diff --git a/.hgignore b/.hgignore index 77e37a7850..b6c427f820 100644 --- a/.hgignore +++ b/.hgignore @@ -4,59 +4,94 @@ autom4te* config.cache config.log config.status -configure -libtool Makefile sdl-config -SDL.spec -SDL.qpg +SDL2.spec build -build-deps + +# for Xcode +*.orig +*.swp +*.tmp +*.rej +*~ +*.o +*.mode1* +*.model* +*.perspective* +*.perspective* +*.pbxuser +(^|/)build($|/) .DS_Store +Xcode/SDL/SDL.xcodeproj/xcuserdata +Xcode/SDL/SDL.xcodeproj/project.xcworkspace +Xcode/SDLTest/SDLTest.xcodeproj/xcuserdata +Xcode/SDLTest/SDLTest.xcodeproj/project.xcworkspace +Xcode-iOS/SDL/SDL.xcodeproj/xcuserdata +Xcode-iOS/SDL/SDL.xcodeproj/project.xcworkspace +Xcode-iOS/Demos/Demos.xcodeproj/xcuserdata +Xcode-iOS/Demos/Demos.xcodeproj/project.xcworkspace + +# for Visual C++ +Debug +Release +*.user +*.ncb +*.suo +*.sdf + +# for Android +android-project/local.properties + sdl.pc -include/SDL_config.h -test/aclocal.m4 test/autom4te* test/config.cache test/config.log test/config.status -test/configure test/Makefile -test/SDL.dll -test/stdout.txt -test/stderr.txt +test/SDL2.dll test/checkkeys -test/graywin test/loopwave -test/testpower -test/testalpha -test/testbitmap -test/testblitspeed -test/testcdrom -test/testdyngl +test/testatomic +test/testaudioinfo +test/testautomation +test/testdraw2 test/testerror test/testfile -test/testgamma -test/testgl -test/testhread +test/testgamecontroller +test/testgesture +test/testgl2 +test/testgles +test/testhaptic test/testiconv +test/testime +test/testintersections test/testjoystick test/testkeys +test/testloadso test/testlock -test/testoverlay +test/testmessage +test/testmultiaudio +test/testnative test/testoverlay2 -test/testpalette test/testplatform +test/testpower +test/testrelative +test/testrendercopyex +test/testrendertarget +test/testresample +test/testrumble +test/testscale test/testsem -test/testsprite +test/testshader +test/testshape +test/testsprite2 +test/testspriteminimal +test/teststreaming +test/testthread test/testtimer test/testver -test/testvidinfo -test/testwin -test/testwm -test/threadwin +test/testwm2 test/torturethread -test/testcursor -test/testloadso test/*.exe test/*.dSYM diff --git a/.hgtags b/.hgtags new file mode 100644 index 0000000000..d5c2200b91 --- /dev/null +++ b/.hgtags @@ -0,0 +1,16 @@ +0afe0e38e02cf2048e93582f01c52fbb91d3c7bb release-1.2.7 +230b156829ed13b31134d96f689c917981f57b84 release-1.2.5 +27cab50ec9c746e886ce0f3fdaa0b0cdc55a594f release-1.2.11 +2fe3fbd2bff50165b3cad33bf40d70b3bb3c9fd0 release-1.2.3 +3c052d3bcc76c899dfd4846be76243a78e8c7180 release-1.2.4 +3c5eed71a3320962551af3b3dfbee0c99fcf0086 release-1.2.10 +4867f7f7dd3426d1dbbeef48b3f3b3aa19590cc4 release-1.2.12 +6e28dae59e3baf4447c83e833a8d2ac912536f5b release-1.2.1 +7c2589fb8d4df54c6faabd3faebd0c0e73f67879 release-1.2.13 +86de11faf082881ad9b73a1a1d78733ca07f8db8 release-1.2.6 +bb051fa871aa0b53ea57df56a446cec3bb85924c release-1.2.2 +cfcb2e1c36ebe9809577adf768b0ec53e8768af9 release-1.2.8 +e044e7c70a50a2f54d14ee20d0933e904e5853b6 release-1.2.9 +f14cf9d71233934811774f941d0de121d5f96ccf release-1.2.14 +39c22a953456f6c9e2c8993c8ff973824104102a pre-touch-removal +ccf5fbfa2afabab429ad911308f362201a94d810 macosx_10_4_supported diff --git a/Android.mk b/Android.mk new file mode 100755 index 0000000000..3230f9feaa --- /dev/null +++ b/Android.mk @@ -0,0 +1,49 @@ +LOCAL_PATH := $(call my-dir) + +########################### +# +# SDL shared library +# +########################### + +include $(CLEAR_VARS) + +LOCAL_MODULE := SDL2 + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include + +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) + +LOCAL_SRC_FILES := \ + $(subst $(LOCAL_PATH)/,, \ + $(wildcard $(LOCAL_PATH)/src/*.c) \ + $(wildcard $(LOCAL_PATH)/src/audio/*.c) \ + $(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \ + $(LOCAL_PATH)/src/atomic/SDL_atomic.c \ + $(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \ + $(wildcard $(LOCAL_PATH)/src/core/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \ + $(wildcard $(LOCAL_PATH)/src/events/*.c) \ + $(wildcard $(LOCAL_PATH)/src/file/*.c) \ + $(wildcard $(LOCAL_PATH)/src/haptic/*.c) \ + $(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \ + $(wildcard $(LOCAL_PATH)/src/joystick/*.c) \ + $(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \ + $(wildcard $(LOCAL_PATH)/src/power/*.c) \ + $(wildcard $(LOCAL_PATH)/src/power/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/render/*.c) \ + $(wildcard $(LOCAL_PATH)/src/render/*/*.c) \ + $(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \ + $(wildcard $(LOCAL_PATH)/src/thread/*.c) \ + $(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \ + $(wildcard $(LOCAL_PATH)/src/timer/*.c) \ + $(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \ + $(wildcard $(LOCAL_PATH)/src/video/*.c) \ + $(wildcard $(LOCAL_PATH)/src/video/android/*.c)) + +LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES +LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog + +include $(BUILD_SHARED_LIBRARY) diff --git a/BUGS b/BUGS deleted file mode 100644 index 218bf3d15b..0000000000 --- a/BUGS +++ /dev/null @@ -1,18 +0,0 @@ - -Bugs are now managed in the SDL bug tracker, here: - - http://bugzilla.libsdl.org/ - -You may report bugs there, and search to see if a given issue has already - been reported, discussed, and maybe even fixed. - - - -You may also find help at the SDL mailing list. Subscription information: - - http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org - -Bug reports are welcome here, but we really appreciate if you use Bugzilla, as - bugs discussed on the mailing list may be forgotten or missed. - - diff --git a/BUGS.txt b/BUGS.txt new file mode 100644 index 0000000000..7ef5538752 --- /dev/null +++ b/BUGS.txt @@ -0,0 +1,16 @@ + +Bugs are now managed in the SDL bug tracker, here: + + http://bugzilla.libsdl.org/ + +You may report bugs there, and search to see if a given issue has already + been reported, discussed, and maybe even fixed. + + +You may also find help on the SDL mailing list. Subscription information: + + http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org + +Bug reports are welcome here, but we really appreciate if you use Bugzilla, as + bugs discussed on the mailing list may be forgotten or missed. + diff --git a/Borland.html b/Borland.html deleted file mode 100644 index eaf82099d6..0000000000 --- a/Borland.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - Building SDL with Borland's C++ compilers - - - - - -

Building SDL with Borland's C++ compilers.

- by David Snopek - and updated by Dominique - Louis ( Last updated : 30th June 2003 ).
-
- These instructions cover how to compile SDL and its included test -programs using either Borland C++ Builder 5, 6 for Windows, - C++ Builder for Linux ( AKA Kylix 3 ) or the free Borland C++ command-line compiler.
- -

Extract the files

- -

Unzip the Borland.zip archive into this directory. Do not unzip - it into any other directory because the makefiles ( *.mak ) and project - files ( *.bpr ) use relative paths to refer to the SDL sources. This should - create a directory named "Borland" inside of the top level SDL source directory. -

- -

Using Borland C++ Builder 5, 6 for Windows -

- -

Inside of the "Borland" directory there is a "bcb6" directory that contains - a number of Builder project files. Double-click on the "libSDL.bpg" file - icon. Once Builder has started click on the "Projects" menu on -the menu-bar and go down to "Build All Projects" option.
- This will proceed to build SDL ( with Borland's calling convention ), -SDLmain, and all the test programs. Currently, all -the test programs are dynamically linked to Sam Lantinga's -SDL.dll.

- -

NOTE : Borland's "lib" format and Microsoft's "lib" format are incompatible. - 
- If you wish to dynamically link to the SDL library supplied by Sam Lantinga - in each release, I have created the correct *.libs for SDL 1.2.4 and they - exist in the "/lib" directory.
- If you would like to create the *.lib files yourself, you will need to -make use of Borland's "implib.exe" utility.
-

- -

IMPLIB works like this:

- -
    IMPLIB (destination lib name) (source dll)
- -

For example,

- -
    IMPLIB SDL.lib SDL.dll
- -

This assumes that SDL.dll was compiled with Visual C++ or similar.
-

- -

To learn more about the difference between Borland's and Microsoft's *.lib - format please read the article here.
-

- -


- NOTE :
The C++ Builder for Windows project format, is not compatible - with the Kylix 3 project format, hence the reason why they are in separate - directories.

- -

Using the free Borland C++ command-line compiler -

- -

The free Borland compiler can be downloaded at no charge from the Borland website - . Make sure that it is installed and properly configured.

- -

Open an MS-DOS Prompt. Change to the "Borland\freebcc" directory under - the SDL source directory. Type "make -f SDL.mak" to build SDL and "make - -f SDLmain.mak". There are also makefiles for all of the test programs, if you wish to build them. All .exes and -DLLs are created in the "test" SDL directory. Ify ou would like to create -the DLL and all the test applications, I have thrown together a basic batchfile -called "makeall.bat" which should create everything in the right order.

- -

Output files

- No matter which compiler you used, three important files should have - been produced: - - Both of the *.lib files will need to be added to all the projects -that use SDL and SDL.dll must be placed some where the Windows dynamic -linker can find it (either in your project directory or on the system -path, C:\WINDOWS\SYSTEM). -

Using Borland C++ Builder for Linux ( AKA Kylix - 3 )

- -

Inside of the "Borland" directory there is a "k3" directory that contains - a number of Builder project files. Double-click on the "libSDL.bpg" file - icon. Once Builder has started click on the "Projects" menu on -the menu-bar and go down to "Build All Projects" option. This will -proceed to build all the test programs
- Linux users do not need *.lib files as the Shared Object is linked right - into the project ( very neat actually, Windows should do this sort of thing - as it is a lot easier for the developer ).
- NOTE : The C++ Builder for Windows project format, is not - compatible with the Kylix 3 project format, hence the reason why they are - in separate directories.

- -

On Mandrake 8.1 the shared objects for SDL are located in the /usr/lib - directory as libSDL_*.so and the Mesa OpenGL shared objects are located -in /usr/X11R6/lib as libGL*.so
-
- So if your setup is different you may need to change the project file - so that they re-link to the ones on your system.
-
- On Mandrake 8.1 the headers files are located at /usr/include/SDL/. - So if you you have not installed the development RPMs ( usually named libSDL-devel* - ) for SDL ( not included ) you may have to change the include directory - within some of the projects.
-

- -

Known Problems

- The only known problem is that I ( Dominique Louis ), was unable to -create the projects that rebuilt the SDL shared objects under Linux, due -to time constraints and my lack of intimate knowledge of Linux. -

Test programs

- Some of the test programs require included media files ( *.wav; *.bmp -etc ). All the test programs are now created in the "test" directory, where -the media files are ( usually ) so they should be ready to go.
-
-
-
- - diff --git a/Borland.zip b/Borland.zip deleted file mode 100644 index ed8f45d27e..0000000000 Binary files a/Borland.zip and /dev/null differ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..925392ebb0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,1205 @@ +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there") +endif() + +cmake_minimum_required(VERSION 2.6) +project(SDL2 C) +include(CheckFunctionExists) +include(CheckLibraryExists) +include(CheckIncludeFiles) +include(CheckIncludeFile) +include(CheckSymbolExists) +include(CheckCSourceRuns) +include(CheckCCompilerFlag) +include(CheckTypeSize) +include(CheckStructHasMember) +include(CMakeDependentOption) +include(FindPkgConfig) +set(CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake") +include(${SDL2_SOURCE_DIR}/cmake/macros.cmake) +include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) + +# General settings +# Edit include/SDL_version.h and change the version, then: +# SDL_MICRO_VERSION += 1; +# SDL_INTERFACE_AGE += 1; +# SDL_BINARY_AGE += 1; +# if any functions have been added, set SDL_INTERFACE_AGE to 0. +# if backwards compatibility has been broken, +# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0. +set(SDL_MAJOR_VERSION 2) +set(SDL_MINOR_VERSION 0) +set(SDL_MICRO_VERSION 0) +set(SDL_INTERFACE_AGE 0) +set(SDL_BINARY_AGE 0) +set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") + +# Calculate a libtool-like version number +math(EXPR LT_CURRENT "${SDL_MICRO_VERSION} - ${SDL_INTERFACE_AGE}") +math(EXPR LT_AGE "${SDL_BINARY_AGE} - ${SDL_INTERFACE_AGE}") +set(LT_REVISION "${SDL_INTERFACE_AGE}") +set(LT_RELEASE "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}") +set(LT_VERSION "${LT_CURRENT}.${LT_REVISION}.${LT_AGE}") + +# General settings & flags +set(LIBRARY_OUTPUT_DIRECTORY "build") +# Check for 64 or 32 bit +set(SIZEOF_VOIDP ${CMAKE_SIZEOF_VOID_P}) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(ARCH_64 TRUE) + set(PROCESSOR_ARCH "x64") +else() + set(ARCH_64 FALSE) + set(PROCESSOR_ARCH "x86") +endif(CMAKE_SIZEOF_VOID_P EQUAL 8) +set(LIBNAME SDL2) +if(NOT LIBTYPE) + set(LIBTYPE SHARED) +endif(NOT LIBTYPE) + +# Get the platform +if(WIN32) + if(NOT WINDOWS) + set(WINDOWS TRUE) + endif(NOT WINDOWS) +elseif(UNIX AND NOT APPLE) + if(CMAKE_SYSTEM_NAME MATCHES ".*Linux") + set(LINUX TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*") + set(FREEBSD TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") + set(NETBSD TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") + set(OPENBSD TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*") + set(GNU TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") + set(BSDI TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD") + set(FREEBSD TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*") + set(SYSV5 TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*") + set(SOLARIS TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*") + set(HPUX TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*") + set(AIX TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*") + set(MINIX TRUE) + endif() +elseif(APPLE) + if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*") + set(DARWIN TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*") + set(MACOSX TRUE) + endif() + # TODO: iOS? +elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*|BeOS.*") + set(BEOS TRUE) +endif() + +# Don't mistake osx for unix +if(UNIX AND NOT APPLE) + set(UNIX_SYS ON) +else() + set(UNIX_SYS OFF) +endif(UNIX AND NOT APPLE) + +if(UNIX OR APPLE) + set(UNIX_OR_MAC_SYS ON) +else() + set(UNIX_OR_MAC_SYS OFF) +endif(UNIX OR APPLE) + +# Default option knobs +if(APPLE OR ARCH_64) + set(OPT_DEF_SSEMATH ON) +endif() +if(UNIX OR MINGW OR MSYS) + set(OPT_DEF_LIBC ON) +endif(UNIX OR MINGW OR MSYS) + +# Compiler info +if(CMAKE_COMPILER_IS_GNUCC) + set(USE_GCC TRUE) + set(OPT_DEF_ASM TRUE) +elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") + set(USE_CLANG TRUE) + set(OPT_DEF_ASM TRUE) +elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+ + set(OPT_DEF_ASM TRUE) + #set(CMAKE_C_FLAGS "/ZI /WX- / +else() + set(OPT_DEF_ASM FALSE) +endif(CMAKE_COMPILER_IS_GNUCC) + +# Default flags, if not set otherwise +if("$ENV{CFLAGS}" STREQUAL "") + if(USE_GCC OR USE_CLANG) + set(CMAKE_C_FLAGS "-g -O3") + endif(USE_GCC OR USE_CLANG) +else("$ENV{CFLAGS}" STREQUAL "") + set(CMAKE_C_FLAGS "$ENV{CFLAGS}") + list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}") +endif("$ENV{CFLAGS}" STREQUAL "") +if(NOT ("$ENV{CFLAGS}" STREQUAL "")) # Hackish, but does the trick on Win32 + list(APPEND EXTRA_LDFLAGS "$ENV{LDFLAGS}") +endif(NOT ("$ENV{CFLAGS}" STREQUAL "")) + +# Those are used for pkg-config and friends, so that the SDL2.pc, sdl2-config, +# etc. are created correctly. +set(SDL_LIBS "-lSDL2") +set(SDL_CFLAGS "") + +if(CYGWIN) + # We build SDL on cygwin without the UNIX emulation layer + include_directories("-I/usr/include/mingw") + set(CMAKE_REQUIRED_FLAGS "-mno-cygwin") + check_c_source_compiles("int main(int argc, char **argv) {}" + HAVE_GCC_NO_CYGWIN) + set(CMAKE_REQUIRED_FLAGS) + if(HAVE_GCC_NO_CYGWIN) + list(APPEND EXTRA_LDFLAGS "-mno-cygwin") + list(APPEND SDL_LIBS "-mno-cygwin") + endif(HAVE_GCC_NO_CYGWIN) + set(SDL_CFLAGS "${SDL_CFLAGS} -I/usr/include/mingw") +endif(CYGWIN) + +add_definitions(-DUSING_GENERATED_CONFIG_H) +# General includes +include_directories(${SDL2_BINARY_DIR}/include ${SDL2_SOURCE_DIR}/include) + +set(SDL_SUBSYSTEMS + Atomic Audio Video Render Events Joystick Haptic Power Threads Timers + File Loadso CPUinfo) +foreach(_SUB ${SDL_SUBSYSTEMS}) + string(TOUPPER ${_SUB} _OPT) + option(SDL_${_OPT} "Enable the ${_SUB} subsystem" ON) +endforeach() + +option_string(ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto") +#set_option(DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON) +set_option(LIBC "Use the system C library" ${OPT_DEF_LIBC}) +set_option(GCC_ATOMICS "Use gcc builtin atomics" ${USE_GCC}) +set_option(ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM}) +set_option(SSEMATH "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH}) +set_option(MMX "Use MMX assembly routines" ${OPT_DEF_ASM}) +set_option(3DNOW "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM}) +set_option(SSE "Use SSE assembly routines" ${OPT_DEF_ASM}) +set_option(SSE2 "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH}) +set_option(ALTIVEC "Use Altivec assembly routines" ${OPT_DEF_ASM}) +set_option(DISKAUDIO "Support the disk writer audio driver" ON) +set_option(DUMMYAUDIO "Support the dummy audio driver" ON) +set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF) +dep_option(DIRECTFB_SHARED "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF) +set_option(FUSIONSOUND "Use FusionSound audio driver" OFF) +dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND_SHARED" OFF) +set_option(VIDEO_DUMMY "Use dummy video driver" ON) +set_option(VIDEO_OPENGL "Include OpenGL support" ON) +set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON) +set_option(PTHREADS "Use POSIX threads for multi-threading" ${UNIX_OR_MAC_SYS}) +dep_option(PTHREADS_SEM "Use pthread semaphores" ON "PTHREADS" OFF) +set_option(SDL_DLOPEN "Use dlopen for shared object loading" ON) +set_option(OSS "Support the OSS audio API" ${UNIX_SYS}) +set_option(ALSA "Support the ALSA audio API" ${UNIX_SYS}) +dep_option(ALSA_SHARED "Dynamically load ALSA audio support" ON "ALSA" OFF) +set_option(ESD "Support the Enlightened Sound Daemon" ${UNIX_SYS}) +dep_option(ESD_SHARED "Dynamically load ESD audio support" ON "ESD" OFF) +set_option(PULSEAUDIO "Use PulseAudio" ${UNIX_SYS}) +dep_option(PULSEAUDIO_SHARED "Dynamically load PulseAudio support" ON "PULSEAUDIO" OFF) +set_option(ARTS "Support the Analog Real Time Synthesizer" ${UNIX_SYS}) +dep_option(ARTS_SHARED "Dynamically load aRts audio support" ON "ARTS" OFF) +set_option(NAS "Support the NAS audio API" ${UNIX_SYS}) +set_option(SNDIO "Support the sndio audio API" ${UNIX_SYS}) +set_option(RPATH "Use an rpath when linking SDL" ${UNIX_SYS}) +set_option(CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" OFF) +set_option(INPUT_TSLIB "Use the Touchscreen library for input" ${UNIX_SYS}) +set_option(VIDEO_X11 "Use X11 video driver" ${UNIX_SYS}) +dep_option(X11_SHARED "Dynamically load X11 support" ON "VIDEO_X11" OFF) +set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm) +foreach(_SUB ${SDL_X11_OPTIONS}) + string(TOUPPER "VIDEO_X11_${_SUB}" _OPT) + dep_option(${_OPT} "Enable ${_SUB} support" ON "VIDEO_X11" OFF) +endforeach() +set_option(VIDEO_COCOA "Use Cocoa video driver" ${APPLE}) +set_option(DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS}) +set_option(RENDER_D3D "Enable the Direct3D render driver" ${WINDOWS}) + +# TODO: We should (should we?) respect cmake's ${BUILD_SHARED_LIBS} flag here +# The options below are for compatibility to configure's default behaviour. +set(SDL_SHARED ON CACHE BOOL "Build a shared version of the library") +set(SDL_STATIC ON CACHE BOOL "Build a static version of the library") + +# General source files +file(GLOB SOURCE_FILES + ${SDL2_SOURCE_DIR}/src/*.c + ${SDL2_SOURCE_DIR}/src/atomic/*.c + ${SDL2_SOURCE_DIR}/src/audio/*.c + ${SDL2_SOURCE_DIR}/src/cpuinfo/*.c + ${SDL2_SOURCE_DIR}/src/events/*.c + ${SDL2_SOURCE_DIR}/src/file/*.c + ${SDL2_SOURCE_DIR}/src/libm/*.c + ${SDL2_SOURCE_DIR}/src/render/*.c + ${SDL2_SOURCE_DIR}/src/render/*/*.c + ${SDL2_SOURCE_DIR}/src/stdlib/*.c + ${SDL2_SOURCE_DIR}/src/thread/*.c + ${SDL2_SOURCE_DIR}/src/timer/*.c + ${SDL2_SOURCE_DIR}/src/video/*.c) + + +if(ASSERTIONS STREQUAL "auto") + # Do nada - use optimization settings to determine the assertion level +elseif(ASSERTIONS STREQUAL "disabled") + set(SDL_DEFAULT_ASSERT_LEVEL 0) +elseif(ASSERTIONS STREQUAL "release") + set(SDL_DEFAULT_ASSERT_LEVEL 1) +elseif(ASSERTIONS STREQUAL "enabled") + set(SDL_DEFAULT_ASSERT_LEVEL 2) +elseif(ASSERTIONS STREQUAL "paranoid") + set(SDL_DEFAULT_ASSERT_LEVEL 3) +else() + message_error("unknown assertion level") +endif(ASSERTIONS STREQUAL "auto") +set(HAVE_ASSERTIONS ${ASSERTIONS}) + +# Compiler option evaluation +if(USE_GCC) + if(DEPENDENCY_TRACKING) + check_c_source_compiles(" + #if !defined(__GNUC__) || __GNUC__ < 3 + #error Dependency tracking requires GCC 3.0 or newer + #endif + int main(int argc, char **argv) { }" HAVE_DEPENDENCY_TRACKING) + endif(DEPENDENCY_TRACKING) + + if(GCC_ATOMICS) + check_c_source_compiles("int main(int argc, char **argv) { + int a; + void *x, *y, *z; + __sync_lock_test_and_set(&a, 4); + __sync_lock_test_and_set(&x, y); + __sync_fetch_and_add(&a, 1); + __sync_bool_compare_and_swap(&a, 5, 10); + __sync_bool_compare_and_swap(&x, y, z); }" HAVE_GCC_ATOMICS) + if(NOT HAVE_GCC_ATOMICS) + check_c_source_compiles("int main(int argc, char **argv) { + int a; + __sync_lock_test_and_set(&a, 1); + __sync_lock_release(&a); }" HAVE_GCC_SYNC_LOCK_TEST_AND_SET) + endif(NOT HAVE_GCC_ATOMICS) + endif(GCC_ATOMICS) + + set(CMAKE_REQUIRED_FLAGS "-mpreferred-stack-boundary=2") + check_c_source_compiles("int x = 0; int main(int argc, char **argv) {}" + HAVE_GCC_PREFERRED_STACK_BOUNDARY) + set(CMAKE_REQUIRED_FLAGS) + + set(CMAKE_REQUIRED_FLAGS "-fvisibility=hidden -Werror") + check_c_source_compiles(" + #if !defined(__GNUC__) || __GNUC__ < 4 + #error SDL only uses visibility attributes in GCC 4 or newer + #endif + int main(int argc, char **argv) {}" HAVE_GCC_FVISIBILITY) + if(HAVE_GCC_FVISIBILITY) + list(APPEND EXTRA_CFLAGS "-fvisibility=hidden") + endif(HAVE_GCC_FVISIBILITY) + set(CMAKE_REQUIRED_FLAGS) + + check_c_compiler_flag(-Wall HAVE_GCC_WALL) + if(HAVE_GCC_WALL) + if(CMAKE_SYSTEM_NAME MATCHES "Haiku|BeOS") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar") + endif(CMAKE_SYSTEM_NAME MATCHES "Haiku|BeOS") + endif(HAVE_GCC_WALL) +endif(USE_GCC) + +if(ASSEMBLY) + if(USE_GCC OR USE_CLANG) + set(SDL_ASSEMBLY_ROUTINES 1) + # TODO: Those all seem to be quite GCC specific - needs to be + # reworked for better compiler support + set(HAVE_ASSEMBLY TRUE) + if(MMX) + set(CMAKE_REQUIRED_FLAGS "-mmmx") + check_c_source_compiles(" + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __MMX__ + #error Assembler CPP flag not enabled + #endif + int main(int argc, char **argv) { }" HAVE_MMX) + if(HAVE_MMX) + list(APPEND EXTRA_CFLAGS "-mmmx") + endif(HAVE_MMX) + set(CMAKE_REQUIRED_FLAGS) + endif(MMX) + + if(3DNOW) + set(CMAKE_REQUIRED_FLAGS "-m3dnow") + check_c_source_compiles(" + #include + #ifndef __3dNOW__ + #error Assembler CPP flag not enabled + #endif + int main(int argc, char **argv) { + void *p = 0; + _m_prefetch(p); + }" HAVE_3DNOW) + if(HAVE_3DNOW) + list(APPEND EXTRA_CFLAGS "-m3dnow") + endif(HAVE_3DNOW) + set(CMAKE_REQUIRED_FLAGS) + endif(3DNOW) + + if(SSE) + set(CMAKE_REQUIRED_FLAGS "-msse") + check_c_source_compiles(" + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __SSE__ + #error Assembler CPP flag not enabled + #endif + int main(int argc, char **argv) { }" HAVE_SSE) + if(HAVE_SSE) + list(APPEND EXTRA_CFLAGS "-msse") + endif(HAVE_SSE) + set(CMAKE_REQUIRED_FLAGS) + endif(SSE) + + if(SSE2) + set(CMAKE_REQUIRED_FLAGS "-msse2") + check_c_source_compiles(" + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __SSE2__ + #error Assembler CPP flag not enabled + #endif + int main(int argc, char **argv) { }" HAVE_SSE2) + if(HAVE_SSE2) + list(APPEND EXTRA_CFLAGS "-msse2") + endif(HAVE_SSE2) + set(CMAKE_REQUIRED_FLAGS) + endif(SSE2) + + if(SSEMATH) + if(SSE OR SSE2) + if(USE_GCC) + list(APPEND EXTRA_CFLAGS "-mfpmath=387") + endif(USE_GCC) + set(HAVE_SSEMATH TRUE) + endif(SSE OR SSE2) + endif(SSEMATH) + + if(ALTIVEC) + set(CMAKE_REQUIRED_FLAGS "-maltivec") + check_c_source_compiles(" + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + int main(int argc, char **argv) { }" HAVE_ALTIVEC_H_HDR) + check_c_source_compiles(" + vector unsigned int vzero() { + return vec_splat_u32(0); + } + int main(int argc, char **argv) { }" HAVE_ALTIVEC) + set(CMAKE_REQUIRED_FLAGS) + if(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR) + set(HAVE_ALTIVEC TRUE) # if only HAVE_ALTIVEC_H_HDR is set + list(APPEND EXTRA_CFLAGS "-maltivec") + set(SDL_ALTIVEC_BLITTERS 1) + if(HAVE_ALTIVEC_H_HDR) + set(HAVE_ALTIVEC_H 1) + endif(HAVE_ALTIVEC_H_HDR) + endif(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR) + endif(ALTIVEC) + elseif(MSVC_VERSION GREATER 1500) + # TODO: SDL_cpuinfo.h needs to support the user's configuration wish + # for MSVC - right now it is always activated + if(NOT ARCH_64) + set(HAVE_MMX TRUE) + set(HAVE_3DNOW TRUE) + endif(NOT ARCH_64) + set(HAVE_SSE TRUE) + set(HAVE_SSE2 TRUE) + set(SDL_ASSEMBLY_ROUTINES 1) + endif(USE_GCC OR USE_CLANG) +# TODO: +#else(ASSEMBLY) +# if(USE_GCC OR USE_CLANG) +# list(APPEND EXTRA_CFLAGS "-mno-sse" "-mno-sse2" "-mno-mmx") +# endif(USE_GCC OR USE_CLANG) +endif(ASSEMBLY) + +# TODO: Can't deactivate on FreeBSD? w/o LIBC, SDL_stdinc.h can't define +# anything. +if(LIBC) + if(WINDOWS AND NOT MINGW) + set(HAVE_LIBC TRUE) + foreach(_HEADER stdio.h string.h ctype.h math.h) + string(TOUPPER "HAVE_${_HEADER}" _UPPER) + string(REPLACE "." "_" _HAVE_H ${_UPPER}) + set(${_HAVE_H} 1) + endforeach() + set(HAVE_SIGNAL_H 1) + foreach(_FN + malloc calloc realloc free qsort abs memset memcpy memmove memcmp + strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa + _ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp + _stricmp _strnicmp sscanf atan atan2 ceil copysign cos cosf fabs + floor log pow scalbn sin sinf sqrt) + string(TOUPPER ${_FN} _UPPER) + set(HAVE_${_UPPER} 1) + endforeach() + if(NOT CYGWIN AND NOT MINGW) + set(HAVE_ALLOCA 1) + endif(NOT CYGWIN AND NOT MINGW) + set(HAVE_M_PI 1) + add_definitions(-D_USE_MATH_DEFINES) # needed for M_PI + set(STDC_HEADERS 1) + else(WINDOWS AND NOT MINGW) + set(HAVE_LIBC TRUE) + check_include_file(sys/types.h HAVE_SYS_TYPES_H) + foreach(_HEADER + stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h + strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h) + string(TOUPPER "HAVE_${_HEADER}" _UPPER) + string(REPLACE "." "_" _HAVE_H ${_UPPER}) + check_include_file("${_HEADER}" ${_HAVE_H}) + endforeach() + + check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" STDC_HEADERS) + check_type_size("size_t" SIZEOF_SIZE_T) + check_symbol_exists(M_PI math.h HAVE_M_PI) + # TODO: refine the mprotect check + check_c_source_compiles("#include + #include + int main() { }" HAVE_MPROTECT) + foreach(_FN + strtod malloc calloc realloc free getenv setenv putenv unsetenv + qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat + strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa + _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull + atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp + sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp + nanosleep sysconf sysctlbyname + ) + string(TOUPPER ${_FN} _UPPER) + set(_HAVEVAR "HAVE_${_UPPER}") + check_function_exists("${_FN}" ${_HAVEVAR}) + endforeach() + + check_library_exists(m pow "" HAVE_LIBM) + if(HAVE_LIBM) + set(CMAKE_REQUIRED_LIBRARIES m) + foreach(_FN + atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin + sinf sqrt) + string(TOUPPER ${_FN} _UPPER) + set(_HAVEVAR "HAVE_${_UPPER}") + check_function_exists("${_FN}" ${_HAVEVAR}) + endforeach() + set(CMAKE_REQUIRED_LIBRARIES) + list(APPEND EXTRA_LIBS m) + endif(HAVE_LIBM) + + check_library_exists(iconv iconv_open "" HAVE_LIBICONV) + if(HAVE_LIBICONV) + list(APPEND EXTRA_LIBS iconv) + endif(HAVE_LIBICONV) + + check_struct_has_member("struct sigaction" "sa_sigaction" "signal.h" HAVE_SA_SIGACTION) + endif(WINDOWS AND NOT MINGW) +else(LIBC) + if(WINDOWS) + set(HAVE_STDARG_H 1) + set(HAVE_STDDEF_H 1) + endif(WINDOWS) +endif(LIBC) + + +# Enable/disable various subsystems of the SDL library +foreach(_SUB ${SDL_SUBSYSTEMS}) + string(TOUPPER ${_SUB} _OPT) + if(NOT SDL_${_OPT}) + set(SDL_${_OPT}_DISABLED 1) + endif(NOT SDL_${_OPT}) +endforeach() +if(SDL_JOYSTICK) + file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) +endif(SDL_JOYSTICK) +if(SDL_HAPTIC) + if(NOT SDL_JOYSTICK) + # Haptic requires some private functions from the joystick subsystem. + message_error("SDL_HAPTIC requires SDL_JOYSTICK, which is not enabled") + endif(NOT SDL_JOYSTICK) + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) +endif(SDL_HAPTIC) +if(SDL_POWER) + file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) +endif(SDL_POWER) +# TODO: in configure.in, the test for LOADSO and SDL_DLOPEN is a bit weird: +# if LOADSO is not wanted, SDL_LOADSO_DISABLED is set +# If however on Unix or APPLE dlopen() is detected via CheckDLOPEN(), +# SDL_LOADSO_DISABLED will not be set, regardless of the LOADSO settings + +# General SDL subsystem options, valid for all platforms +if(SDL_AUDIO) + # CheckDummyAudio/CheckDiskAudio - valid for all platforms + if(DUMMYAUDIO) + set(SDL_AUDIO_DRIVER_DUMMY 1) + file(GLOB DUMMYAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dummy/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${DUMMYAUDIO_SOURCES}) + set(HAVE_DUMMYAUDIO TRUE) + endif(DUMMYAUDIO) + if(DISKAUDIO) + set(SDL_AUDIO_DRIVER_DISK 1) + file(GLOB DISKAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/disk/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${DISKAUDIO_SOURCES}) + set(HAVE_DISKAUDIO TRUE) + endif(DISKAUDIO) +endif(SDL_AUDIO) + +if(SDL_DLOPEN) + # Relevant for Unix/Darwin only + if(UNIX OR APPLE) + CheckDLOPEN() + endif(UNIX OR APPLE) +endif(SDL_DLOPEN) + +if(SDL_VIDEO) + if(VIDEO_DUMMY) + set(SDL_VIDEO_DRIVER_DUMMY 1) + file(GLOB VIDEO_DUMMY_SOURCES ${SDL2_SOURCE_DIR}/src/video/dummy/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${VIDEO_DUMMY_SOURCES}) + set(HAVE_VIDEO_DUMMY TRUE) + set(HAVE_SDL_VIDEO TRUE) + endif(VIDEO_DUMMY) +endif(SDL_VIDEO) + +# Platform-specific options and settings +if(UNIX AND NOT APPLE) + if(SDL_AUDIO) + if(SYSV5 OR SOLARIS OR HPUX) + set(SDL_AUDIO_DRIVER_SUNAUDIO 1) + file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${SUN_AUDIO_SOURCES}) + set(HAVE_SDL_AUDIO TRUE) + elseif(NETBSD OR OPENBSD) + set(SDL_AUDIO_DRIVER_BSD 1) + file(GLOB BSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/bsd/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${BSD_AUDIO_SOURCES}) + set(HAVE_SDL_AUDIO TRUE) + elseif(AIX) + set(SDL_AUDIO_DRIVER_PAUDIO 1) + file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${AIX_AUDIO_SOURCES}) + set(HAVE_SDL_AUDIO TRUE) + endif() + CheckOSS() + CheckALSA() + CheckPulseAudio() + CheckESD() + CheckARTS() + CheckNAS() + CheckSNDIO() + CheckFusionSound() + endif(SDL_AUDIO) + + if(SDL_VIDEO) + CheckX11() + CheckDirectFB() + CheckOpenGLX11() + CheckOpenGLESX11() + endif(SDL_VIDEO) + + if(LINUX) + check_c_source_compiles(" + #include + #ifndef EVIOCGNAME + #error EVIOCGNAME() ioctl not available + #endif + int main(int argc, char** argv) {}" HAVE_INPUT_EVENTS) + if(HAVE_INPUT_EVENTS) + set(SDL_INPUT_LINUXEV 1) + endif(HAVE_INPUT_EVENTS) + + if(SDL_HAPTIC AND HAVE_INPUT_EVENTS) + set(SDL_HAPTIC_LINUX 1) + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) + set(HAVE_SDL_HAPTIC TRUE) + endif(SDL_HAPTIC AND HAVE_INPUT_EVENTS) + + check_include_file("libudev.h" HAVE_LIBUDEV_H) + + # !!! FIXME: this needs pkg-config to find the include path, I think. + check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H) + endif(LINUX) + + if(INPUT_TSLIB) + check_c_source_compiles(" + #include \"tslib.h\" + int main(int argc, char** argv) { }" HAVE_INPUT_TSLIB) + if(HAVE_INPUT_TSLIB) + set(SDL_INPUT_TSLIB 1) + list(APPEND EXTRA_LIBS ts) + endif(HAVE_INPUT_TSLIB) + endif(INPUT_TSLIB) + + if(SDL_JOYSTICK) + CheckUSBHID() # seems to be BSD specific - limit the test to BSD only? + if(LINUX) + set(SDL_JOYSTICK_LINUX 1) + file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) + set(HAVE_SDL_JOYSTICK TRUE) + endif(LINUX) + endif(SDL_JOYSTICK) + + CheckPTHREAD() + + if(CLOCK_GETTIME) + check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME) + if(FOUND_CLOCK_GETTIME) + list(APPEND EXTRA_LIBS rt) + set(HAVE_CLOCK_GETTIME 1) + else(FOUND_CLOCK_GETTIME) + check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME) + if(FOUND_CLOCK_GETTIME) + set(HAVE_CLOCK_GETTIME 1) + endif(FOUND_CLOCK_GETTIME) + endif(HAVE_CLOCK_GETTIME) + endif(CLOCK_GETTIME) + + check_include_file(linux/version.h HAVE_LINUX_VERSION_H) + if(HAVE_LINUX_VERSION_H) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LINUX_VERSION_H") + endif(HAVE_LINUX_VERSION_H) + + if(SDL_POWER) + if(LINUX) + set(SDL_POWER_LINUX 1) + file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/linux/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) + set(HAVE_SDL_POWER TRUE) + endif(LINUX) + endif(SDL_POWER) + + if(SDL_TIMERS) + set(SDL_TIMER_UNIX 1) + file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES}) + set(HAVE_SDL_TIMERS TRUE) + endif(SDL_TIMERS) + + if(RPATH) + set(SDL_RLD_FLAGS "") + if(BSDI OR FREEBSD OR LINUX OR NETBSD) + set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}") + elseif(SOLARIS) + set(SDL_RLD_FLAGS "-R\${libdir}") + endif() + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + set(HAVE_RPATH TRUE) + endif(RPATH) + +elseif(WINDOWS) + find_program(WINDRES windres) + + check_c_source_compiles(" + #include + int main(int argc, char **argv) { }" HAVE_WIN32_CC) + + file(GLOB WIN_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${WIN_SOURCES}) + + # Check for DirectX + if(DIRECTX) + if("$ENV{DXSDK_DIR}" STREQUAL "") + message_error("DIRECTX requires the \$DXSDK_DIR environment variable to be set") + endif("$ENV{DXSDK_DIR}" STREQUAL "") + set(CMAKE_REQUIRED_FLAGS "/I\"$ENV{DXSDK_DIR}\\Include\"") + check_include_file(d3d9.h HAVE_D3D_H) + check_include_file(ddraw.h HAVE_DDRAW_H) + check_include_file(dsound.h HAVE_DSOUND_H) + check_include_file(dinput.h HAVE_DINPUT_H) + check_include_file(xaudio2.h HAVE_XAUDIO2_H) + if(HAVE_D3D_H OR HAVE_DDRAW_H OR HAVE_DSOUND_H OR HAVE_DINPUT_H OR HAVE_XAUDIO2_H) + set(HAVE_DIRECTX TRUE) + # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks + link_directories($ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}) + include_directories($ENV{DXSDK_DIR}\\Include) + endif() + set(CMAKE_REQUIRED_FLAGS) + endif(DIRECTX) + + if(SDL_AUDIO) + set(SDL_AUDIO_DRIVER_WINMM 1) + file(GLOB WINMM_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/winmm/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${WINMM_AUDIO_SOURCES}) + set(HAVE_SDL_AUDIO TRUE) + + if(HAVE_DSOUND_H) + set(SDL_AUDIO_DRIVER_DSOUND 1) + file(GLOB DSOUND_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/directsound/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${DSOUND_AUDIO_SOURCES}) + endif(HAVE_DSOUND_H) + + if(HAVE_XAUDIO2_H) + set(SDL_AUDIO_DRIVER_XAUDIO2 1) + file(GLOB XAUDIO2_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/xaudio2/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${XAUDIO2_AUDIO_SOURCES}) + endif(HAVE_XAUDIO2_H) + endif(SDL_AUDIO) + + if(SDL_VIDEO) + # requires SDL_LOADSO on Windows (IME, DX, etc.) + if(NOT SDL_LOADSO) + message_error("SDL_VIDEO requires SDL_LOADSO, which is not enabled") + endif(NOT SDL_LOADSO) + set(SDL_VIDEO_DRIVER_WINDOWS 1) + file(GLOB WIN_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/windows/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${WIN_VIDEO_SOURCES}) + + if(RENDER_D3D AND HAVE_D3D_H) + set(SDL_VIDEO_RENDER_D3D 1) + set(HAVE_RENDER_D3D TRUE) + endif(RENDER_D3D AND HAVE_D3D_H) + set(HAVE_SDL_VIDEO TRUE) + endif(SDL_VIDEO) + + if(SDL_THREADS) + set(SDL_THREAD_WINDOWS 1) + set(SOURCE_FILES ${SOURCE_FILES} + ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c + ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_syssem.c + ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systhread.c + ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systls.c + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c) + set(HAVE_SDL_THREADS TRUE) + endif(SDL_THREADS) + + if(SDL_POWER) + set(SDL_POWER_WINDOWS 1) + set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/power/windows/SDL_syspower.c) + set(HAVE_SDL_POWER TRUE) + endif(SDL_POWER) + + # Libraries for Win32 native and MinGW + list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid) + + # TODO: in configure.in the check for timers is set on + # cygwin | mingw32* - does this include mingw32CE? + if(SDL_TIMERS) + set(SDL_TIMER_WINDOWS 1) + file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/windows/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES}) + set(HAVE_SDL_TIMERS TRUE) + endif(SDL_TIMERS) + + if(SDL_LOADSO) + set(SDL_LOADSO_WINDOWS 1) + file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/windows/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES}) + set(HAVE_SDL_LOADSO TRUE) + endif(SDL_LOADSO) + + file(GLOB CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/windows/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${CORE_SOURCES}) + + if(SDL_VIDEO) + if(VIDEO_OPENGL) + set(SDL_VIDEO_OPENGL 1) + set(SDL_VIDEO_OPENGL_WGL 1) + set(SDL_VIDEO_RENDER_OGL 1) + set(HAVE_VIDEO_OPENGL TRUE) + endif(VIDEO_OPENGL) + endif(SDL_VIDEO) + + if(SDL_JOYSTICK) + if(HAVE_DINPUT_H) + set(SDL_JOYSTICK_DINPUT 1) + set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_dxjoystick.c) + list(APPEND EXTRA_LIBS dinput8 dxguid dxerr) + else() + set(SDL_JOYSTICK_WINMM 1) + set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/joystick/windows/SDL_mmjoystick.c) + endif(HAVE_DINPUT_H) + set(HAVE_SDL_JOYSTICK TRUE) + endif(SDL_JOYSTICK) + + if(SDL_HAPTIC AND HAVE_DINPUT_H) + set(SDL_HAPTIC_DINPUT 1) + set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/haptic/windows/SDL_syshaptic.c) + set(HAVE_SDL_HAPTIC TRUE) + endif(SDL_HAPTIC AND HAVE_DINPUT_H) + + file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc) + file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c) + if(MINGW OR CYGWIN) + list(APPEND EXTRA_LIBS mingw32) + list(APPEND EXTRA_LDFLAGS "-mwindows") + set(SDL_CFLAGS "${SDL_CFLAGS} -Dmain=SDL_main") + list(APPEND SDL_LIBS "-lmingw32" "-lSDL2main" "-mwindows") + endif(MINGW OR CYGWIN) +elseif(APPLE) + # TODO: rework this for proper MacOS X, iOS and Darwin support + + # Requires the darwin file implementation + if(SDL_FILE) + file(GLOB EXTRA_SOURCES ${PROJECT_SOURCE_DIR}/src/file/cocoa/*.m) + set(SOURCE_FILES ${EXTRA_SOURCES} ${SOURCE_FILES}) + set_source_files_properties(${EXTRA_SOURCES} PROPERTIES LANGUAGE C) + set(HAVE_SDL_FILE TRUE) + set(SDL_FRAMEWORK_COCOA 1) + else() + message_error("SDL_FILE must be enabled to build on MacOS X") + endif() + + if(SDL_AUDIO) + set(MACOSX_COREAUDIO 1) + file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES}) + set(HAVE_SDL_AUDIO TRUE) + set(SDL_FRAMEWORK_COREAUDIO 1) + set(SDL_FRAMEWORK_AUDIOUNIT 1) + endif() + + if(SDL_JOYSTICK) + set(SDL_JOYSTICK_IOKIT 1) + file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/darwin/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) + set(HAVE_SDL_JOYSTICK TRUE) + set(SDL_FRAMEWORK_IOKIT 1) + set(SDL_FRAMEWORK_FF 1) + endif() + + if(SDL_HAPTIC) + set(SDL_HAPTIC_IOKIT 1) + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/darwin/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) + set(HAVE_SDL_HAPTIC TRUE) + set(SDL_FRAMEWORK_IOKIT 1) + set(SDL_FRAMEWORK_FF 1) + if(NOT SDL_JOYSTICK) + message(FATAL_ERROR "SDL_HAPTIC requires SDL_JOYSTICK to be enabled") + endif() + endif() + + if(SDL_POWER) + set(SDL_POWER_MACOSX 1) + file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/macosx/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${POWER_SOURCES}) + set(HAVE_SDL_POWER TRUE) + set(SDL_FRAMEWORK_CARBON 1) + set(SDL_FRAMEWORK_IOKIT 1) + endif() + + # Actually load the frameworks at the end so we don't duplicate include. + if(SDL_FRAMEWORK_COCOA) + find_library(COCOA_LIBRARY Cocoa) + list(APPEND EXTRA_LIBS ${COCOA_LIBRARY}) + endif() + if(SDL_FRAMEWORK_IOKIT) + find_library(IOKIT IOKit) + list(APPEND EXTRA_LIBS ${IOKIT}) + endif() + if(SDL_FRAMEWORK_FF) + find_library(FORCEFEEDBACK ForceFeedback) + list(APPEND EXTRA_LIBS ${FORCEFEEDBACK}) + endif() + if(SDL_FRAMEWORK_CARBON) + find_library(CARBON_LIBRARY Carbon) + list(APPEND EXTRA_LIBS ${CARBON_LIBRARY}) + endif() + if(SDL_FRAMEWORK_COREAUDIO) + find_library(COREAUDIO CoreAudio) + list(APPEND EXTRA_LIBS ${COREAUDIO}) + endif() + if(SDL_FRAMEWORK_AUDIOUNIT) + find_library(AUDIOUNIT AudioUnit) + list(APPEND EXTRA_LIBS ${AUDIOUNIT}) + endif() + + # iOS hack needed - http://code.google.com/p/ios-cmake/ ? + if(SDL_VIDEO) + CheckCOCOA() + if(VIDEO_OPENGL) + set(SDL_VIDEO_OPENGL 1) + set(SDL_VIDEO_OPENGL_CGL 1) + set(SDL_VIDEO_RENDER_OGL 1) + if(DARWIN) + find_library(OpenGL_LIBRARY OpenGL) + list(APPEND EXTRA_LIBRARIES ${OpenGL_LIBRARY}) + endif(DARWIN) + set(HAVE_VIDEO_OPENGL TRUE) + endif(VIDEO_OPENGL) + endif(SDL_VIDEO) + + CheckPTHREAD() +elseif(BEOS) + if(SDL_VIDEO) + set(SDL_VIDEO_DRIVER_BWINDOW 1) + file(GLOB BWINDOW_SOURCES ${SDL2_SOURCE_DIR}/src/video/bwindow/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${BWINDOW_SOURCES}) + set(HAVE_SDL_VIDEO TRUE) + + if(VIDEO_OPENGL) + # TODO: Use FIND_PACKAGE(OpenGL) instead + set(SDL_VIDEO_OPENGL 1) + set(SDL_VIDEO_OPENGL_BGL 1) + set(SDL_VIDEO_RENDER_OGL 1) + list(APPEND EXTRA_LIBS GL) + set(HAVE_VIDEO_OPENGL TRUE) + endif(VIDEO_OPENGL) + endif(SDL_VIDEO) +endif() + +# Dummies +# configure.in does it differently: +# if not have X +# if enable_X { SDL_X_DISABLED = 1 } +# [add dummy sources] +# so it always adds a dummy, without checking, if it was actually requested. +# This leads to missing internal references on building, since the +# src/X/*.c does not get included. +if(NOT HAVE_SDL_JOYSTICK) + set(SDL_JOYSTICK_DISABLED 1) + if(SDL_JOYSTICK AND NOT APPLE) # results in unresolved symbols on OSX + + file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/dummy/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) + endif() +endif(NOT HAVE_SDL_JOYSTICK) +if(NOT HAVE_SDL_HAPTIC) + set(SDL_HAPTIC_DISABLED 1) + file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES}) +endif(NOT HAVE_SDL_HAPTIC) +if(NOT HAVE_SDL_LOADSO) + set(SDL_LOADSO_DISABLED 1) + file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dummy/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${JOYSTICK_SOURCES}) +endif(NOT HAVE_SDL_LOADSO) + +# We always need to have threads and timers around +if(NOT HAVE_SDL_THREADS) + set(SDL_THREADS_DISABLED 1) + file(GLOB THREADS_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${THREADS_SOURCES}) +endif(NOT HAVE_SDL_THREADS) +if(NOT HAVE_SDL_TIMERS) + set(SDL_TIMERS_DISABLED 1) + file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/dummy/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES}) +endif(NOT HAVE_SDL_TIMERS) + +if(NOT SDLMAIN_SOURCES) + file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c) +endif(NOT SDLMAIN_SOURCES) + +# Append the -MMD -MT flags +# if(DEPENDENCY_TRACKING) +# if(COMPILER_IS_GNUCC) +# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MMD -MT \$@") +# endif(COMPILER_IS_GNUCC) +# endif(DEPENDENCY_TRACKING) + +configure_file("${SDL2_SOURCE_DIR}/include/SDL_config.h.cmake" + "${SDL2_BINARY_DIR}/include/SDL_config.h") + +# Prepare the flags and remove duplicates +if(EXTRA_LDFLAGS) + list(REMOVE_DUPLICATES EXTRA_LDFLAGS) +endif(EXTRA_LDFLAGS) +if(EXTRA_LIBS) + list(REMOVE_DUPLICATES EXTRA_LIBS) +endif(EXTRA_LIBS) +if(EXTRA_CFLAGS) + list(REMOVE_DUPLICATES EXTRA_CFLAGS) +endif(EXTRA_CFLAGS) +listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS) +set(EXTRA_CFLAGS ${_EXTRA_CFLAGS}) + +# Compat helpers for the configuration files +if(NOT WINDOWS OR CYGWIN) + # TODO: we need a Windows script, too + execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh) + + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix "\${prefix}") + set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}") + set(bindir "\${exec_prefix}/bin") + set(includedir "\${prefix}/include") + if(SDL_STATIC) + set(ENABLE_STATIC_TRUE "") + set(ENABLE_STATIC_FALSE "#") + else(SDL_STATIC) + set(ENABLE_STATIC_TRUE "#") + set(ENABLE_STATIC_FALSE "") + endif(SDL_STATIC) + if(SDL_SHARED) + set(ENABLE_SHARED_TRUE "") + set(ENABLE_SHARED_FALSE "#") + else(SDL_SHARED) + set(ENABLE_SHARED_TRUE "#") + set(ENABLE_SHARED_FALSE "") + endif(SDL_SHARED) + + # Clean up the different lists + listtostr(EXTRA_LIBS _EXTRA_LIBS "-l") + set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS}) + list(REMOVE_DUPLICATES SDL_STATIC_LIBS) + listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS) + set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS}) + listtostr(SDL_LIBS _SDL_LIBS) + set(SDL_LIBS ${_SDL_LIBS}) + + # MESSAGE(STATUS "SDL_LIBS: ${SDL_LIBS}") + # MESSAGE(STATUS "SDL_STATIC_LIBS: ${SDL_STATIC_LIBS}") + + configure_file("${SDL2_SOURCE_DIR}/sdl2.pc.in" + "${SDL2_BINARY_DIR}/sdl2.pc" @ONLY) + configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in" + "${SDL2_BINARY_DIR}/sdl2-config") + configure_file("${SDL2_SOURCE_DIR}/sdl2-config.in" + "${SDL2_BINARY_DIR}/sdl2-config" @ONLY) + configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in" + "${SDL2_BINARY_DIR}/SDL2.spec" @ONLY) +endif(NOT WINDOWS OR CYGWIN) + +##### Info output ##### +message(STATUS "") +message(STATUS "SDL2 was configured with the following options:") +message(STATUS "") +message(STATUS "Platform: ${CMAKE_SYSTEM}") +message(STATUS "64-bit: ${ARCH_64}") +message(STATUS "Compiler: ${CMAKE_C_COMPILER}") +message(STATUS "") +message(STATUS "Subsystems:") +foreach(_SUB ${SDL_SUBSYSTEMS}) + string(TOUPPER ${_SUB} _OPT) + message_bool_option(${_SUB} SDL_${_OPT}) +endforeach() +message(STATUS "") +message(STATUS "Options:") +list(SORT ALLOPTIONS) +foreach(_OPT ${ALLOPTIONS}) + # Longest option is VIDEO_X11_XSCREENSAVER = 22 characters + # Get the padding + string(LENGTH ${_OPT} _OPTLEN) + math(EXPR _PADLEN "23 - ${_OPTLEN}") + string(RANDOM LENGTH ${_PADLEN} ALPHABET " " _PADDING) + message_tested_option(${_OPT} ${_PADDING}) +endforeach() +message(STATUS "") +message(STATUS " CFLAGS: ${CMAKE_C_FLAGS}") +message(STATUS " EXTRA_CFLAGS: ${EXTRA_CFLAGS}") +message(STATUS " EXTRA_LDFLAGS: ${EXTRA_LDFLAGS}") +message(STATUS " EXTRA_LIBS: ${EXTRA_LIBS}") +message(STATUS "") +message(STATUS " Build Shared Library: ${SDL_SHARED}") +message(STATUS " Build Static Library: ${SDL_STATIC}") +message(STATUS "") +if(UNIX) + message(STATUS "Something was not detected, although your are sure that it") + message(STATUS "has been properly installed? Then make sure, you have set") + message(STATUS "the CFLAGS and LDFLAGS environment variables correctly.") + message(STATUS "") +endif(UNIX) + +# Ensure that the extra cflags are used at compile time +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") + +# Always build SDLmain +add_library(SDL2main STATIC ${SDLMAIN_SOURCES}) +set(_INSTALL_LIBS "SDL2main") + +if(SDL_SHARED) + add_library(SDL2 SHARED ${SOURCE_FILES}) + if(UNIX) + set_target_properties(SDL2 PROPERTIES + VERSION ${LT_VERSION} + SOVERSION ${LT_CURRENT} + OUTPUT_NAME "SDL2-${LT_RELEASE}") + else(UNIX) + set_target_properties(SDL2 PROPERTIES + VERSION ${SDL_VERSION} + SOVERSION ${LT_CURRENT} + OUTPUT_NAME "SDL2") + endif(UNIX) + set(_INSTALL_LIBS "SDL2" ${_INSTALL_LIBS}) + target_link_libraries(SDL2 ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) +endif(SDL_SHARED) + +if(SDL_STATIC) + add_library(SDL2-static STATIC ${SOURCE_FILES}) + set_target_properties(SDL2-static PROPERTIES OUTPUT_NAME "SDL2") + # TODO: Win32 platforms keep the same suffix .lib for import and static + # libraries - do we need to consider this? + set(_INSTALL_LIBS "SDL2-static" ${_INSTALL_LIBS}) + target_link_libraries(SDL2-static ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) +endif(SDL_STATIC) + +##### Installation targets ##### +install(TARGETS ${_INSTALL_LIBS} + LIBRARY DESTINATION "lib${LIB_SUFFIX}" + ARCHIVE DESTINATION "lib${LIB_SUFFIX}") + +file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) +file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h) +foreach(_FNAME ${BIN_INCLUDE_FILES}) + get_filename_component(_INCNAME ${_FNAME} NAME) + list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME}) +endforeach() +list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES}) +install(FILES ${INCLUDE_FILES} DESTINATION include/SDL2) + +if(SDL_SHARED) + install(CODE " + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink + \"libSDL2-2.0.so\" \"libSDL2.so\")") + install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}") +endif(SDL_SHARED) + +if(NOT WINDOWS OR CYGWIN) + if(FREEBSD) + # FreeBSD uses ${PREFIX}/libdata/pkgconfig + install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig") + else(FREEBSD) + install(FILES ${SDL2_BINARY_DIR}/sdl2.pc + DESTINATION "lib${LIB_SUFFIX}/pkgconfig") + endif(FREEBSD) + install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION bin) + # TODO: what about the .spec file? Is it only needed for RPM creation? + install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "share/aclocal") +endif(NOT WINDOWS OR CYGWIN) diff --git a/COPYING b/COPYING deleted file mode 100644 index 2cba2ac74c..0000000000 --- a/COPYING +++ /dev/null @@ -1,458 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/COPYING.txt b/COPYING.txt new file mode 100644 index 0000000000..391424f799 --- /dev/null +++ b/COPYING.txt @@ -0,0 +1,20 @@ + +Simple DirectMedia Layer +Copyright (C) 1997-2013 Sam Lantinga + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + diff --git a/CREDITS b/CREDITS deleted file mode 100644 index efdcfa4d71..0000000000 --- a/CREDITS +++ /dev/null @@ -1,94 +0,0 @@ - -Simple DirectMedia Layer CREDITS -Thanks to everyone who made this possible, including: - -* Cliff Matthews, for giving me a reason to start this project. :) - -- Executor rocks! *grin* - -* Scott Call, for making a home for SDL on the 'Net... Thanks! :) - -* The Linux Fund, C Magazine, Educational Technology Resources Inc., - Gareth Noyce, Jesse Pavel, Keith Kitchin, Jeremy Horvath, Thomas Nicholson, - Hans-Peter Gygax, the Eternal Lands Development Team, Lars Brubaker, - and Phoenix Kokido for financial contributions - -* Gaëtan de Menten for writing the PHP and SQL behind the SDL website - -* Tim Jones for the new look of the SDL website - -* Marco Kraus for setting up SDL merchandise - -* Martin Donlon for his work on the SDL Documentation Project - -* Ryan Gordon for helping everybody out and keeping the dream alive. :) - -* IBM R&D Lab for their PS3 SPE video acceleration code - -* Mattias Engdegård, for help with the Solaris port and lots of other help - -* Max Watson, Matt Slot, and Kyle for help with the MacOS Classic port - -* Stan Shebs, for the initial Mac OS X port - -* Eric Wing, Max Horn, and Darrell Walisser for unflagging work on the Mac OS X port - -* Patrick Trainor, Jim Boucher, and Mike Gorchak for the QNX Neutrino port - -* Carsten Griwodz for the AIX port - -* Gabriele Greco, for the Amiga port - -* Patrice Mandin, for the Atari port - -* Hannu Viitala for the EPOC port - -* Marcus Mertama for the S60 port. - -* Peter Valchev for nagging me about the OpenBSD port until I got it right. :) - -* Kent B Mein, for a place to do the IRIX port - -* Ash, for a place to do the OSF/1 Alpha port - -* David Sowsy, for help with the BeOS port - -* Eugenia Loli, for endless work on porting SDL games to BeOS - -* Jon Taylor for the GGI front-end - -* Paulus Esterhazy, for the Visual C++ testing and libraries - -* Brenda Tantzen, for Metrowerks CodeWarrior on MacOS - -* Chris Nentwich, for the Hermes assembly blitters - -* Michael Vance and Jim Kutter for the X11 OpenGL support - -* Stephane Peter, for the AAlib front-end and multi-threaded timer idea. - -* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation - -* Peter Wiklund, for the 1998 winning SDL logo, - and Arto Hamara, Steven Wong, and Kent Mein for other logo entries. - -* Arne Claus, for the 2004 winning SDL logo, - and Shandy Brown, Jac, Alex Lyman, Mikkel Gjoel, #Guy, Jonas Hartmann, - Daniel Liljeberg, Ronald Sowa, DocD, Pekka Jaervinen, Patrick Avella, - Erkki Kontilla, Levon Gavalian, Hal Emerich, David Wiktorsson, - S. Schury and F. Hufsky, Ciska de Ruyver, Shredweat, Tyler Montbriand, - Martin Andersson, Merlyn Wysard, Fernando Ibanez, David Miller, - Andre Bommele, lovesby.com, Francisco Camenforte Torres, and David Igreja - for other logo entries. - -* Bob Pendleton and David Olofson for being long time contributors to - the SDL mailing list. - -* Everybody at Loki Software, Inc. for their great contributions! - - And a big hand to everyone else who gave me appreciation, advice, - and suggestions, especially the good folks on the SDL mailing list. - -THANKS! :) - - -- Sam Lantinga - diff --git a/CREDITS.txt b/CREDITS.txt new file mode 100644 index 0000000000..a1c2cdcb06 --- /dev/null +++ b/CREDITS.txt @@ -0,0 +1,51 @@ + +Simple DirectMedia Layer CREDITS +Thanks to everyone who made this possible, including: + +* Cliff Matthews, for giving me a reason to start this project. :) + -- Executor rocks! *grin* + +* Ryan Gordon for helping everybody out and keeping the dream alive. :) + +* Gabriel Jacobo for his work on the Android port and generally helping out all around. + +* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches. + +* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code. + +* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve. + +* Alfred Reynolds for the game controller API and general (in)sanity + +* Jørgen Tjernø for numerous magical Mac OS X fixes. + +* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers. + +* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides. + +* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010. + +* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010. + +* Jim Grandpre for his work on multi-touch and gesture recognition during + the Google Summer of Code 2010. + +* Edgar "bobbens" Simo for his force feedback API development during the + Google Summer of Code 2008. + +* Aaron Wishnick for his work on audio resampling and pitch shifting during + the Google Summer of Code 2008. + +* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the + Google Summer of Code 2008. + +* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation. + +* Everybody at Loki Software, Inc. for their great contributions! + + And a big hand to everyone else who has contributed over the years. + +THANKS! :) + + -- Sam Lantinga + diff --git a/CWprojects.sea.bin b/CWprojects.sea.bin deleted file mode 100644 index e8a6fdc29a..0000000000 Binary files a/CWprojects.sea.bin and /dev/null differ diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 1a30fba008..0000000000 --- a/INSTALL +++ /dev/null @@ -1,23 +0,0 @@ - -To compile and install SDL: - - 1. Run './configure; make; make install' - - If you are compiling for Windows using gcc, read the FAQ at: - http://www.libsdl.org/faq.php?action=listentries&category=4#42 - - If you are compiling using Visual C++ on Win32, you should read - the file VisualC.html - - 2. Look at the example programs in ./test, and check out the HTML - documentation in ./docs to see how to use the SDL library. - - 3. Join the SDL developer mailing list by sending E-mail to - sdl-request@libsdl.org - and put "subscribe" in the subject of the message. - - Or alternatively you can use the web interface: - http://www.libsdl.org/mailing-list.php - -That's it! -Sam Lantinga diff --git a/INSTALL.txt b/INSTALL.txt new file mode 100644 index 0000000000..ce77664c99 --- /dev/null +++ b/INSTALL.txt @@ -0,0 +1,40 @@ + +To compile and install SDL: + + 1. Windows with Visual Studio: + * Read VisualC.html + + Windows with gcc, either native or cross-compiling: + * Read the FAQ at http://wiki.libsdl.org/moin.fcg/FAQWindows + * Run './configure; make; make install' + + Mac OS X with Xcode: + * Read README-macosx.txt + + Mac OS X from the command line: + * Run './configure; make; make install' + + Linux and other UNIX systems: + * Run './configure; make; make install' + + Android: + * Read README-android.txt + + iOS: + * Read README-ios.txt + + Using Cmake: + * Read README-cmake.txt + + 2. Look at the example programs in ./test, and check out the online + documentation at http://wiki.libsdl.org/ + + 3. Join the SDL developer mailing list by sending E-mail to + sdl-request@libsdl.org + and put "subscribe" in the subject of the message. + + Or alternatively you can use the web interface: + http://www.libsdl.org/mailing-list.php + +That's it! +Sam Lantinga diff --git a/MPWmake.sea.bin b/MPWmake.sea.bin deleted file mode 100644 index b345e08665..0000000000 Binary files a/MPWmake.sea.bin and /dev/null differ diff --git a/Makefile.dc b/Makefile.dc deleted file mode 100644 index 58d6e712df..0000000000 --- a/Makefile.dc +++ /dev/null @@ -1,111 +0,0 @@ -#GL=1 - -CC = sh-elf-gcc -AR = sh-elf-ar - -ifdef GL -DEFS += -DSDL_VIDEO_OPENGL=1 -TARGET = libSDL_gl.a -else -TARGET = libSDL.a -endif - -CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude - -SRCS = \ - src/audio/dc/SDL_dcaudio.c \ - src/audio/dc/aica.c \ - src/audio/dummy/SDL_dummyaudio.c \ - src/audio/SDL_audio.c \ - src/audio/SDL_audiocvt.c \ - src/audio/SDL_audiodev.c \ - src/audio/SDL_mixer.c \ - src/audio/SDL_wave.c \ - src/cdrom/dc/SDL_syscdrom.c \ - src/cdrom/SDL_cdrom.c \ - src/events/SDL_active.c \ - src/events/SDL_events.c \ - src/events/SDL_expose.c \ - src/events/SDL_keyboard.c \ - src/events/SDL_mouse.c \ - src/events/SDL_quit.c \ - src/events/SDL_resize.c \ - src/file/SDL_rwops.c \ - src/joystick/dc/SDL_sysjoystick.c \ - src/joystick/SDL_joystick.c \ - src/loadso/dummy/SDL_sysloadso.c \ - src/SDL.c \ - src/SDL_error.c \ - src/SDL_fatal.c \ - src/stdlib/SDL_getenv.c \ - src/stdlib/SDL_iconv.c \ - src/stdlib/SDL_malloc.c \ - src/stdlib/SDL_qsort.c \ - src/stdlib/SDL_stdlib.c \ - src/stdlib/SDL_string.c \ - src/thread/dc/SDL_syscond.c \ - src/thread/dc/SDL_sysmutex.c \ - src/thread/dc/SDL_syssem.c \ - src/thread/dc/SDL_systhread.c \ - src/thread/SDL_thread.c \ - src/timer/dc/SDL_systimer.c \ - src/timer/SDL_timer.c \ - src/video/dc/SDL_dcevents.c \ - src/video/dc/SDL_dcvideo.c \ - src/video/dummy/SDL_nullevents.c \ - src/video/dummy/SDL_nullmouse.c \ - src/video/dummy/SDL_nullvideo.c \ - src/video/SDL_blit.c \ - src/video/SDL_blit_0.c \ - src/video/SDL_blit_1.c \ - src/video/SDL_blit_A.c \ - src/video/SDL_blit_N.c \ - src/video/SDL_bmp.c \ - src/video/SDL_cursor.c \ - src/video/SDL_gamma.c \ - src/video/SDL_pixels.c \ - src/video/SDL_RLEaccel.c \ - src/video/SDL_stretch.c \ - src/video/SDL_surface.c \ - src/video/SDL_video.c \ - src/video/SDL_yuv.c \ - src/video/SDL_yuv_sw.c \ - -OBJS = $(SRCS:.c=.o) - -TEST = \ - test/checkkeys.c \ - test/graywin.c \ - test/loopwave.c \ - test/testalpha.c \ - test/testbitmap.c \ - test/testcdrom.c \ - test/testerror.c \ - test/testgamma.c \ - test/testgl.c \ - test/testhread.c \ - test/testjoystick.c \ - test/testkeys.c \ - test/testlock.c \ - test/testoverlay.c \ - test/testpalette.c \ - test/testsem.c \ - test/testsprite.c \ - test/testtimer.c \ - test/testtypes.c \ - test/testver.c \ - test/testvidinfo.c \ - test/testwin.c \ - test/testwm.c \ - test/threadwin.c \ - test/torturethread.c \ - -$(TARGET): copy_config \ - $(OBJS) - $(AR) rcs $(TARGET) $(OBJS) - -copy_config: - @cp include/SDL_config.h.default include/SDL_config.h - -clean: - rm -f include/SDL_config.h $(OBJS) diff --git a/Makefile.ds b/Makefile.ds deleted file mode 100644 index df3d14652c..0000000000 --- a/Makefile.ds +++ /dev/null @@ -1,63 +0,0 @@ -#LibSDL 1.2.12 -#DS porting by Troy Davis(GPF) - - -ifeq ($(strip $(DEVKITPRO)),) -$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitPro) -endif -ifeq ($(strip $(DEVKITARM)),) -DEVKITARM := $(DEVKITPRO)/devkitARM -endif - - -SRCS = $(shell echo ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c ./src/joystick/*.c ./src/joystick/nds/*.c ./src/cdrom/dummy/*.c ./src/thread/generic/*.c ./src/timer/nds/*.c ./src/loadso/dummy/*.c ./src/audio/dummy/*.c ./src/audio/nds/*.c ./src/video/dummy/*.c ./src/video/nds/*.c) - -OBJS = $(SRCS:.c=.o) - - -SUBDIRS= - -CC=arm-eabi-gcc -CXX=arm-eabi-g++ -LDSHARED=$(CXX) -AR=arm-eabi-ar rc -RANLIB=arm-eabi-ranlib - -CFLAGS = -mthumb -mthumb-interwork \ - -march=armv5te -mtune=arm946e-s \ - -O2 -Wall -Wwrite-strings -Wpointer-arith \ - -DARM9 -D__NDS__ -I$(DEVKITPRO)/libnds/include -Iinclude - -CXXFLAGS += $(CFLAGS) - -all: $(DEVKITPRO)/libnds/lib/libSDL.a - - -$(DEVKITPRO)/libnds/lib/libSDL.a: $(OBJS) - $(AR) $@ $(OBJS) - -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 - -clean: - find . -name "*.o" |xargs rm -f - find . -name "*.d" |xargs rm -f - -rm -f *.elf - -rm -f *.nds - -rm -f *.gba - -rm -f *.arm9 - -rm -f *.map - -rm -f *.img - -rm -Rf *.d - - -subdirs: $(patsubst %, _dir_%, $(SUBDIRS)) - -$(patsubst %, _dir_%, $(SUBDIRS)): - $(MAKE) -C $(patsubst _dir_%, %, $@) - -clean_subdirs: $(patsubst %, _clean_dir_%, $(SUBDIRS)) - -$(patsubst %, _clean_dir_%, $(SUBDIRS)): - $(MAKE) -C $(patsubst _clean_dir_%, %, $@) clean - -#include $(DEVKITARM)/ds_rules - diff --git a/Makefile.in b/Makefile.in index ab51035e0b..ae6293e7d2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,7 +3,6 @@ top_builddir = . srcdir = @srcdir@ objects = build -depend = build-deps prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -11,10 +10,9 @@ libdir = @libdir@ includedir = @includedir@ datarootdir = @datarootdir@ datadir = @datadir@ -mandir = @mandir@ auxdir = @ac_aux_dir@ distpath = $(srcdir)/.. -distdir = SDL-@SDL_VERSION@ +distdir = SDL2-@SDL_VERSION@ distfile = $(distdir).tar.gz @SET_MAKE@ @@ -27,23 +25,75 @@ LDFLAGS = @BUILD_LDFLAGS@ EXTRA_LDFLAGS = @EXTRA_LDFLAGS@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ -NASM = @NASM@ @NASMFLAGS@ AR = @AR@ RANLIB = @RANLIB@ WINDRES = @WINDRES@ -TARGET = libSDL.la -SOURCES = @SOURCES@ +TARGET = libSDL2.la OBJECTS = @OBJECTS@ +VERSION_OBJECTS = @VERSION_OBJECTS@ -SDLMAIN_TARGET = libSDLmain.la -SDLMAIN_SOURCES = @SDLMAIN_SOURCES@ +SDLMAIN_TARGET = libSDL2main.a SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ -SDLMAIN_LDFLAGS = @SDLMAIN_LDFLAGS@ -DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE VisualC.html VisualC Watcom-OS2.zip Watcom-Win32.zip symbian.zip WhatsNew Xcode - -HDRS = SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h +SDLTEST_TARGET = libSDL2_test.a +SDLTEST_OBJECTS = @SDLTEST_OBJECTS@ + +SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake configure configure.in debian include Makefile.* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC Xcode Xcode-iOS +GEN_DIST = SDL2.spec + +HDRS = \ + SDL.h \ + SDL_assert.h \ + SDL_atomic.h \ + SDL_audio.h \ + SDL_bits.h \ + SDL_blendmode.h \ + SDL_clipboard.h \ + SDL_cpuinfo.h \ + SDL_endian.h \ + SDL_error.h \ + SDL_events.h \ + SDL_gamecontroller.h \ + SDL_gesture.h \ + SDL_haptic.h \ + SDL_hints.h \ + SDL_joystick.h \ + SDL_keyboard.h \ + SDL_keycode.h \ + SDL_loadso.h \ + SDL_log.h \ + SDL_main.h \ + SDL_messagebox.h \ + SDL_mouse.h \ + SDL_mutex.h \ + SDL_name.h \ + SDL_opengl.h \ + SDL_opengles.h \ + SDL_opengles2.h \ + SDL_pixels.h \ + SDL_platform.h \ + SDL_power.h \ + SDL_quit.h \ + SDL_rect.h \ + SDL_render.h \ + SDL_rwops.h \ + SDL_scancode.h \ + SDL_shape.h \ + SDL_stdinc.h \ + SDL_surface.h \ + SDL_system.h \ + SDL_syswm.h \ + SDL_thread.h \ + SDL_timer.h \ + SDL_touch.h \ + SDL_types.h \ + SDL_version.h \ + SDL_video.h \ + begin_code.h \ + close_code.h + +SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test) LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ @@ -51,7 +101,7 @@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) +all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET) $(srcdir)/configure: $(srcdir)/configure.in @echo "Warning, configure.in is out of date" @@ -61,80 +111,82 @@ $(srcdir)/configure: $(srcdir)/configure.in Makefile: $(srcdir)/Makefile.in $(SHELL) config.status $@ +Makefile.in:; + $(objects): $(SHELL) $(auxdir)/mkinstalldirs $@ -.PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist -depend: - @SOURCES="$(SOURCES) $(SDLMAIN_SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \ - $(SHELL) $(auxdir)/makedep.sh +update-revision: + $(SHELL) $(auxdir)/updaterev.sh -include $(depend) +.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d) -$(objects)/$(TARGET): $(OBJECTS) - $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) +$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS) + $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS) - $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) $(SDLMAIN_LDFLAGS) + $(AR) cru $@ $(SDLMAIN_OBJECTS) + $(RANLIB) $@ +$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS) + $(AR) cru $@ $(SDLTEST_OBJECTS) + $(RANLIB) $@ -install: all install-bin install-hdrs install-lib install-data install-man +install: all install-bin install-hdrs install-lib install-data install-bin: $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir) - $(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config -install-hdrs: - $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL - for file in $(HDRS); do \ - $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \ + $(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config +install-hdrs: update-revision + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2 + for file in $(HDRS) $(SDLTEST_HDRS); do \ + $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \ done - $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h -install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) + $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h + if test -f include/SDL_revision.h; then \ + $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \ + else \ + $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \ + fi + +install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET) $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir) $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET) - $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) + $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) + $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) + $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) + $(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) install-data: $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal - $(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4 + $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig - $(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig -install-man: - $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(mandir)/man3 - for src in $(srcdir)/docs/man3/*.3; do \ - file=`echo $$src | sed -e 's|^.*/||'`; \ - $(INSTALL) -m 644 $$src $(DESTDIR)$(mandir)/man3/$$file; \ - done + $(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig -uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man +uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-bin: - rm -f $(DESTDIR)$(bindir)/sdl-config + rm -f $(DESTDIR)$(bindir)/sdl2-config uninstall-hdrs: - for file in $(HDRS); do \ - rm -f $(DESTDIR)$(includedir)/SDL/$$file; \ + for file in $(HDRS) $(SDLTEST_HDRS); do \ + rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \ done - rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h - -rmdir $(DESTDIR)$(includedir)/SDL + rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h + rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h + -rmdir $(DESTDIR)$(includedir)/SDL2 uninstall-lib: $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET) - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) + rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) + rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) uninstall-data: - rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4 - rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc -uninstall-man: - for src in $(srcdir)/docs/man3/*.3; do \ - file=`echo $$src | sed -e 's|^.*/||'`; \ - rm -f $(DESTDIR)$(mandir)/man3/$$file; \ - done + rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4 + rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc clean: rm -rf $(objects) if test -f test/Makefile; then (cd test; $(MAKE) $@); fi distclean: clean - rm -f Makefile include/SDL_config.h sdl-config - rm -f SDL.qpg - rm -f config.status config.cache config.log libtool $(depend) + rm -f Makefile Makefile.rules sdl2-config + rm -f config.status config.cache config.log libtool rm -rf $(srcdir)/autom4te* - rm -rf $(srcdir)/test/autom4te* find $(srcdir) \( \ -name '*~' -o \ -name '*.bak' -o \ @@ -143,15 +195,12 @@ distclean: clean -name '*.orig' -o \ -name '.#*' \) \ -exec rm -f {} \; - cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h if test -f test/Makefile; then (cd test; $(MAKE) $@); fi dist $(distfile): $(SHELL) $(auxdir)/mkinstalldirs $(distdir) - tar cf - $(DIST) | (cd $(distdir); tar xf -) - cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h - rm -rf `find $(distdir) -name .svn` - rm -rf $(distdir)/test/autom4te* + (cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -) + tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -) find $(distdir) \( \ -name '*~' -o \ -name '*.bak' -o \ @@ -161,18 +210,9 @@ dist $(distfile): -name '.#*' \) \ -exec rm -f {} \; if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi + (cd $(distdir); build-scripts/updaterev.sh) tar cvf - $(distdir) | gzip --best >$(distfile) rm -rf $(distdir) rpm: $(distfile) rpmbuild -ta $? - -# Create a SVN snapshot that people can run update on -snapshot: - svn co http://svn.libsdl.org/branches/SDL-1.2 - (cd SDL-1.2 && ./autogen.sh && rm -rf autom4te.cache) - cp SDL-1.2/include/SDL_config.h.default SDL-1.2/include/SDL_config.h - tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2 - rm -f $(HOME)/SDL-1.2.zip - zip -r $(HOME)/SDL-1.2.zip SDL-1.2 - rm -rf SDL-1.2 diff --git a/Makefile.minimal b/Makefile.minimal index 827621c3f3..a06083230f 100644 --- a/Makefile.minimal +++ b/Makefile.minimal @@ -5,38 +5,37 @@ CFLAGS = -g -O2 $(INCLUDE) AR = ar RANLIB = ranlib -CONFIG_H = include/SDL_config.h TARGET = libSDL.a SOURCES = \ src/*.c \ src/audio/*.c \ - src/cdrom/*.c \ + src/audio/dummy/*.c \ src/cpuinfo/*.c \ src/events/*.c \ src/file/*.c \ + src/haptic/*.c \ + src/haptic/dummy/*.c \ src/joystick/*.c \ + src/joystick/dummy/*.c \ + src/loadso/dummy/*.c \ + src/power/*.c \ + src/render/*.c \ + src/render/software/*.c \ src/stdlib/*.c \ src/thread/*.c \ + src/thread/generic/*.c \ src/timer/*.c \ + src/timer/dummy/*.c \ src/video/*.c \ - src/audio/dummy/*.c \ src/video/dummy/*.c \ - src/joystick/dummy/*.c \ - src/cdrom/dummy/*.c \ - src/thread/generic/*.c \ - src/timer/dummy/*.c \ - src/loadso/dummy/*.c \ OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g') all: $(TARGET) -$(TARGET): $(CONFIG_H) $(OBJECTS) +$(TARGET): $(OBJECTS) $(AR) crv $@ $^ $(RANLIB) $@ -$(CONFIG_H): - cp $(CONFIG_H).default $(CONFIG_H) - clean: rm -f $(TARGET) $(OBJECTS) diff --git a/Makefile.pandora b/Makefile.pandora new file mode 100644 index 0000000000..de15c846b9 --- /dev/null +++ b/Makefile.pandora @@ -0,0 +1,37 @@ +# Makefile to build the pandora SDL library + +AR = arm-none-linux-gnueabi-ar +RANLIB = arm-none-linux-gnueabi-ranlib +CC = arm-none-linux-gnueabi-gcc +CXX = arm-none-linux-gnueabi-g++ +STRIP = arm-none-linux-gnueabi-strip + +CFLAGS = -O3 -march=armv7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfloat-abi=softfp \ + -mfpu=neon -ftree-vectorize -ffast-math -fomit-frame-pointer -fno-strict-aliasing -fsingle-precision-constant \ + -I./include -I$(PNDSDK)/usr/include -DSDL_REVISION=0 + +TARGET = libSDL.a + +SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \ + ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \ + ./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \ + ./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \ + ./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \ + ./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \ + ./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \ + ./src/atomic/linux/*.c \ + ./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c + + +OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g') + +CONFIG_H = $(shell cp include/SDL_config_pandora.h include/SDL_config.h && touch include/SDL_revision.h) + +all: $(TARGET) + +$(TARGET): $(CONFIG_H) $(OBJECTS) + $(AR) crv $@ $^ + $(RANLIB) $@ + +clean: + rm -f $(TARGET) $(OBJECTS) diff --git a/Makefile.psp b/Makefile.psp new file mode 100644 index 0000000000..8bcdcb9270 --- /dev/null +++ b/Makefile.psp @@ -0,0 +1,91 @@ +TARGET_LIB = libSDL2.a +OBJS= src/SDL.o \ + src/SDL_assert.o \ + src/SDL_error.o \ + src/SDL_hints.o \ + src/SDL_log.o \ + src/atomic/SDL_atomic.o \ + src/atomic/SDL_spinlock.o \ + src/audio/SDL_audio.o \ + src/audio/SDL_audiocvt.o \ + src/audio/SDL_audiodev.o \ + src/audio/SDL_audiotypecvt.o \ + src/audio/SDL_mixer.o \ + src/audio/SDL_wave.o \ + src/audio/psp/SDL_pspaudio.o \ + src/cpuinfo/SDL_cpuinfo.o \ + src/events/SDL_clipboardevents.o \ + src/events/SDL_dropevents.o \ + src/events/SDL_events.o \ + src/events/SDL_gesture.o \ + src/events/SDL_keyboard.o \ + src/events/SDL_mouse.o \ + src/events/SDL_quit.o \ + src/events/SDL_touch.o \ + src/events/SDL_windowevents.o \ + src/file/SDL_rwops.o \ + src/haptic/SDL_haptic.o \ + src/haptic/dummy/SDL_syshaptic.o \ + src/joystick/SDL_joystick.o \ + src/joystick/SDL_gamecontroller.o \ + src/joystick/psp/SDL_sysjoystick.o \ + src/power/SDL_power.o \ + src/power/psp/SDL_syspower.o \ + src/render/SDL_render.o \ + src/render/SDL_yuv_sw.o \ + src/render/psp/SDL_render_psp.o \ + src/render/software/SDL_blendfillrect.o \ + src/render/software/SDL_blendline.o \ + src/render/software/SDL_blendpoint.o \ + src/render/software/SDL_drawline.o \ + src/render/software/SDL_drawpoint.o \ + src/render/software/SDL_render_sw.o \ + src/render/software/SDL_rotate.o \ + src/stdlib/SDL_getenv.o \ + src/stdlib/SDL_iconv.o \ + src/stdlib/SDL_malloc.o \ + src/stdlib/SDL_qsort.o \ + src/stdlib/SDL_stdlib.o \ + src/stdlib/SDL_string.o \ + src/thread/SDL_thread.o \ + src/thread/psp/SDL_syssem.o \ + src/thread/psp/SDL_systhread.o \ + src/thread/psp/SDL_sysmutex.o \ + src/thread/psp/SDL_syscond.o \ + src/timer/SDL_timer.o \ + src/timer/psp/SDL_systimer.o \ + src/video/SDL_RLEaccel.o \ + src/video/SDL_blit.o \ + src/video/SDL_blit_0.o \ + src/video/SDL_blit_1.o \ + src/video/SDL_blit_A.o \ + src/video/SDL_blit_N.o \ + src/video/SDL_blit_auto.o \ + src/video/SDL_blit_copy.o \ + src/video/SDL_blit_slow.o \ + src/video/SDL_bmp.o \ + src/video/SDL_clipboard.o \ + src/video/SDL_fillrect.o \ + src/video/SDL_pixels.o \ + src/video/SDL_rect.o \ + src/video/SDL_stretch.o \ + src/video/SDL_surface.o \ + src/video/SDL_video.o \ + src/video/psp/SDL_pspevents.o \ + src/video/psp/SDL_pspvideo.o \ + src/video/psp/SDL_pspgl.o \ + src/video/psp/SDL_pspmouse.o \ + +INCDIR = ./include +CFLAGS = -g -O2 -G0 -Wall -D__PSP__ -DHAVE_OPENGL +CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti +ASFLAGS = $(CFLAGS) + +LIBDIR = +LIBS = -lGL -lGLU -lglut -lz \ + -lpspvfpu -lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgum -lpspgu -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \ + -lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -lpspvram + +PSPSDK=$(shell psp-config --pspsdk-path) +include $(PSPSDK)/lib/build.mak + diff --git a/Makefile.wiz b/Makefile.wiz new file mode 100644 index 0000000000..82619f076c --- /dev/null +++ b/Makefile.wiz @@ -0,0 +1,61 @@ +# Makefile to build the pandora SDL library +WIZSDK = /mythtv/media/devel/toolchains/openwiz/arm-openwiz-linux-gnu + +AR = $(WIZSDK)/bin/arm-openwiz-linux-gnu-ar +RANLIB = $(WIZSDK)/bin/arm-openwiz-linux-gnu-ranlib +CC = $(WIZSDK)/bin/arm-openwiz-linux-gnu-gcc +CXX = $(WIZSDK)/bin/arm-openwiz-linux-gnu-g++ +STRIP = $(WIZSDK)/bin/arm-openwiz-linux-gnu-strip + +CFLAGS = -Wall -fPIC -I./include -I$(WIZSDK)/include -DWIZ_GLES_LITE + +TARGET_STATIC = libSDL13.a +TARGET_SHARED = libSDL13.so + +SOURCES = ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c \ + ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \ + ./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \ + ./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \ + ./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \ + ./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \ + ./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c ./src/cdrom/dummy/*.c \ + ./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o + + +OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g') + +all: config_copy $(TARGET_STATIC) $(TARGET_SHARED) + +$(TARGET_STATIC): $(OBJECTS) + $(AR) crv $@ $^ + $(RANLIB) $@ + +$(TARGET_SHARED): + $(CC) -shared -Wl,-soname,$(TARGET_SHARED).0 -o $(TARGET_SHARED).0.0.1 $(OBJECTS) + ln -s $(TARGET_SHARED).0.0.1 $(TARGET_SHARED).0 + ln -s $(TARGET_SHARED).0 $(TARGET_SHARED) + +config_copy: + cp include/SDL_config_wiz.h include/SDL_config.h + +clean: + rm -f $(TARGET_STATIC) $(TARGET_SHARED)* $(OBJECTS) + +install: + mkdir -p $(WIZSDK)/lib + mkdir -p $(WIZSDK)/include/SDL13 + cp -f $(TARGET_STATIC) $(WIZSDK)/lib + cp -f $(TARGET_SHARED).0.0.1 $(WIZSDK)/lib + rm -f $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED) + ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0.0.1 $(WIZSDK)/lib/$(TARGET_SHARED).0 + ln -s $(WIZSDK)/lib/$(TARGET_SHARED).0 $(WIZSDK)/lib/$(TARGET_SHARED) + + cp $(TARGET_STATIC) ../../toolchain/libs + cp $(TARGET_SHARED).0.0.1 ../../toolchain/libs + rm -f ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED) + ln -s ../../toolchain/libs/$(TARGET_SHARED).0.0.1 ../../toolchain/libs/$(TARGET_SHARED).0 + ln -s ../../toolchain/libs/$(TARGET_SHARED).0 ../../toolchain/libs/$(TARGET_SHARED) + + cp $(TARGET_SHARED).0.0.1 ../nehe_demos/build/$(TARGET_SHARED).0 + cp -f include/*.h $(WIZSDK)/include/SDL13/ + cp -f include/*.h ../../toolchain/include/SDL13/ diff --git a/README b/README deleted file mode 100644 index 7c0dd5890c..0000000000 --- a/README +++ /dev/null @@ -1,49 +0,0 @@ - - Simple DirectMedia Layer - - (SDL) - - Version 1.2 - ---- -http://www.libsdl.org/ - -This is the Simple DirectMedia Layer, a general API that provides low -level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, -and 2D framebuffer across multiple platforms. - -The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS, -MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, -and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, -RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially -supported. - -SDL is written in C, but works with C++ natively, and has bindings to -several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, -Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, -Pike, Pliant, Python, Ruby, and Smalltalk. - -This library is distributed under GNU LGPL version 2, which can be -found in the file "COPYING". This license allows you to use SDL -freely in commercial programs as long as you link with the dynamic -library. - -The best way to learn how to use SDL is to check out the header files in -the "include" subdirectory and the programs in the "test" subdirectory. -The header files and test programs are well commented and always up to date. -More documentation is available in HTML format in "docs/index.html", and -a documentation wiki is available online at: - http://www.libsdl.org/cgi/docwiki.cgi - -The test programs in the "test" subdirectory are in the public domain. - -Frequently asked questions are answered online: - http://www.libsdl.org/faq.php - -If you need help with the library, or just want to discuss SDL related -issues, you can join the developers mailing list: - http://www.libsdl.org/mailing-list.php - -Enjoy! - Sam Lantinga (slouken@libsdl.org) - diff --git a/README-SDL.txt b/README-SDL.txt index 4d36ca9dce..0630395e5d 100644 --- a/README-SDL.txt +++ b/README-SDL.txt @@ -1,13 +1,13 @@ - -Please distribute this file with the SDL runtime environment: - -The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library -designed to make it easy to write multi-media software, such as games and -emulators. - -The Simple DirectMedia Layer library source code is available from: -http://www.libsdl.org/ - -This library is distributed under the terms of the GNU LGPL license: -http://www.gnu.org/copyleft/lesser.html - + +Please distribute this file with the SDL runtime environment: + +The Simple DirectMedia Layer (SDL for short) is a cross-platform library +designed to make it easy to write multi-media software, such as games and +emulators. + +The Simple DirectMedia Layer library source code is available from: +http://www.libsdl.org/ + +This library is distributed under the terms of the zlib license: +http://www.zlib.net/zlib_license.html + diff --git a/README-android.txt b/README-android.txt new file mode 100644 index 0000000000..ecd31ae1be --- /dev/null +++ b/README-android.txt @@ -0,0 +1,384 @@ +================================================================================ +Simple DirectMedia Layer for Android +================================================================================ + +Requirements: + +Android SDK (version 10 or later) +http://developer.android.com/sdk/index.html + +Android NDK r7 or later +http://developer.android.com/sdk/ndk/index.html + +Minimum API level supported by SDL: 10 (Android 2.3.3) + +================================================================================ + How the port works +================================================================================ + +- Android applications are Java-based, optionally with parts written in C +- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to +the SDL library +- This means that your application C code must be placed inside an Android +Java project, along with some C support code that communicates with Java +- This eventually produces a standard Android .apk package + +The Android Java code implements an "Activity" and can be found in: +android-project/src/org/libsdl/app/SDLActivity.java + +The Java code loads your game code, the SDL shared library, and +dispatches to native functions implemented in the SDL library: +src/SDL_android.c + +Your project must include some glue code that starts your main() routine: +src/main/android/SDL_android_main.c + + +================================================================================ + Building an app +================================================================================ + +Instructions: +1. Copy the android-project directory wherever you want to keep your projects + and rename it to the name of your project. +2. Move or symlink this SDL directory into the /jni directory +3. Edit /jni/src/Android.mk to include your source files +4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source + +If you want to use the Eclipse IDE, skip to the Eclipse section below. + +5. Create /local.properties and use that to point to the Android SDK directory, by writing a line with the following form: +sdk.dir=PATH_TO_ANDROID_SDK +6. Run 'ant debug' in android/project. This compiles the .java and eventually + creates a .apk with the native code embedded +7. 'ant debug install' will push the apk to the device or emulator (if connected) + +Here's an explanation of the files in the Android project, so you can customize them: + +android-project/ + AndroidManifest.xml - package manifest. Among others, it contains the class name + of the main Activity and the package name of the application. + build.properties - empty + build.xml - build description file, used by ant. The actual application name + is specified here. + default.properties - holds the target ABI for the application, android-10 and up + project.properties - holds the target ABI for the application, android-10 and up + local.properties - holds the SDK path, you should change this to the path to your SDK + jni/ - directory holding native code + jni/Android.mk - Android makefile that can call recursively the Android.mk files + in all subdirectories + jni/SDL/ - (symlink to) directory holding the SDL library files + jni/SDL/Android.mk - Android makefile for creating the SDL shared library + jni/src/ - directory holding your C/C++ source + jni/src/Android.mk - Android makefile that you should customize to include your + source code and any library references + res/ - directory holding resources for your application + res/drawable-* - directories holding icons for different phone hardware. Could be + one dir called "drawable". + res/layout/main.xml - Usually contains a file main.xml, which declares the screen layout. + We don't need it because we use the SDL video output. + res/values/strings.xml - strings used in your application, including the application name + shown on the phone. + src/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding + to SDL. Be very careful changing this, as the SDL library relies + on this implementation. + + +================================================================================ + Customizing your application name +================================================================================ + +To customize your application name, edit AndroidManifest.xml and replace +"org.libsdl.app" with an identifier for your product package. + +Then create a Java class extending SDLActivity and place it in a directory +under src matching your package, e.g. + src/com/gamemaker/game/MyGame.java + +Here's an example of a minimal class file: +--- MyGame.java -------------------------- +package com.gamemaker.game; + +import org.libsdl.app.SDLActivity; + +/* + * A sample wrapper class that just calls SDLActivity + */ + +public class MyGame extends SDLActivity { } + +------------------------------------------ + +Then replace "SDLActivity" in AndroidManifest.xml with the name of your +class, .e.g. "MyGame" + +================================================================================ + Customizing your application icon +================================================================================ + +Conceptually changing your icon is just replacing the "ic_launcher.png" files in +the drawable directories under the res directory. There are four directories for +different screen sizes. These can be replaced with one dir called "drawable", +containing an icon file "ic_launcher.png" with dimensions 48x48 or 72x72. + +You may need to change the name of your icon in AndroidManifest.xml to match +this icon filename. + +================================================================================ + Loading assets +================================================================================ + +Any files you put in the "assets" directory of your android-project directory +will get bundled into the application package and you can load them using the +standard functions in SDL_rwops.h. + +There are also a few Android specific functions that allow you to get other +useful paths for saving and loading data: +SDL_AndroidGetInternalStoragePath() +SDL_AndroidGetExternalStorageState() +SDL_AndroidGetExternalStoragePath() + +See SDL_system.h for more details on these functions. + +The asset packaging system will, by default, compress certain file extensions. +SDL includes two asset file access mechanisms, the preferred one is the so +called "File Descriptor" method, which is faster and doesn't involve the Dalvik +GC, but given this method does not work on compressed assets, there is also the +"Input Stream" method, which is automatically used as a fall back by SDL. You +may want to keep this fact in mind when building your APK, specially when large +files are involved. +For more information on which extensions get compressed by default and how to +disable this behaviour, see for example: + +http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/ + +================================================================================ + Pause / Resume behaviour +================================================================================ + +If SDL is compiled with SDL_ANDROID_BLOCK_ON_PAUSE defined (the default), +the event loop will block itself when the app is paused (ie, when the user +returns to the main Android dashboard). Blocking is better in terms of battery +use, and it allows your app to spring back to life instantaneously after resume +(versus polling for a resume message). + +Upon resume, SDL will attempt to restore the GL context automatically. +In modern devices (Android 3.0 and up) this will most likely succeed and your +app can continue to operate as it was. + +However, there's a chance (on older hardware, or on systems under heavy load), +where the GL context can not be restored. In that case you have to listen for +a specific message, (which is not yet implemented!) and restore your textures +manually or quit the app (which is actually the kind of behaviour you'll see +under iOS, if the OS can not restore your GL context it will just kill your app) + +================================================================================ + Threads and the Java VM +================================================================================ + +For a quick tour on how Linux native threads interoperate with the Java VM, take +a look here: http://developer.android.com/guide/practices/jni.html +If you want to use threads in your SDL app, it's strongly recommended that you +do so by creating them using SDL functions. This way, the required attach/detach +handling is managed by SDL automagically. If you have threads created by other +means and they make calls to SDL functions, make sure that you call +Android_JNI_SetupThread before doing anything else otherwise SDL will attach +your thread automatically anyway (when you make an SDL call), but it'll never +detach it. + +================================================================================ + Using STL +================================================================================ + +You can use STL in your project by creating an Application.mk file in the jni +folder and adding the following line: +APP_STL := stlport_static + +For more information check out CPLUSPLUS-SUPPORT.html in the NDK documentation. + +================================================================================ + Additional documentation +================================================================================ + +The documentation in the NDK docs directory is very helpful in understanding the +build process and how to work with native code on the Android platform. + +The best place to start is with docs/OVERVIEW.TXT + + +================================================================================ + Using Eclipse +================================================================================ + +First make sure that you've installed Eclipse and the Android extensions as described here: + http://developer.android.com/sdk/eclipse-adt.html + +Once you've copied the SDL android project and customized it, you can create an Eclipse project from it: + * File -> New -> Other + * Select the Android -> Android Project wizard and click Next + * Enter the name you'd like your project to have + * Select "Create project from existing source" and browse for your project directory + * Make sure the Build Target is set to Android 2.0 + * Click Finish + + +================================================================================ + Using the emulator +================================================================================ + +There are some good tips and tricks for getting the most out of the +emulator here: http://developer.android.com/tools/devices/emulator.html + +Especially useful is the info on setting up OpenGL ES 2.0 emulation. + +Notice that this software emulator is incredibly slow and needs a lot of disk space. +Using a real device works better. + +================================================================================ + Troubleshooting +================================================================================ + +You can create and run an emulator from the Eclipse IDE: + * Window -> Android SDK and AVD Manager + +You can see if adb can see any devices with the following command: + adb devices + +You can see the output of log messages on the default device with: + adb logcat + +You can push files to the device with: + adb push local_file remote_path_and_file + +You can push files to the SD Card at /sdcard, for example: + adb push moose.dat /sdcard/moose.dat + +You can see the files on the SD card with a shell command: + adb shell ls /sdcard/ + +You can start a command shell on the default device with: + adb shell + +You can remove the library files of your project (and not the SDL lib files) with: + ndk-build clean + +You can do a build with the following command: + ndk-build + +You can see the complete command line that ndk-build is using by passing V=1 on the command line: + ndk-build V=1 + +If your application crashes in native code, you can use addr2line to convert the +addresses in the stack trace to lines in your code. + +For example, if your crash looks like this: +I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0 +I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4 +I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c +I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c +I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030 +I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so +I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so +I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so +I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so + +You can see that there's a crash in the C library being called from the main code. +I run addr2line with the debug version of my code: + arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so +and then paste in the number after "pc" in the call stack, from the line that I care about: +000014bc + +I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23. + +You can add logging to your code to help show what's happening: + +#include + + __android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x); + +If you need to build without optimization turned on, you can create a file called +"Application.mk" in the jni directory, with the following line in it: +APP_OPTIM := debug + + +================================================================================ + Memory debugging +================================================================================ + +The best (and slowest) way to debug memory issues on Android is valgrind. +Valgrind has support for Android out of the box, just grab code using: + svn co svn://svn.valgrind.org/valgrind/trunk valgrind +... and follow the instructions in the file README.android to build it. + +One thing I needed to do on Mac OS X was change the path to the toolchain, +and add ranlib to the environment variables: +export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib + +Once valgrind is built, you can create a wrapper script to launch your +application with it, changing org.libsdl.app to your package identifier: +--- start_valgrind_app ------------------- +#!/system/bin/sh +export TMPDIR=/data/data/org.libsdl.app +exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $* +------------------------------------------ + +Then push it to the device: + adb push start_valgrind_app /data/local + +and make it executable: + adb shell chmod 755 /data/local/start_valgrind_app + +and tell Android to use the script to launch your application: + adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app" + +If the setprop command says "could not set property", it's likely that +your package name is too long and you should make it shorter by changing +AndroidManifest.xml and the path to your class file in android-project/src + +You can then launch your application normally and waaaaaaaiiittt for it. +You can monitor the startup process with the logcat command above, and +when it's done (or even while it's running) you can grab the valgrind +output file: + adb pull /sdcard/valgrind.log + +When you're done instrumenting with valgrind, you can disable the wrapper: + adb shell setprop wrap.org.libsdl.app "" + +================================================================================ + Why is API level 10 the minimum required? +================================================================================ + +API level 10 is required because SDL requires some functionality for running not +available on older devices and some for building which is not in older NDK/SDKs. + +Support for native OpenGL ES and ES2 applications was introduced in the NDK for +API level 4 and 8. EGL was made a stable API in the NDK for API level 9, which +has since then been obsoleted, with the recommendation to developers to bump the +required API level to 10. +As of this writing, according to http://developer.android.com/about/dashboards/index.html +about 90% of the Android devices accessing Google Play support API level 10 or +higher (March 2013). + +================================================================================ + A note regarding the use of the "dirty rectangles" rendering technique +================================================================================ + +If your app uses a variation of the "dirty rectangles" rendering technique, +where you only update a portion of the screen on each frame, you may notice a +variety of visual glitches on Android, that are not present on other platforms. +This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2 +contexts, in particular the use of the eglSwapBuffers function. As stated in the +documentation for the function "The contents of ancillary buffers are always +undefined after calling eglSwapBuffers". +Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED +is not possible for SDL as it requires EGL 1.4, available only on the API level +17+, so the only workaround available on this platform is to redraw the entire +screen each frame. + +Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html + +================================================================================ + Known issues +================================================================================ + +- TODO. I'm sure there's a bunch more stuff I haven't thought of diff --git a/README-cmake.txt b/README-cmake.txt new file mode 100644 index 0000000000..63c762b53b --- /dev/null +++ b/README-cmake.txt @@ -0,0 +1,31 @@ +================================================================================ +CMake build system for SDL (www.cmake.org) +================================================================================ + +SDL's build system was traditionally based on autotools. Over time, this +approach has suffered from several issues across the different supported +platforms. +To solve these problems, a new build system based on CMake is under development. +It works in parallel to the legacy system, so users can experiment with it +without complication. +While still experimental, the build system should be usable on the following +platforms: + + * FreeBSD + * Linux + * VS.NET 2010 + * MinGW and Msys + * OS X with support for XCode + +================================================================================ +Usage +================================================================================ + +Assuming the source for SDL is located at ~/sdl + +cd ~ +mkdir build +cd build +cmake ../sdl + +This will build the static and dynamic versions of SDL in the ~/build directory. diff --git a/README-directfb.txt b/README-directfb.txt new file mode 100644 index 0000000000..e358278ca6 --- /dev/null +++ b/README-directfb.txt @@ -0,0 +1,106 @@ +SDL on DirectFB + +Supports: + +- Hardware YUV overlays +- OpenGL - software only +- 2D/3D accelerations (depends on directfb driver) +- multiple displays +- windows + +What you need: + +DirectFB 1.0.1, 1.2.x, 1.3.0 +Kernel-Framebuffer support: required: vesafb, radeonfb .... +Mesa 7.0.x - optional for OpenGL + +/etc/directfbrc + +This file should contain the following lines to make +your joystick work and avoid crashes: +------------------------ +disable-module=joystick +disable-module=cle266 +disable-module=cyber5k +no-linux-input-grab +------------------------ + +To disable to use x11 backend when DISPLAY variable is found use + +export SDL_DIRECTFB_X11_CHECK=0 + +To disable the use of linux input devices, i.e. multimice/multikeyboard support, +use + +export SDL_DIRECTFB_LINUX_INPUT=0 + +To use hardware accelerated YUV-overlays for YUV-textures, use: + +export SDL_DIRECTFB_YUV_DIRECT=1 + +This is disabled by default. It will only support one +YUV texture, namely the first. Every other YUV texture will be +rendered in software. + +In addition, you may use (directfb-1.2.x) + +export SDL_DIRECTFB_YUV_UNDERLAY=1 + +to make the YUV texture an underlay. This will make the cursor to +be shown. + +Simple Window Manager +===================== + +The driver has support for a very, very basic window manager you may +want to use when running with "wm=default". Use + +export SDL_DIRECTFB_WM=1 + +to enable basic window borders. In order to have the window title rendered, +you need to have the following font installed: + +/usr/share/fonts/truetype/freefont/FreeSans.ttf + +OpenGL Support +============== + +The following instructions will give you *software* OpenGL. However this +works at least on all directfb supported platforms. + +As of this writing 20100802 you need to pull Mesa from git and do the following: + +------------------------ +git clone git://anongit.freedesktop.org/git/mesa/mesa +cd mesa +git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a +------------------------ + +Edit configs/linux-directfb so that the Directories-section looks like +------------------------ +# Directories +SRC_DIRS = mesa glu +GLU_DIRS = sgi +DRIVER_DIRS = directfb +PROGRAM_DIRS = +------------------------ + +make linux-directfb +make + +echo Installing - please enter sudo pw. + +sudo make install INSTALL_DIR=/usr/local/dfb_GL +cd src/mesa/drivers/directfb +make +sudo make install INSTALL_DIR=/usr/local/dfb_GL +------------------------ + +To run the SDL - testprograms: + +export SDL_VIDEODRIVER=directfb +export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib +export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7 + +./testgl + diff --git a/README-gesture.txt b/README-gesture.txt new file mode 100644 index 0000000000..4d0a8d681b --- /dev/null +++ b/README-gesture.txt @@ -0,0 +1,72 @@ +=========================================================================== +Dollar Gestures +=========================================================================== +SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures. + +Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up. + +Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID. + +Recording: +---------- +To begin recording on a touch device call: +SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices. + +Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event. +A SDL_DOLLARRECORD event is a dgesture with the following fields: + +event.dgesture.touchId - the Id of the touch used to record the gesture. +event.dgesture.gestureId - the unique id of the recorded gesture. + + +Performing: +----------- +As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields: + +event.dgesture.touchId - the Id of the touch which performed the gesture. +event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke. +event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match. +event.dgesture.numFingers - the number of fingers used to draw the stroke. + +Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed). + + + +Saving: +------- +To save a template, call SDL_SaveDollarTemplate(gestureId, src) where gestureId is the id of the gesture you want to save, and src is an SDL_RWops pointer to the file where the gesture will be stored. + +To save all currently loaded templates, call SDL_SaveAllDollarTemplates(src) where source is an SDL_RWops pointer to the file where the gesture will be stored. + +Both functions return the number of gestures successfully saved. + + +Loading: +-------- +To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file. + +SDL_LoadDollarTemplates returns the number of templates successfully loaded. + + + +=========================================================================== +Multi Gestures +=========================================================================== +SDL provides simple support for pinch/rotate/swipe gestures. +Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields: + +event.mgesture.touchId - the Id of the touch on which the gesture was performed. +event.mgesture.x - the normalized x coordinate of the gesture. (0..1) +event.mgesture.y - the normalized y coordinate of the gesture. (0..1) +event.mgesture.dTheta - the amount that the fingers rotated during this motion. +event.mgesture.dDist - the amount that the fingers pinched during this motion. +event.mgesture.numFingers - the number of fingers used in the gesture. + + +=========================================================================== +Notes +=========================================================================== +For a complete example see test/testgesture.c + +Please direct questions/comments to: + jim.tla+sdl_touch@gmail.com diff --git a/README-hg.txt b/README-hg.txt new file mode 100644 index 0000000000..32fb8f99d1 --- /dev/null +++ b/README-hg.txt @@ -0,0 +1,23 @@ +The latest development version of SDL is available via Mercurial. +Mercurial allows you to get up-to-the-minute fixes and enhancements; +as a developer works on a source tree, you can use "hg" to mirror that +source tree instead of waiting for an official release. Please look +at the Mercurial website ( http://mercurial.selenic.com/ ) for more +information on using hg, where you can also download software for +Mac OS X, Windows, and Unix systems. + + hg clone http://hg.libsdl.org/SDL + +If you are building SDL with an IDE, you will need to copy the file +include/SDL_config.h.default to include/SDL_config.h before building. + +If you are building SDL via configure, you will need to run autogen.sh +before running configure. + +There is a web interface to the subversion repository at: + + http://hg.libsdl.org/SDL/ + +There is an RSS feed available at that URL, for those that want to +track commits in real time. + diff --git a/README-ios.txt b/README-ios.txt new file mode 100644 index 0000000000..ee0a16d4a4 --- /dev/null +++ b/README-ios.txt @@ -0,0 +1,222 @@ +============================================================================== +Building the Simple DirectMedia Layer for iPhone OS 2.0 +============================================================================== + +Requirements: Mac OS X v10.5 or later and the iPhone SDK. + +Instructions: +1. Open SDL.xcodeproj (located in Xcode-iOS/SDL) in XCode. +2. Select your desired target, and hit build. + +There are three build targets: +- libSDL.a: + Build SDL as a statically linked library +- testsdl + Build a test program (there are known test failures which are fine) +- Template: + Package a project template together with the SDL for iPhone static libraries and copies of the SDL headers. The template includes proper references to the SDL library and headers, skeleton code for a basic SDL program, and placeholder graphics for the application icon and startup screen. + +============================================================================== +Build SDL for iOS from the command line +============================================================================== + +1. cd (PATH WHERE THE SDL CODE IS)/build-scripts +2. ./iosbuild.sh + +If everything goes fine, you should see a build/ios directory, inside there's +two directories "lib" and "include". +"include" contains a copy of the SDL headers that you'll need for your project, +make sure to configure XCode to look for headers there. +"lib" contains find two files, libSDL2.a and libSDL2main.a, you have to add both +to your XCode project. These libraries contain three architectures in them, +armv6 for legacy devices, armv7, and i386 (for the simulator). +By default, iosbuild.sh will autodetect the SDK version you have installed using +xcodebuild -showsdks, and build for iOS >= 3.0, you can override this behaviour +by setting the MIN_OS_VERSION variable, ie: + +MIN_OS_VERSION=4.2 ./iosbuild.sh + +============================================================================== +Using the Simple DirectMedia Layer for iOS +============================================================================== + +FIXME: This needs to be updated for the latest methods + +Here is the easiest method: +1. Build the SDL libraries (libSDL.a and libSDLSimulator.a) and the iPhone SDL Application template. +1. Install the iPhone SDL Application template by copying it to one of XCode's template directories. I recommend creating a directory called "SDL" in "/Developer/Platforms/iOS.platform/Developer/Library/XCode/Project Templates/" and placing it there. +2. Start a new project using the template. The project should be immediately ready for use with SDL. + +Here is a more manual method: +1. Create a new iPhone view based application. +2. Build the SDL static libraries (libSDL.a and libSDLSimulator.a) for iPhone and include them in your project. XCode will ignore the library that is not currently of the correct architecture, hence your app will work both on iPhone and in the iPhone Simulator. +3. Include the SDL header files in your project. +4. Remove the ApplicationDelegate.h and ApplicationDelegate.m files -- SDL for iPhone provides its own UIApplicationDelegate. Remove MainWindow.xib -- SDL for iPhone produces its user interface programmatically. +5. Delete the contents of main.m and program your app as a regular SDL program instead. You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code. + +============================================================================== +Notes -- Application events +============================================================================== + +On iOS the application goes through a fixed life cycle and you will get +notifications of state changes via application events. When these events +are delivered you must handle them in an event callback because the OS may +not give you any processing time after the events are delivered. + +e.g. + +int HandleAppEvents(void *userdata, SDL_Event *event) +{ + switch (event->type) + { + case SDL_APP_TERMINATING: + /* Terminate the app. + Shut everything down before returning from this function. + */ + return 0; + case SDL_APP_LOWMEMORY: + /* You will get this when your app is paused and iOS wants more memory. + Release as much memory as possible. + */ + return 0; + case SDL_APP_WILLENTERBACKGROUND: + /* Prepare your app to go into the background. Stop loops, etc. + This gets called when the user hits the home button, or gets a call. + */ + return 0; + case SDL_APP_DIDENTERBACKGROUND: + /* This will get called if the user accepted whatever sent your app to the background. + If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops. + When you get this, you have 5 seconds to save all your state or the app will be terminated. + Your app is NOT active at this point. + */ + return 0; + case SDL_APP_WILLENTERFOREGROUND: + /* This call happens when your app is coming back to the foreground. + Restore all your state here. + */ + return 0; + case SDL_APP_DIDENTERFOREGROUND: + /* Restart your loops here. + Your app is interactive and getting CPU again. + */ + return 0; + default: + /* No special processing, add it to the event queue */ + return 1; + } +} + +int main(int argc, char *argv[]) +{ + SDL_SetEventFilter(HandleAppEvents, NULL); + + ... run your main loop + + return 0; +} + + +============================================================================== +Notes -- Accelerometer as Joystick +============================================================================== + +SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory. + +The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF. + +============================================================================== +Notes -- OpenGL ES +============================================================================== + +Your SDL application for iPhone uses OpenGL ES for video by default. + +OpenGL ES for iPhone supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute. + +If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0. + +Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 1. + +============================================================================== +Notes -- Keyboard +============================================================================== + +The SDL keyboard API has been extended to support on-screen keyboards: + +void SDL_StartTextInput() + -- enables text events and reveals the onscreen keyboard. +void SDL_StopTextInput() + -- disables text events and hides the onscreen keyboard. +SDL_bool SDL_IsTextInputActive() + -- returns whether or not text events are enabled (and the onscreen keyboard is visible) + +============================================================================== +Notes -- Reading and Writing files +============================================================================== + +Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory. + +Once your application is installed its directory tree looks like: + +MySDLApp Home/ + MySDLApp.app + Documents/ + Library/ + Preferences/ + tmp/ + +When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences". + +More information on this subject is available here: +http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html + +============================================================================== +Notes -- iPhone SDL limitations +============================================================================== + +Windows: + Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow the flag SDL_WINDOW_BORDERLESS). + +Textures: + The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats. + +Loading Shared Objects: + This is disabled by default since it seems to break the terms of the iPhone SDK agreement. It can be re-enabled in SDL_config_iphoneos.h. + +============================================================================== +Game Center +============================================================================== + +Game Center integration requires that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using: + +int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); + +This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run. + +e.g. + +extern "C" +void ShowFrame(void*) +{ + ... do event handling, frame logic and rendering +} + +int main(int argc, char *argv[]) +{ + ... initialize game ... + +#if __IPHONEOS__ + // Initialize the Game Center for scoring and matchmaking + InitGameCenter(); + + // Set up the game to run in the window animation callback on iOS + // so that Game Center and so forth works correctly. + SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL); +#else + while ( running ) { + ShowFrame(0); + DelayFrame(); + } +#endif + return 0; +} diff --git a/README-macosx.txt b/README-macosx.txt new file mode 100644 index 0000000000..c5cc89b5bc --- /dev/null +++ b/README-macosx.txt @@ -0,0 +1,186 @@ +============================================================================== +Using the Simple DirectMedia Layer with Mac OS X +============================================================================== + +These instructions are for people using Apple's Mac OS X (pronounced +"ten"). + +From the developer's point of view, OS X is a sort of hybrid Mac and +Unix system, and you have the option of using either traditional +command line tools or Apple's IDE Xcode. + +To build SDL using the command line, use the standard configure and make +process: + + ./configure + make + sudo make install + +You can also build SDL as a Universal library (a single binary for both +PowerPC and Intel architectures), on Mac OS X 10.4 and newer, by using +the fatbuild.sh script in build-scripts: + sh build-scripts/fatbuild.sh + sudo build-scripts/fatbuild.sh install +This script builds SDL with 10.2 ABI compatibility on PowerPC and 10.4 +ABI compatibility on Intel architectures. For best compatibility you +should compile your application the same way. A script which wraps +gcc to make this easy is provided in test/gcc-fat.sh + +To use the library once it's built, you essential have two possibilities: +use the traditional autoconf/automake/make method, or use Xcode. + +============================================================================== +Using the Simple DirectMedia Layer with a traditional Makefile +============================================================================== + +An existing autoconf/automake build system for your SDL app has good chances +to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary +that you can distribute to users, you need to put the generated binary into a +so called "bundle", which basically is a fancy folder with a name like +"MyCoolGame.app". + +To get this build automatically, add something like the following rule to +your Makefile.am: + +bundle_contents = APP_NAME.app/Contents +APP_NAME_bundle: EXE_NAME + mkdir -p $(bundle_contents)/MacOS + mkdir -p $(bundle_contents)/Resources + echo "APPL????" > $(bundle_contents)/PkgInfo + $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ + +You should replace EXE_NAME with the name of the executable. APP_NAME is what +will be visible to the user in the Finder. Usually it will be the same +as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME +usually is "TestGame". You might also want to use @PACKAGE@ to use the package +name as specified in your configure.in file. + +If your project builds more than one application, you will have to do a bit +more. For each of your target applications, you need a separate rule. + +If you want the created bundles to be installed, you may want to add this +rule to your Makefile.am: + +install-exec-hook: APP_NAME_bundle + rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app + mkdir -p $(DESTDIR)$(prefix)/Applications/ + cp -r $< /$(DESTDIR)$(prefix)Applications/ + +This rule takes the Bundle created by the rule from step 3 and installs them +into $(DESTDIR)$(prefix)/Applications/. + +Again, if you want to install multiple applications, you will have to augment +the make rule accordingly. + + +But beware! That is only part of the story! With the above, you end up with +a bare bone .app bundle, which is double clickable from the Finder. But +there are some more things you should do before shipping your product... + +1) The bundle right now probably is dynamically linked against SDL. That + means that when you copy it to another computer, *it will not run*, + unless you also install SDL on that other computer. A good solution + for this dilemma is to static link against SDL. On OS X, you can + achieve that by linking against the libraries listed by + sdl-config --static-libs + instead of those listed by + sdl-config --libs + Depending on how exactly SDL is integrated into your build systems, the + way to achieve that varies, so I won't describe it here in detail +2) Add an 'Info.plist' to your application. That is a special XML file which + contains some meta-information about your application (like some copyright + information, the version of your app, the name of an optional icon file, + and other things). Part of that information is displayed by the Finder + when you click on the .app, or if you look at the "Get Info" window. + More information about Info.plist files can be found on Apple's homepage. + + +As a final remark, let me add that I use some of the techniques (and some +variations of them) in Exult and ScummVM; both are available in source on +the net, so feel free to take a peek at them for inspiration! + + +============================================================================== +Using the Simple DirectMedia Layer with Xcode +============================================================================== + +These instructions are for using Apple's Xcode IDE to build SDL applications. + +- First steps + +The first thing to do is to unpack the Xcode.tar.gz archive in the +top level SDL directory (where the Xcode.tar.gz archive resides). +Because Stuffit Expander will unpack the archive into a subdirectory, +you should unpack the archive manually from the command line: + cd [path_to_SDL_source] + tar zxf Xcode.tar.gz +This will create a new folder called Xcode, which you can browse +normally from the Finder. + +- Building the Framework + +The SDL Library is packaged as a framework bundle, an organized +relocatable folder hierarchy of executable code, interface headers, +and additional resources. For practical purposes, you can think of a +framework as a more user and system-friendly shared library, whose library +file behaves more or less like a standard UNIX shared library. + +To build the framework, simply open the framework project and build it. +By default, the framework bundle "SDL.framework" is installed in +/Library/Frameworks. Therefore, the testers and project stationary expect +it to be located there. However, it will function the same in any of the +following locations: + + ~/Library/Frameworks + /Local/Library/Frameworks + /System/Library/Frameworks + +- Build Options + There are two "Build Styles" (See the "Targets" tab) for SDL. + "Deployment" should be used if you aren't tweaking the SDL library. + "Development" should be used to debug SDL apps or the library itself. + +- Building the Testers + Open the SDLTest project and build away! + +- Using the Project Stationary + Copy the stationary to the indicated folders to access it from + the "New Project" and "Add target" menus. What could be easier? + +- Setting up a new project by hand + Some of you won't want to use the Stationary so I'll give some tips: + * Create a new "Cocoa Application" + * Add src/main/macosx/SDLMain.m , .h and .nib to your project + * Remove "main.c" from your project + * Remove "MainMenu.nib" from your project + * Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path + * Add "$(HOME)/Library/Frameworks" to the frameworks search path + * Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS" + * Set the "Main Nib File" under "Application Settings" to "SDLMain.nib" + * Add your files + * Clean and build + +- Building from command line + Use pbxbuild in the same directory as your .pbproj file + +- Running your app + You can send command line args to your app by either invoking it from + the command line (in *.app/Contents/MacOS) or by entering them in the + "Executables" panel of the target settings. + +- Implementation Notes + Some things that may be of interest about how it all works... + * Working directory + As defined in the SDL_main.m file, the working directory of your SDL app + is by default set to its parent. You may wish to change this to better + suit your needs. + * You have a Cocoa App! + Your SDL app is essentially a Cocoa application. When your app + starts up and the libraries finish loading, a Cocoa procedure is called, + which sets up the working directory and calls your main() method. + You are free to modify your Cocoa app with generally no consequence + to SDL. You cannot, however, easily change the SDL window itself. + Functionality may be added in the future to help this. + + +Known bugs are listed in the file "BUGS" diff --git a/README-pandora.txt b/README-pandora.txt new file mode 100644 index 0000000000..f70ed6725f --- /dev/null +++ b/README-pandora.txt @@ -0,0 +1,16 @@ +SDL 2.0 with open pandora console support ( http://openpandora.org/ ) +===================================================================== + +- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES +support to work on the pandora under the framebuffer. This driver do not have +input support for now, so if you use it you will have to add your own control code. +The video driver name is "pandora" so if you have problem running it from +the framebuffer, try to set the following variable before starting your application : +"export SDL_VIDEODRIVER=pandora" + +- OpenGL ES support was added to the x11 driver, so it's working like the normal +x11 driver one with OpenGLX support, with SDL input event's etc.. + + +David Carré (Cpasjuste) +cpasjuste@gmail.com diff --git a/README-platforms.txt b/README-platforms.txt new file mode 100644 index 0000000000..f30c45a8b0 --- /dev/null +++ b/README-platforms.txt @@ -0,0 +1,30 @@ + +This is a list of the platforms SDL supports, and who maintains them. + +Officially supported platforms +============================== +(code compiles, and thoroughly tested for release) +============================== +Windows XP/Vista/7/8 +Mac OS X 10.5+ +Linux 2.6+ +iOS 5.1.1+ +Android 2.3.3+ + +Unofficially supported platforms +================================ +(code compiles, but not thoroughly tested) +================================ +FreeBSD +NetBSD +OpenBSD +Solaris + +Platforms supported by volunteers +================================= +Haiku - maintained by Axel Dörfler +PSP - maintained by 527721088@qq.com +Pandora - maintained by Scott Smith + +Platforms that need maintainers +=============================== diff --git a/README-porting.txt b/README-porting.txt new file mode 100644 index 0000000000..bea194a4a5 --- /dev/null +++ b/README-porting.txt @@ -0,0 +1,61 @@ + +* Porting To A New Platform + + The first thing you have to do when porting to a new platform, is look at +include/SDL_platform.h and create an entry there for your operating system. +The standard format is __PLATFORM__, where PLATFORM is the name of the OS. +Ideally SDL_platform.h will be able to auto-detect the system it's building +on based on C preprocessor symbols. + +There are two basic ways of building SDL at the moment: + +1. The "UNIX" way: ./configure; make; make install + + If you have a GNUish system, then you might try this. Edit configure.in, + take a look at the large section labelled: + "Set up the configuration based on the target platform!" + Add a section for your platform, and then re-run autogen.sh and build! + +2. Using an IDE: + + If you're using an IDE or other non-configure build system, you'll probably + want to create a custom SDL_config.h for your platform. Edit SDL_config.h, + add a section for your platform, and create a custom SDL_config_{platform}.h, + based on SDL_config.h.minimal and SDL_config.h.in + + Add the top level include directory to the header search path, and then add + the following sources to the project: + src/*.c + src/atomic/*.c + src/audio/*.c + src/cpuinfo/*.c + src/events/*.c + src/file/*.c + src/haptic/*.c + src/joystick/*.c + src/power/*.c + src/render/*.c + src/stdlib/*.c + src/thread/*.c + src/timer/*.c + src/video/*.c + src/audio/disk/*.c + src/audio/dummy/*.c + src/video/dummy/*.c + src/haptic/dummy/*.c + src/joystick/dummy/*.c + src/main/dummy/*.c + src/thread/generic/*.c + src/timer/dummy/*.c + src/loadso/dummy/*.c + + +Once you have a working library without any drivers, you can go back to each +of the major subsystems and start implementing drivers for your platform. + +If you have any questions, don't hesitate to ask on the SDL mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/README-psp.txt b/README-psp.txt new file mode 100644 index 0000000000..e9e32ea5c4 --- /dev/null +++ b/README-psp.txt @@ -0,0 +1,17 @@ +SDL port for the Sony PSP contributed by + Captian Lex + +Credit to + Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP + Geecko for his PSP GU lib "Glib2d" + +Building +-------- +To build for the PSP, make sure psp-config is in the path and run: + make -f Makefile.psp + + + +To Do +------ +PSP Screen Keyboard diff --git a/README-touch.txt b/README-touch.txt new file mode 100644 index 0000000000..07823c9343 --- /dev/null +++ b/README-touch.txt @@ -0,0 +1,84 @@ +=========================================================================== +System Specific Notes +=========================================================================== +Linux: +The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it. + +Mac: +The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do. + +iPhone: +Works out of box. + +Windows: +Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com + +=========================================================================== +Events +=========================================================================== +SDL_FINGERDOWN: +Sent when a finger (or stylus) is placed on a touch device. +Fields: +event.tfinger.touchId - the Id of the touch device. +event.tfinger.fingerId - the Id of the finger which just went down. +event.tfinger.x - the x coordinate of the touch (0..1) +event.tfinger.y - the y coordinate of the touch (0..1) +event.tfinger.pressure - the pressure of the touch (0..1) + +SDL_FINGERMOTION: +Sent when a finger (or stylus) is moved on the touch device. +Fields: +Same as SDL_FINGERDOWN but with additional: +event.tfinger.dx - change in x coordinate during this motion event. +event.tfinger.dy - change in y coordinate during this motion event. + +SDL_FINGERUP: +Sent when a finger (or stylus) is lifted from the touch device. +Fields: +Same as SDL_FINGERDOWN. + + +=========================================================================== +Functions +=========================================================================== +SDL provides the ability to access the underlying Finger structures. +These structures should _never_ be modified. + +The following functions are included from SDL_touch.h + +To get a SDL_TouchID call SDL_GetTouchDevice(index). +This returns a SDL_TouchID. +IMPORTANT: If the touch has been removed, or there is no touch with the given ID, SDL_GetTouchID will return 0. Be sure to check for this! + +The number of touch devices can be queried with SDL_GetNumTouchDevices(). + +A SDL_TouchID may be used to get pointers to SDL_Finger. + +SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device. + +The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following: + + float x = event.tfinger.x; + float y = event.tfinger.y; + + + +To get a SDL_Finger, call SDL_GetTouchFinger(touchID,index), where touchID is a SDL_TouchID, and index is the requested finger. +This returns a SDL_Finger*, or NULL if the finger does not exist, or has been removed. +A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled. +As a result, be very careful to check for NULL return values. + +A SDL_Finger has the following fields: +>x,y,pressure: + The current coordinates of the touch. +>pressure: + The pressure of the touch. + +=========================================================================== +Notes +=========================================================================== +For a complete example see test/testgesture.c + +Please direct questions/comments to: + jim.tla+sdl_touch@gmail.com + (original author, API was changed since) diff --git a/README-wince.txt b/README-wince.txt new file mode 100644 index 0000000000..eaacc49827 --- /dev/null +++ b/README-wince.txt @@ -0,0 +1,9 @@ + +Windows CE is no longer supported by SDL. + +We have left the CE support in SDL 1.2 for those that must have it, and we +will accept patches that support more modern Windows Mobile platforms for +SDL 2.0. + +--ryan. + diff --git a/README.AmigaOS b/README.AmigaOS deleted file mode 100644 index e0d890640d..0000000000 --- a/README.AmigaOS +++ /dev/null @@ -1,12 +0,0 @@ -The AmigaOS code has been removed from SDL, since it had been broken for a - long time and had a few bits of fairly invasive code #ifdef'd into the - SDL core. - -However, there is an OS4 version of SDL here: - http://www.rcdrummond.net/amiga/index.html - -And a MorphOS version here: - http://www.lehtoranta.net/powersdl/ - ---ryan. - diff --git a/README.BeOS b/README.BeOS deleted file mode 100644 index ccdccf598a..0000000000 --- a/README.BeOS +++ /dev/null @@ -1,13 +0,0 @@ - -SDL on BeOS R5 -============== - -You can build SDL on BeOS like any other GNU style package. -e.g. ./configure && make && make install -By default it is installed in /boot/develop/tools/gnupro/{bin,lib,etc.} - -Once you install SDL, you need to copy libSDL.so to /boot/home/config/lib, -so it can be found by the dynamic linker. - -Enjoy! - Sam Lantinga (slouken@libsdl.org) diff --git a/README.DC b/README.DC deleted file mode 100644 index e2fb1d6518..0000000000 --- a/README.DC +++ /dev/null @@ -1,32 +0,0 @@ -SDL for Dreamcast (beta2) - - BERO - berobero@users.sourceforge.net - - http://www.geocities.co.jp/Playtown/2004/ - -this work with kos-newlib -http://sourceforge.net/projects/dcquake/ - -compile -- source environ.sh (from the KOS distribution) -- make -f Makefile.dc - -compile with gl support -- install latest libgl from http://sourceforge.net/projects/dcquake/ -- uncomment GL=1 in Makefile.dc -- make -f Makefile.dc clean -- make -f Makefile.dc - -install -- copy include/*.h and libSDL.a or libSDL_gl.a for your enviroment - -changelog: - -beta2 -- OpenGL support -- Hardware page flip support - -beta -- thread, timer don't tested so much. -- not support OpenGL diff --git a/README.HG b/README.HG deleted file mode 100644 index ecbee0d321..0000000000 --- a/README.HG +++ /dev/null @@ -1,23 +0,0 @@ - -The latest development version of SDL is available via Mercurial. -Mercurial allows you to get up-to-the-minute fixes and enhancements; -as a developer works on a source tree, you can use "hg" to mirror that -source tree instead of waiting for an official release. Please look -at the Mercurial website ( http://mercurial.selenic.com/ ) for more -information on using hg, where you can also download software for -Mac OS X, Windows, and Unix systems. - - hg clone -u SDL-1.2 http://hg.libsdl.org/SDL - -If you are building SDL with an IDE, you will need to copy the file -include/SDL_config.h.default to include/SDL_config.h before building. - -If you are building SDL via configure, you will need to run autogen.sh -before running configure. - -There is a web interface to the subversion repository at: - http://hg.libsdl.org/SDL/ - -There is an RSS feed available at that URL, for those that want to -track commits in real time. - diff --git a/README.MacOS b/README.MacOS deleted file mode 100644 index acfd93578b..0000000000 --- a/README.MacOS +++ /dev/null @@ -1,63 +0,0 @@ - -============================================================================== -Using the Simple DirectMedia Layer with MacOS 7,8,9 on PPC -============================================================================== - -These instructions are for people using the Apple MPW environment: -http://developer.apple.com/tools/mpw-tools/ - -CodeWarrior projects are available in the CWprojects directory. - -============================================================================== -I. Building the Simple DirectMedia Layer libraries: - (This step isn't necessary if you have the SDL binary distribution) - - First, unpack the MPWmake.sea.hqx archive and move SDL.make into the - SDL directory. - - Start MPW - - Set the current directory within MPW to the SDL toplevel directory. - - Build "SDL" (Type Command-B and enter "SDL" in the dialog) - - If everything compiles successfully, you now have the PPC libraries - "SDL" and "SDLmain.o" in the 'lib' subdirectory. - -============================================================================== -II. Building the Simple DirectMedia Layer test programs: - - First, unpack the MPWmake.sea.hqx archive, move the new rsrc directory to - the main SDL directory, and move the makefiles in the new test subdirectory - to the SDL 'test' subdirectory. - - Start MPW - - Set the current directory within MPW to the SDL 'test' subdirectory. - - Build the programs that have an associated MPW makefile (file ending - with .make), including "testwin", "testalpha", and "graywin". - - Copy the SDL library file into the test directory, and run! - -============================================================================== -III. Building the Simple DirectMedia Layer demo programs: - - Copy one of the test program Makefiles to the demo directory - and modify it to match the sources in the demo. - -============================================================================== -IV. Enjoy! :) - - If you have a project you'd like me to know about, or want to ask questions, - go ahead and join the SDL developer's mailing list by sending e-mail to: - - sdl-request@libsdl.org - - and put "subscribe" into the subject of the message. Or alternatively you - can use the web interface: - - http://www.libsdl.org/mailman/listinfo/sdl - -============================================================================== - diff --git a/README.MacOSX b/README.MacOSX deleted file mode 100644 index 2ea9f68761..0000000000 --- a/README.MacOSX +++ /dev/null @@ -1,179 +0,0 @@ -============================================================================== -Using the Simple DirectMedia Layer with Mac OS X -============================================================================== - -These instructions are for people using Apple's Mac OS X (pronounced -"ten"). - -From the developer's point of view, OS X is a sort of hybrid Mac and -Unix system, and you have the option of using either traditional -command line tools or Apple's IDE Xcode. - -To build SDL using the command line, use the standard configure and make -process: - - ./configure - make - sudo make install - -You can also build SDL as a Universal library (a single binary for both -PowerPC and Intel architectures), on Mac OS X 10.4 and newer, by using -the fatbuild.sh script in build-scripts: - sh build-scripts/fatbuild.sh - sudo build-scripts/fatbuild.sh install -This script builds SDL with 10.2 ABI compatibility on PowerPC and 10.4 -ABI compatibility on Intel architectures. For best compatibility you -should compile your application the same way. A script which wraps -gcc to make this easy is provided in test/gcc-fat.sh - -To use the library once it's built, you essential have two possibilities: -use the traditional autoconf/automake/make method, or use Xcode. - -============================================================================== -Using the Simple DirectMedia Layer with a traditional Makefile -============================================================================== - -An existing autoconf/automake build system for your SDL app has good chances -to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary -that you can distribute to users, you need to put the generated binary into a -so called "bundle", which basically is a fancy folder with a name like -"MyCoolGame.app". - -To get this build automatically, add something like the following rule to -your Makefile.am: - -bundle_contents = APP_NAME.app/Contents -APP_NAME_bundle: EXE_NAME - mkdir -p $(bundle_contents)/MacOS - mkdir -p $(bundle_contents)/Resources - echo "APPL????" > $(bundle_contents)/PkgInfo - $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ - -You should replace EXE_NAME with the name of the executable. APP_NAME is what -will be visible to the user in the Finder. Usually it will be the same -as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME -usually is "TestGame". You might also want to use @PACKAGE@ to use the package -name as specified in your configure.in file. - -If your project builds more than one application, you will have to do a bit -more. For each of your target applications, you need a seperate rule. - -If you want the created bundles to be installed, you may want to add this -rule to your Makefile.am: - -install-exec-hook: APP_NAME_bundle - rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app - mkdir -p $(DESTDIR)$(prefix)/Applications/ - cp -r $< /$(DESTDIR)$(prefix)Applications/ - -This rule takes the Bundle created by the rule from step 3 and installs them -into $(DESTDIR)$(prefix)/Applications/. - -Again, if you want to install multiple applications, you will have to augment -the make rule accordingly. - - -But beware! That is only part of the story! With the above, you end up with -a bare bone .app bundle, which is double clickable from the Finder. But -there are some more things you should do before shipping yor product... - -1) The bundle right now probably is dynamically linked against SDL. That - means that when you copy it to another computer, *it will not run*, - unless you also install SDL on that other computer. A good solution - for this dilemma is to static link against SDL. On OS X, you can - achieve that by linkinag against the libraries listed by - sdl-config --static-libs - instead of those listed by - sdl-config --libs - Depending on how exactly SDL is integrated into your build systems, the - way to achieve that varies, so I won't describe it here in detail -2) Add an 'Info.plist' to your application. That is a special XML file which - contains some meta-information about your application (like some copyright - information, the version of your app, the name of an optional icon file, - and other things). Part of that information is displayed by the Finder - when you click on the .app, or if you look at the "Get Info" window. - More information about Info.plist files can be found on Apple's homepage. - - -As a final remark, let me add that I use some of the techniques (and some -variations of them) in Exult and ScummVM; both are available in source on -the net, so feel free to take a peek at them for inspiration! - - -============================================================================== -Using the Simple DirectMedia Layer with Xcode -============================================================================== - -These instructions are for using Apple's Xcode IDE to build SDL applications. - -- First steps - -The Xcode project files are in the "Xcode" directory. - -- Building the Framework - -The SDL Library is packaged as a framework bundle, an organized -relocatable folder heirarchy of executible code, interface headers, -and additional resources. For practical purposes, you can think of a -framework as a more user and system-friendly shared library, whose library -file behaves more or less like a standard UNIX shared library. - -To build the framework, simply open the framework project and build it. -By default, the framework bundle "SDL.framework" is installed in -/Library/Frameworks. Therefore, the testers and project stationary expect -it to be located there. However, it will function the same in any of the -following locations: - - ~/Library/Frameworks - /Local/Library/Frameworks - /System/Library/Frameworks - -- Build Options - There are two "Build Styles" (See the "Targets" tab) for SDL. - "Deployment" should be used if you aren't tweaking the SDL library. - "Development" should be used to debug SDL apps or the library itself. - -- Building the Testers - Open the SDLTest project and build away! - -- Using the Project Stationary - Copy the stationary to the indicated folders to access it from - the "New Project" and "Add target" menus. What could be easier? - -- Setting up a new project by hand - Some of you won't want to use the Stationary so I'll give some tips: - * Create a new "Cocoa Application" - * Add src/main/macosx/SDLMain.m , .h and .nib to your project - * Remove "main.c" from your project - * Remove "MainMenu.nib" from your project - * Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path - * Add "$(HOME)/Library/Frameworks" to the frameworks search path - * Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS" - * Set the "Main Nib File" under "Application Settings" to "SDLMain.nib" - * Add your files - * Clean and build - -- Building from command line - Use pbxbuild in the same directory as your .pbproj file - -- Running your app - You can send command line args to your app by either invoking it from - the command line (in *.app/Contents/MacOS) or by entering them in the - "Executibles" panel of the target settings. - -- Implementation Notes - Some things that may be of interest about how it all works... - * Working directory - As defined in the SDL_main.m file, the working directory of your SDL app - is by default set to its parent. You may wish to change this to better - suit your needs. - * You have a Cocoa App! - Your SDL app is essentially a Cocoa application. When your app - starts up and the libraries finish loading, a Cocoa procedure is called, - which sets up the working directory and calls your main() method. - You are free to modify your Cocoa app with generally no consequence - to SDL. You cannot, however, easily change the SDL window itself. - Functionality may be added in the future to help this. - - -Known bugs are listed in the file "BUGS" diff --git a/README.MiNT b/README.MiNT deleted file mode 100644 index eabe3eb1b7..0000000000 --- a/README.MiNT +++ /dev/null @@ -1,250 +0,0 @@ -============================================================================== -Using the Simple DirectMedia Layer on Atari -============================================================================== - - - If you want to build SDL from sources to create SDL programs on Atari: - see sections I - II. - - If you want to create SDL programs on Atari using SDL binary build, - download it from my web site (URL at end of this file). - - If you want to configure a program using SDL on Atari, - see sections IV - VI. - - -============================================================================== -I. Building the Simple DirectMedia Layer libraries: - (This step isn't necessary if you have the SDL binary distribution) - - Do the classic configure, with --disable-shared --enable-static and: - - Tos version (should run everywhere): - --disable-threads - Tos does not support threads. - - MiNT version (maybe Magic, only for multitasking OS): - --disable-pthreads --enable-pth - Mint and Magic may supports threads, so audio can be used with current - devices, like Sun audio, or disk-writing support. Like Tos, interrupt - audio without threads is more suited for Atari machines. - - Then you can make ; make install it. - -============================================================================== -II. Building the Simple DirectMedia Layer test programs: - - Do the classic configure, then make. - - Run them ! - -============================================================================== -III. Enjoy! :) - - If you have a project you'd like me to know about, or want to ask questions, - go ahead and join the SDL developer's mailing list by sending e-mail to: - - sdl-request@libsdl.org - - and put "subscribe" into the subject of the message. Or alternatively you - can use the web interface: - - http://www.libsdl.org/mailman/listinfo/sdl - -============================================================================== -IV. What is supported: - -Keyboard (GEMDOS, BIOS, GEM, Ikbd) -Mouse (XBIOS, GEM, Ikbd, /dev/mouse (non working atm, disabled)) -Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen)) -Timer (VBL vector, GNU pth library) -Joysticks and joypads (Ikbd, Hardware) -Audio (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled) -Threads (Multitasking OS only via GNU pth library) -Shared object loader (using LDG library from http://ldg.atari.org/) -Audio CD (MetaDOS) -OpenGL (using Mesa offscreen rendering driver) - -- Dependent driver combinations: -Video Kbd Mouse Timer Joysticks -xbios ikbd ikbd vbl(2) ikbd -xbios gemdos xbios vbl(2) xbios -xbios bios xbios vbl(2) xbios -gem gem gem(1) vbl(2) xbios - -Audio O/S Misc -dma8 All Uses MFP Timer A interrupt -xbios TOS Uses MFP Timer A interrupt -xbios MiNT Uses MFP Timer A interrupt -xbios Magic Uses MFP Timer A interrupt -stfa All Uses MFP interrupt -mcsn TOS Uses MFP Timer A interrupt -mcsn MiNT Uses MiNT thread -mcsn Magic Disabled -gsxb All Uses GSXB callback - -Joypad driver always uses hardware access. -OpenGL driver always uses OSMesa. - -(1) GEM does not report relative mouse motion, so xbios mouse driver is used -to report this type event. -A preliminary driver for /dev/mouse device driver is present, but is disabled -till it can be used with other applications simultaneously. - -(2) If you build SDL with threads using the GNU pth library, timers are -supported via the pth library. - -============================================================================== -V. Environment variables: - -SDL_VIDEODRIVER: - Set to 'xbios' to force xbios video driver - Set to 'gem' to force gem video driver - -SDL_VIDEO_GL_DRIVER: - Set to filename to load as OpenGL library, if you use SDL_GL_LoadLibrary() - -SDL_AUDIODRIVER: - Set to 'mint_gsxb' to force Atari GSXB audio driver - Set to 'mint_mcsn' to force Atari MCSN audio driver - Set to 'mint_stfa' to force Atari STFA audio driver - Set to 'mint_xbios' to force Atari Xbios audio driver - Set to 'mint_dma8' to force Atari 8 bits DMA audio driver - Set to 'audio' to force Sun /dev/audio audio driver - Set to 'disk' to force disk-writing audio driver - -SDL_ATARI_EVENTSDRIVER - Set to 'ikbd' to force IKBD 6301 keyboard driver - Set to 'gemdos' to force gemdos keyboard driver - Set to 'bios' to force bios keyboard driver - -SDL_JOYSTICK_ATARI: - Use any of these strings in the environment variable to enable or - disable a joystick: - - 'ikbd-joy1-[on|off]' for IKBD joystick on port 1 (hardware access) - 'xbios-joy1-[on|off]' for IKBD joystick on port 1 (xbios access) - 'porta-pad-[on|off]' for joypad and/or teamtap on port A - 'porta-joy0-[on|off]' for joystick 0 on port A - 'porta-joy1-[on|off]' for joystick 1 on port A - 'porta-lp-[on|off]' for lightpen on port A - 'porta-anpad-[on|off]' for analog paddle on port A - 'portb-pad-[on|off]' for joypad and/or teamtap on port B - 'portb-joy0-[on|off]' for joystick 0 on port B - 'portb-joy1-[on|off]' for joystick 1 on port B - 'portb-anpad-[on|off]' for analog paddle on port B - - Default configuration is: - 'ikbd-joy1-on' (if IKBD events driver enabled) - 'xbios-joy1-on' (if gemdos/bios/gem events driver enabled) - 'porta-pad-on portb-pad-on' (if available on the machine) - - port[a|b]-[pad|joy?|lp|anpad]-* strings are mutually exclusives. - On such a port, you can only use a joypad OR 1 or 2 joysticks OR - a lightpen OR an analog paddle. You must disable joypad before - setting another controller. - - The second joystick port on IKBD is used by the mouse, so not usable. - Another problem with the IKBD: mouse buttons and joystick fire buttons - are wired together at the hardware level, it means: - port 0 port 0 port 1 - mouse left button = joystick fire 0 = joystick fire 1 - mouse right button = joystick fire 1 = joystick fire 0 - - Descriptions of joysticks/joypads: - - Joypads: 1 hat, 17 buttons (Atari Jaguar console-like). - - Joysticks: 1 hat, 1 button. - - Lightpen, analog paddles: 2 axis, 2 buttons. The 2 buttons are those - affected to 1 button joysticks on the same port. - -============================================================================== -VI. More informations about drivers: - -OpenGL: - The default is to use the Mesa offscreen driver (osmesa.ldg). If you want - to use an older OpenGL implementation, like mesa_gl.ldg or tiny_gl.ldg, - your program must use SDL_GL_LoadLibrary() to do so, and retrieve the - needed function pointers with SDL_LoadFunction(). In all cases, the OpenGL - context is taken care of by SDL itself, you just have to use gl* functions. - - However, there is one OpenGL call that has a different prototype in the old - implementations: glOrtho(). In the old implementations, it has 6 float as - parameters, in the standard one, it has 6 double parameters. If you want - to compile testdyngl, or any other SDL program that loads its OpenGL - library, you must change the glOrtho() prototype used in this program. In - osmesa.ldg, you can retrieve a glOrtho() with double parameters, by - searching for the function "glOrtho6d". - -Xbios video: - Video chip is detected using the _VDO cookie. - Screen enhancers are not supported, but could be if you know how to - use them. - - ST, STE, Mega ST, Mega STE: - 320x200x4 bits, shades of grey, available only for the purpose - of testing SDL. - TT: - 320x480x8 and 320x240x8 (software double-lined mode). - Falcon: - All modes supported by the current monitor (RVB or VGA). - BlowUp and Centscreen extended modes, ScreenBlaster 3 current mode. - Milan: - Experimental support - Clones and any machine with monochrome monitor: - Not supported. - -Gem video: - Automatically used if xbios not available. - - All machines: - Only the current resolution, if 8 bits or higher depth. - -IKBD keyboard, mouse and joystick driver: - Available if _MCH cookie is ST, Mega ST, STE, Mega STE, TT or Falcon. - - Hades has an IKBD, but xbios is not available for video, so IKBD - driver is disabled. - -Gemdos and bios keyboard driver: - Available on all machines. - -Mouse and joystick xbios driver: - Available on all machines (I think). - -Joypad driver: - Available if _MCH cookie is STE or Falcon. Supports teamtap. - -PTH timer driver: - Available with multitasking OS. - -VBL timer driver: - Available on all machines (I think). - -Audio drivers: - Cookies _SND, MCSN, STFA and GSXB used to detect supported audio - capabilities. - - STE, Mega STE, TT: - 8 bits DMA (hardware access) - STFA, MCSN or GSXB driver if installed - Falcon: - 8 bits DMA (hardware access) - Xbios functions - STFA, MCSN or GSXB driver if installed - Other machines: - STFA, MCSN or GSXB driver if installed - - STFA driver: - http://removers.free.fr/softs/stfa.html - GSXB driver: - http://assemsoft.atari.org/gsxb/ - MacSound driver: - http://jf.omnis.ch/software/tos/ - MagicSound driver (MCSN,GSXB compatible): - http://perso.wanadoo.fr/didierm/ - X-Sound driver (GSXB compatible): - http://www.uni-ulm.de/~s_thuth/atari/xsound_e.html - --- -Patrice Mandin -http://pmandin.atari.org/ diff --git a/README.NDS b/README.NDS deleted file mode 100644 index e96a9eeecb..0000000000 --- a/README.NDS +++ /dev/null @@ -1,22 +0,0 @@ -The SDL port to the Nintendo DS - -This port uses the devKitPro toolchain, available from: -http://www.devkitpro.org - -Precompiled tools for cross-compiling on Linux are available from: -http://www.libsdl.org/extras/nds/devkitPro-20070503-linux.tar.gz - -todo: -add ds console specific features/optimizations -mouse/keyboard support -dual screen support - -build with: -cp include/SDL_config_nds.h include/SDL_config.h -make -f Makefile.ds - -included is an arm9/arm7 template to allow for sound streaming support. - -Enjoy, fix the source and share :) -Troy Davis(GPF) -http://gpf.dcemu.co.uk/ diff --git a/README.NanoX b/README.NanoX deleted file mode 100644 index 8418ff3320..0000000000 --- a/README.NanoX +++ /dev/null @@ -1,97 +0,0 @@ - ================================================================= - Patch version 0.9 of SDL(Simple DirectMedia Layer) for Nano-X API - ================================================================= - - Authors: Hsieh-Fu Tsai, clare@setabox.com - Greg Haerr, greg@censoft.com - - This patch is against SDL version 1.2.4. - It enhances previous patch 0.8 by providing direct framebuffer - access as well as dynamic hardware pixel type support, not - requiring a compile-time option setting for different framebuffer - modes. - Tested against Microwindows version 0.89pre9. - - Older Microwindows versions - =========================== - If running on a version older than Microwindows 0.89pre9, - the following items might need to be patched in Microwindows. - - 1. Patch src/nanox/client.c::GrClose() - It fixes the client side GrClose(). In the original version, - GrOpen() can only be called once. When the GrOpen() is called at - the second time, the program will terminate. In order to prevent - this situation, we need to insert "nxSocket = -1" after - "close(nxSocket)" in GrClose(). If you do not have this problem, - you may skip this step. - - 2. Patch src/nanox/clientfb.c to return absolute x,y coordinates - when using GrGetWindowFBInfo(). Copy the version 0.89pre9 - of src/nanox/clientfb.c to your system, or configure - using --disable-nanox-direct-fb. - - ============= - Quick Install - ============= - - 1. ./configure --disable-video-x11 --disable-video-fbcon \ - --enable-video-nanox \ - --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal] - 2. make clean - 3. make - 4. make install (as root) - - ============ - Nitty-gritty - ============ - - --enable-nanox-direct-fb Use direct framebuffer access - --enable-nanox-debug Show debug messages - --enable-nanox-share-memory Use shared-memory to speed up - - When running multi-threaded applications using SDL, such - as SMPEG, set THREADSAFE=Y in Microwindows' config file, - to enable GrXXX() system call critical section support. - - ============================================= - Some programs can be used to test this patch. - ============================================= - - 1. http://www.cs.berkeley.edu/~weimer/atris (a tetris-like game) - 2. http://www.libsdl.org/projects/newvox/ - 3. http://www.libsdl.org/projects/xflame/ - 4. http://www.libsdl.org/projects/optimum/ - 5. http://www.gnugeneration.com/software/loop/ - 6: http://www.lokigames.com/development/smpeg.php3 (SMPEG version 0.4.4) - - ========= - Todo List - ========= - - 1. Create hardware surface - 2. Create YUVOverlay on hardware - 3. Use OpenGL - 4. Gamma correction - 5. Hide/Change mouse pointer - 6. Better window movement control with direct fb access - 7. Palette handling in 8bpp could be improved - - ===================== - Supporting Institutes - ===================== - - Many thanks to go to Setabox Co., Ltd. and CML (Communication and - Multimedia Laboratory, http://www.cmlab.csie.ntu.edu.tw/) in the - Department of Computer Science and Information Engineering of - National Taiwan University for supporting this porting project. - - Century Embedded Technologies (http://embedded.censoft.com) - for this patch. - - =================== - Contact Information - =================== - - Welcome to give me any suggestion and to report bugs. - My e-mail address : clare@setabox.com or niky@cmlab.csie.ntu.edu.tw - or greg@censoft.com diff --git a/README.OS2 b/README.OS2 deleted file mode 100644 index 424b3739c3..0000000000 --- a/README.OS2 +++ /dev/null @@ -1,281 +0,0 @@ - -=========== -SDL on OS/2 -=========== - -Last updated on May. 17, 2006. - - -1. How to compile? ------------------- - -To compile this, you'll need the followings installed: -- The OS/2 Developer's Toolkit -- The OpenWatcom compiler - (http://www.openwatcom.org) - -First of all, you have to unzip the Watcom-OS2.zip file. This will result in a -file called "makefile" and a file called "setvars.cmd" in this folder (and some -more files...). - -Please edit the second, fourth and fifth lines of setvars.cmd file -to set the folders where the toolkit, the OW compiler and the FSLib are. -You won't need NASM yet (The Netwide Assembler), you can leave that line. -Run setvars.cmd, and you should get a shell in which you can -compile SDL. - -Check the "makefile" file. There is a line in there which determines if the -resulting SDL.DLL will be a 'debug' or a 'release' build. The 'debug' version -is full of printf()'s, so if something goes wrong, its output can help a lot -for debugging. - -Then run "wmake". -This should create the SDL12.DLL and the corresponding SDL12.LIB file here. - -To test applications, it's a good idea to use the 'debug' build of SDL, and -redirect the standard output and standard error output to files, to see what -happens internally in SDL. -(like: testsprite >stdout.txt 2>stderr.txt) - -To rebuild SDL, use the following commands in this folder: -wmake clean -wmake - - - -2. How to compile the testapps? -------------------------------- - -Once you have SDL12.DLL compiled, navigate into the 'test' folder, copy in -there the newly built SDL12.DLL, and copy in there FSLib.DLL. - -Then run "wmake" in there to compile some of the testapps. - - - -3. What is missing? -------------------- - -The following things are missing from this SDL implementation: -- MMX, SSE and 3DNOW! optimized video blitters? -- HW Video surfaces -- OpenGL support - - - -4. Special Keys / Full-Screen support -------------------------------------- - -There are two special hot-keys implemented: -- Alt+Home switches between fullscreen and windowed mode -- Alt+End simulates closing the window (can be used as a Panic key) -Only the LEFT Alt key will work. - - - -5. Joysticks on SDL/2 ---------------------- - -The Joystick detection only works for standard joysticks (2 buttons, 2 axes -and the like). Therefore, if you use a non-standard joystick, you should -specify its features in the SDL_OS2_JOYSTICK environment variable in a batch -file or CONFIG.SYS, so SDL applications can provide full capability to your -device. The syntax is: - -SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS] - -So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls, -the line should be: - -SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0 - -If you want to add spaces in your joystick name, just surround it with -quotes or double-quotes: - -SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0 - -or - -SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0 - - Notive However that Balls and Hats are not supported under OS/2, and the -value will be ignored... but it is wise to define these correctly because -in the future those can be supported. - Also the number of buttons is limited to 2 when using two joysticks, -4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes -and 8 when using a joystick with 2 axes. Notice however these are limitations -of the Joystick Port hardware, not OS/2. - - - -6. Proportional windows ------------------------ - -For some SDL applications it can be handy to have proportional windows, so -the windows will keep their aspect ratio when resized. -This can be achieved in two ways: - -- Before starting the given SDL application, set the - SDL_USE_PROPORTIONAL_WINDOW environment variable to something, e.g.: - - SET SDL_USE_PROPORTIONAL_WINDOW=1 - dosbox.exe - -- If you have a HOME environment variable set, then SDL will look for a file - in there called ".sdl.proportionals". If that file contains the name of the - currently running SDL executable, then that process will have proportional - windows automatically. - - Please note that this file is created automatically with default values - at the first run. - - - -7. Audio in SDL applications ----------------------------- - -Audio effects are one of the most important features in games. Creating audio -effects in sync with the game and without hickups and pauses in the audio are -very important things. - -However there are multithreaded SDL applications that have tight loops as their -main logic loop. This kills performance in OS/2, and takes too much CPU from -other threads in the same process, for example from the thread to create the -sound effects. - -For this reason, the OS/2 port of SDL can be instructed to run the audio thread -in high priority, which makes sure that there will be enough time for the -processing of the audio data. - -At default, SDL/2 runs the audio thread at ForegroundServer+0 priority. Well -written and well behaving SDL applications should work well in this mode. -For other applications, you can tell SDL/2 to run the audio thread at -TimeCritical priority by setting an env.variable before starting the SDL app: - - SET SDL_USE_TIMECRITICAL_AUDIO=1 - -Please note that this is a bit risky, because if the SDL application runs a -tight infinite loop in this thread, this will make the whole system -unresponsive, so use it with care, and only for applications that need it! - - - -8. Next steps... ----------------- - -Things to do: -- Implement missing stuffs (look for 'TODO' string in source code!) -- Finish video driver (the 'wincommon' can be a good example for missing - things like application icon and so on...) -- Enable MMX/SSE/SSE2 acceleration functions -- Rewrite CDROM support using DOS Ioctl for better support. - - - -9. Contacts ------------ - - You can contact the developers for bugs: - - Area Developer email - General (Audio/Video/System) Doodle doodle@scenergy.dfmk.hu - CDROM and Joystick Caetano daniel@caetano.eng.br - - Notice however that SDL/2 is 'in development' stage so ... if you want to help, -please, be our guest and contact us! - - - -10. Changelog of the OS/2 port ------------------------------- - -Version 1.2.10 - 2006-05-17 - Doodle - - Small modifications for v1.2.10 release - - Changed DLL name to include version info (currently SDL12.dll) - -Version 1.2 - 2006-05-01 - Doodle - - Modified makefile system to have only one makefile - - Included FSLib headers, DLL and LIB file - -Version 1.2 - 2006-02-26 - Doodle - - Updated the official SDL version with the OS/2 specific changes. - - Added support for real unicode keycode conversion. - -Version 1.2.7 - 2006-01-20 - Doodle - - Added support for selectively using timecritical priority for - audio threads by SDL_USE_TIMECRITICAL_AUDIO environment variable. - (e.g.: - SET SDL_USE_TIMECRITICAL_AUDIO=1 - dosbox.exe - ) - -Version 1.2.7 - 2005-12-22 - Doodle - - Added support for proportional SDL windows. - There are two ways to have proportional (aspect-keeping) windows for - a given SDL application: Either set the SDL_USE_PROPORTIONAL_WINDOW - environment variable to something before starting the application - (e.g.: - SET SDL_USE_PROPORTIONAL_WINDOW=1 - dosbox.exe - ) - or, if you have the HOME environment variable set, then SDL12.DLL will - create a file in that directory called .sdl.proportionals, and you can - put there the name of executable files that will be automatically made - proportional. - -Version 1.2.7 - 2005-10-14 - Doodle - - Enabled Exception handler code in FSLib to be able to restore original - desktop video mode in case the application crashes. - - Added the missing FSLib_Uninitialize() call into SDL. - (The lack of it did not cause problems, but it's cleaner this way.) - - Fixed a mouse problem in Fullscreen mode where any mouse click - re-centered the mouse. - -Version 1.2.7 - 2005-10-09 - Doodle - - Implemented window icon support - -Version 1.2.7 - 2005-10-03 - Doodle - - Reworked semaphore support again - - Tuned thread priorities - -Version 1.2.7 - 2005-10-02 - Doodle - - Added support for custom mouse pointers - - Fixed WM_CLOSE processing: give a chance to SDL app to ask user... - - Added support for MMX-accelerated audio mixers - - Other small fixes - -Version 1.2.7 - 2005-09-12 - Doodle - - Small fixes for DosBox incorporated into public release - - Fixed semaphore support (SDL_syssem.c) - - Fixed FSLib to have good clipping in scaled window mode, - and to prevent occasional desktop freezes. - -Version 1.2.7 - 2004-09-08a - Caetano - - Improved joystick support (general verifications about hardware). - - Added support up to 8 buttons in 2 axes joysticks and 6 buttons in 3 axes joysticks. - - Added support to environment variable SDL_OS2_JOYSTICK to specify a joystick. - - Improved Joystick test to handle every type of joystick and display only relevant information. - - Merged with Doodle 2004-09-08 - - Little tid up in README.OS2 - - Added explanation about SDL_OS2_JOYSTICK environment variable on README.OS2 - -Version 1.2.7 - 2004-09-07 - Caetano - - Merged with changes in headers for GCC compiling. - - Added Joystick support using basic IBM GAME$ support, allowing it to work with all joystick drivers since OS/2 2.1. - - Improved joystick detection (hacked!). OS/2 do not allow real joystick detection, so... - - Modified makefile in test to compile "testjoystick". Anyway, it's useless, since it seems to cause a lot of trouble in OS/2 (because os video routines, not Joystick support). - - Created separated Joystick test program to test only joystick functions. - - Improved joystick auto-centering. - - Improved the coordinate correction routine to use two scale factors for each axis. - -Version 1.2.7 - 2004-07-05 - Caetano - - Corrected the time returned by status in CDROM support (it was incorrect) - - Added the testcdrom.c and corrected the linking directive (it was causing an error) - -Version 1.2.7 - 2004-07-02a - Caetano - - Corrected a little problem in a comment at SDL-1.2.7\test\torturethread.c, line 18 (missing */, nested comment) - - Added CDROM support to tree (SDL-1.2.7\src\cdrom\os2\SDL_syscdrom.c) - - Modified makefile (SDL-1.2.7\src\makefiles.wat and SDL-1.2.7\watcom.mif) to build with CDROM support - - Added the "extra" SDL_types.h forgotten in 2004-07-02 version. - - diff --git a/README.PS3 b/README.PS3 deleted file mode 100644 index c66467d392..0000000000 --- a/README.PS3 +++ /dev/null @@ -1,29 +0,0 @@ - -SDL on Sony Playstation3 ------------------------- - -Installation: - First, you have to install the Cell SDK - - Download the Cell SDK installer RPM and ISO images to - a temporary directory such as /tmp/cellsdk. - - Mount the image: mount -o loop CellSDK-Devel-Fedora_3.1.0.0.0.iso /tmp/cellsdk - - Install the SDK installer: rpm -ivh cell-install-3.1.0-0.0.noarch.rpm - - Install the SDK: cd /opt/cell && ./cellsdk --iso /tmp/cellsdkiso install - - You need to install the SPU-libs before installing SDL - - Go to SDL-1.2/src/video/ps3/spulibs/ - - Run make && make install - - Finally, install SDL - - Go to SDL-1.2/ and build SDL like any other GNU style package. - e.g. - - Build the configure-script with ./autogen.sh - - Configure SDL for your needs: ./configure --enable-video-ps3 ... - - Build and install it: make && make install - - -Todo: - - mouse/keyboard/controller support - -Have fun! - Dirk Herrendoerfer diff --git a/README.PicoGUI b/README.PicoGUI deleted file mode 100644 index cdb6bedaec..0000000000 --- a/README.PicoGUI +++ /dev/null @@ -1,50 +0,0 @@ - ======================== - Using SDL with PicoGUI - ======================== - -- Originally contributed by Micah Dowty - -PicoGUI is a scalable GUI system with a unique architecture, primarily focused -on scalability to various embedded systems. You can find more information -including a FAQ at http://picogui.org - -To use the patch: - - 1. When compiling, add the "--enable-video-picogui" switch to ./configure - - 2. When running your program, ensure that the picogui driver for SDL - is in use by setting the SDL_VIDEODRIVER environment variable - to "picogui". - - 3. The program must also be linked to the C client library for PicoGUI - (libpgui.so). If the program is being compiled with a patched SDL - installed this should be done automatically. If you want to use an - existing binary with PicoGUI, you can set the LD_PRELOAD environment - variable to the path of your libpgui.so file. - -Capabilities: - - So far only basic functionality is provided on true color (linear16/24/32) - devices. Accessing a memory mapped bitmap, updating the display, and handling - mouse/keyboard input. This functionality has been tested with several - applications, including mplayer, Xine, sldroids, and Abuse. - -TODO list: - - - YUV overlays will be helpful for watching video on set top boxes or other - embedded devices that have some graphics acceleration hardware - - - Account for rotated bitmap storage in pgserver - - - Support for hiding or changing the cursor - - - The display should be centered when the SDL application is smaller - than the PicoGUI panel - - - Fullscreen or any other special modes - - - Support for indexed and grayscale modes - - - Probably much more... - ---- The End --- diff --git a/README.Porting b/README.Porting deleted file mode 100644 index df619934f0..0000000000 --- a/README.Porting +++ /dev/null @@ -1,56 +0,0 @@ - -* Porting To A New Platform - - The first thing you have to do when porting to a new platform, is look at -include/SDL_platform.h and create an entry there for your operating system. -The standard format is __PLATFORM__, where PLATFORM is the name of the OS. -Ideally SDL_platform.h will be able to auto-detect the system it's building -on based on C preprocessor symbols. - -There are two basic ways of building SDL at the moment: - -1. The "UNIX" way: ./configure; make; make install - - If you have a GNUish system, then you might try this. Edit configure.in, - take a look at the large section labelled: - "Set up the configuration based on the target platform!" - Add a section for your platform, and then re-run autogen.sh and build! - -2. Using an IDE: - - If you're using an IDE or other non-configure build system, you'll probably - want to create a custom SDL_config.h for your platform. Edit SDL_config.h, - add a section for your platform, and create a custom SDL_config_{platform}.h, - based on SDL_config.h.minimal and SDL_config.h.in - - Add the top level include directory to the header search path, and then add - the following sources to the project: - src/*.c - src/audio/*.c - src/cdrom/*.c - src/cpuinfo/*.c - src/events/*.c - src/file/*.c - src/joystick/*.c - src/stdlib/*.c - src/thread/*.c - src/timer/*.c - src/video/*.c - src/audio/disk/*.c - src/video/dummy/*.c - src/joystick/dummy/*.c - src/cdrom/dummy/*.c - src/thread/generic/*.c - src/timer/dummy/*.c - src/loadso/dummy/*.c - - -Once you have a working library without any drivers, you can go back to each -of the major subsystems and start implementing drivers for your platform. - -If you have any questions, don't hesitate to ask on the SDL mailing list: - http://www.libsdl.org/mailing-list.php - -Enjoy! - Sam Lantinga (slouken@libsdl.org) - diff --git a/README.QNX b/README.QNX deleted file mode 100644 index 995afbec0e..0000000000 --- a/README.QNX +++ /dev/null @@ -1,155 +0,0 @@ -README.QNX by Mike Gorchak , -Last changed at 24 Apr 2004. - -====================================================================== -Table of Contents: - -1. OpenGL. -2. Wheel and multi-button mouses. -3. CDROM handling issues. -4. Hardware video overlays. -5. Shared library building. -6. Some building issues. -7. Environment variables. - -====================================================================== -1. OpenGL: - - OpenGL works well and is stable, but fullscreen mode has not been -heavily tested yet. - If you have QNX RtP version 6.1.0 or above you must download the -Photon3D runtime from http://developers.qnx.com or install it from the -public repository or from the public CD, available with QNX. OS versi- -ons below 6.1.0 are not supported. - When creating an OpenGL context, software renderer mode is artifi- -cially selected (QSSL made acceleration only for Voodoo boards in -fullscreen mode, sorry but I don't have this board to test OpenGL - -maybe it works or maybe not :)). If you want acceleration - you can -remove one line in the source code: find the file SDL_ph_image.c and -remove the following - - OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW; - -line in the ph_SetupOpenGLContext() function or change the argument to -PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW. - -====================================================================== -2. Wheel and multi-button mouses: - - Photon emits keyboard events (key up and down) when the mouse -wheel is moved. The key_scan field appears valid, and it contains zero. -That is a basic method of detecting mouse wheel events under Photon. -It looks like a hack, but it works for me :) on various PC configura- -tions. - -I've tested it on: - -1. Genius Optical NetScroll/+ PS/2 (1 wheel) -2. A4Tech Optical GreatEye WheelMouse PS/2, model: WOP-35. (2 wheels - + 2 additional buttons). The wheel for vertical scrolling works as - usual, but the second wheel for horizontal scrolling emits two se- - quential events up or down, so it can provide faster scrolling than - the first wheel. Additional buttons don't emit any events, but it - looks like they're handled by photon in an unusual way - like click - to front, but works not with any window, looks like a fun bug-o-fe- - ature :). - -====================================================================== -3. CDROM handling issues: - - Access to CDROM can only be provided with 'root' privileges. I -can't do anything about that, /dev/cd0 has brw------- permissions and -root:root rights. - -====================================================================== -4. Hardware video overlays: - - Overlays can flicker during window movement, resizing, etc. It -happens because the photon driver updates the real window contents be- -hind the overlay, then draws the temporary chroma key color over the -window contents. It can be done without using the chroma key but that -causes the overlay to always be on top. So flickering during window -movement is preferred instead. - Double buffering code is temporarily disabled in the photon driver -code, because on my GF2-MX it can accidentally cause a buffer switch, -which causes the old frame to show. S3 Savage4 has the same problem, -but ATI Rage 128 doesn't. I think it can be fixed later. Current code -works very well, so maybe double buffering is not needed right now. - Something strange happens when you try to move the window with the -overlay beyond the left border of the screen. The overlay tries to -stay at position x=0, but when attempting to move it a bit more it -jumps to position x=-60 (on GF2-MX, on ATI Rage128 this value a bit -smaller). It's really strange, looks like the overlay doesn't like -negative coordinates. - -======================================================================= -5. Shared library building: - - A shared library can be built, but before running the autogen.sh -script you must manually delete the libtool.m4 stuff from the acinclu- -de.m4 file (it comes after the ESD detection code up to the end of the -file), because the libtool stuff in the acinclude.m4 file was very old -in SDL distribution before the version 1.2.7 and doesn't knew anything -about QNX. SDL 1.2.7 distribution contains the new libtool.m4 script, -but anyway it is broken :), Just remove it, then run "libtoolize ---force --copy", delete the file aclocal.m4 if it is exists and after -that run the autogen.sh script. SDL 1.2.8 contains fixed libtool.m4, -ltmain.sh and config.sub files, so you can just run the autogen.sh -script. - -====================================================================== -6. Some building issues: - - Feel free to not use the --disable-shared configure option if you' -ve read the above comment about 'Shared library building'. Otherwise -this option is strongly recommended, as without it the sdl-config -script will be broken. - - Run the configure script without x11 support, e.g.: - - a) for OpenGL support: - ./configure --prefix=/usr \ - --disable-video-x11 \ - --disable-shared - - b) without OpenGL support: - ./configure --prefix=/usr \ - --disable-video-x11 \ - --disable-shared \ - --disable-video-opengl - - And of course dont forget to specify --disable-debug, which is on -by default, to disable debug and enable the expensive optimizations. - - In the test directory also run the ./configure script without -x11 support, e.g.: - - ./configure --with-sdl-prefix=/usr \ - --with-sdl-exec-prefix=/usr \ - --prefix=/usr --without-x - -====================================================================== -7. Environment variables: - - Please note that the photon driver is sensible to the following -environmental variables: - - * SDL_PHOTON_FULLSCREEN_REFRESH - this environment variable controls -the refresh rate in all fullscreen modes. Be carefull !!! Photon -drivers usually do not checking the maximum refresh rate, which video -adapter or monitor supports. - - * SDL_VIDEO_WINDOW_POS - can be set in the "X,Y" format. If X and Y -coordinates are bigger than the current desktop resolution, then win- -dow positioning across virtual consoles is activated. If X and Y are -smaller than the desktop resolution then window positioning in the -current console is activated. The word "center" can be used instead of -coordinates, it produces the same behavior as SDL_VIDEO_CENTERED -environmental variable. - - * SDL_VIDEO_CENTERED - if this environmental variable exists then the -window centering is perfomed in the current virtual console. - -Notes: The SDL_VIDEO_CENTERED enviromental variable has greater pri- -ority than the SDL_VIDEO_WINDOW_POS in case if both variables are sup- -plied to the application. diff --git a/README.Qtopia b/README.Qtopia deleted file mode 100644 index 01627d1fb3..0000000000 --- a/README.Qtopia +++ /dev/null @@ -1,84 +0,0 @@ - -============================================================================== -Using the Simple DirectMedia Layer with Qtopia/OPIE -============================================================================== - -============================================================================== -I. Setting up the Qtopia development environment. - - This document will not explain how to setup the Qtopia development - environment. That is outside the scope of the document. You can read - more on this subject in this excellent howto: - - http://www.zauruszone.com/howtos/linux_compiler_setup_howto.html - -============================================================================== -II. Building the Simple DirectMedia Layer libraries using the arm - cross-compiler - - This is somewhat tricky since the name of the compiler binaries - differ from the standard. Also you should disable features not - needed. The command below works for me. Note that it's all one - line. You can also set the NM, LD etc environment variables - separately. - - NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ RANLIB=arm-linux-ranlib AR=arm-linux-ar ./configure --enable-video-qtopia --disable-video-dummy --disable-video-fbcon --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --prefix=/opt/Qtopia/sharp/ arm-unknown-linux-gnu - - One thing to note is that the above configure will include joystick - support, even though you can't have joysticks on the Zaurus. The - reason for this is to avoid link / compile / runtime errors with - applications that have joystick support. - -============================================================================== -III. Building the Simple DirectMedia Layer test programs: - - After installing, making sure the correct sdl-config is in your - path, run configure like this: - - NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar ./configure arm-unknown-linux-gnu - -============================================================================== -IV. Application porting notes - - One thing I have noticed is that applications sometimes don't exit - correctly. Their icon remains in the taskbar and they tend to - relaunch themselves automatically. I believe this problem doesn't - occur if you exit your application using the exit() method. However, - if you end main() with 'return 0;' or so, this seems to happen. - - Also note that when running in landscape mode - i.e requesting a - window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH - and HEIGHT normally is 240 and 320 - the image is blitted so that - the hardware buttons are on the left side of the display. This might - not always be desirable but such is the code today. - - -============================================================================== -V. Enjoy! :) - - If you have a project you'd like me to know about, or want to ask questions, - go ahead and join the SDL developer's mailing list by sending e-mail to: - - sdl-request@libsdl.org - - and put "subscribe" into the subject of the message. Or alternatively you - can use the web interface: - - http://www.libsdl.org/mailman/listinfo/sdl - -============================================================================== -VI. What is supported: - -Keyboard (Sharp Zaurus) -Hardware buttons -Stylus input (mouse) -Video. Allows fullscreen both in portrait mode (up to WIDTHxHEIGHT -size window) and in landscape mode (up to HEIGHTxWIDTH). - -All other SDL functionality works like a normal Linux system (threads, -audio etc). - --- -David Hedbor -http://david.hedbor.org/ http://eongames.com/ - diff --git a/README.RISCOS b/README.RISCOS deleted file mode 100644 index 1ab85984a6..0000000000 --- a/README.RISCOS +++ /dev/null @@ -1,130 +0,0 @@ -Readme for RISC OS port of SDL -============================== - -This document last updated on 2nd Februrary 2006 - -This is a RISC OS port of the Simple Direct Media Layer (SDL) by Alan Buckley with contributions from Peter Naulls. - -Details of the SDL can be found at http://www.libsdl.org. - -The source code including the RISC OS version can be obtained from: - -http://www.libsdl.org. - -Pre built libraries and many games and applications compiled for RISC OS using this library can be downloaded from The Unix Porting Project at http://www.riscos.info/unix/. - -This is released under the LGPL see the file COPYING for details. - - -Compiling applications under RISC OS -==================================== - -Add -ISDL: for the C compiler flags if you include the files in the SDL directory. e.g. #include "SDL/SDL.h" -Add -ISDL:SDL for the C compiler flags if you include the files directly. e.g. #include "SDL/SDL.h" - -Add -LSDL: -lSDL to the link stage of compilation. - -For example, to compile the testbitmap.c sample you could use: - -gcc -ISDL:SDL -LSDL: -lSDL testbitmap.c -otestbitmap - - -RISC OS port of SDL runtime information -======================================= - -Runtime requirements --------------------- - -This library currently needs a minimum of RISC OS 3.6. The source code for the library (and a lot of the programs built with it) also need long file names. - -To use the audio you also need 16 bit sound and to have installed the DigitalRender module by Andreas Dehmel version 0.51 available from his -web site: http://home.t-online.de/~zarquon -This is loaded when needed by UnixLib. - -Note: As most programs ported from other OSes use high resolution graphics and a memory back buffer a machine with a StrongARM processor and 1 or 2MB of VRAM (or a better machine) is recomended. - - -RISC OS runtime parameters --------------------------- - -Several environmental variables have been defined to make porting programs easier (i.e. By setting these variable you do not need to have source code differences between OSes). - -They are all defined on an application basis. - -The used below is found as follows: -1. Use the name of the program unless it is !RunImage -2. Check the folder specification for the folder !RunImage is run from. If it is a folder name use that name, otherwise if it is an environmental variable of the form use the value of XXX. - -The variables are: - -SDL$$TaskName - -The name of the task for RISC OS. If omitted then is used for the task name, - -SDL$$BackBuffer - -Set to 1 to use a system memory back buffer for the screen in full screen mode. Some programs on other systems assume their is always a back buffer even though the SDL specification specifies this is not the case. The current RISC OS implementation uses direct writes to the screen if a hardware fullscreen is requested. - -Set to 2 to use an ARM code full word copy. This is faster than the standard back buffer, but uses aligned words only so it is possible (but unlikely) for it to corrupt the screen for 8bpp and 16bpp modes. - -Set to 3 to use a RISC OS sprite as the back buffer. This is usually the slowest for most SDL applications, however it may be useful in the future as Sprite acceleration is added to various hardware that runs RISC OS. - -SDL$$CloseAction - set the action for the close icon. Again as programs don't match the specification you can set this to 0 to remove the close icon from the main window for applications where this does not affect the program. - - -RISC OS SDL port API notes -========================== - -Current level of implementation -------------------------------- - -The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL. - -video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL. -Window Manager - Mostly done. SetIcon/IconifyWindow not implemented. -Events - Mostly done. Resize and some joystick events missing. -Joystick - Currently assumes a single joystick with 4 buttons. -Audio - Done -CDROM - Not implemented. -Threads - Done -Timers - Done - -Thread support can be removed by defining DISABLE_THREADS and recompiling the library. - -SDL API notes -------------- - -This section contains additional notes on some specific commands. - -SDL_SetVideoMode - On RISC OS a fullscreen mode directly accesses the screen. This can be modified by the environmental variable (SDL$$BackBuffer) or by using the SDL_SWSURFACE flag to write to an offscreen buffer that is updated using SDL_UpdateRects. - Open GL is not supported so SDL_OPENGL and SDL_OPENGLBLIT flags fail. - SDL_RESIZEABLE and SDL_NOFRAME flags are not supported. - -SDL_SetColors - In a wimp mode the screen colours are not changed for a hardware palette instead the RISC OS sprite colour mapping is used to get the best matching colours. - -SDL_CreateCursor - Inverted colour is not supported. - -SDL_WM_ToggleFullScreen - Currently this won't work if the application starts up in Fullscreen mode. - Toggling to fullscreen will only work if the monitor is set up to support the exact screen size requested. - -SDL_EnableUNICODE - Unicode translation used here is only really accurate for 7 bit characters. - -SDL_NumJoysticks/JoystickName etc. - Hardcoded to expect only 1 joystick with 4 buttons if the Joystick module is loaded. - -SDL_GetTicks - Timer used has only a centisecond accuracy. This applies to other time related functions. - -SDL_Delay - Modified to poll keyboard/mouse during the delay on the event thread. - - -Notes on current implementation -------------------------------- - -Keyboard and mouse are polled so if too long a time is spent between a call to SDL_PumpEvents, functions that use it, or SDL_Delay events can be missed. diff --git a/README.Symbian b/README.Symbian deleted file mode 100644 index 32d925a00d..0000000000 --- a/README.Symbian +++ /dev/null @@ -1,23 +0,0 @@ -============================================================================== -Using the Simple DirectMedia Layer with S60 3.x / Symbian 9.x -============================================================================== - -These instuctions are for people developing for S60 3.x. S60 3.x -uses Symbian OS so you need S60 SDK. - -extract "symbian.zip" into this folder. - -go to symbian folder - -bldmake bldfiles -abld build - -That produces WINSCW and ARMV5 versions of sdl.dll runtime library -and sdl.lib for development. -The sdlexe.dll/sdlexe.lib and sdlmain.lib are for easy SDL S60 -integration, please see http://www.mbnet.fi/~mertama/sdl.html -for further info. - - - - diff --git a/README.Watcom b/README.Watcom deleted file mode 100644 index 2849a11c0f..0000000000 --- a/README.Watcom +++ /dev/null @@ -1,133 +0,0 @@ - -Using SDL under Windows with the OpenWatcom compiler -==================================================== - -Prerequisites -------------- - -I have done the port under Windows XP Home with SP2 installed. Windows -2000 should also be working. I'm not so sure about ancient Windows NT, -since only DirectX 3 is available there. Building should be possible, -but running the compiled applications will probalbly fail with -SDL_VIDEODRIVER=directx. The windib driver should work, though. - -To compile and use the SDL with Open Watcom you will need the following: -- Open Watcom compiler. I used version 1.5. The environment variables - PATH, WATCOM and INCLUDE need to be set appropriately - please consult - the OpenWatcom documentation and instructions given during the - installation of the compiler. - My setup looks like this in owvars.bat: - set WATCOM=C:\watcom - set INCLUDE=%WATCOM%\h;%WATCOM%\h\nt - set PATH=%PATH%;%WATCOM%\binnt;%WATCOM%\binw -- A fairly recent DirectX SDK. The original unmodified DX8 SDK works, as - well as the minimal DirectX 7 SDK from the Allegro download site - (). -- The SDL sources from Subversion -- The file Watcom-Win32.zip (now available in Subversion) - - -Building the Library --------------------- - -1) In the SDL base directory extract the archive Watcom-Win32.zip. This - creates a subdirectory named 'watcom'. -2) The makefile expects the environment variable DXDIR to be set to the - base directory of a DirectX SDK. I have tried a stock DX8 SDK from - Microsoft as well as the minimal DirectX 7 SDK from the Allegro - download site. - You can also edit the makefile directly and hard code your path to - the SDK on your system. - I have this in my setup: - set DXDIR=D:\devel\DX8_SDK -3) Enter the watcom directory and run - wmake sdl -4) All tests from the test directory are working and can be built by - running - wmake tests - -Notes: - - The makefile offers some options to tweak the way the library is built. - You have at your disposal the option to build a static (default) - library, or a DLL (with tgt=dll). You can also choose whether to build - a Release (default) or a Debug version (with build=debug) of the tests - and library. Please consult the usage comment at the top of the - makefile for usage instructions. - - If you specify a test target (i.e. 'wmake tests' for all tests, or - selected targets like 'wmake testgl testvidinfo testoverlay2'), the - tests are always freshly compiled and linked. This is done to - minimise hassle when switching between library versions (static vs. - DLL), because they require subtly different options. - Also, the test executables are put directly into the test directory, - so they can find their data files. The clean target of the makefile - removes the test executables and the SDL.dll file from the test - directory. - - To use the library in your own projects with Open Watcom, you can use - the way the tests are built as base of your own build environment. - - The library can also be built with the stack calling convention of the - compiler (-6s instead of -6r). - - -Test applications ------------------ - -I've tried to make all tests work. The following table gives an overview -of the current status. - - Testname Status -~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -checkkeys + -graywin + -loopwave + -testalpha + -testbitmap + -testdyngl + -testerror + -testfile + -testgamma + -testgl + -testhread + -testiconv - (all failed) -testkeys + -testlock + -testoverlay + (needs 'set SDL_VIDEODRIVER=directx') -testoverlay2 + (needs 'set SDL_VIDEODRIVER=directx') -testpalette + -testplatform + -testsem + -testsprite + -testtimer + -testver + -testvidinfo + -testwin ? (fading doesn't seem right) -testwm + -torturethread + -testcdrom + -testjoystick not tested -threadwin + -testcursor + - - -TODO ----- - -There is room for further improvement: -- Test joystick functionality. -- Investigate fading issue in 'testwin' test. -- Fix the UTF-8 support. -- Adapt the makefile/object file list to support more target systems -- Use "#pragma aux" syntax for the CPU info functions. - - -Questions and Comments ----------------------- - -Please direct any questions or comments to me: - - Happy Coding! - - Marc Peter diff --git a/README.WinCE b/README.WinCE deleted file mode 100644 index b78d24c112..0000000000 --- a/README.WinCE +++ /dev/null @@ -1,55 +0,0 @@ - -Project files for embedded Visual C++ 3.0, 4.0 and -Visual Studio 2005 can be found in the VisualCE directory. - -SDL supports GAPI and WinDib output for Windows CE. - -GAPI driver supports: - -- all possible WinCE devices (Pocket PC, Smartphones, HPC) - with different orientations of video memory and resolutions. -- 4, 8 and 16 bpp devices -- special handling of 8bpp on 8bpp devices -- VGA mode, you can even switch between VGA and GAPI in runtime - (between 240x320 and 480x640 for example). On VGA devices you can - use either GAPI or VGA. -- Landscape mode and automatic rotation of buttons and stylus coordinates. - To enable landscape mode make width of video screen bigger than height. - For example: - SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN) -- WM2005 -- SDL_ListModes - -NOTE: -There are several SDL features not available in the WinCE port of SDL. - -- DirectX is not yet available -- Semaphores are not available -- Joystick support is not available -- CD-ROM control is not available - -In addition, there are several features that run in "degraded" mode: - -Preprocessor Symbol Effect -=================== ================================= - -SDL_systimer.c: -USE_GETTICKCOUNT Less accurate values for SDL time functions -USE_SETTIMER Use only a single marginally accurate timer - -SDL_syswm.c: -DISABLE_ICON_SUPPORT Can't set the runtime window icon - -SDL_sysmouse.c: -USE_STATIC_CURSOR Only the arrow cursor is available - -SDL_sysevents.c: -NO_GETKEYBOARDSTATE Can't get modifier state on keyboard focus - -SDL_dibevents.c: -NO_GETKEYBOARDSTATE Very limited keycode translation - -SDL_dibvideo.c: -NO_GETDIBITS Can't distinguish between 15 bpp and 16 bpp -NO_CHANGEDISPLAYSETTINGS No fullscreen support -NO_GAMMA_SUPPORT Gamma correction not available diff --git a/README.txt b/README.txt new file mode 100644 index 0000000000..681f4a33cf --- /dev/null +++ b/README.txt @@ -0,0 +1,38 @@ + + Simple DirectMedia Layer + + (SDL) + + Version 2.0 + +--- +http://www.libsdl.org/ + +Simple DirectMedia Layer is a cross-platform development library designed +to provide low level access to audio, keyboard, mouse, joystick, and graphics +hardware via OpenGL and Direct3D. It is used by video playback software, +emulators, and popular games including Valve's award winning catalog +and many Humble Bundle games. + +SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. +Support for other platforms may be found in the source code. + +SDL is written in C, works natively with C++, and there are bindings +available for several other languages, including C# and Python. + +This library is distributed under the zlib license, which can be found +in the file "COPYING.txt". + +The best way to learn how to use SDL is to check out the header files in +the "include" subdirectory and the programs in the "test" subdirectory. +The header files and test programs are well commented and always up to date. +More documentation and FAQs are available online at: + http://wiki.libsdl.org/ + +If you need help with the library, or just want to discuss SDL related +issues, you can join the developers mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/README.wscons b/README.wscons deleted file mode 100644 index 349c89c999..0000000000 --- a/README.wscons +++ /dev/null @@ -1,107 +0,0 @@ -============================================================================== -Using the Simple DirectMedia Layer with OpenBSD/wscons -============================================================================== - -The wscons SDL driver can be used to run SDL programs on OpenBSD -without running X. So far, the driver only runs on the Sharp Zaurus, -but the driver is written to be easily extended for other machines. -The main missing pieces are blitting routines for anything but 16 bit -displays, and keycode maps for other keyboards. Also, there is no -support for hardware palettes. - -There is currently no mouse support. - -To compile SDL with support for wscons, use the -"--enable-video-wscons" option when running configure. I used the -following command line: - -./configure --disable-oss --disable-ltdl --enable-pthread-sem \ - --disable-esd --disable-arts --disable-video-aalib \ - --enable-openbsdaudio --enable-video-wscons \ - --prefix=/usr/local --sysconfdir=/etc - - -Setting the console device to use -================================= - -When starting an SDL program on a wscons console, the driver uses the -current virtual terminal (usually /dev/ttyC0). To force the driver to -use a specific terminal device, set the environment variable -SDL_WSCONSDEV: - -bash$ SDL_WSCONSDEV=/dev/ttyC1 ./some-sdl-program - -This is especially useful when starting an SDL program from a remote -login prompt (which is great for development). If you do this, and -want to use keyboard input, you should avoid having some other program -reading from the used virtual console (i.e., do not have a getty -running). - - -Rotating the display -==================== - -The display can be rotated by the wscons SDL driver. This is useful -for the Sharp Zaurus, since the display hardware is wired so that it -is correctly rotated only when the display is folded into "PDA mode." -When using the Zaurus in "normal," or "keyboard" mode, the hardware -screen is rotated 90 degrees anti-clockwise. - -To let the wscons SDL driver rotate the screen, set the environment -variable SDL_VIDEO_WSCONS_ROTATION to "CW", "CCW", or "UD", for -clockwise, counter clockwise, and upside-down rotation respectively. -"CW" makes the screen appear correct on a Sharp Zaurus SL-C3100. - -When using rotation in the driver, a "shadow" frame buffer is used to -hold the intermediary display, before blitting it to the actual -hardware frame buffer. This slows down performance a bit. - -For completeness, the rotation "NONE" can be specified to use a shadow -frame buffer without actually rotating. Unsetting -SDL_VIDEO_WSCONS_ROTATION, or setting it to '' turns off the shadow -frame buffer for maximum performance. - - -Running MAME -============ - -Since my main motivation for writing the driver was playing MAME on -the Zaurus, I'll give a few hints: - -XMame compiles just fine under OpenBSD. - -I'm not sure this is strictly necessary, but set - -MY_CPU = arm - -in makefile.unix, and - -CFLAGS.arm = -DLSB_FIRST -DALIGN_INTS -DALIGN_SHORTS - -in src/unix/unix.max - -to be sure. - -The latest XMame (0.101 at this writing) is a very large program. -Either tinker with the make files to compile a version without support -for all drivers, or, get an older version of XMame. My recommendation -would be 0.37b16. - -When running MAME, DO NOT SET SDL_VIDEO_WSCONS_ROTATION! Performace -is MUCH better without this, and it is COMPLETELY UNNECESSARY, since -MAME can rotate the picture itself while drawing, and does so MUCH -FASTER. - -Use the Xmame command line option "-ror" to rotate the picture to the -right. - - -Acknowledgments -=============== - -I studied the wsfb driver for XFree86/Xorg quite a bit before writing -this, so there ought to be some similarities. - - --- -Staffan Ulfberg diff --git a/SDL.qpg.in b/SDL.qpg.in deleted file mode 100644 index 821faa31e9..0000000000 --- a/SDL.qpg.in +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - QNX.ORG.RU Community - - - QNX.ORG.RU Team - Mike Gorchak - mike@malva.ua - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Library - SDL - 1 - http://qnx.org.ru/repository - 2.6 - - - - Simple DirectMedia Layer (SDL) - SDL - slouken@libsdl.org - Public - public - http://www.libsdl.org - - slouken@libsdl.org - Sam Lantinga - http://www.libsdl.org - - slouken@libsdl.org - - - This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. - This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. This is the libraries, include files and other resources you can use to develop and run SDL applications. - http://www.libsdl.org - - - - - @VERSION@ - Medium - Stable - - - 1 - - GNU Lesser General Public License - - - - Software Development/Libraries and Extensions/C Libraries - SDL,audio,graphics,demos,games,emulators,direct,media,layer - qnx6 - none - Photon - Console - Developer - User - - repdata://LicenseUrl/COPYING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SDL.spec.in b/SDL.spec.in deleted file mode 100644 index dbda11210a..0000000000 --- a/SDL.spec.in +++ /dev/null @@ -1,113 +0,0 @@ -Summary: Simple DirectMedia Layer -Name: SDL -Version: @SDL_VERSION@ -Release: 1 -Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz -URL: http://www.libsdl.org/ -License: LGPL -Group: System Environment/Libraries -BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot -Prefix: %{_prefix} -%ifos linux -Provides: libSDL-1.2.so.0 -%endif - -%define __defattr %defattr(-,root,root) -%define __soext so - -%description -This is the Simple DirectMedia Layer, a generic API that provides low -level access to audio, keyboard, mouse, and display framebuffer across -multiple platforms. - -%package devel -Summary: Libraries, includes and more to develop SDL applications. -Group: Development/Libraries -Requires: %{name} = %{version} - -%description devel -This is the Simple DirectMedia Layer, a generic API that provides low -level access to audio, keyboard, mouse, and display framebuffer across -multiple platforms. - -This is the libraries, include files and other resources you can use -to develop SDL applications. - - -%prep -%setup -q - -%build -%ifos linux -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga -%else -%configure -%endif -make - -%install -rm -rf $RPM_BUILD_ROOT -%ifos linux -make install prefix=$RPM_BUILD_ROOT%{prefix} \ - bindir=$RPM_BUILD_ROOT%{_bindir} \ - libdir=$RPM_BUILD_ROOT%{_libdir} \ - includedir=$RPM_BUILD_ROOT%{_includedir} \ - datadir=$RPM_BUILD_ROOT%{_datadir} \ - mandir=$RPM_BUILD_ROOT%{_mandir} -ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0 -%else -%makeinstall -%endif - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%{__defattr} -%doc README-SDL.txt COPYING CREDITS BUGS -%{_libdir}/lib*.%{__soext}.* - -%files devel -%{__defattr} -%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html -%doc docs/index.html docs/html -%{_bindir}/*-config -%{_libdir}/lib*.a -%{_libdir}/lib*.la -%{_libdir}/lib*.%{__soext} -%dir %{_includedir}/SDL -%{_includedir}/SDL/*.h -%{_libdir}/pkgconfig/sdl.pc -%{_datadir}/aclocal/* -%{_mandir}/man3/* - -%changelog -* Tue May 16 2006 Sam Lantinga -- Removed support for Darwin, due to build problems on ps2linux - -* Mon Jan 03 2004 Anders Bjorklund -- Added support for Darwin, updated spec file - -* Wed Jan 19 2000 Sam Lantinga -- Re-integrated spec file into SDL distribution -- 'name' and 'version' come from configure -- Some of the documentation is devel specific -- Removed SMP support from %build - it doesn't work with libtool anyway - -* Tue Jan 18 2000 Hakan Tandogan -- Hacked Mandrake sdl spec to build 1.1 - -* Sun Dec 19 1999 John Buswell -- Build Release - -* Sat Dec 18 1999 John Buswell -- Add symlink for libSDL-1.0.so.0 required by sdlbomber -- Added docs - -* Thu Dec 09 1999 Lenny Cartier -- v 1.0.0 - -* Mon Nov 1 1999 Chmouel Boudjnah -- First spec file for Mandrake distribution. - -# end of file diff --git a/SDL2.spec.in b/SDL2.spec.in new file mode 100644 index 0000000000..2a5c479242 --- /dev/null +++ b/SDL2.spec.in @@ -0,0 +1,112 @@ +Summary: Simple DirectMedia Layer +Name: SDL2 +Version: @SDL_VERSION@ +Release: 1 +Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +URL: http://www.libsdl.org/ +License: zlib +Group: System Environment/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +Prefix: %{_prefix} +%ifos linux +Provides: libSDL2-2.0.so.0 +%endif + +%define __defattr %defattr(-,root,root) +%define __soext so + +%description +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +%package devel +Summary: Libraries, includes and more to develop SDL applications. +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +This is the libraries, include files and other resources you can use +to develop SDL applications. + + +%prep +%setup -q + +%build +%ifos linux +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-directfb +%else +%configure +%endif +make + +%install +rm -rf $RPM_BUILD_ROOT +%ifos linux +make install prefix=$RPM_BUILD_ROOT%{prefix} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + datadir=$RPM_BUILD_ROOT%{_datadir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} +%else +%makeinstall +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{__defattr} +%doc README-SDL.txt COPYING.txt CREDITS.txt BUGS.txt +%{_libdir}/lib*.%{__soext}.* + +%files devel +%{__defattr} +%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew +%{_bindir}/*-config +%{_libdir}/lib*.a +%{_libdir}/lib*.la +%{_libdir}/lib*.%{__soext} +%{_includedir}/*/*.h +%{_libdir}/pkgconfig/* +%{_datadir}/aclocal/* + +%changelog +* Sun Jan 22 2012 Sam Lantinga +- Updated for SDL 2.0 + +* Tue May 16 2006 Sam Lantinga +- Removed support for Darwin, due to build problems on ps2linux + +* Mon Jan 03 2004 Anders Bjorklund +- Added support for Darwin, updated spec file + +* Wed Jan 19 2000 Sam Lantinga +- Re-integrated spec file into SDL distribution +- 'name' and 'version' come from configure +- Some of the documentation is devel specific +- Removed SMP support from %build - it doesn't work with libtool anyway + +* Tue Jan 18 2000 Hakan Tandogan +- Hacked Mandrake sdl spec to build 1.1 + +* Sun Dec 19 1999 John Buswell +- Build Release + +* Sat Dec 18 1999 John Buswell +- Add symlink for libSDL-1.0.so.0 required by sdlbomber +- Added docs + +* Thu Dec 09 1999 Lenny Cartier +- v 1.0.0 + +* Mon Nov 1 1999 Chmouel Boudjnah +- First spec file for Mandrake distribution. + +# end of file diff --git a/TODO b/TODO deleted file mode 100644 index 65bb01c17a..0000000000 --- a/TODO +++ /dev/null @@ -1,25 +0,0 @@ - -Wish list for the 1.3 development branch: -http://bugzilla.libsdl.org/ - - * Add mousewheel events (new unified event architecture?) - * DirectInput joystick support needs to be implemented - * Be able to enumerate and select available audio and video drivers - * Fullscreen video mode support for Mac OS X - * Explicit vertical retrace wait (maybe separate from SDL_Flip?) - * Shaped windows, windows without borders - * Multiple windows, multiple display support - * SDL_INIT_EVENTTHREAD on Windows and MacOS? - * Add a timestamp to events - * Add audio input API - * Add hardware accelerated scaled blit - * Add hardware accelerated alpha blits - * Redesign blitting architecture to allow blit plugins - -In the jump from 1.2 to 1.3, we should change the SDL_Rect members to -int and evaluate all the rest of the datatypes. This is the only place -we should do it though, since the 1.2 series should not break binary -compatibility in this way. - -Requests: - * PCM and CDROM volume control (deprecated, but possible) diff --git a/TODO.txt b/TODO.txt new file mode 100644 index 0000000000..14c47d0ebc --- /dev/null +++ b/TODO.txt @@ -0,0 +1,15 @@ +Future work roadmap: + * http://wiki.libsdl.org/moin.cgi/Roadmap + + * See why windows are being rearranged. Is the shield window not up? + * Add __WINDOWS__ in addition to __WIN32__ + * Write test for fullscreen gamma to check X11 colormap handling + + * Check 1.2 revisions: + 3554 - Need to resolve semantics for locking keys on different platforms + 4874 - Do we want screen rotation? At what level? + 4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98 + 4484, 4485 - Verify that SDL's Windows keyboard handling works correctly + 4865 - See if this is still needed (mouse coordinate clamping) + 4866 - See if this is still needed (blocking window repositioning) + diff --git a/VisualC.html b/VisualC.html index 2923495146..a25907bd93 100644 --- a/VisualC.html +++ b/VisualC.html @@ -4,27 +4,26 @@

- Using SDL with Microsoft Visual C++ 5,6 and 7 + Using SDL with Microsoft Visual C++

by Lion Kimbro and additions by James Turk

- You can either use the precompiled libraries from - the SDL Download web site , or you can build SDL yourself. + You can either use the precompiled libraries from the SDL Download web site , or you can build SDL yourself.

Building SDL

- Go into the VisualC - directory that is created, and double-click on the VC++ file "SDL.dsw" - ("SDL.sln"). This should open up the IDE. + Go into the VisualC directory and double-click on the Visual Studio solution for your version of Visual Studio, e.g. SDL_VS2008.sln This should open up the IDE.

- You may be prompted at this point to upgrade the workspace, should you be using - a more recent version of Visual C++. If so, allow the workspace to be upgraded. + There are different solution files for the various + versions of the IDE. Please use the appropiate version + 2008, 2010 or 2012; the 2010EE and 2012EE files + should be used with the "Express Edition" releases.

Build the .dll and .lib files. @@ -33,32 +32,22 @@

This is done by right clicking on each project in turn (Projects are listed in the Workspace panel in the FileView tab), and selecting "Build".

-

- If you get an error about SDL_config.h being missing, you should - copy include/SDL_config.h.default to include/SDL_config.h and try again. -

You may get a few warnings, but you should not get any errors. You do have to - have at least the DirectX 5 SDK installed, however. The latest - version of DirectX can be downloaded or purchased on a cheap CD (my - recommendation) from Microsoft . + have at least the DirectX 9 SDK installed, however. The latest + version of DirectX can be downloaded from Microsoft.

Later, we will refer to the following .lib and .dll files that have just been generated:

    -
  • SDL.dll
  • -
  • SDL.lib
  • -
  • SDLmain.lib
  • +
  • SDL2.dll
  • +
  • SDL2.lib
  • +
  • SDL2main.lib

- Search for these using the Windows Find (Windows-F) utility, if you don't - already know where they should be. For those of you with a clue, look inside - the Debug or Release directories of the subdirectories of the Project folder. - (It might be easier to just use Windows Find if this sounds confusing. And - don't worry about needing a clue; we all need visits from the clue fairy - frequently.) + Search for these using the Windows Find (Windows-F) utility inside the VisualC directory.

Creating a Project with SDL @@ -82,8 +71,8 @@

add the include and library directories to the list that VC7 keeps. Do this by selecting Tools|Options|Projects|VC++ Directories and under the "Show Directories For:" dropbox select "Include Files", and click the "New Directory - Icon" and add the [SDLROOT]\include directory (ex. If you installed to - c:\SDL-1.2.5\ add c:\SDL-1.2.5\include). Proceed to change the + Icon" and add the [SDLROOT]\include directory (e.g. If you installed to + c:\SDL\ add c:\SDL\include). Proceed to change the dropbox selection to "Library Files" and add [SDLROOT]\lib.

@@ -98,15 +87,15 @@

Copy the following files into your Project directory:

    -
  • SDL.dll
  • +
  • SDL2.dll

Add the following files to your project (It is not necessary to copy them to your project directory):

    -
  • SDL.lib
  • -
  • SDLmain.lib
  • +
  • SDL2.lib
  • +
  • SDL2main.lib

(To add them to your project, right click on your project, and select "Add @@ -116,7 +105,7 @@

desireable to add them to the linker options: Project|Properties|Linker|Command Line and type the names of the libraries to link with in the "Additional Options:" box.  Note: This must be done for each build - configuration (eg. Release,Debug).

+ configuration (e.g. Release,Debug).

SDL 101, First Day of Class

diff --git a/VisualC/SDL.dsw b/VisualC/SDL.dsw deleted file mode 100644 index 6f6b8bb9b4..0000000000 --- a/VisualC/SDL.dsw +++ /dev/null @@ -1,41 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "SDL"=.\SDL\SDL.DSP - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "SDLmain"=.\SDLmain\SDLmain.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/VisualC/SDL.sln b/VisualC/SDL.sln deleted file mode 100644 index 9703f8f999..0000000000 --- a/VisualC/SDL.sln +++ /dev/null @@ -1,45 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release_NoSTDIO|Win32 = Release_NoSTDIO|Win32 - Release_NoSTDIO|x64 = Release_NoSTDIO|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.Build.0 = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|x64.ActiveCfg = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|x64.Build.0 = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 - {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.ActiveCfg = Release_NoSTDIO|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.Build.0 = Release_NoSTDIO|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|x64.ActiveCfg = Release_NoSTDIO|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|x64.Build.0 = Release_NoSTDIO|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 - {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/VisualC/SDL/SDL.dsp b/VisualC/SDL/SDL.dsp deleted file mode 100644 index 9c2c97a277..0000000000 --- a/VisualC/SDL/SDL.dsp +++ /dev/null @@ -1,546 +0,0 @@ -# Microsoft Developer Studio Project File - Name="SDL" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=SDL - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SDL.MAK". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SDL.MAK" CFG="SDL - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "SDL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "SDL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "SDL - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "_WINDOWS" /D _WIN32_WINNT=0x0400 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "SDL - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "_DEBUG" /D "_WINDOWS" /D _WIN32_WINNT=0x0400 /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "SDL - Win32 Release" -# Name "SDL - Win32 Debug" -# Begin Source File - -SOURCE=..\..\src\video\blank_cursor.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\default_cursor.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windx5\Directx.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_active.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audio.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audio_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audiocvt.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audiomem.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_0.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_1.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_A.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_A.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_N.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_bmp.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\cdrom\SDL_cdrom.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\cpuinfo\SDL_cpuinfo.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_cursor.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_cursor_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\windib\SDL_dibaudio.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\windib\SDL_dibaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibevents.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibevents_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibvideo.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\disk\SDL_diskaudio.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\disk\SDL_diskaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\windx5\SDL_dx5audio.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\windx5\SDL_dx5audio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windx5\SDL_dx5events.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windx5\SDL_dx5events_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windx5\SDL_dx5video.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windx5\SDL_dx5video.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windx5\SDL_dx5yuv.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windx5\SDL_dx5yuv_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_error.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_error_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_events.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_events_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_expose.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_fatal.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_fatal.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_gamma.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_getenv.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_iconv.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\SDL_joystick.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\SDL_joystick_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_keyboard.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_leaks.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_lowvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_malloc.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_mixer.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_mixer_MMX_VC.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\win32\SDL_mmjoystick.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_mouse.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullevents.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullevents_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullmouse.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullmouse_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullvideo.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_pixels.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_pixels_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_qsort.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_quit.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_resize.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_RLEaccel.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_RLEaccel_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\file\SDL_rwops.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_stretch.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_stretch_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_stdlib.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_string.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_surface.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_sysaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\cdrom\win32\SDL_syscdrom.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\cdrom\SDL_syscdrom.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\generic\SDL_syscond.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_sysevents.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_sysevents.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\SDL_sysjoystick.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\loadso\win32\SDL_sysloadso.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_sysmouse.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_sysmouse_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_sysmutex.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_syssem.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_systhread.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\SDL_systhread.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_systhread_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\win32\SDL_systimer.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\SDL_systimer.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_sysvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_syswm.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_syswm_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\SDL_thread.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\SDL_thread_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\SDL_timer.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\SDL_timer_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_video.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_vkeys.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_wave.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_wave.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_wingl.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_wingl_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuv.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuv_sw.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuv_sw_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuvfuncs.h -# End Source File -# Begin Source File - -SOURCE=.\Version.rc -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\Wmmsg.h -# End Source File -# End Target -# End Project diff --git a/VisualC/SDL/SDL.vcproj b/VisualC/SDL/SDL.vcproj deleted file mode 100644 index 0cdcd96e11..0000000000 --- a/VisualC/SDL/SDL.vcproj +++ /dev/null @@ -1,828 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/SDL/SDL_VS2008.vcproj b/VisualC/SDL/SDL_VS2008.vcproj new file mode 100644 index 0000000000..72eb2d4c9f --- /dev/null +++ b/VisualC/SDL/SDL_VS2008.vcproj @@ -0,0 +1,1330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/SDL/SDL_VS2010.vcxproj b/VisualC/SDL/SDL_VS2010.vcxproj new file mode 100644 index 0000000000..4fa9111d2a --- /dev/null +++ b/VisualC/SDL/SDL_VS2010.vcxproj @@ -0,0 +1,464 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + SDL + + + + DynamicLibrary + false + + + DynamicLibrary + false + + + DynamicLibrary + false + + + DynamicLibrary + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + false + + + Level3 + true + EditAndContinue + Default + false + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + false + $(DXSDK_DIR)\lib\x86 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + false + + + Level3 + EditAndContinue + false + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + false + $(DXSDK_DIR)\lib\x64 + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + false + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + + + Level3 + true + Default + false + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies) + true + Windows + $(DXSDK_DIR)\lib\x86 + true + true + true + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + + + OnlyExplicitInline + false + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + + + Level3 + false + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;oleaut32.lib;version.lib;%(AdditionalDependencies) + true + Windows + $(DXSDK_DIR)\lib\x64 + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/SDL/SDL_VS2012.vcxproj b/VisualC/SDL/SDL_VS2012.vcxproj new file mode 100644 index 0000000000..213c10cef8 --- /dev/null +++ b/VisualC/SDL/SDL_VS2012.vcxproj @@ -0,0 +1,468 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + SDL + + + + DynamicLibrary + false + v110 + + + DynamicLibrary + false + v110 + + + DynamicLibrary + false + v110 + + + DynamicLibrary + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + false + + + Level3 + true + EditAndContinue + Default + false + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + false + $(DXSDK_DIR)\lib\x86 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + X64 + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + false + + + Level3 + EditAndContinue + false + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + true + Windows + false + $(DXSDK_DIR)\lib\x64 + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + false + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + + + Level3 + true + Default + false + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + Windows + $(DXSDK_DIR)\lib\x86 + true + true + true + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + X64 + + + OnlyExplicitInline + false + ..\..\include;%(AdditionalIncludeDirectories);"$(DXSDK_DIR)\Include"; + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + false + true + + + Level3 + false + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + winmm.lib;imm32.lib;version.lib;%(AdditionalDependencies) + true + Windows + $(DXSDK_DIR)\lib\x64 + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/SDL/Version.rc b/VisualC/SDL/Version.rc deleted file mode 100644 index 0e729dd195..0000000000 --- a/VisualC/SDL/Version.rc +++ /dev/null @@ -1,105 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winresrc.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,15,0 - PRODUCTVERSION 1,2,15,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "1, 2, 15, 0\0" - VALUE "InternalName", "SDL\0" - VALUE "LegalCopyright", "Copyright © 2012 Sam Lantinga\0" - VALUE "OriginalFilename", "SDL.dll\0" - VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "1, 2, 15, 0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/VisualC/SDL/resource.h b/VisualC/SDL/resource.h deleted file mode 100644 index ddc9d9295d..0000000000 --- a/VisualC/SDL/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Version.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/VisualC/SDL_VS2008.sln b/VisualC/SDL_VS2008.sln new file mode 100644 index 0000000000..3c6a38058e --- /dev/null +++ b/VisualC/SDL_VS2008.sln @@ -0,0 +1,237 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2008.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2008.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2008.vcproj", "{26828762-C95D-4637-9CB1-7F0979523813}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2008.vcproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2008.vcproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2008.vcproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2008.vcproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2008.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2008.vcproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2008.vcproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2008.vcproj", "{31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2008.vcproj", "{79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2008.vcproj", "{66B32F7E-5716-48D0-B5B9-D832FD052DD5}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2008.vcproj", "{5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2008.vcproj", "{2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2008.vcproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_VS2008.vcproj", "{9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.ActiveCfg = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|Win32.Build.0 = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Debug|x64.ActiveCfg = Debug|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.ActiveCfg = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|Win32.Build.0 = Release|Win32 + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2}.Release|x64.ActiveCfg = Release|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.ActiveCfg = Debug|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|Win32.Build.0 = Debug|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Debug|x64.ActiveCfg = Debug|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.ActiveCfg = Release|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|Win32.Build.0 = Release|Win32 + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF}.Release|x64.ActiveCfg = Release|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.ActiveCfg = Debug|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|Win32.Build.0 = Debug|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Debug|x64.ActiveCfg = Debug|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.ActiveCfg = Release|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|Win32.Build.0 = Release|Win32 + {66B32F7E-5716-48D0-B5B9-D832FD052DD5}.Release|x64.ActiveCfg = Release|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.ActiveCfg = Debug|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|Win32.Build.0 = Debug|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Debug|x64.ActiveCfg = Debug|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.ActiveCfg = Release|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|Win32.Build.0 = Release|Win32 + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6}.Release|x64.ActiveCfg = Release|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.ActiveCfg = Debug|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|Win32.Build.0 = Debug|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Debug|x64.ActiveCfg = Debug|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.ActiveCfg = Release|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|Win32.Build.0 = Release|Win32 + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E}.Release|x64.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.ActiveCfg = Debug|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|Win32.Build.0 = Debug|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Debug|x64.ActiveCfg = Debug|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.ActiveCfg = Release|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|Win32.Build.0 = Release|Win32 + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA}.Release|x64.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {31A3E4E1-AAE9-4EF3-9B23-18D0924BE4D2} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {79CEE57E-1BC3-4FF6-90B3-9E39763CDAFF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {66B32F7E-5716-48D0-B5B9-D832FD052DD5} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {5D0930C0-7C91-4ECE-9014-7B7DDE9502E6} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {2D17C1EB-1157-460E-9A99-A82BFC1F9D1E} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {9C7E8C03-3130-436D-A97E-E8F8ED1AC4EA} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + EndGlobalSection +EndGlobal diff --git a/VisualC/SDL_VS2010.sln b/VisualC/SDL_VS2010.sln new file mode 100644 index 0000000000..fb5d873f2a --- /dev/null +++ b/VisualC/SDL_VS2010.sln @@ -0,0 +1,255 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2010.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2010.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2010.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2010.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2010.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2010.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2010.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2010.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2010.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2010.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2010.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2010.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2010.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2010.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2010.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2010.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testoverlay2", "tests\testoverlay2\testoverlay2_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08AAD}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.Build.0 = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.Build.0 = Release|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08AAD}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {2271060E-98B4-4596-8172-A041E4B2EC7A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {E7A6C41C-E059-4C9C-8CCC-73586A540B62} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {55812185-D13C-4022-9C81-32E0F4A08336} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {55812185-D13C-4022-9C81-32E0F4A08996} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {55812185-D13C-4022-9C81-32E0F4A08BCC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {55812185-D13C-4022-9C81-32E0F4A08AAD} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + EndGlobalSection +EndGlobal diff --git a/VisualC/SDL_VS2010EE.sln b/VisualC/SDL_VS2010EE.sln new file mode 100644 index 0000000000..d5213da46d --- /dev/null +++ b/VisualC/SDL_VS2010EE.sln @@ -0,0 +1,219 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2010.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2010.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2010.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2010.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2010.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2010.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2010.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2010.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2010.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2010.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2010.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2010.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2010.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2010.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2010.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2010.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2010.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.Build.0 = Release|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.Build.0 = Release|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.Build.0 = Release|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.Build.0 = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.Build.0 = Release|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.Build.0 = Release|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.Build.0 = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.Build.0 = Release|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.Build.0 = Release|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/VisualC/SDL_VS2012.sln b/VisualC/SDL_VS2012.sln new file mode 100644 index 0000000000..3ac7b68f29 --- /dev/null +++ b/VisualC/SDL_VS2012.sln @@ -0,0 +1,278 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2012.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2012.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2012.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2012.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2012.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2012.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2012.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2012.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2012.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2012.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2012.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2012.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2012.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2012.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2012.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2012.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.Build.0 = Debug|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.Build.0 = Release|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {26932B24-EFC6-4E3A-B277-ED653DA37968} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {CAE4F1D0-314F-4B10-805B-0EFD670133A0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {26828762-C95D-4637-9CB1-7F0979523813} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {2271060E-98B4-4596-8172-A041E4B2EC7A} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {E7A6C41C-E059-4C9C-8CCC-73586A540B62} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {55812185-D13C-4022-9C81-32E0F4A08336} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {55812185-D13C-4022-9C81-32E0F4A08996} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + {55812185-D13C-4022-9C81-32E0F4A08BCC} = {CE748C1F-3C21-4825-AA6A-F895A023F7E7} + EndGlobalSection +EndGlobal diff --git a/VisualC/SDL_VS2012EE.sln b/VisualC/SDL_VS2012EE.sln new file mode 100644 index 0000000000..456f699827 --- /dev/null +++ b/VisualC/SDL_VS2012EE.sln @@ -0,0 +1,258 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL_VS2012.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain_VS2012.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "tests\loopwave\loopwave_VS2012.vcxproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "tests\testplatform\testplatform_VS2012.vcxproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "tests\testfile\testfile_VS2012.vcxproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl2", "tests\testgl2\testgl2_VS2012.vcxproj", "{8B5CFB38-CCBA-40A8-AD7A-89C57B070884}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys_VS2012.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2_VS2012.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshape\testshape_VS2012.vcxproj", "{EDEA9D00-AF64-45DE-8F60-5957048F2F0F}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw2", "tests\testdraw2\testdraw2_VS2012.vcxproj", "{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpower", "tests\testpower\testpower_VS2012.vcxproj", "{C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest_VS2012.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testautomation", "tests\testautomation\testautomation_vs2012.vcxproj", "{FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testatomic", "tests\testatomic\testatomic_VS2012.vcxproj", "{2271060E-98B4-4596-8172-A041E4B2EC7A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testscale", "tests\testscale\testscale_VS2012.vcxproj", "{E7A6C41C-E059-4C9C-8CCC-73586A540B62}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testrendertarget", "tests\testrendertarget\testrendertarget_VS2012.vcxproj", "{43A06713-A52D-4008-AD7E-A69DF3FCFFA8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08336}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgesture", "tests\testgesture\testgesture_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08996}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "tests\testjoystick\testjoystick_VS2012.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08BCC}" + ProjectSection(ProjectDependencies) = postProject + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} = {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64 + {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.ActiveCfg = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|x64.Build.0 = Debug|x64 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|x64.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.ActiveCfg = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|x64.Build.0 = Debug|x64 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 + {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|x64.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.ActiveCfg = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|x64.Build.0 = Debug|x64 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 + {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|x64.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.ActiveCfg = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|Win32.Build.0 = Debug|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.ActiveCfg = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Debug|x64.Build.0 = Debug|x64 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.ActiveCfg = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|Win32.Build.0 = Release|Win32 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884}.Release|x64.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.ActiveCfg = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|Win32.Build.0 = Debug|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.ActiveCfg = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Debug|x64.Build.0 = Debug|x64 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.ActiveCfg = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|Win32.Build.0 = Release|Win32 + {26828762-C95D-4637-9CB1-7F0979523813}.Release|x64.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.ActiveCfg = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Win32.Build.0 = Debug|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.ActiveCfg = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|x64.Build.0 = Debug|x64 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.ActiveCfg = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Win32.Build.0 = Release|Win32 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|x64.ActiveCfg = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.ActiveCfg = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|Win32.Build.0 = Debug|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.ActiveCfg = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Debug|x64.Build.0 = Debug|x64 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|Win32.ActiveCfg = Release|Win32 + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F}.Release|x64.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|Win32.Build.0 = Debug|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.ActiveCfg = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Debug|x64.Build.0 = Debug|x64 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.ActiveCfg = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|Win32.Build.0 = Release|Win32 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}.Release|x64.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|Win32.Build.0 = Debug|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.ActiveCfg = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Debug|x64.Build.0 = Debug|x64 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.ActiveCfg = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|Win32.Build.0 = Release|Win32 + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3}.Release|x64.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Win32.Build.0 = Debug|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.ActiveCfg = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|x64.Build.0 = Debug|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.ActiveCfg = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Win32.Build.0 = Release|Win32 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.ActiveCfg = Release|x64 + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|x64.Build.0 = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.ActiveCfg = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|Win32.Build.0 = Debug|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.ActiveCfg = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Debug|x64.Build.0 = Debug|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.ActiveCfg = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|Win32.Build.0 = Release|Win32 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.ActiveCfg = Release|x64 + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0}.Release|x64.Build.0 = Release|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.ActiveCfg = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|Win32.Build.0 = Debug|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.ActiveCfg = Debug|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Debug|x64.Build.0 = Debug|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.ActiveCfg = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|Win32.Build.0 = Release|Win32 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.ActiveCfg = Release|x64 + {2271060E-98B4-4596-8172-A041E4B2EC7A}.Release|x64.Build.0 = Release|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.ActiveCfg = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|Win32.Build.0 = Debug|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.ActiveCfg = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Debug|x64.Build.0 = Debug|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.ActiveCfg = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|Win32.Build.0 = Release|Win32 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.ActiveCfg = Release|x64 + {E7A6C41C-E059-4C9C-8CCC-73586A540B62}.Release|x64.Build.0 = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.ActiveCfg = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|Win32.Build.0 = Debug|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.ActiveCfg = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Debug|x64.Build.0 = Debug|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.ActiveCfg = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|Win32.Build.0 = Release|Win32 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.ActiveCfg = Release|x64 + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08336}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08996}.Release|x64.Build.0 = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.ActiveCfg = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|Win32.Build.0 = Debug|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.ActiveCfg = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Debug|x64.Build.0 = Debug|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.ActiveCfg = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|Win32.Build.0 = Release|Win32 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.ActiveCfg = Release|x64 + {55812185-D13C-4022-9C81-32E0F4A08BCC}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/VisualC/SDLmain/SDLmain.dsp b/VisualC/SDLmain/SDLmain.dsp deleted file mode 100644 index 42a48f32b6..0000000000 --- a/VisualC/SDLmain/SDLmain.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="SDLmain" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=SDLmain - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SDLmain.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SDLmain.mak" CFG="SDLmain - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "SDLmain - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "SDLmain - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "SDLmain - Win32 Release_NoSTDIO" (based on\ - "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe - -!IF "$(CFG)" == "SDLmain - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Z7 /Od /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 Release_NoSTDIO" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SDLmain_" -# PROP BASE Intermediate_Dir "SDLmain_" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_NOSTDIO" -# PROP Intermediate_Dir "Release_NOSTDIO" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "NO_STDIO_REDIRECT" /YX /FD /c -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "SDLmain - Win32 Release" -# Name "SDLmain - Win32 Debug" -# Name "SDLmain - Win32 Release_NoSTDIO" -# Begin Source File - -SOURCE=..\..\Src\Main\Win32\SDL_win32_main.c -# End Source File -# End Target -# End Project diff --git a/VisualC/SDLmain/SDLmain.vcproj b/VisualC/SDLmain/SDLmain.vcproj deleted file mode 100644 index cc0e66ab37..0000000000 --- a/VisualC/SDLmain/SDLmain.vcproj +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/SDLmain/SDLmain_VS2008.vcproj b/VisualC/SDLmain/SDLmain_VS2008.vcproj new file mode 100644 index 0000000000..9e43c5c3a3 --- /dev/null +++ b/VisualC/SDLmain/SDLmain_VS2008.vcproj @@ -0,0 +1,424 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/SDLmain/SDLmain_VS2010.vcxproj b/VisualC/SDLmain/SDLmain_VS2010.vcxproj new file mode 100644 index 0000000000..122491dea2 --- /dev/null +++ b/VisualC/SDLmain/SDLmain_VS2010.vcxproj @@ -0,0 +1,163 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2main + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + false + OldStyle + + + true + + + + + X64 + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + OldStyle + + + true + + + + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + OldStyle + Default + false + + + true + + + + + X64 + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + .\Debug/SDLmain.pch + Level3 + true + OldStyle + Default + + + true + + + + + + + + + \ No newline at end of file diff --git a/VisualC/SDLmain/SDLmain_VS2012.vcxproj b/VisualC/SDLmain/SDLmain_VS2012.vcxproj new file mode 100644 index 0000000000..d44ea95c18 --- /dev/null +++ b/VisualC/SDLmain/SDLmain_VS2012.vcxproj @@ -0,0 +1,168 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2main + {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} + + + + StaticLibrary + false + v110 + + + StaticLibrary + false + v110 + + + StaticLibrary + false + MultiByte + v110 + + + StaticLibrary + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + OldStyle + false + + + true + + + + + X64 + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + OldStyle + false + + + true + + + + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + OldStyle + Default + false + + + true + + + + + X64 + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + OldStyle + Default + false + + + true + + + + + + + + + \ No newline at end of file diff --git a/VisualC/SDLtest/SDLtest_VS2008.vcproj b/VisualC/SDLtest/SDLtest_VS2008.vcproj new file mode 100644 index 0000000000..4cd7e00039 --- /dev/null +++ b/VisualC/SDLtest/SDLtest_VS2008.vcproj @@ -0,0 +1,480 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/SDLtest/SDLtest_VS2010.vcxproj b/VisualC/SDLtest/SDLtest_VS2010.vcxproj new file mode 100644 index 0000000000..2fbbd25fa9 --- /dev/null +++ b/VisualC/SDLtest/SDLtest_VS2010.vcxproj @@ -0,0 +1,191 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2test + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + + + + StaticLibrary + false + + + StaticLibrary + false + + + StaticLibrary + false + MultiByte + + + StaticLibrary + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + false + OldStyle + + + true + + + + + X64 + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + OldStyle + + + true + + + + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + OldStyle + Default + false + + + true + + + + + X64 + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + .\Debug/SDLtest.pch + Level3 + true + OldStyle + Default + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/SDLtest/SDLtest_VS2012.vcxproj b/VisualC/SDLtest/SDLtest_VS2012.vcxproj new file mode 100644 index 0000000000..a0d78c6b5c --- /dev/null +++ b/VisualC/SDLtest/SDLtest_VS2012.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + SDL2test + {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} + + + + StaticLibrary + false + v110 + + + StaticLibrary + false + v110 + + + StaticLibrary + false + MultiByte + v110 + + + StaticLibrary + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + OldStyle + false + + + true + + + + + X64 + + + OnlyExplicitInline + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + OldStyle + false + + + true + + + + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + OldStyle + Default + false + + + true + + + + + X64 + + + Disabled + ..\..\include;..\..\include\SDL;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + OldStyle + Default + false + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/clean.sh b/VisualC/clean.sh new file mode 100755 index 0000000000..f90a11e970 --- /dev/null +++ b/VisualC/clean.sh @@ -0,0 +1,5 @@ +find . -type d -name 'Debug' -exec rm -rv {} \; +find . -type d -name 'Release' -exec rm -rv {} \; +find . -type f -name '*.user' -exec rm -v {} \; +find . -type f -name '*.ncb' -exec rm -v {} \; +find . -type f -name '*.suo' -exec rm -v {} \; diff --git a/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj b/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj new file mode 100644 index 0000000000..412eda387d --- /dev/null +++ b/VisualC/tests/checkkeys/checkkeys_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj b/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj new file mode 100644 index 0000000000..9c2abe4783 --- /dev/null +++ b/VisualC/tests/checkkeys/checkkeys_VS2010.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + checkkeys + checkkeys + {26828762-C95D-4637-9CB1-7F0979523813} + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + diff --git a/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj b/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj new file mode 100644 index 0000000000..10ac85e90b --- /dev/null +++ b/VisualC/tests/checkkeys/checkkeys_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + checkkeys + checkkeys + {26828762-C95D-4637-9CB1-7F0979523813} + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/graywin/graywin.dsp b/VisualC/tests/graywin/graywin.dsp deleted file mode 100644 index 7ecd032199..0000000000 --- a/VisualC/tests/graywin/graywin.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="graywin" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=graywin - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "graywin.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "graywin.mak" CFG="graywin - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "graywin - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "graywin - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "graywin - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "graywin - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "graywin - Win32 Release" -# Name "graywin - Win32 Debug" -# Begin Source File - -SOURCE=..\..\..\test\graywin.c -# End Source File -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/graywin/graywin.vcproj b/VisualC/tests/graywin/graywin.vcproj deleted file mode 100644 index cd1e3aedf6..0000000000 --- a/VisualC/tests/graywin/graywin.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/loopwave/loopwave.dsp b/VisualC/tests/loopwave/loopwave.dsp deleted file mode 100644 index 584729453b..0000000000 --- a/VisualC/tests/loopwave/loopwave.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="loopwave" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=loopwave - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "loopwave.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "loopwave.mak" CFG="loopwave - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "loopwave - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "loopwave - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "loopwave - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "loopwave - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "loopwave - Win32 Release" -# Name "loopwave - Win32 Debug" -# Begin Source File - -SOURCE=..\..\..\Test\Loopwave.c -# End Source File -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/loopwave/loopwave.vcproj b/VisualC/tests/loopwave/loopwave.vcproj deleted file mode 100644 index 86f428c192..0000000000 --- a/VisualC/tests/loopwave/loopwave.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/loopwave/loopwave_VS2008.vcproj b/VisualC/tests/loopwave/loopwave_VS2008.vcproj new file mode 100644 index 0000000000..f64cc0fb2a --- /dev/null +++ b/VisualC/tests/loopwave/loopwave_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/loopwave/loopwave_VS2010.vcxproj b/VisualC/tests/loopwave/loopwave_VS2010.vcxproj new file mode 100644 index 0000000000..4ef300ad0c --- /dev/null +++ b/VisualC/tests/loopwave/loopwave_VS2010.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + loopwave + loopwave + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + diff --git a/VisualC/tests/loopwave/loopwave_VS2012.vcxproj b/VisualC/tests/loopwave/loopwave_VS2012.vcxproj new file mode 100644 index 0000000000..0a648593eb --- /dev/null +++ b/VisualC/tests/loopwave/loopwave_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + loopwave + loopwave + {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testalpha/testalpha.dsp b/VisualC/tests/testalpha/testalpha.dsp deleted file mode 100644 index ae518abca9..0000000000 --- a/VisualC/tests/testalpha/testalpha.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testalpha" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testalpha - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testalpha.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testalpha.mak" CFG="testalpha - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testalpha - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testalpha - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testalpha - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testalpha - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testalpha - Win32 Release" -# Name "testalpha - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\Test\testalpha.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testalpha/testalpha.vcproj b/VisualC/tests/testalpha/testalpha.vcproj deleted file mode 100644 index d4d2e723fd..0000000000 --- a/VisualC/tests/testalpha/testalpha.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testatomic/testatomic_VS2008.vcproj b/VisualC/tests/testatomic/testatomic_VS2008.vcproj new file mode 100644 index 0000000000..8d69c92126 --- /dev/null +++ b/VisualC/tests/testatomic/testatomic_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testatomic/testatomic_VS2010.vcxproj b/VisualC/tests/testatomic/testatomic_VS2010.vcxproj new file mode 100644 index 0000000000..3b7c7e1009 --- /dev/null +++ b/VisualC/tests/testatomic/testatomic_VS2010.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testatomic + {2271060E-98B4-4596-8172-A041E4B2EC7A} + testatomic + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testatomic/testatomic_VS2012.vcxproj b/VisualC/tests/testatomic/testatomic_VS2012.vcxproj new file mode 100644 index 0000000000..8e908f01b1 --- /dev/null +++ b/VisualC/tests/testatomic/testatomic_VS2012.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testatomic + {2271060E-98B4-4596-8172-A041E4B2EC7A} + testatomic + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testautomation/testautomation_VS2008.vcproj b/VisualC/tests/testautomation/testautomation_VS2008.vcproj new file mode 100755 index 0000000000..5b5ffa66fd --- /dev/null +++ b/VisualC/tests/testautomation/testautomation_VS2008.vcproj @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj new file mode 100644 index 0000000000..3c4fe9d9f9 --- /dev/null +++ b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj @@ -0,0 +1,215 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testautomation + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} + testautomation + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + true + + + Application + Unicode + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + true + Windows + MachineX86 + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + Disabled + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + MaxSpeed + true + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + true + Windows + true + true + MachineX86 + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + MaxSpeed + true + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + true + Windows + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + diff --git a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj new file mode 100644 index 0000000000..a026096bc9 --- /dev/null +++ b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj @@ -0,0 +1,213 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testautomation + {FEE710DB-EC7B-4CCB-BD75-535D401A2FE0} + testautomation + Win32Proj + + + + Application + Unicode + true + v110 + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + Disabled + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + true + Windows + MachineX86 + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + Disabled + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + MaxSpeed + true + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + true + Windows + true + true + MachineX86 + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + MaxSpeed + true + $(SolutionDir)..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + true + Windows + true + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj b/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj new file mode 100644 index 0000000000..03a44498ae --- /dev/null +++ b/VisualC/tests/testdraw2/testdraw2_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj b/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj new file mode 100644 index 0000000000..5588b76e3a --- /dev/null +++ b/VisualC/tests/testdraw2/testdraw2_VS2010.vcxproj @@ -0,0 +1,234 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testdraw2 + testdraw2 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj b/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj new file mode 100644 index 0000000000..e95358feb2 --- /dev/null +++ b/VisualC/tests/testdraw2/testdraw2_VS2012.vcxproj @@ -0,0 +1,232 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testdraw2 + testdraw2 + {8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testfile/testfile.dsp b/VisualC/tests/testfile/testfile.dsp deleted file mode 100644 index 9b6f7c8eb0..0000000000 --- a/VisualC/tests/testfile/testfile.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testfile" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testfile - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testfile.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testfile.mak" CFG="testfile - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testfile - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testfile - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testfile - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testfile - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testfile - Win32 Release" -# Name "testfile - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\Test\testfile.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testfile/testfile.vcproj b/VisualC/tests/testfile/testfile.vcproj deleted file mode 100644 index d882685b28..0000000000 --- a/VisualC/tests/testfile/testfile.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testfile/testfile_VS2008.vcproj b/VisualC/tests/testfile/testfile_VS2008.vcproj new file mode 100644 index 0000000000..c421a2a3df --- /dev/null +++ b/VisualC/tests/testfile/testfile_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testfile/testfile_VS2010.vcxproj b/VisualC/tests/testfile/testfile_VS2010.vcxproj new file mode 100644 index 0000000000..6a74a12e95 --- /dev/null +++ b/VisualC/tests/testfile/testfile_VS2010.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testfile + testfile + {CAE4F1D0-314F-4B10-805B-0EFD670133A0} + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testfile/testfile_VS2012.vcxproj b/VisualC/tests/testfile/testfile_VS2012.vcxproj new file mode 100644 index 0000000000..dc9f82827e --- /dev/null +++ b/VisualC/tests/testfile/testfile_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testfile + testfile + {CAE4F1D0-314F-4B10-805B-0EFD670133A0} + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj b/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj new file mode 100644 index 0000000000..e2d7b6b05b --- /dev/null +++ b/VisualC/tests/testgamecontroller/testgamecontroller_VS2010.vcxproj @@ -0,0 +1,227 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testgamecontroller + testgamecontroller + {55812185-D13C-4022-9C81-32E0F4A08336} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj b/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj new file mode 100644 index 0000000000..c832c5937e --- /dev/null +++ b/VisualC/tests/testgamecontroller/testgamecontroller_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testgamecontroller + testgamecontroller + {55812185-D13C-4022-9C81-32E0F4A08336} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testgamma/testgamma.dsp b/VisualC/tests/testgamma/testgamma.dsp deleted file mode 100644 index e160a0d3cb..0000000000 --- a/VisualC/tests/testgamma/testgamma.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testgamma" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testgamma - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testgamma.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testgamma.mak" CFG="testgamma - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testgamma - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testgamma - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testgamma - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testgamma - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testgamma - Win32 Release" -# Name "testgamma - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\test\testgamma.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testgamma/testgamma.vcproj b/VisualC/tests/testgamma/testgamma.vcproj deleted file mode 100644 index 020ef098fa..0000000000 --- a/VisualC/tests/testgamma/testgamma.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testgesture/testgesture_VS2008.vcproj b/VisualC/tests/testgesture/testgesture_VS2008.vcproj new file mode 100644 index 0000000000..cc199069a0 --- /dev/null +++ b/VisualC/tests/testgesture/testgesture_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testgesture/testgesture_VS2010.vcxproj b/VisualC/tests/testgesture/testgesture_VS2010.vcxproj new file mode 100644 index 0000000000..63adbf0857 --- /dev/null +++ b/VisualC/tests/testgesture/testgesture_VS2010.vcxproj @@ -0,0 +1,227 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testgesture + testgesture + {55812185-D13C-4022-9C81-32E0F4A08996} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testgesture/testgesture_VS2012.vcxproj b/VisualC/tests/testgesture/testgesture_VS2012.vcxproj new file mode 100644 index 0000000000..ef7182011c --- /dev/null +++ b/VisualC/tests/testgesture/testgesture_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testgesture + testgesture + {55812185-D13C-4022-9C81-32E0F4A08996} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testgl/testgl.dsp b/VisualC/tests/testgl/testgl.dsp deleted file mode 100644 index 03ce928546..0000000000 --- a/VisualC/tests/testgl/testgl.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testgl" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testgl - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testgl.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testgl.mak" CFG="testgl - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testgl - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testgl - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testgl - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_OPENGL" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testgl - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_OPENGL" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testgl - Win32 Release" -# Name "testgl - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\test\testgl.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testgl/testgl.vcproj b/VisualC/tests/testgl/testgl.vcproj deleted file mode 100644 index 3116fb8990..0000000000 --- a/VisualC/tests/testgl/testgl.vcproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testgl2/testgl2_VS2008.vcproj b/VisualC/tests/testgl2/testgl2_VS2008.vcproj new file mode 100644 index 0000000000..65c6a6e199 --- /dev/null +++ b/VisualC/tests/testgl2/testgl2_VS2008.vcproj @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testgl2/testgl2_VS2010.vcxproj b/VisualC/tests/testgl2/testgl2_VS2010.vcxproj new file mode 100644 index 0000000000..8a3bd5139f --- /dev/null +++ b/VisualC/tests/testgl2/testgl2_VS2010.vcxproj @@ -0,0 +1,238 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testgl2 + testgl2 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testgl2/testgl2_VS2012.vcxproj b/VisualC/tests/testgl2/testgl2_VS2012.vcxproj new file mode 100644 index 0000000000..d02101fe75 --- /dev/null +++ b/VisualC/tests/testgl2/testgl2_VS2012.vcxproj @@ -0,0 +1,236 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testgl2 + testgl2 + {8B5CFB38-CCBA-40A8-AD7A-89C57B070884} + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;HAVE_OPENGL;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + opengl32.lib;%(AdditionalDependencies) + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testjoystick/testjoystick.dsp b/VisualC/tests/testjoystick/testjoystick.dsp deleted file mode 100644 index 98f40488ab..0000000000 --- a/VisualC/tests/testjoystick/testjoystick.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testjoystick" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testjoystick - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testjoystick.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testjoystick.mak" CFG="testjoystick - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testjoystick - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testjoystick - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testjoystick - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testjoystick - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testjoystick - Win32 Release" -# Name "testjoystick - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\test\testjoystick.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testjoystick/testjoystick.vcproj b/VisualC/tests/testjoystick/testjoystick.vcproj deleted file mode 100644 index 7f03866ddc..0000000000 --- a/VisualC/tests/testjoystick/testjoystick.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj b/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj new file mode 100644 index 0000000000..c6b91bf48c --- /dev/null +++ b/VisualC/tests/testjoystick/testjoystick_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj b/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj new file mode 100644 index 0000000000..41c98e4254 --- /dev/null +++ b/VisualC/tests/testjoystick/testjoystick_VS2010.vcxproj @@ -0,0 +1,227 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testjoystick + testjoystick + {55812185-D13C-4022-9C81-32E0F4A08BCC} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj b/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj new file mode 100644 index 0000000000..9730432ddf --- /dev/null +++ b/VisualC/tests/testjoystick/testjoystick_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testjoystick + testjoystick + {55812185-D13C-4022-9C81-32E0F4A08BCC} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj b/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj new file mode 100644 index 0000000000..cb5023f8db --- /dev/null +++ b/VisualC/tests/testoverlay2/testoverlay2_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj b/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj new file mode 100644 index 0000000000..86a73edb99 --- /dev/null +++ b/VisualC/tests/testoverlay2/testoverlay2_VS2010.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testoverlay2 + testoverlay2 + {55812185-D13C-4022-9C81-32E0F4A08AAD} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL and data files + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj b/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj new file mode 100644 index 0000000000..d51d495e90 --- /dev/null +++ b/VisualC/tests/testoverlay2/testoverlay2_VS2012.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testoverlay2 + testoverlay2 + {55812185-D13C-4022-9C81-32E0F4A08AAD} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\moose.dat" "$(TargetDir)\moose.dat" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testpalette/testpalette.dsp b/VisualC/tests/testpalette/testpalette.dsp deleted file mode 100644 index e1ae296734..0000000000 --- a/VisualC/tests/testpalette/testpalette.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testpalette" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testpalette - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testpalette.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testpalette.mak" CFG="testpalette - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testpalette - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testpalette - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testpalette - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testpalette - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testpalette - Win32 Release" -# Name "testpalette - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\test\testpalette.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testpalette/testpalette.vcproj b/VisualC/tests/testpalette/testpalette.vcproj deleted file mode 100644 index 0e782717f8..0000000000 --- a/VisualC/tests/testpalette/testpalette.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testplatform/testplatform.dsp b/VisualC/tests/testplatform/testplatform.dsp deleted file mode 100644 index 7cbf723d0d..0000000000 --- a/VisualC/tests/testplatform/testplatform.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testplatform" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testplatform - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testplatform.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testplatform.mak" CFG="testplatform - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testplatform - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testplatform - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testplatform - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testplatform - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testplatform - Win32 Release" -# Name "testplatform - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\Test\testplatform.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testplatform/testplatform.vcproj b/VisualC/tests/testplatform/testplatform.vcproj deleted file mode 100644 index 2517030357..0000000000 --- a/VisualC/tests/testplatform/testplatform.vcproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testplatform/testplatform_VS2008.vcproj b/VisualC/tests/testplatform/testplatform_VS2008.vcproj new file mode 100644 index 0000000000..b1fa2dcc3a --- /dev/null +++ b/VisualC/tests/testplatform/testplatform_VS2008.vcproj @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testplatform/testplatform_VS2010.vcxproj b/VisualC/tests/testplatform/testplatform_VS2010.vcxproj new file mode 100644 index 0000000000..d0c019257e --- /dev/null +++ b/VisualC/tests/testplatform/testplatform_VS2010.vcxproj @@ -0,0 +1,250 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testplatform + testplatform + {26932B24-EFC6-4E3A-B277-ED653DA37968} + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDebugDLL + Level3 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/testplatform.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + .\Release/testplatform.pch + $(IntDir) + $(IntDir) + $(IntDir)vc$(PlatformToolsetVersion).pdb + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + MaxSpeed + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testplatform/testplatform_VS2012.vcxproj b/VisualC/tests/testplatform/testplatform_VS2012.vcxproj new file mode 100644 index 0000000000..8885fdf71c --- /dev/null +++ b/VisualC/tests/testplatform/testplatform_VS2012.vcxproj @@ -0,0 +1,249 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testplatform + testplatform + {26932B24-EFC6-4E3A-B277-ED653DA37968} + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDebugDLL + Level3 + true + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + Level3 + true + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/testplatform.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + $(IntDir) + $(IntDir) + $(IntDir)vc$(PlatformToolsetVersion).pdb + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + MaxSpeed + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + true + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testpower/testpower_VS2008.vcproj b/VisualC/tests/testpower/testpower_VS2008.vcproj new file mode 100644 index 0000000000..6171d0f597 --- /dev/null +++ b/VisualC/tests/testpower/testpower_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testpower/testpower_VS2010.vcxproj b/VisualC/tests/testpower/testpower_VS2010.vcxproj new file mode 100644 index 0000000000..6c252a1482 --- /dev/null +++ b/VisualC/tests/testpower/testpower_VS2010.vcxproj @@ -0,0 +1,234 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testpower + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} + testpower + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + .\Debug/testpower.pch + .\Debug/testpower.pch + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testpower/testpower_VS2012.vcxproj b/VisualC/tests/testpower/testpower_VS2012.vcxproj new file mode 100644 index 0000000000..60c8981c68 --- /dev/null +++ b/VisualC/tests/testpower/testpower_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testpower + {C4E04D18-EF76-4B42-B4C2-16A1BACDC0A3} + testpower + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj b/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj new file mode 100644 index 0000000000..d298dd0a62 --- /dev/null +++ b/VisualC/tests/testrendertarget/testrendertarget_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj b/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj new file mode 100644 index 0000000000..133366f5c9 --- /dev/null +++ b/VisualC/tests/testrendertarget/testrendertarget_VS2010.vcxproj @@ -0,0 +1,242 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testrendertarget + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} + testrendertarget + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + diff --git a/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj b/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj new file mode 100644 index 0000000000..b85c066c21 --- /dev/null +++ b/VisualC/tests/testrendertarget/testrendertarget_VS2012.vcxproj @@ -0,0 +1,245 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testrendertarget + {43A06713-A52D-4008-AD7E-A69DF3FCFFA8} + testrendertarget + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + diff --git a/VisualC/tests/tests.dsw b/VisualC/tests/tests.dsw deleted file mode 100644 index 61e3fcdf77..0000000000 --- a/VisualC/tests/tests.dsw +++ /dev/null @@ -1,161 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "graywin"=".\graywin\graywin.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "loopwave"=".\loopwave\loopwave.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testalpha"=".\testalpha\testalpha.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testfile"=".\testfile\testfile.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testgamma"=".\testgamma\testgamma.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testgl"=".\testgl\testgl.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testjoystick"=".\testjoystick\testjoystick.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testpalette"=".\testpalette\testpalette.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testplatform"=".\testplatform\testplatform.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testvidinfo"=".\testvidinfo\testvidinfo.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testwin"=".\testwin\testwin.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "testwm"=".\testwm\testwm.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/VisualC/tests/tests.sln b/VisualC/tests/tests.sln deleted file mode 100644 index caa95445e7..0000000000 --- a/VisualC/tests/tests.sln +++ /dev/null @@ -1,85 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graywin", "graywin\graywin.vcproj", "{0BCCA0BF-073E-439E-BCE0-C9353C177487}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "loopwave\loopwave.vcproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testalpha", "testalpha\testalpha.vcproj", "{7814D54B-65D3-4677-AD77-E0B980B4FA2D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamma", "testgamma\testgamma.vcproj", "{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl", "testgl\testgl.vcproj", "{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "testjoystick\testjoystick.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08304}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpalette", "testpalette\testpalette.vcproj", "{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvidinfo", "testvidinfo\testvidinfo.vcproj", "{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwin", "testwin\testwin.vcproj", "{0FFD1A21-11DB-492C-A989-E4F195B0C441}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "testwm\testwm.vcproj", "{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "testplatform\testplatform.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "testfile\testfile.vcproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Debug|Win32.ActiveCfg = Debug|Win32 - {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Debug|Win32.Build.0 = Debug|Win32 - {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release|Win32.ActiveCfg = Release|Win32 - {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release|Win32.Build.0 = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32 - {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32 - {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Debug|Win32.ActiveCfg = Debug|Win32 - {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Debug|Win32.Build.0 = Debug|Win32 - {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release|Win32.ActiveCfg = Release|Win32 - {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release|Win32.Build.0 = Release|Win32 - {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Debug|Win32.ActiveCfg = Debug|Win32 - {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Debug|Win32.Build.0 = Debug|Win32 - {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release|Win32.ActiveCfg = Release|Win32 - {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release|Win32.Build.0 = Release|Win32 - {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Debug|Win32.ActiveCfg = Debug|Win32 - {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Debug|Win32.Build.0 = Debug|Win32 - {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release|Win32.ActiveCfg = Release|Win32 - {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release|Win32.Build.0 = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32 - {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.ActiveCfg = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.Build.0 = Debug|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.ActiveCfg = Release|Win32 - {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.Build.0 = Release|Win32 - {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.ActiveCfg = Debug|Win32 - {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.Build.0 = Debug|Win32 - {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release|Win32.ActiveCfg = Release|Win32 - {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release|Win32.Build.0 = Release|Win32 - {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Debug|Win32.ActiveCfg = Debug|Win32 - {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Debug|Win32.Build.0 = Debug|Win32 - {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release|Win32.ActiveCfg = Release|Win32 - {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release|Win32.Build.0 = Release|Win32 - {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Debug|Win32.ActiveCfg = Debug|Win32 - {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Debug|Win32.Build.0 = Debug|Win32 - {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.ActiveCfg = Release|Win32 - {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.Build.0 = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32 - {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32 - {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/VisualC/tests/testscale/testscale_VS2008.vcproj b/VisualC/tests/testscale/testscale_VS2008.vcproj new file mode 100644 index 0000000000..e0cac7cf38 --- /dev/null +++ b/VisualC/tests/testscale/testscale_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testscale/testscale_VS2010.vcxproj b/VisualC/tests/testscale/testscale_VS2010.vcxproj new file mode 100644 index 0000000000..6753c1cd2c --- /dev/null +++ b/VisualC/tests/testscale/testscale_VS2010.vcxproj @@ -0,0 +1,242 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testscale + {E7A6C41C-E059-4C9C-8CCC-73586A540B62} + testscale + + + + Application + false + + + Application + false + + + Application + false + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + diff --git a/VisualC/tests/testscale/testscale_VS2012.vcxproj b/VisualC/tests/testscale/testscale_VS2012.vcxproj new file mode 100644 index 0000000000..1419804b24 --- /dev/null +++ b/VisualC/tests/testscale/testscale_VS2012.vcxproj @@ -0,0 +1,246 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testscale + {E7A6C41C-E059-4C9C-8CCC-73586A540B62} + testscale + + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" +copy "$(SolutionDir)\..\test\sample.bmp" "$(TargetDir)\sample.bmp" + + + Copy SDL and data files + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + diff --git a/VisualC/tests/testshape/testshape_VS2008.vcproj b/VisualC/tests/testshape/testshape_VS2008.vcproj new file mode 100644 index 0000000000..fff1458dd4 --- /dev/null +++ b/VisualC/tests/testshape/testshape_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testshape/testshape_VS2010.vcxproj b/VisualC/tests/testshape/testshape_VS2010.vcxproj new file mode 100644 index 0000000000..f7e96f9cc1 --- /dev/null +++ b/VisualC/tests/testshape/testshape_VS2010.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testshape + testshape + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testshape/testshape_VS2012.vcxproj b/VisualC/tests/testshape/testshape_VS2012.vcxproj new file mode 100644 index 0000000000..b7c4e5e1c8 --- /dev/null +++ b/VisualC/tests/testshape/testshape_VS2012.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testshape + testshape + {EDEA9D00-AF64-45DE-8F60-5957048F2F0F} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" + + + Copy SDL + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj b/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj new file mode 100644 index 0000000000..5e37549fd5 --- /dev/null +++ b/VisualC/tests/testsprite2/testsprite2_VS2008.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj b/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj new file mode 100644 index 0000000000..e3cac8acc0 --- /dev/null +++ b/VisualC/tests/testsprite2/testsprite2_VS2010.vcxproj @@ -0,0 +1,238 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testsprite2 + testsprite2 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682} + + + + Application + false + + + Application + false + MultiByte + + + Application + false + + + Application + false + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + + + + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} + + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + + + {81ce8daf-ebb2-4761-8e45-b71abcca8c68} + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj b/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj new file mode 100644 index 0000000000..c2ac6e0e33 --- /dev/null +++ b/VisualC/tests/testsprite2/testsprite2_VS2012.vcxproj @@ -0,0 +1,236 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + testsprite2 + testsprite2 + {40FB7794-D3C3-4CFE-BCF4-A80C96635682} + + + + Application + false + v110 + + + Application + false + MultiByte + v110 + + + Application + false + v110 + + + Application + false + v110 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + true + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + + + OnlyExplicitInline + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + + + Disabled + ..\..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + Windows + + + copy "$(SolutionDir)\SDL\$(Platform)\$(Configuration)\SDL2.dll" "$(TargetDir)\SDL2.dll" +copy "$(SolutionDir)\..\test\icon.bmp" "$(TargetDir)\icon.bmp" + + + Copy SDL and data files + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VisualC/tests/testvidinfo/testvidinfo.dsp b/VisualC/tests/testvidinfo/testvidinfo.dsp deleted file mode 100644 index 8e0fbcf8ba..0000000000 --- a/VisualC/tests/testvidinfo/testvidinfo.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testvidinfo" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testvidinfo - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testvidinfo.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testvidinfo.mak" CFG="testvidinfo - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testvidinfo - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testvidinfo - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testvidinfo - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testvidinfo - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testvidinfo - Win32 Release" -# Name "testvidinfo - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\Test\testvidinfo.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testvidinfo/testvidinfo.vcproj b/VisualC/tests/testvidinfo/testvidinfo.vcproj deleted file mode 100644 index a2033c8a09..0000000000 --- a/VisualC/tests/testvidinfo/testvidinfo.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testwin/testwin.dsp b/VisualC/tests/testwin/testwin.dsp deleted file mode 100644 index f55c914ecf..0000000000 --- a/VisualC/tests/testwin/testwin.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testwin" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testwin - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testwin.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testwin.mak" CFG="testwin - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testwin - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testwin - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testwin - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testwin - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testwin - Win32 Release" -# Name "testwin - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\Test\Testwin.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testwin/testwin.vcproj b/VisualC/tests/testwin/testwin.vcproj deleted file mode 100644 index 330afb5310..0000000000 --- a/VisualC/tests/testwin/testwin.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualC/tests/testwm/testwm.dsp b/VisualC/tests/testwm/testwm.dsp deleted file mode 100644 index 141d814e13..0000000000 --- a/VisualC/tests/testwm/testwm.dsp +++ /dev/null @@ -1,102 +0,0 @@ -# Microsoft Developer Studio Project File - Name="testwm" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=testwm - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testwm.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testwm.mak" CFG="testwm - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testwm - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "testwm - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "testwm - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386 - -!ELSEIF "$(CFG)" == "testwm - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "testwm - Win32 Release" -# Name "testwm - Win32 Debug" -# Begin Source File - -SOURCE=..\..\Sdl\Debug\SDL.lib -# End Source File -# Begin Source File - -SOURCE=..\..\SDLmain\Debug\SDLmain.lib -# End Source File -# Begin Source File - -SOURCE=..\..\..\test\testwm.c -# End Source File -# End Target -# End Project diff --git a/VisualC/tests/testwm/testwm.vcproj b/VisualC/tests/testwm/testwm.vcproj deleted file mode 100644 index 0a6178461a..0000000000 --- a/VisualC/tests/testwm/testwm.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualCE/SDL.sln b/VisualCE/SDL.sln deleted file mode 100644 index aaf906f4ed..0000000000 --- a/VisualCE/SDL.sln +++ /dev/null @@ -1,149 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcproj", "{C598024D-8030-4F9C-AB76-69BF4CA0645F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcproj", "{5AC88B84-5EAA-4C1E-948D-332DA34227F6}" - ProjectSection(ProjectDependencies) = postProject - {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testalpha", "testalpha\testalpha.vcproj", "{DF401CB3-6F70-4485-996B-B7C357CF7EE7}" - ProjectSection(ProjectDependencies) = postProject - {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F} - {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwin", "testwin\testwin.vcproj", "{DC516978-88CB-4F9A-A39A-C351C258613B}" - ProjectSection(ProjectDependencies) = postProject - {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F} - {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "loopwave\loopwave.vcproj", "{6F642636-CB11-4DC7-855E-27FE1744003A}" - ProjectSection(ProjectDependencies) = postProject - {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F} - {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testtimer", "testtimer\testtimer.vcproj", "{D482D7EE-6FF0-4254-9027-C59F8F03AB1F}" - ProjectSection(ProjectDependencies) = postProject - {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F} - {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4) - Debug|Smartphone 2003 (ARMV4) = Debug|Smartphone 2003 (ARMV4) - Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4) - Release|Smartphone 2003 (ARMV4) = Release|Smartphone 2003 (ARMV4) - Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/VisualCE/SDL.vcw b/VisualCE/SDL.vcw deleted file mode 100644 index 8393d2f9b5..0000000000 --- a/VisualCE/SDL.vcw +++ /dev/null @@ -1,116 +0,0 @@ -Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "loopwave"=.\loopwave\loopwave.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name SDL - End Project Dependency - Begin Project Dependency - Project_Dep_Name SDLmain - End Project Dependency -}}} - -############################################################################### - -Project: "SDL"=.\SDL\SDL.VCP - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "SDLmain"=.\SDLmain\SDLmain.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name SDL - End Project Dependency -}}} - -############################################################################### - -Project: "testtimer"=.\testtimer\testtimer.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name SDL - End Project Dependency - Begin Project Dependency - Project_Dep_Name SDLmain - End Project Dependency -}}} - -############################################################################### - -Project: "testalpha"=.\testalpha\testalpha.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name SDL - End Project Dependency - Begin Project Dependency - Project_Dep_Name SDLmain - End Project Dependency -}}} - -############################################################################### - -Project: "testwin"=.\testwin\testwin.vcp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name SDL - End Project Dependency - Begin Project Dependency - Project_Dep_Name SDLmain - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/VisualCE/SDL/SDL.vcp b/VisualCE/SDL/SDL.vcp deleted file mode 100644 index 7527b39f08..0000000000 --- a/VisualCE/SDL/SDL.vcp +++ /dev/null @@ -1,42066 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="SDL" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE MIPSIV) Dynamic-Link Library" 0x9602 -# TARGTYPE "Win32 (WCE ARMV4T) Dynamic-Link Library" 0xa402 -# TARGTYPE "Win32 (WCE MIPSIV_FP) Dynamic-Link Library" 0x9202 -# TARGTYPE "Win32 (WCE SH3) Dynamic-Link Library" 0x8102 -# TARGTYPE "Win32 (WCE MIPSII_FP) Dynamic-Link Library" 0xa202 -# TARGTYPE "Win32 (WCE x86) Dynamic-Link Library" 0x8302 -# TARGTYPE "Win32 (WCE ARM) Dynamic-Link Library" 0x8502 -# TARGTYPE "Win32 (WCE emulator) Dynamic-Link Library" 0xa602 -# TARGTYPE "Win32 (WCE SH4) Dynamic-Link Library" 0x8602 -# TARGTYPE "Win32 (WCE ARMV4) Dynamic-Link Library" 0xa302 -# TARGTYPE "Win32 (WCE MIPS) Dynamic-Link Library" 0x8202 -# TARGTYPE "Win32 (WCE MIPS16) Dynamic-Link Library" 0x8902 -# TARGTYPE "Win32 (WCE ARMV4I) Dynamic-Link Library" 0xa502 -# TARGTYPE "Win32 (WCE MIPSII) Dynamic-Link Library" 0xa102 - -CFG=SDL - Win32 (WCE MIPSII_FP) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SDL.VCN". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SDL.VCN" CFG="SDL - Win32 (WCE MIPSII_FP) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "SDL - Win32 (WCE MIPSII_FP) Release" (based on "Win32 (WCE MIPSII_FP) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPSII_FP) Debug" (based on "Win32 (WCE MIPSII_FP) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPSII) Release" (based on "Win32 (WCE MIPSII) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPSII) Debug" (based on "Win32 (WCE MIPSII) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPSIV) Release" (based on "Win32 (WCE MIPSIV) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPSIV) Debug" (based on "Win32 (WCE MIPSIV) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARMV4I) Release" (based on "Win32 (WCE ARMV4I) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARMV4I) Debug" (based on "Win32 (WCE ARMV4I) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPSIV_FP) Release" (based on "Win32 (WCE MIPSIV_FP) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPSIV_FP) Debug" (based on "Win32 (WCE MIPSIV_FP) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPS16) Release" (based on "Win32 (WCE MIPS16) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPS16) Debug" (based on "Win32 (WCE MIPS16) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARMV4T) Release" (based on "Win32 (WCE ARMV4T) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARMV4T) Debug" (based on "Win32 (WCE ARMV4T) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Dynamic-Link Library") -!MESSAGE "SDL - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSII_FPRel" -# PROP BASE Intermediate_Dir "MIPSII_FPRel" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSII_FPRel" -# PROP Intermediate_Dir "MIPSII_FPRel" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE- /M$(CECrtMT) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSII_FPDbg" -# PROP BASE Intermediate_Dir "MIPSII_FPDbg" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSII_FPDbg" -# PROP Intermediate_Dir "MIPSII_FPDbg" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSIIRel" -# PROP BASE Intermediate_Dir "MIPSIIRel" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSIIRel" -# PROP Intermediate_Dir "MIPSIIRel" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE /M$(CECrtMT) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSIIDbg" -# PROP BASE Intermediate_Dir "MIPSIIDbg" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSIIDbg" -# PROP Intermediate_Dir "MIPSIIDbg" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH4Rel" -# PROP BASE Intermediate_Dir "SH4Rel" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH4Rel" -# PROP Intermediate_Dir "SH4Rel" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /Qsh4 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "SHx" /D "SH4" /D "_SH4_" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Oxt /Qsh4 /M$(CECrtMT) /c -# SUBTRACT CPP /YX -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH4Dbg" -# PROP BASE Intermediate_Dir "SH4Dbg" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH4Dbg" -# PROP Intermediate_Dir "SH4Dbg" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /Qsh4 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Qsh4 /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4 - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSIVRel" -# PROP BASE Intermediate_Dir "MIPSIVRel" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSIVRel" -# PROP Intermediate_Dir "MIPSIVRel" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE /M$(CECrtMT) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSIVDbg" -# PROP BASE Intermediate_Dir "MIPSIVDbg" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSIVDbg" -# PROP Intermediate_Dir "MIPSIVDbg" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "emulatorRel" -# PROP BASE Intermediate_Dir "emulatorRel" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "emulatorRel" -# PROP Intermediate_Dir "emulatorRel" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "SDL_EXPORTS" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "_i386_" /D "_X86_" /D "x86" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /GF /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "emulatorDbg" -# PROP BASE Intermediate_Dir "emulatorDbg" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "emulatorDbg" -# PROP Intermediate_Dir "emulatorDbg" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "SDL_EXPORTS" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D "_i386_" /D "_X86_" /D "x86" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /GF /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4IRel" -# PROP BASE Intermediate_Dir "ARMV4IRel" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4IRel" -# PROP Intermediate_Dir "ARMV4IRel" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "ARM" /D "_ARM_" /D "ARMV4I" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4IDbg" -# PROP BASE Intermediate_Dir "ARMV4IDbg" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4IDbg" -# PROP Intermediate_Dir "ARMV4IDbg" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4I" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSIV_FPRel" -# PROP BASE Intermediate_Dir "MIPSIV_FPRel" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSIV_FPRel" -# PROP Intermediate_Dir "MIPSIV_FPRel" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMT) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSIV_FPDbg" -# PROP BASE Intermediate_Dir "MIPSIV_FPDbg" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSIV_FPDbg" -# PROP Intermediate_Dir "MIPSIV_FPDbg" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4Rel" -# PROP BASE Intermediate_Dir "ARMV4Rel" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4Rel" -# PROP Intermediate_Dir "ARMV4Rel" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "ARM" /D "_ARM_" /D "ARMV4" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /M$(CECrtMT) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4Dbg" -# PROP BASE Intermediate_Dir "ARMV4Dbg" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4Dbg" -# PROP Intermediate_Dir "ARMV4Dbg" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPS16Rel" -# PROP BASE Intermediate_Dir "MIPS16Rel" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPS16Rel" -# PROP Intermediate_Dir "MIPS16Rel" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "SDL_EXPORTS" /YX /QMmips16 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Oxt /QMmips16 /M$(CECrtMT) /c -# SUBTRACT CPP /YX -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096 - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPS16Dbg" -# PROP BASE Intermediate_Dir "MIPS16Dbg" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPS16Dbg" -# PROP Intermediate_Dir "MIPS16Dbg" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "SDL_EXPORTS" /YX /QMmips16 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips16 /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096 - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4TRel" -# PROP BASE Intermediate_Dir "ARMV4TRel" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4TRel" -# PROP Intermediate_Dir "ARMV4TRel" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clthumb.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4TDbg" -# PROP BASE Intermediate_Dir "ARMV4TDbg" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4TDbg" -# PROP Intermediate_Dir "ARMV4TDbg" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clthumb.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86Rel" -# PROP BASE Intermediate_Dir "X86Rel" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86Rel" -# PROP Intermediate_Dir "X86Rel" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "SDL_EXPORTS" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "_i386_" /D "_X86_" /D "x86" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /Oxt /GF /c -# SUBTRACT CPP /YX -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86Dbg" -# PROP BASE Intermediate_Dir "X86Dbg" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86Dbg" -# PROP Intermediate_Dir "X86Dbg" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "SDL_EXPORTS" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "_i386_" /D "_X86_" /D "x86" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /GF /c -# SUBTRACT CPP /YX -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSRel" -# PROP BASE Intermediate_Dir "MIPSRel" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSRel" -# PROP Intermediate_Dir "MIPSRel" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH3Rel" -# PROP BASE Intermediate_Dir "SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH3Rel" -# PROP Intermediate_Dir "SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ENDIF - -# Begin Target - -# Name "SDL - Win32 (WCE MIPSII_FP) Release" -# Name "SDL - Win32 (WCE MIPSII_FP) Debug" -# Name "SDL - Win32 (WCE MIPSII) Release" -# Name "SDL - Win32 (WCE MIPSII) Debug" -# Name "SDL - Win32 (WCE SH4) Release" -# Name "SDL - Win32 (WCE SH4) Debug" -# Name "SDL - Win32 (WCE SH3) Debug" -# Name "SDL - Win32 (WCE MIPSIV) Release" -# Name "SDL - Win32 (WCE MIPSIV) Debug" -# Name "SDL - Win32 (WCE emulator) Release" -# Name "SDL - Win32 (WCE emulator) Debug" -# Name "SDL - Win32 (WCE ARMV4I) Release" -# Name "SDL - Win32 (WCE ARMV4I) Debug" -# Name "SDL - Win32 (WCE MIPSIV_FP) Release" -# Name "SDL - Win32 (WCE MIPSIV_FP) Debug" -# Name "SDL - Win32 (WCE ARMV4) Release" -# Name "SDL - Win32 (WCE ARMV4) Debug" -# Name "SDL - Win32 (WCE MIPS16) Release" -# Name "SDL - Win32 (WCE MIPS16) Debug" -# Name "SDL - Win32 (WCE ARMV4T) Release" -# Name "SDL - Win32 (WCE ARMV4T) Debug" -# Name "SDL - Win32 (WCE x86) Release" -# Name "SDL - Win32 (WCE x86) Debug" -# Name "SDL - Win32 (WCE ARM) Debug" -# Name "SDL - Win32 (WCE ARM) Release" -# Name "SDL - Win32 (WCE MIPS) Debug" -# Name "SDL - Win32 (WCE MIPS) Release" -# Name "SDL - Win32 (WCE SH3) Release" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\src\SDL.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_C=\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_endian.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_C=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_C=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - -NODEP_CPP_SDL_C=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_C=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - "..\..\src\video\SDL_leaks.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_active.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_A=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_A=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_A=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_A=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_A=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_A=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_A=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audio.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_thread.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_AU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_AU=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_AU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_AU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audiocvt.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_AUD=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_AUD=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audiodev.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - -NODEP_CPP_SDL_AUDI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - -NODEP_CPP_SDL_AUDI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - -NODEP_CPP_SDL_AUDI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - -NODEP_CPP_SDL_AUDI=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_AUDI=\ - "..\..\src\audio\SDL_audiodev_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_B=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_B=\ - "..\..\src\video\SDL_memops.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_0.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_BL=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BL=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_BL=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BL=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_BL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_BL=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BL=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_BL=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BL=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_BL=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BL=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_BL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_BL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_BL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_BL=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_BL=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_BL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_1.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_BLI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_BLI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_A.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT=\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\mmx.h"\ - -NODEP_CPP_SDL_BLIT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_BLIT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit_N.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\src\hermes\HeadMMX.h"\ - "..\..\src\hermes\HeadX86.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_BLIT_=\ - "..\..\src\hermes\HeadMMX.h"\ - "..\..\src\hermes\HeadX86.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\src\hermes\HeadMMX.h"\ - "..\..\src\hermes\HeadX86.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - ".\DL_byteorder.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\hermes\HeadMMX.h"\ - "..\..\src\hermes\HeadX86.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\hermes\HeadMMX.h"\ - "..\..\src\hermes\HeadX86.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\hermes\HeadMMX.h"\ - "..\..\src\hermes\HeadX86.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_BLIT_=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_BLIT_=\ - "..\..\src\video\HeadMMX.h"\ - "..\..\src\video\HeadX86.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_bmp.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_BM=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BM=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_BM=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BM=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_BM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_BM=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BM=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_BM=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BM=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_endian.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_BM=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BM=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_BM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_BM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_BM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - -NODEP_CPP_SDL_BM=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_BM=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_BM=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_BM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_BM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\cpuinfo\SDL_cpuinfo.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL_cpuinfo.h"\ - -NODEP_CPP_SDL_CP=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL_cpuinfo.h"\ - -NODEP_CPP_SDL_CP=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_SDL_CP=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_SDL_CP=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_SDL_CP=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL_cpuinfo.h"\ - -NODEP_CPP_SDL_CP=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL_cpuinfo.h"\ - -NODEP_CPP_SDL_CP=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_cpuinfo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL_cpuinfo.h"\ - -NODEP_CPP_SDL_CP=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_CP=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - -NODEP_CPP_SDL_CP=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_cpuinfo.h"\ - -NODEP_CPP_SDL_CP=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_CP=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_cpuinfo.h"\ - -NODEP_CPP_SDL_CP=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_CP=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_cursor.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - ".\DL_active.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_CU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_CU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\default_cursor.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\windib\SDL_dibaudio.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_D=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_D=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_D=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_D=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_D=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_D=\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_D=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_D=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_D=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_D=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_D=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_D=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_D=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - "..\..\src\audio\windib\SDL_dibaudio.h"\ - -NODEP_CPP_SDL_D=\ - "..\..\src\audio\windib\win_ce_semaphore.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibevents.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - -NODEP_CPP_SDL_DI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_DI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - "..\..\src\video\windib\SDL_vkeys.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibvideo.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - -NODEP_CPP_SDL_DIB=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_DIB=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - "..\..\src\video\windib\SDL_dibvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\disk\SDL_diskaudio.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_DIS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\disk\SDL_diskaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_DU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\dummy\SDL_dummyaudio.h"\ - "..\..\src\audio\SDL_audio_c.h"\ - "..\..\src\audio\SDL_audiodev_c.h"\ - "..\..\src\audio\SDL_audiomem.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_error.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_E=\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_E=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_E=\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_E=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_E=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_E=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\src\SDL_error_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_E=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\src\SDL_error_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_E=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\src\SDL_error_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_E=\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_E=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_E=\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_E=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_E=\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_E=\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_E=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_E=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\SDL_error_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_E=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\SDL_error_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_E=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\SDL_error_c.h"\ - -NODEP_CPP_SDL_E=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_E=\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_E=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_types.h"\ - "..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_E=\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_E=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_types.h"\ - "..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_E=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_events.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_thread.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_EV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_EV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_expose.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_EX=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_EX=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_EX=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_EX=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_fatal.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_F=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_F=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_F=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_F=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_F=\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_F=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_F=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_F=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_F=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_F=\ - "..\..\include\SDL.h"\ - "..\..\src\SDL_fatal.h"\ - -NODEP_CPP_SDL_F=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_F=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\SDL_fatal.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_gamma.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_name.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\e_log.h"\ - "..\..\src\video\e_pow.h"\ - "..\..\src\video\e_sqrt.h"\ - "..\..\src\video\math_private.h"\ - -NODEP_CPP_SDL_G=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_name.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\e_log.h"\ - "..\..\src\video\e_pow.h"\ - "..\..\src\video\e_sqrt.h"\ - "..\..\src\video\math_private.h"\ - -NODEP_CPP_SDL_G=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_name.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\e_log.h"\ - "..\..\src\video\e_pow.h"\ - "..\..\src\video\e_sqrt.h"\ - "..\..\src\video\math_private.h"\ - -NODEP_CPP_SDL_G=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - -NODEP_CPP_SDL_G=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_name.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\e_log.h"\ - "..\..\src\video\e_pow.h"\ - "..\..\src\video\e_sqrt.h"\ - "..\..\src\video\math_private.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_name.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\e_log.h"\ - "..\..\src\video\e_pow.h"\ - "..\..\src\video\e_sqrt.h"\ - "..\..\src\video\math_private.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_name.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\e_log.h"\ - "..\..\src\video\e_pow.h"\ - "..\..\src\video\e_sqrt.h"\ - "..\..\src\video\math_private.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_G=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_G=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\gapi\SDL_gapivideo.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_GA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\windib\SDL_dibevents_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_getenv.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_GE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_GE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_GE=\ - "..\include\SDL_config_wince.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_iconv.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_I=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\SDL_joystick.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_J=\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_J=\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_J=\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\SDL_types.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_J=\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_J=\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_J=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_J=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_keyboard.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - -NODEP_CPP_SDL_K=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_K=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_K=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_malloc.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\..\..\..\usr\include\pthread.h"\ - "..\include\SDL_config_wince.h"\ - ".\onfig\_epilog.h"\ - ".\onfig\_msvc_warnings_off.h"\ - ".\onfig\_prolog.h"\ - ".\onfig\stl_apcc.h"\ - ".\onfig\stl_apple.h"\ - ".\onfig\stl_as400.h"\ - ".\onfig\stl_bc.h"\ - ".\onfig\stl_como.h"\ - ".\onfig\stl_confix.h"\ - ".\onfig\stl_dec.h"\ - ".\onfig\stl_dec_vms.h"\ - ".\onfig\stl_fujitsu.h"\ - ".\onfig\stl_gcc.h"\ - ".\onfig\stl_hpacc.h"\ - ".\onfig\stl_ibm.h"\ - ".\onfig\stl_intel.h"\ - ".\onfig\stl_kai.h"\ - ".\onfig\stl_msvc.h"\ - ".\onfig\stl_mwerks.h"\ - ".\onfig\stl_mycomp.h"\ - ".\onfig\stl_sco.h"\ - ".\onfig\stl_select_lib.h"\ - ".\onfig\stl_sgi.h"\ - ".\onfig\stl_solaris.h"\ - ".\onfig\stl_sunpro.h"\ - ".\onfig\stl_symantec.h"\ - ".\onfig\stl_watcom.h"\ - ".\onfig\stl_wince.h"\ - ".\onfig\stlcomp.h"\ - ".\onfig\vc_select_lib.h"\ - ".\thread.h"\ - ".\tl\_abbrevs.h"\ - ".\tl\_config.h"\ - ".\tl\_config_compat.h"\ - ".\tl\_config_compat_post.h"\ - ".\tl\_epilog.h"\ - ".\tl\_prolog.h"\ - ".\tl\_site_config.h"\ - ".\tl_user_config.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\..\..\..\usr\include\pthread.h"\ - "..\include\SDL_config_wince.h"\ - ".\onfig\_epilog.h"\ - ".\onfig\_msvc_warnings_off.h"\ - ".\onfig\_prolog.h"\ - ".\onfig\stl_apcc.h"\ - ".\onfig\stl_apple.h"\ - ".\onfig\stl_as400.h"\ - ".\onfig\stl_bc.h"\ - ".\onfig\stl_como.h"\ - ".\onfig\stl_confix.h"\ - ".\onfig\stl_dec.h"\ - ".\onfig\stl_dec_vms.h"\ - ".\onfig\stl_fujitsu.h"\ - ".\onfig\stl_gcc.h"\ - ".\onfig\stl_hpacc.h"\ - ".\onfig\stl_ibm.h"\ - ".\onfig\stl_intel.h"\ - ".\onfig\stl_kai.h"\ - ".\onfig\stl_msvc.h"\ - ".\onfig\stl_mwerks.h"\ - ".\onfig\stl_mycomp.h"\ - ".\onfig\stl_sco.h"\ - ".\onfig\stl_select_lib.h"\ - ".\onfig\stl_sgi.h"\ - ".\onfig\stl_solaris.h"\ - ".\onfig\stl_sunpro.h"\ - ".\onfig\stl_symantec.h"\ - ".\onfig\stl_watcom.h"\ - ".\onfig\stl_wince.h"\ - ".\onfig\stlcomp.h"\ - ".\onfig\vc_select_lib.h"\ - ".\thread.h"\ - ".\tl\_abbrevs.h"\ - ".\tl\_config.h"\ - ".\tl\_config_compat.h"\ - ".\tl\_config_compat_post.h"\ - ".\tl\_epilog.h"\ - ".\tl\_prolog.h"\ - ".\tl\_site_config.h"\ - ".\tl_user_config.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\..\..\..\usr\include\pthread.h"\ - "..\include\SDL_config_wince.h"\ - ".\onfig\_epilog.h"\ - ".\onfig\_msvc_warnings_off.h"\ - ".\onfig\_prolog.h"\ - ".\onfig\stl_apcc.h"\ - ".\onfig\stl_apple.h"\ - ".\onfig\stl_as400.h"\ - ".\onfig\stl_bc.h"\ - ".\onfig\stl_como.h"\ - ".\onfig\stl_confix.h"\ - ".\onfig\stl_dec.h"\ - ".\onfig\stl_dec_vms.h"\ - ".\onfig\stl_fujitsu.h"\ - ".\onfig\stl_gcc.h"\ - ".\onfig\stl_hpacc.h"\ - ".\onfig\stl_ibm.h"\ - ".\onfig\stl_intel.h"\ - ".\onfig\stl_kai.h"\ - ".\onfig\stl_msvc.h"\ - ".\onfig\stl_mwerks.h"\ - ".\onfig\stl_mycomp.h"\ - ".\onfig\stl_sco.h"\ - ".\onfig\stl_select_lib.h"\ - ".\onfig\stl_sgi.h"\ - ".\onfig\stl_solaris.h"\ - ".\onfig\stl_sunpro.h"\ - ".\onfig\stl_symantec.h"\ - ".\onfig\stl_watcom.h"\ - ".\onfig\stl_wince.h"\ - ".\onfig\stlcomp.h"\ - ".\onfig\vc_select_lib.h"\ - ".\thread.h"\ - ".\tl\_abbrevs.h"\ - ".\tl\_config.h"\ - ".\tl\_config_compat.h"\ - ".\tl\_config_compat_post.h"\ - ".\tl\_epilog.h"\ - ".\tl\_prolog.h"\ - ".\tl\_site_config.h"\ - ".\tl_user_config.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_M=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_M=\ - "..\..\..\..\usr\include\malloc.h"\ - "..\include\SDL_config_wince.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_mixer.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_MI=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_MI=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_thread.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_MI=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_MI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_MI=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_MI=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - -NODEP_CPP_SDL_MI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_MI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\audio\SDL_mixer_m68k.h"\ - "..\..\src\audio\SDL_mixer_MMX.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - "..\..\src\audio\SDL_sysaudio.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_mixer_MMX_VC.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_MIX=\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\src\audio\SDL_mixer_MMX_VC.h"\ - -NODEP_CPP_SDL_MIX=\ - "..\include\SDL_config_wince.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_mouse.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - -NODEP_CPP_SDL_MO=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_MO=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_MO=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullevents.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_N=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullmouse.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_NU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullvideo.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_NUL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\dummy\SDL_nullevents_c.h"\ - "..\..\src\video\dummy\SDL_nullmouse_c.h"\ - "..\..\src\video\dummy\SDL_nullvideo.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_pixels.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_P=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_P=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_qsort.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_Q=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_Q=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_Q=\ - "..\include\SDL_config_wince.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_quit.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_QU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_QU=\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_QU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_QU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_resize.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - -NODEP_CPP_SDL_R=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - ".\DL_active.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_R=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_R=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_RLEaccel.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_RL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\mmx.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_RL=\ - "..\..\src\video\SDL_memops.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\file\SDL_rwops.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_rwops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_RW=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_RW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_stretch.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_S=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_S=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_S=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_S=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_S=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_S=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_S=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_S=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_S=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_S=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_S=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_S=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_S=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_S=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_S=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_S=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - -NODEP_CPP_SDL_S=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_S=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_S=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_S=\ - "..\..\include\SDL_endian.h"\ - -NODEP_CPP_SDL_S=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_S=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\stdlib\SDL_string.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_ST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_ST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_ST=\ - "..\include\SDL_config_wince.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_surface.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_leaks.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_RLEaccel_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_SU=\ - "..\..\src\video\SDL_memops.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\cdrom\dummy\SDL_syscdrom.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - ".\DL_cdrom.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SY=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SY=\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - -NODEP_CPP_SDL_SY=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SY=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\cdrom\SDL_syscdrom.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\generic\SDL_syscond.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYS=\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYS=\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYS=\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYS=\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYS=\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYS=\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYS=\ - "..\..\include\SDL_thread.h"\ - -NODEP_CPP_SDL_SYS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_sysevents.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\..\src\video\wincommon\SDL_gapivideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\..\src\video\wincommon\SDL_gapivideo.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - -NODEP_CPP_SDL_SYSE=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSE=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\gapi\sdl_gapivideo.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\wmmsg.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\dummy\SDL_sysjoystick.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - ".\DL_error.h"\ - ".\DL_joystick.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - -NODEP_CPP_SDL_SYSJ=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSJ=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\joystick\SDL_joystick_c.h"\ - "..\..\src\joystick\SDL_sysjoystick.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\loadso\win32\SDL_sysloadso.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -NODEP_CPP_SDL_SYSL=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSL=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSL=\ - "..\include\SDL_config_wince.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_sysmouse.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - ".\DL_active.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - -NODEP_CPP_SDL_SYSM=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSM=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_sysmouse_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_sysmutex.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_SYSMU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSMU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_syssem.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_thread.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - -NODEP_CPP_SDL_SYSS=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSS=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_systhread.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\src\thread\beos\SDL_systhread_c.h"\ - "..\src\thread\dc\SDL_systhread_c.h"\ - "..\src\thread\epoc\SDL_systhread_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\irix\SDL_systhread_c.h"\ - "..\src\thread\os2\SDL_systhread_c.h"\ - "..\src\thread\pth\SDL_systhread_c.h"\ - "..\src\thread\pthread\SDL_systhread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\src\thread\beos\SDL_systhread_c.h"\ - "..\src\thread\dc\SDL_systhread_c.h"\ - "..\src\thread\epoc\SDL_systhread_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\irix\SDL_systhread_c.h"\ - "..\src\thread\os2\SDL_systhread_c.h"\ - "..\src\thread\pth\SDL_systhread_c.h"\ - "..\src\thread\pthread\SDL_systhread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\src\thread\beos\SDL_systhread_c.h"\ - "..\src\thread\dc\SDL_systhread_c.h"\ - "..\src\thread\epoc\SDL_systhread_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\irix\SDL_systhread_c.h"\ - "..\src\thread\os2\SDL_systhread_c.h"\ - "..\src\thread\pth\SDL_systhread_c.h"\ - "..\src\thread\pthread\SDL_systhread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\..\src\thread\beos\SDL_systhread_c.h"\ - "..\..\src\thread\dc\SDL_systhread_c.h"\ - "..\..\src\thread\epoc\SDL_systhread_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\irix\SDL_systhread_c.h"\ - "..\..\src\thread\os2\SDL_systhread_c.h"\ - "..\..\src\thread\pth\SDL_systhread_c.h"\ - "..\..\src\thread\pthread\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\..\src\thread\amigaos\mydebug.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\..\src\thread\beos\SDL_systhread_c.h"\ - "..\..\src\thread\dc\SDL_systhread_c.h"\ - "..\..\src\thread\epoc\SDL_systhread_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\irix\SDL_systhread_c.h"\ - "..\..\src\thread\os2\SDL_systhread_c.h"\ - "..\..\src\thread\pth\SDL_systhread_c.h"\ - "..\..\src\thread\pthread\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\..\src\thread\amigaos\mydebug.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\..\src\thread\beos\SDL_systhread_c.h"\ - "..\..\src\thread\dc\SDL_systhread_c.h"\ - "..\..\src\thread\epoc\SDL_systhread_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\irix\SDL_systhread_c.h"\ - "..\..\src\thread\os2\SDL_systhread_c.h"\ - "..\..\src\thread\pth\SDL_systhread_c.h"\ - "..\..\src\thread\pthread\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\..\..\..\usr\include\pthread.h"\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\SDL_config_wince.h"\ - ".\onfig\_epilog.h"\ - ".\onfig\_msvc_warnings_off.h"\ - ".\onfig\_prolog.h"\ - ".\onfig\stl_apcc.h"\ - ".\onfig\stl_apple.h"\ - ".\onfig\stl_as400.h"\ - ".\onfig\stl_bc.h"\ - ".\onfig\stl_como.h"\ - ".\onfig\stl_confix.h"\ - ".\onfig\stl_dec.h"\ - ".\onfig\stl_dec_vms.h"\ - ".\onfig\stl_fujitsu.h"\ - ".\onfig\stl_gcc.h"\ - ".\onfig\stl_hpacc.h"\ - ".\onfig\stl_ibm.h"\ - ".\onfig\stl_intel.h"\ - ".\onfig\stl_kai.h"\ - ".\onfig\stl_msvc.h"\ - ".\onfig\stl_mwerks.h"\ - ".\onfig\stl_mycomp.h"\ - ".\onfig\stl_sco.h"\ - ".\onfig\stl_select_lib.h"\ - ".\onfig\stl_sgi.h"\ - ".\onfig\stl_solaris.h"\ - ".\onfig\stl_sunpro.h"\ - ".\onfig\stl_symantec.h"\ - ".\onfig\stl_watcom.h"\ - ".\onfig\stl_wince.h"\ - ".\onfig\stlcomp.h"\ - ".\onfig\vc_select_lib.h"\ - ".\thread.h"\ - ".\tl\_abbrevs.h"\ - ".\tl\_config.h"\ - ".\tl\_config_compat.h"\ - ".\tl\_config_compat_post.h"\ - ".\tl\_epilog.h"\ - ".\tl\_prolog.h"\ - ".\tl\_site_config.h"\ - ".\tl_user_config.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYST=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - "..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_SYST=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - "..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYST=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\wince\SDL_systimer.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSTI=\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_SYSTI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSTI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_syswm.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_SYSW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_SYSW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_syswm_c.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\SDL_thread.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_T=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_T=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_T=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\src\thread\beos\SDL_systhread_c.h"\ - "..\src\thread\dc\SDL_systhread_c.h"\ - "..\src\thread\epoc\SDL_systhread_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\irix\SDL_systhread_c.h"\ - "..\src\thread\os2\SDL_systhread_c.h"\ - "..\src\thread\pth\SDL_systhread_c.h"\ - "..\src\thread\pthread\SDL_systhread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\src\thread\beos\SDL_systhread_c.h"\ - "..\src\thread\dc\SDL_systhread_c.h"\ - "..\src\thread\epoc\SDL_systhread_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\irix\SDL_systhread_c.h"\ - "..\src\thread\os2\SDL_systhread_c.h"\ - "..\src\thread\pth\SDL_systhread_c.h"\ - "..\src\thread\pthread\SDL_systhread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\src\thread\beos\SDL_systhread_c.h"\ - "..\src\thread\dc\SDL_systhread_c.h"\ - "..\src\thread\epoc\SDL_systhread_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\irix\SDL_systhread_c.h"\ - "..\src\thread\os2\SDL_systhread_c.h"\ - "..\src\thread\pth\SDL_systhread_c.h"\ - "..\src\thread\pthread\SDL_systhread_c.h"\ - "..\src\thread\win32\SDL_systhread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_T=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_T=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_T=\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\SDL_thread.h"\ - "..\src\SDL_error_c.h"\ - "..\src\thread\generic\SDL_systhread_c.h"\ - "..\src\thread\SDL_thread_c.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_T=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - -NODEP_CPP_SDL_T=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_T=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\..\src\thread\beos\SDL_systhread_c.h"\ - "..\..\src\thread\dc\SDL_systhread_c.h"\ - "..\..\src\thread\epoc\SDL_systhread_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\irix\SDL_systhread_c.h"\ - "..\..\src\thread\os2\SDL_systhread_c.h"\ - "..\..\src\thread\pth\SDL_systhread_c.h"\ - "..\..\src\thread\pthread\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_T=\ - "..\..\src\thread\amigaos\mydebug.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_T=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\..\src\thread\beos\SDL_systhread_c.h"\ - "..\..\src\thread\dc\SDL_systhread_c.h"\ - "..\..\src\thread\epoc\SDL_systhread_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\irix\SDL_systhread_c.h"\ - "..\..\src\thread\os2\SDL_systhread_c.h"\ - "..\..\src\thread\pth\SDL_systhread_c.h"\ - "..\..\src\thread\pthread\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_T=\ - "..\..\src\thread\amigaos\mydebug.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_T=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\amigaos\SDL_systhread_c.h"\ - "..\..\src\thread\beos\SDL_systhread_c.h"\ - "..\..\src\thread\dc\SDL_systhread_c.h"\ - "..\..\src\thread\epoc\SDL_systhread_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\irix\SDL_systhread_c.h"\ - "..\..\src\thread\os2\SDL_systhread_c.h"\ - "..\..\src\thread\pth\SDL_systhread_c.h"\ - "..\..\src\thread\pthread\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - "..\..\src\thread\win32\SDL_systhread_c.h"\ - -NODEP_CPP_SDL_T=\ - "..\..\..\..\usr\include\pthread.h"\ - "..\..\src\thread\amigaos\mydebug.h"\ - "..\include\SDL_config_wince.h"\ - ".\onfig\_epilog.h"\ - ".\onfig\_msvc_warnings_off.h"\ - ".\onfig\_prolog.h"\ - ".\onfig\stl_apcc.h"\ - ".\onfig\stl_apple.h"\ - ".\onfig\stl_as400.h"\ - ".\onfig\stl_bc.h"\ - ".\onfig\stl_como.h"\ - ".\onfig\stl_confix.h"\ - ".\onfig\stl_dec.h"\ - ".\onfig\stl_dec_vms.h"\ - ".\onfig\stl_fujitsu.h"\ - ".\onfig\stl_gcc.h"\ - ".\onfig\stl_hpacc.h"\ - ".\onfig\stl_ibm.h"\ - ".\onfig\stl_intel.h"\ - ".\onfig\stl_kai.h"\ - ".\onfig\stl_msvc.h"\ - ".\onfig\stl_mwerks.h"\ - ".\onfig\stl_mycomp.h"\ - ".\onfig\stl_sco.h"\ - ".\onfig\stl_select_lib.h"\ - ".\onfig\stl_sgi.h"\ - ".\onfig\stl_solaris.h"\ - ".\onfig\stl_sunpro.h"\ - ".\onfig\stl_symantec.h"\ - ".\onfig\stl_watcom.h"\ - ".\onfig\stl_wince.h"\ - ".\onfig\stlcomp.h"\ - ".\onfig\vc_select_lib.h"\ - ".\thread.h"\ - ".\tl\_abbrevs.h"\ - ".\tl\_config.h"\ - ".\tl\_config_compat.h"\ - ".\tl\_config_compat_post.h"\ - ".\tl\_epilog.h"\ - ".\tl\_prolog.h"\ - ".\tl\_site_config.h"\ - ".\tl_user_config.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_T=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - "..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_T=\ - "..\..\include\SDL_thread.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - -NODEP_CPP_SDL_T=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_types.h"\ - "..\src\thread\SDL_thread_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_T=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\SDL_error_c.h"\ - "..\..\src\thread\generic\SDL_systhread_c.h"\ - "..\..\src\thread\SDL_systhread.h"\ - "..\..\src\thread\SDL_thread_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\SDL_timer.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_timer.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mutex.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_TI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_TI=\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - -NODEP_CPP_SDL_TI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_TI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\timer\SDL_systimer.h"\ - "..\..\src\timer\SDL_timer_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_video.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_endian.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - ".\DL.h"\ - ".\DL_active.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_cdrom.h"\ - ".\DL_error.h"\ - ".\DL_events.h"\ - ".\DL_getenv.h"\ - ".\DL_joystick.h"\ - ".\DL_keyboard.h"\ - ".\DL_keysym.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_quit.h"\ - ".\DL_rwops.h"\ - ".\DL_timer.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - -NODEP_CPP_SDL_V=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_blit.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_V=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\events\SDL_events_c.h"\ - "..\..\src\events\SDL_sysevents.h"\ - "..\..\src\video\SDL_blit.h"\ - "..\..\src\video\SDL_cursor_c.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_pixels_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_wave.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\audio\SDL_wave.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_W=\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_endian.h"\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - ".\DL_audio.h"\ - ".\DL_byteorder.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_wave.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_wave.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL_endian.h"\ - "..\..\src\audio\SDL_wave.h"\ - -NODEP_CPP_SDL_W=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_byteorder.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_types.h"\ - "..\..\src\audio\SDL_wave.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_wingl.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - -NODEP_CPP_SDL_WI=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\wincommon\SDL_lowvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_WI=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\wincommon\SDL_lowvideo.h"\ - "..\..\src\video\wincommon\SDL_wingl_c.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuv.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - ".\DL_error.h"\ - ".\DL_getenv.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_Y=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_getenv.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_Y=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuv_mmx.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -NODEP_CPP_SDL_YU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -NODEP_CPP_SDL_YU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -NODEP_CPP_SDL_YU=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_YU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_YU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_YU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_stdinc.h"\ - -NODEP_CPP_SDL_YU=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_YU=\ - "..\..\include\SDL_types.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuv_sw.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_cpuinfo.h"\ - "..\src\video\SDL_glfuncs.h"\ - "..\src\video\SDL_sysvideo.h"\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - ".\DL_error.h"\ - ".\DL_main.h"\ - ".\DL_mouse.h"\ - ".\DL_mutex.h"\ - ".\DL_rwops.h"\ - ".\DL_types.h"\ - ".\DL_version.h"\ - ".\DL_video.h"\ - ".\egin_code.h"\ - ".\lose_code.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_opengl.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\SDL_config_wince.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - -NODEP_CPP_SDL_YUV=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_types.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - "..\src\video\SDL_glfuncs.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_YUV=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - "..\..\src\video\SDL_glfuncs.h"\ - "..\..\src\video\SDL_stretch_c.h"\ - "..\..\src\video\SDL_sysvideo.h"\ - "..\..\src\video\SDL_yuv_sw_c.h"\ - "..\..\src\video\SDL_yuvfuncs.h"\ - - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\win_ce_semaphore.c - -!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release" - -DEP_CPP_WIN_C=\ - "..\..\src\thread\win32\win_ce_semaphore.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\include\begin_code.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\blank_cursor.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\close_code.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\default_cursor.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\hermes\HeadMMX.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\hermes\HeadX86.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\mmx.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_active.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_audio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audio_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audiodev_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_audiomem.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_blit.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_byteorder.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_cdrom.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_copying.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_cpuinfo.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_cursor_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\windib\SDL_dibaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibevents_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_dibvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\disk\SDL_diskaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_endian.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_error.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_error_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_events.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_events_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\SDL_fatal.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\gapi\sdl_gapivideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_getenv.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_glfuncs.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_joystick.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\SDL_joystick_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_keyboard.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_keysym.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_leaks.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_loadso.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_lowvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_main.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_memops.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_mixer_m68k.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_mixer_MMX.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_mixer_MMX_VC.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_mouse.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_mutex.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_name.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullevents_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullmouse_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\dummy\SDL_nullvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_opengl.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_pixels_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_quit.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_RLEaccel_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_rwops.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_stretch_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_sysaudio.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\cdrom\SDL_syscdrom.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\generic\SDL_syscond_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\events\SDL_sysevents.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\joystick\SDL_sysjoystick.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_sysmouse_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\generic\SDL_sysmutex_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\generic\SDL_syssem_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\SDL_systhread.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\generic\SDL_systhread_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\SDL_systhread_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\SDL_systimer.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_sysvideo.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_syswm.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_syswm_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_thread.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\SDL_thread_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_timer.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\timer\SDL_timer_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_types.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_version.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\SDL_video.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\windib\SDL_vkeys.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\audio\SDL_wave.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\SDL_wingl_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuv_sw_c.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\SDL_yuvfuncs.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\thread\win32\win_ce_semaphore.h -# End Source File -# Begin Source File - -SOURCE=..\..\src\video\wincommon\wmmsg.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/VisualCE/SDL/SDL.vcproj b/VisualCE/SDL/SDL.vcproj deleted file mode 100644 index c8654bf8a9..0000000000 --- a/VisualCE/SDL/SDL.vcproj +++ /dev/null @@ -1,3967 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualCE/SDLMain/SDLmain.vcp b/VisualCE/SDLMain/SDLmain.vcp deleted file mode 100644 index 80d8610642..0000000000 --- a/VisualCE/SDLMain/SDLmain.vcp +++ /dev/null @@ -1,1653 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="SDLmain" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE x86) Static Library" 0x8304 -# TARGTYPE "Win32 (WCE MIPS) Static Library" 0x8204 -# TARGTYPE "Win32 (WCE MIPS16) Static Library" 0x8904 -# TARGTYPE "Win32 (WCE SH4) Static Library" 0x8604 -# TARGTYPE "Win32 (WCE MIPSII) Static Library" 0xa104 -# TARGTYPE "Win32 (WCE MIPSIV_FP) Static Library" 0x9204 -# TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504 -# TARGTYPE "Win32 (WCE SH3) Static Library" 0x8104 -# TARGTYPE "Win32 (WCE ARMV4) Static Library" 0xa304 -# TARGTYPE "Win32 (WCE ARMV4I) Static Library" 0xa504 -# TARGTYPE "Win32 (WCE emulator) Static Library" 0xa604 -# TARGTYPE "Win32 (WCE MIPSII_FP) Static Library" 0xa204 -# TARGTYPE "Win32 (WCE ARMV4T) Static Library" 0xa404 -# TARGTYPE "Win32 (WCE MIPSIV) Static Library" 0x9604 - -CFG=SDLmain - Win32 (WCE MIPSII_FP) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "SDLmain.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "SDLmain.vcn" CFG="SDLmain - Win32 (WCE MIPSII_FP) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "SDLmain - Win32 (WCE MIPSII_FP) Release" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPSII_FP) Debug" (based on "Win32 (WCE MIPSII_FP) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPSII) Release" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPSII) Debug" (based on "Win32 (WCE MIPSII) Static Library") -!MESSAGE "SDLmain - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "SDLmain - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Static Library") -!MESSAGE "SDLmain - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "SDLmain - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPSIV) Release" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPSIV) Debug" (based on "Win32 (WCE MIPSIV) Static Library") -!MESSAGE "SDLmain - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "SDLmain - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARMV4I) Release" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARMV4I) Debug" (based on "Win32 (WCE ARMV4I) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPSIV_FP) Release" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPSIV_FP) Debug" (based on "Win32 (WCE MIPSIV_FP) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPS16) Release" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPS16) Debug" (based on "Win32 (WCE MIPS16) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARMV4T) Release" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARMV4T) Debug" (based on "Win32 (WCE ARMV4T) Static Library") -!MESSAGE "SDLmain - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library") -!MESSAGE "SDLmain - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "SDLmain - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Static Library") -!MESSAGE "SDLmain - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSII_FPRel" -# PROP BASE Intermediate_Dir "MIPSII_FPRel" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSII_FPRel" -# PROP Intermediate_Dir "MIPSII_FPRel" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips2 /QMFPE- /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSII_FPDbg" -# PROP BASE Intermediate_Dir "MIPSII_FPDbg" -# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSII_FPDbg" -# PROP Intermediate_Dir "MIPSII_FPDbg" -# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSIIRel" -# PROP BASE Intermediate_Dir "MIPSIIRel" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSIIRel" -# PROP Intermediate_Dir "MIPSIIRel" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips2 /QMFPE /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSIIDbg" -# PROP BASE Intermediate_Dir "MIPSIIDbg" -# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSIIDbg" -# PROP Intermediate_Dir "MIPSIIDbg" -# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips2 /QMFPE /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH4Rel" -# PROP BASE Intermediate_Dir "SH4Rel" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH4Rel" -# PROP Intermediate_Dir "SH4Rel" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Qsh4 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /Oxt /Qsh4 /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH4Dbg" -# PROP BASE Intermediate_Dir "SH4Dbg" -# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH4Dbg" -# PROP Intermediate_Dir "SH4Dbg" -# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Qsh4 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /Qsh4 /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH3Rel" -# PROP BASE Intermediate_Dir "SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH3Rel" -# PROP Intermediate_Dir "SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob1 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /Oxt /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSIVRel" -# PROP BASE Intermediate_Dir "MIPSIVRel" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSIVRel" -# PROP Intermediate_Dir "MIPSIVRel" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips4 /QMn32 /QMFPE /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSIVDbg" -# PROP BASE Intermediate_Dir "MIPSIVDbg" -# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSIVDbg" -# PROP Intermediate_Dir "MIPSIVDbg" -# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "emulatorRel" -# PROP BASE Intermediate_Dir "emulatorRel" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "emulatorRel" -# PROP Intermediate_Dir "emulatorRel" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /Gs8192 /GF /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "emulatorDbg" -# PROP BASE Intermediate_Dir "emulatorDbg" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "emulatorDbg" -# PROP Intermediate_Dir "emulatorDbg" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /Gs8192 /GF /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4IRel" -# PROP BASE Intermediate_Dir "ARMV4IRel" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4IRel" -# PROP Intermediate_Dir "ARMV4IRel" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4IDbg" -# PROP BASE Intermediate_Dir "ARMV4IDbg" -# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4IDbg" -# PROP Intermediate_Dir "ARMV4IDbg" -# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSIV_FPRel" -# PROP BASE Intermediate_Dir "MIPSIV_FPRel" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSIV_FPRel" -# PROP Intermediate_Dir "MIPSIV_FPRel" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSIV_FPDbg" -# PROP BASE Intermediate_Dir "MIPSIV_FPDbg" -# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSIV_FPDbg" -# PROP Intermediate_Dir "MIPSIV_FPDbg" -# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4Rel" -# PROP BASE Intermediate_Dir "ARMV4Rel" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4Rel" -# PROP Intermediate_Dir "ARMV4Rel" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4Dbg" -# PROP BASE Intermediate_Dir "ARMV4Dbg" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4Dbg" -# PROP Intermediate_Dir "ARMV4Dbg" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPS16Rel" -# PROP BASE Intermediate_Dir "MIPS16Rel" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPS16Rel" -# PROP Intermediate_Dir "MIPS16Rel" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /Oxt /QMmips16 /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPS16Dbg" -# PROP BASE Intermediate_Dir "MIPS16Dbg" -# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPS16Dbg" -# PROP Intermediate_Dir "MIPS16Dbg" -# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /QMmips16 /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4TRel" -# PROP BASE Intermediate_Dir "ARMV4TRel" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4TRel" -# PROP Intermediate_Dir "ARMV4TRel" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clthumb.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4TDbg" -# PROP BASE Intermediate_Dir "ARMV4TDbg" -# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4TDbg" -# PROP Intermediate_Dir "ARMV4TDbg" -# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clthumb.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86Rel" -# PROP BASE Intermediate_Dir "X86Rel" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86Rel" -# PROP Intermediate_Dir "X86Rel" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /Gs8192 /Oxt /GF /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86Dbg" -# PROP BASE Intermediate_Dir "X86Dbg" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86Dbg" -# PROP Intermediate_Dir "X86Dbg" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /Gs8192 /GF /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /Gs8192 /GF /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /Gs8192 /GF /c -# SUBTRACT CPP /YX -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSRel" -# PROP BASE Intermediate_Dir "MIPSRel" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSRel" -# PROP Intermediate_Dir "MIPSRel" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo - -!ENDIF - -# Begin Target - -# Name "SDLmain - Win32 (WCE MIPSII_FP) Release" -# Name "SDLmain - Win32 (WCE MIPSII_FP) Debug" -# Name "SDLmain - Win32 (WCE MIPSII) Release" -# Name "SDLmain - Win32 (WCE MIPSII) Debug" -# Name "SDLmain - Win32 (WCE SH4) Release" -# Name "SDLmain - Win32 (WCE SH4) Debug" -# Name "SDLmain - Win32 (WCE SH3) Release" -# Name "SDLmain - Win32 (WCE SH3) Debug" -# Name "SDLmain - Win32 (WCE MIPSIV) Release" -# Name "SDLmain - Win32 (WCE MIPSIV) Debug" -# Name "SDLmain - Win32 (WCE emulator) Release" -# Name "SDLmain - Win32 (WCE emulator) Debug" -# Name "SDLmain - Win32 (WCE ARMV4I) Release" -# Name "SDLmain - Win32 (WCE ARMV4I) Debug" -# Name "SDLmain - Win32 (WCE MIPSIV_FP) Release" -# Name "SDLmain - Win32 (WCE MIPSIV_FP) Debug" -# Name "SDLmain - Win32 (WCE ARMV4) Release" -# Name "SDLmain - Win32 (WCE ARMV4) Debug" -# Name "SDLmain - Win32 (WCE MIPS16) Release" -# Name "SDLmain - Win32 (WCE MIPS16) Debug" -# Name "SDLmain - Win32 (WCE ARMV4T) Release" -# Name "SDLmain - Win32 (WCE ARMV4T) Debug" -# Name "SDLmain - Win32 (WCE x86) Release" -# Name "SDLmain - Win32 (WCE x86) Debug" -# Name "SDLmain - Win32 (WCE ARM) Debug" -# Name "SDLmain - Win32 (WCE ARM) Release" -# Name "SDLmain - Win32 (WCE MIPS) Debug" -# Name "SDLmain - Win32 (WCE MIPS) Release" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\src\main\win32\SDL_win32_main.c - -!IF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_config.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_macos.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_os2.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_win32.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_wince.h"\ - {$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\ - {$(INCLUDE)}"..\..\include\SDL_endian.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_loadso.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_platform.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_stdinc.h"\ - {$(INCLUDE)}"..\..\include\SDL_thread.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_config.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_macos.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_os2.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_win32.h"\ - {$(INCLUDE)}"..\..\include\SDL_config_wince.h"\ - {$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\ - {$(INCLUDE)}"..\..\include\SDL_endian.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_loadso.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_platform.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_stdinc.h"\ - {$(INCLUDE)}"..\..\include\SDL_thread.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Debug" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Release" - -DEP_CPP_SDL_W=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - {$(INCLUDE)}"..\..\include\begin_code.h"\ - {$(INCLUDE)}"..\..\include\close_code.h"\ - {$(INCLUDE)}"..\..\include\SDL_active.h"\ - {$(INCLUDE)}"..\..\include\SDL_audio.h"\ - {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ - {$(INCLUDE)}"..\..\include\SDL_error.h"\ - {$(INCLUDE)}"..\..\include\SDL_events.h"\ - {$(INCLUDE)}"..\..\include\SDL_joystick.h"\ - {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\ - {$(INCLUDE)}"..\..\include\SDL_keysym.h"\ - {$(INCLUDE)}"..\..\include\SDL_main.h"\ - {$(INCLUDE)}"..\..\include\SDL_mouse.h"\ - {$(INCLUDE)}"..\..\include\SDL_mutex.h"\ - {$(INCLUDE)}"..\..\include\SDL_quit.h"\ - {$(INCLUDE)}"..\..\include\SDL_rwops.h"\ - {$(INCLUDE)}"..\..\include\SDL_timer.h"\ - {$(INCLUDE)}"..\..\include\SDL_version.h"\ - {$(INCLUDE)}"..\..\include\SDL_video.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\include\SDL_main.h -# End Source File -# End Group -# End Target -# End Project diff --git a/VisualCE/SDLMain/SDLmain.vcproj b/VisualCE/SDLMain/SDLmain.vcproj deleted file mode 100644 index 95526d2965..0000000000 --- a/VisualCE/SDLMain/SDLmain.vcproj +++ /dev/null @@ -1,603 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualCE/loopwave/loopwave.vcp b/VisualCE/loopwave/loopwave.vcp deleted file mode 100644 index a49f2faadd..0000000000 --- a/VisualCE/loopwave/loopwave.vcp +++ /dev/null @@ -1,562 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="loopwave" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE x86) Application" 0x8301 -# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 -# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301 -# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01 -# TARGTYPE "Win32 (WCE emulator) Application" 0xa601 - -CFG=loopwave - Win32 (WCE emulator) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "loopwave.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "loopwave.vcn" CFG="loopwave - Win32 (WCE emulator) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "loopwave - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application") -!MESSAGE "loopwave - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application") -!MESSAGE "loopwave - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "loopwave - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "loopwave - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") -!MESSAGE "loopwave - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application") -!MESSAGE "loopwave - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") -!MESSAGE "loopwave - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application") -!MESSAGE "loopwave - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "loopwave - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "emulatorRel" -# PROP BASE Intermediate_Dir "emulatorRel" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "emulatorRel" -# PROP Intermediate_Dir "emulatorRel" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "emulatorDbg" -# PROP BASE Intermediate_Dir "emulatorDbg" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "emulatorDbg" -# PROP Intermediate_Dir "emulatorDbg" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4Rel" -# PROP BASE Intermediate_Dir "ARMV4Rel" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4Rel" -# PROP Intermediate_Dir "ARMV4Rel" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4Dbg" -# PROP BASE Intermediate_Dir "ARMV4Dbg" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4Dbg" -# PROP Intermediate_Dir "ARMV4Dbg" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86em) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86EMRel" -# PROP BASE Intermediate_Dir "X86EMRel" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86EMRel" -# PROP Intermediate_Dir "X86EMRel" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86Rel" -# PROP BASE Intermediate_Dir "X86Rel" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86Rel" -# PROP Intermediate_Dir "X86Rel" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c -# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86Dbg" -# PROP BASE Intermediate_Dir "X86Dbg" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86Dbg" -# PROP Intermediate_Dir "X86Dbg" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ENDIF - -# Begin Target - -# Name "loopwave - Win32 (WCE emulator) Release" -# Name "loopwave - Win32 (WCE emulator) Debug" -# Name "loopwave - Win32 (WCE ARMV4) Release" -# Name "loopwave - Win32 (WCE ARMV4) Debug" -# Name "loopwave - Win32 (WCE ARM) Release" -# Name "loopwave - Win32 (WCE x86em) Release" -# Name "loopwave - Win32 (WCE ARM) Debug" -# Name "loopwave - Win32 (WCE x86) Release" -# Name "loopwave - Win32 (WCE x86) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\test\loopwave.c - -!IF "$(CFG)" == "loopwave - Win32 (WCE emulator) Release" - -DEP_CPP_LOOPW=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_LOOPW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE emulator) Debug" - -DEP_CPP_LOOPW=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_LOOPW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Release" - -DEP_CPP_LOOPW=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_LOOPW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Debug" - -DEP_CPP_LOOPW=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_LOOPW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Release" - -NODEP_CPP_LOOPW=\ - "..\..\test\SDL.h"\ - "..\..\test\SDL_audio.h"\ - "..\..\test\SDL_config.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86em) Release" - -NODEP_CPP_LOOPW=\ - "..\..\test\SDL.h"\ - "..\..\test\SDL_audio.h"\ - "..\..\test\SDL_config.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Debug" - -NODEP_CPP_LOOPW=\ - "..\..\test\SDL.h"\ - "..\..\test\SDL_audio.h"\ - "..\..\test\SDL_config.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Release" - -NODEP_CPP_LOOPW=\ - "..\..\test\SDL.h"\ - "..\..\test\SDL_audio.h"\ - "..\..\test\SDL_config.h"\ - - -!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Debug" - -NODEP_CPP_LOOPW=\ - "..\..\test\SDL.h"\ - "..\..\test\SDL_audio.h"\ - "..\..\test\SDL_config.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/VisualCE/loopwave/loopwave.vcproj b/VisualCE/loopwave/loopwave.vcproj deleted file mode 100644 index e4e515dbb4..0000000000 --- a/VisualCE/loopwave/loopwave.vcproj +++ /dev/null @@ -1,374 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualCE/testalpha/testalpha.vcp b/VisualCE/testalpha/testalpha.vcp deleted file mode 100644 index 7dbc615424..0000000000 --- a/VisualCE/testalpha/testalpha.vcp +++ /dev/null @@ -1,698 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="testalpha" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE x86) Application" 0x8301 -# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 -# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301 -# TARGTYPE "Win32 (WCE SH3) Application" 0x8101 -# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201 -# TARGTYPE "Win32 (WCE emulator) Application" 0xa601 - -CFG=testalpha - Win32 (WCE emulator) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testalpha.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testalpha.vcn" CFG="testalpha - Win32 (WCE emulator) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testalpha - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application") -!MESSAGE "testalpha - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application") -!MESSAGE "testalpha - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "testalpha - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "testalpha - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") -!MESSAGE "testalpha - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") -!MESSAGE "testalpha - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "testalpha - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application") -!MESSAGE "testalpha - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application") -!MESSAGE "testalpha - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "testalpha - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "emulatorRel" -# PROP BASE Intermediate_Dir "emulatorRel" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "emulatorRel" -# PROP Intermediate_Dir "emulatorRel" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "emulatorDbg" -# PROP BASE Intermediate_Dir "emulatorDbg" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "emulatorDbg" -# PROP Intermediate_Dir "emulatorDbg" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4Rel" -# PROP BASE Intermediate_Dir "ARMV4Rel" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4Rel" -# PROP Intermediate_Dir "ARMV4Rel" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4Dbg" -# PROP BASE Intermediate_Dir "ARMV4Dbg" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4Dbg" -# PROP Intermediate_Dir "ARMV4Dbg" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86Rel" -# PROP BASE Intermediate_Dir "X86Rel" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86Rel" -# PROP Intermediate_Dir "X86Rel" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c -# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86Dbg" -# PROP BASE Intermediate_Dir "X86Dbg" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86Dbg" -# PROP Intermediate_Dir "X86Dbg" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ENDIF - -# Begin Target - -# Name "testalpha - Win32 (WCE emulator) Release" -# Name "testalpha - Win32 (WCE emulator) Debug" -# Name "testalpha - Win32 (WCE ARMV4) Release" -# Name "testalpha - Win32 (WCE ARMV4) Debug" -# Name "testalpha - Win32 (WCE ARM) Debug" -# Name "testalpha - Win32 (WCE ARM) Release" -# Name "testalpha - Win32 (WCE MIPS) Debug" -# Name "testalpha - Win32 (WCE SH3) Debug" -# Name "testalpha - Win32 (WCE x86) Release" -# Name "testalpha - Win32 (WCE x86) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\test\testalpha.c - -!IF "$(CFG)" == "testalpha - Win32 (WCE emulator) Release" - -DEP_CPP_TESTA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE emulator) Debug" - -DEP_CPP_TESTA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Release" - -DEP_CPP_TESTA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Debug" - -DEP_CPP_TESTA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_syswm.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Debug" - -DEP_CPP_TESTA=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTA=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Release" - -DEP_CPP_TESTA=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTA=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE MIPS) Debug" - -DEP_CPP_TESTA=\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_types.h"\ - -NODEP_CPP_TESTA=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE SH3) Debug" - -DEP_CPP_TESTA=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Release" - -NODEP_CPP_TESTA=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Debug" - -NODEP_CPP_TESTA=\ - "..\..\test\SDL.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/VisualCE/testalpha/testalpha.vcproj b/VisualCE/testalpha/testalpha.vcproj deleted file mode 100644 index 5e4d623495..0000000000 --- a/VisualCE/testalpha/testalpha.vcproj +++ /dev/null @@ -1,710 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualCE/testtimer/testtimer.vcp b/VisualCE/testtimer/testtimer.vcp deleted file mode 100644 index eba7e47646..0000000000 --- a/VisualCE/testtimer/testtimer.vcp +++ /dev/null @@ -1,874 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="testtimer" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE x86) Application" 0x8301 -# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301 -# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 -# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01 -# TARGTYPE "Win32 (WCE SH3) Application" 0x8101 -# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201 -# TARGTYPE "Win32 (WCE emulator) Application" 0xa601 - -CFG=testtimer - Win32 (WCE MIPS) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testtimer.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testtimer.vcn" CFG="testtimer - Win32 (WCE MIPS) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testtimer - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "testtimer - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "testtimer - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Application") -!MESSAGE "testtimer - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application") -!MESSAGE "testtimer - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") -!MESSAGE "testtimer - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") -!MESSAGE "testtimer - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application") -!MESSAGE "testtimer - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Application") -!MESSAGE "testtimer - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "testtimer - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "testtimer - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application") -!MESSAGE "testtimer - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application") -!MESSAGE "testtimer - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application") -!MESSAGE "testtimer - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "MIPSRel" -# PROP BASE Intermediate_Dir "MIPSRel" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "MIPSRel" -# PROP Intermediate_Dir "MIPSRel" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "SH3Rel" -# PROP BASE Intermediate_Dir "SH3Rel" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "SH3Rel" -# PROP Intermediate_Dir "SH3Rel" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Oxs /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /Oxs /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86EMRel" -# PROP BASE Intermediate_Dir "X86EMRel" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86EMRel" -# PROP Intermediate_Dir "X86EMRel" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86EMDbg" -# PROP BASE Intermediate_Dir "X86EMDbg" -# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86EMDbg" -# PROP Intermediate_Dir "X86EMDbg" -# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4Dbg" -# PROP BASE Intermediate_Dir "ARMV4Dbg" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4Dbg" -# PROP Intermediate_Dir "ARMV4Dbg" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4Rel" -# PROP BASE Intermediate_Dir "ARMV4Rel" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4Rel" -# PROP Intermediate_Dir "ARMV4Rel" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86Rel" -# PROP BASE Intermediate_Dir "X86Rel" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86Rel" -# PROP Intermediate_Dir "X86Rel" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Oxs /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Oxs /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86Dbg" -# PROP BASE Intermediate_Dir "X86Dbg" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86Dbg" -# PROP Intermediate_Dir "X86Dbg" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "emulatorRel" -# PROP BASE Intermediate_Dir "emulatorRel" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "emulatorRel" -# PROP Intermediate_Dir "emulatorRel" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "emulatorDbg" -# PROP BASE Intermediate_Dir "emulatorDbg" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "emulatorDbg" -# PROP Intermediate_Dir "emulatorDbg" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ENDIF - -# Begin Target - -# Name "testtimer - Win32 (WCE MIPS) Release" -# Name "testtimer - Win32 (WCE MIPS) Debug" -# Name "testtimer - Win32 (WCE SH3) Release" -# Name "testtimer - Win32 (WCE SH3) Debug" -# Name "testtimer - Win32 (WCE ARM) Release" -# Name "testtimer - Win32 (WCE ARM) Debug" -# Name "testtimer - Win32 (WCE x86em) Release" -# Name "testtimer - Win32 (WCE x86em) Debug" -# Name "testtimer - Win32 (WCE ARMV4) Debug" -# Name "testtimer - Win32 (WCE ARMV4) Release" -# Name "testtimer - Win32 (WCE x86) Release" -# Name "testtimer - Win32 (WCE x86) Debug" -# Name "testtimer - Win32 (WCE emulator) Release" -# Name "testtimer - Win32 (WCE emulator) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\test\testtimer.c - -!IF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Release" - -DEP_CPP_TESTT=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Debug" - -DEP_CPP_TESTT=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Release" - -DEP_CPP_TESTT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Debug" - -DEP_CPP_TESTT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Release" - -DEP_CPP_TESTT=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Debug" - -DEP_CPP_TESTT=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTT=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Release" - -NODEP_CPP_TESTT=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Debug" - -NODEP_CPP_TESTT=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Debug" - -DEP_CPP_TESTT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Release" - -DEP_CPP_TESTT=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Release" - -NODEP_CPP_TESTT=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Debug" - -NODEP_CPP_TESTT=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Release" - -NODEP_CPP_TESTT=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Debug" - -NODEP_CPP_TESTT=\ - "..\..\test\SDL.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/VisualCE/testtimer/testtimer.vcproj b/VisualCE/testtimer/testtimer.vcproj deleted file mode 100644 index 6c84ea6eea..0000000000 --- a/VisualCE/testtimer/testtimer.vcproj +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VisualCE/testwin/testwin.vcp b/VisualCE/testwin/testwin.vcp deleted file mode 100644 index ec32a29a96..0000000000 --- a/VisualCE/testwin/testwin.vcp +++ /dev/null @@ -1,672 +0,0 @@ -# Microsoft eMbedded Visual Tools Project File - Name="testwin" - Package Owner=<4> -# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (WCE x86) Application" 0x8301 -# TARGTYPE "Win32 (WCE ARM) Application" 0x8501 -# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301 -# TARGTYPE "Win32 (WCE SH3) Application" 0x8101 -# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201 -# TARGTYPE "Win32 (WCE emulator) Application" 0xa601 - -CFG=testwin - Win32 (WCE emulator) Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "testwin.vcn". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "testwin.vcn" CFG="testwin - Win32 (WCE emulator) Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "testwin - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application") -!MESSAGE "testwin - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application") -!MESSAGE "testwin - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "testwin - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application") -!MESSAGE "testwin - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application") -!MESSAGE "testwin - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application") -!MESSAGE "testwin - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application") -!MESSAGE "testwin - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application") -!MESSAGE "testwin - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application") -!MESSAGE "testwin - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -# PROP ATL_Project 2 - -!IF "$(CFG)" == "testwin - Win32 (WCE emulator) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "emulatorRel" -# PROP BASE Intermediate_Dir "emulatorRel" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "emulatorRel" -# PROP Intermediate_Dir "emulatorRel" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE emulator) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "emulatorDbg" -# PROP BASE Intermediate_Dir "emulatorDbg" -# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "emulatorDbg" -# PROP Intermediate_Dir "emulatorDbg" -# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMV4Rel" -# PROP BASE Intermediate_Dir "ARMV4Rel" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMV4Rel" -# PROP Intermediate_Dir "ARMV4Rel" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMV4Dbg" -# PROP BASE Intermediate_Dir "ARMV4Dbg" -# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMV4Dbg" -# PROP Intermediate_Dir "ARMV4Dbg" -# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "ARMDbg" -# PROP BASE Intermediate_Dir "ARMDbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "ARMDbg" -# PROP Intermediate_Dir "ARMDbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "ARMRel" -# PROP BASE Intermediate_Dir "ARMRel" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "ARMRel" -# PROP Intermediate_Dir "ARMRel" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r -CPP=clarm.exe -# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -# ADD CPP /nologo /W3 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE SH3) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "SH3Dbg" -# PROP BASE Intermediate_Dir "SH3Dbg" -# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "SH3Dbg" -# PROP Intermediate_Dir "SH3Dbg" -# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r -CPP=shcl.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3 - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE MIPS) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "MIPSDbg" -# PROP BASE Intermediate_Dir "MIPSDbg" -# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "MIPSDbg" -# PROP Intermediate_Dir "MIPSDbg" -# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r -CPP=clmips.exe -# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "X86Rel" -# PROP BASE Intermediate_Dir "X86Rel" -# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "X86Rel" -# PROP Intermediate_Dir "X86Rel" -# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c -# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 -# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86 - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "X86Dbg" -# PROP BASE Intermediate_Dir "X86Dbg" -# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "X86Dbg" -# PROP Intermediate_Dir "X86Dbg" -# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}" -# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}" -# PROP Target_Dir "" -RSC=rc.exe -# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r -CPP=cl.exe -# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /M$(CECrtMTDebug) /c -# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /M$(CECrtMTDebug) /c -MTL=midl.exe -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# SUBTRACT BASE LINK32 /incremental:no -# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM -# SUBTRACT LINK32 /incremental:no - -!ENDIF - -# Begin Target - -# Name "testwin - Win32 (WCE emulator) Release" -# Name "testwin - Win32 (WCE emulator) Debug" -# Name "testwin - Win32 (WCE ARMV4) Release" -# Name "testwin - Win32 (WCE ARMV4) Debug" -# Name "testwin - Win32 (WCE ARM) Debug" -# Name "testwin - Win32 (WCE ARM) Release" -# Name "testwin - Win32 (WCE SH3) Debug" -# Name "testwin - Win32 (WCE MIPS) Debug" -# Name "testwin - Win32 (WCE x86) Release" -# Name "testwin - Win32 (WCE x86) Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\test\testwin.c - -!IF "$(CFG)" == "testwin - Win32 (WCE emulator) Release" - -DEP_CPP_TESTW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE emulator) Debug" - -DEP_CPP_TESTW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Release" - -DEP_CPP_TESTW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Debug" - -DEP_CPP_TESTW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_config.h"\ - "..\..\include\SDL_config_amiga.h"\ - "..\..\include\SDL_config_dreamcast.h"\ - "..\..\include\SDL_config_macos.h"\ - "..\..\include\SDL_config_macosx.h"\ - "..\..\include\SDL_config_os2.h"\ - "..\..\include\SDL_config_win32.h"\ - "..\..\include\SDL_cpuinfo.h"\ - "..\..\include\SDL_endian.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_loadso.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_platform.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_stdinc.h"\ - "..\..\include\SDL_thread.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Debug" - -DEP_CPP_TESTW=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Release" - -DEP_CPP_TESTW=\ - "..\..\include\SDL.h"\ - -NODEP_CPP_TESTW=\ - "..\include\begin_code.h"\ - "..\include\close_code.h"\ - "..\include\SDL_active.h"\ - "..\include\SDL_audio.h"\ - "..\include\SDL_cdrom.h"\ - "..\include\SDL_config.h"\ - "..\include\SDL_config_amiga.h"\ - "..\include\SDL_config_dreamcast.h"\ - "..\include\SDL_config_macos.h"\ - "..\include\SDL_config_macosx.h"\ - "..\include\SDL_config_os2.h"\ - "..\include\SDL_config_win32.h"\ - "..\include\SDL_config_wince.h"\ - "..\include\SDL_cpuinfo.h"\ - "..\include\SDL_endian.h"\ - "..\include\SDL_error.h"\ - "..\include\SDL_events.h"\ - "..\include\SDL_joystick.h"\ - "..\include\SDL_keyboard.h"\ - "..\include\SDL_keysym.h"\ - "..\include\SDL_loadso.h"\ - "..\include\SDL_main.h"\ - "..\include\SDL_mouse.h"\ - "..\include\SDL_mutex.h"\ - "..\include\SDL_platform.h"\ - "..\include\SDL_quit.h"\ - "..\include\SDL_rwops.h"\ - "..\include\SDL_stdinc.h"\ - "..\include\SDL_thread.h"\ - "..\include\SDL_timer.h"\ - "..\include\SDL_version.h"\ - "..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE SH3) Debug" - -DEP_CPP_TESTW=\ - "..\..\include\begin_code.h"\ - "..\..\include\close_code.h"\ - "..\..\include\SDL.h"\ - "..\..\include\SDL_active.h"\ - "..\..\include\SDL_audio.h"\ - "..\..\include\SDL_byteorder.h"\ - "..\..\include\SDL_cdrom.h"\ - "..\..\include\SDL_error.h"\ - "..\..\include\SDL_events.h"\ - "..\..\include\SDL_getenv.h"\ - "..\..\include\SDL_joystick.h"\ - "..\..\include\SDL_keyboard.h"\ - "..\..\include\SDL_keysym.h"\ - "..\..\include\SDL_main.h"\ - "..\..\include\SDL_mouse.h"\ - "..\..\include\SDL_mutex.h"\ - "..\..\include\SDL_quit.h"\ - "..\..\include\SDL_rwops.h"\ - "..\..\include\SDL_timer.h"\ - "..\..\include\SDL_types.h"\ - "..\..\include\SDL_version.h"\ - "..\..\include\SDL_video.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE MIPS) Debug" - -NODEP_CPP_TESTW=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Release" - -NODEP_CPP_TESTW=\ - "..\..\test\SDL.h"\ - - -!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Debug" - -NODEP_CPP_TESTW=\ - "..\..\test\SDL.h"\ - - -!ENDIF - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/VisualCE/testwin/testwin.vcproj b/VisualCE/testwin/testwin.vcproj deleted file mode 100644 index e95b02e604..0000000000 --- a/VisualCE/testwin/testwin.vcproj +++ /dev/null @@ -1,702 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Watcom-OS2.zip b/Watcom-OS2.zip deleted file mode 100644 index b3d1a67a07..0000000000 Binary files a/Watcom-OS2.zip and /dev/null differ diff --git a/Watcom-Win32.zip b/Watcom-Win32.zip deleted file mode 100644 index c60af6df43..0000000000 Binary files a/Watcom-Win32.zip and /dev/null differ diff --git a/WhatsNew b/WhatsNew deleted file mode 100644 index 927fdd264f..0000000000 --- a/WhatsNew +++ /dev/null @@ -1,727 +0,0 @@ - -This is a list of API changes in SDL's version history. - -Version 1.0: - -1.2.14: - Added cast macros for correct usage with C++: - SDL_reinterpret_cast(type, expression) - SDL_static_cast(type, expression) - - Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for - SDL_VIDEO_FULLSCREEN_HEAD on X11. - - Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal - up/down events for Caps-Lock and Num-Lock keys. - -1.2.13: - Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants. - -1.2.12: - Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling - of the screensaver on Mac OS X and X11. - -1.2.10: - If SDL_OpenAudio() is passed zero for the desired format - fields, the following environment variables will be used - to fill them in: - SDL_AUDIO_FREQUENCY - SDL_AUDIO_FORMAT - SDL_AUDIO_CHANNELS - SDL_AUDIO_SAMPLES - If an environment variable is not specified, it will be set - to a reasonable default value. - - Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment - variable, currently supported on X11 Xinerama configurations. - - Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. - - Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. - - Added current_w and current_h to the SDL_VideoInfo structure, - which is set to the desktop resolution during video intialization, - and then set to the current resolution when a video mode is set. - - SDL_SetVideoMode() now accepts 0 for width or height and will use - the current video mode (or the desktop mode if no mode has been set.) - - Added SDL_GetKeyRepeat() - - Added SDL_config.h, with defaults for various build environments. - -1.2.7: - Added CPU feature detection functions to SDL_cpuinfo.h: - SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(), - SDL_HasAltiVec() - Added function to create RWops from const memory: SDL_RWFromConstMem() - -1.2.6: - Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject() - - Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA - -1.2.5: - Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5) - - Added SDL_GL_STEREO for stereoscopic OpenGL contexts - -1.2.0: - Added SDL_VIDEOEXPOSE event to signal that the screen needs to - be redrawn. This is currently only delivered to OpenGL windows - on X11, though it may be delivered in the future when the video - memory is lost under DirectX. - -1.1.8: - You can pass SDL_NOFRAME to SDL_VideoMode() to create a window - that has no title bar or frame decoration. Fullscreen video - modes automatically have this flag set. - - Added a function to query the clipping rectangle for a surface: - void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) - - Added a function to query the current event filter: - SDL_EventFilter SDL_GetEventFilter(void) - - If you pass -1 to SDL_ShowCursor(), it won't change the current - cursor visibility state, but will still return it. - - SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning - you can nest them as deep as you want, as long as each lock call - has a matching unlock call. The surface remains locked until the - last matching unlock call. - - Note that you may not blit to or from a locked surface. - -1.1.7: - The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take - arrays of Uint16 values instead of Uint8 values. For the most part, - you can just take your old values and shift them up 8 bits to get - new correct values for your gamma ramps. - - You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface() - and SDL will try to RLE accelerate colorkey and alpha blits in the - resulting surface. - -1.1.6: - Added a function to return the thread ID of a specific thread: - Uint32 SDL_GetThreadID(SDL_Thread *thread) - If 'thread' is NULL, this function returns the id for this thread. - -1.1.5: - The YUV overlay structure has been changed to use an array of - pitches and pixels representing the planes of a YUV image, to - better enable hardware acceleration. The YV12 and IYUV formats - each have three planes, corresponding to the Y, U, and V portions - of the image, while packed pixel YUV formats just have one plane. - - For palettized mode (8bpp), the screen colormap is now split in - a physical and a logical palette. The physical palette determines - what colours the screen pixels will get when displayed, and the - logical palette controls the mapping from blits to/from the screen. - A new function, SDL_SetPalette() has been added to change - logical and physical palettes separately. SDL_SetColors() works - just as before, and is equivalent to calling SDL_SetPalette() with - a flag argument of (SDL_LOGPAL|SDL_PHYSPAL). - - SDL_BlitSurface() no longer modifies the source rectangle, only the - destination rectangle. The width/height members of the destination - rectangle are ignored, only the position is used. - - The old source clipping function SDL_SetClipping() has been replaced - with a more useful function to set the destination clipping rectangle: - SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect) - - Added a function to see what subsystems have been initialized: - Uint32 SDL_WasInit(Uint32 flags) - - The Big Alpha Flip: SDL now treats alpha as opacity like everybody - else, and not as transparency: - - A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255 - A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0 - Values between 0 and 255 vary from fully transparent to fully opaque. - - New functions: - SDL_DisplayFormatAlpha() - Returns a surface converted to a format with alpha-channel - that can be blit efficiently to the screen. (In other words, - like SDL_DisplayFormat() but the resulting surface has - an alpha channel.) This is useful for surfaces with alpha. - SDL_MapRGBA() - Works as SDL_MapRGB() but takes an additional alpha parameter. - SDL_GetRGBA() - Works as SDL_GetRGB() but also returns the alpha value - (SDL_ALPHA_OPAQUE for formats without an alpha channel) - - Both SDL_GetRGB() and SDL_GetRGBA() now always return values in - the [0..255] interval. Previously, SDL_GetRGB() would return - (0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format. - (N.B.: This is broken for bit fields < 3 bits.) - - SDL_MapRGB() returns pixels in which the alpha channel is set opaque. - - SDL_SetAlpha() can now be used for both setting the per-surface - alpha, using the new way of thinking of alpha, and also to enable - and disable per-pixel alpha blending for surfaces with an alpha - channel: - To disable alpha blending: - SDL_SetAlpha(surface, 0, 0); - To re-enable alpha blending: - SDL_SetAlpha(surface, SDL_SRCALPHA, 0); - Surfaces with an alpha channel have blending enabled by default. - - SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests - RLE acceleration of blits, just as like with SDL_SetColorKey(). - This flag can be set for both surfaces with an alpha channel - and surfaces with an alpha value set by SDL_SetAlpha(). - As always, RLE surfaces must be locked before pixel access is - allowed, and unlocked before any other SDL operations are done - on it. - - The blit semantics for surfaces with and without alpha and colorkey - have now been defined: - - RGBA->RGB: - SDL_SRCALPHA set: - alpha-blend (using alpha-channel). - SDL_SRCCOLORKEY ignored. - SDL_SRCALPHA not set: - copy RGB. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source colour key, ignoring alpha in the - comparison. - - RGB->RGBA: - SDL_SRCALPHA set: - alpha-blend (using the source per-surface alpha value); - set destination alpha to opaque. - SDL_SRCALPHA not set: - copy RGB, set destination alpha to opaque. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source colour key. - - RGBA->RGBA: - SDL_SRCALPHA set: - alpha-blend (using the source alpha channel) the RGB values; - leave destination alpha untouched. [Note: is this correct?] - SDL_SRCCOLORKEY ignored. - SDL_SRCALPHA not set: - copy all of RGBA to the destination. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source colour key, ignoring alpha in the - comparison. - - RGB->RGB: - SDL_SRCALPHA set: - alpha-blend (using the source per-surface alpha value). - SDL_SRCALPHA not set: - copy RGB. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source colour key. - - As a special case, blits from surfaces with per-surface alpha - value of 128 (50% transparency) are optimised and much faster - than other alpha values. This does not apply to surfaces with - alpha channels (per-pixel alpha). - - New functions for manipulating the gamma of the display have - been added: - int SDL_SetGamma(float red, float green, float blue); - int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); - int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); - Gamma ramps are tables with 256 entries which map the screen color - components into actually displayed colors. For an example of - implementing gamma correction and gamma fades, see test/testgamma.c - Gamma control is not supported on all hardware. - -1.1.4: - The size of the SDL_CDtrack structure changed from 8 to 12 bytes - as the size of the length member was extended to 32 bits. - - You can now use SDL for 2D blitting with a GL mode by passing the - SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or - 32 bpp, and the data in the framebuffer is put into the GL scene - when you call SDL_UpdateRects(), and the scene will be visible - when you call SDL_GL_SwapBuffers(). - - Run the "testgl" test program with the -logo command line option - to see an example of this blending of 2D and 3D in SDL. - -1.1.3: - Added SDL_FreeRW() to the API, to complement SDL_AllocRW() - - Added resizable window support - just add SDL_RESIZABLE to the - SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events. - See SDL_events.h for details on the new SDL_ResizeEvent structure. - - Added condition variable support, based on mutexes and semaphores. - SDL_CreateCond() - SDL_DestroyCond() - SDL_CondSignal() - SDL_CondBroadcast() - SDL_CondWait() - SDL_CondTimedWait() - The new function prototypes are in SDL_mutex.h - - Added counting semaphore support, based on the mutex primitive. - SDL_CreateSemaphore() - SDL_DestroySemaphore() - SDL_SemWait() - SDL_SemTryWait() - SDL_SemWaitTimeout() - SDL_SemPost() - SDL_SemValue() - The new function prototypes are in SDL_mutex.h - - Added support for asynchronous blitting. To take advantage of this, - you must set the SDL_ASYNCBLIT flag when setting the video mode and - creating surfaces that you want accelerated in this way. You must - lock surfaces that have this flag set, and the lock will block until - any queued blits have completed. - - Added YUV video overlay support. - The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU. - This function creates an overlay surface: - SDL_CreateYUVOverlay() - You must lock and unlock the overlay to get access to the data: - SDL_LockYUVOverlay() SDL_UnlockYUVOverlay() - You can then display the overlay: - SDL_DisplayYUVOverlay() - You must free the overlay when you are done using it: - SDL_FreeYUVOverlay() - See SDL_video.h for the full function prototypes. - - The joystick hat position constants have been changed: - Old constant New constant - ------------ ------------ - 0 SDL_HAT_CENTERED - 1 SDL_HAT_UP - 2 SDL_HAT_RIGHTUP - 3 SDL_HAT_RIGHT - 4 SDL_HAT_RIGHTDOWN - 5 SDL_HAT_DOWN - 6 SDL_HAT_LEFTDOWN - 7 SDL_HAT_LEFT - 8 SDL_HAT_LEFTUP - The new constants are bitmasks, so you can check for the - individual axes like this: - if ( hat_position & SDL_HAT_UP ) { - } - and you'll catch left-up, up, and right-up. - -1.1.2: - Added multiple timer support: - SDL_AddTimer() and SDL_RemoveTimer() - - SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL. - -1.1.0: - Added initial OpenGL support. - First set GL attributes (such as RGB depth, alpha depth, etc.) - SDL_GL_SetAttribute() - Then call SDL_SetVideoMode() with the SDL_OPENGL flag. - Perform all of your normal GL drawing. - Finally swap the buffers with the new SDL function: - SDL_GL_SwapBuffers() - See the new 'testgl' test program for an example of using GL with SDL. - - You can load GL extension functions by using the function: - SDL_GL_LoadProcAddress() - - Added functions to initialize and cleanup specific SDL subsystems: - SDL_InitSubSystem() and SDL_QuitSubSystem() - - Added user-defined event type: - typedef struct { - Uint8 type; - int code; - void *data1; - void *data2; - } SDL_UserEvent; - This structure is in the "user" member of an SDL_Event. - - Added a function to push events into the event queue: - SDL_PushEvent() - - Example of using the new SDL user-defined events: - { - SDL_Event event; - - event.type = SDL_USEREVENT; - event.user.code = my_event_code; - event.user.data1 = significant_data; - event.user.data2 = 0; - SDL_PushEvent(&event); - } - - Added a function to get mouse deltas since last query: - SDL_GetRelativeMouseState() - - Added a boolean datatype to SDL_types.h: - SDL_bool = { SDL_TRUE, SDL_FALSE } - - Added a function to get the current audio status: - SDL_GetAudioState(); - It returns one of: - SDL_AUDIO_STOPPED, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED - - Added an AAlib driver (ASCII Art) - by Stephane Peter. - -1.0.6: - The input grab state is reset after each call to SDL_SetVideoMode(). - The input is grabbed by default in fullscreen mode, and ungrabbed in - windowed mode. If you want to set input grab to a particular value, - you should set it after each call to SDL_SetVideoMode(). - -1.0.5: - Exposed SDL_AudioInit(), SDL_VideoInit() - Added SDL_AudioDriverName() and SDL_VideoDriverName() - - Added new window manager function: - SDL_WM_ToggleFullScreen() - This is currently implemented only on Linux - - The ALT-ENTER code has been removed - it's not appropriate for a - lib to bind keys when they aren't even emergency escape sequences. - - ALT-ENTER functionality can be implemented with the following code: - - int Handle_AltEnter(const SDL_Event *event) - { - if ( event->type == SDL_KEYDOWN ) { - if ( (event->key.keysym.sym == SDLK_RETURN) && - (event->key.keysym.mod & KMOD_ALT) ) { - SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); - return(0); - } - } - return(1); - } - SDL_SetEventFilter(Handle_AltEnter); - -1.0.3: - Under X11, if you grab the input and hide the mouse cursor, - the mouse will go into a "relative motion" mode where you - will always get relative motion events no matter how far in - each direction you move the mouse - relative motion is not - bounded by the edges of the window (though the absolute values - of the mouse positions are clamped by the size of the window). - The SVGAlib, framebuffer console, and DirectInput drivers all - have this behavior naturally, and the GDI and BWindow drivers - never go into "relative motion" mode. - -1.0.2: - Added a function to enable keyboard repeat: - SDL_EnableKeyRepeat() - - Added a function to grab the mouse and keyboard input - SDL_WM_GrabInput() - - Added a function to iconify the window. - SDL_WM_IconifyWindow() - If this function succeeds, the application will receive an event - signaling SDL_APPACTIVE event - -1.0.1: - Added constants to SDL_audio.h for 16-bit native byte ordering: - AUDIO_U16SYS, AUDIO_S16SYS - -1.0.0: - New public release - -Version 0.11: - -0.11.5: - A new function SDL_GetVideoSurface() has been added, and returns - a pointer to the current display surface. - - SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and - a new function SDL_CreateRGBSurfaceFrom() has been added to allow - creating an SDL surface from an existing pixel data buffer. - - Added SDL_GetRGB() to the headers and documentation. - -0.11.4: - SDL_SetLibraryPath() is no longer meaningful, and has been removed. - -0.11.3: - A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from - installing fatal signal handlers on operating systems that support - them. - -Version 0.9: - -0.9.15: - SDL_CreateColorCursor() has been removed. Color cursors should - be implemented as sprites, blitted by the application when the - cursor moves. To get smooth color cursor updates when the app - is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This - allows you to handle the mouse motion in another thread from an - event filter function, but is currently only supported by Linux - and BeOS. Note that you'll have to protect the display surface - from multi-threaded access by using mutexes if you do this. - - Thread-safe surface support has been removed from SDL. - This makes blitting somewhat faster, by removing SDL_MiddleBlit(). - Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead. - You can make your surfaces thread-safe by allocating your own - mutex and making lock/unlock calls around accesses to your surface. - -0.9.14: - SDL_GetMouseState() now takes pointers to int rather than Uint16. - - If you set the SDL_WINDOWID environment variable under UNIX X11, - SDL will use that as the main window instead of creating it's own. - This is an unsupported extension to SDL, and not portable at all. - -0.9.13: - Added a function SDL_SetLibraryPath() which can be used to specify - the directory containing the SDL dynamic libraries. This is useful - for commercial applications which ship with particular versions - of the libraries, and for security on multi-user systems. - If this function is not used, the default system directories are - searched using the native dynamic object loading mechanism. - - In order to support C linkage under Visual C++, you must declare - main() without any return type: - main(int argc, char *argv[]) { - /* Do the program... */ - return(0); - } - C++ programs should also return a value if compiled under VC++. - - The blit_endian member of the SDL_VideoInfo struct has been removed. - - SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there - is now no longer any function to translate a keysym to a character. - - The SDL_keysym structure has been extended with a 'scancode' and - 'unicode' member. The 'scancode' is a hardware specific scancode - for the key that was pressed, and may be 0. The 'unicode' member - is a 16-bit UNICODE translation of the key that was pressed along - with any modifiers or compose keys that have been pressed. - If no UNICODE translation exists for the key, 'unicode' will be 0. - - Added a function SDL_EnableUNICODE() to enable/disable UNICODE - translation of character keypresses. Translation defaults off. - - To convert existing code to use the new API, change code which - uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(), - and change code which uses it to get the ASCII value of a sym to - use the 'unicode' member of the event keysym. - -0.9.12: - There is partial support for 64-bit datatypes. I don't recommend - you use this if you have a choice, because 64-bit datatypes are not - supported on many platforms. On platforms for which it is supported, - the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and - you can use the Uint64 and Sint64 datatypes. - - Added functions to SDL_endian.h to support 64-bit datatypes: - SDL_SwapLE64(), SDL_SwapBE64(), - SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64() - - A new member "len_ratio" has been added to the SDL_AudioCVT structure, - and allows you to determine either the original buffer length or the - converted buffer length, given the other. - - A new function SDL_FreeWAV() has been added to the API to free data - allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since - the gcc compiled DLL uses a different heap than VC++ compiled apps. - - SDL now has initial support for international keyboards using the - Latin character set. - If a particular mapping is desired, you can set the DEFAULT_KEYBOARD - compile-time variable, or you can set the environment variable - "SDL_KEYBOARD" to a string identifying the keyboard mapping you desire. - The valid values for these variables can be found in SDL_keyboard.c - - Full support for German and French keyboards under X11 is implemented. - -0.9.11: - The THREADED_EVENTS compile-time define has been replaced with the - SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(), - SDL will create a separate thread to perform input event handling. - If this flag is passed to SDL_Init(), and the OS doesn't support - event handling in a separate thread, SDL_Init() will fail. - Be sure to add calls to SDL_Delay() in your main thread to allow - the OS to schedule your event thread, or it may starve, leading - to slow event delivery and/or dropped events. - Currently MacOS and Win32 do not support this flag, while BeOS - and Linux do support it. I recommend that your application only - use this flag if absolutely necessary. - - The SDL thread function passed to SDL_CreateThread() now returns a - status. This status can be retrieved by passing a non-NULL pointer - as the 'status' argument to SDL_WaitThread(). - - The volume parameter to SDL_MixAudio() has been increased in range - from (0-8) to (0-128) - - SDL now has a data source abstraction which can encompass a file, - an area of memory, or any custom object you can envision. It uses - these abstractions, SDL_RWops, in the endian read/write functions, - and the built-in WAV and BMP file loaders. This means you can load - WAV chunks from memory mapped files, compressed archives, network - pipes, or anything else that has a data read abstraction. - - There are three built-in data source abstractions: - SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem() - along with a generic data source allocation function: - SDL_AllocRW() - These data sources can be used like stdio file pointers with the - following convenience functions: - SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose() - These functions are defined in the new header file "SDL_rwops.h" - - The endian swapping functions have been turned into macros for speed - and SDL_CalculateEndian() has been removed. SDL_endian.h now defines - SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on - the endianness of the host system. - - The endian read/write functions now take an SDL_RWops pointer - instead of a stdio FILE pointer, to support the new data source - abstraction. - - The SDL_*LoadWAV() functions have been replaced with a single - SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's - first parameter, and a flag whether or not to automatically - free it as the second parameter. SDL_LoadWAV() is a macro for - backward compatibility and convenience: - SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); - - The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced - with a single function that takes a SDL_RWops pointer as it's - first parameter, and a flag whether or not to automatically - free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP() - are macros for backward compatibility and convenience: - SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...); - SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...); - Note that these functions use SDL_RWseek() extensively, and should - not be used on pipes or other non-seekable data sources. - -0.9.10: - The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been - extended to support multiple types of display drivers, as well as - safe access to the X11 display when THREADED_EVENTS is enabled. - The new structures are documented in the SDL_syswm.h header file. - - Thanks to John Elliott , the UK keyboard - should now work properly, as well as the "Windows" keys on US - keyboards. - - The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab - instead of trying to open each block device on the system. - The CD must be listed in /etc/fstab as using the iso9660 filesystem. - - On Linux, if you define THREADED_EVENTS at compile time, a separate - thread will be spawned to gather X events asynchronously from the - graphics updates. This hasn't been extensively tested, but it does - provide a means of handling keyboard and mouse input in a separate - thread from the graphics thread. (This is now enabled by default.) - - A special access function SDL_PeepEvents() allows you to manipulate - the event queue in a thread-safe manner, including peeking at events, - removing events of a specified type, and adding new events of arbitrary - type to the queue (use the new 'user' member of the SDL_Event type). - - If you use SDL_PeepEvents() to gather events, then the main graphics - thread needs to call SDL_PumpEvents() periodically to drive the event - loop and generate input events. This is not necessary if SDL has been - compiled with THREADED_EVENTS defined, but doesn't hurt. - - A new function SDL_ThreadID() returns the identifier associated with - the current thread. - -0.9.9: - The AUDIO_STEREO format flag has been replaced with a new 'channels' - member of the SDL_AudioSpec structure. The channels are 1 for mono - audio, and 2 for stereo audio. In the future more channels may be - supported for 3D surround sound. - - The SDL_MixAudio() function now takes an additional volume parameter, - which should be set to SDL_MIX_MAXVOLUME for compatibility with the - original function. - - The CD-ROM functions which take a 'cdrom' parameter can now be - passed NULL, and will act on the last successfully opened CD-ROM. - -0.9.8: - No changes, bugfixes only. - -0.9.7: - No changes, bugfixes only. - -0.9.6: - Added a fast rectangle fill function: SDL_FillRect() - - Addition of a useful function for getting info on the video hardware: - const SDL_VideoInfo *SDL_GetVideoInfo(void) - This function replaces SDL_GetDisplayFormat(). - - Initial support for double-buffering: - Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode() - Update the screen with a new function: SDL_Flip() - - SDL_AllocSurface() takes two new flags: - SDL_SRCCOLORKEY means that the surface will be used for colorkey blits - and if the hardware supports hardware acceleration of colorkey blits - between two surfaces in video memory, to place the surface in video - memory if possible, otherwise it will be placed in system memory. - SDL_SRCALPHA means that the surface will be used for alpha blits and - if the hardware supports hardware acceleration of alpha blits between - two surfaces in video memory, to place the surface in video memory - if possible, otherwise it will be placed in system memory. - SDL_HWSURFACE now means that the surface will be created with the - same format as the display surface, since having surfaces in video - memory is only useful for fast blitting to the screen, and you can't - blit surfaces with different surface formats in video memory. - -0.9.5: - You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume - that the icon consists of the entire image. - - SDL_LowerBlit() is back -- but don't use it on the display surface. - It is exactly the same as SDL_MiddleBlit(), but doesn't check for - thread safety. - - Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take - a FILE pointer instead of a file name. - - Added CD-ROM audio control API: - SDL_CDNumDrives() - SDL_CDName() - SDL_CDOpen() - SDL_CDStatus() - SDL_CDPlayTracks() - SDL_CDPlay() - SDL_CDPause() - SDL_CDResume() - SDL_CDStop() - SDL_CDEject() - SDL_CDClose() - -0.9.4: - No changes, bugfixes only. - -0.9.3: - Mouse motion event now includes relative motion information: - Sint16 event->motion.xrel, Sint16 event->motion.yrel - - X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT - (Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile) - -0.9.2: - No changes, bugfixes only. - -0.9.1: - Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now - automatically mapped on blit. - -0.8.0: - SDL stable release diff --git a/WhatsNew.txt b/WhatsNew.txt new file mode 100644 index 0000000000..c3784deab1 --- /dev/null +++ b/WhatsNew.txt @@ -0,0 +1,3 @@ + +This is a list of API changes in SDL's version history. + diff --git a/Xcode-iOS/Demos/Default.png b/Xcode-iOS/Demos/Default.png new file mode 100644 index 0000000000..f91282875a Binary files /dev/null and b/Xcode-iOS/Demos/Default.png differ diff --git a/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj new file mode 100755 index 0000000000..e3eaecdaed --- /dev/null +++ b/Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj @@ -0,0 +1,1019 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + FD15FD690E086911003BDF25 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + FD15FD6A0E086911003BDF25 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + FD15FD6B0E086911003BDF25 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + FD15FD6C0E086911003BDF25 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; }; + FD15FD6D0E086911003BDF25 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; }; + FD1B48DD0E313255007AB34E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B489E0E313154007AB34E /* libSDL2.a */; }; + FD1B49980E313261007AB34E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B489E0E313154007AB34E /* libSDL2.a */; }; + FD1B499C0E313269007AB34E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B489E0E313154007AB34E /* libSDL2.a */; }; + FD1B499E0E31326C007AB34E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B489E0E313154007AB34E /* libSDL2.a */; }; + FD1B49A00E313270007AB34E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B489E0E313154007AB34E /* libSDL2.a */; }; + FD1B49A20E313273007AB34E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B489E0E313154007AB34E /* libSDL2.a */; }; + FD5F9CE80E0E0741008E885B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + FD5F9CE90E0E0741008E885B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + FD5F9CEA0E0E0741008E885B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + FD5F9CEB0E0E0741008E885B /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; }; + FD5F9CEC0E0E0741008E885B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; }; + FD77A00E0E26BC0500F39101 /* happy.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0080E26BC0500F39101 /* happy.c */; }; + FD77A0130E26BC0500F39101 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; + FD77A0160E26BC0500F39101 /* rectangles.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A00A0E26BC0500F39101 /* rectangles.c */; }; + FD77A0190E26BC0500F39101 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; + FD77A01F0E26BC0500F39101 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; + FD77A0230E26BC0500F39101 /* touch.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A00B0E26BC0500F39101 /* touch.c */; }; + FD77A0250E26BC0500F39101 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; + FD77A0270E26BC0500F39101 /* mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0090E26BC0500F39101 /* mixer.c */; }; + FD77A02A0E26BC2700F39101 /* accelerometer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0050E26BC0500F39101 /* accelerometer.c */; }; + FD787AA10E22A5CC003E8E36 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; }; + FD787AA20E22A5CC003E8E36 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; }; + FD787AA30E22A5CC003E8E36 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; }; + FD787AA40E22A5CC003E8E36 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; }; + FD787AA50E22A5CC003E8E36 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; }; + FD925B190E0F276600E92347 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; }; + FD925B1A0E0F276600E92347 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; }; + FD925B1B0E0F276600E92347 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; }; + FDB651D00E43D1AD00F688B5 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CC0E43D19800F688B5 /* icon.bmp */; }; + FDB651D10E43D1B300F688B5 /* ship.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CD0E43D19800F688B5 /* ship.bmp */; }; + FDB651D20E43D1B500F688B5 /* space.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CE0E43D19800F688B5 /* space.bmp */; }; + FDB651D30E43D1BA00F688B5 /* stroke.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CF0E43D19800F688B5 /* stroke.bmp */; }; + FDB651D40E43D1C500F688B5 /* ds_brush_snare.wav in Resources */ = {isa = PBXBuildFile; fileRef = FDB651C80E43D19800F688B5 /* ds_brush_snare.wav */; }; + FDB651D50E43D1C500F688B5 /* ds_china.wav in Resources */ = {isa = PBXBuildFile; fileRef = FDB651C90E43D19800F688B5 /* ds_china.wav */; }; + FDB651D60E43D1C500F688B5 /* ds_kick_big_amb.wav in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CA0E43D19800F688B5 /* ds_kick_big_amb.wav */; }; + FDB651D70E43D1C500F688B5 /* ds_loose_skin_mute.wav in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CB0E43D19800F688B5 /* ds_loose_skin_mute.wav */; }; + FDB651D80E43D1D800F688B5 /* stroke.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CF0E43D19800F688B5 /* stroke.bmp */; }; + FDB651F90E43D1F300F688B5 /* stroke.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB651CF0E43D19800F688B5 /* stroke.bmp */; }; + FDB651FA0E43D1F300F688B5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; }; + FDB651FB0E43D1F300F688B5 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; }; + FDB651FD0E43D1F300F688B5 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; + FDB652000E43D1F300F688B5 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B489E0E313154007AB34E /* libSDL2.a */; }; + FDB652020E43D1F300F688B5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + FDB652030E43D1F300F688B5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + FDB652040E43D1F300F688B5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + FDB652050E43D1F300F688B5 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; }; + FDB652060E43D1F300F688B5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; }; + FDB652070E43D1F300F688B5 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; }; + FDB652080E43D1F300F688B5 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; }; + FDB652120E43D21A00F688B5 /* keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = FDB652110E43D21A00F688B5 /* keyboard.c */; }; + FDB652C70E43E25900F688B5 /* kromasky_16x16.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDB652C60E43E25900F688B5 /* kromasky_16x16.bmp */; }; + FDB96ED40DEFC9C700FAF19F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; }; + FDB96EE00DEFC9DC00FAF19F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; }; + FDC202E10E107B1200ABAC90 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; }; + FDC202E60E107B1200ABAC90 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + FDC202E70E107B1200ABAC90 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + FDC202E80E107B1200ABAC90 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + FDC202E90E107B1200ABAC90 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; }; + FDC202EA0E107B1200ABAC90 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; }; + FDC214870E26D78A00DDED23 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; + FDC52EC80E2843D6008D768C /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; }; + FDC52EC90E2843D6008D768C /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD787AA00E22A5CC003E8E36 /* Default.png */; }; + FDC52ECF0E2843D6008D768C /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A0060E26BC0500F39101 /* common.c */; }; + FDC52ED40E2843D6008D768C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + FDC52ED50E2843D6008D768C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + FDC52ED60E2843D6008D768C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + FDC52ED70E2843D6008D768C /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; }; + FDC52ED80E2843D6008D768C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; }; + FDC52ED90E2843D6008D768C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; }; + FDC52EDA0E2843D6008D768C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; }; + FDC52EE50E284410008D768C /* fireworks.c in Sources */ = {isa = PBXBuildFile; fileRef = FDC52EE40E284410008D768C /* fireworks.c */; }; + FDF0D6960E12D05400247964 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD925B180E0F276600E92347 /* Icon.png */; }; + FDF0D69C0E12D05400247964 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + FDF0D69D0E12D05400247964 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + FDF0D69E0E12D05400247964 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + FDF0D69F0E12D05400247964 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */; }; + FDF0D6A00E12D05400247964 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */; }; + FDF0D71E0E12D2AB00247964 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; }; + FDF0D7230E12D31800247964 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; }; + FDF0D7950E12D52900247964 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; }; + FDF0D7960E12D52900247964 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; }; + FDF0D7A70E12D53200247964 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; }; + FDF0D7A80E12D53200247964 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; }; + FDF0D7A90E12D53500247964 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; }; + FDF0D7AA0E12D53500247964 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; }; + FDF0D7AB0E12D53800247964 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */; }; + FDF0D7AC0E12D53800247964 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDF0D7220E12D31800247964 /* AudioToolbox.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 049F3694130CD86800FF080F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B; + remoteInfo = libSDL; + }; + 049F3696130CD87600FF080F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B; + remoteInfo = libSDL; + }; + 049F3698130CD87F00FF080F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B; + remoteInfo = libSDL; + }; + 049F369A130CD88800FF080F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B; + remoteInfo = libSDL; + }; + 049F369C130CD89000FF080F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B; + remoteInfo = libSDL; + }; + 049F369E130CD89800FF080F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B; + remoteInfo = libSDL; + }; + 049F36A0130CD8A000FF080F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B; + remoteInfo = libSDL; + }; + FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = FD6526630DE8FCCB002AD96B; + remoteInfo = StaticLib; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* Rectangles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Rectangles.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FD15FCB20E086866003BDF25 /* Happy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Happy.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FD1B48920E313154007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; }; + FD5F9BE40E0DEBEA008E885B /* Accel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Accel.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FD77A0050E26BC0500F39101 /* accelerometer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = accelerometer.c; sourceTree = ""; }; + FD77A0060E26BC0500F39101 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = ""; }; + FD77A0070E26BC0500F39101 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; + FD77A0080E26BC0500F39101 /* happy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = happy.c; sourceTree = ""; }; + FD77A0090E26BC0500F39101 /* mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mixer.c; sourceTree = ""; }; + FD77A00A0E26BC0500F39101 /* rectangles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rectangles.c; sourceTree = ""; }; + FD77A00B0E26BC0500F39101 /* touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = touch.c; sourceTree = ""; }; + FD787AA00E22A5CC003E8E36 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + FD925B180E0F276600E92347 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; + FDB651C60E43D19800F688B5 /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = license.txt; sourceTree = ""; }; + FDB651C80E43D19800F688B5 /* ds_brush_snare.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = ds_brush_snare.wav; sourceTree = ""; }; + FDB651C90E43D19800F688B5 /* ds_china.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = ds_china.wav; sourceTree = ""; }; + FDB651CA0E43D19800F688B5 /* ds_kick_big_amb.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = ds_kick_big_amb.wav; sourceTree = ""; }; + FDB651CB0E43D19800F688B5 /* ds_loose_skin_mute.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = ds_loose_skin_mute.wav; sourceTree = ""; }; + FDB651CC0E43D19800F688B5 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = icon.bmp; sourceTree = ""; }; + FDB651CD0E43D19800F688B5 /* ship.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = ship.bmp; sourceTree = ""; }; + FDB651CE0E43D19800F688B5 /* space.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = space.bmp; sourceTree = ""; }; + FDB651CF0E43D19800F688B5 /* stroke.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = stroke.bmp; sourceTree = ""; }; + FDB6520C0E43D1F300F688B5 /* Keyboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Keyboard.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDB652110E43D21A00F688B5 /* keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = keyboard.c; sourceTree = ""; }; + FDB652C60E43E25900F688B5 /* kromasky_16x16.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = kromasky_16x16.bmp; sourceTree = ""; }; + FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + FDC202EE0E107B1200ABAC90 /* Touch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Touch.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDC52EDE0E2843D6008D768C /* Fireworks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Fireworks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDC52EE40E284410008D768C /* fireworks.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fireworks.c; sourceTree = ""; }; + FDF0D6A40E12D05400247964 /* Mixer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mixer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + FDF0D7220E12D31800247964 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FD1B48DD0E313255007AB34E /* libSDL2.a in Frameworks */, + FDF0D7AB0E12D53800247964 /* CoreAudio.framework in Frameworks */, + FDF0D7AC0E12D53800247964 /* AudioToolbox.framework in Frameworks */, + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */, + FDB96ED40DEFC9C700FAF19F /* OpenGLES.framework in Frameworks */, + FDB96EE00DEFC9DC00FAF19F /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FD15FCB00E086866003BDF25 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FD1B49980E313261007AB34E /* libSDL2.a in Frameworks */, + FDF0D7A90E12D53500247964 /* CoreAudio.framework in Frameworks */, + FDF0D7AA0E12D53500247964 /* AudioToolbox.framework in Frameworks */, + FD15FD690E086911003BDF25 /* Foundation.framework in Frameworks */, + FD15FD6A0E086911003BDF25 /* UIKit.framework in Frameworks */, + FD15FD6B0E086911003BDF25 /* CoreGraphics.framework in Frameworks */, + FD15FD6C0E086911003BDF25 /* OpenGLES.framework in Frameworks */, + FD15FD6D0E086911003BDF25 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FD5F9BE20E0DEBEA008E885B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FD1B499C0E313269007AB34E /* libSDL2.a in Frameworks */, + FDF0D7A70E12D53200247964 /* CoreAudio.framework in Frameworks */, + FDF0D7A80E12D53200247964 /* AudioToolbox.framework in Frameworks */, + FD5F9CEB0E0E0741008E885B /* OpenGLES.framework in Frameworks */, + FD5F9CEC0E0E0741008E885B /* QuartzCore.framework in Frameworks */, + FD5F9CE80E0E0741008E885B /* Foundation.framework in Frameworks */, + FD5F9CE90E0E0741008E885B /* UIKit.framework in Frameworks */, + FD5F9CEA0E0E0741008E885B /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDB651FF0E43D1F300F688B5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB652000E43D1F300F688B5 /* libSDL2.a in Frameworks */, + FDB652020E43D1F300F688B5 /* Foundation.framework in Frameworks */, + FDB652030E43D1F300F688B5 /* UIKit.framework in Frameworks */, + FDB652040E43D1F300F688B5 /* CoreGraphics.framework in Frameworks */, + FDB652050E43D1F300F688B5 /* OpenGLES.framework in Frameworks */, + FDB652060E43D1F300F688B5 /* QuartzCore.framework in Frameworks */, + FDB652070E43D1F300F688B5 /* CoreAudio.framework in Frameworks */, + FDB652080E43D1F300F688B5 /* AudioToolbox.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC202E40E107B1200ABAC90 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FD1B499E0E31326C007AB34E /* libSDL2.a in Frameworks */, + FDF0D7950E12D52900247964 /* CoreAudio.framework in Frameworks */, + FDF0D7960E12D52900247964 /* AudioToolbox.framework in Frameworks */, + FDC202E60E107B1200ABAC90 /* Foundation.framework in Frameworks */, + FDC202E70E107B1200ABAC90 /* UIKit.framework in Frameworks */, + FDC202E80E107B1200ABAC90 /* CoreGraphics.framework in Frameworks */, + FDC202E90E107B1200ABAC90 /* OpenGLES.framework in Frameworks */, + FDC202EA0E107B1200ABAC90 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC52ED10E2843D6008D768C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FD1B49A20E313273007AB34E /* libSDL2.a in Frameworks */, + FDC52ED40E2843D6008D768C /* Foundation.framework in Frameworks */, + FDC52ED50E2843D6008D768C /* UIKit.framework in Frameworks */, + FDC52ED60E2843D6008D768C /* CoreGraphics.framework in Frameworks */, + FDC52ED70E2843D6008D768C /* OpenGLES.framework in Frameworks */, + FDC52ED80E2843D6008D768C /* QuartzCore.framework in Frameworks */, + FDC52ED90E2843D6008D768C /* CoreAudio.framework in Frameworks */, + FDC52EDA0E2843D6008D768C /* AudioToolbox.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDF0D69A0E12D05400247964 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FD1B49A00E313270007AB34E /* libSDL2.a in Frameworks */, + FDF0D69C0E12D05400247964 /* Foundation.framework in Frameworks */, + FDF0D69D0E12D05400247964 /* UIKit.framework in Frameworks */, + FDF0D69E0E12D05400247964 /* CoreGraphics.framework in Frameworks */, + FDF0D69F0E12D05400247964 /* OpenGLES.framework in Frameworks */, + FDF0D6A00E12D05400247964 /* QuartzCore.framework in Frameworks */, + FDF0D71E0E12D2AB00247964 /* CoreAudio.framework in Frameworks */, + FDF0D7230E12D31800247964 /* AudioToolbox.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* Rectangles.app */, + FD15FCB20E086866003BDF25 /* Happy.app */, + FD5F9BE40E0DEBEA008E885B /* Accel.app */, + FDC202EE0E107B1200ABAC90 /* Touch.app */, + FDF0D6A40E12D05400247964 /* Mixer.app */, + FDC52EDE0E2843D6008D768C /* Fireworks.app */, + FDB6520C0E43D1F300F688B5 /* Keyboard.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + FD1B48920E313154007AB34E /* SDL.xcodeproj */, + FD77A0040E26BC0500F39101 /* src */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + FDB651C30E43D19800F688B5 /* data */, + FD787AA00E22A5CC003E8E36 /* Default.png */, + FD925B180E0F276600E92347 /* Icon.png */, + 8D1107310486CEB800E47090 /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + FDF0D7220E12D31800247964 /* AudioToolbox.framework */, + FDB96EDF0DEFC9DC00FAF19F /* QuartzCore.framework */, + FDB96ED30DEFC9C700FAF19F /* OpenGLES.framework */, + 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + FDF0D71D0E12D2AB00247964 /* CoreAudio.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + FD1B48930E313154007AB34E /* Products */ = { + isa = PBXGroup; + children = ( + FD1B489E0E313154007AB34E /* libSDL2.a */, + ); + name = Products; + sourceTree = ""; + }; + FD77A0040E26BC0500F39101 /* src */ = { + isa = PBXGroup; + children = ( + FD77A0060E26BC0500F39101 /* common.c */, + FD77A0070E26BC0500F39101 /* common.h */, + FD77A00A0E26BC0500F39101 /* rectangles.c */, + FD77A0080E26BC0500F39101 /* happy.c */, + FD77A0050E26BC0500F39101 /* accelerometer.c */, + FD77A00B0E26BC0500F39101 /* touch.c */, + FD77A0090E26BC0500F39101 /* mixer.c */, + FDB652110E43D21A00F688B5 /* keyboard.c */, + FDC52EE40E284410008D768C /* fireworks.c */, + ); + path = src; + sourceTree = ""; + }; + FDB651C30E43D19800F688B5 /* data */ = { + isa = PBXGroup; + children = ( + FDB651C40E43D19800F688B5 /* bitmapfont */, + FDB651C70E43D19800F688B5 /* drums */, + FDB651CC0E43D19800F688B5 /* icon.bmp */, + FDB651CD0E43D19800F688B5 /* ship.bmp */, + FDB651CE0E43D19800F688B5 /* space.bmp */, + FDB651CF0E43D19800F688B5 /* stroke.bmp */, + ); + path = data; + sourceTree = ""; + }; + FDB651C40E43D19800F688B5 /* bitmapfont */ = { + isa = PBXGroup; + children = ( + FDB652C60E43E25900F688B5 /* kromasky_16x16.bmp */, + FDB651C60E43D19800F688B5 /* license.txt */, + ); + path = bitmapfont; + sourceTree = ""; + }; + FDB651C70E43D19800F688B5 /* drums */ = { + isa = PBXGroup; + children = ( + FDB651C80E43D19800F688B5 /* ds_brush_snare.wav */, + FDB651C90E43D19800F688B5 /* ds_china.wav */, + FDB651CA0E43D19800F688B5 /* ds_kick_big_amb.wav */, + FDB651CB0E43D19800F688B5 /* ds_loose_skin_mute.wav */, + ); + path = drums; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* Rectangles */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Rectangles" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 049F3695130CD86800FF080F /* PBXTargetDependency */, + ); + name = Rectangles; + productName = SDLiPodTest; + productReference = 1D6058910D05DD3D006BFB54 /* Rectangles.app */; + productType = "com.apple.product-type.application"; + }; + FD15FCB10E086866003BDF25 /* Happy */ = { + isa = PBXNativeTarget; + buildConfigurationList = FD15FCB70E086867003BDF25 /* Build configuration list for PBXNativeTarget "Happy" */; + buildPhases = ( + FD15FCAE0E086866003BDF25 /* Resources */, + FD15FCAF0E086866003BDF25 /* Sources */, + FD15FCB00E086866003BDF25 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 049F3697130CD87600FF080F /* PBXTargetDependency */, + ); + name = Happy; + productName = BMPTest; + productReference = FD15FCB20E086866003BDF25 /* Happy.app */; + productType = "com.apple.product-type.application"; + }; + FD5F9BE30E0DEBEA008E885B /* Accel */ = { + isa = PBXNativeTarget; + buildConfigurationList = FD5F9BE90E0DEBEB008E885B /* Build configuration list for PBXNativeTarget "Accel" */; + buildPhases = ( + FD5F9BE00E0DEBEA008E885B /* Resources */, + FD5F9BE10E0DEBEA008E885B /* Sources */, + FD5F9BE20E0DEBEA008E885B /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 049F3699130CD87F00FF080F /* PBXTargetDependency */, + ); + name = Accel; + productName = Accelerometer; + productReference = FD5F9BE40E0DEBEA008E885B /* Accel.app */; + productType = "com.apple.product-type.application"; + }; + FDB651F70E43D1F300F688B5 /* Keyboard */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDB652090E43D1F300F688B5 /* Build configuration list for PBXNativeTarget "Keyboard" */; + buildPhases = ( + FDB651F80E43D1F300F688B5 /* Resources */, + FDB651FC0E43D1F300F688B5 /* Sources */, + FDB651FF0E43D1F300F688B5 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 049F36A1130CD8A000FF080F /* PBXTargetDependency */, + ); + name = Keyboard; + productName = Accelerometer; + productReference = FDB6520C0E43D1F300F688B5 /* Keyboard.app */; + productType = "com.apple.product-type.application"; + }; + FDC202DD0E107B1200ABAC90 /* Touch */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDC202EB0E107B1200ABAC90 /* Build configuration list for PBXNativeTarget "Touch" */; + buildPhases = ( + FDC202DE0E107B1200ABAC90 /* Resources */, + FDC202E20E107B1200ABAC90 /* Sources */, + FDC202E40E107B1200ABAC90 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 049F369B130CD88800FF080F /* PBXTargetDependency */, + ); + name = Touch; + productName = Accelerometer; + productReference = FDC202EE0E107B1200ABAC90 /* Touch.app */; + productType = "com.apple.product-type.application"; + }; + FDC52EC60E2843D6008D768C /* Fireworks */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDC52EDB0E2843D6008D768C /* Build configuration list for PBXNativeTarget "Fireworks" */; + buildPhases = ( + FDC52EC70E2843D6008D768C /* Resources */, + FDC52ECE0E2843D6008D768C /* Sources */, + FDC52ED10E2843D6008D768C /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 049F369F130CD89800FF080F /* PBXTargetDependency */, + ); + name = Fireworks; + productName = Accelerometer; + productReference = FDC52EDE0E2843D6008D768C /* Fireworks.app */; + productType = "com.apple.product-type.application"; + }; + FDF0D6920E12D05400247964 /* Mixer */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDF0D6A10E12D05400247964 /* Build configuration list for PBXNativeTarget "Mixer" */; + buildPhases = ( + FDF0D6930E12D05400247964 /* Resources */, + FDF0D6980E12D05400247964 /* Sources */, + FDF0D69A0E12D05400247964 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 049F369D130CD89000FF080F /* PBXTargetDependency */, + ); + name = Mixer; + productName = Accelerometer; + productReference = FDF0D6A40E12D05400247964 /* Mixer.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Demos" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = FD1B48930E313154007AB34E /* Products */; + ProjectRef = FD1B48920E313154007AB34E /* SDL.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* Rectangles */, + FD15FCB10E086866003BDF25 /* Happy */, + FD5F9BE30E0DEBEA008E885B /* Accel */, + FDC202DD0E107B1200ABAC90 /* Touch */, + FDF0D6920E12D05400247964 /* Mixer */, + FDC52EC60E2843D6008D768C /* Fireworks */, + FDB651F70E43D1F300F688B5 /* Keyboard */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + FD1B489E0E313154007AB34E /* libSDL2.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libSDL2.a; + remoteRef = FD1B489D0E313154007AB34E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD925B1B0E0F276600E92347 /* Icon.png in Resources */, + FD787AA20E22A5CC003E8E36 /* Default.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FD15FCAE0E086866003BDF25 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB651D00E43D1AD00F688B5 /* icon.bmp in Resources */, + FD925B1A0E0F276600E92347 /* Icon.png in Resources */, + FD787AA10E22A5CC003E8E36 /* Default.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FD5F9BE00E0DEBEA008E885B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB651D20E43D1B500F688B5 /* space.bmp in Resources */, + FDB651D10E43D1B300F688B5 /* ship.bmp in Resources */, + FD925B190E0F276600E92347 /* Icon.png in Resources */, + FD787AA30E22A5CC003E8E36 /* Default.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDB651F80E43D1F300F688B5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB651F90E43D1F300F688B5 /* stroke.bmp in Resources */, + FDB651FA0E43D1F300F688B5 /* Icon.png in Resources */, + FDB651FB0E43D1F300F688B5 /* Default.png in Resources */, + FDB652C70E43E25900F688B5 /* kromasky_16x16.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC202DE0E107B1200ABAC90 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB651D30E43D1BA00F688B5 /* stroke.bmp in Resources */, + FDC202E10E107B1200ABAC90 /* Icon.png in Resources */, + FD787AA40E22A5CC003E8E36 /* Default.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC52EC70E2843D6008D768C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB651D80E43D1D800F688B5 /* stroke.bmp in Resources */, + FDC52EC80E2843D6008D768C /* Icon.png in Resources */, + FDC52EC90E2843D6008D768C /* Default.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDF0D6930E12D05400247964 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB651D40E43D1C500F688B5 /* ds_brush_snare.wav in Resources */, + FDB651D50E43D1C500F688B5 /* ds_china.wav in Resources */, + FDB651D60E43D1C500F688B5 /* ds_kick_big_amb.wav in Resources */, + FDB651D70E43D1C500F688B5 /* ds_loose_skin_mute.wav in Resources */, + FDF0D6960E12D05400247964 /* Icon.png in Resources */, + FD787AA50E22A5CC003E8E36 /* Default.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD77A0130E26BC0500F39101 /* common.c in Sources */, + FD77A0160E26BC0500F39101 /* rectangles.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FD15FCAF0E086866003BDF25 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDC214870E26D78A00DDED23 /* common.c in Sources */, + FD77A00E0E26BC0500F39101 /* happy.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FD5F9BE10E0DEBEA008E885B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD77A0190E26BC0500F39101 /* common.c in Sources */, + FD77A02A0E26BC2700F39101 /* accelerometer.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDB651FC0E43D1F300F688B5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDB651FD0E43D1F300F688B5 /* common.c in Sources */, + FDB652120E43D21A00F688B5 /* keyboard.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC202E20E107B1200ABAC90 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD77A01F0E26BC0500F39101 /* common.c in Sources */, + FD77A0230E26BC0500F39101 /* touch.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC52ECE0E2843D6008D768C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDC52ECF0E2843D6008D768C /* common.c in Sources */, + FDC52EE50E284410008D768C /* fireworks.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDF0D6980E12D05400247964 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD77A0250E26BC0500F39101 /* common.c in Sources */, + FD77A0270E26BC0500F39101 /* mixer.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 049F3695130CD86800FF080F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 049F3694130CD86800FF080F /* PBXContainerItemProxy */; + }; + 049F3697130CD87600FF080F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 049F3696130CD87600FF080F /* PBXContainerItemProxy */; + }; + 049F3699130CD87F00FF080F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 049F3698130CD87F00FF080F /* PBXContainerItemProxy */; + }; + 049F369B130CD88800FF080F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 049F369A130CD88800FF080F /* PBXContainerItemProxy */; + }; + 049F369D130CD89000FF080F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 049F369C130CD89000FF080F /* PBXContainerItemProxy */; + }; + 049F369F130CD89800FF080F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 049F369E130CD89800FF080F /* PBXContainerItemProxy */; + }; + 049F36A1130CD8A000FF080F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 049F36A0130CD8A000FF080F /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Rectangles; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Rectangles; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + armv6, + armv7, + ); + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ../../include; + IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + PRELINK_LIBS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + armv6, + armv7, + ); + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + HEADER_SEARCH_PATHS = ../../include; + IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + PRELINK_LIBS = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + FD15FCB50E086866003BDF25 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_DYNAMIC_NO_PIC = NO; + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Happy; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FD15FCB60E086866003BDF25 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Happy; + SDKROOT = iphoneos; + }; + name = Release; + }; + FD5F9BE70E0DEBEB008E885B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Accel; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FD5F9BE80E0DEBEB008E885B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Accel; + SDKROOT = iphoneos; + }; + name = Release; + }; + FDB6520A0E43D1F300F688B5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Keyboard; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FDB6520B0E43D1F300F688B5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Keyboard; + SDKROOT = iphoneos; + }; + name = Release; + }; + FDC202EC0E107B1200ABAC90 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Touch; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FDC202ED0E107B1200ABAC90 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Touch; + SDKROOT = iphoneos; + }; + name = Release; + }; + FDC52EDC0E2843D6008D768C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Fireworks; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FDC52EDD0E2843D6008D768C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Fireworks; + SDKROOT = iphoneos; + }; + name = Release; + }; + FDF0D6A20E12D05400247964 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Mixer; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FDF0D6A30E12D05400247964 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = Mixer; + SDKROOT = iphoneos; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Rectangles" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Demos" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FD15FCB70E086867003BDF25 /* Build configuration list for PBXNativeTarget "Happy" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FD15FCB50E086866003BDF25 /* Debug */, + FD15FCB60E086866003BDF25 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FD5F9BE90E0DEBEB008E885B /* Build configuration list for PBXNativeTarget "Accel" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FD5F9BE70E0DEBEB008E885B /* Debug */, + FD5F9BE80E0DEBEB008E885B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDB652090E43D1F300F688B5 /* Build configuration list for PBXNativeTarget "Keyboard" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDB6520A0E43D1F300F688B5 /* Debug */, + FDB6520B0E43D1F300F688B5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDC202EB0E107B1200ABAC90 /* Build configuration list for PBXNativeTarget "Touch" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDC202EC0E107B1200ABAC90 /* Debug */, + FDC202ED0E107B1200ABAC90 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDC52EDB0E2843D6008D768C /* Build configuration list for PBXNativeTarget "Fireworks" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDC52EDC0E2843D6008D768C /* Debug */, + FDC52EDD0E2843D6008D768C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDF0D6A10E12D05400247964 /* Build configuration list for PBXNativeTarget "Mixer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDF0D6A20E12D05400247964 /* Debug */, + FDF0D6A30E12D05400247964 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Xcode-iOS/Demos/Icon.png b/Xcode-iOS/Demos/Icon.png new file mode 100644 index 0000000000..83f4d10a21 Binary files /dev/null and b/Xcode-iOS/Demos/Icon.png differ diff --git a/Xcode-iOS/Demos/Info.plist b/Xcode-iOS/Demos/Info.plist new file mode 100644 index 0000000000..0398f008b8 --- /dev/null +++ b/Xcode-iOS/Demos/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + + UISupportedInterfaceOrientations + + + diff --git a/Xcode-iOS/Demos/README b/Xcode-iOS/Demos/README new file mode 100644 index 0000000000..55f8066d66 --- /dev/null +++ b/Xcode-iOS/Demos/README @@ -0,0 +1,43 @@ +============================================================================== +About the iPhone OS Demo Applications +============================================================================== + +Demos.xcodeproj contains several targets for iPhone oriented SDL demos. These demos are written strictly using SDL 1.3 calls. All the demos except for Fireworks (which requires OpenGL ES) should work on platforms other than iPhone OS, though you'll need to write your own compile script. To run them on your favorite platform, you may wish to set the macros SCREEN_WIDTH and SCREEN_HEIGHT, located in common.h. + +Common files: + + common.c and common.h contain code common to all demo applications. This includes macros about the screen dimensions (in pixels), simple error handling, and functions for generating random numbers. + +Rectangles (rectangles.c): + + Draws randomly sized and colored rectangles all over the screen by using SDL_RenderFill. This is the simplest of all the demos. + +Happy (happy.c): + + Loads the classic happy-face bitmap and draws a large number of happy faces bouncing around the screen. Shows how you can load a bitmap into an SDL_Texture. + +Accelerometer (accelerometer.c): + + Uses the iPhone's accelerometer as a joystick device to move a spaceship around the screen. Note the use of the macro SDL_IPHONE_MAX_GFORCE (normally defined in SDL_config_iphoneos.h) which converts between the Sint16 number returned by SDL_JoystickGetAxis, and the floating point units of g-force reported natively by the iPhone. + +Touch (touch.c): + + Acts as a finger-paint type program. Demonstrates how you can use SDL mouse input to accept touch input from the iPhone. If SDL for iPhone is compiled with multitouch as multiple mouse emulation (SDL_IPHONE_MULTIPLE_MICE in SDL_config_iphoneos.h) then the program will accept multiple finger inputs simultaneously. + +Mixer (mixer.c): + + Displays several rectangular buttons which can be used as a virtual drumkit. Demonstrates how you can play .wav sounds in SDL and how you can use SDL_MixAudioFormat to build a software mixer that can play multiple sounds at once. + +Keyboard (keyboard.c): + + Loads a bitmap font and let's the user type words, numbers, and symbols using the iPhone's virtual keyboard. The iPhone's onscreen keyboard visibility is toggled when the user taps the screen. If the user types ':)' a happy face is displayed. Demonstrates how to use functions added to the iPhone implementation of SDL to toggle keyboard onscreen visibility. + +Fireworks (fireworks.c): + + Displays a fireworks show. When you tap the iPhone's screen, fireworks fly from the bottom of the screen and explode at the point that you tapped. Demonstrates how you can use SDL on iPhone to build an OpenGL ES based application. Shows you how you can use SDL_LoadBMP to load a bmp image and convert it to an OpenGL ES texture. Of lesser importance, shows how you can use OpenGL ES point sprites to build an efficient particle system. + +============================================================================== +Building and Running the demos +============================================================================== + +Before building the demos you must first build SDL as a static library for BOTH the iPhone Simulator and the iPhone itself. See the iPhone SDL main README file for directions on how to do this. Once this is done, simply launch XCode, select the target you'd like to build, select the active SDK (simulator or device), and then build and go. diff --git a/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp b/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp new file mode 100644 index 0000000000..c0b6fb964f Binary files /dev/null and b/Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp differ diff --git a/Xcode-iOS/Demos/data/bitmapfont/license.txt b/Xcode-iOS/Demos/data/bitmapfont/license.txt new file mode 100755 index 0000000000..6949ec444b --- /dev/null +++ b/Xcode-iOS/Demos/data/bitmapfont/license.txt @@ -0,0 +1,258 @@ + __ _ _ + / _| | | | | +| |_ ___ _ __ | |_ _ __ __ _ ___| | __ +| _/ _ \| '_ \| __| '_ \ / _` |/ __| |/ / +| || (_) | | | | |_| |_) | (_| | (__| < +|_| \___/|_| |_|\__| .__/ \__,_|\___|_|\_\ + | | + |_| +---------------------------------------------------------------------- +Product : font-pack.zip +Website : http://www.spicypixel.net +Author : Marc Russell +Released: 16th January 2008 +---------------------------------------------------------------------- + +What is this? +------------- +font-pack is a package of free art assets to be used under the terms of this document. It is available to game developers and hobbyists alike. + +Contents +-------- +The contents of the font-pack ZIP file include 20 bitmap fonts + +Usage License & Restrictions +---------------------------- +font-pack is distributed under the "Common Public License Version 1.0." +The terms of which are given below. If you do not understand the terms of the license please refer to a solicitor. It should however, be relatively clear how this package can be used. + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF +THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate from + and are distributed by that particular Contributor. A Contribution + 'originates' from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's + behalf. Contributions do not include additions to the Program which: + (i) are separate modules of software distributed in conjunction with + the Program under their own license agreement, and (ii) are not + derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which +are necessarily infringed by the use or sale of its Contribution alone +or when combined with the Program. + +"Program" means the Contributions distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare derivative works of, publicly display, + publicly perform, distribute and sublicense the Contribution of such + Contributor, if any, and such derivative works, in source code and + object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in source code and object code form. This patent license + shall apply to the combination of the Contribution and the Program + if, at the time the Contribution is added by the Contributor, such + addition of the Contribution causes such combination to be covered + by the Licensed Patents. The patent license shall not apply to any + other combinations which include the Contribution. No hardware per + se is licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby assumes + sole responsibility to secure any other intellectual property rights + needed, if any. For example, if a third party patent license is + required to allow Recipient to distribute the Program, it is + Recipient's responsibility to acquire that license before + distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form +under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all + warranties and conditions, express and implied, including warranties + or conditions of title and non-infringement, and implied warranties + or conditions of merchantability and fitness for a particular + purpose; + + ii) effectively excludes on behalf of all Contributors all liability + for damages, including direct, indirect, special, incidental and + consequential damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are + offered by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable + manner on or through a medium customarily used for software + exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the + Program. + +Contributors may not remove or alter any copyright notices contained +within the Program. + +Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities +with respect to end users, business partners and the like. While this +license is intended to facilitate the commercial use of the Program, the +Contributor who includes the Program in a commercial product offering +should do so in a manner which does not create potential liability for +other Contributors. Therefore, if a Contributor includes the Program in +a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such +Commercial Contributor in connection with its distribution of the +Program in a commercial product offering. The obligations in this +section do not apply to any claims or Losses relating to any actual or +alleged intellectual property infringement. In order to qualify, an +Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial +Contributor to control, and cooperate with the Commercial Contributor +in, the defense and any related settlement negotiations. The Indemnified +Contributor may participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those +performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor +must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED +ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES +OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR +A PARTICULAR PURPOSE. Each Recipient is solely responsible for +determining the appropriateness of using and distributing the Program +and assumes all risks associated with its exercise of rights under this +Agreement, including but not limited to the risks and costs of program +errors, compliance with applicable laws, damage to or loss of data, +programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR +ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR +DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further action +by the parties hereto, such provision shall be reformed to the minimum +extent necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with +respect to a patent applicable to software (including a cross-claim or +counterclaim in a lawsuit), then any patent licenses granted by that +Contributor to such Recipient under this Agreement shall terminate as of +the date such litigation is filed. In addition, if Recipient institutes +patent litigation against any entity (including a cross-claim or +counterclaim in a lawsuit) alleging that the Program itself (excluding +combinations of the Program with other software or hardware) infringes +such Recipient's patent(s), then such Recipient's rights granted under +Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails +to comply with any of the material terms or conditions of this Agreement +and does not cure such failure in a reasonable period of time after +becoming aware of such noncompliance. If all Recipient's rights under +this Agreement terminate, Recipient agrees to cease use and distribution +of the Program as soon as reasonably practicable. However, Recipient's +obligations under this Agreement and any licenses granted by Recipient +relating to the Program shall continue and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, +but in order to avoid inconsistency the Agreement is copyrighted and may +only be modified in the following manner. The Agreement Steward reserves +the right to publish new versions (including revisions) of this +Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. IBM is the initial Agreement +Steward. IBM may assign the responsibility to serve as the Agreement +Steward to a suitable separate entity. Each new version of the Agreement +will be given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version +of the Agreement is published, Contributor may elect to distribute the +Program (including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives no +rights or licenses to the intellectual property of any Contributor under +this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this +Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to +this Agreement will bring a legal action under this Agreement more than +one year after the cause of action arose. Each party waives its rights +to a jury trial in any resulting litigation. + diff --git a/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav b/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav new file mode 100644 index 0000000000..fa752637a0 Binary files /dev/null and b/Xcode-iOS/Demos/data/drums/ds_brush_snare.wav differ diff --git a/Xcode-iOS/Demos/data/drums/ds_china.wav b/Xcode-iOS/Demos/data/drums/ds_china.wav new file mode 100644 index 0000000000..21a71a1b1e Binary files /dev/null and b/Xcode-iOS/Demos/data/drums/ds_china.wav differ diff --git a/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav b/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav new file mode 100644 index 0000000000..404115a18d Binary files /dev/null and b/Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav differ diff --git a/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav b/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav new file mode 100644 index 0000000000..3db05222b5 Binary files /dev/null and b/Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav differ diff --git a/Xcode-iOS/Demos/data/icon.bmp b/Xcode-iOS/Demos/data/icon.bmp new file mode 100644 index 0000000000..cc96356acb Binary files /dev/null and b/Xcode-iOS/Demos/data/icon.bmp differ diff --git a/Xcode-iOS/Demos/data/ship.bmp b/Xcode-iOS/Demos/data/ship.bmp new file mode 100644 index 0000000000..b682dc49d3 Binary files /dev/null and b/Xcode-iOS/Demos/data/ship.bmp differ diff --git a/Xcode-iOS/Demos/data/space.bmp b/Xcode-iOS/Demos/data/space.bmp new file mode 100644 index 0000000000..5bcf273a83 Binary files /dev/null and b/Xcode-iOS/Demos/data/space.bmp differ diff --git a/Xcode-iOS/Demos/data/stroke.bmp b/Xcode-iOS/Demos/data/stroke.bmp new file mode 100644 index 0000000000..d59fed4590 Binary files /dev/null and b/Xcode-iOS/Demos/data/stroke.bmp differ diff --git a/Xcode-iOS/Demos/src/accelerometer.c b/Xcode-iOS/Demos/src/accelerometer.c new file mode 100644 index 0000000000..115de627f5 --- /dev/null +++ b/Xcode-iOS/Demos/src/accelerometer.c @@ -0,0 +1,236 @@ +/* + * accelerometer.c + * written by Holmes Futrell + * use however you want + */ + +#include "SDL.h" +#include "math.h" +#include "common.h" + +#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */ +#define DAMPING 0.5f; /* after bouncing off a wall, damping coefficient determines final speed */ +#define FRICTION 0.0008f /* coefficient of acceleration that opposes direction of motion */ +#define GRAVITY_CONSTANT 0.004f /* how sensitive the ship is to the accelerometer */ + +/* If we aren't on an iPhone, then this definition ought to yield reasonable behavior */ +#ifndef SDL_IPHONE_MAX_GFORCE +#define SDL_IPHONE_MAX_GFORCE 5.0f +#endif + +static SDL_Joystick *accelerometer; /* used for controlling the ship */ + +static struct +{ + float x, y; /* position of ship */ + float vx, vy; /* velocity of ship (in pixels per millesecond) */ + SDL_Rect rect; /* (drawn) position and size of ship */ +} shipData; + +static SDL_Texture *ship = 0; /* texture for spaceship */ +static SDL_Texture *space = 0; /* texture for space (background */ + +void +render(SDL_Renderer *renderer) +{ + + + /* get joystick (accelerometer) axis values and normalize them */ + float ax = SDL_JoystickGetAxis(accelerometer, 0); + float ay = -SDL_JoystickGetAxis(accelerometer, 1); + + /* ship screen constraints */ + Uint32 minx = 0.0f; + Uint32 maxx = SCREEN_WIDTH - shipData.rect.w; + Uint32 miny = 0.0f; + Uint32 maxy = SCREEN_HEIGHT - shipData.rect.h; + +#define SINT16_MAX ((float)(0x7FFF)) + + /* update velocity from accelerometer + the factor SDL_IPHONE_MAX_G_FORCE / SINT16_MAX converts between + SDL's units reported from the joytick, and units of g-force, as reported by the accelerometer + */ + shipData.vx += + ax * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT * + MILLESECONDS_PER_FRAME; + shipData.vy += + ay * SDL_IPHONE_MAX_GFORCE / SINT16_MAX * GRAVITY_CONSTANT * + MILLESECONDS_PER_FRAME; + + float speed = sqrt(shipData.vx * shipData.vx + shipData.vy * shipData.vy); + + if (speed > 0) { + /* compensate for friction */ + float dirx = shipData.vx / speed; /* normalized x velocity */ + float diry = shipData.vy / speed; /* normalized y velocity */ + + /* update velocity due to friction */ + if (speed - FRICTION * MILLESECONDS_PER_FRAME > 0) { + /* apply friction */ + shipData.vx -= dirx * FRICTION * MILLESECONDS_PER_FRAME; + shipData.vy -= diry * FRICTION * MILLESECONDS_PER_FRAME; + } else { + /* applying friction would MORE than stop the ship, so just stop the ship */ + shipData.vx = 0.0f; + shipData.vy = 0.0f; + } + } + + /* update ship location */ + shipData.x += shipData.vx * MILLESECONDS_PER_FRAME; + shipData.y += shipData.vy * MILLESECONDS_PER_FRAME; + + if (shipData.x > maxx) { + shipData.x = maxx; + shipData.vx = -shipData.vx * DAMPING; + } else if (shipData.x < minx) { + shipData.x = minx; + shipData.vx = -shipData.vx * DAMPING; + } + if (shipData.y > maxy) { + shipData.y = maxy; + shipData.vy = -shipData.vy * DAMPING; + } else if (shipData.y < miny) { + shipData.y = miny; + shipData.vy = -shipData.vy * DAMPING; + } + + /* draw the background */ + SDL_RenderCopy(renderer, space, NULL, NULL); + + /* draw the ship */ + shipData.rect.x = shipData.x; + shipData.rect.y = shipData.y; + + SDL_RenderCopy(renderer, ship, NULL, &shipData.rect); + + /* update screen */ + SDL_RenderPresent(renderer); + +} + +void +initializeTextures(SDL_Renderer *renderer) +{ + + SDL_Surface *bmp_surface; + + /* load the ship */ + bmp_surface = SDL_LoadBMP("ship.bmp"); + if (bmp_surface == NULL) { + fatalError("could not ship.bmp"); + } + /* set blue to transparent on the ship */ + SDL_SetColorKey(bmp_surface, 1, + SDL_MapRGB(bmp_surface->format, 0, 0, 255)); + + /* create ship texture from surface */ + ship = SDL_CreateTextureFromSurface(renderer, bmp_surface); + if (ship == 0) { + fatalError("could not create ship texture"); + } + SDL_SetTextureBlendMode(ship, SDL_BLENDMODE_BLEND); + + /* set the width and height of the ship from the surface dimensions */ + shipData.rect.w = bmp_surface->w; + shipData.rect.h = bmp_surface->h; + + SDL_FreeSurface(bmp_surface); + + /* load the space background */ + bmp_surface = SDL_LoadBMP("space.bmp"); + if (bmp_surface == NULL) { + fatalError("could not load space.bmp"); + } + /* create space texture from surface */ + space = SDL_CreateTextureFromSurface(renderer, bmp_surface); + if (space == 0) { + fatalError("could not create space texture"); + } + SDL_FreeSurface(bmp_surface); + +} + + + +int +main(int argc, char *argv[]) +{ + + SDL_Window *window; /* main window */ + SDL_Renderer *renderer; + Uint32 startFrame; /* time frame began to process */ + Uint32 endFrame; /* time frame ended processing */ + Uint32 delay; /* time to pause waiting to draw next frame */ + int done; /* should we clean up and exit? */ + + /* initialize SDL */ + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 0) { + fatalError("Could not initialize SDL"); + } + + /* create main window and renderer */ + window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, + SDL_WINDOW_OPENGL | + SDL_WINDOW_BORDERLESS); + renderer = SDL_CreateRenderer(window, 0, 0); + + /* print out some info about joysticks and try to open accelerometer for use */ + printf("There are %d joysticks available\n", SDL_NumJoysticks()); + printf("Default joystick (index 0) is %s\n", SDL_JoystickName(0)); + accelerometer = SDL_JoystickOpen(0); + if (accelerometer == NULL) { + fatalError("Could not open joystick (accelerometer)"); + } + printf("joystick number of axis = %d\n", + SDL_JoystickNumAxes(accelerometer)); + printf("joystick number of hats = %d\n", + SDL_JoystickNumHats(accelerometer)); + printf("joystick number of balls = %d\n", + SDL_JoystickNumBalls(accelerometer)); + printf("joystick number of buttons = %d\n", + SDL_JoystickNumButtons(accelerometer)); + + /* load graphics */ + initializeTextures(renderer); + + /* setup ship */ + shipData.x = (SCREEN_WIDTH - shipData.rect.w) / 2; + shipData.y = (SCREEN_HEIGHT - shipData.rect.h) / 2; + shipData.vx = 0.0f; + shipData.vy = 0.0f; + + done = 0; + /* enter main loop */ + while (!done) { + startFrame = SDL_GetTicks(); + SDL_Event event; + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT) { + done = 1; + } + } + render(renderer); + endFrame = SDL_GetTicks(); + + /* figure out how much time we have left, and then sleep */ + delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame); + if (delay < 0) { + delay = 0; + } else if (delay > MILLESECONDS_PER_FRAME) { + delay = MILLESECONDS_PER_FRAME; + } + SDL_Delay(delay); + } + + /* delete textures */ + SDL_DestroyTexture(ship); + SDL_DestroyTexture(space); + + /* shutdown SDL */ + SDL_Quit(); + + return 0; + +} diff --git a/Xcode-iOS/Demos/src/common.c b/Xcode-iOS/Demos/src/common.c new file mode 100644 index 0000000000..b2d9634566 --- /dev/null +++ b/Xcode-iOS/Demos/src/common.c @@ -0,0 +1,36 @@ +/* + * common.c + * written by Holmes Futrell + * use however you want + */ + +#include "common.h" +#include "SDL.h" +#include + +/* + Produces a random int x, min <= x <= max + following a uniform distribution +*/ +int +randomInt(int min, int max) +{ + return min + rand() % (max - min + 1); +} + +/* + Produces a random float x, min <= x <= max + following a uniform distribution + */ +float +randomFloat(float min, float max) +{ + return rand() / (float) RAND_MAX *(max - min) + min; +} + +void +fatalError(const char *string) +{ + printf("%s: %s\n", string, SDL_GetError()); + exit(1); +} diff --git a/Xcode-iOS/Demos/src/common.h b/Xcode-iOS/Demos/src/common.h new file mode 100644 index 0000000000..3e0d94ecf2 --- /dev/null +++ b/Xcode-iOS/Demos/src/common.h @@ -0,0 +1,12 @@ +/* + * common.h + * written by Holmes Futrell + * use however you want + */ + +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 480 + +extern int randomInt(int min, int max); +extern float randomFloat(float min, float max); +extern void fatalError(const char *string); diff --git a/Xcode-iOS/Demos/src/fireworks.c b/Xcode-iOS/Demos/src/fireworks.c new file mode 100644 index 0000000000..b2a4d095dc --- /dev/null +++ b/Xcode-iOS/Demos/src/fireworks.c @@ -0,0 +1,475 @@ +/* + * fireworks.c + * written by Holmes Futrell + * use however you want + */ + +#include "SDL.h" +#include "SDL_opengles.h" +#include "common.h" +#include +#include + +#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */ +#define ACCEL 0.0001f /* acceleration due to gravity, units in pixels per millesecond squared */ +#define WIND_RESISTANCE 0.00005f /* acceleration per unit velocity due to wind resistance */ +#define MAX_PARTICLES 2000 /* maximum number of particles displayed at once */ + +static GLuint particleTextureID; /* OpenGL particle texture id */ +static SDL_bool pointSizeExtensionSupported; /* is GL_OES_point_size_array supported ? */ +/* + used to describe what type of particle a given struct particle is. + emitter - this particle flies up, shooting off trail particles, then finally explodes into dust particles. + trail - shoots off, following emitter particle + dust - radiates outwards from emitter explosion +*/ +enum particleType +{ + emitter = 0, + trail, + dust +}; +/* + struct particle is used to describe each particle displayed on screen +*/ +struct particle +{ + GLfloat x; /* x position of particle */ + GLfloat y; /* y position of particle */ + GLubyte color[4]; /* rgba color of particle */ + GLfloat size; /* size of particle in pixels */ + GLfloat xvel; /* x velocity of particle in pixels per milesecond */ + GLfloat yvel; /* y velocity of particle in pixels per millescond */ + int isActive; /* if not active, then particle is overwritten */ + enum particleType type; /* see enum particleType */ +} particles[MAX_PARTICLES]; /* this array holds all our particles */ + +static int num_active_particles; /* how many members of the particle array are actually being drawn / animated? */ +static int screen_w, screen_h; + +/* function declarations */ +void spawnTrailFromEmitter(struct particle *emitter); +void spawnEmitterParticle(GLfloat x, GLfloat y); +void explodeEmitter(struct particle *emitter); +void initializeParticles(void); +void initializeTexture(); +int nextPowerOfTwo(int x); +void drawParticles(); +void stepParticles(void); + +/* helper function (used in texture loading) + returns next power of two greater than or equal to x +*/ +int +nextPowerOfTwo(int x) +{ + int val = 1; + while (val < x) { + val *= 2; + } + return val; +} + +/* + steps each active particle by timestep MILLESECONDS_PER_FRAME +*/ +void +stepParticles(void) +{ + int i; + struct particle *slot = particles; + struct particle *curr = particles; + for (i = 0; i < num_active_particles; i++) { + /* is the particle actually active, or is it marked for deletion? */ + if (curr->isActive) { + /* is the particle off the screen? */ + if (curr->y > screen_h) + curr->isActive = 0; + else if (curr->y < 0) + curr->isActive = 0; + if (curr->x > screen_w) + curr->isActive = 0; + else if (curr->x < 0) + curr->isActive = 0; + + /* step velocity, then step position */ + curr->yvel += ACCEL * MILLESECONDS_PER_FRAME; + curr->xvel += 0.0f; + curr->y += curr->yvel * MILLESECONDS_PER_FRAME; + curr->x += curr->xvel * MILLESECONDS_PER_FRAME; + + /* particle behavior */ + if (curr->type == emitter) { + /* if we're an emitter, spawn a trail */ + spawnTrailFromEmitter(curr); + /* if we've reached our peak, explode */ + if (curr->yvel > 0.0) { + explodeEmitter(curr); + } + } else { + float speed = + sqrt(curr->xvel * curr->xvel + curr->yvel * curr->yvel); + /* if wind resistance is not powerful enough to stop us completely, + then apply winde resistance, otherwise just stop us completely */ + if (WIND_RESISTANCE * MILLESECONDS_PER_FRAME < speed) { + float normx = curr->xvel / speed; + float normy = curr->yvel / speed; + curr->xvel -= + normx * WIND_RESISTANCE * MILLESECONDS_PER_FRAME; + curr->yvel -= + normy * WIND_RESISTANCE * MILLESECONDS_PER_FRAME; + } else { + curr->xvel = curr->yvel = 0; /* stop particle */ + } + + if (curr->color[3] <= MILLESECONDS_PER_FRAME * 0.1275f) { + /* if this next step will cause us to fade out completely + then just mark for deletion */ + curr->isActive = 0; + } else { + /* otherwise, let's fade a bit more */ + curr->color[3] -= MILLESECONDS_PER_FRAME * 0.1275f; + } + + /* if we're a dust particle, shrink our size */ + if (curr->type == dust) + curr->size -= MILLESECONDS_PER_FRAME * 0.010f; + + } + + /* if we're still active, pack ourselves in the array next + to the last active guy (pack the array tightly) */ + if (curr->isActive) + *(slot++) = *curr; + } /* endif (curr->isActive) */ + curr++; + } + /* the number of active particles is computed as the difference between + old number of active particles, where slot points, and the + new size of the array, where particles points */ + num_active_particles = slot - particles; +} + +/* + This draws all the particles shown on screen +*/ +void +drawParticles() +{ + + /* draw the background */ + glClear(GL_COLOR_BUFFER_BIT); + + /* set up the position and color pointers */ + glVertexPointer(2, GL_FLOAT, sizeof(struct particle), particles); + glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(struct particle), + particles[0].color); + + if (pointSizeExtensionSupported) { + /* pass in our array of point sizes */ + glPointSizePointerOES(GL_FLOAT, sizeof(struct particle), + &(particles[0].size)); + } + + /* draw our particles! */ + glDrawArrays(GL_POINTS, 0, num_active_particles); + +} + +/* + This causes an emitter to explode in a circular bloom of dust particles +*/ +void +explodeEmitter(struct particle *emitter) +{ + /* first off, we're done with this particle, so turn active off */ + emitter->isActive = 0; + int i; + for (i = 0; i < 200; i++) { + + if (num_active_particles >= MAX_PARTICLES) + return; + + /* come up with a random angle and speed for new particle */ + float theta = randomFloat(0, 2.0f * 3.141592); + float exponent = 3.0f; + float speed = randomFloat(0.00, powf(0.17, exponent)); + speed = powf(speed, 1.0f / exponent); + + /*select the particle at the end of our array */ + struct particle *p = &particles[num_active_particles]; + + /* set the particles properties */ + p->xvel = speed * cos(theta); + p->yvel = speed * sin(theta); + p->x = emitter->x + emitter->xvel; + p->y = emitter->y + emitter->yvel; + p->isActive = 1; + p->type = dust; + p->size = 15; + /* inherit emitter's color */ + p->color[0] = emitter->color[0]; + p->color[1] = emitter->color[1]; + p->color[2] = emitter->color[2]; + p->color[3] = 255; + /* our array has expanded at the end */ + num_active_particles++; + } + +} + +/* + This spawns a trail particle from an emitter +*/ +void +spawnTrailFromEmitter(struct particle *emitter) +{ + + if (num_active_particles >= MAX_PARTICLES) + return; + + /* select the particle at the slot at the end of our array */ + struct particle *p = &particles[num_active_particles]; + + /* set position and velocity to roughly that of the emitter */ + p->x = emitter->x + randomFloat(-3.0, 3.0); + p->y = emitter->y + emitter->size / 2.0f; + p->xvel = emitter->xvel + randomFloat(-0.005, 0.005); + p->yvel = emitter->yvel + 0.1; + + /* set the color to a random-ish orangy type color */ + p->color[0] = (0.8f + randomFloat(-0.1, 0.0)) * 255; + p->color[1] = (0.4f + randomFloat(-0.1, 0.1)) * 255; + p->color[2] = (0.0f + randomFloat(0.0, 0.2)) * 255; + p->color[3] = (0.7f) * 255; + + /* set other attributes */ + p->size = 10; + p->type = trail; + p->isActive = 1; + + /* our array has expanded at the end */ + num_active_particles++; + +} + +/* + spawns a new emitter particle at the bottom of the screen + destined for the point (x,y). +*/ +void +spawnEmitterParticle(GLfloat x, GLfloat y) +{ + + if (num_active_particles >= MAX_PARTICLES) + return; + + /* find particle at endpoint of array */ + struct particle *p = &particles[num_active_particles]; + + /* set the color randomly */ + switch (rand() % 4) { + case 0: + p->color[0] = 255; + p->color[1] = 100; + p->color[2] = 100; + break; + case 1: + p->color[0] = 100; + p->color[1] = 255; + p->color[2] = 100; + break; + case 2: + p->color[0] = 100; + p->color[1] = 100; + p->color[2] = 255; + break; + case 3: + p->color[0] = 255; + p->color[1] = 150; + p->color[2] = 50; + break; + } + p->color[3] = 255; + /* set position to (x, screen_h) */ + p->x = x; + p->y = screen_h; + /* set velocity so that terminal point is (x,y) */ + p->xvel = 0; + p->yvel = -sqrt(2 * ACCEL * (screen_h - y)); + /* set other attributes */ + p->size = 10; + p->type = emitter; + p->isActive = 1; + /* our array has expanded at the end */ + num_active_particles++; +} + +/* just sets the endpoint of the particle array to element zero */ +void +initializeParticles(void) +{ + num_active_particles = 0; +} + +/* + loads the particle texture + */ +void +initializeTexture() +{ + + int bpp; /* texture bits per pixel */ + Uint32 Rmask, Gmask, Bmask, Amask; /* masks for pixel format passed into OpenGL */ + SDL_Surface *bmp_surface; /* the bmp is loaded here */ + SDL_Surface *bmp_surface_rgba8888; /* this serves as a destination to convert the BMP + to format passed into OpenGL */ + + bmp_surface = SDL_LoadBMP("stroke.bmp"); + if (bmp_surface == NULL) { + fatalError("could not load stroke.bmp"); + } + + /* Grab info about format that will be passed into OpenGL */ + SDL_PixelFormatEnumToMasks(SDL_PIXELFORMAT_ABGR8888, &bpp, &Rmask, &Gmask, + &Bmask, &Amask); + /* Create surface that will hold pixels passed into OpenGL */ + bmp_surface_rgba8888 = + SDL_CreateRGBSurface(0, bmp_surface->w, bmp_surface->h, bpp, Rmask, + Gmask, Bmask, Amask); + /* Blit to this surface, effectively converting the format */ + SDL_BlitSurface(bmp_surface, NULL, bmp_surface_rgba8888, NULL); + + glGenTextures(1, &particleTextureID); + glBindTexture(GL_TEXTURE_2D, particleTextureID); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, + nextPowerOfTwo(bmp_surface->w), + nextPowerOfTwo(bmp_surface->h), + 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + /* this is where we actually pass in the pixel data */ + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bmp_surface->w, bmp_surface->h, 0, + GL_RGBA, GL_UNSIGNED_BYTE, bmp_surface_rgba8888->pixels); + + /* free bmp surface and converted bmp surface */ + SDL_FreeSurface(bmp_surface); + SDL_FreeSurface(bmp_surface_rgba8888); + +} + +int +main(int argc, char *argv[]) +{ + SDL_Window *window; /* main window */ + SDL_GLContext context; + int w, h; + Uint32 startFrame; /* time frame began to process */ + Uint32 endFrame; /* time frame ended processing */ + Uint32 delay; /* time to pause waiting to draw next frame */ + int done; /* should we clean up and exit? */ + + /* initialize SDL */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + fatalError("Could not initialize SDL"); + } + /* seed the random number generator */ + srand(time(NULL)); + /* + request some OpenGL parameters + that may speed drawing + */ + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); + SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 0); + SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); + + /* create main window and renderer */ + window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, + SDL_WINDOW_OPENGL | + SDL_WINDOW_BORDERLESS); + context = SDL_GL_CreateContext(window); + + /* load the particle texture */ + initializeTexture(); + + /* check if GL_POINT_SIZE_ARRAY_OES is supported + this is used to give each particle its own size + */ + pointSizeExtensionSupported = + SDL_GL_ExtensionSupported("GL_OES_point_size_array"); + + /* set up some OpenGL state */ + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + SDL_GetWindowSize(window, &screen_w, &screen_h); + glViewport(0, 0, screen_w, screen_h); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrthof((GLfloat) 0, + (GLfloat) screen_w, + (GLfloat) screen_h, + (GLfloat) 0, 0.0, 1.0); + + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + glEnable(GL_POINT_SPRITE_OES); + glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, 1); + + if (pointSizeExtensionSupported) { + /* we use this to set the sizes of all the particles */ + glEnableClientState(GL_POINT_SIZE_ARRAY_OES); + } else { + /* if extension not available then all particles have size 10 */ + glPointSize(10); + } + + done = 0; + /* enter main loop */ + while (!done) { + startFrame = SDL_GetTicks(); + SDL_Event event; + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT) { + done = 1; + } + if (event.type == SDL_MOUSEBUTTONDOWN) { + int x, y; + SDL_GetMouseState(&x, &y); + spawnEmitterParticle(x, y); + } + } + stepParticles(); + drawParticles(); + SDL_GL_SwapWindow(window); + endFrame = SDL_GetTicks(); + + /* figure out how much time we have left, and then sleep */ + delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame); + if (delay > MILLESECONDS_PER_FRAME) { + delay = MILLESECONDS_PER_FRAME; + } + if (delay > 0) { + SDL_Delay(delay); + } + } + + /* delete textures */ + glDeleteTextures(1, &particleTextureID); + /* shutdown SDL */ + SDL_Quit(); + + return 0; +} diff --git a/Xcode-iOS/Demos/src/happy.c b/Xcode-iOS/Demos/src/happy.c new file mode 100644 index 0000000000..ce661d9587 --- /dev/null +++ b/Xcode-iOS/Demos/src/happy.c @@ -0,0 +1,177 @@ +/* + * happy.c + * written by Holmes Futrell + * use however you want + */ + +#include "SDL.h" +#include "common.h" + +#define NUM_HAPPY_FACES 100 /* number of faces to draw */ +#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */ +#define HAPPY_FACE_SIZE 32 /* width and height of happyface (pixels) */ + +static SDL_Texture *texture = 0; /* reference to texture holding happyface */ + +static struct +{ + float x, y; /* position of happyface */ + float xvel, yvel; /* velocity of happyface */ +} faces[NUM_HAPPY_FACES]; + +/* + Sets initial positions and velocities of happyfaces + units of velocity are pixels per millesecond +*/ +void +initializeHappyFaces() +{ + int i; + for (i = 0; i < NUM_HAPPY_FACES; i++) { + faces[i].x = randomFloat(0.0f, SCREEN_WIDTH - HAPPY_FACE_SIZE); + faces[i].y = randomFloat(0.0f, SCREEN_HEIGHT - HAPPY_FACE_SIZE); + faces[i].xvel = randomFloat(-0.1f, 0.1f); + faces[i].yvel = randomFloat(-0.1f, 0.1f); + } +} + +void +render(SDL_Renderer *renderer) +{ + + int i; + SDL_Rect srcRect; + SDL_Rect dstRect; + + /* setup boundaries for happyface bouncing */ + Uint16 maxx = SCREEN_WIDTH - HAPPY_FACE_SIZE; + Uint16 maxy = SCREEN_HEIGHT - HAPPY_FACE_SIZE; + Uint16 minx = 0; + Uint16 miny = 0; + + /* setup rects for drawing */ + srcRect.x = 0; + srcRect.y = 0; + srcRect.w = HAPPY_FACE_SIZE; + srcRect.h = HAPPY_FACE_SIZE; + dstRect.w = HAPPY_FACE_SIZE; + dstRect.h = HAPPY_FACE_SIZE; + + /* fill background in with black */ + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + + /* + loop through all the happy faces: + - update position + - update velocity (if boundary is hit) + - draw + */ + for (i = 0; i < NUM_HAPPY_FACES; i++) { + faces[i].x += faces[i].xvel * MILLESECONDS_PER_FRAME; + faces[i].y += faces[i].yvel * MILLESECONDS_PER_FRAME; + if (faces[i].x > maxx) { + faces[i].x = maxx; + faces[i].xvel = -faces[i].xvel; + } else if (faces[i].y > maxy) { + faces[i].y = maxy; + faces[i].yvel = -faces[i].yvel; + } + if (faces[i].x < minx) { + faces[i].x = minx; + faces[i].xvel = -faces[i].xvel; + } else if (faces[i].y < miny) { + faces[i].y = miny; + faces[i].yvel = -faces[i].yvel; + } + dstRect.x = faces[i].x; + dstRect.y = faces[i].y; + SDL_RenderCopy(renderer, texture, &srcRect, &dstRect); + } + /* update screen */ + SDL_RenderPresent(renderer); + +} + +/* + loads the happyface graphic into a texture +*/ +void +initializeTexture(SDL_Renderer *renderer) +{ + SDL_Surface *bmp_surface; + /* load the bmp */ + bmp_surface = SDL_LoadBMP("icon.bmp"); + if (bmp_surface == NULL) { + fatalError("could not load bmp"); + } + /* set white to transparent on the happyface */ + SDL_SetColorKey(bmp_surface, 1, + SDL_MapRGB(bmp_surface->format, 255, 255, 255)); + + /* convert RGBA surface to texture */ + texture = SDL_CreateTextureFromSurface(renderer, bmp_surface); + if (texture == 0) { + fatalError("could not create texture"); + } + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + + /* free up allocated memory */ + SDL_FreeSurface(bmp_surface); +} + +int +main(int argc, char *argv[]) +{ + + SDL_Window *window; + SDL_Renderer *renderer; + Uint32 startFrame; + Uint32 endFrame; + Uint32 delay; + int done; + + /* initialize SDL */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + fatalError("Could not initialize SDL"); + } + window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, + SDL_WINDOW_OPENGL | + SDL_WINDOW_BORDERLESS); + + renderer = SDL_CreateRenderer(window, -1, 0); + + initializeTexture(renderer); + initializeHappyFaces(); + + /* main loop */ + done = 0; + while (!done) { + startFrame = SDL_GetTicks(); + SDL_Event event; + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT) { + done = 1; + } + } + render(renderer); + endFrame = SDL_GetTicks(); + + /* figure out how much time we have left, and then sleep */ + delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame); + if (delay < 0) { + delay = 0; + } else if (delay > MILLESECONDS_PER_FRAME) { + delay = MILLESECONDS_PER_FRAME; + } + SDL_Delay(delay); + } + + /* cleanup */ + SDL_DestroyTexture(texture); + /* shutdown SDL */ + SDL_Quit(); + + return 0; + +} diff --git a/Xcode-iOS/Demos/src/keyboard.c b/Xcode-iOS/Demos/src/keyboard.c new file mode 100644 index 0000000000..fd903ff864 --- /dev/null +++ b/Xcode-iOS/Demos/src/keyboard.c @@ -0,0 +1,310 @@ +/* + * keyboard.c + * written by Holmes Futrell + * use however you want + */ + +#import "SDL.h" +#import "common.h" + +#define GLYPH_SIZE_IMAGE 16 /* size of glyphs (characters) in the bitmap font file */ +#define GLYPH_SIZE_SCREEN 32 /* size of glyphs (characters) as shown on the screen */ + +static SDL_Texture *texture; /* texture where we'll hold our font */ + +/* function declarations */ +void cleanup(void); +void drawBlank(int x, int y); + +static SDL_Renderer *renderer; +static int numChars = 0; /* number of characters we've typed so far */ +static SDL_bool lastCharWasColon = 0; /* we use this to detect sequences such as :) */ +static SDL_Color bg_color = { 50, 50, 100, 255 }; /* color of background */ + +/* this structure maps a scancode to an index in our bitmap font. + it also contains data about under which modifiers the mapping is valid + (for example, we don't want shift + 1 to produce the character '1', + but rather the character '!') +*/ +typedef struct +{ + SDL_Scancode scancode; /* scancode of the key we want to map */ + int allow_no_mod; /* is the map valid if the key has no modifiers? */ + SDL_Keymod mod; /* what modifiers are allowed for the mapping */ + int index; /* what index in the font does the scancode map to */ +} fontMapping; + +#define TABLE_SIZE 51 /* size of our table which maps keys and modifiers to font indices */ + +/* Below is the table that defines the mapping between scancodes and modifiers to indices in the + bitmap font. As an example, then line '{ SDL_SCANCODE_A, 1, KMOD_SHIFT, 33 }' means, map + the key A (which has scancode SDL_SCANCODE_A) to index 33 in the font (which is a picture of an A), + The '1' means that the mapping is valid even if there are no modifiers, and KMOD_SHIFT means the + mapping is also valid if the user is holding shift. +*/ +fontMapping map[TABLE_SIZE] = { + + {SDL_SCANCODE_A, 1, KMOD_SHIFT, 33}, /* A */ + {SDL_SCANCODE_B, 1, KMOD_SHIFT, 34}, /* B */ + {SDL_SCANCODE_C, 1, KMOD_SHIFT, 35}, /* C */ + {SDL_SCANCODE_D, 1, KMOD_SHIFT, 36}, /* D */ + {SDL_SCANCODE_E, 1, KMOD_SHIFT, 37}, /* E */ + {SDL_SCANCODE_F, 1, KMOD_SHIFT, 38}, /* F */ + {SDL_SCANCODE_G, 1, KMOD_SHIFT, 39}, /* G */ + {SDL_SCANCODE_H, 1, KMOD_SHIFT, 40}, /* H */ + {SDL_SCANCODE_I, 1, KMOD_SHIFT, 41}, /* I */ + {SDL_SCANCODE_J, 1, KMOD_SHIFT, 42}, /* J */ + {SDL_SCANCODE_K, 1, KMOD_SHIFT, 43}, /* K */ + {SDL_SCANCODE_L, 1, KMOD_SHIFT, 44}, /* L */ + {SDL_SCANCODE_M, 1, KMOD_SHIFT, 45}, /* M */ + {SDL_SCANCODE_N, 1, KMOD_SHIFT, 46}, /* N */ + {SDL_SCANCODE_O, 1, KMOD_SHIFT, 47}, /* O */ + {SDL_SCANCODE_P, 1, KMOD_SHIFT, 48}, /* P */ + {SDL_SCANCODE_Q, 1, KMOD_SHIFT, 49}, /* Q */ + {SDL_SCANCODE_R, 1, KMOD_SHIFT, 50}, /* R */ + {SDL_SCANCODE_S, 1, KMOD_SHIFT, 51}, /* S */ + {SDL_SCANCODE_T, 1, KMOD_SHIFT, 52}, /* T */ + {SDL_SCANCODE_U, 1, KMOD_SHIFT, 53}, /* U */ + {SDL_SCANCODE_V, 1, KMOD_SHIFT, 54}, /* V */ + {SDL_SCANCODE_W, 1, KMOD_SHIFT, 55}, /* W */ + {SDL_SCANCODE_X, 1, KMOD_SHIFT, 56}, /* X */ + {SDL_SCANCODE_Y, 1, KMOD_SHIFT, 57}, /* Y */ + {SDL_SCANCODE_Z, 1, KMOD_SHIFT, 58}, /* Z */ + {SDL_SCANCODE_0, 1, 0, 16}, /* 0 */ + {SDL_SCANCODE_1, 1, 0, 17}, /* 1 */ + {SDL_SCANCODE_2, 1, 0, 18}, /* 2 */ + {SDL_SCANCODE_3, 1, 0, 19}, /* 3 */ + {SDL_SCANCODE_4, 1, 0, 20}, /* 4 */ + {SDL_SCANCODE_5, 1, 0, 21}, /* 5 */ + {SDL_SCANCODE_6, 1, 0, 22}, /* 6 */ + {SDL_SCANCODE_7, 1, 0, 23}, /* 7 */ + {SDL_SCANCODE_8, 1, 0, 24}, /* 8 */ + {SDL_SCANCODE_9, 1, 0, 25}, /* 9 */ + {SDL_SCANCODE_SPACE, 1, 0, 0}, /*' ' */ + {SDL_SCANCODE_1, 0, KMOD_SHIFT, 1}, /* ! */ + {SDL_SCANCODE_SLASH, 0, KMOD_SHIFT, 31}, /* ? */ + {SDL_SCANCODE_SLASH, 1, 0, 15}, /* / */ + {SDL_SCANCODE_COMMA, 1, 0, 12}, /* , */ + {SDL_SCANCODE_SEMICOLON, 1, 0, 27}, /* ; */ + {SDL_SCANCODE_SEMICOLON, 0, KMOD_SHIFT, 26}, /* : */ + {SDL_SCANCODE_PERIOD, 1, 0, 14}, /* . */ + {SDL_SCANCODE_MINUS, 1, 0, 13}, /* - */ + {SDL_SCANCODE_EQUALS, 0, KMOD_SHIFT, 11}, /* = */ + {SDL_SCANCODE_APOSTROPHE, 1, 0, 7}, /* ' */ + {SDL_SCANCODE_APOSTROPHE, 0, KMOD_SHIFT, 2}, /* " */ + {SDL_SCANCODE_5, 0, KMOD_SHIFT, 5}, /* % */ + +}; + +/* + This function maps an SDL_KeySym to an index in the bitmap font. + It does so by scanning through the font mapping table one entry + at a time. + + If a match is found (scancode and allowed modifiers), the proper + index is returned. + + If there is no entry for the key, -1 is returned +*/ +int +keyToIndex(SDL_Keysym key) +{ + int i, index = -1; + for (i = 0; i < TABLE_SIZE; i++) { + fontMapping compare = map[i]; + if (key.scancode == compare.scancode) { + /* if this entry is valid with no key mod and we have no keymod, or if + the key's modifiers are allowed modifiers for that mapping */ + if ((compare.allow_no_mod && key.mod == 0) + || (key.mod & compare.mod)) { + index = compare.index; + break; + } + } + } + return index; +} + +/* + This function returns and x,y position for a given character number. + It is used for positioning each character of text +*/ +void +getPositionForCharNumber(int n, int *x, int *y) +{ + int x_padding = 16; /* padding space on left and right side of screen */ + int y_padding = 32; /* padding space at top of screen */ + /* figure out the number of characters that can fit horizontally across the screen */ + int max_x_chars = (SCREEN_WIDTH - 2 * x_padding) / GLYPH_SIZE_SCREEN; + int line_separation = 5; /* pixels between each line */ + *x = (n % max_x_chars) * GLYPH_SIZE_SCREEN + x_padding; + *y = (n / max_x_chars) * (GLYPH_SIZE_SCREEN + line_separation) + + y_padding; +} + +void +drawIndex(int index) +{ + int x, y; + getPositionForCharNumber(numChars, &x, &y); + SDL_Rect srcRect = + { GLYPH_SIZE_IMAGE * index, 0, GLYPH_SIZE_IMAGE, GLYPH_SIZE_IMAGE }; + SDL_Rect dstRect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN }; + drawBlank(x, y); + SDL_RenderCopy(renderer, texture, &srcRect, &dstRect); +} + +/* draws the cursor icon at the current end position of the text */ +void +drawCursor(void) +{ + drawIndex(29); /* cursor is at index 29 in the bitmap font */ +} + +/* paints over a glyph sized region with the background color + in effect it erases the area +*/ +void +drawBlank(int x, int y) +{ + SDL_Rect rect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN }; + SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a); + SDL_RenderFillRect(renderer, &rect); +} + +/* moves backwards one character, erasing the last one put down */ +void +backspace(void) +{ + int x, y; + if (numChars > 0) { + getPositionForCharNumber(numChars, &x, &y); + drawBlank(x, y); + numChars--; + getPositionForCharNumber(numChars, &x, &y); + drawBlank(x, y); + drawCursor(); + } +} + +/* this function loads our font into an SDL_Texture and returns the SDL_Texture */ +SDL_Texture* +loadFont(void) +{ + + SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp"); + + if (!surface) { + printf("Error loading bitmap: %s\n", SDL_GetError()); + return 0; + } else { + /* set the transparent color for the bitmap font (hot pink) */ + SDL_SetColorKey(surface, 1, SDL_MapRGB(surface->format, 238, 0, 252)); + /* now we convert the surface to our desired pixel format */ + int format = SDL_PIXELFORMAT_ABGR8888; /* desired texture format */ + Uint32 Rmask, Gmask, Bmask, Amask; /* masks for desired format */ + int bpp; /* bits per pixel for desired format */ + SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, + &Amask); + SDL_Surface *converted = + SDL_CreateRGBSurface(0, surface->w, surface->h, bpp, Rmask, Gmask, + Bmask, Amask); + SDL_BlitSurface(surface, NULL, converted, NULL); + /* create our texture */ + texture = + SDL_CreateTextureFromSurface(renderer, converted); + if (texture == 0) { + printf("texture creation failed: %s\n", SDL_GetError()); + } else { + /* set blend mode for our texture */ + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + } + SDL_FreeSurface(surface); + SDL_FreeSurface(converted); + return texture; + } +} + +int +main(int argc, char *argv[]) +{ + + int index; /* index of last key we pushed in the bitmap font */ + SDL_Window *window; + SDL_Event event; /* last event received */ + SDL_Keymod mod; /* key modifiers of last key we pushed */ + SDL_Scancode scancode; /* scancode of last key we pushed */ + + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + printf("Error initializing SDL: %s", SDL_GetError()); + } + /* create window */ + window = SDL_CreateWindow("iPhone keyboard test", 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0); + /* create renderer */ + renderer = SDL_CreateRenderer(window, -1, 0); + + /* load up our font */ + loadFont(); + + /* draw the background, we'll just paint over it */ + SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a); + SDL_RenderFillRect(renderer, NULL); + SDL_RenderPresent(renderer); + + int done = 0; + /* loop till we get SDL_Quit */ + while (SDL_WaitEvent(&event)) { + switch (event.type) { + case SDL_QUIT: + done = 1; + break; + case SDL_KEYDOWN: + index = keyToIndex(event.key.keysym); + scancode = event.key.keysym.scancode; + mod = event.key.keysym.mod; + if (scancode == SDL_SCANCODE_DELETE) { + /* if user hit delete, delete the last character */ + backspace(); + lastCharWasColon = 0; + } else if (lastCharWasColon && scancode == SDL_SCANCODE_0 + && (mod & KMOD_SHIFT)) { + /* if our last key was a colon and this one is a close paren, the make a hoppy face */ + backspace(); + drawIndex(32); /* index for happy face */ + numChars++; + drawCursor(); + lastCharWasColon = 0; + } else if (index != -1) { + /* if we aren't doing a happy face, then just draw the normal character */ + drawIndex(index); + numChars++; + drawCursor(); + lastCharWasColon = + (event.key.keysym.scancode == SDL_SCANCODE_SEMICOLON + && (event.key.keysym.mod & KMOD_SHIFT)); + } + /* check if the key was a colon */ + /* draw our updates to the screen */ + SDL_RenderPresent(renderer); + break; + case SDL_MOUSEBUTTONUP: + /* mouse up toggles onscreen keyboard visibility */ + if (SDL_IsTextInputActive()) { + SDL_StopTextInput(); + } else { + SDL_StartTextInput(); + } + break; + } + } + cleanup(); + return 0; +} + +/* clean up after ourselves like a good kiddy */ +void +cleanup(void) +{ + SDL_DestroyTexture(texture); + SDL_Quit(); +} diff --git a/Xcode-iOS/Demos/src/mixer.c b/Xcode-iOS/Demos/src/mixer.c new file mode 100644 index 0000000000..bd0cfb1dff --- /dev/null +++ b/Xcode-iOS/Demos/src/mixer.c @@ -0,0 +1,353 @@ +/* + * mixer.c + * written by Holmes Futrell + * use however you want + */ + +#import "SDL.h" +#import "common.h" + +#define NUM_CHANNELS 8 /* max number of sounds we can play at once */ +#define NUM_DRUMS 4 /* number of drums in our set */ +#define MILLESECONDS_PER_FRAME 16 /* about 60 frames per second */ + +static struct +{ + SDL_Rect rect; /* where the button is drawn */ + SDL_Color upColor; /* color when button is not active */ + SDL_Color downColor; /* color when button is active */ + int isPressed; /* is the button being pressed ? */ + int touchIndex; /* what mouse (touch) index pressed the button ? */ +} buttons[NUM_DRUMS]; + +struct sound +{ + Uint8 *buffer; /* audio buffer for sound file */ + Uint32 length; /* length of the buffer (in bytes) */ +}; + +/* this array holds the audio for the drum noises */ +static struct sound drums[NUM_DRUMS]; + +/* function declarations */ +void handleMouseButtonDown(SDL_Event * event); +void handleMouseButtonUp(SDL_Event * event); +int playSound(struct sound *); +void initializeButtons(); +void audioCallback(void *userdata, Uint8 * stream, int len); +void loadSound(const char *file, struct sound *s); + +struct +{ + /* channel array holds information about currently playing sounds */ + struct + { + Uint8 *position; /* what is the current position in the buffer of this sound ? */ + Uint32 remaining; /* how many bytes remaining before we're done playing the sound ? */ + Uint32 timestamp; /* when did this sound start playing ? */ + } channels[NUM_CHANNELS]; + SDL_AudioSpec outputSpec; /* what audio format are we using for output? */ + int numSoundsPlaying; /* how many sounds are currently playing */ +} mixer; + +/* sets up the buttons (color, position, state) */ +void +initializeButtons() +{ + + int i; + int spacing = 10; /* gap between drum buttons */ + SDL_Rect buttonRect; /* keeps track of where to position drum */ + SDL_Color upColor = { 86, 86, 140, 255 }; /* color of drum when not pressed */ + SDL_Color downColor = { 191, 191, 221, 255 }; /* color of drum when pressed */ + + buttonRect.x = spacing; + buttonRect.y = spacing; + buttonRect.w = SCREEN_WIDTH - 2 * spacing; + buttonRect.h = (SCREEN_HEIGHT - (NUM_DRUMS + 1) * spacing) / NUM_DRUMS; + + /* setup each button */ + for (i = 0; i < NUM_DRUMS; i++) { + + buttons[i].rect = buttonRect; + buttons[i].isPressed = 0; + buttons[i].upColor = upColor; + buttons[i].downColor = downColor; + + buttonRect.y += spacing + buttonRect.h; /* setup y coordinate for next drum */ + + } +} + +/* + loads a wav file (stored in 'file'), converts it to the mixer's output format, + and stores the resulting buffer and length in the sound structure + */ +void +loadSound(const char *file, struct sound *s) +{ + SDL_AudioSpec spec; /* the audio format of the .wav file */ + SDL_AudioCVT cvt; /* used to convert .wav to output format when formats differ */ + int result; + if (SDL_LoadWAV(file, &spec, &s->buffer, &s->length) == NULL) { + fatalError("could not load .wav"); + } + /* build the audio converter */ + result = SDL_BuildAudioCVT(&cvt, spec.format, spec.channels, spec.freq, + mixer.outputSpec.format, + mixer.outputSpec.channels, + mixer.outputSpec.freq); + if (result == -1) { + fatalError("could not build audio CVT"); + } else if (result != 0) { + /* + this happens when the .wav format differs from the output format. + we convert the .wav buffer here + */ + cvt.buf = (Uint8 *) SDL_malloc(s->length * cvt.len_mult); /* allocate conversion buffer */ + cvt.len = s->length; /* set conversion buffer length */ + SDL_memcpy(cvt.buf, s->buffer, s->length); /* copy sound to conversion buffer */ + if (SDL_ConvertAudio(&cvt) == -1) { /* convert the sound */ + fatalError("could not convert .wav"); + } + SDL_free(s->buffer); /* free the original (unconverted) buffer */ + s->buffer = cvt.buf; /* point sound buffer to converted buffer */ + s->length = cvt.len_cvt; /* set sound buffer's new length */ + } +} + +/* called from main event loop */ +void +handleMouseButtonDown(SDL_Event * event) +{ + + int x, y, mouseIndex, i, drumIndex; + + mouseIndex = 0; + drumIndex = -1; + + SDL_GetMouseState(&x, &y); + /* check if we hit any of the drum buttons */ + for (i = 0; i < NUM_DRUMS; i++) { + if (x >= buttons[i].rect.x + && x < buttons[i].rect.x + buttons[i].rect.w + && y >= buttons[i].rect.y + && y < buttons[i].rect.y + buttons[i].rect.h) { + drumIndex = i; + break; + } + } + if (drumIndex != -1) { + /* if we hit a button */ + buttons[drumIndex].touchIndex = mouseIndex; + buttons[drumIndex].isPressed = 1; + playSound(&drums[drumIndex]); + } + +} + +/* called from main event loop */ +void +handleMouseButtonUp(SDL_Event * event) +{ + int i; + int mouseIndex = 0; + /* check if this should cause any of the buttons to become unpressed */ + for (i = 0; i < NUM_DRUMS; i++) { + if (buttons[i].touchIndex == mouseIndex) { + buttons[i].isPressed = 0; + } + } +} + +/* draws buttons to screen */ +void +render(SDL_Renderer *renderer) +{ + int i; + SDL_SetRenderDrawColor(renderer, 50, 50, 50, 255); + SDL_RenderClear(renderer); /* draw background (gray) */ + /* draw the drum buttons */ + for (i = 0; i < NUM_DRUMS; i++) { + SDL_Color color = + buttons[i].isPressed ? buttons[i].downColor : buttons[i].upColor; + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); + SDL_RenderFillRect(renderer, &buttons[i].rect); + } + /* update the screen */ + SDL_RenderPresent(renderer); +} + +/* + finds a sound channel in the mixer for a sound + and sets it up to start playing +*/ +int +playSound(struct sound *s) +{ + /* + find an empty channel to play on. + if no channel is available, use oldest channel + */ + int i; + int selected_channel = -1; + int oldest_channel = 0; + + if (mixer.numSoundsPlaying == 0) { + /* we're playing a sound now, so start audio callback back up */ + SDL_PauseAudio(0); + } + + /* find a sound channel to play the sound on */ + for (i = 0; i < NUM_CHANNELS; i++) { + if (mixer.channels[i].position == NULL) { + /* if no sound on this channel, select it */ + selected_channel = i; + break; + } + /* if this channel's sound is older than the oldest so far, set it to oldest */ + if (mixer.channels[i].timestamp < + mixer.channels[oldest_channel].timestamp) + oldest_channel = i; + } + + /* no empty channels, take the oldest one */ + if (selected_channel == -1) + selected_channel = oldest_channel; + else + mixer.numSoundsPlaying++; + + /* point channel data to wav data */ + mixer.channels[selected_channel].position = s->buffer; + mixer.channels[selected_channel].remaining = s->length; + mixer.channels[selected_channel].timestamp = SDL_GetTicks(); + + return selected_channel; +} + +/* + Called from SDL's audio system. Supplies sound input with data by mixing together all + currently playing sound effects. +*/ +void +audioCallback(void *userdata, Uint8 * stream, int len) +{ + int i; + int copy_amt; + SDL_memset(stream, mixer.outputSpec.silence, len); /* initialize buffer to silence */ + /* for each channel, mix in whatever is playing on that channel */ + for (i = 0; i < NUM_CHANNELS; i++) { + if (mixer.channels[i].position == NULL) { + /* if no sound is playing on this channel */ + continue; /* nothing to do for this channel */ + } + + /* copy len bytes to the buffer, unless we have fewer than len bytes remaining */ + copy_amt = + mixer.channels[i].remaining < + len ? mixer.channels[i].remaining : len; + + /* mix this sound effect with the output */ + SDL_MixAudioFormat(stream, mixer.channels[i].position, + mixer.outputSpec.format, copy_amt, 150); + + /* update buffer position in sound effect and the number of bytes left */ + mixer.channels[i].position += copy_amt; + mixer.channels[i].remaining -= copy_amt; + + /* did we finish playing the sound effect ? */ + if (mixer.channels[i].remaining == 0) { + mixer.channels[i].position = NULL; /* indicates no sound playing on channel anymore */ + mixer.numSoundsPlaying--; + if (mixer.numSoundsPlaying == 0) { + /* if no sounds left playing, pause audio callback */ + SDL_PauseAudio(1); + } + } + } +} + +int +main(int argc, char *argv[]) +{ + + int done; /* has user tried to quit ? */ + SDL_Window *window; /* main window */ + SDL_Renderer *renderer; + SDL_Event event; + Uint32 startFrame; /* holds when frame started processing */ + Uint32 endFrame; /* holds when frame ended processing */ + Uint32 delay; /* calculated delay, how long should we wait before next frame? */ + + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { + fatalError("could not initialize SDL"); + } + window = + SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, + SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); + renderer = SDL_CreateRenderer(window, 0, 0); + + /* initialize the mixer */ + SDL_memset(&mixer, 0, sizeof(mixer)); + /* setup output format */ + mixer.outputSpec.freq = 44100; + mixer.outputSpec.format = AUDIO_S16LSB; + mixer.outputSpec.channels = 2; + mixer.outputSpec.samples = 256; + mixer.outputSpec.callback = audioCallback; + mixer.outputSpec.userdata = NULL; + + /* open audio for output */ + if (SDL_OpenAudio(&mixer.outputSpec, NULL) != 0) { + fatalError("Opening audio failed"); + } + + /* load our drum noises */ + loadSound("ds_kick_big_amb.wav", &drums[3]); + loadSound("ds_brush_snare.wav", &drums[2]); + loadSound("ds_loose_skin_mute.wav", &drums[1]); + loadSound("ds_china.wav", &drums[0]); + + /* setup positions, colors, and state of buttons */ + initializeButtons(); + + /* enter main loop */ + done = 0; + while (!done) { + startFrame = SDL_GetTicks(); + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_MOUSEBUTTONDOWN: + handleMouseButtonDown(&event); + break; + case SDL_MOUSEBUTTONUP: + handleMouseButtonUp(&event); + break; + case SDL_QUIT: + done = 1; + break; + } + } + render(renderer); /* draw buttons */ + endFrame = SDL_GetTicks(); + + /* figure out how much time we have left, and then sleep */ + delay = MILLESECONDS_PER_FRAME - (endFrame - startFrame); + if (delay < 0) { + delay = 0; + } else if (delay > MILLESECONDS_PER_FRAME) { + delay = MILLESECONDS_PER_FRAME; + } + SDL_Delay(delay); + } + + /* cleanup code, let's free up those sound buffers */ + int i; + for (i = 0; i < NUM_DRUMS; i++) { + SDL_free(drums[i].buffer); + } + /* let SDL do its exit code */ + SDL_Quit(); + + return 0; +} diff --git a/Xcode-iOS/Demos/src/rectangles.c b/Xcode-iOS/Demos/src/rectangles.c new file mode 100644 index 0000000000..035e4f9825 --- /dev/null +++ b/Xcode-iOS/Demos/src/rectangles.c @@ -0,0 +1,81 @@ +/* + * rectangles.c + * written by Holmes Futrell + * use however you want +*/ + +#include "SDL.h" +#include +#include "common.h" + +void +render(SDL_Renderer *renderer) +{ + + Uint8 r, g, b; + /* Come up with a random rectangle */ + SDL_Rect rect; + rect.w = randomInt(64, 128); + rect.h = randomInt(64, 128); + rect.x = randomInt(0, SCREEN_WIDTH); + rect.y = randomInt(0, SCREEN_HEIGHT); + + /* Come up with a random color */ + r = randomInt(50, 255); + g = randomInt(50, 255); + b = randomInt(50, 255); + + /* Fill the rectangle in the color */ + SDL_SetRenderDrawColor(renderer, r, g, b, 255); + SDL_RenderFillRect(renderer, &rect); + + /* update screen */ + SDL_RenderPresent(renderer); + +} + +int +main(int argc, char *argv[]) +{ + if (SDL_Init(SDL_INIT_VIDEO/* | SDL_INIT_AUDIO*/) < 0) + { + printf("Unable to initialize SDL"); + } + + SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + + int landscape = 1; + int modes = SDL_GetNumDisplayModes(0); + int sx = 0, sy = 0; + for (int i = 0; i < modes; i++) + { + SDL_DisplayMode mode; + SDL_GetDisplayMode(0, i, &mode); + if (landscape ? mode.w > sx : mode.h > sy) + { + sx = mode.w; + sy = mode.h; + } + } + + printf("picked: %d %d\n", sx, sy); + + SDL_Window *_sdl_window = NULL; + SDL_GLContext _sdl_context = NULL; + + _sdl_window = SDL_CreateWindow("fred", + 0, 0, + sx, sy, + SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); + + SDL_SetHint("SDL_HINT_ORIENTATIONS", "LandscapeLeft LandscapeRight"); + + int ax = 0, ay = 0; + SDL_GetWindowSize(_sdl_window, &ax, &ay); + + printf("given: %d %d\n", ax, ay); + + return 0; +} diff --git a/Xcode-iOS/Demos/src/touch.c b/Xcode-iOS/Demos/src/touch.c new file mode 100644 index 0000000000..e811967b14 --- /dev/null +++ b/Xcode-iOS/Demos/src/touch.c @@ -0,0 +1,125 @@ +/* + * touch.c + * written by Holmes Futrell + * use however you want + */ + +#include "SDL.h" +#include "math.h" +#include "common.h" + +#define BRUSH_SIZE 32 /* width and height of the brush */ +#define PIXELS_PER_ITERATION 5 /* number of pixels between brush blots when forming a line */ + +static SDL_Texture *brush = 0; /* texture for the brush */ + +/* + draws a line from (startx, starty) to (startx + dx, starty + dy) + this is accomplished by drawing several blots spaced PIXELS_PER_ITERATION apart +*/ +void +drawLine(SDL_Renderer *renderer, float startx, float starty, float dx, float dy) +{ + + float distance = sqrt(dx * dx + dy * dy); /* length of line segment (pythagoras) */ + int iterations = distance / PIXELS_PER_ITERATION + 1; /* number of brush sprites to draw for the line */ + float dx_prime = dx / iterations; /* x-shift per iteration */ + float dy_prime = dy / iterations; /* y-shift per iteration */ + SDL_Rect dstRect; /* rect to draw brush sprite into */ + + dstRect.w = BRUSH_SIZE; + dstRect.h = BRUSH_SIZE; + + /* setup x and y for the location of the first sprite */ + float x = startx - BRUSH_SIZE / 2.0f; + float y = starty - BRUSH_SIZE / 2.0f; + + int i; + /* draw a series of blots to form the line */ + for (i = 0; i < iterations; i++) { + dstRect.x = x; + dstRect.y = y; + /* shift x and y for next sprite location */ + x += dx_prime; + y += dy_prime; + /* draw brush blot */ + SDL_RenderCopy(renderer, brush, NULL, &dstRect); + } +} + +/* + loads the brush texture +*/ +void +initializeTexture(SDL_Renderer *renderer) +{ + SDL_Surface *bmp_surface; + bmp_surface = SDL_LoadBMP("stroke.bmp"); + if (bmp_surface == NULL) { + fatalError("could not load stroke.bmp"); + } + brush = + SDL_CreateTextureFromSurface(renderer, bmp_surface); + SDL_FreeSurface(bmp_surface); + if (brush == 0) { + fatalError("could not create brush texture"); + } + /* additive blending -- laying strokes on top of eachother makes them brighter */ + SDL_SetTextureBlendMode(brush, SDL_BLENDMODE_ADD); + /* set brush color (red) */ + SDL_SetTextureColorMod(brush, 255, 100, 100); +} + +int +main(int argc, char *argv[]) +{ + + int x, y, dx, dy; /* mouse location */ + Uint8 state; /* mouse (touch) state */ + SDL_Event event; + SDL_Window *window; /* main window */ + SDL_Renderer *renderer; + int done; /* does user want to quit? */ + + /* initialize SDL */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + fatalError("Could not initialize SDL"); + } + + /* create main window and renderer */ + window = SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, + SDL_WINDOW_OPENGL | + SDL_WINDOW_BORDERLESS); + renderer = SDL_CreateRenderer(window, 0, 0); + + /*load brush texture */ + initializeTexture(renderer); + + /* fill canvass initially with all black */ + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + + done = 0; + while (!done && SDL_WaitEvent(&event)) { + switch (event.type) { + case SDL_QUIT: + done = 1; + break; + case SDL_MOUSEMOTION: + state = SDL_GetMouseState(&x, &y); /* get its location */ + SDL_GetRelativeMouseState(&dx, &dy); /* find how much the mouse moved */ + if (state & SDL_BUTTON_LMASK) { /* is the mouse (touch) down? */ + drawLine(renderer, x - dx, y - dy, dx, dy); /* draw line segment */ + SDL_RenderPresent(renderer); + } + break; + } + } + + /* cleanup */ + SDL_DestroyTexture(brush); + SDL_Quit(); + + return 0; +} diff --git a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj new file mode 100755 index 0000000000..f3122ecbab --- /dev/null +++ b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj @@ -0,0 +1,1290 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXAggregateTarget section */ + 00B4F48B12F6A69C0084EC00 /* PrepareXcodeProjectTemplate */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 00B4F48E12F6A6BA0084EC00 /* Build configuration list for PBXAggregateTarget "PrepareXcodeProjectTemplate" */; + buildPhases = ( + 00B4F48A12F6A69C0084EC00 /* ShellScript */, + ); + dependencies = ( + ); + name = PrepareXcodeProjectTemplate; + productName = PrepareXcodeProjectTemplate; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 006E9886119552DD001DE610 /* SDL_rwopsbundlesupport.h */; }; + 006E9889119552DD001DE610 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */; }; + 0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */; }; + 0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */; }; + 0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */ = {isa = PBXBuildFile; fileRef = 0402A85712FE70C600CECEE3 /* SDL_shaders_gles2.h */; }; + 041B2CF112FA0F680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2CEA12FA0F680087D585 /* SDL_render.c */; }; + 041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */; }; + 0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */; }; + 0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */; }; + 04409BA612FA989600FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA212FA989600FB9AA8 /* mmx.h */; }; + 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */; }; + 04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */; }; + 04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */; }; + 0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */; }; + 0442EC5112FE1C1E004C9285 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */; }; + 0442EC5312FE1C28004C9285 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5212FE1C28004C9285 /* SDL_render_gles.c */; }; + 0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5412FE1C3F004C9285 /* SDL_hints.c */; }; + 044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 044E5FB711E606EB0076F181 /* SDL_clipboard.c */; }; + 046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */; }; + 046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */; }; + 047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */; }; + 047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 047677B90EA76A31008ABAF1 /* SDL_haptic.c */; }; + 047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */; }; + 047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */; }; + 04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */; }; + 04BA9D6411EF474A00B60E01 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */; }; + 04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */; }; + 04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BA9D6211EF474A00B60E01 /* SDL_touch.c */; }; + 04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */; }; + 04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC09B1300C1290055DE28 /* SDL_log.c */; }; + 04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */; }; + 04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */; }; + 04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */; }; + 04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806C12FB751400FC43C0 /* SDL_blendline.c */; }; + 04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806D12FB751400FC43C0 /* SDL_blendline.h */; }; + 04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */; }; + 04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */; }; + 04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807012FB751400FC43C0 /* SDL_draw.h */; }; + 04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807112FB751400FC43C0 /* SDL_drawline.c */; }; + 04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807212FB751400FC43C0 /* SDL_drawline.h */; }; + 04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */; }; + 04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */; }; + 04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */; }; + 04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */; }; + 04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; }; + 04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; }; + 56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; }; + 56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */; }; + 56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; }; + 56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; }; + 93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */; }; + 93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */; }; + AA0AD06216647BBB00CE5896 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */; }; + AA0AD06516647BD400CE5896 /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */; }; + AA0F8495178D5F1A00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8494178D5F1A00823F9D /* SDL_systls.c */; }; + AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */ = {isa = PBXBuildFile; fileRef = AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */; }; + AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */ = {isa = PBXBuildFile; fileRef = AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */; }; + AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AD9159369E3005138DD /* SDL_rotate.c */; }; + AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628ADA159369E3005138DD /* SDL_rotate.h */; }; + AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */; }; + AA704DD7162AA90A0076D1C1 /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */; }; + AA7558981595D55500BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558651595D55500BBD41B /* begin_code.h */; }; + AA7558991595D55500BBD41B /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558661595D55500BBD41B /* close_code.h */; }; + AA75589A1595D55500BBD41B /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558671595D55500BBD41B /* SDL_assert.h */; }; + AA75589B1595D55500BBD41B /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558681595D55500BBD41B /* SDL_atomic.h */; }; + AA75589C1595D55500BBD41B /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558691595D55500BBD41B /* SDL_audio.h */; }; + AA75589D1595D55500BBD41B /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586A1595D55500BBD41B /* SDL_blendmode.h */; }; + AA75589E1595D55500BBD41B /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586B1595D55500BBD41B /* SDL_clipboard.h */; }; + AA75589F1595D55500BBD41B /* SDL_config_iphoneos.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */; }; + AA7558A01595D55500BBD41B /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586D1595D55500BBD41B /* SDL_config.h */; }; + AA7558A11595D55500BBD41B /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586E1595D55500BBD41B /* SDL_copying.h */; }; + AA7558A21595D55500BBD41B /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75586F1595D55500BBD41B /* SDL_cpuinfo.h */; }; + AA7558A31595D55500BBD41B /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558701595D55500BBD41B /* SDL_endian.h */; }; + AA7558A41595D55500BBD41B /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558711595D55500BBD41B /* SDL_error.h */; }; + AA7558A51595D55500BBD41B /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558721595D55500BBD41B /* SDL_events.h */; }; + AA7558A61595D55500BBD41B /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558731595D55500BBD41B /* SDL_gesture.h */; }; + AA7558A71595D55500BBD41B /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558741595D55500BBD41B /* SDL_haptic.h */; }; + AA7558A81595D55500BBD41B /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558751595D55500BBD41B /* SDL_hints.h */; }; + AA7558AA1595D55500BBD41B /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558771595D55500BBD41B /* SDL_joystick.h */; }; + AA7558AB1595D55500BBD41B /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558781595D55500BBD41B /* SDL_keyboard.h */; }; + AA7558AC1595D55500BBD41B /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558791595D55500BBD41B /* SDL_keycode.h */; }; + AA7558AD1595D55500BBD41B /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587A1595D55500BBD41B /* SDL_loadso.h */; }; + AA7558AE1595D55500BBD41B /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587B1595D55500BBD41B /* SDL_log.h */; }; + AA7558AF1595D55500BBD41B /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587C1595D55500BBD41B /* SDL_main.h */; }; + AA7558B01595D55500BBD41B /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587D1595D55500BBD41B /* SDL_mouse.h */; }; + AA7558B11595D55500BBD41B /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587E1595D55500BBD41B /* SDL_mutex.h */; }; + AA7558B21595D55500BBD41B /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75587F1595D55500BBD41B /* SDL_name.h */; }; + AA7558B31595D55500BBD41B /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558801595D55500BBD41B /* SDL_opengl.h */; }; + AA7558B41595D55500BBD41B /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558811595D55500BBD41B /* SDL_opengles.h */; }; + AA7558B51595D55500BBD41B /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558821595D55500BBD41B /* SDL_opengles2.h */; }; + AA7558B61595D55500BBD41B /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558831595D55500BBD41B /* SDL_pixels.h */; }; + AA7558B71595D55500BBD41B /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558841595D55500BBD41B /* SDL_platform.h */; }; + AA7558B81595D55500BBD41B /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558851595D55500BBD41B /* SDL_power.h */; }; + AA7558B91595D55500BBD41B /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558861595D55500BBD41B /* SDL_quit.h */; }; + AA7558BA1595D55500BBD41B /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558871595D55500BBD41B /* SDL_rect.h */; }; + AA7558BB1595D55500BBD41B /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558881595D55500BBD41B /* SDL_render.h */; }; + AA7558BC1595D55500BBD41B /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558891595D55500BBD41B /* SDL_revision.h */; }; + AA7558BD1595D55500BBD41B /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588A1595D55500BBD41B /* SDL_rwops.h */; }; + AA7558BE1595D55500BBD41B /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588B1595D55500BBD41B /* SDL_scancode.h */; }; + AA7558BF1595D55500BBD41B /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588C1595D55500BBD41B /* SDL_shape.h */; }; + AA7558C01595D55500BBD41B /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588D1595D55500BBD41B /* SDL_stdinc.h */; }; + AA7558C11595D55500BBD41B /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588E1595D55500BBD41B /* SDL_surface.h */; }; + AA7558C21595D55500BBD41B /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA75588F1595D55500BBD41B /* SDL_system.h */; }; + AA7558C31595D55500BBD41B /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558901595D55500BBD41B /* SDL_syswm.h */; }; + AA7558C41595D55500BBD41B /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558911595D55500BBD41B /* SDL_thread.h */; }; + AA7558C51595D55500BBD41B /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558921595D55500BBD41B /* SDL_timer.h */; }; + AA7558C61595D55500BBD41B /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558931595D55500BBD41B /* SDL_touch.h */; }; + AA7558C71595D55500BBD41B /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558941595D55500BBD41B /* SDL_types.h */; }; + AA7558C81595D55500BBD41B /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558951595D55500BBD41B /* SDL_version.h */; }; + AA7558C91595D55500BBD41B /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558961595D55500BBD41B /* SDL_video.h */; }; + AA7558CA1595D55500BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7558971595D55500BBD41B /* SDL.h */; }; + AA9FF9511637C6E5000DF050 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */; }; + AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */; }; + AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */; }; + AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */; }; + FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A700DEA620800C5B771 /* SDL_getenv.c */; }; + FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A710DEA620800C5B771 /* SDL_iconv.c */; }; + FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A720DEA620800C5B771 /* SDL_malloc.c */; }; + FD3F4A790DEA620800C5B771 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A730DEA620800C5B771 /* SDL_qsort.c */; }; + FD3F4A7A0DEA620800C5B771 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */; }; + FD3F4A7B0DEA620800C5B771 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = FD3F4A750DEA620800C5B771 /* SDL_string.c */; }; + FD5F9D2F0E0E08B3008E885B /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */; }; + FD5F9D300E0E08B3008E885B /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FD5F9D1F0E0E08B3008E885B /* SDL_joystick_c.h */; }; + FD5F9D310E0E08B3008E885B /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = FD5F9D200E0E08B3008E885B /* SDL_sysjoystick.h */; }; + FD6526660DE8FCDD002AD96B /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */; }; + FD6526670DE8FCDD002AD96B /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */; }; + FD6526680DE8FCDD002AD96B /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */; }; + FD65266A0DE8FCDD002AD96B /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */; }; + FD65266B0DE8FCDD002AD96B /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */; }; + FD65266F0DE8FCDD002AD96B /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */; }; + FD6526700DE8FCDD002AD96B /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */; }; + FD6526710DE8FCDD002AD96B /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9930DD52EDC00FB1D6B /* SDL_events.c */; }; + FD6526720DE8FCDD002AD96B /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */; }; + FD6526730DE8FCDD002AD96B /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */; }; + FD6526740DE8FCDD002AD96B /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */; }; + FD6526750DE8FCDD002AD96B /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */; }; + FD6526760DE8FCDD002AD96B /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */; }; + FD6526780DE8FCDD002AD96B /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */; }; + FD65267A0DE8FCDD002AD96B /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9D80DD52EDC00FB1D6B /* SDL.c */; }; + FD65267B0DE8FCDD002AD96B /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */; }; + FD65267C0DE8FCDD002AD96B /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */; }; + FD65267D0DE8FCDD002AD96B /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */; }; + FD65267E0DE8FCDD002AD96B /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */; }; + FD65267F0DE8FCDD002AD96B /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */; }; + FD6526800DE8FCDD002AD96B /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */; }; + FD6526810DE8FCDD002AD96B /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */; }; + FD689F030E26E5B600F90B21 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */; }; + FD689F040E26E5B600F90B21 /* SDLUIAccelerationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F010E26E5B600F90B21 /* SDLUIAccelerationDelegate.h */; }; + FD689F050E26E5B600F90B21 /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F020E26E5B600F90B21 /* SDLUIAccelerationDelegate.m */; }; + FD689F1C0E26E5D900F90B21 /* SDL_uikitevents.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */; }; + FD689F1D0E26E5D900F90B21 /* SDL_uikitevents.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */; }; + FD689F1E0E26E5D900F90B21 /* SDL_uikitopengles.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */; }; + FD689F1F0E26E5D900F90B21 /* SDL_uikitopengles.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */; }; + FD689F200E26E5D900F90B21 /* SDL_uikitvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F100E26E5D900F90B21 /* SDL_uikitvideo.h */; }; + FD689F210E26E5D900F90B21 /* SDL_uikitvideo.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */; }; + FD689F230E26E5D900F90B21 /* SDL_uikitview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F130E26E5D900F90B21 /* SDL_uikitview.m */; }; + FD689F240E26E5D900F90B21 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */; }; + FD689F250E26E5D900F90B21 /* SDL_uikitwindow.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */; }; + FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */; }; + FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */; }; + FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */; }; + FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */; }; + FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */; }; + FDA6844D0DF2374E00F98A1A /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683000DF2374E00F98A1A /* SDL_blit.c */; }; + FDA6844E0DF2374E00F98A1A /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683010DF2374E00F98A1A /* SDL_blit.h */; }; + FDA6844F0DF2374E00F98A1A /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683020DF2374E00F98A1A /* SDL_blit_0.c */; }; + FDA684500DF2374E00F98A1A /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683030DF2374E00F98A1A /* SDL_blit_1.c */; }; + FDA684510DF2374E00F98A1A /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683040DF2374E00F98A1A /* SDL_blit_A.c */; }; + FDA684520DF2374E00F98A1A /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */; }; + FDA684530DF2374E00F98A1A /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683060DF2374E00F98A1A /* SDL_blit_auto.h */; }; + FDA684540DF2374E00F98A1A /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */; }; + FDA684550DF2374E00F98A1A /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683080DF2374E00F98A1A /* SDL_blit_copy.h */; }; + FDA684560DF2374E00F98A1A /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683090DF2374E00F98A1A /* SDL_blit_N.c */; }; + FDA684570DF2374E00F98A1A /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */; }; + FDA684580DF2374E00F98A1A /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */; }; + FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */; }; + FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */; }; + FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683110DF2374E00F98A1A /* SDL_rect.c */; }; + FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */; }; + FDA684630DF2374E00F98A1A /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */; }; + FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683170DF2374E00F98A1A /* SDL_stretch.c */; }; + FDA684660DF2374E00F98A1A /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA683190DF2374E00F98A1A /* SDL_surface.c */; }; + FDA684670DF2374E00F98A1A /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */; }; + FDA684680DF2374E00F98A1A /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA6831B0DF2374E00F98A1A /* SDL_video.c */; }; + FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F50DF244C800F98A1A /* SDL_nullevents.c */; }; + FDA685FC0DF244C800F98A1A /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */; }; + FDA685FF0DF244C800F98A1A /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */; }; + FDA686000DF244C800F98A1A /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 006E9886119552DD001DE610 /* SDL_rwopsbundlesupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwopsbundlesupport.h; sourceTree = ""; }; + 006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_rwopsbundlesupport.m; sourceTree = ""; }; + 0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles2.c; sourceTree = ""; }; + 0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shaders_gles2.c; sourceTree = ""; }; + 0402A85712FE70C600CECEE3 /* SDL_shaders_gles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gles2.h; sourceTree = ""; }; + 041B2CEA12FA0F680087D585 /* SDL_render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render.c; sourceTree = ""; }; + 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = ""; }; + 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = ""; }; + 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = ""; }; + 04409BA212FA989600FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = ""; }; + 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = ""; }; + 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = ""; }; + 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = ""; }; + 0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render_sw_c.h; sourceTree = ""; }; + 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_sw.c; sourceTree = ""; }; + 0442EC5212FE1C28004C9285 /* SDL_render_gles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gles.c; sourceTree = ""; }; + 0442EC5412FE1C3F004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_hints.c; path = ../../src/SDL_hints.c; sourceTree = SOURCE_ROOT; }; + 044E5FB711E606EB0076F181 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = ""; }; + 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = ""; }; + 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = ""; }; + 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syshaptic.c; sourceTree = ""; }; + 047677B90EA76A31008ABAF1 /* SDL_haptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_haptic.c; path = ../../src/haptic/SDL_haptic.c; sourceTree = SOURCE_ROOT; }; + 047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_syshaptic.h; path = ../../src/haptic/SDL_syshaptic.h; sourceTree = SOURCE_ROOT; }; + 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = ""; }; + 04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture_c.h; sourceTree = ""; }; + 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gesture.c; sourceTree = ""; }; + 04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch_c.h; sourceTree = ""; }; + 04BA9D6211EF474A00B60E01 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = ""; }; + 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; }; + 04BAC09B1300C1290055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; }; + 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; }; + 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = ""; }; + 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = ""; }; + 04F7806C12FB751400FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = ""; }; + 04F7806D12FB751400FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = ""; }; + 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = ""; }; + 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = ""; }; + 04F7807012FB751400FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = ""; }; + 04F7807112FB751400FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = ""; }; + 04F7807212FB751400FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = ""; }; + 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = ""; }; + 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = ""; }; + 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = ""; }; + 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = ""; }; + 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = ""; }; + 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = ""; }; + 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_coreaudio.c; path = coreaudio/SDL_coreaudio.c; sourceTree = ""; }; + 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_coreaudio.h; path = coreaudio/SDL_coreaudio.h; sourceTree = ""; }; + 56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_power.c; path = ../../src/power/SDL_power.c; sourceTree = SOURCE_ROOT; }; + 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_syspower.m; path = ../../src/power/uikit/SDL_syspower.m; sourceTree = SOURCE_ROOT; }; + 93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitviewcontroller.h; sourceTree = ""; }; + 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitviewcontroller.m; sourceTree = ""; }; + AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamecontroller.c; sourceTree = ""; }; + AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = ""; }; + AA0F8494178D5F1A00823F9D /* SDL_systls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systls.c; sourceTree = ""; }; + AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmodes.h; sourceTree = ""; }; + AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmodes.m; sourceTree = ""; }; + AA628AD9159369E3005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = ""; }; + AA628ADA159369E3005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = ""; }; + AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dropevents_c.h; sourceTree = ""; }; + AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dropevents.c; sourceTree = ""; }; + AA7558651595D55500BBD41B /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = ""; }; + AA7558661595D55500BBD41B /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = ""; }; + AA7558671595D55500BBD41B /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = ""; }; + AA7558681595D55500BBD41B /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_atomic.h; sourceTree = ""; }; + AA7558691595D55500BBD41B /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio.h; sourceTree = ""; }; + AA75586A1595D55500BBD41B /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendmode.h; sourceTree = ""; }; + AA75586B1595D55500BBD41B /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard.h; sourceTree = ""; }; + AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_iphoneos.h; sourceTree = ""; }; + AA75586D1595D55500BBD41B /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = ""; }; + AA75586E1595D55500BBD41B /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_copying.h; sourceTree = ""; }; + AA75586F1595D55500BBD41B /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cpuinfo.h; sourceTree = ""; }; + AA7558701595D55500BBD41B /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = ""; }; + AA7558711595D55500BBD41B /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = ""; }; + AA7558721595D55500BBD41B /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = ""; }; + AA7558731595D55500BBD41B /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture.h; sourceTree = ""; }; + AA7558741595D55500BBD41B /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic.h; sourceTree = ""; }; + AA7558751595D55500BBD41B /* SDL_hints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hints.h; sourceTree = ""; }; + AA7558771595D55500BBD41B /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = ""; }; + AA7558781595D55500BBD41B /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = ""; }; + AA7558791595D55500BBD41B /* SDL_keycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keycode.h; sourceTree = ""; }; + AA75587A1595D55500BBD41B /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_loadso.h; sourceTree = ""; }; + AA75587B1595D55500BBD41B /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_log.h; sourceTree = ""; }; + AA75587C1595D55500BBD41B /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main.h; sourceTree = ""; }; + AA75587D1595D55500BBD41B /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = ""; }; + AA75587E1595D55500BBD41B /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mutex.h; sourceTree = ""; }; + AA75587F1595D55500BBD41B /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_name.h; sourceTree = ""; }; + AA7558801595D55500BBD41B /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengl.h; sourceTree = ""; }; + AA7558811595D55500BBD41B /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles.h; sourceTree = ""; }; + AA7558821595D55500BBD41B /* SDL_opengles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2.h; sourceTree = ""; }; + AA7558831595D55500BBD41B /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels.h; sourceTree = ""; }; + AA7558841595D55500BBD41B /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = ""; }; + AA7558851595D55500BBD41B /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_power.h; sourceTree = ""; }; + AA7558861595D55500BBD41B /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_quit.h; sourceTree = ""; }; + AA7558871595D55500BBD41B /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect.h; sourceTree = ""; }; + AA7558881595D55500BBD41B /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render.h; sourceTree = ""; }; + AA7558891595D55500BBD41B /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_revision.h; sourceTree = ""; }; + AA75588A1595D55500BBD41B /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwops.h; sourceTree = ""; }; + AA75588B1595D55500BBD41B /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scancode.h; sourceTree = ""; }; + AA75588C1595D55500BBD41B /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape.h; sourceTree = ""; }; + AA75588D1595D55500BBD41B /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = ""; }; + AA75588E1595D55500BBD41B /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface.h; sourceTree = ""; }; + AA75588F1595D55500BBD41B /* SDL_system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_system.h; sourceTree = ""; }; + AA7558901595D55500BBD41B /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syswm.h; sourceTree = ""; }; + AA7558911595D55500BBD41B /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread.h; sourceTree = ""; }; + AA7558921595D55500BBD41B /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer.h; sourceTree = ""; }; + AA7558931595D55500BBD41B /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch.h; sourceTree = ""; }; + AA7558941595D55500BBD41B /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_types.h; sourceTree = ""; }; + AA7558951595D55500BBD41B /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = ""; }; + AA7558961595D55500BBD41B /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = ""; }; + AA7558971595D55500BBD41B /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = ""; }; + AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_messagebox.h; sourceTree = ""; }; + AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmessagebox.h; sourceTree = ""; }; + AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitmessagebox.m; sourceTree = ""; }; + AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = ""; }; + FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitview.h; sourceTree = ""; }; + FD3F4A700DEA620800C5B771 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = ""; }; + FD3F4A710DEA620800C5B771 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = ""; }; + FD3F4A720DEA620800C5B771 /* SDL_malloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_malloc.c; sourceTree = ""; }; + FD3F4A730DEA620800C5B771 /* SDL_qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_qsort.c; sourceTree = ""; }; + FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stdlib.c; sourceTree = ""; }; + FD3F4A750DEA620800C5B771 /* SDL_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_string.c; sourceTree = ""; }; + FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = ""; }; + FD5F9D1F0E0E08B3008E885B /* SDL_joystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick_c.h; sourceTree = ""; }; + FD5F9D200E0E08B3008E885B /* SDL_sysjoystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick.h; sourceTree = ""; }; + FD6526630DE8FCCB002AD96B /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; }; + FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_sysjoystick.m; sourceTree = ""; }; + FD689F010E26E5B600F90B21 /* SDLUIAccelerationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLUIAccelerationDelegate.h; sourceTree = ""; }; + FD689F020E26E5B600F90B21 /* SDLUIAccelerationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLUIAccelerationDelegate.m; sourceTree = ""; }; + FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitevents.h; sourceTree = ""; }; + FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitevents.m; sourceTree = ""; }; + FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitopengles.h; sourceTree = ""; }; + FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitopengles.m; sourceTree = ""; }; + FD689F100E26E5D900F90B21 /* SDL_uikitvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitvideo.h; sourceTree = ""; }; + FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitvideo.m; sourceTree = ""; }; + FD689F130E26E5D900F90B21 /* SDL_uikitview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitview.m; sourceTree = ""; }; + FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitwindow.h; sourceTree = ""; }; + FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitwindow.m; sourceTree = ""; }; + FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitopenglview.h; sourceTree = ""; }; + FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitopenglview.m; sourceTree = ""; }; + FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitappdelegate.m; sourceTree = ""; }; + FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitappdelegate.h; sourceTree = ""; }; + FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = ""; }; + FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = ""; }; + FD99B91E0DD52EDC00FB1D6B /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = ""; }; + FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = ""; }; + FD99B9450DD52EDC00FB1D6B /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = ""; }; + FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = ""; }; + FD99B9490DD52EDC00FB1D6B /* SDL_audiomem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiomem.h; sourceTree = ""; }; + FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiotypecvt.c; sourceTree = ""; }; + FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = ""; }; + FD99B9520DD52EDC00FB1D6B /* SDL_sysaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysaudio.h; sourceTree = ""; }; + FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_wave.c; sourceTree = ""; }; + FD99B9540DD52EDC00FB1D6B /* SDL_wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_wave.h; sourceTree = ""; }; + FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_cpuinfo.c; sourceTree = ""; }; + FD99B98D0DD52EDC00FB1D6B /* blank_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blank_cursor.h; sourceTree = ""; }; + FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_cursor.h; sourceTree = ""; }; + FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_darwin.h; sourceTree = ""; }; + FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_linux.h; sourceTree = ""; }; + FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_xfree86.h; sourceTree = ""; }; + FD99B9930DD52EDC00FB1D6B /* SDL_events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_events.c; sourceTree = ""; }; + FD99B9940DD52EDC00FB1D6B /* SDL_events_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events_c.h; sourceTree = ""; }; + FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_keyboard.c; sourceTree = ""; }; + FD99B9960DD52EDC00FB1D6B /* SDL_keyboard_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard_c.h; sourceTree = ""; }; + FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mouse.c; sourceTree = ""; }; + FD99B9980DD52EDC00FB1D6B /* SDL_mouse_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse_c.h; sourceTree = ""; }; + FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_quit.c; sourceTree = ""; }; + FD99B99A0DD52EDC00FB1D6B /* SDL_sysevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysevents.h; sourceTree = ""; }; + FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_windowevents.c; sourceTree = ""; }; + FD99B99C0DD52EDC00FB1D6B /* SDL_windowevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_windowevents_c.h; sourceTree = ""; }; + FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rwops.c; sourceTree = ""; }; + FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_error_c.h; path = ../../src/SDL_error_c.h; sourceTree = ""; }; + FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_error.c; path = ../../src/SDL_error.c; sourceTree = ""; }; + FD99B9D80DD52EDC00FB1D6B /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = ""; }; + FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syscond.c; sourceTree = ""; }; + FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysmutex.c; sourceTree = ""; }; + FD99BA090DD52EDC00FB1D6B /* SDL_sysmutex_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysmutex_c.h; sourceTree = ""; }; + FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syssem.c; sourceTree = ""; }; + FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systhread.c; sourceTree = ""; }; + FD99BA0C0DD52EDC00FB1D6B /* SDL_systhread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread_c.h; sourceTree = ""; }; + FD99BA140DD52EDC00FB1D6B /* SDL_systhread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread.h; sourceTree = ""; }; + FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_thread.c; sourceTree = ""; }; + FD99BA160DD52EDC00FB1D6B /* SDL_thread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread_c.h; sourceTree = ""; }; + FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = ""; }; + FD99BA2F0DD52EDC00FB1D6B /* SDL_timer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer_c.h; sourceTree = ""; }; + FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = ""; }; + FDA683000DF2374E00F98A1A /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = ""; }; + FDA683010DF2374E00F98A1A /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = ""; }; + FDA683020DF2374E00F98A1A /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = ""; }; + FDA683030DF2374E00F98A1A /* SDL_blit_1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_1.c; sourceTree = ""; }; + FDA683040DF2374E00F98A1A /* SDL_blit_A.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_A.c; sourceTree = ""; }; + FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_auto.c; sourceTree = ""; }; + FDA683060DF2374E00F98A1A /* SDL_blit_auto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_auto.h; sourceTree = ""; }; + FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_copy.c; sourceTree = ""; }; + FDA683080DF2374E00F98A1A /* SDL_blit_copy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_copy.h; sourceTree = ""; }; + FDA683090DF2374E00F98A1A /* SDL_blit_N.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_N.c; sourceTree = ""; }; + FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_slow.c; sourceTree = ""; }; + FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = ""; }; + FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = ""; }; + FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = ""; }; + FDA683110DF2374E00F98A1A /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = ""; }; + FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = ""; }; + FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_RLEaccel_c.h; sourceTree = ""; }; + FDA683170DF2374E00F98A1A /* SDL_stretch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stretch.c; sourceTree = ""; }; + FDA683190DF2374E00F98A1A /* SDL_surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_surface.c; sourceTree = ""; }; + FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysvideo.h; sourceTree = ""; }; + FDA6831B0DF2374E00F98A1A /* SDL_video.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video.c; sourceTree = ""; }; + FDA685F50DF244C800F98A1A /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = ""; }; + FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = ""; }; + FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = ""; }; + FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = ""; }; + FDC261780E3A3FC8001C4554 /* keyinfotable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyinfotable.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + 006E9885119552DD001DE610 /* cocoa */ = { + isa = PBXGroup; + children = ( + 006E9886119552DD001DE610 /* SDL_rwopsbundlesupport.h */, + 006E9887119552DD001DE610 /* SDL_rwopsbundlesupport.m */, + ); + path = cocoa; + sourceTree = ""; + }; + 0402A85412FE70C600CECEE3 /* opengles2 */ = { + isa = PBXGroup; + children = ( + 0402A85512FE70C600CECEE3 /* SDL_render_gles2.c */, + 0402A85612FE70C600CECEE3 /* SDL_shaders_gles2.c */, + 0402A85712FE70C600CECEE3 /* SDL_shaders_gles2.h */, + ); + path = opengles2; + sourceTree = ""; + }; + 041B2CE312FA0F680087D585 /* render */ = { + isa = PBXGroup; + children = ( + 041B2CE812FA0F680087D585 /* opengles */, + 0402A85412FE70C600CECEE3 /* opengles2 */, + 041B2CEC12FA0F680087D585 /* software */, + 04409BA212FA989600FB9AA8 /* mmx.h */, + 041B2CEA12FA0F680087D585 /* SDL_render.c */, + 041B2CEB12FA0F680087D585 /* SDL_sysrender.h */, + 04409BA312FA989600FB9AA8 /* SDL_yuv_mmx.c */, + 04409BA412FA989600FB9AA8 /* SDL_yuv_sw_c.h */, + 04409BA512FA989600FB9AA8 /* SDL_yuv_sw.c */, + ); + name = render; + path = ../../src/render; + sourceTree = SOURCE_ROOT; + }; + 041B2CE812FA0F680087D585 /* opengles */ = { + isa = PBXGroup; + children = ( + 0442EC5212FE1C28004C9285 /* SDL_render_gles.c */, + ); + path = opengles; + sourceTree = ""; + }; + 041B2CEC12FA0F680087D585 /* software */ = { + isa = PBXGroup; + children = ( + 04F7806A12FB751400FC43C0 /* SDL_blendfillrect.c */, + 04F7806B12FB751400FC43C0 /* SDL_blendfillrect.h */, + 04F7806C12FB751400FC43C0 /* SDL_blendline.c */, + 04F7806D12FB751400FC43C0 /* SDL_blendline.h */, + 04F7806E12FB751400FC43C0 /* SDL_blendpoint.c */, + 04F7806F12FB751400FC43C0 /* SDL_blendpoint.h */, + 04F7807012FB751400FC43C0 /* SDL_draw.h */, + 04F7807112FB751400FC43C0 /* SDL_drawline.c */, + 04F7807212FB751400FC43C0 /* SDL_drawline.h */, + 04F7807312FB751400FC43C0 /* SDL_drawpoint.c */, + 04F7807412FB751400FC43C0 /* SDL_drawpoint.h */, + 0442EC4F12FE1C1E004C9285 /* SDL_render_sw.c */, + 0442EC4E12FE1C1E004C9285 /* SDL_render_sw_c.h */, + AA628AD9159369E3005138DD /* SDL_rotate.c */, + AA628ADA159369E3005138DD /* SDL_rotate.h */, + ); + path = software; + sourceTree = ""; + }; + 047677B60EA769DF008ABAF1 /* haptic */ = { + isa = PBXGroup; + children = ( + 047677B70EA76A31008ABAF1 /* dummy */, + 047677B90EA76A31008ABAF1 /* SDL_haptic.c */, + 047677BA0EA76A31008ABAF1 /* SDL_syshaptic.h */, + ); + name = haptic; + sourceTree = ""; + }; + 047677B70EA76A31008ABAF1 /* dummy */ = { + isa = PBXGroup; + children = ( + 047677B80EA76A31008ABAF1 /* SDL_syshaptic.c */, + ); + name = dummy; + path = ../../src/haptic/dummy; + sourceTree = SOURCE_ROOT; + }; + 047AF1B10EA98D6C00811173 /* dummy */ = { + isa = PBXGroup; + children = ( + 047AF1B20EA98D6C00811173 /* SDL_sysloadso.c */, + ); + path = dummy; + sourceTree = ""; + }; + 04B2ECEF1025CEB900F9BC5F /* atomic */ = { + isa = PBXGroup; + children = ( + 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */, + 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */, + ); + name = atomic; + path = ../../src/atomic; + sourceTree = SOURCE_ROOT; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + FD6526630DE8FCCB002AD96B /* libSDL2.a */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + FD99B8BC0DD52E5C00FB1D6B /* Public Headers */, + FD99B8BD0DD52E6D00FB1D6B /* Library Source */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 56EA86F813E9EBF9002E47EB /* coreaudio */ = { + isa = PBXGroup; + children = ( + 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */, + 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */, + ); + name = coreaudio; + sourceTree = ""; + }; + 56ED04DE118A8E9A00A56AA6 /* power */ = { + isa = PBXGroup; + children = ( + 56ED04E0118A8EE200A56AA6 /* SDL_power.c */, + 56ED04DF118A8EB700A56AA6 /* uikit */, + ); + name = power; + sourceTree = ""; + }; + 56ED04DF118A8EB700A56AA6 /* uikit */ = { + isa = PBXGroup; + children = ( + 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */, + ); + name = uikit; + sourceTree = ""; + }; + FD3F4A6F0DEA620800C5B771 /* stdlib */ = { + isa = PBXGroup; + children = ( + FD3F4A700DEA620800C5B771 /* SDL_getenv.c */, + FD3F4A710DEA620800C5B771 /* SDL_iconv.c */, + FD3F4A720DEA620800C5B771 /* SDL_malloc.c */, + FD3F4A730DEA620800C5B771 /* SDL_qsort.c */, + FD3F4A740DEA620800C5B771 /* SDL_stdlib.c */, + FD3F4A750DEA620800C5B771 /* SDL_string.c */, + ); + name = stdlib; + path = ../../src/stdlib; + sourceTree = SOURCE_ROOT; + }; + FD5F9D080E0E08B3008E885B /* joystick */ = { + isa = PBXGroup; + children = ( + FD689EFF0E26E5B600F90B21 /* iphoneos */, + AA0AD06116647BBB00CE5896 /* SDL_gamecontroller.c */, + FD5F9D1E0E0E08B3008E885B /* SDL_joystick.c */, + FD5F9D1F0E0E08B3008E885B /* SDL_joystick_c.h */, + FD5F9D200E0E08B3008E885B /* SDL_sysjoystick.h */, + ); + name = joystick; + path = ../../src/joystick; + sourceTree = SOURCE_ROOT; + }; + FD689EFF0E26E5B600F90B21 /* iphoneos */ = { + isa = PBXGroup; + children = ( + FD689F000E26E5B600F90B21 /* SDL_sysjoystick.m */, + FD689F010E26E5B600F90B21 /* SDLUIAccelerationDelegate.h */, + FD689F020E26E5B600F90B21 /* SDLUIAccelerationDelegate.m */, + ); + path = iphoneos; + sourceTree = ""; + }; + FD689F090E26E5D900F90B21 /* uikit */ = { + isa = PBXGroup; + children = ( + FDC261780E3A3FC8001C4554 /* keyinfotable.h */, + FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */, + FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */, + FD689F0C0E26E5D900F90B21 /* SDL_uikitevents.h */, + FD689F0D0E26E5D900F90B21 /* SDL_uikitevents.m */, + AABCC3921640643D00AB8930 /* SDL_uikitmessagebox.h */, + AABCC3931640643D00AB8930 /* SDL_uikitmessagebox.m */, + AA126AD21617C5E6005ABC8F /* SDL_uikitmodes.h */, + AA126AD31617C5E6005ABC8F /* SDL_uikitmodes.m */, + FD689F0E0E26E5D900F90B21 /* SDL_uikitopengles.h */, + FD689F0F0E26E5D900F90B21 /* SDL_uikitopengles.m */, + FD689F160E26E5D900F90B21 /* SDL_uikitopenglview.h */, + FD689F170E26E5D900F90B21 /* SDL_uikitopenglview.m */, + FD689F100E26E5D900F90B21 /* SDL_uikitvideo.h */, + FD689F110E26E5D900F90B21 /* SDL_uikitvideo.m */, + FD0BBFEF0E3933DD00D833B1 /* SDL_uikitview.h */, + FD689F130E26E5D900F90B21 /* SDL_uikitview.m */, + 93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */, + 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */, + FD689F140E26E5D900F90B21 /* SDL_uikitwindow.h */, + FD689F150E26E5D900F90B21 /* SDL_uikitwindow.m */, + ); + path = uikit; + sourceTree = ""; + }; + FD8BD8150E27E25900B52CD5 /* loadso */ = { + isa = PBXGroup; + children = ( + 047AF1B10EA98D6C00811173 /* dummy */, + FD8BD8180E27E25900B52CD5 /* dlopen */, + ); + name = loadso; + path = ../../src/loadso; + sourceTree = SOURCE_ROOT; + }; + FD8BD8180E27E25900B52CD5 /* dlopen */ = { + isa = PBXGroup; + children = ( + FD8BD8190E27E25900B52CD5 /* SDL_sysloadso.c */, + ); + path = dlopen; + sourceTree = ""; + }; + FD99B8BC0DD52E5C00FB1D6B /* Public Headers */ = { + isa = PBXGroup; + children = ( + AA7558651595D55500BBD41B /* begin_code.h */, + AA7558661595D55500BBD41B /* close_code.h */, + AA7558971595D55500BBD41B /* SDL.h */, + AA7558671595D55500BBD41B /* SDL_assert.h */, + AA7558681595D55500BBD41B /* SDL_atomic.h */, + AA7558691595D55500BBD41B /* SDL_audio.h */, + AADA5B8E16CCAB7C00107CF7 /* SDL_bits.h */, + AA75586A1595D55500BBD41B /* SDL_blendmode.h */, + AA75586B1595D55500BBD41B /* SDL_clipboard.h */, + AA75586D1595D55500BBD41B /* SDL_config.h */, + AA75586C1595D55500BBD41B /* SDL_config_iphoneos.h */, + AA75586E1595D55500BBD41B /* SDL_copying.h */, + AA75586F1595D55500BBD41B /* SDL_cpuinfo.h */, + AA7558701595D55500BBD41B /* SDL_endian.h */, + AA7558711595D55500BBD41B /* SDL_error.h */, + AA7558721595D55500BBD41B /* SDL_events.h */, + AA0AD06416647BD400CE5896 /* SDL_gamecontroller.h */, + AA7558731595D55500BBD41B /* SDL_gesture.h */, + AA7558741595D55500BBD41B /* SDL_haptic.h */, + AA7558751595D55500BBD41B /* SDL_hints.h */, + AA7558771595D55500BBD41B /* SDL_joystick.h */, + AA7558781595D55500BBD41B /* SDL_keyboard.h */, + AA7558791595D55500BBD41B /* SDL_keycode.h */, + AA75587A1595D55500BBD41B /* SDL_loadso.h */, + AA75587B1595D55500BBD41B /* SDL_log.h */, + AA75587C1595D55500BBD41B /* SDL_main.h */, + AA9FF9501637C6E5000DF050 /* SDL_messagebox.h */, + AA75587D1595D55500BBD41B /* SDL_mouse.h */, + AA75587E1595D55500BBD41B /* SDL_mutex.h */, + AA75587F1595D55500BBD41B /* SDL_name.h */, + AA7558801595D55500BBD41B /* SDL_opengl.h */, + AA7558811595D55500BBD41B /* SDL_opengles.h */, + AA7558821595D55500BBD41B /* SDL_opengles2.h */, + AA7558831595D55500BBD41B /* SDL_pixels.h */, + AA7558841595D55500BBD41B /* SDL_platform.h */, + AA7558851595D55500BBD41B /* SDL_power.h */, + AA7558861595D55500BBD41B /* SDL_quit.h */, + AA7558871595D55500BBD41B /* SDL_rect.h */, + AA7558881595D55500BBD41B /* SDL_render.h */, + AA7558891595D55500BBD41B /* SDL_revision.h */, + AA75588A1595D55500BBD41B /* SDL_rwops.h */, + AA75588B1595D55500BBD41B /* SDL_scancode.h */, + AA75588C1595D55500BBD41B /* SDL_shape.h */, + AA75588D1595D55500BBD41B /* SDL_stdinc.h */, + AA75588E1595D55500BBD41B /* SDL_surface.h */, + AA75588F1595D55500BBD41B /* SDL_system.h */, + AA7558901595D55500BBD41B /* SDL_syswm.h */, + AA7558911595D55500BBD41B /* SDL_thread.h */, + AA7558921595D55500BBD41B /* SDL_timer.h */, + AA7558931595D55500BBD41B /* SDL_touch.h */, + AA7558941595D55500BBD41B /* SDL_types.h */, + AA7558951595D55500BBD41B /* SDL_version.h */, + AA7558961595D55500BBD41B /* SDL_video.h */, + ); + name = "Public Headers"; + path = ../../include; + sourceTree = ""; + }; + FD99B8BD0DD52E6D00FB1D6B /* Library Source */ = { + isa = PBXGroup; + children = ( + 04B2ECEF1025CEB900F9BC5F /* atomic */, + FD99B8FB0DD52EDC00FB1D6B /* audio */, + FD99B98A0DD52EDC00FB1D6B /* cpuinfo */, + FD99B98C0DD52EDC00FB1D6B /* events */, + FD99B99D0DD52EDC00FB1D6B /* file */, + 047677B60EA769DF008ABAF1 /* haptic */, + FD5F9D080E0E08B3008E885B /* joystick */, + FD8BD8150E27E25900B52CD5 /* loadso */, + 56ED04DE118A8E9A00A56AA6 /* power */, + 041B2CE312FA0F680087D585 /* render */, + FD3F4A6F0DEA620800C5B771 /* stdlib */, + FD99B9E00DD52EDC00FB1D6B /* thread */, + FD99BA1E0DD52EDC00FB1D6B /* timer */, + FDA682420DF2374D00F98A1A /* video */, + 04F2AF551104ABD200D6DDF7 /* SDL_assert.c */, + 04BAC09A1300C1290055DE28 /* SDL_assert_c.h */, + FD99B9D40DD52EDC00FB1D6B /* SDL_error_c.h */, + FD99B9D50DD52EDC00FB1D6B /* SDL_error.c */, + 0442EC5412FE1C3F004C9285 /* SDL_hints.c */, + 04BAC09B1300C1290055DE28 /* SDL_log.c */, + FD99B9D80DD52EDC00FB1D6B /* SDL.c */, + ); + name = "Library Source"; + sourceTree = ""; + }; + FD99B8FB0DD52EDC00FB1D6B /* audio */ = { + isa = PBXGroup; + children = ( + 56EA86F813E9EBF9002E47EB /* coreaudio */, + FD99B91C0DD52EDC00FB1D6B /* dummy */, + FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */, + FD99B9450DD52EDC00FB1D6B /* SDL_audio_c.h */, + FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */, + FD99B9490DD52EDC00FB1D6B /* SDL_audiomem.h */, + FD99B94A0DD52EDC00FB1D6B /* SDL_audiotypecvt.c */, + FD99B94B0DD52EDC00FB1D6B /* SDL_mixer.c */, + FD99B9520DD52EDC00FB1D6B /* SDL_sysaudio.h */, + FD99B9530DD52EDC00FB1D6B /* SDL_wave.c */, + FD99B9540DD52EDC00FB1D6B /* SDL_wave.h */, + ); + name = audio; + path = ../../src/audio; + sourceTree = ""; + }; + FD99B91C0DD52EDC00FB1D6B /* dummy */ = { + isa = PBXGroup; + children = ( + FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */, + FD99B91E0DD52EDC00FB1D6B /* SDL_dummyaudio.h */, + ); + path = dummy; + sourceTree = ""; + }; + FD99B98A0DD52EDC00FB1D6B /* cpuinfo */ = { + isa = PBXGroup; + children = ( + FD99B98B0DD52EDC00FB1D6B /* SDL_cpuinfo.c */, + ); + name = cpuinfo; + path = ../../src/cpuinfo; + sourceTree = ""; + }; + FD99B98C0DD52EDC00FB1D6B /* events */ = { + isa = PBXGroup; + children = ( + FD99B98D0DD52EDC00FB1D6B /* blank_cursor.h */, + FD99B98E0DD52EDC00FB1D6B /* default_cursor.h */, + FD99B98F0DD52EDC00FB1D6B /* scancodes_darwin.h */, + FD99B9900DD52EDC00FB1D6B /* scancodes_linux.h */, + FD99B9920DD52EDC00FB1D6B /* scancodes_xfree86.h */, + 0420496F11E6F03D007E7EC9 /* SDL_clipboardevents.c */, + 0420496E11E6F03D007E7EC9 /* SDL_clipboardevents_c.h */, + AA704DD5162AA90A0076D1C1 /* SDL_dropevents.c */, + AA704DD4162AA90A0076D1C1 /* SDL_dropevents_c.h */, + FD99B9930DD52EDC00FB1D6B /* SDL_events.c */, + FD99B9940DD52EDC00FB1D6B /* SDL_events_c.h */, + 04BA9D6011EF474A00B60E01 /* SDL_gesture.c */, + 04BA9D5F11EF474A00B60E01 /* SDL_gesture_c.h */, + FD99B9950DD52EDC00FB1D6B /* SDL_keyboard.c */, + FD99B9960DD52EDC00FB1D6B /* SDL_keyboard_c.h */, + FD99B9970DD52EDC00FB1D6B /* SDL_mouse.c */, + FD99B9980DD52EDC00FB1D6B /* SDL_mouse_c.h */, + FD99B9990DD52EDC00FB1D6B /* SDL_quit.c */, + FD99B99A0DD52EDC00FB1D6B /* SDL_sysevents.h */, + 04BA9D6211EF474A00B60E01 /* SDL_touch.c */, + 04BA9D6111EF474A00B60E01 /* SDL_touch_c.h */, + FD99B99B0DD52EDC00FB1D6B /* SDL_windowevents.c */, + FD99B99C0DD52EDC00FB1D6B /* SDL_windowevents_c.h */, + ); + name = events; + path = ../../src/events; + sourceTree = ""; + }; + FD99B99D0DD52EDC00FB1D6B /* file */ = { + isa = PBXGroup; + children = ( + 006E9885119552DD001DE610 /* cocoa */, + FD99B99E0DD52EDC00FB1D6B /* SDL_rwops.c */, + ); + name = file; + path = ../../src/file; + sourceTree = ""; + }; + FD99B9E00DD52EDC00FB1D6B /* thread */ = { + isa = PBXGroup; + children = ( + FD99BA060DD52EDC00FB1D6B /* pthread */, + FD99BA140DD52EDC00FB1D6B /* SDL_systhread.h */, + FD99BA150DD52EDC00FB1D6B /* SDL_thread.c */, + FD99BA160DD52EDC00FB1D6B /* SDL_thread_c.h */, + ); + name = thread; + path = ../../src/thread; + sourceTree = ""; + }; + FD99BA060DD52EDC00FB1D6B /* pthread */ = { + isa = PBXGroup; + children = ( + FD99BA070DD52EDC00FB1D6B /* SDL_syscond.c */, + FD99BA080DD52EDC00FB1D6B /* SDL_sysmutex.c */, + FD99BA090DD52EDC00FB1D6B /* SDL_sysmutex_c.h */, + FD99BA0A0DD52EDC00FB1D6B /* SDL_syssem.c */, + FD99BA0B0DD52EDC00FB1D6B /* SDL_systhread.c */, + FD99BA0C0DD52EDC00FB1D6B /* SDL_systhread_c.h */, + AA0F8494178D5F1A00823F9D /* SDL_systls.c */, + ); + path = pthread; + sourceTree = ""; + }; + FD99BA1E0DD52EDC00FB1D6B /* timer */ = { + isa = PBXGroup; + children = ( + FD99BA300DD52EDC00FB1D6B /* unix */, + FD99BA2E0DD52EDC00FB1D6B /* SDL_timer.c */, + FD99BA2F0DD52EDC00FB1D6B /* SDL_timer_c.h */, + ); + name = timer; + path = ../../src/timer; + sourceTree = ""; + }; + FD99BA300DD52EDC00FB1D6B /* unix */ = { + isa = PBXGroup; + children = ( + FD99BA310DD52EDC00FB1D6B /* SDL_systimer.c */, + ); + path = unix; + sourceTree = ""; + }; + FDA682420DF2374D00F98A1A /* video */ = { + isa = PBXGroup; + children = ( + FD689F090E26E5D900F90B21 /* uikit */, + FDA685F40DF244C800F98A1A /* dummy */, + FDA683000DF2374E00F98A1A /* SDL_blit.c */, + FDA683010DF2374E00F98A1A /* SDL_blit.h */, + FDA683020DF2374E00F98A1A /* SDL_blit_0.c */, + FDA683030DF2374E00F98A1A /* SDL_blit_1.c */, + FDA683040DF2374E00F98A1A /* SDL_blit_A.c */, + FDA683050DF2374E00F98A1A /* SDL_blit_auto.c */, + FDA683060DF2374E00F98A1A /* SDL_blit_auto.h */, + FDA683070DF2374E00F98A1A /* SDL_blit_copy.c */, + FDA683080DF2374E00F98A1A /* SDL_blit_copy.h */, + FDA683090DF2374E00F98A1A /* SDL_blit_N.c */, + FDA6830A0DF2374E00F98A1A /* SDL_blit_slow.c */, + 0463873A0F0B5B7D0041FD65 /* SDL_blit_slow.h */, + FDA6830B0DF2374E00F98A1A /* SDL_bmp.c */, + 044E5FB711E606EB0076F181 /* SDL_clipboard.c */, + 0463873E0F0B5B7D0041FD65 /* SDL_fillrect.c */, + FDA6830F0DF2374E00F98A1A /* SDL_pixels.c */, + FDA683100DF2374E00F98A1A /* SDL_pixels_c.h */, + FDA683110DF2374E00F98A1A /* SDL_rect.c */, + FDA683150DF2374E00F98A1A /* SDL_RLEaccel.c */, + FDA683160DF2374E00F98A1A /* SDL_RLEaccel_c.h */, + FDA683170DF2374E00F98A1A /* SDL_stretch.c */, + FDA683190DF2374E00F98A1A /* SDL_surface.c */, + FDA6831A0DF2374E00F98A1A /* SDL_sysvideo.h */, + FDA6831B0DF2374E00F98A1A /* SDL_video.c */, + ); + name = video; + path = ../../src/video; + sourceTree = SOURCE_ROOT; + }; + FDA685F40DF244C800F98A1A /* dummy */ = { + isa = PBXGroup; + children = ( + FDA685F50DF244C800F98A1A /* SDL_nullevents.c */, + FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */, + 04F7808212FB753F00FC43C0 /* SDL_nullframebuffer_c.h */, + 04F7808312FB753F00FC43C0 /* SDL_nullframebuffer.c */, + FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */, + FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */, + ); + path = dummy; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + FD65265F0DE8FCCB002AD96B /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + FDA6844E0DF2374E00F98A1A /* SDL_blit.h in Headers */, + FDA684530DF2374E00F98A1A /* SDL_blit_auto.h in Headers */, + FDA684550DF2374E00F98A1A /* SDL_blit_copy.h in Headers */, + FDA6845D0DF2374E00F98A1A /* SDL_pixels_c.h in Headers */, + FDA684630DF2374E00F98A1A /* SDL_RLEaccel_c.h in Headers */, + FDA684670DF2374E00F98A1A /* SDL_sysvideo.h in Headers */, + FDA685FC0DF244C800F98A1A /* SDL_nullevents_c.h in Headers */, + FDA686000DF244C800F98A1A /* SDL_nullvideo.h in Headers */, + FD5F9D300E0E08B3008E885B /* SDL_joystick_c.h in Headers */, + FD5F9D310E0E08B3008E885B /* SDL_sysjoystick.h in Headers */, + FD689F040E26E5B600F90B21 /* SDLUIAccelerationDelegate.h in Headers */, + FD689F1C0E26E5D900F90B21 /* SDL_uikitevents.h in Headers */, + FD689F1E0E26E5D900F90B21 /* SDL_uikitopengles.h in Headers */, + FD689F200E26E5D900F90B21 /* SDL_uikitvideo.h in Headers */, + FD689F240E26E5D900F90B21 /* SDL_uikitwindow.h in Headers */, + FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */, + FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */, + 047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */, + 046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */, + 006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */, + 0420497011E6F03D007E7EC9 /* SDL_clipboardevents_c.h in Headers */, + 04BA9D6311EF474A00B60E01 /* SDL_gesture_c.h in Headers */, + 04BA9D6511EF474A00B60E01 /* SDL_touch_c.h in Headers */, + 041B2CF212FA0F680087D585 /* SDL_sysrender.h in Headers */, + 04409BA612FA989600FB9AA8 /* mmx.h in Headers */, + 04409BA812FA989600FB9AA8 /* SDL_yuv_sw_c.h in Headers */, + 04F7807712FB751400FC43C0 /* SDL_blendfillrect.h in Headers */, + 04F7807912FB751400FC43C0 /* SDL_blendline.h in Headers */, + 04F7807B12FB751400FC43C0 /* SDL_blendpoint.h in Headers */, + 04F7807C12FB751400FC43C0 /* SDL_draw.h in Headers */, + 04F7807E12FB751400FC43C0 /* SDL_drawline.h in Headers */, + 04F7808012FB751400FC43C0 /* SDL_drawpoint.h in Headers */, + 04F7808412FB753F00FC43C0 /* SDL_nullframebuffer_c.h in Headers */, + 0442EC5012FE1C1E004C9285 /* SDL_render_sw_c.h in Headers */, + 0402A85A12FE70C600CECEE3 /* SDL_shaders_gles2.h in Headers */, + 04BAC09C1300C1290055DE28 /* SDL_assert_c.h in Headers */, + 56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */, + 93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */, + AA628ADC159369E3005138DD /* SDL_rotate.h in Headers */, + AA7558981595D55500BBD41B /* begin_code.h in Headers */, + AA7558991595D55500BBD41B /* close_code.h in Headers */, + AA75589A1595D55500BBD41B /* SDL_assert.h in Headers */, + AA75589B1595D55500BBD41B /* SDL_atomic.h in Headers */, + AA75589C1595D55500BBD41B /* SDL_audio.h in Headers */, + AA75589D1595D55500BBD41B /* SDL_blendmode.h in Headers */, + AA75589E1595D55500BBD41B /* SDL_clipboard.h in Headers */, + AA75589F1595D55500BBD41B /* SDL_config_iphoneos.h in Headers */, + AA7558A01595D55500BBD41B /* SDL_config.h in Headers */, + AA7558A11595D55500BBD41B /* SDL_copying.h in Headers */, + AA7558A21595D55500BBD41B /* SDL_cpuinfo.h in Headers */, + AA7558A31595D55500BBD41B /* SDL_endian.h in Headers */, + AA7558A41595D55500BBD41B /* SDL_error.h in Headers */, + AA7558A51595D55500BBD41B /* SDL_events.h in Headers */, + AA7558A61595D55500BBD41B /* SDL_gesture.h in Headers */, + AA7558A71595D55500BBD41B /* SDL_haptic.h in Headers */, + AA7558A81595D55500BBD41B /* SDL_hints.h in Headers */, + AA7558AA1595D55500BBD41B /* SDL_joystick.h in Headers */, + AA7558AB1595D55500BBD41B /* SDL_keyboard.h in Headers */, + AA7558AC1595D55500BBD41B /* SDL_keycode.h in Headers */, + AA7558AD1595D55500BBD41B /* SDL_loadso.h in Headers */, + AA7558AE1595D55500BBD41B /* SDL_log.h in Headers */, + AA7558AF1595D55500BBD41B /* SDL_main.h in Headers */, + AA7558B01595D55500BBD41B /* SDL_mouse.h in Headers */, + AA7558B11595D55500BBD41B /* SDL_mutex.h in Headers */, + AA7558B21595D55500BBD41B /* SDL_name.h in Headers */, + AA7558B31595D55500BBD41B /* SDL_opengl.h in Headers */, + AA7558B41595D55500BBD41B /* SDL_opengles.h in Headers */, + AA7558B51595D55500BBD41B /* SDL_opengles2.h in Headers */, + AA7558B61595D55500BBD41B /* SDL_pixels.h in Headers */, + AA7558B71595D55500BBD41B /* SDL_platform.h in Headers */, + AA7558B81595D55500BBD41B /* SDL_power.h in Headers */, + AA7558B91595D55500BBD41B /* SDL_quit.h in Headers */, + AA7558BA1595D55500BBD41B /* SDL_rect.h in Headers */, + AA7558BB1595D55500BBD41B /* SDL_render.h in Headers */, + AA7558BC1595D55500BBD41B /* SDL_revision.h in Headers */, + AA7558BD1595D55500BBD41B /* SDL_rwops.h in Headers */, + AA7558BE1595D55500BBD41B /* SDL_scancode.h in Headers */, + AA7558BF1595D55500BBD41B /* SDL_shape.h in Headers */, + AA7558C01595D55500BBD41B /* SDL_stdinc.h in Headers */, + AA7558C11595D55500BBD41B /* SDL_surface.h in Headers */, + AA7558C21595D55500BBD41B /* SDL_system.h in Headers */, + AA7558C31595D55500BBD41B /* SDL_syswm.h in Headers */, + AA7558C41595D55500BBD41B /* SDL_thread.h in Headers */, + AA7558C51595D55500BBD41B /* SDL_timer.h in Headers */, + AA7558C61595D55500BBD41B /* SDL_touch.h in Headers */, + AA7558C71595D55500BBD41B /* SDL_types.h in Headers */, + AA7558C81595D55500BBD41B /* SDL_version.h in Headers */, + AA7558C91595D55500BBD41B /* SDL_video.h in Headers */, + AA7558CA1595D55500BBD41B /* SDL.h in Headers */, + AA126AD41617C5E7005ABC8F /* SDL_uikitmodes.h in Headers */, + AA704DD6162AA90A0076D1C1 /* SDL_dropevents_c.h in Headers */, + AA9FF9511637C6E5000DF050 /* SDL_messagebox.h in Headers */, + AABCC3941640643D00AB8930 /* SDL_uikitmessagebox.h in Headers */, + AA0AD06516647BD400CE5896 /* SDL_gamecontroller.h in Headers */, + AADA5B8F16CCAB7C00107CF7 /* SDL_bits.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + FD6526620DE8FCCB002AD96B /* libSDL */ = { + isa = PBXNativeTarget; + buildConfigurationList = FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */; + buildPhases = ( + FD65265F0DE8FCCB002AD96B /* Headers */, + FD6526600DE8FCCB002AD96B /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = libSDL; + productName = iPhoneSDLStaticLib; + productReference = FD6526630DE8FCCB002AD96B /* libSDL2.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDL" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ../..; + targets = ( + FD6526620DE8FCCB002AD96B /* libSDL */, + 00B4F48B12F6A69C0084EC00 /* PrepareXcodeProjectTemplate */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 00B4F48A12F6A69C0084EC00 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SYMROOT)/$CONFIGURATION-Universal/libSDL.a", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# clean up the framework, remove headers, extra files\n\ntemp=$BUILD_DIR/$BUILD_STYLE-template\n# Wrong! 1. Can't assume location of Xcode directory (use xcode-select)\n# 2. Project templates should go in Application Support directories anyway.\ntemplate_dir_name=\"SDL iOS Application\"\n# dest=\"$(HOME)/Library/Application Support/Developer/Shared/Xcode/Project Templates/SDL/SDL iOS Application\"\nrsync_flags=\"--exclude *.svn --links -r\"\n\n# mkdir -p $dest\nmkdir -p $temp\nmkdir -p \"$temp/$template_dir_name/SDL/lib/\"\nmkdir -p \"$temp/$template_dir_name/SDL/include\"\n\n# copy template\nrsync $rsync_flags \"../template/$template_dir_name\" $temp/\n\n# copy Universal libSDL.a\nrsync $rsync_flags -r $SYMROOT/$CONFIGURATION-Universal/libSDL.a \"$temp/$template_dir_name/SDL/lib/\"\n\n# copy headers\nrsync $rsync_flags ../../include/ \"$temp/$template_dir_name/SDL/include\"\n\n#install (nah, don't install)\n# cp -fr \"$temp/$template_dir_name\" \"$dest\""; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FD6526600DE8FCCB002AD96B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD6526810DE8FCDD002AD96B /* SDL_systimer.c in Sources */, + FD6526800DE8FCDD002AD96B /* SDL_timer.c in Sources */, + FD3F4A7B0DEA620800C5B771 /* SDL_string.c in Sources */, + FD6526660DE8FCDD002AD96B /* SDL_dummyaudio.c in Sources */, + FD6526670DE8FCDD002AD96B /* SDL_audio.c in Sources */, + FD6526680DE8FCDD002AD96B /* SDL_audiocvt.c in Sources */, + FD65266A0DE8FCDD002AD96B /* SDL_audiotypecvt.c in Sources */, + FD65266B0DE8FCDD002AD96B /* SDL_mixer.c in Sources */, + FD65266F0DE8FCDD002AD96B /* SDL_wave.c in Sources */, + FD6526700DE8FCDD002AD96B /* SDL_cpuinfo.c in Sources */, + FD6526710DE8FCDD002AD96B /* SDL_events.c in Sources */, + FD6526720DE8FCDD002AD96B /* SDL_keyboard.c in Sources */, + FD6526730DE8FCDD002AD96B /* SDL_mouse.c in Sources */, + FD6526740DE8FCDD002AD96B /* SDL_quit.c in Sources */, + FD6526750DE8FCDD002AD96B /* SDL_windowevents.c in Sources */, + FD6526760DE8FCDD002AD96B /* SDL_rwops.c in Sources */, + FD6526780DE8FCDD002AD96B /* SDL_error.c in Sources */, + FD65267A0DE8FCDD002AD96B /* SDL.c in Sources */, + FD65267B0DE8FCDD002AD96B /* SDL_syscond.c in Sources */, + FD65267C0DE8FCDD002AD96B /* SDL_sysmutex.c in Sources */, + FD65267D0DE8FCDD002AD96B /* SDL_syssem.c in Sources */, + FD65267E0DE8FCDD002AD96B /* SDL_systhread.c in Sources */, + FD65267F0DE8FCDD002AD96B /* SDL_thread.c in Sources */, + FD3F4A760DEA620800C5B771 /* SDL_getenv.c in Sources */, + FD3F4A770DEA620800C5B771 /* SDL_iconv.c in Sources */, + FD3F4A780DEA620800C5B771 /* SDL_malloc.c in Sources */, + FD3F4A790DEA620800C5B771 /* SDL_qsort.c in Sources */, + FD3F4A7A0DEA620800C5B771 /* SDL_stdlib.c in Sources */, + FDA6844D0DF2374E00F98A1A /* SDL_blit.c in Sources */, + FDA6844F0DF2374E00F98A1A /* SDL_blit_0.c in Sources */, + FDA684500DF2374E00F98A1A /* SDL_blit_1.c in Sources */, + FDA684510DF2374E00F98A1A /* SDL_blit_A.c in Sources */, + FDA684520DF2374E00F98A1A /* SDL_blit_auto.c in Sources */, + FDA684540DF2374E00F98A1A /* SDL_blit_copy.c in Sources */, + FDA684560DF2374E00F98A1A /* SDL_blit_N.c in Sources */, + FDA684570DF2374E00F98A1A /* SDL_blit_slow.c in Sources */, + FDA684580DF2374E00F98A1A /* SDL_bmp.c in Sources */, + FDA6845C0DF2374E00F98A1A /* SDL_pixels.c in Sources */, + FDA6845E0DF2374E00F98A1A /* SDL_rect.c in Sources */, + FDA684620DF2374E00F98A1A /* SDL_RLEaccel.c in Sources */, + FDA684640DF2374E00F98A1A /* SDL_stretch.c in Sources */, + FDA684660DF2374E00F98A1A /* SDL_surface.c in Sources */, + FDA684680DF2374E00F98A1A /* SDL_video.c in Sources */, + FDA685FB0DF244C800F98A1A /* SDL_nullevents.c in Sources */, + FDA685FF0DF244C800F98A1A /* SDL_nullvideo.c in Sources */, + FD5F9D2F0E0E08B3008E885B /* SDL_joystick.c in Sources */, + FD689F030E26E5B600F90B21 /* SDL_sysjoystick.m in Sources */, + FD689F050E26E5B600F90B21 /* SDLUIAccelerationDelegate.m in Sources */, + FD689F1D0E26E5D900F90B21 /* SDL_uikitevents.m in Sources */, + FD689F1F0E26E5D900F90B21 /* SDL_uikitopengles.m in Sources */, + FD689F210E26E5D900F90B21 /* SDL_uikitvideo.m in Sources */, + FD689F230E26E5D900F90B21 /* SDL_uikitview.m in Sources */, + FD689F250E26E5D900F90B21 /* SDL_uikitwindow.m in Sources */, + FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */, + FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */, + FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */, + 047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */, + 047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */, + 047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */, + 046387460F0B5B7D0041FD65 /* SDL_fillrect.c in Sources */, + 04F2AF561104ABD200D6DDF7 /* SDL_assert.c in Sources */, + 56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */, + 56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */, + 006E9889119552DD001DE610 /* SDL_rwopsbundlesupport.m in Sources */, + 044E5FB811E606EB0076F181 /* SDL_clipboard.c in Sources */, + 0420497111E6F03D007E7EC9 /* SDL_clipboardevents.c in Sources */, + 04BA9D6411EF474A00B60E01 /* SDL_gesture.c in Sources */, + 04BA9D6611EF474A00B60E01 /* SDL_touch.c in Sources */, + 04FFAB8B12E23B8D00BA343D /* SDL_atomic.c in Sources */, + 04FFAB8C12E23B8D00BA343D /* SDL_spinlock.c in Sources */, + 041B2CF112FA0F680087D585 /* SDL_render.c in Sources */, + 04409BA712FA989600FB9AA8 /* SDL_yuv_mmx.c in Sources */, + 04409BA912FA989600FB9AA8 /* SDL_yuv_sw.c in Sources */, + 04F7807612FB751400FC43C0 /* SDL_blendfillrect.c in Sources */, + 04F7807812FB751400FC43C0 /* SDL_blendline.c in Sources */, + 04F7807A12FB751400FC43C0 /* SDL_blendpoint.c in Sources */, + 04F7807D12FB751400FC43C0 /* SDL_drawline.c in Sources */, + 04F7807F12FB751400FC43C0 /* SDL_drawpoint.c in Sources */, + 04F7808512FB753F00FC43C0 /* SDL_nullframebuffer.c in Sources */, + 0442EC5112FE1C1E004C9285 /* SDL_render_sw.c in Sources */, + 0442EC5312FE1C28004C9285 /* SDL_render_gles.c in Sources */, + 0442EC5512FE1C3F004C9285 /* SDL_hints.c in Sources */, + 0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */, + 0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */, + 04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */, + 56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */, + 93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */, + AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */, + AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */, + AA704DD7162AA90A0076D1C1 /* SDL_dropevents.c in Sources */, + AABCC3951640643D00AB8930 /* SDL_uikitmessagebox.m in Sources */, + AA0AD06216647BBB00CE5896 /* SDL_gamecontroller.c in Sources */, + AA0F8495178D5F1A00823F9D /* SDL_systls.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 00B4F48C12F6A69C0084EC00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = PrepareXcodeProjectTemplate; + }; + name = Debug; + }; + 00B4F48D12F6A69C0084EC00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + PRODUCT_NAME = PrepareXcodeProjectTemplate; + ZERO_LINK = NO; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + FD6526640DE8FCCB002AD96B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + PRODUCT_NAME = SDL2; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + FD6526650DE8FCCB002AD96B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + PRODUCT_NAME = SDL2; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 00B4F48E12F6A6BA0084EC00 /* Build configuration list for PBXAggregateTarget "PrepareXcodeProjectTemplate" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 00B4F48C12F6A69C0084EC00 /* Debug */, + 00B4F48D12F6A69C0084EC00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDL" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FD6526990DE8FD14002AD96B /* Build configuration list for PBXNativeTarget "libSDL" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FD6526640DE8FCCB002AD96B /* Debug */, + FD6526650DE8FCCB002AD96B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj b/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..0995735e97 --- /dev/null +++ b/Xcode-iOS/SDLtest/SDL2test.xcodeproj/project.pbxproj @@ -0,0 +1,272 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + AA1EE462176059AB0029C7A5 /* SDL_test_common.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE454176059AB0029C7A5 /* SDL_test_common.c */; }; + AA1EE463176059AB0029C7A5 /* SDL_test_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */; }; + AA1EE464176059AB0029C7A5 /* SDL_test_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */; }; + AA1EE465176059AB0029C7A5 /* SDL_test_font.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE457176059AB0029C7A5 /* SDL_test_font.c */; }; + AA1EE466176059AB0029C7A5 /* SDL_test_fuzzer.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */; }; + AA1EE467176059AB0029C7A5 /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */; }; + AA1EE468176059AB0029C7A5 /* SDL_test_imageBlit.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */; }; + AA1EE469176059AB0029C7A5 /* SDL_test_imageBlitBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */; }; + AA1EE46A176059AB0029C7A5 /* SDL_test_imageFace.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */; }; + AA1EE46B176059AB0029C7A5 /* SDL_test_imagePrimitives.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */; }; + AA1EE46C176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */; }; + AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */; }; + AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */; }; + AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = AA1EE461176059AB0029C7A5 /* SDL_test_random.c */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + AA1EE4461760589B0029C7A5 /* libSDL2test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2test.a; sourceTree = BUILT_PRODUCTS_DIR; }; + AA1EE454176059AB0029C7A5 /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = ""; }; + AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = ""; }; + AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = ""; }; + AA1EE457176059AB0029C7A5 /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = ""; }; + AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = ""; }; + AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = ""; }; + AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = ""; }; + AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = ""; }; + AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = ""; }; + AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = ""; }; + AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = ""; }; + AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = ""; }; + AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = ""; }; + AA1EE461176059AB0029C7A5 /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + AA1EE4431760589B0029C7A5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + AA1EE43D1760589B0029C7A5 = { + isa = PBXGroup; + children = ( + AA1EE453176059770029C7A5 /* Library Source */, + AA1EE4471760589B0029C7A5 /* Products */, + ); + sourceTree = ""; + }; + AA1EE4471760589B0029C7A5 /* Products */ = { + isa = PBXGroup; + children = ( + AA1EE4461760589B0029C7A5 /* libSDL2test.a */, + ); + name = Products; + sourceTree = ""; + }; + AA1EE453176059770029C7A5 /* Library Source */ = { + isa = PBXGroup; + children = ( + AA1EE454176059AB0029C7A5 /* SDL_test_common.c */, + AA1EE455176059AB0029C7A5 /* SDL_test_compare.c */, + AA1EE456176059AB0029C7A5 /* SDL_test_crc32.c */, + AA1EE457176059AB0029C7A5 /* SDL_test_font.c */, + AA1EE458176059AB0029C7A5 /* SDL_test_fuzzer.c */, + AA1EE459176059AB0029C7A5 /* SDL_test_harness.c */, + AA1EE45A176059AB0029C7A5 /* SDL_test_imageBlit.c */, + AA1EE45B176059AB0029C7A5 /* SDL_test_imageBlitBlend.c */, + AA1EE45C176059AB0029C7A5 /* SDL_test_imageFace.c */, + AA1EE45D176059AB0029C7A5 /* SDL_test_imagePrimitives.c */, + AA1EE45E176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c */, + AA1EE45F176059AB0029C7A5 /* SDL_test_log.c */, + AA1EE460176059AB0029C7A5 /* SDL_test_md5.c */, + AA1EE461176059AB0029C7A5 /* SDL_test_random.c */, + ); + name = "Library Source"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + AA1EE4441760589B0029C7A5 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + AA1EE4451760589B0029C7A5 /* SDL2test */ = { + isa = PBXNativeTarget; + buildConfigurationList = AA1EE44A1760589B0029C7A5 /* Build configuration list for PBXNativeTarget "SDL2test" */; + buildPhases = ( + AA1EE4421760589B0029C7A5 /* Sources */, + AA1EE4431760589B0029C7A5 /* Frameworks */, + AA1EE4441760589B0029C7A5 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SDL2test; + productName = SDL2test; + productReference = AA1EE4461760589B0029C7A5 /* libSDL2test.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + AA1EE43E1760589B0029C7A5 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0460; + ORGANIZATIONNAME = "Sam Lantinga"; + }; + buildConfigurationList = AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = AA1EE43D1760589B0029C7A5; + productRefGroup = AA1EE4471760589B0029C7A5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + AA1EE4451760589B0029C7A5 /* SDL2test */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + AA1EE4421760589B0029C7A5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE462176059AB0029C7A5 /* SDL_test_common.c in Sources */, + AA1EE463176059AB0029C7A5 /* SDL_test_compare.c in Sources */, + AA1EE464176059AB0029C7A5 /* SDL_test_crc32.c in Sources */, + AA1EE465176059AB0029C7A5 /* SDL_test_font.c in Sources */, + AA1EE466176059AB0029C7A5 /* SDL_test_fuzzer.c in Sources */, + AA1EE467176059AB0029C7A5 /* SDL_test_harness.c in Sources */, + AA1EE468176059AB0029C7A5 /* SDL_test_imageBlit.c in Sources */, + AA1EE469176059AB0029C7A5 /* SDL_test_imageBlitBlend.c in Sources */, + AA1EE46A176059AB0029C7A5 /* SDL_test_imageFace.c in Sources */, + AA1EE46B176059AB0029C7A5 /* SDL_test_imagePrimitives.c in Sources */, + AA1EE46C176059AB0029C7A5 /* SDL_test_imagePrimitivesBlend.c in Sources */, + AA1EE46D176059AB0029C7A5 /* SDL_test_log.c in Sources */, + AA1EE46E176059AB0029C7A5 /* SDL_test_md5.c in Sources */, + AA1EE46F176059AB0029C7A5 /* SDL_test_random.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + AA1EE4481760589B0029C7A5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + AA1EE4491760589B0029C7A5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = iphoneos; + }; + name = Release; + }; + AA1EE44B1760589B0029C7A5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + EXECUTABLE_PREFIX = lib; + HEADER_SEARCH_PATHS = ../../include; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + AA1EE44C1760589B0029C7A5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + EXECUTABLE_PREFIX = lib; + HEADER_SEARCH_PATHS = ../../include; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + AA1EE4411760589B0029C7A5 /* Build configuration list for PBXProject "SDL2test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AA1EE4481760589B0029C7A5 /* Debug */, + AA1EE4491760589B0029C7A5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AA1EE44A1760589B0029C7A5 /* Build configuration list for PBXNativeTarget "SDL2test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AA1EE44B1760589B0029C7A5 /* Debug */, + AA1EE44C1760589B0029C7A5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = AA1EE43E1760589B0029C7A5 /* Project object */; +} diff --git a/Xcode-iOS/Template/SDL iOS Application/Default.png b/Xcode-iOS/Template/SDL iOS Application/Default.png new file mode 100644 index 0000000000..f91282875a Binary files /dev/null and b/Xcode-iOS/Template/SDL iOS Application/Default.png differ diff --git a/Xcode-iOS/Template/SDL iOS Application/Icon.png b/Xcode-iOS/Template/SDL iOS Application/Icon.png new file mode 100644 index 0000000000..83f4d10a21 Binary files /dev/null and b/Xcode-iOS/Template/SDL iOS Application/Icon.png differ diff --git a/Xcode-iOS/Template/SDL iOS Application/Info.plist b/Xcode-iOS/Template/SDL iOS Application/Info.plist new file mode 100644 index 0000000000..b8089dca2d --- /dev/null +++ b/Xcode-iOS/Template/SDL iOS Application/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + Icon + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + + diff --git a/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns new file mode 100644 index 0000000000..4500ce2bbd Binary files /dev/null and b/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns differ diff --git a/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist new file mode 100644 index 0000000000..498e37d4f7 --- /dev/null +++ b/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist @@ -0,0 +1,10 @@ + + + + + Description + This project builds an SDL based project for iPhone OS using C or Objective-C. It includes everything you need to get up and running with SDL on iPhone. + CFBundleIconFile + Icon.png + + diff --git a/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj new file mode 100755 index 0000000000..3e0eb0c807 --- /dev/null +++ b/Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj @@ -0,0 +1,403 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 0097E2D912F70C4E00724AC5 /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0097E2D512F70C4D00724AC5 /* libSDL.a */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; }; + 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; }; + FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779EDD0E26BA1200F39101 /* CoreAudio.framework */; }; + FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07C0E26BD8C00F39101 /* Icon.png */; }; + FD77A07F0E26BDA900F39101 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07E0E26BDA900F39101 /* Default.png */; }; + FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD77A0840E26BDB800F39101 /* AudioToolbox.framework */; }; + FD77A09D0E26BDE500F39101 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = FD77A09C0E26BDE500F39101 /* main.c */; }; + FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 0097E29A12F70C4D00724AC5 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = ""; }; + 0097E29B12F70C4D00724AC5 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = ""; }; + 0097E29C12F70C4D00724AC5 /* doxyfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = doxyfile; sourceTree = ""; }; + 0097E29D12F70C4D00724AC5 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = ""; }; + 0097E29E12F70C4D00724AC5 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = ""; }; + 0097E29F12F70C4D00724AC5 /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_atomic.h; sourceTree = ""; }; + 0097E2A012F70C4D00724AC5 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio.h; sourceTree = ""; }; + 0097E2A112F70C4D00724AC5 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendmode.h; sourceTree = ""; }; + 0097E2A212F70C4D00724AC5 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard.h; sourceTree = ""; }; + 0097E2A312F70C4D00724AC5 /* SDL_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_compat.h; sourceTree = ""; }; + 0097E2A412F70C4D00724AC5 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = ""; }; + 0097E2A512F70C4D00724AC5 /* SDL_config.h.default */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SDL_config.h.default; sourceTree = ""; }; + 0097E2A612F70C4D00724AC5 /* SDL_config.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SDL_config.h.in; sourceTree = ""; }; + 0097E2A712F70C4D00724AC5 /* SDL_config_android.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_android.h; sourceTree = ""; }; + 0097E2A812F70C4D00724AC5 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_iphoneos.h; sourceTree = ""; }; + 0097E2A912F70C4D00724AC5 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_macosx.h; sourceTree = ""; }; + 0097E2AA12F70C4D00724AC5 /* SDL_config_minimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_minimal.h; sourceTree = ""; }; + 0097E2AC12F70C4D00724AC5 /* SDL_config_pandora.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_pandora.h; sourceTree = ""; }; + 0097E2AD12F70C4D00724AC5 /* SDL_config_windows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_windows.h; sourceTree = ""; }; + 0097E2AE12F70C4D00724AC5 /* SDL_config_wiz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_wiz.h; sourceTree = ""; }; + 0097E2AF12F70C4D00724AC5 /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_copying.h; sourceTree = ""; }; + 0097E2B012F70C4D00724AC5 /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cpuinfo.h; sourceTree = ""; }; + 0097E2B112F70C4D00724AC5 /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = ""; }; + 0097E2B212F70C4D00724AC5 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = ""; }; + 0097E2B312F70C4D00724AC5 /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = ""; }; + 0097E2B412F70C4D00724AC5 /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture.h; sourceTree = ""; }; + 0097E2B512F70C4D00724AC5 /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic.h; sourceTree = ""; }; + 0097E2B612F70C4D00724AC5 /* SDL_input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_input.h; sourceTree = ""; }; + 0097E2B712F70C4D00724AC5 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = ""; }; + 0097E2B812F70C4D00724AC5 /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = ""; }; + 0097E2B912F70C4D00724AC5 /* SDL_keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keysym.h; sourceTree = ""; }; + 0097E2BA12F70C4D00724AC5 /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_loadso.h; sourceTree = ""; }; + 0097E2BB12F70C4D00724AC5 /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main.h; sourceTree = ""; }; + 0097E2BC12F70C4D00724AC5 /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = ""; }; + 0097E2BD12F70C4D00724AC5 /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mutex.h; sourceTree = ""; }; + 0097E2BE12F70C4D00724AC5 /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_name.h; sourceTree = ""; }; + 0097E2BF12F70C4D00724AC5 /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengl.h; sourceTree = ""; }; + 0097E2C012F70C4D00724AC5 /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles.h; sourceTree = ""; }; + 0097E2C112F70C4D00724AC5 /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels.h; sourceTree = ""; }; + 0097E2C212F70C4D00724AC5 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = ""; }; + 0097E2C312F70C4D00724AC5 /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_power.h; sourceTree = ""; }; + 0097E2C412F70C4D00724AC5 /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_quit.h; sourceTree = ""; }; + 0097E2C512F70C4D00724AC5 /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect.h; sourceTree = ""; }; + 0097E2C612F70C4D00724AC5 /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_revision.h; sourceTree = ""; }; + 0097E2C712F70C4D00724AC5 /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwops.h; sourceTree = ""; }; + 0097E2C812F70C4D00724AC5 /* SDL_scalemode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scalemode.h; sourceTree = ""; }; + 0097E2C912F70C4D00724AC5 /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scancode.h; sourceTree = ""; }; + 0097E2CA12F70C4D00724AC5 /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape.h; sourceTree = ""; }; + 0097E2CB12F70C4D00724AC5 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = ""; }; + 0097E2CC12F70C4D00724AC5 /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface.h; sourceTree = ""; }; + 0097E2CD12F70C4D00724AC5 /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syswm.h; sourceTree = ""; }; + 0097E2CE12F70C4D00724AC5 /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread.h; sourceTree = ""; }; + 0097E2CF12F70C4D00724AC5 /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer.h; sourceTree = ""; }; + 0097E2D012F70C4D00724AC5 /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch.h; sourceTree = ""; }; + 0097E2D112F70C4D00724AC5 /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_types.h; sourceTree = ""; }; + 0097E2D212F70C4D00724AC5 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = ""; }; + 0097E2D312F70C4D00724AC5 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = ""; }; + 0097E2D512F70C4D00724AC5 /* libSDL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL.a; sourceTree = ""; }; + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FD779EDD0E26BA1200F39101 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + FD77A07C0E26BD8C00F39101 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; + FD77A07E0E26BDA900F39101 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + FD77A0840E26BDB800F39101 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + FD77A09C0E26BDE500F39101 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; + FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */, + 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */, + FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */, + FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */, + FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */, + 0097E2D912F70C4E00724AC5 /* libSDL.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0097E29812F70C4D00724AC5 /* SDL */ = { + isa = PBXGroup; + children = ( + 0097E29912F70C4D00724AC5 /* include */, + 0097E2D412F70C4D00724AC5 /* lib */, + ); + path = SDL; + sourceTree = ""; + }; + 0097E29912F70C4D00724AC5 /* include */ = { + isa = PBXGroup; + children = ( + 0097E29A12F70C4D00724AC5 /* begin_code.h */, + 0097E29B12F70C4D00724AC5 /* close_code.h */, + 0097E29C12F70C4D00724AC5 /* doxyfile */, + 0097E29D12F70C4D00724AC5 /* SDL.h */, + 0097E29E12F70C4D00724AC5 /* SDL_assert.h */, + 0097E29F12F70C4D00724AC5 /* SDL_atomic.h */, + 0097E2A012F70C4D00724AC5 /* SDL_audio.h */, + 0097E2A112F70C4D00724AC5 /* SDL_blendmode.h */, + 0097E2A212F70C4D00724AC5 /* SDL_clipboard.h */, + 0097E2A312F70C4D00724AC5 /* SDL_compat.h */, + 0097E2A412F70C4D00724AC5 /* SDL_config.h */, + 0097E2A512F70C4D00724AC5 /* SDL_config.h.default */, + 0097E2A612F70C4D00724AC5 /* SDL_config.h.in */, + 0097E2A712F70C4D00724AC5 /* SDL_config_android.h */, + 0097E2A812F70C4D00724AC5 /* SDL_config_iphoneos.h */, + 0097E2A912F70C4D00724AC5 /* SDL_config_macosx.h */, + 0097E2AA12F70C4D00724AC5 /* SDL_config_minimal.h */, + 0097E2AC12F70C4D00724AC5 /* SDL_config_pandora.h */, + 0097E2AD12F70C4D00724AC5 /* SDL_config_windows.h */, + 0097E2AE12F70C4D00724AC5 /* SDL_config_wiz.h */, + 0097E2AF12F70C4D00724AC5 /* SDL_copying.h */, + 0097E2B012F70C4D00724AC5 /* SDL_cpuinfo.h */, + 0097E2B112F70C4D00724AC5 /* SDL_endian.h */, + 0097E2B212F70C4D00724AC5 /* SDL_error.h */, + 0097E2B312F70C4D00724AC5 /* SDL_events.h */, + 0097E2B412F70C4D00724AC5 /* SDL_gesture.h */, + 0097E2B512F70C4D00724AC5 /* SDL_haptic.h */, + 0097E2B612F70C4D00724AC5 /* SDL_input.h */, + 0097E2B712F70C4D00724AC5 /* SDL_joystick.h */, + 0097E2B812F70C4D00724AC5 /* SDL_keyboard.h */, + 0097E2B912F70C4D00724AC5 /* SDL_keysym.h */, + 0097E2BA12F70C4D00724AC5 /* SDL_loadso.h */, + 0097E2BB12F70C4D00724AC5 /* SDL_main.h */, + 0097E2BC12F70C4D00724AC5 /* SDL_mouse.h */, + 0097E2BD12F70C4D00724AC5 /* SDL_mutex.h */, + 0097E2BE12F70C4D00724AC5 /* SDL_name.h */, + 0097E2BF12F70C4D00724AC5 /* SDL_opengl.h */, + 0097E2C012F70C4D00724AC5 /* SDL_opengles.h */, + 0097E2C112F70C4D00724AC5 /* SDL_pixels.h */, + 0097E2C212F70C4D00724AC5 /* SDL_platform.h */, + 0097E2C312F70C4D00724AC5 /* SDL_power.h */, + 0097E2C412F70C4D00724AC5 /* SDL_quit.h */, + 0097E2C512F70C4D00724AC5 /* SDL_rect.h */, + 0097E2C612F70C4D00724AC5 /* SDL_revision.h */, + 0097E2C712F70C4D00724AC5 /* SDL_rwops.h */, + 0097E2C812F70C4D00724AC5 /* SDL_scalemode.h */, + 0097E2C912F70C4D00724AC5 /* SDL_scancode.h */, + 0097E2CA12F70C4D00724AC5 /* SDL_shape.h */, + 0097E2CB12F70C4D00724AC5 /* SDL_stdinc.h */, + 0097E2CC12F70C4D00724AC5 /* SDL_surface.h */, + 0097E2CD12F70C4D00724AC5 /* SDL_syswm.h */, + 0097E2CE12F70C4D00724AC5 /* SDL_thread.h */, + 0097E2CF12F70C4D00724AC5 /* SDL_timer.h */, + 0097E2D012F70C4D00724AC5 /* SDL_touch.h */, + 0097E2D112F70C4D00724AC5 /* SDL_types.h */, + 0097E2D212F70C4D00724AC5 /* SDL_version.h */, + 0097E2D312F70C4D00724AC5 /* SDL_video.h */, + ); + path = include; + sourceTree = ""; + }; + 0097E2D412F70C4D00724AC5 /* lib */ = { + isa = PBXGroup; + children = ( + 0097E2D512F70C4D00724AC5 /* libSDL.a */, + ); + path = lib; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 29B97315FDCFA39411CA2CEA /* Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 0097E29812F70C4D00724AC5 /* SDL */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Sources */ = { + isa = PBXGroup; + children = ( + FD77A09C0E26BDE500F39101 /* main.c */, + ); + name = Sources; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + FD77A07E0E26BDA900F39101 /* Default.png */, + FD77A07C0E26BD8C00F39101 /* Icon.png */, + 8D1107310486CEB800E47090 /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */, + FD77A0840E26BDB800F39101 /* AudioToolbox.framework */, + FD779EDD0E26BA1200F39101 /* CoreAudio.framework */, + 28FD15070DC6FC5B0079059D /* QuartzCore.framework */, + 28FD14FF0DC6FC520079059D /* OpenGLES.framework */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "___PROJECTNAME___"; + productName = "___PROJECTNAME___"; + productReference = 1D6058910D05DD3D006BFB54 /* ___PROJECTNAME___.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* ___PROJECTNAME___ */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD77A07D0E26BD8C00F39101 /* Icon.png in Resources */, + FD77A07F0E26BDA900F39101 /* Default.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD77A09D0E26BDE500F39101 /* main.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/SDL/lib\"", + ); + PRODUCT_NAME = "___PROJECTNAME___"; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/SDL/lib\"", + ); + PRODUCT_NAME = "___PROJECTNAME___"; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ""; + PREBINDING = NO; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_CFLAGS = ""; + PREBINDING = NO; + SDKROOT = iphoneos; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Xcode-iOS/Template/SDL iOS Application/main.c b/Xcode-iOS/Template/SDL iOS Application/main.c new file mode 100644 index 0000000000..8dc00706f3 --- /dev/null +++ b/Xcode-iOS/Template/SDL iOS Application/main.c @@ -0,0 +1,98 @@ +/* + * rectangles.c + * written by Holmes Futrell + * use however you want + */ + +#include "SDL.h" +#include + +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 480 + +int +randomInt(int min, int max) +{ + return min + rand() % (max - min + 1); +} + +void +render(SDL_Renderer *renderer) +{ + + Uint8 r, g, b; + + /* Clear the screen */ + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + + /* Come up with a random rectangle */ + SDL_Rect rect; + rect.w = randomInt(64, 128); + rect.h = randomInt(64, 128); + rect.x = randomInt(0, SCREEN_WIDTH); + rect.y = randomInt(0, SCREEN_HEIGHT); + + /* Come up with a random color */ + r = randomInt(50, 255); + g = randomInt(50, 255); + b = randomInt(50, 255); + SDL_SetRenderDrawColor(renderer, r, g, b, 255); + + /* Fill the rectangle in the color */ + SDL_RenderFillRect(renderer, &rect); + + /* update screen */ + SDL_RenderPresent(renderer); +} + +int +main(int argc, char *argv[]) +{ + + SDL_Window *window; + SDL_Renderer *renderer; + int done; + SDL_Event event; + + /* initialize SDL */ + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + printf("Could not initialize SDL\n"); + return 1; + } + + /* seed random number generator */ + srand(time(NULL)); + + /* create window and renderer */ + window = + SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, + SDL_WINDOW_OPENGL); + if (!window) { + printf("Could not initialize Window\n"); + return 1; + } + + renderer = SDL_CreateRenderer(window, -1, 0); + if (!renderer) { + printf("Could not create renderer\n"); + return 1; + } + + /* Enter render loop, waiting for user to quit */ + done = 0; + while (!done) { + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT) { + done = 1; + } + } + render(renderer); + SDL_Delay(1); + } + + /* shutdown SDL */ + SDL_Quit(); + + return 0; +} diff --git a/Xcode-iOS/Test/Info.plist b/Xcode-iOS/Test/Info.plist new file mode 100644 index 0000000000..c0f1179d35 --- /dev/null +++ b/Xcode-iOS/Test/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + + + diff --git a/Xcode-iOS/Test/README b/Xcode-iOS/Test/README new file mode 100644 index 0000000000..b16ff7c0f9 --- /dev/null +++ b/Xcode-iOS/Test/README @@ -0,0 +1,22 @@ +TestiPhoneOS.xcodeproj contains targets to compile many of the SDL test programs for iPhone OS. Most of these test programs work fine, with the following exceptions: + +testalpha: + Program crashes. Problem appears to effect Mac OS X as well. + +testthread: + SIGTERM kills the process immediately without executing the 'kill' function. The posix standard says this shouldn't happen. Apple seems intent on having iPhone apps exit promptly when the user requests it, so maybe that's why(?) + +testlock: + Locks appear to work, but there doesn't appear to be a simple way to send the process SIGINT. + +testpalette: + "SDL error: blitting boat: Blit combination not supported." Happens on Mac OS X as well. + +testsprite2: + SDL_CreateTextureFromSurface requests an ARGB pixel format, but iPhone's SDL video driver only supports ABGR. + +testwin: + Behaves as it does under Mac OS X ... not sure if that is correctly or not. + +threadwin: + Works if -threaded is not on. Otherwise it doesn't work, but this is true under Mac OS X as well. diff --git a/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj new file mode 100755 index 0000000000..0b35c22cfd --- /dev/null +++ b/Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj @@ -0,0 +1,2267 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 046CEF7713254F23007AD51D /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + 046CEF7B13254F23007AD51D /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + 046CEF7C13254F23007AD51D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + 046CEF7D13254F23007AD51D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + 046CEF7E13254F23007AD51D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + 046CEF7F13254F23007AD51D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + 046CEF8013254F23007AD51D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + 046CEF8113254F23007AD51D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + 046CEF8213254F23007AD51D /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + 046CEF8A13254F63007AD51D /* testgesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 046CEF8913254F63007AD51D /* testgesture.c */; }; + 047A63E213285C3200CD7973 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + 047A63E313285C3200CD7973 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + 047A63E413285C3200CD7973 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + 047A63E513285C3200CD7973 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + 047A63E613285C3200CD7973 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + 047A63E713285C3200CD7973 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + 047A63E813285C3200CD7973 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + 047A63E913285C3200CD7973 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + 047A63F113285CD100CD7973 /* checkkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 047A63F013285CD100CD7973 /* checkkeys.c */; }; + 56ED04FE118A8FE400A56AA6 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + 56ED0502118A8FE400A56AA6 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + 56ED0503118A8FE400A56AA6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + 56ED0504118A8FE400A56AA6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + 56ED0505118A8FE400A56AA6 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + 56ED0506118A8FE400A56AA6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + 56ED0507118A8FE400A56AA6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + 56ED0508118A8FE400A56AA6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + 56ED0509118A8FE400A56AA6 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + 56ED0511118A904200A56AA6 /* testpower.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED0510118A904200A56AA6 /* testpower.c */; }; + AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; }; + AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; }; + AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; }; + AA1EE47517605B930029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; }; + AA1EE47617605B9E0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; }; + AA1EE47717605BAB0029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; }; + AA1EE47817605BF60029C7A5 /* libSDL2test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA1EE452176059230029C7A5 /* libSDL2test.a */; }; + AAE7DEDC14CBB1E100DF1A0E /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + AAE7DEE114CBB1E100DF1A0E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + AAE7DEE214CBB1E100DF1A0E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + AAE7DEE314CBB1E100DF1A0E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + AAE7DEE414CBB1E100DF1A0E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + AAE7DEE514CBB1E100DF1A0E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + AAE7DEE614CBB1E100DF1A0E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + AAE7DEE714CBB1E100DF1A0E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + AAE7DEE814CBB1E100DF1A0E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + AAE7DF4614CBB43900DF1A0E /* testscale.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE7DF4514CBB43900DF1A0E /* testscale.c */; }; + AAE7DF4714CBB45000DF1A0E /* sample.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AADE0E2D33C100EA573E /* sample.bmp */; }; + AAE7DFA014CBB54E00DF1A0E /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + AAE7DFA114CBB54E00DF1A0E /* sample.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AADE0E2D33C100EA573E /* sample.bmp */; }; + AAE7DFA614CBB54E00DF1A0E /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + AAE7DFA714CBB54E00DF1A0E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + AAE7DFA814CBB54E00DF1A0E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + AAE7DFA914CBB54E00DF1A0E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + AAE7DFAA14CBB54E00DF1A0E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + AAE7DFAB14CBB54E00DF1A0E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + AAE7DFAC14CBB54E00DF1A0E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + AAE7DFAD14CBB54E00DF1A0E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */ = {isa = PBXBuildFile; fileRef = AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */; }; + FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75F0E2D0F1600EA573E /* testwm2.c */; }; + FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDA8A8A10E2D111A00EA573E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDA8A8A20E2D111A00EA573E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDA8A8A30E2D111A00EA573E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDA8A8A40E2D111A00EA573E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDA8A8A50E2D111A00EA573E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDA8AAB10E2D330F00EA573E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDA8AAB20E2D330F00EA573E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDA8AAB30E2D330F00EA573E /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDA8AAB40E2D330F00EA573E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDA8AAB50E2D330F00EA573E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDA8AAB60E2D330F00EA573E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDA8AAB70E2D330F00EA573E /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDA8AABE0E2D335C00EA573E /* loopwave.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A78B0E2D0F3D00EA573E /* loopwave.c */; }; + FDA8AAE30E2D33C600EA573E /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAE20E2D33C600EA573E /* sample.wav */; }; + FDAAC3C30E2D47E6001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDAAC3C40E2D47E6001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDAAC3C50E2D47E6001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDAAC3C60E2D47E6001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDAAC3C70E2D47E6001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDAAC3C80E2D47E6001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDAAC3C90E2D47E6001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDAAC3D30E2D4800001DB1D8 /* testaudioinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */; }; + FDAAC5910E2D5429001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDAAC5920E2D5429001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDAAC5930E2D5429001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDAAC5940E2D5429001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDAAC5950E2D5429001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDAAC5960E2D5429001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDAAC5970E2D5429001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDAAC59F0E2D54B8001DB1D8 /* testerror.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7470E2D0F1600EA573E /* testerror.c */; }; + FDAAC5BF0E2D55B5001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDAAC5C00E2D55B5001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDAAC5C10E2D55B5001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDAAC5C20E2D55B5001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDAAC5C30E2D55B5001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDAAC5C40E2D55B5001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDAAC5C50E2D55B5001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDAAC5CC0E2D55CA001DB1D8 /* testfile.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7480E2D0F1600EA573E /* testfile.c */; }; + FDAAC61C0E2D5914001DB1D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDAAC61D0E2D5914001DB1D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDAAC61E0E2D5914001DB1D8 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDAAC61F0E2D5914001DB1D8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDAAC6200E2D5914001DB1D8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDAAC6210E2D5914001DB1D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDAAC6220E2D5914001DB1D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDAAC62A0E2D5960001DB1D8 /* testgles.c in Sources */ = {isa = PBXBuildFile; fileRef = FDAAC6290E2D5960001DB1D8 /* testgles.c */; }; + FDAAC6390E2D59BE001DB1D8 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + FDBDE57C0E313445006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5810E313465006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5850E313495006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE58C0E3134F3006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE59B0E31356A006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE59F0E31358D006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5A90E3135C0006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5AE0E3135E6006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5B60E3135FE006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5BC0E31364D006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5C20E313663006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5C60E3136F1006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5C80E313702006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5CA0E313712006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5CC0E31372B006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5CE0E31373E006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDBDE5D40E313789006BAC0B /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDC42FF40F0D866D009C87E1 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FD1B48B80E3131CA007AB34E /* libSDL2.a */; }; + FDC42FF60F0D866D009C87E1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDC42FF70F0D866D009C87E1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDC42FF80F0D866D009C87E1 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDC42FF90F0D866D009C87E1 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDC42FFA0F0D866D009C87E1 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDC42FFB0F0D866D009C87E1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDC42FFC0F0D866D009C87E1 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDC4300A0F0D86BF009C87E1 /* testdraw2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDC430090F0D86BF009C87E1 /* testdraw2.c */; }; + FDD2C1000E2E4F4B00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C1010E2E4F4B00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C1020E2E4F4B00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C1030E2E4F4B00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C1040E2E4F4B00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C1050E2E4F4B00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C1060E2E4F4B00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C10D0E2E4F6900B7A85F /* testthread.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74C0E2D0F1600EA573E /* testthread.c */; }; + FDD2C1770E2E52C000B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C1780E2E52C000B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C1790E2E52C000B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C17A0E2E52C000B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C17B0E2E52C000B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C17C0E2E52C000B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C17D0E2E52C000B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C1840E2E52D900B7A85F /* testiconv.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74D0E2D0F1600EA573E /* testiconv.c */; }; + FDD2C18B0E2E52FE00B7A85F /* utf8.txt in Resources */ = {isa = PBXBuildFile; fileRef = FDD2C18A0E2E52FE00B7A85F /* utf8.txt */; }; + FDD2C19B0E2E534F00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C19C0E2E534F00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C19D0E2E534F00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C19E0E2E534F00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C19F0E2E534F00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C1A00E2E534F00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C1A10E2E534F00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C1A80E2E536400B7A85F /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74E0E2D0F1600EA573E /* testjoystick.c */; }; + FDD2C4540E2E773800B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C4550E2E773800B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C4560E2E773800B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C4570E2E773800B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C4580E2E773800B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C4590E2E773800B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C45A0E2E773800B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C4610E2E777500B7A85F /* testkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A74F0E2D0F1600EA573E /* testkeys.c */; }; + FDD2C4720E2E77D700B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C4730E2E77D700B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C4740E2E77D700B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C4750E2E77D700B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C4760E2E77D700B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C4770E2E77D700B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C4780E2E77D700B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C47F0E2E77E300B7A85F /* testlock.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7510E2D0F1600EA573E /* testlock.c */; }; + FDD2C5010E2E7F4800B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C5020E2E7F4800B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C5030E2E7F4800B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C5040E2E7F4800B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C5050E2E7F4800B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C5060E2E7F4800B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C5070E2E7F4800B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C50E0E2E7F5800B7A85F /* testplatform.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7560E2D0F1600EA573E /* testplatform.c */; }; + FDD2C51F0E2E807600B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C5200E2E807600B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C5210E2E807600B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C5220E2E807600B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C5230E2E807600B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C5240E2E807600B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C5250E2E807600B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C52C0E2E808700B7A85F /* testsem.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7570E2D0F1600EA573E /* testsem.c */; }; + FDD2C5440E2E80E400B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C5450E2E80E400B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C5460E2E80E400B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C5470E2E80E400B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C5480E2E80E400B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C5490E2E80E400B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C54A0E2E80E400B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C5510E2E80F400B7A85F /* testsprite2.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7590E2D0F1600EA573E /* testsprite2.c */; }; + FDD2C5520E2E812C00B7A85F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + FDD2C5760E2E8C7400B7A85F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + FDD2C57D0E2E8C7400B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C57E0E2E8C7400B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C57F0E2E8C7400B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C5800E2E8C7400B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C5810E2E8C7400B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C5820E2E8C7400B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C5830E2E8C7400B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C58A0E2E8CB500B7A85F /* testtimer.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75A0E2D0F1600EA573E /* testtimer.c */; }; + FDD2C5B50E2E8CFC00B7A85F /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = FDA8AAD90E2D33B000EA573E /* icon.bmp */; }; + FDD2C5BB0E2E8CFC00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C5BC0E2E8CFC00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C5BD0E2E8CFC00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C5BE0E2E8CFC00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C5BF0E2E8CFC00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C5C00E2E8CFC00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C5C10E2E8CFC00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C5C80E2E8D1200B7A85F /* testver.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A75B0E2D0F1600EA573E /* testver.c */; }; + FDD2C6EA0E2E959E00B7A85F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */; }; + FDD2C6EB0E2E959E00B7A85F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A8990E2D111A00EA573E /* QuartzCore.framework */; }; + FDD2C6EC0E2E959E00B7A85F /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */; }; + FDD2C6ED0E2E959E00B7A85F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */; }; + FDD2C6EE0E2E959E00B7A85F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89C0E2D111A00EA573E /* UIKit.framework */; }; + FDD2C6EF0E2E959E00B7A85F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89D0E2D111A00EA573E /* Foundation.framework */; }; + FDD2C6F00E2E959E00B7A85F /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */; }; + FDD2C6F70E2E95B100B7A85F /* torturethread.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA8A7610E2D0F1600EA573E /* torturethread.c */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 006E982211955059001DE610; + remoteInfo = testsdl; + }; + AA1EE451176059230029C7A5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = AA1EE4461760589B0029C7A5; + remoteInfo = SDL2test; + }; + FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = FD6526630DE8FCCB002AD96B; + remoteInfo = StaticLib; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 046CEF8613254F23007AD51D /* testgesture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgesture.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 046CEF8913254F63007AD51D /* testgesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgesture.c; path = ../../test/testgesture.c; sourceTree = SOURCE_ROOT; }; + 047A63ED13285C3200CD7973 /* checkkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = checkkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 047A63F013285CD100CD7973 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checkkeys.c; path = ../../test/checkkeys.c; sourceTree = SOURCE_ROOT; }; + 1D6058910D05DD3D006BFB54 /* testwm2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 56ED050D118A8FE400A56AA6 /* testpower.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 56ED0510118A904200A56AA6 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; }; + AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL2test.xcodeproj; path = ../SDLtest/SDL2test.xcodeproj; sourceTree = ""; }; + AAE7DEEC14CBB1E100DF1A0E /* testscale.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testscale.app; sourceTree = BUILT_PRODUCTS_DIR; }; + AAE7DF4514CBB43900DF1A0E /* testscale.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = ""; }; + AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrendertarget.app; sourceTree = BUILT_PRODUCTS_DIR; }; + AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testrendertarget.c; path = ../../test/testrendertarget.c; sourceTree = ""; }; + FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; }; + FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; }; + FDA8A7470E2D0F1600EA573E /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; }; + FDA8A7480E2D0F1600EA573E /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testfile.c; path = ../../test/testfile.c; sourceTree = SOURCE_ROOT; }; + FDA8A74C0E2D0F1600EA573E /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testthread.c; path = ../../test/testthread.c; sourceTree = SOURCE_ROOT; }; + FDA8A74D0E2D0F1600EA573E /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testiconv.c; path = ../../test/testiconv.c; sourceTree = SOURCE_ROOT; }; + FDA8A74E0E2D0F1600EA573E /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testjoystick.c; path = ../../test/testjoystick.c; sourceTree = SOURCE_ROOT; }; + FDA8A74F0E2D0F1600EA573E /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testkeys.c; path = ../../test/testkeys.c; sourceTree = SOURCE_ROOT; }; + FDA8A7510E2D0F1600EA573E /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testlock.c; path = ../../test/testlock.c; sourceTree = SOURCE_ROOT; }; + FDA8A7540E2D0F1600EA573E /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testoverlay2.c; path = ../../test/testoverlay2.c; sourceTree = SOURCE_ROOT; }; + FDA8A7560E2D0F1600EA573E /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testplatform.c; path = ../../test/testplatform.c; sourceTree = SOURCE_ROOT; }; + FDA8A7570E2D0F1600EA573E /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsem.c; path = ../../test/testsem.c; sourceTree = SOURCE_ROOT; }; + FDA8A7590E2D0F1600EA573E /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsprite2.c; path = ../../test/testsprite2.c; sourceTree = SOURCE_ROOT; }; + FDA8A75A0E2D0F1600EA573E /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testtimer.c; path = ../../test/testtimer.c; sourceTree = SOURCE_ROOT; }; + FDA8A75B0E2D0F1600EA573E /* testver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testver.c; path = ../../test/testver.c; sourceTree = SOURCE_ROOT; }; + FDA8A75F0E2D0F1600EA573E /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testwm2.c; path = ../../test/testwm2.c; sourceTree = SOURCE_ROOT; }; + FDA8A7610E2D0F1600EA573E /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = torturethread.c; path = ../../test/torturethread.c; sourceTree = SOURCE_ROOT; }; + FDA8A78B0E2D0F3D00EA573E /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = loopwave.c; path = ../../test/loopwave.c; sourceTree = SOURCE_ROOT; }; + FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + FDA8A8990E2D111A00EA573E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + FDA8A89C0E2D111A00EA573E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + FDA8A89D0E2D111A00EA573E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + FDA8AABB0E2D330F00EA573E /* loopwav.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = loopwav.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDA8AAD90E2D33B000EA573E /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; }; + FDA8AADA0E2D33BA00EA573E /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; }; + FDA8AADB0E2D33BA00EA573E /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; }; + FDA8AADE0E2D33C100EA573E /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; }; + FDA8AAE20E2D33C600EA573E /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; }; + FDAAC3CD0E2D47E6001DB1D8 /* testaudioinfo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testaudioinfo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDAAC59B0E2D5429001DB1D8 /* testerror.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testerror.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDAAC5C90E2D55B5001DB1D8 /* testfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testfile.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDAAC6260E2D5914001DB1D8 /* testgles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgles.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDAAC6290E2D5960001DB1D8 /* testgles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgles.c; path = ../../test/testgles.c; sourceTree = SOURCE_ROOT; }; + FDC430000F0D866D009C87E1 /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDC430090F0D86BF009C87E1 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testdraw2.c; path = ../../test/testdraw2.c; sourceTree = SOURCE_ROOT; }; + FDD2C10A0E2E4F4B00B7A85F /* testthread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testthread.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C1810E2E52C000B7A85F /* testiconv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testiconv.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C18A0E2E52FE00B7A85F /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; }; + FDD2C1A50E2E534F00B7A85F /* testjoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testjoystick.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C45E0E2E773800B7A85F /* testkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C47C0E2E77D700B7A85F /* testlock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testlock.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C50B0E2E7F4800B7A85F /* testplatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testplatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C5290E2E807600B7A85F /* testsem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C54E0E2E80E400B7A85F /* testsprite2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsprite2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C5870E2E8C7400B7A85F /* testtimer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testtimer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C5C50E2E8CFC00B7A85F /* testver.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testver.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FDD2C6F40E2E959E00B7A85F /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 046CEF7A13254F23007AD51D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 046CEF7B13254F23007AD51D /* libSDL2.a in Frameworks */, + 046CEF7C13254F23007AD51D /* AudioToolbox.framework in Frameworks */, + 046CEF7D13254F23007AD51D /* QuartzCore.framework in Frameworks */, + 046CEF7E13254F23007AD51D /* OpenGLES.framework in Frameworks */, + 046CEF7F13254F23007AD51D /* CoreGraphics.framework in Frameworks */, + 046CEF8013254F23007AD51D /* UIKit.framework in Frameworks */, + 046CEF8113254F23007AD51D /* Foundation.framework in Frameworks */, + 046CEF8213254F23007AD51D /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 047A63E113285C3200CD7973 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE470176059D00029C7A5 /* libSDL2test.a in Frameworks */, + 047A63E213285C3200CD7973 /* libSDL2.a in Frameworks */, + 047A63E313285C3200CD7973 /* AudioToolbox.framework in Frameworks */, + 047A63E413285C3200CD7973 /* QuartzCore.framework in Frameworks */, + 047A63E513285C3200CD7973 /* OpenGLES.framework in Frameworks */, + 047A63E613285C3200CD7973 /* CoreGraphics.framework in Frameworks */, + 047A63E713285C3200CD7973 /* UIKit.framework in Frameworks */, + 047A63E813285C3200CD7973 /* Foundation.framework in Frameworks */, + 047A63E913285C3200CD7973 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE47817605BF60029C7A5 /* libSDL2test.a in Frameworks */, + FDBDE5810E313465006BAC0B /* libSDL2.a in Frameworks */, + FDA8A89F0E2D111A00EA573E /* AudioToolbox.framework in Frameworks */, + FDA8A8A00E2D111A00EA573E /* QuartzCore.framework in Frameworks */, + FDA8A8A10E2D111A00EA573E /* OpenGLES.framework in Frameworks */, + FDA8A8A20E2D111A00EA573E /* CoreGraphics.framework in Frameworks */, + FDA8A8A30E2D111A00EA573E /* UIKit.framework in Frameworks */, + FDA8A8A40E2D111A00EA573E /* Foundation.framework in Frameworks */, + FDA8A8A50E2D111A00EA573E /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56ED0501118A8FE400A56AA6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 56ED0502118A8FE400A56AA6 /* libSDL2.a in Frameworks */, + 56ED0503118A8FE400A56AA6 /* AudioToolbox.framework in Frameworks */, + 56ED0504118A8FE400A56AA6 /* QuartzCore.framework in Frameworks */, + 56ED0505118A8FE400A56AA6 /* OpenGLES.framework in Frameworks */, + 56ED0506118A8FE400A56AA6 /* CoreGraphics.framework in Frameworks */, + 56ED0507118A8FE400A56AA6 /* UIKit.framework in Frameworks */, + 56ED0508118A8FE400A56AA6 /* Foundation.framework in Frameworks */, + 56ED0509118A8FE400A56AA6 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAE7DEE014CBB1E100DF1A0E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE47617605B9E0029C7A5 /* libSDL2test.a in Frameworks */, + AAE7DEE114CBB1E100DF1A0E /* libSDL2.a in Frameworks */, + AAE7DEE214CBB1E100DF1A0E /* AudioToolbox.framework in Frameworks */, + AAE7DEE314CBB1E100DF1A0E /* QuartzCore.framework in Frameworks */, + AAE7DEE414CBB1E100DF1A0E /* OpenGLES.framework in Frameworks */, + AAE7DEE514CBB1E100DF1A0E /* CoreGraphics.framework in Frameworks */, + AAE7DEE614CBB1E100DF1A0E /* UIKit.framework in Frameworks */, + AAE7DEE714CBB1E100DF1A0E /* Foundation.framework in Frameworks */, + AAE7DEE814CBB1E100DF1A0E /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAE7DFA514CBB54E00DF1A0E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE47517605B930029C7A5 /* libSDL2test.a in Frameworks */, + AAE7DFA614CBB54E00DF1A0E /* libSDL2.a in Frameworks */, + AAE7DFA714CBB54E00DF1A0E /* AudioToolbox.framework in Frameworks */, + AAE7DFA814CBB54E00DF1A0E /* QuartzCore.framework in Frameworks */, + AAE7DFA914CBB54E00DF1A0E /* OpenGLES.framework in Frameworks */, + AAE7DFAA14CBB54E00DF1A0E /* CoreGraphics.framework in Frameworks */, + AAE7DFAB14CBB54E00DF1A0E /* UIKit.framework in Frameworks */, + AAE7DFAC14CBB54E00DF1A0E /* Foundation.framework in Frameworks */, + AAE7DFAD14CBB54E00DF1A0E /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDA8AAAE0E2D330F00EA573E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5850E313495006BAC0B /* libSDL2.a in Frameworks */, + FDA8AAB10E2D330F00EA573E /* AudioToolbox.framework in Frameworks */, + FDA8AAB20E2D330F00EA573E /* QuartzCore.framework in Frameworks */, + FDA8AAB30E2D330F00EA573E /* OpenGLES.framework in Frameworks */, + FDA8AAB40E2D330F00EA573E /* CoreGraphics.framework in Frameworks */, + FDA8AAB50E2D330F00EA573E /* UIKit.framework in Frameworks */, + FDA8AAB60E2D330F00EA573E /* Foundation.framework in Frameworks */, + FDA8AAB70E2D330F00EA573E /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC3C00E2D47E6001DB1D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE58C0E3134F3006BAC0B /* libSDL2.a in Frameworks */, + FDAAC3C30E2D47E6001DB1D8 /* AudioToolbox.framework in Frameworks */, + FDAAC3C40E2D47E6001DB1D8 /* QuartzCore.framework in Frameworks */, + FDAAC3C50E2D47E6001DB1D8 /* OpenGLES.framework in Frameworks */, + FDAAC3C60E2D47E6001DB1D8 /* CoreGraphics.framework in Frameworks */, + FDAAC3C70E2D47E6001DB1D8 /* UIKit.framework in Frameworks */, + FDAAC3C80E2D47E6001DB1D8 /* Foundation.framework in Frameworks */, + FDAAC3C90E2D47E6001DB1D8 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC58E0E2D5429001DB1D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE59B0E31356A006BAC0B /* libSDL2.a in Frameworks */, + FDAAC5910E2D5429001DB1D8 /* AudioToolbox.framework in Frameworks */, + FDAAC5920E2D5429001DB1D8 /* QuartzCore.framework in Frameworks */, + FDAAC5930E2D5429001DB1D8 /* OpenGLES.framework in Frameworks */, + FDAAC5940E2D5429001DB1D8 /* CoreGraphics.framework in Frameworks */, + FDAAC5950E2D5429001DB1D8 /* UIKit.framework in Frameworks */, + FDAAC5960E2D5429001DB1D8 /* Foundation.framework in Frameworks */, + FDAAC5970E2D5429001DB1D8 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC5BC0E2D55B5001DB1D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE59F0E31358D006BAC0B /* libSDL2.a in Frameworks */, + FDAAC5BF0E2D55B5001DB1D8 /* AudioToolbox.framework in Frameworks */, + FDAAC5C00E2D55B5001DB1D8 /* QuartzCore.framework in Frameworks */, + FDAAC5C10E2D55B5001DB1D8 /* OpenGLES.framework in Frameworks */, + FDAAC5C20E2D55B5001DB1D8 /* CoreGraphics.framework in Frameworks */, + FDAAC5C30E2D55B5001DB1D8 /* UIKit.framework in Frameworks */, + FDAAC5C40E2D55B5001DB1D8 /* Foundation.framework in Frameworks */, + FDAAC5C50E2D55B5001DB1D8 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC6190E2D5914001DB1D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE47417605B5C0029C7A5 /* libSDL2test.a in Frameworks */, + FDBDE57C0E313445006BAC0B /* libSDL2.a in Frameworks */, + FDAAC61C0E2D5914001DB1D8 /* AudioToolbox.framework in Frameworks */, + FDAAC61D0E2D5914001DB1D8 /* QuartzCore.framework in Frameworks */, + FDAAC61E0E2D5914001DB1D8 /* OpenGLES.framework in Frameworks */, + FDAAC61F0E2D5914001DB1D8 /* CoreGraphics.framework in Frameworks */, + FDAAC6200E2D5914001DB1D8 /* UIKit.framework in Frameworks */, + FDAAC6210E2D5914001DB1D8 /* Foundation.framework in Frameworks */, + FDAAC6220E2D5914001DB1D8 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC42FF30F0D866D009C87E1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE47117605A7F0029C7A5 /* libSDL2test.a in Frameworks */, + FDC42FF40F0D866D009C87E1 /* libSDL2.a in Frameworks */, + FDC42FF60F0D866D009C87E1 /* AudioToolbox.framework in Frameworks */, + FDC42FF70F0D866D009C87E1 /* QuartzCore.framework in Frameworks */, + FDC42FF80F0D866D009C87E1 /* OpenGLES.framework in Frameworks */, + FDC42FF90F0D866D009C87E1 /* CoreGraphics.framework in Frameworks */, + FDC42FFA0F0D866D009C87E1 /* UIKit.framework in Frameworks */, + FDC42FFB0F0D866D009C87E1 /* Foundation.framework in Frameworks */, + FDC42FFC0F0D866D009C87E1 /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C0FD0E2E4F4B00B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5A90E3135C0006BAC0B /* libSDL2.a in Frameworks */, + FDD2C1000E2E4F4B00B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C1010E2E4F4B00B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C1020E2E4F4B00B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C1030E2E4F4B00B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C1040E2E4F4B00B7A85F /* UIKit.framework in Frameworks */, + FDD2C1050E2E4F4B00B7A85F /* Foundation.framework in Frameworks */, + FDD2C1060E2E4F4B00B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C1740E2E52C000B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5AE0E3135E6006BAC0B /* libSDL2.a in Frameworks */, + FDD2C1770E2E52C000B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C1780E2E52C000B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C1790E2E52C000B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C17A0E2E52C000B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C17B0E2E52C000B7A85F /* UIKit.framework in Frameworks */, + FDD2C17C0E2E52C000B7A85F /* Foundation.framework in Frameworks */, + FDD2C17D0E2E52C000B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C1980E2E534F00B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5B60E3135FE006BAC0B /* libSDL2.a in Frameworks */, + FDD2C19B0E2E534F00B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C19C0E2E534F00B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C19D0E2E534F00B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C19E0E2E534F00B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C19F0E2E534F00B7A85F /* UIKit.framework in Frameworks */, + FDD2C1A00E2E534F00B7A85F /* Foundation.framework in Frameworks */, + FDD2C1A10E2E534F00B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C4510E2E773800B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5BC0E31364D006BAC0B /* libSDL2.a in Frameworks */, + FDD2C4540E2E773800B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C4550E2E773800B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C4560E2E773800B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C4570E2E773800B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C4580E2E773800B7A85F /* UIKit.framework in Frameworks */, + FDD2C4590E2E773800B7A85F /* Foundation.framework in Frameworks */, + FDD2C45A0E2E773800B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C46F0E2E77D700B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5C20E313663006BAC0B /* libSDL2.a in Frameworks */, + FDD2C4720E2E77D700B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C4730E2E77D700B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C4740E2E77D700B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C4750E2E77D700B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C4760E2E77D700B7A85F /* UIKit.framework in Frameworks */, + FDD2C4770E2E77D700B7A85F /* Foundation.framework in Frameworks */, + FDD2C4780E2E77D700B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C4FE0E2E7F4800B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5C60E3136F1006BAC0B /* libSDL2.a in Frameworks */, + FDD2C5010E2E7F4800B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C5020E2E7F4800B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C5030E2E7F4800B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C5040E2E7F4800B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C5050E2E7F4800B7A85F /* UIKit.framework in Frameworks */, + FDD2C5060E2E7F4800B7A85F /* Foundation.framework in Frameworks */, + FDD2C5070E2E7F4800B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C51C0E2E807600B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5C80E313702006BAC0B /* libSDL2.a in Frameworks */, + FDD2C51F0E2E807600B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C5200E2E807600B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C5210E2E807600B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C5220E2E807600B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C5230E2E807600B7A85F /* UIKit.framework in Frameworks */, + FDD2C5240E2E807600B7A85F /* Foundation.framework in Frameworks */, + FDD2C5250E2E807600B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C5410E2E80E400B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AA1EE47717605BAB0029C7A5 /* libSDL2test.a in Frameworks */, + FDBDE5CA0E313712006BAC0B /* libSDL2.a in Frameworks */, + FDD2C5440E2E80E400B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C5450E2E80E400B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C5460E2E80E400B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C5470E2E80E400B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C5480E2E80E400B7A85F /* UIKit.framework in Frameworks */, + FDD2C5490E2E80E400B7A85F /* Foundation.framework in Frameworks */, + FDD2C54A0E2E80E400B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C57A0E2E8C7400B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5CC0E31372B006BAC0B /* libSDL2.a in Frameworks */, + FDD2C57D0E2E8C7400B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C57E0E2E8C7400B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C57F0E2E8C7400B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C5800E2E8C7400B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C5810E2E8C7400B7A85F /* UIKit.framework in Frameworks */, + FDD2C5820E2E8C7400B7A85F /* Foundation.framework in Frameworks */, + FDD2C5830E2E8C7400B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C5B80E2E8CFC00B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5CE0E31373E006BAC0B /* libSDL2.a in Frameworks */, + FDD2C5BB0E2E8CFC00B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C5BC0E2E8CFC00B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C5BD0E2E8CFC00B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C5BE0E2E8CFC00B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C5BF0E2E8CFC00B7A85F /* UIKit.framework in Frameworks */, + FDD2C5C00E2E8CFC00B7A85F /* Foundation.framework in Frameworks */, + FDD2C5C10E2E8CFC00B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C6E70E2E959E00B7A85F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FDBDE5D40E313789006BAC0B /* libSDL2.a in Frameworks */, + FDD2C6EA0E2E959E00B7A85F /* AudioToolbox.framework in Frameworks */, + FDD2C6EB0E2E959E00B7A85F /* QuartzCore.framework in Frameworks */, + FDD2C6EC0E2E959E00B7A85F /* OpenGLES.framework in Frameworks */, + FDD2C6ED0E2E959E00B7A85F /* CoreGraphics.framework in Frameworks */, + FDD2C6EE0E2E959E00B7A85F /* UIKit.framework in Frameworks */, + FDD2C6EF0E2E959E00B7A85F /* Foundation.framework in Frameworks */, + FDD2C6F00E2E959E00B7A85F /* CoreAudio.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* testwm2.app */, + FDA8AABB0E2D330F00EA573E /* loopwav.app */, + FDAAC3CD0E2D47E6001DB1D8 /* testaudioinfo.app */, + FDAAC59B0E2D5429001DB1D8 /* testerror.app */, + FDAAC5C90E2D55B5001DB1D8 /* testfile.app */, + FDAAC6260E2D5914001DB1D8 /* testgles.app */, + FDD2C10A0E2E4F4B00B7A85F /* testthread.app */, + FDD2C1810E2E52C000B7A85F /* testiconv.app */, + FDD2C1A50E2E534F00B7A85F /* testjoystick.app */, + FDD2C45E0E2E773800B7A85F /* testkeys.app */, + FDD2C47C0E2E77D700B7A85F /* testlock.app */, + FDD2C50B0E2E7F4800B7A85F /* testplatform.app */, + FDD2C5290E2E807600B7A85F /* testsem.app */, + FDD2C54E0E2E80E400B7A85F /* testsprite2.app */, + FDD2C5870E2E8C7400B7A85F /* testtimer.app */, + FDD2C5C50E2E8CFC00B7A85F /* testver.app */, + FDD2C6F40E2E959E00B7A85F /* torturethread.app */, + FDC430000F0D866D009C87E1 /* torturethread.app */, + 56ED050D118A8FE400A56AA6 /* testpower.app */, + 046CEF8613254F23007AD51D /* testgesture.app */, + 047A63ED13285C3200CD7973 /* checkkeys.app */, + AAE7DEEC14CBB1E100DF1A0E /* testscale.app */, + AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */, + FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */, + FDA8AAD60E2D339A00EA573E /* Resources */, + FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */, + FDA8A73B0E2D0F0400EA573E /* src */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + AA1EE44E176059220029C7A5 /* Products */ = { + isa = PBXGroup; + children = ( + AA1EE452176059230029C7A5 /* libSDL2test.a */, + ); + name = Products; + sourceTree = ""; + }; + FD1B48AD0E3131CA007AB34E /* Products */ = { + isa = PBXGroup; + children = ( + FD1B48B80E3131CA007AB34E /* libSDL2.a */, + 0466EE7011E565E4000198A4 /* testsdl.app */, + ); + name = Products; + sourceTree = ""; + }; + FDA8A73B0E2D0F0400EA573E /* src */ = { + isa = PBXGroup; + children = ( + 047A63F013285CD100CD7973 /* checkkeys.c */, + FDA8A78B0E2D0F3D00EA573E /* loopwave.c */, + FDA8A7410E2D0F1600EA573E /* testaudioinfo.c */, + FDC430090F0D86BF009C87E1 /* testdraw2.c */, + FDA8A7470E2D0F1600EA573E /* testerror.c */, + FDA8A7480E2D0F1600EA573E /* testfile.c */, + 046CEF8913254F63007AD51D /* testgesture.c */, + FDAAC6290E2D5960001DB1D8 /* testgles.c */, + FDA8A74D0E2D0F1600EA573E /* testiconv.c */, + FDA8A74E0E2D0F1600EA573E /* testjoystick.c */, + FDA8A74F0E2D0F1600EA573E /* testkeys.c */, + FDA8A7510E2D0F1600EA573E /* testlock.c */, + FDA8A7540E2D0F1600EA573E /* testoverlay2.c */, + FDA8A7560E2D0F1600EA573E /* testplatform.c */, + 56ED0510118A904200A56AA6 /* testpower.c */, + AAE7DFB414CBB5F700DF1A0E /* testrendertarget.c */, + AAE7DF4514CBB43900DF1A0E /* testscale.c */, + FDA8A7570E2D0F1600EA573E /* testsem.c */, + FDA8A7590E2D0F1600EA573E /* testsprite2.c */, + FDA8A74C0E2D0F1600EA573E /* testthread.c */, + FDA8A75A0E2D0F1600EA573E /* testtimer.c */, + FDA8A75B0E2D0F1600EA573E /* testver.c */, + FDA8A75F0E2D0F1600EA573E /* testwm2.c */, + FDA8A7610E2D0F1600EA573E /* torturethread.c */, + ); + name = src; + sourceTree = ""; + }; + FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + FDA8A8980E2D111A00EA573E /* AudioToolbox.framework */, + FDA8A8990E2D111A00EA573E /* QuartzCore.framework */, + FDA8A89A0E2D111A00EA573E /* OpenGLES.framework */, + FDA8A89B0E2D111A00EA573E /* CoreGraphics.framework */, + FDA8A89C0E2D111A00EA573E /* UIKit.framework */, + FDA8A89D0E2D111A00EA573E /* Foundation.framework */, + FDA8A89E0E2D111A00EA573E /* CoreAudio.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + FDA8AAD60E2D339A00EA573E /* Resources */ = { + isa = PBXGroup; + children = ( + FDD2C18A0E2E52FE00B7A85F /* utf8.txt */, + FDA8AAD90E2D33B000EA573E /* icon.bmp */, + FDA8AADA0E2D33BA00EA573E /* moose.dat */, + FDA8AADB0E2D33BA00EA573E /* picture.xbm */, + FDA8AADE0E2D33C100EA573E /* sample.bmp */, + FDA8AAE20E2D33C600EA573E /* sample.wav */, + ); + name = Resources; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 046CEF7513254F23007AD51D /* testgesture */ = { + isa = PBXNativeTarget; + buildConfigurationList = 046CEF8313254F23007AD51D /* Build configuration list for PBXNativeTarget "testgesture" */; + buildPhases = ( + 046CEF7613254F23007AD51D /* Resources */, + 046CEF7813254F23007AD51D /* Sources */, + 046CEF7A13254F23007AD51D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testgesture; + productName = Test; + productReference = 046CEF8613254F23007AD51D /* testgesture.app */; + productType = "com.apple.product-type.application"; + }; + 047A63DD13285C3200CD7973 /* checkkeys */ = { + isa = PBXNativeTarget; + buildConfigurationList = 047A63EA13285C3200CD7973 /* Build configuration list for PBXNativeTarget "checkkeys" */; + buildPhases = ( + 047A63DE13285C3200CD7973 /* Resources */, + 047A63DF13285C3200CD7973 /* Sources */, + 047A63E113285C3200CD7973 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = checkkeys; + productName = Test; + productReference = 047A63ED13285C3200CD7973 /* checkkeys.app */; + productType = "com.apple.product-type.application"; + }; + 1D6058900D05DD3D006BFB54 /* testwm2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "testwm2" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testwm2; + productName = Test; + productReference = 1D6058910D05DD3D006BFB54 /* testwm2.app */; + productType = "com.apple.product-type.application"; + }; + 56ED04FC118A8FE400A56AA6 /* testpower */ = { + isa = PBXNativeTarget; + buildConfigurationList = 56ED050A118A8FE400A56AA6 /* Build configuration list for PBXNativeTarget "testpower" */; + buildPhases = ( + 56ED04FD118A8FE400A56AA6 /* Resources */, + 56ED04FF118A8FE400A56AA6 /* Sources */, + 56ED0501118A8FE400A56AA6 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testpower; + productName = Test; + productReference = 56ED050D118A8FE400A56AA6 /* testpower.app */; + productType = "com.apple.product-type.application"; + }; + AAE7DEDA14CBB1E100DF1A0E /* testscale */ = { + isa = PBXNativeTarget; + buildConfigurationList = AAE7DEE914CBB1E100DF1A0E /* Build configuration list for PBXNativeTarget "testscale" */; + buildPhases = ( + AAE7DEDB14CBB1E100DF1A0E /* Resources */, + AAE7DEDD14CBB1E100DF1A0E /* Sources */, + AAE7DEE014CBB1E100DF1A0E /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testscale; + productName = Test; + productReference = AAE7DEEC14CBB1E100DF1A0E /* testscale.app */; + productType = "com.apple.product-type.application"; + }; + AAE7DF9E14CBB54E00DF1A0E /* testrendertarget */ = { + isa = PBXNativeTarget; + buildConfigurationList = AAE7DFAE14CBB54E00DF1A0E /* Build configuration list for PBXNativeTarget "testrendertarget" */; + buildPhases = ( + AAE7DF9F14CBB54E00DF1A0E /* Resources */, + AAE7DFA214CBB54E00DF1A0E /* Sources */, + AAE7DFA514CBB54E00DF1A0E /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testrendertarget; + productName = Test; + productReference = AAE7DFB114CBB54E00DF1A0E /* testrendertarget.app */; + productType = "com.apple.product-type.application"; + }; + FDA8AAAA0E2D330F00EA573E /* loopwav */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDA8AAB80E2D330F00EA573E /* Build configuration list for PBXNativeTarget "loopwav" */; + buildPhases = ( + FDA8AAAB0E2D330F00EA573E /* Resources */, + FDA8AAAC0E2D330F00EA573E /* Sources */, + FDA8AAAE0E2D330F00EA573E /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = loopwav; + productName = Test; + productReference = FDA8AABB0E2D330F00EA573E /* loopwav.app */; + productType = "com.apple.product-type.application"; + }; + FDAAC3BB0E2D47E6001DB1D8 /* testaudioinfo */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDAAC3CA0E2D47E6001DB1D8 /* Build configuration list for PBXNativeTarget "testaudioinfo" */; + buildPhases = ( + FDAAC3BC0E2D47E6001DB1D8 /* Resources */, + FDAAC3BE0E2D47E6001DB1D8 /* Sources */, + FDAAC3C00E2D47E6001DB1D8 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testaudioinfo; + productName = Test; + productReference = FDAAC3CD0E2D47E6001DB1D8 /* testaudioinfo.app */; + productType = "com.apple.product-type.application"; + }; + FDAAC58A0E2D5429001DB1D8 /* testerror */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDAAC5980E2D5429001DB1D8 /* Build configuration list for PBXNativeTarget "testerror" */; + buildPhases = ( + FDAAC58B0E2D5429001DB1D8 /* Resources */, + FDAAC58C0E2D5429001DB1D8 /* Sources */, + FDAAC58E0E2D5429001DB1D8 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testerror; + productName = Test; + productReference = FDAAC59B0E2D5429001DB1D8 /* testerror.app */; + productType = "com.apple.product-type.application"; + }; + FDAAC5B80E2D55B5001DB1D8 /* testfile */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDAAC5C60E2D55B5001DB1D8 /* Build configuration list for PBXNativeTarget "testfile" */; + buildPhases = ( + FDAAC5B90E2D55B5001DB1D8 /* Resources */, + FDAAC5BA0E2D55B5001DB1D8 /* Sources */, + FDAAC5BC0E2D55B5001DB1D8 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testfile; + productName = Test; + productReference = FDAAC5C90E2D55B5001DB1D8 /* testfile.app */; + productType = "com.apple.product-type.application"; + }; + FDAAC6150E2D5914001DB1D8 /* testgles */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDAAC6230E2D5914001DB1D8 /* Build configuration list for PBXNativeTarget "testgles" */; + buildPhases = ( + FDAAC6160E2D5914001DB1D8 /* Resources */, + FDAAC6170E2D5914001DB1D8 /* Sources */, + FDAAC6190E2D5914001DB1D8 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testgles; + productName = Test; + productReference = FDAAC6260E2D5914001DB1D8 /* testgles.app */; + productType = "com.apple.product-type.application"; + }; + FDC42FEF0F0D866D009C87E1 /* testdraw2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDC42FFD0F0D866D009C87E1 /* Build configuration list for PBXNativeTarget "testdraw2" */; + buildPhases = ( + FDC42FF00F0D866D009C87E1 /* Resources */, + FDC42FF10F0D866D009C87E1 /* Sources */, + FDC42FF30F0D866D009C87E1 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testdraw2; + productName = Test; + productReference = FDC430000F0D866D009C87E1 /* torturethread.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C0F90E2E4F4B00B7A85F /* testthread */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C1070E2E4F4B00B7A85F /* Build configuration list for PBXNativeTarget "testthread" */; + buildPhases = ( + FDD2C0FA0E2E4F4B00B7A85F /* Resources */, + FDD2C0FB0E2E4F4B00B7A85F /* Sources */, + FDD2C0FD0E2E4F4B00B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testthread; + productName = Test; + productReference = FDD2C10A0E2E4F4B00B7A85F /* testthread.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C1700E2E52C000B7A85F /* testiconv */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C17E0E2E52C000B7A85F /* Build configuration list for PBXNativeTarget "testiconv" */; + buildPhases = ( + FDD2C1710E2E52C000B7A85F /* Resources */, + FDD2C1720E2E52C000B7A85F /* Sources */, + FDD2C1740E2E52C000B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testiconv; + productName = Test; + productReference = FDD2C1810E2E52C000B7A85F /* testiconv.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C1930E2E534F00B7A85F /* testjoystick */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C1A20E2E534F00B7A85F /* Build configuration list for PBXNativeTarget "testjoystick" */; + buildPhases = ( + FDD2C1940E2E534F00B7A85F /* Resources */, + FDD2C1960E2E534F00B7A85F /* Sources */, + FDD2C1980E2E534F00B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testjoystick; + productName = Test; + productReference = FDD2C1A50E2E534F00B7A85F /* testjoystick.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C44D0E2E773800B7A85F /* testkeys */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C45B0E2E773800B7A85F /* Build configuration list for PBXNativeTarget "testkeys" */; + buildPhases = ( + FDD2C44E0E2E773800B7A85F /* Resources */, + FDD2C44F0E2E773800B7A85F /* Sources */, + FDD2C4510E2E773800B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testkeys; + productName = Test; + productReference = FDD2C45E0E2E773800B7A85F /* testkeys.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C46B0E2E77D700B7A85F /* testlock */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C4790E2E77D700B7A85F /* Build configuration list for PBXNativeTarget "testlock" */; + buildPhases = ( + FDD2C46C0E2E77D700B7A85F /* Resources */, + FDD2C46D0E2E77D700B7A85F /* Sources */, + FDD2C46F0E2E77D700B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testlock; + productName = Test; + productReference = FDD2C47C0E2E77D700B7A85F /* testlock.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C4F90E2E7F4800B7A85F /* testplatform */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C5080E2E7F4800B7A85F /* Build configuration list for PBXNativeTarget "testplatform" */; + buildPhases = ( + FDD2C4FA0E2E7F4800B7A85F /* Resources */, + FDD2C4FC0E2E7F4800B7A85F /* Sources */, + FDD2C4FE0E2E7F4800B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testplatform; + productName = Test; + productReference = FDD2C50B0E2E7F4800B7A85F /* testplatform.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C5170E2E807600B7A85F /* testsem */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C5260E2E807600B7A85F /* Build configuration list for PBXNativeTarget "testsem" */; + buildPhases = ( + FDD2C5180E2E807600B7A85F /* Resources */, + FDD2C51A0E2E807600B7A85F /* Sources */, + FDD2C51C0E2E807600B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testsem; + productName = Test; + productReference = FDD2C5290E2E807600B7A85F /* testsem.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C53D0E2E80E400B7A85F /* testsprite2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C54B0E2E80E400B7A85F /* Build configuration list for PBXNativeTarget "testsprite2" */; + buildPhases = ( + FDD2C53E0E2E80E400B7A85F /* Resources */, + FDD2C53F0E2E80E400B7A85F /* Sources */, + FDD2C5410E2E80E400B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testsprite2; + productName = Test; + productReference = FDD2C54E0E2E80E400B7A85F /* testsprite2.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C5740E2E8C7400B7A85F /* testtimer */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C5840E2E8C7400B7A85F /* Build configuration list for PBXNativeTarget "testtimer" */; + buildPhases = ( + FDD2C5750E2E8C7400B7A85F /* Resources */, + FDD2C5770E2E8C7400B7A85F /* Sources */, + FDD2C57A0E2E8C7400B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testtimer; + productName = Test; + productReference = FDD2C5870E2E8C7400B7A85F /* testtimer.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C5B30E2E8CFC00B7A85F /* testver */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C5C20E2E8CFC00B7A85F /* Build configuration list for PBXNativeTarget "testver" */; + buildPhases = ( + FDD2C5B40E2E8CFC00B7A85F /* Resources */, + FDD2C5B60E2E8CFC00B7A85F /* Sources */, + FDD2C5B80E2E8CFC00B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = testver; + productName = Test; + productReference = FDD2C5C50E2E8CFC00B7A85F /* testver.app */; + productType = "com.apple.product-type.application"; + }; + FDD2C6E20E2E959E00B7A85F /* torturethread */ = { + isa = PBXNativeTarget; + buildConfigurationList = FDD2C6F10E2E959E00B7A85F /* Build configuration list for PBXNativeTarget "torturethread" */; + buildPhases = ( + FDD2C6E30E2E959E00B7A85F /* Resources */, + FDD2C6E50E2E959E00B7A85F /* Sources */, + FDD2C6E70E2E959E00B7A85F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = torturethread; + productName = Test; + productReference = FDD2C6F40E2E959E00B7A85F /* torturethread.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestiPhoneOS" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = FD1B48AD0E3131CA007AB34E /* Products */; + ProjectRef = FD1B48AC0E3131CA007AB34E /* SDL.xcodeproj */; + }, + { + ProductGroup = AA1EE44E176059220029C7A5 /* Products */; + ProjectRef = AA1EE44D176059220029C7A5 /* SDL2test.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 047A63DD13285C3200CD7973 /* checkkeys */, + FDA8AAAA0E2D330F00EA573E /* loopwav */, + FDAAC3BB0E2D47E6001DB1D8 /* testaudioinfo */, + FDC42FEF0F0D866D009C87E1 /* testdraw2 */, + FDAAC58A0E2D5429001DB1D8 /* testerror */, + FDAAC5B80E2D55B5001DB1D8 /* testfile */, + 046CEF7513254F23007AD51D /* testgesture */, + FDAAC6150E2D5914001DB1D8 /* testgles */, + FDD2C1700E2E52C000B7A85F /* testiconv */, + FDD2C1930E2E534F00B7A85F /* testjoystick */, + FDD2C44D0E2E773800B7A85F /* testkeys */, + FDD2C46B0E2E77D700B7A85F /* testlock */, + FDD2C4F90E2E7F4800B7A85F /* testplatform */, + 56ED04FC118A8FE400A56AA6 /* testpower */, + AAE7DF9E14CBB54E00DF1A0E /* testrendertarget */, + AAE7DEDA14CBB1E100DF1A0E /* testscale */, + FDD2C5170E2E807600B7A85F /* testsem */, + FDD2C53D0E2E80E400B7A85F /* testsprite2 */, + FDD2C0F90E2E4F4B00B7A85F /* testthread */, + FDD2C5740E2E8C7400B7A85F /* testtimer */, + FDD2C5B30E2E8CFC00B7A85F /* testver */, + 1D6058900D05DD3D006BFB54 /* testwm2 */, + FDD2C6E20E2E959E00B7A85F /* torturethread */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 0466EE7011E565E4000198A4 /* testsdl.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = testsdl.app; + remoteRef = 0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + AA1EE452176059230029C7A5 /* libSDL2test.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libSDL2test.a; + remoteRef = AA1EE451176059230029C7A5 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + FD1B48B80E3131CA007AB34E /* libSDL2.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libSDL2.a; + remoteRef = FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 046CEF7613254F23007AD51D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 046CEF7713254F23007AD51D /* icon.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 047A63DE13285C3200CD7973 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56ED04FD118A8FE400A56AA6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 56ED04FE118A8FE400A56AA6 /* icon.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAE7DEDB14CBB1E100DF1A0E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AAE7DEDC14CBB1E100DF1A0E /* icon.bmp in Resources */, + AAE7DF4714CBB45000DF1A0E /* sample.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAE7DF9F14CBB54E00DF1A0E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AAE7DFA014CBB54E00DF1A0E /* icon.bmp in Resources */, + AAE7DFA114CBB54E00DF1A0E /* sample.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDA8AAAB0E2D330F00EA573E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDA8AAE30E2D33C600EA573E /* sample.wav in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC3BC0E2D47E6001DB1D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC58B0E2D5429001DB1D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC5B90E2D55B5001DB1D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC6160E2D5914001DB1D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDAAC6390E2D59BE001DB1D8 /* icon.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC42FF00F0D866D009C87E1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C0FA0E2E4F4B00B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C1710E2E52C000B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C18B0E2E52FE00B7A85F /* utf8.txt in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C1940E2E534F00B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C44E0E2E773800B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C46C0E2E77D700B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C4FA0E2E7F4800B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C5180E2E807600B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C53E0E2E80E400B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C5520E2E812C00B7A85F /* icon.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C5750E2E8C7400B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C5760E2E8C7400B7A85F /* icon.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C5B40E2E8CFC00B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C5B50E2E8CFC00B7A85F /* icon.bmp in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C6E30E2E959E00B7A85F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 046CEF7813254F23007AD51D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 046CEF8A13254F63007AD51D /* testgesture.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 047A63DF13285C3200CD7973 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 047A63F113285CD100CD7973 /* checkkeys.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDA8A79C0E2D0F9300EA573E /* testwm2.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 56ED04FF118A8FE400A56AA6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 56ED0511118A904200A56AA6 /* testpower.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAE7DEDD14CBB1E100DF1A0E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AAE7DF4614CBB43900DF1A0E /* testscale.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AAE7DFA214CBB54E00DF1A0E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AAE7DFB514CBB5F700DF1A0E /* testrendertarget.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDA8AAAC0E2D330F00EA573E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDA8AABE0E2D335C00EA573E /* loopwave.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC3BE0E2D47E6001DB1D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDAAC3D30E2D4800001DB1D8 /* testaudioinfo.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC58C0E2D5429001DB1D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDAAC59F0E2D54B8001DB1D8 /* testerror.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC5BA0E2D55B5001DB1D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDAAC5CC0E2D55CA001DB1D8 /* testfile.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDAAC6170E2D5914001DB1D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDAAC62A0E2D5960001DB1D8 /* testgles.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDC42FF10F0D866D009C87E1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDC4300A0F0D86BF009C87E1 /* testdraw2.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C0FB0E2E4F4B00B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C10D0E2E4F6900B7A85F /* testthread.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C1720E2E52C000B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C1840E2E52D900B7A85F /* testiconv.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C1960E2E534F00B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C1A80E2E536400B7A85F /* testjoystick.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C44F0E2E773800B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C4610E2E777500B7A85F /* testkeys.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C46D0E2E77D700B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C47F0E2E77E300B7A85F /* testlock.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C4FC0E2E7F4800B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C50E0E2E7F5800B7A85F /* testplatform.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C51A0E2E807600B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C52C0E2E808700B7A85F /* testsem.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C53F0E2E80E400B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C5510E2E80F400B7A85F /* testsprite2.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C5770E2E8C7400B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C58A0E2E8CB500B7A85F /* testtimer.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C5B60E2E8CFC00B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C5C80E2E8D1200B7A85F /* testver.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FDD2C6E50E2E959E00B7A85F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FDD2C6F70E2E95B100B7A85F /* torturethread.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 046CEF8413254F23007AD51D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testgesture; + }; + name = Debug; + }; + 046CEF8513254F23007AD51D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testgesture; + }; + name = Release; + }; + 047A63EB13285C3200CD7973 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = checkkeys; + }; + name = Debug; + }; + 047A63EC13285C3200CD7973 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = checkkeys; + }; + name = Release; + }; + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testwm2; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testwm2; + }; + name = Release; + }; + 56ED050B118A8FE400A56AA6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testpower; + }; + name = Debug; + }; + 56ED050C118A8FE400A56AA6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testpower; + }; + name = Release; + }; + AAE7DEEA14CBB1E100DF1A0E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testscale; + }; + name = Debug; + }; + AAE7DEEB14CBB1E100DF1A0E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testscale; + }; + name = Release; + }; + AAE7DFAF14CBB54E00DF1A0E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testrendertarget; + }; + name = Debug; + }; + AAE7DFB014CBB54E00DF1A0E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testrendertarget; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + armv7, + armv6, + ); + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ../../include; + IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + OTHER_LDFLAGS = "-ObjC"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + armv7, + armv6, + ); + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + HEADER_SEARCH_PATHS = ../../include; + IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; + OTHER_LDFLAGS = "-ObjC"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + FDA8AAB90E2D330F00EA573E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = loopwav; + }; + name = Debug; + }; + FDA8AABA0E2D330F00EA573E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = loopwav; + }; + name = Release; + }; + FDAAC3CB0E2D47E6001DB1D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testaudioinfo; + }; + name = Debug; + }; + FDAAC3CC0E2D47E6001DB1D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testaudioinfo; + }; + name = Release; + }; + FDAAC5990E2D5429001DB1D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testerror; + }; + name = Debug; + }; + FDAAC59A0E2D5429001DB1D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testerror; + }; + name = Release; + }; + FDAAC5C70E2D55B5001DB1D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testfile; + }; + name = Debug; + }; + FDAAC5C80E2D55B5001DB1D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testfile; + }; + name = Release; + }; + FDAAC6240E2D5914001DB1D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testgles; + }; + name = Debug; + }; + FDAAC6250E2D5914001DB1D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testgles; + }; + name = Release; + }; + FDC42FFE0F0D866D009C87E1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = torturethread; + }; + name = Debug; + }; + FDC42FFF0F0D866D009C87E1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = torturethread; + }; + name = Release; + }; + FDD2C1080E2E4F4B00B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testthread; + }; + name = Debug; + }; + FDD2C1090E2E4F4B00B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testthread; + }; + name = Release; + }; + FDD2C17F0E2E52C000B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testiconv; + }; + name = Debug; + }; + FDD2C1800E2E52C000B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testiconv; + }; + name = Release; + }; + FDD2C1A30E2E534F00B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testjoystick; + }; + name = Debug; + }; + FDD2C1A40E2E534F00B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testjoystick; + }; + name = Release; + }; + FDD2C45C0E2E773800B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testkeys; + }; + name = Debug; + }; + FDD2C45D0E2E773800B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testkeys; + }; + name = Release; + }; + FDD2C47A0E2E77D700B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testlock; + }; + name = Debug; + }; + FDD2C47B0E2E77D700B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testlock; + }; + name = Release; + }; + FDD2C5090E2E7F4800B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testplatform; + }; + name = Debug; + }; + FDD2C50A0E2E7F4800B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testplatform; + }; + name = Release; + }; + FDD2C5270E2E807600B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testsem; + }; + name = Debug; + }; + FDD2C5280E2E807600B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testsem; + }; + name = Release; + }; + FDD2C54C0E2E80E400B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testsprite2; + }; + name = Debug; + }; + FDD2C54D0E2E80E400B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testsprite2; + }; + name = Release; + }; + FDD2C5850E2E8C7400B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testtimer; + }; + name = Debug; + }; + FDD2C5860E2E8C7400B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testtimer; + }; + name = Release; + }; + FDD2C5C30E2E8CFC00B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testver; + }; + name = Debug; + }; + FDD2C5C40E2E8CFC00B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = testver; + }; + name = Release; + }; + FDD2C6F20E2E959E00B7A85F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = torturethread; + }; + name = Debug; + }; + FDD2C6F30E2E959E00B7A85F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = torturethread; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 046CEF8313254F23007AD51D /* Build configuration list for PBXNativeTarget "testgesture" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 046CEF8413254F23007AD51D /* Debug */, + 046CEF8513254F23007AD51D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 047A63EA13285C3200CD7973 /* Build configuration list for PBXNativeTarget "checkkeys" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 047A63EB13285C3200CD7973 /* Debug */, + 047A63EC13285C3200CD7973 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "testwm2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 56ED050A118A8FE400A56AA6 /* Build configuration list for PBXNativeTarget "testpower" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 56ED050B118A8FE400A56AA6 /* Debug */, + 56ED050C118A8FE400A56AA6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AAE7DEE914CBB1E100DF1A0E /* Build configuration list for PBXNativeTarget "testscale" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AAE7DEEA14CBB1E100DF1A0E /* Debug */, + AAE7DEEB14CBB1E100DF1A0E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AAE7DFAE14CBB54E00DF1A0E /* Build configuration list for PBXNativeTarget "testrendertarget" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AAE7DFAF14CBB54E00DF1A0E /* Debug */, + AAE7DFB014CBB54E00DF1A0E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TestiPhoneOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDA8AAB80E2D330F00EA573E /* Build configuration list for PBXNativeTarget "loopwav" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDA8AAB90E2D330F00EA573E /* Debug */, + FDA8AABA0E2D330F00EA573E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDAAC3CA0E2D47E6001DB1D8 /* Build configuration list for PBXNativeTarget "testaudioinfo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDAAC3CB0E2D47E6001DB1D8 /* Debug */, + FDAAC3CC0E2D47E6001DB1D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDAAC5980E2D5429001DB1D8 /* Build configuration list for PBXNativeTarget "testerror" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDAAC5990E2D5429001DB1D8 /* Debug */, + FDAAC59A0E2D5429001DB1D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDAAC5C60E2D55B5001DB1D8 /* Build configuration list for PBXNativeTarget "testfile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDAAC5C70E2D55B5001DB1D8 /* Debug */, + FDAAC5C80E2D55B5001DB1D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDAAC6230E2D5914001DB1D8 /* Build configuration list for PBXNativeTarget "testgles" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDAAC6240E2D5914001DB1D8 /* Debug */, + FDAAC6250E2D5914001DB1D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDC42FFD0F0D866D009C87E1 /* Build configuration list for PBXNativeTarget "testdraw2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDC42FFE0F0D866D009C87E1 /* Debug */, + FDC42FFF0F0D866D009C87E1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C1070E2E4F4B00B7A85F /* Build configuration list for PBXNativeTarget "testthread" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C1080E2E4F4B00B7A85F /* Debug */, + FDD2C1090E2E4F4B00B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C17E0E2E52C000B7A85F /* Build configuration list for PBXNativeTarget "testiconv" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C17F0E2E52C000B7A85F /* Debug */, + FDD2C1800E2E52C000B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C1A20E2E534F00B7A85F /* Build configuration list for PBXNativeTarget "testjoystick" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C1A30E2E534F00B7A85F /* Debug */, + FDD2C1A40E2E534F00B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C45B0E2E773800B7A85F /* Build configuration list for PBXNativeTarget "testkeys" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C45C0E2E773800B7A85F /* Debug */, + FDD2C45D0E2E773800B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C4790E2E77D700B7A85F /* Build configuration list for PBXNativeTarget "testlock" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C47A0E2E77D700B7A85F /* Debug */, + FDD2C47B0E2E77D700B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C5080E2E7F4800B7A85F /* Build configuration list for PBXNativeTarget "testplatform" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C5090E2E7F4800B7A85F /* Debug */, + FDD2C50A0E2E7F4800B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C5260E2E807600B7A85F /* Build configuration list for PBXNativeTarget "testsem" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C5270E2E807600B7A85F /* Debug */, + FDD2C5280E2E807600B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C54B0E2E80E400B7A85F /* Build configuration list for PBXNativeTarget "testsprite2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C54C0E2E80E400B7A85F /* Debug */, + FDD2C54D0E2E80E400B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C5840E2E8C7400B7A85F /* Build configuration list for PBXNativeTarget "testtimer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C5850E2E8C7400B7A85F /* Debug */, + FDD2C5860E2E8C7400B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C5C20E2E8CFC00B7A85F /* Build configuration list for PBXNativeTarget "testver" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C5C30E2E8CFC00B7A85F /* Debug */, + FDD2C5C40E2E8CFC00B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FDD2C6F10E2E959E00B7A85F /* Build configuration list for PBXNativeTarget "torturethread" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FDD2C6F20E2E959E00B7A85F /* Debug */, + FDD2C6F30E2E959E00B7A85F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist index bdcbf6e717..0ab4b25e3c 100644 --- a/Xcode/SDL/Info-Framework.plist +++ b/Xcode/SDL/Info-Framework.plist @@ -4,14 +4,12 @@ CFBundleDevelopmentRegion English - CFBundleExecutable - SDL CFBundleGetInfoString http://www.libsdl.org CFBundleIconFile CFBundleIdentifier - SDL + org.libsdl.SDL2 CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -19,10 +17,12 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.2.14 + 2.0.0 CFBundleSignature SDLX CFBundleVersion - 1.2.14 + 2.0.0 + CFBundleExecutable + ${EXECUTABLE_NAME} diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 1dbe888692..3757efde05 100755 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -6,174 +6,7 @@ objectVersion = 46; objects = { -/* Begin PBXAggregateTarget section */ - 0032354F1070931700C76517 /* Generate Doxygen DocSet */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 003235571070933500C76517 /* Build configuration list for PBXAggregateTarget "Generate Doxygen DocSet" */; - buildPhases = ( - 0032354E1070931700C76517 /* ShellScript */, - ); - dependencies = ( - ); - name = "Generate Doxygen DocSet"; - productName = "Generate Doxygen DocSet"; - }; -/* End PBXAggregateTarget section */ - /* Begin PBXBuildFile section */ - 0014B7EF09C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */; }; - 0014B7F109C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */; }; - 0014B7F209C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */; }; - 0014B7F409C0D8D2003A99D5 /* SDL_dgaevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B7E809C0D8D2003A99D5 /* SDL_dgaevents_c.h */; }; - 0014B7F509C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */; }; - 0014B7F609C0D8D2003A99D5 /* SDL_dgamouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B7EA09C0D8D2003A99D5 /* SDL_dgamouse_c.h */; }; - 0014B7F709C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */; }; - 0014B7F809C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */; }; - 0014B7F909C0D8D2003A99D5 /* SDL_dgavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B7ED09C0D8D2003A99D5 /* SDL_dgavideo.h */; }; - 0014B84F09C0D977003A99D5 /* SDL_x11dga.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83809C0D977003A99D5 /* SDL_x11dga.c */; }; - 0014B85009C0D977003A99D5 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */; }; - 0014B85309C0D977003A99D5 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83C09C0D977003A99D5 /* SDL_x11events.c */; }; - 0014B85509C0D977003A99D5 /* SDL_x11gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */; }; - 0014B85709C0D977003A99D5 /* SDL_x11gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84009C0D977003A99D5 /* SDL_x11gl.c */; }; - 0014B85909C0D977003A99D5 /* SDL_x11image.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84209C0D977003A99D5 /* SDL_x11image.c */; }; - 0014B85B09C0D977003A99D5 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84409C0D977003A99D5 /* SDL_x11modes.c */; }; - 0014B85D09C0D977003A99D5 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */; }; - 0014B85F09C0D977003A99D5 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84809C0D977003A99D5 /* SDL_x11video.c */; }; - 0014B86209C0D977003A99D5 /* SDL_x11wm.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */; }; - 0014B86409C0D977003A99D5 /* SDL_x11yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */; }; - 0014B86509C0D977003A99D5 /* SDL_x11dga_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83709C0D977003A99D5 /* SDL_x11dga_c.h */; }; - 0014B86609C0D977003A99D5 /* SDL_x11dga.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83809C0D977003A99D5 /* SDL_x11dga.c */; }; - 0014B86709C0D977003A99D5 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */; }; - 0014B86809C0D977003A99D5 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83A09C0D977003A99D5 /* SDL_x11dyn.h */; }; - 0014B86909C0D977003A99D5 /* SDL_x11events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83B09C0D977003A99D5 /* SDL_x11events_c.h */; }; - 0014B86A09C0D977003A99D5 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83C09C0D977003A99D5 /* SDL_x11events.c */; }; - 0014B86B09C0D977003A99D5 /* SDL_x11gamma_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83D09C0D977003A99D5 /* SDL_x11gamma_c.h */; }; - 0014B86C09C0D977003A99D5 /* SDL_x11gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */; }; - 0014B86D09C0D977003A99D5 /* SDL_x11gl_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83F09C0D977003A99D5 /* SDL_x11gl_c.h */; }; - 0014B86E09C0D977003A99D5 /* SDL_x11gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84009C0D977003A99D5 /* SDL_x11gl.c */; }; - 0014B86F09C0D977003A99D5 /* SDL_x11image_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84109C0D977003A99D5 /* SDL_x11image_c.h */; }; - 0014B87009C0D977003A99D5 /* SDL_x11image.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84209C0D977003A99D5 /* SDL_x11image.c */; }; - 0014B87109C0D977003A99D5 /* SDL_x11modes_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84309C0D977003A99D5 /* SDL_x11modes_c.h */; }; - 0014B87209C0D977003A99D5 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84409C0D977003A99D5 /* SDL_x11modes.c */; }; - 0014B87309C0D977003A99D5 /* SDL_x11mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84509C0D977003A99D5 /* SDL_x11mouse_c.h */; }; - 0014B87409C0D977003A99D5 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */; }; - 0014B87509C0D977003A99D5 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84709C0D977003A99D5 /* SDL_x11sym.h */; }; - 0014B87609C0D977003A99D5 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84809C0D977003A99D5 /* SDL_x11video.c */; }; - 0014B87709C0D977003A99D5 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84909C0D977003A99D5 /* SDL_x11video.h */; }; - 0014B87809C0D977003A99D5 /* SDL_x11wm_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84A09C0D977003A99D5 /* SDL_x11wm_c.h */; }; - 0014B87909C0D977003A99D5 /* SDL_x11wm.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */; }; - 0014B87A09C0D977003A99D5 /* SDL_x11yuv_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84C09C0D977003A99D5 /* SDL_x11yuv_c.h */; }; - 0014B87B09C0D977003A99D5 /* SDL_x11yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */; }; - 0014B89209C0DA94003A99D5 /* XF86DGA.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89009C0DA94003A99D5 /* XF86DGA.c */; }; - 0014B89309C0DA94003A99D5 /* XF86DGA2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89109C0DA94003A99D5 /* XF86DGA2.c */; }; - 0014B89409C0DA94003A99D5 /* XF86DGA.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89009C0DA94003A99D5 /* XF86DGA.c */; }; - 0014B89509C0DA94003A99D5 /* XF86DGA2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89109C0DA94003A99D5 /* XF86DGA2.c */; }; - 0014B89709C0DAA1003A99D5 /* XF86VMode.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89609C0DAA1003A99D5 /* XF86VMode.c */; }; - 0014B89809C0DAA1003A99D5 /* XF86VMode.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89609C0DAA1003A99D5 /* XF86VMode.c */; }; - 0014B89B09C0DAAE003A99D5 /* Xv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89909C0DAAE003A99D5 /* Xv.c */; }; - 0014B89D09C0DAAE003A99D5 /* Xv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89909C0DAAE003A99D5 /* Xv.c */; }; - 0014B89E09C0DAAE003A99D5 /* Xvlibint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B89A09C0DAAE003A99D5 /* Xvlibint.h */; }; - 0014B8A009C0DAB9003A99D5 /* Xinerama.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89F09C0DAB9003A99D5 /* Xinerama.c */; }; - 0014B8A109C0DAB9003A99D5 /* Xinerama.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89F09C0DAB9003A99D5 /* Xinerama.c */; }; - 0014B8A309C0DAC4003A99D5 /* xme.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B8A209C0DAC4003A99D5 /* xme.c */; }; - 0014B8A409C0DAC4003A99D5 /* xme.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B8A209C0DAC4003A99D5 /* xme.c */; }; - 00162D4409BD1FA90037C8D0 /* SDL_config_dreamcast.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */; }; - 00162D4509BD1FA90037C8D0 /* SDL_config_macos.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */; }; - 00162D4609BD1FA90037C8D0 /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */; }; - 00162D4709BD1FA90037C8D0 /* SDL_config_os2.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */; }; - 00162D4809BD1FA90037C8D0 /* SDL_config_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */; }; - 00162D4909BD1FA90037C8D0 /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3709BD1FA90037C8D0 /* SDL_config.h */; }; - 00162D4A09BD1FA90037C8D0 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3809BD1FA90037C8D0 /* SDL_platform.h */; }; - 00162D4B09BD1FA90037C8D0 /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */; }; - 00162D5309BD20DA0037C8D0 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */; }; - 00162D5409BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */; }; - 00162D5609BD20DA0037C8D0 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */; }; - 00162D5709BD20DA0037C8D0 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */; }; - 00162D5909BD20DA0037C8D0 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */; }; - 00162D5A09BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */; }; - 00162D5B09BD20DA0037C8D0 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D4F09BD20DA0037C8D0 /* SDL_sysmutex_c.h */; }; - 00162D5C09BD20DA0037C8D0 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */; }; - 00162D5D09BD20DA0037C8D0 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */; }; - 00162D5E09BD20DA0037C8D0 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D5209BD20DA0037C8D0 /* SDL_systhread_c.h */; }; - 00162D6109BD21010037C8D0 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6009BD21010037C8D0 /* SDL_systimer.c */; }; - 00162D6209BD21010037C8D0 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6009BD21010037C8D0 /* SDL_systimer.c */; }; - 00162D6B09BD214F0037C8D0 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6509BD214F0037C8D0 /* SDL_getenv.c */; }; - 00162D6C09BD214F0037C8D0 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6609BD214F0037C8D0 /* SDL_malloc.c */; }; - 00162D6D09BD214F0037C8D0 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6709BD214F0037C8D0 /* SDL_qsort.c */; }; - 00162D6E09BD214F0037C8D0 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */; }; - 00162D6F09BD214F0037C8D0 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6909BD214F0037C8D0 /* SDL_string.c */; }; - 00162D7009BD214F0037C8D0 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6509BD214F0037C8D0 /* SDL_getenv.c */; }; - 00162D7109BD214F0037C8D0 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6609BD214F0037C8D0 /* SDL_malloc.c */; }; - 00162D7209BD214F0037C8D0 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6709BD214F0037C8D0 /* SDL_qsort.c */; }; - 00162D7309BD214F0037C8D0 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */; }; - 00162D7409BD214F0037C8D0 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6909BD214F0037C8D0 /* SDL_string.c */; }; - 00162DA409BD222F0037C8D0 /* SDL_config_dreamcast.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DA509BD222F0037C8D0 /* SDL_config_macos.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DA609BD222F0037C8D0 /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DA709BD222F0037C8D0 /* SDL_config_os2.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DA809BD222F0037C8D0 /* SDL_config_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DA909BD222F0037C8D0 /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3709BD1FA90037C8D0 /* SDL_config.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DAA09BD222F0037C8D0 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3809BD1FA90037C8D0 /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DAB09BD222F0037C8D0 /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DAC09BD222F0037C8D0 /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E501191D2B7F000001 /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DAD09BD222F0037C8D0 /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E601191D2B7F000001 /* close_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DAE09BD222F0037C8D0 /* SDL_active.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E701191D2B7F000001 /* SDL_active.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DAF09BD222F0037C8D0 /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E801191D2B7F000001 /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB009BD222F0037C8D0 /* SDL_byteorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E901191D2B7F000001 /* SDL_byteorder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB109BD222F0037C8D0 /* SDL_cdrom.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EA01191D2B7F000001 /* SDL_cdrom.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB209BD222F0037C8D0 /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EB01191D2B7F000001 /* SDL_copying.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB309BD222F0037C8D0 /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB409BD222F0037C8D0 /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EC01191D2B7F000001 /* SDL_endian.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB509BD222F0037C8D0 /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5ED01191D2B7F000001 /* SDL_error.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB609BD222F0037C8D0 /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EE01191D2B7F000001 /* SDL_events.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB709BD222F0037C8D0 /* SDL_getenv.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EF01191D2B7F000001 /* SDL_getenv.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB809BD222F0037C8D0 /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F001191D2B7F000001 /* SDL_joystick.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DB909BD222F0037C8D0 /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DBA09BD222F0037C8D0 /* SDL_keysym.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F201191D2B7F000001 /* SDL_keysym.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DBB09BD222F0037C8D0 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = B29A290D04E5B28700A80002 /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DBC09BD222F0037C8D0 /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F301191D2B7F000001 /* SDL_main.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DBD09BD222F0037C8D0 /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F401191D2B7F000001 /* SDL_mouse.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DBE09BD222F0037C8D0 /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F501191D2B7F000001 /* SDL_mutex.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DBF09BD222F0037C8D0 /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC705C4450500E5DC7F /* SDL_name.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC009BD222F0037C8D0 /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F601191D2B7F000001 /* SDL_opengl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC109BD222F0037C8D0 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F701191D2B7F000001 /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC209BD222F0037C8D0 /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F801191D2B7F000001 /* SDL_rwops.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC309BD222F0037C8D0 /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F901191D2B7F000001 /* SDL_syswm.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC409BD222F0037C8D0 /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FA01191D2B7F000001 /* SDL_thread.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC509BD222F0037C8D0 /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FB01191D2B7F000001 /* SDL_timer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC609BD222F0037C8D0 /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FC01191D2B7F000001 /* SDL_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC709BD222F0037C8D0 /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FD01191D2B7F000001 /* SDL_version.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC809BD222F0037C8D0 /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FE01191D2B7F000001 /* SDL_video.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162DC909BD222F0037C8D0 /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FF01191D2B7F000001 /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00162E6809BD27300037C8D0 /* SDL_mixer_MMX.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */; }; - 00162E6A09BD27360037C8D0 /* SDL_mixer_MMX.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */; }; - 00162E6B09BD27370037C8D0 /* SDL_mixer_MMX.h in Headers */ = {isa = PBXBuildFile; fileRef = 00B7E620097F2D9E00826121 /* SDL_mixer_MMX.h */; }; - 00162F3B09BE27FB0037C8D0 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */; }; - 00162F3D09BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */; }; - 00162F3F09BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */; }; - 00162F4109BE27FB0037C8D0 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */; }; - 00162F4209BE27FB0037C8D0 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162F3509BE27FB0037C8D0 /* SDL_nullevents_c.h */; }; - 00162F4309BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */; }; - 00162F4409BE27FB0037C8D0 /* SDL_nullmouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162F3709BE27FB0037C8D0 /* SDL_nullmouse_c.h */; }; - 00162F4509BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */; }; - 00162F4609BE27FB0037C8D0 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162F3909BE27FB0037C8D0 /* SDL_nullvideo.h */; }; - 002F328609CA049100EBEB88 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F328509CA049100EBEB88 /* SDL_iconv.c */; }; - 002F328709CA049100EBEB88 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F328509CA049100EBEB88 /* SDL_iconv.c */; }; - 002F32D709CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */; }; - 002F32D909CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */; }; - 002F32DA09CA0BE700EBEB88 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 002F32D509CA0BE700EBEB88 /* SDL_diskaudio.h */; }; - 002F32E509CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */; }; - 002F32E709CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */; }; - 002F32E809CA0BF600EBEB88 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */; }; - 004C2C8B0975E13300E9D430 /* AudioFilePlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C860975E13300E9D430 /* AudioFilePlayer.c */; }; - 004C2C8C0975E13300E9D430 /* AudioFileReaderThread.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */; }; - 004C2C8D0975E13300E9D430 /* CDPlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C880975E13300E9D430 /* CDPlayer.c */; }; - 004C2C8E0975E13300E9D430 /* SDLOSXCAGuard.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */; }; - 004C2C900975E13300E9D430 /* AudioFilePlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C860975E13300E9D430 /* AudioFilePlayer.c */; }; - 004C2C910975E13300E9D430 /* AudioFileReaderThread.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */; }; - 004C2C920975E13300E9D430 /* CDPlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C880975E13300E9D430 /* CDPlayer.c */; }; - 004C2C930975E13300E9D430 /* SDLOSXCAGuard.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */; }; - 004C2C940975E13300E9D430 /* SDLOSXCAGuard.h in Headers */ = {isa = PBXBuildFile; fileRef = 004C2C8A0975E13300E9D430 /* SDLOSXCAGuard.h */; }; 007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; }; 007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; }; 007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; }; @@ -186,132 +19,765 @@ 007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; }; 007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; }; 007317AE0858DECD00B2BC32 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; }; - 007317AF0858DECD00B2BC32 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A10858DECD00B2BC32 /* QuickTime.framework */; }; - 007317B00858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; }; - 007317B10858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; }; - 007317B20858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; }; - 007317B30858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; }; - 007317B40858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; }; - 007317B50858DECD00B2BC32 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; }; - 007317B60858DECD00B2BC32 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A10858DECD00B2BC32 /* QuickTime.framework */; }; 007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; }; - 007317C40858E15000B2BC32 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; }; - 00D0D02310675823004B05EF /* SDL_QuartzWM.h in Headers */ = {isa = PBXBuildFile; fileRef = 00D0D02210675823004B05EF /* SDL_QuartzWM.h */; }; + 00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; }; 00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; }; 00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; }; - 00EAE6FC0C4D3F84009A420A /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */; }; - 00EAE6FD0C4D3F88009A420A /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */; }; - 046B91EC0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; }; - 046B91ED0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; }; - 046B92130A11B8AD00FB151C /* SDL_dlcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */; }; - 046B92140A11B8AD00FB151C /* SDL_dlcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */; }; - BECDF62B0761BA81005FE872 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF2F0086C3A07F000001 /* SDLMain.nib */; }; - BECDF62E0761BA81005FE872 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538330006D78D67F000001 /* SDL_audio.c */; }; - BECDF62F0761BA81005FE872 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538331006D78D67F000001 /* SDL_audiocvt.c */; }; - BECDF6300761BA81005FE872 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538332006D78D67F000001 /* SDL_audiodev.c */; }; - BECDF6320761BA81005FE872 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538334006D78D67F000001 /* SDL_mixer.c */; }; - BECDF6330761BA81005FE872 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538335006D78D67F000001 /* SDL_wave.c */; }; - BECDF6350761BA81005FE872 /* SDL_active.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538368006D79147F000001 /* SDL_active.c */; }; - BECDF6360761BA81005FE872 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538369006D79147F000001 /* SDL_events.c */; }; - BECDF6370761BA81005FE872 /* SDL_expose.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836A006D79147F000001 /* SDL_expose.c */; }; - BECDF6380761BA81005FE872 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836B006D79147F000001 /* SDL_keyboard.c */; }; - BECDF6390761BA81005FE872 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836C006D79147F000001 /* SDL_mouse.c */; }; - BECDF63A0761BA81005FE872 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836D006D79147F000001 /* SDL_quit.c */; }; - BECDF63B0761BA81005FE872 /* SDL_resize.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836E006D79147F000001 /* SDL_resize.c */; }; - BECDF63C0761BA81005FE872 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538377006D79307F000001 /* SDL_rwops.c */; }; - BECDF63E0761BA81005FE872 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383A0006D79BC7F000001 /* SDL_timer.c */; }; - BECDF63F0761BA81005FE872 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383D8006D7A567F000001 /* SDL_blit.c */; }; - BECDF6400761BA81005FE872 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DA006D7A567F000001 /* SDL_blit_0.c */; }; - BECDF6410761BA81005FE872 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DB006D7A567F000001 /* SDL_blit_1.c */; }; - BECDF6420761BA81005FE872 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DC006D7A567F000001 /* SDL_blit_A.c */; }; - BECDF6430761BA81005FE872 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DE006D7A567F000001 /* SDL_blit_N.c */; }; - BECDF6440761BA81005FE872 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DF006D7A567F000001 /* SDL_bmp.c */; }; - BECDF6450761BA81005FE872 /* SDL_cursor.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E0006D7A567F000001 /* SDL_cursor.c */; }; - BECDF6460761BA81005FE872 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E2006D7A567F000001 /* SDL_gamma.c */; }; - BECDF6470761BA81005FE872 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E6006D7A567F000001 /* SDL_pixels.c */; }; - BECDF6480761BA81005FE872 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E8006D7A567F000001 /* SDL_RLEaccel.c */; }; - BECDF6490761BA81005FE872 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EC006D7A567F000001 /* SDL_surface.c */; }; - BECDF64A0761BA81005FE872 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EE006D7A567F000001 /* SDL_video.c */; }; - BECDF64B0761BA81005FE872 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EF006D7A567F000001 /* SDL_yuv.c */; }; - BECDF64C0761BA81005FE872 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383F1006D7A567F000001 /* SDL_yuv_sw.c */; }; - BECDF64D0761BA81005FE872 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538438006D7D947F000001 /* SDL_error.c */; }; - BECDF64E0761BA81005FE872 /* SDL_fatal.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538439006D7D947F000001 /* SDL_fatal.c */; }; - BECDF6500761BA81005FE872 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153843C006D7D947F000001 /* SDL.c */; }; - BECDF6510761BA81005FE872 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538445006D7EC67F000001 /* SDL_thread.c */; }; - BECDF6520761BA81005FE872 /* SDL_cdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4895006D86FF7F000001 /* SDL_cdrom.c */; }; - BECDF6530761BA81005FE872 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E489D006D88D97F000001 /* SDL_joystick.c */; }; - BECDF6580761BA81005FE872 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EA006D7A567F000001 /* SDL_stretch.c */; }; - BECDF6590761BA81005FE872 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = F51789D101769A2401D3D55B /* SDL_sysjoystick.c */; }; - BECDF65B0761BA81005FE872 /* SDL_QuartzEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */; }; - BECDF65C0761BA81005FE872 /* SDL_QuartzGL.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */; }; - BECDF65D0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */; }; - BECDF65E0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */; }; - BECDF65F0761BA81005FE872 /* SDL_QuartzWM.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */; }; - BECDF6610761BA81005FE872 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */; }; - BECDF6620761BA81005FE872 /* SDL_syscdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = B2A23A7B04157C5700A80002 /* SDL_syscdrom.c */; }; - BECDF6670761BA81005FE872 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = BECDF5D50761B759005FE872 /* SDL_coreaudio.c */; }; - BECDF6720761BA81005FE872 /* CGS.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4D605A88AD0006B9F1C /* CGS.h */; }; - BECDF6730761BA81005FE872 /* SDL_QuartzKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4D905A88AD0006B9F1C /* SDL_QuartzKeys.h */; }; - BECDF6740761BA81005FE872 /* SDL_QuartzVideo.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4DA05A88AD0006B9F1C /* SDL_QuartzVideo.h */; }; - BECDF6750761BA81005FE872 /* SDL_QuartzWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4DC05A88AD0006B9F1C /* SDL_QuartzWindow.h */; }; - BECDF6760761BA81005FE872 /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */; }; - BECDF6770761BA81005FE872 /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC705C4450500E5DC7F /* SDL_name.h */; }; - BECDF6780761BA81005FE872 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = BECDF5D60761B759005FE872 /* SDL_coreaudio.h */; }; - BECDF67A0761BA81005FE872 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538330006D78D67F000001 /* SDL_audio.c */; }; - BECDF67B0761BA81005FE872 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538331006D78D67F000001 /* SDL_audiocvt.c */; }; - BECDF67D0761BA81005FE872 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538332006D78D67F000001 /* SDL_audiodev.c */; }; - BECDF67E0761BA81005FE872 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538334006D78D67F000001 /* SDL_mixer.c */; }; - BECDF67F0761BA81005FE872 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538335006D78D67F000001 /* SDL_wave.c */; }; - BECDF6810761BA81005FE872 /* SDL_cdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4895006D86FF7F000001 /* SDL_cdrom.c */; }; - BECDF6830761BA81005FE872 /* SDL_active.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538368006D79147F000001 /* SDL_active.c */; }; - BECDF6840761BA81005FE872 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538369006D79147F000001 /* SDL_events.c */; }; - BECDF6850761BA81005FE872 /* SDL_expose.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836A006D79147F000001 /* SDL_expose.c */; }; - BECDF6860761BA81005FE872 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836B006D79147F000001 /* SDL_keyboard.c */; }; - BECDF6870761BA81005FE872 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836C006D79147F000001 /* SDL_mouse.c */; }; - BECDF6880761BA81005FE872 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836D006D79147F000001 /* SDL_quit.c */; }; - BECDF6890761BA81005FE872 /* SDL_resize.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836E006D79147F000001 /* SDL_resize.c */; }; - BECDF68A0761BA81005FE872 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538377006D79307F000001 /* SDL_rwops.c */; }; - BECDF68B0761BA81005FE872 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E489D006D88D97F000001 /* SDL_joystick.c */; }; - BECDF68C0761BA81005FE872 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538445006D7EC67F000001 /* SDL_thread.c */; }; - BECDF6920761BA81005FE872 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383A0006D79BC7F000001 /* SDL_timer.c */; }; - BECDF6930761BA81005FE872 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383D8006D7A567F000001 /* SDL_blit.c */; }; - BECDF6940761BA81005FE872 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DA006D7A567F000001 /* SDL_blit_0.c */; }; - BECDF6950761BA81005FE872 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DB006D7A567F000001 /* SDL_blit_1.c */; }; - BECDF6960761BA81005FE872 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DC006D7A567F000001 /* SDL_blit_A.c */; }; - BECDF6970761BA81005FE872 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DE006D7A567F000001 /* SDL_blit_N.c */; }; - BECDF6980761BA81005FE872 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DF006D7A567F000001 /* SDL_bmp.c */; }; - BECDF6990761BA81005FE872 /* SDL_cursor.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E0006D7A567F000001 /* SDL_cursor.c */; }; - BECDF69A0761BA81005FE872 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E2006D7A567F000001 /* SDL_gamma.c */; }; - BECDF69B0761BA81005FE872 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E6006D7A567F000001 /* SDL_pixels.c */; }; - BECDF69C0761BA81005FE872 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E8006D7A567F000001 /* SDL_RLEaccel.c */; }; - BECDF69D0761BA81005FE872 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EA006D7A567F000001 /* SDL_stretch.c */; }; - BECDF69E0761BA81005FE872 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EC006D7A567F000001 /* SDL_surface.c */; }; - BECDF69F0761BA81005FE872 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EE006D7A567F000001 /* SDL_video.c */; }; - BECDF6A00761BA81005FE872 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EF006D7A567F000001 /* SDL_yuv.c */; }; - BECDF6A10761BA81005FE872 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383F1006D7A567F000001 /* SDL_yuv_sw.c */; }; - BECDF6A20761BA81005FE872 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538438006D7D947F000001 /* SDL_error.c */; }; - BECDF6A30761BA81005FE872 /* SDL_fatal.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538439006D7D947F000001 /* SDL_fatal.c */; }; - BECDF6A50761BA81005FE872 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153843C006D7D947F000001 /* SDL.c */; }; - BECDF6A60761BA81005FE872 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = F51789D101769A2401D3D55B /* SDL_sysjoystick.c */; }; - BECDF6A80761BA81005FE872 /* SDL_syscdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4894006D86FF7F000001 /* SDL_syscdrom.c */; }; - BECDF6A90761BA81005FE872 /* SDL_QuartzEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */; }; - BECDF6AA0761BA81005FE872 /* SDL_QuartzGL.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */; }; - BECDF6AB0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */; }; - BECDF6AC0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */; }; - BECDF6AD0761BA81005FE872 /* SDL_QuartzWM.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */; }; - BECDF6AF0761BA81005FE872 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */; }; - BECDF6B00761BA81005FE872 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = BECDF5D50761B759005FE872 /* SDL_coreaudio.c */; }; - BECDF6B70761BA81005FE872 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EECDF2E0086C3A07F000001 /* SDLMain.m */; }; + 04043BBB12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */; }; + 04043BBC12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */; }; + 041B2CA512FA0D680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; }; + 041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; }; + 041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; }; + 041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; }; + 0435673E1303160F00BA5428 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; }; + 0435673F1303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; }; + 043567401303160F00BA5428 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; }; + 043567411303160F00BA5428 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; }; + 04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; }; + 04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; }; + 04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; }; + 04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; }; + 04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; }; + 04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; }; + 04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; }; + 04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; }; + 0442EC1812FE1BBA004C9285 /* SDL_render_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */; }; + 0442EC1912FE1BBA004C9285 /* SDL_render_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */; }; + 0442EC1C12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */; }; + 0442EC1D12FE1BCB004C9285 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */; }; + 0442EC1E12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */; }; + 0442EC1F12FE1BCB004C9285 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */; }; + 0442EC5A12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */; }; + 0442EC5B12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */; }; + 0442EC5C12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */; }; + 0442EC5D12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */; }; + 0442EC5F12FE1C75004C9285 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5E12FE1C75004C9285 /* SDL_hints.c */; }; + 0442EC6012FE1C75004C9285 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5E12FE1C75004C9285 /* SDL_hints.c */; }; + 04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; }; + 04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; }; + 04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; }; + 04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; }; + 04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; }; + 04BD001112E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; }; + 04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; }; + 04BD001912E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; }; + 04BD002612E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; }; + 04BD002712E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; }; + 04BD002812E6671800899322 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; }; + 04BD002912E6671800899322 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; }; + 04BD002A12E6671800899322 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; }; + 04BD002B12E6671800899322 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; }; + 04BD002C12E6671800899322 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; }; + 04BD002D12E6671800899322 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; }; + 04BD003412E6671800899322 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; }; + 04BD003512E6671800899322 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDC312E6671700899322 /* SDL_wave.c */; }; + 04BD003612E6671800899322 /* SDL_wave.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC412E6671700899322 /* SDL_wave.h */; }; + 04BD004112E6671800899322 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */; }; + 04BD004212E6671800899322 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD612E6671700899322 /* blank_cursor.h */; }; + 04BD004312E6671800899322 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; }; + 04BD004412E6671800899322 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; }; + 04BD004512E6671800899322 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; }; + 04BD004712E6671800899322 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; }; + 04BD004812E6671800899322 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; }; + 04BD004912E6671800899322 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; }; + 04BD004A12E6671800899322 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDE12E6671700899322 /* SDL_events.c */; }; + 04BD004B12E6671800899322 /* SDL_events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDF12E6671700899322 /* SDL_events_c.h */; }; + 04BD004C12E6671800899322 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE012E6671700899322 /* SDL_gesture.c */; }; + 04BD004D12E6671800899322 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE112E6671700899322 /* SDL_gesture_c.h */; }; + 04BD004E12E6671800899322 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE212E6671700899322 /* SDL_keyboard.c */; }; + 04BD004F12E6671800899322 /* SDL_keyboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */; }; + 04BD005012E6671800899322 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE412E6671700899322 /* SDL_mouse.c */; }; + 04BD005112E6671800899322 /* SDL_mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE512E6671700899322 /* SDL_mouse_c.h */; }; + 04BD005212E6671800899322 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE612E6671700899322 /* SDL_quit.c */; }; + 04BD005312E6671800899322 /* SDL_sysevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE712E6671700899322 /* SDL_sysevents.h */; }; + 04BD005412E6671800899322 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE812E6671700899322 /* SDL_touch.c */; }; + 04BD005512E6671800899322 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE912E6671700899322 /* SDL_touch_c.h */; }; + 04BD005612E6671800899322 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEA12E6671700899322 /* SDL_windowevents.c */; }; + 04BD005712E6671800899322 /* SDL_windowevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */; }; + 04BD005812E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */; }; + 04BD005912E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */; }; + 04BD005A12E6671800899322 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF012E6671700899322 /* SDL_rwops.c */; }; + 04BD005B12E6671800899322 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF312E6671700899322 /* SDL_syshaptic.c */; }; + 04BD005F12E6671800899322 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDFA12E6671700899322 /* SDL_haptic.c */; }; + 04BD006012E6671800899322 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */; }; + 04BD006112E6671800899322 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */; }; + 04BD006612E6671800899322 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */; }; + 04BD006712E6671800899322 /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */; }; + 04BD007012E6671800899322 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE1612E6671700899322 /* SDL_joystick.c */; }; + 04BD007112E6671800899322 /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1712E6671700899322 /* SDL_joystick_c.h */; }; + 04BD007212E6671800899322 /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */; }; + 04BD008812E6671800899322 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE3312E6671700899322 /* SDL_sysloadso.c */; }; + 04BD009412E6671800899322 /* SDL_syspower.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4B12E6671700899322 /* SDL_syspower.c */; }; + 04BD009612E6671800899322 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4E12E6671700899322 /* SDL_power.c */; }; + 04BD009B12E6671800899322 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5512E6671700899322 /* SDL_assert_c.h */; }; + 04BD009C12E6671800899322 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5612E6671700899322 /* SDL_assert.c */; }; + 04BD009E12E6671800899322 /* SDL_error_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5812E6671700899322 /* SDL_error_c.h */; }; + 04BD009F12E6671800899322 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5912E6671700899322 /* SDL_error.c */; }; + 04BD00A212E6671800899322 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5C12E6671700899322 /* SDL.c */; }; + 04BD00A312E6671800899322 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5E12E6671700899322 /* SDL_getenv.c */; }; + 04BD00A412E6671800899322 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5F12E6671700899322 /* SDL_iconv.c */; }; + 04BD00A512E6671800899322 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6012E6671700899322 /* SDL_malloc.c */; }; + 04BD00A612E6671800899322 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6112E6671700899322 /* SDL_qsort.c */; }; + 04BD00A712E6671800899322 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6212E6671700899322 /* SDL_stdlib.c */; }; + 04BD00A812E6671800899322 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6312E6671700899322 /* SDL_string.c */; }; + 04BD00BD12E6671800899322 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7E12E6671800899322 /* SDL_syscond.c */; }; + 04BD00BE12E6671800899322 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */; }; + 04BD00BF12E6671800899322 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */; }; + 04BD00C012E6671800899322 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8112E6671800899322 /* SDL_syssem.c */; }; + 04BD00C112E6671800899322 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8212E6671800899322 /* SDL_systhread.c */; }; + 04BD00C212E6671800899322 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8312E6671800899322 /* SDL_systhread_c.h */; }; + 04BD00C912E6671800899322 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; }; + 04BD00CA12E6671800899322 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; }; + 04BD00CB12E6671800899322 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; }; + 04BD00D712E6671800899322 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; }; + 04BD00D812E6671800899322 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; }; + 04BD00D912E6671800899322 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; }; + 04BD00F312E6671800899322 /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */; }; + 04BD00F412E6671800899322 /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */; }; + 04BD00F512E6671800899322 /* SDL_cocoaevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */; }; + 04BD00F612E6671800899322 /* SDL_cocoaevents.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */; }; + 04BD00F712E6671800899322 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */; }; + 04BD00F812E6671800899322 /* SDL_cocoakeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */; }; + 04BD00F912E6671800899322 /* SDL_cocoamodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */; }; + 04BD00FA12E6671800899322 /* SDL_cocoamodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */; }; + 04BD00FB12E6671800899322 /* SDL_cocoamouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */; }; + 04BD00FC12E6671800899322 /* SDL_cocoamouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */; }; + 04BD00FD12E6671800899322 /* SDL_cocoaopengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */; }; + 04BD00FE12E6671800899322 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */; }; + 04BD00FF12E6671800899322 /* SDL_cocoashape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECE12E6671800899322 /* SDL_cocoashape.h */; }; + 04BD010012E6671800899322 /* SDL_cocoashape.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECF12E6671800899322 /* SDL_cocoashape.m */; }; + 04BD010112E6671800899322 /* SDL_cocoavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED012E6671800899322 /* SDL_cocoavideo.h */; }; + 04BD010212E6671800899322 /* SDL_cocoavideo.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED112E6671800899322 /* SDL_cocoavideo.m */; }; + 04BD010312E6671800899322 /* SDL_cocoawindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED212E6671800899322 /* SDL_cocoawindow.h */; }; + 04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; }; + 04BD011712E6671800899322 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; }; + 04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; }; + 04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; }; + 04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; }; + 04BD017512E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; }; + 04BD017612E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; }; + 04BD017712E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; }; + 04BD017812E6671800899322 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5112E6671800899322 /* SDL_blit_1.c */; }; + 04BD017912E6671800899322 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5212E6671800899322 /* SDL_blit_A.c */; }; + 04BD017A12E6671800899322 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5312E6671800899322 /* SDL_blit_auto.c */; }; + 04BD017B12E6671800899322 /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5412E6671800899322 /* SDL_blit_auto.h */; }; + 04BD017C12E6671800899322 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5512E6671800899322 /* SDL_blit_copy.c */; }; + 04BD017D12E6671800899322 /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5612E6671800899322 /* SDL_blit_copy.h */; }; + 04BD017E12E6671800899322 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5712E6671800899322 /* SDL_blit_N.c */; }; + 04BD017F12E6671800899322 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5812E6671800899322 /* SDL_blit_slow.c */; }; + 04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; }; + 04BD018112E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; }; + 04BD018212E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; }; + 04BD018712E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; }; + 04BD018C12E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; }; + 04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; }; + 04BD018E12E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; }; + 04BD019612E6671800899322 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; }; + 04BD019712E6671800899322 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; }; + 04BD019812E6671800899322 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; }; + 04BD019912E6671800899322 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7212E6671800899322 /* SDL_shape_internals.h */; }; + 04BD019A12E6671800899322 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7312E6671800899322 /* SDL_stretch.c */; }; + 04BD019B12E6671800899322 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7412E6671800899322 /* SDL_surface.c */; }; + 04BD019C12E6671800899322 /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7512E6671800899322 /* SDL_sysvideo.h */; }; + 04BD019D12E6671800899322 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7612E6671800899322 /* SDL_video.c */; }; + 04BD01DB12E6671800899322 /* imKStoUCS.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFB812E6671800899322 /* imKStoUCS.c */; }; + 04BD01DC12E6671800899322 /* imKStoUCS.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFB912E6671800899322 /* imKStoUCS.h */; }; + 04BD01DD12E6671800899322 /* SDL_x11clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */; }; + 04BD01DE12E6671800899322 /* SDL_x11clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */; }; + 04BD01DF12E6671800899322 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */; }; + 04BD01E012E6671800899322 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; }; + 04BD01E112E6671800899322 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; }; + 04BD01E212E6671800899322 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; }; + 04BD01E512E6671800899322 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; }; + 04BD01E612E6671800899322 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; }; + 04BD01E712E6671800899322 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; }; + 04BD01E812E6671800899322 /* SDL_x11modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC512E6671800899322 /* SDL_x11modes.h */; }; + 04BD01E912E6671800899322 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC612E6671800899322 /* SDL_x11mouse.c */; }; + 04BD01EA12E6671800899322 /* SDL_x11mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC712E6671800899322 /* SDL_x11mouse.h */; }; + 04BD01EB12E6671800899322 /* SDL_x11opengl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC812E6671800899322 /* SDL_x11opengl.c */; }; + 04BD01EC12E6671800899322 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; }; + 04BD01ED12E6671800899322 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; }; + 04BD01EE12E6671800899322 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; }; + 04BD01F112E6671800899322 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; }; + 04BD01F212E6671800899322 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; }; + 04BD01F312E6671800899322 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; }; + 04BD01F412E6671800899322 /* SDL_x11touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD112E6671800899322 /* SDL_x11touch.c */; }; + 04BD01F512E6671800899322 /* SDL_x11touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD212E6671800899322 /* SDL_x11touch.h */; }; + 04BD01F612E6671800899322 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD312E6671800899322 /* SDL_x11video.c */; }; + 04BD01F712E6671800899322 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD412E6671800899322 /* SDL_x11video.h */; }; + 04BD01F812E6671800899322 /* SDL_x11window.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD512E6671800899322 /* SDL_x11window.c */; }; + 04BD01F912E6671800899322 /* SDL_x11window.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD612E6671800899322 /* SDL_x11window.h */; }; + 04BD021712E6671800899322 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7412E6671700899322 /* SDL_atomic.c */; }; + 04BD021812E6671800899322 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; }; + 04BD022412E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; }; + 04BD022512E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; }; + 04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; }; + 04BD022D12E6671800899322 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; }; + 04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; }; + 04BD023512E6671800899322 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; }; + 04BD024212E6671800899322 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; }; + 04BD024312E6671800899322 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; }; + 04BD024412E6671800899322 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; }; + 04BD024512E6671800899322 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; }; + 04BD024612E6671800899322 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; }; + 04BD024712E6671800899322 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; }; + 04BD024812E6671800899322 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; }; + 04BD024912E6671800899322 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; }; + 04BD025012E6671800899322 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; }; + 04BD025112E6671800899322 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDC312E6671700899322 /* SDL_wave.c */; }; + 04BD025212E6671800899322 /* SDL_wave.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC412E6671700899322 /* SDL_wave.h */; }; + 04BD025C12E6671800899322 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */; }; + 04BD025D12E6671800899322 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD612E6671700899322 /* blank_cursor.h */; }; + 04BD025E12E6671800899322 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; }; + 04BD025F12E6671800899322 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; }; + 04BD026012E6671800899322 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; }; + 04BD026212E6671800899322 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; }; + 04BD026312E6671800899322 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; }; + 04BD026412E6671800899322 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; }; + 04BD026512E6671800899322 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDE12E6671700899322 /* SDL_events.c */; }; + 04BD026612E6671800899322 /* SDL_events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDF12E6671700899322 /* SDL_events_c.h */; }; + 04BD026712E6671800899322 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE012E6671700899322 /* SDL_gesture.c */; }; + 04BD026812E6671800899322 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE112E6671700899322 /* SDL_gesture_c.h */; }; + 04BD026912E6671800899322 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE212E6671700899322 /* SDL_keyboard.c */; }; + 04BD026A12E6671800899322 /* SDL_keyboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */; }; + 04BD026B12E6671800899322 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE412E6671700899322 /* SDL_mouse.c */; }; + 04BD026C12E6671800899322 /* SDL_mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE512E6671700899322 /* SDL_mouse_c.h */; }; + 04BD026D12E6671800899322 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE612E6671700899322 /* SDL_quit.c */; }; + 04BD026E12E6671800899322 /* SDL_sysevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE712E6671700899322 /* SDL_sysevents.h */; }; + 04BD026F12E6671800899322 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE812E6671700899322 /* SDL_touch.c */; }; + 04BD027012E6671800899322 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE912E6671700899322 /* SDL_touch_c.h */; }; + 04BD027112E6671800899322 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEA12E6671700899322 /* SDL_windowevents.c */; }; + 04BD027212E6671800899322 /* SDL_windowevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */; }; + 04BD027312E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */; }; + 04BD027412E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */; }; + 04BD027512E6671800899322 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF012E6671700899322 /* SDL_rwops.c */; }; + 04BD027612E6671800899322 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF312E6671700899322 /* SDL_syshaptic.c */; }; + 04BD027A12E6671800899322 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDFA12E6671700899322 /* SDL_haptic.c */; }; + 04BD027B12E6671800899322 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */; }; + 04BD027C12E6671800899322 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */; }; + 04BD028112E6671800899322 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */; }; + 04BD028212E6671800899322 /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */; }; + 04BD028B12E6671800899322 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE1612E6671700899322 /* SDL_joystick.c */; }; + 04BD028C12E6671800899322 /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1712E6671700899322 /* SDL_joystick_c.h */; }; + 04BD028D12E6671800899322 /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */; }; + 04BD02A312E6671800899322 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE3312E6671700899322 /* SDL_sysloadso.c */; }; + 04BD02AE12E6671800899322 /* SDL_syspower.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4B12E6671700899322 /* SDL_syspower.c */; }; + 04BD02B012E6671800899322 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4E12E6671700899322 /* SDL_power.c */; }; + 04BD02B512E6671800899322 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5512E6671700899322 /* SDL_assert_c.h */; }; + 04BD02B612E6671800899322 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5612E6671700899322 /* SDL_assert.c */; }; + 04BD02B812E6671800899322 /* SDL_error_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5812E6671700899322 /* SDL_error_c.h */; }; + 04BD02B912E6671800899322 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5912E6671700899322 /* SDL_error.c */; }; + 04BD02BC12E6671800899322 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5C12E6671700899322 /* SDL.c */; }; + 04BD02BD12E6671800899322 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5E12E6671700899322 /* SDL_getenv.c */; }; + 04BD02BE12E6671800899322 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5F12E6671700899322 /* SDL_iconv.c */; }; + 04BD02BF12E6671800899322 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6012E6671700899322 /* SDL_malloc.c */; }; + 04BD02C012E6671800899322 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6112E6671700899322 /* SDL_qsort.c */; }; + 04BD02C112E6671800899322 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6212E6671700899322 /* SDL_stdlib.c */; }; + 04BD02C212E6671800899322 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6312E6671700899322 /* SDL_string.c */; }; + 04BD02D712E6671800899322 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7E12E6671800899322 /* SDL_syscond.c */; }; + 04BD02D812E6671800899322 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */; }; + 04BD02D912E6671800899322 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */; }; + 04BD02DA12E6671800899322 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8112E6671800899322 /* SDL_syssem.c */; }; + 04BD02DB12E6671800899322 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8212E6671800899322 /* SDL_systhread.c */; }; + 04BD02DC12E6671800899322 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8312E6671800899322 /* SDL_systhread_c.h */; }; + 04BD02E312E6671800899322 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; }; + 04BD02E412E6671800899322 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; }; + 04BD02E512E6671800899322 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; }; + 04BD02F112E6671800899322 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; }; + 04BD02F212E6671800899322 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; }; + 04BD02F312E6671800899322 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; }; + 04BD030D12E6671800899322 /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */; }; + 04BD030E12E6671800899322 /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */; }; + 04BD030F12E6671800899322 /* SDL_cocoaevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */; }; + 04BD031012E6671800899322 /* SDL_cocoaevents.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */; }; + 04BD031112E6671800899322 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */; }; + 04BD031212E6671800899322 /* SDL_cocoakeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */; }; + 04BD031312E6671800899322 /* SDL_cocoamodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */; }; + 04BD031412E6671800899322 /* SDL_cocoamodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */; }; + 04BD031512E6671800899322 /* SDL_cocoamouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */; }; + 04BD031612E6671800899322 /* SDL_cocoamouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */; }; + 04BD031712E6671800899322 /* SDL_cocoaopengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */; }; + 04BD031812E6671800899322 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */; }; + 04BD031912E6671800899322 /* SDL_cocoashape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECE12E6671800899322 /* SDL_cocoashape.h */; }; + 04BD031A12E6671800899322 /* SDL_cocoashape.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECF12E6671800899322 /* SDL_cocoashape.m */; }; + 04BD031B12E6671800899322 /* SDL_cocoavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED012E6671800899322 /* SDL_cocoavideo.h */; }; + 04BD031C12E6671800899322 /* SDL_cocoavideo.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED112E6671800899322 /* SDL_cocoavideo.m */; }; + 04BD031D12E6671800899322 /* SDL_cocoawindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED212E6671800899322 /* SDL_cocoawindow.h */; }; + 04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; }; + 04BD033112E6671800899322 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; }; + 04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; }; + 04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; }; + 04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; }; + 04BD038F12E6671800899322 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; }; + 04BD039012E6671800899322 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; }; + 04BD039112E6671800899322 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; }; + 04BD039212E6671800899322 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5112E6671800899322 /* SDL_blit_1.c */; }; + 04BD039312E6671800899322 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5212E6671800899322 /* SDL_blit_A.c */; }; + 04BD039412E6671800899322 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5312E6671800899322 /* SDL_blit_auto.c */; }; + 04BD039512E6671800899322 /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5412E6671800899322 /* SDL_blit_auto.h */; }; + 04BD039612E6671800899322 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5512E6671800899322 /* SDL_blit_copy.c */; }; + 04BD039712E6671800899322 /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5612E6671800899322 /* SDL_blit_copy.h */; }; + 04BD039812E6671800899322 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5712E6671800899322 /* SDL_blit_N.c */; }; + 04BD039912E6671800899322 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5812E6671800899322 /* SDL_blit_slow.c */; }; + 04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; }; + 04BD039B12E6671800899322 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; }; + 04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; }; + 04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; }; + 04BD03A612E6671800899322 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; }; + 04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; }; + 04BD03A812E6671800899322 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; }; + 04BD03B012E6671800899322 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; }; + 04BD03B112E6671800899322 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; }; + 04BD03B212E6671800899322 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; }; + 04BD03B312E6671800899322 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7212E6671800899322 /* SDL_shape_internals.h */; }; + 04BD03B412E6671800899322 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7312E6671800899322 /* SDL_stretch.c */; }; + 04BD03B512E6671800899322 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7412E6671800899322 /* SDL_surface.c */; }; + 04BD03B612E6671800899322 /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7512E6671800899322 /* SDL_sysvideo.h */; }; + 04BD03B712E6671800899322 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7612E6671800899322 /* SDL_video.c */; }; + 04BD03F312E6671800899322 /* imKStoUCS.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFB812E6671800899322 /* imKStoUCS.c */; }; + 04BD03F412E6671800899322 /* imKStoUCS.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFB912E6671800899322 /* imKStoUCS.h */; }; + 04BD03F512E6671800899322 /* SDL_x11clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */; }; + 04BD03F612E6671800899322 /* SDL_x11clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */; }; + 04BD03F712E6671800899322 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */; }; + 04BD03F812E6671800899322 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; }; + 04BD03F912E6671800899322 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; }; + 04BD03FA12E6671800899322 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; }; + 04BD03FD12E6671800899322 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; }; + 04BD03FE12E6671800899322 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; }; + 04BD03FF12E6671800899322 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; }; + 04BD040012E6671800899322 /* SDL_x11modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC512E6671800899322 /* SDL_x11modes.h */; }; + 04BD040112E6671800899322 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC612E6671800899322 /* SDL_x11mouse.c */; }; + 04BD040212E6671800899322 /* SDL_x11mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC712E6671800899322 /* SDL_x11mouse.h */; }; + 04BD040312E6671800899322 /* SDL_x11opengl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC812E6671800899322 /* SDL_x11opengl.c */; }; + 04BD040412E6671800899322 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; }; + 04BD040512E6671800899322 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; }; + 04BD040612E6671800899322 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; }; + 04BD040912E6671800899322 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; }; + 04BD040A12E6671800899322 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; }; + 04BD040B12E6671800899322 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; }; + 04BD040C12E6671800899322 /* SDL_x11touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD112E6671800899322 /* SDL_x11touch.c */; }; + 04BD040D12E6671800899322 /* SDL_x11touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD212E6671800899322 /* SDL_x11touch.h */; }; + 04BD040E12E6671800899322 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD312E6671800899322 /* SDL_x11video.c */; }; + 04BD040F12E6671800899322 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD412E6671800899322 /* SDL_x11video.h */; }; + 04BD041012E6671800899322 /* SDL_x11window.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD512E6671800899322 /* SDL_x11window.c */; }; + 04BD041112E6671800899322 /* SDL_x11window.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD612E6671800899322 /* SDL_x11window.h */; }; + 04BDFFFB12E6671800899322 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7412E6671700899322 /* SDL_atomic.c */; }; + 04BDFFFC12E6671800899322 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; }; + 04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; }; + 04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; }; + 04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; }; + 04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; }; + 04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; }; + 04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; }; + 04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; }; + 04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; }; + 04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; }; + 04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; }; + 04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; }; + 04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; }; + 04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; }; + 04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; }; + 04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; }; + 04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; }; + 04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; }; + 04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; }; + 04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; }; + 04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; }; + 04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; }; + 04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; }; + 04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; }; + 04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; }; + 04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; }; + 04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; }; + 566CDE8F148F0AC200C5A9BB /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 566CDE8D148F0AC200C5A9BB /* SDL_dropevents_c.h */; }; + 566CDE90148F0AC200C5A9BB /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */; }; + A77E6EB4167AB0A90010E40B /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A77E6EB5167AB0A90010E40B /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; }; + AA0AD09D16648D1700CE5896 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */; }; + AA0F8491178D5ECC00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8490178D5ECC00823F9D /* SDL_systls.c */; }; + AA0F8492178D5ECC00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8490178D5ECC00823F9D /* SDL_systls.c */; }; + AA0F8493178D5ECC00823F9D /* SDL_systls.c in Sources */ = {isa = PBXBuildFile; fileRef = AA0F8490178D5ECC00823F9D /* SDL_systls.c */; }; + AA41F88014B8F1F500993C4F /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */; }; + AA628ACA159367B7005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AC8159367B7005138DD /* SDL_rotate.c */; }; + AA628ACB159367B7005138DD /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AC8159367B7005138DD /* SDL_rotate.c */; }; + AA628ACC159367B7005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AC9159367B7005138DD /* SDL_rotate.h */; }; + AA628ACD159367B7005138DD /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AC9159367B7005138DD /* SDL_rotate.h */; }; + AA628AD1159367F2005138DD /* SDL_x11xinput2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628ACF159367F2005138DD /* SDL_x11xinput2.c */; }; + AA628AD2159367F2005138DD /* SDL_x11xinput2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628ACF159367F2005138DD /* SDL_x11xinput2.c */; }; + AA628AD3159367F2005138DD /* SDL_x11xinput2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AD0159367F2005138DD /* SDL_x11xinput2.h */; }; + AA628AD4159367F2005138DD /* SDL_x11xinput2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AD0159367F2005138DD /* SDL_x11xinput2.h */; }; + AA7557FA1595D4D800BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7557FB1595D4D800BBD41B /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; }; + AA7557FC1595D4D800BBD41B /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C81595D4D800BBD41B /* close_code.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7557FD1595D4D800BBD41B /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C81595D4D800BBD41B /* close_code.h */; }; + AA7557FE1595D4D800BBD41B /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C91595D4D800BBD41B /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7557FF1595D4D800BBD41B /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C91595D4D800BBD41B /* SDL_assert.h */; }; + AA7558001595D4D800BBD41B /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CA1595D4D800BBD41B /* SDL_atomic.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558011595D4D800BBD41B /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CA1595D4D800BBD41B /* SDL_atomic.h */; }; + AA7558021595D4D800BBD41B /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CB1595D4D800BBD41B /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558031595D4D800BBD41B /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CB1595D4D800BBD41B /* SDL_audio.h */; }; + AA7558041595D4D800BBD41B /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558051595D4D800BBD41B /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; }; + AA7558061595D4D800BBD41B /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558071595D4D800BBD41B /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */; }; + AA7558081595D4D800BBD41B /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558091595D4D800BBD41B /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */; }; + AA75580A1595D4D800BBD41B /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CF1595D4D800BBD41B /* SDL_config.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75580B1595D4D800BBD41B /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CF1595D4D800BBD41B /* SDL_config.h */; }; + AA75580C1595D4D800BBD41B /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D01595D4D800BBD41B /* SDL_copying.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75580D1595D4D800BBD41B /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D01595D4D800BBD41B /* SDL_copying.h */; }; + AA75580E1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75580F1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */; }; + AA7558101595D4D800BBD41B /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D21595D4D800BBD41B /* SDL_endian.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558111595D4D800BBD41B /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D21595D4D800BBD41B /* SDL_endian.h */; }; + AA7558121595D4D800BBD41B /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D31595D4D800BBD41B /* SDL_error.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558131595D4D800BBD41B /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D31595D4D800BBD41B /* SDL_error.h */; }; + AA7558141595D4D800BBD41B /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D41595D4D800BBD41B /* SDL_events.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558151595D4D800BBD41B /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D41595D4D800BBD41B /* SDL_events.h */; }; + AA7558161595D4D800BBD41B /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D51595D4D800BBD41B /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558171595D4D800BBD41B /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D51595D4D800BBD41B /* SDL_gesture.h */; }; + AA7558181595D4D800BBD41B /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D61595D4D800BBD41B /* SDL_haptic.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558191595D4D800BBD41B /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D61595D4D800BBD41B /* SDL_haptic.h */; }; + AA75581A1595D4D800BBD41B /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D71595D4D800BBD41B /* SDL_hints.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75581B1595D4D800BBD41B /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D71595D4D800BBD41B /* SDL_hints.h */; }; + AA75581E1595D4D800BBD41B /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D91595D4D800BBD41B /* SDL_joystick.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75581F1595D4D800BBD41B /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D91595D4D800BBD41B /* SDL_joystick.h */; }; + AA7558201595D4D800BBD41B /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558211595D4D800BBD41B /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */; }; + AA7558221595D4D800BBD41B /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558231595D4D800BBD41B /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; }; + AA7558241595D4D800BBD41B /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558251595D4D800BBD41B /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; }; + AA7558261595D4D800BBD41B /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DD1595D4D800BBD41B /* SDL_log.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558271595D4D800BBD41B /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DD1595D4D800BBD41B /* SDL_log.h */; }; + AA7558281595D4D800BBD41B /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DE1595D4D800BBD41B /* SDL_main.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558291595D4D800BBD41B /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DE1595D4D800BBD41B /* SDL_main.h */; }; + AA75582A1595D4D800BBD41B /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DF1595D4D800BBD41B /* SDL_mouse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75582B1595D4D800BBD41B /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DF1595D4D800BBD41B /* SDL_mouse.h */; }; + AA75582C1595D4D800BBD41B /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E01595D4D800BBD41B /* SDL_mutex.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75582D1595D4D800BBD41B /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E01595D4D800BBD41B /* SDL_mutex.h */; }; + AA75582E1595D4D800BBD41B /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E11595D4D800BBD41B /* SDL_name.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75582F1595D4D800BBD41B /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E11595D4D800BBD41B /* SDL_name.h */; }; + AA7558301595D4D800BBD41B /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E21595D4D800BBD41B /* SDL_opengl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558311595D4D800BBD41B /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E21595D4D800BBD41B /* SDL_opengl.h */; }; + AA7558321595D4D800BBD41B /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E31595D4D800BBD41B /* SDL_opengles.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558331595D4D800BBD41B /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E31595D4D800BBD41B /* SDL_opengles.h */; }; + AA7558341595D4D800BBD41B /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E41595D4D800BBD41B /* SDL_opengles2.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558351595D4D800BBD41B /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E41595D4D800BBD41B /* SDL_opengles2.h */; }; + AA7558361595D4D800BBD41B /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E51595D4D800BBD41B /* SDL_pixels.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558371595D4D800BBD41B /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E51595D4D800BBD41B /* SDL_pixels.h */; }; + AA7558381595D4D800BBD41B /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E61595D4D800BBD41B /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558391595D4D800BBD41B /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E61595D4D800BBD41B /* SDL_platform.h */; }; + AA75583A1595D4D800BBD41B /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E71595D4D800BBD41B /* SDL_power.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75583B1595D4D800BBD41B /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E71595D4D800BBD41B /* SDL_power.h */; }; + AA75583C1595D4D800BBD41B /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75583D1595D4D800BBD41B /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; }; + AA75583E1595D4D800BBD41B /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E91595D4D800BBD41B /* SDL_rect.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75583F1595D4D800BBD41B /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E91595D4D800BBD41B /* SDL_rect.h */; }; + AA7558401595D4D800BBD41B /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EA1595D4D800BBD41B /* SDL_render.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558411595D4D800BBD41B /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EA1595D4D800BBD41B /* SDL_render.h */; }; + AA7558421595D4D800BBD41B /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EB1595D4D800BBD41B /* SDL_revision.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558431595D4D800BBD41B /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EB1595D4D800BBD41B /* SDL_revision.h */; }; + AA7558441595D4D800BBD41B /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EC1595D4D800BBD41B /* SDL_rwops.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558451595D4D800BBD41B /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EC1595D4D800BBD41B /* SDL_rwops.h */; }; + AA7558461595D4D800BBD41B /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557ED1595D4D800BBD41B /* SDL_scancode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558471595D4D800BBD41B /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557ED1595D4D800BBD41B /* SDL_scancode.h */; }; + AA7558481595D4D800BBD41B /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EE1595D4D800BBD41B /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558491595D4D800BBD41B /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EE1595D4D800BBD41B /* SDL_shape.h */; }; + AA75584A1595D4D800BBD41B /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75584B1595D4D800BBD41B /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */; }; + AA75584C1595D4D800BBD41B /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F01595D4D800BBD41B /* SDL_surface.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75584D1595D4D800BBD41B /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F01595D4D800BBD41B /* SDL_surface.h */; }; + AA75584E1595D4D800BBD41B /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F11595D4D800BBD41B /* SDL_system.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75584F1595D4D800BBD41B /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F11595D4D800BBD41B /* SDL_system.h */; }; + AA7558501595D4D800BBD41B /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F21595D4D800BBD41B /* SDL_syswm.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558511595D4D800BBD41B /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F21595D4D800BBD41B /* SDL_syswm.h */; }; + AA7558521595D4D800BBD41B /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F31595D4D800BBD41B /* SDL_thread.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558531595D4D800BBD41B /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F31595D4D800BBD41B /* SDL_thread.h */; }; + AA7558541595D4D800BBD41B /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F41595D4D800BBD41B /* SDL_timer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558551595D4D800BBD41B /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F41595D4D800BBD41B /* SDL_timer.h */; }; + AA7558561595D4D800BBD41B /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F51595D4D800BBD41B /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558571595D4D800BBD41B /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F51595D4D800BBD41B /* SDL_touch.h */; }; + AA7558581595D4D800BBD41B /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F61595D4D800BBD41B /* SDL_types.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA7558591595D4D800BBD41B /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F61595D4D800BBD41B /* SDL_types.h */; }; + AA75585A1595D4D800BBD41B /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F71595D4D800BBD41B /* SDL_version.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75585B1595D4D800BBD41B /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F71595D4D800BBD41B /* SDL_version.h */; }; + AA75585C1595D4D800BBD41B /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F81595D4D800BBD41B /* SDL_video.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75585D1595D4D800BBD41B /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F81595D4D800BBD41B /* SDL_video.h */; }; + AA75585E1595D4D800BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AA75585F1595D4D800BBD41B /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; }; + AA9E4093163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; }; + AA9E4094163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; }; + AA9FF95A1637CBF9000DF050 /* SDL_messagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AABCC38D164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */; }; + AABCC38E164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */; }; + AABCC38F164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */; }; + AABCC390164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */; }; + AADA5B8716CCAB3000107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; }; + AADA5B8816CCAB3000107CF7 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; }; + BBFC088D164C6647003E6A99 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */; }; + D55A1B81179F262300625D7C /* SDL_cocoamousetap.h in Headers */ = {isa = PBXBuildFile; fileRef = D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */; }; + D55A1B82179F262300625D7C /* SDL_cocoamousetap.m in Sources */ = {isa = PBXBuildFile; fileRef = D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */; }; + D55A1B83179F263500625D7C /* SDL_cocoamousetap.m in Sources */ = {isa = PBXBuildFile; fileRef = D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */; }; + D55A1B84179F263600625D7C /* SDL_cocoamousetap.m in Sources */ = {isa = PBXBuildFile; fileRef = D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */; }; + D55A1B85179F278E00625D7C /* SDL_cocoamousetap.h in Headers */ = {isa = PBXBuildFile; fileRef = D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */; }; + D55A1B86179F278F00625D7C /* SDL_cocoamousetap.h in Headers */ = {isa = PBXBuildFile; fileRef = D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */; }; + DB313F7417554B71006C0E22 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; }; + DB313F7517554B71006C0E22 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */; }; + DB313F7617554B71006C0E22 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDA112E6671700899322 /* SDL_coreaudio.h */; }; + DB313F7717554B71006C0E22 /* SDL_audio_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB512E6671700899322 /* SDL_audio_c.h */; }; + DB313F7817554B71006C0E22 /* SDL_audiodev_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */; }; + DB313F7917554B71006C0E22 /* SDL_audiomem.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDB912E6671700899322 /* SDL_audiomem.h */; }; + DB313F7A17554B71006C0E22 /* SDL_sysaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC212E6671700899322 /* SDL_sysaudio.h */; }; + DB313F7B17554B71006C0E22 /* SDL_wave.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDC412E6671700899322 /* SDL_wave.h */; }; + DB313F7C17554B71006C0E22 /* blank_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD612E6671700899322 /* blank_cursor.h */; }; + DB313F7D17554B71006C0E22 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD712E6671700899322 /* default_cursor.h */; }; + DB313F7E17554B71006C0E22 /* scancodes_darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD812E6671700899322 /* scancodes_darwin.h */; }; + DB313F7F17554B71006C0E22 /* scancodes_linux.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDD912E6671700899322 /* scancodes_linux.h */; }; + DB313F8017554B71006C0E22 /* scancodes_xfree86.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */; }; + DB313F8117554B71006C0E22 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */; }; + DB313F8217554B71006C0E22 /* SDL_events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDDF12E6671700899322 /* SDL_events_c.h */; }; + DB313F8317554B71006C0E22 /* SDL_gesture_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE112E6671700899322 /* SDL_gesture_c.h */; }; + DB313F8417554B71006C0E22 /* SDL_keyboard_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */; }; + DB313F8517554B71006C0E22 /* SDL_mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE512E6671700899322 /* SDL_mouse_c.h */; }; + DB313F8617554B71006C0E22 /* SDL_sysevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE712E6671700899322 /* SDL_sysevents.h */; }; + DB313F8717554B71006C0E22 /* SDL_touch_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDE912E6671700899322 /* SDL_touch_c.h */; }; + DB313F8817554B71006C0E22 /* SDL_windowevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */; }; + DB313F8917554B71006C0E22 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */; }; + DB313F8A17554B71006C0E22 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */; }; + DB313F8B17554B71006C0E22 /* SDL_syshaptic.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */; }; + DB313F8C17554B71006C0E22 /* SDL_sysjoystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */; }; + DB313F8D17554B71006C0E22 /* SDL_joystick_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1712E6671700899322 /* SDL_joystick_c.h */; }; + DB313F8E17554B71006C0E22 /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */; }; + DB313F8F17554B71006C0E22 /* SDL_assert_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5512E6671700899322 /* SDL_assert_c.h */; }; + DB313F9017554B71006C0E22 /* SDL_error_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE5812E6671700899322 /* SDL_error_c.h */; }; + DB313F9217554B71006C0E22 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */; }; + DB313F9317554B71006C0E22 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8312E6671800899322 /* SDL_systhread_c.h */; }; + DB313F9417554B71006C0E22 /* SDL_systhread.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8B12E6671800899322 /* SDL_systhread.h */; }; + DB313F9517554B71006C0E22 /* SDL_thread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFE8D12E6671800899322 /* SDL_thread_c.h */; }; + DB313F9617554B71006C0E22 /* SDL_timer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEA012E6671800899322 /* SDL_timer_c.h */; }; + DB313F9717554B71006C0E22 /* SDL_cocoaclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */; }; + DB313F9817554B71006C0E22 /* SDL_cocoaevents.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */; }; + DB313F9917554B71006C0E22 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */; }; + DB313F9A17554B71006C0E22 /* SDL_cocoamodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */; }; + DB313F9B17554B71006C0E22 /* SDL_cocoamouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */; }; + DB313F9C17554B71006C0E22 /* SDL_cocoaopengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */; }; + DB313F9D17554B71006C0E22 /* SDL_cocoashape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFECE12E6671800899322 /* SDL_cocoashape.h */; }; + DB313F9E17554B71006C0E22 /* SDL_cocoavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED012E6671800899322 /* SDL_cocoavideo.h */; }; + DB313F9F17554B71006C0E22 /* SDL_cocoawindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFED212E6671800899322 /* SDL_cocoawindow.h */; }; + DB313FA017554B71006C0E22 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */; }; + DB313FA117554B71006C0E22 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFEED12E6671800899322 /* SDL_nullvideo.h */; }; + DB313FA217554B71006C0E22 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF4F12E6671800899322 /* SDL_blit.h */; }; + DB313FA317554B71006C0E22 /* SDL_blit_auto.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5412E6671800899322 /* SDL_blit_auto.h */; }; + DB313FA417554B71006C0E22 /* SDL_blit_copy.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5612E6671800899322 /* SDL_blit_copy.h */; }; + DB313FA517554B71006C0E22 /* SDL_blit_slow.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF5912E6671800899322 /* SDL_blit_slow.h */; }; + DB313FA617554B71006C0E22 /* SDL_pixels_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF6612E6671800899322 /* SDL_pixels_c.h */; }; + DB313FA717554B71006C0E22 /* SDL_RLEaccel_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */; }; + DB313FA817554B71006C0E22 /* SDL_shape_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7212E6671800899322 /* SDL_shape_internals.h */; }; + DB313FA917554B71006C0E22 /* SDL_sysvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFF7512E6671800899322 /* SDL_sysvideo.h */; }; + DB313FAA17554B71006C0E22 /* imKStoUCS.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFB912E6671800899322 /* imKStoUCS.h */; }; + DB313FAB17554B71006C0E22 /* SDL_x11clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */; }; + DB313FAC17554B71006C0E22 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */; }; + DB313FAD17554B71006C0E22 /* SDL_x11events.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFBF12E6671800899322 /* SDL_x11events.h */; }; + DB313FAE17554B71006C0E22 /* SDL_x11keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */; }; + DB313FAF17554B71006C0E22 /* SDL_x11modes.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC512E6671800899322 /* SDL_x11modes.h */; }; + DB313FB017554B71006C0E22 /* SDL_x11mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC712E6671800899322 /* SDL_x11mouse.h */; }; + DB313FB117554B71006C0E22 /* SDL_x11opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFC912E6671800899322 /* SDL_x11opengl.h */; }; + DB313FB217554B71006C0E22 /* SDL_x11opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */; }; + DB313FB317554B71006C0E22 /* SDL_x11shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFCF12E6671800899322 /* SDL_x11shape.h */; }; + DB313FB417554B71006C0E22 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD012E6671800899322 /* SDL_x11sym.h */; }; + DB313FB517554B71006C0E22 /* SDL_x11touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD212E6671800899322 /* SDL_x11touch.h */; }; + DB313FB617554B71006C0E22 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD412E6671800899322 /* SDL_x11video.h */; }; + DB313FB717554B71006C0E22 /* SDL_x11window.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFFD612E6671800899322 /* SDL_x11window.h */; }; + DB313FB817554B71006C0E22 /* SDL_sysrender.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */; }; + DB313FB917554B71006C0E22 /* mmx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8D12FA97ED00FB9AA8 /* mmx.h */; }; + DB313FBA17554B71006C0E22 /* SDL_yuv_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */; }; + DB313FBB17554B71006C0E22 /* SDL_nullframebuffer_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */; }; + DB313FBC17554B71006C0E22 /* SDL_blendfillrect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */; }; + DB313FBD17554B71006C0E22 /* SDL_blendline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804012FB74A200FC43C0 /* SDL_blendline.h */; }; + DB313FBE17554B71006C0E22 /* SDL_blendpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */; }; + DB313FBF17554B71006C0E22 /* SDL_draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804312FB74A200FC43C0 /* SDL_draw.h */; }; + DB313FC017554B71006C0E22 /* SDL_drawline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804512FB74A200FC43C0 /* SDL_drawline.h */; }; + DB313FC117554B71006C0E22 /* SDL_drawpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */; }; + DB313FC217554B71006C0E22 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */; }; + DB313FC317554B71006C0E22 /* SDL_x11framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */; }; + DB313FC417554B71006C0E22 /* SDL_glfuncs.h in Headers */ = {isa = PBXBuildFile; fileRef = 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */; }; + DB313FC517554B71006C0E22 /* SDL_shaders_gl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */; }; + DB313FC617554B71006C0E22 /* SDL_rotate.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AC9159367B7005138DD /* SDL_rotate.h */; }; + DB313FC717554B71006C0E22 /* SDL_x11xinput2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA628AD0159367F2005138DD /* SDL_x11xinput2.h */; }; + DB313FC817554B71006C0E22 /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C71595D4D800BBD41B /* begin_code.h */; }; + DB313FC917554B71006C0E22 /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C81595D4D800BBD41B /* close_code.h */; }; + DB313FCA17554B71006C0E22 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557C91595D4D800BBD41B /* SDL_assert.h */; }; + DB313FCB17554B71006C0E22 /* SDL_atomic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CA1595D4D800BBD41B /* SDL_atomic.h */; }; + DB313FCC17554B71006C0E22 /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CB1595D4D800BBD41B /* SDL_audio.h */; }; + DB313FCD17554B71006C0E22 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; }; + DB313FCE17554B71006C0E22 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */; }; + DB313FCF17554B71006C0E22 /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */; }; + DB313FD017554B71006C0E22 /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CF1595D4D800BBD41B /* SDL_config.h */; }; + DB313FD117554B71006C0E22 /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D01595D4D800BBD41B /* SDL_copying.h */; }; + DB313FD217554B71006C0E22 /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */; }; + DB313FD317554B71006C0E22 /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D21595D4D800BBD41B /* SDL_endian.h */; }; + DB313FD417554B71006C0E22 /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D31595D4D800BBD41B /* SDL_error.h */; }; + DB313FD517554B71006C0E22 /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D41595D4D800BBD41B /* SDL_events.h */; }; + DB313FD617554B71006C0E22 /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D51595D4D800BBD41B /* SDL_gesture.h */; }; + DB313FD717554B71006C0E22 /* SDL_haptic.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D61595D4D800BBD41B /* SDL_haptic.h */; }; + DB313FD817554B71006C0E22 /* SDL_hints.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D71595D4D800BBD41B /* SDL_hints.h */; }; + DB313FD917554B71006C0E22 /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557D91595D4D800BBD41B /* SDL_joystick.h */; }; + DB313FDA17554B71006C0E22 /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */; }; + DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; }; + DB313FDC17554B71006C0E22 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; }; + DB313FDD17554B71006C0E22 /* SDL_log.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DD1595D4D800BBD41B /* SDL_log.h */; }; + DB313FDE17554B71006C0E22 /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DE1595D4D800BBD41B /* SDL_main.h */; }; + DB313FDF17554B71006C0E22 /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DF1595D4D800BBD41B /* SDL_mouse.h */; }; + DB313FE017554B71006C0E22 /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E01595D4D800BBD41B /* SDL_mutex.h */; }; + DB313FE117554B71006C0E22 /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E11595D4D800BBD41B /* SDL_name.h */; }; + DB313FE217554B71006C0E22 /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E21595D4D800BBD41B /* SDL_opengl.h */; }; + DB313FE317554B71006C0E22 /* SDL_opengles.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E31595D4D800BBD41B /* SDL_opengles.h */; }; + DB313FE417554B71006C0E22 /* SDL_opengles2.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E41595D4D800BBD41B /* SDL_opengles2.h */; }; + DB313FE517554B71006C0E22 /* SDL_pixels.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E51595D4D800BBD41B /* SDL_pixels.h */; }; + DB313FE617554B71006C0E22 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E61595D4D800BBD41B /* SDL_platform.h */; }; + DB313FE717554B71006C0E22 /* SDL_power.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E71595D4D800BBD41B /* SDL_power.h */; }; + DB313FE817554B71006C0E22 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; }; + DB313FE917554B71006C0E22 /* SDL_rect.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E91595D4D800BBD41B /* SDL_rect.h */; }; + DB313FEA17554B71006C0E22 /* SDL_render.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EA1595D4D800BBD41B /* SDL_render.h */; }; + DB313FEB17554B71006C0E22 /* SDL_revision.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EB1595D4D800BBD41B /* SDL_revision.h */; }; + DB313FEC17554B71006C0E22 /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EC1595D4D800BBD41B /* SDL_rwops.h */; }; + DB313FED17554B71006C0E22 /* SDL_scancode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557ED1595D4D800BBD41B /* SDL_scancode.h */; }; + DB313FEE17554B71006C0E22 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EE1595D4D800BBD41B /* SDL_shape.h */; }; + DB313FEF17554B71006C0E22 /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */; }; + DB313FF017554B71006C0E22 /* SDL_surface.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F01595D4D800BBD41B /* SDL_surface.h */; }; + DB313FF117554B71006C0E22 /* SDL_system.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F11595D4D800BBD41B /* SDL_system.h */; }; + DB313FF217554B71006C0E22 /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F21595D4D800BBD41B /* SDL_syswm.h */; }; + DB313FF317554B71006C0E22 /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F31595D4D800BBD41B /* SDL_thread.h */; }; + DB313FF417554B71006C0E22 /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F41595D4D800BBD41B /* SDL_timer.h */; }; + DB313FF517554B71006C0E22 /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F51595D4D800BBD41B /* SDL_touch.h */; }; + DB313FF617554B71006C0E22 /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F61595D4D800BBD41B /* SDL_types.h */; }; + DB313FF717554B71006C0E22 /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F71595D4D800BBD41B /* SDL_version.h */; }; + DB313FF817554B71006C0E22 /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F81595D4D800BBD41B /* SDL_video.h */; }; + DB313FF917554B71006C0E22 /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557F91595D4D800BBD41B /* SDL.h */; }; + DB313FFA17554B71006C0E22 /* SDL_cocoamessagebox.h in Headers */ = {isa = PBXBuildFile; fileRef = AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */; }; + DB313FFB17554B71006C0E22 /* SDL_gamecontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */; }; + DB313FFC17554B71006C0E22 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; }; + DB313FFE17554B71006C0E22 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7412E6671700899322 /* SDL_atomic.c */; }; + DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD7512E6671700899322 /* SDL_spinlock.c */; }; + DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; }; + DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; }; + DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDA012E6671700899322 /* SDL_coreaudio.c */; }; + DB31400317554B71006C0E22 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB412E6671700899322 /* SDL_audio.c */; }; + DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB612E6671700899322 /* SDL_audiocvt.c */; }; + DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDB712E6671700899322 /* SDL_audiodev.c */; }; + DB31400617554B71006C0E22 /* SDL_audiotypecvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */; }; + DB31400717554B71006C0E22 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDBB12E6671700899322 /* SDL_mixer.c */; }; + DB31400817554B71006C0E22 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDC312E6671700899322 /* SDL_wave.c */; }; + DB31400917554B71006C0E22 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */; }; + DB31400A17554B71006C0E22 /* SDL_clipboardevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */; }; + DB31400B17554B71006C0E22 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDDE12E6671700899322 /* SDL_events.c */; }; + DB31400C17554B71006C0E22 /* SDL_dropevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */; }; + DB31400D17554B71006C0E22 /* SDL_gesture.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE012E6671700899322 /* SDL_gesture.c */; }; + DB31400E17554B71006C0E22 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE212E6671700899322 /* SDL_keyboard.c */; }; + DB31400F17554B71006C0E22 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE412E6671700899322 /* SDL_mouse.c */; }; + DB31401017554B71006C0E22 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE612E6671700899322 /* SDL_quit.c */; }; + DB31401117554B71006C0E22 /* SDL_touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDE812E6671700899322 /* SDL_touch.c */; }; + DB31401217554B71006C0E22 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEA12E6671700899322 /* SDL_windowevents.c */; }; + DB31401317554B71006C0E22 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */; }; + DB31401417554B71006C0E22 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF012E6671700899322 /* SDL_rwops.c */; }; + DB31401517554B71006C0E22 /* SDL_syshaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDF312E6671700899322 /* SDL_syshaptic.c */; }; + DB31401617554B71006C0E22 /* SDL_haptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFDFA12E6671700899322 /* SDL_haptic.c */; }; + DB31401717554B71006C0E22 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */; }; + DB31401817554B71006C0E22 /* SDL_gamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */; }; + DB31401917554B71006C0E22 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE1612E6671700899322 /* SDL_joystick.c */; }; + DB31401A17554B71006C0E22 /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE3312E6671700899322 /* SDL_sysloadso.c */; }; + DB31401B17554B71006C0E22 /* SDL_syspower.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4B12E6671700899322 /* SDL_syspower.c */; }; + DB31401C17554B71006C0E22 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE4E12E6671700899322 /* SDL_power.c */; }; + DB31401D17554B71006C0E22 /* SDL_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5612E6671700899322 /* SDL_assert.c */; }; + DB31401E17554B71006C0E22 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5912E6671700899322 /* SDL_error.c */; }; + DB31402017554B71006C0E22 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5C12E6671700899322 /* SDL.c */; }; + DB31402117554B71006C0E22 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5E12E6671700899322 /* SDL_getenv.c */; }; + DB31402217554B71006C0E22 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE5F12E6671700899322 /* SDL_iconv.c */; }; + DB31402317554B71006C0E22 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6012E6671700899322 /* SDL_malloc.c */; }; + DB31402417554B71006C0E22 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6112E6671700899322 /* SDL_qsort.c */; }; + DB31402517554B71006C0E22 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6212E6671700899322 /* SDL_stdlib.c */; }; + DB31402617554B71006C0E22 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE6312E6671700899322 /* SDL_string.c */; }; + DB31402717554B71006C0E22 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7E12E6671800899322 /* SDL_syscond.c */; }; + DB31402817554B71006C0E22 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */; }; + DB31402917554B71006C0E22 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8112E6671800899322 /* SDL_syssem.c */; }; + DB31402A17554B71006C0E22 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8212E6671800899322 /* SDL_systhread.c */; }; + DB31402B17554B71006C0E22 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE8C12E6671800899322 /* SDL_thread.c */; }; + DB31402C17554B71006C0E22 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFE9F12E6671800899322 /* SDL_timer.c */; }; + DB31402D17554B71006C0E22 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEA212E6671800899322 /* SDL_systimer.c */; }; + DB31402E17554B71006C0E22 /* SDL_cocoaclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */; }; + DB31402F17554B71006C0E22 /* SDL_cocoaevents.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */; }; + DB31403017554B71006C0E22 /* SDL_cocoakeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */; }; + DB31403117554B71006C0E22 /* SDL_cocoamodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */; }; + DB31403217554B71006C0E22 /* SDL_cocoamouse.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */; }; + DB31403317554B71006C0E22 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */; }; + DB31403417554B71006C0E22 /* SDL_cocoashape.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFECF12E6671800899322 /* SDL_cocoashape.m */; }; + DB31403517554B71006C0E22 /* SDL_cocoavideo.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED112E6671800899322 /* SDL_cocoavideo.m */; }; + DB31403617554B71006C0E22 /* SDL_cocoawindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFED312E6671800899322 /* SDL_cocoawindow.m */; }; + DB31403717554B71006C0E22 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEE812E6671800899322 /* SDL_nullevents.c */; }; + DB31403817554B71006C0E22 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */; }; + DB31403917554B71006C0E22 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF4E12E6671800899322 /* SDL_blit.c */; }; + DB31403A17554B71006C0E22 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5012E6671800899322 /* SDL_blit_0.c */; }; + DB31403B17554B71006C0E22 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5112E6671800899322 /* SDL_blit_1.c */; }; + DB31403C17554B71006C0E22 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5212E6671800899322 /* SDL_blit_A.c */; }; + DB31403D17554B71006C0E22 /* SDL_blit_auto.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5312E6671800899322 /* SDL_blit_auto.c */; }; + DB31403E17554B71006C0E22 /* SDL_blit_copy.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5512E6671800899322 /* SDL_blit_copy.c */; }; + DB31403F17554B71006C0E22 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5712E6671800899322 /* SDL_blit_N.c */; }; + DB31404017554B71006C0E22 /* SDL_blit_slow.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5812E6671800899322 /* SDL_blit_slow.c */; }; + DB31404117554B71006C0E22 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5A12E6671800899322 /* SDL_bmp.c */; }; + DB31404217554B71006C0E22 /* SDL_clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF5B12E6671800899322 /* SDL_clipboard.c */; }; + DB31404317554B71006C0E22 /* SDL_fillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6012E6671800899322 /* SDL_fillrect.c */; }; + DB31404417554B71006C0E22 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6512E6671800899322 /* SDL_pixels.c */; }; + DB31404517554B71006C0E22 /* SDL_rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6712E6671800899322 /* SDL_rect.c */; }; + DB31404617554B71006C0E22 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */; }; + DB31404717554B71006C0E22 /* SDL_shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7112E6671800899322 /* SDL_shape.c */; }; + DB31404817554B71006C0E22 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7312E6671800899322 /* SDL_stretch.c */; }; + DB31404917554B71006C0E22 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7412E6671800899322 /* SDL_surface.c */; }; + DB31404A17554B71006C0E22 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFF7612E6671800899322 /* SDL_video.c */; }; + DB31404B17554B71006C0E22 /* imKStoUCS.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFB812E6671800899322 /* imKStoUCS.c */; }; + DB31404C17554B71006C0E22 /* SDL_x11clipboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */; }; + DB31404D17554B71006C0E22 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */; }; + DB31404E17554B71006C0E22 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFBE12E6671800899322 /* SDL_x11events.c */; }; + DB31404F17554B71006C0E22 /* SDL_x11keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */; }; + DB31405017554B71006C0E22 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC412E6671800899322 /* SDL_x11modes.c */; }; + DB31405117554B71006C0E22 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC612E6671800899322 /* SDL_x11mouse.c */; }; + DB31405217554B71006C0E22 /* SDL_x11opengl.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFC812E6671800899322 /* SDL_x11opengl.c */; }; + DB31405317554B71006C0E22 /* SDL_x11opengles.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */; }; + DB31405417554B71006C0E22 /* SDL_x11shape.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFCE12E6671800899322 /* SDL_x11shape.c */; }; + DB31405517554B71006C0E22 /* SDL_x11touch.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD112E6671800899322 /* SDL_x11touch.c */; }; + DB31405617554B71006C0E22 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD312E6671800899322 /* SDL_x11video.c */; }; + DB31405717554B71006C0E22 /* SDL_x11window.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFFD512E6671800899322 /* SDL_x11window.c */; }; + DB31405817554B71006C0E22 /* SDL_render.c in Sources */ = {isa = PBXBuildFile; fileRef = 041B2C9E12FA0D680087D585 /* SDL_render.c */; }; + DB31405917554B71006C0E22 /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */; }; + DB31405A17554B71006C0E22 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */; }; + DB31405B17554B71006C0E22 /* SDL_nullframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */; }; + DB31405C17554B71006C0E22 /* SDL_blendfillrect.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */; }; + DB31405D17554B71006C0E22 /* SDL_blendline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */; }; + DB31405E17554B71006C0E22 /* SDL_blendpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */; }; + DB31405F17554B71006C0E22 /* SDL_drawline.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804412FB74A200FC43C0 /* SDL_drawline.c */; }; + DB31406017554B71006C0E22 /* SDL_drawpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */; }; + DB31406117554B71006C0E22 /* SDL_render_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */; }; + DB31406217554B71006C0E22 /* SDL_render_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */; }; + DB31406317554B71006C0E22 /* SDL_x11framebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */; }; + DB31406417554B71006C0E22 /* SDL_hints.c in Sources */ = {isa = PBXBuildFile; fileRef = 0442EC5E12FE1C75004C9285 /* SDL_hints.c */; }; + DB31406517554B71006C0E22 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BAC0C71300C2160055DE28 /* SDL_log.c */; }; + DB31406617554B71006C0E22 /* SDL_shaders_gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */; }; + DB31406717554B71006C0E22 /* SDL_rotate.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628AC8159367B7005138DD /* SDL_rotate.c */; }; + DB31406817554B71006C0E22 /* SDL_x11xinput2.c in Sources */ = {isa = PBXBuildFile; fileRef = AA628ACF159367F2005138DD /* SDL_x11xinput2.c */; }; + DB31406917554B71006C0E22 /* SDL_x11messagebox.c in Sources */ = {isa = PBXBuildFile; fileRef = AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */; }; + DB31406A17554B71006C0E22 /* SDL_cocoamessagebox.m in Sources */ = {isa = PBXBuildFile; fileRef = AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */; }; + DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; }; + DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; }; + DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; }; + DB31406F17554B71006C0E22 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; }; + DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; }; + DB31407117554B71006C0E22 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; }; + DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; }; + DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; }; + DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 00830FFF1072D94A00A531F1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 0032354F1070931700C76517; - remoteInfo = "Generate Doxygen DocSet"; - }; BECDF6C50761BA81005FE872 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; @@ -322,203 +788,279 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 0014B7E809C0D8D2003A99D5 /* SDL_dgaevents_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dgaevents_c.h; sourceTree = ""; }; - 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dgaevents.c; sourceTree = ""; }; - 0014B7EA09C0D8D2003A99D5 /* SDL_dgamouse_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dgamouse_c.h; sourceTree = ""; }; - 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dgamouse.c; sourceTree = ""; }; - 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dgavideo.c; sourceTree = ""; }; - 0014B7ED09C0D8D2003A99D5 /* SDL_dgavideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dgavideo.h; sourceTree = ""; }; - 0014B83709C0D977003A99D5 /* SDL_x11dga_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11dga_c.h; sourceTree = ""; }; - 0014B83809C0D977003A99D5 /* SDL_x11dga.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11dga.c; sourceTree = ""; }; - 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11dyn.c; sourceTree = ""; }; - 0014B83A09C0D977003A99D5 /* SDL_x11dyn.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11dyn.h; sourceTree = ""; }; - 0014B83B09C0D977003A99D5 /* SDL_x11events_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11events_c.h; sourceTree = ""; }; - 0014B83C09C0D977003A99D5 /* SDL_x11events.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11events.c; sourceTree = ""; }; - 0014B83D09C0D977003A99D5 /* SDL_x11gamma_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11gamma_c.h; sourceTree = ""; }; - 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11gamma.c; sourceTree = ""; }; - 0014B83F09C0D977003A99D5 /* SDL_x11gl_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11gl_c.h; sourceTree = ""; }; - 0014B84009C0D977003A99D5 /* SDL_x11gl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11gl.c; sourceTree = ""; }; - 0014B84109C0D977003A99D5 /* SDL_x11image_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11image_c.h; sourceTree = ""; }; - 0014B84209C0D977003A99D5 /* SDL_x11image.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11image.c; sourceTree = ""; }; - 0014B84309C0D977003A99D5 /* SDL_x11modes_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11modes_c.h; sourceTree = ""; }; - 0014B84409C0D977003A99D5 /* SDL_x11modes.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11modes.c; sourceTree = ""; }; - 0014B84509C0D977003A99D5 /* SDL_x11mouse_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11mouse_c.h; sourceTree = ""; }; - 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11mouse.c; sourceTree = ""; }; - 0014B84709C0D977003A99D5 /* SDL_x11sym.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11sym.h; sourceTree = ""; }; - 0014B84809C0D977003A99D5 /* SDL_x11video.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11video.c; sourceTree = ""; }; - 0014B84909C0D977003A99D5 /* SDL_x11video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11video.h; sourceTree = ""; }; - 0014B84A09C0D977003A99D5 /* SDL_x11wm_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11wm_c.h; sourceTree = ""; }; - 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11wm.c; sourceTree = ""; }; - 0014B84C09C0D977003A99D5 /* SDL_x11yuv_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11yuv_c.h; sourceTree = ""; }; - 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11yuv.c; sourceTree = ""; }; - 0014B89009C0DA94003A99D5 /* XF86DGA.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = XF86DGA.c; sourceTree = ""; }; - 0014B89109C0DA94003A99D5 /* XF86DGA2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = XF86DGA2.c; sourceTree = ""; }; - 0014B89609C0DAA1003A99D5 /* XF86VMode.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = XF86VMode.c; sourceTree = ""; }; - 0014B89909C0DAAE003A99D5 /* Xv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = Xv.c; sourceTree = ""; }; - 0014B89A09C0DAAE003A99D5 /* Xvlibint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xvlibint.h; sourceTree = ""; }; - 0014B89F09C0DAB9003A99D5 /* Xinerama.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = Xinerama.c; sourceTree = ""; }; - 0014B8A209C0DAC4003A99D5 /* xme.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = xme.c; sourceTree = ""; }; - 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_dreamcast.h; path = ../../include/SDL_config_dreamcast.h; sourceTree = SOURCE_ROOT; }; - 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_macos.h; path = ../../include/SDL_config_macos.h; sourceTree = SOURCE_ROOT; }; - 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_macosx.h; path = ../../include/SDL_config_macosx.h; sourceTree = SOURCE_ROOT; }; - 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_os2.h; path = ../../include/SDL_config_os2.h; sourceTree = SOURCE_ROOT; }; - 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_win32.h; path = ../../include/SDL_config_win32.h; sourceTree = SOURCE_ROOT; }; - 00162D3709BD1FA90037C8D0 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config.h; path = ../../include/SDL_config.h; sourceTree = SOURCE_ROOT; }; - 00162D3809BD1FA90037C8D0 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_platform.h; path = ../../include/SDL_platform.h; sourceTree = SOURCE_ROOT; }; - 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_stdinc.h; path = ../../include/SDL_stdinc.h; sourceTree = SOURCE_ROOT; }; - 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syscond.c; sourceTree = ""; }; - 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysmutex.c; sourceTree = ""; }; - 00162D4F09BD20DA0037C8D0 /* SDL_sysmutex_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_sysmutex_c.h; sourceTree = ""; }; - 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syssem.c; sourceTree = ""; }; - 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_systhread.c; sourceTree = ""; }; - 00162D5209BD20DA0037C8D0 /* SDL_systhread_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_systhread_c.h; sourceTree = ""; }; - 00162D6009BD21010037C8D0 /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = ""; }; - 00162D6509BD214F0037C8D0 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = ""; }; - 00162D6609BD214F0037C8D0 /* SDL_malloc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_malloc.c; sourceTree = ""; }; - 00162D6709BD214F0037C8D0 /* SDL_qsort.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_qsort.c; sourceTree = ""; }; - 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_stdlib.c; sourceTree = ""; }; - 00162D6909BD214F0037C8D0 /* SDL_string.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_string.c; sourceTree = ""; }; - 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = ""; }; - 00162F3509BE27FB0037C8D0 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = ""; }; - 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_nullmouse.c; sourceTree = ""; }; - 00162F3709BE27FB0037C8D0 /* SDL_nullmouse_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_nullmouse_c.h; sourceTree = ""; }; - 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = ""; }; - 00162F3909BE27FB0037C8D0 /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = ""; }; - 002F328509CA049100EBEB88 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = ""; }; - 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = ""; }; - 002F32D509CA0BE700EBEB88 /* SDL_diskaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_diskaudio.h; sourceTree = ""; }; - 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = ""; }; - 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = ""; }; - 004C2C860975E13300E9D430 /* AudioFilePlayer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = AudioFilePlayer.c; sourceTree = ""; }; - 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = AudioFileReaderThread.c; sourceTree = ""; }; - 004C2C880975E13300E9D430 /* CDPlayer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = CDPlayer.c; sourceTree = ""; }; - 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDLOSXCAGuard.c; sourceTree = ""; }; - 004C2C8A0975E13300E9D430 /* SDLOSXCAGuard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLOSXCAGuard.h; sourceTree = ""; }; 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 0073179C0858DECD00B2BC32 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; 0073179D0858DECD00B2BC32 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 0073179E0858DECD00B2BC32 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 0073179F0858DECD00B2BC32 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 007317A00858DECD00B2BC32 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 007317A10858DECD00B2BC32 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 007317C10858E15000B2BC32 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; - 00794D3F09D0C461003FC8A1 /* License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = License.rtf; sourceTree = ""; }; + 00794D3F09D0C461003FC8A1 /* License.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = License.txt; sourceTree = ""; }; 00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMeDevLite.txt; sourceTree = ""; }; - 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_mixer_MMX.c; sourceTree = ""; }; - 00B7E620097F2D9E00826121 /* SDL_mixer_MMX.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_mixer_MMX.h; sourceTree = ""; }; - 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = ""; }; - 00D0D02210675823004B05EF /* SDL_QuartzWM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzWM.h; sourceTree = ""; }; + 00CFA89C106B4BA100758660 /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = ""; }; 00D0D08310675DD9004B05EF /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; - 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = UniversalBinaryNotes.rtf; sourceTree = ""; }; - 01538330006D78D67F000001 /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = ""; }; - 01538331006D78D67F000001 /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = ""; }; - 01538332006D78D67F000001 /* SDL_audiodev.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audiodev.c; sourceTree = ""; }; - 01538334006D78D67F000001 /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = ""; }; - 01538335006D78D67F000001 /* SDL_wave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_wave.c; sourceTree = ""; }; - 01538368006D79147F000001 /* SDL_active.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_active.c; sourceTree = ""; }; - 01538369006D79147F000001 /* SDL_events.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_events.c; sourceTree = ""; }; - 0153836A006D79147F000001 /* SDL_expose.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_expose.c; sourceTree = ""; }; - 0153836B006D79147F000001 /* SDL_keyboard.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_keyboard.c; sourceTree = ""; }; - 0153836C006D79147F000001 /* SDL_mouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_mouse.c; sourceTree = ""; }; - 0153836D006D79147F000001 /* SDL_quit.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_quit.c; sourceTree = ""; }; - 0153836E006D79147F000001 /* SDL_resize.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_resize.c; sourceTree = ""; }; - 01538377006D79307F000001 /* SDL_rwops.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_rwops.c; sourceTree = ""; }; - 015383A0006D79BC7F000001 /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = ""; }; - 015383C5006D7A567F000001 /* SDL_macevents.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macevents.c; sourceTree = ""; }; - 015383C7006D7A567F000001 /* SDL_macgl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macgl.c; sourceTree = ""; }; - 015383CA006D7A567F000001 /* SDL_macmouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macmouse.c; sourceTree = ""; }; - 015383CC006D7A567F000001 /* SDL_macwm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macwm.c; sourceTree = ""; }; - 015383D1006D7A567F000001 /* SDL_dspvideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dspvideo.c; sourceTree = ""; }; - 015383D2006D7A567F000001 /* SDL_dspvideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dspvideo.h; sourceTree = ""; }; - 015383D6006D7A567F000001 /* SDL_romvideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_romvideo.c; sourceTree = ""; }; - 015383D8006D7A567F000001 /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = ""; }; - 015383DA006D7A567F000001 /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = ""; }; - 015383DB006D7A567F000001 /* SDL_blit_1.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_1.c; sourceTree = ""; }; - 015383DC006D7A567F000001 /* SDL_blit_A.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_A.c; sourceTree = ""; }; - 015383DE006D7A567F000001 /* SDL_blit_N.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_N.c; sourceTree = ""; }; - 015383DF006D7A567F000001 /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = ""; }; - 015383E0006D7A567F000001 /* SDL_cursor.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_cursor.c; sourceTree = ""; }; - 015383E2006D7A567F000001 /* SDL_gamma.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_gamma.c; sourceTree = ""; }; - 015383E6006D7A567F000001 /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = ""; }; - 015383E8006D7A567F000001 /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = ""; }; - 015383EA006D7A567F000001 /* SDL_stretch.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_stretch.c; sourceTree = ""; }; - 015383EC006D7A567F000001 /* SDL_surface.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_surface.c; sourceTree = ""; }; - 015383EE006D7A567F000001 /* SDL_video.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_video.c; sourceTree = ""; }; - 015383EF006D7A567F000001 /* SDL_yuv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_yuv.c; sourceTree = ""; }; - 015383F1006D7A567F000001 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = ""; }; - 01538438006D7D947F000001 /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_error.c; path = ../../src/SDL_error.c; sourceTree = SOURCE_ROOT; }; - 01538439006D7D947F000001 /* SDL_fatal.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_fatal.c; path = ../../src/SDL_fatal.c; sourceTree = SOURCE_ROOT; }; - 0153843C006D7D947F000001 /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = SOURCE_ROOT; }; - 01538445006D7EC67F000001 /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_thread.c; path = ../../src/thread/SDL_thread.c; sourceTree = SOURCE_ROOT; }; - 046B91E90A11B53500FB151C /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = ""; }; - 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dlcompat.c; sourceTree = ""; }; - 083E4894006D86FF7F000001 /* SDL_syscdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syscdrom.c; sourceTree = ""; }; - 083E4895006D86FF7F000001 /* SDL_cdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_cdrom.c; sourceTree = ""; }; - 083E489D006D88D97F000001 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = ""; }; - 0C5AF5E501191D2B7F000001 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = begin_code.h; path = ../../include/begin_code.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5E601191D2B7F000001 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = close_code.h; path = ../../include/close_code.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5E701191D2B7F000001 /* SDL_active.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_active.h; path = ../../include/SDL_active.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5E801191D2B7F000001 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = ../../include/SDL_audio.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5E901191D2B7F000001 /* SDL_byteorder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_byteorder.h; path = ../../include/SDL_byteorder.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5EA01191D2B7F000001 /* SDL_cdrom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_cdrom.h; path = ../../include/SDL_cdrom.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5EB01191D2B7F000001 /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_copying.h; path = ../../include/SDL_copying.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5EC01191D2B7F000001 /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_endian.h; path = ../../include/SDL_endian.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5ED01191D2B7F000001 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_error.h; path = ../../include/SDL_error.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5EE01191D2B7F000001 /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_events.h; path = ../../include/SDL_events.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5EF01191D2B7F000001 /* SDL_getenv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_getenv.h; path = ../../include/SDL_getenv.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F001191D2B7F000001 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_joystick.h; path = ../../include/SDL_joystick.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_keyboard.h; path = ../../include/SDL_keyboard.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F201191D2B7F000001 /* SDL_keysym.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_keysym.h; path = ../../include/SDL_keysym.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F301191D2B7F000001 /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_main.h; path = ../../include/SDL_main.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F401191D2B7F000001 /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_mouse.h; path = ../../include/SDL_mouse.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F501191D2B7F000001 /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_mutex.h; path = ../../include/SDL_mutex.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F601191D2B7F000001 /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_opengl.h; path = ../../include/SDL_opengl.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F701191D2B7F000001 /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_quit.h; path = ../../include/SDL_quit.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F801191D2B7F000001 /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_rwops.h; path = ../../include/SDL_rwops.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5F901191D2B7F000001 /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_syswm.h; path = ../../include/SDL_syswm.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5FA01191D2B7F000001 /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_thread.h; path = ../../include/SDL_thread.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5FB01191D2B7F000001 /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_timer.h; path = ../../include/SDL_timer.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5FC01191D2B7F000001 /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_types.h; path = ../../include/SDL_types.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5FD01191D2B7F000001 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_version.h; path = ../../include/SDL_version.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5FE01191D2B7F000001 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_video.h; path = ../../include/SDL_video.h; sourceTree = SOURCE_ROOT; }; - 0C5AF5FF01191D2B7F000001 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = ../../include/SDL.h; sourceTree = SOURCE_ROOT; }; - 2EECDF2D0086C3A07F000001 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDLMain.h; path = ../../src/main/macosx/SDLMain.h; sourceTree = SOURCE_ROOT; }; - 2EECDF2E0086C3A07F000001 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SDLMain.m; path = ../../src/main/macosx/SDLMain.m; sourceTree = SOURCE_ROOT; }; - 2EECDF2F0086C3A07F000001 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = ../../src/main/macosx/SDLMain.nib; sourceTree = SOURCE_ROOT; }; - B24DA4D605A88AD0006B9F1C /* CGS.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CGS.h; sourceTree = ""; }; - B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzEvents.m; sourceTree = ""; }; - B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzGL.m; sourceTree = ""; }; - B24DA4D905A88AD0006B9F1C /* SDL_QuartzKeys.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzKeys.h; sourceTree = ""; }; - B24DA4DA05A88AD0006B9F1C /* SDL_QuartzVideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzVideo.h; sourceTree = ""; }; - B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzVideo.m; sourceTree = ""; }; - B24DA4DC05A88AD0006B9F1C /* SDL_QuartzWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzWindow.h; sourceTree = ""; }; - B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzWindow.m; sourceTree = ""; }; - B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzWM.m; sourceTree = ""; }; - B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_cpuinfo.c; sourceTree = ""; }; - B29A290D04E5B28700A80002 /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_loadso.h; path = ../../include/SDL_loadso.h; sourceTree = ""; }; - B2A23A450415799100A80002 /* AudioFilePlayer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioFilePlayer.h; sourceTree = ""; }; - B2A23A7A04157C5700A80002 /* SDL_syscdrom_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_syscdrom_c.h; sourceTree = ""; }; - B2A23A7B04157C5700A80002 /* SDL_syscdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syscdrom.c; sourceTree = ""; }; - B2A23A8104157D5D00A80002 /* CDPlayer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CDPlayer.h; sourceTree = ""; }; - B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_cpuinfo.h; path = ../../include/SDL_cpuinfo.h; sourceTree = SOURCE_ROOT; }; - B2CF8DC705C4450500E5DC7F /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_name.h; path = ../../include/SDL_name.h; sourceTree = SOURCE_ROOT; }; - BECDF5D50761B759005FE872 /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_coreaudio.c; sourceTree = ""; }; - BECDF5D60761B759005FE872 /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = ""; }; + 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_glfuncs.h; sourceTree = ""; }; + 041B2C9E12FA0D680087D585 /* SDL_render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render.c; sourceTree = ""; }; + 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysrender.h; sourceTree = ""; }; + 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shaders_gl.c; sourceTree = ""; }; + 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shaders_gl.h; sourceTree = ""; }; + 04409B8D12FA97ED00FB9AA8 /* mmx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmx.h; sourceTree = ""; }; + 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = ""; }; + 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_sw_c.h; sourceTree = ""; }; + 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = ""; }; + 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_gl.c; sourceTree = ""; }; + 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render_sw_c.h; sourceTree = ""; }; + 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_render_sw.c; sourceTree = ""; }; + 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11framebuffer.c; sourceTree = ""; }; + 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11framebuffer.h; sourceTree = ""; }; + 0442EC5E12FE1C75004C9285 /* SDL_hints.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_hints.c; path = ../../src/SDL_hints.c; sourceTree = SOURCE_ROOT; }; + 04BAC0C71300C2160055DE28 /* SDL_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_log.c; path = ../../src/SDL_log.c; sourceTree = SOURCE_ROOT; }; + 04BDFD7412E6671700899322 /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = ""; }; + 04BDFD7512E6671700899322 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = ""; }; + 04BDFD8812E6671700899322 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = ""; }; + 04BDFD8912E6671700899322 /* SDL_diskaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_diskaudio.h; sourceTree = ""; }; + 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = ""; }; + 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = ""; }; + 04BDFDA012E6671700899322 /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_coreaudio.c; sourceTree = ""; }; + 04BDFDA112E6671700899322 /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = ""; }; + 04BDFDB412E6671700899322 /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = ""; }; + 04BDFDB512E6671700899322 /* SDL_audio_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio_c.h; sourceTree = ""; }; + 04BDFDB612E6671700899322 /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = ""; }; + 04BDFDB712E6671700899322 /* SDL_audiodev.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiodev.c; sourceTree = ""; }; + 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiodev_c.h; sourceTree = ""; }; + 04BDFDB912E6671700899322 /* SDL_audiomem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audiomem.h; sourceTree = ""; }; + 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_audiotypecvt.c; sourceTree = ""; }; + 04BDFDBB12E6671700899322 /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = ""; }; + 04BDFDC212E6671700899322 /* SDL_sysaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysaudio.h; sourceTree = ""; }; + 04BDFDC312E6671700899322 /* SDL_wave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_wave.c; sourceTree = ""; }; + 04BDFDC412E6671700899322 /* SDL_wave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_wave.h; sourceTree = ""; }; + 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_cpuinfo.c; sourceTree = ""; }; + 04BDFDD612E6671700899322 /* blank_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blank_cursor.h; sourceTree = ""; }; + 04BDFDD712E6671700899322 /* default_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_cursor.h; sourceTree = ""; }; + 04BDFDD812E6671700899322 /* scancodes_darwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_darwin.h; sourceTree = ""; }; + 04BDFDD912E6671700899322 /* scancodes_linux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_linux.h; sourceTree = ""; }; + 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scancodes_xfree86.h; sourceTree = ""; }; + 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboardevents.c; sourceTree = ""; }; + 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboardevents_c.h; sourceTree = ""; }; + 04BDFDDE12E6671700899322 /* SDL_events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_events.c; sourceTree = ""; }; + 04BDFDDF12E6671700899322 /* SDL_events_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events_c.h; sourceTree = ""; }; + 04BDFDE012E6671700899322 /* SDL_gesture.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gesture.c; sourceTree = ""; }; + 04BDFDE112E6671700899322 /* SDL_gesture_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture_c.h; sourceTree = ""; }; + 04BDFDE212E6671700899322 /* SDL_keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_keyboard.c; sourceTree = ""; }; + 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard_c.h; sourceTree = ""; }; + 04BDFDE412E6671700899322 /* SDL_mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mouse.c; sourceTree = ""; }; + 04BDFDE512E6671700899322 /* SDL_mouse_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse_c.h; sourceTree = ""; }; + 04BDFDE612E6671700899322 /* SDL_quit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_quit.c; sourceTree = ""; }; + 04BDFDE712E6671700899322 /* SDL_sysevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysevents.h; sourceTree = ""; }; + 04BDFDE812E6671700899322 /* SDL_touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_touch.c; sourceTree = ""; }; + 04BDFDE912E6671700899322 /* SDL_touch_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch_c.h; sourceTree = ""; }; + 04BDFDEA12E6671700899322 /* SDL_windowevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_windowevents.c; sourceTree = ""; }; + 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_windowevents_c.h; sourceTree = ""; }; + 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwopsbundlesupport.h; sourceTree = ""; }; + 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_rwopsbundlesupport.m; sourceTree = ""; }; + 04BDFDF012E6671700899322 /* SDL_rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rwops.c; sourceTree = ""; }; + 04BDFDF312E6671700899322 /* SDL_syshaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syshaptic.c; sourceTree = ""; }; + 04BDFDFA12E6671700899322 /* SDL_haptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_haptic.c; sourceTree = ""; }; + 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic_c.h; sourceTree = ""; }; + 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syshaptic.h; sourceTree = ""; }; + 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysjoystick.c; sourceTree = ""; }; + 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick_c.h; sourceTree = ""; }; + 04BDFE1612E6671700899322 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = ""; }; + 04BDFE1712E6671700899322 /* SDL_joystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick_c.h; sourceTree = ""; }; + 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick.h; sourceTree = ""; }; + 04BDFE3312E6671700899322 /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = ""; }; + 04BDFE4B12E6671700899322 /* SDL_syspower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syspower.c; sourceTree = ""; }; + 04BDFE4E12E6671700899322 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_power.c; sourceTree = ""; }; + 04BDFE5512E6671700899322 /* 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; }; + 04BDFE5612E6671700899322 /* SDL_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_assert.c; path = ../../src/SDL_assert.c; sourceTree = SOURCE_ROOT; }; + 04BDFE5812E6671700899322 /* SDL_error_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_error_c.h; path = ../../src/SDL_error_c.h; sourceTree = SOURCE_ROOT; }; + 04BDFE5912E6671700899322 /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_error.c; path = ../../src/SDL_error.c; sourceTree = SOURCE_ROOT; }; + 04BDFE5C12E6671700899322 /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = SOURCE_ROOT; }; + 04BDFE5E12E6671700899322 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = ""; }; + 04BDFE5F12E6671700899322 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = ""; }; + 04BDFE6012E6671700899322 /* SDL_malloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_malloc.c; sourceTree = ""; }; + 04BDFE6112E6671700899322 /* SDL_qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_qsort.c; sourceTree = ""; }; + 04BDFE6212E6671700899322 /* SDL_stdlib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stdlib.c; sourceTree = ""; }; + 04BDFE6312E6671700899322 /* SDL_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_string.c; sourceTree = ""; }; + 04BDFE7E12E6671800899322 /* SDL_syscond.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syscond.c; sourceTree = ""; }; + 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sysmutex.c; sourceTree = ""; }; + 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysmutex_c.h; sourceTree = ""; }; + 04BDFE8112E6671800899322 /* SDL_syssem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_syssem.c; sourceTree = ""; }; + 04BDFE8212E6671800899322 /* SDL_systhread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systhread.c; sourceTree = ""; }; + 04BDFE8312E6671800899322 /* SDL_systhread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread_c.h; sourceTree = ""; }; + 04BDFE8B12E6671800899322 /* SDL_systhread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_systhread.h; sourceTree = ""; }; + 04BDFE8C12E6671800899322 /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_thread.c; sourceTree = ""; }; + 04BDFE8D12E6671800899322 /* SDL_thread_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread_c.h; sourceTree = ""; }; + 04BDFE9F12E6671800899322 /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = ""; }; + 04BDFEA012E6671800899322 /* SDL_timer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer_c.h; sourceTree = ""; }; + 04BDFEA212E6671800899322 /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = ""; }; + 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaclipboard.h; sourceTree = ""; }; + 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaclipboard.m; sourceTree = ""; }; + 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaevents.h; sourceTree = ""; }; + 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaevents.m; sourceTree = ""; }; + 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoakeyboard.h; sourceTree = ""; }; + 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoakeyboard.m; sourceTree = ""; }; + 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamodes.h; sourceTree = ""; }; + 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamodes.m; sourceTree = ""; }; + 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamouse.h; sourceTree = ""; }; + 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamouse.m; sourceTree = ""; }; + 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoaopengl.h; sourceTree = ""; }; + 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoaopengl.m; sourceTree = ""; }; + 04BDFECE12E6671800899322 /* SDL_cocoashape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoashape.h; sourceTree = ""; }; + 04BDFECF12E6671800899322 /* SDL_cocoashape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoashape.m; sourceTree = ""; }; + 04BDFED012E6671800899322 /* SDL_cocoavideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoavideo.h; sourceTree = ""; }; + 04BDFED112E6671800899322 /* SDL_cocoavideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoavideo.m; sourceTree = ""; }; + 04BDFED212E6671800899322 /* SDL_cocoawindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoawindow.h; sourceTree = ""; }; + 04BDFED312E6671800899322 /* SDL_cocoawindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoawindow.m; sourceTree = ""; }; + 04BDFEE812E6671800899322 /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = ""; }; + 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = ""; }; + 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = ""; }; + 04BDFEED12E6671800899322 /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = ""; }; + 04BDFF4E12E6671800899322 /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = ""; }; + 04BDFF4F12E6671800899322 /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = ""; }; + 04BDFF5012E6671800899322 /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = ""; }; + 04BDFF5112E6671800899322 /* SDL_blit_1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_1.c; sourceTree = ""; }; + 04BDFF5212E6671800899322 /* SDL_blit_A.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_A.c; sourceTree = ""; }; + 04BDFF5312E6671800899322 /* SDL_blit_auto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_auto.c; sourceTree = ""; }; + 04BDFF5412E6671800899322 /* SDL_blit_auto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_auto.h; sourceTree = ""; }; + 04BDFF5512E6671800899322 /* SDL_blit_copy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_copy.c; sourceTree = ""; }; + 04BDFF5612E6671800899322 /* SDL_blit_copy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_copy.h; sourceTree = ""; }; + 04BDFF5712E6671800899322 /* SDL_blit_N.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_N.c; sourceTree = ""; }; + 04BDFF5812E6671800899322 /* SDL_blit_slow.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blit_slow.c; sourceTree = ""; }; + 04BDFF5912E6671800899322 /* SDL_blit_slow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit_slow.h; sourceTree = ""; }; + 04BDFF5A12E6671800899322 /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = ""; }; + 04BDFF5B12E6671800899322 /* SDL_clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_clipboard.c; sourceTree = ""; }; + 04BDFF6012E6671800899322 /* SDL_fillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_fillrect.c; sourceTree = ""; }; + 04BDFF6512E6671800899322 /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = ""; }; + 04BDFF6612E6671800899322 /* SDL_pixels_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels_c.h; sourceTree = ""; }; + 04BDFF6712E6671800899322 /* SDL_rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rect.c; sourceTree = ""; }; + 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = ""; }; + 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_RLEaccel_c.h; sourceTree = ""; }; + 04BDFF7112E6671800899322 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = ""; }; + 04BDFF7212E6671800899322 /* SDL_shape_internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape_internals.h; sourceTree = ""; }; + 04BDFF7312E6671800899322 /* SDL_stretch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_stretch.c; sourceTree = ""; }; + 04BDFF7412E6671800899322 /* SDL_surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_surface.c; sourceTree = ""; }; + 04BDFF7512E6671800899322 /* SDL_sysvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysvideo.h; sourceTree = ""; }; + 04BDFF7612E6671800899322 /* SDL_video.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_video.c; sourceTree = ""; }; + 04BDFFB812E6671800899322 /* imKStoUCS.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = imKStoUCS.c; sourceTree = ""; }; + 04BDFFB912E6671800899322 /* imKStoUCS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imKStoUCS.h; sourceTree = ""; }; + 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11clipboard.c; sourceTree = ""; }; + 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11clipboard.h; sourceTree = ""; }; + 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11dyn.c; sourceTree = ""; }; + 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11dyn.h; sourceTree = ""; }; + 04BDFFBE12E6671800899322 /* SDL_x11events.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11events.c; sourceTree = ""; }; + 04BDFFBF12E6671800899322 /* SDL_x11events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11events.h; sourceTree = ""; }; + 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11keyboard.c; sourceTree = ""; }; + 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11keyboard.h; sourceTree = ""; }; + 04BDFFC412E6671800899322 /* SDL_x11modes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11modes.c; sourceTree = ""; }; + 04BDFFC512E6671800899322 /* SDL_x11modes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11modes.h; sourceTree = ""; }; + 04BDFFC612E6671800899322 /* SDL_x11mouse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11mouse.c; sourceTree = ""; }; + 04BDFFC712E6671800899322 /* SDL_x11mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11mouse.h; sourceTree = ""; }; + 04BDFFC812E6671800899322 /* SDL_x11opengl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11opengl.c; sourceTree = ""; }; + 04BDFFC912E6671800899322 /* SDL_x11opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11opengl.h; sourceTree = ""; }; + 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11opengles.c; sourceTree = ""; }; + 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11opengles.h; sourceTree = ""; }; + 04BDFFCE12E6671800899322 /* SDL_x11shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11shape.c; sourceTree = ""; }; + 04BDFFCF12E6671800899322 /* SDL_x11shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11shape.h; sourceTree = ""; }; + 04BDFFD012E6671800899322 /* SDL_x11sym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11sym.h; sourceTree = ""; }; + 04BDFFD112E6671800899322 /* SDL_x11touch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11touch.c; sourceTree = ""; }; + 04BDFFD212E6671800899322 /* SDL_x11touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11touch.h; sourceTree = ""; }; + 04BDFFD312E6671800899322 /* SDL_x11video.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11video.c; sourceTree = ""; }; + 04BDFFD412E6671800899322 /* SDL_x11video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11video.h; sourceTree = ""; }; + 04BDFFD512E6671800899322 /* SDL_x11window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11window.c; sourceTree = ""; }; + 04BDFFD612E6671800899322 /* SDL_x11window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11window.h; sourceTree = ""; }; + 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullframebuffer_c.h; sourceTree = ""; }; + 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullframebuffer.c; sourceTree = ""; }; + 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendfillrect.c; sourceTree = ""; }; + 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendfillrect.h; sourceTree = ""; }; + 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendline.c; sourceTree = ""; }; + 04F7804012FB74A200FC43C0 /* SDL_blendline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendline.h; sourceTree = ""; }; + 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_blendpoint.c; sourceTree = ""; }; + 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendpoint.h; sourceTree = ""; }; + 04F7804312FB74A200FC43C0 /* SDL_draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_draw.h; sourceTree = ""; }; + 04F7804412FB74A200FC43C0 /* SDL_drawline.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawline.c; sourceTree = ""; }; + 04F7804512FB74A200FC43C0 /* SDL_drawline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawline.h; sourceTree = ""; }; + 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_drawpoint.c; sourceTree = ""; }; + 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_drawpoint.h; sourceTree = ""; }; + 566CDE8D148F0AC200C5A9BB /* SDL_dropevents_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dropevents_c.h; sourceTree = ""; }; + 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dropevents.c; sourceTree = ""; }; + A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gamecontroller.h; sourceTree = ""; }; + AA0F8490178D5ECC00823F9D /* SDL_systls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_systls.c; sourceTree = ""; }; + AA628AC8159367B7005138DD /* SDL_rotate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_rotate.c; sourceTree = ""; }; + AA628AC9159367B7005138DD /* SDL_rotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rotate.h; sourceTree = ""; }; + AA628ACF159367F2005138DD /* SDL_x11xinput2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11xinput2.c; sourceTree = ""; }; + AA628AD0159367F2005138DD /* SDL_x11xinput2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_x11xinput2.h; sourceTree = ""; }; + AA7557C71595D4D800BBD41B /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = ""; }; + AA7557C81595D4D800BBD41B /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = ""; }; + AA7557C91595D4D800BBD41B /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_assert.h; sourceTree = ""; }; + AA7557CA1595D4D800BBD41B /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_atomic.h; sourceTree = ""; }; + AA7557CB1595D4D800BBD41B /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_audio.h; sourceTree = ""; }; + AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blendmode.h; sourceTree = ""; }; + AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_clipboard.h; sourceTree = ""; }; + AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_macosx.h; sourceTree = ""; }; + AA7557CF1595D4D800BBD41B /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = ""; }; + AA7557D01595D4D800BBD41B /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_copying.h; sourceTree = ""; }; + AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cpuinfo.h; sourceTree = ""; }; + AA7557D21595D4D800BBD41B /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = ""; }; + AA7557D31595D4D800BBD41B /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = ""; }; + AA7557D41595D4D800BBD41B /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = ""; }; + AA7557D51595D4D800BBD41B /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_gesture.h; sourceTree = ""; }; + AA7557D61595D4D800BBD41B /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_haptic.h; sourceTree = ""; }; + AA7557D71595D4D800BBD41B /* SDL_hints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hints.h; sourceTree = ""; }; + AA7557D91595D4D800BBD41B /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = ""; }; + AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = ""; }; + AA7557DB1595D4D800BBD41B /* SDL_keycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keycode.h; sourceTree = ""; }; + AA7557DC1595D4D800BBD41B /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_loadso.h; sourceTree = ""; }; + AA7557DD1595D4D800BBD41B /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_log.h; sourceTree = ""; }; + AA7557DE1595D4D800BBD41B /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_main.h; sourceTree = ""; }; + AA7557DF1595D4D800BBD41B /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = ""; }; + AA7557E01595D4D800BBD41B /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mutex.h; sourceTree = ""; }; + AA7557E11595D4D800BBD41B /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_name.h; sourceTree = ""; }; + AA7557E21595D4D800BBD41B /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengl.h; sourceTree = ""; }; + AA7557E31595D4D800BBD41B /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles.h; sourceTree = ""; }; + AA7557E41595D4D800BBD41B /* SDL_opengles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_opengles2.h; sourceTree = ""; }; + AA7557E51595D4D800BBD41B /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_pixels.h; sourceTree = ""; }; + AA7557E61595D4D800BBD41B /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = ""; }; + AA7557E71595D4D800BBD41B /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_power.h; sourceTree = ""; }; + AA7557E81595D4D800BBD41B /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_quit.h; sourceTree = ""; }; + AA7557E91595D4D800BBD41B /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rect.h; sourceTree = ""; }; + AA7557EA1595D4D800BBD41B /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_render.h; sourceTree = ""; }; + AA7557EB1595D4D800BBD41B /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_revision.h; sourceTree = ""; }; + AA7557EC1595D4D800BBD41B /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwops.h; sourceTree = ""; }; + AA7557ED1595D4D800BBD41B /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_scancode.h; sourceTree = ""; }; + AA7557EE1595D4D800BBD41B /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_shape.h; sourceTree = ""; }; + AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = ""; }; + AA7557F01595D4D800BBD41B /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_surface.h; sourceTree = ""; }; + AA7557F11595D4D800BBD41B /* SDL_system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_system.h; sourceTree = ""; }; + AA7557F21595D4D800BBD41B /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syswm.h; sourceTree = ""; }; + AA7557F31595D4D800BBD41B /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_thread.h; sourceTree = ""; }; + AA7557F41595D4D800BBD41B /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_timer.h; sourceTree = ""; }; + AA7557F51595D4D800BBD41B /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_touch.h; sourceTree = ""; }; + AA7557F61595D4D800BBD41B /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_types.h; sourceTree = ""; }; + AA7557F71595D4D800BBD41B /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_version.h; sourceTree = ""; }; + AA7557F81595D4D800BBD41B /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = ""; }; + AA7557F91595D4D800BBD41B /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = ""; }; + AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_x11messagebox.c; sourceTree = ""; }; + AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_messagebox.h; sourceTree = ""; }; + AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamessagebox.h; sourceTree = ""; }; + AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamessagebox.m; sourceTree = ""; }; + AADA5B8616CCAB3000107CF7 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_bits.h; sourceTree = ""; }; + BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_gamecontroller.c; sourceTree = ""; }; BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = ""; }; - BECDF66C0761BA81005FE872 /* SDL.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BECDF6B30761BA81005FE872 /* libSDL.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL.a; sourceTree = BUILT_PRODUCTS_DIR; }; - BECDF6BA0761BA81005FE872 /* libSDLmain.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDLmain.a; sourceTree = BUILT_PRODUCTS_DIR; }; + BECDF66C0761BA81005FE872 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BECDF6B30761BA81005FE872 /* libSDL2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL2.a; sourceTree = BUILT_PRODUCTS_DIR; }; BECDF6BE0761BA81005FE872 /* Standard DMG */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Standard DMG"; sourceTree = BUILT_PRODUCTS_DIR; }; - BECDF6C30761BA81005FE872 /* Developer Extras Package */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Developer Extras Package"; sourceTree = BUILT_PRODUCTS_DIR; }; - F51789D101769A2401D3D55B /* SDL_sysjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysjoystick.c; sourceTree = ""; }; + D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_cocoamousetap.h; sourceTree = ""; }; + D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_cocoamousetap.m; sourceTree = ""; }; + DB31407717554B71006C0E22 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; F59C70FF00D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = ""; }; F59C710000D5CB5801000001 /* Welcome.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Welcome.txt; sourceTree = ""; }; F59C710300D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = ""; }; F59C710500D5CB5801000001 /* SDL-devel.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "SDL-devel.info"; sourceTree = ""; }; F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = ""; }; F59C710C00D5D15801000001 /* install.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = install.sh; sourceTree = ""; }; - F5A2EF3900C6A39A01000001 /* BUGS */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS; path = ../../BUGS; sourceTree = SOURCE_ROOT; }; - F5A2EF3A00C6A3C201000001 /* README.MacOSX */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = README.MacOSX; path = ../../README.MacOSX; sourceTree = SOURCE_ROOT; }; + F5A2EF3900C6A39A01000001 /* BUGS.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = BUGS.txt; path = ../../BUGS.txt; sourceTree = SOURCE_ROOT; }; + F5A2EF3A00C6A3C201000001 /* README-macosx.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "README-macosx.txt"; path = "../../README-macosx.txt"; sourceTree = SOURCE_ROOT; }; F5F81AD400D706B101000001 /* Readme SDL Developer.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = "Readme SDL Developer.txt"; path = "pkg-support/Readme SDL Developer.txt"; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ @@ -535,6 +1077,7 @@ 007317A70858DECD00B2BC32 /* OpenGL.framework in Frameworks */, 00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */, 00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */, + 00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -548,434 +1091,529 @@ 007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */, 007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */, 007317AE0858DECD00B2BC32 /* OpenGL.framework in Frameworks */, - 007317AF0858DECD00B2BC32 /* QuickTime.framework in Frameworks */, 007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */, + DB31408B17554D37006C0E22 /* ForceFeedback.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BECDF6B80761BA81005FE872 /* Frameworks */ = { + DB31406B17554B71006C0E22 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 007317B00858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */, - 007317B10858DECD00B2BC32 /* AudioUnit.framework in Frameworks */, - 007317B20858DECD00B2BC32 /* Cocoa.framework in Frameworks */, - 007317B30858DECD00B2BC32 /* CoreAudio.framework in Frameworks */, - 007317B40858DECD00B2BC32 /* IOKit.framework in Frameworks */, - 007317B50858DECD00B2BC32 /* OpenGL.framework in Frameworks */, - 007317B60858DECD00B2BC32 /* QuickTime.framework in Frameworks */, - 007317C40858E15000B2BC32 /* Carbon.framework in Frameworks */, + DB31406C17554B71006C0E22 /* AudioToolbox.framework in Frameworks */, + DB31406D17554B71006C0E22 /* AudioUnit.framework in Frameworks */, + DB31406E17554B71006C0E22 /* Cocoa.framework in Frameworks */, + DB31406F17554B71006C0E22 /* CoreAudio.framework in Frameworks */, + DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */, + DB31407117554B71006C0E22 /* OpenGL.framework in Frameworks */, + DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */, + DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0014B7D809C0D808003A99D5 /* dga */ = { + 0153844A006D81B07F000001 /* Public Headers */ = { isa = PBXGroup; children = ( - 0014B7E809C0D8D2003A99D5 /* SDL_dgaevents_c.h */, - 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */, - 0014B7EA09C0D8D2003A99D5 /* SDL_dgamouse_c.h */, - 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */, - 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */, - 0014B7ED09C0D8D2003A99D5 /* SDL_dgavideo.h */, - ); - path = dga; + AA7557C71595D4D800BBD41B /* begin_code.h */, + AA7557C81595D4D800BBD41B /* close_code.h */, + AA7557F91595D4D800BBD41B /* SDL.h */, + AA7557C91595D4D800BBD41B /* SDL_assert.h */, + AA7557CA1595D4D800BBD41B /* SDL_atomic.h */, + AA7557CB1595D4D800BBD41B /* SDL_audio.h */, + AADA5B8616CCAB3000107CF7 /* SDL_bits.h */, + AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */, + AA7557CD1595D4D800BBD41B /* SDL_clipboard.h */, + AA7557CF1595D4D800BBD41B /* SDL_config.h */, + AA7557CE1595D4D800BBD41B /* SDL_config_macosx.h */, + AA7557D01595D4D800BBD41B /* SDL_copying.h */, + AA7557D11595D4D800BBD41B /* SDL_cpuinfo.h */, + AA7557D21595D4D800BBD41B /* SDL_endian.h */, + AA7557D31595D4D800BBD41B /* SDL_error.h */, + AA7557D41595D4D800BBD41B /* SDL_events.h */, + A77E6EB3167AB0A90010E40B /* SDL_gamecontroller.h */, + AA7557D51595D4D800BBD41B /* SDL_gesture.h */, + AA7557D61595D4D800BBD41B /* SDL_haptic.h */, + AA7557D71595D4D800BBD41B /* SDL_hints.h */, + AA7557D91595D4D800BBD41B /* SDL_joystick.h */, + AA7557DA1595D4D800BBD41B /* SDL_keyboard.h */, + AA7557DB1595D4D800BBD41B /* SDL_keycode.h */, + AA7557DC1595D4D800BBD41B /* SDL_loadso.h */, + AA7557DD1595D4D800BBD41B /* SDL_log.h */, + AA7557DE1595D4D800BBD41B /* SDL_main.h */, + AA9FF9591637CBF9000DF050 /* SDL_messagebox.h */, + AA7557DF1595D4D800BBD41B /* SDL_mouse.h */, + AA7557E01595D4D800BBD41B /* SDL_mutex.h */, + AA7557E11595D4D800BBD41B /* SDL_name.h */, + AA7557E21595D4D800BBD41B /* SDL_opengl.h */, + AA7557E31595D4D800BBD41B /* SDL_opengles.h */, + AA7557E41595D4D800BBD41B /* SDL_opengles2.h */, + AA7557E51595D4D800BBD41B /* SDL_pixels.h */, + AA7557E61595D4D800BBD41B /* SDL_platform.h */, + AA7557E71595D4D800BBD41B /* SDL_power.h */, + AA7557E81595D4D800BBD41B /* SDL_quit.h */, + AA7557E91595D4D800BBD41B /* SDL_rect.h */, + AA7557EA1595D4D800BBD41B /* SDL_render.h */, + AA7557EB1595D4D800BBD41B /* SDL_revision.h */, + AA7557EC1595D4D800BBD41B /* SDL_rwops.h */, + AA7557ED1595D4D800BBD41B /* SDL_scancode.h */, + AA7557EE1595D4D800BBD41B /* SDL_shape.h */, + AA7557EF1595D4D800BBD41B /* SDL_stdinc.h */, + AA7557F01595D4D800BBD41B /* SDL_surface.h */, + AA7557F11595D4D800BBD41B /* SDL_system.h */, + AA7557F21595D4D800BBD41B /* SDL_syswm.h */, + AA7557F31595D4D800BBD41B /* SDL_thread.h */, + AA7557F41595D4D800BBD41B /* SDL_timer.h */, + AA7557F51595D4D800BBD41B /* SDL_touch.h */, + AA7557F61595D4D800BBD41B /* SDL_types.h */, + AA7557F71595D4D800BBD41B /* SDL_version.h */, + AA7557F81595D4D800BBD41B /* SDL_video.h */, + ); + name = "Public Headers"; + path = ../../include; sourceTree = ""; }; - 0014B83109C0D91E003A99D5 /* x11 */ = { + 034768DDFF38A45A11DB9C8B /* Products */ = { isa = PBXGroup; children = ( - 0014B83709C0D977003A99D5 /* SDL_x11dga_c.h */, - 0014B83809C0D977003A99D5 /* SDL_x11dga.c */, - 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */, - 0014B83A09C0D977003A99D5 /* SDL_x11dyn.h */, - 0014B83B09C0D977003A99D5 /* SDL_x11events_c.h */, - 0014B83C09C0D977003A99D5 /* SDL_x11events.c */, - 0014B83D09C0D977003A99D5 /* SDL_x11gamma_c.h */, - 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */, - 0014B83F09C0D977003A99D5 /* SDL_x11gl_c.h */, - 0014B84009C0D977003A99D5 /* SDL_x11gl.c */, - 0014B84109C0D977003A99D5 /* SDL_x11image_c.h */, - 0014B84209C0D977003A99D5 /* SDL_x11image.c */, - 0014B84309C0D977003A99D5 /* SDL_x11modes_c.h */, - 0014B84409C0D977003A99D5 /* SDL_x11modes.c */, - 0014B84509C0D977003A99D5 /* SDL_x11mouse_c.h */, - 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */, - 0014B84709C0D977003A99D5 /* SDL_x11sym.h */, - 0014B84809C0D977003A99D5 /* SDL_x11video.c */, - 0014B84909C0D977003A99D5 /* SDL_x11video.h */, - 0014B84A09C0D977003A99D5 /* SDL_x11wm_c.h */, - 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */, - 0014B84C09C0D977003A99D5 /* SDL_x11yuv_c.h */, - 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */, + 089C1665FE841158C02AAC07 /* Resources */, + BECDF66C0761BA81005FE872 /* SDL2.framework */, + BECDF6B30761BA81005FE872 /* libSDL2.a */, + BECDF6BE0761BA81005FE872 /* Standard DMG */, + DB31407717554B71006C0E22 /* libSDL2.dylib */, ); - path = x11; + name = Products; sourceTree = ""; }; - 0014B87D09C0D98A003A99D5 /* Xext */ = { + 041B2C9712FA0D680087D585 /* render */ = { isa = PBXGroup; children = ( - 0014B87E09C0D9BD003A99D5 /* Xxf86dga */, - 0014B87F09C0D9D1003A99D5 /* Xxf86vm */, - 0014B88309C0DA1A003A99D5 /* Xv */, - 0014B88209C0DA0F003A99D5 /* Xinerama */, - 0014B88109C0DA04003A99D5 /* XME */, - ); - path = Xext; - sourceTree = ""; + 041B2C9A12FA0D680087D585 /* opengl */, + 041B2CA012FA0D680087D585 /* software */, + 04409B8D12FA97ED00FB9AA8 /* mmx.h */, + 041B2C9E12FA0D680087D585 /* SDL_render.c */, + 041B2C9F12FA0D680087D585 /* SDL_sysrender.h */, + 04409B8E12FA97ED00FB9AA8 /* SDL_yuv_mmx.c */, + 04409B8F12FA97ED00FB9AA8 /* SDL_yuv_sw_c.h */, + 04409B9012FA97ED00FB9AA8 /* SDL_yuv_sw.c */, + ); + name = render; + path = ../../src/render; + sourceTree = SOURCE_ROOT; }; - 0014B87E09C0D9BD003A99D5 /* Xxf86dga */ = { + 041B2C9A12FA0D680087D585 /* opengl */ = { isa = PBXGroup; children = ( - 0014B89009C0DA94003A99D5 /* XF86DGA.c */, - 0014B89109C0DA94003A99D5 /* XF86DGA2.c */, + 04043BBA12FEB1BE0076DB1F /* SDL_glfuncs.h */, + 0442EC1712FE1BBA004C9285 /* SDL_render_gl.c */, + 0435673C1303160F00BA5428 /* SDL_shaders_gl.c */, + 0435673D1303160F00BA5428 /* SDL_shaders_gl.h */, ); - path = Xxf86dga; + path = opengl; sourceTree = ""; }; - 0014B87F09C0D9D1003A99D5 /* Xxf86vm */ = { + 041B2CA012FA0D680087D585 /* software */ = { isa = PBXGroup; children = ( - 0014B89609C0DAA1003A99D5 /* XF86VMode.c */, - ); - path = Xxf86vm; + 04F7803D12FB74A200FC43C0 /* SDL_blendfillrect.c */, + 04F7803E12FB74A200FC43C0 /* SDL_blendfillrect.h */, + 04F7803F12FB74A200FC43C0 /* SDL_blendline.c */, + 04F7804012FB74A200FC43C0 /* SDL_blendline.h */, + 04F7804112FB74A200FC43C0 /* SDL_blendpoint.c */, + 04F7804212FB74A200FC43C0 /* SDL_blendpoint.h */, + 04F7804312FB74A200FC43C0 /* SDL_draw.h */, + 04F7804412FB74A200FC43C0 /* SDL_drawline.c */, + 04F7804512FB74A200FC43C0 /* SDL_drawline.h */, + 04F7804612FB74A200FC43C0 /* SDL_drawpoint.c */, + 04F7804712FB74A200FC43C0 /* SDL_drawpoint.h */, + 0442EC1B12FE1BCB004C9285 /* SDL_render_sw.c */, + 0442EC1A12FE1BCB004C9285 /* SDL_render_sw_c.h */, + AA628AC8159367B7005138DD /* SDL_rotate.c */, + AA628AC9159367B7005138DD /* SDL_rotate.h */, + ); + path = software; sourceTree = ""; }; - 0014B88109C0DA04003A99D5 /* XME */ = { + 04BDFD7312E6671700899322 /* atomic */ = { isa = PBXGroup; children = ( - 0014B8A209C0DAC4003A99D5 /* xme.c */, + 04BDFD7412E6671700899322 /* SDL_atomic.c */, + 04BDFD7512E6671700899322 /* SDL_spinlock.c */, ); - path = XME; - sourceTree = ""; + name = atomic; + path = ../../src/atomic; + sourceTree = SOURCE_ROOT; }; - 0014B88209C0DA0F003A99D5 /* Xinerama */ = { + 04BDFD7612E6671700899322 /* audio */ = { isa = PBXGroup; children = ( - 0014B89F09C0DAB9003A99D5 /* Xinerama.c */, + 04BDFD8712E6671700899322 /* disk */, + 04BDFD9312E6671700899322 /* dummy */, + 04BDFD9F12E6671700899322 /* coreaudio */, + 04BDFDB412E6671700899322 /* SDL_audio.c */, + 04BDFDB512E6671700899322 /* SDL_audio_c.h */, + 04BDFDB612E6671700899322 /* SDL_audiocvt.c */, + 04BDFDB712E6671700899322 /* SDL_audiodev.c */, + 04BDFDB812E6671700899322 /* SDL_audiodev_c.h */, + 04BDFDB912E6671700899322 /* SDL_audiomem.h */, + 04BDFDBA12E6671700899322 /* SDL_audiotypecvt.c */, + 04BDFDBB12E6671700899322 /* SDL_mixer.c */, + 04BDFDC212E6671700899322 /* SDL_sysaudio.h */, + 04BDFDC312E6671700899322 /* SDL_wave.c */, + 04BDFDC412E6671700899322 /* SDL_wave.h */, ); - path = Xinerama; - sourceTree = ""; + name = audio; + path = ../../src/audio; + sourceTree = SOURCE_ROOT; }; - 0014B88309C0DA1A003A99D5 /* Xv */ = { + 04BDFD8712E6671700899322 /* disk */ = { isa = PBXGroup; children = ( - 0014B89909C0DAAE003A99D5 /* Xv.c */, - 0014B89A09C0DAAE003A99D5 /* Xvlibint.h */, + 04BDFD8812E6671700899322 /* SDL_diskaudio.c */, + 04BDFD8912E6671700899322 /* SDL_diskaudio.h */, ); - path = Xv; + path = disk; sourceTree = ""; }; - 00162D4C09BD20DA0037C8D0 /* pthread */ = { + 04BDFD9312E6671700899322 /* dummy */ = { isa = PBXGroup; children = ( - 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */, - 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */, - 00162D4F09BD20DA0037C8D0 /* SDL_sysmutex_c.h */, - 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */, - 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */, - 00162D5209BD20DA0037C8D0 /* SDL_systhread_c.h */, + 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */, + 04BDFD9512E6671700899322 /* SDL_dummyaudio.h */, ); - path = pthread; + path = dummy; sourceTree = ""; }; - 00162D5F09BD21010037C8D0 /* unix */ = { + 04BDFD9F12E6671700899322 /* coreaudio */ = { isa = PBXGroup; children = ( - 00162D6009BD21010037C8D0 /* SDL_systimer.c */, + 04BDFDA012E6671700899322 /* SDL_coreaudio.c */, + 04BDFDA112E6671700899322 /* SDL_coreaudio.h */, ); - path = unix; + path = coreaudio; sourceTree = ""; }; - 00162D6309BD214E0037C8D0 /* stdlib */ = { + 04BDFDD312E6671700899322 /* cpuinfo */ = { isa = PBXGroup; children = ( - 00162D6509BD214F0037C8D0 /* SDL_getenv.c */, - 002F328509CA049100EBEB88 /* SDL_iconv.c */, - 00162D6609BD214F0037C8D0 /* SDL_malloc.c */, - 00162D6709BD214F0037C8D0 /* SDL_qsort.c */, - 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */, - 00162D6909BD214F0037C8D0 /* SDL_string.c */, + 04BDFDD412E6671700899322 /* SDL_cpuinfo.c */, ); - name = stdlib; - path = ../../src/stdlib; + name = cpuinfo; + path = ../../src/cpuinfo; sourceTree = SOURCE_ROOT; }; - 00162D7509BD217B0037C8D0 /* loadso */ = { + 04BDFDD512E6671700899322 /* events */ = { isa = PBXGroup; children = ( - 046B91E80A11B53500FB151C /* dlopen */, - 00D55F250A11163D0030ED2A /* macosx */, + 04BDFDD612E6671700899322 /* blank_cursor.h */, + 04BDFDD712E6671700899322 /* default_cursor.h */, + 04BDFDD812E6671700899322 /* scancodes_darwin.h */, + 04BDFDD912E6671700899322 /* scancodes_linux.h */, + 04BDFDDB12E6671700899322 /* scancodes_xfree86.h */, + 04BDFDDC12E6671700899322 /* SDL_clipboardevents.c */, + 04BDFDDD12E6671700899322 /* SDL_clipboardevents_c.h */, + 566CDE8D148F0AC200C5A9BB /* SDL_dropevents_c.h */, + 566CDE8E148F0AC200C5A9BB /* SDL_dropevents.c */, + 04BDFDDE12E6671700899322 /* SDL_events.c */, + 04BDFDDF12E6671700899322 /* SDL_events_c.h */, + 04BDFDE012E6671700899322 /* SDL_gesture.c */, + 04BDFDE112E6671700899322 /* SDL_gesture_c.h */, + 04BDFDE212E6671700899322 /* SDL_keyboard.c */, + 04BDFDE312E6671700899322 /* SDL_keyboard_c.h */, + 04BDFDE412E6671700899322 /* SDL_mouse.c */, + 04BDFDE512E6671700899322 /* SDL_mouse_c.h */, + 04BDFDE612E6671700899322 /* SDL_quit.c */, + 04BDFDE712E6671700899322 /* SDL_sysevents.h */, + 04BDFDE812E6671700899322 /* SDL_touch.c */, + 04BDFDE912E6671700899322 /* SDL_touch_c.h */, + 04BDFDEA12E6671700899322 /* SDL_windowevents.c */, + 04BDFDEB12E6671700899322 /* SDL_windowevents_c.h */, ); - name = loadso; - path = ../../src/loadso; + name = events; + path = ../../src/events; sourceTree = SOURCE_ROOT; }; - 00162F3209BE27FB0037C8D0 /* dummy */ = { + 04BDFDEC12E6671700899322 /* file */ = { isa = PBXGroup; children = ( - 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */, - 00162F3509BE27FB0037C8D0 /* SDL_nullevents_c.h */, - 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */, - 00162F3709BE27FB0037C8D0 /* SDL_nullmouse_c.h */, - 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */, - 00162F3909BE27FB0037C8D0 /* SDL_nullvideo.h */, + 04BDFDED12E6671700899322 /* cocoa */, + 04BDFDF012E6671700899322 /* SDL_rwops.c */, ); - path = dummy; - sourceTree = ""; + name = file; + path = ../../src/file; + sourceTree = SOURCE_ROOT; }; - 002F32D209CA0BE700EBEB88 /* disk */ = { + 04BDFDED12E6671700899322 /* cocoa */ = { isa = PBXGroup; children = ( - 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */, - 002F32D509CA0BE700EBEB88 /* SDL_diskaudio.h */, + 04BDFDEE12E6671700899322 /* SDL_rwopsbundlesupport.h */, + 04BDFDEF12E6671700899322 /* SDL_rwopsbundlesupport.m */, ); - path = disk; + path = cocoa; sourceTree = ""; }; - 002F32E009CA0BF600EBEB88 /* dummy */ = { + 04BDFDF112E6671700899322 /* haptic */ = { isa = PBXGroup; children = ( - 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */, - 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */, + 04BDFDF212E6671700899322 /* darwin */, + 04BDFDFA12E6671700899322 /* SDL_haptic.c */, + 04BDFDFB12E6671700899322 /* SDL_haptic_c.h */, + 04BDFDFC12E6671700899322 /* SDL_syshaptic.h */, ); - path = dummy; - sourceTree = ""; + name = haptic; + path = ../../src/haptic; + sourceTree = SOURCE_ROOT; }; - 00D55F250A11163D0030ED2A /* macosx */ = { + 04BDFDF212E6671700899322 /* darwin */ = { isa = PBXGroup; children = ( - 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */, + 04BDFDF312E6671700899322 /* SDL_syshaptic.c */, ); - path = macosx; + path = darwin; sourceTree = ""; }; - 0153832C006D78D67F000001 /* audio */ = { + 04BDFDFF12E6671700899322 /* joystick */ = { isa = PBXGroup; children = ( - BECDF5D20761B759005FE872 /* macosx */, - 002F32D209CA0BE700EBEB88 /* disk */, - 002F32E009CA0BF600EBEB88 /* dummy */, - 01538330006D78D67F000001 /* SDL_audio.c */, - 01538331006D78D67F000001 /* SDL_audiocvt.c */, - 01538332006D78D67F000001 /* SDL_audiodev.c */, - 01538334006D78D67F000001 /* SDL_mixer.c */, - 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */, - 00B7E620097F2D9E00826121 /* SDL_mixer_MMX.h */, - 01538335006D78D67F000001 /* SDL_wave.c */, + 04BDFE0612E6671700899322 /* darwin */, + 04BDFE1612E6671700899322 /* SDL_joystick.c */, + 04BDFE1712E6671700899322 /* SDL_joystick_c.h */, + BBFC088A164C6514003E6A99 /* SDL_gamecontroller.c */, + 04BDFE1812E6671700899322 /* SDL_sysjoystick.h */, ); - name = audio; - path = ../../src/audio; + name = joystick; + path = ../../src/joystick; sourceTree = SOURCE_ROOT; }; - 01538367006D79147F000001 /* events */ = { + 04BDFE0612E6671700899322 /* darwin */ = { isa = PBXGroup; children = ( - 01538368006D79147F000001 /* SDL_active.c */, - 01538369006D79147F000001 /* SDL_events.c */, - 0153836A006D79147F000001 /* SDL_expose.c */, - 0153836B006D79147F000001 /* SDL_keyboard.c */, - 0153836C006D79147F000001 /* SDL_mouse.c */, - 0153836D006D79147F000001 /* SDL_quit.c */, - 0153836E006D79147F000001 /* SDL_resize.c */, + 04BDFE0712E6671700899322 /* SDL_sysjoystick.c */, + 04BDFE0812E6671700899322 /* SDL_sysjoystick_c.h */, ); - name = events; - path = ../../src/events; - sourceTree = SOURCE_ROOT; + path = darwin; + sourceTree = ""; }; - 01538376006D79307F000001 /* file */ = { + 04BDFE2F12E6671700899322 /* loadso */ = { isa = PBXGroup; children = ( - 01538377006D79307F000001 /* SDL_rwops.c */, + 04BDFE3212E6671700899322 /* dlopen */, ); - name = file; - path = ../../src/file; + name = loadso; + path = ../../src/loadso; sourceTree = SOURCE_ROOT; }; - 01538379006D79737F000001 /* thread */ = { + 04BDFE3212E6671700899322 /* dlopen */ = { isa = PBXGroup; children = ( - 00162D4C09BD20DA0037C8D0 /* pthread */, - 01538445006D7EC67F000001 /* SDL_thread.c */, + 04BDFE3312E6671700899322 /* SDL_sysloadso.c */, ); - name = thread; - path = ../../src/thread; - sourceTree = SOURCE_ROOT; + path = dlopen; + sourceTree = ""; }; - 01538391006D79BC7F000001 /* timer */ = { + 04BDFE4512E6671700899322 /* power */ = { isa = PBXGroup; children = ( - 00162D5F09BD21010037C8D0 /* unix */, - 015383A0006D79BC7F000001 /* SDL_timer.c */, + 04BDFE4A12E6671700899322 /* macosx */, + 04BDFE4E12E6671700899322 /* SDL_power.c */, ); - name = timer; - path = ../../src/timer; + name = power; + path = ../../src/power; sourceTree = SOURCE_ROOT; }; - 015383BE006D7A567F000001 /* video */ = { + 04BDFE4A12E6671700899322 /* macosx */ = { isa = PBXGroup; children = ( - 0FCDF5B50083FCE77F000001 /* quartz */, - 015383C1006D7A567F000001 /* maccommon */, - 015383CE006D7A567F000001 /* macdsp */, - 015383D3006D7A567F000001 /* macrom */, - 00162F3209BE27FB0037C8D0 /* dummy */, - 0014B83109C0D91E003A99D5 /* x11 */, - 0014B7D809C0D808003A99D5 /* dga */, - 0014B87D09C0D98A003A99D5 /* Xext */, - 015383D8006D7A567F000001 /* SDL_blit.c */, - 015383DA006D7A567F000001 /* SDL_blit_0.c */, - 015383DB006D7A567F000001 /* SDL_blit_1.c */, - 015383DC006D7A567F000001 /* SDL_blit_A.c */, - 015383DE006D7A567F000001 /* SDL_blit_N.c */, - 015383DF006D7A567F000001 /* SDL_bmp.c */, - 015383E0006D7A567F000001 /* SDL_cursor.c */, - 015383E2006D7A567F000001 /* SDL_gamma.c */, - 015383E6006D7A567F000001 /* SDL_pixels.c */, - 015383E8006D7A567F000001 /* SDL_RLEaccel.c */, - 015383EA006D7A567F000001 /* SDL_stretch.c */, - 015383EC006D7A567F000001 /* SDL_surface.c */, - 015383EE006D7A567F000001 /* SDL_video.c */, - 015383EF006D7A567F000001 /* SDL_yuv.c */, - 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */, - 015383F1006D7A567F000001 /* SDL_yuv_sw.c */, + 04BDFE4B12E6671700899322 /* SDL_syspower.c */, ); - name = video; - path = ../../src/video; - sourceTree = SOURCE_ROOT; + path = macosx; + sourceTree = ""; }; - 015383C1006D7A567F000001 /* maccommon */ = { + 04BDFE5D12E6671700899322 /* stdlib */ = { isa = PBXGroup; children = ( - 015383C5006D7A567F000001 /* SDL_macevents.c */, - 015383C7006D7A567F000001 /* SDL_macgl.c */, - 015383CA006D7A567F000001 /* SDL_macmouse.c */, - 015383CC006D7A567F000001 /* SDL_macwm.c */, + 04BDFE5E12E6671700899322 /* SDL_getenv.c */, + 04BDFE5F12E6671700899322 /* SDL_iconv.c */, + 04BDFE6012E6671700899322 /* SDL_malloc.c */, + 04BDFE6112E6671700899322 /* SDL_qsort.c */, + 04BDFE6212E6671700899322 /* SDL_stdlib.c */, + 04BDFE6312E6671700899322 /* SDL_string.c */, ); - path = maccommon; - sourceTree = ""; + name = stdlib; + path = ../../src/stdlib; + sourceTree = SOURCE_ROOT; }; - 015383CE006D7A567F000001 /* macdsp */ = { + 04BDFE6412E6671800899322 /* thread */ = { isa = PBXGroup; children = ( - 015383D1006D7A567F000001 /* SDL_dspvideo.c */, - 015383D2006D7A567F000001 /* SDL_dspvideo.h */, + 04BDFE7D12E6671800899322 /* pthread */, + 04BDFE8B12E6671800899322 /* SDL_systhread.h */, + 04BDFE8C12E6671800899322 /* SDL_thread.c */, + 04BDFE8D12E6671800899322 /* SDL_thread_c.h */, ); - path = macdsp; - sourceTree = ""; + name = thread; + path = ../../src/thread; + sourceTree = SOURCE_ROOT; }; - 015383D3006D7A567F000001 /* macrom */ = { + 04BDFE7D12E6671800899322 /* pthread */ = { isa = PBXGroup; children = ( - 015383D6006D7A567F000001 /* SDL_romvideo.c */, + 04BDFE7E12E6671800899322 /* SDL_syscond.c */, + 04BDFE7F12E6671800899322 /* SDL_sysmutex.c */, + 04BDFE8012E6671800899322 /* SDL_sysmutex_c.h */, + 04BDFE8112E6671800899322 /* SDL_syssem.c */, + 04BDFE8212E6671800899322 /* SDL_systhread.c */, + 04BDFE8312E6671800899322 /* SDL_systhread_c.h */, + AA0F8490178D5ECC00823F9D /* SDL_systls.c */, ); - path = macrom; + path = pthread; sourceTree = ""; }; - 0153844A006D81B07F000001 /* Public Headers */ = { + 04BDFE9512E6671800899322 /* timer */ = { isa = PBXGroup; children = ( - 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */, - 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */, - 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */, - 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */, - 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */, - 00162D3709BD1FA90037C8D0 /* SDL_config.h */, - 00162D3809BD1FA90037C8D0 /* SDL_platform.h */, - 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */, - 0C5AF5E501191D2B7F000001 /* begin_code.h */, - 0C5AF5E601191D2B7F000001 /* close_code.h */, - 0C5AF5E701191D2B7F000001 /* SDL_active.h */, - 0C5AF5E801191D2B7F000001 /* SDL_audio.h */, - 0C5AF5E901191D2B7F000001 /* SDL_byteorder.h */, - 0C5AF5EA01191D2B7F000001 /* SDL_cdrom.h */, - 0C5AF5EB01191D2B7F000001 /* SDL_copying.h */, - B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */, - 0C5AF5EC01191D2B7F000001 /* SDL_endian.h */, - 0C5AF5ED01191D2B7F000001 /* SDL_error.h */, - 0C5AF5EE01191D2B7F000001 /* SDL_events.h */, - 0C5AF5EF01191D2B7F000001 /* SDL_getenv.h */, - 0C5AF5F001191D2B7F000001 /* SDL_joystick.h */, - 0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */, - 0C5AF5F201191D2B7F000001 /* SDL_keysym.h */, - B29A290D04E5B28700A80002 /* SDL_loadso.h */, - 0C5AF5F301191D2B7F000001 /* SDL_main.h */, - 0C5AF5F401191D2B7F000001 /* SDL_mouse.h */, - 0C5AF5F501191D2B7F000001 /* SDL_mutex.h */, - B2CF8DC705C4450500E5DC7F /* SDL_name.h */, - 0C5AF5F601191D2B7F000001 /* SDL_opengl.h */, - 0C5AF5F701191D2B7F000001 /* SDL_quit.h */, - 0C5AF5F801191D2B7F000001 /* SDL_rwops.h */, - 0C5AF5F901191D2B7F000001 /* SDL_syswm.h */, - 0C5AF5FA01191D2B7F000001 /* SDL_thread.h */, - 0C5AF5FB01191D2B7F000001 /* SDL_timer.h */, - 0C5AF5FC01191D2B7F000001 /* SDL_types.h */, - 0C5AF5FD01191D2B7F000001 /* SDL_version.h */, - 0C5AF5FE01191D2B7F000001 /* SDL_video.h */, - 0C5AF5FF01191D2B7F000001 /* SDL.h */, + 04BDFEA112E6671800899322 /* unix */, + 04BDFE9F12E6671800899322 /* SDL_timer.c */, + 04BDFEA012E6671800899322 /* SDL_timer_c.h */, ); - name = "Public Headers"; - sourceTree = ""; + name = timer; + path = ../../src/timer; + sourceTree = SOURCE_ROOT; }; - 034768DDFF38A45A11DB9C8B /* Products */ = { + 04BDFEA112E6671800899322 /* unix */ = { isa = PBXGroup; children = ( - 089C1665FE841158C02AAC07 /* Resources */, - BECDF66C0761BA81005FE872 /* SDL.framework */, - BECDF6B30761BA81005FE872 /* libSDL.a */, - BECDF6BA0761BA81005FE872 /* libSDLmain.a */, - BECDF6BE0761BA81005FE872 /* Standard DMG */, - BECDF6C30761BA81005FE872 /* Developer Extras Package */, + 04BDFEA212E6671800899322 /* SDL_systimer.c */, ); - name = Products; + path = unix; sourceTree = ""; }; - 046B91E80A11B53500FB151C /* dlopen */ = { + 04BDFEA712E6671800899322 /* video */ = { isa = PBXGroup; children = ( - 046B91E90A11B53500FB151C /* SDL_sysloadso.c */, + 04BDFEC112E6671800899322 /* cocoa */, + 04BDFEE712E6671800899322 /* dummy */, + 04BDFFB712E6671800899322 /* x11 */, + 04BDFF4E12E6671800899322 /* SDL_blit.c */, + 04BDFF4F12E6671800899322 /* SDL_blit.h */, + 04BDFF5012E6671800899322 /* SDL_blit_0.c */, + 04BDFF5112E6671800899322 /* SDL_blit_1.c */, + 04BDFF5212E6671800899322 /* SDL_blit_A.c */, + 04BDFF5312E6671800899322 /* SDL_blit_auto.c */, + 04BDFF5412E6671800899322 /* SDL_blit_auto.h */, + 04BDFF5512E6671800899322 /* SDL_blit_copy.c */, + 04BDFF5612E6671800899322 /* SDL_blit_copy.h */, + 04BDFF5712E6671800899322 /* SDL_blit_N.c */, + 04BDFF5812E6671800899322 /* SDL_blit_slow.c */, + 04BDFF5912E6671800899322 /* SDL_blit_slow.h */, + 04BDFF5A12E6671800899322 /* SDL_bmp.c */, + 04BDFF5B12E6671800899322 /* SDL_clipboard.c */, + 04BDFF6012E6671800899322 /* SDL_fillrect.c */, + 04BDFF6512E6671800899322 /* SDL_pixels.c */, + 04BDFF6612E6671800899322 /* SDL_pixels_c.h */, + 04BDFF6712E6671800899322 /* SDL_rect.c */, + 04BDFF6F12E6671800899322 /* SDL_RLEaccel.c */, + 04BDFF7012E6671800899322 /* SDL_RLEaccel_c.h */, + 04BDFF7112E6671800899322 /* SDL_shape.c */, + 04BDFF7212E6671800899322 /* SDL_shape_internals.h */, + 04BDFF7312E6671800899322 /* SDL_stretch.c */, + 04BDFF7412E6671800899322 /* SDL_surface.c */, + 04BDFF7512E6671800899322 /* SDL_sysvideo.h */, + 04BDFF7612E6671800899322 /* SDL_video.c */, ); - path = dlopen; - sourceTree = ""; + name = video; + path = ../../src/video; + sourceTree = SOURCE_ROOT; }; - 083E4892006D86FF7F000001 /* cdrom */ = { + 04BDFEC112E6671800899322 /* cocoa */ = { isa = PBXGroup; children = ( - B2A23A420415799100A80002 /* macosx */, - 083E4893006D86FF7F000001 /* dummy */, - 083E4895006D86FF7F000001 /* SDL_cdrom.c */, - ); - name = cdrom; - path = ../../src/cdrom; - sourceTree = SOURCE_ROOT; + 04BDFEC212E6671800899322 /* SDL_cocoaclipboard.h */, + 04BDFEC312E6671800899322 /* SDL_cocoaclipboard.m */, + 04BDFEC412E6671800899322 /* SDL_cocoaevents.h */, + 04BDFEC512E6671800899322 /* SDL_cocoaevents.m */, + 04BDFEC612E6671800899322 /* SDL_cocoakeyboard.h */, + 04BDFEC712E6671800899322 /* SDL_cocoakeyboard.m */, + AABCC38B164063D200AB8930 /* SDL_cocoamessagebox.h */, + AABCC38C164063D200AB8930 /* SDL_cocoamessagebox.m */, + 04BDFEC812E6671800899322 /* SDL_cocoamodes.h */, + 04BDFEC912E6671800899322 /* SDL_cocoamodes.m */, + 04BDFECA12E6671800899322 /* SDL_cocoamouse.h */, + 04BDFECB12E6671800899322 /* SDL_cocoamouse.m */, + D55A1B7F179F262300625D7C /* SDL_cocoamousetap.h */, + D55A1B80179F262300625D7C /* SDL_cocoamousetap.m */, + 04BDFECC12E6671800899322 /* SDL_cocoaopengl.h */, + 04BDFECD12E6671800899322 /* SDL_cocoaopengl.m */, + 04BDFECE12E6671800899322 /* SDL_cocoashape.h */, + 04BDFECF12E6671800899322 /* SDL_cocoashape.m */, + 04BDFED012E6671800899322 /* SDL_cocoavideo.h */, + 04BDFED112E6671800899322 /* SDL_cocoavideo.m */, + 04BDFED212E6671800899322 /* SDL_cocoawindow.h */, + 04BDFED312E6671800899322 /* SDL_cocoawindow.m */, + ); + path = cocoa; + sourceTree = ""; }; - 083E4893006D86FF7F000001 /* dummy */ = { + 04BDFEE712E6671800899322 /* dummy */ = { isa = PBXGroup; children = ( - 083E4894006D86FF7F000001 /* SDL_syscdrom.c */, + 04BDFEE812E6671800899322 /* SDL_nullevents.c */, + 04BDFEE912E6671800899322 /* SDL_nullevents_c.h */, + 04F7803712FB748500FC43C0 /* SDL_nullframebuffer_c.h */, + 04F7803812FB748500FC43C0 /* SDL_nullframebuffer.c */, + 04BDFEEC12E6671800899322 /* SDL_nullvideo.c */, + 04BDFEED12E6671800899322 /* SDL_nullvideo.h */, ); path = dummy; sourceTree = ""; }; - 083E489A006D88D97F000001 /* joystick */ = { + 04BDFFB712E6671800899322 /* x11 */ = { isa = PBXGroup; children = ( - F51789D001769A2401D3D55B /* darwin */, - 083E489D006D88D97F000001 /* SDL_joystick.c */, + 04BDFFB812E6671800899322 /* imKStoUCS.c */, + 04BDFFB912E6671800899322 /* imKStoUCS.h */, + 04BDFFBA12E6671800899322 /* SDL_x11clipboard.c */, + 04BDFFBB12E6671800899322 /* SDL_x11clipboard.h */, + 04BDFFBC12E6671800899322 /* SDL_x11dyn.c */, + 04BDFFBD12E6671800899322 /* SDL_x11dyn.h */, + 04BDFFBE12E6671800899322 /* SDL_x11events.c */, + 04BDFFBF12E6671800899322 /* SDL_x11events.h */, + 0442EC5812FE1C60004C9285 /* SDL_x11framebuffer.c */, + 0442EC5912FE1C60004C9285 /* SDL_x11framebuffer.h */, + 04BDFFC212E6671800899322 /* SDL_x11keyboard.c */, + 04BDFFC312E6671800899322 /* SDL_x11keyboard.h */, + AA9E4092163BE51E007A2AD0 /* SDL_x11messagebox.c */, + 04BDFFC412E6671800899322 /* SDL_x11modes.c */, + 04BDFFC512E6671800899322 /* SDL_x11modes.h */, + 04BDFFC612E6671800899322 /* SDL_x11mouse.c */, + 04BDFFC712E6671800899322 /* SDL_x11mouse.h */, + 04BDFFC812E6671800899322 /* SDL_x11opengl.c */, + 04BDFFC912E6671800899322 /* SDL_x11opengl.h */, + 04BDFFCA12E6671800899322 /* SDL_x11opengles.c */, + 04BDFFCB12E6671800899322 /* SDL_x11opengles.h */, + 04BDFFCE12E6671800899322 /* SDL_x11shape.c */, + 04BDFFCF12E6671800899322 /* SDL_x11shape.h */, + 04BDFFD012E6671800899322 /* SDL_x11sym.h */, + 04BDFFD112E6671800899322 /* SDL_x11touch.c */, + 04BDFFD212E6671800899322 /* SDL_x11touch.h */, + 04BDFFD312E6671800899322 /* SDL_x11video.c */, + 04BDFFD412E6671800899322 /* SDL_x11video.h */, + 04BDFFD512E6671800899322 /* SDL_x11window.c */, + 04BDFFD612E6671800899322 /* SDL_x11window.h */, + AA628ACF159367F2005138DD /* SDL_x11xinput2.c */, + AA628AD0159367F2005138DD /* SDL_x11xinput2.h */, ); - name = joystick; - path = ../../src/joystick; - sourceTree = SOURCE_ROOT; + path = x11; + sourceTree = ""; }; 0867D691FE84028FC02AAC07 /* SDLFramework */ = { isa = PBXGroup; children = ( - F5A2EF3900C6A39A01000001 /* BUGS */, - F5A2EF3A00C6A3C201000001 /* README.MacOSX */, + F5A2EF3900C6A39A01000001 /* BUGS.txt */, + F5A2EF3A00C6A3C201000001 /* README-macosx.txt */, F59C70FC00D5CB5801000001 /* pkg-support */, - F5B2A58400C5D39001000001 /* Main */, 0153844A006D81B07F000001 /* Public Headers */, 08FB77ACFE841707C02AAC07 /* Library Source */, 034768DDFF38A45A11DB9C8B /* Products */, @@ -983,8 +1621,11 @@ BEC562FE0761C0E800A33029 /* Linked Frameworks */, ); comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n"; + indentWidth = 4; name = SDLFramework; sourceTree = ""; + tabWidth = 4; + usesTabs = 0; }; 089C1665FE841158C02AAC07 /* Resources */ = { isa = PBXGroup; @@ -996,67 +1637,31 @@ 08FB77ACFE841707C02AAC07 /* Library Source */ = { isa = PBXGroup; children = ( - 0153832C006D78D67F000001 /* audio */, - 083E4892006D86FF7F000001 /* cdrom */, - B24DA50105A88D52006B9F1C /* cpuinfo */, - 01538367006D79147F000001 /* events */, - 01538376006D79307F000001 /* file */, - 083E489A006D88D97F000001 /* joystick */, - 00162D7509BD217B0037C8D0 /* loadso */, - 00162D6309BD214E0037C8D0 /* stdlib */, - 01538379006D79737F000001 /* thread */, - 01538391006D79BC7F000001 /* timer */, - 015383BE006D7A567F000001 /* video */, - 01538438006D7D947F000001 /* SDL_error.c */, - 01538439006D7D947F000001 /* SDL_fatal.c */, - 0153843C006D7D947F000001 /* SDL.c */, + 04BDFD7312E6671700899322 /* atomic */, + 04BDFD7612E6671700899322 /* audio */, + 04BDFDD312E6671700899322 /* cpuinfo */, + 04BDFDD512E6671700899322 /* events */, + 04BDFDEC12E6671700899322 /* file */, + 04BDFDF112E6671700899322 /* haptic */, + 04BDFDFF12E6671700899322 /* joystick */, + 04BDFE2F12E6671700899322 /* loadso */, + 04BDFE4512E6671700899322 /* power */, + 041B2C9712FA0D680087D585 /* render */, + 04BDFE5D12E6671700899322 /* stdlib */, + 04BDFE6412E6671800899322 /* thread */, + 04BDFE9512E6671800899322 /* timer */, + 04BDFEA712E6671800899322 /* video */, + 04BDFE5512E6671700899322 /* SDL_assert_c.h */, + 04BDFE5612E6671700899322 /* SDL_assert.c */, + 04BDFE5812E6671700899322 /* SDL_error_c.h */, + 04BDFE5912E6671700899322 /* SDL_error.c */, + 0442EC5E12FE1C75004C9285 /* SDL_hints.c */, + 04BAC0C71300C2160055DE28 /* SDL_log.c */, + 04BDFE5C12E6671700899322 /* SDL.c */, ); name = "Library Source"; sourceTree = ""; }; - 0FCDF5B50083FCE77F000001 /* quartz */ = { - isa = PBXGroup; - children = ( - 00D0D02210675823004B05EF /* SDL_QuartzWM.h */, - B24DA4D605A88AD0006B9F1C /* CGS.h */, - B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */, - B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */, - B24DA4D905A88AD0006B9F1C /* SDL_QuartzKeys.h */, - B24DA4DA05A88AD0006B9F1C /* SDL_QuartzVideo.h */, - B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */, - B24DA4DC05A88AD0006B9F1C /* SDL_QuartzWindow.h */, - B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */, - B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */, - ); - name = quartz; - path = ../../src/video/quartz; - sourceTree = SOURCE_ROOT; - }; - B24DA50105A88D52006B9F1C /* cpuinfo */ = { - isa = PBXGroup; - children = ( - B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */, - ); - name = cpuinfo; - path = ../../src/cpuinfo; - sourceTree = ""; - }; - B2A23A420415799100A80002 /* macosx */ = { - isa = PBXGroup; - children = ( - 004C2C860975E13300E9D430 /* AudioFilePlayer.c */, - B2A23A450415799100A80002 /* AudioFilePlayer.h */, - 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */, - 004C2C880975E13300E9D430 /* CDPlayer.c */, - B2A23A8104157D5D00A80002 /* CDPlayer.h */, - 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */, - 004C2C8A0975E13300E9D430 /* SDLOSXCAGuard.h */, - B2A23A7B04157C5700A80002 /* SDL_syscdrom.c */, - B2A23A7A04157C5700A80002 /* SDL_syscdrom_c.h */, - ); - path = macosx; - sourceTree = ""; - }; BEC562FE0761C0E800A33029 /* Linked Frameworks */ = { isa = PBXGroup; children = ( @@ -1068,30 +1673,11 @@ 0073179E0858DECD00B2BC32 /* CoreAudio.framework */, 0073179F0858DECD00B2BC32 /* IOKit.framework */, 007317A00858DECD00B2BC32 /* OpenGL.framework */, - 007317A10858DECD00B2BC32 /* QuickTime.framework */, + 00CFA89C106B4BA100758660 /* ForceFeedback.framework */, ); name = "Linked Frameworks"; sourceTree = ""; }; - BECDF5D20761B759005FE872 /* macosx */ = { - isa = PBXGroup; - children = ( - BECDF5D50761B759005FE872 /* SDL_coreaudio.c */, - BECDF5D60761B759005FE872 /* SDL_coreaudio.h */, - ); - name = macosx; - path = ../../src/audio/macosx; - sourceTree = SOURCE_ROOT; - }; - F51789D001769A2401D3D55B /* darwin */ = { - isa = PBXGroup; - children = ( - F51789D101769A2401D3D55B /* SDL_sysjoystick.c */, - ); - name = darwin; - path = ../../src/joystick/darwin; - sourceTree = SOURCE_ROOT; - }; F59C70FC00D5CB5801000001 /* pkg-support */ = { isa = PBXGroup; children = ( @@ -1117,24 +1703,13 @@ F59C710100D5CB5801000001 /* resources */ = { isa = PBXGroup; children = ( - 00794D3F09D0C461003FC8A1 /* License.rtf */, - 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */, + 00794D3F09D0C461003FC8A1 /* License.txt */, 00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */, F59C710300D5CB5801000001 /* ReadMe.txt */, ); path = resources; sourceTree = ""; }; - F5B2A58400C5D39001000001 /* Main */ = { - isa = PBXGroup; - children = ( - 2EECDF2D0086C3A07F000001 /* SDLMain.h */, - 2EECDF2E0086C3A07F000001 /* SDLMain.m */, - 2EECDF2F0086C3A07F000001 /* SDLMain.nib */, - ); - name = Main; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1142,45 +1717,145 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 00162DA409BD222F0037C8D0 /* SDL_config_dreamcast.h in Headers */, - 00162DA509BD222F0037C8D0 /* SDL_config_macos.h in Headers */, - 00162DA609BD222F0037C8D0 /* SDL_config_macosx.h in Headers */, - 00162DA709BD222F0037C8D0 /* SDL_config_os2.h in Headers */, - 00162DA809BD222F0037C8D0 /* SDL_config_win32.h in Headers */, - 00162DA909BD222F0037C8D0 /* SDL_config.h in Headers */, - 00162DAA09BD222F0037C8D0 /* SDL_platform.h in Headers */, - 00162DAB09BD222F0037C8D0 /* SDL_stdinc.h in Headers */, - 00162DAC09BD222F0037C8D0 /* begin_code.h in Headers */, - 00162DAD09BD222F0037C8D0 /* close_code.h in Headers */, - 00162DAE09BD222F0037C8D0 /* SDL_active.h in Headers */, - 00162DAF09BD222F0037C8D0 /* SDL_audio.h in Headers */, - 00162DB009BD222F0037C8D0 /* SDL_byteorder.h in Headers */, - 00162DB109BD222F0037C8D0 /* SDL_cdrom.h in Headers */, - 00162DB209BD222F0037C8D0 /* SDL_copying.h in Headers */, - 00162DB309BD222F0037C8D0 /* SDL_cpuinfo.h in Headers */, - 00162DB409BD222F0037C8D0 /* SDL_endian.h in Headers */, - 00162DB509BD222F0037C8D0 /* SDL_error.h in Headers */, - 00162DB609BD222F0037C8D0 /* SDL_events.h in Headers */, - 00162DB709BD222F0037C8D0 /* SDL_getenv.h in Headers */, - 00162DB809BD222F0037C8D0 /* SDL_joystick.h in Headers */, - 00162DB909BD222F0037C8D0 /* SDL_keyboard.h in Headers */, - 00162DBA09BD222F0037C8D0 /* SDL_keysym.h in Headers */, - 00162DBB09BD222F0037C8D0 /* SDL_loadso.h in Headers */, - 00162DBC09BD222F0037C8D0 /* SDL_main.h in Headers */, - 00162DBD09BD222F0037C8D0 /* SDL_mouse.h in Headers */, - 00162DBE09BD222F0037C8D0 /* SDL_mutex.h in Headers */, - 00162DBF09BD222F0037C8D0 /* SDL_name.h in Headers */, - 00162DC009BD222F0037C8D0 /* SDL_opengl.h in Headers */, - 00162DC109BD222F0037C8D0 /* SDL_quit.h in Headers */, - 00162DC209BD222F0037C8D0 /* SDL_rwops.h in Headers */, - 00162DC309BD222F0037C8D0 /* SDL_syswm.h in Headers */, - 00162DC409BD222F0037C8D0 /* SDL_thread.h in Headers */, - 00162DC509BD222F0037C8D0 /* SDL_timer.h in Headers */, - 00162DC609BD222F0037C8D0 /* SDL_types.h in Headers */, - 00162DC709BD222F0037C8D0 /* SDL_version.h in Headers */, - 00162DC809BD222F0037C8D0 /* SDL_video.h in Headers */, - 00162DC909BD222F0037C8D0 /* SDL.h in Headers */, - 00D0D02310675823004B05EF /* SDL_QuartzWM.h in Headers */, + AA7557FA1595D4D800BBD41B /* begin_code.h in Headers */, + AA7557FC1595D4D800BBD41B /* close_code.h in Headers */, + AA7557FE1595D4D800BBD41B /* SDL_assert.h in Headers */, + AA7558001595D4D800BBD41B /* SDL_atomic.h in Headers */, + AA7558021595D4D800BBD41B /* SDL_audio.h in Headers */, + AA7558041595D4D800BBD41B /* SDL_blendmode.h in Headers */, + AA7558061595D4D800BBD41B /* SDL_clipboard.h in Headers */, + AA7558081595D4D800BBD41B /* SDL_config_macosx.h in Headers */, + AA75580A1595D4D800BBD41B /* SDL_config.h in Headers */, + AA75580C1595D4D800BBD41B /* SDL_copying.h in Headers */, + AA75580E1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */, + AA7558101595D4D800BBD41B /* SDL_endian.h in Headers */, + AA7558121595D4D800BBD41B /* SDL_error.h in Headers */, + AA7558141595D4D800BBD41B /* SDL_events.h in Headers */, + A77E6EB4167AB0A90010E40B /* SDL_gamecontroller.h in Headers */, + AA7558161595D4D800BBD41B /* SDL_gesture.h in Headers */, + AA7558181595D4D800BBD41B /* SDL_haptic.h in Headers */, + AA75581A1595D4D800BBD41B /* SDL_hints.h in Headers */, + AA75581E1595D4D800BBD41B /* SDL_joystick.h in Headers */, + AA7558201595D4D800BBD41B /* SDL_keyboard.h in Headers */, + AA7558221595D4D800BBD41B /* SDL_keycode.h in Headers */, + AA7558241595D4D800BBD41B /* SDL_loadso.h in Headers */, + AA7558261595D4D800BBD41B /* SDL_log.h in Headers */, + AA7558281595D4D800BBD41B /* SDL_main.h in Headers */, + AA9FF95A1637CBF9000DF050 /* SDL_messagebox.h in Headers */, + AA75582A1595D4D800BBD41B /* SDL_mouse.h in Headers */, + AA75582C1595D4D800BBD41B /* SDL_mutex.h in Headers */, + AA75582E1595D4D800BBD41B /* SDL_name.h in Headers */, + AA7558301595D4D800BBD41B /* SDL_opengl.h in Headers */, + AA7558321595D4D800BBD41B /* SDL_opengles.h in Headers */, + AA7558341595D4D800BBD41B /* SDL_opengles2.h in Headers */, + AA7558361595D4D800BBD41B /* SDL_pixels.h in Headers */, + AA7558381595D4D800BBD41B /* SDL_platform.h in Headers */, + AA75583A1595D4D800BBD41B /* SDL_power.h in Headers */, + AA75583C1595D4D800BBD41B /* SDL_quit.h in Headers */, + AA75583E1595D4D800BBD41B /* SDL_rect.h in Headers */, + AA7558401595D4D800BBD41B /* SDL_render.h in Headers */, + AA7558421595D4D800BBD41B /* SDL_revision.h in Headers */, + AA7558441595D4D800BBD41B /* SDL_rwops.h in Headers */, + AA7558461595D4D800BBD41B /* SDL_scancode.h in Headers */, + AA7558481595D4D800BBD41B /* SDL_shape.h in Headers */, + AA75584A1595D4D800BBD41B /* SDL_stdinc.h in Headers */, + AA75584C1595D4D800BBD41B /* SDL_surface.h in Headers */, + AA75584E1595D4D800BBD41B /* SDL_system.h in Headers */, + AA7558501595D4D800BBD41B /* SDL_syswm.h in Headers */, + AA7558521595D4D800BBD41B /* SDL_thread.h in Headers */, + AA7558541595D4D800BBD41B /* SDL_timer.h in Headers */, + AA7558561595D4D800BBD41B /* SDL_touch.h in Headers */, + AA7558581595D4D800BBD41B /* SDL_types.h in Headers */, + AA75585A1595D4D800BBD41B /* SDL_version.h in Headers */, + AA75585C1595D4D800BBD41B /* SDL_video.h in Headers */, + AA75585E1595D4D800BBD41B /* SDL.h in Headers */, + 04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */, + 04BD001112E6671800899322 /* SDL_dummyaudio.h in Headers */, + 04BD001912E6671800899322 /* SDL_coreaudio.h in Headers */, + 04BD002712E6671800899322 /* SDL_audio_c.h in Headers */, + 04BD002A12E6671800899322 /* SDL_audiodev_c.h in Headers */, + 04BD002B12E6671800899322 /* SDL_audiomem.h in Headers */, + 04BD003412E6671800899322 /* SDL_sysaudio.h in Headers */, + 04BD003612E6671800899322 /* SDL_wave.h in Headers */, + 04BD004212E6671800899322 /* blank_cursor.h in Headers */, + 04BD004312E6671800899322 /* default_cursor.h in Headers */, + 04BD004412E6671800899322 /* scancodes_darwin.h in Headers */, + 04BD004512E6671800899322 /* scancodes_linux.h in Headers */, + 04BD004712E6671800899322 /* scancodes_xfree86.h in Headers */, + 04BD004912E6671800899322 /* SDL_clipboardevents_c.h in Headers */, + 04BD004B12E6671800899322 /* SDL_events_c.h in Headers */, + 04BD004D12E6671800899322 /* SDL_gesture_c.h in Headers */, + 04BD004F12E6671800899322 /* SDL_keyboard_c.h in Headers */, + 04BD005112E6671800899322 /* SDL_mouse_c.h in Headers */, + 04BD005312E6671800899322 /* SDL_sysevents.h in Headers */, + 04BD005512E6671800899322 /* SDL_touch_c.h in Headers */, + 04BD005712E6671800899322 /* SDL_windowevents_c.h in Headers */, + 04BD005812E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */, + 04BD006012E6671800899322 /* SDL_haptic_c.h in Headers */, + 04BD006112E6671800899322 /* SDL_syshaptic.h in Headers */, + 04BD006712E6671800899322 /* SDL_sysjoystick_c.h in Headers */, + 04BD007112E6671800899322 /* SDL_joystick_c.h in Headers */, + 04BD007212E6671800899322 /* SDL_sysjoystick.h in Headers */, + 04BD009B12E6671800899322 /* SDL_assert_c.h in Headers */, + 04BD009E12E6671800899322 /* SDL_error_c.h in Headers */, + 04BD00BF12E6671800899322 /* SDL_sysmutex_c.h in Headers */, + 04BD00C212E6671800899322 /* SDL_systhread_c.h in Headers */, + 04BD00C912E6671800899322 /* SDL_systhread.h in Headers */, + 04BD00CB12E6671800899322 /* SDL_thread_c.h in Headers */, + 04BD00D812E6671800899322 /* SDL_timer_c.h in Headers */, + 04BD00F312E6671800899322 /* SDL_cocoaclipboard.h in Headers */, + 04BD00F512E6671800899322 /* SDL_cocoaevents.h in Headers */, + 04BD00F712E6671800899322 /* SDL_cocoakeyboard.h in Headers */, + 04BD00F912E6671800899322 /* SDL_cocoamodes.h in Headers */, + 04BD00FB12E6671800899322 /* SDL_cocoamouse.h in Headers */, + 04BD00FD12E6671800899322 /* SDL_cocoaopengl.h in Headers */, + 04BD00FF12E6671800899322 /* SDL_cocoashape.h in Headers */, + 04BD010112E6671800899322 /* SDL_cocoavideo.h in Headers */, + 04BD010312E6671800899322 /* SDL_cocoawindow.h in Headers */, + 04BD011812E6671800899322 /* SDL_nullevents_c.h in Headers */, + 04BD011C12E6671800899322 /* SDL_nullvideo.h in Headers */, + 04BD017612E6671800899322 /* SDL_blit.h in Headers */, + 04BD017B12E6671800899322 /* SDL_blit_auto.h in Headers */, + 04BD017D12E6671800899322 /* SDL_blit_copy.h in Headers */, + 04BD018012E6671800899322 /* SDL_blit_slow.h in Headers */, + 04BD018D12E6671800899322 /* SDL_pixels_c.h in Headers */, + 04BD019712E6671800899322 /* SDL_RLEaccel_c.h in Headers */, + 04BD019912E6671800899322 /* SDL_shape_internals.h in Headers */, + 04BD019C12E6671800899322 /* SDL_sysvideo.h in Headers */, + 04BD01DC12E6671800899322 /* imKStoUCS.h in Headers */, + 04BD01DE12E6671800899322 /* SDL_x11clipboard.h in Headers */, + 04BD01E012E6671800899322 /* SDL_x11dyn.h in Headers */, + 04BD01E212E6671800899322 /* SDL_x11events.h in Headers */, + 04BD01E612E6671800899322 /* SDL_x11keyboard.h in Headers */, + 04BD01E812E6671800899322 /* SDL_x11modes.h in Headers */, + 04BD01EA12E6671800899322 /* SDL_x11mouse.h in Headers */, + 04BD01EC12E6671800899322 /* SDL_x11opengl.h in Headers */, + 04BD01EE12E6671800899322 /* SDL_x11opengles.h in Headers */, + 04BD01F212E6671800899322 /* SDL_x11shape.h in Headers */, + 04BD01F312E6671800899322 /* SDL_x11sym.h in Headers */, + 04BD01F512E6671800899322 /* SDL_x11touch.h in Headers */, + 04BD01F712E6671800899322 /* SDL_x11video.h in Headers */, + 04BD01F912E6671800899322 /* SDL_x11window.h in Headers */, + 041B2CA612FA0D680087D585 /* SDL_sysrender.h in Headers */, + 04409B9112FA97ED00FB9AA8 /* mmx.h in Headers */, + 04409B9312FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */, + 04F7803912FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */, + 04F7804A12FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */, + 04F7804C12FB74A200FC43C0 /* SDL_blendline.h in Headers */, + 04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */, + 04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */, + 04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */, + 04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */, + 0442EC1C12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */, + 0442EC5B12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */, + 04043BBB12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */, + 0435673F1303160F00BA5428 /* SDL_shaders_gl.h in Headers */, + 566CDE8F148F0AC200C5A9BB /* SDL_dropevents_c.h in Headers */, + AA628ACC159367B7005138DD /* SDL_rotate.h in Headers */, + AA628AD3159367F2005138DD /* SDL_x11xinput2.h in Headers */, + AABCC38D164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */, + AADA5B8716CCAB3000107CF7 /* SDL_bits.h in Headers */, + D55A1B81179F262300625D7C /* SDL_cocoamousetap.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1188,53 +1863,287 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - BECDF6720761BA81005FE872 /* CGS.h in Headers */, - BECDF6730761BA81005FE872 /* SDL_QuartzKeys.h in Headers */, - BECDF6740761BA81005FE872 /* SDL_QuartzVideo.h in Headers */, - BECDF6750761BA81005FE872 /* SDL_QuartzWindow.h in Headers */, - BECDF6760761BA81005FE872 /* SDL_cpuinfo.h in Headers */, - BECDF6770761BA81005FE872 /* SDL_name.h in Headers */, - BECDF6780761BA81005FE872 /* SDL_coreaudio.h in Headers */, - 004C2C940975E13300E9D430 /* SDLOSXCAGuard.h in Headers */, - 00162D4409BD1FA90037C8D0 /* SDL_config_dreamcast.h in Headers */, - 00162D4509BD1FA90037C8D0 /* SDL_config_macos.h in Headers */, - 00162D4609BD1FA90037C8D0 /* SDL_config_macosx.h in Headers */, - 00162D4709BD1FA90037C8D0 /* SDL_config_os2.h in Headers */, - 00162D4809BD1FA90037C8D0 /* SDL_config_win32.h in Headers */, - 00162D4909BD1FA90037C8D0 /* SDL_config.h in Headers */, - 00162D4A09BD1FA90037C8D0 /* SDL_platform.h in Headers */, - 00162D4B09BD1FA90037C8D0 /* SDL_stdinc.h in Headers */, - 00162D5B09BD20DA0037C8D0 /* SDL_sysmutex_c.h in Headers */, - 00162D5E09BD20DA0037C8D0 /* SDL_systhread_c.h in Headers */, - 00162E6B09BD27370037C8D0 /* SDL_mixer_MMX.h in Headers */, - 00162F4209BE27FB0037C8D0 /* SDL_nullevents_c.h in Headers */, - 00162F4409BE27FB0037C8D0 /* SDL_nullmouse_c.h in Headers */, - 00162F4609BE27FB0037C8D0 /* SDL_nullvideo.h in Headers */, - 0014B7F409C0D8D2003A99D5 /* SDL_dgaevents_c.h in Headers */, - 0014B7F609C0D8D2003A99D5 /* SDL_dgamouse_c.h in Headers */, - 0014B7F909C0D8D2003A99D5 /* SDL_dgavideo.h in Headers */, - 0014B86509C0D977003A99D5 /* SDL_x11dga_c.h in Headers */, - 0014B86809C0D977003A99D5 /* SDL_x11dyn.h in Headers */, - 0014B86909C0D977003A99D5 /* SDL_x11events_c.h in Headers */, - 0014B86B09C0D977003A99D5 /* SDL_x11gamma_c.h in Headers */, - 0014B86D09C0D977003A99D5 /* SDL_x11gl_c.h in Headers */, - 0014B86F09C0D977003A99D5 /* SDL_x11image_c.h in Headers */, - 0014B87109C0D977003A99D5 /* SDL_x11modes_c.h in Headers */, - 0014B87309C0D977003A99D5 /* SDL_x11mouse_c.h in Headers */, - 0014B87509C0D977003A99D5 /* SDL_x11sym.h in Headers */, - 0014B87709C0D977003A99D5 /* SDL_x11video.h in Headers */, - 0014B87809C0D977003A99D5 /* SDL_x11wm_c.h in Headers */, - 0014B87A09C0D977003A99D5 /* SDL_x11yuv_c.h in Headers */, - 0014B89E09C0DAAE003A99D5 /* Xvlibint.h in Headers */, - 002F32DA09CA0BE700EBEB88 /* SDL_diskaudio.h in Headers */, - 002F32E809CA0BF600EBEB88 /* SDL_dummyaudio.h in Headers */, + 04BD022512E6671800899322 /* SDL_diskaudio.h in Headers */, + 04BD022D12E6671800899322 /* SDL_dummyaudio.h in Headers */, + 04BD023512E6671800899322 /* SDL_coreaudio.h in Headers */, + 04BD024312E6671800899322 /* SDL_audio_c.h in Headers */, + 04BD024612E6671800899322 /* SDL_audiodev_c.h in Headers */, + 04BD024712E6671800899322 /* SDL_audiomem.h in Headers */, + 04BD025012E6671800899322 /* SDL_sysaudio.h in Headers */, + 04BD025212E6671800899322 /* SDL_wave.h in Headers */, + 04BD025D12E6671800899322 /* blank_cursor.h in Headers */, + 04BD025E12E6671800899322 /* default_cursor.h in Headers */, + 04BD025F12E6671800899322 /* scancodes_darwin.h in Headers */, + 04BD026012E6671800899322 /* scancodes_linux.h in Headers */, + 04BD026212E6671800899322 /* scancodes_xfree86.h in Headers */, + 04BD026412E6671800899322 /* SDL_clipboardevents_c.h in Headers */, + 04BD026612E6671800899322 /* SDL_events_c.h in Headers */, + 04BD026812E6671800899322 /* SDL_gesture_c.h in Headers */, + 04BD026A12E6671800899322 /* SDL_keyboard_c.h in Headers */, + 04BD026C12E6671800899322 /* SDL_mouse_c.h in Headers */, + 04BD026E12E6671800899322 /* SDL_sysevents.h in Headers */, + 04BD027012E6671800899322 /* SDL_touch_c.h in Headers */, + 04BD027212E6671800899322 /* SDL_windowevents_c.h in Headers */, + 04BD027312E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */, + 04BD027B12E6671800899322 /* SDL_haptic_c.h in Headers */, + 04BD027C12E6671800899322 /* SDL_syshaptic.h in Headers */, + 04BD028212E6671800899322 /* SDL_sysjoystick_c.h in Headers */, + 04BD028C12E6671800899322 /* SDL_joystick_c.h in Headers */, + 04BD028D12E6671800899322 /* SDL_sysjoystick.h in Headers */, + 04BD02B512E6671800899322 /* SDL_assert_c.h in Headers */, + 04BD02B812E6671800899322 /* SDL_error_c.h in Headers */, + 04BD02D912E6671800899322 /* SDL_sysmutex_c.h in Headers */, + 04BD02DC12E6671800899322 /* SDL_systhread_c.h in Headers */, + 04BD02E312E6671800899322 /* SDL_systhread.h in Headers */, + 04BD02E512E6671800899322 /* SDL_thread_c.h in Headers */, + 04BD02F212E6671800899322 /* SDL_timer_c.h in Headers */, + 04BD030D12E6671800899322 /* SDL_cocoaclipboard.h in Headers */, + 04BD030F12E6671800899322 /* SDL_cocoaevents.h in Headers */, + 04BD031112E6671800899322 /* SDL_cocoakeyboard.h in Headers */, + 04BD031312E6671800899322 /* SDL_cocoamodes.h in Headers */, + 04BD031512E6671800899322 /* SDL_cocoamouse.h in Headers */, + 04BD031712E6671800899322 /* SDL_cocoaopengl.h in Headers */, + 04BD031912E6671800899322 /* SDL_cocoashape.h in Headers */, + 04BD031B12E6671800899322 /* SDL_cocoavideo.h in Headers */, + 04BD031D12E6671800899322 /* SDL_cocoawindow.h in Headers */, + 04BD033212E6671800899322 /* SDL_nullevents_c.h in Headers */, + 04BD033612E6671800899322 /* SDL_nullvideo.h in Headers */, + 04BD039012E6671800899322 /* SDL_blit.h in Headers */, + 04BD039512E6671800899322 /* SDL_blit_auto.h in Headers */, + 04BD039712E6671800899322 /* SDL_blit_copy.h in Headers */, + 04BD039A12E6671800899322 /* SDL_blit_slow.h in Headers */, + 04BD03A712E6671800899322 /* SDL_pixels_c.h in Headers */, + 04BD03B112E6671800899322 /* SDL_RLEaccel_c.h in Headers */, + 04BD03B312E6671800899322 /* SDL_shape_internals.h in Headers */, + 04BD03B612E6671800899322 /* SDL_sysvideo.h in Headers */, + 04BD03F412E6671800899322 /* imKStoUCS.h in Headers */, + 04BD03F612E6671800899322 /* SDL_x11clipboard.h in Headers */, + 04BD03F812E6671800899322 /* SDL_x11dyn.h in Headers */, + 04BD03FA12E6671800899322 /* SDL_x11events.h in Headers */, + 04BD03FE12E6671800899322 /* SDL_x11keyboard.h in Headers */, + 04BD040012E6671800899322 /* SDL_x11modes.h in Headers */, + 04BD040212E6671800899322 /* SDL_x11mouse.h in Headers */, + 04BD040412E6671800899322 /* SDL_x11opengl.h in Headers */, + 04BD040612E6671800899322 /* SDL_x11opengles.h in Headers */, + 04BD040A12E6671800899322 /* SDL_x11shape.h in Headers */, + 04BD040B12E6671800899322 /* SDL_x11sym.h in Headers */, + 04BD040D12E6671800899322 /* SDL_x11touch.h in Headers */, + 04BD040F12E6671800899322 /* SDL_x11video.h in Headers */, + 04BD041112E6671800899322 /* SDL_x11window.h in Headers */, + 041B2CAC12FA0D680087D585 /* SDL_sysrender.h in Headers */, + 04409B9512FA97ED00FB9AA8 /* mmx.h in Headers */, + 04409B9712FA97ED00FB9AA8 /* SDL_yuv_sw_c.h in Headers */, + 04F7803B12FB748500FC43C0 /* SDL_nullframebuffer_c.h in Headers */, + 04F7805612FB74A200FC43C0 /* SDL_blendfillrect.h in Headers */, + 04F7805812FB74A200FC43C0 /* SDL_blendline.h in Headers */, + 04F7805A12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */, + 04F7805B12FB74A200FC43C0 /* SDL_draw.h in Headers */, + 04F7805D12FB74A200FC43C0 /* SDL_drawline.h in Headers */, + 04F7805F12FB74A200FC43C0 /* SDL_drawpoint.h in Headers */, + 0442EC1E12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */, + 0442EC5D12FE1C60004C9285 /* SDL_x11framebuffer.h in Headers */, + 04043BBC12FEB1BE0076DB1F /* SDL_glfuncs.h in Headers */, + 043567411303160F00BA5428 /* SDL_shaders_gl.h in Headers */, + AA628ACD159367B7005138DD /* SDL_rotate.h in Headers */, + AA628AD4159367F2005138DD /* SDL_x11xinput2.h in Headers */, + AA7557FB1595D4D800BBD41B /* begin_code.h in Headers */, + AA7557FD1595D4D800BBD41B /* close_code.h in Headers */, + AA7557FF1595D4D800BBD41B /* SDL_assert.h in Headers */, + AA7558011595D4D800BBD41B /* SDL_atomic.h in Headers */, + AA7558031595D4D800BBD41B /* SDL_audio.h in Headers */, + AA7558051595D4D800BBD41B /* SDL_blendmode.h in Headers */, + AA7558071595D4D800BBD41B /* SDL_clipboard.h in Headers */, + AA7558091595D4D800BBD41B /* SDL_config_macosx.h in Headers */, + AA75580B1595D4D800BBD41B /* SDL_config.h in Headers */, + AA75580D1595D4D800BBD41B /* SDL_copying.h in Headers */, + AA75580F1595D4D800BBD41B /* SDL_cpuinfo.h in Headers */, + AA7558111595D4D800BBD41B /* SDL_endian.h in Headers */, + AA7558131595D4D800BBD41B /* SDL_error.h in Headers */, + AA7558151595D4D800BBD41B /* SDL_events.h in Headers */, + AA7558171595D4D800BBD41B /* SDL_gesture.h in Headers */, + AA7558191595D4D800BBD41B /* SDL_haptic.h in Headers */, + AA75581B1595D4D800BBD41B /* SDL_hints.h in Headers */, + AA75581F1595D4D800BBD41B /* SDL_joystick.h in Headers */, + AA7558211595D4D800BBD41B /* SDL_keyboard.h in Headers */, + AA7558231595D4D800BBD41B /* SDL_keycode.h in Headers */, + AA7558251595D4D800BBD41B /* SDL_loadso.h in Headers */, + AA7558271595D4D800BBD41B /* SDL_log.h in Headers */, + AA7558291595D4D800BBD41B /* SDL_main.h in Headers */, + AA75582B1595D4D800BBD41B /* SDL_mouse.h in Headers */, + AA75582D1595D4D800BBD41B /* SDL_mutex.h in Headers */, + AA75582F1595D4D800BBD41B /* SDL_name.h in Headers */, + AA7558311595D4D800BBD41B /* SDL_opengl.h in Headers */, + AA7558331595D4D800BBD41B /* SDL_opengles.h in Headers */, + AA7558351595D4D800BBD41B /* SDL_opengles2.h in Headers */, + AA7558371595D4D800BBD41B /* SDL_pixels.h in Headers */, + AA7558391595D4D800BBD41B /* SDL_platform.h in Headers */, + AA75583B1595D4D800BBD41B /* SDL_power.h in Headers */, + AA75583D1595D4D800BBD41B /* SDL_quit.h in Headers */, + AA75583F1595D4D800BBD41B /* SDL_rect.h in Headers */, + AA7558411595D4D800BBD41B /* SDL_render.h in Headers */, + AA7558431595D4D800BBD41B /* SDL_revision.h in Headers */, + AA7558451595D4D800BBD41B /* SDL_rwops.h in Headers */, + AA7558471595D4D800BBD41B /* SDL_scancode.h in Headers */, + AA7558491595D4D800BBD41B /* SDL_shape.h in Headers */, + AA75584B1595D4D800BBD41B /* SDL_stdinc.h in Headers */, + AA75584D1595D4D800BBD41B /* SDL_surface.h in Headers */, + AA75584F1595D4D800BBD41B /* SDL_system.h in Headers */, + AA7558511595D4D800BBD41B /* SDL_syswm.h in Headers */, + AA7558531595D4D800BBD41B /* SDL_thread.h in Headers */, + AA7558551595D4D800BBD41B /* SDL_timer.h in Headers */, + AA7558571595D4D800BBD41B /* SDL_touch.h in Headers */, + AA7558591595D4D800BBD41B /* SDL_types.h in Headers */, + AA75585B1595D4D800BBD41B /* SDL_version.h in Headers */, + AA75585D1595D4D800BBD41B /* SDL_video.h in Headers */, + AA75585F1595D4D800BBD41B /* SDL.h in Headers */, + AABCC38E164063D200AB8930 /* SDL_cocoamessagebox.h in Headers */, + A77E6EB5167AB0A90010E40B /* SDL_gamecontroller.h in Headers */, + AADA5B8816CCAB3000107CF7 /* SDL_bits.h in Headers */, + D55A1B85179F278E00625D7C /* SDL_cocoamousetap.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - BECDF6B50761BA81005FE872 /* Headers */ = { + DB313F7317554B71006C0E22 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + DB313F7417554B71006C0E22 /* SDL_diskaudio.h in Headers */, + DB313F7517554B71006C0E22 /* SDL_dummyaudio.h in Headers */, + DB313F7617554B71006C0E22 /* SDL_coreaudio.h in Headers */, + DB313F7717554B71006C0E22 /* SDL_audio_c.h in Headers */, + DB313F7817554B71006C0E22 /* SDL_audiodev_c.h in Headers */, + DB313F7917554B71006C0E22 /* SDL_audiomem.h in Headers */, + DB313F7A17554B71006C0E22 /* SDL_sysaudio.h in Headers */, + DB313F7B17554B71006C0E22 /* SDL_wave.h in Headers */, + DB313F7C17554B71006C0E22 /* blank_cursor.h in Headers */, + DB313F7D17554B71006C0E22 /* default_cursor.h in Headers */, + DB313F7E17554B71006C0E22 /* scancodes_darwin.h in Headers */, + DB313F7F17554B71006C0E22 /* scancodes_linux.h in Headers */, + DB313F8017554B71006C0E22 /* scancodes_xfree86.h in Headers */, + DB313F8117554B71006C0E22 /* SDL_clipboardevents_c.h in Headers */, + DB313F8217554B71006C0E22 /* SDL_events_c.h in Headers */, + DB313F8317554B71006C0E22 /* SDL_gesture_c.h in Headers */, + DB313F8417554B71006C0E22 /* SDL_keyboard_c.h in Headers */, + DB313F8517554B71006C0E22 /* SDL_mouse_c.h in Headers */, + DB313F8617554B71006C0E22 /* SDL_sysevents.h in Headers */, + DB313F8717554B71006C0E22 /* SDL_touch_c.h in Headers */, + DB313F8817554B71006C0E22 /* SDL_windowevents_c.h in Headers */, + DB313F8917554B71006C0E22 /* SDL_rwopsbundlesupport.h in Headers */, + DB313F8A17554B71006C0E22 /* SDL_haptic_c.h in Headers */, + DB313F8B17554B71006C0E22 /* SDL_syshaptic.h in Headers */, + DB313F8C17554B71006C0E22 /* SDL_sysjoystick_c.h in Headers */, + DB313F8D17554B71006C0E22 /* SDL_joystick_c.h in Headers */, + DB313F8E17554B71006C0E22 /* SDL_sysjoystick.h in Headers */, + DB313F8F17554B71006C0E22 /* SDL_assert_c.h in Headers */, + DB313F9017554B71006C0E22 /* SDL_error_c.h in Headers */, + DB313F9217554B71006C0E22 /* SDL_sysmutex_c.h in Headers */, + DB313F9317554B71006C0E22 /* SDL_systhread_c.h in Headers */, + DB313F9417554B71006C0E22 /* SDL_systhread.h in Headers */, + DB313F9517554B71006C0E22 /* SDL_thread_c.h in Headers */, + DB313F9617554B71006C0E22 /* SDL_timer_c.h in Headers */, + DB313F9717554B71006C0E22 /* SDL_cocoaclipboard.h in Headers */, + DB313F9817554B71006C0E22 /* SDL_cocoaevents.h in Headers */, + DB313F9917554B71006C0E22 /* SDL_cocoakeyboard.h in Headers */, + DB313F9A17554B71006C0E22 /* SDL_cocoamodes.h in Headers */, + DB313F9B17554B71006C0E22 /* SDL_cocoamouse.h in Headers */, + DB313F9C17554B71006C0E22 /* SDL_cocoaopengl.h in Headers */, + DB313F9D17554B71006C0E22 /* SDL_cocoashape.h in Headers */, + DB313F9E17554B71006C0E22 /* SDL_cocoavideo.h in Headers */, + DB313F9F17554B71006C0E22 /* SDL_cocoawindow.h in Headers */, + DB313FA017554B71006C0E22 /* SDL_nullevents_c.h in Headers */, + DB313FA117554B71006C0E22 /* SDL_nullvideo.h in Headers */, + DB313FA217554B71006C0E22 /* SDL_blit.h in Headers */, + DB313FA317554B71006C0E22 /* SDL_blit_auto.h in Headers */, + DB313FA417554B71006C0E22 /* SDL_blit_copy.h in Headers */, + DB313FA517554B71006C0E22 /* SDL_blit_slow.h in Headers */, + DB313FA617554B71006C0E22 /* SDL_pixels_c.h in Headers */, + DB313FA717554B71006C0E22 /* SDL_RLEaccel_c.h in Headers */, + DB313FA817554B71006C0E22 /* SDL_shape_internals.h in Headers */, + DB313FA917554B71006C0E22 /* SDL_sysvideo.h in Headers */, + DB313FAA17554B71006C0E22 /* imKStoUCS.h in Headers */, + DB313FAB17554B71006C0E22 /* SDL_x11clipboard.h in Headers */, + DB313FAC17554B71006C0E22 /* SDL_x11dyn.h in Headers */, + DB313FAD17554B71006C0E22 /* SDL_x11events.h in Headers */, + DB313FAE17554B71006C0E22 /* SDL_x11keyboard.h in Headers */, + DB313FAF17554B71006C0E22 /* SDL_x11modes.h in Headers */, + DB313FB017554B71006C0E22 /* SDL_x11mouse.h in Headers */, + DB313FB117554B71006C0E22 /* SDL_x11opengl.h in Headers */, + DB313FB217554B71006C0E22 /* SDL_x11opengles.h in Headers */, + DB313FB317554B71006C0E22 /* SDL_x11shape.h in Headers */, + DB313FB417554B71006C0E22 /* SDL_x11sym.h in Headers */, + DB313FB517554B71006C0E22 /* SDL_x11touch.h in Headers */, + DB313FB617554B71006C0E22 /* SDL_x11video.h in Headers */, + DB313FB717554B71006C0E22 /* SDL_x11window.h in Headers */, + DB313FB817554B71006C0E22 /* SDL_sysrender.h in Headers */, + DB313FB917554B71006C0E22 /* mmx.h in Headers */, + DB313FBA17554B71006C0E22 /* SDL_yuv_sw_c.h in Headers */, + DB313FBB17554B71006C0E22 /* SDL_nullframebuffer_c.h in Headers */, + DB313FBC17554B71006C0E22 /* SDL_blendfillrect.h in Headers */, + DB313FBD17554B71006C0E22 /* SDL_blendline.h in Headers */, + DB313FBE17554B71006C0E22 /* SDL_blendpoint.h in Headers */, + DB313FBF17554B71006C0E22 /* SDL_draw.h in Headers */, + DB313FC017554B71006C0E22 /* SDL_drawline.h in Headers */, + DB313FC117554B71006C0E22 /* SDL_drawpoint.h in Headers */, + DB313FC217554B71006C0E22 /* SDL_render_sw_c.h in Headers */, + DB313FC317554B71006C0E22 /* SDL_x11framebuffer.h in Headers */, + DB313FC417554B71006C0E22 /* SDL_glfuncs.h in Headers */, + DB313FC517554B71006C0E22 /* SDL_shaders_gl.h in Headers */, + DB313FC617554B71006C0E22 /* SDL_rotate.h in Headers */, + DB313FC717554B71006C0E22 /* SDL_x11xinput2.h in Headers */, + DB313FC817554B71006C0E22 /* begin_code.h in Headers */, + DB313FC917554B71006C0E22 /* close_code.h in Headers */, + DB313FCA17554B71006C0E22 /* SDL_assert.h in Headers */, + DB313FCB17554B71006C0E22 /* SDL_atomic.h in Headers */, + DB313FCC17554B71006C0E22 /* SDL_audio.h in Headers */, + DB313FCD17554B71006C0E22 /* SDL_blendmode.h in Headers */, + DB313FCE17554B71006C0E22 /* SDL_clipboard.h in Headers */, + DB313FCF17554B71006C0E22 /* SDL_config_macosx.h in Headers */, + DB313FD017554B71006C0E22 /* SDL_config.h in Headers */, + DB313FD117554B71006C0E22 /* SDL_copying.h in Headers */, + DB313FD217554B71006C0E22 /* SDL_cpuinfo.h in Headers */, + DB313FD317554B71006C0E22 /* SDL_endian.h in Headers */, + DB313FD417554B71006C0E22 /* SDL_error.h in Headers */, + DB313FD517554B71006C0E22 /* SDL_events.h in Headers */, + DB313FD617554B71006C0E22 /* SDL_gesture.h in Headers */, + DB313FD717554B71006C0E22 /* SDL_haptic.h in Headers */, + DB313FD817554B71006C0E22 /* SDL_hints.h in Headers */, + DB313FD917554B71006C0E22 /* SDL_joystick.h in Headers */, + DB313FDA17554B71006C0E22 /* SDL_keyboard.h in Headers */, + DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */, + DB313FDC17554B71006C0E22 /* SDL_loadso.h in Headers */, + DB313FDD17554B71006C0E22 /* SDL_log.h in Headers */, + DB313FDE17554B71006C0E22 /* SDL_main.h in Headers */, + DB313FDF17554B71006C0E22 /* SDL_mouse.h in Headers */, + DB313FE017554B71006C0E22 /* SDL_mutex.h in Headers */, + DB313FE117554B71006C0E22 /* SDL_name.h in Headers */, + DB313FE217554B71006C0E22 /* SDL_opengl.h in Headers */, + DB313FE317554B71006C0E22 /* SDL_opengles.h in Headers */, + DB313FE417554B71006C0E22 /* SDL_opengles2.h in Headers */, + DB313FE517554B71006C0E22 /* SDL_pixels.h in Headers */, + DB313FE617554B71006C0E22 /* SDL_platform.h in Headers */, + DB313FE717554B71006C0E22 /* SDL_power.h in Headers */, + DB313FE817554B71006C0E22 /* SDL_quit.h in Headers */, + DB313FE917554B71006C0E22 /* SDL_rect.h in Headers */, + DB313FEA17554B71006C0E22 /* SDL_render.h in Headers */, + DB313FEB17554B71006C0E22 /* SDL_revision.h in Headers */, + DB313FEC17554B71006C0E22 /* SDL_rwops.h in Headers */, + DB313FED17554B71006C0E22 /* SDL_scancode.h in Headers */, + DB313FEE17554B71006C0E22 /* SDL_shape.h in Headers */, + DB313FEF17554B71006C0E22 /* SDL_stdinc.h in Headers */, + DB313FF017554B71006C0E22 /* SDL_surface.h in Headers */, + DB313FF117554B71006C0E22 /* SDL_system.h in Headers */, + DB313FF217554B71006C0E22 /* SDL_syswm.h in Headers */, + DB313FF317554B71006C0E22 /* SDL_thread.h in Headers */, + DB313FF417554B71006C0E22 /* SDL_timer.h in Headers */, + DB313FF517554B71006C0E22 /* SDL_touch.h in Headers */, + DB313FF617554B71006C0E22 /* SDL_types.h in Headers */, + DB313FF717554B71006C0E22 /* SDL_version.h in Headers */, + DB313FF817554B71006C0E22 /* SDL_video.h in Headers */, + DB313FF917554B71006C0E22 /* SDL.h in Headers */, + DB313FFA17554B71006C0E22 /* SDL_cocoamessagebox.h in Headers */, + DB313FFB17554B71006C0E22 /* SDL_gamecontroller.h in Headers */, + DB313FFC17554B71006C0E22 /* SDL_bits.h in Headers */, + D55A1B86179F278F00625D7C /* SDL_cocoamousetap.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1245,12 +2154,11 @@ isa = PBXNativeTarget; buildConfigurationList = 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */; buildPhases = ( - 00D55F050A11143E0030ED2A /* Run Script to Create SDL_config.h */, BECDF5FF0761BA81005FE872 /* Headers */, BECDF62A0761BA81005FE872 /* Resources */, BECDF62C0761BA81005FE872 /* Sources */, BECDF6680761BA81005FE872 /* Frameworks */, - BECDF6690761BA81005FE872 /* Rez */, + AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */, ); buildRules = ( ); @@ -1260,14 +2168,13 @@ name = Framework; productInstallPath = "@executable_path/../Frameworks"; productName = SDL; - productReference = BECDF66C0761BA81005FE872 /* SDL.framework */; + productReference = BECDF66C0761BA81005FE872 /* SDL2.framework */; productType = "com.apple.product-type.framework"; }; BECDF66D0761BA81005FE872 /* Static Library */ = { isa = PBXNativeTarget; buildConfigurationList = 0073177E0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Static Library" */; buildPhases = ( - 00D55F080A11147F0030ED2A /* Run Script to Create SDL_config.h */, BECDF66E0761BA81005FE872 /* Headers */, BECDF6790761BA81005FE872 /* Sources */, BECDF6B10761BA81005FE872 /* Frameworks */, @@ -1281,27 +2188,7 @@ name = "Static Library"; productInstallPath = /usr/local/lib; productName = "Static Library"; - productReference = BECDF6B30761BA81005FE872 /* libSDL.a */; - productType = "com.apple.product-type.library.static"; - }; - BECDF6B40761BA81005FE872 /* Main Library */ = { - isa = PBXNativeTarget; - buildConfigurationList = 007317820858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Main Library" */; - buildPhases = ( - BECDF6B50761BA81005FE872 /* Headers */, - BECDF6B60761BA81005FE872 /* Sources */, - BECDF6B80761BA81005FE872 /* Frameworks */, - BECDF6B90761BA81005FE872 /* Rez */, - ); - buildRules = ( - ); - comments = "This produces libSDLmain.a, which contains only SDL_main.m, the hook to get the app running correctly before your SDL code executes."; - dependencies = ( - ); - name = "Main Library"; - productInstallPath = /usr/local/lib; - productName = libSDLmain.a; - productReference = BECDF6BA0761BA81005FE872 /* libSDLmain.a */; + productReference = BECDF6B30761BA81005FE872 /* libSDL2.a */; productType = "com.apple.product-type.library.static"; }; BECDF6BB0761BA81005FE872 /* Standard DMG */ = { @@ -1321,22 +2208,25 @@ productReference = BECDF6BE0761BA81005FE872 /* Standard DMG */; productType = "com.apple.product-type.tool"; }; - BECDF6C00761BA81005FE872 /* Developer Extras Package */ = { + DB313F7217554B71006C0E22 /* Shared Library */ = { isa = PBXNativeTarget; - buildConfigurationList = 0073178A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Developer Extras Package" */; + buildConfigurationList = DB31407417554B71006C0E22 /* Build configuration list for PBXNativeTarget "Shared Library" */; buildPhases = ( - BECDF6C20761BA81005FE872 /* ShellScript */, + DB313F7317554B71006C0E22 /* Headers */, + DB313FFD17554B71006C0E22 /* Sources */, + DB31406B17554B71006C0E22 /* Frameworks */, + DB31407317554B71006C0E22 /* Rez */, ); buildRules = ( ); + comments = "This produces libSDL2.dylib, which is the shared build of SDL."; dependencies = ( - 008310001072D94A00A531F1 /* PBXTargetDependency */, ); - name = "Developer Extras Package"; - productInstallPath = /usr/local/bin; - productName = "Devel Package"; - productReference = BECDF6C30761BA81005FE872 /* Developer Extras Package */; - productType = "com.apple.product-type.tool"; + name = "Shared Library"; + productInstallPath = /usr/local/lib; + productName = "Shared Library"; + productReference = DB31407717554B71006C0E22 /* libSDL2.dylib */; + productType = "com.apple.product-type.library.dynamic"; }; /* End PBXNativeTarget section */ @@ -1363,10 +2253,8 @@ targets = ( BECDF5FE0761BA81005FE872 /* Framework */, BECDF66D0761BA81005FE872 /* Static Library */, - BECDF6B40761BA81005FE872 /* Main Library */, + DB313F7217554B71006C0E22 /* Shared Library */, BECDF6BB0761BA81005FE872 /* Standard DMG */, - BECDF6C00761BA81005FE872 /* Developer Extras Package */, - 0032354F1070931700C76517 /* Generate Doxygen DocSet */, ); }; /* End PBXProject section */ @@ -1376,20 +2264,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - BECDF62B0761BA81005FE872 /* SDLMain.nib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXRezBuildPhase section */ - BECDF6690761BA81005FE872 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; BECDF6B20761BA81005FE872 /* Rez */ = { isa = PBXRezBuildPhase; buildActionMask = 2147483647; @@ -1397,7 +2277,7 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - BECDF6B90761BA81005FE872 /* Rez */ = { + DB31407317554B71006C0E22 /* Rez */ = { isa = PBXRezBuildPhase; buildActionMask = 2147483647; files = ( @@ -1407,46 +2287,19 @@ /* End PBXRezBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0032354E1070931700C76517 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 12; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# DOXYGEN_EXE is defined in the Enclosing Target's Build Tab\n# DOXYGEN_EXE=/Applications/Doxygen.app/Contents/Resources/doxygen\n#echo DOXYGEN_EXE dir is $DOXYGEN_EXE\n\nDOC_DIR=$SRCROOT/../XcodeDocSet\n#echo Doc dir is $DOC_DIR\ncd $DOC_DIR\n$DOXYGEN_EXE $DOC_DIR/Doxyfile\ncd html\nmake\nif [ -d $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset ] ; then\n\t# remove previous docset\n\trm -rf $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset\nfi\nmv org.libsdl.sdl.docset ..\ncd ..\nrm -rf html\nexit 0"; - }; - 00D55F050A11143E0030ED2A /* Run Script to Create SDL_config.h */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script to Create SDL_config.h"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Make sure that include/SDL_config.h is a symlink to SDL_config.h.default.\n# If it exists and is not a symlink, it was probably generated by configure and\n# we move it aside.\nif [ ! -L ../../include/SDL_config.h ]; then\n if [ -e ../../include/SDL_config.h ]; then\n mv ../../include/SDL_config.h ../../include/SDL_config.h.generated\n fi\n ln -s SDL_config.h.default ../../include/SDL_config.h\nfi\n"; - }; - 00D55F080A11147F0030ED2A /* Run Script to Create SDL_config.h */ = { + AA5C3FDC17A8C58600D6C8A1 /* Sign Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Run Script to Create SDL_config.h"; + name = "Sign Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Make sure that include/SDL_config.h is a symlink to SDL_config.h.default.\n# If it exists and is not a symlink, it was probably generated by configure and\n# we move it aside.\nif [ ! -L ../../include/SDL_config.h ]; then\n if [ -e ../../include/SDL_config.h ]; then\n mv ../../include/SDL_config.h ../../include/SDL_config.h.generated\n fi\n ln -s SDL_config.h.default ../../include/SDL_config.h\nfi\n"; + shellScript = "if [ \"$USER\" = \"slouken\" ]; then\n CODE_SIGN_IDENTITY=\"Mac Developer: Sam Lantinga (84TP7N5TA4)\" pkg-support/codesign-frameworks.sh || exit 1\nfi"; }; BECDF6BD0761BA81005FE872 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -1455,17 +2308,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nmkdir -p build/dmg-tmp/devel-lite\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/SDL.framework build/dmg-tmp/\n\n# strip moved to Xcode native mechanism\n# strip -x build/dmg-tmp/SDL.framework/SDL\n\ncp pkg-support/resources/License.rtf build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\ncp pkg-support/resources/ReadMeDevLite.txt build/dmg-tmp/devel-lite\ncp pkg-support/resources/UniversalBinaryNotes.rtf build/dmg-tmp\n\ncp ../../src/main/macosx/SDLMain.h build/dmg-tmp/devel-lite\ncp ../../src/main/macosx/SDLMain.m build/dmg-tmp/devel-lite\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\nfind -d build/dmg-tmp -type d -name .svn -exec rm -rf \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL -srcfolder build/dmg-tmp build/SDL.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n\n# compress it???\n#(cd build; gnutar -zcvf SDL.dmg.tar.gz SDL.dmg)"; - }; - BECDF6C20761BA81005FE872 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - comments = "The old .pkg generator script:\n\n# make a copy of the framework to work with\nmkdir -p build/pkg-tmp\n\n## We're changing this to follow OS X conventions, where the headers and\n## framework are bundled together. Thus this development package won't \n## actually contain any direct framework elements.\n#/Developer/Tools/CpMac -r build/SDL.framework build/pkg-tmp/\n\n# copy in some files they might want around...\ncp ../../docs.html build/pkg-tmp\ncp -r ../../docs build/pkg-tmp\n#cp -r ../../src/main/macosx build/pkg-tmp/\n#rm -rf build/pkg-tmp/main/exports\ncp -r \"../Project Stationary\" build/pkg-tmp/\ncp \"pkg-support/Readme SDL Developer.txt\" build/pkg-tmp/\n#cp \"../uninstall.csh\" build/pkg-tmp/\n\n## We shouldn't have any framework stuff to deal with now\n# clean up the framework, remove extra files\n# rm -rf build/pkg-tmp/SDL.framework/Resources/pbdevelopment.plist\n\n# remove the .DS_Store file to keep tool from crapping out\nfind pkg-support -name \".DS_Store\" -exec rm -rf \"{}\" \";\" \n\n# create the .pkg\n../package build/pkg-tmp pkg-support/SDL-devel.info -d build -r pkg-support/devel-resources \n#\"/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker\" -build -p build/ -f build/pkg-tmp -r pkg-support/devel-resources -i Info.plist -d Description.plist\n\n# create install scripts\nDIR=build/SDL-devel.pkg/\ncp $DIR/install.sh $DIR/SDL-devel.post_install\nmv $DIR/install.sh $DIR/SDL-devel.post_upgrade\n\n# add execute flag to scripts\nchmod 755 $DIR/SDL-devel.post_install $DIR/SDL-devel.post_upgrade\n\n# remove temporary files\n#rm -rf build/pkg-tmp\n\n# compress\n(cd build; gnutar -zcvf SDL-devel.pkg.tar.gz SDL-devel.pkg)"; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# make a directory to hold the stuff we're going to package up\nmkdir -p build/devel-extras-tmp\nmkdir -p build/devel-extras-tmp/Documentation\nmkdir -p build/devel-extras-tmp/Documentation/docs/XcodeDocSet\nmkdir -p build/devel-extras-tmp/XcodeTemplates\nmkdir -p build/devel-extras-tmp/SDLMain\nmkdir -p build/devel-extras-tmp/SDLMain/NIBless\nmkdir -p build/devel-extras-tmp/SDLMain/CocoaMenus\n\n# copy the docs\ncp ../../docs.html build/devel-extras-tmp/Documentation\ncp -r ../../docs build/devel-extras-tmp/Documentation\n\n# Copy Doxyfile for DocSet\ncp $SRCROOT/../XcodeDocSet/Doxyfile build/devel-extras-tmp/Documentation/docs/XcodeDocSet\n\n# Copy DocSet (if it exists)\nif [ -d $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset ] ; then\n#\techo Found docset directory\n\tmv $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset build/devel-extras-tmp/Documentation/docs/XcodeDocSet/\nelse\n\techo Warning: Could not find DocSet and will be omitted from package\nfi\n\n# copy the Xcode Project user templates\ncp -r \"../TemplatesForXcodeTiger\" build/devel-extras-tmp/XcodeTemplates\ncp -r \"../TemplatesForXcodeLeopard\" build/devel-extras-tmp/XcodeTemplates\ncp -r \"../TemplatesForXcodeSnowLeopard\" build/devel-extras-tmp/XcodeTemplates\n\ncp \"pkg-support/Readme SDL Developer.txt\" build/devel-extras-tmp\n\n# readme file\n#cp pkg-support/resources/ReadMe.txt build/devel-extras-tmp\n\n#cp pkg-support/resources/UniversalBinaryNotes.rtf build/devel-extras-tmp\n\n# Copy the devel-lite stuff just in case the user didn't notice it in the main package\n# I should copy all the different SDLMain versions (and nibs) instead.\n# I'm assuming the default is the same as the SDL App and SDL/OpenGL templates\n\ncp pkg-support/resources/ReadMeDevLite.txt build/devel-extras-tmp/SDLMain/NIBless\ncp ../../src/main/macosx/SDLMain.h build/devel-extras-tmp/SDLMain/NIBless\ncp ../../src/main/macosx/SDLMain.m build/devel-extras-tmp/SDLMain/NIBless\n\n# Nib stuff from SDL-Cocoa App\n/Developer/Tools/CpMac -r \"../TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h\" build/devel-extras-tmp/SDLMain/CocoaMenus\n/Developer/Tools/CpMac -r \"../TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m\" build/devel-extras-tmp/SDLMain/CocoaMenus\n/Developer/Tools/CpMac -r \"../TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib\" build/devel-extras-tmp/SDLMain/CocoaMenus\n\n# Copy precompiled libSDLmain.a's here??? We have potentially 3 different ones?\n# /Developer/Tools/CpMac -r $TARGET_BUILD_DIR/libSDLmain.a build/devel-extras-tmp/SDLMain/NIBless\n#\n#\n\n# Copy sdl-config's for those who've been wanting one? Will need to document that it may\n# require manual changes if you don't install the framework to /Library/Frameworks\n# <>\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/devel-extras-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n# remove CVS stuff\nfind build/devel-extras-tmp -name .cvsignore -exec rm -f \"{}\" \\;\n# depth first traversal, type=directory, remove recursively\nfind -d build/devel-extras-tmp -type d -name CVS -exec rm -rf \"{}\" \\;\nfind -d build/devel-extras-tmp -type d -name .svn -exec rm -rf \"{}\" \\;\n\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL-devel-extras -srcfolder build/devel-extras-tmp build/SDL-devel-extras.dmg\n\n# clean up\nrm -rf build/devel-extras-tmp\n\n# compress it???\n#(cd build; gnutar -zcvf SDL.dmg.tar.gz SDL.dmg)\n\n"; + shellScript = "# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nxcrun CpMac -r $TARGET_BUILD_DIR/SDL2.framework build/dmg-tmp/\n\ncp pkg-support/resources/License.txt build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL2 -srcfolder build/dmg-tmp build/SDL2.dmg\n\n# clean up\nrm -rf build/dmg-tmp"; }; /* End PBXShellScriptBuildPhase section */ @@ -1474,94 +2317,116 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BECDF62E0761BA81005FE872 /* SDL_audio.c in Sources */, - BECDF62F0761BA81005FE872 /* SDL_audiocvt.c in Sources */, - BECDF6300761BA81005FE872 /* SDL_audiodev.c in Sources */, - BECDF6320761BA81005FE872 /* SDL_mixer.c in Sources */, - BECDF6330761BA81005FE872 /* SDL_wave.c in Sources */, - BECDF6350761BA81005FE872 /* SDL_active.c in Sources */, - BECDF6360761BA81005FE872 /* SDL_events.c in Sources */, - BECDF6370761BA81005FE872 /* SDL_expose.c in Sources */, - BECDF6380761BA81005FE872 /* SDL_keyboard.c in Sources */, - BECDF6390761BA81005FE872 /* SDL_mouse.c in Sources */, - BECDF63A0761BA81005FE872 /* SDL_quit.c in Sources */, - BECDF63B0761BA81005FE872 /* SDL_resize.c in Sources */, - BECDF63C0761BA81005FE872 /* SDL_rwops.c in Sources */, - BECDF63E0761BA81005FE872 /* SDL_timer.c in Sources */, - BECDF63F0761BA81005FE872 /* SDL_blit.c in Sources */, - BECDF6400761BA81005FE872 /* SDL_blit_0.c in Sources */, - BECDF6410761BA81005FE872 /* SDL_blit_1.c in Sources */, - BECDF6420761BA81005FE872 /* SDL_blit_A.c in Sources */, - BECDF6430761BA81005FE872 /* SDL_blit_N.c in Sources */, - BECDF6440761BA81005FE872 /* SDL_bmp.c in Sources */, - BECDF6450761BA81005FE872 /* SDL_cursor.c in Sources */, - BECDF6460761BA81005FE872 /* SDL_gamma.c in Sources */, - BECDF6470761BA81005FE872 /* SDL_pixels.c in Sources */, - BECDF6480761BA81005FE872 /* SDL_RLEaccel.c in Sources */, - BECDF6490761BA81005FE872 /* SDL_surface.c in Sources */, - BECDF64A0761BA81005FE872 /* SDL_video.c in Sources */, - BECDF64B0761BA81005FE872 /* SDL_yuv.c in Sources */, - BECDF64C0761BA81005FE872 /* SDL_yuv_sw.c in Sources */, - BECDF64D0761BA81005FE872 /* SDL_error.c in Sources */, - BECDF64E0761BA81005FE872 /* SDL_fatal.c in Sources */, - BECDF6500761BA81005FE872 /* SDL.c in Sources */, - BECDF6510761BA81005FE872 /* SDL_thread.c in Sources */, - BECDF6520761BA81005FE872 /* SDL_cdrom.c in Sources */, - BECDF6530761BA81005FE872 /* SDL_joystick.c in Sources */, - BECDF6580761BA81005FE872 /* SDL_stretch.c in Sources */, - BECDF6590761BA81005FE872 /* SDL_sysjoystick.c in Sources */, - BECDF65B0761BA81005FE872 /* SDL_QuartzEvents.m in Sources */, - BECDF65C0761BA81005FE872 /* SDL_QuartzGL.m in Sources */, - BECDF65D0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */, - BECDF65E0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */, - BECDF65F0761BA81005FE872 /* SDL_QuartzWM.m in Sources */, - BECDF6610761BA81005FE872 /* SDL_cpuinfo.c in Sources */, - BECDF6620761BA81005FE872 /* SDL_syscdrom.c in Sources */, - BECDF6670761BA81005FE872 /* SDL_coreaudio.c in Sources */, - 004C2C8B0975E13300E9D430 /* AudioFilePlayer.c in Sources */, - 004C2C8C0975E13300E9D430 /* AudioFileReaderThread.c in Sources */, - 004C2C8D0975E13300E9D430 /* CDPlayer.c in Sources */, - 004C2C8E0975E13300E9D430 /* SDLOSXCAGuard.c in Sources */, - 00162D5309BD20DA0037C8D0 /* SDL_syscond.c in Sources */, - 00162D5409BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */, - 00162D5609BD20DA0037C8D0 /* SDL_syssem.c in Sources */, - 00162D5709BD20DA0037C8D0 /* SDL_systhread.c in Sources */, - 00162D6109BD21010037C8D0 /* SDL_systimer.c in Sources */, - 00162D6B09BD214F0037C8D0 /* SDL_getenv.c in Sources */, - 00162D6C09BD214F0037C8D0 /* SDL_malloc.c in Sources */, - 00162D6D09BD214F0037C8D0 /* SDL_qsort.c in Sources */, - 00162D6E09BD214F0037C8D0 /* SDL_stdlib.c in Sources */, - 00162D6F09BD214F0037C8D0 /* SDL_string.c in Sources */, - 00162E6809BD27300037C8D0 /* SDL_mixer_MMX.c in Sources */, - 00162F3B09BE27FB0037C8D0 /* SDL_nullevents.c in Sources */, - 00162F3D09BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */, - 00162F3F09BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */, - 0014B7EF09C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */, - 0014B7F109C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */, - 0014B7F209C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */, - 0014B84F09C0D977003A99D5 /* SDL_x11dga.c in Sources */, - 0014B85009C0D977003A99D5 /* SDL_x11dyn.c in Sources */, - 0014B85309C0D977003A99D5 /* SDL_x11events.c in Sources */, - 0014B85509C0D977003A99D5 /* SDL_x11gamma.c in Sources */, - 0014B85709C0D977003A99D5 /* SDL_x11gl.c in Sources */, - 0014B85909C0D977003A99D5 /* SDL_x11image.c in Sources */, - 0014B85B09C0D977003A99D5 /* SDL_x11modes.c in Sources */, - 0014B85D09C0D977003A99D5 /* SDL_x11mouse.c in Sources */, - 0014B85F09C0D977003A99D5 /* SDL_x11video.c in Sources */, - 0014B86209C0D977003A99D5 /* SDL_x11wm.c in Sources */, - 0014B86409C0D977003A99D5 /* SDL_x11yuv.c in Sources */, - 0014B89209C0DA94003A99D5 /* XF86DGA.c in Sources */, - 0014B89309C0DA94003A99D5 /* XF86DGA2.c in Sources */, - 0014B89709C0DAA1003A99D5 /* XF86VMode.c in Sources */, - 0014B89B09C0DAAE003A99D5 /* Xv.c in Sources */, - 0014B8A009C0DAB9003A99D5 /* Xinerama.c in Sources */, - 0014B8A309C0DAC4003A99D5 /* xme.c in Sources */, - 002F328609CA049100EBEB88 /* SDL_iconv.c in Sources */, - 002F32D709CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */, - 002F32E509CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */, - 046B91EC0A11B53500FB151C /* SDL_sysloadso.c in Sources */, - 046B92130A11B8AD00FB151C /* SDL_dlcompat.c in Sources */, - 00EAE6FC0C4D3F84009A420A /* SDL_yuv_mmx.c in Sources */, + 04BDFFFB12E6671800899322 /* SDL_atomic.c in Sources */, + 04BDFFFC12E6671800899322 /* SDL_spinlock.c in Sources */, + 04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */, + 04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */, + 04BD001812E6671800899322 /* SDL_coreaudio.c in Sources */, + 04BD002612E6671800899322 /* SDL_audio.c in Sources */, + 04BD002812E6671800899322 /* SDL_audiocvt.c in Sources */, + 04BD002912E6671800899322 /* SDL_audiodev.c in Sources */, + 04BD002C12E6671800899322 /* SDL_audiotypecvt.c in Sources */, + 04BD002D12E6671800899322 /* SDL_mixer.c in Sources */, + 04BD003512E6671800899322 /* SDL_wave.c in Sources */, + 04BD004112E6671800899322 /* SDL_cpuinfo.c in Sources */, + 04BD004812E6671800899322 /* SDL_clipboardevents.c in Sources */, + 04BD004A12E6671800899322 /* SDL_events.c in Sources */, + 04BD004C12E6671800899322 /* SDL_gesture.c in Sources */, + 04BD004E12E6671800899322 /* SDL_keyboard.c in Sources */, + 04BD005012E6671800899322 /* SDL_mouse.c in Sources */, + 04BD005212E6671800899322 /* SDL_quit.c in Sources */, + 04BD005412E6671800899322 /* SDL_touch.c in Sources */, + 04BD005612E6671800899322 /* SDL_windowevents.c in Sources */, + 04BD005912E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */, + 04BD005A12E6671800899322 /* SDL_rwops.c in Sources */, + 04BD005B12E6671800899322 /* SDL_syshaptic.c in Sources */, + 04BD005F12E6671800899322 /* SDL_haptic.c in Sources */, + 04BD006612E6671800899322 /* SDL_sysjoystick.c in Sources */, + 04BD007012E6671800899322 /* SDL_joystick.c in Sources */, + 04BD008812E6671800899322 /* SDL_sysloadso.c in Sources */, + 04BD009412E6671800899322 /* SDL_syspower.c in Sources */, + 04BD009612E6671800899322 /* SDL_power.c in Sources */, + 04BD009C12E6671800899322 /* SDL_assert.c in Sources */, + 04BD009F12E6671800899322 /* SDL_error.c in Sources */, + 04BD00A212E6671800899322 /* SDL.c in Sources */, + 04BD00A312E6671800899322 /* SDL_getenv.c in Sources */, + 04BD00A412E6671800899322 /* SDL_iconv.c in Sources */, + 04BD00A512E6671800899322 /* SDL_malloc.c in Sources */, + 04BD00A612E6671800899322 /* SDL_qsort.c in Sources */, + 04BD00A712E6671800899322 /* SDL_stdlib.c in Sources */, + 04BD00A812E6671800899322 /* SDL_string.c in Sources */, + 04BD00BD12E6671800899322 /* SDL_syscond.c in Sources */, + 04BD00BE12E6671800899322 /* SDL_sysmutex.c in Sources */, + 04BD00C012E6671800899322 /* SDL_syssem.c in Sources */, + 04BD00C112E6671800899322 /* SDL_systhread.c in Sources */, + 04BD00CA12E6671800899322 /* SDL_thread.c in Sources */, + 04BD00D712E6671800899322 /* SDL_timer.c in Sources */, + 04BD00D912E6671800899322 /* SDL_systimer.c in Sources */, + 04BD00F412E6671800899322 /* SDL_cocoaclipboard.m in Sources */, + 04BD00F612E6671800899322 /* SDL_cocoaevents.m in Sources */, + 04BD00F812E6671800899322 /* SDL_cocoakeyboard.m in Sources */, + 04BD00FA12E6671800899322 /* SDL_cocoamodes.m in Sources */, + 04BD00FC12E6671800899322 /* SDL_cocoamouse.m in Sources */, + 04BD00FE12E6671800899322 /* SDL_cocoaopengl.m in Sources */, + 04BD010012E6671800899322 /* SDL_cocoashape.m in Sources */, + 04BD010212E6671800899322 /* SDL_cocoavideo.m in Sources */, + 04BD010412E6671800899322 /* SDL_cocoawindow.m in Sources */, + 04BD011712E6671800899322 /* SDL_nullevents.c in Sources */, + 04BD011B12E6671800899322 /* SDL_nullvideo.c in Sources */, + 04BD017512E6671800899322 /* SDL_blit.c in Sources */, + 04BD017712E6671800899322 /* SDL_blit_0.c in Sources */, + 04BD017812E6671800899322 /* SDL_blit_1.c in Sources */, + 04BD017912E6671800899322 /* SDL_blit_A.c in Sources */, + 04BD017A12E6671800899322 /* SDL_blit_auto.c in Sources */, + 04BD017C12E6671800899322 /* SDL_blit_copy.c in Sources */, + 04BD017E12E6671800899322 /* SDL_blit_N.c in Sources */, + 04BD017F12E6671800899322 /* SDL_blit_slow.c in Sources */, + 04BD018112E6671800899322 /* SDL_bmp.c in Sources */, + 04BD018212E6671800899322 /* SDL_clipboard.c in Sources */, + 04BD018712E6671800899322 /* SDL_fillrect.c in Sources */, + 04BD018C12E6671800899322 /* SDL_pixels.c in Sources */, + 04BD018E12E6671800899322 /* SDL_rect.c in Sources */, + 04BD019612E6671800899322 /* SDL_RLEaccel.c in Sources */, + 04BD019812E6671800899322 /* SDL_shape.c in Sources */, + 04BD019A12E6671800899322 /* SDL_stretch.c in Sources */, + 04BD019B12E6671800899322 /* SDL_surface.c in Sources */, + 04BD019D12E6671800899322 /* SDL_video.c in Sources */, + 04BD01DB12E6671800899322 /* imKStoUCS.c in Sources */, + 04BD01DD12E6671800899322 /* SDL_x11clipboard.c in Sources */, + 04BD01DF12E6671800899322 /* SDL_x11dyn.c in Sources */, + 04BD01E112E6671800899322 /* SDL_x11events.c in Sources */, + 04BD01E512E6671800899322 /* SDL_x11keyboard.c in Sources */, + 04BD01E712E6671800899322 /* SDL_x11modes.c in Sources */, + 04BD01E912E6671800899322 /* SDL_x11mouse.c in Sources */, + 04BD01EB12E6671800899322 /* SDL_x11opengl.c in Sources */, + 04BD01ED12E6671800899322 /* SDL_x11opengles.c in Sources */, + 04BD01F112E6671800899322 /* SDL_x11shape.c in Sources */, + 04BD01F412E6671800899322 /* SDL_x11touch.c in Sources */, + 04BD01F612E6671800899322 /* SDL_x11video.c in Sources */, + 04BD01F812E6671800899322 /* SDL_x11window.c in Sources */, + 041B2CA512FA0D680087D585 /* SDL_render.c in Sources */, + 04409B9212FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */, + 04409B9412FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */, + 04F7803A12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */, + 04F7804912FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */, + 04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */, + 04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */, + 04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */, + 04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */, + 0442EC1812FE1BBA004C9285 /* SDL_render_gl.c in Sources */, + 0442EC1D12FE1BCB004C9285 /* SDL_render_sw.c in Sources */, + 0442EC5A12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */, + 0442EC5F12FE1C75004C9285 /* SDL_hints.c in Sources */, + 04BAC0C81300C2160055DE28 /* SDL_log.c in Sources */, + 0435673E1303160F00BA5428 /* SDL_shaders_gl.c in Sources */, + 566CDE90148F0AC200C5A9BB /* SDL_dropevents.c in Sources */, + AA628ACA159367B7005138DD /* SDL_rotate.c in Sources */, + AA628AD1159367F2005138DD /* SDL_x11xinput2.c in Sources */, + AA9E4093163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */, + AABCC38F164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */, + AA0AD09D16648D1700CE5896 /* SDL_gamecontroller.c in Sources */, + AA0F8491178D5ECC00823F9D /* SDL_systls.c in Sources */, + D55A1B82179F262300625D7C /* SDL_cocoamousetap.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1569,113 +2434,239 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BECDF67A0761BA81005FE872 /* SDL_audio.c in Sources */, - BECDF67B0761BA81005FE872 /* SDL_audiocvt.c in Sources */, - BECDF67D0761BA81005FE872 /* SDL_audiodev.c in Sources */, - BECDF67E0761BA81005FE872 /* SDL_mixer.c in Sources */, - BECDF67F0761BA81005FE872 /* SDL_wave.c in Sources */, - BECDF6810761BA81005FE872 /* SDL_cdrom.c in Sources */, - BECDF6830761BA81005FE872 /* SDL_active.c in Sources */, - BECDF6840761BA81005FE872 /* SDL_events.c in Sources */, - BECDF6850761BA81005FE872 /* SDL_expose.c in Sources */, - BECDF6860761BA81005FE872 /* SDL_keyboard.c in Sources */, - BECDF6870761BA81005FE872 /* SDL_mouse.c in Sources */, - BECDF6880761BA81005FE872 /* SDL_quit.c in Sources */, - BECDF6890761BA81005FE872 /* SDL_resize.c in Sources */, - BECDF68A0761BA81005FE872 /* SDL_rwops.c in Sources */, - BECDF68B0761BA81005FE872 /* SDL_joystick.c in Sources */, - BECDF68C0761BA81005FE872 /* SDL_thread.c in Sources */, - BECDF6920761BA81005FE872 /* SDL_timer.c in Sources */, - BECDF6930761BA81005FE872 /* SDL_blit.c in Sources */, - BECDF6940761BA81005FE872 /* SDL_blit_0.c in Sources */, - BECDF6950761BA81005FE872 /* SDL_blit_1.c in Sources */, - BECDF6960761BA81005FE872 /* SDL_blit_A.c in Sources */, - BECDF6970761BA81005FE872 /* SDL_blit_N.c in Sources */, - BECDF6980761BA81005FE872 /* SDL_bmp.c in Sources */, - BECDF6990761BA81005FE872 /* SDL_cursor.c in Sources */, - BECDF69A0761BA81005FE872 /* SDL_gamma.c in Sources */, - BECDF69B0761BA81005FE872 /* SDL_pixels.c in Sources */, - BECDF69C0761BA81005FE872 /* SDL_RLEaccel.c in Sources */, - BECDF69D0761BA81005FE872 /* SDL_stretch.c in Sources */, - BECDF69E0761BA81005FE872 /* SDL_surface.c in Sources */, - BECDF69F0761BA81005FE872 /* SDL_video.c in Sources */, - BECDF6A00761BA81005FE872 /* SDL_yuv.c in Sources */, - BECDF6A10761BA81005FE872 /* SDL_yuv_sw.c in Sources */, - BECDF6A20761BA81005FE872 /* SDL_error.c in Sources */, - BECDF6A30761BA81005FE872 /* SDL_fatal.c in Sources */, - BECDF6A50761BA81005FE872 /* SDL.c in Sources */, - BECDF6A60761BA81005FE872 /* SDL_sysjoystick.c in Sources */, - BECDF6A80761BA81005FE872 /* SDL_syscdrom.c in Sources */, - BECDF6A90761BA81005FE872 /* SDL_QuartzEvents.m in Sources */, - BECDF6AA0761BA81005FE872 /* SDL_QuartzGL.m in Sources */, - BECDF6AB0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */, - BECDF6AC0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */, - BECDF6AD0761BA81005FE872 /* SDL_QuartzWM.m in Sources */, - BECDF6AF0761BA81005FE872 /* SDL_cpuinfo.c in Sources */, - BECDF6B00761BA81005FE872 /* SDL_coreaudio.c in Sources */, - 004C2C900975E13300E9D430 /* AudioFilePlayer.c in Sources */, - 004C2C910975E13300E9D430 /* AudioFileReaderThread.c in Sources */, - 004C2C920975E13300E9D430 /* CDPlayer.c in Sources */, - 004C2C930975E13300E9D430 /* SDLOSXCAGuard.c in Sources */, - 00162D5909BD20DA0037C8D0 /* SDL_syscond.c in Sources */, - 00162D5A09BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */, - 00162D5C09BD20DA0037C8D0 /* SDL_syssem.c in Sources */, - 00162D5D09BD20DA0037C8D0 /* SDL_systhread.c in Sources */, - 00162D6209BD21010037C8D0 /* SDL_systimer.c in Sources */, - 00162D7009BD214F0037C8D0 /* SDL_getenv.c in Sources */, - 00162D7109BD214F0037C8D0 /* SDL_malloc.c in Sources */, - 00162D7209BD214F0037C8D0 /* SDL_qsort.c in Sources */, - 00162D7309BD214F0037C8D0 /* SDL_stdlib.c in Sources */, - 00162D7409BD214F0037C8D0 /* SDL_string.c in Sources */, - 00162E6A09BD27360037C8D0 /* SDL_mixer_MMX.c in Sources */, - 00162F4109BE27FB0037C8D0 /* SDL_nullevents.c in Sources */, - 00162F4309BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */, - 00162F4509BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */, - 0014B7F509C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */, - 0014B7F709C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */, - 0014B7F809C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */, - 0014B86609C0D977003A99D5 /* SDL_x11dga.c in Sources */, - 0014B86709C0D977003A99D5 /* SDL_x11dyn.c in Sources */, - 0014B86A09C0D977003A99D5 /* SDL_x11events.c in Sources */, - 0014B86C09C0D977003A99D5 /* SDL_x11gamma.c in Sources */, - 0014B86E09C0D977003A99D5 /* SDL_x11gl.c in Sources */, - 0014B87009C0D977003A99D5 /* SDL_x11image.c in Sources */, - 0014B87209C0D977003A99D5 /* SDL_x11modes.c in Sources */, - 0014B87409C0D977003A99D5 /* SDL_x11mouse.c in Sources */, - 0014B87609C0D977003A99D5 /* SDL_x11video.c in Sources */, - 0014B87909C0D977003A99D5 /* SDL_x11wm.c in Sources */, - 0014B87B09C0D977003A99D5 /* SDL_x11yuv.c in Sources */, - 0014B89409C0DA94003A99D5 /* XF86DGA.c in Sources */, - 0014B89509C0DA94003A99D5 /* XF86DGA2.c in Sources */, - 0014B89809C0DAA1003A99D5 /* XF86VMode.c in Sources */, - 0014B89D09C0DAAE003A99D5 /* Xv.c in Sources */, - 0014B8A109C0DAB9003A99D5 /* Xinerama.c in Sources */, - 0014B8A409C0DAC4003A99D5 /* xme.c in Sources */, - 002F328709CA049100EBEB88 /* SDL_iconv.c in Sources */, - 002F32D909CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */, - 002F32E709CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */, - 046B91ED0A11B53500FB151C /* SDL_sysloadso.c in Sources */, - 046B92140A11B8AD00FB151C /* SDL_dlcompat.c in Sources */, - 00EAE6FD0C4D3F88009A420A /* SDL_yuv_mmx.c in Sources */, + 04BD021712E6671800899322 /* SDL_atomic.c in Sources */, + 04BD021812E6671800899322 /* SDL_spinlock.c in Sources */, + 04BD022412E6671800899322 /* SDL_diskaudio.c in Sources */, + 04BD022C12E6671800899322 /* SDL_dummyaudio.c in Sources */, + 04BD023412E6671800899322 /* SDL_coreaudio.c in Sources */, + 04BD024212E6671800899322 /* SDL_audio.c in Sources */, + 04BD024412E6671800899322 /* SDL_audiocvt.c in Sources */, + 04BD024512E6671800899322 /* SDL_audiodev.c in Sources */, + 04BD024812E6671800899322 /* SDL_audiotypecvt.c in Sources */, + 04BD024912E6671800899322 /* SDL_mixer.c in Sources */, + 04BD025112E6671800899322 /* SDL_wave.c in Sources */, + 04BD025C12E6671800899322 /* SDL_cpuinfo.c in Sources */, + 04BD026312E6671800899322 /* SDL_clipboardevents.c in Sources */, + 04BD026512E6671800899322 /* SDL_events.c in Sources */, + AA41F88014B8F1F500993C4F /* SDL_dropevents.c in Sources */, + 04BD026712E6671800899322 /* SDL_gesture.c in Sources */, + 04BD026912E6671800899322 /* SDL_keyboard.c in Sources */, + 04BD026B12E6671800899322 /* SDL_mouse.c in Sources */, + 04BD026D12E6671800899322 /* SDL_quit.c in Sources */, + 04BD026F12E6671800899322 /* SDL_touch.c in Sources */, + 04BD027112E6671800899322 /* SDL_windowevents.c in Sources */, + 04BD027412E6671800899322 /* SDL_rwopsbundlesupport.m in Sources */, + 04BD027512E6671800899322 /* SDL_rwops.c in Sources */, + 04BD027612E6671800899322 /* SDL_syshaptic.c in Sources */, + 04BD027A12E6671800899322 /* SDL_haptic.c in Sources */, + 04BD028112E6671800899322 /* SDL_sysjoystick.c in Sources */, + BBFC088D164C6647003E6A99 /* SDL_gamecontroller.c in Sources */, + 04BD028B12E6671800899322 /* SDL_joystick.c in Sources */, + 04BD02A312E6671800899322 /* SDL_sysloadso.c in Sources */, + 04BD02AE12E6671800899322 /* SDL_syspower.c in Sources */, + 04BD02B012E6671800899322 /* SDL_power.c in Sources */, + 04BD02B612E6671800899322 /* SDL_assert.c in Sources */, + 04BD02B912E6671800899322 /* SDL_error.c in Sources */, + 04BD02BC12E6671800899322 /* SDL.c in Sources */, + 04BD02BD12E6671800899322 /* SDL_getenv.c in Sources */, + 04BD02BE12E6671800899322 /* SDL_iconv.c in Sources */, + 04BD02BF12E6671800899322 /* SDL_malloc.c in Sources */, + 04BD02C012E6671800899322 /* SDL_qsort.c in Sources */, + 04BD02C112E6671800899322 /* SDL_stdlib.c in Sources */, + 04BD02C212E6671800899322 /* SDL_string.c in Sources */, + 04BD02D712E6671800899322 /* SDL_syscond.c in Sources */, + 04BD02D812E6671800899322 /* SDL_sysmutex.c in Sources */, + 04BD02DA12E6671800899322 /* SDL_syssem.c in Sources */, + 04BD02DB12E6671800899322 /* SDL_systhread.c in Sources */, + 04BD02E412E6671800899322 /* SDL_thread.c in Sources */, + 04BD02F112E6671800899322 /* SDL_timer.c in Sources */, + 04BD02F312E6671800899322 /* SDL_systimer.c in Sources */, + 04BD030E12E6671800899322 /* SDL_cocoaclipboard.m in Sources */, + 04BD031012E6671800899322 /* SDL_cocoaevents.m in Sources */, + 04BD031212E6671800899322 /* SDL_cocoakeyboard.m in Sources */, + 04BD031412E6671800899322 /* SDL_cocoamodes.m in Sources */, + 04BD031612E6671800899322 /* SDL_cocoamouse.m in Sources */, + 04BD031812E6671800899322 /* SDL_cocoaopengl.m in Sources */, + 04BD031A12E6671800899322 /* SDL_cocoashape.m in Sources */, + 04BD031C12E6671800899322 /* SDL_cocoavideo.m in Sources */, + 04BD031E12E6671800899322 /* SDL_cocoawindow.m in Sources */, + 04BD033112E6671800899322 /* SDL_nullevents.c in Sources */, + 04BD033512E6671800899322 /* SDL_nullvideo.c in Sources */, + 04BD038F12E6671800899322 /* SDL_blit.c in Sources */, + 04BD039112E6671800899322 /* SDL_blit_0.c in Sources */, + 04BD039212E6671800899322 /* SDL_blit_1.c in Sources */, + 04BD039312E6671800899322 /* SDL_blit_A.c in Sources */, + 04BD039412E6671800899322 /* SDL_blit_auto.c in Sources */, + 04BD039612E6671800899322 /* SDL_blit_copy.c in Sources */, + 04BD039812E6671800899322 /* SDL_blit_N.c in Sources */, + 04BD039912E6671800899322 /* SDL_blit_slow.c in Sources */, + 04BD039B12E6671800899322 /* SDL_bmp.c in Sources */, + 04BD039C12E6671800899322 /* SDL_clipboard.c in Sources */, + 04BD03A112E6671800899322 /* SDL_fillrect.c in Sources */, + 04BD03A612E6671800899322 /* SDL_pixels.c in Sources */, + 04BD03A812E6671800899322 /* SDL_rect.c in Sources */, + 04BD03B012E6671800899322 /* SDL_RLEaccel.c in Sources */, + 04BD03B212E6671800899322 /* SDL_shape.c in Sources */, + 04BD03B412E6671800899322 /* SDL_stretch.c in Sources */, + 04BD03B512E6671800899322 /* SDL_surface.c in Sources */, + 04BD03B712E6671800899322 /* SDL_video.c in Sources */, + 04BD03F312E6671800899322 /* imKStoUCS.c in Sources */, + 04BD03F512E6671800899322 /* SDL_x11clipboard.c in Sources */, + 04BD03F712E6671800899322 /* SDL_x11dyn.c in Sources */, + 04BD03F912E6671800899322 /* SDL_x11events.c in Sources */, + 04BD03FD12E6671800899322 /* SDL_x11keyboard.c in Sources */, + 04BD03FF12E6671800899322 /* SDL_x11modes.c in Sources */, + 04BD040112E6671800899322 /* SDL_x11mouse.c in Sources */, + 04BD040312E6671800899322 /* SDL_x11opengl.c in Sources */, + 04BD040512E6671800899322 /* SDL_x11opengles.c in Sources */, + 04BD040912E6671800899322 /* SDL_x11shape.c in Sources */, + 04BD040C12E6671800899322 /* SDL_x11touch.c in Sources */, + 04BD040E12E6671800899322 /* SDL_x11video.c in Sources */, + 04BD041012E6671800899322 /* SDL_x11window.c in Sources */, + 041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */, + 04409B9612FA97ED00FB9AA8 /* SDL_yuv_mmx.c in Sources */, + 04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */, + 04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */, + 04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */, + 04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */, + 04F7805912FB74A200FC43C0 /* SDL_blendpoint.c in Sources */, + 04F7805C12FB74A200FC43C0 /* SDL_drawline.c in Sources */, + 04F7805E12FB74A200FC43C0 /* SDL_drawpoint.c in Sources */, + 0442EC1912FE1BBA004C9285 /* SDL_render_gl.c in Sources */, + 0442EC1F12FE1BCB004C9285 /* SDL_render_sw.c in Sources */, + 0442EC5C12FE1C60004C9285 /* SDL_x11framebuffer.c in Sources */, + 0442EC6012FE1C75004C9285 /* SDL_hints.c in Sources */, + 04BAC0C91300C2160055DE28 /* SDL_log.c in Sources */, + 043567401303160F00BA5428 /* SDL_shaders_gl.c in Sources */, + AA628ACB159367B7005138DD /* SDL_rotate.c in Sources */, + AA628AD2159367F2005138DD /* SDL_x11xinput2.c in Sources */, + AA9E4094163BE51E007A2AD0 /* SDL_x11messagebox.c in Sources */, + AABCC390164063D200AB8930 /* SDL_cocoamessagebox.m in Sources */, + AA0F8492178D5ECC00823F9D /* SDL_systls.c in Sources */, + D55A1B84179F263600625D7C /* SDL_cocoamousetap.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BECDF6B60761BA81005FE872 /* Sources */ = { + DB313FFD17554B71006C0E22 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BECDF6B70761BA81005FE872 /* SDLMain.m in Sources */, + DB313FFE17554B71006C0E22 /* SDL_atomic.c in Sources */, + DB313FFF17554B71006C0E22 /* SDL_spinlock.c in Sources */, + DB31400017554B71006C0E22 /* SDL_diskaudio.c in Sources */, + DB31400117554B71006C0E22 /* SDL_dummyaudio.c in Sources */, + DB31400217554B71006C0E22 /* SDL_coreaudio.c in Sources */, + DB31400317554B71006C0E22 /* SDL_audio.c in Sources */, + DB31400417554B71006C0E22 /* SDL_audiocvt.c in Sources */, + DB31400517554B71006C0E22 /* SDL_audiodev.c in Sources */, + DB31400617554B71006C0E22 /* SDL_audiotypecvt.c in Sources */, + DB31400717554B71006C0E22 /* SDL_mixer.c in Sources */, + DB31400817554B71006C0E22 /* SDL_wave.c in Sources */, + DB31400917554B71006C0E22 /* SDL_cpuinfo.c in Sources */, + DB31400A17554B71006C0E22 /* SDL_clipboardevents.c in Sources */, + DB31400B17554B71006C0E22 /* SDL_events.c in Sources */, + DB31400C17554B71006C0E22 /* SDL_dropevents.c in Sources */, + DB31400D17554B71006C0E22 /* SDL_gesture.c in Sources */, + DB31400E17554B71006C0E22 /* SDL_keyboard.c in Sources */, + DB31400F17554B71006C0E22 /* SDL_mouse.c in Sources */, + DB31401017554B71006C0E22 /* SDL_quit.c in Sources */, + DB31401117554B71006C0E22 /* SDL_touch.c in Sources */, + DB31401217554B71006C0E22 /* SDL_windowevents.c in Sources */, + DB31401317554B71006C0E22 /* SDL_rwopsbundlesupport.m in Sources */, + DB31401417554B71006C0E22 /* SDL_rwops.c in Sources */, + DB31401517554B71006C0E22 /* SDL_syshaptic.c in Sources */, + DB31401617554B71006C0E22 /* SDL_haptic.c in Sources */, + DB31401717554B71006C0E22 /* SDL_sysjoystick.c in Sources */, + DB31401817554B71006C0E22 /* SDL_gamecontroller.c in Sources */, + DB31401917554B71006C0E22 /* SDL_joystick.c in Sources */, + DB31401A17554B71006C0E22 /* SDL_sysloadso.c in Sources */, + DB31401B17554B71006C0E22 /* SDL_syspower.c in Sources */, + DB31401C17554B71006C0E22 /* SDL_power.c in Sources */, + DB31401D17554B71006C0E22 /* SDL_assert.c in Sources */, + DB31401E17554B71006C0E22 /* SDL_error.c in Sources */, + DB31402017554B71006C0E22 /* SDL.c in Sources */, + DB31402117554B71006C0E22 /* SDL_getenv.c in Sources */, + DB31402217554B71006C0E22 /* SDL_iconv.c in Sources */, + DB31402317554B71006C0E22 /* SDL_malloc.c in Sources */, + DB31402417554B71006C0E22 /* SDL_qsort.c in Sources */, + DB31402517554B71006C0E22 /* SDL_stdlib.c in Sources */, + DB31402617554B71006C0E22 /* SDL_string.c in Sources */, + DB31402717554B71006C0E22 /* SDL_syscond.c in Sources */, + DB31402817554B71006C0E22 /* SDL_sysmutex.c in Sources */, + DB31402917554B71006C0E22 /* SDL_syssem.c in Sources */, + DB31402A17554B71006C0E22 /* SDL_systhread.c in Sources */, + DB31402B17554B71006C0E22 /* SDL_thread.c in Sources */, + DB31402C17554B71006C0E22 /* SDL_timer.c in Sources */, + DB31402D17554B71006C0E22 /* SDL_systimer.c in Sources */, + DB31402E17554B71006C0E22 /* SDL_cocoaclipboard.m in Sources */, + DB31402F17554B71006C0E22 /* SDL_cocoaevents.m in Sources */, + DB31403017554B71006C0E22 /* SDL_cocoakeyboard.m in Sources */, + DB31403117554B71006C0E22 /* SDL_cocoamodes.m in Sources */, + DB31403217554B71006C0E22 /* SDL_cocoamouse.m in Sources */, + DB31403317554B71006C0E22 /* SDL_cocoaopengl.m in Sources */, + DB31403417554B71006C0E22 /* SDL_cocoashape.m in Sources */, + DB31403517554B71006C0E22 /* SDL_cocoavideo.m in Sources */, + DB31403617554B71006C0E22 /* SDL_cocoawindow.m in Sources */, + DB31403717554B71006C0E22 /* SDL_nullevents.c in Sources */, + DB31403817554B71006C0E22 /* SDL_nullvideo.c in Sources */, + DB31403917554B71006C0E22 /* SDL_blit.c in Sources */, + DB31403A17554B71006C0E22 /* SDL_blit_0.c in Sources */, + DB31403B17554B71006C0E22 /* SDL_blit_1.c in Sources */, + DB31403C17554B71006C0E22 /* SDL_blit_A.c in Sources */, + DB31403D17554B71006C0E22 /* SDL_blit_auto.c in Sources */, + DB31403E17554B71006C0E22 /* SDL_blit_copy.c in Sources */, + DB31403F17554B71006C0E22 /* SDL_blit_N.c in Sources */, + DB31404017554B71006C0E22 /* SDL_blit_slow.c in Sources */, + DB31404117554B71006C0E22 /* SDL_bmp.c in Sources */, + DB31404217554B71006C0E22 /* SDL_clipboard.c in Sources */, + DB31404317554B71006C0E22 /* SDL_fillrect.c in Sources */, + DB31404417554B71006C0E22 /* SDL_pixels.c in Sources */, + DB31404517554B71006C0E22 /* SDL_rect.c in Sources */, + DB31404617554B71006C0E22 /* SDL_RLEaccel.c in Sources */, + DB31404717554B71006C0E22 /* SDL_shape.c in Sources */, + DB31404817554B71006C0E22 /* SDL_stretch.c in Sources */, + DB31404917554B71006C0E22 /* SDL_surface.c in Sources */, + DB31404A17554B71006C0E22 /* SDL_video.c in Sources */, + DB31404B17554B71006C0E22 /* imKStoUCS.c in Sources */, + DB31404C17554B71006C0E22 /* SDL_x11clipboard.c in Sources */, + DB31404D17554B71006C0E22 /* SDL_x11dyn.c in Sources */, + DB31404E17554B71006C0E22 /* SDL_x11events.c in Sources */, + DB31404F17554B71006C0E22 /* SDL_x11keyboard.c in Sources */, + DB31405017554B71006C0E22 /* SDL_x11modes.c in Sources */, + DB31405117554B71006C0E22 /* SDL_x11mouse.c in Sources */, + DB31405217554B71006C0E22 /* SDL_x11opengl.c in Sources */, + DB31405317554B71006C0E22 /* SDL_x11opengles.c in Sources */, + DB31405417554B71006C0E22 /* SDL_x11shape.c in Sources */, + DB31405517554B71006C0E22 /* SDL_x11touch.c in Sources */, + DB31405617554B71006C0E22 /* SDL_x11video.c in Sources */, + DB31405717554B71006C0E22 /* SDL_x11window.c in Sources */, + DB31405817554B71006C0E22 /* SDL_render.c in Sources */, + DB31405917554B71006C0E22 /* SDL_yuv_mmx.c in Sources */, + DB31405A17554B71006C0E22 /* SDL_yuv_sw.c in Sources */, + DB31405B17554B71006C0E22 /* SDL_nullframebuffer.c in Sources */, + DB31405C17554B71006C0E22 /* SDL_blendfillrect.c in Sources */, + DB31405D17554B71006C0E22 /* SDL_blendline.c in Sources */, + DB31405E17554B71006C0E22 /* SDL_blendpoint.c in Sources */, + DB31405F17554B71006C0E22 /* SDL_drawline.c in Sources */, + DB31406017554B71006C0E22 /* SDL_drawpoint.c in Sources */, + DB31406117554B71006C0E22 /* SDL_render_gl.c in Sources */, + DB31406217554B71006C0E22 /* SDL_render_sw.c in Sources */, + DB31406317554B71006C0E22 /* SDL_x11framebuffer.c in Sources */, + DB31406417554B71006C0E22 /* SDL_hints.c in Sources */, + DB31406517554B71006C0E22 /* SDL_log.c in Sources */, + DB31406617554B71006C0E22 /* SDL_shaders_gl.c in Sources */, + DB31406717554B71006C0E22 /* SDL_rotate.c in Sources */, + DB31406817554B71006C0E22 /* SDL_x11xinput2.c in Sources */, + DB31406917554B71006C0E22 /* SDL_x11messagebox.c in Sources */, + DB31406A17554B71006C0E22 /* SDL_cocoamessagebox.m in Sources */, + AA0F8493178D5ECC00823F9D /* SDL_systls.c in Sources */, + D55A1B83179F263500625D7C /* SDL_cocoamousetap.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 008310001072D94A00A531F1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 0032354F1070931700C76517 /* Generate Doxygen DocSet */; - targetProxy = 00830FFF1072D94A00A531F1 /* PBXContainerItemProxy */; - }; BECDF6C60761BA81005FE872 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = BECDF5FE0761BA81005FE872 /* Framework */; @@ -1684,22 +2675,6 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 003235521070931700C76517 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DOXYGEN_EXE = /Applications/Doxygen.app/Contents/Resources/doxygen; - PRODUCT_NAME = "Generate Doxygen DocSet"; - }; - name = Debug; - }; - 003235531070931700C76517 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DOXYGEN_EXE = /Applications/Doxygen.app/Contents/Resources/doxygen; - PRODUCT_NAME = "Generate Doxygen DocSet"; - }; - name = Release; - }; 00CFA621106A567900758660 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1707,16 +2682,13 @@ DEPLOYMENT_POSTPROCESSING = YES; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_SSE3_EXTENSIONS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_OPTIMIZATION_LEVEL = s; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; SDKROOT = macosx; - SEPARATE_STRIP = YES; STRIP_STYLE = "non-global"; - WARNING_CFLAGS = ""; }; name = Release; }; @@ -1724,24 +2696,13 @@ isa = XCBuildConfiguration; buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 12.4; + DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(GCC_PREPROCESSOR_DEFINITIONS)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist"; INSTALL_PATH = "@rpath"; - OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))"; - OTHER_CFLAGS_i386 = ""; - OTHER_CFLAGS_ppc = ""; - OTHER_LDFLAGS_ppc = "-prebind -seg1addr 0x30000000"; - PRODUCT_NAME = SDL; + OTHER_LDFLAGS = "-liconv"; + PRODUCT_NAME = SDL2; WRAPPER_EXTENSION = framework; }; name = Release; @@ -1751,35 +2712,15 @@ buildSettings = { GCC_PREPROCESSOR_DEFINITIONS = ( "$(GCC_PREPROCESSOR_DEFINITIONS)", - "SDL_VIDEO_DRIVER_DGA=1", - "SDL_VIDEO_DRIVER_X11=1", - "SDL_VIDEO_DRIVER_X11_DGAMOUSE=1", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)", - "SDL_VIDEO_DRIVER_X11_VIDMODE=1", - "SDL_VIDEO_DRIVER_X11_XINERAMA=1", - "SDL_VIDEO_DRIVER_X11_XME=1", - "SDL_VIDEO_DRIVER_X11_XRANDR=1", - "SDL_VIDEO_DRIVER_X11_XV=1", ); - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1 = "SDL_VIDEO_DRIVER_X11_DYNAMIC=\\\"/usr/X11R6/lib/libX11.6.dylib\\\""; - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT=\\\"/usr/X11R6/lib/libXext.6.dylib\\\""; - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR=\\\"/usr/X11R6/lib/libXrandr.2.dylib\\\""; - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER=\\\"/usr/X11R6/lib/libXrender.1.dylib\\\""; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; HEADER_SEARCH_PATHS = /usr/X11R6/include; - OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))"; - OTHER_CFLAGS_i386 = ""; - OTHER_CFLAGS_ppc = ""; - PRODUCT_NAME = SDL; - }; - name = Release; - }; - 00CFA624106A567900758660 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = SDLmain; + PRODUCT_NAME = SDL2; + SKIP_INSTALL = YES; }; name = Release; }; @@ -1790,26 +2731,18 @@ }; name = Release; }; - 00CFA626106A567900758660 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "Developer Extras Package"; - }; - name = Release; - }; 00CFA627106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; GCC_ALTIVEC_EXTENSIONS = YES; GCC_AUTO_VECTORIZATION = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; GCC_ENABLE_SSE3_EXTENSIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; MACOSX_DEPLOYMENT_TARGET = 10.5; SDKROOT = macosx; - WARNING_CFLAGS = ""; + STRIP_INSTALLED_PRODUCT = NO; }; name = Debug; }; @@ -1817,23 +2750,13 @@ isa = XCBuildConfiguration; buildSettings = { DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 12.4; + DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(GCC_PREPROCESSOR_DEFINITIONS)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)", - "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; HEADER_SEARCH_PATHS = /usr/X11R6/include; INFOPLIST_FILE = "Info-Framework.plist"; INSTALL_PATH = "@rpath"; - OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))"; - OTHER_CFLAGS_i386 = ""; - OTHER_CFLAGS_ppc = ""; - PRODUCT_NAME = SDL; + OTHER_LDFLAGS = "-liconv"; + PRODUCT_NAME = SDL2; WRAPPER_EXTENSION = framework; }; name = Debug; @@ -1843,64 +2766,66 @@ buildSettings = { GCC_PREPROCESSOR_DEFINITIONS = ( "$(GCC_PREPROCESSOR_DEFINITIONS)", - "SDL_VIDEO_DRIVER_DGA=1", - "SDL_VIDEO_DRIVER_X11=1", - "SDL_VIDEO_DRIVER_X11_DGAMOUSE=1", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)", "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)", - "SDL_VIDEO_DRIVER_X11_VIDMODE=1", - "SDL_VIDEO_DRIVER_X11_XINERAMA=1", - "SDL_VIDEO_DRIVER_X11_XME=1", - "SDL_VIDEO_DRIVER_X11_XRANDR=1", - "SDL_VIDEO_DRIVER_X11_XV=1", ); - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1 = "SDL_VIDEO_DRIVER_X11_DYNAMIC=\\\"/usr/X11R6/lib/libX11.6.dylib\\\""; - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT=\\\"/usr/X11R6/lib/libXext.6.dylib\\\""; - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR=\\\"/usr/X11R6/lib/libXrandr.2.dylib\\\""; - GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER=\\\"/usr/X11R6/lib/libXrender.1.dylib\\\""; + GCC_SYMBOLS_PRIVATE_EXTERN = YES; HEADER_SEARCH_PATHS = /usr/X11R6/include; - OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))"; - OTHER_CFLAGS_i386 = ""; - OTHER_CFLAGS_ppc = ""; - PRODUCT_NAME = SDL; + PRODUCT_NAME = SDL2; + SKIP_INSTALL = YES; }; name = Debug; }; - 00CFA62A106A568900758660 /* Debug */ = { + 00CFA62B106A568900758660 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - PRODUCT_NAME = SDLmain; + PRODUCT_NAME = "Standard DMG"; }; name = Debug; }; - 00CFA62B106A568900758660 /* Debug */ = { + DB31407517554B71006C0E22 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - PRODUCT_NAME = "Standard DMG"; + EXECUTABLE_PREFIX = lib; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(GCC_PREPROCESSOR_DEFINITIONS)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = /usr/X11R6/include; + INSTALL_PATH = "@rpath"; + PRODUCT_NAME = SDL2; + SKIP_INSTALL = YES; }; name = Debug; }; - 00CFA62C106A568900758660 /* Debug */ = { + DB31407617554B71006C0E22 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - PRODUCT_NAME = "Developer Extras Package"; + EXECUTABLE_PREFIX = lib; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(GCC_PREPROCESSOR_DEFINITIONS)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)", + "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = YES; + HEADER_SEARCH_PATHS = /usr/X11R6/include; + INSTALL_PATH = "@rpath"; + PRODUCT_NAME = SDL2; + SKIP_INSTALL = YES; }; - name = Debug; + name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 003235571070933500C76517 /* Build configuration list for PBXAggregateTarget "Generate Doxygen DocSet" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 003235521070931700C76517 /* Debug */, - 003235531070931700C76517 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1919,15 +2844,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 007317820858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Main Library" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00CFA62A106A568900758660 /* Debug */, - 00CFA624106A567900758660 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; 007317860858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Standard DMG" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1937,20 +2853,20 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 0073178A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Developer Extras Package" */ = { + 0073178E0858DB0500B2BC32 /* Build configuration list for PBXProject "SDL" */ = { isa = XCConfigurationList; buildConfigurations = ( - 00CFA62C106A568900758660 /* Debug */, - 00CFA626106A567900758660 /* Release */, + 00CFA627106A568900758660 /* Debug */, + 00CFA621106A567900758660 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 0073178E0858DB0500B2BC32 /* Build configuration list for PBXProject "SDL" */ = { + DB31407417554B71006C0E22 /* Build configuration list for PBXNativeTarget "Shared Library" */ = { isa = XCConfigurationList; buildConfigurations = ( - 00CFA627106A568900758660 /* Debug */, - 00CFA621106A567900758660 /* Release */, + DB31407517554B71006C0E22 /* Debug */, + DB31407617554B71006C0E22 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; diff --git a/Xcode/SDL/pkg-support/Readme SDL Developer.txt b/Xcode/SDL/pkg-support/Readme SDL Developer.txt deleted file mode 100755 index aa32284d9d..0000000000 --- a/Xcode/SDL/pkg-support/Readme SDL Developer.txt +++ /dev/null @@ -1,282 +0,0 @@ -SDL Mac OS X Developer Notes: - This is an optional developer package to provide extras that an - SDL developer might benefit from. - - Make sure you have already installed the SDL.framework - from the SDL.dmg. - - For more complete documentation, please see READMEs included - with the SDL source code. Also, don't forget about the API - documentation (also included with this package). - - -This package contains: -- SDL API Documentation -- A variety of SDLMain and .Nib files to choose from -- Xcode project templates - - -SDL API Documentation: - We include both the HTML documentation and the man files. - And new to 1.2.14, we introduce an Xocde DocSet which - is generated via Doxygen. These require Xcode 3.0 or greater. - - You will need to drill down into the XcodeDocSet directory - from the Documentation folder and find the - org.libsdl.sdl.docset bundle. We recommend you copy this to: - - /Library/Developer/Shared/Documentation/DocSets - - Again, this follows all the standard Xcode patterns - described with the project templates (below). You may need - to create the directories if they don't already exist. - You may install it on a per-user basis. - And you may target specific versions of Xcode - in lieu of using the "Shared" directory. - - To use, it is quite simple. Just bring up the Xcode - Documentation Browser window (can be activated through - the Xcode Help Menu) and start searching for something. - - If nothing is found on a legitimate search, verify that - the SDL documentation is enabled by opening up the DocSet - popup box below the toolbar in Snow Leopard. - (In Leopard, the DocSets appear in the left-side panel.) - - Another handy trick is to use the mouse and Option-Double-Click - on a function or keyword to bring up documentation on the - selected item. Prior to Xcode 3.2 (Snow Leopard), this would - jump you to the entry in the Xcode Documentation Browser. - - However, in Xcode 3.2 (Snow Leopard), this behavior has been - altered and you are now given a hovering connected popup box - on the selected item (called Quick Help). Unfortunately, the - Doxygen generated DocSet doesn't currently provide Quick Help - information. You can either follow a link to the main - Documentation Browser from the Quick Help, or alternatively, - you can bypass Quick Help by using Command-Option-Double-Click - instead of Option-Double-Click. (Please file feedback with both - Doxygen and Apple to improve Quick Help integration.) - - - For those that want to tweak the documentation output, - you can find my Doxyfile in the XcodeDocSet directory in - the Xcode directory of the SDL source code base (and in this package). - - One of the most significant options is "Separate Member Pages" - which I disable. When disabled, the documentation is about 6MB. - When enabled, the documentation is closer to 1.6GB (yes gigabytes). - Obviously, distribution will be really hard with sizes that huge - so I disable the option. - - I also disabled Dot because there didn't seem to be - much benefit of generating graphs for public C functions. - - One thing I would like to see is a CSS file that makes the - Doxygen DocSet look more like the native Apple documentation - style. Style sheets are outside my expertise so I am asking for - contributions on this one. Meanwhile, I also request you send - feedback to Doxygen and Apple about this issue too. - - - Finally for convenience, I have added a new shell script target - to the Xcode project that builds SDL that refers to my Doxyfile - and generate the DocSet we distribute. - - -SDLMain: - We include several different variations of SDLMain and the - .Nibs. (Each of these are demonstrated by the different PB/Xcode - project templates.) You get to pick which one you want to use, - or you can write your own to meet your own specific needs. We do - not currently provide a libSDLMain.a. You can build it yourself - once you decide which one you want to use though it is easier and - recommended in the SDL FAQ that you just copy the SDLMain.h and - SDLMain.m directly into your project. If you are puzzled by this, - we strongly recommend you look at the different PB/Xcode project - templates to understand their uses and differences. (See Project - Template info below.) Note that the "Nibless" version is the same - version of SDLMain we include the the devel-lite section of the - main SDL.dmg. - - -Xocde Project Templates: - For convenience, we provide Project Templates for Xcode. - Using Xcode is *not* a requirement for using - the SDL.framework. However, for newbies, we do recommend trying - out the Xcode templates first (and work your way back to raw gcc - if you desire), as the Xcode templates try to setup everything - for you in a working state. This avoids the need to ask those - many reoccuring questions that appear on the mailing list - or the SDL FAQ. - - - We have provided 3 different kinds of SDL templates for Xcode and have - a different set of templates for each version of Xcode (which generally - correspond with a particular Mac OS X version). - The installion directory depends on which version of Xcode you have. - (Note: These directories may not already exist on your system so you must create them yourself.) - - For Leopard and Snow Leopard (Xcode 2.5, 3+), we recommend you install to: - /Library/Application Support/Developer/Shared/Xcode/Project Templates/Application - - For Xcode 1.0 to 2.4, - /Library/Application Support/Apple/Developer Tools/Project Templates/Appllcation - - - Also note you may place it in per-user locations, e.g. - ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Application - - - And for advanced users who have multiple versions of Xcode installed on a single system, - you may put each set in a directory with the Xcode version number instead of using "Shared", e.g. - /Library/Application Support/Developer/2.5/Xcode/Project Templates/Application - /Library/Application Support/Developer/3.1/Xcode/Project Templates/Application - /Library/Application Support/Developer/3.2/Xcode/Project Templates/Application - - - Copy each of the SDL/Xcode template directories into the correct location (e.g. "SDL OpenGL Application"). - Do not copy our enclosing folder into the location (e.g. TemplatesForXcodeSnowLeopard). - So for example, in: - /Library/Application Support/Developer/Shared/Xcode/Project Templates/Application - you should have the 3 folders: - SDL Application - SDL Cocoa Application - SDL OpenGL Application - - - After doing this, when doing a File->New Project, you will see the - projects under the Application category. - (Newer versions of Xcode have a separate section for User Templates and it will - appear in the Application category of the User Templates section.) - - - - How to create a new SDL project: - - 1. Open Xcode - 2. Select File->New Project - 3. Select SDL Application - 4. Name, Save, and Finish - 5. Add your sources. - *6. That's it! - - * If you installed the SDL.framework to $(HOME)/Library/Frameworks - instead of /Library/Frameworks, you will need to update the - location of the SDL.framework in the "Groups & Files" browser. - - - The project templates we provide are: - - SDL Application - This is the barebones, most basic version. There is no - customized .Nib file. While still utilizing Cocoa under - the hood, this version may be best suited for fullscreen - applications. - - - SDL Cocoa Application - This demonstrates the integration of using native - Cocoa Menus with an SDL Application. For applications - designed to run in Windowed mode, Mac users may appreciate - having access to standard menus for things - like Preferences and Quiting (among other things). - - - SDL OpenGL Application - This reuses the same SDLMain from the "SDL Application" - temmplate, but also demonstrates how to - bring OpenGL into the mix. - - -Special Notes: -Only the 10.6 Snow Leopard templates (and later) will include 64-bit in the Universal Binary as -prior versions of OS X lacked the API support SDL requires for 64-bit to work correctly. -To prevent 64-bit SDL executables from being launched on 10.5 Leopard, a special key has been set -in the Info.plist in our Snow Leopard SDL/Xcode templates. - - -Xcode Tips and Tricks: - -- Building from command line - Use the command line tool: xcodebuild (see man page) - -- Running your app - You can send command line args to your app by either - invoking it from the command line (in *.app/Contents/MacOS) - or by entering them in the "Executables" panel of the target - settings. - -- Working directory - As defined in the SDLMain.m file, the working directory of - your SDL app is by default set to its parent. You may wish to - change this to better suit your needs. - - - -Additional References: - - - Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are - available at: - http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips - Though these are OpenSceneGraph centric, the same exact concepts apply to - SDL, thus the videos are recommended for everybody getting started with - developing on Mac OS X. (You can skim over the PlugIns stuff since SDL - doesn't have any PlugIns to worry about.) - - -Partial History: -2009-09-21 - CustomView template project was removed because it was broken by - the removal of legacy Quicktime support while moving to 64-bit. - ProjectBuilder templates were removed. - Tiger, Leopard, and Snow Leopard Xcode templates were introduced instead of - using a single common template due to the differences between the 3. - (Tiger used a chevron marker for substitution while Leopard/Snow Leopard use ___ - and we need the 10.6 SDK for 64-bit.) - -2007-12-30 - Updated documentation to reflect new template paths in Leopard - Xcode. Added reference to OSG screencasts. - -2006-03-17 - Changed the package format from a .pkg based - installer to a .dmg to avoid requiring administrator/root - to access contents, for better transparency, and to allow - users to more easily control which components - they actually want to install. - Introduced and updated documentation. - Created brand new Xcode project templates for Xcode 2.1 - based on the old Project Builder templates as they - required Xcode users to "Upgrade to Native Target". The new - templates try to leveage more default options and leverage - more Xcode conventions. The major change that may introduce - some breakage is that I now link to the SDL framework - via the "Group & Files" browser instead of using build - options. The downside to this is that if the user - installs the SDL.framework to a place other than - /Library/Frameworks (e.g. $(HOME)/Library/Frameworks), - the framework will not be found to link to and the user - has to manually fix this. But the upshot is (in addition to - being visually displayed in the forefront) is that it is - really easy to copy (embed) the framework automatically - into the .app bundle on build. So I have added this - feature, which makes the application potentially - drag-and-droppable ready. The Project Builder templates - are mostly unchanged due to the fact that I don't have - Project Builder. I did rename a file extension to .pbxproj - for the SDL Custom Cocoa Application template because - the .pbx extension would not load in my version of Xcode. - For both Project Builder and Xcode templates, I resync'd - the SDLMain.* files for the SDL App and OpenGL App - templates. I think people forget that we have 2 other - SDLMain's (and .Nib's) and somebody needs to go - through them and merge the new changes into those. - I also wrote a fix for the SDL Custom Cocoa App - template in MyController.m. The sprite loading code - needed to be able to find the icon.bmp in the .app - bundle's Resources folder. This change was needed to get - the app to run out of the box. This might change is untested - with Project Builder though and might break it. - There also seemed to be some corruption in the .nib itself. - Merely opening it and saving (allowing IB to correct the - .nib) seemed to correct things. - (Eric Wing) - - - - diff --git a/Xcode/SDL/pkg-support/SDL-devel.info b/Xcode/SDL/pkg-support/SDL-devel.info deleted file mode 100755 index 698f1d6032..0000000000 --- a/Xcode/SDL/pkg-support/SDL-devel.info +++ /dev/null @@ -1,15 +0,0 @@ -Title SDL 1.2.9 -Version 1 -Description SDL Library for Mac OS X (http://www.libsdl.org) -DefaultLocation /Developer/Documentation/SDL -Diskname (null) -DeleteWarning -NeedsAuthorization YES -DisableStop NO -UseUserMask YES -Application NO -Relocatable NO -Required NO -InstallOnly NO -RequiresReboot NO -InstallFat NO diff --git a/Xcode/SDL/pkg-support/SDL.info b/Xcode/SDL/pkg-support/SDL.info index ca37a7f168..f08facd234 100755 --- a/Xcode/SDL/pkg-support/SDL.info +++ b/Xcode/SDL/pkg-support/SDL.info @@ -1,4 +1,4 @@ -Title SDL 1.2.8 +Title SDL 2.0.0 Version 1 Description SDL Library for Mac OS X (http://www.libsdl.org) DefaultLocation /Library/Frameworks diff --git a/Xcode/SDL/pkg-support/codesign-frameworks.sh b/Xcode/SDL/pkg-support/codesign-frameworks.sh new file mode 100755 index 0000000000..16dea25195 --- /dev/null +++ b/Xcode/SDL/pkg-support/codesign-frameworks.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# WARNING: You may have to run Clean in Xcode after changing CODE_SIGN_IDENTITY! + +# Verify that $CODE_SIGN_IDENTITY is set +if [ -z "$CODE_SIGN_IDENTITY" ] ; then + echo "CODE_SIGN_IDENTITY needs to be non-empty for codesigning frameworks!" + + if [ "$CONFIGURATION" = "Release" ] ; then + exit 1 + else + # Codesigning is optional for non-release builds. + exit 0 + fi +fi + +SAVEIFS=$IFS +IFS=$(echo -en "\n\b") + +FRAMEWORK_DIR="${TARGET_BUILD_DIR}" + +# Loop through all frameworks +FRAMEWORKS=`find "${FRAMEWORK_DIR}" -type d -name "*.framework" | sed -e "s/\(.*\)/\1\/Versions\/A\//"` +RESULT=$? +if [[ $RESULT != 0 ]] ; then + exit 1 +fi + +echo "Found:" +echo "${FRAMEWORKS}" + +for FRAMEWORK in $FRAMEWORKS; +do + echo "Signing '${FRAMEWORK}'" + `codesign -f -v -s "${CODE_SIGN_IDENTITY}" "${FRAMEWORK}"` + RESULT=$? + if [[ $RESULT != 0 ]] ; then + exit 1 + fi +done + +# restore $IFS +IFS=$SAVEIFS diff --git a/Xcode/SDL/pkg-support/devel-resources/ReadMe.txt b/Xcode/SDL/pkg-support/devel-resources/ReadMe.txt deleted file mode 100755 index f4fe36164c..0000000000 --- a/Xcode/SDL/pkg-support/devel-resources/ReadMe.txt +++ /dev/null @@ -1,5 +0,0 @@ -The Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators. - -The Simple DirectMedia Layer library source code is available from: http://www.libsdl.org/ - -This library is distributed under the terms of the GNU LGPL license: http://www.gnu.org/copyleft/lesser.html \ No newline at end of file diff --git a/Xcode/SDL/pkg-support/devel-resources/Welcome.txt b/Xcode/SDL/pkg-support/devel-resources/Welcome.txt deleted file mode 100755 index 9b0d2862fc..0000000000 --- a/Xcode/SDL/pkg-support/devel-resources/Welcome.txt +++ /dev/null @@ -1,5 +0,0 @@ -This package installs documentation and Project Builder stationary for the SDL framework. - -The SDL documentation is installed into /Developer/Documentation/SDL. - -The SDL Mac OS X Readme is installed into your home directory. diff --git a/Xcode/SDL/pkg-support/devel-resources/install.sh b/Xcode/SDL/pkg-support/devel-resources/install.sh deleted file mode 100755 index e7a4dedff1..0000000000 --- a/Xcode/SDL/pkg-support/devel-resources/install.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# finish up the installation -# this script should be executed using the sudo command -# this file is copied to SDL-devel.post_install and SDL-devel.post_upgrade -# inside the .pkg bundle -echo "Running post-install script" -umask 022 - -USER=`basename ~` -echo "User is \"$USER\"" - -ROOT=/Developer/Documentation/SDL -echo "Fixing framework permissions" -find $ROOT -type d -exec chmod a+rx {} \; -find $ROOT -type f -exec chmod a+r {} \; - -## We're not installing frameworks here anymore. The single -## framework should be installed to /Library/Frameworks which -## is handled by the standard package (not developer package). -## Using the home directory here is problematic for multi-user systems too. -# echo "Moving SDL.framework to ~/Library/Frameworks" -# move SDL to its proper home, so the target stationary works -#sudo -u $USER mkdir -p ~/Library/Frameworks -#sudo -u $USER /Developer/Tools/CpMac -r $ROOT/SDL.framework ~/Library/Frameworks - -## I'm not sure where this gets created and what's put in there. -rm -rf $ROOT/SDL.framework - -## I think precompiled headers have changed through the revisions of Apple's gcc. -## I don't know how useful this is anymore w.r.t. Apple's newest system for precompiled headers. -## I'm removing this for now. -# echo "Precompiling Header" -# precompile header for speedier compiles -#sudo -u $USER /usr/bin/cc -precomp ~/Library/Frameworks/SDL.framework/Headers/SDL.h -o ~/Library/Frameworks/SDL.framework/Headers/SDL.p - -# find the directory to store stationary in -if [ -e "/Library/Application Support/Apple/Developer Tools" ] ; then - echo "Installing project stationary for XCode" - PBXDIR="/Library/Application Support/Apple/Developer Tools" -else - echo "Installing project stationary for Project Builder" - PBXDIR="/Developer/ProjectBuilder Extras" -fi - -# move stationary to its proper home -mkdir -p "$PBXDIR/Project Templates/Application" -mkdir -p "$PBXDIR/Target Templates/SDL" - -cp -r "$ROOT/Project Stationary/SDL Application" "$PBXDIR/Project Templates/Application/" -cp -r "$ROOT/Project Stationary/SDL Cocoa Application" "$PBXDIR/Project Templates/Application/" -cp -r "$ROOT/Project Stationary/SDL Custom Cocoa Application" "$PBXDIR/Project Templates/Application/" -cp -r "$ROOT/Project Stationary/SDL OpenGL Application" "$PBXDIR/Project Templates/Application/" -cp "$ROOT/Project Stationary/Application.trgttmpl" "$PBXDIR/Target Templates/SDL/" - -rm -rf "$ROOT/Project Stationary" - -# Actually, man doesn't check this directory by default, so this isn't -# very helpful anymore. -#echo "Installing Man Pages" -## remove old man pages -#rm -rf "/Developer/Documentation/ManPages/man3/SDL"* -# -## install man pages -#mkdir -p "/Developer/Documentation/ManPages/man3" -#cp "$ROOT/docs/man3/SDL"* "/Developer/Documentation/ManPages/man3/" -#rm -rf "$ROOT/docs/man3" -# -#echo "Rebuilding Apropos Database" -## rebuild apropos database -#/usr/libexec/makewhatis - -# copy README file to your home directory -sudo -u $USER cp "$ROOT/Readme SDL Developer.txt" ~/ - -# open up the README file -sudo -u $USER open ~/"Readme SDL Developer.txt" diff --git a/Xcode/SDL/pkg-support/resources/License.rtf b/Xcode/SDL/pkg-support/resources/License.rtf deleted file mode 100755 index 706980dbbf..0000000000 --- a/Xcode/SDL/pkg-support/resources/License.rtf +++ /dev/null @@ -1,283 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf102 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; -} -{\colortbl;\red255\green255\blue255;\red64\green64\blue64;} -\paperw11900\paperh16840\margl1440\margr1440\vieww9080\viewh13160\viewkind0 -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b\fs36 \cf0 GNU LESSER GENERAL PUBLIC LICENSE -\fs24 \ -Version 2.1, February 1999 -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f2\i \cf0 Copyright (C) 1991, 1999 Free Software Foundation, Inc.\ - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\ - Everyone is permitted to copy and distribute verbatim copies\ - of this license document, but changing it is not allowed.\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f1\i0 \cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf2 [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]\cf0 \ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 Preamble -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.\ -\ -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.\ -\ -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.\ -\ -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.\ -\ -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.\ -\ -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.\ -\ -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.\ -\ -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.\ -\ -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We this license for certain libraries in order to permit linking those libraries into non-free programs.\ -\ -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.\ -\ -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.\ -\ -For example, on rare occasions, there may be a special need to encourage widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.\ -\ -Another cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.\ -\ -Although the Lesser General Public License is Less protective of the users' freedom, it does insure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.\ -\ -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.\ -\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 GNU LESSER GENERAL PUBLIC LICENSE\ -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f1\b0 \cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 0. -\f1\b0 This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".\ -\ -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.\ -\ -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)\ -\ -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.\ -\ -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.\ - \ - -\f0\b 1. -\f1\b0 You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.\ -\ -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\ -\ - -\f0\b 2. -\f1\b0 You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural - -\f0\b \cf0 a) -\f1\b0 The modified work must itself be a software library.\ -\ - -\f0\b b) -\f1\b0 You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.\ -\ - -\f0\b c) -\f1\b0 You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.\ -\ - -\f0\b d) -\f1\b0 If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.\ -\ -(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\ -\ -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.\ -\ -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 3. -\f1\b0 You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.\ -\ -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.\ -\ -This option is useful when you wish to copy part of the code of the Library into a program that is not a library.\ -\ - -\f0\b 4. -\f1\b0 You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.\ -\ -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.\ -\ - -\f0\b 5. -\f1\b0 A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.\ -\ -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.\ -\ -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.\ -\ -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)\ -\ -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.\ -\ - -\f0\b 6. -\f1\b0 As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.\ -\ -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural - -\f0\b \cf0 a) -\f1\b0 Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)\ -\ - -\f0\b b) -\f1\b0 Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.\ -\ - -\f0\b c) -\f1\b0 Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.\ -\ - -\f0\b d) -\f1\b0 If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.\ -\ - -\f0\b e) -\f1\b0 Verify that the user has already received a copy of these materials or that you have already sent this user a copy.\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\ -\ -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 7. -\f1\b0 You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural - -\f0\b \cf0 a) -\f1\b0 Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.\ -\ - -\f0\b b) -\f1\b0 Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 8. -\f1\b0 You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\ -\ - -\f0\b 9. -\f1\b0 You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.\ -\ - -\f0\b 10. -\f1\b0 Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.\ -\ - -\f0\b 11. -\f1\b0 If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.\ -\ -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.\ -\ -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\ -\ -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\ -\ - -\f0\b 12. -\f1\b0 If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\ -\ - -\f0\b 13. -\f1\b0 The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\ -\ -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.\ -\ - -\f0\b 14. -\f1\b0 If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 NO WARRANTY -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural - -\f0\b \cf0 15. -\f1\b0 BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\ -\ - -\f0\b 16. -\f1\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc - -\f0\b \cf0 END OF TERMS AND CONDITIONS -\f1\b0 \ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -\ -How to Apply These Terms to Your New Libraries\ -\ -If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).\ -\ -To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.\ -\ -\pard\tx220\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural -\cf0 \ -Copyright (C) \ -\ -This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\ -\ -This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\ -\ -You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -Also add information on how to contact you by electronic and paper mail.\ -\ -You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:\ -\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural -\cf0 Yoyodyne, Inc., hereby disclaims all copyright interest in the library\ -`Frob' (a library for tweaking knobs) written by James Random Hacker.\ -\ -, 1 April 1990\ -Ty Coon, President of Vice\ -\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf0 \ -That's all there is to it!\ -\ -} \ No newline at end of file diff --git a/Xcode/SDL/pkg-support/resources/License.txt b/Xcode/SDL/pkg-support/resources/License.txt new file mode 100644 index 0000000000..18f109c3f7 --- /dev/null +++ b/Xcode/SDL/pkg-support/resources/License.txt @@ -0,0 +1,19 @@ + +Simple DirectMedia Layer +Copyright (C) 1997-2013 Sam Lantinga + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. diff --git a/Xcode/SDL/pkg-support/resources/ReadMe.txt b/Xcode/SDL/pkg-support/resources/ReadMe.txt index 0731150319..40ac3a14c1 100755 --- a/Xcode/SDL/pkg-support/resources/ReadMe.txt +++ b/Xcode/SDL/pkg-support/resources/ReadMe.txt @@ -5,26 +5,20 @@ such as games and emulators. The Simple DirectMedia Layer library source code is available from: http://www.libsdl.org/ -This library is distributed under the terms of the GNU LGPL license: -http://www.gnu.org/copyleft/lesser.html +This library is distributed under the terms of the zlib license: +http://zlib.net/zlib_license.html -This packages contains the SDL.framework for OS X. +This packages contains the SDL framework for OS X. Conforming with Apple guidelines, this framework contains both the SDL runtime component and development header files. To Install: -Copy the SDL.framework to /Library/Frameworks +Copy the SDL2.framework to /Library/Frameworks You may alternatively install it in /Library/Frameworks if your access privileges are not high enough. -(Be aware that the Xcode templates we provide in the SDL Developer Extras -package may require some adjustment for your system if you do this.) - - -Known Issues: -??? Additional References: @@ -36,136 +30,3 @@ Additional References: SDL, thus the videos are recommended for everybody getting started with developing on Mac OS X. (You can skim over the PlugIns stuff since SDL doesn't have any PlugIns to worry about.) - - - -(Partial) History of PB/Xcode projects: -2009-09-21 - Added 64-bit for Snow Leopard. 10.4 is the new minimum requirement. - Removed 'no X11' targets as - new codebase will assume you have them. Also removed specific #defines - for X11, but needed to add search path to /usr/X11R6/include - -2007-12-31 - Enabled strip -x in the Xcode settings and removed it - from the Build DMG script. - Added a per-arch setting for the Deployment targets for OTHER_LDFLAGS_ppc - to re-enable prebinding. - Need to remember to copy these changes to the SDL satellite projects. - -2007-12-30 - Updated documentation to reflect new installation paths for - Xcode project templates under Leopard (Xcode 2.5/3.0). - -????-??-?? - Added extra targets for building formal releases against the - 10.2 SDK so we don't have to keep modifying the settings. - -????-??-?? - Added fancy DMG (background logo) support with automation. - -2006-05-09 - Added shell script phase to deal with new SDL_config.h - behavior. Encountered what seems to be an Xcode bug with - multiple files of the same name, even when conditional compiling - is controlled by custom #defines (SDL_sysloadso.c). Multiple or - undefined symbols are the result of this. - Recommended that macosx/SDL_sysloadso.c be modified to directly - include the dlopen version of the file via #ifdef's so only - one version needs to exist. Filed a formal bug report with Apple - about this (4542369). - -2006-03-22 - gcc 4 visibility features have been added to the code base so I - enabled the switch in Xcode to take advantage of it. Be aware that only - our x86 builds will be exposed to this feature as we still build ppc - with gcc 3.3. - - Christian Walther has sent me some great feedback on things that are - broken, so I have made some of these fixes. Among the issues are - compatibility and current library versions are not set to 1 (breaks - backwards compatibility), documentation errors, resource copying - location problems for the SDLTest apps, missing HAVE_OPENGL and - OpenGL.framework linking in testgl. - (Eric Wing) - -2006-03-17 - Because the X11 headers are not installed by default with Xcode, - we decided to offer two variants of the same targets (one with X11 stuff - and one without). By default, since the X11 stuff does not necessarily - conflict with the native stuff, we build the libraries with the X11 stuff - so advanced developers can access it by default. However, in the case - that a developer did not install X11 (or just doesn't want the extra bloat), - the user may directly select those targets and build those instead. - - Once again, we are attempting to remove the exported symbols file. If - I recall correctly, the clashing symbol problems we got were related - to the CD-ROM code which was formerly in C++. Now that the C++ code - has been purged, we are speculating that we might be able to remove - the exports file safely. The long term solution is to utilize gcc 4's - visibility features. - - For the developer extras package, I changed the package format - from a .pkg based installer to a .dmg to avoid requiring - administrator/root to access contents, for better - transparency, and to allow users to more easily control which components - they actually want to install. - I also made changes and updates to the PB/Xcode project templates (see Developer ReadMe). - (Eric Wing) - -2006-03-07 - The entire code base has been reorganized and platform specific - defines have been pushed into header files (SDL_config_*.h). This means - that defines that previously had to be defined in the Xcode projects can - be removed (which I have started doing). Furthermore, it appears that the - MMX/SSE code has been rewritten and refactored so it now compiles without - nasm and without making us do strange things to support OS X. However, this - Xcode project still employs architecture specific build options in order to - achieve the mandated 10.2 compatibility. As a result of the code base changes, - there are new public headers. But also as a result of these changes, there are - also new headers that qualify as "PrivateHeaders". Private Headers are headers - that must be exported because a public header includes them, but users shouldn't - directly invoke these. SDL_config_macosx.h and SDL_config_dreamcast.h are - examples of this. We have considered marking these headers as Private, but it - requires that the public headers invoke them via framework conventions, i.e. - #include - e.g. - #include - and not - #include "SDL_config_macosx.h" - However this imposes the restriction that non-framework distributions must - place their headers in a directory called SDL/ (and not SDL11/ like FreeBSD). - Currently, I do not believe this would pose a problem for any of the current - distributions (Fink, DarwinPorts). Or alternatively, users could be - expected/forced to also include the header path: - -I/Library/Frameworks/SDL.framework/PrivateHeaders, - but most people would probably not read the documentation on this. - But currently, we have decided to be conservative and have opted not to - use the PrivateHeaders feature. - (Eric Wing) - -2006-01-31 - Updates to build Universal Binaries while retaining 10.2 compatibility. - We were unable to get MMX/SSE support enabled. It is believed that a rewrite of - the assembly code will be necessary to make it position independent and not - require nasm. Altivec has finally been enabled for PPC. (Eric Wing) - -2005-09-?? - Had to add back the exports file because it was causing build problems - for some cases. (Eric Wing) - -2005-08-21 - First entry in history. Updated for SDL 1.2.9 and Xcode 2.1. Getting - ready for Universal Binaries. Removed the .pkg system for .dmg for due to problems - with broken packages in the past several SDL point releases. Removed usage of SDL - exports file because it has become another point of failure. Introduced new documentation - about SDLMain and how to compile in an devel-lite section of the SDL.dmg. (Eric Wing) - -Before history: -SDL 1.2.6? to 1.2.8 -Started updating Project Builder projects to Xcode for Panther and Tiger. Also removed -the system that split the single framework into separate runtime and headers frameworks. -This is against Apple conventions and causes problems on multiuser systems. -We now distribute a single framework. -The .pkg system has repeatedly been broken with every new release of OS X. -With 1.2.8, started migrating stuff to .dmg based system to simplify distribution process. -Tried updating the exports file and Perl script generation system for changing syntax. (Eric Wing) - -Pre-SDL 1.2.6 -Created Project Builder projects for SDL and .pkg based distribution system. (Darrell Walisser) - - - - - - - - diff --git a/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt b/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt deleted file mode 100644 index d2cd793c5c..0000000000 --- a/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt +++ /dev/null @@ -1,12 +0,0 @@ -This directory is for developers. This directory contains some basic essentials you will need for developing SDL based applications on OS X. The SDL-devel package contains all of this stuff plus more, so you can ignore this if you install the SDL-devel.pkg. The SDL-devel package contains Xcode templates, SDL documentation, and different variations of SDLmain and NIB files for SDL. - -To compile an SDL based application on OS X, SDLMain.m must be compiled into your program. (See the SDL FAQ). The SDL-devel.pkg includes Xcode templates which already do this for you. But for those who may not want to install the dev package, an SDLMain is provided here as a convenience. Be aware that there are different variations of SDLMain.m depending on what class of SDL application you make and they are intended to work with NIB files. Only one SDLMain variant is provided here and without any NIB files. You should look to the SDL-devel package for the others. We currently do not provide a SDLMain.a file, partly to call to attention that there are different variations of SDLmain. - -To build from the command line, your gcc line will look something like this: - -gcc -I/Library/Frameworks/SDL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa - -An SDL/OpenGL based application might look like: - -gcc -I/Library/Frameworks/SDL.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa -framework OpenGL - diff --git a/Xcode/SDL/pkg-support/resources/SDL_DS_Store b/Xcode/SDL/pkg-support/resources/SDL_DS_Store index f15a5e78c0..5658d15e4f 100644 Binary files a/Xcode/SDL/pkg-support/resources/SDL_DS_Store and b/Xcode/SDL/pkg-support/resources/SDL_DS_Store differ diff --git a/Xcode/SDL/pkg-support/resources/UniversalBinaryNotes.rtf b/Xcode/SDL/pkg-support/resources/UniversalBinaryNotes.rtf deleted file mode 100644 index 5585ecb5a6..0000000000 --- a/Xcode/SDL/pkg-support/resources/UniversalBinaryNotes.rtf +++ /dev/null @@ -1,150 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf110 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;\f2\fmodern\fcharset0 Courier-Oblique; -} -{\colortbl;\red255\green255\blue255;} -{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural - -\f0\b\fs24 \cf0 64-bit Universal Binary Notes:\ - -\b0 \ -SDL 1.2.14 is our first release with Snow Leopard on the market. In order to make SDL compile and run in 64-bit, we had to remove code that depended on deprecated Mac APIs and move over to more modern Mac APIs.\ -\ -In addition, Apple has stopped shipping gcc 3.3 and the 10.3 SDK.\ -\ -Because of all these combined factors, we have made the decision to make Mac OS X 10.4 the new minimum requirement for SDL.\ -\ -Our official SDL.framework is compiled as a 3-way Universal Binary (64-bit Intel, 32-bit Intel, 32-bit PowerPC.)\ -\ -Certain APIs that SDL relies on were not made 64-bit ready by Apple until 10.6. This means even though 10.5 had preliminary 64-bit support, SDL will not compile or run correctly in 64-bit mode on 10.5. So there are two fallout items from this.\ -\ -First, you can only compile 64-bit code on Snow Leopard or greater (which removes the possibility of 64-bit PowerPC). \ -\ -Second, this presents a corner-case where if you have a 64-bit Intel executable in your Universal binary and try to run on 10.5 on an 64-bit Intel Mac, it will launch and crash. To force 10.5 to use the 32-bit version instead of the 64-bit, you should set the LaunchServices key, LSMinimumSystemVersionByArchitecture, in your application's Info.plist. Our SDL/Xcode templates for Snow Leopard already set this up for you.\ -\ -\ -One additional fallout item is we had to remove the SDL Custom Cocoa Xcode template project. It depended on NSQuickTimeView which was deprecated and removed from the SDL codebase. It may still be possible to recreate the behavior that this template demonstrated, but we would need a volunteer to investigate this.\ -\ -\ -\ -In addition, the SDL satellite projects were affected by the 64-bit transition.\ -\ -- SDL_mixer depended on legacy Quicktime for midi playback support. We had to disable midi. (Recall that we also disabled MP3 support awhile back because we never got SMPEG working during the Tiger/Intel transition.) To fix this, we would need a native Core Audio backend for SDL_mixer.\ -\ -- Since we have changed the baseline to 10.4, we took this opportunity to switch SDL_image over to a new native ImageIO based backend. This makes the binary about 10x smaller, greatly simplifies our maintenance requirements and build process as we no longer have to maintain build systems for 3rd party dependencies, and gives us access to more image formats.\ -\ -- The static library target for SDL_ttf no longer works because we no longer have access to a libfreetype.a. We have been relying on Apple's supplied libfreetype.a, but they stopped shipping a static version starting in 10.5 which means we have no static 64-bit version. But since 10.4 is our new baseline, all these systems should have libfreetype.dylib installed, so it shouldn't be much of a problem to use SDL_ttf as a dynamic library which dynamically links to libfreetype.\ -\ -\ --Eric Wing 2009-09-23\ - -\b \ -\ -\ -\ -Universal Binary Notes: (historical, somewhat obsolete)\ - -\b0 \ -Below is an overview of what we had to do to build Universal Binaries for SDL (and satellites). The document is provided to help others understand what the heck we had to do to get this to work so they know (and don't break) any settings we have set to accomplish this. It also describes areas of problems for those who might attempt to fix them after us.\ -\ -\ -It turns out that developing a Universal Binary for SDL was a painful process, but not for the typical reasons affecting most other developers. SDL is already platform clean and has an Xcode project which are usually the two biggest obstacles. (The only real code bug we had to fix was in SDL_mixer, but that was due to a Quicktime issue so we can blame the Quicktime authors.)\ -\ -But developing a Universal Binary was painful to us for several reasons:\ -\ -\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural -\ls1\ilvl0\cf0 {\listtext \'95 }SDL must retain compatibility with 10.2 (Jaguar)\ -\ -{\listtext \'95 }SDL has processor specific optimizations (Altivec, MMX/SSE)\ -\ -{\listtext \'95 }The SDL satellites (SDL_mixer, SDL_image, SDL_ttf) have 3rd party dependencies which we currently statically link against. All of these dependencies needed to be updated/recompiled with the same above constraints.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 \ -For retaining compatibility with 10.2, we have experimentally determined that there is no reliable way to use gcc 4.0.x to compile a binary that works under Jaguar. With the gcc 4.0 that shipped in Xcode 2.1, libgcc_s was automatically linked against. This library does not exist on systems prior to 10.3.9. After filing a bug report, Apple removed this automatic linking in gcc 4.0.1 which shipped with Xcode 2.2, but we discovered that we suffered from undefined symbols to things in the printf family library. (They seem to be new symbols related to printing long doubles, etc.)\ -\ -So to accomplish our compatibility goals, we had to find and exploit some lesser known features of Xcode that allow us to specify architecture specific build flags found here:\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_07_bs_building_product/chapter_33_section_6.html#//apple_ref/doc/uid/TP40002693-SW3"}}{\fldrslt \cf0 http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_07_bs_building_product/chapter_33_section_6.html#//apple_ref/doc/uid/TP40002693-SW3}}\ -\ -The first and most important of these is the -\f1 GCC_VERSION flag which lets us set gcc 3.3 for PowerPC and gcc 4.0 for Intel.\ -\ -But we also needed to verify other options such as the deployment target and SDK. Experimentally, we found that the Deployment target did very little for us except retain prebinding. Setting it to anything less than 10.4 allows for prebinding to remain active.\ -\ -For the SDK's, we found that Apple does link against different versions of system components. But experimentally, we discovered we could still link to the 10.4u SDK and things would still work on Jaguar. Ideally we should probably link to the 10.2.8 SDK for PowerPC. But in reality, most people don't install the 10.2.8 SDK on their system (it is not a default component) so we didn't want to confuse people as setting this would likely cause people's compile to fail the first time they try and they would have to understand the reason for this. We did leave the architecture specific SDKROOT option set explicitly to make it easy to change in case we need to.\ -\ -For the Altivec and MMX/SSE options, we had to use architecture specific build flags. Furthermore, to use SSE, we also had to include the assembly code. This caused us problems because there is no easy way to tell Xcode to use files only for a specific architecture. So the PowerPC side got confused on the .asm files and would fail to compile. \ -\ -Pushing forward, we ignored PPC for the moment to see if we could at least build an optimized x86 build and then use lipo manually to merge the results. We encountered additional problems. First the alignment needed to be changed for reasons outside my knowledge base. We changed all instances of .align 16 to .align 8. This seemed to fix the compile problems. But at the linking stage, we got errors such as:\ -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li640\fi-640\ql\qnatural\pardirnatural - -\f2\i\fs22 \cf0 ld: /Users/ewing/DEVELOPMENT/CODETEST/UniversalBinarySDL/SDL12/Xcode/SDL/build/SDL.build/Deployment/Framework.build/Objects-normal/i386/SDL_yuv_mmx.o has local relocation entries in non-writable section (__TEXT,__text)\ -/usr/bin/libtool: internal link edit command failed\ -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural - -\f1\i0\fs24 \cf0 \ -Our belief is that the assembly code is not position independent and thus will not work for us. We double checked for any OS X gcc flags that control position independence, but everything seemed to be in order. As such, we cannot compile MMX/SSE optimizations until they are rewritten, preferably without the nasm requirement to accommodate the dual PPC/x86 Xcode limitations.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 \ -So for now, we have unchecked (checkbox) the assembly specific files in the Xcode project and have removed the -DUSE_ASMBLIT flag from OTHER_CFLAGS_i386. To reactivate this stuff, you will need to recheck the boxes and re-add the flag.\ -\ -The files are\ -SDL_mixer_MMX.c/h\ -The files under hermes\ -and SDL_yuv_mmx.c\ -\ -\ -\ -For the SDL satellites, it was more of the same. The painful part was that the 3rd library dependencies needed to be rebuilt. (Some of our libraries were out of date, so this was an opportunity to update them.) But this meant changing those build systems as well. \ -\ -These are the versions I used:\ -libpng-1.2.8\ -libjpeg-6b\ -libogg-1.1.3\ -libvorbis-1.1.2\ -smpeg cvs\ -\ -We found that Apple already had a libfreetype in the 10.4u SDK so we just used that one which seemed to work. (For the record, the question did come up of why we statically link against this when it seems to be a standard component on Panther and Tiger. We double checked, and it did not seem to be in Jaguar. So that's why.)\ -\ -The old libpng turned out to be from the 1.0.x branch so we needed to replace all the headers we had as well. Updating to the 1.2.x branch didn't seem to cause any problems we could detect.\ -\ -libpng and libjpeg lack an Xcode project so we mucked with their build system to produce Universal Binaries. But since we needed PPC to be compiled with 3.3 and Intel to be compiled with 4.0, it ended up that we built multiple times changing the compiler, and then using lipo to strip and combine the binaries.\ -\ -libogg/libvorbis did contain Xcode projects, but didn't build static libraries so we had to add that. We also discovered that not building with gcc 3.3 caused us addition missing symbol runtime problems with float versions of math functions (sinf, sqrtf, etc).\ -\ -It seems that once upon a time, the SDL_mixer framework supported MP3's via SMPEG, but this disappeared at some point. I don't know why or how this happened. But I also don't know how SMPEG was ever used with the framework as there was no preexisting infrastructure as with the other libraries. So I have attempted to correct this oversight, however, the SMPEG framework itself has MMX code which has also turned out to be problematic. I am getting compiler errors of " -\f2\i\fs22 Unknown pseudo-op:" -\f1\i0\fs24 for -\f2\i\fs22 .type -\f1\i0\fs24 and -\f2\i\fs22 .size. -\f1\i0\fs24 \ -So SMPEG is currently compiled without MMX optimizations.\ -\ -\ -\ -\ -Addendum: \ -2006-03-06:\ -The main SDL code base (not the satellites) have undergone an overhaul. The required platform specific defines have been moved out of the build system into platform specific header files (SDL_config_*.h). This allows us to simplify the Xcode projects somewhat, but we still must maintain the architecture specific build options to invoke gcc 3.3 to maintain our mandated 10.2 compatibilty requirement.\ -\ -Also it appears that the MMX/SSE code has been rewritten as well so that the obstacles we faced in compiling in these optimizations are no longer problems. The binaries we produce should now contain the processor specific optimizations. (Remember this note only applies to SDL and not the satellites, such as SMPEG.)\ -\ -\ -\ -Contributers:\ -Eric Wing (Xcode projects, 3rd party dependencies, documentation)\ -Christian Walther (10.2.8 and 10.3.9 testing/verification)\ -Ryan Gordon (converted C++ code in SDL/OSX code base to pure C)\ -Martin Storsj\'f6 (libgcc_s testing/verification)\ -Stephane Marchesin (MMX/SSE code expert)\ -\ -\ -\ -\ -\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural - -\f0 \cf0 \ -} \ No newline at end of file diff --git a/Xcode/SDLTest/Info-checkkeys__Upgraded_.plist b/Xcode/SDLTest/Info-checkkeys__Upgraded_.plist deleted file mode 100644 index 69321e3746..0000000000 --- a/Xcode/SDLTest/Info-checkkeys__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - checkkeys - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-graywin__Upgraded_.plist b/Xcode/SDLTest/Info-graywin__Upgraded_.plist deleted file mode 100644 index 0a9c04b108..0000000000 --- a/Xcode/SDLTest/Info-graywin__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - graywin - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-loopwave__Upgraded_.plist b/Xcode/SDLTest/Info-loopwave__Upgraded_.plist deleted file mode 100644 index 5f66864f85..0000000000 --- a/Xcode/SDLTest/Info-loopwave__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - loopwave - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-test.plist b/Xcode/SDLTest/Info-test.plist deleted file mode 100644 index 60d5db5b3f..0000000000 --- a/Xcode/SDLTest/Info-test.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testalpha - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testalpha__Upgraded_.plist b/Xcode/SDLTest/Info-testalpha__Upgraded_.plist deleted file mode 100644 index 60d5db5b3f..0000000000 --- a/Xcode/SDLTest/Info-testalpha__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testalpha - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testbitmap__Upgraded_.plist b/Xcode/SDLTest/Info-testbitmap__Upgraded_.plist deleted file mode 100644 index 87ec2719ea..0000000000 --- a/Xcode/SDLTest/Info-testbitmap__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testbitmap - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testblitspeed.plist b/Xcode/SDLTest/Info-testblitspeed.plist deleted file mode 100644 index c7fbcfe569..0000000000 --- a/Xcode/SDLTest/Info-testblitspeed.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testblitspeed - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testcdrom__Upgraded_.plist b/Xcode/SDLTest/Info-testcdrom__Upgraded_.plist deleted file mode 100644 index dde6614d7e..0000000000 --- a/Xcode/SDLTest/Info-testcdrom__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testcdrom - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testdyngl.plist b/Xcode/SDLTest/Info-testdyngl.plist deleted file mode 100644 index 1874119d2c..0000000000 --- a/Xcode/SDLTest/Info-testdyngl.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testdyngl - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testerror__Upgraded_.plist b/Xcode/SDLTest/Info-testerror__Upgraded_.plist deleted file mode 100644 index 11cc0fdc89..0000000000 --- a/Xcode/SDLTest/Info-testerror__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testerror - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testfile.plist b/Xcode/SDLTest/Info-testfile.plist deleted file mode 100644 index 6488b54e6d..0000000000 --- a/Xcode/SDLTest/Info-testfile.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testfile - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testgamma__Upgraded_.plist b/Xcode/SDLTest/Info-testgamma__Upgraded_.plist deleted file mode 100644 index 6a6b5af8d6..0000000000 --- a/Xcode/SDLTest/Info-testgamma__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testgamma - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testgl__Upgraded_.plist b/Xcode/SDLTest/Info-testgl__Upgraded_.plist deleted file mode 100644 index eecc9cc348..0000000000 --- a/Xcode/SDLTest/Info-testgl__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testgl - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testiconv.plist b/Xcode/SDLTest/Info-testiconv.plist deleted file mode 100644 index 0ff003f8a8..0000000000 --- a/Xcode/SDLTest/Info-testiconv.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testiconv - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testjoystick__Upgraded_.plist b/Xcode/SDLTest/Info-testjoystick__Upgraded_.plist deleted file mode 100644 index ef2e274f17..0000000000 --- a/Xcode/SDLTest/Info-testjoystick__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testjoystick - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testkeys__Upgraded_.plist b/Xcode/SDLTest/Info-testkeys__Upgraded_.plist deleted file mode 100644 index 03eba705b4..0000000000 --- a/Xcode/SDLTest/Info-testkeys__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testkeys - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testlock__Upgraded_.plist b/Xcode/SDLTest/Info-testlock__Upgraded_.plist deleted file mode 100644 index 50b71f2d34..0000000000 --- a/Xcode/SDLTest/Info-testlock__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testlock - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testoverlay2.plist b/Xcode/SDLTest/Info-testoverlay2.plist deleted file mode 100644 index 664e0ce6d2..0000000000 --- a/Xcode/SDLTest/Info-testoverlay2.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testoverlay2 - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testoverlay__Upgraded_.plist b/Xcode/SDLTest/Info-testoverlay__Upgraded_.plist deleted file mode 100644 index a7a8a77264..0000000000 --- a/Xcode/SDLTest/Info-testoverlay__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testpalette__Upgraded_.plist b/Xcode/SDLTest/Info-testpalette__Upgraded_.plist deleted file mode 100644 index a08947ecb1..0000000000 --- a/Xcode/SDLTest/Info-testpalette__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testpalette - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testplatform.plist b/Xcode/SDLTest/Info-testplatform.plist deleted file mode 100644 index 9b60de2435..0000000000 --- a/Xcode/SDLTest/Info-testplatform.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testplatform - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testsem__Upgraded_.plist b/Xcode/SDLTest/Info-testsem__Upgraded_.plist deleted file mode 100644 index 69235feaca..0000000000 --- a/Xcode/SDLTest/Info-testsem__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testsem - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testsprite__Upgraded_.plist b/Xcode/SDLTest/Info-testsprite__Upgraded_.plist deleted file mode 100644 index 91739c16ff..0000000000 --- a/Xcode/SDLTest/Info-testsprite__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testsprite - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testthread__Upgraded_.plist b/Xcode/SDLTest/Info-testthread__Upgraded_.plist deleted file mode 100644 index 30147f0566..0000000000 --- a/Xcode/SDLTest/Info-testthread__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testthread - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testtimer__Upgraded_.plist b/Xcode/SDLTest/Info-testtimer__Upgraded_.plist deleted file mode 100644 index a143244cac..0000000000 --- a/Xcode/SDLTest/Info-testtimer__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testtimer - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testtypes__Upgraded_.plist b/Xcode/SDLTest/Info-testtypes__Upgraded_.plist deleted file mode 100644 index f16490c02b..0000000000 --- a/Xcode/SDLTest/Info-testtypes__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testtypes - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testversion__Upgraded_.plist b/Xcode/SDLTest/Info-testversion__Upgraded_.plist deleted file mode 100644 index ba635f703d..0000000000 --- a/Xcode/SDLTest/Info-testversion__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testversion - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testvidinfo__Upgraded_.plist b/Xcode/SDLTest/Info-testvidinfo__Upgraded_.plist deleted file mode 100644 index 35f13b473c..0000000000 --- a/Xcode/SDLTest/Info-testvidinfo__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testvidinfo - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testwin__Upgraded_.plist b/Xcode/SDLTest/Info-testwin__Upgraded_.plist deleted file mode 100644 index f0e91c6cd5..0000000000 --- a/Xcode/SDLTest/Info-testwin__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testwin - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-testwm__Upgraded_.plist b/Xcode/SDLTest/Info-testwm__Upgraded_.plist deleted file mode 100644 index 9979ee4bff..0000000000 --- a/Xcode/SDLTest/Info-testwm__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - testwm - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-threadwin__Upgraded_.plist b/Xcode/SDLTest/Info-threadwin__Upgraded_.plist deleted file mode 100644 index 721763d257..0000000000 --- a/Xcode/SDLTest/Info-threadwin__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - threadwin - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/Info-torturethread__Upgraded_.plist b/Xcode/SDLTest/Info-torturethread__Upgraded_.plist deleted file mode 100644 index 3433469d13..0000000000 --- a/Xcode/SDLTest/Info-torturethread__Upgraded_.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - torturethread - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 0.0.1d1 - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj index 938d60f9da..bb4714de21 100755 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 46; objects = { /* Begin PBXAggregateTarget section */ @@ -13,37 +13,47 @@ buildPhases = ( ); dependencies = ( - 003FA6A809400236000C53B3 /* PBXTargetDependency */, - BEC568010761D90600A33029 /* PBXTargetDependency */, - BEC568030761D90600A33029 /* PBXTargetDependency */, - BEC568050761D90600A33029 /* PBXTargetDependency */, - BEC568070761D90600A33029 /* PBXTargetDependency */, - BEC568090761D90600A33029 /* PBXTargetDependency */, - 002F347909CA215600EBEB88 /* PBXTargetDependency */, - BEC5680B0761D90600A33029 /* PBXTargetDependency */, - 002F347B09CA215600EBEB88 /* PBXTargetDependency */, - BEC5680D0761D90600A33029 /* PBXTargetDependency */, - 002F347D09CA215600EBEB88 /* PBXTargetDependency */, - BEC5680F0761D90600A33029 /* PBXTargetDependency */, - BEC568110761D90600A33029 /* PBXTargetDependency */, - 002F347F09CA215600EBEB88 /* PBXTargetDependency */, - BEC568150761D90600A33029 /* PBXTargetDependency */, - BEC568170761D90600A33029 /* PBXTargetDependency */, - BEC568190761D90600A33029 /* PBXTargetDependency */, - 002F348109CA215600EBEB88 /* PBXTargetDependency */, - 002F348309CA215600EBEB88 /* PBXTargetDependency */, - BEC5681B0761D90600A33029 /* PBXTargetDependency */, - 002F348509CA215600EBEB88 /* PBXTargetDependency */, - BEC5681D0761D90600A33029 /* PBXTargetDependency */, - BEC5681F0761D90600A33029 /* PBXTargetDependency */, - BEC568130761D90600A33029 /* PBXTargetDependency */, - BEC568210761D90600A33029 /* PBXTargetDependency */, - BEC568250761D90600A33029 /* PBXTargetDependency */, - BEC568270761D90600A33029 /* PBXTargetDependency */, - BEC568290761D90600A33029 /* PBXTargetDependency */, - BEC5682B0761D90600A33029 /* PBXTargetDependency */, - BEC5682D0761D90600A33029 /* PBXTargetDependency */, - BEC5682F0761D90600A33029 /* PBXTargetDependency */, + DB166E9816A1D7CF00A1396C /* PBXTargetDependency */, + DB166E9616A1D7CD00A1396C /* PBXTargetDependency */, + DB166E6C16A1D72000A1396C /* PBXTargetDependency */, + DB166E5616A1D6B800A1396C /* PBXTargetDependency */, + DB166E3B16A1D65A00A1396C /* PBXTargetDependency */, + DB166E2016A1D5D000A1396C /* PBXTargetDependency */, + DB166E0916A1D5A400A1396C /* PBXTargetDependency */, + DB166DF216A1D53700A1396C /* PBXTargetDependency */, + DB166DD916A1D38900A1396C /* PBXTargetDependency */, + 001799481074403E00F5D044 /* PBXTargetDependency */, + 0017994C1074403E00F5D044 /* PBXTargetDependency */, + 001799501074403E00F5D044 /* PBXTargetDependency */, + 001799521074403E00F5D044 /* PBXTargetDependency */, + 0017995A1074403E00F5D044 /* PBXTargetDependency */, + 0017995E1074403E00F5D044 /* PBXTargetDependency */, + 001799601074403E00F5D044 /* PBXTargetDependency */, + 001799661074403E00F5D044 /* PBXTargetDependency */, + 001799681074403E00F5D044 /* PBXTargetDependency */, + 0017996A1074403E00F5D044 /* PBXTargetDependency */, + 0017996C1074403E00F5D044 /* PBXTargetDependency */, + 0017996E1074403E00F5D044 /* PBXTargetDependency */, + 001799701074403E00F5D044 /* PBXTargetDependency */, + 001799721074403E00F5D044 /* PBXTargetDependency */, + 001799741074403E00F5D044 /* PBXTargetDependency */, + 001799761074403E00F5D044 /* PBXTargetDependency */, + 001799781074403E00F5D044 /* PBXTargetDependency */, + 0017997C1074403E00F5D044 /* PBXTargetDependency */, + 001799801074403E00F5D044 /* PBXTargetDependency */, + 001799841074403E00F5D044 /* PBXTargetDependency */, + 001799881074403E00F5D044 /* PBXTargetDependency */, + 0017998A1074403E00F5D044 /* PBXTargetDependency */, + 0017998C1074403E00F5D044 /* PBXTargetDependency */, + 0017998E1074403E00F5D044 /* PBXTargetDependency */, + 001799921074403E00F5D044 /* PBXTargetDependency */, + 001799941074403E00F5D044 /* PBXTargetDependency */, + 001799961074403E00F5D044 /* PBXTargetDependency */, + 0017999E1074403E00F5D044 /* PBXTargetDependency */, + 001799A21074403E00F5D044 /* PBXTargetDependency */, + DB166D7016A1CEAF00A1396C /* PBXTargetDependency */, + DB166D6E16A1CEAA00A1396C /* PBXTargetDependency */, + DB166DC316A1D32C00A1396C /* PBXTargetDependency */, ); name = All; productName = "Build All"; @@ -51,645 +61,815 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 002F337509CA14F900EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - 002F337909CA14F900EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - 002F337A09CA14F900EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 002F338B09CA16BF00EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - 002F338F09CA16BF00EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - 002F339009CA16BF00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 002F339B09CA17BC00EBEB88 /* testblitspeed.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F339A09CA17BC00EBEB88 /* testblitspeed.c */; }; - 002F33A809CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33A909CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 001794D01073667700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794D11073667B00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794D41073668800F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794D51073668D00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794D61073669200F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794D71073669700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794D91073669E00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794DB107366A700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794DC107366AC00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794DE107366B900F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794DF107366BD00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794E0107366C100F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001794E5107366D900F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 0017957C10741F7900F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017957D10741F7900F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 0017957E10741F7900F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 0017957F10741F7900F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 0017958010741F7900F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 0017958110741F7900F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 0017958210741F7900F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 0017958310741F7900F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 0017958410741F7900F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 0017958510741F7900F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001795901074216E00F5D044 /* testatomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017958F1074216E00F5D044 /* testatomic.c */; }; + 0017959D107421BF00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017959E107421BF00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 0017959F107421BF00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 001795A0107421BF00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 001795A1107421BF00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 001795A2107421BF00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 001795A3107421BF00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 001795A4107421BF00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 001795A5107421BF00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 001795A6107421BF00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001795B11074222D00F5D044 /* testaudioinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 001795B01074222D00F5D044 /* testaudioinfo.c */; }; + 0017971110742F3200F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017971210742F3200F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 0017971310742F3200F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 0017971410742F3200F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 0017971510742F3200F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 0017971610742F3200F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 0017971710742F3200F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 0017971810742F3200F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 0017971910742F3200F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 0017971A10742F3200F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 0017972810742FB900F5D044 /* testgl2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017972710742FB900F5D044 /* testgl2.c */; }; + 00179738107430D600F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 00179739107430D600F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 0017973A107430D600F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 0017973B107430D600F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 0017973C107430D600F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 0017973D107430D600F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 0017973E107430D600F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 0017973F107430D600F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 00179740107430D600F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 00179741107430D600F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 0017974F1074315700F5D044 /* testhaptic.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017974E1074315700F5D044 /* testhaptic.c */; }; + 0017975E107431B300F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017975F107431B300F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 00179760107431B300F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 00179761107431B300F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 00179762107431B300F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 00179763107431B300F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 00179764107431B300F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 00179765107431B300F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 00179766107431B300F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 00179767107431B300F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001797721074320D00F5D044 /* testdraw2.c in Sources */ = {isa = PBXBuildFile; fileRef = 001797711074320D00F5D044 /* testdraw2.c */; }; + 0017977E107432AE00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017977F107432AE00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 00179780107432AE00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 00179781107432AE00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 00179782107432AE00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 00179783107432AE00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 00179784107432AE00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 00179785107432AE00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 00179786107432AE00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 00179787107432AE00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 00179792107432FA00F5D044 /* testime.c in Sources */ = {isa = PBXBuildFile; fileRef = 00179791107432FA00F5D044 /* testime.c */; }; + 0017979E1074334C00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017979F1074334C00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 001797A01074334C00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 001797A11074334C00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 001797A21074334C00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 001797A31074334C00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 001797A41074334C00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 001797A51074334C00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 001797A61074334C00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 001797A71074334C00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001797B41074339C00F5D044 /* testintersections.c in Sources */ = {isa = PBXBuildFile; fileRef = 001797B31074339C00F5D044 /* testintersections.c */; }; + 001797C0107433C600F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 001797C1107433C600F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 001797C2107433C600F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 001797C3107433C600F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 001797C4107433C600F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 001797C5107433C600F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 001797C6107433C600F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 001797C7107433C600F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 001797C8107433C600F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 001797C9107433C600F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001797D41074343E00F5D044 /* testloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 001797D31074343E00F5D044 /* testloadso.c */; }; + 001798021074355200F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 001798031074355200F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 001798041074355200F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 001798051074355200F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 001798061074355200F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 001798071074355200F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 001798081074355200F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 001798091074355200F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 0017980A1074355200F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 0017980B1074355200F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001798161074359B00F5D044 /* testmultiaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 001798151074359B00F5D044 /* testmultiaudio.c */; }; + 0017987F1074392D00F5D044 /* testnative.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017985A107436ED00F5D044 /* testnative.c */; }; + 001798801074392D00F5D044 /* testnativecocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = 0017985C107436ED00F5D044 /* testnativecocoa.m */; }; + 001798811074392D00F5D044 /* testnativex11.c in Sources */ = {isa = PBXBuildFile; fileRef = 00179872107438D000F5D044 /* testnativex11.c */; }; + 001798841074392D00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 001798851074392D00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 001798861074392D00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 001798871074392D00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 001798881074392D00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 001798891074392D00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 0017988A1074392D00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 0017988B1074392D00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 0017988C1074392D00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 0017988D1074392D00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001798A5107439DF00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 001798A6107439DF00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 001798A7107439DF00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 001798A8107439DF00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 001798A9107439DF00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 001798AA107439DF00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 001798AB107439DF00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 001798AC107439DF00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 001798AD107439DF00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 001798AE107439DF00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001798BA10743A4900F5D044 /* testpower.c in Sources */ = {isa = PBXBuildFile; fileRef = 001798B910743A4900F5D044 /* testpower.c */; }; + 001798E210743BEC00F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 001798E310743BEC00F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 001798E410743BEC00F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 001798E510743BEC00F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 001798E610743BEC00F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 001798E710743BEC00F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 001798E810743BEC00F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 001798E910743BEC00F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 001798EA10743BEC00F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 001798EB10743BEC00F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 001798FA10743E9200F5D044 /* testresample.c in Sources */ = {isa = PBXBuildFile; fileRef = 001798F910743E9200F5D044 /* testresample.c */; }; + 0017990610743F1000F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017990710743F1000F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 0017990810743F1000F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 0017990910743F1000F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 0017990A10743F1000F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 0017990B10743F1000F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 0017990C10743F1000F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 0017990D10743F1000F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 0017990E10743F1000F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 0017990F10743F1000F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 0017991A10743F5300F5D044 /* testsprite2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017991910743F5300F5D044 /* testsprite2.c */; }; + 0017992810743FB700F5D044 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + 0017992910743FB700F5D044 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 0017992A10743FB700F5D044 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 0017992B10743FB700F5D044 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 0017992C10743FB700F5D044 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 0017992D10743FB700F5D044 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 0017992E10743FB700F5D044 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 0017992F10743FB700F5D044 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 0017993010743FB700F5D044 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 0017993110743FB700F5D044 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 0017993C10743FEF00F5D044 /* testwm2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0017993B10743FEF00F5D044 /* testwm2.c */; }; + 002A863010730405007319AE /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + 002A864110730546007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A864210730546007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A864310730546007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A864D10730546007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A864E10730546007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A864F10730546007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A865310730547007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A865410730547007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A865510730547007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A866210730547007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A866310730547007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A866410730547007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A866B10730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A866C10730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A866D10730548007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A866E10730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A866F10730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A867010730548007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A867410730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A867510730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A867610730548007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A867710730548007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A867810730548007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A867910730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A867A10730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A867B10730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A867C10730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A868010730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A868110730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A868210730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A868610730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A868710730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A868810730549007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A868910730549007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A868A10730549007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A868B1073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A868F1073054A007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A86901073054A007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A86911073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A86951073054A007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A86961073054A007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A86971073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A86981073054A007319AE /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + 002A86991073054A007319AE /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + 002A869A1073054A007319AE /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + 002A86A310730593007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86A410730593007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86AB10730594007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86AC10730594007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86AF10730594007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86B010730594007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86B910730594007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86BA10730594007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86BF10730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86C010730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86C110730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86C210730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86C510730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86C610730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86C710730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86C810730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86C910730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86CA10730595007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86CD10730595007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86CE10730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86D110730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86D210730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86D310730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86D410730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86D710730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86D810730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86DB10730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86DC10730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86DD10730596007319AE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + 002A86DE10730596007319AE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + 002A86F4107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A86F8107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A86FA107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A86FF107305CE007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8702107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8703107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8705107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8706107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8707107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8709107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A870B107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A870C107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A870E107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8710107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A8711107305CF007319AE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + 002A871610730623007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A871A10730623007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A871C10730623007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872110730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872410730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872510730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872710730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872810730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872910730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872B10730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872D10730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A872E10730624007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A873010730625007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A873210730625007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A873310730625007319AE /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + 002A873B10730675007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A873F10730675007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A874110730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A874610730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A874910730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A874A10730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A874C10730676007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A874D10730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A874E10730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A875010730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A875210730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A875310730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A875510730677007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A875710730678007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A875810730678007319AE /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + 002A875E10730745007319AE /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; 002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33AB09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33AC09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33AD09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33AE09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33B109CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33B309CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33B409CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33B909CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33BA09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33BB09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33BD09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33BE09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33C009CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33CF09CA19A600EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - 002F33D209CA19A600EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - 002F33D309CA19A600EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 002F33D409CA19A600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; - 002F33E309CA1A0B00EBEB88 /* testdyngl.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F33E209CA1A0B00EBEB88 /* testdyngl.c */; }; - 002F340609CA1BFF00EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - 002F340909CA1BFF00EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - 002F340A09CA1BFF00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; 002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F341809CA1C5B00EBEB88 /* testfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F341709CA1C5B00EBEB88 /* testfile.c */; }; - 002F342509CA1F0300EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - 002F342809CA1F0300EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - 002F342909CA1F0300EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; 002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F343709CA1F6F00EBEB88 /* testiconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F343609CA1F6F00EBEB88 /* testiconv.c */; }; - 002F344109CA1FB300EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - 002F344409CA1FB300EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - 002F344509CA1FB300EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; 002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F345409CA202000EBEB88 /* testoverlay2.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F345209CA201C00EBEB88 /* testoverlay2.c */; }; - 002F345E09CA204F00EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - 002F346109CA204F00EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - 002F346209CA204F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; 002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; 002F347009CA20A600EBEB88 /* testplatform.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F346F09CA20A600EBEB88 /* testplatform.c */; }; - 003FA64D093FFDB3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA64E093FFDB5000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA64F093FFDB7000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA650093FFDBA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA651093FFDBC000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA652093FFDBE000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA653093FFDC1000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA654093FFDC3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA655093FFDC6000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA656093FFDC8000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA657093FFDCA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA658093FFDCC000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA659093FFDCF000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA65A093FFDD1000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA65B093FFDD3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA65C093FFDD5000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA65D093FFDD7000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA65E093FFDDA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA660093FFDDF000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA661093FFDE1000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA662093FFDE3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA663093FFDE6000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA664093FFDE8000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 003FA665093FFDEA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; }; - 00794DD909D1F894003FC8A1 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00794DD809D1F894003FC8A1 /* OpenGL.framework */; }; 00794E6609D20865003FC8A1 /* sample.wav in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6209D20839003FC8A1 /* sample.wav */; }; - 00794EA209D2344B003FC8A1 /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; - 00794EB709D235F5003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; }; - 00794EE709D236ED003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; }; 00794EF009D23739003FC8A1 /* utf8.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6309D20839003FC8A1 /* utf8.txt */; }; 00794EF709D237DE003FC8A1 /* moose.dat in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5E09D20839003FC8A1 /* moose.dat */; }; - 00794EFE09D2382B003FC8A1 /* sail.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6009D20839003FC8A1 /* sail.bmp */; }; - 00794F0409D23869003FC8A1 /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; - 00794F0B09D238F4003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; }; - 00794F1109D2392B003FC8A1 /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; - 00794F8709D2413B003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; }; - BEC566AF0761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; + 453774A5120915E3002F0F45 /* testshape.c in Sources */ = {isa = PBXBuildFile; fileRef = 453774A4120915E3002F0F45 /* testshape.c */; }; + BBFC08C0164C6862003E6A99 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + BBFC08C1164C6862003E6A99 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + BBFC08C2164C6862003E6A99 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + BBFC08C3164C6862003E6A99 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + BBFC08C4164C6862003E6A99 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + BBFC08C5164C6862003E6A99 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + BBFC08C6164C6862003E6A99 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + BBFC08C7164C6862003E6A99 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + BBFC08C8164C6862003E6A99 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + BBFC08C9164C6862003E6A99 /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + BBFC08D0164C6876003E6A99 /* testgamecontroller.c in Sources */ = {isa = PBXBuildFile; fileRef = BBFC088E164C6820003E6A99 /* testgamecontroller.c */; }; BEC566B10761D90300A33029 /* checkkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D10FFB30A2C7F000001 /* checkkeys.c */; }; - BEC566BC0761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC566BE0761D90300A33029 /* graywin.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D1BFFB30C237F000001 /* graywin.c */; }; - BEC566C90761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC566CB0761D90300A33029 /* loopwave.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4872006D84C97F000001 /* loopwave.c */; }; - BEC566D70761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC566D90761D90300A33029 /* testalpha.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4874006D84F77F000001 /* testalpha.c */; }; - BEC566E50761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC566E70761D90300A33029 /* testbitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D25FFB30D1A7F000001 /* testbitmap.c */; }; - BEC566F20761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC566F40761D90300A33029 /* testcdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4876006D85297F000001 /* testcdrom.c */; }; - BEC566FF0761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC567010761D90300A33029 /* testerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4878006D85357F000001 /* testerror.c */; }; - BEC5670C0761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC5670E0761D90400A33029 /* testgamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487A006D85477F000001 /* testgamma.c */; }; - BEC5671A0761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC5671C0761D90400A33029 /* testgl.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D4EFFB311087F000001 /* testgl.c */; }; - BEC567270761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC567290761D90400A33029 /* testhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D58FFB311A97F000001 /* testhread.c */; }; - BEC567340761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; + BEC567290761D90400A33029 /* testthread.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D58FFB311A97F000001 /* testthread.c */; }; BEC567360761D90400A33029 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D62FFB312AA7F000001 /* testjoystick.c */; }; - BEC567410761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC567430761D90400A33029 /* testkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D6CFFB313437F000001 /* testkeys.c */; }; - BEC5674E0761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC567500761D90400A33029 /* testlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D75FFB313BB7F000001 /* testlock.c */; }; - BEC5675D0761D90400A33029 /* testoverlay.c in Sources */ = {isa = PBXBuildFile; fileRef = F57DC39802A6E6A201D28762 /* testoverlay.c */; }; - BEC567680761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC5676A0761D90400A33029 /* testpalette.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487C006D856B7F000001 /* testpalette.c */; }; - BEC567760761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC567780761D90500A33029 /* testsem.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487E006D86A17F000001 /* testsem.c */; }; - BEC567830761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC567850761D90500A33029 /* testsprite.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487F006D86A17F000001 /* testsprite.c */; }; - BEC567910761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC567930761D90500A33029 /* testtimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4880006D86A17F000001 /* testtimer.c */; }; - BEC567AB0761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC567AD0761D90500A33029 /* testver.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4882006D86A17F000001 /* testver.c */; }; - BEC567B80761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC567BA0761D90500A33029 /* testvidinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4883006D86A17F000001 /* testvidinfo.c */; }; - BEC567C50761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC567C70761D90500A33029 /* testwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4884006D86A17F000001 /* testwin.c */; }; - BEC567D30761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC567D50761D90500A33029 /* testwm.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4885006D86A17F000001 /* testwm.c */; }; - BEC567E10761D90600A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; - BEC567E30761D90600A33029 /* threadwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4886006D86A17F000001 /* threadwin.c */; }; - BEC567EE0761D90600A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; }; BEC567F00761D90600A33029 /* torturethread.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4887006D86A17F000001 /* torturethread.c */; }; - BEC567F90761D90600A33029 /* SDLMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EECDF3B0086C5EA7F000001 /* SDLMain.h */; }; - BEC567FA0761D90600A33029 /* libsdlmain_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = B207FF2404E1B19600A80002 /* libsdlmain_prefix.h */; }; - BEC567FC0761D90600A33029 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EECDF3C0086C5EA7F000001 /* SDLMain.m */; }; - BEC568620761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568630761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568640761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568650761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568660761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568670761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568680761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568690761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC5686A0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC5686B0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC5686C0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC5686D0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC5686E0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC5686F0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568700761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568710761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568720761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568730761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568750761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568760761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568770761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568780761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC568790761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; - BEC5687A0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; }; + DB166D7116A1CFB200A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166D7216A1CFB200A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166D7316A1CFB200A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166D7416A1CFB200A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166D7516A1CFB200A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166D7616A1CFB200A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166D7716A1CFB200A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166D7816A1CFB200A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166D7916A1CFB200A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166D7A16A1CFD500A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166D9316A1D1A500A1396C /* SDL_test_assert.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8416A1D1A500A1396C /* SDL_test_assert.c */; }; + DB166D9416A1D1A500A1396C /* SDL_test_common.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8516A1D1A500A1396C /* SDL_test_common.c */; }; + DB166D9516A1D1A500A1396C /* SDL_test_compare.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8616A1D1A500A1396C /* SDL_test_compare.c */; }; + DB166D9616A1D1A500A1396C /* SDL_test_crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */; }; + DB166D9716A1D1A500A1396C /* SDL_test_font.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8816A1D1A500A1396C /* SDL_test_font.c */; }; + DB166D9816A1D1A500A1396C /* SDL_test_fuzzer.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */; }; + DB166D9916A1D1A500A1396C /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */; }; + DB166D9A16A1D1A500A1396C /* SDL_test_imageBlit.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */; }; + DB166D9B16A1D1A500A1396C /* SDL_test_imageBlitBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */; }; + DB166D9C16A1D1A500A1396C /* SDL_test_imageFace.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */; }; + DB166D9D16A1D1A500A1396C /* SDL_test_imagePrimitives.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */; }; + DB166D9E16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */; }; + DB166D9F16A1D1A500A1396C /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9016A1D1A500A1396C /* SDL_test_log.c */; }; + DB166DA016A1D1A500A1396C /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9116A1D1A500A1396C /* SDL_test_md5.c */; }; + DB166DA116A1D1A500A1396C /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9216A1D1A500A1396C /* SDL_test_random.c */; }; + DB166DA216A1D1E900A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DA316A1D1FA00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DA416A1D21700A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DA716A1D24D00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DAA16A1D27700A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DAB16A1D27C00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DAC16A1D29000A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DB116A1D2F600A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166DB216A1D2F600A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166DB316A1D2F600A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166DB416A1D2F600A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166DB516A1D2F600A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166DB616A1D2F600A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166DB716A1D2F600A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166DB816A1D2F600A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166DB916A1D2F600A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166DBA16A1D2F600A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166DC116A1D31E00A1396C /* testgesture.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBB16A1C74100A1396C /* testgesture.c */; }; + DB166DC816A1D36A00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166DC916A1D36A00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166DCA16A1D36A00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166DCB16A1D36A00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166DCC16A1D36A00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166DCD16A1D36A00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166DCE16A1D36A00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166DCF16A1D36A00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166DD016A1D36A00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166DD116A1D36A00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166DD716A1D37800A1396C /* testmessage.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBD16A1C74100A1396C /* testmessage.c */; }; + DB166DDB16A1D42F00A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; + DB166DE016A1D50C00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166DE116A1D50C00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166DE216A1D50C00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166DE316A1D50C00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166DE416A1D50C00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166DE516A1D50C00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166DE616A1D50C00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166DE716A1D50C00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166DE816A1D50C00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166DE916A1D50C00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166DEA16A1D50C00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166DF016A1D52500A1396C /* testrelative.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBF16A1C74100A1396C /* testrelative.c */; }; + DB166DF716A1D57C00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166DF816A1D57C00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166DF916A1D57C00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166DFA16A1D57C00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166DFB16A1D57C00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166DFC16A1D57C00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166DFD16A1D57C00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166DFE16A1D57C00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166DFF16A1D57C00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166E0016A1D57C00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166E0116A1D57C00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166E0716A1D59400A1396C /* testrendercopyex.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC016A1C74100A1396C /* testrendercopyex.c */; }; + DB166E0E16A1D5AD00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166E0F16A1D5AD00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166E1016A1D5AD00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166E1116A1D5AD00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166E1216A1D5AD00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166E1316A1D5AD00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166E1416A1D5AD00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166E1516A1D5AD00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166E1616A1D5AD00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166E1716A1D5AD00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166E1816A1D5AD00A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166E1E16A1D5C300A1396C /* testrendertarget.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC116A1C74100A1396C /* testrendertarget.c */; }; + DB166E2216A1D5EC00A1396C /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; }; + DB166E2316A1D60B00A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; + DB166E2516A1D61900A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; + DB166E2616A1D61900A1396C /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; }; + DB166E2B16A1D64D00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166E2C16A1D64D00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166E2D16A1D64D00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166E2E16A1D64D00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166E2F16A1D64D00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166E3016A1D64D00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166E3116A1D64D00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166E3216A1D64D00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166E3316A1D64D00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166E3416A1D64D00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166E3C16A1D66500A1396C /* testrumble.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC216A1C74100A1396C /* testrumble.c */; }; + DB166E4116A1D69000A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166E4216A1D69000A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166E4316A1D69000A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166E4416A1D69000A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166E4516A1D69000A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166E4616A1D69000A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166E4716A1D69000A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166E4816A1D69000A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166E4916A1D69000A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166E4A16A1D69000A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166E4B16A1D69000A1396C /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; + DB166E4D16A1D69000A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; + DB166E4E16A1D69000A1396C /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; }; + DB166E5416A1D6A300A1396C /* testscale.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC316A1C74100A1396C /* testscale.c */; }; + DB166E5B16A1D6F300A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166E5C16A1D6F300A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166E5D16A1D6F300A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166E5E16A1D6F300A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166E5F16A1D6F300A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166E6016A1D6F300A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166E6116A1D6F300A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166E6216A1D6F300A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166E6316A1D6F300A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166E6416A1D6F300A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166E6A16A1D70C00A1396C /* testshader.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC416A1C74100A1396C /* testshader.c */; }; + DB166E7116A1D78400A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166E7216A1D78400A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166E7316A1D78400A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166E7416A1D78400A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166E7516A1D78400A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166E7616A1D78400A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166E7716A1D78400A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166E7816A1D78400A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166E7916A1D78400A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166E7A16A1D78400A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166E8416A1D78C00A1396C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; }; + DB166E8516A1D78C00A1396C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863B10730545007319AE /* CoreAudio.framework */; }; + DB166E8616A1D78C00A1396C /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863C10730545007319AE /* ForceFeedback.framework */; }; + DB166E8716A1D78C00A1396C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A863D10730545007319AE /* IOKit.framework */; }; + DB166E8816A1D78C00A1396C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A869F10730593007319AE /* AudioToolbox.framework */; }; + DB166E8916A1D78C00A1396C /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86A010730593007319AE /* CoreFoundation.framework */; }; + DB166E8A16A1D78C00A1396C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A86F2107305CE007319AE /* OpenGL.framework */; }; + DB166E8B16A1D78C00A1396C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A871410730623007319AE /* AudioUnit.framework */; }; + DB166E8C16A1D78C00A1396C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002A873910730675007319AE /* Carbon.framework */; }; + DB166E8D16A1D78C00A1396C /* libSDL2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA645093FFD41000C53B3 /* libSDL2.a */; }; + DB166E9316A1D7BC00A1396C /* testspriteminimal.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC516A1C74100A1396C /* testspriteminimal.c */; }; + DB166E9416A1D7C700A1396C /* teststreaming.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CC616A1C74100A1396C /* teststreaming.c */; }; + DB166E9A16A1D7F700A1396C /* moose.dat in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5E09D20839003FC8A1 /* moose.dat */; }; + DB166E9C16A1D80900A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; + DB166ED016A1D88100A1396C /* shapes in CopyFiles */ = {isa = PBXBuildFile; fileRef = DB166ECF16A1D87000A1396C /* shapes */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 002F337209CA14F900EBEB88 /* PBXContainerItemProxy */ = { + 001799471074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - 002F338809CA16BF00EBEB88 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - 002F33CC09CA19A600EBEB88 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - 002F340309CA1BFF00EBEB88 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = BEC566AB0761D90300A33029; + remoteInfo = checkkeys; }; - 002F342209CA1F0300EBEB88 /* PBXContainerItemProxy */ = { + 0017994B1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = BEC566C50761D90300A33029; + remoteInfo = loopwave; }; - 002F343E09CA1FB300EBEB88 /* PBXContainerItemProxy */ = { + 0017994F1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = 0017957410741F7900F5D044; + remoteInfo = testatomic; }; - 002F345B09CA204F00EBEB88 /* PBXContainerItemProxy */ = { + 001799511074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = 00179595107421BF00F5D044; + remoteInfo = testaudioinfo; }; - 002F347809CA215600EBEB88 /* PBXContainerItemProxy */ = { + 001799591074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = 002F338609CA16BF00EBEB88; - remoteInfo = testblitspeed; + remoteGlobalIDString = 00179756107431B300F5D044; + remoteInfo = testdraw2; }; - 002F347A09CA215600EBEB88 /* PBXContainerItemProxy */ = { + 0017995D1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = 002F33CA09CA19A600EBEB88; - remoteInfo = testdyngl; + remoteGlobalIDString = BEC566FB0761D90300A33029; + remoteInfo = testerror; }; - 002F347C09CA215600EBEB88 /* PBXContainerItemProxy */ = { + 0017995F1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; remoteGlobalIDString = 002F340109CA1BFF00EBEB88; remoteInfo = testfile; }; - 002F347E09CA215600EBEB88 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 002F342009CA1F0300EBEB88; - remoteInfo = testiconv; - }; - 002F348009CA215600EBEB88 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567570761D90400A33029; - remoteInfo = "testoverlay (Upgraded)"; - }; - 002F348209CA215600EBEB88 /* PBXContainerItemProxy */ = { + 001799651074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = 002F343C09CA1FB300EBEB88; - remoteInfo = testoverlay2; + remoteGlobalIDString = 0017970910742F3200F5D044; + remoteInfo = testgl2; }; - 002F348409CA215600EBEB88 /* PBXContainerItemProxy */ = { + 001799671074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = 002F345909CA204F00EBEB88; - remoteInfo = testplatform; - }; - 003FA642093FFD41000C53B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BECDF66C0761BA81005FE872; - remoteInfo = Framework; - }; - 003FA644093FFD41000C53B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BECDF6B30761BA81005FE872; - remoteInfo = "Static Library"; - }; - 003FA646093FFD41000C53B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BECDF6BA0761BA81005FE872; - remoteInfo = "Main Library"; - }; - 003FA648093FFD41000C53B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BECDF6BE0761BA81005FE872; - remoteInfo = "Standard DMG"; - }; - 003FA64A093FFD41000C53B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BECDF6C30761BA81005FE872; - remoteInfo = "Devel Extras Package"; - }; - 003FA6A709400236000C53B3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = BECDF5FE0761BA81005FE872; - remoteInfo = Framework; + remoteGlobalIDString = 00179730107430D600F5D044; + remoteInfo = testhaptic; }; - BEC568000761D90600A33029 /* PBXContainerItemProxy */ = { + 001799691074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC566AB0761D90300A33029; - remoteInfo = "checkkeys (Upgraded)"; + remoteGlobalIDString = BEC567230761D90400A33029; + remoteInfo = testthread; }; - BEC568020761D90600A33029 /* PBXContainerItemProxy */ = { + 0017996B1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC566B80761D90300A33029; - remoteInfo = "graywin (Upgraded)"; + remoteGlobalIDString = 002F342009CA1F0300EBEB88; + remoteInfo = testiconv; }; - BEC568040761D90600A33029 /* PBXContainerItemProxy */ = { + 0017996D1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC566C50761D90300A33029; - remoteInfo = "loopwave (Upgraded)"; + remoteGlobalIDString = 00179776107432AE00F5D044; + remoteInfo = testime; }; - BEC568060761D90600A33029 /* PBXContainerItemProxy */ = { + 0017996F1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC566D30761D90300A33029; - remoteInfo = "testalpha (Upgraded)"; + remoteGlobalIDString = 001797961074334C00F5D044; + remoteInfo = testintersections; }; - BEC568080761D90600A33029 /* PBXContainerItemProxy */ = { + 001799711074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC566E10761D90300A33029; - remoteInfo = "testbitmap (Upgraded)"; + remoteGlobalIDString = BEC567300761D90400A33029; + remoteInfo = testjoystick; }; - BEC5680A0761D90600A33029 /* PBXContainerItemProxy */ = { + 001799731074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC566EE0761D90300A33029; - remoteInfo = "testcdrom (Upgraded)"; + remoteGlobalIDString = BEC5673D0761D90400A33029; + remoteInfo = testkeys; }; - BEC5680C0761D90600A33029 /* PBXContainerItemProxy */ = { + 001799751074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC566FB0761D90300A33029; - remoteInfo = "testerror (Upgraded)"; + remoteGlobalIDString = 001797B8107433C600F5D044; + remoteInfo = testloadso; }; - BEC5680E0761D90600A33029 /* PBXContainerItemProxy */ = { + 001799771074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567080761D90400A33029; - remoteInfo = "testgamma (Upgraded)"; + remoteGlobalIDString = BEC5674A0761D90400A33029; + remoteInfo = testlock; }; - BEC568100761D90600A33029 /* PBXContainerItemProxy */ = { + 0017997B1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567160761D90400A33029; - remoteInfo = "testgl (Upgraded)"; + remoteGlobalIDString = 001797FA1074355200F5D044; + remoteInfo = testmultiaudio; }; - BEC568120761D90600A33029 /* PBXContainerItemProxy */ = { + 0017997F1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567230761D90400A33029; - remoteInfo = "testthread (Upgraded)"; + remoteGlobalIDString = 001798781074392D00F5D044; + remoteInfo = testnativex11; }; - BEC568140761D90600A33029 /* PBXContainerItemProxy */ = { + 001799831074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567300761D90400A33029; - remoteInfo = "testjoystick (Upgraded)"; + remoteGlobalIDString = 002F343C09CA1FB300EBEB88; + remoteInfo = testoverlay2; }; - BEC568160761D90600A33029 /* PBXContainerItemProxy */ = { + 001799871074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC5673D0761D90400A33029; - remoteInfo = "testkeys (Upgraded)"; + remoteGlobalIDString = 002F345909CA204F00EBEB88; + remoteInfo = testplatform; }; - BEC568180761D90600A33029 /* PBXContainerItemProxy */ = { + 001799891074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC5674A0761D90400A33029; - remoteInfo = "testlock (Upgraded)"; + remoteGlobalIDString = 0017989D107439DF00F5D044; + remoteInfo = testpower; }; - BEC5681A0761D90600A33029 /* PBXContainerItemProxy */ = { + 0017998B1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567640761D90400A33029; - remoteInfo = "testpalette (Upgraded)"; + remoteGlobalIDString = 001798DA10743BEC00F5D044; + remoteInfo = testresample; }; - BEC5681C0761D90600A33029 /* PBXContainerItemProxy */ = { + 0017998D1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; remoteGlobalIDString = BEC567720761D90500A33029; - remoteInfo = "testsem (Upgraded)"; + remoteInfo = testsem; }; - BEC5681E0761D90600A33029 /* PBXContainerItemProxy */ = { + 001799911074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC5677F0761D90500A33029; - remoteInfo = "testsprite (Upgraded)"; + remoteGlobalIDString = 001798FE10743F1000F5D044; + remoteInfo = testsprite2; }; - BEC568200761D90600A33029 /* PBXContainerItemProxy */ = { + 001799931074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; remoteGlobalIDString = BEC5678D0761D90500A33029; - remoteInfo = "testtimer (Upgraded)"; + remoteInfo = testtimer; }; - BEC568240761D90600A33029 /* PBXContainerItemProxy */ = { + 001799951074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; remoteGlobalIDString = BEC567A70761D90500A33029; - remoteInfo = "testversion (Upgraded)"; + remoteInfo = testversion; }; - BEC568260761D90600A33029 /* PBXContainerItemProxy */ = { + 0017999D1074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567B40761D90500A33029; - remoteInfo = "testvidinfo (Upgraded)"; + remoteGlobalIDString = 0017992010743FB700F5D044; + remoteInfo = testwm2; }; - BEC568280761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567C10761D90500A33029; - remoteInfo = "testwin (Upgraded)"; - }; - BEC5682A0761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567CF0761D90500A33029; - remoteInfo = "testwm (Upgraded)"; - }; - BEC5682C0761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567DD0761D90600A33029; - remoteInfo = "threadwin (Upgraded)"; - }; - BEC5682E0761D90600A33029 /* PBXContainerItemProxy */ = { + 001799A11074403E00F5D044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; remoteGlobalIDString = BEC567EA0761D90600A33029; - remoteInfo = "torturethread (Upgraded)"; - }; - BEC568300761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteInfo = torturethread; }; - BEC568320761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - BEC568340761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - BEC568360761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - BEC568380761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - BEC5683A0761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - BEC5683C0761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - BEC5683E0761D90600A33029 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; - }; - BEC568400761D90600A33029 /* PBXContainerItemProxy */ = { + 003FA642093FFD41000C53B3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = BECDF66C0761BA81005FE872; + remoteInfo = Framework; }; - BEC568420761D90600A33029 /* PBXContainerItemProxy */ = { + 003FA644093FFD41000C53B3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = BECDF6B30761BA81005FE872; + remoteInfo = "Static Library"; }; - BEC568440761D90600A33029 /* PBXContainerItemProxy */ = { + 003FA648093FFD41000C53B3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = BECDF6BE0761BA81005FE872; + remoteInfo = "Standard DMG"; }; - BEC568460761D90600A33029 /* PBXContainerItemProxy */ = { + DB166D6D16A1CEAA00A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = BBFC08B7164C6862003E6A99; + remoteInfo = testgamecontroller; }; - BEC568480761D90600A33029 /* PBXContainerItemProxy */ = { + DB166D6F16A1CEAF00A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = 4537749112091504002F0F45; + remoteInfo = testshape; }; - BEC5684A0761D90600A33029 /* PBXContainerItemProxy */ = { + DB166DC216A1D32C00A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166DAD16A1D2F600A1396C; + remoteInfo = testgesture; }; - BEC5684C0761D90600A33029 /* PBXContainerItemProxy */ = { + DB166DD816A1D38900A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166DC416A1D36A00A1396C; + remoteInfo = testmessage; }; - BEC5684E0761D90600A33029 /* PBXContainerItemProxy */ = { + DB166DF116A1D53700A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166DDC16A1D50C00A1396C; + remoteInfo = testrelative; }; - BEC568500761D90600A33029 /* PBXContainerItemProxy */ = { + DB166E0816A1D5A400A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166DF316A1D57C00A1396C; + remoteInfo = testrendercopyex; }; - BEC568520761D90600A33029 /* PBXContainerItemProxy */ = { + DB166E1F16A1D5D000A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166E0A16A1D5AD00A1396C; + remoteInfo = testrendertarget; }; - BEC568560761D90600A33029 /* PBXContainerItemProxy */ = { + DB166E3A16A1D65A00A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166E2716A1D64D00A1396C; + remoteInfo = testrumble; }; - BEC568580761D90600A33029 /* PBXContainerItemProxy */ = { + DB166E5516A1D6B800A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166E3D16A1D69000A1396C; + remoteInfo = testscale; }; - BEC5685A0761D90600A33029 /* PBXContainerItemProxy */ = { + DB166E6B16A1D72000A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166E5716A1D6F300A1396C; + remoteInfo = testshader; }; - BEC5685C0761D90600A33029 /* PBXContainerItemProxy */ = { + DB166E9516A1D7CD00A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166E6D16A1D78400A1396C; + remoteInfo = testspriteminimal; }; - BEC5685E0761D90600A33029 /* PBXContainerItemProxy */ = { + DB166E9716A1D7CF00A1396C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + remoteGlobalIDString = DB166E8016A1D78C00A1396C; + remoteInfo = teststreaming; }; - BEC568600761D90600A33029 /* PBXContainerItemProxy */ = { + DB1D40D617B3F30D00D74CFC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; - proxyType = 1; - remoteGlobalIDString = BEC567F70761D90600A33029; - remoteInfo = "libsdlmain.a (Upgraded)"; + containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = DB31407717554B71006C0E22; + remoteInfo = "Shared Library"; }; /* End PBXContainerItemProxy section */ @@ -704,346 +884,619 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 00794EA009D2343A003FC8A1 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 16; - files = ( - 00794EA209D2344B003FC8A1 /* icon.bmp in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 00794EA909D234E8003FC8A1 /* CopyFiles */ = { + 00794EEC09D2371F003FC8A1 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794EB709D235F5003FC8A1 /* sample.bmp in CopyFiles */, + 00794EF009D23739003FC8A1 /* utf8.txt in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794EE509D236E4003FC8A1 /* CopyFiles */ = { + 00794EF409D237C7003FC8A1 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794EE709D236ED003FC8A1 /* sample.bmp in CopyFiles */, + 00794EF709D237DE003FC8A1 /* moose.dat in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794EEC09D2371F003FC8A1 /* CopyFiles */ = { + DB166DDA16A1D40F00A1396C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794EF009D23739003FC8A1 /* utf8.txt in CopyFiles */, + DB166DDB16A1D42F00A1396C /* icon.bmp in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794EF409D237C7003FC8A1 /* CopyFiles */ = { + DB166E2116A1D5DF00A1396C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794EF709D237DE003FC8A1 /* moose.dat in CopyFiles */, + DB166E2316A1D60B00A1396C /* icon.bmp in CopyFiles */, + DB166E2216A1D5EC00A1396C /* sample.bmp in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794EFC09D2381C003FC8A1 /* CopyFiles */ = { + DB166E2416A1D61000A1396C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794EFE09D2382B003FC8A1 /* sail.bmp in CopyFiles */, + DB166E2516A1D61900A1396C /* icon.bmp in CopyFiles */, + DB166E2616A1D61900A1396C /* sample.bmp in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794F0209D2385F003FC8A1 /* CopyFiles */ = { + DB166E4C16A1D69000A1396C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794F0409D23869003FC8A1 /* icon.bmp in CopyFiles */, + DB166E4D16A1D69000A1396C /* icon.bmp in CopyFiles */, + DB166E4E16A1D69000A1396C /* sample.bmp in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794F0909D238E3003FC8A1 /* CopyFiles */ = { + DB166E9916A1D7EE00A1396C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794F0B09D238F4003FC8A1 /* sample.bmp in CopyFiles */, + DB166E9A16A1D7F700A1396C /* moose.dat in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794F0F09D23923003FC8A1 /* CopyFiles */ = { + DB166E9B16A1D7FC00A1396C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794F1109D2392B003FC8A1 /* icon.bmp in CopyFiles */, + DB166E9C16A1D80900A1396C /* icon.bmp in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; - 00794F6109D24125003FC8A1 /* CopyFiles */ = { + DB166ECE16A1D85400A1396C /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 16; files = ( - 00794F8709D2413B003FC8A1 /* sample.bmp in CopyFiles */, + DB166ED016A1D88100A1396C /* shapes in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 002F338109CA14F900EBEB88 /* test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = test.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 002F339709CA16BF00EBEB88 /* testblitspeed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testblitspeed.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 002F339A09CA17BC00EBEB88 /* testblitspeed.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testblitspeed.c; path = ../../test/testblitspeed.c; sourceTree = SOURCE_ROOT; }; + 0017958C10741F7900F5D044 /* testatomic */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testatomic; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017958F1074216E00F5D044 /* testatomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testatomic.c; path = ../../test/testatomic.c; sourceTree = SOURCE_ROOT; }; + 001795AD107421BF00F5D044 /* testaudioinfo */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testaudioinfo; sourceTree = BUILT_PRODUCTS_DIR; }; + 001795B01074222D00F5D044 /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testaudioinfo.c; path = ../../test/testaudioinfo.c; sourceTree = SOURCE_ROOT; }; + 0017972110742F3200F5D044 /* testgl2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testgl2; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017972710742FB900F5D044 /* testgl2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgl2.c; path = ../../test/testgl2.c; sourceTree = SOURCE_ROOT; }; + 00179748107430D600F5D044 /* testhaptic */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testhaptic; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017974E1074315700F5D044 /* testhaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testhaptic.c; path = ../../test/testhaptic.c; sourceTree = SOURCE_ROOT; }; + 0017976E107431B300F5D044 /* testdraw2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testdraw2; sourceTree = BUILT_PRODUCTS_DIR; }; + 001797711074320D00F5D044 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testdraw2.c; path = ../../test/testdraw2.c; sourceTree = SOURCE_ROOT; }; + 0017978E107432AE00F5D044 /* testime */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testime; sourceTree = BUILT_PRODUCTS_DIR; }; + 00179791107432FA00F5D044 /* testime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testime.c; path = ../../test/testime.c; sourceTree = SOURCE_ROOT; }; + 001797AE1074334C00F5D044 /* testintersections */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testintersections; sourceTree = BUILT_PRODUCTS_DIR; }; + 001797B31074339C00F5D044 /* testintersections.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testintersections.c; path = ../../test/testintersections.c; sourceTree = SOURCE_ROOT; }; + 001797D0107433C600F5D044 /* testloadso */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testloadso; sourceTree = BUILT_PRODUCTS_DIR; }; + 001797D31074343E00F5D044 /* testloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testloadso.c; path = ../../test/testloadso.c; sourceTree = SOURCE_ROOT; }; + 001798121074355200F5D044 /* testmultiaudio */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testmultiaudio; sourceTree = BUILT_PRODUCTS_DIR; }; + 001798151074359B00F5D044 /* testmultiaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testmultiaudio.c; path = ../../test/testmultiaudio.c; sourceTree = SOURCE_ROOT; }; + 0017985A107436ED00F5D044 /* testnative.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testnative.c; path = ../../test/testnative.c; sourceTree = SOURCE_ROOT; }; + 0017985B107436ED00F5D044 /* testnative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = testnative.h; path = ../../test/testnative.h; sourceTree = SOURCE_ROOT; }; + 0017985C107436ED00F5D044 /* testnativecocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = testnativecocoa.m; path = ../../test/testnativecocoa.m; sourceTree = SOURCE_ROOT; }; + 00179872107438D000F5D044 /* testnativex11.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testnativex11.c; path = ../../test/testnativex11.c; sourceTree = SOURCE_ROOT; }; + 001798941074392D00F5D044 /* testnative */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testnative; sourceTree = BUILT_PRODUCTS_DIR; }; + 001798B5107439DF00F5D044 /* testpower */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testpower; sourceTree = BUILT_PRODUCTS_DIR; }; + 001798B910743A4900F5D044 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; }; + 001798F210743BEC00F5D044 /* testresample */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testresample; sourceTree = BUILT_PRODUCTS_DIR; }; + 001798F910743E9200F5D044 /* testresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testresample.c; path = ../../test/testresample.c; sourceTree = SOURCE_ROOT; }; + 0017991610743F1000F5D044 /* testsprite2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testsprite2; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017991910743F5300F5D044 /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsprite2.c; path = ../../test/testsprite2.c; sourceTree = SOURCE_ROOT; }; + 0017993810743FB700F5D044 /* testwm2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testwm2; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017993B10743FEF00F5D044 /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testwm2.c; path = ../../test/testwm2.c; sourceTree = SOURCE_ROOT; }; + 002A863B10730545007319AE /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; + 002A863C10730545007319AE /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = ""; }; + 002A863D10730545007319AE /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; + 002A869F10730593007319AE /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; + 002A86A010730593007319AE /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; + 002A86F2107305CE007319AE /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; + 002A871410730623007319AE /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; + 002A873910730675007319AE /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 002F33A709CA188600EBEB88 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 002F33DB09CA19A600EBEB88 /* testdyngl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testdyngl.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 002F33E209CA1A0B00EBEB88 /* testdyngl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testdyngl.c; path = ../../test/testdyngl.c; sourceTree = SOURCE_ROOT; }; - 002F341209CA1BFF00EBEB88 /* testfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testfile.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F341209CA1BFF00EBEB88 /* testfile */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testfile; sourceTree = BUILT_PRODUCTS_DIR; }; 002F341709CA1C5B00EBEB88 /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testfile.c; path = ../../test/testfile.c; sourceTree = SOURCE_ROOT; }; - 002F343109CA1F0300EBEB88 /* testiconv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testiconv.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F343109CA1F0300EBEB88 /* testiconv */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testiconv; sourceTree = BUILT_PRODUCTS_DIR; }; 002F343609CA1F6F00EBEB88 /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testiconv.c; path = ../../test/testiconv.c; sourceTree = SOURCE_ROOT; }; - 002F344D09CA1FB300EBEB88 /* testoverlay2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testoverlay2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F344D09CA1FB300EBEB88 /* testoverlay2 */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testoverlay2; sourceTree = BUILT_PRODUCTS_DIR; }; 002F345209CA201C00EBEB88 /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testoverlay2.c; path = ../../test/testoverlay2.c; sourceTree = SOURCE_ROOT; }; - 002F346A09CA204F00EBEB88 /* testplatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testplatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F346A09CA204F00EBEB88 /* testplatform */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testplatform; sourceTree = BUILT_PRODUCTS_DIR; }; 002F346F09CA20A600EBEB88 /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testplatform.c; path = ../../test/testplatform.c; sourceTree = SOURCE_ROOT; }; 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; }; - 00794DD809D1F894003FC8A1 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 00794E5D09D20839003FC8A1 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; }; 00794E5E09D20839003FC8A1 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; }; 00794E5F09D20839003FC8A1 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; }; - 00794E6009D20839003FC8A1 /* sail.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sail.bmp; path = ../../test/sail.bmp; sourceTree = SOURCE_ROOT; }; 00794E6109D20839003FC8A1 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; }; 00794E6209D20839003FC8A1 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; }; 00794E6309D20839003FC8A1 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; }; 083E4872006D84C97F000001 /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = loopwave.c; path = ../../test/loopwave.c; sourceTree = SOURCE_ROOT; }; - 083E4874006D84F77F000001 /* testalpha.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testalpha.c; path = ../../test/testalpha.c; sourceTree = SOURCE_ROOT; }; - 083E4876006D85297F000001 /* testcdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testcdrom.c; path = ../../test/testcdrom.c; sourceTree = SOURCE_ROOT; }; 083E4878006D85357F000001 /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; }; - 083E487A006D85477F000001 /* testgamma.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testgamma.c; path = ../../test/testgamma.c; sourceTree = SOURCE_ROOT; }; - 083E487C006D856B7F000001 /* testpalette.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testpalette.c; path = ../../test/testpalette.c; sourceTree = SOURCE_ROOT; }; 083E487E006D86A17F000001 /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testsem.c; path = ../../test/testsem.c; sourceTree = SOURCE_ROOT; }; - 083E487F006D86A17F000001 /* testsprite.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testsprite.c; path = ../../test/testsprite.c; sourceTree = SOURCE_ROOT; }; 083E4880006D86A17F000001 /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testtimer.c; path = ../../test/testtimer.c; sourceTree = SOURCE_ROOT; }; 083E4882006D86A17F000001 /* testver.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testver.c; path = ../../test/testver.c; sourceTree = SOURCE_ROOT; }; - 083E4883006D86A17F000001 /* testvidinfo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testvidinfo.c; path = ../../test/testvidinfo.c; sourceTree = SOURCE_ROOT; }; - 083E4884006D86A17F000001 /* testwin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testwin.c; path = ../../test/testwin.c; sourceTree = SOURCE_ROOT; }; - 083E4885006D86A17F000001 /* testwm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testwm.c; path = ../../test/testwm.c; sourceTree = SOURCE_ROOT; }; - 083E4886006D86A17F000001 /* threadwin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = threadwin.c; path = ../../test/threadwin.c; sourceTree = SOURCE_ROOT; }; 083E4887006D86A17F000001 /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = torturethread.c; path = ../../test/torturethread.c; sourceTree = SOURCE_ROOT; }; 092D6D10FFB30A2C7F000001 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = checkkeys.c; path = ../../test/checkkeys.c; sourceTree = SOURCE_ROOT; }; - 092D6D1BFFB30C237F000001 /* graywin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = graywin.c; path = ../../test/graywin.c; sourceTree = SOURCE_ROOT; }; - 092D6D25FFB30D1A7F000001 /* testbitmap.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testbitmap.c; path = ../../test/testbitmap.c; sourceTree = SOURCE_ROOT; }; - 092D6D4EFFB311087F000001 /* testgl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testgl.c; path = ../../test/testgl.c; sourceTree = SOURCE_ROOT; }; - 092D6D58FFB311A97F000001 /* testhread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testhread.c; path = ../../test/testhread.c; sourceTree = SOURCE_ROOT; }; + 092D6D58FFB311A97F000001 /* testthread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testthread.c; path = ../../test/testthread.c; sourceTree = SOURCE_ROOT; }; 092D6D62FFB312AA7F000001 /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testjoystick.c; path = ../../test/testjoystick.c; sourceTree = SOURCE_ROOT; }; 092D6D6CFFB313437F000001 /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testkeys.c; path = ../../test/testkeys.c; sourceTree = SOURCE_ROOT; }; 092D6D75FFB313BB7F000001 /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testlock.c; path = ../../test/testlock.c; sourceTree = SOURCE_ROOT; }; - 2EECDF3B0086C5EA7F000001 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDLMain.h; path = ../../src/main/macosx/SDLMain.h; sourceTree = SOURCE_ROOT; }; - 2EECDF3C0086C5EA7F000001 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SDLMain.m; path = ../../src/main/macosx/SDLMain.m; sourceTree = SOURCE_ROOT; }; - 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = ../../src/main/macosx/SDLMain.nib; sourceTree = SOURCE_ROOT; }; - B207FF2404E1B19600A80002 /* libsdlmain_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsdlmain_prefix.h; sourceTree = ""; }; - BEC566B60761D90300A33029 /* checkkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = checkkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566C30761D90300A33029 /* graywin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = graywin.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566D10761D90300A33029 /* loopwave.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = loopwave.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566DF0761D90300A33029 /* testalpha.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testalpha.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566EC0761D90300A33029 /* testbitmap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testbitmap.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566F90761D90300A33029 /* testcdrom.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testcdrom.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567060761D90400A33029 /* testerror.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testerror.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567140761D90400A33029 /* testgamma.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgamma.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567210761D90400A33029 /* testgl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgl.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC5672E0761D90400A33029 /* testthread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testthread.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC5673B0761D90400A33029 /* testjoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testjoystick.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567480761D90400A33029 /* testkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567550761D90400A33029 /* testlock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testlock.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567620761D90400A33029 /* testoverlay.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testoverlay.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567700761D90500A33029 /* testpalette.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpalette.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC5677D0761D90500A33029 /* testsem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsem.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC5678B0761D90500A33029 /* testsprite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsprite.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567980761D90500A33029 /* testtimer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testtimer.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567B20761D90500A33029 /* testversion.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testversion.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567BF0761D90500A33029 /* testvidinfo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testvidinfo.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567CD0761D90500A33029 /* testwin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwin.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567DB0761D90600A33029 /* testwm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567E80761D90600A33029 /* threadwin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = threadwin.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567F50761D90600A33029 /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567FF0761D90600A33029 /* libsdlmain.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libsdlmain.a; sourceTree = BUILT_PRODUCTS_DIR; }; - F57DC39802A6E6A201D28762 /* testoverlay.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testoverlay.c; path = ../../test/testoverlay.c; sourceTree = SOURCE_ROOT; }; + 4537749212091504002F0F45 /* testshape */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testshape; sourceTree = BUILT_PRODUCTS_DIR; }; + 453774A4120915E3002F0F45 /* testshape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testshape.c; path = ../../test/testshape.c; sourceTree = SOURCE_ROOT; }; + BBFC088E164C6820003E6A99 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testgamecontroller.c; path = ../../test/testgamecontroller.c; sourceTree = ""; }; + BBFC08CD164C6862003E6A99 /* testgamecontroller */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testgamecontroller; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC566B60761D90300A33029 /* checkkeys */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = checkkeys; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC566D10761D90300A33029 /* loopwave */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = loopwave; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567060761D90400A33029 /* testerror */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testerror; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC5672E0761D90400A33029 /* testthread */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testthread; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC5673B0761D90400A33029 /* testjoystick */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testjoystick; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567480761D90400A33029 /* testkeys */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testkeys; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567550761D90400A33029 /* testlock */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testlock; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC5677D0761D90500A33029 /* testsem */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testsem; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567980761D90500A33029 /* testtimer */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testtimer; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567B20761D90500A33029 /* testversion */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = testversion; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567F50761D90600A33029 /* torturethread */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = text; path = torturethread; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166CBB16A1C74100A1396C /* testgesture.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testgesture.c; path = ../../test/testgesture.c; sourceTree = ""; }; + DB166CBC16A1C74100A1396C /* testgles.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testgles.c; path = ../../test/testgles.c; sourceTree = ""; }; + DB166CBD16A1C74100A1396C /* testmessage.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testmessage.c; path = ../../test/testmessage.c; sourceTree = ""; }; + DB166CBF16A1C74100A1396C /* testrelative.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrelative.c; path = ../../test/testrelative.c; sourceTree = ""; }; + DB166CC016A1C74100A1396C /* testrendercopyex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrendercopyex.c; path = ../../test/testrendercopyex.c; sourceTree = ""; }; + DB166CC116A1C74100A1396C /* testrendertarget.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrendertarget.c; path = ../../test/testrendertarget.c; sourceTree = ""; }; + DB166CC216A1C74100A1396C /* testrumble.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testrumble.c; path = ../../test/testrumble.c; sourceTree = ""; }; + DB166CC316A1C74100A1396C /* testscale.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testscale.c; path = ../../test/testscale.c; sourceTree = ""; }; + DB166CC416A1C74100A1396C /* testshader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testshader.c; path = ../../test/testshader.c; sourceTree = ""; }; + DB166CC516A1C74100A1396C /* testspriteminimal.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = testspriteminimal.c; path = ../../test/testspriteminimal.c; sourceTree = ""; }; + DB166CC616A1C74100A1396C /* teststreaming.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = teststreaming.c; path = ../../test/teststreaming.c; sourceTree = ""; }; + DB166D7F16A1D12400A1396C /* libSDL_test.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL_test.a; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166D8416A1D1A500A1396C /* SDL_test_assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_assert.c; path = ../../src/test/SDL_test_assert.c; sourceTree = ""; }; + DB166D8516A1D1A500A1396C /* SDL_test_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_common.c; path = ../../src/test/SDL_test_common.c; sourceTree = ""; }; + DB166D8616A1D1A500A1396C /* SDL_test_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_compare.c; path = ../../src/test/SDL_test_compare.c; sourceTree = ""; }; + DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_crc32.c; path = ../../src/test/SDL_test_crc32.c; sourceTree = ""; }; + DB166D8816A1D1A500A1396C /* SDL_test_font.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_font.c; path = ../../src/test/SDL_test_font.c; sourceTree = ""; }; + DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_fuzzer.c; path = ../../src/test/SDL_test_fuzzer.c; sourceTree = ""; }; + DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_harness.c; path = ../../src/test/SDL_test_harness.c; sourceTree = ""; }; + DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlit.c; path = ../../src/test/SDL_test_imageBlit.c; sourceTree = ""; }; + DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageBlitBlend.c; path = ../../src/test/SDL_test_imageBlitBlend.c; sourceTree = ""; }; + DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imageFace.c; path = ../../src/test/SDL_test_imageFace.c; sourceTree = ""; }; + DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitives.c; path = ../../src/test/SDL_test_imagePrimitives.c; sourceTree = ""; }; + DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_imagePrimitivesBlend.c; path = ../../src/test/SDL_test_imagePrimitivesBlend.c; sourceTree = ""; }; + DB166D9016A1D1A500A1396C /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_log.c; path = ../../src/test/SDL_test_log.c; sourceTree = ""; }; + DB166D9116A1D1A500A1396C /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_md5.c; path = ../../src/test/SDL_test_md5.c; sourceTree = ""; }; + DB166D9216A1D1A500A1396C /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_test_random.c; path = ../../src/test/SDL_test_random.c; sourceTree = ""; }; + DB166DBF16A1D2F600A1396C /* testgesture */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testgesture; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166DD516A1D36A00A1396C /* testmessage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testmessage; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166DEE16A1D50C00A1396C /* testrelative */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrelative; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E0516A1D57C00A1396C /* testrendercopyex */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrendercopyex; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E1C16A1D5AD00A1396C /* testrendertarget */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrendertarget; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E3816A1D64D00A1396C /* testrumble */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testrumble; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E5216A1D69000A1396C /* testscale */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testscale; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E6816A1D6F300A1396C /* testshader */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testshader; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E7E16A1D78400A1396C /* testspriteminimal */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testspriteminimal; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E9116A1D78C00A1396C /* teststreaming */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = teststreaming; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166ECF16A1D87000A1396C /* shapes */ = {isa = PBXFileReference; lastKnownFileType = folder; name = shapes; path = ../../test/shapes; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 002F337809CA14F900EBEB88 /* Frameworks */ = { + 0017957A10741F7900F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 002F337909CA14F900EBEB88 /* libsdlmain.a in Frameworks */, - 002F337A09CA14F900EBEB88 /* SDL.framework in Frameworks */, - 002F33A909CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 0017957C10741F7900F5D044 /* Cocoa.framework in Frameworks */, + 0017957D10741F7900F5D044 /* CoreAudio.framework in Frameworks */, + 0017957E10741F7900F5D044 /* ForceFeedback.framework in Frameworks */, + 0017957F10741F7900F5D044 /* IOKit.framework in Frameworks */, + 0017958010741F7900F5D044 /* AudioToolbox.framework in Frameworks */, + 0017958110741F7900F5D044 /* CoreFoundation.framework in Frameworks */, + 0017958210741F7900F5D044 /* OpenGL.framework in Frameworks */, + 0017958310741F7900F5D044 /* AudioUnit.framework in Frameworks */, + 0017958410741F7900F5D044 /* Carbon.framework in Frameworks */, + 0017958510741F7900F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F338E09CA16BF00EBEB88 /* Frameworks */ = { + 0017959B107421BF00F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 002F338F09CA16BF00EBEB88 /* libsdlmain.a in Frameworks */, - 002F339009CA16BF00EBEB88 /* SDL.framework in Frameworks */, - 002F33A809CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 0017959D107421BF00F5D044 /* Cocoa.framework in Frameworks */, + 0017959E107421BF00F5D044 /* CoreAudio.framework in Frameworks */, + 0017959F107421BF00F5D044 /* ForceFeedback.framework in Frameworks */, + 001795A0107421BF00F5D044 /* IOKit.framework in Frameworks */, + 001795A1107421BF00F5D044 /* AudioToolbox.framework in Frameworks */, + 001795A2107421BF00F5D044 /* CoreFoundation.framework in Frameworks */, + 001795A3107421BF00F5D044 /* OpenGL.framework in Frameworks */, + 001795A4107421BF00F5D044 /* AudioUnit.framework in Frameworks */, + 001795A5107421BF00F5D044 /* Carbon.framework in Frameworks */, + 001795A6107421BF00F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F33D109CA19A600EBEB88 /* Frameworks */ = { + 0017970F10742F3200F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 002F33D209CA19A600EBEB88 /* libsdlmain.a in Frameworks */, - 002F33D309CA19A600EBEB88 /* SDL.framework in Frameworks */, - 002F33D409CA19A600EBEB88 /* Cocoa.framework in Frameworks */, + 0017971110742F3200F5D044 /* Cocoa.framework in Frameworks */, + 0017971210742F3200F5D044 /* CoreAudio.framework in Frameworks */, + 0017971310742F3200F5D044 /* ForceFeedback.framework in Frameworks */, + 0017971410742F3200F5D044 /* IOKit.framework in Frameworks */, + 0017971510742F3200F5D044 /* AudioToolbox.framework in Frameworks */, + 0017971610742F3200F5D044 /* CoreFoundation.framework in Frameworks */, + 0017971710742F3200F5D044 /* OpenGL.framework in Frameworks */, + 0017971810742F3200F5D044 /* AudioUnit.framework in Frameworks */, + 0017971910742F3200F5D044 /* Carbon.framework in Frameworks */, + 0017971A10742F3200F5D044 /* libSDL2.a in Frameworks */, + DB166DA316A1D1FA00A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F340809CA1BFF00EBEB88 /* Frameworks */ = { + 00179736107430D600F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 002F340909CA1BFF00EBEB88 /* libsdlmain.a in Frameworks */, - 002F340A09CA1BFF00EBEB88 /* SDL.framework in Frameworks */, - 002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */, + 00179738107430D600F5D044 /* Cocoa.framework in Frameworks */, + 00179739107430D600F5D044 /* CoreAudio.framework in Frameworks */, + 0017973A107430D600F5D044 /* ForceFeedback.framework in Frameworks */, + 0017973B107430D600F5D044 /* IOKit.framework in Frameworks */, + 0017973C107430D600F5D044 /* AudioToolbox.framework in Frameworks */, + 0017973D107430D600F5D044 /* CoreFoundation.framework in Frameworks */, + 0017973E107430D600F5D044 /* OpenGL.framework in Frameworks */, + 0017973F107430D600F5D044 /* AudioUnit.framework in Frameworks */, + 00179740107430D600F5D044 /* Carbon.framework in Frameworks */, + 00179741107430D600F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F342709CA1F0300EBEB88 /* Frameworks */ = { + 0017975C107431B300F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 002F342809CA1F0300EBEB88 /* libsdlmain.a in Frameworks */, - 002F342909CA1F0300EBEB88 /* SDL.framework in Frameworks */, - 002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */, + 0017975E107431B300F5D044 /* Cocoa.framework in Frameworks */, + 0017975F107431B300F5D044 /* CoreAudio.framework in Frameworks */, + 00179760107431B300F5D044 /* ForceFeedback.framework in Frameworks */, + 00179761107431B300F5D044 /* IOKit.framework in Frameworks */, + 00179762107431B300F5D044 /* AudioToolbox.framework in Frameworks */, + 00179763107431B300F5D044 /* CoreFoundation.framework in Frameworks */, + 00179764107431B300F5D044 /* OpenGL.framework in Frameworks */, + 00179765107431B300F5D044 /* AudioUnit.framework in Frameworks */, + 00179766107431B300F5D044 /* Carbon.framework in Frameworks */, + 00179767107431B300F5D044 /* libSDL2.a in Frameworks */, + DB166DA216A1D1E900A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F344309CA1FB300EBEB88 /* Frameworks */ = { + 0017977C107432AE00F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 002F344409CA1FB300EBEB88 /* libsdlmain.a in Frameworks */, - 002F344509CA1FB300EBEB88 /* SDL.framework in Frameworks */, - 002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */, + 0017977E107432AE00F5D044 /* Cocoa.framework in Frameworks */, + 0017977F107432AE00F5D044 /* CoreAudio.framework in Frameworks */, + 00179780107432AE00F5D044 /* ForceFeedback.framework in Frameworks */, + 00179781107432AE00F5D044 /* IOKit.framework in Frameworks */, + 00179782107432AE00F5D044 /* AudioToolbox.framework in Frameworks */, + 00179783107432AE00F5D044 /* CoreFoundation.framework in Frameworks */, + 00179784107432AE00F5D044 /* OpenGL.framework in Frameworks */, + 00179785107432AE00F5D044 /* AudioUnit.framework in Frameworks */, + 00179786107432AE00F5D044 /* Carbon.framework in Frameworks */, + 00179787107432AE00F5D044 /* libSDL2.a in Frameworks */, + DB166DA716A1D24D00A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F346009CA204F00EBEB88 /* Frameworks */ = { + 0017979C1074334C00F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 002F346109CA204F00EBEB88 /* libsdlmain.a in Frameworks */, - 002F346209CA204F00EBEB88 /* SDL.framework in Frameworks */, - 002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */, + 0017979E1074334C00F5D044 /* Cocoa.framework in Frameworks */, + 0017979F1074334C00F5D044 /* CoreAudio.framework in Frameworks */, + 001797A01074334C00F5D044 /* ForceFeedback.framework in Frameworks */, + 001797A11074334C00F5D044 /* IOKit.framework in Frameworks */, + 001797A21074334C00F5D044 /* AudioToolbox.framework in Frameworks */, + 001797A31074334C00F5D044 /* CoreFoundation.framework in Frameworks */, + 001797A41074334C00F5D044 /* OpenGL.framework in Frameworks */, + 001797A51074334C00F5D044 /* AudioUnit.framework in Frameworks */, + 001797A61074334C00F5D044 /* Carbon.framework in Frameworks */, + 001797A71074334C00F5D044 /* libSDL2.a in Frameworks */, + DB166DAA16A1D27700A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566B20761D90300A33029 /* Frameworks */ = { + 001797BE107433C600F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568620761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA64D093FFDB3000C53B3 /* SDL.framework in Frameworks */, - 002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 001797C0107433C600F5D044 /* Cocoa.framework in Frameworks */, + 001797C1107433C600F5D044 /* CoreAudio.framework in Frameworks */, + 001797C2107433C600F5D044 /* ForceFeedback.framework in Frameworks */, + 001797C3107433C600F5D044 /* IOKit.framework in Frameworks */, + 001797C4107433C600F5D044 /* AudioToolbox.framework in Frameworks */, + 001797C5107433C600F5D044 /* CoreFoundation.framework in Frameworks */, + 001797C6107433C600F5D044 /* OpenGL.framework in Frameworks */, + 001797C7107433C600F5D044 /* AudioUnit.framework in Frameworks */, + 001797C8107433C600F5D044 /* Carbon.framework in Frameworks */, + 001797C9107433C600F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566BF0761D90300A33029 /* Frameworks */ = { + 001798001074355200F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568630761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA64E093FFDB5000C53B3 /* SDL.framework in Frameworks */, - 002F33C009CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 001798021074355200F5D044 /* Cocoa.framework in Frameworks */, + 001798031074355200F5D044 /* CoreAudio.framework in Frameworks */, + 001798041074355200F5D044 /* ForceFeedback.framework in Frameworks */, + 001798051074355200F5D044 /* IOKit.framework in Frameworks */, + 001798061074355200F5D044 /* AudioToolbox.framework in Frameworks */, + 001798071074355200F5D044 /* CoreFoundation.framework in Frameworks */, + 001798081074355200F5D044 /* OpenGL.framework in Frameworks */, + 001798091074355200F5D044 /* AudioUnit.framework in Frameworks */, + 0017980A1074355200F5D044 /* Carbon.framework in Frameworks */, + 0017980B1074355200F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566CC0761D90300A33029 /* Frameworks */ = { + 001798821074392D00F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568640761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA64F093FFDB7000C53B3 /* SDL.framework in Frameworks */, - 002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 001798841074392D00F5D044 /* Cocoa.framework in Frameworks */, + 001798851074392D00F5D044 /* CoreAudio.framework in Frameworks */, + 001798861074392D00F5D044 /* ForceFeedback.framework in Frameworks */, + 001798871074392D00F5D044 /* IOKit.framework in Frameworks */, + 001798881074392D00F5D044 /* AudioToolbox.framework in Frameworks */, + 001798891074392D00F5D044 /* CoreFoundation.framework in Frameworks */, + 0017988A1074392D00F5D044 /* OpenGL.framework in Frameworks */, + 0017988B1074392D00F5D044 /* AudioUnit.framework in Frameworks */, + 0017988C1074392D00F5D044 /* Carbon.framework in Frameworks */, + 0017988D1074392D00F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566DA0761D90300A33029 /* Frameworks */ = { + 001798A3107439DF00F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568650761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA650093FFDBA000C53B3 /* SDL.framework in Frameworks */, - 002F33BE09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 001798A5107439DF00F5D044 /* Cocoa.framework in Frameworks */, + 001798A6107439DF00F5D044 /* CoreAudio.framework in Frameworks */, + 001798A7107439DF00F5D044 /* ForceFeedback.framework in Frameworks */, + 001798A8107439DF00F5D044 /* IOKit.framework in Frameworks */, + 001798A9107439DF00F5D044 /* AudioToolbox.framework in Frameworks */, + 001798AA107439DF00F5D044 /* CoreFoundation.framework in Frameworks */, + 001798AB107439DF00F5D044 /* OpenGL.framework in Frameworks */, + 001798AC107439DF00F5D044 /* AudioUnit.framework in Frameworks */, + 001798AD107439DF00F5D044 /* Carbon.framework in Frameworks */, + 001798AE107439DF00F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566E80761D90300A33029 /* Frameworks */ = { + 001798E010743BEC00F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568660761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA651093FFDBC000C53B3 /* SDL.framework in Frameworks */, - 002F33BD09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 001798E210743BEC00F5D044 /* Cocoa.framework in Frameworks */, + 001798E310743BEC00F5D044 /* CoreAudio.framework in Frameworks */, + 001798E410743BEC00F5D044 /* ForceFeedback.framework in Frameworks */, + 001798E510743BEC00F5D044 /* IOKit.framework in Frameworks */, + 001798E610743BEC00F5D044 /* AudioToolbox.framework in Frameworks */, + 001798E710743BEC00F5D044 /* CoreFoundation.framework in Frameworks */, + 001798E810743BEC00F5D044 /* OpenGL.framework in Frameworks */, + 001798E910743BEC00F5D044 /* AudioUnit.framework in Frameworks */, + 001798EA10743BEC00F5D044 /* Carbon.framework in Frameworks */, + 001798EB10743BEC00F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566F50761D90300A33029 /* Frameworks */ = { + 0017990410743F1000F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568670761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA652093FFDBE000C53B3 /* SDL.framework in Frameworks */, - 002F33BB09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 0017990610743F1000F5D044 /* Cocoa.framework in Frameworks */, + 0017990710743F1000F5D044 /* CoreAudio.framework in Frameworks */, + 0017990810743F1000F5D044 /* ForceFeedback.framework in Frameworks */, + 0017990910743F1000F5D044 /* IOKit.framework in Frameworks */, + 0017990A10743F1000F5D044 /* AudioToolbox.framework in Frameworks */, + 0017990B10743F1000F5D044 /* CoreFoundation.framework in Frameworks */, + 0017990C10743F1000F5D044 /* OpenGL.framework in Frameworks */, + 0017990D10743F1000F5D044 /* AudioUnit.framework in Frameworks */, + 0017990E10743F1000F5D044 /* Carbon.framework in Frameworks */, + 0017990F10743F1000F5D044 /* libSDL2.a in Frameworks */, + DB166DAB16A1D27C00A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567020761D90300A33029 /* Frameworks */ = { + 0017992610743FB700F5D044 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568680761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA653093FFDC1000C53B3 /* SDL.framework in Frameworks */, - 002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 0017992810743FB700F5D044 /* Cocoa.framework in Frameworks */, + 0017992910743FB700F5D044 /* CoreAudio.framework in Frameworks */, + 0017992A10743FB700F5D044 /* ForceFeedback.framework in Frameworks */, + 0017992B10743FB700F5D044 /* IOKit.framework in Frameworks */, + 0017992C10743FB700F5D044 /* AudioToolbox.framework in Frameworks */, + 0017992D10743FB700F5D044 /* CoreFoundation.framework in Frameworks */, + 0017992E10743FB700F5D044 /* OpenGL.framework in Frameworks */, + 0017992F10743FB700F5D044 /* AudioUnit.framework in Frameworks */, + 0017993010743FB700F5D044 /* Carbon.framework in Frameworks */, + 0017993110743FB700F5D044 /* libSDL2.a in Frameworks */, + DB166DAC16A1D29000A1396C /* libSDL_test.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 002F340809CA1BFF00EBEB88 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */, + 002A866B10730548007319AE /* CoreAudio.framework in Frameworks */, + 002A866C10730548007319AE /* ForceFeedback.framework in Frameworks */, + 002A866D10730548007319AE /* IOKit.framework in Frameworks */, + 002A86BF10730595007319AE /* AudioToolbox.framework in Frameworks */, + 002A86C010730595007319AE /* CoreFoundation.framework in Frameworks */, + 002A8702107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872410730624007319AE /* AudioUnit.framework in Frameworks */, + 002A874910730676007319AE /* Carbon.framework in Frameworks */, + 001794D11073667B00F5D044 /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 002F342709CA1F0300EBEB88 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */, + 002A866210730547007319AE /* CoreAudio.framework in Frameworks */, + 002A866310730547007319AE /* ForceFeedback.framework in Frameworks */, + 002A866410730547007319AE /* IOKit.framework in Frameworks */, + 002A86B910730594007319AE /* AudioToolbox.framework in Frameworks */, + 002A86BA10730594007319AE /* CoreFoundation.framework in Frameworks */, + 002A86FF107305CE007319AE /* OpenGL.framework in Frameworks */, + 002A872110730624007319AE /* AudioUnit.framework in Frameworks */, + 002A874610730676007319AE /* Carbon.framework in Frameworks */, + 001794D41073668800F5D044 /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 002F344309CA1FB300EBEB88 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */, + 002A868010730549007319AE /* CoreAudio.framework in Frameworks */, + 002A868110730549007319AE /* ForceFeedback.framework in Frameworks */, + 002A868210730549007319AE /* IOKit.framework in Frameworks */, + 002A86CD10730595007319AE /* AudioToolbox.framework in Frameworks */, + 002A86CE10730596007319AE /* CoreFoundation.framework in Frameworks */, + 002A8709107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872B10730624007319AE /* AudioUnit.framework in Frameworks */, + 002A875010730677007319AE /* Carbon.framework in Frameworks */, + 001794D91073669E00F5D044 /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 002F346009CA204F00EBEB88 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */, + 002A868610730549007319AE /* CoreAudio.framework in Frameworks */, + 002A868710730549007319AE /* ForceFeedback.framework in Frameworks */, + 002A868810730549007319AE /* IOKit.framework in Frameworks */, + 002A86D110730596007319AE /* AudioToolbox.framework in Frameworks */, + 002A86D210730596007319AE /* CoreFoundation.framework in Frameworks */, + 002A870B107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872D10730624007319AE /* AudioUnit.framework in Frameworks */, + 002A875210730677007319AE /* Carbon.framework in Frameworks */, + 001794DB107366A700F5D044 /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4537749012091504002F0F45 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166D7116A1CFB200A1396C /* AudioToolbox.framework in Frameworks */, + DB166D7216A1CFB200A1396C /* AudioUnit.framework in Frameworks */, + DB166D7316A1CFB200A1396C /* Carbon.framework in Frameworks */, + DB166D7416A1CFB200A1396C /* Cocoa.framework in Frameworks */, + DB166D7516A1CFB200A1396C /* CoreAudio.framework in Frameworks */, + DB166D7616A1CFB200A1396C /* CoreFoundation.framework in Frameworks */, + DB166D7716A1CFB200A1396C /* ForceFeedback.framework in Frameworks */, + DB166D7816A1CFB200A1396C /* IOKit.framework in Frameworks */, + DB166D7916A1CFB200A1396C /* OpenGL.framework in Frameworks */, + DB166D7A16A1CFD500A1396C /* libSDL2.a in Frameworks */, + DB166DA416A1D21700A1396C /* libSDL_test.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BBFC08BE164C6862003E6A99 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BBFC08C0164C6862003E6A99 /* Cocoa.framework in Frameworks */, + BBFC08C1164C6862003E6A99 /* CoreAudio.framework in Frameworks */, + BBFC08C2164C6862003E6A99 /* ForceFeedback.framework in Frameworks */, + BBFC08C3164C6862003E6A99 /* IOKit.framework in Frameworks */, + BBFC08C4164C6862003E6A99 /* AudioToolbox.framework in Frameworks */, + BBFC08C5164C6862003E6A99 /* CoreFoundation.framework in Frameworks */, + BBFC08C6164C6862003E6A99 /* OpenGL.framework in Frameworks */, + BBFC08C7164C6862003E6A99 /* AudioUnit.framework in Frameworks */, + BBFC08C8164C6862003E6A99 /* Carbon.framework in Frameworks */, + BBFC08C9164C6862003E6A99 /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BEC566B20761D90300A33029 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A863010730405007319AE /* libSDL2.a in Frameworks */, + 002A864D10730546007319AE /* CoreAudio.framework in Frameworks */, + 002A864E10730546007319AE /* ForceFeedback.framework in Frameworks */, + 002A864F10730546007319AE /* IOKit.framework in Frameworks */, + 002A86AB10730594007319AE /* AudioToolbox.framework in Frameworks */, + 002A86AC10730594007319AE /* CoreFoundation.framework in Frameworks */, + 002A86F8107305CE007319AE /* OpenGL.framework in Frameworks */, + 002A871A10730623007319AE /* AudioUnit.framework in Frameworks */, + 002A873F10730675007319AE /* Carbon.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC5670F0761D90400A33029 /* Frameworks */ = { + BEC566CC0761D90300A33029 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568690761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA654093FFDC3000C53B3 /* SDL.framework in Frameworks */, - 002F33BA09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A865310730547007319AE /* CoreAudio.framework in Frameworks */, + 002A865410730547007319AE /* ForceFeedback.framework in Frameworks */, + 002A865510730547007319AE /* IOKit.framework in Frameworks */, + 002A86AF10730594007319AE /* AudioToolbox.framework in Frameworks */, + 002A86B010730594007319AE /* CoreFoundation.framework in Frameworks */, + 002A86FA107305CE007319AE /* OpenGL.framework in Frameworks */, + 002A871C10730623007319AE /* AudioUnit.framework in Frameworks */, + 002A874110730676007319AE /* Carbon.framework in Frameworks */, + 002A875E10730745007319AE /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC5671D0761D90400A33029 /* Frameworks */ = { + BEC567020761D90300A33029 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC5686A0761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA655093FFDC6000C53B3 /* SDL.framework in Frameworks */, - 002F33B909CA188600EBEB88 /* Cocoa.framework in Frameworks */, - 00794DD909D1F894003FC8A1 /* OpenGL.framework in Frameworks */, + 002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A866E10730548007319AE /* CoreAudio.framework in Frameworks */, + 002A866F10730548007319AE /* ForceFeedback.framework in Frameworks */, + 002A867010730548007319AE /* IOKit.framework in Frameworks */, + 002A86C110730595007319AE /* AudioToolbox.framework in Frameworks */, + 002A86C210730595007319AE /* CoreFoundation.framework in Frameworks */, + 002A8703107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872510730624007319AE /* AudioUnit.framework in Frameworks */, + 002A874A10730676007319AE /* Carbon.framework in Frameworks */, + 001794D01073667700F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1051,9 +1504,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC5686B0761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA656093FFDC8000C53B3 /* SDL.framework in Frameworks */, 002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A868F1073054A007319AE /* CoreAudio.framework in Frameworks */, + 002A86901073054A007319AE /* ForceFeedback.framework in Frameworks */, + 002A86911073054A007319AE /* IOKit.framework in Frameworks */, + 002A86D710730596007319AE /* AudioToolbox.framework in Frameworks */, + 002A86D810730596007319AE /* CoreFoundation.framework in Frameworks */, + 002A870E107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A873010730625007319AE /* AudioUnit.framework in Frameworks */, + 002A875510730677007319AE /* Carbon.framework in Frameworks */, + 001794DE107366B900F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1061,9 +1521,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC5686C0761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA657093FFDCA000C53B3 /* SDL.framework in Frameworks */, 002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A867410730548007319AE /* CoreAudio.framework in Frameworks */, + 002A867510730548007319AE /* ForceFeedback.framework in Frameworks */, + 002A867610730548007319AE /* IOKit.framework in Frameworks */, + 002A86C510730595007319AE /* AudioToolbox.framework in Frameworks */, + 002A86C610730595007319AE /* CoreFoundation.framework in Frameworks */, + 002A8705107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872710730624007319AE /* AudioUnit.framework in Frameworks */, + 002A874C10730676007319AE /* Carbon.framework in Frameworks */, + 001794D51073668D00F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1071,9 +1538,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC5686D0761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA658093FFDCC000C53B3 /* SDL.framework in Frameworks */, 002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A867710730548007319AE /* CoreAudio.framework in Frameworks */, + 002A867810730548007319AE /* ForceFeedback.framework in Frameworks */, + 002A867910730549007319AE /* IOKit.framework in Frameworks */, + 002A86C710730595007319AE /* AudioToolbox.framework in Frameworks */, + 002A86C810730595007319AE /* CoreFoundation.framework in Frameworks */, + 002A8706107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872810730624007319AE /* AudioUnit.framework in Frameworks */, + 002A874D10730677007319AE /* Carbon.framework in Frameworks */, + 001794D61073669200F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1081,137 +1555,283 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC5686E0761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA659093FFDCF000C53B3 /* SDL.framework in Frameworks */, 002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A867A10730549007319AE /* CoreAudio.framework in Frameworks */, + 002A867B10730549007319AE /* ForceFeedback.framework in Frameworks */, + 002A867C10730549007319AE /* IOKit.framework in Frameworks */, + 002A86C910730595007319AE /* AudioToolbox.framework in Frameworks */, + 002A86CA10730595007319AE /* CoreFoundation.framework in Frameworks */, + 002A8707107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872910730624007319AE /* AudioUnit.framework in Frameworks */, + 002A874E10730677007319AE /* Carbon.framework in Frameworks */, + 001794D71073669700F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC5675E0761D90400A33029 /* Frameworks */ = { + BEC567790761D90500A33029 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC5686F0761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA65A093FFDD1000C53B3 /* SDL.framework in Frameworks */, - 002F33B409CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A868910730549007319AE /* CoreAudio.framework in Frameworks */, + 002A868A10730549007319AE /* ForceFeedback.framework in Frameworks */, + 002A868B1073054A007319AE /* IOKit.framework in Frameworks */, + 002A86D310730596007319AE /* AudioToolbox.framework in Frameworks */, + 002A86D410730596007319AE /* CoreFoundation.framework in Frameworks */, + 002A870C107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A872E10730624007319AE /* AudioUnit.framework in Frameworks */, + 002A875310730677007319AE /* Carbon.framework in Frameworks */, + 001794DC107366AC00F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC5676B0761D90400A33029 /* Frameworks */ = { + BEC567940761D90500A33029 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568700761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA65B093FFDD3000C53B3 /* SDL.framework in Frameworks */, - 002F33B309CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A86981073054A007319AE /* CoreAudio.framework in Frameworks */, + 002A86991073054A007319AE /* ForceFeedback.framework in Frameworks */, + 002A869A1073054A007319AE /* IOKit.framework in Frameworks */, + 002A86DD10730596007319AE /* AudioToolbox.framework in Frameworks */, + 002A86DE10730596007319AE /* CoreFoundation.framework in Frameworks */, + 002A8711107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A873310730625007319AE /* AudioUnit.framework in Frameworks */, + 002A875810730678007319AE /* Carbon.framework in Frameworks */, + 001794DF107366BD00F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567790761D90500A33029 /* Frameworks */ = { + BEC567AE0761D90500A33029 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568710761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA65C093FFDD5000C53B3 /* SDL.framework in Frameworks */, - 002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A86951073054A007319AE /* CoreAudio.framework in Frameworks */, + 002A86961073054A007319AE /* ForceFeedback.framework in Frameworks */, + 002A86971073054A007319AE /* IOKit.framework in Frameworks */, + 002A86DB10730596007319AE /* AudioToolbox.framework in Frameworks */, + 002A86DC10730596007319AE /* CoreFoundation.framework in Frameworks */, + 002A8710107305CF007319AE /* OpenGL.framework in Frameworks */, + 002A873210730625007319AE /* AudioUnit.framework in Frameworks */, + 002A875710730678007319AE /* Carbon.framework in Frameworks */, + 001794E0107366C100F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567860761D90500A33029 /* Frameworks */ = { + BEC567F10761D90600A33029 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568720761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA65D093FFDD7000C53B3 /* SDL.framework in Frameworks */, - 002F33B109CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + 002A864110730546007319AE /* CoreAudio.framework in Frameworks */, + 002A864210730546007319AE /* ForceFeedback.framework in Frameworks */, + 002A864310730546007319AE /* IOKit.framework in Frameworks */, + 002A86A310730593007319AE /* AudioToolbox.framework in Frameworks */, + 002A86A410730593007319AE /* CoreFoundation.framework in Frameworks */, + 002A86F4107305CE007319AE /* OpenGL.framework in Frameworks */, + 002A871610730623007319AE /* AudioUnit.framework in Frameworks */, + 002A873B10730675007319AE /* Carbon.framework in Frameworks */, + 001794E5107366D900F5D044 /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567940761D90500A33029 /* Frameworks */ = { + DB166D7C16A1D12400A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568730761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA65E093FFDDA000C53B3 /* SDL.framework in Frameworks */, - 002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567AE0761D90500A33029 /* Frameworks */ = { + DB166DB016A1D2F600A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568750761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA660093FFDDF000C53B3 /* SDL.framework in Frameworks */, - 002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + DB166DB116A1D2F600A1396C /* Cocoa.framework in Frameworks */, + DB166DB216A1D2F600A1396C /* CoreAudio.framework in Frameworks */, + DB166DB316A1D2F600A1396C /* ForceFeedback.framework in Frameworks */, + DB166DB416A1D2F600A1396C /* IOKit.framework in Frameworks */, + DB166DB516A1D2F600A1396C /* AudioToolbox.framework in Frameworks */, + DB166DB616A1D2F600A1396C /* CoreFoundation.framework in Frameworks */, + DB166DB716A1D2F600A1396C /* OpenGL.framework in Frameworks */, + DB166DB816A1D2F600A1396C /* AudioUnit.framework in Frameworks */, + DB166DB916A1D2F600A1396C /* Carbon.framework in Frameworks */, + DB166DBA16A1D2F600A1396C /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567BB0761D90500A33029 /* Frameworks */ = { + DB166DC716A1D36A00A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568760761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA661093FFDE1000C53B3 /* SDL.framework in Frameworks */, - 002F33AE09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + DB166DC816A1D36A00A1396C /* Cocoa.framework in Frameworks */, + DB166DC916A1D36A00A1396C /* CoreAudio.framework in Frameworks */, + DB166DCA16A1D36A00A1396C /* ForceFeedback.framework in Frameworks */, + DB166DCB16A1D36A00A1396C /* IOKit.framework in Frameworks */, + DB166DCC16A1D36A00A1396C /* AudioToolbox.framework in Frameworks */, + DB166DCD16A1D36A00A1396C /* CoreFoundation.framework in Frameworks */, + DB166DCE16A1D36A00A1396C /* OpenGL.framework in Frameworks */, + DB166DCF16A1D36A00A1396C /* AudioUnit.framework in Frameworks */, + DB166DD016A1D36A00A1396C /* Carbon.framework in Frameworks */, + DB166DD116A1D36A00A1396C /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567C80761D90500A33029 /* Frameworks */ = { + DB166DDF16A1D50C00A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568770761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA662093FFDE3000C53B3 /* SDL.framework in Frameworks */, - 002F33AD09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + DB166DE016A1D50C00A1396C /* Cocoa.framework in Frameworks */, + DB166DE116A1D50C00A1396C /* CoreAudio.framework in Frameworks */, + DB166DE216A1D50C00A1396C /* ForceFeedback.framework in Frameworks */, + DB166DE316A1D50C00A1396C /* IOKit.framework in Frameworks */, + DB166DE416A1D50C00A1396C /* AudioToolbox.framework in Frameworks */, + DB166DE516A1D50C00A1396C /* CoreFoundation.framework in Frameworks */, + DB166DE616A1D50C00A1396C /* OpenGL.framework in Frameworks */, + DB166DE716A1D50C00A1396C /* AudioUnit.framework in Frameworks */, + DB166DE816A1D50C00A1396C /* Carbon.framework in Frameworks */, + DB166DE916A1D50C00A1396C /* libSDL2.a in Frameworks */, + DB166DEA16A1D50C00A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567D60761D90500A33029 /* Frameworks */ = { + DB166DF616A1D57C00A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568780761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA663093FFDE6000C53B3 /* SDL.framework in Frameworks */, - 002F33AC09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + DB166DF716A1D57C00A1396C /* Cocoa.framework in Frameworks */, + DB166DF816A1D57C00A1396C /* CoreAudio.framework in Frameworks */, + DB166DF916A1D57C00A1396C /* ForceFeedback.framework in Frameworks */, + DB166DFA16A1D57C00A1396C /* IOKit.framework in Frameworks */, + DB166DFB16A1D57C00A1396C /* AudioToolbox.framework in Frameworks */, + DB166DFC16A1D57C00A1396C /* CoreFoundation.framework in Frameworks */, + DB166DFD16A1D57C00A1396C /* OpenGL.framework in Frameworks */, + DB166DFE16A1D57C00A1396C /* AudioUnit.framework in Frameworks */, + DB166DFF16A1D57C00A1396C /* Carbon.framework in Frameworks */, + DB166E0016A1D57C00A1396C /* libSDL2.a in Frameworks */, + DB166E0116A1D57C00A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567E40761D90600A33029 /* Frameworks */ = { + DB166E0D16A1D5AD00A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC568790761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA665093FFDEA000C53B3 /* SDL.framework in Frameworks */, - 002F33AB09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + DB166E0E16A1D5AD00A1396C /* Cocoa.framework in Frameworks */, + DB166E0F16A1D5AD00A1396C /* CoreAudio.framework in Frameworks */, + DB166E1016A1D5AD00A1396C /* ForceFeedback.framework in Frameworks */, + DB166E1116A1D5AD00A1396C /* IOKit.framework in Frameworks */, + DB166E1216A1D5AD00A1396C /* AudioToolbox.framework in Frameworks */, + DB166E1316A1D5AD00A1396C /* CoreFoundation.framework in Frameworks */, + DB166E1416A1D5AD00A1396C /* OpenGL.framework in Frameworks */, + DB166E1516A1D5AD00A1396C /* AudioUnit.framework in Frameworks */, + DB166E1616A1D5AD00A1396C /* Carbon.framework in Frameworks */, + DB166E1716A1D5AD00A1396C /* libSDL2.a in Frameworks */, + DB166E1816A1D5AD00A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567F10761D90600A33029 /* Frameworks */ = { + DB166E2A16A1D64D00A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BEC5687A0761D90600A33029 /* libsdlmain.a in Frameworks */, - 003FA664093FFDE8000C53B3 /* SDL.framework in Frameworks */, - 002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */, + DB166E2B16A1D64D00A1396C /* Cocoa.framework in Frameworks */, + DB166E2C16A1D64D00A1396C /* CoreAudio.framework in Frameworks */, + DB166E2D16A1D64D00A1396C /* ForceFeedback.framework in Frameworks */, + DB166E2E16A1D64D00A1396C /* IOKit.framework in Frameworks */, + DB166E2F16A1D64D00A1396C /* AudioToolbox.framework in Frameworks */, + DB166E3016A1D64D00A1396C /* CoreFoundation.framework in Frameworks */, + DB166E3116A1D64D00A1396C /* OpenGL.framework in Frameworks */, + DB166E3216A1D64D00A1396C /* AudioUnit.framework in Frameworks */, + DB166E3316A1D64D00A1396C /* Carbon.framework in Frameworks */, + DB166E3416A1D64D00A1396C /* libSDL2.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567FD0761D90600A33029 /* Frameworks */ = { + DB166E4016A1D69000A1396C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DB166E4116A1D69000A1396C /* Cocoa.framework in Frameworks */, + DB166E4216A1D69000A1396C /* CoreAudio.framework in Frameworks */, + DB166E4316A1D69000A1396C /* ForceFeedback.framework in Frameworks */, + DB166E4416A1D69000A1396C /* IOKit.framework in Frameworks */, + DB166E4516A1D69000A1396C /* AudioToolbox.framework in Frameworks */, + DB166E4616A1D69000A1396C /* CoreFoundation.framework in Frameworks */, + DB166E4716A1D69000A1396C /* OpenGL.framework in Frameworks */, + DB166E4816A1D69000A1396C /* AudioUnit.framework in Frameworks */, + DB166E4916A1D69000A1396C /* Carbon.framework in Frameworks */, + DB166E4A16A1D69000A1396C /* libSDL2.a in Frameworks */, + DB166E4B16A1D69000A1396C /* libSDL_test.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 002F33A209CA183B00EBEB88 /* Linked Frameworks */ = { - isa = PBXGroup; + DB166E5A16A1D6F300A1396C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E5B16A1D6F300A1396C /* Cocoa.framework in Frameworks */, + DB166E5C16A1D6F300A1396C /* CoreAudio.framework in Frameworks */, + DB166E5D16A1D6F300A1396C /* ForceFeedback.framework in Frameworks */, + DB166E5E16A1D6F300A1396C /* IOKit.framework in Frameworks */, + DB166E5F16A1D6F300A1396C /* AudioToolbox.framework in Frameworks */, + DB166E6016A1D6F300A1396C /* CoreFoundation.framework in Frameworks */, + DB166E6116A1D6F300A1396C /* OpenGL.framework in Frameworks */, + DB166E6216A1D6F300A1396C /* AudioUnit.framework in Frameworks */, + DB166E6316A1D6F300A1396C /* Carbon.framework in Frameworks */, + DB166E6416A1D6F300A1396C /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DB166E7016A1D78400A1396C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E7116A1D78400A1396C /* Cocoa.framework in Frameworks */, + DB166E7216A1D78400A1396C /* CoreAudio.framework in Frameworks */, + DB166E7316A1D78400A1396C /* ForceFeedback.framework in Frameworks */, + DB166E7416A1D78400A1396C /* IOKit.framework in Frameworks */, + DB166E7516A1D78400A1396C /* AudioToolbox.framework in Frameworks */, + DB166E7616A1D78400A1396C /* CoreFoundation.framework in Frameworks */, + DB166E7716A1D78400A1396C /* OpenGL.framework in Frameworks */, + DB166E7816A1D78400A1396C /* AudioUnit.framework in Frameworks */, + DB166E7916A1D78400A1396C /* Carbon.framework in Frameworks */, + DB166E7A16A1D78400A1396C /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DB166E8316A1D78C00A1396C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E8416A1D78C00A1396C /* Cocoa.framework in Frameworks */, + DB166E8516A1D78C00A1396C /* CoreAudio.framework in Frameworks */, + DB166E8616A1D78C00A1396C /* ForceFeedback.framework in Frameworks */, + DB166E8716A1D78C00A1396C /* IOKit.framework in Frameworks */, + DB166E8816A1D78C00A1396C /* AudioToolbox.framework in Frameworks */, + DB166E8916A1D78C00A1396C /* CoreFoundation.framework in Frameworks */, + DB166E8A16A1D78C00A1396C /* OpenGL.framework in Frameworks */, + DB166E8B16A1D78C00A1396C /* AudioUnit.framework in Frameworks */, + DB166E8C16A1D78C00A1396C /* Carbon.framework in Frameworks */, + DB166E8D16A1D78C00A1396C /* libSDL2.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 002F33A209CA183B00EBEB88 /* Linked Frameworks */ = { + isa = PBXGroup; children = ( - 00794DD809D1F894003FC8A1 /* OpenGL.framework */, + 002A869F10730593007319AE /* AudioToolbox.framework */, + 002A871410730623007319AE /* AudioUnit.framework */, + 002A873910730675007319AE /* Carbon.framework */, 002F33A709CA188600EBEB88 /* Cocoa.framework */, + 002A863B10730545007319AE /* CoreAudio.framework */, + 002A86A010730593007319AE /* CoreFoundation.framework */, + 002A863C10730545007319AE /* ForceFeedback.framework */, + 002A863D10730545007319AE /* IOKit.framework */, + 002A86F2107305CE007319AE /* OpenGL.framework */, ); name = "Linked Frameworks"; sourceTree = ""; @@ -1219,11 +1839,10 @@ 003FA63B093FFD41000C53B3 /* Products */ = { isa = PBXGroup; children = ( - 003FA643093FFD41000C53B3 /* SDL.framework */, - 003FA645093FFD41000C53B3 /* libSDL.a */, - 003FA647093FFD41000C53B3 /* libSDLmain.a */, + 003FA643093FFD41000C53B3 /* SDL2.framework */, + 003FA645093FFD41000C53B3 /* libSDL2.a */, + DB1D40D717B3F30D00D74CFC /* libSDL2.dylib */, 003FA649093FFD41000C53B3 /* Standard DMG */, - 003FA64B093FFD41000C53B3 /* Developer Extras Package */, ); name = Products; sourceTree = ""; @@ -1231,10 +1850,10 @@ 00794E4609D207B4003FC8A1 /* Resources */ = { isa = PBXGroup; children = ( + DB166ECF16A1D87000A1396C /* shapes */, 00794E5D09D20839003FC8A1 /* icon.bmp */, 00794E5E09D20839003FC8A1 /* moose.dat */, 00794E5F09D20839003FC8A1 /* picture.xbm */, - 00794E6009D20839003FC8A1 /* sail.bmp */, 00794E6109D20839003FC8A1 /* sample.bmp */, 00794E6209D20839003FC8A1 /* sample.wav */, 00794E6309D20839003FC8A1 /* utf8.txt */, @@ -1247,10 +1866,7 @@ children = ( 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */, 08FB7795FE84155DC02AAC07 /* Source */, - 2EECDF3B0086C5EA7F000001 /* SDLMain.h */, - 2EECDF3C0086C5EA7F000001 /* SDLMain.m */, - B207FF2404E1B19600A80002 /* libsdlmain_prefix.h */, - 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */, + DB166D8316A1D17E00A1396C /* SDL_Test */, 002F33A209CA183B00EBEB88 /* Linked Frameworks */, 00794E4609D207B4003FC8A1 /* Resources */, 1AB674ADFE9D54B511CA2CBB /* Products */, @@ -1263,34 +1879,49 @@ isa = PBXGroup; children = ( 092D6D10FFB30A2C7F000001 /* checkkeys.c */, - 092D6D1BFFB30C237F000001 /* graywin.c */, 083E4872006D84C97F000001 /* loopwave.c */, - 083E4874006D84F77F000001 /* testalpha.c */, - 092D6D25FFB30D1A7F000001 /* testbitmap.c */, - 002F339A09CA17BC00EBEB88 /* testblitspeed.c */, - 083E4876006D85297F000001 /* testcdrom.c */, - 002F33E209CA1A0B00EBEB88 /* testdyngl.c */, + 0017958F1074216E00F5D044 /* testatomic.c */, + 001795B01074222D00F5D044 /* testaudioinfo.c */, + 001797711074320D00F5D044 /* testdraw2.c */, 083E4878006D85357F000001 /* testerror.c */, - 002F343609CA1F6F00EBEB88 /* testiconv.c */, 002F341709CA1C5B00EBEB88 /* testfile.c */, - 083E487A006D85477F000001 /* testgamma.c */, - 092D6D4EFFB311087F000001 /* testgl.c */, - 092D6D58FFB311A97F000001 /* testhread.c */, + BBFC088E164C6820003E6A99 /* testgamecontroller.c */, + DB166CBB16A1C74100A1396C /* testgesture.c */, + 0017972710742FB900F5D044 /* testgl2.c */, + DB166CBC16A1C74100A1396C /* testgles.c */, + 0017974E1074315700F5D044 /* testhaptic.c */, + 002F343609CA1F6F00EBEB88 /* testiconv.c */, + 00179791107432FA00F5D044 /* testime.c */, + 001797B31074339C00F5D044 /* testintersections.c */, 092D6D62FFB312AA7F000001 /* testjoystick.c */, 092D6D6CFFB313437F000001 /* testkeys.c */, + 001797D31074343E00F5D044 /* testloadso.c */, 092D6D75FFB313BB7F000001 /* testlock.c */, - F57DC39802A6E6A201D28762 /* testoverlay.c */, + DB166CBD16A1C74100A1396C /* testmessage.c */, + 001798151074359B00F5D044 /* testmultiaudio.c */, + 0017985A107436ED00F5D044 /* testnative.c */, + 0017985B107436ED00F5D044 /* testnative.h */, + 0017985C107436ED00F5D044 /* testnativecocoa.m */, + 00179872107438D000F5D044 /* testnativex11.c */, 002F345209CA201C00EBEB88 /* testoverlay2.c */, - 083E487C006D856B7F000001 /* testpalette.c */, 002F346F09CA20A600EBEB88 /* testplatform.c */, + 001798B910743A4900F5D044 /* testpower.c */, + DB166CBF16A1C74100A1396C /* testrelative.c */, + DB166CC016A1C74100A1396C /* testrendercopyex.c */, + DB166CC116A1C74100A1396C /* testrendertarget.c */, + 001798F910743E9200F5D044 /* testresample.c */, + DB166CC216A1C74100A1396C /* testrumble.c */, + DB166CC316A1C74100A1396C /* testscale.c */, 083E487E006D86A17F000001 /* testsem.c */, - 083E487F006D86A17F000001 /* testsprite.c */, + DB166CC416A1C74100A1396C /* testshader.c */, + 453774A4120915E3002F0F45 /* testshape.c */, + 0017991910743F5300F5D044 /* testsprite2.c */, + DB166CC516A1C74100A1396C /* testspriteminimal.c */, + DB166CC616A1C74100A1396C /* teststreaming.c */, + 092D6D58FFB311A97F000001 /* testthread.c */, 083E4880006D86A17F000001 /* testtimer.c */, 083E4882006D86A17F000001 /* testver.c */, - 083E4883006D86A17F000001 /* testvidinfo.c */, - 083E4884006D86A17F000001 /* testwin.c */, - 083E4885006D86A17F000001 /* testwm.c */, - 083E4886006D86A17F000001 /* threadwin.c */, + 0017993B10743FEF00F5D044 /* testwm2.c */, 083E4887006D86A17F000001 /* torturethread.c */, ); name = Source; @@ -1299,361 +1930,332 @@ 1AB674ADFE9D54B511CA2CBB /* Products */ = { isa = PBXGroup; children = ( - BEC566B60761D90300A33029 /* checkkeys.app */, - BEC566C30761D90300A33029 /* graywin.app */, - BEC566D10761D90300A33029 /* loopwave.app */, - BEC566DF0761D90300A33029 /* testalpha.app */, - BEC566EC0761D90300A33029 /* testbitmap.app */, - BEC566F90761D90300A33029 /* testcdrom.app */, - BEC567060761D90400A33029 /* testerror.app */, - BEC567140761D90400A33029 /* testgamma.app */, - BEC567210761D90400A33029 /* testgl.app */, - BEC5672E0761D90400A33029 /* testthread.app */, - BEC5673B0761D90400A33029 /* testjoystick.app */, - BEC567480761D90400A33029 /* testkeys.app */, - BEC567550761D90400A33029 /* testlock.app */, - BEC567620761D90400A33029 /* testoverlay.app */, - BEC567700761D90500A33029 /* testpalette.app */, - BEC5677D0761D90500A33029 /* testsem.app */, - BEC5678B0761D90500A33029 /* testsprite.app */, - BEC567980761D90500A33029 /* testtimer.app */, - BEC567B20761D90500A33029 /* testversion.app */, - BEC567BF0761D90500A33029 /* testvidinfo.app */, - BEC567CD0761D90500A33029 /* testwin.app */, - BEC567DB0761D90600A33029 /* testwm.app */, - BEC567E80761D90600A33029 /* threadwin.app */, - BEC567F50761D90600A33029 /* torturethread.app */, - BEC567FF0761D90600A33029 /* libsdlmain.a */, - 002F338109CA14F900EBEB88 /* test.app */, - 002F339709CA16BF00EBEB88 /* testblitspeed.app */, - 002F33DB09CA19A600EBEB88 /* testdyngl.app */, - 002F341209CA1BFF00EBEB88 /* testfile.app */, - 002F343109CA1F0300EBEB88 /* testiconv.app */, - 002F344D09CA1FB300EBEB88 /* testoverlay2.app */, - 002F346A09CA204F00EBEB88 /* testplatform.app */, + BEC566B60761D90300A33029 /* checkkeys */, + BEC566D10761D90300A33029 /* loopwave */, + BEC567060761D90400A33029 /* testerror */, + BEC5672E0761D90400A33029 /* testthread */, + BEC5673B0761D90400A33029 /* testjoystick */, + BEC567480761D90400A33029 /* testkeys */, + BEC567550761D90400A33029 /* testlock */, + BEC5677D0761D90500A33029 /* testsem */, + BEC567980761D90500A33029 /* testtimer */, + BEC567B20761D90500A33029 /* testversion */, + BEC567F50761D90600A33029 /* torturethread */, + 002F341209CA1BFF00EBEB88 /* testfile */, + 002F343109CA1F0300EBEB88 /* testiconv */, + 002F344D09CA1FB300EBEB88 /* testoverlay2 */, + 002F346A09CA204F00EBEB88 /* testplatform */, + 0017958C10741F7900F5D044 /* testatomic */, + 001795AD107421BF00F5D044 /* testaudioinfo */, + 0017972110742F3200F5D044 /* testgl2 */, + 00179748107430D600F5D044 /* testhaptic */, + 0017976E107431B300F5D044 /* testdraw2 */, + 0017978E107432AE00F5D044 /* testime */, + 001797AE1074334C00F5D044 /* testintersections */, + 001797D0107433C600F5D044 /* testloadso */, + 001798121074355200F5D044 /* testmultiaudio */, + 001798941074392D00F5D044 /* testnative */, + 001798B5107439DF00F5D044 /* testpower */, + 001798F210743BEC00F5D044 /* testresample */, + 0017991610743F1000F5D044 /* testsprite2 */, + 0017993810743FB700F5D044 /* testwm2 */, + 4537749212091504002F0F45 /* testshape */, + BBFC08CD164C6862003E6A99 /* testgamecontroller */, + DB166D7F16A1D12400A1396C /* libSDL_test.a */, + DB166DBF16A1D2F600A1396C /* testgesture */, + DB166DD516A1D36A00A1396C /* testmessage */, + DB166DEE16A1D50C00A1396C /* testrelative */, + DB166E0516A1D57C00A1396C /* testrendercopyex */, + DB166E1C16A1D5AD00A1396C /* testrendertarget */, + DB166E3816A1D64D00A1396C /* testrumble */, + DB166E5216A1D69000A1396C /* testscale */, + DB166E6816A1D6F300A1396C /* testshader */, + DB166E7E16A1D78400A1396C /* testspriteminimal */, + DB166E9116A1D78C00A1396C /* teststreaming */, ); name = Products; sourceTree = ""; }; + DB166D8316A1D17E00A1396C /* SDL_Test */ = { + isa = PBXGroup; + children = ( + DB166D8416A1D1A500A1396C /* SDL_test_assert.c */, + DB166D8516A1D1A500A1396C /* SDL_test_common.c */, + DB166D8616A1D1A500A1396C /* SDL_test_compare.c */, + DB166D8716A1D1A500A1396C /* SDL_test_crc32.c */, + DB166D8816A1D1A500A1396C /* SDL_test_font.c */, + DB166D8916A1D1A500A1396C /* SDL_test_fuzzer.c */, + DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */, + DB166D8B16A1D1A500A1396C /* SDL_test_imageBlit.c */, + DB166D8C16A1D1A500A1396C /* SDL_test_imageBlitBlend.c */, + DB166D8D16A1D1A500A1396C /* SDL_test_imageFace.c */, + DB166D8E16A1D1A500A1396C /* SDL_test_imagePrimitives.c */, + DB166D8F16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c */, + DB166D9016A1D1A500A1396C /* SDL_test_log.c */, + DB166D9116A1D1A500A1396C /* SDL_test_md5.c */, + DB166D9216A1D1A500A1396C /* SDL_test_random.c */, + ); + name = SDL_Test; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 002F337309CA14F900EBEB88 /* Headers */ = { + DB166D7D16A1D12400A1396C /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; - 002F338909CA16BF00EBEB88 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 0017957410741F7900F5D044 /* testatomic */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0017958610741F7900F5D044 /* Build configuration list for PBXNativeTarget "testatomic" */; + buildPhases = ( + 0017957910741F7900F5D044 /* Sources */, + 0017957A10741F7900F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F33CD09CA19A600EBEB88 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F340409CA1BFF00EBEB88 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testatomic; + productName = testalpha; + productReference = 0017958C10741F7900F5D044 /* testatomic */; + productType = "com.apple.product-type.tool"; }; - 002F342309CA1F0300EBEB88 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 00179595107421BF00F5D044 /* testaudioinfo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 001795A7107421BF00F5D044 /* Build configuration list for PBXNativeTarget "testaudioinfo" */; + buildPhases = ( + 0017959A107421BF00F5D044 /* Sources */, + 0017959B107421BF00F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F343F09CA1FB300EBEB88 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F345C09CA204F00EBEB88 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testaudioinfo; + productName = testalpha; + productReference = 001795AD107421BF00F5D044 /* testaudioinfo */; + productType = "com.apple.product-type.tool"; }; - BEC566AD0761D90300A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 0017970910742F3200F5D044 /* testgl2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0017971B10742F3200F5D044 /* Build configuration list for PBXNativeTarget "testgl2" */; + buildPhases = ( + 0017970E10742F3200F5D044 /* Sources */, + 0017970F10742F3200F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566BA0761D90300A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566C70761D90300A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testgl2; + productName = testalpha; + productReference = 0017972110742F3200F5D044 /* testgl2 */; + productType = "com.apple.product-type.tool"; }; - BEC566D50761D90300A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 00179730107430D600F5D044 /* testhaptic */ = { + isa = PBXNativeTarget; + buildConfigurationList = 00179742107430D600F5D044 /* Build configuration list for PBXNativeTarget "testhaptic" */; + buildPhases = ( + 00179735107430D600F5D044 /* Sources */, + 00179736107430D600F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566E30761D90300A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566F00761D90300A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testhaptic; + productName = testalpha; + productReference = 00179748107430D600F5D044 /* testhaptic */; + productType = "com.apple.product-type.tool"; }; - BEC566FD0761D90300A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 00179756107431B300F5D044 /* testdraw2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 00179768107431B300F5D044 /* Build configuration list for PBXNativeTarget "testdraw2" */; + buildPhases = ( + 0017975B107431B300F5D044 /* Sources */, + 0017975C107431B300F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC5670A0761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567180761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testdraw2; + productName = testalpha; + productReference = 0017976E107431B300F5D044 /* testdraw2 */; + productType = "com.apple.product-type.tool"; }; - BEC567250761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 00179776107432AE00F5D044 /* testime */ = { + isa = PBXNativeTarget; + buildConfigurationList = 00179788107432AE00F5D044 /* Build configuration list for PBXNativeTarget "testime" */; + buildPhases = ( + 0017977B107432AE00F5D044 /* Sources */, + 0017977C107432AE00F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567320761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC5673F0761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testime; + productName = testalpha; + productReference = 0017978E107432AE00F5D044 /* testime */; + productType = "com.apple.product-type.tool"; }; - BEC5674C0761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 001797961074334C00F5D044 /* testintersections */ = { + isa = PBXNativeTarget; + buildConfigurationList = 001797A81074334C00F5D044 /* Build configuration list for PBXNativeTarget "testintersections" */; + buildPhases = ( + 0017979B1074334C00F5D044 /* Sources */, + 0017979C1074334C00F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567590761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567660761D90400A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testintersections; + productName = testalpha; + productReference = 001797AE1074334C00F5D044 /* testintersections */; + productType = "com.apple.product-type.tool"; }; - BEC567740761D90500A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 001797B8107433C600F5D044 /* testloadso */ = { + isa = PBXNativeTarget; + buildConfigurationList = 001797CA107433C600F5D044 /* Build configuration list for PBXNativeTarget "testloadso" */; + buildPhases = ( + 001797BD107433C600F5D044 /* Sources */, + 001797BE107433C600F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567810761D90500A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC5678F0761D90500A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testloadso; + productName = testalpha; + productReference = 001797D0107433C600F5D044 /* testloadso */; + productType = "com.apple.product-type.tool"; }; - BEC567A90761D90500A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 001797FA1074355200F5D044 /* testmultiaudio */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0017980C1074355200F5D044 /* Build configuration list for PBXNativeTarget "testmultiaudio" */; + buildPhases = ( + 001797FF1074355200F5D044 /* Sources */, + 001798001074355200F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567B60761D90500A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567C30761D90500A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testmultiaudio; + productName = testalpha; + productReference = 001798121074355200F5D044 /* testmultiaudio */; + productType = "com.apple.product-type.tool"; }; - BEC567D10761D90500A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + 001798781074392D00F5D044 /* testnative */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0017988E1074392D00F5D044 /* Build configuration list for PBXNativeTarget "testnative" */; + buildPhases = ( + 0017987E1074392D00F5D044 /* Sources */, + 001798821074392D00F5D044 /* Frameworks */, + DB166DDA16A1D40F00A1396C /* CopyFiles */, ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567DF0761D90600A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + buildRules = ( ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567EC0761D90600A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( + dependencies = ( ); - runOnlyForDeploymentPostprocessing = 0; + name = testnative; + productName = testalpha; + productReference = 001798941074392D00F5D044 /* testnative */; + productType = "com.apple.product-type.tool"; }; - BEC567F80761D90600A33029 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC567F90761D90600A33029 /* SDLMain.h in Headers */, - BEC567FA0761D90600A33029 /* libsdlmain_prefix.h in Headers */, + 0017989D107439DF00F5D044 /* testpower */ = { + isa = PBXNativeTarget; + buildConfigurationList = 001798AF107439DF00F5D044 /* Build configuration list for PBXNativeTarget "testpower" */; + buildPhases = ( + 001798A2107439DF00F5D044 /* Sources */, + 001798A3107439DF00F5D044 /* Frameworks */, ); - runOnlyForDeploymentPostprocessing = 0; + buildRules = ( + ); + dependencies = ( + ); + name = testpower; + productName = testalpha; + productReference = 001798B5107439DF00F5D044 /* testpower */; + productType = "com.apple.product-type.tool"; }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 002F337009CA14F900EBEB88 /* test */ = { + 001798DA10743BEC00F5D044 /* testresample */ = { isa = PBXNativeTarget; - buildConfigurationList = 002F337D09CA14F900EBEB88 /* Build configuration list for PBXNativeTarget "test" */; + buildConfigurationList = 001798EC10743BEC00F5D044 /* Build configuration list for PBXNativeTarget "testresample" */; buildPhases = ( - 002F337309CA14F900EBEB88 /* Headers */, - 002F337409CA14F900EBEB88 /* Resources */, - 002F337609CA14F900EBEB88 /* Sources */, - 002F337809CA14F900EBEB88 /* Frameworks */, + 001798DF10743BEC00F5D044 /* Sources */, + 001798E010743BEC00F5D044 /* Frameworks */, ); buildRules = ( ); dependencies = ( - 002F337109CA14F900EBEB88 /* PBXTargetDependency */, ); - name = test; - productInstallPath = "$(USER_APPS_DIR)"; + name = testresample; productName = testalpha; - productReference = 002F338109CA14F900EBEB88 /* test.app */; - productType = "com.apple.product-type.application"; + productReference = 001798F210743BEC00F5D044 /* testresample */; + productType = "com.apple.product-type.tool"; }; - 002F338609CA16BF00EBEB88 /* testblitspeed */ = { + 001798FE10743F1000F5D044 /* testsprite2 */ = { isa = PBXNativeTarget; - buildConfigurationList = 002F339309CA16BF00EBEB88 /* Build configuration list for PBXNativeTarget "testblitspeed" */; + buildConfigurationList = 0017991010743F1000F5D044 /* Build configuration list for PBXNativeTarget "testsprite2" */; buildPhases = ( - 002F338909CA16BF00EBEB88 /* Headers */, - 002F338A09CA16BF00EBEB88 /* Resources */, - 002F338C09CA16BF00EBEB88 /* Sources */, - 002F338E09CA16BF00EBEB88 /* Frameworks */, - 00794EA909D234E8003FC8A1 /* CopyFiles */, + 0017990310743F1000F5D044 /* Sources */, + 0017990410743F1000F5D044 /* Frameworks */, ); buildRules = ( ); dependencies = ( - 002F338709CA16BF00EBEB88 /* PBXTargetDependency */, ); - name = testblitspeed; - productInstallPath = "$(USER_APPS_DIR)"; + name = testsprite2; productName = testalpha; - productReference = 002F339709CA16BF00EBEB88 /* testblitspeed.app */; - productType = "com.apple.product-type.application"; + productReference = 0017991610743F1000F5D044 /* testsprite2 */; + productType = "com.apple.product-type.tool"; }; - 002F33CA09CA19A600EBEB88 /* testdyngl */ = { + 0017992010743FB700F5D044 /* testwm2 */ = { isa = PBXNativeTarget; - buildConfigurationList = 002F33D709CA19A600EBEB88 /* Build configuration list for PBXNativeTarget "testdyngl" */; + buildConfigurationList = 0017993210743FB700F5D044 /* Build configuration list for PBXNativeTarget "testwm2" */; buildPhases = ( - 002F33CD09CA19A600EBEB88 /* Headers */, - 002F33CE09CA19A600EBEB88 /* Resources */, - 002F33D009CA19A600EBEB88 /* Sources */, - 002F33D109CA19A600EBEB88 /* Frameworks */, + 0017992510743FB700F5D044 /* Sources */, + 0017992610743FB700F5D044 /* Frameworks */, ); buildRules = ( ); dependencies = ( - 002F33CB09CA19A600EBEB88 /* PBXTargetDependency */, ); - name = testdyngl; - productInstallPath = "$(USER_APPS_DIR)"; + name = testwm2; productName = testalpha; - productReference = 002F33DB09CA19A600EBEB88 /* testdyngl.app */; - productType = "com.apple.product-type.application"; + productReference = 0017993810743FB700F5D044 /* testwm2 */; + productType = "com.apple.product-type.tool"; }; 002F340109CA1BFF00EBEB88 /* testfile */ = { isa = PBXNativeTarget; buildConfigurationList = 002F340E09CA1BFF00EBEB88 /* Build configuration list for PBXNativeTarget "testfile" */; buildPhases = ( - 002F340409CA1BFF00EBEB88 /* Headers */, - 002F340509CA1BFF00EBEB88 /* Resources */, 002F340709CA1BFF00EBEB88 /* Sources */, 002F340809CA1BFF00EBEB88 /* Frameworks */, ); buildRules = ( ); dependencies = ( - 002F340209CA1BFF00EBEB88 /* PBXTargetDependency */, ); name = testfile; - productInstallPath = "$(USER_APPS_DIR)"; productName = testalpha; - productReference = 002F341209CA1BFF00EBEB88 /* testfile.app */; - productType = "com.apple.product-type.application"; + productReference = 002F341209CA1BFF00EBEB88 /* testfile */; + productType = "com.apple.product-type.tool"; }; 002F342009CA1F0300EBEB88 /* testiconv */ = { isa = PBXNativeTarget; buildConfigurationList = 002F342D09CA1F0300EBEB88 /* Build configuration list for PBXNativeTarget "testiconv" */; buildPhases = ( - 002F342309CA1F0300EBEB88 /* Headers */, - 002F342409CA1F0300EBEB88 /* Resources */, 002F342609CA1F0300EBEB88 /* Sources */, 002F342709CA1F0300EBEB88 /* Frameworks */, 00794EEC09D2371F003FC8A1 /* CopyFiles */, @@ -1661,20 +2263,16 @@ buildRules = ( ); dependencies = ( - 002F342109CA1F0300EBEB88 /* PBXTargetDependency */, ); name = testiconv; - productInstallPath = "$(USER_APPS_DIR)"; productName = testalpha; - productReference = 002F343109CA1F0300EBEB88 /* testiconv.app */; - productType = "com.apple.product-type.application"; + productReference = 002F343109CA1F0300EBEB88 /* testiconv */; + productType = "com.apple.product-type.tool"; }; 002F343C09CA1FB300EBEB88 /* testoverlay2 */ = { isa = PBXNativeTarget; buildConfigurationList = 002F344909CA1FB300EBEB88 /* Build configuration list for PBXNativeTarget "testoverlay2" */; buildPhases = ( - 002F343F09CA1FB300EBEB88 /* Headers */, - 002F344009CA1FB300EBEB88 /* Resources */, 002F344209CA1FB300EBEB88 /* Sources */, 002F344309CA1FB300EBEB88 /* Frameworks */, 00794EF409D237C7003FC8A1 /* CopyFiles */, @@ -1682,548 +2280,430 @@ buildRules = ( ); dependencies = ( - 002F343D09CA1FB300EBEB88 /* PBXTargetDependency */, ); name = testoverlay2; - productInstallPath = "$(USER_APPS_DIR)"; productName = testalpha; - productReference = 002F344D09CA1FB300EBEB88 /* testoverlay2.app */; - productType = "com.apple.product-type.application"; + productReference = 002F344D09CA1FB300EBEB88 /* testoverlay2 */; + productType = "com.apple.product-type.tool"; }; 002F345909CA204F00EBEB88 /* testplatform */ = { isa = PBXNativeTarget; buildConfigurationList = 002F346609CA204F00EBEB88 /* Build configuration list for PBXNativeTarget "testplatform" */; buildPhases = ( - 002F345C09CA204F00EBEB88 /* Headers */, - 002F345D09CA204F00EBEB88 /* Resources */, 002F345F09CA204F00EBEB88 /* Sources */, 002F346009CA204F00EBEB88 /* Frameworks */, ); buildRules = ( ); dependencies = ( - 002F345A09CA204F00EBEB88 /* PBXTargetDependency */, ); name = testplatform; - productInstallPath = "$(USER_APPS_DIR)"; productName = testalpha; - productReference = 002F346A09CA204F00EBEB88 /* testplatform.app */; - productType = "com.apple.product-type.application"; - }; - BEC566AB0761D90300A33029 /* checkkeys (Upgraded) */ = { - isa = PBXNativeTarget; - buildConfigurationList = 001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys (Upgraded)" */; - buildPhases = ( - BEC566AD0761D90300A33029 /* Headers */, - BEC566AE0761D90300A33029 /* Resources */, - BEC566B00761D90300A33029 /* Sources */, - BEC566B20761D90300A33029 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - BEC568310761D90600A33029 /* PBXTargetDependency */, - ); - name = "checkkeys (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = checkkeys; - productReference = BEC566B60761D90300A33029 /* checkkeys.app */; - productType = "com.apple.product-type.application"; + productReference = 002F346A09CA204F00EBEB88 /* testplatform */; + productType = "com.apple.product-type.tool"; }; - BEC566B80761D90300A33029 /* graywin (Upgraded) */ = { + 4537749112091504002F0F45 /* testshape */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B593C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "graywin (Upgraded)" */; + buildConfigurationList = 4537749A1209150C002F0F45 /* Build configuration list for PBXNativeTarget "testshape" */; buildPhases = ( - BEC566BA0761D90300A33029 /* Headers */, - BEC566BB0761D90300A33029 /* Resources */, - BEC566BD0761D90300A33029 /* Sources */, - BEC566BF0761D90300A33029 /* Frameworks */, + 4537748F12091504002F0F45 /* Sources */, + 4537749012091504002F0F45 /* Frameworks */, + DB166ECE16A1D85400A1396C /* CopyFiles */, ); buildRules = ( ); dependencies = ( - BEC568330761D90600A33029 /* PBXTargetDependency */, ); - name = "graywin (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = graywin; - productReference = BEC566C30761D90300A33029 /* graywin.app */; - productType = "com.apple.product-type.application"; + name = testshape; + productName = testshape; + productReference = 4537749212091504002F0F45 /* testshape */; + productType = "com.apple.product-type.tool"; }; - BEC566C50761D90300A33029 /* loopwave (Upgraded) */ = { + BBFC08B7164C6862003E6A99 /* testgamecontroller */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave (Upgraded)" */; + buildConfigurationList = BBFC08CA164C6862003E6A99 /* Build configuration list for PBXNativeTarget "testgamecontroller" */; buildPhases = ( - BEC566C70761D90300A33029 /* Headers */, - BEC566C80761D90300A33029 /* Resources */, - BEC566CA0761D90300A33029 /* Sources */, - BEC566CC0761D90300A33029 /* Frameworks */, - 00794E6409D2084F003FC8A1 /* CopyFiles */, + BBFC08BC164C6862003E6A99 /* Sources */, + BBFC08BE164C6862003E6A99 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568350761D90600A33029 /* PBXTargetDependency */, ); - name = "loopwave (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = loopwave; - productReference = BEC566D10761D90300A33029 /* loopwave.app */; - productType = "com.apple.product-type.application"; + name = testgamecontroller; + productName = testjoystick; + productReference = BBFC08CD164C6862003E6A99 /* testgamecontroller */; + productType = "com.apple.product-type.tool"; }; - BEC566D30761D90300A33029 /* testalpha (Upgraded) */ = { + BEC566AB0761D90300A33029 /* checkkeys */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B594408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testalpha (Upgraded)" */; + buildConfigurationList = 001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys" */; buildPhases = ( - BEC566D50761D90300A33029 /* Headers */, - BEC566D60761D90300A33029 /* Resources */, - BEC566D80761D90300A33029 /* Sources */, - BEC566DA0761D90300A33029 /* Frameworks */, - 00794EA009D2343A003FC8A1 /* CopyFiles */, + BEC566B00761D90300A33029 /* Sources */, + BEC566B20761D90300A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568370761D90600A33029 /* PBXTargetDependency */, ); - name = "testalpha (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testalpha; - productReference = BEC566DF0761D90300A33029 /* testalpha.app */; - productType = "com.apple.product-type.application"; + name = checkkeys; + productName = checkkeys; + productReference = BEC566B60761D90300A33029 /* checkkeys */; + productType = "com.apple.product-type.tool"; }; - BEC566E10761D90300A33029 /* testbitmap (Upgraded) */ = { + BEC566C50761D90300A33029 /* loopwave */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B594808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testbitmap (Upgraded)" */; + buildConfigurationList = 001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave" */; buildPhases = ( - BEC566E30761D90300A33029 /* Headers */, - BEC566E40761D90300A33029 /* Resources */, - BEC566E60761D90300A33029 /* Sources */, - BEC566E80761D90300A33029 /* Frameworks */, + BEC566CA0761D90300A33029 /* Sources */, + BEC566CC0761D90300A33029 /* Frameworks */, + 00794E6409D2084F003FC8A1 /* CopyFiles */, ); buildRules = ( ); dependencies = ( - BEC568390761D90600A33029 /* PBXTargetDependency */, ); - name = "testbitmap (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testbitmap; - productReference = BEC566EC0761D90300A33029 /* testbitmap.app */; - productType = "com.apple.product-type.application"; + name = loopwave; + productName = loopwave; + productReference = BEC566D10761D90300A33029 /* loopwave */; + productType = "com.apple.product-type.tool"; }; - BEC566EE0761D90300A33029 /* testcdrom (Upgraded) */ = { + BEC566FB0761D90300A33029 /* testerror */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B594C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testcdrom (Upgraded)" */; + buildConfigurationList = 001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror" */; buildPhases = ( - BEC566F00761D90300A33029 /* Headers */, - BEC566F10761D90300A33029 /* Resources */, - BEC566F30761D90300A33029 /* Sources */, - BEC566F50761D90300A33029 /* Frameworks */, + BEC567000761D90300A33029 /* Sources */, + BEC567020761D90300A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC5683B0761D90600A33029 /* PBXTargetDependency */, ); - name = "testcdrom (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testcdrom; - productReference = BEC566F90761D90300A33029 /* testcdrom.app */; - productType = "com.apple.product-type.application"; + name = testerror; + productName = testerror; + productReference = BEC567060761D90400A33029 /* testerror */; + productType = "com.apple.product-type.tool"; }; - BEC566FB0761D90300A33029 /* testerror (Upgraded) */ = { + BEC567230761D90400A33029 /* testthread */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror (Upgraded)" */; + buildConfigurationList = 001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread" */; buildPhases = ( - BEC566FD0761D90300A33029 /* Headers */, - BEC566FE0761D90300A33029 /* Resources */, - BEC567000761D90300A33029 /* Sources */, - BEC567020761D90300A33029 /* Frameworks */, + BEC567280761D90400A33029 /* Sources */, + BEC5672A0761D90400A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC5683D0761D90600A33029 /* PBXTargetDependency */, ); - name = "testerror (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testerror; - productReference = BEC567060761D90400A33029 /* testerror.app */; - productType = "com.apple.product-type.application"; + name = testthread; + productName = testthread; + productReference = BEC5672E0761D90400A33029 /* testthread */; + productType = "com.apple.product-type.tool"; }; - BEC567080761D90400A33029 /* testgamma (Upgraded) */ = { + BEC567300761D90400A33029 /* testjoystick */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B595408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgamma (Upgraded)" */; + buildConfigurationList = 001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick" */; buildPhases = ( - BEC5670A0761D90400A33029 /* Headers */, - BEC5670B0761D90400A33029 /* Resources */, - BEC5670D0761D90400A33029 /* Sources */, - BEC5670F0761D90400A33029 /* Frameworks */, - 00794EE509D236E4003FC8A1 /* CopyFiles */, + BEC567350761D90400A33029 /* Sources */, + BEC567370761D90400A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC5683F0761D90600A33029 /* PBXTargetDependency */, ); - name = "testgamma (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testgamma; - productReference = BEC567140761D90400A33029 /* testgamma.app */; - productType = "com.apple.product-type.application"; + name = testjoystick; + productName = testjoystick; + productReference = BEC5673B0761D90400A33029 /* testjoystick */; + productType = "com.apple.product-type.tool"; }; - BEC567160761D90400A33029 /* testgl (Upgraded) */ = { + BEC5673D0761D90400A33029 /* testkeys */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B595808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgl (Upgraded)" */; + buildConfigurationList = 001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys" */; buildPhases = ( - BEC567180761D90400A33029 /* Headers */, - BEC567190761D90400A33029 /* Resources */, - BEC5671B0761D90400A33029 /* Sources */, - BEC5671D0761D90400A33029 /* Frameworks */, + BEC567420761D90400A33029 /* Sources */, + BEC567440761D90400A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568410761D90600A33029 /* PBXTargetDependency */, ); - name = "testgl (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testgl; - productReference = BEC567210761D90400A33029 /* testgl.app */; - productType = "com.apple.product-type.application"; + name = testkeys; + productName = testkeys; + productReference = BEC567480761D90400A33029 /* testkeys */; + productType = "com.apple.product-type.tool"; }; - BEC567230761D90400A33029 /* testthread (Upgraded) */ = { + BEC5674A0761D90400A33029 /* testlock */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread (Upgraded)" */; + buildConfigurationList = 001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock" */; buildPhases = ( - BEC567250761D90400A33029 /* Headers */, - BEC567260761D90400A33029 /* Resources */, - BEC567280761D90400A33029 /* Sources */, - BEC5672A0761D90400A33029 /* Frameworks */, + BEC5674F0761D90400A33029 /* Sources */, + BEC567510761D90400A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568430761D90600A33029 /* PBXTargetDependency */, ); - name = "testthread (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testthread; - productReference = BEC5672E0761D90400A33029 /* testthread.app */; - productType = "com.apple.product-type.application"; + name = testlock; + productName = testlock; + productReference = BEC567550761D90400A33029 /* testlock */; + productType = "com.apple.product-type.tool"; }; - BEC567300761D90400A33029 /* testjoystick (Upgraded) */ = { + BEC567720761D90500A33029 /* testsem */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick (Upgraded)" */; + buildConfigurationList = 001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem" */; buildPhases = ( - BEC567320761D90400A33029 /* Headers */, - BEC567330761D90400A33029 /* Resources */, - BEC567350761D90400A33029 /* Sources */, - BEC567370761D90400A33029 /* Frameworks */, + BEC567770761D90500A33029 /* Sources */, + BEC567790761D90500A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568450761D90600A33029 /* PBXTargetDependency */, ); - name = "testjoystick (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testjoystick; - productReference = BEC5673B0761D90400A33029 /* testjoystick.app */; - productType = "com.apple.product-type.application"; + name = testsem; + productName = testsem; + productReference = BEC5677D0761D90500A33029 /* testsem */; + productType = "com.apple.product-type.tool"; }; - BEC5673D0761D90400A33029 /* testkeys (Upgraded) */ = { + BEC5678D0761D90500A33029 /* testtimer */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys (Upgraded)" */; + buildConfigurationList = 001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer" */; buildPhases = ( - BEC5673F0761D90400A33029 /* Headers */, - BEC567400761D90400A33029 /* Resources */, - BEC567420761D90400A33029 /* Sources */, - BEC567440761D90400A33029 /* Frameworks */, + BEC567920761D90500A33029 /* Sources */, + BEC567940761D90500A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568470761D90600A33029 /* PBXTargetDependency */, ); - name = "testkeys (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testkeys; - productReference = BEC567480761D90400A33029 /* testkeys.app */; - productType = "com.apple.product-type.application"; + name = testtimer; + productName = testtimer; + productReference = BEC567980761D90500A33029 /* testtimer */; + productType = "com.apple.product-type.tool"; }; - BEC5674A0761D90400A33029 /* testlock (Upgraded) */ = { + BEC567A70761D90500A33029 /* testversion */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock (Upgraded)" */; + buildConfigurationList = 001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion" */; buildPhases = ( - BEC5674C0761D90400A33029 /* Headers */, - BEC5674D0761D90400A33029 /* Resources */, - BEC5674F0761D90400A33029 /* Sources */, - BEC567510761D90400A33029 /* Frameworks */, + BEC567AC0761D90500A33029 /* Sources */, + BEC567AE0761D90500A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568490761D90600A33029 /* PBXTargetDependency */, ); - name = "testlock (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testlock; - productReference = BEC567550761D90400A33029 /* testlock.app */; - productType = "com.apple.product-type.application"; + name = testversion; + productName = testversion; + productReference = BEC567B20761D90500A33029 /* testversion */; + productType = "com.apple.product-type.tool"; }; - BEC567570761D90400A33029 /* testoverlay (Upgraded) */ = { + BEC567EA0761D90600A33029 /* torturethread */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B599C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testoverlay (Upgraded)" */; + buildConfigurationList = 001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread" */; buildPhases = ( - BEC567590761D90400A33029 /* Headers */, - BEC5675A0761D90400A33029 /* Resources */, - BEC5675C0761D90400A33029 /* Sources */, - BEC5675E0761D90400A33029 /* Frameworks */, - 00794F6109D24125003FC8A1 /* CopyFiles */, + BEC567EF0761D90600A33029 /* Sources */, + BEC567F10761D90600A33029 /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC5684B0761D90600A33029 /* PBXTargetDependency */, ); - name = "testoverlay (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testoverlay; - productReference = BEC567620761D90400A33029 /* testoverlay.app */; - productType = "com.apple.product-type.application"; + name = torturethread; + productName = torturethread; + productReference = BEC567F50761D90600A33029 /* torturethread */; + productType = "com.apple.product-type.tool"; }; - BEC567640761D90400A33029 /* testpalette (Upgraded) */ = { + DB166D7E16A1D12400A1396C /* SDL_test */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B596C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testpalette (Upgraded)" */; + buildConfigurationList = DB166D8016A1D12400A1396C /* Build configuration list for PBXNativeTarget "SDL_test" */; buildPhases = ( - BEC567660761D90400A33029 /* Headers */, - BEC567670761D90400A33029 /* Resources */, - BEC567690761D90400A33029 /* Sources */, - BEC5676B0761D90400A33029 /* Frameworks */, - 00794EFC09D2381C003FC8A1 /* CopyFiles */, + DB166D7B16A1D12400A1396C /* Sources */, + DB166D7C16A1D12400A1396C /* Frameworks */, + DB166D7D16A1D12400A1396C /* Headers */, ); buildRules = ( ); dependencies = ( - BEC5684D0761D90600A33029 /* PBXTargetDependency */, ); - name = "testpalette (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testpalette; - productReference = BEC567700761D90500A33029 /* testpalette.app */; - productType = "com.apple.product-type.application"; + name = SDL_test; + productName = SDL_test; + productReference = DB166D7F16A1D12400A1396C /* libSDL_test.a */; + productType = "com.apple.product-type.library.static"; }; - BEC567720761D90500A33029 /* testsem (Upgraded) */ = { + DB166DAD16A1D2F600A1396C /* testgesture */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem (Upgraded)" */; + buildConfigurationList = DB166DBC16A1D2F600A1396C /* Build configuration list for PBXNativeTarget "testgesture" */; buildPhases = ( - BEC567740761D90500A33029 /* Headers */, - BEC567750761D90500A33029 /* Resources */, - BEC567770761D90500A33029 /* Sources */, - BEC567790761D90500A33029 /* Frameworks */, + DB166DAE16A1D2F600A1396C /* Sources */, + DB166DB016A1D2F600A1396C /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC5684F0761D90600A33029 /* PBXTargetDependency */, ); - name = "testsem (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testsem; - productReference = BEC5677D0761D90500A33029 /* testsem.app */; - productType = "com.apple.product-type.application"; + name = testgesture; + productName = testalpha; + productReference = DB166DBF16A1D2F600A1396C /* testgesture */; + productType = "com.apple.product-type.tool"; }; - BEC5677F0761D90500A33029 /* testsprite (Upgraded) */ = { + DB166DC416A1D36A00A1396C /* testmessage */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B597408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsprite (Upgraded)" */; + buildConfigurationList = DB166DD216A1D36A00A1396C /* Build configuration list for PBXNativeTarget "testmessage" */; buildPhases = ( - BEC567810761D90500A33029 /* Headers */, - BEC567820761D90500A33029 /* Resources */, - BEC567840761D90500A33029 /* Sources */, - BEC567860761D90500A33029 /* Frameworks */, - 00794F0209D2385F003FC8A1 /* CopyFiles */, + DB166DC516A1D36A00A1396C /* Sources */, + DB166DC716A1D36A00A1396C /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568510761D90600A33029 /* PBXTargetDependency */, ); - name = "testsprite (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testsprite; - productReference = BEC5678B0761D90500A33029 /* testsprite.app */; - productType = "com.apple.product-type.application"; + name = testmessage; + productName = testalpha; + productReference = DB166DD516A1D36A00A1396C /* testmessage */; + productType = "com.apple.product-type.tool"; }; - BEC5678D0761D90500A33029 /* testtimer (Upgraded) */ = { + DB166DDC16A1D50C00A1396C /* testrelative */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer (Upgraded)" */; + buildConfigurationList = DB166DEB16A1D50C00A1396C /* Build configuration list for PBXNativeTarget "testrelative" */; buildPhases = ( - BEC5678F0761D90500A33029 /* Headers */, - BEC567900761D90500A33029 /* Resources */, - BEC567920761D90500A33029 /* Sources */, - BEC567940761D90500A33029 /* Frameworks */, + DB166DDD16A1D50C00A1396C /* Sources */, + DB166DDF16A1D50C00A1396C /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC568530761D90600A33029 /* PBXTargetDependency */, ); - name = "testtimer (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testtimer; - productReference = BEC567980761D90500A33029 /* testtimer.app */; - productType = "com.apple.product-type.application"; + name = testrelative; + productName = testalpha; + productReference = DB166DEE16A1D50C00A1396C /* testrelative */; + productType = "com.apple.product-type.tool"; }; - BEC567A70761D90500A33029 /* testversion (Upgraded) */ = { + DB166DF316A1D57C00A1396C /* testrendercopyex */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion (Upgraded)" */; + buildConfigurationList = DB166E0216A1D57C00A1396C /* Build configuration list for PBXNativeTarget "testrendercopyex" */; buildPhases = ( - BEC567A90761D90500A33029 /* Headers */, - BEC567AA0761D90500A33029 /* Resources */, - BEC567AC0761D90500A33029 /* Sources */, - BEC567AE0761D90500A33029 /* Frameworks */, + DB166DF416A1D57C00A1396C /* Sources */, + DB166DF616A1D57C00A1396C /* Frameworks */, + DB166E2116A1D5DF00A1396C /* CopyFiles */, ); buildRules = ( ); dependencies = ( - BEC568570761D90600A33029 /* PBXTargetDependency */, ); - name = "testversion (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testversion; - productReference = BEC567B20761D90500A33029 /* testversion.app */; - productType = "com.apple.product-type.application"; + name = testrendercopyex; + productName = testalpha; + productReference = DB166E0516A1D57C00A1396C /* testrendercopyex */; + productType = "com.apple.product-type.tool"; }; - BEC567B40761D90500A33029 /* testvidinfo (Upgraded) */ = { + DB166E0A16A1D5AD00A1396C /* testrendertarget */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B598408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testvidinfo (Upgraded)" */; + buildConfigurationList = DB166E1916A1D5AD00A1396C /* Build configuration list for PBXNativeTarget "testrendertarget" */; buildPhases = ( - BEC567B60761D90500A33029 /* Headers */, - BEC567B70761D90500A33029 /* Resources */, - BEC567B90761D90500A33029 /* Sources */, - BEC567BB0761D90500A33029 /* Frameworks */, + DB166E0B16A1D5AD00A1396C /* Sources */, + DB166E0D16A1D5AD00A1396C /* Frameworks */, + DB166E2416A1D61000A1396C /* CopyFiles */, ); buildRules = ( ); dependencies = ( - BEC568590761D90600A33029 /* PBXTargetDependency */, ); - name = "testvidinfo (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testvidinfo; - productReference = BEC567BF0761D90500A33029 /* testvidinfo.app */; - productType = "com.apple.product-type.application"; + name = testrendertarget; + productName = testalpha; + productReference = DB166E1C16A1D5AD00A1396C /* testrendertarget */; + productType = "com.apple.product-type.tool"; }; - BEC567C10761D90500A33029 /* testwin (Upgraded) */ = { + DB166E2716A1D64D00A1396C /* testrumble */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B598808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwin (Upgraded)" */; + buildConfigurationList = DB166E3516A1D64D00A1396C /* Build configuration list for PBXNativeTarget "testrumble" */; buildPhases = ( - BEC567C30761D90500A33029 /* Headers */, - BEC567C40761D90500A33029 /* Resources */, - BEC567C60761D90500A33029 /* Sources */, - BEC567C80761D90500A33029 /* Frameworks */, - 00794F0909D238E3003FC8A1 /* CopyFiles */, + DB166E2816A1D64D00A1396C /* Sources */, + DB166E2A16A1D64D00A1396C /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC5685B0761D90600A33029 /* PBXTargetDependency */, ); - name = "testwin (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testwin; - productReference = BEC567CD0761D90500A33029 /* testwin.app */; - productType = "com.apple.product-type.application"; + name = testrumble; + productName = testalpha; + productReference = DB166E3816A1D64D00A1396C /* testrumble */; + productType = "com.apple.product-type.tool"; }; - BEC567CF0761D90500A33029 /* testwm (Upgraded) */ = { + DB166E3D16A1D69000A1396C /* testscale */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B598C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwm (Upgraded)" */; + buildConfigurationList = DB166E4F16A1D69000A1396C /* Build configuration list for PBXNativeTarget "testscale" */; buildPhases = ( - BEC567D10761D90500A33029 /* Headers */, - BEC567D20761D90500A33029 /* Resources */, - BEC567D40761D90500A33029 /* Sources */, - BEC567D60761D90500A33029 /* Frameworks */, - 00794F0F09D23923003FC8A1 /* CopyFiles */, + DB166E3E16A1D69000A1396C /* Sources */, + DB166E4016A1D69000A1396C /* Frameworks */, + DB166E4C16A1D69000A1396C /* CopyFiles */, ); buildRules = ( ); dependencies = ( - BEC5685D0761D90600A33029 /* PBXTargetDependency */, ); - name = "testwm (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = testwm; - productReference = BEC567DB0761D90600A33029 /* testwm.app */; - productType = "com.apple.product-type.application"; + name = testscale; + productName = testalpha; + productReference = DB166E5216A1D69000A1396C /* testscale */; + productType = "com.apple.product-type.tool"; }; - BEC567DD0761D90600A33029 /* threadwin (Upgraded) */ = { + DB166E5716A1D6F300A1396C /* testshader */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B599008BDB826006539E9 /* Build configuration list for PBXNativeTarget "threadwin (Upgraded)" */; + buildConfigurationList = DB166E6516A1D6F300A1396C /* Build configuration list for PBXNativeTarget "testshader" */; buildPhases = ( - BEC567DF0761D90600A33029 /* Headers */, - BEC567E00761D90600A33029 /* Resources */, - BEC567E20761D90600A33029 /* Sources */, - BEC567E40761D90600A33029 /* Frameworks */, + DB166E5816A1D6F300A1396C /* Sources */, + DB166E5A16A1D6F300A1396C /* Frameworks */, ); buildRules = ( ); dependencies = ( - BEC5685F0761D90600A33029 /* PBXTargetDependency */, ); - name = "threadwin (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = threadwin; - productReference = BEC567E80761D90600A33029 /* threadwin.app */; - productType = "com.apple.product-type.application"; + name = testshader; + productName = testsem; + productReference = DB166E6816A1D6F300A1396C /* testshader */; + productType = "com.apple.product-type.tool"; }; - BEC567EA0761D90600A33029 /* torturethread (Upgraded) */ = { + DB166E6D16A1D78400A1396C /* testspriteminimal */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread (Upgraded)" */; + buildConfigurationList = DB166E7B16A1D78400A1396C /* Build configuration list for PBXNativeTarget "testspriteminimal" */; buildPhases = ( - BEC567EC0761D90600A33029 /* Headers */, - BEC567ED0761D90600A33029 /* Resources */, - BEC567EF0761D90600A33029 /* Sources */, - BEC567F10761D90600A33029 /* Frameworks */, + DB166E6E16A1D78400A1396C /* Sources */, + DB166E7016A1D78400A1396C /* Frameworks */, + DB166E9B16A1D7FC00A1396C /* CopyFiles */, ); buildRules = ( ); dependencies = ( - BEC568610761D90600A33029 /* PBXTargetDependency */, ); - name = "torturethread (Upgraded)"; - productInstallPath = "$(USER_APPS_DIR)"; - productName = tortureThread; - productReference = BEC567F50761D90600A33029 /* torturethread.app */; - productType = "com.apple.product-type.application"; + name = testspriteminimal; + productName = testsem; + productReference = DB166E7E16A1D78400A1396C /* testspriteminimal */; + productType = "com.apple.product-type.tool"; }; - BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */ = { + DB166E8016A1D78C00A1396C /* teststreaming */ = { isa = PBXNativeTarget; - buildConfigurationList = 001B593408BDB826006539E9 /* Build configuration list for PBXNativeTarget "libsdlmain.a (Upgraded)" */; + buildConfigurationList = DB166E8E16A1D78C00A1396C /* Build configuration list for PBXNativeTarget "teststreaming" */; buildPhases = ( - BEC567F80761D90600A33029 /* Headers */, - BEC567FB0761D90600A33029 /* Sources */, - BEC567FD0761D90600A33029 /* Frameworks */, - BEC567FE0761D90600A33029 /* Rez */, + DB166E8116A1D78C00A1396C /* Sources */, + DB166E8316A1D78C00A1396C /* Frameworks */, + DB166E9916A1D7EE00A1396C /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); - name = "libsdlmain.a (Upgraded)"; - productInstallPath = /usr/local/lib; - productName = libsdlmain.a; - productReference = BEC567FF0761D90600A33029 /* libsdlmain.a */; - productType = "com.apple.product-type.library.static"; + name = teststreaming; + productName = testsem; + productReference = DB166E9116A1D78C00A1396C /* teststreaming */; + productType = "com.apple.product-type.tool"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; buildConfigurationList = 001B5A0C08BDB826006539E9 /* Build configuration list for PBXProject "SDLTest" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( @@ -2231,6 +2711,7 @@ Japanese, French, German, + en, ); mainGroup = 08FB7794FE84155DC02AAC07 /* SDLTest */; projectDirPath = ""; @@ -2243,64 +2724,67 @@ projectRoot = ""; targets = ( BEC566920761D90300A33029 /* All */, - BEC566AB0761D90300A33029 /* checkkeys (Upgraded) */, - BEC566B80761D90300A33029 /* graywin (Upgraded) */, - BEC566C50761D90300A33029 /* loopwave (Upgraded) */, - BEC566D30761D90300A33029 /* testalpha (Upgraded) */, - BEC566E10761D90300A33029 /* testbitmap (Upgraded) */, - 002F338609CA16BF00EBEB88 /* testblitspeed */, - BEC566EE0761D90300A33029 /* testcdrom (Upgraded) */, - 002F33CA09CA19A600EBEB88 /* testdyngl */, - BEC566FB0761D90300A33029 /* testerror (Upgraded) */, + DB166D7E16A1D12400A1396C /* SDL_test */, + BEC566AB0761D90300A33029 /* checkkeys */, + BEC566C50761D90300A33029 /* loopwave */, + 0017957410741F7900F5D044 /* testatomic */, + 00179595107421BF00F5D044 /* testaudioinfo */, + 00179756107431B300F5D044 /* testdraw2 */, + BEC566FB0761D90300A33029 /* testerror */, 002F340109CA1BFF00EBEB88 /* testfile */, - BEC567080761D90400A33029 /* testgamma (Upgraded) */, - BEC567160761D90400A33029 /* testgl (Upgraded) */, + BBFC08B7164C6862003E6A99 /* testgamecontroller */, + DB166DAD16A1D2F600A1396C /* testgesture */, + 0017970910742F3200F5D044 /* testgl2 */, + 00179730107430D600F5D044 /* testhaptic */, 002F342009CA1F0300EBEB88 /* testiconv */, - BEC567300761D90400A33029 /* testjoystick (Upgraded) */, - BEC5673D0761D90400A33029 /* testkeys (Upgraded) */, - BEC5674A0761D90400A33029 /* testlock (Upgraded) */, - BEC567570761D90400A33029 /* testoverlay (Upgraded) */, + 00179776107432AE00F5D044 /* testime */, + 001797961074334C00F5D044 /* testintersections */, + BEC567300761D90400A33029 /* testjoystick */, + BEC5673D0761D90400A33029 /* testkeys */, + 001797B8107433C600F5D044 /* testloadso */, + BEC5674A0761D90400A33029 /* testlock */, + DB166DC416A1D36A00A1396C /* testmessage */, + 001797FA1074355200F5D044 /* testmultiaudio */, + 001798781074392D00F5D044 /* testnative */, 002F343C09CA1FB300EBEB88 /* testoverlay2 */, - BEC567640761D90400A33029 /* testpalette (Upgraded) */, 002F345909CA204F00EBEB88 /* testplatform */, - BEC567720761D90500A33029 /* testsem (Upgraded) */, - BEC5677F0761D90500A33029 /* testsprite (Upgraded) */, - BEC567230761D90400A33029 /* testthread (Upgraded) */, - BEC5678D0761D90500A33029 /* testtimer (Upgraded) */, - BEC567A70761D90500A33029 /* testversion (Upgraded) */, - BEC567B40761D90500A33029 /* testvidinfo (Upgraded) */, - BEC567C10761D90500A33029 /* testwin (Upgraded) */, - BEC567CF0761D90500A33029 /* testwm (Upgraded) */, - BEC567DD0761D90600A33029 /* threadwin (Upgraded) */, - BEC567EA0761D90600A33029 /* torturethread (Upgraded) */, - BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */, - 002F337009CA14F900EBEB88 /* test */, + 0017989D107439DF00F5D044 /* testpower */, + DB166DDC16A1D50C00A1396C /* testrelative */, + DB166DF316A1D57C00A1396C /* testrendercopyex */, + DB166E0A16A1D5AD00A1396C /* testrendertarget */, + 001798DA10743BEC00F5D044 /* testresample */, + DB166E2716A1D64D00A1396C /* testrumble */, + DB166E3D16A1D69000A1396C /* testscale */, + BEC567720761D90500A33029 /* testsem */, + DB166E5716A1D6F300A1396C /* testshader */, + 4537749112091504002F0F45 /* testshape */, + 001798FE10743F1000F5D044 /* testsprite2 */, + DB166E6D16A1D78400A1396C /* testspriteminimal */, + DB166E8016A1D78C00A1396C /* teststreaming */, + BEC567230761D90400A33029 /* testthread */, + BEC5678D0761D90500A33029 /* testtimer */, + BEC567A70761D90500A33029 /* testversion */, + 0017992010743FB700F5D044 /* testwm2 */, + BEC567EA0761D90600A33029 /* torturethread */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 003FA643093FFD41000C53B3 /* SDL.framework */ = { + 003FA643093FFD41000C53B3 /* SDL2.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; - path = SDL.framework; + path = SDL2.framework; remoteRef = 003FA642093FFD41000C53B3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 003FA645093FFD41000C53B3 /* libSDL.a */ = { + 003FA645093FFD41000C53B3 /* libSDL2.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; - path = libSDL.a; + path = libSDL2.a; remoteRef = 003FA644093FFD41000C53B3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 003FA647093FFD41000C53B3 /* libSDLmain.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libSDLmain.a; - remoteRef = 003FA646093FFD41000C53B3 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 003FA649093FFD41000C53B3 /* Standard DMG */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.executable"; @@ -2308,296 +2792,127 @@ remoteRef = 003FA648093FFD41000C53B3 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 003FA64B093FFD41000C53B3 /* Developer Extras Package */ = { + DB1D40D717B3F30D00D74CFC /* libSDL2.dylib */ = { isa = PBXReferenceProxy; - fileType = "compiled.mach-o.executable"; - path = "Developer Extras Package"; - remoteRef = 003FA64A093FFD41000C53B3 /* PBXContainerItemProxy */; + fileType = "compiled.mach-o.dylib"; + path = libSDL2.dylib; + remoteRef = DB1D40D617B3F30D00D74CFC /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ -/* Begin PBXResourcesBuildPhase section */ - 002F337409CA14F900EBEB88 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F337509CA14F900EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F338A09CA16BF00EBEB88 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F338B09CA16BF00EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F33CE09CA19A600EBEB88 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F33CF09CA19A600EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F340509CA1BFF00EBEB88 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F340609CA1BFF00EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F342409CA1F0300EBEB88 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F342509CA1F0300EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F344009CA1FB300EBEB88 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F344109CA1FB300EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 002F345D09CA204F00EBEB88 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F345E09CA204F00EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566AE0761D90300A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566AF0761D90300A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566BB0761D90300A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566BC0761D90300A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566C80761D90300A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566C90761D90300A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566D60761D90300A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566D70761D90300A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566E40761D90300A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566E50761D90300A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566F10761D90300A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566F20761D90300A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566FE0761D90300A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566FF0761D90300A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC5670B0761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC5670C0761D90400A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567190761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC5671A0761D90400A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567260761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC567270761D90400A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567330761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC567340761D90400A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567400761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC567410761D90400A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC5674D0761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC5674E0761D90400A33029 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC5675A0761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567670761D90400A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; +/* Begin PBXSourcesBuildPhase section */ + 0017957910741F7900F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567680761D90400A33029 /* SDLMain.nib in Resources */, + 001795901074216E00F5D044 /* testatomic.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567750761D90500A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 0017959A107421BF00F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567760761D90500A33029 /* SDLMain.nib in Resources */, + 001795B11074222D00F5D044 /* testaudioinfo.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567820761D90500A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 0017970E10742F3200F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567830761D90500A33029 /* SDLMain.nib in Resources */, + 0017972810742FB900F5D044 /* testgl2.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567900761D90500A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 00179735107430D600F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567910761D90500A33029 /* SDLMain.nib in Resources */, + 0017974F1074315700F5D044 /* testhaptic.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567AA0761D90500A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 0017975B107431B300F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567AB0761D90500A33029 /* SDLMain.nib in Resources */, + 001797721074320D00F5D044 /* testdraw2.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567B70761D90500A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 0017977B107432AE00F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567B80761D90500A33029 /* SDLMain.nib in Resources */, + 00179792107432FA00F5D044 /* testime.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567C40761D90500A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 0017979B1074334C00F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567C50761D90500A33029 /* SDLMain.nib in Resources */, + 001797B41074339C00F5D044 /* testintersections.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567D20761D90500A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 001797BD107433C600F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567D30761D90500A33029 /* SDLMain.nib in Resources */, + 001797D41074343E00F5D044 /* testloadso.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567E00761D90600A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 001797FF1074355200F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567E10761D90600A33029 /* SDLMain.nib in Resources */, + 001798161074359B00F5D044 /* testmultiaudio.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567ED0761D90600A33029 /* Resources */ = { - isa = PBXResourcesBuildPhase; + 0017987E1074392D00F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567EE0761D90600A33029 /* SDLMain.nib in Resources */, + 0017987F1074392D00F5D044 /* testnative.c in Sources */, + 001798801074392D00F5D044 /* testnativecocoa.m in Sources */, + 001798811074392D00F5D044 /* testnativex11.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXRezBuildPhase section */ - BEC567FE0761D90600A33029 /* Rez */ = { - isa = PBXRezBuildPhase; + 001798A2107439DF00F5D044 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 001798BA10743A4900F5D044 /* testpower.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXRezBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 002F337609CA14F900EBEB88 /* Sources */ = { + 001798DF10743BEC00F5D044 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 001798FA10743E9200F5D044 /* testresample.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F338C09CA16BF00EBEB88 /* Sources */ = { + 0017990310743F1000F5D044 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 002F339B09CA17BC00EBEB88 /* testblitspeed.c in Sources */, + 0017991A10743F5300F5D044 /* testsprite2.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 002F33D009CA19A600EBEB88 /* Sources */ = { + 0017992510743FB700F5D044 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 002F33E309CA1A0B00EBEB88 /* testdyngl.c in Sources */, + 0017993C10743FEF00F5D044 /* testwm2.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2633,51 +2948,35 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566B00761D90300A33029 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566B10761D90300A33029 /* checkkeys.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566BD0761D90300A33029 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC566BE0761D90300A33029 /* graywin.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC566CA0761D90300A33029 /* Sources */ = { + 4537748F12091504002F0F45 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC566CB0761D90300A33029 /* loopwave.c in Sources */, + 453774A5120915E3002F0F45 /* testshape.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566D80761D90300A33029 /* Sources */ = { + BBFC08BC164C6862003E6A99 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC566D90761D90300A33029 /* testalpha.c in Sources */, + BBFC08D0164C6876003E6A99 /* testgamecontroller.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566E60761D90300A33029 /* Sources */ = { + BEC566B00761D90300A33029 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC566E70761D90300A33029 /* testbitmap.c in Sources */, + BEC566B10761D90300A33029 /* checkkeys.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC566F30761D90300A33029 /* Sources */ = { + BEC566CA0761D90300A33029 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC566F40761D90300A33029 /* testcdrom.c in Sources */, + BEC566CB0761D90300A33029 /* loopwave.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2689,27 +2988,11 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - BEC5670D0761D90400A33029 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC5670E0761D90400A33029 /* testgamma.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC5671B0761D90400A33029 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC5671C0761D90400A33029 /* testgl.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; BEC567280761D90400A33029 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567290761D90400A33029 /* testhread.c in Sources */, + BEC567290761D90400A33029 /* testthread.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2737,22 +3020,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - BEC5675C0761D90400A33029 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC5675D0761D90400A33029 /* testoverlay.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BEC567690761D90400A33029 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BEC5676A0761D90400A33029 /* testpalette.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; BEC567770761D90500A33029 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2761,1752 +3028,1377 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567840761D90500A33029 /* Sources */ = { + BEC567920761D90500A33029 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567850761D90500A33029 /* testsprite.c in Sources */, + BEC567930761D90500A33029 /* testtimer.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567920761D90500A33029 /* Sources */ = { + BEC567AC0761D90500A33029 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567930761D90500A33029 /* testtimer.c in Sources */, + BEC567AD0761D90500A33029 /* testver.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567AC0761D90500A33029 /* Sources */ = { + BEC567EF0761D90600A33029 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567AD0761D90500A33029 /* testver.c in Sources */, + BEC567F00761D90600A33029 /* torturethread.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567B90761D90500A33029 /* Sources */ = { + DB166D7B16A1D12400A1396C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567BA0761D90500A33029 /* testvidinfo.c in Sources */, + DB166D9316A1D1A500A1396C /* SDL_test_assert.c in Sources */, + DB166D9416A1D1A500A1396C /* SDL_test_common.c in Sources */, + DB166D9516A1D1A500A1396C /* SDL_test_compare.c in Sources */, + DB166D9616A1D1A500A1396C /* SDL_test_crc32.c in Sources */, + DB166D9716A1D1A500A1396C /* SDL_test_font.c in Sources */, + DB166D9816A1D1A500A1396C /* SDL_test_fuzzer.c in Sources */, + DB166D9916A1D1A500A1396C /* SDL_test_harness.c in Sources */, + DB166D9A16A1D1A500A1396C /* SDL_test_imageBlit.c in Sources */, + DB166D9B16A1D1A500A1396C /* SDL_test_imageBlitBlend.c in Sources */, + DB166D9C16A1D1A500A1396C /* SDL_test_imageFace.c in Sources */, + DB166D9D16A1D1A500A1396C /* SDL_test_imagePrimitives.c in Sources */, + DB166D9E16A1D1A500A1396C /* SDL_test_imagePrimitivesBlend.c in Sources */, + DB166D9F16A1D1A500A1396C /* SDL_test_log.c in Sources */, + DB166DA016A1D1A500A1396C /* SDL_test_md5.c in Sources */, + DB166DA116A1D1A500A1396C /* SDL_test_random.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567C60761D90500A33029 /* Sources */ = { + DB166DAE16A1D2F600A1396C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567C70761D90500A33029 /* testwin.c in Sources */, + DB166DC116A1D31E00A1396C /* testgesture.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567D40761D90500A33029 /* Sources */ = { + DB166DC516A1D36A00A1396C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567D50761D90500A33029 /* testwm.c in Sources */, + DB166DD716A1D37800A1396C /* testmessage.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567E20761D90600A33029 /* Sources */ = { + DB166DDD16A1D50C00A1396C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567E30761D90600A33029 /* threadwin.c in Sources */, + DB166DF016A1D52500A1396C /* testrelative.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567EF0761D90600A33029 /* Sources */ = { + DB166DF416A1D57C00A1396C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567F00761D90600A33029 /* torturethread.c in Sources */, + DB166E0716A1D59400A1396C /* testrendercopyex.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - BEC567FB0761D90600A33029 /* Sources */ = { + DB166E0B16A1D5AD00A1396C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BEC567FC0761D90600A33029 /* SDLMain.m in Sources */, + DB166E1E16A1D5C300A1396C /* testrendertarget.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 002F337109CA14F900EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = 002F337209CA14F900EBEB88 /* PBXContainerItemProxy */; - }; - 002F338709CA16BF00EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = 002F338809CA16BF00EBEB88 /* PBXContainerItemProxy */; - }; - 002F33CB09CA19A600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = 002F33CC09CA19A600EBEB88 /* PBXContainerItemProxy */; - }; - 002F340209CA1BFF00EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = 002F340309CA1BFF00EBEB88 /* PBXContainerItemProxy */; - }; - 002F342109CA1F0300EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = 002F342209CA1F0300EBEB88 /* PBXContainerItemProxy */; - }; - 002F343D09CA1FB300EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = 002F343E09CA1FB300EBEB88 /* PBXContainerItemProxy */; - }; - 002F345A09CA204F00EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = 002F345B09CA204F00EBEB88 /* PBXContainerItemProxy */; - }; - 002F347909CA215600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 002F338609CA16BF00EBEB88 /* testblitspeed */; - targetProxy = 002F347809CA215600EBEB88 /* PBXContainerItemProxy */; - }; - 002F347B09CA215600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 002F33CA09CA19A600EBEB88 /* testdyngl */; - targetProxy = 002F347A09CA215600EBEB88 /* PBXContainerItemProxy */; - }; - 002F347D09CA215600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 002F340109CA1BFF00EBEB88 /* testfile */; - targetProxy = 002F347C09CA215600EBEB88 /* PBXContainerItemProxy */; - }; - 002F347F09CA215600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 002F342009CA1F0300EBEB88 /* testiconv */; - targetProxy = 002F347E09CA215600EBEB88 /* PBXContainerItemProxy */; - }; - 002F348109CA215600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC567570761D90400A33029 /* testoverlay (Upgraded) */; - targetProxy = 002F348009CA215600EBEB88 /* PBXContainerItemProxy */; - }; - 002F348309CA215600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 002F343C09CA1FB300EBEB88 /* testoverlay2 */; - targetProxy = 002F348209CA215600EBEB88 /* PBXContainerItemProxy */; - }; - 002F348509CA215600EBEB88 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 002F345909CA204F00EBEB88 /* testplatform */; - targetProxy = 002F348409CA215600EBEB88 /* PBXContainerItemProxy */; - }; - 003FA6A809400236000C53B3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Framework; - targetProxy = 003FA6A709400236000C53B3 /* PBXContainerItemProxy */; - }; - BEC568010761D90600A33029 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC566AB0761D90300A33029 /* checkkeys (Upgraded) */; - targetProxy = BEC568000761D90600A33029 /* PBXContainerItemProxy */; - }; - BEC568030761D90600A33029 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC566B80761D90300A33029 /* graywin (Upgraded) */; - targetProxy = BEC568020761D90600A33029 /* PBXContainerItemProxy */; + DB166E2816A1D64D00A1396C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E3C16A1D66500A1396C /* testrumble.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; }; - BEC568050761D90600A33029 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC566C50761D90300A33029 /* loopwave (Upgraded) */; - targetProxy = BEC568040761D90600A33029 /* PBXContainerItemProxy */; + DB166E3E16A1D69000A1396C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E5416A1D6A300A1396C /* testscale.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; }; - BEC568070761D90600A33029 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC566D30761D90300A33029 /* testalpha (Upgraded) */; - targetProxy = BEC568060761D90600A33029 /* PBXContainerItemProxy */; + DB166E5816A1D6F300A1396C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E6A16A1D70C00A1396C /* testshader.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; }; - BEC568090761D90600A33029 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC566E10761D90300A33029 /* testbitmap (Upgraded) */; - targetProxy = BEC568080761D90600A33029 /* PBXContainerItemProxy */; + DB166E6E16A1D78400A1396C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E9316A1D7BC00A1396C /* testspriteminimal.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; }; - BEC5680B0761D90600A33029 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = BEC566EE0761D90300A33029 /* testcdrom (Upgraded) */; - targetProxy = BEC5680A0761D90600A33029 /* PBXContainerItemProxy */; + DB166E8116A1D78C00A1396C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DB166E9416A1D7C700A1396C /* teststreaming.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; }; - BEC5680D0761D90600A33029 /* PBXTargetDependency */ = { +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 001799481074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC566FB0761D90300A33029 /* testerror (Upgraded) */; - targetProxy = BEC5680C0761D90600A33029 /* PBXContainerItemProxy */; + target = BEC566AB0761D90300A33029 /* checkkeys */; + targetProxy = 001799471074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5680F0761D90600A33029 /* PBXTargetDependency */ = { + 0017994C1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567080761D90400A33029 /* testgamma (Upgraded) */; - targetProxy = BEC5680E0761D90600A33029 /* PBXContainerItemProxy */; + target = BEC566C50761D90300A33029 /* loopwave */; + targetProxy = 0017994B1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568110761D90600A33029 /* PBXTargetDependency */ = { + 001799501074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567160761D90400A33029 /* testgl (Upgraded) */; - targetProxy = BEC568100761D90600A33029 /* PBXContainerItemProxy */; + target = 0017957410741F7900F5D044 /* testatomic */; + targetProxy = 0017994F1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568130761D90600A33029 /* PBXTargetDependency */ = { + 001799521074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567230761D90400A33029 /* testthread (Upgraded) */; - targetProxy = BEC568120761D90600A33029 /* PBXContainerItemProxy */; + target = 00179595107421BF00F5D044 /* testaudioinfo */; + targetProxy = 001799511074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568150761D90600A33029 /* PBXTargetDependency */ = { + 0017995A1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567300761D90400A33029 /* testjoystick (Upgraded) */; - targetProxy = BEC568140761D90600A33029 /* PBXContainerItemProxy */; + target = 00179756107431B300F5D044 /* testdraw2 */; + targetProxy = 001799591074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568170761D90600A33029 /* PBXTargetDependency */ = { + 0017995E1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC5673D0761D90400A33029 /* testkeys (Upgraded) */; - targetProxy = BEC568160761D90600A33029 /* PBXContainerItemProxy */; + target = BEC566FB0761D90300A33029 /* testerror */; + targetProxy = 0017995D1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568190761D90600A33029 /* PBXTargetDependency */ = { + 001799601074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC5674A0761D90400A33029 /* testlock (Upgraded) */; - targetProxy = BEC568180761D90600A33029 /* PBXContainerItemProxy */; + target = 002F340109CA1BFF00EBEB88 /* testfile */; + targetProxy = 0017995F1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5681B0761D90600A33029 /* PBXTargetDependency */ = { + 001799661074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567640761D90400A33029 /* testpalette (Upgraded) */; - targetProxy = BEC5681A0761D90600A33029 /* PBXContainerItemProxy */; + target = 0017970910742F3200F5D044 /* testgl2 */; + targetProxy = 001799651074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5681D0761D90600A33029 /* PBXTargetDependency */ = { + 001799681074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567720761D90500A33029 /* testsem (Upgraded) */; - targetProxy = BEC5681C0761D90600A33029 /* PBXContainerItemProxy */; + target = 00179730107430D600F5D044 /* testhaptic */; + targetProxy = 001799671074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5681F0761D90600A33029 /* PBXTargetDependency */ = { + 0017996A1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC5677F0761D90500A33029 /* testsprite (Upgraded) */; - targetProxy = BEC5681E0761D90600A33029 /* PBXContainerItemProxy */; + target = BEC567230761D90400A33029 /* testthread */; + targetProxy = 001799691074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568210761D90600A33029 /* PBXTargetDependency */ = { + 0017996C1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC5678D0761D90500A33029 /* testtimer (Upgraded) */; - targetProxy = BEC568200761D90600A33029 /* PBXContainerItemProxy */; + target = 002F342009CA1F0300EBEB88 /* testiconv */; + targetProxy = 0017996B1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568250761D90600A33029 /* PBXTargetDependency */ = { + 0017996E1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567A70761D90500A33029 /* testversion (Upgraded) */; - targetProxy = BEC568240761D90600A33029 /* PBXContainerItemProxy */; + target = 00179776107432AE00F5D044 /* testime */; + targetProxy = 0017996D1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568270761D90600A33029 /* PBXTargetDependency */ = { + 001799701074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567B40761D90500A33029 /* testvidinfo (Upgraded) */; - targetProxy = BEC568260761D90600A33029 /* PBXContainerItemProxy */; + target = 001797961074334C00F5D044 /* testintersections */; + targetProxy = 0017996F1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568290761D90600A33029 /* PBXTargetDependency */ = { + 001799721074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567C10761D90500A33029 /* testwin (Upgraded) */; - targetProxy = BEC568280761D90600A33029 /* PBXContainerItemProxy */; + target = BEC567300761D90400A33029 /* testjoystick */; + targetProxy = 001799711074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5682B0761D90600A33029 /* PBXTargetDependency */ = { + 001799741074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567CF0761D90500A33029 /* testwm (Upgraded) */; - targetProxy = BEC5682A0761D90600A33029 /* PBXContainerItemProxy */; + target = BEC5673D0761D90400A33029 /* testkeys */; + targetProxy = 001799731074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5682D0761D90600A33029 /* PBXTargetDependency */ = { + 001799761074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567DD0761D90600A33029 /* threadwin (Upgraded) */; - targetProxy = BEC5682C0761D90600A33029 /* PBXContainerItemProxy */; + target = 001797B8107433C600F5D044 /* testloadso */; + targetProxy = 001799751074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5682F0761D90600A33029 /* PBXTargetDependency */ = { + 001799781074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567EA0761D90600A33029 /* torturethread (Upgraded) */; - targetProxy = BEC5682E0761D90600A33029 /* PBXContainerItemProxy */; + target = BEC5674A0761D90400A33029 /* testlock */; + targetProxy = 001799771074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568310761D90600A33029 /* PBXTargetDependency */ = { + 0017997C1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568300761D90600A33029 /* PBXContainerItemProxy */; + target = 001797FA1074355200F5D044 /* testmultiaudio */; + targetProxy = 0017997B1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568330761D90600A33029 /* PBXTargetDependency */ = { + 001799801074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568320761D90600A33029 /* PBXContainerItemProxy */; + target = 001798781074392D00F5D044 /* testnative */; + targetProxy = 0017997F1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568350761D90600A33029 /* PBXTargetDependency */ = { + 001799841074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568340761D90600A33029 /* PBXContainerItemProxy */; + target = 002F343C09CA1FB300EBEB88 /* testoverlay2 */; + targetProxy = 001799831074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568370761D90600A33029 /* PBXTargetDependency */ = { + 001799881074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568360761D90600A33029 /* PBXContainerItemProxy */; + target = 002F345909CA204F00EBEB88 /* testplatform */; + targetProxy = 001799871074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568390761D90600A33029 /* PBXTargetDependency */ = { + 0017998A1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568380761D90600A33029 /* PBXContainerItemProxy */; + target = 0017989D107439DF00F5D044 /* testpower */; + targetProxy = 001799891074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5683B0761D90600A33029 /* PBXTargetDependency */ = { + 0017998C1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5683A0761D90600A33029 /* PBXContainerItemProxy */; + target = 001798DA10743BEC00F5D044 /* testresample */; + targetProxy = 0017998B1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5683D0761D90600A33029 /* PBXTargetDependency */ = { + 0017998E1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5683C0761D90600A33029 /* PBXContainerItemProxy */; + target = BEC567720761D90500A33029 /* testsem */; + targetProxy = 0017998D1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC5683F0761D90600A33029 /* PBXTargetDependency */ = { + 001799921074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5683E0761D90600A33029 /* PBXContainerItemProxy */; + target = 001798FE10743F1000F5D044 /* testsprite2 */; + targetProxy = 001799911074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568410761D90600A33029 /* PBXTargetDependency */ = { + 001799941074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568400761D90600A33029 /* PBXContainerItemProxy */; + target = BEC5678D0761D90500A33029 /* testtimer */; + targetProxy = 001799931074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568430761D90600A33029 /* PBXTargetDependency */ = { + 001799961074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568420761D90600A33029 /* PBXContainerItemProxy */; + target = BEC567A70761D90500A33029 /* testversion */; + targetProxy = 001799951074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568450761D90600A33029 /* PBXTargetDependency */ = { + 0017999E1074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568440761D90600A33029 /* PBXContainerItemProxy */; + target = 0017992010743FB700F5D044 /* testwm2 */; + targetProxy = 0017999D1074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568470761D90600A33029 /* PBXTargetDependency */ = { + 001799A21074403E00F5D044 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568460761D90600A33029 /* PBXContainerItemProxy */; + target = BEC567EA0761D90600A33029 /* torturethread */; + targetProxy = 001799A11074403E00F5D044 /* PBXContainerItemProxy */; }; - BEC568490761D90600A33029 /* PBXTargetDependency */ = { + DB166D6E16A1CEAA00A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568480761D90600A33029 /* PBXContainerItemProxy */; + target = BBFC08B7164C6862003E6A99 /* testgamecontroller */; + targetProxy = DB166D6D16A1CEAA00A1396C /* PBXContainerItemProxy */; }; - BEC5684B0761D90600A33029 /* PBXTargetDependency */ = { + DB166D7016A1CEAF00A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5684A0761D90600A33029 /* PBXContainerItemProxy */; + target = 4537749112091504002F0F45 /* testshape */; + targetProxy = DB166D6F16A1CEAF00A1396C /* PBXContainerItemProxy */; }; - BEC5684D0761D90600A33029 /* PBXTargetDependency */ = { + DB166DC316A1D32C00A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5684C0761D90600A33029 /* PBXContainerItemProxy */; + target = DB166DAD16A1D2F600A1396C /* testgesture */; + targetProxy = DB166DC216A1D32C00A1396C /* PBXContainerItemProxy */; }; - BEC5684F0761D90600A33029 /* PBXTargetDependency */ = { + DB166DD916A1D38900A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5684E0761D90600A33029 /* PBXContainerItemProxy */; + target = DB166DC416A1D36A00A1396C /* testmessage */; + targetProxy = DB166DD816A1D38900A1396C /* PBXContainerItemProxy */; }; - BEC568510761D90600A33029 /* PBXTargetDependency */ = { + DB166DF216A1D53700A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568500761D90600A33029 /* PBXContainerItemProxy */; + target = DB166DDC16A1D50C00A1396C /* testrelative */; + targetProxy = DB166DF116A1D53700A1396C /* PBXContainerItemProxy */; }; - BEC568530761D90600A33029 /* PBXTargetDependency */ = { + DB166E0916A1D5A400A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568520761D90600A33029 /* PBXContainerItemProxy */; + target = DB166DF316A1D57C00A1396C /* testrendercopyex */; + targetProxy = DB166E0816A1D5A400A1396C /* PBXContainerItemProxy */; }; - BEC568570761D90600A33029 /* PBXTargetDependency */ = { + DB166E2016A1D5D000A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568560761D90600A33029 /* PBXContainerItemProxy */; + target = DB166E0A16A1D5AD00A1396C /* testrendertarget */; + targetProxy = DB166E1F16A1D5D000A1396C /* PBXContainerItemProxy */; }; - BEC568590761D90600A33029 /* PBXTargetDependency */ = { + DB166E3B16A1D65A00A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568580761D90600A33029 /* PBXContainerItemProxy */; + target = DB166E2716A1D64D00A1396C /* testrumble */; + targetProxy = DB166E3A16A1D65A00A1396C /* PBXContainerItemProxy */; }; - BEC5685B0761D90600A33029 /* PBXTargetDependency */ = { + DB166E5616A1D6B800A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5685A0761D90600A33029 /* PBXContainerItemProxy */; + target = DB166E3D16A1D69000A1396C /* testscale */; + targetProxy = DB166E5516A1D6B800A1396C /* PBXContainerItemProxy */; }; - BEC5685D0761D90600A33029 /* PBXTargetDependency */ = { + DB166E6C16A1D72000A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5685C0761D90600A33029 /* PBXContainerItemProxy */; + target = DB166E5716A1D6F300A1396C /* testshader */; + targetProxy = DB166E6B16A1D72000A1396C /* PBXContainerItemProxy */; }; - BEC5685F0761D90600A33029 /* PBXTargetDependency */ = { + DB166E9616A1D7CD00A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC5685E0761D90600A33029 /* PBXContainerItemProxy */; + target = DB166E6D16A1D78400A1396C /* testspriteminimal */; + targetProxy = DB166E9516A1D7CD00A1396C /* PBXContainerItemProxy */; }; - BEC568610761D90600A33029 /* PBXTargetDependency */ = { + DB166E9816A1D7CF00A1396C /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */; - targetProxy = BEC568600761D90600A33029 /* PBXContainerItemProxy */; + target = DB166E8016A1D78C00A1396C /* teststreaming */; + targetProxy = DB166E9716A1D7CF00A1396C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 001B593508BDB826006539E9 /* Deployment */ = { + 0017958910741F7900F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREFIX_HEADER = libsdlmain_prefix.h; - PRODUCT_NAME = sdlmain; + PRODUCT_NAME = testatomic; }; - name = Deployment; + name = Debug; }; - 001B593608BDB826006539E9 /* Development */ = { + 0017958A10741F7900F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREFIX_HEADER = libsdlmain_prefix.h; - PRODUCT_NAME = sdlmain; + PRODUCT_NAME = testatomic; }; - name = Development; + name = Release; }; - 001B593708BDB826006539E9 /* Default */ = { + 001795AA107421BF00F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREFIX_HEADER = libsdlmain_prefix.h; - PRODUCT_NAME = sdlmain; + PRODUCT_NAME = testaudioinfo; }; - name = Default; + name = Debug; }; - 001B593908BDB826006539E9 /* Deployment */ = { + 001795AB107421BF00F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-checkkeys__Upgraded_.plist"; - PRODUCT_NAME = checkkeys; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testaudioinfo; }; - name = Deployment; + name = Release; }; - 001B593A08BDB826006539E9 /* Development */ = { + 0017971E10742F3200F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-checkkeys__Upgraded_.plist"; - PRODUCT_NAME = checkkeys; - WRAPPER_EXTENSION = app; + GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL; + PRODUCT_NAME = testgl2; }; - name = Development; + name = Debug; }; - 001B593B08BDB826006539E9 /* Default */ = { + 0017971F10742F3200F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-checkkeys__Upgraded_.plist"; - PRODUCT_NAME = checkkeys; - WRAPPER_EXTENSION = app; + GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL; + PRODUCT_NAME = testgl2; }; - name = Default; + name = Release; }; - 001B593D08BDB826006539E9 /* Deployment */ = { + 00179745107430D600F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-graywin__Upgraded_.plist"; - PRODUCT_NAME = graywin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testhaptic; }; - name = Deployment; + name = Debug; }; - 001B593E08BDB826006539E9 /* Development */ = { + 00179746107430D600F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-graywin__Upgraded_.plist"; - PRODUCT_NAME = graywin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testhaptic; }; - name = Development; + name = Release; }; - 001B593F08BDB826006539E9 /* Default */ = { + 0017976B107431B300F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-graywin__Upgraded_.plist"; - PRODUCT_NAME = graywin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testdraw2; }; - name = Default; + name = Debug; }; - 001B594108BDB826006539E9 /* Deployment */ = { + 0017976C107431B300F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-loopwave__Upgraded_.plist"; - PRODUCT_NAME = loopwave; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testdraw2; }; - name = Deployment; + name = Release; }; - 001B594208BDB826006539E9 /* Development */ = { + 0017978B107432AE00F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-loopwave__Upgraded_.plist"; - PRODUCT_NAME = loopwave; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testime; }; - name = Development; + name = Debug; }; - 001B594308BDB826006539E9 /* Default */ = { + 0017978C107432AE00F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-loopwave__Upgraded_.plist"; - PRODUCT_NAME = loopwave; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testime; }; - name = Default; + name = Release; }; - 001B594508BDB826006539E9 /* Deployment */ = { + 001797AB1074334C00F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testalpha__Upgraded_.plist"; - PRODUCT_NAME = testalpha; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testintersections; }; - name = Deployment; + name = Debug; }; - 001B594608BDB826006539E9 /* Development */ = { + 001797AC1074334C00F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testalpha__Upgraded_.plist"; - PRODUCT_NAME = testalpha; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testintersections; }; - name = Development; + name = Release; }; - 001B594708BDB826006539E9 /* Default */ = { + 001797CD107433C600F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testalpha__Upgraded_.plist"; - PRODUCT_NAME = testalpha; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testloadso; }; - name = Default; + name = Debug; }; - 001B594908BDB826006539E9 /* Deployment */ = { + 001797CE107433C600F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testbitmap__Upgraded_.plist"; - PRODUCT_NAME = testbitmap; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testloadso; }; - name = Deployment; + name = Release; }; - 001B594A08BDB826006539E9 /* Development */ = { + 0017980F1074355200F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testbitmap__Upgraded_.plist"; - PRODUCT_NAME = testbitmap; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testmultiaudio; }; - name = Development; + name = Debug; }; - 001B594B08BDB826006539E9 /* Default */ = { + 001798101074355200F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testbitmap__Upgraded_.plist"; - PRODUCT_NAME = testbitmap; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testmultiaudio; }; - name = Default; + name = Release; }; - 001B594D08BDB826006539E9 /* Deployment */ = { + 001798911074392D00F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testcdrom__Upgraded_.plist"; - PRODUCT_NAME = testcdrom; - WRAPPER_EXTENSION = app; + LIBRARY_SEARCH_PATHS = /usr/X11/lib; + OTHER_LDFLAGS = "-lX11"; + PRODUCT_NAME = testnative; }; - name = Deployment; + name = Debug; }; - 001B594E08BDB826006539E9 /* Development */ = { + 001798921074392D00F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testcdrom__Upgraded_.plist"; - PRODUCT_NAME = testcdrom; - WRAPPER_EXTENSION = app; + LIBRARY_SEARCH_PATHS = /usr/X11/lib; + OTHER_LDFLAGS = "-lX11"; + PRODUCT_NAME = testnative; }; - name = Development; + name = Release; }; - 001B594F08BDB826006539E9 /* Default */ = { + 001798B2107439DF00F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testcdrom__Upgraded_.plist"; - PRODUCT_NAME = testcdrom; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testpower; }; - name = Default; + name = Debug; }; - 001B595108BDB826006539E9 /* Deployment */ = { + 001798B3107439DF00F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testerror__Upgraded_.plist"; - PRODUCT_NAME = testerror; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testpower; }; - name = Deployment; + name = Release; }; - 001B595208BDB826006539E9 /* Development */ = { + 001798EF10743BEC00F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testerror__Upgraded_.plist"; - PRODUCT_NAME = testerror; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testresample; }; - name = Development; + name = Debug; }; - 001B595308BDB826006539E9 /* Default */ = { + 001798F010743BEC00F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testerror__Upgraded_.plist"; - PRODUCT_NAME = testerror; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testresample; }; - name = Default; + name = Release; }; - 001B595508BDB826006539E9 /* Deployment */ = { + 0017991310743F1000F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testgamma__Upgraded_.plist"; - PRODUCT_NAME = testgamma; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testsprite2; }; - name = Deployment; + name = Debug; }; - 001B595608BDB826006539E9 /* Development */ = { + 0017991410743F1000F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testgamma__Upgraded_.plist"; - PRODUCT_NAME = testgamma; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testsprite2; }; - name = Development; + name = Release; }; - 001B595708BDB826006539E9 /* Default */ = { + 0017993510743FB700F5D044 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testgamma__Upgraded_.plist"; - PRODUCT_NAME = testgamma; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testwm2; }; - name = Default; + name = Debug; }; - 001B595908BDB826006539E9 /* Deployment */ = { + 0017993610743FB700F5D044 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL; - INFOPLIST_FILE = "Info-testgl__Upgraded_.plist"; - PRODUCT_NAME = testgl; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testwm2; }; - name = Deployment; + name = Release; }; - 001B595A08BDB826006539E9 /* Development */ = { + 002A85B21073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL; - INFOPLIST_FILE = "Info-testgl__Upgraded_.plist"; - PRODUCT_NAME = testgl; - WRAPPER_EXTENSION = app; + FRAMEWORK_SEARCH_PATHS = ( + "$(SRCROOT)/../SDL/build/$(CONFIGURATION)", + "$(HOME)/Library/Frameworks", + /Library/Frameworks, + ); + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ../../include; }; - name = Development; + name = Debug; }; - 001B595B08BDB826006539E9 /* Default */ = { + 002A85B31073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL; - INFOPLIST_FILE = "Info-testgl__Upgraded_.plist"; - PRODUCT_NAME = testgl; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = "Build All"; }; - name = Default; + name = Debug; }; - 001B595D08BDB826006539E9 /* Deployment */ = { + 002A85B41073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testthread__Upgraded_.plist"; - PRODUCT_NAME = testthread; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = checkkeys; }; - name = Deployment; + name = Debug; }; - 001B595E08BDB826006539E9 /* Development */ = { + 002A85B61073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testthread__Upgraded_.plist"; - PRODUCT_NAME = testthread; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = loopwave; }; - name = Development; + name = Debug; }; - 001B595F08BDB826006539E9 /* Default */ = { + 002A85BC1073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testthread__Upgraded_.plist"; - PRODUCT_NAME = testthread; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testerror; }; - name = Default; + name = Debug; }; - 001B596108BDB826006539E9 /* Deployment */ = { + 002A85BD1073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testjoystick__Upgraded_.plist"; - PRODUCT_NAME = testjoystick; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testfile; }; - name = Deployment; + name = Debug; }; - 001B596208BDB826006539E9 /* Development */ = { + 002A85C01073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testjoystick__Upgraded_.plist"; - PRODUCT_NAME = testjoystick; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testiconv; }; - name = Development; + name = Debug; }; - 001B596308BDB826006539E9 /* Default */ = { + 002A85C11073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testjoystick__Upgraded_.plist"; PRODUCT_NAME = testjoystick; - WRAPPER_EXTENSION = app; - }; - name = Default; - }; - 001B596508BDB826006539E9 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testkeys__Upgraded_.plist"; - PRODUCT_NAME = testkeys; - WRAPPER_EXTENSION = app; - }; - name = Deployment; - }; - 001B596608BDB826006539E9 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testkeys__Upgraded_.plist"; - PRODUCT_NAME = testkeys; - WRAPPER_EXTENSION = app; }; - name = Development; + name = Debug; }; - 001B596708BDB826006539E9 /* Default */ = { + 002A85C21073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testkeys__Upgraded_.plist"; PRODUCT_NAME = testkeys; - WRAPPER_EXTENSION = app; - }; - name = Default; - }; - 001B596908BDB826006539E9 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testlock__Upgraded_.plist"; - PRODUCT_NAME = testlock; - WRAPPER_EXTENSION = app; - }; - name = Deployment; - }; - 001B596A08BDB826006539E9 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testlock__Upgraded_.plist"; - PRODUCT_NAME = testlock; - WRAPPER_EXTENSION = app; }; - name = Development; + name = Debug; }; - 001B596B08BDB826006539E9 /* Default */ = { + 002A85C31073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testlock__Upgraded_.plist"; PRODUCT_NAME = testlock; - WRAPPER_EXTENSION = app; }; - name = Default; + name = Debug; }; - 001B596D08BDB826006539E9 /* Deployment */ = { + 002A85C51073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testpalette__Upgraded_.plist"; - PRODUCT_NAME = testpalette; - WRAPPER_EXTENSION = app; - }; - name = Deployment; - }; - 001B596E08BDB826006539E9 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testpalette__Upgraded_.plist"; - PRODUCT_NAME = testpalette; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testoverlay2; }; - name = Development; + name = Debug; }; - 001B596F08BDB826006539E9 /* Default */ = { + 002A85C71073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testpalette__Upgraded_.plist"; - PRODUCT_NAME = testpalette; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testplatform; }; - name = Default; + name = Debug; }; - 001B597108BDB826006539E9 /* Deployment */ = { + 002A85C81073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testsem__Upgraded_.plist"; PRODUCT_NAME = testsem; - WRAPPER_EXTENSION = app; }; - name = Deployment; + name = Debug; }; - 001B597208BDB826006539E9 /* Development */ = { + 002A85CA1073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testsem__Upgraded_.plist"; - PRODUCT_NAME = testsem; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testthread; }; - name = Development; + name = Debug; }; - 001B597308BDB826006539E9 /* Default */ = { + 002A85CB1073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testsem__Upgraded_.plist"; - PRODUCT_NAME = testsem; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testtimer; }; - name = Default; + name = Debug; }; - 001B597508BDB826006539E9 /* Deployment */ = { + 002A85CC1073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testsprite__Upgraded_.plist"; - PRODUCT_NAME = testsprite; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testversion; }; - name = Deployment; + name = Debug; }; - 001B597608BDB826006539E9 /* Development */ = { + 002A85D11073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testsprite__Upgraded_.plist"; - PRODUCT_NAME = testsprite; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = torturethread; }; - name = Development; + name = Debug; }; - 001B597708BDB826006539E9 /* Default */ = { + 002A85D41073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testsprite__Upgraded_.plist"; - PRODUCT_NAME = testsprite; - WRAPPER_EXTENSION = app; + FRAMEWORK_SEARCH_PATHS = ( + "$(SRCROOT)/../SDL/build/$(CONFIGURATION)", + "$(HOME)/Library/Frameworks", + /Library/Frameworks, + ); + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + HEADER_SEARCH_PATHS = ../../include; }; - name = Default; + name = Release; }; - 001B597908BDB826006539E9 /* Deployment */ = { + 002A85D51073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testtimer__Upgraded_.plist"; - PRODUCT_NAME = testtimer; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = "Build All"; }; - name = Deployment; + name = Release; }; - 001B597A08BDB826006539E9 /* Development */ = { + 002A85D61073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testtimer__Upgraded_.plist"; - PRODUCT_NAME = testtimer; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = checkkeys; }; - name = Development; + name = Release; }; - 001B597B08BDB826006539E9 /* Default */ = { + 002A85D81073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testtimer__Upgraded_.plist"; - PRODUCT_NAME = testtimer; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = loopwave; }; - name = Default; + name = Release; }; - 001B598108BDB826006539E9 /* Deployment */ = { + 002A85DE1073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testversion__Upgraded_.plist"; - PRODUCT_NAME = testversion; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testerror; }; - name = Deployment; + name = Release; }; - 001B598208BDB826006539E9 /* Development */ = { + 002A85DF1073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testversion__Upgraded_.plist"; - PRODUCT_NAME = testversion; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testfile; }; - name = Development; + name = Release; }; - 001B598308BDB826006539E9 /* Default */ = { + 002A85E21073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testversion__Upgraded_.plist"; - PRODUCT_NAME = testversion; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testiconv; }; - name = Default; + name = Release; }; - 001B598508BDB826006539E9 /* Deployment */ = { + 002A85E31073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testvidinfo__Upgraded_.plist"; - PRODUCT_NAME = testvidinfo; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testjoystick; }; - name = Deployment; + name = Release; }; - 001B598608BDB826006539E9 /* Development */ = { + 002A85E41073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testvidinfo__Upgraded_.plist"; - PRODUCT_NAME = testvidinfo; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testkeys; }; - name = Development; + name = Release; }; - 001B598708BDB826006539E9 /* Default */ = { + 002A85E51073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testvidinfo__Upgraded_.plist"; - PRODUCT_NAME = testvidinfo; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testlock; }; - name = Default; + name = Release; }; - 001B598908BDB826006539E9 /* Deployment */ = { + 002A85E71073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testwin__Upgraded_.plist"; - PRODUCT_NAME = testwin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testoverlay2; }; - name = Deployment; + name = Release; }; - 001B598A08BDB826006539E9 /* Development */ = { + 002A85E91073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testwin__Upgraded_.plist"; - PRODUCT_NAME = testwin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testplatform; }; - name = Development; + name = Release; }; - 001B598B08BDB826006539E9 /* Default */ = { + 002A85EA1073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testwin__Upgraded_.plist"; - PRODUCT_NAME = testwin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testsem; }; - name = Default; + name = Release; }; - 001B598D08BDB826006539E9 /* Deployment */ = { + 002A85EC1073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testwm__Upgraded_.plist"; - PRODUCT_NAME = testwm; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testthread; }; - name = Deployment; + name = Release; }; - 001B598E08BDB826006539E9 /* Development */ = { + 002A85ED1073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testwm__Upgraded_.plist"; - PRODUCT_NAME = testwm; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testtimer; }; - name = Development; + name = Release; }; - 001B598F08BDB826006539E9 /* Default */ = { + 002A85EE1073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testwm__Upgraded_.plist"; - PRODUCT_NAME = testwm; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testversion; }; - name = Default; + name = Release; }; - 001B599108BDB826006539E9 /* Deployment */ = { + 002A85F31073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-threadwin__Upgraded_.plist"; - PRODUCT_NAME = threadwin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = torturethread; }; - name = Deployment; + name = Release; }; - 001B599208BDB826006539E9 /* Development */ = { + 4537749712091509002F0F45 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-threadwin__Upgraded_.plist"; - PRODUCT_NAME = threadwin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testshape; }; - name = Development; + name = Debug; }; - 001B599308BDB826006539E9 /* Default */ = { + 4537749812091509002F0F45 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-threadwin__Upgraded_.plist"; - PRODUCT_NAME = threadwin; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testshape; }; - name = Default; + name = Release; }; - 001B599508BDB826006539E9 /* Deployment */ = { + BBFC08CB164C6862003E6A99 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-torturethread__Upgraded_.plist"; - PRODUCT_NAME = torturethread; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testgamecontroller; }; - name = Deployment; + name = Debug; }; - 001B599608BDB826006539E9 /* Development */ = { + BBFC08CC164C6862003E6A99 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-torturethread__Upgraded_.plist"; - PRODUCT_NAME = torturethread; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testgamecontroller; }; - name = Development; + name = Release; }; - 001B599708BDB826006539E9 /* Default */ = { + DB166D8116A1D12400A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-torturethread__Upgraded_.plist"; - PRODUCT_NAME = torturethread; - WRAPPER_EXTENSION = app; + EXECUTABLE_PREFIX = lib; + PRODUCT_NAME = "$(TARGET_NAME)"; }; - name = Default; + name = Debug; }; - 001B599908BDB826006539E9 /* Deployment */ = { + DB166D8216A1D12400A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUGGING_SYMBOLS = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_OPTIMIZATION_LEVEL = 3; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = "Build All"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - ZERO_LINK = NO; + EXECUTABLE_PREFIX = lib; + PRODUCT_NAME = "$(TARGET_NAME)"; }; - name = Deployment; + name = Release; }; - 001B599A08BDB826006539E9 /* Development */ = { + DB166DBD16A1D2F600A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = "Build All"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - ZERO_LINK = YES; + PRODUCT_NAME = testgesture; }; - name = Development; + name = Debug; }; - 001B599B08BDB826006539E9 /* Default */ = { + DB166DBE16A1D2F600A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - OTHER_REZFLAGS = ""; - PRODUCT_NAME = "Build All"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); + PRODUCT_NAME = testgesture; }; - name = Default; + name = Release; }; - 001B599D08BDB826006539E9 /* Deployment */ = { + DB166DD316A1D36A00A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testoverlay__Upgraded_.plist"; - PRODUCT_NAME = testoverlay; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testmessage; }; - name = Deployment; + name = Debug; }; - 001B599E08BDB826006539E9 /* Development */ = { + DB166DD416A1D36A00A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testoverlay__Upgraded_.plist"; - PRODUCT_NAME = testoverlay; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testmessage; }; - name = Development; + name = Release; }; - 001B599F08BDB826006539E9 /* Default */ = { + DB166DEC16A1D50C00A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testoverlay__Upgraded_.plist"; - PRODUCT_NAME = testoverlay; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testrelative; }; - name = Default; + name = Debug; }; - 001B5A0D08BDB826006539E9 /* Deployment */ = { + DB166DED16A1D50C00A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; - CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SRCROOT)/../SDL/build/$(CONFIGURATION)", - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - ); - GCC_VERSION_i386 = 4.0; - GCC_VERSION_ppc = 4.0; - GCC_VERSION_x86_64 = 4.2; - HEADER_SEARCH_PATHS = ( - ../../include, - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - ); - MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; - MACOSX_DEPLOYMENT_TARGET_ppc = 10.4; - MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.6; - WARNING_CFLAGS = "-Wmost"; - ZERO_LINK = NO; + PRODUCT_NAME = testrelative; }; - name = Deployment; + name = Release; }; - 001B5A0E08BDB826006539E9 /* Development */ = { + DB166E0316A1D57C00A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; - CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SRCROOT)/../SDL/build/$(CONFIGURATION)", - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - ); - GCC_VERSION_i386 = 4.0; - GCC_VERSION_ppc = 4.0; - GCC_VERSION_x86_64 = 4.2; - HEADER_SEARCH_PATHS = ( - ../../include, - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - ); - MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; - MACOSX_DEPLOYMENT_TARGET_ppc = 10.4; - MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.6; - WARNING_CFLAGS = "-Wmost"; - ZERO_LINK = NO; + PRODUCT_NAME = testrendercopyex; }; - name = Development; + name = Debug; }; - 001B5A0F08BDB826006539E9 /* Default */ = { + DB166E0416A1D57C00A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc"; - CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SRCROOT)/../SDL/build/$(CONFIGURATION)", - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - ); - GCC_VERSION_i386 = 4.0; - GCC_VERSION_ppc = 4.0; - GCC_VERSION_x86_64 = 4.2; - HEADER_SEARCH_PATHS = ( - ../../include, - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - ); - MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; - MACOSX_DEPLOYMENT_TARGET_ppc = 10.4; - MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.6; - WARNING_CFLAGS = "-Wmost"; - ZERO_LINK = NO; + PRODUCT_NAME = testrendercopyex; }; - name = Default; + name = Release; }; - 002F337E09CA14F900EBEB88 /* Deployment */ = { + DB166E1A16A1D5AD00A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-test.plist"; - PRODUCT_NAME = test; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testrendertarget; }; - name = Deployment; + name = Debug; }; - 002F337F09CA14F900EBEB88 /* Development */ = { + DB166E1B16A1D5AD00A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-test.plist"; - PRODUCT_NAME = test; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testrendertarget; }; - name = Development; + name = Release; }; - 002F338009CA14F900EBEB88 /* Default */ = { + DB166E3616A1D64D00A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-test.plist"; - PRODUCT_NAME = test; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testrumble; }; - name = Default; + name = Debug; }; - 002F339409CA16BF00EBEB88 /* Deployment */ = { + DB166E3716A1D64D00A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testblitspeed.plist"; - PRODUCT_NAME = testblitspeed; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testrumble; }; - name = Deployment; + name = Release; }; - 002F339509CA16BF00EBEB88 /* Development */ = { + DB166E5016A1D69000A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testblitspeed.plist"; - PRODUCT_NAME = testblitspeed; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testscale; }; - name = Development; + name = Debug; }; - 002F339609CA16BF00EBEB88 /* Default */ = { + DB166E5116A1D69000A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testblitspeed.plist"; - PRODUCT_NAME = testblitspeed; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testscale; }; - name = Default; + name = Release; }; - 002F33D809CA19A600EBEB88 /* Deployment */ = { + DB166E6616A1D6F300A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(GCC_PREPROCESSOR_DEFINITIONS)", - HAVE_OPENGL, - ); - INFOPLIST_FILE = "Info-testdyngl.plist"; - PRODUCT_NAME = testdyngl; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testshader; }; - name = Deployment; + name = Debug; }; - 002F33D909CA19A600EBEB88 /* Development */ = { + DB166E6716A1D6F300A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(GCC_PREPROCESSOR_DEFINITIONS)", - HAVE_OPENGL, - ); - INFOPLIST_FILE = "Info-testdyngl.plist"; - PRODUCT_NAME = testdyngl; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testshader; }; - name = Development; + name = Release; }; - 002F33DA09CA19A600EBEB88 /* Default */ = { + DB166E7C16A1D78400A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(GCC_PREPROCESSOR_DEFINITIONS)", - HAVE_OPENGL, - ); - INFOPLIST_FILE = "Info-testdyngl.plist"; - PRODUCT_NAME = testdyngl; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testspriteminimal; }; - name = Default; + name = Debug; }; - 002F340F09CA1BFF00EBEB88 /* Deployment */ = { + DB166E7D16A1D78400A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testfile.plist"; - PRODUCT_NAME = testfile; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = testspriteminimal; }; - name = Deployment; + name = Release; }; - 002F341009CA1BFF00EBEB88 /* Development */ = { + DB166E8F16A1D78C00A1396C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testfile.plist"; - PRODUCT_NAME = testfile; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = teststreaming; }; - name = Development; + name = Debug; }; - 002F341109CA1BFF00EBEB88 /* Default */ = { + DB166E9016A1D78C00A1396C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - INFOPLIST_FILE = "Info-testfile.plist"; - PRODUCT_NAME = testfile; - WRAPPER_EXTENSION = app; + PRODUCT_NAME = teststreaming; }; - name = Default; + name = Release; }; - 002F342E09CA1F0300EBEB88 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testiconv.plist"; - PRODUCT_NAME = testiconv; - WRAPPER_EXTENSION = app; - }; - name = Deployment; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0017958610741F7900F5D044 /* Build configuration list for PBXNativeTarget "testatomic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0017958910741F7900F5D044 /* Debug */, + 0017958A10741F7900F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F342F09CA1F0300EBEB88 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testiconv.plist"; - PRODUCT_NAME = testiconv; - WRAPPER_EXTENSION = app; - }; - name = Development; + 001795A7107421BF00F5D044 /* Build configuration list for PBXNativeTarget "testaudioinfo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 001795AA107421BF00F5D044 /* Debug */, + 001795AB107421BF00F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F343009CA1F0300EBEB88 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testiconv.plist"; - PRODUCT_NAME = testiconv; - WRAPPER_EXTENSION = app; - }; - name = Default; + 0017971B10742F3200F5D044 /* Build configuration list for PBXNativeTarget "testgl2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0017971E10742F3200F5D044 /* Debug */, + 0017971F10742F3200F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F344A09CA1FB300EBEB88 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testoverlay2.plist"; - PRODUCT_NAME = testoverlay2; - WRAPPER_EXTENSION = app; - }; - name = Deployment; + 00179742107430D600F5D044 /* Build configuration list for PBXNativeTarget "testhaptic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 00179745107430D600F5D044 /* Debug */, + 00179746107430D600F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F344B09CA1FB300EBEB88 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testoverlay2.plist"; - PRODUCT_NAME = testoverlay2; - WRAPPER_EXTENSION = app; - }; - name = Development; + 00179768107431B300F5D044 /* Build configuration list for PBXNativeTarget "testdraw2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0017976B107431B300F5D044 /* Debug */, + 0017976C107431B300F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F344C09CA1FB300EBEB88 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testoverlay2.plist"; - PRODUCT_NAME = testoverlay2; - WRAPPER_EXTENSION = app; - }; - name = Default; + 00179788107432AE00F5D044 /* Build configuration list for PBXNativeTarget "testime" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0017978B107432AE00F5D044 /* Debug */, + 0017978C107432AE00F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F346709CA204F00EBEB88 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testplatform.plist"; - PRODUCT_NAME = testplatform; - WRAPPER_EXTENSION = app; - }; - name = Deployment; + 001797A81074334C00F5D044 /* Build configuration list for PBXNativeTarget "testintersections" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 001797AB1074334C00F5D044 /* Debug */, + 001797AC1074334C00F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F346809CA204F00EBEB88 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testplatform.plist"; - PRODUCT_NAME = testplatform; - WRAPPER_EXTENSION = app; - }; - name = Development; + 001797CA107433C600F5D044 /* Build configuration list for PBXNativeTarget "testloadso" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 001797CD107433C600F5D044 /* Debug */, + 001797CE107433C600F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; - 002F346909CA204F00EBEB88 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = "Info-testplatform.plist"; - PRODUCT_NAME = testplatform; - WRAPPER_EXTENSION = app; - }; - name = Default; + 0017980C1074355200F5D044 /* Build configuration list for PBXNativeTarget "testmultiaudio" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0017980F1074355200F5D044 /* Debug */, + 001798101074355200F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 001B593408BDB826006539E9 /* Build configuration list for PBXNativeTarget "libsdlmain.a (Upgraded)" */ = { + 0017988E1074392D00F5D044 /* Build configuration list for PBXNativeTarget "testnative" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 001798911074392D00F5D044 /* Debug */, + 001798921074392D00F5D044 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + 001798AF107439DF00F5D044 /* Build configuration list for PBXNativeTarget "testpower" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B593508BDB826006539E9 /* Deployment */, - 001B593608BDB826006539E9 /* Development */, - 001B593708BDB826006539E9 /* Default */, + 001798B2107439DF00F5D044 /* Debug */, + 001798B3107439DF00F5D044 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys (Upgraded)" */ = { + 001798EC10743BEC00F5D044 /* Build configuration list for PBXNativeTarget "testresample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B593908BDB826006539E9 /* Deployment */, - 001B593A08BDB826006539E9 /* Development */, - 001B593B08BDB826006539E9 /* Default */, + 001798EF10743BEC00F5D044 /* Debug */, + 001798F010743BEC00F5D044 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B593C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "graywin (Upgraded)" */ = { + 0017991010743F1000F5D044 /* Build configuration list for PBXNativeTarget "testsprite2" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B593D08BDB826006539E9 /* Deployment */, - 001B593E08BDB826006539E9 /* Development */, - 001B593F08BDB826006539E9 /* Default */, + 0017991310743F1000F5D044 /* Debug */, + 0017991410743F1000F5D044 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave (Upgraded)" */ = { + 0017993210743FB700F5D044 /* Build configuration list for PBXNativeTarget "testwm2" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B594108BDB826006539E9 /* Deployment */, - 001B594208BDB826006539E9 /* Development */, - 001B594308BDB826006539E9 /* Default */, + 0017993510743FB700F5D044 /* Debug */, + 0017993610743FB700F5D044 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B594408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testalpha (Upgraded)" */ = { + 001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B594508BDB826006539E9 /* Deployment */, - 001B594608BDB826006539E9 /* Development */, - 001B594708BDB826006539E9 /* Default */, + 002A85B41073008E007319AE /* Debug */, + 002A85D61073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B594808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testbitmap (Upgraded)" */ = { + 001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B594908BDB826006539E9 /* Deployment */, - 001B594A08BDB826006539E9 /* Development */, - 001B594B08BDB826006539E9 /* Default */, + 002A85B61073008E007319AE /* Debug */, + 002A85D81073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B594C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testcdrom (Upgraded)" */ = { + 001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B594D08BDB826006539E9 /* Deployment */, - 001B594E08BDB826006539E9 /* Development */, - 001B594F08BDB826006539E9 /* Default */, + 002A85BC1073008E007319AE /* Debug */, + 002A85DE1073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror (Upgraded)" */ = { + 001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B595108BDB826006539E9 /* Deployment */, - 001B595208BDB826006539E9 /* Development */, - 001B595308BDB826006539E9 /* Default */, + 002A85CA1073008E007319AE /* Debug */, + 002A85EC1073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B595408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgamma (Upgraded)" */ = { + 001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B595508BDB826006539E9 /* Deployment */, - 001B595608BDB826006539E9 /* Development */, - 001B595708BDB826006539E9 /* Default */, + 002A85C11073008E007319AE /* Debug */, + 002A85E31073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B595808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgl (Upgraded)" */ = { + 001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B595908BDB826006539E9 /* Deployment */, - 001B595A08BDB826006539E9 /* Development */, - 001B595B08BDB826006539E9 /* Default */, + 002A85C21073008E007319AE /* Debug */, + 002A85E41073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread (Upgraded)" */ = { + 001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B595D08BDB826006539E9 /* Deployment */, - 001B595E08BDB826006539E9 /* Development */, - 001B595F08BDB826006539E9 /* Default */, + 002A85C31073008E007319AE /* Debug */, + 002A85E51073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick (Upgraded)" */ = { + 001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B596108BDB826006539E9 /* Deployment */, - 001B596208BDB826006539E9 /* Development */, - 001B596308BDB826006539E9 /* Default */, + 002A85C81073008E007319AE /* Debug */, + 002A85EA1073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys (Upgraded)" */ = { + 001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B596508BDB826006539E9 /* Deployment */, - 001B596608BDB826006539E9 /* Development */, - 001B596708BDB826006539E9 /* Default */, + 002A85CB1073008E007319AE /* Debug */, + 002A85ED1073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock (Upgraded)" */ = { + 001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B596908BDB826006539E9 /* Deployment */, - 001B596A08BDB826006539E9 /* Development */, - 001B596B08BDB826006539E9 /* Default */, + 002A85CC1073008E007319AE /* Debug */, + 002A85EE1073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B596C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testpalette (Upgraded)" */ = { + 001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B596D08BDB826006539E9 /* Deployment */, - 001B596E08BDB826006539E9 /* Development */, - 001B596F08BDB826006539E9 /* Default */, + 002A85D11073008E007319AE /* Debug */, + 002A85F31073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem (Upgraded)" */ = { + 001B599808BDB826006539E9 /* Build configuration list for PBXAggregateTarget "All" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B597108BDB826006539E9 /* Deployment */, - 001B597208BDB826006539E9 /* Development */, - 001B597308BDB826006539E9 /* Default */, + 002A85B31073008E007319AE /* Debug */, + 002A85D51073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B597408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsprite (Upgraded)" */ = { + 001B5A0C08BDB826006539E9 /* Build configuration list for PBXProject "SDLTest" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B597508BDB826006539E9 /* Deployment */, - 001B597608BDB826006539E9 /* Development */, - 001B597708BDB826006539E9 /* Default */, + 002A85B21073008E007319AE /* Debug */, + 002A85D41073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer (Upgraded)" */ = { + 002F340E09CA1BFF00EBEB88 /* Build configuration list for PBXNativeTarget "testfile" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B597908BDB826006539E9 /* Deployment */, - 001B597A08BDB826006539E9 /* Development */, - 001B597B08BDB826006539E9 /* Default */, + 002A85BD1073008E007319AE /* Debug */, + 002A85DF1073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion (Upgraded)" */ = { + 002F342D09CA1F0300EBEB88 /* Build configuration list for PBXNativeTarget "testiconv" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B598108BDB826006539E9 /* Deployment */, - 001B598208BDB826006539E9 /* Development */, - 001B598308BDB826006539E9 /* Default */, + 002A85C01073008E007319AE /* Debug */, + 002A85E21073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B598408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testvidinfo (Upgraded)" */ = { + 002F344909CA1FB300EBEB88 /* Build configuration list for PBXNativeTarget "testoverlay2" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B598508BDB826006539E9 /* Deployment */, - 001B598608BDB826006539E9 /* Development */, - 001B598708BDB826006539E9 /* Default */, + 002A85C51073008E007319AE /* Debug */, + 002A85E71073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B598808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwin (Upgraded)" */ = { + 002F346609CA204F00EBEB88 /* Build configuration list for PBXNativeTarget "testplatform" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B598908BDB826006539E9 /* Deployment */, - 001B598A08BDB826006539E9 /* Development */, - 001B598B08BDB826006539E9 /* Default */, + 002A85C71073008E007319AE /* Debug */, + 002A85E91073009D007319AE /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B598C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwm (Upgraded)" */ = { + 4537749A1209150C002F0F45 /* Build configuration list for PBXNativeTarget "testshape" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B598D08BDB826006539E9 /* Deployment */, - 001B598E08BDB826006539E9 /* Development */, - 001B598F08BDB826006539E9 /* Default */, + 4537749712091509002F0F45 /* Debug */, + 4537749812091509002F0F45 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B599008BDB826006539E9 /* Build configuration list for PBXNativeTarget "threadwin (Upgraded)" */ = { + BBFC08CA164C6862003E6A99 /* Build configuration list for PBXNativeTarget "testgamecontroller" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B599108BDB826006539E9 /* Deployment */, - 001B599208BDB826006539E9 /* Development */, - 001B599308BDB826006539E9 /* Default */, + BBFC08CB164C6862003E6A99 /* Debug */, + BBFC08CC164C6862003E6A99 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread (Upgraded)" */ = { + DB166D8016A1D12400A1396C /* Build configuration list for PBXNativeTarget "SDL_test" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B599508BDB826006539E9 /* Deployment */, - 001B599608BDB826006539E9 /* Development */, - 001B599708BDB826006539E9 /* Default */, + DB166D8116A1D12400A1396C /* Debug */, + DB166D8216A1D12400A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B599808BDB826006539E9 /* Build configuration list for PBXAggregateTarget "All" */ = { + DB166DBC16A1D2F600A1396C /* Build configuration list for PBXNativeTarget "testgesture" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B599908BDB826006539E9 /* Deployment */, - 001B599A08BDB826006539E9 /* Development */, - 001B599B08BDB826006539E9 /* Default */, + DB166DBD16A1D2F600A1396C /* Debug */, + DB166DBE16A1D2F600A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B599C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testoverlay (Upgraded)" */ = { + DB166DD216A1D36A00A1396C /* Build configuration list for PBXNativeTarget "testmessage" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B599D08BDB826006539E9 /* Deployment */, - 001B599E08BDB826006539E9 /* Development */, - 001B599F08BDB826006539E9 /* Default */, + DB166DD316A1D36A00A1396C /* Debug */, + DB166DD416A1D36A00A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 001B5A0C08BDB826006539E9 /* Build configuration list for PBXProject "SDLTest" */ = { + DB166DEB16A1D50C00A1396C /* Build configuration list for PBXNativeTarget "testrelative" */ = { isa = XCConfigurationList; buildConfigurations = ( - 001B5A0D08BDB826006539E9 /* Deployment */, - 001B5A0E08BDB826006539E9 /* Development */, - 001B5A0F08BDB826006539E9 /* Default */, + DB166DEC16A1D50C00A1396C /* Debug */, + DB166DED16A1D50C00A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 002F337D09CA14F900EBEB88 /* Build configuration list for PBXNativeTarget "test" */ = { + DB166E0216A1D57C00A1396C /* Build configuration list for PBXNativeTarget "testrendercopyex" */ = { isa = XCConfigurationList; buildConfigurations = ( - 002F337E09CA14F900EBEB88 /* Deployment */, - 002F337F09CA14F900EBEB88 /* Development */, - 002F338009CA14F900EBEB88 /* Default */, + DB166E0316A1D57C00A1396C /* Debug */, + DB166E0416A1D57C00A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 002F339309CA16BF00EBEB88 /* Build configuration list for PBXNativeTarget "testblitspeed" */ = { + DB166E1916A1D5AD00A1396C /* Build configuration list for PBXNativeTarget "testrendertarget" */ = { isa = XCConfigurationList; buildConfigurations = ( - 002F339409CA16BF00EBEB88 /* Deployment */, - 002F339509CA16BF00EBEB88 /* Development */, - 002F339609CA16BF00EBEB88 /* Default */, + DB166E1A16A1D5AD00A1396C /* Debug */, + DB166E1B16A1D5AD00A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 002F33D709CA19A600EBEB88 /* Build configuration list for PBXNativeTarget "testdyngl" */ = { + DB166E3516A1D64D00A1396C /* Build configuration list for PBXNativeTarget "testrumble" */ = { isa = XCConfigurationList; buildConfigurations = ( - 002F33D809CA19A600EBEB88 /* Deployment */, - 002F33D909CA19A600EBEB88 /* Development */, - 002F33DA09CA19A600EBEB88 /* Default */, + DB166E3616A1D64D00A1396C /* Debug */, + DB166E3716A1D64D00A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 002F340E09CA1BFF00EBEB88 /* Build configuration list for PBXNativeTarget "testfile" */ = { + DB166E4F16A1D69000A1396C /* Build configuration list for PBXNativeTarget "testscale" */ = { isa = XCConfigurationList; buildConfigurations = ( - 002F340F09CA1BFF00EBEB88 /* Deployment */, - 002F341009CA1BFF00EBEB88 /* Development */, - 002F341109CA1BFF00EBEB88 /* Default */, + DB166E5016A1D69000A1396C /* Debug */, + DB166E5116A1D69000A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 002F342D09CA1F0300EBEB88 /* Build configuration list for PBXNativeTarget "testiconv" */ = { + DB166E6516A1D6F300A1396C /* Build configuration list for PBXNativeTarget "testshader" */ = { isa = XCConfigurationList; buildConfigurations = ( - 002F342E09CA1F0300EBEB88 /* Deployment */, - 002F342F09CA1F0300EBEB88 /* Development */, - 002F343009CA1F0300EBEB88 /* Default */, + DB166E6616A1D6F300A1396C /* Debug */, + DB166E6716A1D6F300A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 002F344909CA1FB300EBEB88 /* Build configuration list for PBXNativeTarget "testoverlay2" */ = { + DB166E7B16A1D78400A1396C /* Build configuration list for PBXNativeTarget "testspriteminimal" */ = { isa = XCConfigurationList; buildConfigurations = ( - 002F344A09CA1FB300EBEB88 /* Deployment */, - 002F344B09CA1FB300EBEB88 /* Development */, - 002F344C09CA1FB300EBEB88 /* Default */, + DB166E7C16A1D78400A1396C /* Debug */, + DB166E7D16A1D78400A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; - 002F346609CA204F00EBEB88 /* Build configuration list for PBXNativeTarget "testplatform" */ = { + DB166E8E16A1D78C00A1396C /* Build configuration list for PBXNativeTarget "teststreaming" */ = { isa = XCConfigurationList; buildConfigurations = ( - 002F346709CA204F00EBEB88 /* Deployment */, - 002F346809CA204F00EBEB88 /* Development */, - 002F346909CA204F00EBEB88 /* Default */, + DB166E8F16A1D78C00A1396C /* Debug */, + DB166E9016A1D78C00A1396C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ }; diff --git a/Xcode/SDLTest/libsdlmain_prefix.h b/Xcode/SDLTest/libsdlmain_prefix.h deleted file mode 100644 index ed41c97440..0000000000 --- a/Xcode/SDLTest/libsdlmain_prefix.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * libsdlmain_prefix.h - * SDLTest - * - * Created by Darrell Walisser on Wed Aug 06 2003. - * Copyright (c) 2003 __MyCompanyName__. All rights reserved. - * - */ - -#include -#include -#include "SDL.h" -#include "SDLMain.h" \ No newline at end of file diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeLeopard/SDL Application/English.lproj/InfoPlist.strings deleted file mode 100644 index 6e721b0ef0..0000000000 Binary files a/Xcode/TemplatesForXcodeLeopard/SDL Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/Info.plist b/Xcode/TemplatesForXcodeLeopard/SDL Application/Info.plist deleted file mode 100644 index e4332041bf..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/Info.plist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.___PROJECTNAMEASXML___ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - - - diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.h b/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m b/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns deleted file mode 100644 index ae0b02b12a..0000000000 Binary files a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns and /dev/null differ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist deleted file mode 100644 index d9ca454937..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application."; -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj deleted file mode 100644 index 0cff0a3388..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,308 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "___PROJECTNAMEASXML___"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "___PROJECTNAME___"; - productInstallPath = "$(HOME)/Applications"; - productName = "___PROJECTNAME___"; - productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Application/main.c b/Xcode/TemplatesForXcodeLeopard/SDL Application/main.c deleted file mode 100644 index 7115de9897..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Application/main.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -int main(int argc, char *argv[]) -{ - Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */ - SDL_Surface *screen; - Uint8 video_bpp = 0; - Uint32 videoflags = SDL_SWSURFACE; - int done; - SDL_Event event; - - /* Initialize the SDL library */ - if ( SDL_Init(initflags) < 0 ) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - /* Set 640x480 video mode */ - screen=SDL_SetVideoMode(640,480, video_bpp, videoflags); - if (screen == NULL) { - fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", - video_bpp, SDL_GetError()); - SDL_Quit(); - exit(2); - } - - done = 0; - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent(&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - } - - /* Clean up the SDL library */ - SDL_Quit(); - return(0); -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings deleted file mode 100644 index 6e721b0ef0..0000000000 Binary files a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib deleted file mode 100644 index 799eaadddb..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib +++ /dev/null @@ -1,19 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = { - help = id; - newGame = id; - openGame = id; - prefsMenu = id; - saveGame = id; - saveGameAs = id; - }; - CLASS = SDLMain; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib deleted file mode 100644 index 1d6fb7e01d..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - IBDocumentLocation - 62 117 356 240 0 0 1152 848 - IBEditorPositions - - 29 - 62 362 195 44 0 0 1152 848 - - IBFramework Version - 291.0 - IBOpenObjects - - 29 - - IBSystem Version - 6L60 - - diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib deleted file mode 100644 index 637801528a..0000000000 Binary files a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib and /dev/null differ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/Info.plist b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/Info.plist deleted file mode 100644 index 40a970f973..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/Info.plist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.___PROJECTNAMEASXML___ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - - - diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.h b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.m b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns deleted file mode 100644 index ae0b02b12a..0000000000 Binary files a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns and /dev/null differ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist deleted file mode 100644 index 1dcbea207c..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application with Cocoa menus."; -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj deleted file mode 100644 index c61e527c4c..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,320 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 002F3AF009D08F1000EBEB88 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/SDLMain.nib; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "___PROJECTNAMEASXML___"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "___PROJECTNAME___"; - productInstallPath = "$(HOME)/Applications"; - productName = "___PROJECTNAME___"; - productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */ = { - isa = PBXVariantGroup; - children = ( - 002F3AF009D08F1000EBEB88 /* English */, - ); - name = SDLMain.nib; - sourceTree = ""; - }; - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/main.c b/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/main.c deleted file mode 100644 index 7115de9897..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/main.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -int main(int argc, char *argv[]) -{ - Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */ - SDL_Surface *screen; - Uint8 video_bpp = 0; - Uint32 videoflags = SDL_SWSURFACE; - int done; - SDL_Event event; - - /* Initialize the SDL library */ - if ( SDL_Init(initflags) < 0 ) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - /* Set 640x480 video mode */ - screen=SDL_SetVideoMode(640,480, video_bpp, videoflags); - if (screen == NULL) { - fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", - video_bpp, SDL_GetError()); - SDL_Quit(); - exit(2); - } - - done = 0; - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent(&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - } - - /* Clean up the SDL library */ - SDL_Quit(); - return(0); -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings deleted file mode 100644 index 6e721b0ef0..0000000000 Binary files a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/Info.plist b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/Info.plist deleted file mode 100644 index a2e942960c..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/Info.plist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.___PROJECTNAMEASXML___ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - - - diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.h b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns deleted file mode 100644 index ae0b02b12a..0000000000 Binary files a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns and /dev/null differ diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist deleted file mode 100644 index ba87745fc3..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application that uses OpenGL."; -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj deleted file mode 100644 index 529d444364..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,350 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF409D0938900EBEB88 /* atlantis.c */; }; - 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF609D0938900EBEB88 /* dolphin.c */; }; - 002F3BFD09D0938900EBEB88 /* shark.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF709D0938900EBEB88 /* shark.c */; }; - 002F3BFE09D0938900EBEB88 /* swim.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF809D0938900EBEB88 /* swim.c */; }; - 002F3BFF09D0938900EBEB88 /* whale.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF909D0938900EBEB88 /* whale.c */; }; - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; }; - 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C6009D0951E00EBEB88 /* GLUT.framework */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 002F3BF409D0938900EBEB88 /* atlantis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = atlantis.c; path = atlantis/atlantis.c; sourceTree = SOURCE_ROOT; }; - 002F3BF509D0938900EBEB88 /* atlantis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = atlantis.h; path = atlantis/atlantis.h; sourceTree = SOURCE_ROOT; }; - 002F3BF609D0938900EBEB88 /* dolphin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dolphin.c; path = atlantis/dolphin.c; sourceTree = SOURCE_ROOT; }; - 002F3BF709D0938900EBEB88 /* shark.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = shark.c; path = atlantis/shark.c; sourceTree = SOURCE_ROOT; }; - 002F3BF809D0938900EBEB88 /* swim.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = swim.c; path = atlantis/swim.c; sourceTree = SOURCE_ROOT; }; - 002F3BF909D0938900EBEB88 /* whale.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = whale.c; path = atlantis/whale.c; sourceTree = SOURCE_ROOT; }; - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 002F3C6009D0951E00EBEB88 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../../../../../../../../System/Library/Frameworks/GLUT.framework; sourceTree = SOURCE_ROOT; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 002F3BF309D0937800EBEB88 /* atlantis */ = { - isa = PBXGroup; - children = ( - 002F3BF409D0938900EBEB88 /* atlantis.c */, - 002F3BF509D0938900EBEB88 /* atlantis.h */, - 002F3BF609D0938900EBEB88 /* dolphin.c */, - 002F3BF709D0938900EBEB88 /* shark.c */, - 002F3BF809D0938900EBEB88 /* swim.c */, - 002F3BF909D0938900EBEB88 /* whale.c */, - ); - name = atlantis; - sourceTree = ""; - }; - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 002F3C6009D0951E00EBEB88 /* GLUT.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "___PROJECTNAMEASXML___"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 002F3BF309D0937800EBEB88 /* atlantis */, - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "___PROJECTNAME___"; - productInstallPath = "$(HOME)/Applications"; - productName = "___PROJECTNAME___"; - productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */, - 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */, - 002F3BFD09D0938900EBEB88 /* shark.c in Sources */, - 002F3BFE09D0938900EBEB88 /* swim.c in Sources */, - 002F3BFF09D0938900EBEB88 /* whale.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.c b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.c deleted file mode 100644 index 4efdf6ce88..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.c +++ /dev/null @@ -1,459 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include -#include -#include -#include -#include "atlantis.h" - -fishRec sharks[NUM_SHARKS]; -fishRec momWhale; -fishRec babyWhale; -fishRec dolph; - -GLboolean Timing = GL_TRUE; - -int w_win = 640; -int h_win = 480; -GLint count = 0; -GLenum StrMode = GL_VENDOR; - -GLboolean moving; - -static double mtime(void) -{ - struct timeval tk_time; - struct timezone tz; - - gettimeofday(&tk_time, &tz); - - return 4294.967296 * tk_time.tv_sec + 0.000001 * tk_time.tv_usec; -} - -static double filter(double in, double *save) -{ - static double k1 = 0.9; - static double k2 = 0.05; - - save[3] = in; - save[1] = save[0]*k1 + k2*(save[3] + save[2]); - - save[0]=save[1]; - save[2]=save[3]; - - return(save[1]); -} - -void DrawStr(const char *str) -{ - GLint i = 0; - - if(!str) return; - - while(str[i]) - { - glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, str[i]); - i++; - } -} - -void -InitFishs(void) -{ - int i; - - for (i = 0; i < NUM_SHARKS; i++) { - sharks[i].x = 70000.0 + rand() % 6000; - sharks[i].y = rand() % 6000; - sharks[i].z = rand() % 6000; - sharks[i].psi = rand() % 360 - 180.0; - sharks[i].v = 1.0; - } - - dolph.x = 30000.0; - dolph.y = 0.0; - dolph.z = 6000.0; - dolph.psi = 90.0; - dolph.theta = 0.0; - dolph.v = 3.0; - - momWhale.x = 70000.0; - momWhale.y = 0.0; - momWhale.z = 0.0; - momWhale.psi = 90.0; - momWhale.theta = 0.0; - momWhale.v = 3.0; - - babyWhale.x = 60000.0; - babyWhale.y = -2000.0; - babyWhale.z = -2000.0; - babyWhale.psi = 90.0; - babyWhale.theta = 0.0; - babyWhale.v = 3.0; -} - -void -Atlantis_Init(void) -{ - static float ambient[] = {0.2, 0.2, 0.2, 1.0}; - static float diffuse[] = {1.0, 1.0, 1.0, 1.0}; - static float position[] = {0.0, 1.0, 0.0, 0.0}; - static float mat_shininess[] = {90.0}; - static float mat_specular[] = {0.8, 0.8, 0.8, 1.0}; - static float mat_diffuse[] = {0.46, 0.66, 0.795, 1.0}; - static float mat_ambient[] = {0.3, 0.4, 0.5, 1.0}; - static float lmodel_ambient[] = {0.4, 0.4, 0.4, 1.0}; - static float lmodel_localviewer[] = {0.0}; - //GLfloat map1[4] = {0.0, 0.0, 0.0, 0.0}; - //GLfloat map2[4] = {0.0, 0.0, 0.0, 0.0}; - static float fog_color[] = {0.0, 0.5, 0.9, 1.0}; - - glFrontFace(GL_CCW); - - glDepthFunc(GL_LESS); - glEnable(GL_DEPTH_TEST); - - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT0, GL_POSITION, position); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); - glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_localviewer); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - - glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); - glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient); - - InitFishs(); - - glEnable(GL_FOG); - glFogi(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 0.0000025); - glFogfv(GL_FOG_COLOR, fog_color); - - glClearColor(0.0, 0.5, 0.9, 1.0); -} - -void -Atlantis_Reshape(int width, int height) -{ - w_win = width; - h_win = height; - - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60.0, (GLfloat) width / (GLfloat) height, 20000.0, 300000.0); - glMatrixMode(GL_MODELVIEW); -} - -void -Atlantis_Animate(void) -{ - int i; - - for (i = 0; i < NUM_SHARKS; i++) { - SharkPilot(&sharks[i]); - SharkMiss(i); - } - WhalePilot(&dolph); - dolph.phi++; - //glutPostRedisplay(); - WhalePilot(&momWhale); - momWhale.phi++; - WhalePilot(&babyWhale); - babyWhale.phi++; -} - -void -Atlantis_Key(unsigned char key, int x, int y) -{ - switch (key) { - case 't': - Timing = !Timing; - break; - case ' ': - switch(StrMode) - { - case GL_EXTENSIONS: - StrMode = GL_VENDOR; - break; - case GL_VENDOR: - StrMode = GL_RENDERER; - break; - case GL_RENDERER: - StrMode = GL_VERSION; - break; - case GL_VERSION: - StrMode = GL_EXTENSIONS; - break; - } - break; - case 27: /* Esc will quit */ - exit(1); - break; - case 's': /* "s" start animation */ - moving = GL_TRUE; - //glutIdleFunc(Animate); - break; - case 'a': /* "a" stop animation */ - moving = GL_FALSE; - //glutIdleFunc(NULL); - break; - case '.': /* "." will advance frame */ - if (!moving) { - Atlantis_Animate(); - } - } -} -/* -void Display(void) -{ - static float P123[3] = {-448.94, -203.14, 9499.60}; - static float P124[3] = {-442.64, -185.20, 9528.07}; - static float P125[3] = {-441.07, -148.05, 9528.07}; - static float P126[3] = {-443.43, -128.84, 9499.60}; - static float P127[3] = {-456.87, -146.78, 9466.67}; - static float P128[3] = {-453.68, -183.93, 9466.67}; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - FishTransform(&dolph); - DrawDolphin(&dolph); - glPopMatrix(); - - glutSwapBuffers(); -} -*/ - -void -Atlantis_Display(void) -{ - int i; - static double th[4] = {0.0, 0.0, 0.0, 0.0}; - static double t1 = 0.0, t2 = 0.0, t; - char num_str[128]; - - t1 = t2; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - for (i = 0; i < NUM_SHARKS; i++) { - glPushMatrix(); - FishTransform(&sharks[i]); - DrawShark(&sharks[i]); - glPopMatrix(); - } - - glPushMatrix(); - FishTransform(&dolph); - DrawDolphin(&dolph); - glPopMatrix(); - - glPushMatrix(); - FishTransform(&momWhale); - DrawWhale(&momWhale); - glPopMatrix(); - - glPushMatrix(); - FishTransform(&babyWhale); - glScalef(0.45, 0.45, 0.3); - DrawWhale(&babyWhale); - glPopMatrix(); - - if(Timing) - { - t2 = mtime(); - t = t2 - t1; - if(t > 0.0001) t = 1.0 / t; - - glDisable(GL_LIGHTING); - //glDisable(GL_DEPTH_TEST); - - glColor3f(1.0, 0.0, 0.0); - - glMatrixMode (GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(0, w_win, 0, h_win, -10.0, 10.0); - - glRasterPos2f(5.0, 5.0); - - switch(StrMode) - { - case GL_VENDOR: - sprintf(num_str, "%0.2f Hz, %dx%d, VENDOR: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_VENDOR)); - break; - case GL_RENDERER: - sprintf(num_str, "%0.2f Hz, %dx%d, RENDERER: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_RENDERER)); - break; - case GL_VERSION: - sprintf(num_str, "%0.2f Hz, %dx%d, VERSION: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_VERSION)); - break; - case GL_EXTENSIONS: - sprintf(num_str, "%0.2f Hz, %dx%d, EXTENSIONS: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_EXTENSIONS)); - break; - } - - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_LIGHTING); - //glEnable(GL_DEPTH_TEST); - } - - count++; - - glutSwapBuffers(); -} - -/* -void -Visible(int state) -{ - if (state == GLUT_VISIBLE) { - if (moving) - glutIdleFunc(Animate); - } else { - if (moving) - glutIdleFunc(NULL); - } -} - - -void -timingSelect(int value) -{ - switch(value) - { - case 1: - StrMode = GL_VENDOR; - break; - case 2: - StrMode = GL_RENDERER; - break; - case 3: - StrMode = GL_VERSION; - break; - case 4: - StrMode = GL_EXTENSIONS; - break; - } -} - -void -menuSelect(int value) -{ - switch (value) { - case 1: - moving = GL_TRUE; - glutIdleFunc(Animate); - break; - case 2: - moving = GL_FALSE; - glutIdleFunc(NULL); - break; - case 4: - exit(0); - break; - } -} - -int -main(int argc, char **argv) -{ - GLboolean fullscreen = GL_FALSE; - GLint time_menu; - - srand(0); - - glutInit(&argc, argv); - if (argc > 1 && !strcmp(argv[1], "-w")) - fullscreen = GL_FALSE; - - //glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); - glutInitDisplayString("rgba double depth=24"); - if (fullscreen) { - glutGameModeString("1024x768:32"); - glutEnterGameMode(); - } else { - glutInitWindowSize(320, 240); - glutCreateWindow("Atlantis Timing"); - } - Init(); - glutDisplayFunc(Display); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - moving = GL_TRUE; -glutIdleFunc(Animate); - glutVisibilityFunc(Visible); - - time_menu = glutCreateMenu(timingSelect); - glutAddMenuEntry("GL_VENDOR", 1); - glutAddMenuEntry("GL_RENDERER", 2); - glutAddMenuEntry("GL_VERSION", 3); - glutAddMenuEntry("GL_EXTENSIONS", 4); - - glutCreateMenu(menuSelect); - glutAddMenuEntry("Start motion", 1); - glutAddMenuEntry("Stop motion", 2); - glutAddSubMenu("Timing Mode", time_menu); - glutAddMenuEntry("Quit", 4); - - //glutAttachMenu(GLUT_RIGHT_BUTTON); - glutAttachMenu(GLUT_RIGHT_BUTTON); - glutMainLoop(); - return 0; // ANSI C requires main to return int. -} -*/ \ No newline at end of file diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.h b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.h deleted file mode 100644 index 6ccf2d5f0c..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#define RAD 57.295 -#define RRAD 0.01745 - -#define NUM_SHARKS 4 -#define SHARKSIZE 6000 -#define SHARKSPEED 100.0 - -#define WHALESPEED 250.0 - -typedef struct _fishRec { - float x, y, z, phi, theta, psi, v; - float xt, yt, zt; - float htail, vtail; - float dtheta; - int spurt, attack; -} fishRec; - -extern fishRec sharks[NUM_SHARKS]; -extern fishRec momWhale; -extern fishRec babyWhale; -extern fishRec dolph; - -extern void FishTransform(fishRec *); -extern void WhalePilot(fishRec *); -extern void SharkPilot(fishRec *); -extern void SharkMiss(int); -extern void DrawWhale(fishRec *); -extern void DrawShark(fishRec *); -extern void DrawDolphin(fishRec *); diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/dolphin.c b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/dolphin.c deleted file mode 100644 index 9fba3ba986..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/dolphin.c +++ /dev/null @@ -1,1934 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N001[3] = {-0.005937 ,-0.101998 ,-0.994767}; -static float N002[3] = {0.936780 ,-0.200803 ,0.286569}; -static float N003[3] = {-0.233062 ,0.972058 ,0.028007}; -static float N005[3] = {0.898117 ,0.360171 ,0.252315}; -static float N006[3] = {-0.915437 ,0.348456 ,0.201378}; -static float N007[3] = {0.602263 ,-0.777527 ,0.180920}; -static float N008[3] = {-0.906912 ,-0.412015 ,0.088061}; -static float N012[3] = {0.884408 ,-0.429417 ,-0.182821}; -static float N013[3] = {0.921121 ,0.311084 ,-0.234016}; -static float N014[3] = {0.382635 ,0.877882 ,-0.287948}; -static float N015[3] = {-0.380046 ,0.888166 ,-0.258316}; -static float N016[3] = {-0.891515 ,0.392238 ,-0.226607}; -static float N017[3] = {-0.901419 ,-0.382002 ,-0.203763}; -static float N018[3] = {-0.367225 ,-0.911091 ,-0.187243}; -static float N019[3] = {0.339539 ,-0.924846 ,-0.171388}; -static float N020[3] = {0.914706 ,-0.378617 ,-0.141290}; -static float N021[3] = {0.950662 ,0.262713 ,-0.164994}; -static float N022[3] = {0.546359 ,0.801460 ,-0.243218}; -static float N023[3] = {-0.315796 ,0.917068 ,-0.243431}; -static float N024[3] = {-0.825687 ,0.532277 ,-0.186875}; -static float N025[3] = {-0.974763 ,-0.155232 ,-0.160435}; -static float N026[3] = {-0.560596 ,-0.816658 ,-0.137119}; -static float N027[3] = {0.380210 ,-0.910817 ,-0.160786}; -static float N028[3] = {0.923772 ,-0.358322 ,-0.135093}; -static float N029[3] = {0.951202 ,0.275053 ,-0.139859}; -static float N030[3] = {0.686099 ,0.702548 ,-0.188932}; -static float N031[3] = {-0.521865 ,0.826719 ,-0.210220}; -static float N032[3] = {-0.923820 ,0.346739 ,-0.162258}; -static float N033[3] = {-0.902095 ,-0.409995 ,-0.134646}; -static float N034[3] = {-0.509115 ,-0.848498 ,-0.144404}; -static float N035[3] = {0.456469 ,-0.880293 ,-0.129305}; -static float N036[3] = {0.873401 ,-0.475489 ,-0.105266}; -static float N037[3] = {0.970825 ,0.179861 ,-0.158584}; -static float N038[3] = {0.675609 ,0.714187 ,-0.183004}; -static float N039[3] = {-0.523574 ,0.830212 ,-0.191360}; -static float N040[3] = {-0.958895 ,0.230808 ,-0.165071}; -static float N041[3] = {-0.918285 ,-0.376803 ,-0.121542}; -static float N042[3] = {-0.622467 ,-0.774167 ,-0.114888}; -static float N043[3] = {0.404497 ,-0.908807 ,-0.102231}; -static float N044[3] = {0.930538 ,-0.365155 ,-0.027588}; -static float N045[3] = {0.921920 ,0.374157 ,-0.100345}; -static float N046[3] = {0.507346 ,0.860739 ,0.041562}; -static float N047[3] = {-0.394646 ,0.918815 ,-0.005730}; -static float N048[3] = {-0.925411 ,0.373024 ,-0.066837}; -static float N049[3] = {-0.945337 ,-0.322309 ,-0.049551}; -static float N050[3] = {-0.660437 ,-0.750557 ,-0.022072}; -static float N051[3] = {0.488835 ,-0.871950 ,-0.027261}; -static float N052[3] = {0.902599 ,-0.421397 ,0.087969}; -static float N053[3] = {0.938636 ,0.322606 ,0.122020}; -static float N054[3] = {0.484605 ,0.871078 ,0.079878}; -static float N055[3] = {-0.353607 ,0.931559 ,0.084619}; -static float N056[3] = {-0.867759 ,0.478564 ,0.134054}; -static float N057[3] = {-0.951583 ,-0.296030 ,0.082794}; -static float N058[3] = {-0.672355 ,-0.730209 ,0.121384}; -static float N059[3] = {0.528336 ,-0.842452 ,0.105525}; -static float N060[3] = {0.786913 ,-0.564760 ,0.248627}; -static float N062[3] = {0.622098 ,0.765230 ,0.165584}; -static float N063[3] = {-0.631711 ,0.767816 ,0.106773}; -static float N064[3] = {-0.687886 ,0.606351 ,0.398938}; -static float N065[3] = {-0.946327 ,-0.281623 ,0.158598}; -static float N066[3] = {-0.509549 ,-0.860437 ,0.002776}; -static float N067[3] = {0.462594 ,-0.876692 ,0.131977}; -static float N071[3] = {0.000000 ,1.000000 ,0.000000}; -static float N077[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N078[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N079[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N080[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N081[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N082[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N083[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N084[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N085[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N086[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N087[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N088[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N089[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N090[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N091[3] = {0.000000 ,1.000000 ,0.000000}; -static float N092[3] = {0.000000 ,1.000000 ,0.000000}; -static float N093[3] = {0.000000 ,1.000000 ,0.000000}; -static float N094[3] = {1.000000 ,0.000000 ,0.000000}; -static float N095[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N097[3] = {-0.697296 ,0.702881 ,0.140491}; -static float N098[3] = {0.918864 ,0.340821 ,0.198819}; -static float N099[3] = {-0.932737 ,0.201195 ,0.299202}; -static float N100[3] = {0.029517 ,0.981679 ,0.188244}; -static float N102[3] = {0.813521 ,-0.204936 ,0.544229}; -static float N110[3] = {-0.781480 ,-0.384779 ,0.491155}; -static float N111[3] = {-0.722243 ,0.384927 ,0.574627}; -static float N112[3] = {-0.752278 ,0.502679 ,0.425901}; -static float N113[3] = {0.547257 ,0.367910 ,0.751766}; -static float N114[3] = {0.725949 ,-0.232568 ,0.647233}; -static float N115[3] = {-0.747182 ,-0.660786 ,0.071280}; -static float N116[3] = {0.931519 ,0.200748 ,0.303270}; -static float N117[3] = {-0.828928 ,0.313757 ,0.463071}; -static float N118[3] = {0.902554 ,-0.370967 ,0.218587}; -static float N119[3] = {-0.879257 ,-0.441851 ,0.177973}; -static float N120[3] = {0.642327 ,0.611901 ,0.461512}; -static float N121[3] = {0.964817 ,-0.202322 ,0.167910}; -static float N122[3] = {0.000000 ,1.000000 ,0.000000}; -static float P001[3] = {5.68, -300.95, 1324.70}; -static float P002[3] = {338.69, -219.63, 9677.03}; -static float P003[3] = {12.18, 474.59, 9138.14}; -static float P005[3] = {487.51, 198.05, 9350.78}; -static float P006[3] = {-457.61, 68.74, 9427.85}; -static float P007[3] = {156.52, -266.72, 10311.68}; -static float P008[3] = {-185.56, -266.51, 10310.47}; -static float P009[3] = {124.39, -261.46, 1942.34}; -static float P010[3] = {-130.05, -261.46, 1946.03}; -static float P011[3] = {141.07, -320.11, 1239.38}; -static float P012[3] = {156.48, -360.12, 2073.41}; -static float P013[3] = {162.00, -175.88, 2064.44}; -static float P014[3] = {88.16, -87.72, 2064.02}; -static float P015[3] = {-65.21, -96.13, 2064.02}; -static float P016[3] = {-156.48, -180.96, 2064.44}; -static float P017[3] = {-162.00, -368.93, 2082.39}; -static float P018[3] = {-88.16, -439.22, 2082.39}; -static float P019[3] = {65.21, -440.32, 2083.39}; -static float P020[3] = {246.87, -356.02, 2576.95}; -static float P021[3] = {253.17, -111.15, 2567.15}; -static float P022[3] = {132.34, 51.41, 2559.84}; -static float P023[3] = {-97.88, 40.44, 2567.15}; -static float P024[3] = {-222.97, -117.49, 2567.15}; -static float P025[3] = {-252.22, -371.53, 2569.92}; -static float P026[3] = {-108.44, -518.19, 2586.75}; -static float P027[3] = {97.88, -524.79, 2586.75}; -static float P028[3] = {370.03, -421.19, 3419.70}; -static float P029[3] = {351.15, -16.98, 3423.17}; -static float P030[3] = {200.66, 248.46, 3430.37}; -static float P031[3] = {-148.42, 235.02, 3417.91}; -static float P032[3] = {-360.21, -30.27, 3416.84}; -static float P033[3] = {-357.90, -414.89, 3407.04}; -static float P034[3] = {-148.88, -631.35, 3409.90}; -static float P035[3] = {156.38, -632.59, 3419.70}; -static float P036[3] = {462.61, -469.21, 4431.51}; -static float P037[3] = {466.60, 102.25, 4434.98}; -static float P038[3] = {243.05, 474.34, 4562.02}; -static float P039[3] = {-191.23, 474.40, 4554.42}; -static float P040[3] = {-476.12, 111.05, 4451.11}; -static float P041[3] = {-473.36, -470.74, 4444.78}; -static float P042[3] = {-266.95, -748.41, 4447.78}; -static float P043[3] = {211.14, -749.91, 4429.73}; -static float P044[3] = {680.57, -370.27, 5943.46}; -static float P045[3] = {834.01, 363.09, 6360.63}; -static float P046[3] = {371.29, 804.51, 6486.26}; -static float P047[3] = {-291.43, 797.22, 6494.28}; -static float P048[3] = {-784.13, 370.75, 6378.01}; -static float P049[3] = {-743.29, -325.82, 5943.46}; -static float P050[3] = {-383.24, -804.77, 5943.46}; -static float P051[3] = {283.47, -846.09, 5943.46}; -static float iP001[3] = {5.68, -300.95, 1324.70}; -static float iP009[3] = {124.39, -261.46, 1942.34}; -static float iP010[3] = {-130.05, -261.46, 1946.03}; -static float iP011[3] = {141.07, -320.11, 1239.38}; -static float iP012[3] = {156.48, -360.12, 2073.41}; -static float iP013[3] = {162.00, -175.88, 2064.44}; -static float iP014[3] = {88.16, -87.72, 2064.02}; -static float iP015[3] = {-65.21, -96.13, 2064.02}; -static float iP016[3] = {-156.48, -180.96, 2064.44}; -static float iP017[3] = {-162.00, -368.93, 2082.39}; -static float iP018[3] = {-88.16, -439.22, 2082.39}; -static float iP019[3] = {65.21, -440.32, 2083.39}; -static float iP020[3] = {246.87, -356.02, 2576.95}; -static float iP021[3] = {253.17, -111.15, 2567.15}; -static float iP022[3] = {132.34, 51.41, 2559.84}; -static float iP023[3] = {-97.88, 40.44, 2567.15}; -static float iP024[3] = {-222.97, -117.49, 2567.15}; -static float iP025[3] = {-252.22, -371.53, 2569.92}; -static float iP026[3] = {-108.44, -518.19, 2586.75}; -static float iP027[3] = {97.88, -524.79, 2586.75}; -static float iP028[3] = {370.03, -421.19, 3419.70}; -static float iP029[3] = {351.15, -16.98, 3423.17}; -static float iP030[3] = {200.66, 248.46, 3430.37}; -static float iP031[3] = {-148.42, 235.02, 3417.91}; -static float iP032[3] = {-360.21, -30.27, 3416.84}; -static float iP033[3] = {-357.90, -414.89, 3407.04}; -static float iP034[3] = {-148.88, -631.35, 3409.90}; -static float iP035[3] = {156.38, -632.59, 3419.70}; -static float iP036[3] = {462.61, -469.21, 4431.51}; -static float iP037[3] = {466.60, 102.25, 4434.98}; -static float iP038[3] = {243.05, 474.34, 4562.02}; -static float iP039[3] = {-191.23, 474.40, 4554.42}; -static float iP040[3] = {-476.12, 111.05, 4451.11}; -static float iP041[3] = {-473.36, -470.74, 4444.78}; -static float iP042[3] = {-266.95, -748.41, 4447.78}; -static float iP043[3] = {211.14, -749.91, 4429.73}; -static float iP044[3] = {680.57, -370.27, 5943.46}; -static float iP045[3] = {834.01, 363.09, 6360.63}; -static float iP046[3] = {371.29, 804.51, 6486.26}; -static float iP047[3] = {-291.43, 797.22, 6494.28}; -static float iP048[3] = {-784.13, 370.75, 6378.01}; -static float iP049[3] = {-743.29, -325.82, 5943.46}; -static float iP050[3] = {-383.24, -804.77, 5943.46}; -static float iP051[3] = {283.47, -846.09, 5943.46}; -static float P052[3] = {599.09, -300.15, 7894.03}; -static float P053[3] = {735.48, 306.26, 7911.92}; -static float P054[3] = {246.22, 558.53, 8460.50}; -static float P055[3] = {-230.41, 559.84, 8473.23}; -static float P056[3] = {-698.66, 320.83, 7902.59}; -static float P057[3] = {-643.29, -299.16, 7902.59}; -static float P058[3] = {-341.47, -719.30, 7902.59}; -static float P059[3] = {252.57, -756.12, 7902.59}; -static float P060[3] = {458.39, -265.31, 9355.44}; -static float P062[3] = {224.04, 338.75, 9450.30}; -static float P063[3] = {-165.71, 341.04, 9462.35}; -static float P064[3] = {-298.11, 110.13, 10180.37}; -static float P065[3] = {-473.99, -219.71, 9355.44}; -static float P066[3] = {-211.97, -479.87, 9355.44}; -static float P067[3] = {192.86, -491.45, 9348.73}; -static float P068[3] = {-136.29, -319.84, 1228.73}; -static float P069[3] = {1111.17, -314.14, 1314.19}; -static float P070[3] = {-1167.34, -321.61, 1319.45}; -static float P071[3] = {1404.86, -306.66, 1235.45}; -static float P072[3] = {-1409.73, -314.14, 1247.66}; -static float P073[3] = {1254.01, -296.87, 1544.58}; -static float P074[3] = {-1262.09, -291.70, 1504.26}; -static float P075[3] = {965.71, -269.26, 1742.65}; -static float P076[3] = {-900.97, -276.74, 1726.07}; -static float iP068[3] = {-136.29, -319.84, 1228.73}; -static float iP069[3] = {1111.17, -314.14, 1314.19}; -static float iP070[3] = {-1167.34, -321.61, 1319.45}; -static float iP071[3] = {1404.86, -306.66, 1235.45}; -static float iP072[3] = {-1409.73, -314.14, 1247.66}; -static float iP073[3] = {1254.01, -296.87, 1544.58}; -static float iP074[3] = {-1262.09, -291.70, 1504.26}; -static float iP075[3] = {965.71, -269.26, 1742.65}; -static float iP076[3] = {-900.97, -276.74, 1726.07}; -static float P077[3] = {1058.00, -448.81, 8194.66}; -static float P078[3] = {-1016.51, -456.43, 8190.62}; -static float P079[3] = {-1515.96, -676.45, 7754.93}; -static float P080[3] = {1856.75, -830.34, 7296.56}; -static float P081[3] = {1472.16, -497.38, 7399.68}; -static float P082[3] = {-1775.26, -829.51, 7298.46}; -static float P083[3] = {911.09, -252.51, 7510.99}; -static float P084[3] = {-1451.94, -495.62, 7384.30}; -static float P085[3] = {1598.75, -669.26, 7769.90}; -static float P086[3] = {-836.53, -250.08, 7463.25}; -static float P087[3] = {722.87, -158.18, 8006.41}; -static float P088[3] = {-688.86, -162.28, 7993.89}; -static float P089[3] = {-626.92, -185.30, 8364.98}; -static float P090[3] = {647.72, -189.46, 8354.99}; -static float P091[3] = {0.00, 835.01, 5555.62}; -static float P092[3] = {0.00, 1350.18, 5220.86}; -static float P093[3] = {0.00, 1422.94, 5285.27}; -static float P094[3] = {0.00, 1296.75, 5650.19}; -static float P095[3] = {0.00, 795.63, 6493.88}; -static float iP091[3] = {0.00, 835.01, 5555.62}; -static float iP092[3] = {0.00, 1350.18, 5220.86}; -static float iP093[3] = {0.00, 1422.94, 5285.27}; -static float iP094[3] = {0.00, 1296.75, 5650.19}; -static float iP095[3] = {0.00, 795.63, 6493.88}; -static float P097[3] = {-194.91, -357.14, 10313.32}; -static float P098[3] = {135.35, -357.66, 10307.94}; -static float iP097[3] = {-194.91, -357.14, 10313.32}; -static float iP098[3] = {135.35, -357.66, 10307.94}; -static float P099[3] = {-380.53, -221.14, 9677.98}; -static float P100[3] = {0.00, 412.99, 9629.33}; -static float P102[3] = {59.51, -412.55, 10677.58}; -static float iP102[3] = {59.51, -412.55, 10677.58}; -static float P103[3] = {6.50, 484.74, 9009.94}; -static float P105[3] = {-41.86, 476.51, 9078.17}; -static float P108[3] = {49.20, 476.83, 9078.24}; -static float P110[3] = {-187.62, -410.04, 10674.12}; -static float iP110[3] = {-187.62, -410.04, 10674.12}; -static float P111[3] = {-184.25, -318.70, 10723.88}; -static float iP111[3] = {-184.25, -318.70, 10723.88}; -static float P112[3] = {-179.61, -142.81, 10670.26}; -static float P113[3] = {57.43, -147.94, 10675.26}; -static float P114[3] = {54.06, -218.90, 10712.44}; -static float P115[3] = {-186.35, -212.09, 10713.76}; -static float P116[3] = {205.90, -84.61, 10275.97}; -static float P117[3] = {-230.96, -83.26, 10280.09}; -static float iP118[3] = {216.78, -509.17, 10098.94}; -static float iP119[3] = {-313.21, -510.79, 10102.62}; -static float P118[3] = {216.78, -509.17, 10098.94}; -static float P119[3] = {-313.21, -510.79, 10102.62}; -static float P120[3] = {217.95, 96.34, 10161.62}; -static float P121[3] = {71.99, -319.74, 10717.70}; -static float iP121[3] = {71.99, -319.74, 10717.70}; -static float P122[3] = {0.00, 602.74, 5375.84}; -static float iP122[3] = {0.00, 602.74, 5375.84}; -static float P123[3] = {-448.94, -203.14, 9499.60}; -static float P124[3] = {-442.64, -185.20, 9528.07}; -static float P125[3] = {-441.07, -148.05, 9528.07}; -static float P126[3] = {-443.43, -128.84, 9499.60}; -static float P127[3] = {-456.87, -146.78, 9466.67}; -static float P128[3] = {-453.68, -183.93, 9466.67}; -static float P129[3] = {428.43, -124.08, 9503.03}; -static float P130[3] = {419.73, -142.14, 9534.56}; -static float P131[3] = {419.92, -179.96, 9534.56}; -static float P132[3] = {431.20, -199.73, 9505.26}; -static float P133[3] = {442.28, -181.67, 9475.96}; -static float P134[3] = {442.08, -143.84, 9475.96}; -/* *INDENT-ON* */ - -void -Dolphin001(void) -{ - glNormal3fv(N071); - glBegin(GL_POLYGON); - glVertex3fv(P001); - glVertex3fv(P068); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P076); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P070); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P076); - glVertex3fv(P070); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P070); - glVertex3fv(P072); - glVertex3fv(P074); - glEnd(); - glNormal3fv(N119); - glBegin(GL_POLYGON); - glVertex3fv(P072); - glVertex3fv(P070); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P074); - glVertex3fv(P070); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P070); - glVertex3fv(P068); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P076); - glVertex3fv(P068); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P001); - glVertex3fv(P010); - glEnd(); -} - -void -Dolphin002(void) -{ - glNormal3fv(N071); - glBegin(GL_POLYGON); - glVertex3fv(P011); - glVertex3fv(P001); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P075); - glVertex3fv(P011); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P011); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P075); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P071); - glVertex3fv(P069); - glVertex3fv(P073); - glEnd(); - glNormal3fv(N119); - glBegin(GL_POLYGON); - glVertex3fv(P001); - glVertex3fv(P011); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P009); - glVertex3fv(P011); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P011); - glVertex3fv(P069); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P073); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P071); - glVertex3fv(P073); - glEnd(); -} - -void -Dolphin003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glEnd(); -} - -void -Dolphin004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); -} - -void -Dolphin005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); -} - -void -Dolphin006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N122); - glVertex3fv(P122); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N091); - glVertex3fv(P091); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N122); - glVertex3fv(P122); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); -} - -void -Dolphin007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); -} - -void -Dolphin008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); -} - -void -Dolphin009(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); -} - -void -Dolphin010(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); -} - -void -Dolphin011(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N079); - glVertex3fv(P079); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N089); - glVertex3fv(P089); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); -} - -void -Dolphin012(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N067); - glVertex3fv(P067); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); -} - -void -Dolphin013(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N116); - glVertex3fv(P116); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N113); - glVertex3fv(P113); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N113); - glVertex3fv(P113); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N115); - glVertex3fv(P115); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N116); - glVertex3fv(P116); - glNormal3fv(N113); - glVertex3fv(P113); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P002); - glVertex3fv(P007); - glVertex3fv(P008); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P007); - glVertex3fv(P114); - glVertex3fv(P115); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N112); - glVertex3fv(P112); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N115); - glVertex3fv(P115); - glEnd(); -} - -void -Dolphin014(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N111); - glVertex3fv(P111); - glNormal3fv(N110); - glVertex3fv(P110); - glNormal3fv(N102); - glVertex3fv(P102); - glNormal3fv(N121); - glVertex3fv(P121); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N111); - glVertex3fv(P111); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N110); - glVertex3fv(P110); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N110); - glVertex3fv(P110); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P098); - glVertex3fv(P097); - glVertex3fv(P111); - glVertex3fv(P121); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P002); - glVertex3fv(P099); - glVertex3fv(P097); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N110); - glVertex3fv(P110); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N102); - glVertex3fv(P102); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N118); - glVertex3fv(P118); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N118); - glVertex3fv(P118); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N098); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N102); - glVertex3fv(P102); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N102); - glVertex3fv(P102); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N121); - glVertex3fv(P121); - glEnd(); -} - -void -Dolphin015(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N100); - glVertex3fv(P100); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N117); - glVertex3fv(P117); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); -} - -void -Dolphin016(void) -{ - - glDisable(GL_DEPTH_TEST); - glBegin(GL_POLYGON); - glVertex3fv(P123); - glVertex3fv(P124); - glVertex3fv(P125); - glVertex3fv(P126); - glVertex3fv(P127); - glVertex3fv(P128); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P129); - glVertex3fv(P130); - glVertex3fv(P131); - glVertex3fv(P132); - glVertex3fv(P133); - glVertex3fv(P134); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P103); - glVertex3fv(P105); - glVertex3fv(P108); - glEnd(); - glEnable(GL_DEPTH_TEST); -} - -void -DrawDolphin(fishRec * fish) -{ - float seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7; - float pitch, thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (10.0 * fish->v)) % 360; - - thrash = 70.0 * fish->v; - - seg0 = 1.0 * thrash * sin((fish->htail) * RRAD); - seg3 = 1.0 * thrash * sin((fish->htail) * RRAD); - seg1 = 2.0 * thrash * sin((fish->htail + 4.0) * RRAD); - seg2 = 3.0 * thrash * sin((fish->htail + 6.0) * RRAD); - seg4 = 4.0 * thrash * sin((fish->htail + 10.0) * RRAD); - seg5 = 4.5 * thrash * sin((fish->htail + 15.0) * RRAD); - seg6 = 5.0 * thrash * sin((fish->htail + 20.0) * RRAD); - seg7 = 6.0 * thrash * sin((fish->htail + 30.0) * RRAD); - - pitch = fish->v * sin((fish->htail + 180.0) * RRAD); - - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - chomp = 100.0; - - P012[1] = iP012[1] + seg5; - P013[1] = iP013[1] + seg5; - P014[1] = iP014[1] + seg5; - P015[1] = iP015[1] + seg5; - P016[1] = iP016[1] + seg5; - P017[1] = iP017[1] + seg5; - P018[1] = iP018[1] + seg5; - P019[1] = iP019[1] + seg5; - - P020[1] = iP020[1] + seg4; - P021[1] = iP021[1] + seg4; - P022[1] = iP022[1] + seg4; - P023[1] = iP023[1] + seg4; - P024[1] = iP024[1] + seg4; - P025[1] = iP025[1] + seg4; - P026[1] = iP026[1] + seg4; - P027[1] = iP027[1] + seg4; - - P028[1] = iP028[1] + seg2; - P029[1] = iP029[1] + seg2; - P030[1] = iP030[1] + seg2; - P031[1] = iP031[1] + seg2; - P032[1] = iP032[1] + seg2; - P033[1] = iP033[1] + seg2; - P034[1] = iP034[1] + seg2; - P035[1] = iP035[1] + seg2; - - P036[1] = iP036[1] + seg1; - P037[1] = iP037[1] + seg1; - P038[1] = iP038[1] + seg1; - P039[1] = iP039[1] + seg1; - P040[1] = iP040[1] + seg1; - P041[1] = iP041[1] + seg1; - P042[1] = iP042[1] + seg1; - P043[1] = iP043[1] + seg1; - - P044[1] = iP044[1] + seg0; - P045[1] = iP045[1] + seg0; - P046[1] = iP046[1] + seg0; - P047[1] = iP047[1] + seg0; - P048[1] = iP048[1] + seg0; - P049[1] = iP049[1] + seg0; - P050[1] = iP050[1] + seg0; - P051[1] = iP051[1] + seg0; - - P009[1] = iP009[1] + seg6; - P010[1] = iP010[1] + seg6; - P075[1] = iP075[1] + seg6; - P076[1] = iP076[1] + seg6; - - P001[1] = iP001[1] + seg7; - P011[1] = iP011[1] + seg7; - P068[1] = iP068[1] + seg7; - P069[1] = iP069[1] + seg7; - P070[1] = iP070[1] + seg7; - P071[1] = iP071[1] + seg7; - P072[1] = iP072[1] + seg7; - P073[1] = iP073[1] + seg7; - P074[1] = iP074[1] + seg7; - - P091[1] = iP091[1] + seg3; - P092[1] = iP092[1] + seg3; - P093[1] = iP093[1] + seg3; - P094[1] = iP094[1] + seg3; - P095[1] = iP095[1] + seg3; - P122[1] = iP122[1] + seg3 * 1.5; - - P097[1] = iP097[1] + chomp; - P098[1] = iP098[1] + chomp; - P102[1] = iP102[1] + chomp; - P110[1] = iP110[1] + chomp; - P111[1] = iP111[1] + chomp; - P121[1] = iP121[1] + chomp; - P118[1] = iP118[1] + chomp; - P119[1] = iP119[1] + chomp; - - glPushMatrix(); - - glRotatef(pitch, 1.0, 0.0, 0.0); - - glTranslatef(0.0, 0.0, 7000.0); - - glRotatef(180.0, 0.0, 1.0, 0.0); - - glEnable(GL_CULL_FACE); - Dolphin014(); - Dolphin010(); - Dolphin009(); - Dolphin012(); - Dolphin013(); - Dolphin006(); - Dolphin002(); - Dolphin001(); - Dolphin003(); - Dolphin015(); - Dolphin004(); - Dolphin005(); - Dolphin007(); - Dolphin008(); - Dolphin011(); - Dolphin016(); - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/shark.c b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/shark.c deleted file mode 100644 index 9c847dbafe..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/shark.c +++ /dev/null @@ -1,1308 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N002[3] = {0.000077 ,-0.020611 ,0.999788}; -static float N003[3] = {0.961425 ,0.258729 ,-0.093390}; -static float N004[3] = {0.510811 ,-0.769633 ,-0.383063}; -static float N005[3] = {0.400123 ,0.855734 ,-0.328055}; -static float N006[3] = {-0.770715 ,0.610204 ,-0.183440}; -static float N007[3] = {-0.915597 ,-0.373345 ,-0.149316}; -static float N008[3] = {-0.972788 ,0.208921 ,-0.100179}; -static float N009[3] = {-0.939713 ,-0.312268 ,-0.139383}; -static float N010[3] = {-0.624138 ,-0.741047 ,-0.247589}; -static float N011[3] = {0.591434 ,-0.768401 ,-0.244471}; -static float N012[3] = {0.935152 ,-0.328495 ,-0.132598}; -static float N013[3] = {0.997102 ,0.074243 ,-0.016593}; -static float N014[3] = {0.969995 ,0.241712 ,-0.026186}; -static float N015[3] = {0.844539 ,0.502628 ,-0.184714}; -static float N016[3] = {-0.906608 ,0.386308 ,-0.169787}; -static float N017[3] = {-0.970016 ,0.241698 ,-0.025516}; -static float N018[3] = {-0.998652 ,0.050493 ,-0.012045}; -static float N019[3] = {-0.942685 ,-0.333051 ,-0.020556}; -static float N020[3] = {-0.660944 ,-0.750276 ,0.015480}; -static float N021[3] = {0.503549 ,-0.862908 ,-0.042749}; -static float N022[3] = {0.953202 ,-0.302092 ,-0.012089}; -static float N023[3] = {0.998738 ,0.023574 ,0.044344}; -static float N024[3] = {0.979297 ,0.193272 ,0.060202}; -static float N025[3] = {0.798300 ,0.464885 ,0.382883}; -static float N026[3] = {-0.756590 ,0.452403 ,0.472126}; -static float N027[3] = {-0.953855 ,0.293003 ,0.065651}; -static float N028[3] = {-0.998033 ,0.040292 ,0.048028}; -static float N029[3] = {-0.977079 ,-0.204288 ,0.059858}; -static float N030[3] = {-0.729117 ,-0.675304 ,0.111140}; -static float N031[3] = {0.598361 ,-0.792753 ,0.116221}; -static float N032[3] = {0.965192 ,-0.252991 ,0.066332}; -static float N033[3] = {0.998201 ,-0.002790 ,0.059892}; -static float N034[3] = {0.978657 ,0.193135 ,0.070207}; -static float N035[3] = {0.718815 ,0.680392 ,0.142733}; -static float N036[3] = {-0.383096 ,0.906212 ,0.178936}; -static float N037[3] = {-0.952831 ,0.292590 ,0.080647}; -static float N038[3] = {-0.997680 ,0.032417 ,0.059861}; -static float N039[3] = {-0.982629 ,-0.169881 ,0.074700}; -static float N040[3] = {-0.695424 ,-0.703466 ,0.146700}; -static float N041[3] = {0.359323 ,-0.915531 ,0.180805}; -static float N042[3] = {0.943356 ,-0.319387 ,0.089842}; -static float N043[3] = {0.998272 ,-0.032435 ,0.048993}; -static float N044[3] = {0.978997 ,0.193205 ,0.065084}; -static float N045[3] = {0.872144 ,0.470094 ,-0.135565}; -static float N046[3] = {-0.664282 ,0.737945 ,-0.119027}; -static float N047[3] = {-0.954508 ,0.288570 ,0.075107}; -static float N048[3] = {-0.998273 ,0.032406 ,0.048993}; -static float N049[3] = {-0.979908 ,-0.193579 ,0.048038}; -static float N050[3] = {-0.858736 ,-0.507202 ,-0.072938}; -static float N051[3] = {0.643545 ,-0.763887 ,-0.048237}; -static float N052[3] = {0.955580 ,-0.288954 ,0.058068}; -static float N058[3] = {0.000050 ,0.793007 ,-0.609213}; -static float N059[3] = {0.913510 ,0.235418 ,-0.331779}; -static float N060[3] = {-0.807970 ,0.495000 ,-0.319625}; -static float N061[3] = {0.000000 ,0.784687 ,-0.619892}; -static float N062[3] = {0.000000 ,-1.000000 ,0.000000}; -static float N063[3] = {0.000000 ,1.000000 ,0.000000}; -static float N064[3] = {0.000000 ,1.000000 ,0.000000}; -static float N065[3] = {0.000000 ,1.000000 ,0.000000}; -static float N066[3] = {-0.055784 ,0.257059 ,0.964784}; -static float N069[3] = {-0.000505 ,-0.929775 ,-0.368127}; -static float N070[3] = {0.000000 ,1.000000 ,0.000000}; -static float P002[3] = {0.00, -36.59, 5687.72}; -static float P003[3] = {90.00, 114.73, 724.38}; -static float P004[3] = {58.24, -146.84, 262.35}; -static float P005[3] = {27.81, 231.52, 510.43}; -static float P006[3] = {-27.81, 230.43, 509.76}; -static float P007[3] = {-46.09, -146.83, 265.84}; -static float P008[3] = {-90.00, 103.84, 718.53}; -static float P009[3] = {-131.10, -165.92, 834.85}; -static float P010[3] = {-27.81, -285.31, 500.00}; -static float P011[3] = {27.81, -285.32, 500.00}; -static float P012[3] = {147.96, -170.89, 845.50}; -static float P013[3] = {180.00, 0.00, 2000.00}; -static float P014[3] = {145.62, 352.67, 2000.00}; -static float P015[3] = {55.62, 570.63, 2000.00}; -static float P016[3] = {-55.62, 570.64, 2000.00}; -static float P017[3] = {-145.62, 352.68, 2000.00}; -static float P018[3] = {-180.00, 0.01, 2000.00}; -static float P019[3] = {-178.20, -352.66, 2001.61}; -static float P020[3] = {-55.63, -570.63, 2000.00}; -static float P021[3] = {55.62, -570.64, 2000.00}; -static float P022[3] = {179.91, -352.69, 1998.39}; -static float P023[3] = {150.00, 0.00, 3000.00}; -static float P024[3] = {121.35, 293.89, 3000.00}; -static float P025[3] = {46.35, 502.93, 2883.09}; -static float P026[3] = {-46.35, 497.45, 2877.24}; -static float P027[3] = {-121.35, 293.90, 3000.00}; -static float P028[3] = {-150.00, 0.00, 3000.00}; -static float P029[3] = {-152.21, -304.84, 2858.68}; -static float P030[3] = {-46.36, -475.52, 3000.00}; -static float P031[3] = {46.35, -475.53, 3000.00}; -static float P032[3] = {155.64, -304.87, 2863.50}; -static float P033[3] = {90.00, 0.00, 4000.00}; -static float P034[3] = {72.81, 176.33, 4000.00}; -static float P035[3] = {27.81, 285.32, 4000.00}; -static float P036[3] = {-27.81, 285.32, 4000.00}; -static float P037[3] = {-72.81, 176.34, 4000.00}; -static float P038[3] = {-90.00, 0.00, 4000.00}; -static float P039[3] = {-72.81, -176.33, 4000.00}; -static float P040[3] = {-27.81, -285.31, 4000.00}; -static float P041[3] = {27.81, -285.32, 4000.00}; -static float P042[3] = {72.81, -176.34, 4000.00}; -static float P043[3] = {30.00, 0.00, 5000.00}; -static float P044[3] = {24.27, 58.78, 5000.00}; -static float P045[3] = {9.27, 95.11, 5000.00}; -static float P046[3] = {-9.27, 95.11, 5000.00}; -static float P047[3] = {-24.27, 58.78, 5000.00}; -static float P048[3] = {-30.00, 0.00, 5000.00}; -static float P049[3] = {-24.27, -58.78, 5000.00}; -static float P050[3] = {-9.27, -95.10, 5000.00}; -static float P051[3] = {9.27, -95.11, 5000.00}; -static float P052[3] = {24.27, -58.78, 5000.00}; -static float P058[3] = {0.00, 1212.72, 2703.08}; -static float P059[3] = {50.36, 0.00, 108.14}; -static float P060[3] = {-22.18, 0.00, 108.14}; -static float P061[3] = {0.00, 1181.61, 6344.65}; -static float P062[3] = {516.45, -887.08, 2535.45}; -static float P063[3] = {-545.69, -879.31, 2555.63}; -static float P064[3] = {618.89, -1005.64, 2988.32}; -static float P065[3] = {-635.37, -1014.79, 2938.68}; -static float P066[3] = {0.00, 1374.43, 3064.18}; -static float P069[3] = {0.00, -418.25, 5765.04}; -static float P070[3] = {0.00, 1266.91, 6629.60}; -static float P071[3] = {-139.12, -124.96, 997.98}; -static float P072[3] = {-139.24, -110.18, 1020.68}; -static float P073[3] = {-137.33, -94.52, 1022.63}; -static float P074[3] = {-137.03, -79.91, 996.89}; -static float P075[3] = {-135.21, -91.48, 969.14}; -static float P076[3] = {-135.39, -110.87, 968.76}; -static float P077[3] = {150.23, -78.44, 995.53}; -static float P078[3] = {152.79, -92.76, 1018.46}; -static float P079[3] = {154.19, -110.20, 1020.55}; -static float P080[3] = {151.33, -124.15, 993.77}; -static float P081[3] = {150.49, -111.19, 969.86}; -static float P082[3] = {150.79, -92.41, 969.70}; -static float iP002[3] = {0.00, -36.59, 5687.72}; -static float iP004[3] = {58.24, -146.84, 262.35}; -static float iP007[3] = {-46.09, -146.83, 265.84}; -static float iP010[3] = {-27.81, -285.31, 500.00}; -static float iP011[3] = {27.81, -285.32, 500.00}; -static float iP023[3] = {150.00, 0.00, 3000.00}; -static float iP024[3] = {121.35, 293.89, 3000.00}; -static float iP025[3] = {46.35, 502.93, 2883.09}; -static float iP026[3] = {-46.35, 497.45, 2877.24}; -static float iP027[3] = {-121.35, 293.90, 3000.00}; -static float iP028[3] = {-150.00, 0.00, 3000.00}; -static float iP029[3] = {-121.35, -304.84, 2853.86}; -static float iP030[3] = {-46.36, -475.52, 3000.00}; -static float iP031[3] = {46.35, -475.53, 3000.00}; -static float iP032[3] = {121.35, -304.87, 2853.86}; -static float iP033[3] = {90.00, 0.00, 4000.00}; -static float iP034[3] = {72.81, 176.33, 4000.00}; -static float iP035[3] = {27.81, 285.32, 4000.00}; -static float iP036[3] = {-27.81, 285.32, 4000.00}; -static float iP037[3] = {-72.81, 176.34, 4000.00}; -static float iP038[3] = {-90.00, 0.00, 4000.00}; -static float iP039[3] = {-72.81, -176.33, 4000.00}; -static float iP040[3] = {-27.81, -285.31, 4000.00}; -static float iP041[3] = {27.81, -285.32, 4000.00}; -static float iP042[3] = {72.81, -176.34, 4000.00}; -static float iP043[3] = {30.00, 0.00, 5000.00}; -static float iP044[3] = {24.27, 58.78, 5000.00}; -static float iP045[3] = {9.27, 95.11, 5000.00}; -static float iP046[3] = {-9.27, 95.11, 5000.00}; -static float iP047[3] = {-24.27, 58.78, 5000.00}; -static float iP048[3] = {-30.00, 0.00, 5000.00}; -static float iP049[3] = {-24.27, -58.78, 5000.00}; -static float iP050[3] = {-9.27, -95.10, 5000.00}; -static float iP051[3] = {9.27, -95.11, 5000.00}; -static float iP052[3] = {24.27, -58.78, 5000.00}; -static float iP061[3] = {0.00, 1181.61, 6344.65}; -static float iP069[3] = {0.00, -418.25, 5765.04}; -static float iP070[3] = {0.00, 1266.91, 6629.60}; -/* *INDENT-ON* */ - -void -Fish001(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N017); - glVertex3fv(P017); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N007); - glVertex3fv(P007); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N011); - glVertex3fv(P011); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N011); - glVertex3fv(P011); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P071); - glVertex3fv(P072); - glVertex3fv(P073); - glVertex3fv(P074); - glVertex3fv(P075); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P077); - glVertex3fv(P078); - glVertex3fv(P079); - glVertex3fv(P080); - glVertex3fv(P081); - glVertex3fv(P082); - glEnd(); -} - -void -Fish002(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); -} - -void -Fish003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); -} - -void -Fish004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N061); - glVertex3fv(P061); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N070); - glVertex3fv(P070); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N061); - glVertex3fv(P061); - glEnd(); -} - -void -Fish005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N069); - glVertex3fv(P069); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N069); - glVertex3fv(P069); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); -} - -void -Fish006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); -} - -void -Fish007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); -} - -void -Fish008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); -} - -void -Fish009(void) -{ - glBegin(GL_POLYGON); - glVertex3fv(P059); - glVertex3fv(P012); - glVertex3fv(P009); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P012); - glVertex3fv(P004); - glVertex3fv(P007); - glVertex3fv(P009); - glEnd(); -} - -void -Fish_1(void) -{ - Fish004(); - Fish005(); - Fish003(); - Fish007(); - Fish006(); - Fish002(); - Fish008(); - Fish009(); - Fish001(); -} - -void -Fish_2(void) -{ - Fish005(); - Fish004(); - Fish003(); - Fish008(); - Fish006(); - Fish002(); - Fish007(); - Fish009(); - Fish001(); -} - -void -Fish_3(void) -{ - Fish005(); - Fish004(); - Fish007(); - Fish003(); - Fish002(); - Fish008(); - Fish009(); - Fish001(); - Fish006(); -} - -void -Fish_4(void) -{ - Fish005(); - Fish004(); - Fish008(); - Fish003(); - Fish002(); - Fish007(); - Fish009(); - Fish001(); - Fish006(); -} - -void -Fish_5(void) -{ - Fish009(); - Fish006(); - Fish007(); - Fish001(); - Fish002(); - Fish003(); - Fish008(); - Fish004(); - Fish005(); -} - -void -Fish_6(void) -{ - Fish009(); - Fish006(); - Fish008(); - Fish001(); - Fish002(); - Fish007(); - Fish003(); - Fish004(); - Fish005(); -} - -void -Fish_7(void) -{ - Fish009(); - Fish001(); - Fish007(); - Fish005(); - Fish002(); - Fish008(); - Fish003(); - Fish004(); - Fish006(); -} - -void -Fish_8(void) -{ - Fish009(); - Fish008(); - Fish001(); - Fish002(); - Fish007(); - Fish003(); - Fish005(); - Fish004(); - Fish006(); -} - -void -DrawShark(fishRec * fish) -{ - float mat[4][4]; - int n; - float seg1, seg2, seg3, seg4, segup; - float thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360; - - thrash = 50.0 * fish->v; - - seg1 = 0.6 * thrash * sin(fish->htail * RRAD); - seg2 = 1.8 * thrash * sin((fish->htail + 45.0) * RRAD); - seg3 = 3.0 * thrash * sin((fish->htail + 90.0) * RRAD); - seg4 = 4.0 * thrash * sin((fish->htail + 110.0) * RRAD); - - chomp = 0.0; - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - P004[1] = iP004[1] + chomp; - P007[1] = iP007[1] + chomp; - P010[1] = iP010[1] + chomp; - P011[1] = iP011[1] + chomp; - - P023[0] = iP023[0] + seg1; - P024[0] = iP024[0] + seg1; - P025[0] = iP025[0] + seg1; - P026[0] = iP026[0] + seg1; - P027[0] = iP027[0] + seg1; - P028[0] = iP028[0] + seg1; - P029[0] = iP029[0] + seg1; - P030[0] = iP030[0] + seg1; - P031[0] = iP031[0] + seg1; - P032[0] = iP032[0] + seg1; - P033[0] = iP033[0] + seg2; - P034[0] = iP034[0] + seg2; - P035[0] = iP035[0] + seg2; - P036[0] = iP036[0] + seg2; - P037[0] = iP037[0] + seg2; - P038[0] = iP038[0] + seg2; - P039[0] = iP039[0] + seg2; - P040[0] = iP040[0] + seg2; - P041[0] = iP041[0] + seg2; - P042[0] = iP042[0] + seg2; - P043[0] = iP043[0] + seg3; - P044[0] = iP044[0] + seg3; - P045[0] = iP045[0] + seg3; - P046[0] = iP046[0] + seg3; - P047[0] = iP047[0] + seg3; - P048[0] = iP048[0] + seg3; - P049[0] = iP049[0] + seg3; - P050[0] = iP050[0] + seg3; - P051[0] = iP051[0] + seg3; - P052[0] = iP052[0] + seg3; - P002[0] = iP002[0] + seg4; - P061[0] = iP061[0] + seg4; - P069[0] = iP069[0] + seg4; - P070[0] = iP070[0] + seg4; - - fish->vtail += ((fish->dtheta - fish->vtail) * 0.1); - - if (fish->vtail > 0.5) { - fish->vtail = 0.5; - } else if (fish->vtail < -0.5) { - fish->vtail = -0.5; - } - segup = thrash * fish->vtail; - - P023[1] = iP023[1] + segup; - P024[1] = iP024[1] + segup; - P025[1] = iP025[1] + segup; - P026[1] = iP026[1] + segup; - P027[1] = iP027[1] + segup; - P028[1] = iP028[1] + segup; - P029[1] = iP029[1] + segup; - P030[1] = iP030[1] + segup; - P031[1] = iP031[1] + segup; - P032[1] = iP032[1] + segup; - P033[1] = iP033[1] + segup * 5.0; - P034[1] = iP034[1] + segup * 5.0; - P035[1] = iP035[1] + segup * 5.0; - P036[1] = iP036[1] + segup * 5.0; - P037[1] = iP037[1] + segup * 5.0; - P038[1] = iP038[1] + segup * 5.0; - P039[1] = iP039[1] + segup * 5.0; - P040[1] = iP040[1] + segup * 5.0; - P041[1] = iP041[1] + segup * 5.0; - P042[1] = iP042[1] + segup * 5.0; - P043[1] = iP043[1] + segup * 12.0; - P044[1] = iP044[1] + segup * 12.0; - P045[1] = iP045[1] + segup * 12.0; - P046[1] = iP046[1] + segup * 12.0; - P047[1] = iP047[1] + segup * 12.0; - P048[1] = iP048[1] + segup * 12.0; - P049[1] = iP049[1] + segup * 12.0; - P050[1] = iP050[1] + segup * 12.0; - P051[1] = iP051[1] + segup * 12.0; - P052[1] = iP052[1] + segup * 12.0; - P002[1] = iP002[1] + segup * 17.0; - P061[1] = iP061[1] + segup * 17.0; - P069[1] = iP069[1] + segup * 17.0; - P070[1] = iP070[1] + segup * 17.0; - - glPushMatrix(); - - glTranslatef(0.0, 0.0, -3000.0); - - glGetFloatv(GL_MODELVIEW_MATRIX, &mat[0][0]); - n = 0; - if (mat[0][2] >= 0.0) { - n += 1; - } - if (mat[1][2] >= 0.0) { - n += 2; - } - if (mat[2][2] >= 0.0) { - n += 4; - } - glScalef(2.0, 1.0, 1.0); - - glEnable(GL_CULL_FACE); - switch (n) { - case 0: - Fish_1(); - break; - case 1: - Fish_2(); - break; - case 2: - Fish_3(); - break; - case 3: - Fish_4(); - break; - case 4: - Fish_5(); - break; - case 5: - Fish_6(); - break; - case 6: - Fish_7(); - break; - case 7: - Fish_8(); - break; - } - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/swim.c b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/swim.c deleted file mode 100644 index cac7b60952..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/swim.c +++ /dev/null @@ -1,188 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include /* For rand(). */ -#include -#include "atlantis.h" - -void -FishTransform(fishRec * fish) -{ - - glTranslatef(fish->y, fish->z, -fish->x); - glRotatef(-fish->psi, 0.0, 1.0, 0.0); - glRotatef(fish->theta, 1.0, 0.0, 0.0); - glRotatef(-fish->phi, 0.0, 0.0, 1.0); -} - -void -WhalePilot(fishRec * fish) -{ - - fish->phi = -20.0; - fish->theta = 0.0; - fish->psi -= 0.5; - - fish->x += WHALESPEED * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD); - fish->y += WHALESPEED * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD); - fish->z += WHALESPEED * fish->v * sin(fish->theta / RAD); -} - -void -SharkPilot(fishRec * fish) -{ - static int sign = 1; - float X, Y, Z, tpsi, ttheta, thetal; - - fish->xt = 60000.0; - fish->yt = 0.0; - fish->zt = 0.0; - - X = fish->xt - fish->x; - Y = fish->yt - fish->y; - Z = fish->zt - fish->z; - - thetal = fish->theta; - - ttheta = RAD * atan(Z / (sqrt(X * X + Y * Y))); - - if (ttheta > fish->theta + 0.25) { - fish->theta += 0.5; - } else if (ttheta < fish->theta - 0.25) { - fish->theta -= 0.5; - } - if (fish->theta > 90.0) { - fish->theta = 90.0; - } - if (fish->theta < -90.0) { - fish->theta = -90.0; - } - fish->dtheta = fish->theta - thetal; - - tpsi = RAD * atan2(Y, X); - - fish->attack = 0; - - if (fabs(tpsi - fish->psi) < 10.0) { - fish->attack = 1; - } else if (fabs(tpsi - fish->psi) < 45.0) { - if (fish->psi > tpsi) { - fish->psi -= 0.5; - if (fish->psi < -180.0) { - fish->psi += 360.0; - } - } else if (fish->psi < tpsi) { - fish->psi += 0.5; - if (fish->psi > 180.0) { - fish->psi -= 360.0; - } - } - } else { - if (rand() % 100 > 98) { - sign = 1 - sign; - } - fish->psi += sign; - if (fish->psi > 180.0) { - fish->psi -= 360.0; - } - if (fish->psi < -180.0) { - fish->psi += 360.0; - } - } - - if (fish->attack) { - if (fish->v < 1.1) { - fish->spurt = 1; - } - if (fish->spurt) { - fish->v += 0.2; - } - if (fish->v > 5.0) { - fish->spurt = 0; - } - if ((fish->v > 1.0) && (!fish->spurt)) { - fish->v -= 0.2; - } - } else { - if (!(rand() % 400) && (!fish->spurt)) { - fish->spurt = 1; - } - if (fish->spurt) { - fish->v += 0.05; - } - if (fish->v > 3.0) { - fish->spurt = 0; - } - if ((fish->v > 1.0) && (!fish->spurt)) { - fish->v -= 0.05; - } - } - - fish->x += SHARKSPEED * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD); - fish->y += SHARKSPEED * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD); - fish->z += SHARKSPEED * fish->v * sin(fish->theta / RAD); -} - -void -SharkMiss(int i) -{ - int j; - float avoid, thetal; - float X, Y, Z, R; - - for (j = 0; j < NUM_SHARKS; j++) { - if (j != i) { - X = sharks[j].x - sharks[i].x; - Y = sharks[j].y - sharks[i].y; - Z = sharks[j].z - sharks[i].z; - - R = sqrt(X * X + Y * Y + Z * Z); - - avoid = 1.0; - thetal = sharks[i].theta; - - if (R < SHARKSIZE) { - if (Z > 0.0) { - sharks[i].theta -= avoid; - } else { - sharks[i].theta += avoid; - } - } - sharks[i].dtheta += (sharks[i].theta - thetal); - } - } -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/whale.c b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/whale.c deleted file mode 100644 index 828640ad04..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/whale.c +++ /dev/null @@ -1,1798 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N001[3] = {0.019249 ,0.011340 ,-0.999750}; -static float N002[3] = {-0.132579 ,0.954547 ,0.266952}; -static float N003[3] = {-0.196061 ,0.980392 ,-0.019778}; -static float N004[3] = {0.695461 ,0.604704 ,0.388158}; -static float N005[3] = {0.870600 ,0.425754 ,0.246557}; -static float N006[3] = {-0.881191 ,0.392012 ,0.264251}; -static float N008[3] = {-0.341437 ,0.887477 ,0.309523}; -static float N009[3] = {0.124035 ,-0.992278 ,0.000000}; -static float N010[3] = {0.242536 ,0.000000 ,-0.970143}; -static float N011[3] = {0.588172 ,0.000000 ,0.808736}; -static float N012[3] = {0.929824 ,-0.340623 ,-0.139298}; -static float N013[3] = {0.954183 ,0.267108 ,-0.134865}; -static float N014[3] = {0.495127 ,0.855436 ,-0.151914}; -static float N015[3] = {-0.390199 ,0.906569 ,-0.160867}; -static float N016[3] = {-0.923605 ,0.354581 ,-0.145692}; -static float N017[3] = {-0.955796 ,-0.260667 ,-0.136036}; -static float N018[3] = {-0.501283 ,-0.853462 ,-0.142540}; -static float N019[3] = {0.405300 ,-0.901974 ,-0.148913}; -static float N020[3] = {0.909913 ,-0.392746 ,-0.133451}; -static float N021[3] = {0.936494 ,0.331147 ,-0.115414}; -static float N022[3] = {0.600131 ,0.793724 ,-0.099222}; -static float N023[3] = {-0.231556 ,0.968361 ,-0.093053}; -static float N024[3] = {-0.844369 ,0.525330 ,-0.105211}; -static float N025[3] = {-0.982725 ,-0.136329 ,-0.125164}; -static float N026[3] = {-0.560844 ,-0.822654 ,-0.093241}; -static float N027[3] = {0.263884 ,-0.959981 ,-0.093817}; -static float N028[3] = {0.842057 ,-0.525192 ,-0.122938}; -static float N029[3] = {0.921620 ,0.367565 ,-0.124546}; -static float N030[3] = {0.613927 ,0.784109 ,-0.090918}; -static float N031[3] = {-0.448754 ,0.888261 ,-0.098037}; -static float N032[3] = {-0.891865 ,0.434376 ,-0.126077}; -static float N033[3] = {-0.881447 ,-0.448017 ,-0.149437}; -static float N034[3] = {-0.345647 ,-0.922057 ,-0.174183}; -static float N035[3] = {0.307998 ,-0.941371 ,-0.137688}; -static float N036[3] = {0.806316 ,-0.574647 ,-0.140124}; -static float N037[3] = {0.961346 ,0.233646 ,-0.145681}; -static float N038[3] = {0.488451 ,0.865586 ,-0.110351}; -static float N039[3] = {-0.374290 ,0.921953 ,-0.099553}; -static float N040[3] = {-0.928504 ,0.344533 ,-0.138485}; -static float N041[3] = {-0.918419 ,-0.371792 ,-0.135189}; -static float N042[3] = {-0.520666 ,-0.833704 ,-0.183968}; -static float N043[3] = {0.339204 ,-0.920273 ,-0.195036}; -static float N044[3] = {0.921475 ,-0.387382 ,-0.028636}; -static float N045[3] = {0.842465 ,0.533335 ,-0.076204}; -static float N046[3] = {0.380110 ,0.924939 ,0.002073}; -static float N047[3] = {-0.276128 ,0.961073 ,-0.009579}; -static float N048[3] = {-0.879684 ,0.473001 ,-0.049250}; -static float N049[3] = {-0.947184 ,-0.317614 ,-0.044321}; -static float N050[3] = {-0.642059 ,-0.764933 ,-0.051363}; -static float N051[3] = {0.466794 ,-0.880921 ,-0.077990}; -static float N052[3] = {0.898509 ,-0.432277 ,0.076279}; -static float N053[3] = {0.938985 ,0.328141 ,0.103109}; -static float N054[3] = {0.442420 ,0.895745 ,0.043647}; -static float N055[3] = {-0.255163 ,0.966723 ,0.018407}; -static float N056[3] = {-0.833769 ,0.540650 ,0.111924}; -static float N057[3] = {-0.953653 ,-0.289939 ,0.080507}; -static float N058[3] = {-0.672357 ,-0.730524 ,0.119461}; -static float N059[3] = {0.522249 ,-0.846652 ,0.102157}; -static float N060[3] = {0.885868 ,-0.427631 ,0.179914}; -static float N062[3] = {0.648942 ,0.743116 ,0.163255}; -static float N063[3] = {-0.578967 ,0.807730 ,0.111219}; -static float N065[3] = {-0.909864 ,-0.352202 ,0.219321}; -static float N066[3] = {-0.502541 ,-0.818090 ,0.279610}; -static float N067[3] = {0.322919 ,-0.915358 ,0.240504}; -static float N068[3] = {0.242536 ,0.000000 ,-0.970143}; -static float N069[3] = {0.000000 ,1.000000 ,0.000000}; -static float N070[3] = {0.000000 ,1.000000 ,0.000000}; -static float N071[3] = {0.000000 ,1.000000 ,0.000000}; -static float N072[3] = {0.000000 ,1.000000 ,0.000000}; -static float N073[3] = {0.000000 ,1.000000 ,0.000000}; -static float N074[3] = {0.000000 ,1.000000 ,0.000000}; -static float N075[3] = {0.031220 ,0.999025 ,-0.031220}; -static float N076[3] = {0.000000 ,1.000000 ,0.000000}; -static float N077[3] = {0.446821 ,0.893642 ,0.041889}; -static float N078[3] = {0.863035 ,-0.100980 ,0.494949}; -static float N079[3] = {0.585597 ,-0.808215 ,0.062174}; -static float N080[3] = {0.000000 ,1.000000 ,0.000000}; -static float N081[3] = {1.000000 ,0.000000 ,0.000000}; -static float N082[3] = {0.000000 ,1.000000 ,0.000000}; -static float N083[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N084[3] = {-0.478893 ,0.837129 ,-0.264343}; -static float N085[3] = {0.000000 ,1.000000 ,0.000000}; -static float N086[3] = {0.763909 ,0.539455 ,-0.354163}; -static float N087[3] = {0.446821 ,0.893642 ,0.041889}; -static float N088[3] = {0.385134 ,-0.908288 ,0.163352}; -static float N089[3] = {-0.605952 ,0.779253 ,-0.159961}; -static float N090[3] = {0.000000 ,1.000000 ,0.000000}; -static float N091[3] = {0.000000 ,1.000000 ,0.000000}; -static float N092[3] = {0.000000 ,1.000000 ,0.000000}; -static float N093[3] = {0.000000 ,1.000000 ,0.000000}; -static float N094[3] = {1.000000 ,0.000000 ,0.000000}; -static float N095[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N096[3] = {0.644444 ,-0.621516 ,0.445433}; -static float N097[3] = {-0.760896 ,-0.474416 ,0.442681}; -static float N098[3] = {0.636888 ,-0.464314 ,0.615456}; -static float N099[3] = {-0.710295 ,0.647038 ,0.277168}; -static float N100[3] = {0.009604 ,0.993655 ,0.112063}; -static float iP001[3] = {18.74, 13.19, 3.76}; -static float P001[3] = {18.74, 13.19, 3.76}; -static float P002[3] = {0.00, 390.42, 10292.57}; -static float P003[3] = {55.80, 622.31, 8254.35}; -static float P004[3] = {20.80, 247.66, 10652.13}; -static float P005[3] = {487.51, 198.05, 9350.78}; -static float P006[3] = {-457.61, 199.04, 9353.01}; -static float P008[3] = {-34.67, 247.64, 10663.71}; -static float iP009[3] = {97.46, 67.63, 593.82}; -static float iP010[3] = {-84.33, 67.63, 588.18}; -static float iP011[3] = {118.69, 8.98, -66.91}; -static float P009[3] = {97.46, 67.63, 593.82}; -static float P010[3] = {-84.33, 67.63, 588.18}; -static float P011[3] = {118.69, 8.98, -66.91}; -static float iP012[3] = {156.48, -31.95, 924.54}; -static float iP013[3] = {162.00, 110.22, 924.54}; -static float iP014[3] = {88.16, 221.65, 924.54}; -static float iP015[3] = {-65.21, 231.16, 924.54}; -static float iP016[3] = {-156.48, 121.97, 924.54}; -static float iP017[3] = {-162.00, -23.93, 924.54}; -static float iP018[3] = {-88.16, -139.10, 924.54}; -static float iP019[3] = {65.21, -148.61, 924.54}; -static float iP020[3] = {246.87, -98.73, 1783.04}; -static float iP021[3] = {253.17, 127.76, 1783.04}; -static float iP022[3] = {132.34, 270.77, 1783.04}; -static float iP023[3] = {-97.88, 285.04, 1783.04}; -static float iP024[3] = {-222.97, 139.80, 1783.04}; -static float iP025[3] = {-225.29, -86.68, 1783.04}; -static float iP026[3] = {-108.44, -224.15, 1783.04}; -static float iP027[3] = {97.88, -221.56, 1783.04}; -static float iP028[3] = {410.55, -200.66, 3213.87}; -static float iP029[3] = {432.19, 148.42, 3213.87}; -static float iP030[3] = {200.66, 410.55, 3213.87}; -static float iP031[3] = {-148.42, 432.19, 3213.87}; -static float iP032[3] = {-407.48, 171.88, 3213.87}; -static float iP033[3] = {-432.19, -148.42, 3213.87}; -static float iP034[3] = {-148.88, -309.74, 3213.87}; -static float iP035[3] = {156.38, -320.17, 3213.87}; -static float iP036[3] = {523.39, -303.81, 4424.57}; -static float iP037[3] = {574.66, 276.84, 4424.57}; -static float iP038[3] = {243.05, 492.50, 4424.57}; -static float iP039[3] = {-191.23, 520.13, 4424.57}; -static float iP040[3] = {-523.39, 304.01, 4424.57}; -static float iP041[3] = {-574.66, -231.83, 4424.57}; -static float iP042[3] = {-266.95, -578.17, 4424.57}; -static float iP043[3] = {211.14, -579.67, 4424.57}; -static float iP044[3] = {680.57, -370.27, 5943.46}; -static float iP045[3] = {834.01, 363.09, 5943.46}; -static float iP046[3] = {371.29, 614.13, 5943.46}; -static float iP047[3] = {-291.43, 621.86, 5943.46}; -static float iP048[3] = {-784.13, 362.60, 5943.46}; -static float iP049[3] = {-743.29, -325.82, 5943.46}; -static float iP050[3] = {-383.24, -804.77, 5943.46}; -static float iP051[3] = {283.47, -846.09, 5943.46}; -static float P012[3] = {156.48, -31.95, 924.54}; -static float P013[3] = {162.00, 110.22, 924.54}; -static float P014[3] = {88.16, 221.65, 924.54}; -static float P015[3] = {-65.21, 231.16, 924.54}; -static float P016[3] = {-156.48, 121.97, 924.54}; -static float P017[3] = {-162.00, -23.93, 924.54}; -static float P018[3] = {-88.16, -139.10, 924.54}; -static float P019[3] = {65.21, -148.61, 924.54}; -static float P020[3] = {246.87, -98.73, 1783.04}; -static float P021[3] = {253.17, 127.76, 1783.04}; -static float P022[3] = {132.34, 270.77, 1783.04}; -static float P023[3] = {-97.88, 285.04, 1783.04}; -static float P024[3] = {-222.97, 139.80, 1783.04}; -static float P025[3] = {-225.29, -86.68, 1783.04}; -static float P026[3] = {-108.44, -224.15, 1783.04}; -static float P027[3] = {97.88, -221.56, 1783.04}; -static float P028[3] = {410.55, -200.66, 3213.87}; -static float P029[3] = {432.19, 148.42, 3213.87}; -static float P030[3] = {200.66, 410.55, 3213.87}; -static float P031[3] = {-148.42, 432.19, 3213.87}; -static float P032[3] = {-407.48, 171.88, 3213.87}; -static float P033[3] = {-432.19, -148.42, 3213.87}; -static float P034[3] = {-148.88, -309.74, 3213.87}; -static float P035[3] = {156.38, -320.17, 3213.87}; -static float P036[3] = {523.39, -303.81, 4424.57}; -static float P037[3] = {574.66, 276.84, 4424.57}; -static float P038[3] = {243.05, 492.50, 4424.57}; -static float P039[3] = {-191.23, 520.13, 4424.57}; -static float P040[3] = {-523.39, 304.01, 4424.57}; -static float P041[3] = {-574.66, -231.83, 4424.57}; -static float P042[3] = {-266.95, -578.17, 4424.57}; -static float P043[3] = {211.14, -579.67, 4424.57}; -static float P044[3] = {680.57, -370.27, 5943.46}; -static float P045[3] = {834.01, 363.09, 5943.46}; -static float P046[3] = {371.29, 614.13, 5943.46}; -static float P047[3] = {-291.43, 621.86, 5943.46}; -static float P048[3] = {-784.13, 362.60, 5943.46}; -static float P049[3] = {-743.29, -325.82, 5943.46}; -static float P050[3] = {-383.24, -804.77, 5943.46}; -static float P051[3] = {283.47, -846.09, 5943.46}; -static float P052[3] = {599.09, -332.24, 7902.59}; -static float P053[3] = {735.48, 306.26, 7911.92}; -static float P054[3] = {321.55, 558.53, 7902.59}; -static float P055[3] = {-260.54, 559.84, 7902.59}; -static float P056[3] = {-698.66, 320.83, 7902.59}; -static float P057[3] = {-643.29, -299.16, 7902.59}; -static float P058[3] = {-341.47, -719.30, 7902.59}; -static float P059[3] = {252.57, -756.12, 7902.59}; -static float P060[3] = {458.39, -265.31, 9355.44}; -static float P062[3] = {224.04, 438.98, 9364.77}; -static float P063[3] = {-165.71, 441.27, 9355.44}; -static float P065[3] = {-473.99, -219.71, 9355.44}; -static float P066[3] = {-211.97, -479.87, 9355.44}; -static float P067[3] = {192.86, -504.03, 9355.44}; -static float iP068[3] = {-112.44, 9.25, -64.42}; -static float iP069[3] = {1155.63, 0.00, -182.46}; -static float iP070[3] = {-1143.13, 0.00, -181.54}; -static float iP071[3] = {1424.23, 0.00, -322.09}; -static float iP072[3] = {-1368.01, 0.00, -310.38}; -static float iP073[3] = {1255.57, 2.31, 114.05}; -static float iP074[3] = {-1149.38, 0.00, 117.12}; -static float iP075[3] = {718.36, 0.00, 433.36}; -static float iP076[3] = {-655.90, 0.00, 433.36}; -static float P068[3] = {-112.44, 9.25, -64.42}; -static float P069[3] = {1155.63, 0.00, -182.46}; -static float P070[3] = {-1143.13, 0.00, -181.54}; -static float P071[3] = {1424.23, 0.00, -322.09}; -static float P072[3] = {-1368.01, 0.00, -310.38}; -static float P073[3] = {1255.57, 2.31, 114.05}; -static float P074[3] = {-1149.38, 0.00, 117.12}; -static float P075[3] = {718.36, 0.00, 433.36}; -static float P076[3] = {-655.90, 0.00, 433.36}; -static float P077[3] = {1058.00, -2.66, 7923.51}; -static float P078[3] = {-1016.51, -15.47, 7902.87}; -static float P079[3] = {-1363.99, -484.50, 7593.38}; -static float P080[3] = {1478.09, -861.47, 7098.12}; -static float P081[3] = {1338.06, -284.68, 7024.15}; -static float P082[3] = {-1545.51, -860.64, 7106.60}; -static float P083[3] = {1063.19, -70.46, 7466.60}; -static float P084[3] = {-1369.18, -288.11, 7015.34}; -static float P085[3] = {1348.44, -482.50, 7591.41}; -static float P086[3] = {-1015.45, -96.80, 7474.86}; -static float P087[3] = {731.04, 148.38, 7682.58}; -static float P088[3] = {-697.03, 151.82, 7668.81}; -static float P089[3] = {-686.82, 157.09, 7922.29}; -static float P090[3] = {724.73, 147.75, 7931.39}; -static float iP091[3] = {0.00, 327.10, 2346.55}; -static float iP092[3] = {0.00, 552.28, 2311.31}; -static float iP093[3] = {0.00, 721.16, 2166.41}; -static float iP094[3] = {0.00, 693.42, 2388.80}; -static float iP095[3] = {0.00, 389.44, 2859.97}; -static float P091[3] = {0.00, 327.10, 2346.55}; -static float P092[3] = {0.00, 552.28, 2311.31}; -static float P093[3] = {0.00, 721.16, 2166.41}; -static float P094[3] = {0.00, 693.42, 2388.80}; -static float P095[3] = {0.00, 389.44, 2859.97}; -static float iP096[3] = {222.02, -183.67, 10266.89}; -static float iP097[3] = {-128.90, -182.70, 10266.89}; -static float iP098[3] = {41.04, 88.31, 10659.36}; -static float iP099[3] = {-48.73, 88.30, 10659.36}; -static float P096[3] = {222.02, -183.67, 10266.89}; -static float P097[3] = {-128.90, -182.70, 10266.89}; -static float P098[3] = {41.04, 88.31, 10659.36}; -static float P099[3] = {-48.73, 88.30, 10659.36}; -static float P100[3] = {0.00, 603.42, 9340.68}; -static float P104[3] = {-9.86, 567.62, 7858.65}; -static float P105[3] = {31.96, 565.27, 7908.46}; -static float P106[3] = {22.75, 568.13, 7782.83}; -static float P107[3] = {58.93, 568.42, 7775.94}; -static float P108[3] = {55.91, 565.59, 7905.86}; -static float P109[3] = {99.21, 566.00, 7858.65}; -static float P110[3] = {-498.83, 148.14, 9135.10}; -static float P111[3] = {-495.46, 133.24, 9158.48}; -static float P112[3] = {-490.82, 146.23, 9182.76}; -static float P113[3] = {-489.55, 174.11, 9183.66}; -static float P114[3] = {-492.92, 189.00, 9160.28}; -static float P115[3] = {-497.56, 176.02, 9136.00}; -static float P116[3] = {526.54, 169.68, 9137.70}; -static float P117[3] = {523.49, 184.85, 9161.42}; -static float P118[3] = {518.56, 171.78, 9186.06}; -static float P119[3] = {516.68, 143.53, 9186.98}; -static float P120[3] = {519.73, 128.36, 9163.26}; -static float P121[3] = {524.66, 141.43, 9138.62}; -/* *INDENT-ON* */ - -void -Whale001(void) -{ - - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N072); - glVertex3fv(P072); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N072); - glVertex3fv(P072); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N074); - glVertex3fv(P074); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); -} - -void -Whale002(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N075); - glVertex3fv(P075); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N075); - glVertex3fv(P075); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N071); - glVertex3fv(P071); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N073); - glVertex3fv(P073); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N071); - glVertex3fv(P071); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); -} - -void -Whale003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glEnd(); -} - -void -Whale004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); -} - -void -Whale005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); -} - -void -Whale006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); -} - -void -Whale007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); -} - -void -Whale008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); -} - -void -Whale009(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); -} - -void -Whale010(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); -} - -void -Whale011(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N079); - glVertex3fv(P079); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N089); - glVertex3fv(P089); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); -} - -void -Whale012(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N067); - glVertex3fv(P067); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); -} - -void -Whale013(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N096); - glVertex3fv(P096); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N096); - glVertex3fv(P096); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N098); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P005); - glVertex3fv(P006); - glVertex3fv(P099); - glVertex3fv(P098); - glEnd(); -} - -void -Whale014(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P006); - glVertex3fv(P005); - glVertex3fv(P004); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N004); - glVertex3fv(P004); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N004); - glVertex3fv(P004); - glEnd(); -} - -void -Whale015(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N100); - glVertex3fv(P100); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); -} - -void -Whale016(void) -{ - glBegin(GL_POLYGON); - glVertex3fv(P104); - glVertex3fv(P105); - glVertex3fv(P106); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P107); - glVertex3fv(P108); - glVertex3fv(P109); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P110); - glVertex3fv(P111); - glVertex3fv(P112); - glVertex3fv(P113); - glVertex3fv(P114); - glVertex3fv(P115); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P116); - glVertex3fv(P117); - glVertex3fv(P118); - glVertex3fv(P119); - glVertex3fv(P120); - glVertex3fv(P121); - glEnd(); -} - -void -DrawWhale(fishRec * fish) -{ - float seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7; - float pitch, thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360; - - thrash = 70.0 * fish->v; - - seg0 = 1.5 * thrash * sin((fish->htail) * RRAD); - seg1 = 2.5 * thrash * sin((fish->htail + 10.0) * RRAD); - seg2 = 3.7 * thrash * sin((fish->htail + 15.0) * RRAD); - seg3 = 4.8 * thrash * sin((fish->htail + 23.0) * RRAD); - seg4 = 6.0 * thrash * sin((fish->htail + 28.0) * RRAD); - seg5 = 6.5 * thrash * sin((fish->htail + 35.0) * RRAD); - seg6 = 6.5 * thrash * sin((fish->htail + 40.0) * RRAD); - seg7 = 6.5 * thrash * sin((fish->htail + 55.0) * RRAD); - - pitch = fish->v * sin((fish->htail - 160.0) * RRAD); - - chomp = 0.0; - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - P012[1] = iP012[1] + seg5; - P013[1] = iP013[1] + seg5; - P014[1] = iP014[1] + seg5; - P015[1] = iP015[1] + seg5; - P016[1] = iP016[1] + seg5; - P017[1] = iP017[1] + seg5; - P018[1] = iP018[1] + seg5; - P019[1] = iP019[1] + seg5; - - P020[1] = iP020[1] + seg4; - P021[1] = iP021[1] + seg4; - P022[1] = iP022[1] + seg4; - P023[1] = iP023[1] + seg4; - P024[1] = iP024[1] + seg4; - P025[1] = iP025[1] + seg4; - P026[1] = iP026[1] + seg4; - P027[1] = iP027[1] + seg4; - - P028[1] = iP028[1] + seg2; - P029[1] = iP029[1] + seg2; - P030[1] = iP030[1] + seg2; - P031[1] = iP031[1] + seg2; - P032[1] = iP032[1] + seg2; - P033[1] = iP033[1] + seg2; - P034[1] = iP034[1] + seg2; - P035[1] = iP035[1] + seg2; - - P036[1] = iP036[1] + seg1; - P037[1] = iP037[1] + seg1; - P038[1] = iP038[1] + seg1; - P039[1] = iP039[1] + seg1; - P040[1] = iP040[1] + seg1; - P041[1] = iP041[1] + seg1; - P042[1] = iP042[1] + seg1; - P043[1] = iP043[1] + seg1; - - P044[1] = iP044[1] + seg0; - P045[1] = iP045[1] + seg0; - P046[1] = iP046[1] + seg0; - P047[1] = iP047[1] + seg0; - P048[1] = iP048[1] + seg0; - P049[1] = iP049[1] + seg0; - P050[1] = iP050[1] + seg0; - P051[1] = iP051[1] + seg0; - - P009[1] = iP009[1] + seg6; - P010[1] = iP010[1] + seg6; - P075[1] = iP075[1] + seg6; - P076[1] = iP076[1] + seg6; - - P001[1] = iP001[1] + seg7; - P011[1] = iP011[1] + seg7; - P068[1] = iP068[1] + seg7; - P069[1] = iP069[1] + seg7; - P070[1] = iP070[1] + seg7; - P071[1] = iP071[1] + seg7; - P072[1] = iP072[1] + seg7; - P073[1] = iP073[1] + seg7; - P074[1] = iP074[1] + seg7; - - P091[1] = iP091[1] + seg3 * 1.1; - P092[1] = iP092[1] + seg3; - P093[1] = iP093[1] + seg3; - P094[1] = iP094[1] + seg3; - P095[1] = iP095[1] + seg3 * 0.9; - - P099[1] = iP099[1] + chomp; - P098[1] = iP098[1] + chomp; - P097[1] = iP097[1] + chomp; - P096[1] = iP096[1] + chomp; - - glPushMatrix(); - - glRotatef(pitch, 1.0, 0.0, 0.0); - - glTranslatef(0.0, 0.0, 8000.0); - - glRotatef(180.0, 0.0, 1.0, 0.0); - - glScalef(3.0, 3.0, 3.0); - - glEnable(GL_CULL_FACE); - - Whale001(); - Whale002(); - Whale003(); - Whale004(); - Whale005(); - Whale006(); - Whale007(); - Whale008(); - Whale009(); - Whale010(); - Whale011(); - Whale012(); - Whale013(); - Whale014(); - Whale015(); - Whale016(); - - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/main.c b/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/main.c deleted file mode 100644 index b7794b3b6f..0000000000 --- a/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/main.c +++ /dev/null @@ -1,179 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -extern void Atlantis_Init (); -extern void Atlantis_Reshape (int w, int h); -extern void Atlantis_Animate (); -extern void Atlantis_Display (); - -static SDL_Surface *gScreen; - -static void initAttributes () -{ - // Setup attributes we want for the OpenGL context - - int value; - - // Don't set color bit sizes (SDL_GL_RED_SIZE, etc) - // Mac OS X will always use 8-8-8-8 ARGB for 32-bit screens and - // 5-5-5 RGB for 16-bit screens - - // Request a 16-bit depth buffer (without this, there is no depth buffer) - value = 16; - SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, value); - - - // Request double-buffered OpenGL - // The fact that windows are double-buffered on Mac OS X has no effect - // on OpenGL double buffering. - value = 1; - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, value); -} - -static void printAttributes () -{ - // Print out attributes of the context we created - int nAttr; - int i; - - int attr[] = { SDL_GL_RED_SIZE, SDL_GL_BLUE_SIZE, SDL_GL_GREEN_SIZE, - SDL_GL_ALPHA_SIZE, SDL_GL_BUFFER_SIZE, SDL_GL_DEPTH_SIZE }; - - char *desc[] = { "Red size: %d bits\n", "Blue size: %d bits\n", "Green size: %d bits\n", - "Alpha size: %d bits\n", "Color buffer size: %d bits\n", - "Depth bufer size: %d bits\n" }; - - nAttr = sizeof(attr) / sizeof(int); - - for (i = 0; i < nAttr; i++) { - - int value; - SDL_GL_GetAttribute (attr[i], &value); - printf (desc[i], value); - } -} - -static void createSurface (int fullscreen) -{ - Uint32 flags = 0; - - flags = SDL_OPENGL; - if (fullscreen) - flags |= SDL_FULLSCREEN; - - // Create window - gScreen = SDL_SetVideoMode (640, 480, 0, flags); - if (gScreen == NULL) { - - fprintf (stderr, "Couldn't set 640x480 OpenGL video mode: %s\n", - SDL_GetError()); - SDL_Quit(); - exit(2); - } -} - -static void initGL () -{ - Atlantis_Init (); - Atlantis_Reshape (gScreen->w, gScreen->h); -} - -static void drawGL () -{ - Atlantis_Animate (); - Atlantis_Display (); -} - -static void mainLoop () -{ - SDL_Event event; - int done = 0; - int fps = 24; - int delay = 1000/fps; - int thenTicks = -1; - int nowTicks; - - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent (&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - - // Draw at 24 hz - // This approach is not normally recommended - it is better to - // use time-based animation and run as fast as possible - drawGL (); - SDL_GL_SwapBuffers (); - - // Time how long each draw-swap-delay cycle takes - // and adjust delay to get closer to target framerate - if (thenTicks > 0) { - nowTicks = SDL_GetTicks (); - delay += (1000/fps - (nowTicks-thenTicks)); - thenTicks = nowTicks; - if (delay < 0) - delay = 1000/fps; - } - else { - thenTicks = SDL_GetTicks (); - } - - SDL_Delay (delay); - } -} - -int main(int argc, char *argv[]) -{ - // Init SDL video subsystem - if ( SDL_Init (SDL_INIT_VIDEO) < 0 ) { - - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - // Set GL context attributes - initAttributes (); - - // Create GL context - createSurface (0); - - // Get GL context attributes - printAttributes (); - - // Init GL state - initGL (); - - // Draw, get events... - mainLoop (); - - // Cleanup - SDL_Quit(); - - return 0; -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/English.lproj/InfoPlist.strings deleted file mode 100644 index 6e721b0ef0..0000000000 Binary files a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/Info.plist b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/Info.plist deleted file mode 100644 index e4332041bf..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/Info.plist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.___PROJECTNAMEASXML___ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - - - diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.h b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns deleted file mode 100644 index ae0b02b12a..0000000000 Binary files a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns and /dev/null differ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist deleted file mode 100644 index d9ca454937..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application."; -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj deleted file mode 100644 index d6553a7bf8..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,310 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "___PROJECTNAMEASXML___"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "___PROJECTNAME___"; - productInstallPath = "$(HOME)/Applications"; - productName = "___PROJECTNAME___"; - productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */; - compatibilityVersion = "Xcode 3.2"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - "GCC_VERSION[arch=x86_64]" = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = macosx10.4; - "SDKROOT[arch=x86_64]" = macosx10.6; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - "GCC_VERSION[arch=x86_64]" = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = macosx10.4; - "SDKROOT[arch=x86_64]" = macosx10.6; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/main.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/main.c deleted file mode 100644 index 7115de9897..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/main.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -int main(int argc, char *argv[]) -{ - Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */ - SDL_Surface *screen; - Uint8 video_bpp = 0; - Uint32 videoflags = SDL_SWSURFACE; - int done; - SDL_Event event; - - /* Initialize the SDL library */ - if ( SDL_Init(initflags) < 0 ) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - /* Set 640x480 video mode */ - screen=SDL_SetVideoMode(640,480, video_bpp, videoflags); - if (screen == NULL) { - fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", - video_bpp, SDL_GetError()); - SDL_Quit(); - exit(2); - } - - done = 0; - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent(&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - } - - /* Clean up the SDL library */ - SDL_Quit(); - return(0); -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings deleted file mode 100644 index 6e721b0ef0..0000000000 Binary files a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib deleted file mode 100644 index 799eaadddb..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib +++ /dev/null @@ -1,19 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = { - help = id; - newGame = id; - openGame = id; - prefsMenu = id; - saveGame = id; - saveGameAs = id; - }; - CLASS = SDLMain; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib deleted file mode 100644 index 1d6fb7e01d..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - IBDocumentLocation - 62 117 356 240 0 0 1152 848 - IBEditorPositions - - 29 - 62 362 195 44 0 0 1152 848 - - IBFramework Version - 291.0 - IBOpenObjects - - 29 - - IBSystem Version - 6L60 - - diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib deleted file mode 100644 index 637801528a..0000000000 Binary files a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib and /dev/null differ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/Info.plist b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/Info.plist deleted file mode 100644 index 40a970f973..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/Info.plist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.___PROJECTNAMEASXML___ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - - - diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns deleted file mode 100644 index ae0b02b12a..0000000000 Binary files a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns and /dev/null differ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist deleted file mode 100644 index 1dcbea207c..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application with Cocoa menus."; -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj deleted file mode 100644 index 9d9a9248f7..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,322 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 002F3AF009D08F1000EBEB88 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/SDLMain.nib; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "___PROJECTNAMEASXML___"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "___PROJECTNAME___"; - productInstallPath = "$(HOME)/Applications"; - productName = "___PROJECTNAME___"; - productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */; - compatibilityVersion = "Xcode 3.2"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */ = { - isa = PBXVariantGroup; - children = ( - 002F3AF009D08F1000EBEB88 /* English */, - ); - name = SDLMain.nib; - sourceTree = ""; - }; - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - "GCC_VERSION[arch=x86_64]" = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = macosx10.4; - "SDKROOT[arch=x86_64]" = macosx10.6; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - "GCC_VERSION[arch=x86_64]" = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = macosx10.4; - "SDKROOT[arch=x86_64]" = macosx10.6; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/main.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/main.c deleted file mode 100644 index 7115de9897..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/main.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -int main(int argc, char *argv[]) -{ - Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */ - SDL_Surface *screen; - Uint8 video_bpp = 0; - Uint32 videoflags = SDL_SWSURFACE; - int done; - SDL_Event event; - - /* Initialize the SDL library */ - if ( SDL_Init(initflags) < 0 ) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - /* Set 640x480 video mode */ - screen=SDL_SetVideoMode(640,480, video_bpp, videoflags); - if (screen == NULL) { - fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", - video_bpp, SDL_GetError()); - SDL_Quit(); - exit(2); - } - - done = 0; - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent(&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - } - - /* Clean up the SDL library */ - SDL_Quit(); - return(0); -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings deleted file mode 100644 index 6e721b0ef0..0000000000 Binary files a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/Info.plist b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/Info.plist deleted file mode 100644 index a2e942960c..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/Info.plist +++ /dev/null @@ -1,37 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.___PROJECTNAMEASXML___ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - LSMinimumSystemVersionByArchitecture - - x86_64 - 10.6.0 - i386 - 10.4.0 - ppc - 10.4.0 - - - diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.h b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns deleted file mode 100644 index ae0b02b12a..0000000000 Binary files a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns and /dev/null differ diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist deleted file mode 100644 index ba87745fc3..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application that uses OpenGL."; -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj deleted file mode 100644 index 568327307c..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj +++ /dev/null @@ -1,352 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF409D0938900EBEB88 /* atlantis.c */; }; - 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF609D0938900EBEB88 /* dolphin.c */; }; - 002F3BFD09D0938900EBEB88 /* shark.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF709D0938900EBEB88 /* shark.c */; }; - 002F3BFE09D0938900EBEB88 /* swim.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF809D0938900EBEB88 /* swim.c */; }; - 002F3BFF09D0938900EBEB88 /* whale.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF909D0938900EBEB88 /* whale.c */; }; - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; }; - 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C6009D0951E00EBEB88 /* GLUT.framework */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 002F3BF409D0938900EBEB88 /* atlantis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = atlantis.c; path = atlantis/atlantis.c; sourceTree = SOURCE_ROOT; }; - 002F3BF509D0938900EBEB88 /* atlantis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = atlantis.h; path = atlantis/atlantis.h; sourceTree = SOURCE_ROOT; }; - 002F3BF609D0938900EBEB88 /* dolphin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dolphin.c; path = atlantis/dolphin.c; sourceTree = SOURCE_ROOT; }; - 002F3BF709D0938900EBEB88 /* shark.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = shark.c; path = atlantis/shark.c; sourceTree = SOURCE_ROOT; }; - 002F3BF809D0938900EBEB88 /* swim.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = swim.c; path = atlantis/swim.c; sourceTree = SOURCE_ROOT; }; - 002F3BF909D0938900EBEB88 /* whale.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = whale.c; path = atlantis/whale.c; sourceTree = SOURCE_ROOT; }; - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 002F3C6009D0951E00EBEB88 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../../../../../../../../System/Library/Frameworks/GLUT.framework; sourceTree = SOURCE_ROOT; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 002F3BF309D0937800EBEB88 /* atlantis */ = { - isa = PBXGroup; - children = ( - 002F3BF409D0938900EBEB88 /* atlantis.c */, - 002F3BF509D0938900EBEB88 /* atlantis.h */, - 002F3BF609D0938900EBEB88 /* dolphin.c */, - 002F3BF709D0938900EBEB88 /* shark.c */, - 002F3BF809D0938900EBEB88 /* swim.c */, - 002F3BF909D0938900EBEB88 /* whale.c */, - ); - name = atlantis; - sourceTree = ""; - }; - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 002F3C6009D0951E00EBEB88 /* GLUT.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "___PROJECTNAMEASXML___"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 002F3BF309D0937800EBEB88 /* atlantis */, - 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "___PROJECTNAME___"; - productInstallPath = "$(HOME)/Applications"; - productName = "___PROJECTNAME___"; - productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */; - compatibilityVersion = "Xcode 3.2"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */, - 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */, - 002F3BFD09D0938900EBEB88 /* shark.c in Sources */, - 002F3BFE09D0938900EBEB88 /* swim.c in Sources */, - 002F3BFF09D0938900EBEB88 /* whale.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "___PROJECTNAME___"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - "GCC_VERSION[arch=x86_64]" = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = macosx10.4; - "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_VERSION = 4.0; - "GCC_VERSION[arch=x86_64]" = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = macosx10.4; - "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.c deleted file mode 100644 index 4efdf6ce88..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.c +++ /dev/null @@ -1,459 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include -#include -#include -#include -#include "atlantis.h" - -fishRec sharks[NUM_SHARKS]; -fishRec momWhale; -fishRec babyWhale; -fishRec dolph; - -GLboolean Timing = GL_TRUE; - -int w_win = 640; -int h_win = 480; -GLint count = 0; -GLenum StrMode = GL_VENDOR; - -GLboolean moving; - -static double mtime(void) -{ - struct timeval tk_time; - struct timezone tz; - - gettimeofday(&tk_time, &tz); - - return 4294.967296 * tk_time.tv_sec + 0.000001 * tk_time.tv_usec; -} - -static double filter(double in, double *save) -{ - static double k1 = 0.9; - static double k2 = 0.05; - - save[3] = in; - save[1] = save[0]*k1 + k2*(save[3] + save[2]); - - save[0]=save[1]; - save[2]=save[3]; - - return(save[1]); -} - -void DrawStr(const char *str) -{ - GLint i = 0; - - if(!str) return; - - while(str[i]) - { - glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, str[i]); - i++; - } -} - -void -InitFishs(void) -{ - int i; - - for (i = 0; i < NUM_SHARKS; i++) { - sharks[i].x = 70000.0 + rand() % 6000; - sharks[i].y = rand() % 6000; - sharks[i].z = rand() % 6000; - sharks[i].psi = rand() % 360 - 180.0; - sharks[i].v = 1.0; - } - - dolph.x = 30000.0; - dolph.y = 0.0; - dolph.z = 6000.0; - dolph.psi = 90.0; - dolph.theta = 0.0; - dolph.v = 3.0; - - momWhale.x = 70000.0; - momWhale.y = 0.0; - momWhale.z = 0.0; - momWhale.psi = 90.0; - momWhale.theta = 0.0; - momWhale.v = 3.0; - - babyWhale.x = 60000.0; - babyWhale.y = -2000.0; - babyWhale.z = -2000.0; - babyWhale.psi = 90.0; - babyWhale.theta = 0.0; - babyWhale.v = 3.0; -} - -void -Atlantis_Init(void) -{ - static float ambient[] = {0.2, 0.2, 0.2, 1.0}; - static float diffuse[] = {1.0, 1.0, 1.0, 1.0}; - static float position[] = {0.0, 1.0, 0.0, 0.0}; - static float mat_shininess[] = {90.0}; - static float mat_specular[] = {0.8, 0.8, 0.8, 1.0}; - static float mat_diffuse[] = {0.46, 0.66, 0.795, 1.0}; - static float mat_ambient[] = {0.3, 0.4, 0.5, 1.0}; - static float lmodel_ambient[] = {0.4, 0.4, 0.4, 1.0}; - static float lmodel_localviewer[] = {0.0}; - //GLfloat map1[4] = {0.0, 0.0, 0.0, 0.0}; - //GLfloat map2[4] = {0.0, 0.0, 0.0, 0.0}; - static float fog_color[] = {0.0, 0.5, 0.9, 1.0}; - - glFrontFace(GL_CCW); - - glDepthFunc(GL_LESS); - glEnable(GL_DEPTH_TEST); - - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT0, GL_POSITION, position); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); - glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_localviewer); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - - glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); - glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient); - - InitFishs(); - - glEnable(GL_FOG); - glFogi(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 0.0000025); - glFogfv(GL_FOG_COLOR, fog_color); - - glClearColor(0.0, 0.5, 0.9, 1.0); -} - -void -Atlantis_Reshape(int width, int height) -{ - w_win = width; - h_win = height; - - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60.0, (GLfloat) width / (GLfloat) height, 20000.0, 300000.0); - glMatrixMode(GL_MODELVIEW); -} - -void -Atlantis_Animate(void) -{ - int i; - - for (i = 0; i < NUM_SHARKS; i++) { - SharkPilot(&sharks[i]); - SharkMiss(i); - } - WhalePilot(&dolph); - dolph.phi++; - //glutPostRedisplay(); - WhalePilot(&momWhale); - momWhale.phi++; - WhalePilot(&babyWhale); - babyWhale.phi++; -} - -void -Atlantis_Key(unsigned char key, int x, int y) -{ - switch (key) { - case 't': - Timing = !Timing; - break; - case ' ': - switch(StrMode) - { - case GL_EXTENSIONS: - StrMode = GL_VENDOR; - break; - case GL_VENDOR: - StrMode = GL_RENDERER; - break; - case GL_RENDERER: - StrMode = GL_VERSION; - break; - case GL_VERSION: - StrMode = GL_EXTENSIONS; - break; - } - break; - case 27: /* Esc will quit */ - exit(1); - break; - case 's': /* "s" start animation */ - moving = GL_TRUE; - //glutIdleFunc(Animate); - break; - case 'a': /* "a" stop animation */ - moving = GL_FALSE; - //glutIdleFunc(NULL); - break; - case '.': /* "." will advance frame */ - if (!moving) { - Atlantis_Animate(); - } - } -} -/* -void Display(void) -{ - static float P123[3] = {-448.94, -203.14, 9499.60}; - static float P124[3] = {-442.64, -185.20, 9528.07}; - static float P125[3] = {-441.07, -148.05, 9528.07}; - static float P126[3] = {-443.43, -128.84, 9499.60}; - static float P127[3] = {-456.87, -146.78, 9466.67}; - static float P128[3] = {-453.68, -183.93, 9466.67}; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - FishTransform(&dolph); - DrawDolphin(&dolph); - glPopMatrix(); - - glutSwapBuffers(); -} -*/ - -void -Atlantis_Display(void) -{ - int i; - static double th[4] = {0.0, 0.0, 0.0, 0.0}; - static double t1 = 0.0, t2 = 0.0, t; - char num_str[128]; - - t1 = t2; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - for (i = 0; i < NUM_SHARKS; i++) { - glPushMatrix(); - FishTransform(&sharks[i]); - DrawShark(&sharks[i]); - glPopMatrix(); - } - - glPushMatrix(); - FishTransform(&dolph); - DrawDolphin(&dolph); - glPopMatrix(); - - glPushMatrix(); - FishTransform(&momWhale); - DrawWhale(&momWhale); - glPopMatrix(); - - glPushMatrix(); - FishTransform(&babyWhale); - glScalef(0.45, 0.45, 0.3); - DrawWhale(&babyWhale); - glPopMatrix(); - - if(Timing) - { - t2 = mtime(); - t = t2 - t1; - if(t > 0.0001) t = 1.0 / t; - - glDisable(GL_LIGHTING); - //glDisable(GL_DEPTH_TEST); - - glColor3f(1.0, 0.0, 0.0); - - glMatrixMode (GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(0, w_win, 0, h_win, -10.0, 10.0); - - glRasterPos2f(5.0, 5.0); - - switch(StrMode) - { - case GL_VENDOR: - sprintf(num_str, "%0.2f Hz, %dx%d, VENDOR: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_VENDOR)); - break; - case GL_RENDERER: - sprintf(num_str, "%0.2f Hz, %dx%d, RENDERER: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_RENDERER)); - break; - case GL_VERSION: - sprintf(num_str, "%0.2f Hz, %dx%d, VERSION: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_VERSION)); - break; - case GL_EXTENSIONS: - sprintf(num_str, "%0.2f Hz, %dx%d, EXTENSIONS: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_EXTENSIONS)); - break; - } - - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_LIGHTING); - //glEnable(GL_DEPTH_TEST); - } - - count++; - - glutSwapBuffers(); -} - -/* -void -Visible(int state) -{ - if (state == GLUT_VISIBLE) { - if (moving) - glutIdleFunc(Animate); - } else { - if (moving) - glutIdleFunc(NULL); - } -} - - -void -timingSelect(int value) -{ - switch(value) - { - case 1: - StrMode = GL_VENDOR; - break; - case 2: - StrMode = GL_RENDERER; - break; - case 3: - StrMode = GL_VERSION; - break; - case 4: - StrMode = GL_EXTENSIONS; - break; - } -} - -void -menuSelect(int value) -{ - switch (value) { - case 1: - moving = GL_TRUE; - glutIdleFunc(Animate); - break; - case 2: - moving = GL_FALSE; - glutIdleFunc(NULL); - break; - case 4: - exit(0); - break; - } -} - -int -main(int argc, char **argv) -{ - GLboolean fullscreen = GL_FALSE; - GLint time_menu; - - srand(0); - - glutInit(&argc, argv); - if (argc > 1 && !strcmp(argv[1], "-w")) - fullscreen = GL_FALSE; - - //glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); - glutInitDisplayString("rgba double depth=24"); - if (fullscreen) { - glutGameModeString("1024x768:32"); - glutEnterGameMode(); - } else { - glutInitWindowSize(320, 240); - glutCreateWindow("Atlantis Timing"); - } - Init(); - glutDisplayFunc(Display); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - moving = GL_TRUE; -glutIdleFunc(Animate); - glutVisibilityFunc(Visible); - - time_menu = glutCreateMenu(timingSelect); - glutAddMenuEntry("GL_VENDOR", 1); - glutAddMenuEntry("GL_RENDERER", 2); - glutAddMenuEntry("GL_VERSION", 3); - glutAddMenuEntry("GL_EXTENSIONS", 4); - - glutCreateMenu(menuSelect); - glutAddMenuEntry("Start motion", 1); - glutAddMenuEntry("Stop motion", 2); - glutAddSubMenu("Timing Mode", time_menu); - glutAddMenuEntry("Quit", 4); - - //glutAttachMenu(GLUT_RIGHT_BUTTON); - glutAttachMenu(GLUT_RIGHT_BUTTON); - glutMainLoop(); - return 0; // ANSI C requires main to return int. -} -*/ \ No newline at end of file diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.h b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.h deleted file mode 100644 index 6ccf2d5f0c..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#define RAD 57.295 -#define RRAD 0.01745 - -#define NUM_SHARKS 4 -#define SHARKSIZE 6000 -#define SHARKSPEED 100.0 - -#define WHALESPEED 250.0 - -typedef struct _fishRec { - float x, y, z, phi, theta, psi, v; - float xt, yt, zt; - float htail, vtail; - float dtheta; - int spurt, attack; -} fishRec; - -extern fishRec sharks[NUM_SHARKS]; -extern fishRec momWhale; -extern fishRec babyWhale; -extern fishRec dolph; - -extern void FishTransform(fishRec *); -extern void WhalePilot(fishRec *); -extern void SharkPilot(fishRec *); -extern void SharkMiss(int); -extern void DrawWhale(fishRec *); -extern void DrawShark(fishRec *); -extern void DrawDolphin(fishRec *); diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/dolphin.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/dolphin.c deleted file mode 100644 index 9fba3ba986..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/dolphin.c +++ /dev/null @@ -1,1934 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N001[3] = {-0.005937 ,-0.101998 ,-0.994767}; -static float N002[3] = {0.936780 ,-0.200803 ,0.286569}; -static float N003[3] = {-0.233062 ,0.972058 ,0.028007}; -static float N005[3] = {0.898117 ,0.360171 ,0.252315}; -static float N006[3] = {-0.915437 ,0.348456 ,0.201378}; -static float N007[3] = {0.602263 ,-0.777527 ,0.180920}; -static float N008[3] = {-0.906912 ,-0.412015 ,0.088061}; -static float N012[3] = {0.884408 ,-0.429417 ,-0.182821}; -static float N013[3] = {0.921121 ,0.311084 ,-0.234016}; -static float N014[3] = {0.382635 ,0.877882 ,-0.287948}; -static float N015[3] = {-0.380046 ,0.888166 ,-0.258316}; -static float N016[3] = {-0.891515 ,0.392238 ,-0.226607}; -static float N017[3] = {-0.901419 ,-0.382002 ,-0.203763}; -static float N018[3] = {-0.367225 ,-0.911091 ,-0.187243}; -static float N019[3] = {0.339539 ,-0.924846 ,-0.171388}; -static float N020[3] = {0.914706 ,-0.378617 ,-0.141290}; -static float N021[3] = {0.950662 ,0.262713 ,-0.164994}; -static float N022[3] = {0.546359 ,0.801460 ,-0.243218}; -static float N023[3] = {-0.315796 ,0.917068 ,-0.243431}; -static float N024[3] = {-0.825687 ,0.532277 ,-0.186875}; -static float N025[3] = {-0.974763 ,-0.155232 ,-0.160435}; -static float N026[3] = {-0.560596 ,-0.816658 ,-0.137119}; -static float N027[3] = {0.380210 ,-0.910817 ,-0.160786}; -static float N028[3] = {0.923772 ,-0.358322 ,-0.135093}; -static float N029[3] = {0.951202 ,0.275053 ,-0.139859}; -static float N030[3] = {0.686099 ,0.702548 ,-0.188932}; -static float N031[3] = {-0.521865 ,0.826719 ,-0.210220}; -static float N032[3] = {-0.923820 ,0.346739 ,-0.162258}; -static float N033[3] = {-0.902095 ,-0.409995 ,-0.134646}; -static float N034[3] = {-0.509115 ,-0.848498 ,-0.144404}; -static float N035[3] = {0.456469 ,-0.880293 ,-0.129305}; -static float N036[3] = {0.873401 ,-0.475489 ,-0.105266}; -static float N037[3] = {0.970825 ,0.179861 ,-0.158584}; -static float N038[3] = {0.675609 ,0.714187 ,-0.183004}; -static float N039[3] = {-0.523574 ,0.830212 ,-0.191360}; -static float N040[3] = {-0.958895 ,0.230808 ,-0.165071}; -static float N041[3] = {-0.918285 ,-0.376803 ,-0.121542}; -static float N042[3] = {-0.622467 ,-0.774167 ,-0.114888}; -static float N043[3] = {0.404497 ,-0.908807 ,-0.102231}; -static float N044[3] = {0.930538 ,-0.365155 ,-0.027588}; -static float N045[3] = {0.921920 ,0.374157 ,-0.100345}; -static float N046[3] = {0.507346 ,0.860739 ,0.041562}; -static float N047[3] = {-0.394646 ,0.918815 ,-0.005730}; -static float N048[3] = {-0.925411 ,0.373024 ,-0.066837}; -static float N049[3] = {-0.945337 ,-0.322309 ,-0.049551}; -static float N050[3] = {-0.660437 ,-0.750557 ,-0.022072}; -static float N051[3] = {0.488835 ,-0.871950 ,-0.027261}; -static float N052[3] = {0.902599 ,-0.421397 ,0.087969}; -static float N053[3] = {0.938636 ,0.322606 ,0.122020}; -static float N054[3] = {0.484605 ,0.871078 ,0.079878}; -static float N055[3] = {-0.353607 ,0.931559 ,0.084619}; -static float N056[3] = {-0.867759 ,0.478564 ,0.134054}; -static float N057[3] = {-0.951583 ,-0.296030 ,0.082794}; -static float N058[3] = {-0.672355 ,-0.730209 ,0.121384}; -static float N059[3] = {0.528336 ,-0.842452 ,0.105525}; -static float N060[3] = {0.786913 ,-0.564760 ,0.248627}; -static float N062[3] = {0.622098 ,0.765230 ,0.165584}; -static float N063[3] = {-0.631711 ,0.767816 ,0.106773}; -static float N064[3] = {-0.687886 ,0.606351 ,0.398938}; -static float N065[3] = {-0.946327 ,-0.281623 ,0.158598}; -static float N066[3] = {-0.509549 ,-0.860437 ,0.002776}; -static float N067[3] = {0.462594 ,-0.876692 ,0.131977}; -static float N071[3] = {0.000000 ,1.000000 ,0.000000}; -static float N077[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N078[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N079[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N080[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N081[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N082[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N083[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N084[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N085[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N086[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N087[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N088[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N089[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N090[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N091[3] = {0.000000 ,1.000000 ,0.000000}; -static float N092[3] = {0.000000 ,1.000000 ,0.000000}; -static float N093[3] = {0.000000 ,1.000000 ,0.000000}; -static float N094[3] = {1.000000 ,0.000000 ,0.000000}; -static float N095[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N097[3] = {-0.697296 ,0.702881 ,0.140491}; -static float N098[3] = {0.918864 ,0.340821 ,0.198819}; -static float N099[3] = {-0.932737 ,0.201195 ,0.299202}; -static float N100[3] = {0.029517 ,0.981679 ,0.188244}; -static float N102[3] = {0.813521 ,-0.204936 ,0.544229}; -static float N110[3] = {-0.781480 ,-0.384779 ,0.491155}; -static float N111[3] = {-0.722243 ,0.384927 ,0.574627}; -static float N112[3] = {-0.752278 ,0.502679 ,0.425901}; -static float N113[3] = {0.547257 ,0.367910 ,0.751766}; -static float N114[3] = {0.725949 ,-0.232568 ,0.647233}; -static float N115[3] = {-0.747182 ,-0.660786 ,0.071280}; -static float N116[3] = {0.931519 ,0.200748 ,0.303270}; -static float N117[3] = {-0.828928 ,0.313757 ,0.463071}; -static float N118[3] = {0.902554 ,-0.370967 ,0.218587}; -static float N119[3] = {-0.879257 ,-0.441851 ,0.177973}; -static float N120[3] = {0.642327 ,0.611901 ,0.461512}; -static float N121[3] = {0.964817 ,-0.202322 ,0.167910}; -static float N122[3] = {0.000000 ,1.000000 ,0.000000}; -static float P001[3] = {5.68, -300.95, 1324.70}; -static float P002[3] = {338.69, -219.63, 9677.03}; -static float P003[3] = {12.18, 474.59, 9138.14}; -static float P005[3] = {487.51, 198.05, 9350.78}; -static float P006[3] = {-457.61, 68.74, 9427.85}; -static float P007[3] = {156.52, -266.72, 10311.68}; -static float P008[3] = {-185.56, -266.51, 10310.47}; -static float P009[3] = {124.39, -261.46, 1942.34}; -static float P010[3] = {-130.05, -261.46, 1946.03}; -static float P011[3] = {141.07, -320.11, 1239.38}; -static float P012[3] = {156.48, -360.12, 2073.41}; -static float P013[3] = {162.00, -175.88, 2064.44}; -static float P014[3] = {88.16, -87.72, 2064.02}; -static float P015[3] = {-65.21, -96.13, 2064.02}; -static float P016[3] = {-156.48, -180.96, 2064.44}; -static float P017[3] = {-162.00, -368.93, 2082.39}; -static float P018[3] = {-88.16, -439.22, 2082.39}; -static float P019[3] = {65.21, -440.32, 2083.39}; -static float P020[3] = {246.87, -356.02, 2576.95}; -static float P021[3] = {253.17, -111.15, 2567.15}; -static float P022[3] = {132.34, 51.41, 2559.84}; -static float P023[3] = {-97.88, 40.44, 2567.15}; -static float P024[3] = {-222.97, -117.49, 2567.15}; -static float P025[3] = {-252.22, -371.53, 2569.92}; -static float P026[3] = {-108.44, -518.19, 2586.75}; -static float P027[3] = {97.88, -524.79, 2586.75}; -static float P028[3] = {370.03, -421.19, 3419.70}; -static float P029[3] = {351.15, -16.98, 3423.17}; -static float P030[3] = {200.66, 248.46, 3430.37}; -static float P031[3] = {-148.42, 235.02, 3417.91}; -static float P032[3] = {-360.21, -30.27, 3416.84}; -static float P033[3] = {-357.90, -414.89, 3407.04}; -static float P034[3] = {-148.88, -631.35, 3409.90}; -static float P035[3] = {156.38, -632.59, 3419.70}; -static float P036[3] = {462.61, -469.21, 4431.51}; -static float P037[3] = {466.60, 102.25, 4434.98}; -static float P038[3] = {243.05, 474.34, 4562.02}; -static float P039[3] = {-191.23, 474.40, 4554.42}; -static float P040[3] = {-476.12, 111.05, 4451.11}; -static float P041[3] = {-473.36, -470.74, 4444.78}; -static float P042[3] = {-266.95, -748.41, 4447.78}; -static float P043[3] = {211.14, -749.91, 4429.73}; -static float P044[3] = {680.57, -370.27, 5943.46}; -static float P045[3] = {834.01, 363.09, 6360.63}; -static float P046[3] = {371.29, 804.51, 6486.26}; -static float P047[3] = {-291.43, 797.22, 6494.28}; -static float P048[3] = {-784.13, 370.75, 6378.01}; -static float P049[3] = {-743.29, -325.82, 5943.46}; -static float P050[3] = {-383.24, -804.77, 5943.46}; -static float P051[3] = {283.47, -846.09, 5943.46}; -static float iP001[3] = {5.68, -300.95, 1324.70}; -static float iP009[3] = {124.39, -261.46, 1942.34}; -static float iP010[3] = {-130.05, -261.46, 1946.03}; -static float iP011[3] = {141.07, -320.11, 1239.38}; -static float iP012[3] = {156.48, -360.12, 2073.41}; -static float iP013[3] = {162.00, -175.88, 2064.44}; -static float iP014[3] = {88.16, -87.72, 2064.02}; -static float iP015[3] = {-65.21, -96.13, 2064.02}; -static float iP016[3] = {-156.48, -180.96, 2064.44}; -static float iP017[3] = {-162.00, -368.93, 2082.39}; -static float iP018[3] = {-88.16, -439.22, 2082.39}; -static float iP019[3] = {65.21, -440.32, 2083.39}; -static float iP020[3] = {246.87, -356.02, 2576.95}; -static float iP021[3] = {253.17, -111.15, 2567.15}; -static float iP022[3] = {132.34, 51.41, 2559.84}; -static float iP023[3] = {-97.88, 40.44, 2567.15}; -static float iP024[3] = {-222.97, -117.49, 2567.15}; -static float iP025[3] = {-252.22, -371.53, 2569.92}; -static float iP026[3] = {-108.44, -518.19, 2586.75}; -static float iP027[3] = {97.88, -524.79, 2586.75}; -static float iP028[3] = {370.03, -421.19, 3419.70}; -static float iP029[3] = {351.15, -16.98, 3423.17}; -static float iP030[3] = {200.66, 248.46, 3430.37}; -static float iP031[3] = {-148.42, 235.02, 3417.91}; -static float iP032[3] = {-360.21, -30.27, 3416.84}; -static float iP033[3] = {-357.90, -414.89, 3407.04}; -static float iP034[3] = {-148.88, -631.35, 3409.90}; -static float iP035[3] = {156.38, -632.59, 3419.70}; -static float iP036[3] = {462.61, -469.21, 4431.51}; -static float iP037[3] = {466.60, 102.25, 4434.98}; -static float iP038[3] = {243.05, 474.34, 4562.02}; -static float iP039[3] = {-191.23, 474.40, 4554.42}; -static float iP040[3] = {-476.12, 111.05, 4451.11}; -static float iP041[3] = {-473.36, -470.74, 4444.78}; -static float iP042[3] = {-266.95, -748.41, 4447.78}; -static float iP043[3] = {211.14, -749.91, 4429.73}; -static float iP044[3] = {680.57, -370.27, 5943.46}; -static float iP045[3] = {834.01, 363.09, 6360.63}; -static float iP046[3] = {371.29, 804.51, 6486.26}; -static float iP047[3] = {-291.43, 797.22, 6494.28}; -static float iP048[3] = {-784.13, 370.75, 6378.01}; -static float iP049[3] = {-743.29, -325.82, 5943.46}; -static float iP050[3] = {-383.24, -804.77, 5943.46}; -static float iP051[3] = {283.47, -846.09, 5943.46}; -static float P052[3] = {599.09, -300.15, 7894.03}; -static float P053[3] = {735.48, 306.26, 7911.92}; -static float P054[3] = {246.22, 558.53, 8460.50}; -static float P055[3] = {-230.41, 559.84, 8473.23}; -static float P056[3] = {-698.66, 320.83, 7902.59}; -static float P057[3] = {-643.29, -299.16, 7902.59}; -static float P058[3] = {-341.47, -719.30, 7902.59}; -static float P059[3] = {252.57, -756.12, 7902.59}; -static float P060[3] = {458.39, -265.31, 9355.44}; -static float P062[3] = {224.04, 338.75, 9450.30}; -static float P063[3] = {-165.71, 341.04, 9462.35}; -static float P064[3] = {-298.11, 110.13, 10180.37}; -static float P065[3] = {-473.99, -219.71, 9355.44}; -static float P066[3] = {-211.97, -479.87, 9355.44}; -static float P067[3] = {192.86, -491.45, 9348.73}; -static float P068[3] = {-136.29, -319.84, 1228.73}; -static float P069[3] = {1111.17, -314.14, 1314.19}; -static float P070[3] = {-1167.34, -321.61, 1319.45}; -static float P071[3] = {1404.86, -306.66, 1235.45}; -static float P072[3] = {-1409.73, -314.14, 1247.66}; -static float P073[3] = {1254.01, -296.87, 1544.58}; -static float P074[3] = {-1262.09, -291.70, 1504.26}; -static float P075[3] = {965.71, -269.26, 1742.65}; -static float P076[3] = {-900.97, -276.74, 1726.07}; -static float iP068[3] = {-136.29, -319.84, 1228.73}; -static float iP069[3] = {1111.17, -314.14, 1314.19}; -static float iP070[3] = {-1167.34, -321.61, 1319.45}; -static float iP071[3] = {1404.86, -306.66, 1235.45}; -static float iP072[3] = {-1409.73, -314.14, 1247.66}; -static float iP073[3] = {1254.01, -296.87, 1544.58}; -static float iP074[3] = {-1262.09, -291.70, 1504.26}; -static float iP075[3] = {965.71, -269.26, 1742.65}; -static float iP076[3] = {-900.97, -276.74, 1726.07}; -static float P077[3] = {1058.00, -448.81, 8194.66}; -static float P078[3] = {-1016.51, -456.43, 8190.62}; -static float P079[3] = {-1515.96, -676.45, 7754.93}; -static float P080[3] = {1856.75, -830.34, 7296.56}; -static float P081[3] = {1472.16, -497.38, 7399.68}; -static float P082[3] = {-1775.26, -829.51, 7298.46}; -static float P083[3] = {911.09, -252.51, 7510.99}; -static float P084[3] = {-1451.94, -495.62, 7384.30}; -static float P085[3] = {1598.75, -669.26, 7769.90}; -static float P086[3] = {-836.53, -250.08, 7463.25}; -static float P087[3] = {722.87, -158.18, 8006.41}; -static float P088[3] = {-688.86, -162.28, 7993.89}; -static float P089[3] = {-626.92, -185.30, 8364.98}; -static float P090[3] = {647.72, -189.46, 8354.99}; -static float P091[3] = {0.00, 835.01, 5555.62}; -static float P092[3] = {0.00, 1350.18, 5220.86}; -static float P093[3] = {0.00, 1422.94, 5285.27}; -static float P094[3] = {0.00, 1296.75, 5650.19}; -static float P095[3] = {0.00, 795.63, 6493.88}; -static float iP091[3] = {0.00, 835.01, 5555.62}; -static float iP092[3] = {0.00, 1350.18, 5220.86}; -static float iP093[3] = {0.00, 1422.94, 5285.27}; -static float iP094[3] = {0.00, 1296.75, 5650.19}; -static float iP095[3] = {0.00, 795.63, 6493.88}; -static float P097[3] = {-194.91, -357.14, 10313.32}; -static float P098[3] = {135.35, -357.66, 10307.94}; -static float iP097[3] = {-194.91, -357.14, 10313.32}; -static float iP098[3] = {135.35, -357.66, 10307.94}; -static float P099[3] = {-380.53, -221.14, 9677.98}; -static float P100[3] = {0.00, 412.99, 9629.33}; -static float P102[3] = {59.51, -412.55, 10677.58}; -static float iP102[3] = {59.51, -412.55, 10677.58}; -static float P103[3] = {6.50, 484.74, 9009.94}; -static float P105[3] = {-41.86, 476.51, 9078.17}; -static float P108[3] = {49.20, 476.83, 9078.24}; -static float P110[3] = {-187.62, -410.04, 10674.12}; -static float iP110[3] = {-187.62, -410.04, 10674.12}; -static float P111[3] = {-184.25, -318.70, 10723.88}; -static float iP111[3] = {-184.25, -318.70, 10723.88}; -static float P112[3] = {-179.61, -142.81, 10670.26}; -static float P113[3] = {57.43, -147.94, 10675.26}; -static float P114[3] = {54.06, -218.90, 10712.44}; -static float P115[3] = {-186.35, -212.09, 10713.76}; -static float P116[3] = {205.90, -84.61, 10275.97}; -static float P117[3] = {-230.96, -83.26, 10280.09}; -static float iP118[3] = {216.78, -509.17, 10098.94}; -static float iP119[3] = {-313.21, -510.79, 10102.62}; -static float P118[3] = {216.78, -509.17, 10098.94}; -static float P119[3] = {-313.21, -510.79, 10102.62}; -static float P120[3] = {217.95, 96.34, 10161.62}; -static float P121[3] = {71.99, -319.74, 10717.70}; -static float iP121[3] = {71.99, -319.74, 10717.70}; -static float P122[3] = {0.00, 602.74, 5375.84}; -static float iP122[3] = {0.00, 602.74, 5375.84}; -static float P123[3] = {-448.94, -203.14, 9499.60}; -static float P124[3] = {-442.64, -185.20, 9528.07}; -static float P125[3] = {-441.07, -148.05, 9528.07}; -static float P126[3] = {-443.43, -128.84, 9499.60}; -static float P127[3] = {-456.87, -146.78, 9466.67}; -static float P128[3] = {-453.68, -183.93, 9466.67}; -static float P129[3] = {428.43, -124.08, 9503.03}; -static float P130[3] = {419.73, -142.14, 9534.56}; -static float P131[3] = {419.92, -179.96, 9534.56}; -static float P132[3] = {431.20, -199.73, 9505.26}; -static float P133[3] = {442.28, -181.67, 9475.96}; -static float P134[3] = {442.08, -143.84, 9475.96}; -/* *INDENT-ON* */ - -void -Dolphin001(void) -{ - glNormal3fv(N071); - glBegin(GL_POLYGON); - glVertex3fv(P001); - glVertex3fv(P068); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P076); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P070); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P076); - glVertex3fv(P070); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P070); - glVertex3fv(P072); - glVertex3fv(P074); - glEnd(); - glNormal3fv(N119); - glBegin(GL_POLYGON); - glVertex3fv(P072); - glVertex3fv(P070); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P074); - glVertex3fv(P070); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P070); - glVertex3fv(P068); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P076); - glVertex3fv(P068); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P001); - glVertex3fv(P010); - glEnd(); -} - -void -Dolphin002(void) -{ - glNormal3fv(N071); - glBegin(GL_POLYGON); - glVertex3fv(P011); - glVertex3fv(P001); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P075); - glVertex3fv(P011); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P011); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P075); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P071); - glVertex3fv(P069); - glVertex3fv(P073); - glEnd(); - glNormal3fv(N119); - glBegin(GL_POLYGON); - glVertex3fv(P001); - glVertex3fv(P011); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P009); - glVertex3fv(P011); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P011); - glVertex3fv(P069); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P073); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P071); - glVertex3fv(P073); - glEnd(); -} - -void -Dolphin003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glEnd(); -} - -void -Dolphin004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); -} - -void -Dolphin005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); -} - -void -Dolphin006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N122); - glVertex3fv(P122); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N091); - glVertex3fv(P091); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N122); - glVertex3fv(P122); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); -} - -void -Dolphin007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); -} - -void -Dolphin008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); -} - -void -Dolphin009(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); -} - -void -Dolphin010(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); -} - -void -Dolphin011(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N079); - glVertex3fv(P079); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N089); - glVertex3fv(P089); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); -} - -void -Dolphin012(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N067); - glVertex3fv(P067); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); -} - -void -Dolphin013(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N116); - glVertex3fv(P116); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N113); - glVertex3fv(P113); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N113); - glVertex3fv(P113); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N115); - glVertex3fv(P115); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N116); - glVertex3fv(P116); - glNormal3fv(N113); - glVertex3fv(P113); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P002); - glVertex3fv(P007); - glVertex3fv(P008); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P007); - glVertex3fv(P114); - glVertex3fv(P115); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N112); - glVertex3fv(P112); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N115); - glVertex3fv(P115); - glEnd(); -} - -void -Dolphin014(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N111); - glVertex3fv(P111); - glNormal3fv(N110); - glVertex3fv(P110); - glNormal3fv(N102); - glVertex3fv(P102); - glNormal3fv(N121); - glVertex3fv(P121); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N111); - glVertex3fv(P111); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N110); - glVertex3fv(P110); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N110); - glVertex3fv(P110); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P098); - glVertex3fv(P097); - glVertex3fv(P111); - glVertex3fv(P121); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P002); - glVertex3fv(P099); - glVertex3fv(P097); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N110); - glVertex3fv(P110); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N102); - glVertex3fv(P102); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N118); - glVertex3fv(P118); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N118); - glVertex3fv(P118); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N098); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N102); - glVertex3fv(P102); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N102); - glVertex3fv(P102); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N121); - glVertex3fv(P121); - glEnd(); -} - -void -Dolphin015(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N100); - glVertex3fv(P100); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N117); - glVertex3fv(P117); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); -} - -void -Dolphin016(void) -{ - - glDisable(GL_DEPTH_TEST); - glBegin(GL_POLYGON); - glVertex3fv(P123); - glVertex3fv(P124); - glVertex3fv(P125); - glVertex3fv(P126); - glVertex3fv(P127); - glVertex3fv(P128); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P129); - glVertex3fv(P130); - glVertex3fv(P131); - glVertex3fv(P132); - glVertex3fv(P133); - glVertex3fv(P134); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P103); - glVertex3fv(P105); - glVertex3fv(P108); - glEnd(); - glEnable(GL_DEPTH_TEST); -} - -void -DrawDolphin(fishRec * fish) -{ - float seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7; - float pitch, thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (10.0 * fish->v)) % 360; - - thrash = 70.0 * fish->v; - - seg0 = 1.0 * thrash * sin((fish->htail) * RRAD); - seg3 = 1.0 * thrash * sin((fish->htail) * RRAD); - seg1 = 2.0 * thrash * sin((fish->htail + 4.0) * RRAD); - seg2 = 3.0 * thrash * sin((fish->htail + 6.0) * RRAD); - seg4 = 4.0 * thrash * sin((fish->htail + 10.0) * RRAD); - seg5 = 4.5 * thrash * sin((fish->htail + 15.0) * RRAD); - seg6 = 5.0 * thrash * sin((fish->htail + 20.0) * RRAD); - seg7 = 6.0 * thrash * sin((fish->htail + 30.0) * RRAD); - - pitch = fish->v * sin((fish->htail + 180.0) * RRAD); - - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - chomp = 100.0; - - P012[1] = iP012[1] + seg5; - P013[1] = iP013[1] + seg5; - P014[1] = iP014[1] + seg5; - P015[1] = iP015[1] + seg5; - P016[1] = iP016[1] + seg5; - P017[1] = iP017[1] + seg5; - P018[1] = iP018[1] + seg5; - P019[1] = iP019[1] + seg5; - - P020[1] = iP020[1] + seg4; - P021[1] = iP021[1] + seg4; - P022[1] = iP022[1] + seg4; - P023[1] = iP023[1] + seg4; - P024[1] = iP024[1] + seg4; - P025[1] = iP025[1] + seg4; - P026[1] = iP026[1] + seg4; - P027[1] = iP027[1] + seg4; - - P028[1] = iP028[1] + seg2; - P029[1] = iP029[1] + seg2; - P030[1] = iP030[1] + seg2; - P031[1] = iP031[1] + seg2; - P032[1] = iP032[1] + seg2; - P033[1] = iP033[1] + seg2; - P034[1] = iP034[1] + seg2; - P035[1] = iP035[1] + seg2; - - P036[1] = iP036[1] + seg1; - P037[1] = iP037[1] + seg1; - P038[1] = iP038[1] + seg1; - P039[1] = iP039[1] + seg1; - P040[1] = iP040[1] + seg1; - P041[1] = iP041[1] + seg1; - P042[1] = iP042[1] + seg1; - P043[1] = iP043[1] + seg1; - - P044[1] = iP044[1] + seg0; - P045[1] = iP045[1] + seg0; - P046[1] = iP046[1] + seg0; - P047[1] = iP047[1] + seg0; - P048[1] = iP048[1] + seg0; - P049[1] = iP049[1] + seg0; - P050[1] = iP050[1] + seg0; - P051[1] = iP051[1] + seg0; - - P009[1] = iP009[1] + seg6; - P010[1] = iP010[1] + seg6; - P075[1] = iP075[1] + seg6; - P076[1] = iP076[1] + seg6; - - P001[1] = iP001[1] + seg7; - P011[1] = iP011[1] + seg7; - P068[1] = iP068[1] + seg7; - P069[1] = iP069[1] + seg7; - P070[1] = iP070[1] + seg7; - P071[1] = iP071[1] + seg7; - P072[1] = iP072[1] + seg7; - P073[1] = iP073[1] + seg7; - P074[1] = iP074[1] + seg7; - - P091[1] = iP091[1] + seg3; - P092[1] = iP092[1] + seg3; - P093[1] = iP093[1] + seg3; - P094[1] = iP094[1] + seg3; - P095[1] = iP095[1] + seg3; - P122[1] = iP122[1] + seg3 * 1.5; - - P097[1] = iP097[1] + chomp; - P098[1] = iP098[1] + chomp; - P102[1] = iP102[1] + chomp; - P110[1] = iP110[1] + chomp; - P111[1] = iP111[1] + chomp; - P121[1] = iP121[1] + chomp; - P118[1] = iP118[1] + chomp; - P119[1] = iP119[1] + chomp; - - glPushMatrix(); - - glRotatef(pitch, 1.0, 0.0, 0.0); - - glTranslatef(0.0, 0.0, 7000.0); - - glRotatef(180.0, 0.0, 1.0, 0.0); - - glEnable(GL_CULL_FACE); - Dolphin014(); - Dolphin010(); - Dolphin009(); - Dolphin012(); - Dolphin013(); - Dolphin006(); - Dolphin002(); - Dolphin001(); - Dolphin003(); - Dolphin015(); - Dolphin004(); - Dolphin005(); - Dolphin007(); - Dolphin008(); - Dolphin011(); - Dolphin016(); - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c deleted file mode 100644 index 9c847dbafe..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c +++ /dev/null @@ -1,1308 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N002[3] = {0.000077 ,-0.020611 ,0.999788}; -static float N003[3] = {0.961425 ,0.258729 ,-0.093390}; -static float N004[3] = {0.510811 ,-0.769633 ,-0.383063}; -static float N005[3] = {0.400123 ,0.855734 ,-0.328055}; -static float N006[3] = {-0.770715 ,0.610204 ,-0.183440}; -static float N007[3] = {-0.915597 ,-0.373345 ,-0.149316}; -static float N008[3] = {-0.972788 ,0.208921 ,-0.100179}; -static float N009[3] = {-0.939713 ,-0.312268 ,-0.139383}; -static float N010[3] = {-0.624138 ,-0.741047 ,-0.247589}; -static float N011[3] = {0.591434 ,-0.768401 ,-0.244471}; -static float N012[3] = {0.935152 ,-0.328495 ,-0.132598}; -static float N013[3] = {0.997102 ,0.074243 ,-0.016593}; -static float N014[3] = {0.969995 ,0.241712 ,-0.026186}; -static float N015[3] = {0.844539 ,0.502628 ,-0.184714}; -static float N016[3] = {-0.906608 ,0.386308 ,-0.169787}; -static float N017[3] = {-0.970016 ,0.241698 ,-0.025516}; -static float N018[3] = {-0.998652 ,0.050493 ,-0.012045}; -static float N019[3] = {-0.942685 ,-0.333051 ,-0.020556}; -static float N020[3] = {-0.660944 ,-0.750276 ,0.015480}; -static float N021[3] = {0.503549 ,-0.862908 ,-0.042749}; -static float N022[3] = {0.953202 ,-0.302092 ,-0.012089}; -static float N023[3] = {0.998738 ,0.023574 ,0.044344}; -static float N024[3] = {0.979297 ,0.193272 ,0.060202}; -static float N025[3] = {0.798300 ,0.464885 ,0.382883}; -static float N026[3] = {-0.756590 ,0.452403 ,0.472126}; -static float N027[3] = {-0.953855 ,0.293003 ,0.065651}; -static float N028[3] = {-0.998033 ,0.040292 ,0.048028}; -static float N029[3] = {-0.977079 ,-0.204288 ,0.059858}; -static float N030[3] = {-0.729117 ,-0.675304 ,0.111140}; -static float N031[3] = {0.598361 ,-0.792753 ,0.116221}; -static float N032[3] = {0.965192 ,-0.252991 ,0.066332}; -static float N033[3] = {0.998201 ,-0.002790 ,0.059892}; -static float N034[3] = {0.978657 ,0.193135 ,0.070207}; -static float N035[3] = {0.718815 ,0.680392 ,0.142733}; -static float N036[3] = {-0.383096 ,0.906212 ,0.178936}; -static float N037[3] = {-0.952831 ,0.292590 ,0.080647}; -static float N038[3] = {-0.997680 ,0.032417 ,0.059861}; -static float N039[3] = {-0.982629 ,-0.169881 ,0.074700}; -static float N040[3] = {-0.695424 ,-0.703466 ,0.146700}; -static float N041[3] = {0.359323 ,-0.915531 ,0.180805}; -static float N042[3] = {0.943356 ,-0.319387 ,0.089842}; -static float N043[3] = {0.998272 ,-0.032435 ,0.048993}; -static float N044[3] = {0.978997 ,0.193205 ,0.065084}; -static float N045[3] = {0.872144 ,0.470094 ,-0.135565}; -static float N046[3] = {-0.664282 ,0.737945 ,-0.119027}; -static float N047[3] = {-0.954508 ,0.288570 ,0.075107}; -static float N048[3] = {-0.998273 ,0.032406 ,0.048993}; -static float N049[3] = {-0.979908 ,-0.193579 ,0.048038}; -static float N050[3] = {-0.858736 ,-0.507202 ,-0.072938}; -static float N051[3] = {0.643545 ,-0.763887 ,-0.048237}; -static float N052[3] = {0.955580 ,-0.288954 ,0.058068}; -static float N058[3] = {0.000050 ,0.793007 ,-0.609213}; -static float N059[3] = {0.913510 ,0.235418 ,-0.331779}; -static float N060[3] = {-0.807970 ,0.495000 ,-0.319625}; -static float N061[3] = {0.000000 ,0.784687 ,-0.619892}; -static float N062[3] = {0.000000 ,-1.000000 ,0.000000}; -static float N063[3] = {0.000000 ,1.000000 ,0.000000}; -static float N064[3] = {0.000000 ,1.000000 ,0.000000}; -static float N065[3] = {0.000000 ,1.000000 ,0.000000}; -static float N066[3] = {-0.055784 ,0.257059 ,0.964784}; -static float N069[3] = {-0.000505 ,-0.929775 ,-0.368127}; -static float N070[3] = {0.000000 ,1.000000 ,0.000000}; -static float P002[3] = {0.00, -36.59, 5687.72}; -static float P003[3] = {90.00, 114.73, 724.38}; -static float P004[3] = {58.24, -146.84, 262.35}; -static float P005[3] = {27.81, 231.52, 510.43}; -static float P006[3] = {-27.81, 230.43, 509.76}; -static float P007[3] = {-46.09, -146.83, 265.84}; -static float P008[3] = {-90.00, 103.84, 718.53}; -static float P009[3] = {-131.10, -165.92, 834.85}; -static float P010[3] = {-27.81, -285.31, 500.00}; -static float P011[3] = {27.81, -285.32, 500.00}; -static float P012[3] = {147.96, -170.89, 845.50}; -static float P013[3] = {180.00, 0.00, 2000.00}; -static float P014[3] = {145.62, 352.67, 2000.00}; -static float P015[3] = {55.62, 570.63, 2000.00}; -static float P016[3] = {-55.62, 570.64, 2000.00}; -static float P017[3] = {-145.62, 352.68, 2000.00}; -static float P018[3] = {-180.00, 0.01, 2000.00}; -static float P019[3] = {-178.20, -352.66, 2001.61}; -static float P020[3] = {-55.63, -570.63, 2000.00}; -static float P021[3] = {55.62, -570.64, 2000.00}; -static float P022[3] = {179.91, -352.69, 1998.39}; -static float P023[3] = {150.00, 0.00, 3000.00}; -static float P024[3] = {121.35, 293.89, 3000.00}; -static float P025[3] = {46.35, 502.93, 2883.09}; -static float P026[3] = {-46.35, 497.45, 2877.24}; -static float P027[3] = {-121.35, 293.90, 3000.00}; -static float P028[3] = {-150.00, 0.00, 3000.00}; -static float P029[3] = {-152.21, -304.84, 2858.68}; -static float P030[3] = {-46.36, -475.52, 3000.00}; -static float P031[3] = {46.35, -475.53, 3000.00}; -static float P032[3] = {155.64, -304.87, 2863.50}; -static float P033[3] = {90.00, 0.00, 4000.00}; -static float P034[3] = {72.81, 176.33, 4000.00}; -static float P035[3] = {27.81, 285.32, 4000.00}; -static float P036[3] = {-27.81, 285.32, 4000.00}; -static float P037[3] = {-72.81, 176.34, 4000.00}; -static float P038[3] = {-90.00, 0.00, 4000.00}; -static float P039[3] = {-72.81, -176.33, 4000.00}; -static float P040[3] = {-27.81, -285.31, 4000.00}; -static float P041[3] = {27.81, -285.32, 4000.00}; -static float P042[3] = {72.81, -176.34, 4000.00}; -static float P043[3] = {30.00, 0.00, 5000.00}; -static float P044[3] = {24.27, 58.78, 5000.00}; -static float P045[3] = {9.27, 95.11, 5000.00}; -static float P046[3] = {-9.27, 95.11, 5000.00}; -static float P047[3] = {-24.27, 58.78, 5000.00}; -static float P048[3] = {-30.00, 0.00, 5000.00}; -static float P049[3] = {-24.27, -58.78, 5000.00}; -static float P050[3] = {-9.27, -95.10, 5000.00}; -static float P051[3] = {9.27, -95.11, 5000.00}; -static float P052[3] = {24.27, -58.78, 5000.00}; -static float P058[3] = {0.00, 1212.72, 2703.08}; -static float P059[3] = {50.36, 0.00, 108.14}; -static float P060[3] = {-22.18, 0.00, 108.14}; -static float P061[3] = {0.00, 1181.61, 6344.65}; -static float P062[3] = {516.45, -887.08, 2535.45}; -static float P063[3] = {-545.69, -879.31, 2555.63}; -static float P064[3] = {618.89, -1005.64, 2988.32}; -static float P065[3] = {-635.37, -1014.79, 2938.68}; -static float P066[3] = {0.00, 1374.43, 3064.18}; -static float P069[3] = {0.00, -418.25, 5765.04}; -static float P070[3] = {0.00, 1266.91, 6629.60}; -static float P071[3] = {-139.12, -124.96, 997.98}; -static float P072[3] = {-139.24, -110.18, 1020.68}; -static float P073[3] = {-137.33, -94.52, 1022.63}; -static float P074[3] = {-137.03, -79.91, 996.89}; -static float P075[3] = {-135.21, -91.48, 969.14}; -static float P076[3] = {-135.39, -110.87, 968.76}; -static float P077[3] = {150.23, -78.44, 995.53}; -static float P078[3] = {152.79, -92.76, 1018.46}; -static float P079[3] = {154.19, -110.20, 1020.55}; -static float P080[3] = {151.33, -124.15, 993.77}; -static float P081[3] = {150.49, -111.19, 969.86}; -static float P082[3] = {150.79, -92.41, 969.70}; -static float iP002[3] = {0.00, -36.59, 5687.72}; -static float iP004[3] = {58.24, -146.84, 262.35}; -static float iP007[3] = {-46.09, -146.83, 265.84}; -static float iP010[3] = {-27.81, -285.31, 500.00}; -static float iP011[3] = {27.81, -285.32, 500.00}; -static float iP023[3] = {150.00, 0.00, 3000.00}; -static float iP024[3] = {121.35, 293.89, 3000.00}; -static float iP025[3] = {46.35, 502.93, 2883.09}; -static float iP026[3] = {-46.35, 497.45, 2877.24}; -static float iP027[3] = {-121.35, 293.90, 3000.00}; -static float iP028[3] = {-150.00, 0.00, 3000.00}; -static float iP029[3] = {-121.35, -304.84, 2853.86}; -static float iP030[3] = {-46.36, -475.52, 3000.00}; -static float iP031[3] = {46.35, -475.53, 3000.00}; -static float iP032[3] = {121.35, -304.87, 2853.86}; -static float iP033[3] = {90.00, 0.00, 4000.00}; -static float iP034[3] = {72.81, 176.33, 4000.00}; -static float iP035[3] = {27.81, 285.32, 4000.00}; -static float iP036[3] = {-27.81, 285.32, 4000.00}; -static float iP037[3] = {-72.81, 176.34, 4000.00}; -static float iP038[3] = {-90.00, 0.00, 4000.00}; -static float iP039[3] = {-72.81, -176.33, 4000.00}; -static float iP040[3] = {-27.81, -285.31, 4000.00}; -static float iP041[3] = {27.81, -285.32, 4000.00}; -static float iP042[3] = {72.81, -176.34, 4000.00}; -static float iP043[3] = {30.00, 0.00, 5000.00}; -static float iP044[3] = {24.27, 58.78, 5000.00}; -static float iP045[3] = {9.27, 95.11, 5000.00}; -static float iP046[3] = {-9.27, 95.11, 5000.00}; -static float iP047[3] = {-24.27, 58.78, 5000.00}; -static float iP048[3] = {-30.00, 0.00, 5000.00}; -static float iP049[3] = {-24.27, -58.78, 5000.00}; -static float iP050[3] = {-9.27, -95.10, 5000.00}; -static float iP051[3] = {9.27, -95.11, 5000.00}; -static float iP052[3] = {24.27, -58.78, 5000.00}; -static float iP061[3] = {0.00, 1181.61, 6344.65}; -static float iP069[3] = {0.00, -418.25, 5765.04}; -static float iP070[3] = {0.00, 1266.91, 6629.60}; -/* *INDENT-ON* */ - -void -Fish001(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N017); - glVertex3fv(P017); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N007); - glVertex3fv(P007); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N011); - glVertex3fv(P011); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N011); - glVertex3fv(P011); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P071); - glVertex3fv(P072); - glVertex3fv(P073); - glVertex3fv(P074); - glVertex3fv(P075); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P077); - glVertex3fv(P078); - glVertex3fv(P079); - glVertex3fv(P080); - glVertex3fv(P081); - glVertex3fv(P082); - glEnd(); -} - -void -Fish002(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); -} - -void -Fish003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); -} - -void -Fish004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N061); - glVertex3fv(P061); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N070); - glVertex3fv(P070); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N061); - glVertex3fv(P061); - glEnd(); -} - -void -Fish005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N069); - glVertex3fv(P069); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N069); - glVertex3fv(P069); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); -} - -void -Fish006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); -} - -void -Fish007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); -} - -void -Fish008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); -} - -void -Fish009(void) -{ - glBegin(GL_POLYGON); - glVertex3fv(P059); - glVertex3fv(P012); - glVertex3fv(P009); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P012); - glVertex3fv(P004); - glVertex3fv(P007); - glVertex3fv(P009); - glEnd(); -} - -void -Fish_1(void) -{ - Fish004(); - Fish005(); - Fish003(); - Fish007(); - Fish006(); - Fish002(); - Fish008(); - Fish009(); - Fish001(); -} - -void -Fish_2(void) -{ - Fish005(); - Fish004(); - Fish003(); - Fish008(); - Fish006(); - Fish002(); - Fish007(); - Fish009(); - Fish001(); -} - -void -Fish_3(void) -{ - Fish005(); - Fish004(); - Fish007(); - Fish003(); - Fish002(); - Fish008(); - Fish009(); - Fish001(); - Fish006(); -} - -void -Fish_4(void) -{ - Fish005(); - Fish004(); - Fish008(); - Fish003(); - Fish002(); - Fish007(); - Fish009(); - Fish001(); - Fish006(); -} - -void -Fish_5(void) -{ - Fish009(); - Fish006(); - Fish007(); - Fish001(); - Fish002(); - Fish003(); - Fish008(); - Fish004(); - Fish005(); -} - -void -Fish_6(void) -{ - Fish009(); - Fish006(); - Fish008(); - Fish001(); - Fish002(); - Fish007(); - Fish003(); - Fish004(); - Fish005(); -} - -void -Fish_7(void) -{ - Fish009(); - Fish001(); - Fish007(); - Fish005(); - Fish002(); - Fish008(); - Fish003(); - Fish004(); - Fish006(); -} - -void -Fish_8(void) -{ - Fish009(); - Fish008(); - Fish001(); - Fish002(); - Fish007(); - Fish003(); - Fish005(); - Fish004(); - Fish006(); -} - -void -DrawShark(fishRec * fish) -{ - float mat[4][4]; - int n; - float seg1, seg2, seg3, seg4, segup; - float thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360; - - thrash = 50.0 * fish->v; - - seg1 = 0.6 * thrash * sin(fish->htail * RRAD); - seg2 = 1.8 * thrash * sin((fish->htail + 45.0) * RRAD); - seg3 = 3.0 * thrash * sin((fish->htail + 90.0) * RRAD); - seg4 = 4.0 * thrash * sin((fish->htail + 110.0) * RRAD); - - chomp = 0.0; - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - P004[1] = iP004[1] + chomp; - P007[1] = iP007[1] + chomp; - P010[1] = iP010[1] + chomp; - P011[1] = iP011[1] + chomp; - - P023[0] = iP023[0] + seg1; - P024[0] = iP024[0] + seg1; - P025[0] = iP025[0] + seg1; - P026[0] = iP026[0] + seg1; - P027[0] = iP027[0] + seg1; - P028[0] = iP028[0] + seg1; - P029[0] = iP029[0] + seg1; - P030[0] = iP030[0] + seg1; - P031[0] = iP031[0] + seg1; - P032[0] = iP032[0] + seg1; - P033[0] = iP033[0] + seg2; - P034[0] = iP034[0] + seg2; - P035[0] = iP035[0] + seg2; - P036[0] = iP036[0] + seg2; - P037[0] = iP037[0] + seg2; - P038[0] = iP038[0] + seg2; - P039[0] = iP039[0] + seg2; - P040[0] = iP040[0] + seg2; - P041[0] = iP041[0] + seg2; - P042[0] = iP042[0] + seg2; - P043[0] = iP043[0] + seg3; - P044[0] = iP044[0] + seg3; - P045[0] = iP045[0] + seg3; - P046[0] = iP046[0] + seg3; - P047[0] = iP047[0] + seg3; - P048[0] = iP048[0] + seg3; - P049[0] = iP049[0] + seg3; - P050[0] = iP050[0] + seg3; - P051[0] = iP051[0] + seg3; - P052[0] = iP052[0] + seg3; - P002[0] = iP002[0] + seg4; - P061[0] = iP061[0] + seg4; - P069[0] = iP069[0] + seg4; - P070[0] = iP070[0] + seg4; - - fish->vtail += ((fish->dtheta - fish->vtail) * 0.1); - - if (fish->vtail > 0.5) { - fish->vtail = 0.5; - } else if (fish->vtail < -0.5) { - fish->vtail = -0.5; - } - segup = thrash * fish->vtail; - - P023[1] = iP023[1] + segup; - P024[1] = iP024[1] + segup; - P025[1] = iP025[1] + segup; - P026[1] = iP026[1] + segup; - P027[1] = iP027[1] + segup; - P028[1] = iP028[1] + segup; - P029[1] = iP029[1] + segup; - P030[1] = iP030[1] + segup; - P031[1] = iP031[1] + segup; - P032[1] = iP032[1] + segup; - P033[1] = iP033[1] + segup * 5.0; - P034[1] = iP034[1] + segup * 5.0; - P035[1] = iP035[1] + segup * 5.0; - P036[1] = iP036[1] + segup * 5.0; - P037[1] = iP037[1] + segup * 5.0; - P038[1] = iP038[1] + segup * 5.0; - P039[1] = iP039[1] + segup * 5.0; - P040[1] = iP040[1] + segup * 5.0; - P041[1] = iP041[1] + segup * 5.0; - P042[1] = iP042[1] + segup * 5.0; - P043[1] = iP043[1] + segup * 12.0; - P044[1] = iP044[1] + segup * 12.0; - P045[1] = iP045[1] + segup * 12.0; - P046[1] = iP046[1] + segup * 12.0; - P047[1] = iP047[1] + segup * 12.0; - P048[1] = iP048[1] + segup * 12.0; - P049[1] = iP049[1] + segup * 12.0; - P050[1] = iP050[1] + segup * 12.0; - P051[1] = iP051[1] + segup * 12.0; - P052[1] = iP052[1] + segup * 12.0; - P002[1] = iP002[1] + segup * 17.0; - P061[1] = iP061[1] + segup * 17.0; - P069[1] = iP069[1] + segup * 17.0; - P070[1] = iP070[1] + segup * 17.0; - - glPushMatrix(); - - glTranslatef(0.0, 0.0, -3000.0); - - glGetFloatv(GL_MODELVIEW_MATRIX, &mat[0][0]); - n = 0; - if (mat[0][2] >= 0.0) { - n += 1; - } - if (mat[1][2] >= 0.0) { - n += 2; - } - if (mat[2][2] >= 0.0) { - n += 4; - } - glScalef(2.0, 1.0, 1.0); - - glEnable(GL_CULL_FACE); - switch (n) { - case 0: - Fish_1(); - break; - case 1: - Fish_2(); - break; - case 2: - Fish_3(); - break; - case 3: - Fish_4(); - break; - case 4: - Fish_5(); - break; - case 5: - Fish_6(); - break; - case 6: - Fish_7(); - break; - case 7: - Fish_8(); - break; - } - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/swim.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/swim.c deleted file mode 100644 index cac7b60952..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/swim.c +++ /dev/null @@ -1,188 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include /* For rand(). */ -#include -#include "atlantis.h" - -void -FishTransform(fishRec * fish) -{ - - glTranslatef(fish->y, fish->z, -fish->x); - glRotatef(-fish->psi, 0.0, 1.0, 0.0); - glRotatef(fish->theta, 1.0, 0.0, 0.0); - glRotatef(-fish->phi, 0.0, 0.0, 1.0); -} - -void -WhalePilot(fishRec * fish) -{ - - fish->phi = -20.0; - fish->theta = 0.0; - fish->psi -= 0.5; - - fish->x += WHALESPEED * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD); - fish->y += WHALESPEED * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD); - fish->z += WHALESPEED * fish->v * sin(fish->theta / RAD); -} - -void -SharkPilot(fishRec * fish) -{ - static int sign = 1; - float X, Y, Z, tpsi, ttheta, thetal; - - fish->xt = 60000.0; - fish->yt = 0.0; - fish->zt = 0.0; - - X = fish->xt - fish->x; - Y = fish->yt - fish->y; - Z = fish->zt - fish->z; - - thetal = fish->theta; - - ttheta = RAD * atan(Z / (sqrt(X * X + Y * Y))); - - if (ttheta > fish->theta + 0.25) { - fish->theta += 0.5; - } else if (ttheta < fish->theta - 0.25) { - fish->theta -= 0.5; - } - if (fish->theta > 90.0) { - fish->theta = 90.0; - } - if (fish->theta < -90.0) { - fish->theta = -90.0; - } - fish->dtheta = fish->theta - thetal; - - tpsi = RAD * atan2(Y, X); - - fish->attack = 0; - - if (fabs(tpsi - fish->psi) < 10.0) { - fish->attack = 1; - } else if (fabs(tpsi - fish->psi) < 45.0) { - if (fish->psi > tpsi) { - fish->psi -= 0.5; - if (fish->psi < -180.0) { - fish->psi += 360.0; - } - } else if (fish->psi < tpsi) { - fish->psi += 0.5; - if (fish->psi > 180.0) { - fish->psi -= 360.0; - } - } - } else { - if (rand() % 100 > 98) { - sign = 1 - sign; - } - fish->psi += sign; - if (fish->psi > 180.0) { - fish->psi -= 360.0; - } - if (fish->psi < -180.0) { - fish->psi += 360.0; - } - } - - if (fish->attack) { - if (fish->v < 1.1) { - fish->spurt = 1; - } - if (fish->spurt) { - fish->v += 0.2; - } - if (fish->v > 5.0) { - fish->spurt = 0; - } - if ((fish->v > 1.0) && (!fish->spurt)) { - fish->v -= 0.2; - } - } else { - if (!(rand() % 400) && (!fish->spurt)) { - fish->spurt = 1; - } - if (fish->spurt) { - fish->v += 0.05; - } - if (fish->v > 3.0) { - fish->spurt = 0; - } - if ((fish->v > 1.0) && (!fish->spurt)) { - fish->v -= 0.05; - } - } - - fish->x += SHARKSPEED * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD); - fish->y += SHARKSPEED * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD); - fish->z += SHARKSPEED * fish->v * sin(fish->theta / RAD); -} - -void -SharkMiss(int i) -{ - int j; - float avoid, thetal; - float X, Y, Z, R; - - for (j = 0; j < NUM_SHARKS; j++) { - if (j != i) { - X = sharks[j].x - sharks[i].x; - Y = sharks[j].y - sharks[i].y; - Z = sharks[j].z - sharks[i].z; - - R = sqrt(X * X + Y * Y + Z * Z); - - avoid = 1.0; - thetal = sharks[i].theta; - - if (R < SHARKSIZE) { - if (Z > 0.0) { - sharks[i].theta -= avoid; - } else { - sharks[i].theta += avoid; - } - } - sharks[i].dtheta += (sharks[i].theta - thetal); - } - } -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/whale.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/whale.c deleted file mode 100644 index 828640ad04..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/whale.c +++ /dev/null @@ -1,1798 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N001[3] = {0.019249 ,0.011340 ,-0.999750}; -static float N002[3] = {-0.132579 ,0.954547 ,0.266952}; -static float N003[3] = {-0.196061 ,0.980392 ,-0.019778}; -static float N004[3] = {0.695461 ,0.604704 ,0.388158}; -static float N005[3] = {0.870600 ,0.425754 ,0.246557}; -static float N006[3] = {-0.881191 ,0.392012 ,0.264251}; -static float N008[3] = {-0.341437 ,0.887477 ,0.309523}; -static float N009[3] = {0.124035 ,-0.992278 ,0.000000}; -static float N010[3] = {0.242536 ,0.000000 ,-0.970143}; -static float N011[3] = {0.588172 ,0.000000 ,0.808736}; -static float N012[3] = {0.929824 ,-0.340623 ,-0.139298}; -static float N013[3] = {0.954183 ,0.267108 ,-0.134865}; -static float N014[3] = {0.495127 ,0.855436 ,-0.151914}; -static float N015[3] = {-0.390199 ,0.906569 ,-0.160867}; -static float N016[3] = {-0.923605 ,0.354581 ,-0.145692}; -static float N017[3] = {-0.955796 ,-0.260667 ,-0.136036}; -static float N018[3] = {-0.501283 ,-0.853462 ,-0.142540}; -static float N019[3] = {0.405300 ,-0.901974 ,-0.148913}; -static float N020[3] = {0.909913 ,-0.392746 ,-0.133451}; -static float N021[3] = {0.936494 ,0.331147 ,-0.115414}; -static float N022[3] = {0.600131 ,0.793724 ,-0.099222}; -static float N023[3] = {-0.231556 ,0.968361 ,-0.093053}; -static float N024[3] = {-0.844369 ,0.525330 ,-0.105211}; -static float N025[3] = {-0.982725 ,-0.136329 ,-0.125164}; -static float N026[3] = {-0.560844 ,-0.822654 ,-0.093241}; -static float N027[3] = {0.263884 ,-0.959981 ,-0.093817}; -static float N028[3] = {0.842057 ,-0.525192 ,-0.122938}; -static float N029[3] = {0.921620 ,0.367565 ,-0.124546}; -static float N030[3] = {0.613927 ,0.784109 ,-0.090918}; -static float N031[3] = {-0.448754 ,0.888261 ,-0.098037}; -static float N032[3] = {-0.891865 ,0.434376 ,-0.126077}; -static float N033[3] = {-0.881447 ,-0.448017 ,-0.149437}; -static float N034[3] = {-0.345647 ,-0.922057 ,-0.174183}; -static float N035[3] = {0.307998 ,-0.941371 ,-0.137688}; -static float N036[3] = {0.806316 ,-0.574647 ,-0.140124}; -static float N037[3] = {0.961346 ,0.233646 ,-0.145681}; -static float N038[3] = {0.488451 ,0.865586 ,-0.110351}; -static float N039[3] = {-0.374290 ,0.921953 ,-0.099553}; -static float N040[3] = {-0.928504 ,0.344533 ,-0.138485}; -static float N041[3] = {-0.918419 ,-0.371792 ,-0.135189}; -static float N042[3] = {-0.520666 ,-0.833704 ,-0.183968}; -static float N043[3] = {0.339204 ,-0.920273 ,-0.195036}; -static float N044[3] = {0.921475 ,-0.387382 ,-0.028636}; -static float N045[3] = {0.842465 ,0.533335 ,-0.076204}; -static float N046[3] = {0.380110 ,0.924939 ,0.002073}; -static float N047[3] = {-0.276128 ,0.961073 ,-0.009579}; -static float N048[3] = {-0.879684 ,0.473001 ,-0.049250}; -static float N049[3] = {-0.947184 ,-0.317614 ,-0.044321}; -static float N050[3] = {-0.642059 ,-0.764933 ,-0.051363}; -static float N051[3] = {0.466794 ,-0.880921 ,-0.077990}; -static float N052[3] = {0.898509 ,-0.432277 ,0.076279}; -static float N053[3] = {0.938985 ,0.328141 ,0.103109}; -static float N054[3] = {0.442420 ,0.895745 ,0.043647}; -static float N055[3] = {-0.255163 ,0.966723 ,0.018407}; -static float N056[3] = {-0.833769 ,0.540650 ,0.111924}; -static float N057[3] = {-0.953653 ,-0.289939 ,0.080507}; -static float N058[3] = {-0.672357 ,-0.730524 ,0.119461}; -static float N059[3] = {0.522249 ,-0.846652 ,0.102157}; -static float N060[3] = {0.885868 ,-0.427631 ,0.179914}; -static float N062[3] = {0.648942 ,0.743116 ,0.163255}; -static float N063[3] = {-0.578967 ,0.807730 ,0.111219}; -static float N065[3] = {-0.909864 ,-0.352202 ,0.219321}; -static float N066[3] = {-0.502541 ,-0.818090 ,0.279610}; -static float N067[3] = {0.322919 ,-0.915358 ,0.240504}; -static float N068[3] = {0.242536 ,0.000000 ,-0.970143}; -static float N069[3] = {0.000000 ,1.000000 ,0.000000}; -static float N070[3] = {0.000000 ,1.000000 ,0.000000}; -static float N071[3] = {0.000000 ,1.000000 ,0.000000}; -static float N072[3] = {0.000000 ,1.000000 ,0.000000}; -static float N073[3] = {0.000000 ,1.000000 ,0.000000}; -static float N074[3] = {0.000000 ,1.000000 ,0.000000}; -static float N075[3] = {0.031220 ,0.999025 ,-0.031220}; -static float N076[3] = {0.000000 ,1.000000 ,0.000000}; -static float N077[3] = {0.446821 ,0.893642 ,0.041889}; -static float N078[3] = {0.863035 ,-0.100980 ,0.494949}; -static float N079[3] = {0.585597 ,-0.808215 ,0.062174}; -static float N080[3] = {0.000000 ,1.000000 ,0.000000}; -static float N081[3] = {1.000000 ,0.000000 ,0.000000}; -static float N082[3] = {0.000000 ,1.000000 ,0.000000}; -static float N083[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N084[3] = {-0.478893 ,0.837129 ,-0.264343}; -static float N085[3] = {0.000000 ,1.000000 ,0.000000}; -static float N086[3] = {0.763909 ,0.539455 ,-0.354163}; -static float N087[3] = {0.446821 ,0.893642 ,0.041889}; -static float N088[3] = {0.385134 ,-0.908288 ,0.163352}; -static float N089[3] = {-0.605952 ,0.779253 ,-0.159961}; -static float N090[3] = {0.000000 ,1.000000 ,0.000000}; -static float N091[3] = {0.000000 ,1.000000 ,0.000000}; -static float N092[3] = {0.000000 ,1.000000 ,0.000000}; -static float N093[3] = {0.000000 ,1.000000 ,0.000000}; -static float N094[3] = {1.000000 ,0.000000 ,0.000000}; -static float N095[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N096[3] = {0.644444 ,-0.621516 ,0.445433}; -static float N097[3] = {-0.760896 ,-0.474416 ,0.442681}; -static float N098[3] = {0.636888 ,-0.464314 ,0.615456}; -static float N099[3] = {-0.710295 ,0.647038 ,0.277168}; -static float N100[3] = {0.009604 ,0.993655 ,0.112063}; -static float iP001[3] = {18.74, 13.19, 3.76}; -static float P001[3] = {18.74, 13.19, 3.76}; -static float P002[3] = {0.00, 390.42, 10292.57}; -static float P003[3] = {55.80, 622.31, 8254.35}; -static float P004[3] = {20.80, 247.66, 10652.13}; -static float P005[3] = {487.51, 198.05, 9350.78}; -static float P006[3] = {-457.61, 199.04, 9353.01}; -static float P008[3] = {-34.67, 247.64, 10663.71}; -static float iP009[3] = {97.46, 67.63, 593.82}; -static float iP010[3] = {-84.33, 67.63, 588.18}; -static float iP011[3] = {118.69, 8.98, -66.91}; -static float P009[3] = {97.46, 67.63, 593.82}; -static float P010[3] = {-84.33, 67.63, 588.18}; -static float P011[3] = {118.69, 8.98, -66.91}; -static float iP012[3] = {156.48, -31.95, 924.54}; -static float iP013[3] = {162.00, 110.22, 924.54}; -static float iP014[3] = {88.16, 221.65, 924.54}; -static float iP015[3] = {-65.21, 231.16, 924.54}; -static float iP016[3] = {-156.48, 121.97, 924.54}; -static float iP017[3] = {-162.00, -23.93, 924.54}; -static float iP018[3] = {-88.16, -139.10, 924.54}; -static float iP019[3] = {65.21, -148.61, 924.54}; -static float iP020[3] = {246.87, -98.73, 1783.04}; -static float iP021[3] = {253.17, 127.76, 1783.04}; -static float iP022[3] = {132.34, 270.77, 1783.04}; -static float iP023[3] = {-97.88, 285.04, 1783.04}; -static float iP024[3] = {-222.97, 139.80, 1783.04}; -static float iP025[3] = {-225.29, -86.68, 1783.04}; -static float iP026[3] = {-108.44, -224.15, 1783.04}; -static float iP027[3] = {97.88, -221.56, 1783.04}; -static float iP028[3] = {410.55, -200.66, 3213.87}; -static float iP029[3] = {432.19, 148.42, 3213.87}; -static float iP030[3] = {200.66, 410.55, 3213.87}; -static float iP031[3] = {-148.42, 432.19, 3213.87}; -static float iP032[3] = {-407.48, 171.88, 3213.87}; -static float iP033[3] = {-432.19, -148.42, 3213.87}; -static float iP034[3] = {-148.88, -309.74, 3213.87}; -static float iP035[3] = {156.38, -320.17, 3213.87}; -static float iP036[3] = {523.39, -303.81, 4424.57}; -static float iP037[3] = {574.66, 276.84, 4424.57}; -static float iP038[3] = {243.05, 492.50, 4424.57}; -static float iP039[3] = {-191.23, 520.13, 4424.57}; -static float iP040[3] = {-523.39, 304.01, 4424.57}; -static float iP041[3] = {-574.66, -231.83, 4424.57}; -static float iP042[3] = {-266.95, -578.17, 4424.57}; -static float iP043[3] = {211.14, -579.67, 4424.57}; -static float iP044[3] = {680.57, -370.27, 5943.46}; -static float iP045[3] = {834.01, 363.09, 5943.46}; -static float iP046[3] = {371.29, 614.13, 5943.46}; -static float iP047[3] = {-291.43, 621.86, 5943.46}; -static float iP048[3] = {-784.13, 362.60, 5943.46}; -static float iP049[3] = {-743.29, -325.82, 5943.46}; -static float iP050[3] = {-383.24, -804.77, 5943.46}; -static float iP051[3] = {283.47, -846.09, 5943.46}; -static float P012[3] = {156.48, -31.95, 924.54}; -static float P013[3] = {162.00, 110.22, 924.54}; -static float P014[3] = {88.16, 221.65, 924.54}; -static float P015[3] = {-65.21, 231.16, 924.54}; -static float P016[3] = {-156.48, 121.97, 924.54}; -static float P017[3] = {-162.00, -23.93, 924.54}; -static float P018[3] = {-88.16, -139.10, 924.54}; -static float P019[3] = {65.21, -148.61, 924.54}; -static float P020[3] = {246.87, -98.73, 1783.04}; -static float P021[3] = {253.17, 127.76, 1783.04}; -static float P022[3] = {132.34, 270.77, 1783.04}; -static float P023[3] = {-97.88, 285.04, 1783.04}; -static float P024[3] = {-222.97, 139.80, 1783.04}; -static float P025[3] = {-225.29, -86.68, 1783.04}; -static float P026[3] = {-108.44, -224.15, 1783.04}; -static float P027[3] = {97.88, -221.56, 1783.04}; -static float P028[3] = {410.55, -200.66, 3213.87}; -static float P029[3] = {432.19, 148.42, 3213.87}; -static float P030[3] = {200.66, 410.55, 3213.87}; -static float P031[3] = {-148.42, 432.19, 3213.87}; -static float P032[3] = {-407.48, 171.88, 3213.87}; -static float P033[3] = {-432.19, -148.42, 3213.87}; -static float P034[3] = {-148.88, -309.74, 3213.87}; -static float P035[3] = {156.38, -320.17, 3213.87}; -static float P036[3] = {523.39, -303.81, 4424.57}; -static float P037[3] = {574.66, 276.84, 4424.57}; -static float P038[3] = {243.05, 492.50, 4424.57}; -static float P039[3] = {-191.23, 520.13, 4424.57}; -static float P040[3] = {-523.39, 304.01, 4424.57}; -static float P041[3] = {-574.66, -231.83, 4424.57}; -static float P042[3] = {-266.95, -578.17, 4424.57}; -static float P043[3] = {211.14, -579.67, 4424.57}; -static float P044[3] = {680.57, -370.27, 5943.46}; -static float P045[3] = {834.01, 363.09, 5943.46}; -static float P046[3] = {371.29, 614.13, 5943.46}; -static float P047[3] = {-291.43, 621.86, 5943.46}; -static float P048[3] = {-784.13, 362.60, 5943.46}; -static float P049[3] = {-743.29, -325.82, 5943.46}; -static float P050[3] = {-383.24, -804.77, 5943.46}; -static float P051[3] = {283.47, -846.09, 5943.46}; -static float P052[3] = {599.09, -332.24, 7902.59}; -static float P053[3] = {735.48, 306.26, 7911.92}; -static float P054[3] = {321.55, 558.53, 7902.59}; -static float P055[3] = {-260.54, 559.84, 7902.59}; -static float P056[3] = {-698.66, 320.83, 7902.59}; -static float P057[3] = {-643.29, -299.16, 7902.59}; -static float P058[3] = {-341.47, -719.30, 7902.59}; -static float P059[3] = {252.57, -756.12, 7902.59}; -static float P060[3] = {458.39, -265.31, 9355.44}; -static float P062[3] = {224.04, 438.98, 9364.77}; -static float P063[3] = {-165.71, 441.27, 9355.44}; -static float P065[3] = {-473.99, -219.71, 9355.44}; -static float P066[3] = {-211.97, -479.87, 9355.44}; -static float P067[3] = {192.86, -504.03, 9355.44}; -static float iP068[3] = {-112.44, 9.25, -64.42}; -static float iP069[3] = {1155.63, 0.00, -182.46}; -static float iP070[3] = {-1143.13, 0.00, -181.54}; -static float iP071[3] = {1424.23, 0.00, -322.09}; -static float iP072[3] = {-1368.01, 0.00, -310.38}; -static float iP073[3] = {1255.57, 2.31, 114.05}; -static float iP074[3] = {-1149.38, 0.00, 117.12}; -static float iP075[3] = {718.36, 0.00, 433.36}; -static float iP076[3] = {-655.90, 0.00, 433.36}; -static float P068[3] = {-112.44, 9.25, -64.42}; -static float P069[3] = {1155.63, 0.00, -182.46}; -static float P070[3] = {-1143.13, 0.00, -181.54}; -static float P071[3] = {1424.23, 0.00, -322.09}; -static float P072[3] = {-1368.01, 0.00, -310.38}; -static float P073[3] = {1255.57, 2.31, 114.05}; -static float P074[3] = {-1149.38, 0.00, 117.12}; -static float P075[3] = {718.36, 0.00, 433.36}; -static float P076[3] = {-655.90, 0.00, 433.36}; -static float P077[3] = {1058.00, -2.66, 7923.51}; -static float P078[3] = {-1016.51, -15.47, 7902.87}; -static float P079[3] = {-1363.99, -484.50, 7593.38}; -static float P080[3] = {1478.09, -861.47, 7098.12}; -static float P081[3] = {1338.06, -284.68, 7024.15}; -static float P082[3] = {-1545.51, -860.64, 7106.60}; -static float P083[3] = {1063.19, -70.46, 7466.60}; -static float P084[3] = {-1369.18, -288.11, 7015.34}; -static float P085[3] = {1348.44, -482.50, 7591.41}; -static float P086[3] = {-1015.45, -96.80, 7474.86}; -static float P087[3] = {731.04, 148.38, 7682.58}; -static float P088[3] = {-697.03, 151.82, 7668.81}; -static float P089[3] = {-686.82, 157.09, 7922.29}; -static float P090[3] = {724.73, 147.75, 7931.39}; -static float iP091[3] = {0.00, 327.10, 2346.55}; -static float iP092[3] = {0.00, 552.28, 2311.31}; -static float iP093[3] = {0.00, 721.16, 2166.41}; -static float iP094[3] = {0.00, 693.42, 2388.80}; -static float iP095[3] = {0.00, 389.44, 2859.97}; -static float P091[3] = {0.00, 327.10, 2346.55}; -static float P092[3] = {0.00, 552.28, 2311.31}; -static float P093[3] = {0.00, 721.16, 2166.41}; -static float P094[3] = {0.00, 693.42, 2388.80}; -static float P095[3] = {0.00, 389.44, 2859.97}; -static float iP096[3] = {222.02, -183.67, 10266.89}; -static float iP097[3] = {-128.90, -182.70, 10266.89}; -static float iP098[3] = {41.04, 88.31, 10659.36}; -static float iP099[3] = {-48.73, 88.30, 10659.36}; -static float P096[3] = {222.02, -183.67, 10266.89}; -static float P097[3] = {-128.90, -182.70, 10266.89}; -static float P098[3] = {41.04, 88.31, 10659.36}; -static float P099[3] = {-48.73, 88.30, 10659.36}; -static float P100[3] = {0.00, 603.42, 9340.68}; -static float P104[3] = {-9.86, 567.62, 7858.65}; -static float P105[3] = {31.96, 565.27, 7908.46}; -static float P106[3] = {22.75, 568.13, 7782.83}; -static float P107[3] = {58.93, 568.42, 7775.94}; -static float P108[3] = {55.91, 565.59, 7905.86}; -static float P109[3] = {99.21, 566.00, 7858.65}; -static float P110[3] = {-498.83, 148.14, 9135.10}; -static float P111[3] = {-495.46, 133.24, 9158.48}; -static float P112[3] = {-490.82, 146.23, 9182.76}; -static float P113[3] = {-489.55, 174.11, 9183.66}; -static float P114[3] = {-492.92, 189.00, 9160.28}; -static float P115[3] = {-497.56, 176.02, 9136.00}; -static float P116[3] = {526.54, 169.68, 9137.70}; -static float P117[3] = {523.49, 184.85, 9161.42}; -static float P118[3] = {518.56, 171.78, 9186.06}; -static float P119[3] = {516.68, 143.53, 9186.98}; -static float P120[3] = {519.73, 128.36, 9163.26}; -static float P121[3] = {524.66, 141.43, 9138.62}; -/* *INDENT-ON* */ - -void -Whale001(void) -{ - - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N072); - glVertex3fv(P072); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N072); - glVertex3fv(P072); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N074); - glVertex3fv(P074); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); -} - -void -Whale002(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N075); - glVertex3fv(P075); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N075); - glVertex3fv(P075); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N071); - glVertex3fv(P071); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N073); - glVertex3fv(P073); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N071); - glVertex3fv(P071); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); -} - -void -Whale003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glEnd(); -} - -void -Whale004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); -} - -void -Whale005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); -} - -void -Whale006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); -} - -void -Whale007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); -} - -void -Whale008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); -} - -void -Whale009(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); -} - -void -Whale010(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); -} - -void -Whale011(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N079); - glVertex3fv(P079); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N089); - glVertex3fv(P089); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); -} - -void -Whale012(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N067); - glVertex3fv(P067); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); -} - -void -Whale013(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N096); - glVertex3fv(P096); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N096); - glVertex3fv(P096); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N098); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P005); - glVertex3fv(P006); - glVertex3fv(P099); - glVertex3fv(P098); - glEnd(); -} - -void -Whale014(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P006); - glVertex3fv(P005); - glVertex3fv(P004); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N004); - glVertex3fv(P004); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N004); - glVertex3fv(P004); - glEnd(); -} - -void -Whale015(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N100); - glVertex3fv(P100); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); -} - -void -Whale016(void) -{ - glBegin(GL_POLYGON); - glVertex3fv(P104); - glVertex3fv(P105); - glVertex3fv(P106); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P107); - glVertex3fv(P108); - glVertex3fv(P109); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P110); - glVertex3fv(P111); - glVertex3fv(P112); - glVertex3fv(P113); - glVertex3fv(P114); - glVertex3fv(P115); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P116); - glVertex3fv(P117); - glVertex3fv(P118); - glVertex3fv(P119); - glVertex3fv(P120); - glVertex3fv(P121); - glEnd(); -} - -void -DrawWhale(fishRec * fish) -{ - float seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7; - float pitch, thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360; - - thrash = 70.0 * fish->v; - - seg0 = 1.5 * thrash * sin((fish->htail) * RRAD); - seg1 = 2.5 * thrash * sin((fish->htail + 10.0) * RRAD); - seg2 = 3.7 * thrash * sin((fish->htail + 15.0) * RRAD); - seg3 = 4.8 * thrash * sin((fish->htail + 23.0) * RRAD); - seg4 = 6.0 * thrash * sin((fish->htail + 28.0) * RRAD); - seg5 = 6.5 * thrash * sin((fish->htail + 35.0) * RRAD); - seg6 = 6.5 * thrash * sin((fish->htail + 40.0) * RRAD); - seg7 = 6.5 * thrash * sin((fish->htail + 55.0) * RRAD); - - pitch = fish->v * sin((fish->htail - 160.0) * RRAD); - - chomp = 0.0; - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - P012[1] = iP012[1] + seg5; - P013[1] = iP013[1] + seg5; - P014[1] = iP014[1] + seg5; - P015[1] = iP015[1] + seg5; - P016[1] = iP016[1] + seg5; - P017[1] = iP017[1] + seg5; - P018[1] = iP018[1] + seg5; - P019[1] = iP019[1] + seg5; - - P020[1] = iP020[1] + seg4; - P021[1] = iP021[1] + seg4; - P022[1] = iP022[1] + seg4; - P023[1] = iP023[1] + seg4; - P024[1] = iP024[1] + seg4; - P025[1] = iP025[1] + seg4; - P026[1] = iP026[1] + seg4; - P027[1] = iP027[1] + seg4; - - P028[1] = iP028[1] + seg2; - P029[1] = iP029[1] + seg2; - P030[1] = iP030[1] + seg2; - P031[1] = iP031[1] + seg2; - P032[1] = iP032[1] + seg2; - P033[1] = iP033[1] + seg2; - P034[1] = iP034[1] + seg2; - P035[1] = iP035[1] + seg2; - - P036[1] = iP036[1] + seg1; - P037[1] = iP037[1] + seg1; - P038[1] = iP038[1] + seg1; - P039[1] = iP039[1] + seg1; - P040[1] = iP040[1] + seg1; - P041[1] = iP041[1] + seg1; - P042[1] = iP042[1] + seg1; - P043[1] = iP043[1] + seg1; - - P044[1] = iP044[1] + seg0; - P045[1] = iP045[1] + seg0; - P046[1] = iP046[1] + seg0; - P047[1] = iP047[1] + seg0; - P048[1] = iP048[1] + seg0; - P049[1] = iP049[1] + seg0; - P050[1] = iP050[1] + seg0; - P051[1] = iP051[1] + seg0; - - P009[1] = iP009[1] + seg6; - P010[1] = iP010[1] + seg6; - P075[1] = iP075[1] + seg6; - P076[1] = iP076[1] + seg6; - - P001[1] = iP001[1] + seg7; - P011[1] = iP011[1] + seg7; - P068[1] = iP068[1] + seg7; - P069[1] = iP069[1] + seg7; - P070[1] = iP070[1] + seg7; - P071[1] = iP071[1] + seg7; - P072[1] = iP072[1] + seg7; - P073[1] = iP073[1] + seg7; - P074[1] = iP074[1] + seg7; - - P091[1] = iP091[1] + seg3 * 1.1; - P092[1] = iP092[1] + seg3; - P093[1] = iP093[1] + seg3; - P094[1] = iP094[1] + seg3; - P095[1] = iP095[1] + seg3 * 0.9; - - P099[1] = iP099[1] + chomp; - P098[1] = iP098[1] + chomp; - P097[1] = iP097[1] + chomp; - P096[1] = iP096[1] + chomp; - - glPushMatrix(); - - glRotatef(pitch, 1.0, 0.0, 0.0); - - glTranslatef(0.0, 0.0, 8000.0); - - glRotatef(180.0, 0.0, 1.0, 0.0); - - glScalef(3.0, 3.0, 3.0); - - glEnable(GL_CULL_FACE); - - Whale001(); - Whale002(); - Whale003(); - Whale004(); - Whale005(); - Whale006(); - Whale007(); - Whale008(); - Whale009(); - Whale010(); - Whale011(); - Whale012(); - Whale013(); - Whale014(); - Whale015(); - Whale016(); - - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/main.c b/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/main.c deleted file mode 100644 index b7794b3b6f..0000000000 --- a/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/main.c +++ /dev/null @@ -1,179 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -extern void Atlantis_Init (); -extern void Atlantis_Reshape (int w, int h); -extern void Atlantis_Animate (); -extern void Atlantis_Display (); - -static SDL_Surface *gScreen; - -static void initAttributes () -{ - // Setup attributes we want for the OpenGL context - - int value; - - // Don't set color bit sizes (SDL_GL_RED_SIZE, etc) - // Mac OS X will always use 8-8-8-8 ARGB for 32-bit screens and - // 5-5-5 RGB for 16-bit screens - - // Request a 16-bit depth buffer (without this, there is no depth buffer) - value = 16; - SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, value); - - - // Request double-buffered OpenGL - // The fact that windows are double-buffered on Mac OS X has no effect - // on OpenGL double buffering. - value = 1; - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, value); -} - -static void printAttributes () -{ - // Print out attributes of the context we created - int nAttr; - int i; - - int attr[] = { SDL_GL_RED_SIZE, SDL_GL_BLUE_SIZE, SDL_GL_GREEN_SIZE, - SDL_GL_ALPHA_SIZE, SDL_GL_BUFFER_SIZE, SDL_GL_DEPTH_SIZE }; - - char *desc[] = { "Red size: %d bits\n", "Blue size: %d bits\n", "Green size: %d bits\n", - "Alpha size: %d bits\n", "Color buffer size: %d bits\n", - "Depth bufer size: %d bits\n" }; - - nAttr = sizeof(attr) / sizeof(int); - - for (i = 0; i < nAttr; i++) { - - int value; - SDL_GL_GetAttribute (attr[i], &value); - printf (desc[i], value); - } -} - -static void createSurface (int fullscreen) -{ - Uint32 flags = 0; - - flags = SDL_OPENGL; - if (fullscreen) - flags |= SDL_FULLSCREEN; - - // Create window - gScreen = SDL_SetVideoMode (640, 480, 0, flags); - if (gScreen == NULL) { - - fprintf (stderr, "Couldn't set 640x480 OpenGL video mode: %s\n", - SDL_GetError()); - SDL_Quit(); - exit(2); - } -} - -static void initGL () -{ - Atlantis_Init (); - Atlantis_Reshape (gScreen->w, gScreen->h); -} - -static void drawGL () -{ - Atlantis_Animate (); - Atlantis_Display (); -} - -static void mainLoop () -{ - SDL_Event event; - int done = 0; - int fps = 24; - int delay = 1000/fps; - int thenTicks = -1; - int nowTicks; - - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent (&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - - // Draw at 24 hz - // This approach is not normally recommended - it is better to - // use time-based animation and run as fast as possible - drawGL (); - SDL_GL_SwapBuffers (); - - // Time how long each draw-swap-delay cycle takes - // and adjust delay to get closer to target framerate - if (thenTicks > 0) { - nowTicks = SDL_GetTicks (); - delay += (1000/fps - (nowTicks-thenTicks)); - thenTicks = nowTicks; - if (delay < 0) - delay = 1000/fps; - } - else { - thenTicks = SDL_GetTicks (); - } - - SDL_Delay (delay); - } -} - -int main(int argc, char *argv[]) -{ - // Init SDL video subsystem - if ( SDL_Init (SDL_INIT_VIDEO) < 0 ) { - - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - // Set GL context attributes - initAttributes (); - - // Create GL context - createSurface (0); - - // Get GL context attributes - printAttributes (); - - // Init GL state - initGL (); - - // Draw, get events... - mainLoop (); - - // Cleanup - SDL_Quit(); - - return 0; -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings deleted file mode 100755 index e612457676..0000000000 Binary files a/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/Info.plist b/Xcode/TemplatesForXcodeTiger/SDL Application/Info.plist deleted file mode 100644 index c678d1145e..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.«PROJECTNAMEASXML» - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - - diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/TemplateInfo.plist deleted file mode 100644 index d9ca454937..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application."; -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj deleted file mode 100644 index ccac459819..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,324 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXBuildStyle section */ - 4A9504CCFFE6A4B311CA0CBA /* Debug */ = { - isa = PBXBuildStyle; - buildSettings = { - }; - name = Debug; - }; - 4A9504CDFFE6A4B311CA0CBA /* Release */ = { - isa = PBXBuildStyle; - buildSettings = { - }; - name = Release; - }; -/* End PBXBuildStyle section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = "«PROJECTNAME»_Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* «PROJECTNAME».app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "«PROJECTNAME».app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* «PROJECTNAME».app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "«PROJECTNAMEASXML»"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* «PROJECTNAME» */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - buildSettings = { - }; - dependencies = ( - ); - name = "«PROJECTNAME»"; - productInstallPath = "$(HOME)/Applications"; - productName = "«PROJECTNAME»"; - productReference = 8D1107320486CEB800E47090 /* «PROJECTNAME».app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLApp" */; - buildSettings = { - }; - buildStyles = ( - 4A9504CCFFE6A4B311CA0CBA /* Debug */, - 4A9504CDFFE6A4B311CA0CBA /* Release */, - ); - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */; - projectDirPath = ""; - targets = ( - 8D1107260486CEB800E47090 /* «PROJECTNAME» */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "«PROJECTNAME»"; - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "«PROJECTNAME»"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp_Prefix.pch b/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp_Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp_Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.h b/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m b/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeTiger/SDL Application/main.c b/Xcode/TemplatesForXcodeTiger/SDL Application/main.c deleted file mode 100644 index 7115de9897..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Application/main.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -int main(int argc, char *argv[]) -{ - Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */ - SDL_Surface *screen; - Uint8 video_bpp = 0; - Uint32 videoflags = SDL_SWSURFACE; - int done; - SDL_Event event; - - /* Initialize the SDL library */ - if ( SDL_Init(initflags) < 0 ) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - /* Set 640x480 video mode */ - screen=SDL_SetVideoMode(640,480, video_bpp, videoflags); - if (screen == NULL) { - fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", - video_bpp, SDL_GetError()); - SDL_Quit(); - exit(2); - } - - done = 0; - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent(&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - } - - /* Clean up the SDL library */ - SDL_Quit(); - return(0); -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings deleted file mode 100755 index e612457676..0000000000 Binary files a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib deleted file mode 100644 index 799eaadddb..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib +++ /dev/null @@ -1,19 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = { - help = id; - newGame = id; - openGame = id; - prefsMenu = id; - saveGame = id; - saveGameAs = id; - }; - CLASS = SDLMain; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib deleted file mode 100644 index 1d6fb7e01d..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - IBDocumentLocation - 62 117 356 240 0 0 1152 848 - IBEditorPositions - - 29 - 62 362 195 44 0 0 1152 848 - - IBFramework Version - 291.0 - IBOpenObjects - - 29 - - IBSystem Version - 6L60 - - diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib deleted file mode 100644 index 637801528a..0000000000 Binary files a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib and /dev/null differ diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/Info.plist b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/Info.plist deleted file mode 100644 index c678d1145e..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.«PROJECTNAMEASXML» - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - - diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLApp_Prefix.pch b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLApp_Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLApp_Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/TemplateInfo.plist deleted file mode 100644 index 1dcbea207c..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application with Cocoa menus."; -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj deleted file mode 100644 index 58596625b0..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,336 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXBuildStyle section */ - 4A9504CCFFE6A4B311CA0CBA /* Debug */ = { - isa = PBXBuildStyle; - buildSettings = { - }; - name = Debug; - }; - 4A9504CDFFE6A4B311CA0CBA /* Release */ = { - isa = PBXBuildStyle; - buildSettings = { - }; - name = Release; - }; -/* End PBXBuildStyle section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 002F3AF009D08F1000EBEB88 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/SDLMain.nib; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = "«PROJECTNAME»_Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* «PROJECTNAME».app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "«PROJECTNAME».app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* «PROJECTNAME».app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "«PROJECTNAMEASXML»"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* «PROJECTNAME» */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - buildSettings = { - }; - dependencies = ( - ); - name = "«PROJECTNAME»"; - productInstallPath = "$(HOME)/Applications"; - productName = "«PROJECTNAME»"; - productReference = 8D1107320486CEB800E47090 /* «PROJECTNAME».app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLCocoaApp" */; - buildSettings = { - }; - buildStyles = ( - 4A9504CCFFE6A4B311CA0CBA /* Debug */, - 4A9504CDFFE6A4B311CA0CBA /* Release */, - ); - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */; - projectDirPath = ""; - targets = ( - 8D1107260486CEB800E47090 /* «PROJECTNAME» */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */ = { - isa = PBXVariantGroup; - children = ( - 002F3AF009D08F1000EBEB88 /* English */, - ); - name = SDLMain.nib; - sourceTree = ""; - }; - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "«PROJECTNAME»"; - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "«PROJECTNAME»"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLCocoaApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.h b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c b/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c deleted file mode 100644 index 7115de9897..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c +++ /dev/null @@ -1,65 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -int main(int argc, char *argv[]) -{ - Uint32 initflags = SDL_INIT_VIDEO; /* See documentation for details */ - SDL_Surface *screen; - Uint8 video_bpp = 0; - Uint32 videoflags = SDL_SWSURFACE; - int done; - SDL_Event event; - - /* Initialize the SDL library */ - if ( SDL_Init(initflags) < 0 ) { - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - /* Set 640x480 video mode */ - screen=SDL_SetVideoMode(640,480, video_bpp, videoflags); - if (screen == NULL) { - fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", - video_bpp, SDL_GetError()); - SDL_Quit(); - exit(2); - } - - done = 0; - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent(&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - } - - /* Clean up the SDL library */ - SDL_Quit(); - return(0); -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings deleted file mode 100755 index e612457676..0000000000 Binary files a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/Info.plist b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/Info.plist deleted file mode 100644 index c678d1145e..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - com.yourcompany.«PROJECTNAMEASXML» - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - SDLMain - NSPrincipalClass - NSApplication - - diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLApp_Prefix.pch b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLApp_Prefix.pch deleted file mode 100644 index 00095074ae..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLApp_Prefix.pch +++ /dev/null @@ -1,9 +0,0 @@ -// -// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project -// - -#include "SDL.h" - -#ifdef __OBJC__ - #import -#endif diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.h b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m deleted file mode 100644 index b065a20094..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m +++ /dev/null @@ -1,383 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface SDLApplication : NSApplication -@end - -@implementation SDLApplication -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } - [ aMenu sizeToFit ]; -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [SDLApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [SDLApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - [SDLApplication poseAsClass:[NSApplication class]]; - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist deleted file mode 100644 index ba87745fc3..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist +++ /dev/null @@ -1,12 +0,0 @@ -{ - FilesToRename = { - "SDLApp_Prefix.pch" = "ÇPROJECTNAMEÈ_Prefix.pch"; - }; - FilesToMacroExpand = ( - "ÇPROJECTNAMEÈ_Prefix.pch", - "Info.plist", - "English.lproj/InfoPlist.strings", - "main.c", - ); - Description = "This project builds an SDL-based application that uses OpenGL."; -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj deleted file mode 100644 index 6995ccbf75..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,362 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; }; - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; }; - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; }; - 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF409D0938900EBEB88 /* atlantis.c */; }; - 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF609D0938900EBEB88 /* dolphin.c */; }; - 002F3BFD09D0938900EBEB88 /* shark.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF709D0938900EBEB88 /* shark.c */; }; - 002F3BFE09D0938900EBEB88 /* swim.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF809D0938900EBEB88 /* swim.c */; }; - 002F3BFF09D0938900EBEB88 /* whale.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF909D0938900EBEB88 /* whale.c */; }; - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; }; - 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C6009D0951E00EBEB88 /* GLUT.framework */; }; - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXBuildStyle section */ - 4A9504CCFFE6A4B311CA0CBA /* Debug */ = { - isa = PBXBuildStyle; - buildSettings = { - }; - name = Debug; - }; - 4A9504CDFFE6A4B311CA0CBA /* Release */ = { - isa = PBXBuildStyle; - buildSettings = { - }; - name = Release; - }; -/* End PBXBuildStyle section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */, - ); - name = "Copy Frameworks into .app bundle"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = ""; }; - 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; }; - 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; }; - 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; }; - 002F3BF409D0938900EBEB88 /* atlantis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = atlantis.c; path = atlantis/atlantis.c; sourceTree = SOURCE_ROOT; }; - 002F3BF509D0938900EBEB88 /* atlantis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = atlantis.h; path = atlantis/atlantis.h; sourceTree = SOURCE_ROOT; }; - 002F3BF609D0938900EBEB88 /* dolphin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dolphin.c; path = atlantis/dolphin.c; sourceTree = SOURCE_ROOT; }; - 002F3BF709D0938900EBEB88 /* shark.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = shark.c; path = atlantis/shark.c; sourceTree = SOURCE_ROOT; }; - 002F3BF809D0938900EBEB88 /* swim.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = swim.c; path = atlantis/swim.c; sourceTree = SOURCE_ROOT; }; - 002F3BF909D0938900EBEB88 /* whale.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = whale.c; path = atlantis/whale.c; sourceTree = SOURCE_ROOT; }; - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - 002F3C6009D0951E00EBEB88 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../../../../../../../../System/Library/Frameworks/GLUT.framework; sourceTree = SOURCE_ROOT; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = "«PROJECTNAME»_Prefix.pch"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* «PROJECTNAME».app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "«PROJECTNAME».app"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */, - 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 002F3BF309D0937800EBEB88 /* atlantis */ = { - isa = PBXGroup; - children = ( - 002F3BF409D0938900EBEB88 /* atlantis.c */, - 002F3BF509D0938900EBEB88 /* atlantis.h */, - 002F3BF609D0938900EBEB88 /* dolphin.c */, - 002F3BF709D0938900EBEB88 /* shark.c */, - 002F3BF809D0938900EBEB88 /* swim.c */, - 002F3BF909D0938900EBEB88 /* whale.c */, - ); - name = atlantis; - sourceTree = ""; - }; - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 002F3A2B09D0888800EBEB88 /* SDLMain.h */, - 002F3A2C09D0888800EBEB88 /* SDLMain.m */, - ); - name = Classes; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 002F39F909D0881F00EBEB88 /* SDL.framework */, - 002F3C6009D0951E00EBEB88 /* GLUT.framework */, - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 002F3C0009D093BD00EBEB88 /* OpenGL.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* «PROJECTNAME».app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = { - isa = PBXGroup; - children = ( - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = "«PROJECTNAMEASXML»"; - sourceTree = ""; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 002F3BF309D0937800EBEB88 /* atlantis */, - 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */, - 002F3A3E09D088BA00EBEB88 /* main.c */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 8D1107310486CEB800E47090 /* Info.plist */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* «PROJECTNAME» */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */, - ); - buildRules = ( - ); - buildSettings = { - }; - dependencies = ( - ); - name = "«PROJECTNAME»"; - productInstallPath = "$(HOME)/Applications"; - productName = "«PROJECTNAME»"; - productReference = 8D1107320486CEB800E47090 /* «PROJECTNAME».app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLOpenGLApp" */; - buildSettings = { - }; - buildStyles = ( - 4A9504CCFFE6A4B311CA0CBA /* Debug */, - 4A9504CDFFE6A4B311CA0CBA /* Release */, - ); - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */; - projectDirPath = ""; - targets = ( - 8D1107260486CEB800E47090 /* «PROJECTNAME» */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */, - 002F3A3F09D088BA00EBEB88 /* main.c in Sources */, - 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */, - 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */, - 002F3BFD09D0938900EBEB88 /* shark.c in Sources */, - 002F3BFE09D0938900EBEB88 /* swim.c in Sources */, - 002F3BFF09D0938900EBEB88 /* whale.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "«PROJECTNAME»"; - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = "«PROJECTNAME»"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks", - /Library/Frameworks, - "$(FRAMEWORK_SEARCH_PATHS)", - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - "$(HOME)/Library/Frameworks/SDL.framework/Headers", - /Library/Frameworks/SDL.framework/Headers, - "$(HEADER_SEARCH_PATHS)", - ); - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLOpenGLApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.c b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.c deleted file mode 100644 index 4efdf6ce88..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.c +++ /dev/null @@ -1,459 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include -#include -#include -#include -#include "atlantis.h" - -fishRec sharks[NUM_SHARKS]; -fishRec momWhale; -fishRec babyWhale; -fishRec dolph; - -GLboolean Timing = GL_TRUE; - -int w_win = 640; -int h_win = 480; -GLint count = 0; -GLenum StrMode = GL_VENDOR; - -GLboolean moving; - -static double mtime(void) -{ - struct timeval tk_time; - struct timezone tz; - - gettimeofday(&tk_time, &tz); - - return 4294.967296 * tk_time.tv_sec + 0.000001 * tk_time.tv_usec; -} - -static double filter(double in, double *save) -{ - static double k1 = 0.9; - static double k2 = 0.05; - - save[3] = in; - save[1] = save[0]*k1 + k2*(save[3] + save[2]); - - save[0]=save[1]; - save[2]=save[3]; - - return(save[1]); -} - -void DrawStr(const char *str) -{ - GLint i = 0; - - if(!str) return; - - while(str[i]) - { - glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, str[i]); - i++; - } -} - -void -InitFishs(void) -{ - int i; - - for (i = 0; i < NUM_SHARKS; i++) { - sharks[i].x = 70000.0 + rand() % 6000; - sharks[i].y = rand() % 6000; - sharks[i].z = rand() % 6000; - sharks[i].psi = rand() % 360 - 180.0; - sharks[i].v = 1.0; - } - - dolph.x = 30000.0; - dolph.y = 0.0; - dolph.z = 6000.0; - dolph.psi = 90.0; - dolph.theta = 0.0; - dolph.v = 3.0; - - momWhale.x = 70000.0; - momWhale.y = 0.0; - momWhale.z = 0.0; - momWhale.psi = 90.0; - momWhale.theta = 0.0; - momWhale.v = 3.0; - - babyWhale.x = 60000.0; - babyWhale.y = -2000.0; - babyWhale.z = -2000.0; - babyWhale.psi = 90.0; - babyWhale.theta = 0.0; - babyWhale.v = 3.0; -} - -void -Atlantis_Init(void) -{ - static float ambient[] = {0.2, 0.2, 0.2, 1.0}; - static float diffuse[] = {1.0, 1.0, 1.0, 1.0}; - static float position[] = {0.0, 1.0, 0.0, 0.0}; - static float mat_shininess[] = {90.0}; - static float mat_specular[] = {0.8, 0.8, 0.8, 1.0}; - static float mat_diffuse[] = {0.46, 0.66, 0.795, 1.0}; - static float mat_ambient[] = {0.3, 0.4, 0.5, 1.0}; - static float lmodel_ambient[] = {0.4, 0.4, 0.4, 1.0}; - static float lmodel_localviewer[] = {0.0}; - //GLfloat map1[4] = {0.0, 0.0, 0.0, 0.0}; - //GLfloat map2[4] = {0.0, 0.0, 0.0, 0.0}; - static float fog_color[] = {0.0, 0.5, 0.9, 1.0}; - - glFrontFace(GL_CCW); - - glDepthFunc(GL_LESS); - glEnable(GL_DEPTH_TEST); - - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT0, GL_POSITION, position); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); - glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_localviewer); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - - glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); - glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient); - - InitFishs(); - - glEnable(GL_FOG); - glFogi(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 0.0000025); - glFogfv(GL_FOG_COLOR, fog_color); - - glClearColor(0.0, 0.5, 0.9, 1.0); -} - -void -Atlantis_Reshape(int width, int height) -{ - w_win = width; - h_win = height; - - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60.0, (GLfloat) width / (GLfloat) height, 20000.0, 300000.0); - glMatrixMode(GL_MODELVIEW); -} - -void -Atlantis_Animate(void) -{ - int i; - - for (i = 0; i < NUM_SHARKS; i++) { - SharkPilot(&sharks[i]); - SharkMiss(i); - } - WhalePilot(&dolph); - dolph.phi++; - //glutPostRedisplay(); - WhalePilot(&momWhale); - momWhale.phi++; - WhalePilot(&babyWhale); - babyWhale.phi++; -} - -void -Atlantis_Key(unsigned char key, int x, int y) -{ - switch (key) { - case 't': - Timing = !Timing; - break; - case ' ': - switch(StrMode) - { - case GL_EXTENSIONS: - StrMode = GL_VENDOR; - break; - case GL_VENDOR: - StrMode = GL_RENDERER; - break; - case GL_RENDERER: - StrMode = GL_VERSION; - break; - case GL_VERSION: - StrMode = GL_EXTENSIONS; - break; - } - break; - case 27: /* Esc will quit */ - exit(1); - break; - case 's': /* "s" start animation */ - moving = GL_TRUE; - //glutIdleFunc(Animate); - break; - case 'a': /* "a" stop animation */ - moving = GL_FALSE; - //glutIdleFunc(NULL); - break; - case '.': /* "." will advance frame */ - if (!moving) { - Atlantis_Animate(); - } - } -} -/* -void Display(void) -{ - static float P123[3] = {-448.94, -203.14, 9499.60}; - static float P124[3] = {-442.64, -185.20, 9528.07}; - static float P125[3] = {-441.07, -148.05, 9528.07}; - static float P126[3] = {-443.43, -128.84, 9499.60}; - static float P127[3] = {-456.87, -146.78, 9466.67}; - static float P128[3] = {-453.68, -183.93, 9466.67}; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - FishTransform(&dolph); - DrawDolphin(&dolph); - glPopMatrix(); - - glutSwapBuffers(); -} -*/ - -void -Atlantis_Display(void) -{ - int i; - static double th[4] = {0.0, 0.0, 0.0, 0.0}; - static double t1 = 0.0, t2 = 0.0, t; - char num_str[128]; - - t1 = t2; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - for (i = 0; i < NUM_SHARKS; i++) { - glPushMatrix(); - FishTransform(&sharks[i]); - DrawShark(&sharks[i]); - glPopMatrix(); - } - - glPushMatrix(); - FishTransform(&dolph); - DrawDolphin(&dolph); - glPopMatrix(); - - glPushMatrix(); - FishTransform(&momWhale); - DrawWhale(&momWhale); - glPopMatrix(); - - glPushMatrix(); - FishTransform(&babyWhale); - glScalef(0.45, 0.45, 0.3); - DrawWhale(&babyWhale); - glPopMatrix(); - - if(Timing) - { - t2 = mtime(); - t = t2 - t1; - if(t > 0.0001) t = 1.0 / t; - - glDisable(GL_LIGHTING); - //glDisable(GL_DEPTH_TEST); - - glColor3f(1.0, 0.0, 0.0); - - glMatrixMode (GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(0, w_win, 0, h_win, -10.0, 10.0); - - glRasterPos2f(5.0, 5.0); - - switch(StrMode) - { - case GL_VENDOR: - sprintf(num_str, "%0.2f Hz, %dx%d, VENDOR: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_VENDOR)); - break; - case GL_RENDERER: - sprintf(num_str, "%0.2f Hz, %dx%d, RENDERER: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_RENDERER)); - break; - case GL_VERSION: - sprintf(num_str, "%0.2f Hz, %dx%d, VERSION: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_VERSION)); - break; - case GL_EXTENSIONS: - sprintf(num_str, "%0.2f Hz, %dx%d, EXTENSIONS: ", filter(t, th), w_win, h_win); - DrawStr(num_str); - DrawStr(glGetString(GL_EXTENSIONS)); - break; - } - - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_LIGHTING); - //glEnable(GL_DEPTH_TEST); - } - - count++; - - glutSwapBuffers(); -} - -/* -void -Visible(int state) -{ - if (state == GLUT_VISIBLE) { - if (moving) - glutIdleFunc(Animate); - } else { - if (moving) - glutIdleFunc(NULL); - } -} - - -void -timingSelect(int value) -{ - switch(value) - { - case 1: - StrMode = GL_VENDOR; - break; - case 2: - StrMode = GL_RENDERER; - break; - case 3: - StrMode = GL_VERSION; - break; - case 4: - StrMode = GL_EXTENSIONS; - break; - } -} - -void -menuSelect(int value) -{ - switch (value) { - case 1: - moving = GL_TRUE; - glutIdleFunc(Animate); - break; - case 2: - moving = GL_FALSE; - glutIdleFunc(NULL); - break; - case 4: - exit(0); - break; - } -} - -int -main(int argc, char **argv) -{ - GLboolean fullscreen = GL_FALSE; - GLint time_menu; - - srand(0); - - glutInit(&argc, argv); - if (argc > 1 && !strcmp(argv[1], "-w")) - fullscreen = GL_FALSE; - - //glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); - glutInitDisplayString("rgba double depth=24"); - if (fullscreen) { - glutGameModeString("1024x768:32"); - glutEnterGameMode(); - } else { - glutInitWindowSize(320, 240); - glutCreateWindow("Atlantis Timing"); - } - Init(); - glutDisplayFunc(Display); - glutReshapeFunc(Reshape); - glutKeyboardFunc(Key); - moving = GL_TRUE; -glutIdleFunc(Animate); - glutVisibilityFunc(Visible); - - time_menu = glutCreateMenu(timingSelect); - glutAddMenuEntry("GL_VENDOR", 1); - glutAddMenuEntry("GL_RENDERER", 2); - glutAddMenuEntry("GL_VERSION", 3); - glutAddMenuEntry("GL_EXTENSIONS", 4); - - glutCreateMenu(menuSelect); - glutAddMenuEntry("Start motion", 1); - glutAddMenuEntry("Stop motion", 2); - glutAddSubMenu("Timing Mode", time_menu); - glutAddMenuEntry("Quit", 4); - - //glutAttachMenu(GLUT_RIGHT_BUTTON); - glutAttachMenu(GLUT_RIGHT_BUTTON); - glutMainLoop(); - return 0; // ANSI C requires main to return int. -} -*/ \ No newline at end of file diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.h b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.h deleted file mode 100644 index 6ccf2d5f0c..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#define RAD 57.295 -#define RRAD 0.01745 - -#define NUM_SHARKS 4 -#define SHARKSIZE 6000 -#define SHARKSPEED 100.0 - -#define WHALESPEED 250.0 - -typedef struct _fishRec { - float x, y, z, phi, theta, psi, v; - float xt, yt, zt; - float htail, vtail; - float dtheta; - int spurt, attack; -} fishRec; - -extern fishRec sharks[NUM_SHARKS]; -extern fishRec momWhale; -extern fishRec babyWhale; -extern fishRec dolph; - -extern void FishTransform(fishRec *); -extern void WhalePilot(fishRec *); -extern void SharkPilot(fishRec *); -extern void SharkMiss(int); -extern void DrawWhale(fishRec *); -extern void DrawShark(fishRec *); -extern void DrawDolphin(fishRec *); diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/dolphin.c b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/dolphin.c deleted file mode 100644 index 9fba3ba986..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/dolphin.c +++ /dev/null @@ -1,1934 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N001[3] = {-0.005937 ,-0.101998 ,-0.994767}; -static float N002[3] = {0.936780 ,-0.200803 ,0.286569}; -static float N003[3] = {-0.233062 ,0.972058 ,0.028007}; -static float N005[3] = {0.898117 ,0.360171 ,0.252315}; -static float N006[3] = {-0.915437 ,0.348456 ,0.201378}; -static float N007[3] = {0.602263 ,-0.777527 ,0.180920}; -static float N008[3] = {-0.906912 ,-0.412015 ,0.088061}; -static float N012[3] = {0.884408 ,-0.429417 ,-0.182821}; -static float N013[3] = {0.921121 ,0.311084 ,-0.234016}; -static float N014[3] = {0.382635 ,0.877882 ,-0.287948}; -static float N015[3] = {-0.380046 ,0.888166 ,-0.258316}; -static float N016[3] = {-0.891515 ,0.392238 ,-0.226607}; -static float N017[3] = {-0.901419 ,-0.382002 ,-0.203763}; -static float N018[3] = {-0.367225 ,-0.911091 ,-0.187243}; -static float N019[3] = {0.339539 ,-0.924846 ,-0.171388}; -static float N020[3] = {0.914706 ,-0.378617 ,-0.141290}; -static float N021[3] = {0.950662 ,0.262713 ,-0.164994}; -static float N022[3] = {0.546359 ,0.801460 ,-0.243218}; -static float N023[3] = {-0.315796 ,0.917068 ,-0.243431}; -static float N024[3] = {-0.825687 ,0.532277 ,-0.186875}; -static float N025[3] = {-0.974763 ,-0.155232 ,-0.160435}; -static float N026[3] = {-0.560596 ,-0.816658 ,-0.137119}; -static float N027[3] = {0.380210 ,-0.910817 ,-0.160786}; -static float N028[3] = {0.923772 ,-0.358322 ,-0.135093}; -static float N029[3] = {0.951202 ,0.275053 ,-0.139859}; -static float N030[3] = {0.686099 ,0.702548 ,-0.188932}; -static float N031[3] = {-0.521865 ,0.826719 ,-0.210220}; -static float N032[3] = {-0.923820 ,0.346739 ,-0.162258}; -static float N033[3] = {-0.902095 ,-0.409995 ,-0.134646}; -static float N034[3] = {-0.509115 ,-0.848498 ,-0.144404}; -static float N035[3] = {0.456469 ,-0.880293 ,-0.129305}; -static float N036[3] = {0.873401 ,-0.475489 ,-0.105266}; -static float N037[3] = {0.970825 ,0.179861 ,-0.158584}; -static float N038[3] = {0.675609 ,0.714187 ,-0.183004}; -static float N039[3] = {-0.523574 ,0.830212 ,-0.191360}; -static float N040[3] = {-0.958895 ,0.230808 ,-0.165071}; -static float N041[3] = {-0.918285 ,-0.376803 ,-0.121542}; -static float N042[3] = {-0.622467 ,-0.774167 ,-0.114888}; -static float N043[3] = {0.404497 ,-0.908807 ,-0.102231}; -static float N044[3] = {0.930538 ,-0.365155 ,-0.027588}; -static float N045[3] = {0.921920 ,0.374157 ,-0.100345}; -static float N046[3] = {0.507346 ,0.860739 ,0.041562}; -static float N047[3] = {-0.394646 ,0.918815 ,-0.005730}; -static float N048[3] = {-0.925411 ,0.373024 ,-0.066837}; -static float N049[3] = {-0.945337 ,-0.322309 ,-0.049551}; -static float N050[3] = {-0.660437 ,-0.750557 ,-0.022072}; -static float N051[3] = {0.488835 ,-0.871950 ,-0.027261}; -static float N052[3] = {0.902599 ,-0.421397 ,0.087969}; -static float N053[3] = {0.938636 ,0.322606 ,0.122020}; -static float N054[3] = {0.484605 ,0.871078 ,0.079878}; -static float N055[3] = {-0.353607 ,0.931559 ,0.084619}; -static float N056[3] = {-0.867759 ,0.478564 ,0.134054}; -static float N057[3] = {-0.951583 ,-0.296030 ,0.082794}; -static float N058[3] = {-0.672355 ,-0.730209 ,0.121384}; -static float N059[3] = {0.528336 ,-0.842452 ,0.105525}; -static float N060[3] = {0.786913 ,-0.564760 ,0.248627}; -static float N062[3] = {0.622098 ,0.765230 ,0.165584}; -static float N063[3] = {-0.631711 ,0.767816 ,0.106773}; -static float N064[3] = {-0.687886 ,0.606351 ,0.398938}; -static float N065[3] = {-0.946327 ,-0.281623 ,0.158598}; -static float N066[3] = {-0.509549 ,-0.860437 ,0.002776}; -static float N067[3] = {0.462594 ,-0.876692 ,0.131977}; -static float N071[3] = {0.000000 ,1.000000 ,0.000000}; -static float N077[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N078[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N079[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N080[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N081[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N082[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N083[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N084[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N085[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N086[3] = {-0.571197 ,0.816173 ,0.087152}; -static float N087[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N088[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N089[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N090[3] = {-0.880770 ,0.461448 ,0.106351}; -static float N091[3] = {0.000000 ,1.000000 ,0.000000}; -static float N092[3] = {0.000000 ,1.000000 ,0.000000}; -static float N093[3] = {0.000000 ,1.000000 ,0.000000}; -static float N094[3] = {1.000000 ,0.000000 ,0.000000}; -static float N095[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N097[3] = {-0.697296 ,0.702881 ,0.140491}; -static float N098[3] = {0.918864 ,0.340821 ,0.198819}; -static float N099[3] = {-0.932737 ,0.201195 ,0.299202}; -static float N100[3] = {0.029517 ,0.981679 ,0.188244}; -static float N102[3] = {0.813521 ,-0.204936 ,0.544229}; -static float N110[3] = {-0.781480 ,-0.384779 ,0.491155}; -static float N111[3] = {-0.722243 ,0.384927 ,0.574627}; -static float N112[3] = {-0.752278 ,0.502679 ,0.425901}; -static float N113[3] = {0.547257 ,0.367910 ,0.751766}; -static float N114[3] = {0.725949 ,-0.232568 ,0.647233}; -static float N115[3] = {-0.747182 ,-0.660786 ,0.071280}; -static float N116[3] = {0.931519 ,0.200748 ,0.303270}; -static float N117[3] = {-0.828928 ,0.313757 ,0.463071}; -static float N118[3] = {0.902554 ,-0.370967 ,0.218587}; -static float N119[3] = {-0.879257 ,-0.441851 ,0.177973}; -static float N120[3] = {0.642327 ,0.611901 ,0.461512}; -static float N121[3] = {0.964817 ,-0.202322 ,0.167910}; -static float N122[3] = {0.000000 ,1.000000 ,0.000000}; -static float P001[3] = {5.68, -300.95, 1324.70}; -static float P002[3] = {338.69, -219.63, 9677.03}; -static float P003[3] = {12.18, 474.59, 9138.14}; -static float P005[3] = {487.51, 198.05, 9350.78}; -static float P006[3] = {-457.61, 68.74, 9427.85}; -static float P007[3] = {156.52, -266.72, 10311.68}; -static float P008[3] = {-185.56, -266.51, 10310.47}; -static float P009[3] = {124.39, -261.46, 1942.34}; -static float P010[3] = {-130.05, -261.46, 1946.03}; -static float P011[3] = {141.07, -320.11, 1239.38}; -static float P012[3] = {156.48, -360.12, 2073.41}; -static float P013[3] = {162.00, -175.88, 2064.44}; -static float P014[3] = {88.16, -87.72, 2064.02}; -static float P015[3] = {-65.21, -96.13, 2064.02}; -static float P016[3] = {-156.48, -180.96, 2064.44}; -static float P017[3] = {-162.00, -368.93, 2082.39}; -static float P018[3] = {-88.16, -439.22, 2082.39}; -static float P019[3] = {65.21, -440.32, 2083.39}; -static float P020[3] = {246.87, -356.02, 2576.95}; -static float P021[3] = {253.17, -111.15, 2567.15}; -static float P022[3] = {132.34, 51.41, 2559.84}; -static float P023[3] = {-97.88, 40.44, 2567.15}; -static float P024[3] = {-222.97, -117.49, 2567.15}; -static float P025[3] = {-252.22, -371.53, 2569.92}; -static float P026[3] = {-108.44, -518.19, 2586.75}; -static float P027[3] = {97.88, -524.79, 2586.75}; -static float P028[3] = {370.03, -421.19, 3419.70}; -static float P029[3] = {351.15, -16.98, 3423.17}; -static float P030[3] = {200.66, 248.46, 3430.37}; -static float P031[3] = {-148.42, 235.02, 3417.91}; -static float P032[3] = {-360.21, -30.27, 3416.84}; -static float P033[3] = {-357.90, -414.89, 3407.04}; -static float P034[3] = {-148.88, -631.35, 3409.90}; -static float P035[3] = {156.38, -632.59, 3419.70}; -static float P036[3] = {462.61, -469.21, 4431.51}; -static float P037[3] = {466.60, 102.25, 4434.98}; -static float P038[3] = {243.05, 474.34, 4562.02}; -static float P039[3] = {-191.23, 474.40, 4554.42}; -static float P040[3] = {-476.12, 111.05, 4451.11}; -static float P041[3] = {-473.36, -470.74, 4444.78}; -static float P042[3] = {-266.95, -748.41, 4447.78}; -static float P043[3] = {211.14, -749.91, 4429.73}; -static float P044[3] = {680.57, -370.27, 5943.46}; -static float P045[3] = {834.01, 363.09, 6360.63}; -static float P046[3] = {371.29, 804.51, 6486.26}; -static float P047[3] = {-291.43, 797.22, 6494.28}; -static float P048[3] = {-784.13, 370.75, 6378.01}; -static float P049[3] = {-743.29, -325.82, 5943.46}; -static float P050[3] = {-383.24, -804.77, 5943.46}; -static float P051[3] = {283.47, -846.09, 5943.46}; -static float iP001[3] = {5.68, -300.95, 1324.70}; -static float iP009[3] = {124.39, -261.46, 1942.34}; -static float iP010[3] = {-130.05, -261.46, 1946.03}; -static float iP011[3] = {141.07, -320.11, 1239.38}; -static float iP012[3] = {156.48, -360.12, 2073.41}; -static float iP013[3] = {162.00, -175.88, 2064.44}; -static float iP014[3] = {88.16, -87.72, 2064.02}; -static float iP015[3] = {-65.21, -96.13, 2064.02}; -static float iP016[3] = {-156.48, -180.96, 2064.44}; -static float iP017[3] = {-162.00, -368.93, 2082.39}; -static float iP018[3] = {-88.16, -439.22, 2082.39}; -static float iP019[3] = {65.21, -440.32, 2083.39}; -static float iP020[3] = {246.87, -356.02, 2576.95}; -static float iP021[3] = {253.17, -111.15, 2567.15}; -static float iP022[3] = {132.34, 51.41, 2559.84}; -static float iP023[3] = {-97.88, 40.44, 2567.15}; -static float iP024[3] = {-222.97, -117.49, 2567.15}; -static float iP025[3] = {-252.22, -371.53, 2569.92}; -static float iP026[3] = {-108.44, -518.19, 2586.75}; -static float iP027[3] = {97.88, -524.79, 2586.75}; -static float iP028[3] = {370.03, -421.19, 3419.70}; -static float iP029[3] = {351.15, -16.98, 3423.17}; -static float iP030[3] = {200.66, 248.46, 3430.37}; -static float iP031[3] = {-148.42, 235.02, 3417.91}; -static float iP032[3] = {-360.21, -30.27, 3416.84}; -static float iP033[3] = {-357.90, -414.89, 3407.04}; -static float iP034[3] = {-148.88, -631.35, 3409.90}; -static float iP035[3] = {156.38, -632.59, 3419.70}; -static float iP036[3] = {462.61, -469.21, 4431.51}; -static float iP037[3] = {466.60, 102.25, 4434.98}; -static float iP038[3] = {243.05, 474.34, 4562.02}; -static float iP039[3] = {-191.23, 474.40, 4554.42}; -static float iP040[3] = {-476.12, 111.05, 4451.11}; -static float iP041[3] = {-473.36, -470.74, 4444.78}; -static float iP042[3] = {-266.95, -748.41, 4447.78}; -static float iP043[3] = {211.14, -749.91, 4429.73}; -static float iP044[3] = {680.57, -370.27, 5943.46}; -static float iP045[3] = {834.01, 363.09, 6360.63}; -static float iP046[3] = {371.29, 804.51, 6486.26}; -static float iP047[3] = {-291.43, 797.22, 6494.28}; -static float iP048[3] = {-784.13, 370.75, 6378.01}; -static float iP049[3] = {-743.29, -325.82, 5943.46}; -static float iP050[3] = {-383.24, -804.77, 5943.46}; -static float iP051[3] = {283.47, -846.09, 5943.46}; -static float P052[3] = {599.09, -300.15, 7894.03}; -static float P053[3] = {735.48, 306.26, 7911.92}; -static float P054[3] = {246.22, 558.53, 8460.50}; -static float P055[3] = {-230.41, 559.84, 8473.23}; -static float P056[3] = {-698.66, 320.83, 7902.59}; -static float P057[3] = {-643.29, -299.16, 7902.59}; -static float P058[3] = {-341.47, -719.30, 7902.59}; -static float P059[3] = {252.57, -756.12, 7902.59}; -static float P060[3] = {458.39, -265.31, 9355.44}; -static float P062[3] = {224.04, 338.75, 9450.30}; -static float P063[3] = {-165.71, 341.04, 9462.35}; -static float P064[3] = {-298.11, 110.13, 10180.37}; -static float P065[3] = {-473.99, -219.71, 9355.44}; -static float P066[3] = {-211.97, -479.87, 9355.44}; -static float P067[3] = {192.86, -491.45, 9348.73}; -static float P068[3] = {-136.29, -319.84, 1228.73}; -static float P069[3] = {1111.17, -314.14, 1314.19}; -static float P070[3] = {-1167.34, -321.61, 1319.45}; -static float P071[3] = {1404.86, -306.66, 1235.45}; -static float P072[3] = {-1409.73, -314.14, 1247.66}; -static float P073[3] = {1254.01, -296.87, 1544.58}; -static float P074[3] = {-1262.09, -291.70, 1504.26}; -static float P075[3] = {965.71, -269.26, 1742.65}; -static float P076[3] = {-900.97, -276.74, 1726.07}; -static float iP068[3] = {-136.29, -319.84, 1228.73}; -static float iP069[3] = {1111.17, -314.14, 1314.19}; -static float iP070[3] = {-1167.34, -321.61, 1319.45}; -static float iP071[3] = {1404.86, -306.66, 1235.45}; -static float iP072[3] = {-1409.73, -314.14, 1247.66}; -static float iP073[3] = {1254.01, -296.87, 1544.58}; -static float iP074[3] = {-1262.09, -291.70, 1504.26}; -static float iP075[3] = {965.71, -269.26, 1742.65}; -static float iP076[3] = {-900.97, -276.74, 1726.07}; -static float P077[3] = {1058.00, -448.81, 8194.66}; -static float P078[3] = {-1016.51, -456.43, 8190.62}; -static float P079[3] = {-1515.96, -676.45, 7754.93}; -static float P080[3] = {1856.75, -830.34, 7296.56}; -static float P081[3] = {1472.16, -497.38, 7399.68}; -static float P082[3] = {-1775.26, -829.51, 7298.46}; -static float P083[3] = {911.09, -252.51, 7510.99}; -static float P084[3] = {-1451.94, -495.62, 7384.30}; -static float P085[3] = {1598.75, -669.26, 7769.90}; -static float P086[3] = {-836.53, -250.08, 7463.25}; -static float P087[3] = {722.87, -158.18, 8006.41}; -static float P088[3] = {-688.86, -162.28, 7993.89}; -static float P089[3] = {-626.92, -185.30, 8364.98}; -static float P090[3] = {647.72, -189.46, 8354.99}; -static float P091[3] = {0.00, 835.01, 5555.62}; -static float P092[3] = {0.00, 1350.18, 5220.86}; -static float P093[3] = {0.00, 1422.94, 5285.27}; -static float P094[3] = {0.00, 1296.75, 5650.19}; -static float P095[3] = {0.00, 795.63, 6493.88}; -static float iP091[3] = {0.00, 835.01, 5555.62}; -static float iP092[3] = {0.00, 1350.18, 5220.86}; -static float iP093[3] = {0.00, 1422.94, 5285.27}; -static float iP094[3] = {0.00, 1296.75, 5650.19}; -static float iP095[3] = {0.00, 795.63, 6493.88}; -static float P097[3] = {-194.91, -357.14, 10313.32}; -static float P098[3] = {135.35, -357.66, 10307.94}; -static float iP097[3] = {-194.91, -357.14, 10313.32}; -static float iP098[3] = {135.35, -357.66, 10307.94}; -static float P099[3] = {-380.53, -221.14, 9677.98}; -static float P100[3] = {0.00, 412.99, 9629.33}; -static float P102[3] = {59.51, -412.55, 10677.58}; -static float iP102[3] = {59.51, -412.55, 10677.58}; -static float P103[3] = {6.50, 484.74, 9009.94}; -static float P105[3] = {-41.86, 476.51, 9078.17}; -static float P108[3] = {49.20, 476.83, 9078.24}; -static float P110[3] = {-187.62, -410.04, 10674.12}; -static float iP110[3] = {-187.62, -410.04, 10674.12}; -static float P111[3] = {-184.25, -318.70, 10723.88}; -static float iP111[3] = {-184.25, -318.70, 10723.88}; -static float P112[3] = {-179.61, -142.81, 10670.26}; -static float P113[3] = {57.43, -147.94, 10675.26}; -static float P114[3] = {54.06, -218.90, 10712.44}; -static float P115[3] = {-186.35, -212.09, 10713.76}; -static float P116[3] = {205.90, -84.61, 10275.97}; -static float P117[3] = {-230.96, -83.26, 10280.09}; -static float iP118[3] = {216.78, -509.17, 10098.94}; -static float iP119[3] = {-313.21, -510.79, 10102.62}; -static float P118[3] = {216.78, -509.17, 10098.94}; -static float P119[3] = {-313.21, -510.79, 10102.62}; -static float P120[3] = {217.95, 96.34, 10161.62}; -static float P121[3] = {71.99, -319.74, 10717.70}; -static float iP121[3] = {71.99, -319.74, 10717.70}; -static float P122[3] = {0.00, 602.74, 5375.84}; -static float iP122[3] = {0.00, 602.74, 5375.84}; -static float P123[3] = {-448.94, -203.14, 9499.60}; -static float P124[3] = {-442.64, -185.20, 9528.07}; -static float P125[3] = {-441.07, -148.05, 9528.07}; -static float P126[3] = {-443.43, -128.84, 9499.60}; -static float P127[3] = {-456.87, -146.78, 9466.67}; -static float P128[3] = {-453.68, -183.93, 9466.67}; -static float P129[3] = {428.43, -124.08, 9503.03}; -static float P130[3] = {419.73, -142.14, 9534.56}; -static float P131[3] = {419.92, -179.96, 9534.56}; -static float P132[3] = {431.20, -199.73, 9505.26}; -static float P133[3] = {442.28, -181.67, 9475.96}; -static float P134[3] = {442.08, -143.84, 9475.96}; -/* *INDENT-ON* */ - -void -Dolphin001(void) -{ - glNormal3fv(N071); - glBegin(GL_POLYGON); - glVertex3fv(P001); - glVertex3fv(P068); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P076); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P070); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P076); - glVertex3fv(P070); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P070); - glVertex3fv(P072); - glVertex3fv(P074); - glEnd(); - glNormal3fv(N119); - glBegin(GL_POLYGON); - glVertex3fv(P072); - glVertex3fv(P070); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P074); - glVertex3fv(P070); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P070); - glVertex3fv(P068); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P076); - glVertex3fv(P068); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P068); - glVertex3fv(P001); - glVertex3fv(P010); - glEnd(); -} - -void -Dolphin002(void) -{ - glNormal3fv(N071); - glBegin(GL_POLYGON); - glVertex3fv(P011); - glVertex3fv(P001); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P075); - glVertex3fv(P011); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P011); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P075); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P071); - glVertex3fv(P069); - glVertex3fv(P073); - glEnd(); - glNormal3fv(N119); - glBegin(GL_POLYGON); - glVertex3fv(P001); - glVertex3fv(P011); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P009); - glVertex3fv(P011); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P011); - glVertex3fv(P069); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P073); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P069); - glVertex3fv(P071); - glVertex3fv(P073); - glEnd(); -} - -void -Dolphin003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glEnd(); -} - -void -Dolphin004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); -} - -void -Dolphin005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); -} - -void -Dolphin006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N122); - glVertex3fv(P122); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N091); - glVertex3fv(P091); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N122); - glVertex3fv(P122); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); -} - -void -Dolphin007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); -} - -void -Dolphin008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); -} - -void -Dolphin009(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); -} - -void -Dolphin010(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); -} - -void -Dolphin011(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N079); - glVertex3fv(P079); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N089); - glVertex3fv(P089); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); -} - -void -Dolphin012(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N067); - glVertex3fv(P067); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); -} - -void -Dolphin013(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N116); - glVertex3fv(P116); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N113); - glVertex3fv(P113); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N113); - glVertex3fv(P113); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N115); - glVertex3fv(P115); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N116); - glVertex3fv(P116); - glNormal3fv(N113); - glVertex3fv(P113); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N114); - glVertex3fv(P114); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P002); - glVertex3fv(P007); - glVertex3fv(P008); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P007); - glVertex3fv(P114); - glVertex3fv(P115); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N112); - glVertex3fv(P112); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N112); - glVertex3fv(P112); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N115); - glVertex3fv(P115); - glEnd(); -} - -void -Dolphin014(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N111); - glVertex3fv(P111); - glNormal3fv(N110); - glVertex3fv(P110); - glNormal3fv(N102); - glVertex3fv(P102); - glNormal3fv(N121); - glVertex3fv(P121); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N111); - glVertex3fv(P111); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N110); - glVertex3fv(P110); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N110); - glVertex3fv(P110); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N119); - glVertex3fv(P119); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P098); - glVertex3fv(P097); - glVertex3fv(P111); - glVertex3fv(P121); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P002); - glVertex3fv(P099); - glVertex3fv(P097); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N110); - glVertex3fv(P110); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N102); - glVertex3fv(P102); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N119); - glVertex3fv(P119); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N118); - glVertex3fv(P118); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N118); - glVertex3fv(P118); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N098); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N118); - glVertex3fv(P118); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N102); - glVertex3fv(P102); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N102); - glVertex3fv(P102); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N121); - glVertex3fv(P121); - glEnd(); -} - -void -Dolphin015(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N100); - glVertex3fv(P100); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N099); - glVertex3fv(P099); - glNormal3fv(N117); - glVertex3fv(P117); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N117); - glVertex3fv(P117); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N120); - glVertex3fv(P120); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N120); - glVertex3fv(P120); - glNormal3fv(N116); - glVertex3fv(P116); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); -} - -void -Dolphin016(void) -{ - - glDisable(GL_DEPTH_TEST); - glBegin(GL_POLYGON); - glVertex3fv(P123); - glVertex3fv(P124); - glVertex3fv(P125); - glVertex3fv(P126); - glVertex3fv(P127); - glVertex3fv(P128); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P129); - glVertex3fv(P130); - glVertex3fv(P131); - glVertex3fv(P132); - glVertex3fv(P133); - glVertex3fv(P134); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P103); - glVertex3fv(P105); - glVertex3fv(P108); - glEnd(); - glEnable(GL_DEPTH_TEST); -} - -void -DrawDolphin(fishRec * fish) -{ - float seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7; - float pitch, thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (10.0 * fish->v)) % 360; - - thrash = 70.0 * fish->v; - - seg0 = 1.0 * thrash * sin((fish->htail) * RRAD); - seg3 = 1.0 * thrash * sin((fish->htail) * RRAD); - seg1 = 2.0 * thrash * sin((fish->htail + 4.0) * RRAD); - seg2 = 3.0 * thrash * sin((fish->htail + 6.0) * RRAD); - seg4 = 4.0 * thrash * sin((fish->htail + 10.0) * RRAD); - seg5 = 4.5 * thrash * sin((fish->htail + 15.0) * RRAD); - seg6 = 5.0 * thrash * sin((fish->htail + 20.0) * RRAD); - seg7 = 6.0 * thrash * sin((fish->htail + 30.0) * RRAD); - - pitch = fish->v * sin((fish->htail + 180.0) * RRAD); - - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - chomp = 100.0; - - P012[1] = iP012[1] + seg5; - P013[1] = iP013[1] + seg5; - P014[1] = iP014[1] + seg5; - P015[1] = iP015[1] + seg5; - P016[1] = iP016[1] + seg5; - P017[1] = iP017[1] + seg5; - P018[1] = iP018[1] + seg5; - P019[1] = iP019[1] + seg5; - - P020[1] = iP020[1] + seg4; - P021[1] = iP021[1] + seg4; - P022[1] = iP022[1] + seg4; - P023[1] = iP023[1] + seg4; - P024[1] = iP024[1] + seg4; - P025[1] = iP025[1] + seg4; - P026[1] = iP026[1] + seg4; - P027[1] = iP027[1] + seg4; - - P028[1] = iP028[1] + seg2; - P029[1] = iP029[1] + seg2; - P030[1] = iP030[1] + seg2; - P031[1] = iP031[1] + seg2; - P032[1] = iP032[1] + seg2; - P033[1] = iP033[1] + seg2; - P034[1] = iP034[1] + seg2; - P035[1] = iP035[1] + seg2; - - P036[1] = iP036[1] + seg1; - P037[1] = iP037[1] + seg1; - P038[1] = iP038[1] + seg1; - P039[1] = iP039[1] + seg1; - P040[1] = iP040[1] + seg1; - P041[1] = iP041[1] + seg1; - P042[1] = iP042[1] + seg1; - P043[1] = iP043[1] + seg1; - - P044[1] = iP044[1] + seg0; - P045[1] = iP045[1] + seg0; - P046[1] = iP046[1] + seg0; - P047[1] = iP047[1] + seg0; - P048[1] = iP048[1] + seg0; - P049[1] = iP049[1] + seg0; - P050[1] = iP050[1] + seg0; - P051[1] = iP051[1] + seg0; - - P009[1] = iP009[1] + seg6; - P010[1] = iP010[1] + seg6; - P075[1] = iP075[1] + seg6; - P076[1] = iP076[1] + seg6; - - P001[1] = iP001[1] + seg7; - P011[1] = iP011[1] + seg7; - P068[1] = iP068[1] + seg7; - P069[1] = iP069[1] + seg7; - P070[1] = iP070[1] + seg7; - P071[1] = iP071[1] + seg7; - P072[1] = iP072[1] + seg7; - P073[1] = iP073[1] + seg7; - P074[1] = iP074[1] + seg7; - - P091[1] = iP091[1] + seg3; - P092[1] = iP092[1] + seg3; - P093[1] = iP093[1] + seg3; - P094[1] = iP094[1] + seg3; - P095[1] = iP095[1] + seg3; - P122[1] = iP122[1] + seg3 * 1.5; - - P097[1] = iP097[1] + chomp; - P098[1] = iP098[1] + chomp; - P102[1] = iP102[1] + chomp; - P110[1] = iP110[1] + chomp; - P111[1] = iP111[1] + chomp; - P121[1] = iP121[1] + chomp; - P118[1] = iP118[1] + chomp; - P119[1] = iP119[1] + chomp; - - glPushMatrix(); - - glRotatef(pitch, 1.0, 0.0, 0.0); - - glTranslatef(0.0, 0.0, 7000.0); - - glRotatef(180.0, 0.0, 1.0, 0.0); - - glEnable(GL_CULL_FACE); - Dolphin014(); - Dolphin010(); - Dolphin009(); - Dolphin012(); - Dolphin013(); - Dolphin006(); - Dolphin002(); - Dolphin001(); - Dolphin003(); - Dolphin015(); - Dolphin004(); - Dolphin005(); - Dolphin007(); - Dolphin008(); - Dolphin011(); - Dolphin016(); - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/shark.c b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/shark.c deleted file mode 100644 index 9c847dbafe..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/shark.c +++ /dev/null @@ -1,1308 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N002[3] = {0.000077 ,-0.020611 ,0.999788}; -static float N003[3] = {0.961425 ,0.258729 ,-0.093390}; -static float N004[3] = {0.510811 ,-0.769633 ,-0.383063}; -static float N005[3] = {0.400123 ,0.855734 ,-0.328055}; -static float N006[3] = {-0.770715 ,0.610204 ,-0.183440}; -static float N007[3] = {-0.915597 ,-0.373345 ,-0.149316}; -static float N008[3] = {-0.972788 ,0.208921 ,-0.100179}; -static float N009[3] = {-0.939713 ,-0.312268 ,-0.139383}; -static float N010[3] = {-0.624138 ,-0.741047 ,-0.247589}; -static float N011[3] = {0.591434 ,-0.768401 ,-0.244471}; -static float N012[3] = {0.935152 ,-0.328495 ,-0.132598}; -static float N013[3] = {0.997102 ,0.074243 ,-0.016593}; -static float N014[3] = {0.969995 ,0.241712 ,-0.026186}; -static float N015[3] = {0.844539 ,0.502628 ,-0.184714}; -static float N016[3] = {-0.906608 ,0.386308 ,-0.169787}; -static float N017[3] = {-0.970016 ,0.241698 ,-0.025516}; -static float N018[3] = {-0.998652 ,0.050493 ,-0.012045}; -static float N019[3] = {-0.942685 ,-0.333051 ,-0.020556}; -static float N020[3] = {-0.660944 ,-0.750276 ,0.015480}; -static float N021[3] = {0.503549 ,-0.862908 ,-0.042749}; -static float N022[3] = {0.953202 ,-0.302092 ,-0.012089}; -static float N023[3] = {0.998738 ,0.023574 ,0.044344}; -static float N024[3] = {0.979297 ,0.193272 ,0.060202}; -static float N025[3] = {0.798300 ,0.464885 ,0.382883}; -static float N026[3] = {-0.756590 ,0.452403 ,0.472126}; -static float N027[3] = {-0.953855 ,0.293003 ,0.065651}; -static float N028[3] = {-0.998033 ,0.040292 ,0.048028}; -static float N029[3] = {-0.977079 ,-0.204288 ,0.059858}; -static float N030[3] = {-0.729117 ,-0.675304 ,0.111140}; -static float N031[3] = {0.598361 ,-0.792753 ,0.116221}; -static float N032[3] = {0.965192 ,-0.252991 ,0.066332}; -static float N033[3] = {0.998201 ,-0.002790 ,0.059892}; -static float N034[3] = {0.978657 ,0.193135 ,0.070207}; -static float N035[3] = {0.718815 ,0.680392 ,0.142733}; -static float N036[3] = {-0.383096 ,0.906212 ,0.178936}; -static float N037[3] = {-0.952831 ,0.292590 ,0.080647}; -static float N038[3] = {-0.997680 ,0.032417 ,0.059861}; -static float N039[3] = {-0.982629 ,-0.169881 ,0.074700}; -static float N040[3] = {-0.695424 ,-0.703466 ,0.146700}; -static float N041[3] = {0.359323 ,-0.915531 ,0.180805}; -static float N042[3] = {0.943356 ,-0.319387 ,0.089842}; -static float N043[3] = {0.998272 ,-0.032435 ,0.048993}; -static float N044[3] = {0.978997 ,0.193205 ,0.065084}; -static float N045[3] = {0.872144 ,0.470094 ,-0.135565}; -static float N046[3] = {-0.664282 ,0.737945 ,-0.119027}; -static float N047[3] = {-0.954508 ,0.288570 ,0.075107}; -static float N048[3] = {-0.998273 ,0.032406 ,0.048993}; -static float N049[3] = {-0.979908 ,-0.193579 ,0.048038}; -static float N050[3] = {-0.858736 ,-0.507202 ,-0.072938}; -static float N051[3] = {0.643545 ,-0.763887 ,-0.048237}; -static float N052[3] = {0.955580 ,-0.288954 ,0.058068}; -static float N058[3] = {0.000050 ,0.793007 ,-0.609213}; -static float N059[3] = {0.913510 ,0.235418 ,-0.331779}; -static float N060[3] = {-0.807970 ,0.495000 ,-0.319625}; -static float N061[3] = {0.000000 ,0.784687 ,-0.619892}; -static float N062[3] = {0.000000 ,-1.000000 ,0.000000}; -static float N063[3] = {0.000000 ,1.000000 ,0.000000}; -static float N064[3] = {0.000000 ,1.000000 ,0.000000}; -static float N065[3] = {0.000000 ,1.000000 ,0.000000}; -static float N066[3] = {-0.055784 ,0.257059 ,0.964784}; -static float N069[3] = {-0.000505 ,-0.929775 ,-0.368127}; -static float N070[3] = {0.000000 ,1.000000 ,0.000000}; -static float P002[3] = {0.00, -36.59, 5687.72}; -static float P003[3] = {90.00, 114.73, 724.38}; -static float P004[3] = {58.24, -146.84, 262.35}; -static float P005[3] = {27.81, 231.52, 510.43}; -static float P006[3] = {-27.81, 230.43, 509.76}; -static float P007[3] = {-46.09, -146.83, 265.84}; -static float P008[3] = {-90.00, 103.84, 718.53}; -static float P009[3] = {-131.10, -165.92, 834.85}; -static float P010[3] = {-27.81, -285.31, 500.00}; -static float P011[3] = {27.81, -285.32, 500.00}; -static float P012[3] = {147.96, -170.89, 845.50}; -static float P013[3] = {180.00, 0.00, 2000.00}; -static float P014[3] = {145.62, 352.67, 2000.00}; -static float P015[3] = {55.62, 570.63, 2000.00}; -static float P016[3] = {-55.62, 570.64, 2000.00}; -static float P017[3] = {-145.62, 352.68, 2000.00}; -static float P018[3] = {-180.00, 0.01, 2000.00}; -static float P019[3] = {-178.20, -352.66, 2001.61}; -static float P020[3] = {-55.63, -570.63, 2000.00}; -static float P021[3] = {55.62, -570.64, 2000.00}; -static float P022[3] = {179.91, -352.69, 1998.39}; -static float P023[3] = {150.00, 0.00, 3000.00}; -static float P024[3] = {121.35, 293.89, 3000.00}; -static float P025[3] = {46.35, 502.93, 2883.09}; -static float P026[3] = {-46.35, 497.45, 2877.24}; -static float P027[3] = {-121.35, 293.90, 3000.00}; -static float P028[3] = {-150.00, 0.00, 3000.00}; -static float P029[3] = {-152.21, -304.84, 2858.68}; -static float P030[3] = {-46.36, -475.52, 3000.00}; -static float P031[3] = {46.35, -475.53, 3000.00}; -static float P032[3] = {155.64, -304.87, 2863.50}; -static float P033[3] = {90.00, 0.00, 4000.00}; -static float P034[3] = {72.81, 176.33, 4000.00}; -static float P035[3] = {27.81, 285.32, 4000.00}; -static float P036[3] = {-27.81, 285.32, 4000.00}; -static float P037[3] = {-72.81, 176.34, 4000.00}; -static float P038[3] = {-90.00, 0.00, 4000.00}; -static float P039[3] = {-72.81, -176.33, 4000.00}; -static float P040[3] = {-27.81, -285.31, 4000.00}; -static float P041[3] = {27.81, -285.32, 4000.00}; -static float P042[3] = {72.81, -176.34, 4000.00}; -static float P043[3] = {30.00, 0.00, 5000.00}; -static float P044[3] = {24.27, 58.78, 5000.00}; -static float P045[3] = {9.27, 95.11, 5000.00}; -static float P046[3] = {-9.27, 95.11, 5000.00}; -static float P047[3] = {-24.27, 58.78, 5000.00}; -static float P048[3] = {-30.00, 0.00, 5000.00}; -static float P049[3] = {-24.27, -58.78, 5000.00}; -static float P050[3] = {-9.27, -95.10, 5000.00}; -static float P051[3] = {9.27, -95.11, 5000.00}; -static float P052[3] = {24.27, -58.78, 5000.00}; -static float P058[3] = {0.00, 1212.72, 2703.08}; -static float P059[3] = {50.36, 0.00, 108.14}; -static float P060[3] = {-22.18, 0.00, 108.14}; -static float P061[3] = {0.00, 1181.61, 6344.65}; -static float P062[3] = {516.45, -887.08, 2535.45}; -static float P063[3] = {-545.69, -879.31, 2555.63}; -static float P064[3] = {618.89, -1005.64, 2988.32}; -static float P065[3] = {-635.37, -1014.79, 2938.68}; -static float P066[3] = {0.00, 1374.43, 3064.18}; -static float P069[3] = {0.00, -418.25, 5765.04}; -static float P070[3] = {0.00, 1266.91, 6629.60}; -static float P071[3] = {-139.12, -124.96, 997.98}; -static float P072[3] = {-139.24, -110.18, 1020.68}; -static float P073[3] = {-137.33, -94.52, 1022.63}; -static float P074[3] = {-137.03, -79.91, 996.89}; -static float P075[3] = {-135.21, -91.48, 969.14}; -static float P076[3] = {-135.39, -110.87, 968.76}; -static float P077[3] = {150.23, -78.44, 995.53}; -static float P078[3] = {152.79, -92.76, 1018.46}; -static float P079[3] = {154.19, -110.20, 1020.55}; -static float P080[3] = {151.33, -124.15, 993.77}; -static float P081[3] = {150.49, -111.19, 969.86}; -static float P082[3] = {150.79, -92.41, 969.70}; -static float iP002[3] = {0.00, -36.59, 5687.72}; -static float iP004[3] = {58.24, -146.84, 262.35}; -static float iP007[3] = {-46.09, -146.83, 265.84}; -static float iP010[3] = {-27.81, -285.31, 500.00}; -static float iP011[3] = {27.81, -285.32, 500.00}; -static float iP023[3] = {150.00, 0.00, 3000.00}; -static float iP024[3] = {121.35, 293.89, 3000.00}; -static float iP025[3] = {46.35, 502.93, 2883.09}; -static float iP026[3] = {-46.35, 497.45, 2877.24}; -static float iP027[3] = {-121.35, 293.90, 3000.00}; -static float iP028[3] = {-150.00, 0.00, 3000.00}; -static float iP029[3] = {-121.35, -304.84, 2853.86}; -static float iP030[3] = {-46.36, -475.52, 3000.00}; -static float iP031[3] = {46.35, -475.53, 3000.00}; -static float iP032[3] = {121.35, -304.87, 2853.86}; -static float iP033[3] = {90.00, 0.00, 4000.00}; -static float iP034[3] = {72.81, 176.33, 4000.00}; -static float iP035[3] = {27.81, 285.32, 4000.00}; -static float iP036[3] = {-27.81, 285.32, 4000.00}; -static float iP037[3] = {-72.81, 176.34, 4000.00}; -static float iP038[3] = {-90.00, 0.00, 4000.00}; -static float iP039[3] = {-72.81, -176.33, 4000.00}; -static float iP040[3] = {-27.81, -285.31, 4000.00}; -static float iP041[3] = {27.81, -285.32, 4000.00}; -static float iP042[3] = {72.81, -176.34, 4000.00}; -static float iP043[3] = {30.00, 0.00, 5000.00}; -static float iP044[3] = {24.27, 58.78, 5000.00}; -static float iP045[3] = {9.27, 95.11, 5000.00}; -static float iP046[3] = {-9.27, 95.11, 5000.00}; -static float iP047[3] = {-24.27, 58.78, 5000.00}; -static float iP048[3] = {-30.00, 0.00, 5000.00}; -static float iP049[3] = {-24.27, -58.78, 5000.00}; -static float iP050[3] = {-9.27, -95.10, 5000.00}; -static float iP051[3] = {9.27, -95.11, 5000.00}; -static float iP052[3] = {24.27, -58.78, 5000.00}; -static float iP061[3] = {0.00, 1181.61, 6344.65}; -static float iP069[3] = {0.00, -418.25, 5765.04}; -static float iP070[3] = {0.00, 1266.91, 6629.60}; -/* *INDENT-ON* */ - -void -Fish001(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N017); - glVertex3fv(P017); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N007); - glVertex3fv(P007); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N010); - glVertex3fv(P010); - glNormal3fv(N007); - glVertex3fv(P007); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N011); - glVertex3fv(P011); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N011); - glVertex3fv(P011); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N003); - glVertex3fv(P003); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P071); - glVertex3fv(P072); - glVertex3fv(P073); - glVertex3fv(P074); - glVertex3fv(P075); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P077); - glVertex3fv(P078); - glVertex3fv(P079); - glVertex3fv(P080); - glVertex3fv(P081); - glVertex3fv(P082); - glEnd(); -} - -void -Fish002(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); -} - -void -Fish003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); -} - -void -Fish004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N061); - glVertex3fv(P061); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N061); - glVertex3fv(P061); - glNormal3fv(N070); - glVertex3fv(P070); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N061); - glVertex3fv(P061); - glEnd(); -} - -void -Fish005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N069); - glVertex3fv(P069); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N069); - glVertex3fv(P069); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); -} - -void -Fish006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); -} - -void -Fish007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N064); - glVertex3fv(P064); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N064); - glVertex3fv(P064); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); -} - -void -Fish008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); -} - -void -Fish009(void) -{ - glBegin(GL_POLYGON); - glVertex3fv(P059); - glVertex3fv(P012); - glVertex3fv(P009); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P012); - glVertex3fv(P004); - glVertex3fv(P007); - glVertex3fv(P009); - glEnd(); -} - -void -Fish_1(void) -{ - Fish004(); - Fish005(); - Fish003(); - Fish007(); - Fish006(); - Fish002(); - Fish008(); - Fish009(); - Fish001(); -} - -void -Fish_2(void) -{ - Fish005(); - Fish004(); - Fish003(); - Fish008(); - Fish006(); - Fish002(); - Fish007(); - Fish009(); - Fish001(); -} - -void -Fish_3(void) -{ - Fish005(); - Fish004(); - Fish007(); - Fish003(); - Fish002(); - Fish008(); - Fish009(); - Fish001(); - Fish006(); -} - -void -Fish_4(void) -{ - Fish005(); - Fish004(); - Fish008(); - Fish003(); - Fish002(); - Fish007(); - Fish009(); - Fish001(); - Fish006(); -} - -void -Fish_5(void) -{ - Fish009(); - Fish006(); - Fish007(); - Fish001(); - Fish002(); - Fish003(); - Fish008(); - Fish004(); - Fish005(); -} - -void -Fish_6(void) -{ - Fish009(); - Fish006(); - Fish008(); - Fish001(); - Fish002(); - Fish007(); - Fish003(); - Fish004(); - Fish005(); -} - -void -Fish_7(void) -{ - Fish009(); - Fish001(); - Fish007(); - Fish005(); - Fish002(); - Fish008(); - Fish003(); - Fish004(); - Fish006(); -} - -void -Fish_8(void) -{ - Fish009(); - Fish008(); - Fish001(); - Fish002(); - Fish007(); - Fish003(); - Fish005(); - Fish004(); - Fish006(); -} - -void -DrawShark(fishRec * fish) -{ - float mat[4][4]; - int n; - float seg1, seg2, seg3, seg4, segup; - float thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360; - - thrash = 50.0 * fish->v; - - seg1 = 0.6 * thrash * sin(fish->htail * RRAD); - seg2 = 1.8 * thrash * sin((fish->htail + 45.0) * RRAD); - seg3 = 3.0 * thrash * sin((fish->htail + 90.0) * RRAD); - seg4 = 4.0 * thrash * sin((fish->htail + 110.0) * RRAD); - - chomp = 0.0; - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - P004[1] = iP004[1] + chomp; - P007[1] = iP007[1] + chomp; - P010[1] = iP010[1] + chomp; - P011[1] = iP011[1] + chomp; - - P023[0] = iP023[0] + seg1; - P024[0] = iP024[0] + seg1; - P025[0] = iP025[0] + seg1; - P026[0] = iP026[0] + seg1; - P027[0] = iP027[0] + seg1; - P028[0] = iP028[0] + seg1; - P029[0] = iP029[0] + seg1; - P030[0] = iP030[0] + seg1; - P031[0] = iP031[0] + seg1; - P032[0] = iP032[0] + seg1; - P033[0] = iP033[0] + seg2; - P034[0] = iP034[0] + seg2; - P035[0] = iP035[0] + seg2; - P036[0] = iP036[0] + seg2; - P037[0] = iP037[0] + seg2; - P038[0] = iP038[0] + seg2; - P039[0] = iP039[0] + seg2; - P040[0] = iP040[0] + seg2; - P041[0] = iP041[0] + seg2; - P042[0] = iP042[0] + seg2; - P043[0] = iP043[0] + seg3; - P044[0] = iP044[0] + seg3; - P045[0] = iP045[0] + seg3; - P046[0] = iP046[0] + seg3; - P047[0] = iP047[0] + seg3; - P048[0] = iP048[0] + seg3; - P049[0] = iP049[0] + seg3; - P050[0] = iP050[0] + seg3; - P051[0] = iP051[0] + seg3; - P052[0] = iP052[0] + seg3; - P002[0] = iP002[0] + seg4; - P061[0] = iP061[0] + seg4; - P069[0] = iP069[0] + seg4; - P070[0] = iP070[0] + seg4; - - fish->vtail += ((fish->dtheta - fish->vtail) * 0.1); - - if (fish->vtail > 0.5) { - fish->vtail = 0.5; - } else if (fish->vtail < -0.5) { - fish->vtail = -0.5; - } - segup = thrash * fish->vtail; - - P023[1] = iP023[1] + segup; - P024[1] = iP024[1] + segup; - P025[1] = iP025[1] + segup; - P026[1] = iP026[1] + segup; - P027[1] = iP027[1] + segup; - P028[1] = iP028[1] + segup; - P029[1] = iP029[1] + segup; - P030[1] = iP030[1] + segup; - P031[1] = iP031[1] + segup; - P032[1] = iP032[1] + segup; - P033[1] = iP033[1] + segup * 5.0; - P034[1] = iP034[1] + segup * 5.0; - P035[1] = iP035[1] + segup * 5.0; - P036[1] = iP036[1] + segup * 5.0; - P037[1] = iP037[1] + segup * 5.0; - P038[1] = iP038[1] + segup * 5.0; - P039[1] = iP039[1] + segup * 5.0; - P040[1] = iP040[1] + segup * 5.0; - P041[1] = iP041[1] + segup * 5.0; - P042[1] = iP042[1] + segup * 5.0; - P043[1] = iP043[1] + segup * 12.0; - P044[1] = iP044[1] + segup * 12.0; - P045[1] = iP045[1] + segup * 12.0; - P046[1] = iP046[1] + segup * 12.0; - P047[1] = iP047[1] + segup * 12.0; - P048[1] = iP048[1] + segup * 12.0; - P049[1] = iP049[1] + segup * 12.0; - P050[1] = iP050[1] + segup * 12.0; - P051[1] = iP051[1] + segup * 12.0; - P052[1] = iP052[1] + segup * 12.0; - P002[1] = iP002[1] + segup * 17.0; - P061[1] = iP061[1] + segup * 17.0; - P069[1] = iP069[1] + segup * 17.0; - P070[1] = iP070[1] + segup * 17.0; - - glPushMatrix(); - - glTranslatef(0.0, 0.0, -3000.0); - - glGetFloatv(GL_MODELVIEW_MATRIX, &mat[0][0]); - n = 0; - if (mat[0][2] >= 0.0) { - n += 1; - } - if (mat[1][2] >= 0.0) { - n += 2; - } - if (mat[2][2] >= 0.0) { - n += 4; - } - glScalef(2.0, 1.0, 1.0); - - glEnable(GL_CULL_FACE); - switch (n) { - case 0: - Fish_1(); - break; - case 1: - Fish_2(); - break; - case 2: - Fish_3(); - break; - case 3: - Fish_4(); - break; - case 4: - Fish_5(); - break; - case 5: - Fish_6(); - break; - case 6: - Fish_7(); - break; - case 7: - Fish_8(); - break; - } - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/swim.c b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/swim.c deleted file mode 100644 index cac7b60952..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/swim.c +++ /dev/null @@ -1,188 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include /* For rand(). */ -#include -#include "atlantis.h" - -void -FishTransform(fishRec * fish) -{ - - glTranslatef(fish->y, fish->z, -fish->x); - glRotatef(-fish->psi, 0.0, 1.0, 0.0); - glRotatef(fish->theta, 1.0, 0.0, 0.0); - glRotatef(-fish->phi, 0.0, 0.0, 1.0); -} - -void -WhalePilot(fishRec * fish) -{ - - fish->phi = -20.0; - fish->theta = 0.0; - fish->psi -= 0.5; - - fish->x += WHALESPEED * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD); - fish->y += WHALESPEED * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD); - fish->z += WHALESPEED * fish->v * sin(fish->theta / RAD); -} - -void -SharkPilot(fishRec * fish) -{ - static int sign = 1; - float X, Y, Z, tpsi, ttheta, thetal; - - fish->xt = 60000.0; - fish->yt = 0.0; - fish->zt = 0.0; - - X = fish->xt - fish->x; - Y = fish->yt - fish->y; - Z = fish->zt - fish->z; - - thetal = fish->theta; - - ttheta = RAD * atan(Z / (sqrt(X * X + Y * Y))); - - if (ttheta > fish->theta + 0.25) { - fish->theta += 0.5; - } else if (ttheta < fish->theta - 0.25) { - fish->theta -= 0.5; - } - if (fish->theta > 90.0) { - fish->theta = 90.0; - } - if (fish->theta < -90.0) { - fish->theta = -90.0; - } - fish->dtheta = fish->theta - thetal; - - tpsi = RAD * atan2(Y, X); - - fish->attack = 0; - - if (fabs(tpsi - fish->psi) < 10.0) { - fish->attack = 1; - } else if (fabs(tpsi - fish->psi) < 45.0) { - if (fish->psi > tpsi) { - fish->psi -= 0.5; - if (fish->psi < -180.0) { - fish->psi += 360.0; - } - } else if (fish->psi < tpsi) { - fish->psi += 0.5; - if (fish->psi > 180.0) { - fish->psi -= 360.0; - } - } - } else { - if (rand() % 100 > 98) { - sign = 1 - sign; - } - fish->psi += sign; - if (fish->psi > 180.0) { - fish->psi -= 360.0; - } - if (fish->psi < -180.0) { - fish->psi += 360.0; - } - } - - if (fish->attack) { - if (fish->v < 1.1) { - fish->spurt = 1; - } - if (fish->spurt) { - fish->v += 0.2; - } - if (fish->v > 5.0) { - fish->spurt = 0; - } - if ((fish->v > 1.0) && (!fish->spurt)) { - fish->v -= 0.2; - } - } else { - if (!(rand() % 400) && (!fish->spurt)) { - fish->spurt = 1; - } - if (fish->spurt) { - fish->v += 0.05; - } - if (fish->v > 3.0) { - fish->spurt = 0; - } - if ((fish->v > 1.0) && (!fish->spurt)) { - fish->v -= 0.05; - } - } - - fish->x += SHARKSPEED * fish->v * cos(fish->psi / RAD) * cos(fish->theta / RAD); - fish->y += SHARKSPEED * fish->v * sin(fish->psi / RAD) * cos(fish->theta / RAD); - fish->z += SHARKSPEED * fish->v * sin(fish->theta / RAD); -} - -void -SharkMiss(int i) -{ - int j; - float avoid, thetal; - float X, Y, Z, R; - - for (j = 0; j < NUM_SHARKS; j++) { - if (j != i) { - X = sharks[j].x - sharks[i].x; - Y = sharks[j].y - sharks[i].y; - Z = sharks[j].z - sharks[i].z; - - R = sqrt(X * X + Y * Y + Z * Z); - - avoid = 1.0; - thetal = sharks[i].theta; - - if (R < SHARKSIZE) { - if (Z > 0.0) { - sharks[i].theta -= avoid; - } else { - sharks[i].theta += avoid; - } - } - sharks[i].dtheta += (sharks[i].theta - thetal); - } - } -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/whale.c b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/whale.c deleted file mode 100644 index 828640ad04..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/whale.c +++ /dev/null @@ -1,1798 +0,0 @@ -/** - * (c) Copyright 1993, 1994, Silicon Graphics, Inc. - * ALL RIGHTS RESERVED - * Permission to use, copy, modify, and distribute this software for - * any purpose and without fee is hereby granted, provided that the above - * copyright notice appear in all copies and that both the copyright notice - * and this permission notice appear in supporting documentation, and that - * the name of Silicon Graphics, Inc. not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" - * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR - * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, - * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY - * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, - * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF - * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN - * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE - * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer Software - * clause at DFARS 252.227-7013 and/or in similar or successor - * clauses in the FAR or the DOD or NASA FAR Supplement. - * Unpublished-- rights reserved under the copyright laws of the - * United States. Contractor/manufacturer is Silicon Graphics, - * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ -#include -#include -#include "atlantis.h" -/* *INDENT-OFF* */ -static float N001[3] = {0.019249 ,0.011340 ,-0.999750}; -static float N002[3] = {-0.132579 ,0.954547 ,0.266952}; -static float N003[3] = {-0.196061 ,0.980392 ,-0.019778}; -static float N004[3] = {0.695461 ,0.604704 ,0.388158}; -static float N005[3] = {0.870600 ,0.425754 ,0.246557}; -static float N006[3] = {-0.881191 ,0.392012 ,0.264251}; -static float N008[3] = {-0.341437 ,0.887477 ,0.309523}; -static float N009[3] = {0.124035 ,-0.992278 ,0.000000}; -static float N010[3] = {0.242536 ,0.000000 ,-0.970143}; -static float N011[3] = {0.588172 ,0.000000 ,0.808736}; -static float N012[3] = {0.929824 ,-0.340623 ,-0.139298}; -static float N013[3] = {0.954183 ,0.267108 ,-0.134865}; -static float N014[3] = {0.495127 ,0.855436 ,-0.151914}; -static float N015[3] = {-0.390199 ,0.906569 ,-0.160867}; -static float N016[3] = {-0.923605 ,0.354581 ,-0.145692}; -static float N017[3] = {-0.955796 ,-0.260667 ,-0.136036}; -static float N018[3] = {-0.501283 ,-0.853462 ,-0.142540}; -static float N019[3] = {0.405300 ,-0.901974 ,-0.148913}; -static float N020[3] = {0.909913 ,-0.392746 ,-0.133451}; -static float N021[3] = {0.936494 ,0.331147 ,-0.115414}; -static float N022[3] = {0.600131 ,0.793724 ,-0.099222}; -static float N023[3] = {-0.231556 ,0.968361 ,-0.093053}; -static float N024[3] = {-0.844369 ,0.525330 ,-0.105211}; -static float N025[3] = {-0.982725 ,-0.136329 ,-0.125164}; -static float N026[3] = {-0.560844 ,-0.822654 ,-0.093241}; -static float N027[3] = {0.263884 ,-0.959981 ,-0.093817}; -static float N028[3] = {0.842057 ,-0.525192 ,-0.122938}; -static float N029[3] = {0.921620 ,0.367565 ,-0.124546}; -static float N030[3] = {0.613927 ,0.784109 ,-0.090918}; -static float N031[3] = {-0.448754 ,0.888261 ,-0.098037}; -static float N032[3] = {-0.891865 ,0.434376 ,-0.126077}; -static float N033[3] = {-0.881447 ,-0.448017 ,-0.149437}; -static float N034[3] = {-0.345647 ,-0.922057 ,-0.174183}; -static float N035[3] = {0.307998 ,-0.941371 ,-0.137688}; -static float N036[3] = {0.806316 ,-0.574647 ,-0.140124}; -static float N037[3] = {0.961346 ,0.233646 ,-0.145681}; -static float N038[3] = {0.488451 ,0.865586 ,-0.110351}; -static float N039[3] = {-0.374290 ,0.921953 ,-0.099553}; -static float N040[3] = {-0.928504 ,0.344533 ,-0.138485}; -static float N041[3] = {-0.918419 ,-0.371792 ,-0.135189}; -static float N042[3] = {-0.520666 ,-0.833704 ,-0.183968}; -static float N043[3] = {0.339204 ,-0.920273 ,-0.195036}; -static float N044[3] = {0.921475 ,-0.387382 ,-0.028636}; -static float N045[3] = {0.842465 ,0.533335 ,-0.076204}; -static float N046[3] = {0.380110 ,0.924939 ,0.002073}; -static float N047[3] = {-0.276128 ,0.961073 ,-0.009579}; -static float N048[3] = {-0.879684 ,0.473001 ,-0.049250}; -static float N049[3] = {-0.947184 ,-0.317614 ,-0.044321}; -static float N050[3] = {-0.642059 ,-0.764933 ,-0.051363}; -static float N051[3] = {0.466794 ,-0.880921 ,-0.077990}; -static float N052[3] = {0.898509 ,-0.432277 ,0.076279}; -static float N053[3] = {0.938985 ,0.328141 ,0.103109}; -static float N054[3] = {0.442420 ,0.895745 ,0.043647}; -static float N055[3] = {-0.255163 ,0.966723 ,0.018407}; -static float N056[3] = {-0.833769 ,0.540650 ,0.111924}; -static float N057[3] = {-0.953653 ,-0.289939 ,0.080507}; -static float N058[3] = {-0.672357 ,-0.730524 ,0.119461}; -static float N059[3] = {0.522249 ,-0.846652 ,0.102157}; -static float N060[3] = {0.885868 ,-0.427631 ,0.179914}; -static float N062[3] = {0.648942 ,0.743116 ,0.163255}; -static float N063[3] = {-0.578967 ,0.807730 ,0.111219}; -static float N065[3] = {-0.909864 ,-0.352202 ,0.219321}; -static float N066[3] = {-0.502541 ,-0.818090 ,0.279610}; -static float N067[3] = {0.322919 ,-0.915358 ,0.240504}; -static float N068[3] = {0.242536 ,0.000000 ,-0.970143}; -static float N069[3] = {0.000000 ,1.000000 ,0.000000}; -static float N070[3] = {0.000000 ,1.000000 ,0.000000}; -static float N071[3] = {0.000000 ,1.000000 ,0.000000}; -static float N072[3] = {0.000000 ,1.000000 ,0.000000}; -static float N073[3] = {0.000000 ,1.000000 ,0.000000}; -static float N074[3] = {0.000000 ,1.000000 ,0.000000}; -static float N075[3] = {0.031220 ,0.999025 ,-0.031220}; -static float N076[3] = {0.000000 ,1.000000 ,0.000000}; -static float N077[3] = {0.446821 ,0.893642 ,0.041889}; -static float N078[3] = {0.863035 ,-0.100980 ,0.494949}; -static float N079[3] = {0.585597 ,-0.808215 ,0.062174}; -static float N080[3] = {0.000000 ,1.000000 ,0.000000}; -static float N081[3] = {1.000000 ,0.000000 ,0.000000}; -static float N082[3] = {0.000000 ,1.000000 ,0.000000}; -static float N083[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N084[3] = {-0.478893 ,0.837129 ,-0.264343}; -static float N085[3] = {0.000000 ,1.000000 ,0.000000}; -static float N086[3] = {0.763909 ,0.539455 ,-0.354163}; -static float N087[3] = {0.446821 ,0.893642 ,0.041889}; -static float N088[3] = {0.385134 ,-0.908288 ,0.163352}; -static float N089[3] = {-0.605952 ,0.779253 ,-0.159961}; -static float N090[3] = {0.000000 ,1.000000 ,0.000000}; -static float N091[3] = {0.000000 ,1.000000 ,0.000000}; -static float N092[3] = {0.000000 ,1.000000 ,0.000000}; -static float N093[3] = {0.000000 ,1.000000 ,0.000000}; -static float N094[3] = {1.000000 ,0.000000 ,0.000000}; -static float N095[3] = {-1.000000 ,0.000000 ,0.000000}; -static float N096[3] = {0.644444 ,-0.621516 ,0.445433}; -static float N097[3] = {-0.760896 ,-0.474416 ,0.442681}; -static float N098[3] = {0.636888 ,-0.464314 ,0.615456}; -static float N099[3] = {-0.710295 ,0.647038 ,0.277168}; -static float N100[3] = {0.009604 ,0.993655 ,0.112063}; -static float iP001[3] = {18.74, 13.19, 3.76}; -static float P001[3] = {18.74, 13.19, 3.76}; -static float P002[3] = {0.00, 390.42, 10292.57}; -static float P003[3] = {55.80, 622.31, 8254.35}; -static float P004[3] = {20.80, 247.66, 10652.13}; -static float P005[3] = {487.51, 198.05, 9350.78}; -static float P006[3] = {-457.61, 199.04, 9353.01}; -static float P008[3] = {-34.67, 247.64, 10663.71}; -static float iP009[3] = {97.46, 67.63, 593.82}; -static float iP010[3] = {-84.33, 67.63, 588.18}; -static float iP011[3] = {118.69, 8.98, -66.91}; -static float P009[3] = {97.46, 67.63, 593.82}; -static float P010[3] = {-84.33, 67.63, 588.18}; -static float P011[3] = {118.69, 8.98, -66.91}; -static float iP012[3] = {156.48, -31.95, 924.54}; -static float iP013[3] = {162.00, 110.22, 924.54}; -static float iP014[3] = {88.16, 221.65, 924.54}; -static float iP015[3] = {-65.21, 231.16, 924.54}; -static float iP016[3] = {-156.48, 121.97, 924.54}; -static float iP017[3] = {-162.00, -23.93, 924.54}; -static float iP018[3] = {-88.16, -139.10, 924.54}; -static float iP019[3] = {65.21, -148.61, 924.54}; -static float iP020[3] = {246.87, -98.73, 1783.04}; -static float iP021[3] = {253.17, 127.76, 1783.04}; -static float iP022[3] = {132.34, 270.77, 1783.04}; -static float iP023[3] = {-97.88, 285.04, 1783.04}; -static float iP024[3] = {-222.97, 139.80, 1783.04}; -static float iP025[3] = {-225.29, -86.68, 1783.04}; -static float iP026[3] = {-108.44, -224.15, 1783.04}; -static float iP027[3] = {97.88, -221.56, 1783.04}; -static float iP028[3] = {410.55, -200.66, 3213.87}; -static float iP029[3] = {432.19, 148.42, 3213.87}; -static float iP030[3] = {200.66, 410.55, 3213.87}; -static float iP031[3] = {-148.42, 432.19, 3213.87}; -static float iP032[3] = {-407.48, 171.88, 3213.87}; -static float iP033[3] = {-432.19, -148.42, 3213.87}; -static float iP034[3] = {-148.88, -309.74, 3213.87}; -static float iP035[3] = {156.38, -320.17, 3213.87}; -static float iP036[3] = {523.39, -303.81, 4424.57}; -static float iP037[3] = {574.66, 276.84, 4424.57}; -static float iP038[3] = {243.05, 492.50, 4424.57}; -static float iP039[3] = {-191.23, 520.13, 4424.57}; -static float iP040[3] = {-523.39, 304.01, 4424.57}; -static float iP041[3] = {-574.66, -231.83, 4424.57}; -static float iP042[3] = {-266.95, -578.17, 4424.57}; -static float iP043[3] = {211.14, -579.67, 4424.57}; -static float iP044[3] = {680.57, -370.27, 5943.46}; -static float iP045[3] = {834.01, 363.09, 5943.46}; -static float iP046[3] = {371.29, 614.13, 5943.46}; -static float iP047[3] = {-291.43, 621.86, 5943.46}; -static float iP048[3] = {-784.13, 362.60, 5943.46}; -static float iP049[3] = {-743.29, -325.82, 5943.46}; -static float iP050[3] = {-383.24, -804.77, 5943.46}; -static float iP051[3] = {283.47, -846.09, 5943.46}; -static float P012[3] = {156.48, -31.95, 924.54}; -static float P013[3] = {162.00, 110.22, 924.54}; -static float P014[3] = {88.16, 221.65, 924.54}; -static float P015[3] = {-65.21, 231.16, 924.54}; -static float P016[3] = {-156.48, 121.97, 924.54}; -static float P017[3] = {-162.00, -23.93, 924.54}; -static float P018[3] = {-88.16, -139.10, 924.54}; -static float P019[3] = {65.21, -148.61, 924.54}; -static float P020[3] = {246.87, -98.73, 1783.04}; -static float P021[3] = {253.17, 127.76, 1783.04}; -static float P022[3] = {132.34, 270.77, 1783.04}; -static float P023[3] = {-97.88, 285.04, 1783.04}; -static float P024[3] = {-222.97, 139.80, 1783.04}; -static float P025[3] = {-225.29, -86.68, 1783.04}; -static float P026[3] = {-108.44, -224.15, 1783.04}; -static float P027[3] = {97.88, -221.56, 1783.04}; -static float P028[3] = {410.55, -200.66, 3213.87}; -static float P029[3] = {432.19, 148.42, 3213.87}; -static float P030[3] = {200.66, 410.55, 3213.87}; -static float P031[3] = {-148.42, 432.19, 3213.87}; -static float P032[3] = {-407.48, 171.88, 3213.87}; -static float P033[3] = {-432.19, -148.42, 3213.87}; -static float P034[3] = {-148.88, -309.74, 3213.87}; -static float P035[3] = {156.38, -320.17, 3213.87}; -static float P036[3] = {523.39, -303.81, 4424.57}; -static float P037[3] = {574.66, 276.84, 4424.57}; -static float P038[3] = {243.05, 492.50, 4424.57}; -static float P039[3] = {-191.23, 520.13, 4424.57}; -static float P040[3] = {-523.39, 304.01, 4424.57}; -static float P041[3] = {-574.66, -231.83, 4424.57}; -static float P042[3] = {-266.95, -578.17, 4424.57}; -static float P043[3] = {211.14, -579.67, 4424.57}; -static float P044[3] = {680.57, -370.27, 5943.46}; -static float P045[3] = {834.01, 363.09, 5943.46}; -static float P046[3] = {371.29, 614.13, 5943.46}; -static float P047[3] = {-291.43, 621.86, 5943.46}; -static float P048[3] = {-784.13, 362.60, 5943.46}; -static float P049[3] = {-743.29, -325.82, 5943.46}; -static float P050[3] = {-383.24, -804.77, 5943.46}; -static float P051[3] = {283.47, -846.09, 5943.46}; -static float P052[3] = {599.09, -332.24, 7902.59}; -static float P053[3] = {735.48, 306.26, 7911.92}; -static float P054[3] = {321.55, 558.53, 7902.59}; -static float P055[3] = {-260.54, 559.84, 7902.59}; -static float P056[3] = {-698.66, 320.83, 7902.59}; -static float P057[3] = {-643.29, -299.16, 7902.59}; -static float P058[3] = {-341.47, -719.30, 7902.59}; -static float P059[3] = {252.57, -756.12, 7902.59}; -static float P060[3] = {458.39, -265.31, 9355.44}; -static float P062[3] = {224.04, 438.98, 9364.77}; -static float P063[3] = {-165.71, 441.27, 9355.44}; -static float P065[3] = {-473.99, -219.71, 9355.44}; -static float P066[3] = {-211.97, -479.87, 9355.44}; -static float P067[3] = {192.86, -504.03, 9355.44}; -static float iP068[3] = {-112.44, 9.25, -64.42}; -static float iP069[3] = {1155.63, 0.00, -182.46}; -static float iP070[3] = {-1143.13, 0.00, -181.54}; -static float iP071[3] = {1424.23, 0.00, -322.09}; -static float iP072[3] = {-1368.01, 0.00, -310.38}; -static float iP073[3] = {1255.57, 2.31, 114.05}; -static float iP074[3] = {-1149.38, 0.00, 117.12}; -static float iP075[3] = {718.36, 0.00, 433.36}; -static float iP076[3] = {-655.90, 0.00, 433.36}; -static float P068[3] = {-112.44, 9.25, -64.42}; -static float P069[3] = {1155.63, 0.00, -182.46}; -static float P070[3] = {-1143.13, 0.00, -181.54}; -static float P071[3] = {1424.23, 0.00, -322.09}; -static float P072[3] = {-1368.01, 0.00, -310.38}; -static float P073[3] = {1255.57, 2.31, 114.05}; -static float P074[3] = {-1149.38, 0.00, 117.12}; -static float P075[3] = {718.36, 0.00, 433.36}; -static float P076[3] = {-655.90, 0.00, 433.36}; -static float P077[3] = {1058.00, -2.66, 7923.51}; -static float P078[3] = {-1016.51, -15.47, 7902.87}; -static float P079[3] = {-1363.99, -484.50, 7593.38}; -static float P080[3] = {1478.09, -861.47, 7098.12}; -static float P081[3] = {1338.06, -284.68, 7024.15}; -static float P082[3] = {-1545.51, -860.64, 7106.60}; -static float P083[3] = {1063.19, -70.46, 7466.60}; -static float P084[3] = {-1369.18, -288.11, 7015.34}; -static float P085[3] = {1348.44, -482.50, 7591.41}; -static float P086[3] = {-1015.45, -96.80, 7474.86}; -static float P087[3] = {731.04, 148.38, 7682.58}; -static float P088[3] = {-697.03, 151.82, 7668.81}; -static float P089[3] = {-686.82, 157.09, 7922.29}; -static float P090[3] = {724.73, 147.75, 7931.39}; -static float iP091[3] = {0.00, 327.10, 2346.55}; -static float iP092[3] = {0.00, 552.28, 2311.31}; -static float iP093[3] = {0.00, 721.16, 2166.41}; -static float iP094[3] = {0.00, 693.42, 2388.80}; -static float iP095[3] = {0.00, 389.44, 2859.97}; -static float P091[3] = {0.00, 327.10, 2346.55}; -static float P092[3] = {0.00, 552.28, 2311.31}; -static float P093[3] = {0.00, 721.16, 2166.41}; -static float P094[3] = {0.00, 693.42, 2388.80}; -static float P095[3] = {0.00, 389.44, 2859.97}; -static float iP096[3] = {222.02, -183.67, 10266.89}; -static float iP097[3] = {-128.90, -182.70, 10266.89}; -static float iP098[3] = {41.04, 88.31, 10659.36}; -static float iP099[3] = {-48.73, 88.30, 10659.36}; -static float P096[3] = {222.02, -183.67, 10266.89}; -static float P097[3] = {-128.90, -182.70, 10266.89}; -static float P098[3] = {41.04, 88.31, 10659.36}; -static float P099[3] = {-48.73, 88.30, 10659.36}; -static float P100[3] = {0.00, 603.42, 9340.68}; -static float P104[3] = {-9.86, 567.62, 7858.65}; -static float P105[3] = {31.96, 565.27, 7908.46}; -static float P106[3] = {22.75, 568.13, 7782.83}; -static float P107[3] = {58.93, 568.42, 7775.94}; -static float P108[3] = {55.91, 565.59, 7905.86}; -static float P109[3] = {99.21, 566.00, 7858.65}; -static float P110[3] = {-498.83, 148.14, 9135.10}; -static float P111[3] = {-495.46, 133.24, 9158.48}; -static float P112[3] = {-490.82, 146.23, 9182.76}; -static float P113[3] = {-489.55, 174.11, 9183.66}; -static float P114[3] = {-492.92, 189.00, 9160.28}; -static float P115[3] = {-497.56, 176.02, 9136.00}; -static float P116[3] = {526.54, 169.68, 9137.70}; -static float P117[3] = {523.49, 184.85, 9161.42}; -static float P118[3] = {518.56, 171.78, 9186.06}; -static float P119[3] = {516.68, 143.53, 9186.98}; -static float P120[3] = {519.73, 128.36, 9163.26}; -static float P121[3] = {524.66, 141.43, 9138.62}; -/* *INDENT-ON* */ - -void -Whale001(void) -{ - - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N072); - glVertex3fv(P072); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N072); - glVertex3fv(P072); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N074); - glVertex3fv(P074); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N074); - glVertex3fv(P074); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N070); - glVertex3fv(P070); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N076); - glVertex3fv(P076); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N076); - glVertex3fv(P076); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N068); - glVertex3fv(P068); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N010); - glVertex3fv(P010); - glEnd(); -} - -void -Whale002(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N075); - glVertex3fv(P075); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N075); - glVertex3fv(P075); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N071); - glVertex3fv(P071); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N009); - glVertex3fv(P009); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N009); - glVertex3fv(P009); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N011); - glVertex3fv(P011); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N073); - glVertex3fv(P073); - glNormal3fv(N075); - glVertex3fv(P075); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N069); - glVertex3fv(P069); - glNormal3fv(N071); - glVertex3fv(P071); - glNormal3fv(N073); - glVertex3fv(P073); - glEnd(); -} - -void -Whale003(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N019); - glVertex3fv(P019); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N018); - glVertex3fv(P018); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N016); - glVertex3fv(P016); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N012); - glVertex3fv(P012); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N015); - glVertex3fv(P015); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N013); - glVertex3fv(P013); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N001); - glVertex3fv(P001); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N014); - glVertex3fv(P014); - glEnd(); -} - -void -Whale004(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N022); - glVertex3fv(P022); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N015); - glVertex3fv(P015); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N023); - glVertex3fv(P023); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N016); - glVertex3fv(P016); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N024); - glVertex3fv(P024); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N017); - glVertex3fv(P017); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N025); - glVertex3fv(P025); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N014); - glVertex3fv(P014); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N021); - glVertex3fv(P021); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N013); - glVertex3fv(P013); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N020); - glVertex3fv(P020); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N018); - glVertex3fv(P018); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N026); - glVertex3fv(P026); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N019); - glVertex3fv(P019); - glNormal3fv(N012); - glVertex3fv(P012); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N027); - glVertex3fv(P027); - glEnd(); -} - -void -Whale005(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N022); - glVertex3fv(P022); - glNormal3fv(N030); - glVertex3fv(P030); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N023); - glVertex3fv(P023); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N031); - glVertex3fv(P031); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N024); - glVertex3fv(P024); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N032); - glVertex3fv(P032); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N021); - glVertex3fv(P021); - glNormal3fv(N029); - glVertex3fv(P029); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N020); - glVertex3fv(P020); - glNormal3fv(N028); - glVertex3fv(P028); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N035); - glVertex3fv(P035); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N025); - glVertex3fv(P025); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N033); - glVertex3fv(P033); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N026); - glVertex3fv(P026); - glNormal3fv(N027); - glVertex3fv(P027); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N034); - glVertex3fv(P034); - glEnd(); -} - -void -Whale006(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N093); - glVertex3fv(P093); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N095); - glVertex3fv(P095); - glNormal3fv(N094); - glVertex3fv(P094); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N091); - glVertex3fv(P091); - glNormal3fv(N092); - glVertex3fv(P092); - glNormal3fv(N094); - glVertex3fv(P094); - glNormal3fv(N095); - glVertex3fv(P095); - glEnd(); -} - -void -Whale007(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N030); - glVertex3fv(P030); - glNormal3fv(N038); - glVertex3fv(P038); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N029); - glVertex3fv(P029); - glNormal3fv(N037); - glVertex3fv(P037); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N028); - glVertex3fv(P028); - glNormal3fv(N036); - glVertex3fv(P036); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N043); - glVertex3fv(P043); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N035); - glVertex3fv(P035); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N034); - glVertex3fv(P034); - glNormal3fv(N042); - glVertex3fv(P042); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N031); - glVertex3fv(P031); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N039); - glVertex3fv(P039); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N032); - glVertex3fv(P032); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N040); - glVertex3fv(P040); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N033); - glVertex3fv(P033); - glNormal3fv(N041); - glVertex3fv(P041); - glEnd(); -} - -void -Whale008(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N043); - glVertex3fv(P043); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N051); - glVertex3fv(P051); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N042); - glVertex3fv(P042); - glNormal3fv(N050); - glVertex3fv(P050); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N036); - glVertex3fv(P036); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N044); - glVertex3fv(P044); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N041); - glVertex3fv(P041); - glNormal3fv(N049); - glVertex3fv(P049); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N040); - glVertex3fv(P040); - glNormal3fv(N048); - glVertex3fv(P048); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N047); - glVertex3fv(P047); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N037); - glVertex3fv(P037); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N045); - glVertex3fv(P045); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N038); - glVertex3fv(P038); - glNormal3fv(N039); - glVertex3fv(P039); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N046); - glVertex3fv(P046); - glEnd(); -} - -void -Whale009(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N051); - glVertex3fv(P051); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N059); - glVertex3fv(P059); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N044); - glVertex3fv(P044); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N050); - glVertex3fv(P050); - glNormal3fv(N058); - glVertex3fv(P058); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N049); - glVertex3fv(P049); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N048); - glVertex3fv(P048); - glNormal3fv(N056); - glVertex3fv(P056); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N045); - glVertex3fv(P045); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N046); - glVertex3fv(P046); - glNormal3fv(N047); - glVertex3fv(P047); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); -} - -void -Whale010(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N080); - glVertex3fv(P080); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N081); - glVertex3fv(P081); - glNormal3fv(N085); - glVertex3fv(P085); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N085); - glVertex3fv(P085); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N083); - glVertex3fv(P083); - glNormal3fv(N077); - glVertex3fv(P077); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N087); - glVertex3fv(P087); - glNormal3fv(N077); - glVertex3fv(P077); - glNormal3fv(N090); - glVertex3fv(P090); - glEnd(); -} - -void -Whale011(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N079); - glVertex3fv(P079); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N088); - glVertex3fv(P088); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N089); - glVertex3fv(P089); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N089); - glVertex3fv(P089); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N086); - glVertex3fv(P086); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N078); - glVertex3fv(P078); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N078); - glVertex3fv(P078); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N084); - glVertex3fv(P084); - glNormal3fv(N082); - glVertex3fv(P082); - glNormal3fv(N079); - glVertex3fv(P079); - glEnd(); -} - -void -Whale012(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N066); - glVertex3fv(P066); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N052); - glVertex3fv(P052); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N059); - glVertex3fv(P059); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N067); - glVertex3fv(P067); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N058); - glVertex3fv(P058); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N057); - glVertex3fv(P057); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N057); - glVertex3fv(P057); - glNormal3fv(N065); - glVertex3fv(P065); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N006); - glVertex3fv(P006); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N056); - glVertex3fv(P056); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N055); - glVertex3fv(P055); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N053); - glVertex3fv(P053); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N060); - glVertex3fv(P060); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N053); - glVertex3fv(P053); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N052); - glVertex3fv(P052); - glEnd(); -} - -void -Whale013(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N098); - glVertex3fv(P098); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N066); - glVertex3fv(P066); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N067); - glVertex3fv(P067); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N096); - glVertex3fv(P096); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N060); - glVertex3fv(P060); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N096); - glVertex3fv(P096); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N096); - glVertex3fv(P096); - glNormal3fv(N005); - glVertex3fv(P005); - glNormal3fv(N098); - glVertex3fv(P098); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N065); - glVertex3fv(P065); - glNormal3fv(N097); - glVertex3fv(P097); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N097); - glVertex3fv(P097); - glNormal3fv(N099); - glVertex3fv(P099); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P005); - glVertex3fv(P006); - glVertex3fv(P099); - glVertex3fv(P098); - glEnd(); -} - -void -Whale014(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N004); - glVertex3fv(P004); - glNormal3fv(N005); - glVertex3fv(P005); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P006); - glVertex3fv(P005); - glVertex3fv(P004); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N006); - glVertex3fv(P006); - glNormal3fv(N008); - glVertex3fv(P008); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N008); - glVertex3fv(P008); - glNormal3fv(N004); - glVertex3fv(P004); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N062); - glVertex3fv(P062); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N004); - glVertex3fv(P004); - glEnd(); -} - -void -Whale015(void) -{ - glBegin(GL_POLYGON); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N055); - glVertex3fv(P055); - glNormal3fv(N063); - glVertex3fv(P063); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N100); - glVertex3fv(P100); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N003); - glVertex3fv(P003); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N054); - glVertex3fv(P054); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N054); - glVertex3fv(P054); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N063); - glVertex3fv(P063); - glNormal3fv(N002); - glVertex3fv(P002); - glEnd(); - glBegin(GL_POLYGON); - glNormal3fv(N100); - glVertex3fv(P100); - glNormal3fv(N002); - glVertex3fv(P002); - glNormal3fv(N062); - glVertex3fv(P062); - glEnd(); -} - -void -Whale016(void) -{ - glBegin(GL_POLYGON); - glVertex3fv(P104); - glVertex3fv(P105); - glVertex3fv(P106); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P107); - glVertex3fv(P108); - glVertex3fv(P109); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P110); - glVertex3fv(P111); - glVertex3fv(P112); - glVertex3fv(P113); - glVertex3fv(P114); - glVertex3fv(P115); - glEnd(); - glBegin(GL_POLYGON); - glVertex3fv(P116); - glVertex3fv(P117); - glVertex3fv(P118); - glVertex3fv(P119); - glVertex3fv(P120); - glVertex3fv(P121); - glEnd(); -} - -void -DrawWhale(fishRec * fish) -{ - float seg0, seg1, seg2, seg3, seg4, seg5, seg6, seg7; - float pitch, thrash, chomp; - - fish->htail = (int) (fish->htail - (int) (5.0 * fish->v)) % 360; - - thrash = 70.0 * fish->v; - - seg0 = 1.5 * thrash * sin((fish->htail) * RRAD); - seg1 = 2.5 * thrash * sin((fish->htail + 10.0) * RRAD); - seg2 = 3.7 * thrash * sin((fish->htail + 15.0) * RRAD); - seg3 = 4.8 * thrash * sin((fish->htail + 23.0) * RRAD); - seg4 = 6.0 * thrash * sin((fish->htail + 28.0) * RRAD); - seg5 = 6.5 * thrash * sin((fish->htail + 35.0) * RRAD); - seg6 = 6.5 * thrash * sin((fish->htail + 40.0) * RRAD); - seg7 = 6.5 * thrash * sin((fish->htail + 55.0) * RRAD); - - pitch = fish->v * sin((fish->htail - 160.0) * RRAD); - - chomp = 0.0; - if (fish->v > 2.0) { - chomp = -(fish->v - 2.0) * 200.0; - } - P012[1] = iP012[1] + seg5; - P013[1] = iP013[1] + seg5; - P014[1] = iP014[1] + seg5; - P015[1] = iP015[1] + seg5; - P016[1] = iP016[1] + seg5; - P017[1] = iP017[1] + seg5; - P018[1] = iP018[1] + seg5; - P019[1] = iP019[1] + seg5; - - P020[1] = iP020[1] + seg4; - P021[1] = iP021[1] + seg4; - P022[1] = iP022[1] + seg4; - P023[1] = iP023[1] + seg4; - P024[1] = iP024[1] + seg4; - P025[1] = iP025[1] + seg4; - P026[1] = iP026[1] + seg4; - P027[1] = iP027[1] + seg4; - - P028[1] = iP028[1] + seg2; - P029[1] = iP029[1] + seg2; - P030[1] = iP030[1] + seg2; - P031[1] = iP031[1] + seg2; - P032[1] = iP032[1] + seg2; - P033[1] = iP033[1] + seg2; - P034[1] = iP034[1] + seg2; - P035[1] = iP035[1] + seg2; - - P036[1] = iP036[1] + seg1; - P037[1] = iP037[1] + seg1; - P038[1] = iP038[1] + seg1; - P039[1] = iP039[1] + seg1; - P040[1] = iP040[1] + seg1; - P041[1] = iP041[1] + seg1; - P042[1] = iP042[1] + seg1; - P043[1] = iP043[1] + seg1; - - P044[1] = iP044[1] + seg0; - P045[1] = iP045[1] + seg0; - P046[1] = iP046[1] + seg0; - P047[1] = iP047[1] + seg0; - P048[1] = iP048[1] + seg0; - P049[1] = iP049[1] + seg0; - P050[1] = iP050[1] + seg0; - P051[1] = iP051[1] + seg0; - - P009[1] = iP009[1] + seg6; - P010[1] = iP010[1] + seg6; - P075[1] = iP075[1] + seg6; - P076[1] = iP076[1] + seg6; - - P001[1] = iP001[1] + seg7; - P011[1] = iP011[1] + seg7; - P068[1] = iP068[1] + seg7; - P069[1] = iP069[1] + seg7; - P070[1] = iP070[1] + seg7; - P071[1] = iP071[1] + seg7; - P072[1] = iP072[1] + seg7; - P073[1] = iP073[1] + seg7; - P074[1] = iP074[1] + seg7; - - P091[1] = iP091[1] + seg3 * 1.1; - P092[1] = iP092[1] + seg3; - P093[1] = iP093[1] + seg3; - P094[1] = iP094[1] + seg3; - P095[1] = iP095[1] + seg3 * 0.9; - - P099[1] = iP099[1] + chomp; - P098[1] = iP098[1] + chomp; - P097[1] = iP097[1] + chomp; - P096[1] = iP096[1] + chomp; - - glPushMatrix(); - - glRotatef(pitch, 1.0, 0.0, 0.0); - - glTranslatef(0.0, 0.0, 8000.0); - - glRotatef(180.0, 0.0, 1.0, 0.0); - - glScalef(3.0, 3.0, 3.0); - - glEnable(GL_CULL_FACE); - - Whale001(); - Whale002(); - Whale003(); - Whale004(); - Whale005(); - Whale006(); - Whale007(); - Whale008(); - Whale009(); - Whale010(); - Whale011(); - Whale012(); - Whale013(); - Whale014(); - Whale015(); - Whale016(); - - glDisable(GL_CULL_FACE); - - glPopMatrix(); -} diff --git a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/main.c b/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/main.c deleted file mode 100644 index b7794b3b6f..0000000000 --- a/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/main.c +++ /dev/null @@ -1,179 +0,0 @@ - -/* Simple program: Create a blank window, wait for keypress, quit. - - Please see the SDL documentation for details on using the SDL API: - /Developer/Documentation/SDL/docs.html -*/ - -#include -#include -#include -#include - -#include "SDL.h" - -extern void Atlantis_Init (); -extern void Atlantis_Reshape (int w, int h); -extern void Atlantis_Animate (); -extern void Atlantis_Display (); - -static SDL_Surface *gScreen; - -static void initAttributes () -{ - // Setup attributes we want for the OpenGL context - - int value; - - // Don't set color bit sizes (SDL_GL_RED_SIZE, etc) - // Mac OS X will always use 8-8-8-8 ARGB for 32-bit screens and - // 5-5-5 RGB for 16-bit screens - - // Request a 16-bit depth buffer (without this, there is no depth buffer) - value = 16; - SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, value); - - - // Request double-buffered OpenGL - // The fact that windows are double-buffered on Mac OS X has no effect - // on OpenGL double buffering. - value = 1; - SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, value); -} - -static void printAttributes () -{ - // Print out attributes of the context we created - int nAttr; - int i; - - int attr[] = { SDL_GL_RED_SIZE, SDL_GL_BLUE_SIZE, SDL_GL_GREEN_SIZE, - SDL_GL_ALPHA_SIZE, SDL_GL_BUFFER_SIZE, SDL_GL_DEPTH_SIZE }; - - char *desc[] = { "Red size: %d bits\n", "Blue size: %d bits\n", "Green size: %d bits\n", - "Alpha size: %d bits\n", "Color buffer size: %d bits\n", - "Depth bufer size: %d bits\n" }; - - nAttr = sizeof(attr) / sizeof(int); - - for (i = 0; i < nAttr; i++) { - - int value; - SDL_GL_GetAttribute (attr[i], &value); - printf (desc[i], value); - } -} - -static void createSurface (int fullscreen) -{ - Uint32 flags = 0; - - flags = SDL_OPENGL; - if (fullscreen) - flags |= SDL_FULLSCREEN; - - // Create window - gScreen = SDL_SetVideoMode (640, 480, 0, flags); - if (gScreen == NULL) { - - fprintf (stderr, "Couldn't set 640x480 OpenGL video mode: %s\n", - SDL_GetError()); - SDL_Quit(); - exit(2); - } -} - -static void initGL () -{ - Atlantis_Init (); - Atlantis_Reshape (gScreen->w, gScreen->h); -} - -static void drawGL () -{ - Atlantis_Animate (); - Atlantis_Display (); -} - -static void mainLoop () -{ - SDL_Event event; - int done = 0; - int fps = 24; - int delay = 1000/fps; - int thenTicks = -1; - int nowTicks; - - while ( !done ) { - - /* Check for events */ - while ( SDL_PollEvent (&event) ) { - switch (event.type) { - - case SDL_MOUSEMOTION: - break; - case SDL_MOUSEBUTTONDOWN: - break; - case SDL_KEYDOWN: - /* Any keypress quits the app... */ - case SDL_QUIT: - done = 1; - break; - default: - break; - } - } - - // Draw at 24 hz - // This approach is not normally recommended - it is better to - // use time-based animation and run as fast as possible - drawGL (); - SDL_GL_SwapBuffers (); - - // Time how long each draw-swap-delay cycle takes - // and adjust delay to get closer to target framerate - if (thenTicks > 0) { - nowTicks = SDL_GetTicks (); - delay += (1000/fps - (nowTicks-thenTicks)); - thenTicks = nowTicks; - if (delay < 0) - delay = 1000/fps; - } - else { - thenTicks = SDL_GetTicks (); - } - - SDL_Delay (delay); - } -} - -int main(int argc, char *argv[]) -{ - // Init SDL video subsystem - if ( SDL_Init (SDL_INIT_VIDEO) < 0 ) { - - fprintf(stderr, "Couldn't initialize SDL: %s\n", - SDL_GetError()); - exit(1); - } - - // Set GL context attributes - initAttributes (); - - // Create GL context - createSurface (0); - - // Get GL context attributes - printAttributes (); - - // Init GL state - initGL (); - - // Draw, get events... - mainLoop (); - - // Cleanup - SDL_Quit(); - - return 0; -} diff --git a/Xcode/XcodeDocSet/Doxyfile b/Xcode/XcodeDocSet/Doxyfile index 34e12280e1..961ac98ef4 100644 --- a/Xcode/XcodeDocSet/Doxyfile +++ b/Xcode/XcodeDocSet/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = SDL # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.2.14 +PROJECT_NUMBER = 1.3.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/Xcode/mkxcode.csh b/Xcode/mkxcode.csh deleted file mode 100755 index caf6481cb5..0000000000 --- a/Xcode/mkxcode.csh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/csh - -### -## This script creates "Xcode.tar.gz" in the parent directory -### - -# remove build products -rm -rf SDL/build -rm -rf SDLTest/build - -# remove Finder info files -find . -name ".DS_Store" -exec rm "{}" ";" - -# remove user project prefs -find . -name "*.pbxuser*" -exec rm "{}" ";" -find . -name "*.mode*" -exec rm "{}" ";" -find . -name "*.perspective*" -exec rm "{}" ";" - -# create the archive -(cd .. && gnutar -zcvf Xcode.tar.gz Xcode) diff --git a/Xcode/package b/Xcode/package deleted file mode 100755 index 6e6b5707c2..0000000000 --- a/Xcode/package +++ /dev/null @@ -1,272 +0,0 @@ -#! /bin/csh -ef - -set prog = `/usr/bin/basename $0` -set usage = "Usage: $prog [-f] root-dir info-file [tiff-file] [-d dest-dir] [-r resource-dir] [-traditional | -gnutar]" -set noglob - -if (-x /usr/bin/mkbom) then - set mkbom=/usr/bin/mkbom - set lsbom=/usr/bin/lsbom -else - set mkbom=/usr/etc/mkbom - set lsbom=/usr/etc/lsbom -endif - -if (-x /usr/bin/awk) then - set awk=/usr/bin/awk -else - set awk=/bin/awk -endif - -set gnutar=/usr/bin/gnutar -set tar=/usr/bin/tar -set pax=/bin/pax - -# gather parameters -if ($#argv == 0) then - echo $usage - exit(1) -endif - -while ( $#argv > 0 ) - switch ( $argv[1] ) - case -d: - if ( $?destDir ) then - echo ${prog}: dest-dir parameter already set to ${destDir}. - echo $usage - exit(1) - else if ( $#argv < 2 ) then - echo ${prog}: -d option requires destination directory. - echo $usage - exit(1) - else - set destDir = $argv[2] - shift; shift - breaksw - endif - case -f: - if ( $?rootDir ) then - echo ${prog}: root-dir parameter already set to ${rootDir}. - echo $usage - exit(1) - else if ( $#argv < 2 ) then - echo ${prog}: -f option requires package root directory. - echo $usage - exit(1) - else - set rootDir = $argv[2] - set fflag - shift; shift - breaksw - endif - case -r: - if ( $?resDir ) then - echo ${prog}: resource-dir parameter already set to ${resDir}. - echo $usage - exit(1) - else if ( $#argv < 2 ) then - echo ${prog}: -r option requires package resource directory. - echo $usage - exit(1) - else - set resDir = $argv[2] - shift; shift - breaksw - endif - case -traditional: - set usetar - unset usegnutar - unset usepax - breaksw - case -gnutar: - set usegnutar - unset usepax - unset usetar - case -B: - # We got long file names, better use bigtar instead - #set archiver = /NextAdmin/Installer.app/Resources/installer_bigtar - echo 2>&1 ${prog}: -B flag is no longer relevant. - shift - breaksw - case -*: - echo ${prog}: Unknown option: $argv[1] - echo $usage - exit(1) - case *.info: - if ( $?info ) then - echo ${prog}: info-file parameter already set to ${info}. - echo $usage - exit(1) - else - set info = "$argv[1]" - shift - breaksw - endif - case *.tiff: - if ( $?tiff ) then - echo ${prog}: tiff-file parameter already set to ${tiff}. - echo $usage - exit(1) - else - set tiff = "$argv[1]" - shift - breaksw - endif - default: - if ( $?rootDir ) then - echo ${prog}: unrecognized parameter: $argv[1] - echo $usage - exit(1) - else - set rootDir = "$argv[1]" - shift - breaksw - endif - endsw -end - -# check for mandatory parameters -if ( ! $?rootDir ) then - echo ${prog}: missing root-dir parameter. - echo $usage - exit(1) -else if ( ! $?info) then - echo ${prog}: missing info-file parameter. - echo $usage - exit(1) -endif - -# destDir gets default value if unset on command line -if ( $?destDir ) then - /bin/mkdir -p $destDir -else - set destDir = . -endif - -# derive the root name for the package from the root name of the info file -set root = `/usr/bin/basename $info .info` - -# create package directory -set pkg = ${destDir}/${root}.pkg -echo Generating Installer package $pkg ... -if ( -e $pkg ) /bin/rm -rf $pkg -/bin/mkdir -p -m 755 $pkg - -# (gnu)tar/pax and compress root directory to package archive -echo -n " creating package archive ... " -if ( $?fflag ) then - set pkgTop = ${rootDir:t} - set parent = ${rootDir:h} - if ( "$parent" == "$pkgTop" ) set parent = "." -else - set parent = $rootDir - set pkgTop = . -endif -if ( $?usetar ) then - set pkgArchive = $pkg/$root.tar.Z - (cd $parent; $tar -w $pkgTop) | /usr/bin/compress -f -c > $pkgArchive -else if ( $?usegnutar ) then - set pkgArchive = $pkg/$root.tar.gz - (cd $parent; $gnutar zcf $pkgArchive $pkgTop) -else - set pkgArchive = $pkg/$root.pax.gz - (cd $parent; $pax -w -z -x cpio $pkgTop) > $pkgArchive -endif -/bin/chmod 444 $pkgArchive -echo done. - -# copy info file to package -set pkgInfo = $pkg/$root.info -echo -n " copying ${info:t} ... " -/bin/cp $info $pkgInfo -/bin/chmod 444 $pkgInfo -echo done. - -# copy tiff file to package -if ( $?tiff ) then - set pkgTiff = $pkg/$root.tiff - echo -n " copying ${tiff:t} ... " - /bin/cp $tiff $pkgTiff - /bin/chmod 444 $pkgTiff - echo done. -endif - -# copy resources to package -if ( $?resDir ) then - echo -n " copying ${resDir:t} ... " - - # don't want to see push/pop output - pushd $resDir > /dev/null - # get lists of resources. We'll want to change - # permissions on just these things later. - set directoriesInResDir = `find . -type d` - set filesInResDir = `find . -type f` - popd > /dev/null - - # copy the resource directory contents into the package directory - foreach resFile (`ls $resDir`) - cp -r $resDir/$resFile $pkg - end - - pushd $pkg > /dev/null - # Change all directories to +r+x, except the package - # directory itself - foreach resFileItem ($directoriesInResDir) - if ( $resFileItem != "." ) then - chmod 555 $resFileItem - endif - end - # change all flat files to read only - foreach resFileItem ($filesInResDir) - chmod 444 $resFileItem - end - popd > /dev/null - - echo done. -endif - -# generate bom file -set pkgBom = $pkg/$root.bom -echo -n " generating bom file ... " -/bin/rm -f $pkgBom -if ( $?fflag ) then - $mkbom $parent $pkgBom >& /dev/null -else - $mkbom $rootDir $pkgBom >& /dev/null -endif -/bin/chmod 444 $pkgArchive -echo done. - -# generate sizes file -set pkgSizes = $pkg/$root.sizes -echo -n " generating sizes file ... " - -# compute number of files in package -set numFiles = `$lsbom -s $pkgBom | /usr/bin/wc -l` - -# compute package size when compressed -@ compressedSize = `/usr/bin/du -k -s $pkg | $awk '{print $1}'` -@ compressedSize += 3 # add 1KB each for sizes, location, status files - -@ infoSize = `/bin/ls -s $pkgInfo | $awk '{print $1}'` -@ bomSize = `/bin/ls -s $pkgBom | $awk '{print $1}'` -if ( $?tiff ) then - @ tiffSize = `/bin/ls -s $pkgTiff | $awk '{print $1}'` -else - @ tiffSize = 0 -endif - -@ installedSize = `/usr/bin/du -k -s $rootDir | $awk '{print $1}'` -@ installedSize += $infoSize + $bomSize + $tiffSize + 3 - -# echo size parameters to sizes file -echo NumFiles $numFiles > $pkgSizes -echo InstalledSize $installedSize >> $pkgSizes -echo CompressedSize $compressedSize >> $pkgSizes -echo done. -echo " ... finished generating $pkg." - -exit(0) - -# end package - diff --git a/Xcode/stationary.csh b/Xcode/stationary.csh deleted file mode 100755 index ba5a385518..0000000000 --- a/Xcode/stationary.csh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/csh - -### -## This script installs the stationary -### - -sudo -v -p "Please enter the administrator password: " - -# project templates -sudo /Developer/Tools/CpMac -r "Project Stationary/SDL Application" "/Developer/ProjectBuilder Extras/Project Templates/Application/" - -sudo /Developer/Tools/CpMac -r "Project Stationary/SDL Cocoa Application" "/Developer/ProjectBuilder Extras/Project Templates/Application/" - -sudo /Developer/Tools/CpMac -r "Project Stationary/SDL Custom Cocoa Application" "/Developer/ProjectBuilder Extras/Project Templates/Application/" - -sudo /Developer/Tools/CpMac -r "Project Stationary/SDL OpenGL Application" "/Developer/ProjectBuilder Extras/Project Templates/Application/" - - -# target templates -sudo mkdir -p "/Developer/ProjectBuilder Extras/Target Templates/SDL" - -sudo /Developer/Tools/CpMac -r "Project Stationary/Application.trgttmpl" "/Developer/ProjectBuilder Extras/Target Templates/SDL" - - - diff --git a/Xcode/uninstall.csh b/Xcode/uninstall.csh deleted file mode 100755 index aab8d790f1..0000000000 --- a/Xcode/uninstall.csh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/csh - -### -## This script removes the Developer SDL package -### - -setenv HOME_DIR ~ - -sudo -v -p "Enter administrator password to remove SDL: " - -sudo rm -rf "$HOME_DIR/Library/Frameworks/SDL.framework" - -# will only remove the Frameworks dir if empty (since we put it there) -sudo rmdir "$HOME_DIR/Library/Frameworks" - -sudo rm -r "$HOME_DIR/Readme SDL Developer.txt" -sudo rm -r "/Developer/Documentation/SDL" -sudo rm -r "/Developer/Documentation/ManPages/man3/SDL"* -sudo rm -r "/Developer/ProjectBuilder Extras/Project Templates/Application/SDL Application" -sudo rm -r "/Developer/ProjectBuilder Extras/Project Templates/Application/SDL Cocoa Application" -sudo rm -r "/Developer/ProjectBuilder Extras/Project Templates/Application/SDL Custom Cocoa Application" -sudo rm -r "/Developer/ProjectBuilder Extras/Project Templates/Application/SDL OpenGL Application" -sudo rm -r "/Developer/ProjectBuilder Extras/Target Templates/SDL" -sudo rm -r "/Library/Receipts/SDL-devel.pkg" - -# rebuild apropos database -sudo /usr/libexec/makewhatis - -unsetenv HOME_DIR - - - diff --git a/acinclude/ac_check_define.m4 b/acinclude/ac_check_define.m4 new file mode 100644 index 0000000000..64de801f10 --- /dev/null +++ b/acinclude/ac_check_define.m4 @@ -0,0 +1,14 @@ +AC_DEFUN([AC_CHECK_DEFINE],[dnl + AC_CACHE_CHECK(for $1 in $2, ac_cv_define_$1, + AC_EGREP_CPP([YES_IS_DEFINED], [ +#include <$2> +#ifdef $1 +YES_IS_DEFINED +#endif + ], ac_cv_define_$1=yes, ac_cv_define_$1=no) + ) + if test "$ac_cv_define_$1" = "yes" ; then + AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE]) + fi +])dnl +AC_DEFINE([HAVE_$1],[],[Added by AC_CHECK_DEFINE]) diff --git a/acinclude/ax_check_compiler_flags.m4 b/acinclude/ax_check_compiler_flags.m4 new file mode 100644 index 0000000000..35bfd2a5a2 --- /dev/null +++ b/acinclude/ax_check_compiler_flags.m4 @@ -0,0 +1,76 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_compiler_flags.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# Check whether the given compiler FLAGS work with the current language's +# compiler, or whether they give an error. (Warnings, however, are +# ignored.) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# LICENSE +# +# Copyright (c) 2009 Steven G. Johnson +# Copyright (c) 2009 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 9 + +AC_DEFUN([AX_CHECK_COMPILER_FLAGS], +[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX +AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1]) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF([$1], + [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [ + ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])], + [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS]) +eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]) +AC_MSG_RESULT($ax_check_compiler_flags) +if test "x$ax_check_compiler_flags" = xyes; then + m4_default([$2], :) +else + m4_default([$3], :) +fi +])dnl AX_CHECK_COMPILER_FLAGS diff --git a/acinclude/ax_gcc_archflag.m4 b/acinclude/ax_gcc_archflag.m4 new file mode 100644 index 0000000000..d37a9134c2 --- /dev/null +++ b/acinclude/ax_gcc_archflag.m4 @@ -0,0 +1,215 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# This macro tries to guess the "native" arch corresponding to the target +# architecture for use with gcc's -march=arch or -mtune=arch flags. If +# found, the cache variable $ax_cv_gcc_archflag is set to this flag and +# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to +# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is +# to add $ax_cv_gcc_archflag to the end of $CFLAGS. +# +# PORTABLE? should be either [yes] (default) or [no]. In the former case, +# the flag is set to -mtune (or equivalent) so that the architecture is +# only used for tuning, but the instruction set used is still portable. In +# the latter case, the flag is set to -march (or equivalent) so that +# architecture-specific instructions are enabled. +# +# The user can specify --with-gcc-arch= in order to override the +# macro's choice of architecture, or --without-gcc-arch to disable this. +# +# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is +# called unless the user specified --with-gcc-arch manually. +# +# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID +# +# (The main emphasis here is on recent CPUs, on the principle that doing +# high-performance computing on old hardware is uncommon.) +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AC_DEFUN([AX_GCC_ARCHFLAG], +[AC_REQUIRE([AC_PROG_CC]) +AC_REQUIRE([AC_CANONICAL_HOST]) + +AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=], [use architecture for gcc -march/-mtune, instead of guessing])], + ax_gcc_arch=$withval, ax_gcc_arch=yes) + +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT([]) +AC_CACHE_VAL(ax_cv_gcc_archflag, +[ +ax_cv_gcc_archflag="unknown" + +if test "$GCC" = yes; then + +if test "x$ax_gcc_arch" = xyes; then +ax_gcc_arch="" +if test "$cross_compiling" = no; then +case $host_cpu in + i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones + AX_GCC_X86_CPUID(0) + AX_GCC_X86_CPUID(1) + case $ax_cv_gcc_x86_cpuid_0 in + *:756e6547:*:*) # Intel + case $ax_cv_gcc_x86_cpuid_1 in + *5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;; + *5??:*:*:*) ax_gcc_arch=pentium ;; + *6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;; + *6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;; + *6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;; + *6??:*:*:*) ax_gcc_arch=pentiumpro ;; + *f3[[347]]:*:*:*|*f4[1347]:*:*:*) + case $host_cpu in + x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;; + *) ax_gcc_arch="prescott pentium4 pentiumpro" ;; + esac ;; + *f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";; + esac ;; + *:68747541:*:*) # AMD + case $ax_cv_gcc_x86_cpuid_1 in + *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;; + *5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;; + *5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;; + *60?:*:*:*) ax_gcc_arch=k7 ;; + *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;; + *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;; + *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;; + *6[[68a]]?:*:*:*) + AX_GCC_X86_CPUID(0x80000006) # L2 cache size + case $ax_cv_gcc_x86_cpuid_0x80000006 in + *:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256 + ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;; + *) ax_gcc_arch="athlon-4 athlon k7" ;; + esac ;; + *f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;; + *f5?:*:*:*) ax_gcc_arch="opteron k8" ;; + *f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;; + *f??:*:*:*) ax_gcc_arch="k8" ;; + esac ;; + *:746e6543:*:*) # IDT + case $ax_cv_gcc_x86_cpuid_1 in + *54?:*:*:*) ax_gcc_arch=winchip-c6 ;; + *58?:*:*:*) ax_gcc_arch=winchip2 ;; + *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;; + *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;; + esac ;; + esac + if test x"$ax_gcc_arch" = x; then # fallback + case $host_cpu in + i586*) ax_gcc_arch=pentium ;; + i686*) ax_gcc_arch=pentiumpro ;; + esac + fi + ;; + + sparc*) + AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) + cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` + cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` + case $cputype in + *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; + *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; + *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;; + *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;; + *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;; + *cypress*) ax_gcc_arch=cypress ;; + esac ;; + + alphaev5) ax_gcc_arch=ev5 ;; + alphaev56) ax_gcc_arch=ev56 ;; + alphapca56) ax_gcc_arch="pca56 ev56" ;; + alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;; + alphaev6) ax_gcc_arch=ev6 ;; + alphaev67) ax_gcc_arch=ev67 ;; + alphaev68) ax_gcc_arch="ev68 ev67" ;; + alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;; + alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;; + alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;; + + powerpc*) + cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null` + cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'` + case $cputype in + *750*) ax_gcc_arch="750 G3" ;; + *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;; + *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;; + *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;; + *970*) ax_gcc_arch="970 G5 power4";; + *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; + *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; + 603ev|8240) ax_gcc_arch="$cputype 603e 603";; + *) ax_gcc_arch=$cputype ;; + esac + ax_gcc_arch="$ax_gcc_arch powerpc" + ;; +esac +fi # not cross-compiling +fi # guess arch + +if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then +for arch in $ax_gcc_arch; do + if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code + flags="-mtune=$arch" + # -mcpu=$arch and m$arch generate nonportable code on every arch except + # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr. + case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac + else + flags="-march=$arch -mcpu=$arch -m$arch" + fi + for flag in $flags; do + AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break]) + done + test "x$ax_cv_gcc_archflag" = xunknown || break +done +fi + +fi # $GCC=yes +]) +AC_MSG_CHECKING([for gcc architecture flag]) +AC_MSG_RESULT($ax_cv_gcc_archflag) +if test "x$ax_cv_gcc_archflag" = xunknown; then + m4_default([$3],:) +else + m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"]) +fi +]) diff --git a/acinclude/ax_gcc_x86_cpuid.m4.htm b/acinclude/ax_gcc_x86_cpuid.m4.htm new file mode 100644 index 0000000000..7d46fee021 --- /dev/null +++ b/acinclude/ax_gcc_x86_cpuid.m4.htm @@ -0,0 +1,79 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_X86_CPUID(OP) +# +# DESCRIPTION +# +# On Pentium and later x86 processors, with gcc or a compiler that has a +# compatible syntax for inline assembly instructions, run a small program +# that executes the cpuid instruction with input OP. This can be used to +# detect the CPU type. +# +# On output, the values of the eax, ebx, ecx, and edx registers are stored +# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable +# ax_cv_gcc_x86_cpuid_OP. +# +# If the cpuid instruction fails (because you are running a +# cross-compiler, or because you are not using gcc, or because you are on +# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP +# is set to the string "unknown". +# +# This macro mainly exists to be used in AX_GCC_ARCHFLAG. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2008 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 7 + +AC_DEFUN([AX_GCC_X86_CPUID], +[AC_REQUIRE([AC_PROG_CC]) +AC_LANG_PUSH([C]) +AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1, + [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include ], [ + int op = $1, eax, ebx, ecx, edx; + FILE *f; + __asm__("cpuid" + : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) + : "a" (op)); + f = fopen("conftest_cpuid", "w"); if (!f) return 1; + fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx); + fclose(f); + return 0; +])], + [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid], + [ax_cv_gcc_x86_cpuid_$1=unknown])]) +AC_LANG_POP([C]) +]) diff --git a/acinclude/libtool.m4 b/acinclude/libtool.m4 index b64223e2ed..c444a5ed05 100644 --- a/acinclude/libtool.m4 +++ b/acinclude/libtool.m4 @@ -1,9 +1,10 @@ ############################################################################## -# Based on libtool-2.2.6a +# Based on libtool-2.4.2 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -12,7 +13,8 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008 Free Software Foundation, Inc. +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -39,7 +41,7 @@ m4_define([_LT_COPYING], [dnl # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 56 LT_INIT +# serial 57 LT_INIT # LT_PREREQ(VERSION) @@ -68,6 +70,7 @@ esac # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -84,6 +87,8 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -120,7 +125,7 @@ m4_defun([_LT_CC_BASENAME], *) break;; esac done -cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) @@ -140,6 +145,11 @@ m4_defun([_LT_FILEUTILS_DEFAULTS], m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -162,10 +172,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -181,7 +194,6 @@ fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl -_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -195,23 +207,6 @@ aix3*) ;; esac -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - # Global variables: ofile=libtool can_build_shared=yes @@ -252,6 +247,28 @@ _LT_CONFIG_COMMANDS ])# _LT_SETUP +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -410,7 +427,7 @@ m4_define([_lt_decl_all_varnames], # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -420,7 +437,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE], # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -519,12 +536,20 @@ LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -535,9 +560,9 @@ done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -545,16 +570,38 @@ for var in lt_decl_all_varnames([[ \ esac done -# Fix-up fallback echo if it was mangled by the above quoting rules. -case \$lt_ECHO in -*'\\\[$]0 --fallback-echo"')dnl " - lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` - ;; -esac - _LT_OUTPUT_LIBTOOL_INIT ]) +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -564,20 +611,11 @@ _LT_OUTPUT_LIBTOOL_INIT AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -cat >"$CONFIG_LT" <<_LTEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. - -lt_cl_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_LTEOF +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF -AS_SHELL_SANITIZE -_AS_PREPARE - -exec AS_MESSAGE_FD>&1 +lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -603,7 +641,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -648,15 +686,13 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -if test "$no_create" != yes; then - lt_cl_success=: - test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" - exec AS_MESSAGE_LOG_FD>/dev/null - $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false - exec AS_MESSAGE_LOG_FD>>config.log - $lt_cl_success || AS_EXIT(1) -fi +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT @@ -719,15 +755,12 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_XSI_SHELLFNS + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + _LT_PROG_REPLACE_SHELLFNS - mv -f "$cfgfile" "$ofile" || + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -772,6 +805,7 @@ AC_DEFUN([LT_LANG], m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], @@ -793,6 +827,31 @@ m4_defun([_LT_LANG], ])# _LT_LANG +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], @@ -823,6 +882,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ], m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) @@ -833,11 +896,13 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -923,7 +988,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? - if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD @@ -931,6 +1002,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ rm -rf libconftest.dylib* rm -f conftest.* fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -942,6 +1014,34 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -969,7 +1069,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":"; then + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -979,8 +1079,8 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ ]) -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ @@ -989,7 +1089,13 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(whole_archive_flag_spec, $1)='' + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -997,7 +1103,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1013,203 +1119,142 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], fi ]) -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_SHELL_INIT +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], -[_LT_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$lt_ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -ECHO=${lt_ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then - # Yippee, $ECHO works! - : +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<_LT_EOF -[$]* -_LT_EOF - exit 0 + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' fi -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test -z "$lt_ECHO"; then - if test "X${echo_test_string+set}" != Xset; then - # find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if { echo_test_string=`eval $cmd`; } 2>/dev/null && - { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null - then - break - fi - done - fi - - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : - else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$ECHO" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - ECHO='print -r' - elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - ECHO='printf %s\n' - if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && - echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - ECHO="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null - then - break - fi - prev="$cmd" - done +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - ECHO=echo - fi - fi - fi - fi - fi -fi +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -lt_ECHO=$ECHO -if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) -AC_SUBST(lt_ECHO) -]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], - [An echo program that does not interpret backslashes]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], @@ -1238,7 +1283,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1331,14 +1376,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$SAVE_CFLAGS" fi ;; -sparc*-*solaris*) +*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" @@ -1356,14 +1414,47 @@ need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1]) +[_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1382,18 +1473,27 @@ old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1418,15 +1518,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1466,7 +1566,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1529,9 +1629,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - beos*) - # On BeOS, this test takes a really really long time. - # So we just punt and use a minimum line length of 8192. + mint*) + # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; @@ -1560,6 +1659,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=196608 ;; + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not @@ -1599,8 +1703,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1651,7 +1755,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line __oline__ "configure" +[#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1692,7 +1796,13 @@ else # endif #endif -void fnord() { int i=42;} +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1701,7 +1811,11 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } /* dlclose (self); */ } else @@ -1877,16 +1991,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2045,6 +2159,7 @@ m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2053,16 +2168,23 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` - else - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2075,7 +2197,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2095,7 +2217,13 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2121,7 +2249,7 @@ need_version=unknown case $host_os in aix3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH @@ -2130,7 +2258,7 @@ aix3*) ;; aix[[4-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes @@ -2183,7 +2311,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2195,7 +2323,7 @@ beos*) ;; bsdi[[45]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -2214,8 +2342,9 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + case $GCC,$cc_basename in + yes,*) + # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2237,37 +2366,84 @@ cygwin* | mingw* | pw32* | cegcc*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' ;; *) + # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' ;; esac - dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2288,7 +2464,7 @@ m4_if([$1], [],[ ;; dgux*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' @@ -2296,10 +2472,6 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd1*) - dynamic_linker=no - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -2307,7 +2479,7 @@ freebsd* | dragonfly*) objformat=`/usr/bin/objformat` else case $host_os in - freebsd[[123]]*) objformat=aout ;; + freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi @@ -2325,7 +2497,7 @@ freebsd* | dragonfly*) esac shlibpath_var=LD_LIBRARY_PATH case $host_os in - freebsd2*) + freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) @@ -2345,12 +2517,26 @@ freebsd* | dragonfly*) ;; gnu*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; @@ -2396,12 +2582,14 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 ;; interix[[3-9]]*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' @@ -2417,7 +2605,7 @@ irix5* | irix6* | nonstopux*) nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; @@ -2454,9 +2642,9 @@ linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) - version_type=linux +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2464,16 +2652,21 @@ linux* | k*bsd*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install @@ -2482,7 +2675,7 @@ linux* | k*bsd*-gnu) # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -2514,7 +2707,7 @@ netbsd*) ;; newsos6) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2583,7 +2776,7 @@ rdos*) ;; solaris*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2608,7 +2801,7 @@ sunos4*) ;; sysv4 | sysv4.3*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2632,7 +2825,7 @@ sysv4 | sysv4.3*) sysv4*MP*) if test -d /usr/nec ;then - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH @@ -2663,7 +2856,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -2673,7 +2866,7 @@ tpf*) ;; uts4*) - version_type=linux + version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH @@ -2715,6 +2908,8 @@ _LT_DECL([], [library_names_spec], [1], The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2827,6 +3022,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -2948,6 +3144,11 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -2956,8 +3157,8 @@ case $host_os in fi ;; esac -_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_DECL([], [reload_cmds], [2])dnl +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3002,25 +3203,27 @@ bsdi[[45]]*) cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_cmd='func_win32_libid' + lt_cv_deplibs_check_method=pass_all ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else + # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi lt_cv_deplibs_check_method=pass_all ;; -cegcc) +cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3050,6 +3253,10 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3058,11 +3265,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3083,8 +3290,8 @@ irix5* | irix6* | nonstopux*) lt_cv_deplibs_check_method=pass_all ;; -# This must be Linux ELF. -linux* | k*bsd*-gnu) +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; @@ -3162,6 +3369,21 @@ tpf*) ;; esac ]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3169,7 +3391,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method == "file_magic"]) + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3226,7 +3452,19 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3239,13 +3477,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3260,15 +3498,76 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' -# LT_LIB_M -# -------- -# check for math library +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -3296,7 +3595,12 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3313,6 +3617,7 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3380,8 +3685,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3405,6 +3710,7 @@ for ac_symprfx in "" "_"; do # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ @@ -3417,6 +3723,7 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3438,7 +3745,7 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3450,6 +3757,18 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + #ifdef __cplusplus extern "C" { #endif @@ -3461,7 +3780,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -const struct { +LT@&t@_DLSYM_CONST struct { const char *name; void *address; } @@ -3487,15 +3806,15 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3528,6 +3847,13 @@ else AC_MSG_RESULT(ok) fi +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3538,6 +3864,8 @@ _LT_DECL([global_symbol_to_c_name_address], _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3549,7 +3877,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= -AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3600,6 +3927,11 @@ m4_if([$1], [CXX], [ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3649,6 +3981,12 @@ m4_if([$1], [CXX], [ ;; esac ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; dgux*) case $cc_basename in ec++*) @@ -3705,7 +4043,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -3738,8 +4076,8 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC*) - # IBM XL 8.0 on PPC + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -3801,7 +4139,7 @@ m4_if([$1], [CXX], [ ;; solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -3905,6 +4243,12 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -3947,6 +4291,15 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -3989,7 +4342,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4010,7 +4363,13 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - pgcc* | pgf77* | pgf90* | pgf95*) + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4022,25 +4381,40 @@ m4_if([$1], [CXX], [ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl*) - # IBM XL C 8.0/Fortran 10.1 on PPC + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; - *Sun\ F*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; @@ -4072,7 +4446,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95*) + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4129,9 +4503,11 @@ case $host_os in _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. @@ -4150,6 +4526,8 @@ fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4170,6 +4548,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4178,27 +4557,37 @@ m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - ;; + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4213,7 +4602,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -4261,7 +4649,33 @@ dnl Note also adjust exclude_expsyms for C++ above. esac _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4279,6 +4693,7 @@ dnl Note also adjust exclude_expsyms for C++ above. fi supports_anon_versioning=no case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... @@ -4294,11 +4709,12 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. _LT_EOF fi @@ -4334,10 +4750,12 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4355,6 +4773,11 @@ _LT_EOF fi ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4370,7 +4793,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -4380,15 +4803,16 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag= + tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4399,13 +4823,17 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4421,17 +4849,16 @@ _LT_EOF fi case $cc_basename in - xlf*) + xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4445,8 +4872,8 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4464,8 +4891,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4511,8 +4938,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4552,8 +4979,10 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4640,9 +5069,9 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -4651,14 +5080,19 @@ _LT_EOF else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -4690,20 +5124,64 @@ _LT_EOF # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac ;; darwin* | rhapsody*) @@ -4716,10 +5194,6 @@ _LT_EOF _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; - freebsd1*) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little @@ -4732,7 +5206,7 @@ _LT_EOF ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) + freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes @@ -4741,7 +5215,7 @@ _LT_EOF # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4749,7 +5223,7 @@ _LT_EOF hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -4764,14 +5238,13 @@ _LT_EOF ;; hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes @@ -4783,16 +5256,16 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then + if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -4804,7 +5277,14 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi @@ -4832,19 +5312,34 @@ _LT_EOF irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE(int foo(void) {}, - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - ) - LDFLAGS="$save_LDFLAGS" + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4906,17 +5401,17 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -4926,13 +5421,13 @@ _LT_EOF osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -4945,9 +5440,9 @@ _LT_EOF _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5123,36 +5618,38 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi @@ -5189,9 +5686,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1], _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], - [[If ld is used when linking, flag to hardcode $libdir into a binary - during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], @@ -5217,8 +5711,6 @@ _LT_TAGDECL([], [inherit_rpath], [0], to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [fix_srcfile_path], [1], - [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5229,6 +5721,8 @@ _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5322,37 +5816,22 @@ CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG -# _LT_PROG_CXX -# ------------ -# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ -# compiler, we have our own version here. -m4_defun([_LT_PROG_CXX], -[ -pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) -AC_PROG_CXX -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_CXX - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_CXX], []) - - # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], -[AC_REQUIRE([_LT_PROG_CXX])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5364,7 +5843,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported @@ -5374,6 +5852,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5405,6 +5885,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Allow CC to be a program name with arguments. lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5422,6 +5903,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5443,8 +5925,8 @@ if test "$_lt_caught_CXX_error" != yes; then # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5476,7 +5958,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no @@ -5585,10 +6067,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5597,14 +6079,19 @@ if test "$_lt_caught_CXX_error" != yes; then else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX + _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -5634,28 +6121,75 @@ if test "$_lt_caught_CXX_error" != yes; then ;; cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -5678,7 +6212,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac ;; - freebsd[[12]]*) + freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no @@ -5697,6 +6231,11 @@ if test "$_lt_caught_CXX_error" != yes; then gnu*) ;; + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -5721,11 +6260,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -5786,7 +6325,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then @@ -5796,10 +6335,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -5829,7 +6368,7 @@ if test "$_lt_caught_CXX_error" != yes; then case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -5840,9 +6379,9 @@ if test "$_lt_caught_CXX_error" != yes; then *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -5853,7 +6392,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -5871,7 +6410,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5908,26 +6447,26 @@ if test "$_lt_caught_CXX_error" != yes; then pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 will use weak symbols + *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -5935,7 +6474,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -5954,9 +6493,9 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; - xl*) + xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5976,13 +6515,13 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6051,7 +6590,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=echo + output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6086,15 +6625,15 @@ if test "$_lt_caught_CXX_error" != yes; then case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6110,17 +6649,17 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6130,7 +6669,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6166,7 +6705,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6187,7 +6726,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='echo' + output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6207,14 +6746,14 @@ if test "$_lt_caught_CXX_error" != yes; then if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6225,7 +6764,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6279,6 +6818,10 @@ if test "$_lt_caught_CXX_error" != yes; then CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6334,6 +6877,7 @@ if test "$_lt_caught_CXX_error" != yes; then fi # test -n "$compiler" CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6348,6 +6892,29 @@ AC_LANG_POP ])# _LT_LANG_CXX_CONFIG +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6356,6 +6923,7 @@ AC_LANG_POP # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6405,7 +6973,20 @@ public class foo { } }; _LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF ]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6417,7 +6998,7 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case $p in + case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6426,13 +7007,22 @@ if AC_TRY_EVAL(ac_compile); then test $p = "-R"; then prev=$p continue - else - prev= fi + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) + case ${prev} in + -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6452,8 +7042,10 @@ if AC_TRY_EVAL(ac_compile); then _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi + prev= ;; + *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -6489,6 +7081,7 @@ else fi $RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -6525,7 +7118,7 @@ linux*) solaris*) case $cc_basename in - CC*) + CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -6569,32 +7162,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], ])# _LT_SYS_HIDDEN_LIBDEPS -# _LT_PROG_F77 -# ------------ -# Since AC_PROG_F77 is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_F77], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) -AC_PROG_F77 -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_F77 - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_F77], []) - - # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_REQUIRE([_LT_PROG_F77])dnl -AC_LANG_PUSH(Fortran 77) +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6604,7 +7181,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6613,6 +7189,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6652,7 +7230,9 @@ if test "$_lt_disable_F77" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} + CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6706,38 +7286,24 @@ if test "$_lt_disable_F77" != yes; then GCC=$lt_save_GCC CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG -# _LT_PROG_FC -# ----------- -# Since AC_PROG_FC is broken, in that it returns the empty string -# if there is no fortran compiler, we have our own version here. -m4_defun([_LT_PROG_FC], -[ -pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) -AC_PROG_FC -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi -popdef([AC_MSG_ERROR]) -])# _LT_PROG_FC - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([_LT_PROG_FC], []) - - # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_REQUIRE([_LT_PROG_FC])dnl -AC_LANG_PUSH(Fortran) +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -6747,7 +7313,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no @@ -6756,6 +7321,8 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -6795,7 +7362,9 @@ if test "$_lt_disable_FC" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} + CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -6851,7 +7420,8 @@ if test "$_lt_disable_FC" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC="$lt_save_CC" + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -6888,10 +7458,12 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC="$CC" +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -6901,6 +7473,8 @@ _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -6920,10 +7494,82 @@ fi AC_LANG_RESTORE GCC=$lt_save_GCC -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler @@ -6955,9 +7601,11 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} +CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -6970,7 +7618,8 @@ fi GCC=$lt_save_GCC AC_LANG_RESTORE -CC="$lt_save_CC" +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG @@ -6990,6 +7639,13 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], @@ -7029,6 +7685,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) # _LT_DECL_SED # ------------ @@ -7122,8 +7787,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES], # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7162,209 +7827,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_XSI_SHELLFNS -# --------------------- -# Bourne and XSI compatible variants of some useful shell functions. -m4_defun([_LT_PROG_XSI_SHELLFNS], -[case $xsi_shell in - yes) - cat << \_LT_EOF >> "$cfgfile" - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac -} - -# func_basename file -func_basename () -{ - func_basename_result="${1##*/}" -} - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}" -} - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -func_stripname () -{ - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"} -} - -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=${1%%=*} - func_opt_split_arg=${1#*=} -} - -# func_lo2o object -func_lo2o () -{ - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=${1%.*}.lo -} +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=$(( $[*] )) -} -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=${#1} -} +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) -_LT_EOF - ;; - *) # Bourne compatible functions. - cat << \_LT_EOF >> "$cfgfile" + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) -dnl func_dirname_and_basename -dnl A portable version of this function is already defined in general.m4sh -dnl so there is no need for it here. + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "X${3}" \ - | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; - esac -} + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) -# sed scripts: -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' -my_sed_long_arg='1s/^-[[^=]]*=//' + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) -# func_opt_split -func_opt_split () -{ - func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` -} + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "$[@]"` -} +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` -} + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) -_LT_EOF -esac + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi -case $lt_shell_append in - yes) - cat << \_LT_EOF >> "$cfgfile" +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]+=\$[2]" -} -_LT_EOF +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac ;; - *) - cat << \_LT_EOF >> "$cfgfile" - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$[1]=\$$[1]\$[2]" -} - -_LT_EOF + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac ;; - esac + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac ]) - +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/acinclude/ltdl.m4 b/acinclude/ltdl.m4 deleted file mode 100644 index e2b7129919..0000000000 --- a/acinclude/ltdl.m4 +++ /dev/null @@ -1,806 +0,0 @@ -############################################################################## -# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- -# -# Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc. -# Written by Thomas Tanner, 1999 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 17 LTDL_INIT - -# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) -# ------------------------------------------ -# DIRECTORY contains the libltdl sources. It is okay to call this -# function multiple times, as long as the same DIRECTORY is always given. -AC_DEFUN([LT_CONFIG_LTDL_DIR], -[AC_BEFORE([$0], [LTDL_INIT]) -_$0($*) -])# LT_CONFIG_LTDL_DIR - -# We break this out into a separate macro, so that we can call it safely -# internally without being caught accidentally by the sed scan in libtoolize. -m4_defun([_LT_CONFIG_LTDL_DIR], -[dnl remove trailing slashes -m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) -m4_case(_LTDL_DIR, - [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.' - m4_if(_ARG_DIR, [.], - [], - [m4_define([_LTDL_DIR], _ARG_DIR) - _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], - [m4_if(_ARG_DIR, _LTDL_DIR, - [], - [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])]) -m4_popdef([_ARG_DIR]) -])# _LT_CONFIG_LTDL_DIR - -# Initialise: -m4_define([_LTDL_DIR], []) - - -# _LT_BUILD_PREFIX -# ---------------- -# If Autoconf is new enough, expand to `${top_build_prefix}', otherwise -# to `${top_builddir}/'. -m4_define([_LT_BUILD_PREFIX], -[m4_ifdef([AC_AUTOCONF_VERSION], - [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), - [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], - [${top_build_prefix}], - [${top_builddir}/])], - [${top_build_prefix}])], - [${top_builddir}/])[]dnl -]) - - -# LTDL_CONVENIENCE -# ---------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with -# '${top_build_prefix}' if available, otherwise with '${top_builddir}/', -# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single -# quotes!). If your package is not flat and you're not using automake, -# define top_build_prefix, top_builddir, and top_srcdir appropriately -# in your Makefiles. -AC_DEFUN([LTDL_CONVENIENCE], -[AC_BEFORE([$0], [LTDL_INIT])dnl -dnl Although the argument is deprecated and no longer documented, -dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one -dnl here make sure it is the same as any other declaration of libltdl's -dnl location! This also ensures lt_ltdl_dir is set when configure.ac is -dnl not yet using an explicit LT_CONFIG_LTDL_DIR. -m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl -_$0() -])# LTDL_CONVENIENCE - -# AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, -# now we have LT_CONFIG_LTDL_DIR: -AU_DEFUN([AC_LIBLTDL_CONVENIENCE], -[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) -_LTDL_CONVENIENCE]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) - - -# _LTDL_CONVENIENCE -# ----------------- -# Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). -m4_defun([_LTDL_CONVENIENCE], -[case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; -esac -LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" -LTDLDEPS=$LIBLTDL -LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" - -AC_SUBST([LIBLTDL]) -AC_SUBST([LTDLDEPS]) -AC_SUBST([LTDLINCL]) - -# For backwards non-gettext consistent compatibility... -INCLTDL="$LTDLINCL" -AC_SUBST([INCLTDL]) -])# _LTDL_CONVENIENCE - - -# LTDL_INSTALLABLE -# ---------------- -# sets LIBLTDL to the link flags for the libltdl installable library -# and LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl -# is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if -# available, otherwise with '${top_builddir}/', and LTDLINCL will be -# prefixed with '${top_srcdir}/' (note the single quotes!). If your -# package is not flat and you're not using automake, define top_build_prefix, -# top_builddir, and top_srcdir appropriately in your Makefiles. -# In the future, this macro may have to be called after LT_INIT. -AC_DEFUN([LTDL_INSTALLABLE], -[AC_BEFORE([$0], [LTDL_INIT])dnl -dnl Although the argument is deprecated and no longer documented, -dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one -dnl here make sure it is the same as any other declaration of libltdl's -dnl location! This also ensures lt_ltdl_dir is set when configure.ac is -dnl not yet using an explicit LT_CONFIG_LTDL_DIR. -m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl -_$0() -])# LTDL_INSTALLABLE - -# AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, -# now we have LT_CONFIG_LTDL_DIR: -AU_DEFUN([AC_LIBLTDL_INSTALLABLE], -[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) -_LTDL_INSTALLABLE]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) - - -# _LTDL_INSTALLABLE -# ----------------- -# Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). -m4_defun([_LTDL_INSTALLABLE], -[if test -f $prefix/lib/libltdl.la; then - lt_save_LDFLAGS="$LDFLAGS" - LDFLAGS="-L$prefix/lib $LDFLAGS" - AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) - LDFLAGS="$lt_save_LDFLAGS" - if test x"${lt_lib_ltdl-no}" = xyes; then - if test x"$enable_ltdl_install" != xyes; then - # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install - AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install']) - enable_ltdl_install=no - fi - elif test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - fi -fi - -# If configure.ac declared an installable ltdl, and the user didn't override -# with --disable-ltdl-install, we will install the shipped libltdl. -case $enable_ltdl_install in - no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLDEPS= - LTDLINCL= - ;; - *) enable_ltdl_install=yes - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" - LTDLDEPS=$LIBLTDL - LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" - ;; -esac - -AC_SUBST([LIBLTDL]) -AC_SUBST([LTDLDEPS]) -AC_SUBST([LTDLINCL]) - -# For backwards non-gettext consistent compatibility... -INCLTDL="$LTDLINCL" -AC_SUBST([INCLTDL]) -])# LTDL_INSTALLABLE - - -# _LTDL_MODE_DISPATCH -# ------------------- -m4_define([_LTDL_MODE_DISPATCH], -[dnl If _LTDL_DIR is `.', then we are configuring libltdl itself: -m4_if(_LTDL_DIR, [], - [], - dnl if _LTDL_MODE was not set already, the default value is `subproject': - [m4_case(m4_default(_LTDL_MODE, [subproject]), - [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) - _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])], - [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])], - [recursive], [], - [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl -dnl Be careful not to expand twice: -m4_define([$0], []) -])# _LTDL_MODE_DISPATCH - - -# _LT_LIBOBJ(MODULE_NAME) -# ----------------------- -# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead -# of into LIBOBJS. -AC_DEFUN([_LT_LIBOBJ], [ - m4_pattern_allow([^_LT_LIBOBJS$]) - _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" -])# _LT_LIBOBJS - - -# LTDL_INIT([OPTIONS]) -# -------------------- -# Clients of libltdl can use this macro to allow the installer to -# choose between a shipped copy of the ltdl sources or a preinstalled -# version of the library. If the shipped ltdl sources are not in a -# subdirectory named libltdl, the directory name must be given by -# LT_CONFIG_LTDL_DIR. -AC_DEFUN([LTDL_INIT], -[dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -dnl We need to keep our own list of libobjs separate from our parent project, -dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while -dnl we look for our own LIBOBJs. -m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) -m4_pushdef([AC_LIBSOURCES]) - -dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: -m4_if(_LTDL_MODE, [], - [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) - m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], - [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) - -AC_ARG_WITH([included_ltdl], - [AS_HELP_STRING([--with-included-ltdl], - [use the GNU ltdl sources included here])]) - -if test "x$with_included_ltdl" != xyes; then - # We are not being forced to use the included libltdl sources, so - # decide whether there is a useful installed version we can use. - AC_CHECK_HEADER([ltdl.h], - [AC_CHECK_DECL([lt_dlinterface_register], - [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], - [with_included_ltdl=no], - [with_included_ltdl=yes])], - [with_included_ltdl=yes], - [AC_INCLUDES_DEFAULT - #include ])], - [with_included_ltdl=yes], - [AC_INCLUDES_DEFAULT] - ) -fi - -dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE -dnl was called yet, then for old times' sake, we assume libltdl is in an -dnl eponymous directory: -AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) - -AC_ARG_WITH([ltdl_include], - [AS_HELP_STRING([--with-ltdl-include=DIR], - [use the ltdl headers installed in DIR])]) - -if test -n "$with_ltdl_include"; then - if test -f "$with_ltdl_include/ltdl.h"; then : - else - AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) - fi -else - with_ltdl_include=no -fi - -AC_ARG_WITH([ltdl_lib], - [AS_HELP_STRING([--with-ltdl-lib=DIR], - [use the libltdl.la installed in DIR])]) - -if test -n "$with_ltdl_lib"; then - if test -f "$with_ltdl_lib/libltdl.la"; then : - else - AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) - fi -else - with_ltdl_lib=no -fi - -case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in - ,yes,no,no,) - m4_case(m4_default(_LTDL_TYPE, [convenience]), - [convenience], [_LTDL_CONVENIENCE], - [installable], [_LTDL_INSTALLABLE], - [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) - ;; - ,no,no,no,) - # If the included ltdl is not to be used, then use the - # preinstalled libltdl we found. - AC_DEFINE([HAVE_LTDL], [1], - [Define this if a modern libltdl is already installed]) - LIBLTDL=-lltdl - LTDLDEPS= - LTDLINCL= - ;; - ,no*,no,*) - AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) - ;; - *) with_included_ltdl=no - LIBLTDL="-L$with_ltdl_lib -lltdl" - LTDLDEPS= - LTDLINCL="-I$with_ltdl_include" - ;; -esac -INCLTDL="$LTDLINCL" - -# Report our decision... -AC_MSG_CHECKING([where to find libltdl headers]) -AC_MSG_RESULT([$LTDLINCL]) -AC_MSG_CHECKING([where to find libltdl library]) -AC_MSG_RESULT([$LIBLTDL]) - -_LTDL_SETUP - -dnl restore autoconf definition. -m4_popdef([AC_LIBOBJ]) -m4_popdef([AC_LIBSOURCES]) - -AC_CONFIG_COMMANDS_PRE([ - _ltdl_libobjs= - _ltdl_ltlibobjs= - if test -n "$_LT_LIBOBJS"; then - # Remove the extension. - _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' - for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do - _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" - _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" - done - fi - AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) - AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) -]) - -# Only expand once: -m4_define([LTDL_INIT]) -])# LTDL_INIT - -# Old names: -AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) -AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) -AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIB_LTDL], []) -dnl AC_DEFUN([AC_WITH_LTDL], []) -dnl AC_DEFUN([LT_WITH_LTDL], []) - - -# _LTDL_SETUP -# ----------- -# Perform all the checks necessary for compilation of the ltdl objects -# -- including compiler checks and header checks. This is a public -# interface mainly for the benefit of libltdl's own configure.ac, most -# other users should call LTDL_INIT instead. -AC_DEFUN([_LTDL_SETUP], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_SYS_MODULE_EXT])dnl -AC_REQUIRE([LT_SYS_MODULE_PATH])dnl -AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl -AC_REQUIRE([LT_LIB_DLLOAD])dnl -AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl -AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl -AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl -AC_REQUIRE([gl_FUNC_ARGZ])dnl - -m4_require([_LT_CHECK_OBJDIR])dnl -m4_require([_LT_HEADER_DLFCN])dnl -m4_require([_LT_CHECK_DLPREOPEN])dnl -m4_require([_LT_DECL_SED])dnl - -dnl Don't require this, or it will be expanded earlier than the code -dnl that sets the variables it relies on: -_LT_ENABLE_INSTALL - -dnl _LTDL_MODE specific code must be called at least once: -_LTDL_MODE_DISPATCH - -# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS -# the user used. This is so that ltdl.h can pick up the parent projects -# config.h file, The first file in AC_CONFIG_HEADERS must contain the -# definitions required by ltdl.c. -# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). -AC_CONFIG_COMMANDS_PRE([dnl -m4_pattern_allow([^LT_CONFIG_H$])dnl -m4_ifset([AH_HEADER], - [LT_CONFIG_H=AH_HEADER], - [m4_ifset([AC_LIST_HEADERS], - [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], - [])])]) -AC_SUBST([LT_CONFIG_H]) - -AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], - [], [], [AC_INCLUDES_DEFAULT]) - -AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) -AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) - -AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) - -name=ltdl -LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""` -AC_SUBST([LTDLOPEN]) -])# _LTDL_SETUP - - -# _LT_ENABLE_INSTALL -# ------------------ -m4_define([_LT_ENABLE_INSTALL], -[AC_ARG_ENABLE([ltdl-install], - [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) - -case ,${enable_ltdl_install},${enable_ltdl_convenience} in - *yes*) ;; - *) enable_ltdl_convenience=yes ;; -esac - -m4_ifdef([AM_CONDITIONAL], -[AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) - AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)]) -])# _LT_ENABLE_INSTALL - - -# LT_SYS_DLOPEN_DEPLIBS -# --------------------- -AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_CACHE_CHECK([whether deplibs are loaded by dlopen], - [lt_cv_sys_dlopen_deplibs], - [# PORTME does your system automatically load deplibs for dlopen? - # or its logical equivalent (e.g. shl_load for HP-UX < 11) - # For now, we just catch OSes we know something about -- in the - # future, we'll try test this programmatically. - lt_cv_sys_dlopen_deplibs=unknown - case $host_os in - aix3*|aix4.1.*|aix4.2.*) - # Unknown whether this is true for these versions of AIX, but - # we want this `case' here to explicitly catch those versions. - lt_cv_sys_dlopen_deplibs=unknown - ;; - aix[[4-9]]*) - lt_cv_sys_dlopen_deplibs=yes - ;; - amigaos*) - case $host_cpu in - powerpc) - lt_cv_sys_dlopen_deplibs=no - ;; - esac - ;; - darwin*) - # Assuming the user has installed a libdl from somewhere, this is true - # If you are looking for one http://www.opendarwin.org/projects/dlcompat - lt_cv_sys_dlopen_deplibs=yes - ;; - freebsd* | dragonfly*) - lt_cv_sys_dlopen_deplibs=yes - ;; - gnu* | linux* | k*bsd*-gnu) - # GNU and its variants, using gnu ld.so (Glibc) - lt_cv_sys_dlopen_deplibs=yes - ;; - hpux10*|hpux11*) - lt_cv_sys_dlopen_deplibs=yes - ;; - interix*) - lt_cv_sys_dlopen_deplibs=yes - ;; - irix[[12345]]*|irix6.[[01]]*) - # Catch all versions of IRIX before 6.2, and indicate that we don't - # know how it worked for any of those versions. - lt_cv_sys_dlopen_deplibs=unknown - ;; - irix*) - # The case above catches anything before 6.2, and it's known that - # at 6.2 and later dlopen does load deplibs. - lt_cv_sys_dlopen_deplibs=yes - ;; - netbsd*) - lt_cv_sys_dlopen_deplibs=yes - ;; - openbsd*) - lt_cv_sys_dlopen_deplibs=yes - ;; - osf[[1234]]*) - # dlopen did load deplibs (at least at 4.x), but until the 5.x series, - # it did *not* use an RPATH in a shared library to find objects the - # library depends on, so we explicitly say `no'. - lt_cv_sys_dlopen_deplibs=no - ;; - osf5.0|osf5.0a|osf5.1) - # dlopen *does* load deplibs and with the right loader patch applied - # it even uses RPATH in a shared library to search for shared objects - # that the library depends on, but there's no easy way to know if that - # patch is installed. Since this is the case, all we can really - # say is unknown -- it depends on the patch being installed. If - # it is, this changes to `yes'. Without it, it would be `no'. - lt_cv_sys_dlopen_deplibs=unknown - ;; - osf*) - # the two cases above should catch all versions of osf <= 5.1. Read - # the comments above for what we know about them. - # At > 5.1, deplibs are loaded *and* any RPATH in a shared library - # is used to find them so we can finally say `yes'. - lt_cv_sys_dlopen_deplibs=yes - ;; - qnx*) - lt_cv_sys_dlopen_deplibs=yes - ;; - solaris*) - lt_cv_sys_dlopen_deplibs=yes - ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - libltdl_cv_sys_dlopen_deplibs=yes - ;; - esac - ]) -if test "$lt_cv_sys_dlopen_deplibs" != yes; then - AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], - [Define if the OS needs help to load dependent libraries for dlopen().]) -fi -])# LT_SYS_DLOPEN_DEPLIBS - -# Old name: -AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) - - -# LT_SYS_MODULE_EXT -# ----------------- -AC_DEFUN([LT_SYS_MODULE_EXT], -[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl -AC_CACHE_CHECK([which extension is used for runtime loadable modules], - [libltdl_cv_shlibext], -[ -module=yes -eval libltdl_cv_shlibext=$shrext_cmds - ]) -if test -n "$libltdl_cv_shlibext"; then - m4_pattern_allow([LT_MODULE_EXT])dnl - AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], - [Define to the extension used for runtime loadable modules, say, ".so".]) -fi -])# LT_SYS_MODULE_EXT - -# Old name: -AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) - - -# LT_SYS_MODULE_PATH -# ------------------ -AC_DEFUN([LT_SYS_MODULE_PATH], -[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl -AC_CACHE_CHECK([which variable specifies run-time module search path], - [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) -if test -n "$lt_cv_module_path_var"; then - m4_pattern_allow([LT_MODULE_PATH_VAR])dnl - AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], - [Define to the name of the environment variable that determines the run-time module search path.]) -fi -])# LT_SYS_MODULE_PATH - -# Old name: -AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) - - -# LT_SYS_DLSEARCH_PATH -# -------------------- -AC_DEFUN([LT_SYS_DLSEARCH_PATH], -[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl -AC_CACHE_CHECK([for the default library search path], - [lt_cv_sys_dlsearch_path], - [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) -if test -n "$lt_cv_sys_dlsearch_path"; then - sys_dlsearch_path= - for dir in $lt_cv_sys_dlsearch_path; do - if test -z "$sys_dlsearch_path"; then - sys_dlsearch_path="$dir" - else - sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" - fi - done - m4_pattern_allow([LT_DLSEARCH_PATH])dnl - AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], - [Define to the system default library search path.]) -fi -])# LT_SYS_DLSEARCH_PATH - -# Old name: -AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) - - -# _LT_CHECK_DLPREOPEN -# ------------------- -m4_defun([_LT_CHECK_DLPREOPEN], -[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], - [libltdl_cv_preloaded_symbols], - [if test -n "$lt_cv_sys_global_symbol_pipe"; then - libltdl_cv_preloaded_symbols=yes - else - libltdl_cv_preloaded_symbols=no - fi - ]) -if test x"$libltdl_cv_preloaded_symbols" = xyes; then - AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], - [Define if libtool can extract symbol lists from object files.]) -fi -])# _LT_CHECK_DLPREOPEN - - -# LT_LIB_DLLOAD -# ------------- -AC_DEFUN([LT_LIB_DLLOAD], -[m4_pattern_allow([^LT_DLLOADERS$]) -LT_DLLOADERS= -AC_SUBST([LT_DLLOADERS]) - -AC_LANG_PUSH([C]) - -LIBADD_DLOPEN= -AC_SEARCH_LIBS([dlopen], [dl], - [AC_DEFINE([HAVE_LIBDL], [1], - [Define if you have the libdl library or equivalent.]) - if test "$ac_cv_search_dlopen" != "none required" ; then - LIBADD_DLOPEN="-ldl" - fi - libltdl_cv_lib_dl_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H -# include -#endif - ]], [[dlopen(0, 0);]])], - [AC_DEFINE([HAVE_LIBDL], [1], - [Define if you have the libdl library or equivalent.]) - libltdl_cv_func_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], - [AC_CHECK_LIB([svld], [dlopen], - [AC_DEFINE([HAVE_LIBDL], [1], - [Define if you have the libdl library or equivalent.]) - LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) -if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes -then - lt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBADD_DLOPEN" - AC_CHECK_FUNCS([dlerror]) - LIBS="$lt_save_LIBS" -fi -AC_SUBST([LIBADD_DLOPEN]) - -LIBADD_SHL_LOAD= -AC_CHECK_FUNC([shl_load], - [AC_DEFINE([HAVE_SHL_LOAD], [1], - [Define if you have the shl_load function.]) - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], - [AC_CHECK_LIB([dld], [shl_load], - [AC_DEFINE([HAVE_SHL_LOAD], [1], - [Define if you have the shl_load function.]) - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" - LIBADD_SHL_LOAD="-ldld"])]) -AC_SUBST([LIBADD_SHL_LOAD]) - -case $host_os in -darwin[[1567]].*) -# We only want this for pre-Mac OS X 10.4. - AC_CHECK_FUNC([_dyld_func_lookup], - [AC_DEFINE([HAVE_DYLD], [1], - [Define if you have the _dyld_func_lookup function.]) - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) - ;; -beos*) - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" - ;; -cygwin* | mingw* | os2* | pw32*) - AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" - ;; -esac - -AC_CHECK_LIB([dld], [dld_link], - [AC_DEFINE([HAVE_DLD], [1], - [Define if you have the GNU dld library.]) - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) -AC_SUBST([LIBADD_DLD_LINK]) - -m4_pattern_allow([^LT_DLPREOPEN$]) -LT_DLPREOPEN= -if test -n "$LT_DLLOADERS" -then - for lt_loader in $LT_DLLOADERS; do - LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " - done - AC_DEFINE([HAVE_LIBDLLOADER], [1], - [Define if libdlloader will be built on this platform]) -fi -AC_SUBST([LT_DLPREOPEN]) - -dnl This isn't used anymore, but set it for backwards compatibility -LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" -AC_SUBST([LIBADD_DL]) - -AC_LANG_POP -])# LT_LIB_DLLOAD - -# Old name: -AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LTDL_DLLIB], []) - - -# LT_SYS_SYMBOL_USCORE -# -------------------- -# does the compiler prefix global symbols with an underscore? -AC_DEFUN([LT_SYS_SYMBOL_USCORE], -[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -AC_CACHE_CHECK([for _ prefix in compiled symbols], - [lt_cv_sys_symbol_underscore], - [lt_cv_sys_symbol_underscore=no - cat > conftest.$ac_ext <<_LT_EOF -void nm_test_func(){} -int main(){nm_test_func;return 0;} -_LT_EOF - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - ac_nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then - # See whether the symbols have a leading underscore. - if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then - lt_cv_sys_symbol_underscore=yes - else - if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then - : - else - echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD - fi - fi - else - echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.c >&AS_MESSAGE_LOG_FD - fi - rm -rf conftest* - ]) - sys_symbol_underscore=$lt_cv_sys_symbol_underscore - AC_SUBST([sys_symbol_underscore]) -])# LT_SYS_SYMBOL_USCORE - -# Old name: -AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) - - -# LT_FUNC_DLSYM_USCORE -# -------------------- -AC_DEFUN([LT_FUNC_DLSYM_USCORE], -[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl -if test x"$lt_cv_sys_symbol_underscore" = xyes; then - if test x"$libltdl_cv_func_dlopen" = xyes || - test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then - AC_CACHE_CHECK([whether we have to add an underscore for dlsym], - [libltdl_cv_need_uscore], - [libltdl_cv_need_uscore=unknown - save_LIBS="$LIBS" - LIBS="$LIBS $LIBADD_DLOPEN" - _LT_TRY_DLOPEN_SELF( - [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], - [], [libltdl_cv_need_uscore=cross]) - LIBS="$save_LIBS" - ]) - fi -fi - -if test x"$libltdl_cv_need_uscore" = xyes; then - AC_DEFINE([NEED_USCORE], [1], - [Define if dlsym() requires a leading underscore in symbol names.]) -fi -])# LT_FUNC_DLSYM_USCORE - -# Old name: -AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) - diff --git a/acinclude/ltoptions.m4 b/acinclude/ltoptions.m4 index d4df679195..5d9acd8e23 100644 --- a/acinclude/ltoptions.m4 +++ b/acinclude/ltoptions.m4 @@ -1,14 +1,14 @@ -############################################################################## # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltoptions.m4 +# serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -126,7 +126,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -134,13 +134,13 @@ case $host in esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [0], [Assembler program])dnl +_LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -326,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) @@ -367,4 +382,3 @@ LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) - diff --git a/acinclude/ltsugar.m4 b/acinclude/ltsugar.m4 index 02a939d819..9000a057d3 100644 --- a/acinclude/ltsugar.m4 +++ b/acinclude/ltsugar.m4 @@ -1,4 +1,3 @@ -############################################################################## # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. @@ -122,4 +121,3 @@ m4_define([lt_dict_filter], lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) - diff --git a/acinclude/ltversion.m4 b/acinclude/ltversion.m4 index 83a83f20ad..07a8602d48 100644 --- a/acinclude/ltversion.m4 +++ b/acinclude/ltversion.m4 @@ -1,4 +1,3 @@ -############################################################################## # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. @@ -8,18 +7,17 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# Generated from ltversion.in. +# @configure_input@ -# serial 3012 ltversion.m4 +# serial 3337 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6]) -m4_define([LT_PACKAGE_REVISION], [1.3012]) +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6' -macro_revision='1.3012' +[macro_version='2.4.2' +macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) - diff --git a/acinclude/lt~obsolete.m4 b/acinclude/lt~obsolete.m4 index 3b2acd4d00..c573da90c5 100644 --- a/acinclude/lt~obsolete.m4 +++ b/acinclude/lt~obsolete.m4 @@ -1,14 +1,13 @@ -############################################################################## # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -78,7 +77,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -91,3 +89,10 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/android-project/AndroidManifest.xml b/android-project/AndroidManifest.xml new file mode 100644 index 0000000000..27db41843a --- /dev/null +++ b/android-project/AndroidManifest.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android-project/ant.properties b/android-project/ant.properties new file mode 100644 index 0000000000..b0971e891e --- /dev/null +++ b/android-project/ant.properties @@ -0,0 +1,17 @@ +# This file is used to override default values used by the Ant build system. +# +# This file must be checked into Version Control Systems, as it is +# integral to the build system of your project. + +# This file is only used by the Ant script. + +# You can use this to override default values such as +# 'source.dir' for the location of your java source folder and +# 'out.dir' for the location of your output folder. + +# You can also use it define how the release builds are signed by declaring +# the following properties: +# 'key.store' for the location of your keystore and +# 'key.alias' for the name of the key to use. +# The password will be asked during the build when you use the 'release' target. + diff --git a/android-project/build.properties b/android-project/build.properties new file mode 100644 index 0000000000..edc7f23050 --- /dev/null +++ b/android-project/build.properties @@ -0,0 +1,17 @@ +# This file is used to override default values used by the Ant build system. +# +# This file must be checked in Version Control Systems, as it is +# integral to the build system of your project. + +# This file is only used by the Ant script. + +# You can use this to override default values such as +# 'source.dir' for the location of your java source folder and +# 'out.dir' for the location of your output folder. + +# You can also use it define how the release builds are signed by declaring +# the following properties: +# 'key.store' for the location of your keystore and +# 'key.alias' for the name of the key to use. +# The password will be asked during the build when you use the 'release' target. + diff --git a/android-project/build.xml b/android-project/build.xml new file mode 100644 index 0000000000..9f19a077b1 --- /dev/null +++ b/android-project/build.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android-project/default.properties b/android-project/default.properties new file mode 100644 index 0000000000..9d135cb85f --- /dev/null +++ b/android-project/default.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-7 diff --git a/android-project/jni/Android.mk b/android-project/jni/Android.mk new file mode 100644 index 0000000000..5053e7d643 --- /dev/null +++ b/android-project/jni/Android.mk @@ -0,0 +1 @@ +include $(call all-subdir-makefiles) diff --git a/android-project/jni/Application.mk b/android-project/jni/Application.mk new file mode 100644 index 0000000000..05cf0c31cb --- /dev/null +++ b/android-project/jni/Application.mk @@ -0,0 +1,4 @@ + +# Uncomment this if you're using STL in your project +# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information +# APP_STL := stlport_static diff --git a/android-project/jni/src/Android.mk b/android-project/jni/src/Android.mk new file mode 100644 index 0000000000..70ca7dc356 --- /dev/null +++ b/android-project/jni/src/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := main + +SDL_PATH := ../SDL + +LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include + +# Add your application source files here... +LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \ + YourSourceHere.c + +LOCAL_SHARED_LIBRARIES := SDL2 + +LOCAL_LDLIBS := -lGLESv1_CM -llog + +include $(BUILD_SHARED_LIBRARY) diff --git a/android-project/proguard-project.txt b/android-project/proguard-project.txt new file mode 100644 index 0000000000..f2fe1559a2 --- /dev/null +++ b/android-project/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/android-project/project.properties b/android-project/project.properties new file mode 100644 index 0000000000..b7c2081d56 --- /dev/null +++ b/android-project/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-10 diff --git a/android-project/res/drawable-hdpi/ic_launcher.png b/android-project/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000..d50bdaae06 Binary files /dev/null and b/android-project/res/drawable-hdpi/ic_launcher.png differ diff --git a/android-project/res/drawable-mdpi/ic_launcher.png b/android-project/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000000..0a299eb3cc Binary files /dev/null and b/android-project/res/drawable-mdpi/ic_launcher.png differ diff --git a/android-project/res/drawable-xhdpi/ic_launcher.png b/android-project/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..a336ad5c2b Binary files /dev/null and b/android-project/res/drawable-xhdpi/ic_launcher.png differ diff --git a/android-project/res/drawable-xxhdpi/ic_launcher.png b/android-project/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..d423dac262 Binary files /dev/null and b/android-project/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/android-project/res/layout/main.xml b/android-project/res/layout/main.xml new file mode 100644 index 0000000000..123c4b6eac --- /dev/null +++ b/android-project/res/layout/main.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/android-project/res/values/strings.xml b/android-project/res/values/strings.xml new file mode 100644 index 0000000000..9bce51cb36 --- /dev/null +++ b/android-project/res/values/strings.xml @@ -0,0 +1,4 @@ + + + SDL App + diff --git a/android-project/src/org/libsdl/app/SDLActivity.java b/android-project/src/org/libsdl/app/SDLActivity.java new file mode 100644 index 0000000000..ed6f4ef324 --- /dev/null +++ b/android-project/src/org/libsdl/app/SDLActivity.java @@ -0,0 +1,906 @@ +package org.libsdl.app; + +import javax.microedition.khronos.egl.EGL10; +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.egl.EGLContext; +import javax.microedition.khronos.egl.EGLDisplay; +import javax.microedition.khronos.egl.EGLSurface; + +import android.app.*; +import android.content.*; +import android.view.*; +import android.view.inputmethod.BaseInputConnection; +import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.InputConnection; +import android.view.inputmethod.InputMethodManager; +import android.widget.AbsoluteLayout; +import android.os.*; +import android.util.Log; +import android.graphics.*; +import android.media.*; +import android.hardware.*; + + +/** + SDL Activity +*/ +public class SDLActivity extends Activity { + private static final String TAG = "SDL"; + + // Keep track of the paused state + public static boolean mIsPaused = false, mIsSurfaceReady = false, mHasFocus = true; + + // Main components + protected static SDLActivity mSingleton; + protected static SDLSurface mSurface; + protected static View mTextEdit; + protected static ViewGroup mLayout; + + // This is what SDL runs in. It invokes SDL_main(), eventually + protected static Thread mSDLThread; + + // Audio + protected static Thread mAudioThread; + protected static AudioTrack mAudioTrack; + + // EGL objects + protected static EGLContext mEGLContext; + protected static EGLSurface mEGLSurface; + protected static EGLDisplay mEGLDisplay; + protected static EGLConfig mEGLConfig; + protected static int mGLMajor, mGLMinor; + + // Load the .so + static { + System.loadLibrary("SDL2"); + //System.loadLibrary("SDL2_image"); + //System.loadLibrary("SDL2_mixer"); + //System.loadLibrary("SDL2_net"); + //System.loadLibrary("SDL2_ttf"); + System.loadLibrary("main"); + } + + // Setup + @Override + protected void onCreate(Bundle savedInstanceState) { + //Log.v("SDL", "onCreate()"); + super.onCreate(savedInstanceState); + + // So we can call stuff from static callbacks + mSingleton = this; + + // Set up the surface + mEGLSurface = EGL10.EGL_NO_SURFACE; + mSurface = new SDLSurface(getApplication()); + mEGLContext = EGL10.EGL_NO_CONTEXT; + + mLayout = new AbsoluteLayout(this); + mLayout.addView(mSurface); + + setContentView(mLayout); + } + + // Events + @Override + protected void onPause() { + Log.v("SDL", "onPause()"); + super.onPause(); + SDLActivity.handlePause(); + } + + @Override + protected void onResume() { + Log.v("SDL", "onResume()"); + super.onResume(); + SDLActivity.handleResume(); + } + + + @Override + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + Log.v("SDL", "onWindowFocusChanged(): " + hasFocus); + + SDLActivity.mHasFocus = hasFocus; + if (hasFocus) { + SDLActivity.handleResume(); + } + } + + @Override + public void onLowMemory() { + Log.v("SDL", "onLowMemory()"); + super.onLowMemory(); + SDLActivity.nativeLowMemory(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + Log.v("SDL", "onDestroy()"); + // Send a quit message to the application + SDLActivity.nativeQuit(); + + // Now wait for the SDL thread to quit + if (mSDLThread != null) { + try { + mSDLThread.join(); + } catch(Exception e) { + Log.v("SDL", "Problem stopping thread: " + e); + } + mSDLThread = null; + + //Log.v("SDL", "Finished waiting for SDL thread"); + } + } + + @Override + public boolean dispatchKeyEvent(KeyEvent event) { + int keyCode = event.getKeyCode(); + // Ignore volume keys so they're handled by Android + if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || + keyCode == KeyEvent.KEYCODE_VOLUME_UP) { + return false; + } + return super.dispatchKeyEvent(event); + } + + /** Called by onPause or surfaceDestroyed. Even if surfaceDestroyed + * is the first to be called, mIsSurfaceReady should still be set + * to 'true' during the call to onPause (in a usual scenario). + */ + public static void handlePause() { + if (!SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady) { + SDLActivity.mIsPaused = true; + SDLActivity.nativePause(); + mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, false); + } + } + + /** Called by onResume or surfaceCreated. An actual resume should be done only when the surface is ready. + * Note: Some Android variants may send multiple surfaceChanged events, so we don't need to resume + * every time we get one of those events, only if it comes after surfaceDestroyed + */ + public static void handleResume() { + if (SDLActivity.mIsPaused && SDLActivity.mIsSurfaceReady && SDLActivity.mHasFocus) { + SDLActivity.mIsPaused = false; + SDLActivity.nativeResume(); + mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true); + } + } + + + // Messages from the SDLMain thread + static final int COMMAND_CHANGE_TITLE = 1; + static final int COMMAND_UNUSED = 2; + static final int COMMAND_TEXTEDIT_HIDE = 3; + + protected static final int COMMAND_USER = 0x8000; + + /** + * This method is called by SDL if SDL did not handle a message itself. + * This happens if a received message contains an unsupported command. + * Method can be overwritten to handle Messages in a different class. + * @param command the command of the message. + * @param param the parameter of the message. May be null. + * @return if the message was handled in overridden method. + */ + protected boolean onUnhandledMessage(int command, Object param) { + return false; + } + + /** + * A Handler class for Messages from native SDL applications. + * It uses current Activities as target (e.g. for the title). + * static to prevent implicit references to enclosing object. + */ + protected static class SDLCommandHandler extends Handler { + @Override + public void handleMessage(Message msg) { + Context context = getContext(); + if (context == null) { + Log.e(TAG, "error handling message, getContext() returned null"); + return; + } + switch (msg.arg1) { + case COMMAND_CHANGE_TITLE: + if (context instanceof Activity) { + ((Activity) context).setTitle((String)msg.obj); + } else { + Log.e(TAG, "error handling message, getContext() returned no Activity"); + } + break; + case COMMAND_TEXTEDIT_HIDE: + if (mTextEdit != null) { + mTextEdit.setVisibility(View.GONE); + + InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(mTextEdit.getWindowToken(), 0); + } + break; + + default: + if ((context instanceof SDLActivity) && !((SDLActivity) context).onUnhandledMessage(msg.arg1, msg.obj)) { + Log.e(TAG, "error handling message, command is " + msg.arg1); + } + } + } + } + + // Handler for the messages + Handler commandHandler = new SDLCommandHandler(); + + // Send a message from the SDLMain thread + boolean sendCommand(int command, Object data) { + Message msg = commandHandler.obtainMessage(); + msg.arg1 = command; + msg.obj = data; + return commandHandler.sendMessage(msg); + } + + // C functions we call + public static native void nativeInit(); + public static native void nativeLowMemory(); + public static native void nativeQuit(); + public static native void nativePause(); + public static native void nativeResume(); + public static native void onNativeResize(int x, int y, int format); + public static native void onNativeKeyDown(int keycode); + public static native void onNativeKeyUp(int keycode); + public static native void onNativeKeyboardFocusLost(); + public static native void onNativeTouch(int touchDevId, int pointerFingerId, + int action, float x, + float y, float p); + public static native void onNativeAccel(float x, float y, float z); + + // Java functions called from C + + public static boolean createGLContext(int majorVersion, int minorVersion, int[] attribs) { + return initEGL(majorVersion, minorVersion, attribs); + } + + public static void deleteGLContext() { + if (SDLActivity.mEGLDisplay != null && SDLActivity.mEGLContext != EGL10.EGL_NO_CONTEXT) { + EGL10 egl = (EGL10)EGLContext.getEGL(); + egl.eglMakeCurrent(SDLActivity.mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); + egl.eglDestroyContext(SDLActivity.mEGLDisplay, SDLActivity.mEGLContext); + SDLActivity.mEGLContext = EGL10.EGL_NO_CONTEXT; + + if (SDLActivity.mEGLSurface != EGL10.EGL_NO_SURFACE) { + egl.eglDestroySurface(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface); + SDLActivity.mEGLSurface = EGL10.EGL_NO_SURFACE; + } + } + } + + public static void flipBuffers() { + flipEGL(); + } + + public static boolean setActivityTitle(String title) { + // Called from SDLMain() thread and can't directly affect the view + return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title); + } + + public static boolean sendMessage(int command, int param) { + return mSingleton.sendCommand(command, Integer.valueOf(param)); + } + + public static Context getContext() { + return mSingleton; + } + + static class ShowTextInputTask implements Runnable { + /* + * This is used to regulate the pan&scan method to have some offset from + * the bottom edge of the input region and the top edge of an input + * method (soft keyboard) + */ + static final int HEIGHT_PADDING = 15; + + public int x, y, w, h; + + public ShowTextInputTask(int x, int y, int w, int h) { + this.x = x; + this.y = y; + this.w = w; + this.h = h; + } + + @Override + public void run() { + AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams( + w, h + HEIGHT_PADDING, x, y); + + if (mTextEdit == null) { + mTextEdit = new DummyEdit(getContext()); + + mLayout.addView(mTextEdit, params); + } else { + mTextEdit.setLayoutParams(params); + } + + mTextEdit.setVisibility(View.VISIBLE); + mTextEdit.requestFocus(); + + InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(mTextEdit, 0); + } + } + + public static boolean showTextInput(int x, int y, int w, int h) { + // Transfer the task to the main thread as a Runnable + return mSingleton.commandHandler.post(new ShowTextInputTask(x, y, w, h)); + } + + + // EGL functions + public static boolean initEGL(int majorVersion, int minorVersion, int[] attribs) { + try { + EGL10 egl = (EGL10)EGLContext.getEGL(); + + if (SDLActivity.mEGLDisplay == null) { + SDLActivity.mEGLDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); + int[] version = new int[2]; + egl.eglInitialize(SDLActivity.mEGLDisplay, version); + } + + if (SDLActivity.mEGLDisplay != null && SDLActivity.mEGLContext == EGL10.EGL_NO_CONTEXT) { + // No current GL context exists, we will create a new one. + Log.v("SDL", "Starting up OpenGL ES " + majorVersion + "." + minorVersion); + EGLConfig[] configs = new EGLConfig[128]; + int[] num_config = new int[1]; + if (!egl.eglChooseConfig(SDLActivity.mEGLDisplay, attribs, configs, 1, num_config) || num_config[0] == 0) { + Log.e("SDL", "No EGL config available"); + return false; + } + EGLConfig config = null; + int bestdiff = -1, bitdiff; + int[] value = new int[1]; + + // eglChooseConfig returns a number of configurations that match or exceed the requested attribs. + // From those, we select the one that matches our requirements more closely + Log.v("SDL", "Got " + num_config[0] + " valid modes from egl"); + for(int i = 0; i < num_config[0]; i++) { + bitdiff = 0; + // Go through some of the attributes and compute the bit difference between what we want and what we get. + for (int j = 0; ; j += 2) { + if (attribs[j] == EGL10.EGL_NONE) + break; + + if (attribs[j+1] != EGL10.EGL_DONT_CARE && (attribs[j] == EGL10.EGL_RED_SIZE || + attribs[j] == EGL10.EGL_GREEN_SIZE || + attribs[j] == EGL10.EGL_BLUE_SIZE || + attribs[j] == EGL10.EGL_ALPHA_SIZE || + attribs[j] == EGL10.EGL_DEPTH_SIZE || + attribs[j] == EGL10.EGL_STENCIL_SIZE)) { + egl.eglGetConfigAttrib(SDLActivity.mEGLDisplay, configs[i], attribs[j], value); + bitdiff += value[0] - attribs[j + 1]; // value is always >= attrib + } + } + + if (bitdiff < bestdiff || bestdiff == -1) { + config = configs[i]; + bestdiff = bitdiff; + } + + if (bitdiff == 0) break; // we found an exact match! + } + + Log.d("SDL", "Selected mode with a total bit difference of " + bestdiff); + + SDLActivity.mEGLConfig = config; + SDLActivity.mGLMajor = majorVersion; + SDLActivity.mGLMinor = minorVersion; + } + + return SDLActivity.createEGLSurface(); + + } catch(Exception e) { + Log.v("SDL", e + ""); + for (StackTraceElement s : e.getStackTrace()) { + Log.v("SDL", s.toString()); + } + return false; + } + } + + public static boolean createEGLContext() { + EGL10 egl = (EGL10)EGLContext.getEGL(); + int EGL_CONTEXT_CLIENT_VERSION=0x3098; + int contextAttrs[] = new int[] { EGL_CONTEXT_CLIENT_VERSION, SDLActivity.mGLMajor, EGL10.EGL_NONE }; + SDLActivity.mEGLContext = egl.eglCreateContext(SDLActivity.mEGLDisplay, SDLActivity.mEGLConfig, EGL10.EGL_NO_CONTEXT, contextAttrs); + if (SDLActivity.mEGLContext == EGL10.EGL_NO_CONTEXT) { + Log.e("SDL", "Couldn't create context"); + return false; + } + return true; + } + + public static boolean createEGLSurface() { + if (SDLActivity.mEGLDisplay != null && SDLActivity.mEGLConfig != null) { + EGL10 egl = (EGL10)EGLContext.getEGL(); + if (SDLActivity.mEGLContext == EGL10.EGL_NO_CONTEXT) createEGLContext(); + + if (SDLActivity.mEGLSurface == EGL10.EGL_NO_SURFACE) { + Log.v("SDL", "Creating new EGL Surface"); + SDLActivity.mEGLSurface = egl.eglCreateWindowSurface(SDLActivity.mEGLDisplay, SDLActivity.mEGLConfig, SDLActivity.mSurface, null); + if (SDLActivity.mEGLSurface == EGL10.EGL_NO_SURFACE) { + Log.e("SDL", "Couldn't create surface"); + return false; + } + } + else Log.v("SDL", "EGL Surface remains valid"); + + if (egl.eglGetCurrentContext() != SDLActivity.mEGLContext) { + if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface, SDLActivity.mEGLSurface, SDLActivity.mEGLContext)) { + Log.e("SDL", "Old EGL Context doesnt work, trying with a new one"); + // TODO: Notify the user via a message that the old context could not be restored, and that textures need to be manually restored. + createEGLContext(); + if (!egl.eglMakeCurrent(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface, SDLActivity.mEGLSurface, SDLActivity.mEGLContext)) { + Log.e("SDL", "Failed making EGL Context current"); + return false; + } + } + else Log.v("SDL", "EGL Context made current"); + } + else Log.v("SDL", "EGL Context remains current"); + + return true; + } else { + Log.e("SDL", "Surface creation failed, display = " + SDLActivity.mEGLDisplay + ", config = " + SDLActivity.mEGLConfig); + return false; + } + } + + // EGL buffer flip + public static void flipEGL() { + try { + EGL10 egl = (EGL10)EGLContext.getEGL(); + + egl.eglWaitNative(EGL10.EGL_CORE_NATIVE_ENGINE, null); + + // drawing here + + egl.eglWaitGL(); + + egl.eglSwapBuffers(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface); + + + } catch(Exception e) { + Log.v("SDL", "flipEGL(): " + e); + for (StackTraceElement s : e.getStackTrace()) { + Log.v("SDL", s.toString()); + } + } + } + + // Audio + public static int audioInit(int sampleRate, boolean is16Bit, boolean isStereo, int desiredFrames) { + int channelConfig = isStereo ? AudioFormat.CHANNEL_CONFIGURATION_STEREO : AudioFormat.CHANNEL_CONFIGURATION_MONO; + int audioFormat = is16Bit ? AudioFormat.ENCODING_PCM_16BIT : AudioFormat.ENCODING_PCM_8BIT; + int frameSize = (isStereo ? 2 : 1) * (is16Bit ? 2 : 1); + + Log.v("SDL", "SDL audio: wanted " + (isStereo ? "stereo" : "mono") + " " + (is16Bit ? "16-bit" : "8-bit") + " " + (sampleRate / 1000f) + "kHz, " + desiredFrames + " frames buffer"); + + // Let the user pick a larger buffer if they really want -- but ye + // gods they probably shouldn't, the minimums are horrifyingly high + // latency already + desiredFrames = Math.max(desiredFrames, (AudioTrack.getMinBufferSize(sampleRate, channelConfig, audioFormat) + frameSize - 1) / frameSize); + + if (mAudioTrack == null) { + mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, + channelConfig, audioFormat, desiredFrames * frameSize, AudioTrack.MODE_STREAM); + + // Instantiating AudioTrack can "succeed" without an exception and the track may still be invalid + // Ref: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/media/java/android/media/AudioTrack.java + // Ref: http://developer.android.com/reference/android/media/AudioTrack.html#getState() + + if (mAudioTrack.getState() != AudioTrack.STATE_INITIALIZED) { + Log.e("SDL", "Failed during initialization of Audio Track"); + mAudioTrack = null; + return -1; + } + + mAudioTrack.play(); + } + + Log.v("SDL", "SDL audio: got " + ((mAudioTrack.getChannelCount() >= 2) ? "stereo" : "mono") + " " + ((mAudioTrack.getAudioFormat() == AudioFormat.ENCODING_PCM_16BIT) ? "16-bit" : "8-bit") + " " + (mAudioTrack.getSampleRate() / 1000f) + "kHz, " + desiredFrames + " frames buffer"); + + return 0; + } + + public static void audioWriteShortBuffer(short[] buffer) { + for (int i = 0; i < buffer.length; ) { + int result = mAudioTrack.write(buffer, i, buffer.length - i); + if (result > 0) { + i += result; + } else if (result == 0) { + try { + Thread.sleep(1); + } catch(InterruptedException e) { + // Nom nom + } + } else { + Log.w("SDL", "SDL audio: error return from write(short)"); + return; + } + } + } + + public static void audioWriteByteBuffer(byte[] buffer) { + for (int i = 0; i < buffer.length; ) { + int result = mAudioTrack.write(buffer, i, buffer.length - i); + if (result > 0) { + i += result; + } else if (result == 0) { + try { + Thread.sleep(1); + } catch(InterruptedException e) { + // Nom nom + } + } else { + Log.w("SDL", "SDL audio: error return from write(byte)"); + return; + } + } + } + + public static void audioQuit() { + if (mAudioTrack != null) { + mAudioTrack.stop(); + mAudioTrack = null; + } + } +} + +/** + Simple nativeInit() runnable +*/ +class SDLMain implements Runnable { + @Override + public void run() { + // Runs SDL_main() + SDLActivity.nativeInit(); + + //Log.v("SDL", "SDL thread terminated"); + } +} + + +/** + SDLSurface. This is what we draw on, so we need to know when it's created + in order to do anything useful. + + Because of this, that's where we set up the SDL thread +*/ +class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, + View.OnKeyListener, View.OnTouchListener, SensorEventListener { + + // Sensors + protected static SensorManager mSensorManager; + + // Keep track of the surface size to normalize touch events + protected static float mWidth, mHeight; + + // Startup + public SDLSurface(Context context) { + super(context); + getHolder().addCallback(this); + + setFocusable(true); + setFocusableInTouchMode(true); + requestFocus(); + setOnKeyListener(this); + setOnTouchListener(this); + + mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); + + // Some arbitrary defaults to avoid a potential division by zero + mWidth = 1.0f; + mHeight = 1.0f; + } + + // Called when we have a valid drawing surface + @Override + public void surfaceCreated(SurfaceHolder holder) { + Log.v("SDL", "surfaceCreated()"); + holder.setType(SurfaceHolder.SURFACE_TYPE_GPU); + // Set mIsSurfaceReady to 'true' *before* any call to handleResume + SDLActivity.mIsSurfaceReady = true; + } + + // Called when we lose the surface + @Override + public void surfaceDestroyed(SurfaceHolder holder) { + Log.v("SDL", "surfaceDestroyed()"); + // Call this *before* setting mIsSurfaceReady to 'false' + SDLActivity.handlePause(); + SDLActivity.mIsSurfaceReady = false; + + /* We have to clear the current context and destroy the egl surface here + * Otherwise there's BAD_NATIVE_WINDOW errors coming from eglCreateWindowSurface on resume + * Ref: http://stackoverflow.com/questions/8762589/eglcreatewindowsurface-on-ics-and-switching-from-2d-to-3d + */ + + EGL10 egl = (EGL10)EGLContext.getEGL(); + egl.eglMakeCurrent(SDLActivity.mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); + egl.eglDestroySurface(SDLActivity.mEGLDisplay, SDLActivity.mEGLSurface); + SDLActivity.mEGLSurface = EGL10.EGL_NO_SURFACE; + } + + // Called when the surface is resized + @Override + public void surfaceChanged(SurfaceHolder holder, + int format, int width, int height) { + Log.v("SDL", "surfaceChanged()"); + + int sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 by default + switch (format) { + case PixelFormat.A_8: + Log.v("SDL", "pixel format A_8"); + break; + case PixelFormat.LA_88: + Log.v("SDL", "pixel format LA_88"); + break; + case PixelFormat.L_8: + Log.v("SDL", "pixel format L_8"); + break; + case PixelFormat.RGBA_4444: + Log.v("SDL", "pixel format RGBA_4444"); + sdlFormat = 0x15421002; // SDL_PIXELFORMAT_RGBA4444 + break; + case PixelFormat.RGBA_5551: + Log.v("SDL", "pixel format RGBA_5551"); + sdlFormat = 0x15441002; // SDL_PIXELFORMAT_RGBA5551 + break; + case PixelFormat.RGBA_8888: + Log.v("SDL", "pixel format RGBA_8888"); + sdlFormat = 0x16462004; // SDL_PIXELFORMAT_RGBA8888 + break; + case PixelFormat.RGBX_8888: + Log.v("SDL", "pixel format RGBX_8888"); + sdlFormat = 0x16261804; // SDL_PIXELFORMAT_RGBX8888 + break; + case PixelFormat.RGB_332: + Log.v("SDL", "pixel format RGB_332"); + sdlFormat = 0x14110801; // SDL_PIXELFORMAT_RGB332 + break; + case PixelFormat.RGB_565: + Log.v("SDL", "pixel format RGB_565"); + sdlFormat = 0x15151002; // SDL_PIXELFORMAT_RGB565 + break; + case PixelFormat.RGB_888: + Log.v("SDL", "pixel format RGB_888"); + // Not sure this is right, maybe SDL_PIXELFORMAT_RGB24 instead? + sdlFormat = 0x16161804; // SDL_PIXELFORMAT_RGB888 + break; + default: + Log.v("SDL", "pixel format unknown " + format); + break; + } + + mWidth = width; + mHeight = height; + SDLActivity.onNativeResize(width, height, sdlFormat); + Log.v("SDL", "Window size:" + width + "x"+height); + + // Set mIsSurfaceReady to 'true' *before* making a call to handleResume + SDLActivity.mIsSurfaceReady = true; + + if (SDLActivity.mSDLThread == null) { + // This is the entry point to the C app. + // Start up the C app thread and enable sensor input for the first time + + SDLActivity.mSDLThread = new Thread(new SDLMain(), "SDLThread"); + enableSensor(Sensor.TYPE_ACCELEROMETER, true); + SDLActivity.mSDLThread.start(); + } else { + // The app already exists, we resume via handleResume + // Multiple sequential calls to surfaceChanged are handled internally by handleResume + + SDLActivity.handleResume(); + } + } + + // unused + @Override + public void onDraw(Canvas canvas) {} + + + // Key events + @Override + public boolean onKey(View v, int keyCode, KeyEvent event) { + + if (event.getAction() == KeyEvent.ACTION_DOWN) { + //Log.v("SDL", "key down: " + keyCode); + SDLActivity.onNativeKeyDown(keyCode); + return true; + } + else if (event.getAction() == KeyEvent.ACTION_UP) { + //Log.v("SDL", "key up: " + keyCode); + SDLActivity.onNativeKeyUp(keyCode); + return true; + } + + return false; + } + + // Touch events + @Override + public boolean onTouch(View v, MotionEvent event) { + final int touchDevId = event.getDeviceId(); + final int pointerCount = event.getPointerCount(); + // touchId, pointerId, action, x, y, pressure + int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */ + int pointerFingerId = event.getPointerId(actionPointerIndex); + int action = (event.getAction() & MotionEvent.ACTION_MASK); /* API 8: event.getActionMasked(); */ + + float x = event.getX(actionPointerIndex) / mWidth; + float y = event.getY(actionPointerIndex) / mHeight; + float p = event.getPressure(actionPointerIndex); + + if (action == MotionEvent.ACTION_MOVE && pointerCount > 1) { + // TODO send motion to every pointer if its position has + // changed since prev event. + for (int i = 0; i < pointerCount; i++) { + pointerFingerId = event.getPointerId(i); + x = event.getX(i) / mWidth; + y = event.getY(i) / mHeight; + p = event.getPressure(i); + SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); + } + } else { + SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p); + } + return true; + } + + // Sensor events + public void enableSensor(int sensortype, boolean enabled) { + // TODO: This uses getDefaultSensor - what if we have >1 accels? + if (enabled) { + mSensorManager.registerListener(this, + mSensorManager.getDefaultSensor(sensortype), + SensorManager.SENSOR_DELAY_GAME, null); + } else { + mSensorManager.unregisterListener(this, + mSensorManager.getDefaultSensor(sensortype)); + } + } + + @Override + public void onAccuracyChanged(Sensor sensor, int accuracy) { + // TODO + } + + @Override + public void onSensorChanged(SensorEvent event) { + if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) { + SDLActivity.onNativeAccel(event.values[0] / SensorManager.GRAVITY_EARTH, + event.values[1] / SensorManager.GRAVITY_EARTH, + event.values[2] / SensorManager.GRAVITY_EARTH); + } + } + +} + +/* This is a fake invisible editor view that receives the input and defines the + * pan&scan region + */ +class DummyEdit extends View implements View.OnKeyListener { + InputConnection ic; + + public DummyEdit(Context context) { + super(context); + setFocusableInTouchMode(true); + setFocusable(true); + setOnKeyListener(this); + } + + @Override + public boolean onCheckIsTextEditor() { + return true; + } + + @Override + public boolean onKey(View v, int keyCode, KeyEvent event) { + + // This handles the hardware keyboard input + if (event.isPrintingKey()) { + if (event.getAction() == KeyEvent.ACTION_DOWN) { + ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1); + } + return true; + } + + if (event.getAction() == KeyEvent.ACTION_DOWN) { + SDLActivity.onNativeKeyDown(keyCode); + return true; + } else if (event.getAction() == KeyEvent.ACTION_UP) { + SDLActivity.onNativeKeyUp(keyCode); + return true; + } + + return false; + } + + // + @Override + public boolean onKeyPreIme (int keyCode, KeyEvent event) { + // As seen on StackOverflow: http://stackoverflow.com/questions/7634346/keyboard-hide-event + // FIXME: Discussion at http://bugzilla.libsdl.org/show_bug.cgi?id=1639 + // FIXME: This is not a 100% effective solution to the problem of detecting if the keyboard is showing or not + // FIXME: A more effective solution would be to change our Layout from AbsoluteLayout to Relative or Linear + // FIXME: And determine the keyboard presence doing this: http://stackoverflow.com/questions/2150078/how-to-check-visibility-of-software-keyboard-in-android + // FIXME: An even more effective way would be if Android provided this out of the box, but where would the fun be in that :) + if (event.getAction()==KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) { + if (SDLActivity.mTextEdit != null && SDLActivity.mTextEdit.getVisibility() == View.VISIBLE) { + SDLActivity.onNativeKeyboardFocusLost(); + } + } + return super.onKeyPreIme(keyCode, event); + } + + @Override + public InputConnection onCreateInputConnection(EditorInfo outAttrs) { + ic = new SDLInputConnection(this, true); + + outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI + | 33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */; + + return ic; + } +} + +class SDLInputConnection extends BaseInputConnection { + + public SDLInputConnection(View targetView, boolean fullEditor) { + super(targetView, fullEditor); + + } + + @Override + public boolean sendKeyEvent(KeyEvent event) { + + /* + * This handles the keycodes from soft keyboard (and IME-translated + * input from hardkeyboard) + */ + int keyCode = event.getKeyCode(); + if (event.getAction() == KeyEvent.ACTION_DOWN) { + if (event.isPrintingKey()) { + commitText(String.valueOf((char) event.getUnicodeChar()), 1); + } + SDLActivity.onNativeKeyDown(keyCode); + return true; + } else if (event.getAction() == KeyEvent.ACTION_UP) { + + SDLActivity.onNativeKeyUp(keyCode); + return true; + } + return super.sendKeyEvent(event); + } + + @Override + public boolean commitText(CharSequence text, int newCursorPosition) { + + nativeCommitText(text.toString(), newCursorPosition); + + return super.commitText(text, newCursorPosition); + } + + @Override + public boolean setComposingText(CharSequence text, int newCursorPosition) { + + nativeSetComposingText(text.toString(), newCursorPosition); + + return super.setComposingText(text, newCursorPosition); + } + + public native void nativeCommitText(String text, int newCursorPosition); + + public native void nativeSetComposingText(String text, int newCursorPosition); + +} + diff --git a/build-scripts/config.guess b/build-scripts/config.guess old mode 100755 new mode 100644 index e792aac608..137bedf2e2 --- a/build-scripts/config.guess +++ b/build-scripts/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-09-18' +timestamp='2012-08-14' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ timestamp='2009-09-18' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -56,8 +54,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -144,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -180,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -201,6 +200,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -223,7 +226,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -269,7 +272,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -295,7 +301,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -333,6 +339,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" @@ -391,23 +400,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -477,8 +486,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -491,7 +500,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -548,7 +557,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -591,52 +600,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include - #include + #define _HPUX_SOURCE + #include + #include - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -727,22 +736,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -766,14 +775,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -785,34 +794,39 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in + *:Interix*:*) + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd | genuineintel) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -854,6 +868,13 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -863,7 +884,7 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -875,23 +896,40 @@ EOF then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-gnu + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -918,15 +956,11 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -952,7 +986,7 @@ EOF echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -960,14 +994,17 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -976,11 +1013,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1012,7 +1049,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1040,13 +1077,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1081,8 +1118,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1125,10 +1162,10 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1154,11 +1191,11 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1171,6 +1208,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1223,7 +1263,10 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1268,13 +1311,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1292,11 +1335,11 @@ EOF i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c < printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff --git a/build-scripts/config.sub b/build-scripts/config.sub old mode 100755 new mode 100644 index 5ecc18b6ad..bdda9e4a32 --- a/build-scripts/config.sub +++ b/build-scripts/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2009-10-07' +timestamp='2012-08-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ timestamp='2009-10-07' # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -75,8 +73,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,13 +122,18 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -156,8 +160,8 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -173,10 +177,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -221,6 +225,12 @@ case $os in -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -245,17 +255,22 @@ case $basic_machine in # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -281,28 +296,39 @@ case $basic_machine in | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -312,6 +338,21 @@ case $basic_machine in basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -326,21 +367,25 @@ case $basic_machine in # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ @@ -366,24 +411,29 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ | tron-* \ - | v850-* | v850e-* | vax-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -408,7 +458,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -478,11 +528,20 @@ case $basic_machine in basic_machine=powerpc-ibm os=-cnk ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -514,7 +573,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -672,7 +731,6 @@ case $basic_machine in i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -730,9 +788,13 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -769,10 +831,18 @@ case $basic_machine in ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -837,6 +907,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -919,9 +995,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1015,6 +1092,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1071,20 +1151,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1154,6 +1222,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1251,9 +1322,12 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1275,21 +1349,22 @@ case $os in # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -kopensolaris* \ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1336,7 +1411,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1385,7 +1460,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1430,6 +1505,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1452,10 +1529,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1467,8 +1544,20 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1488,14 +1577,11 @@ case $basic_machine in ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1522,7 +1608,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff --git a/build-scripts/fatbuild.sh b/build-scripts/fatbuild.sh deleted file mode 100755 index 8b99c1ddca..0000000000 --- a/build-scripts/fatbuild.sh +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# -# Build a fat binary on Mac OS X, thanks Ryan! - -# Number of CPUs (for make -j) -NCPU=`sysctl -n hw.ncpu` -if test x$NJOB = x; then - NJOB=$NCPU -fi - -# SDK path -if test x$SDK_PATH = x; then - SDK_PATH=/Developer/SDKs -fi - -# Generic, cross-platform CFLAGS you always want go here. -CFLAGS="-O3 -g -pipe" - -# We dynamically load X11, so using the system X11 headers is fine. -BASE_CONFIG_FLAGS="--build=`uname -p`-apple-darwin \ ---x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib" - -# PowerPC 32-bit compiler flags -CONFIG_PPC="--host=powerpc-apple-darwin" -CC_PPC="gcc-4.0" -CXX_PPC="g++-4.0" -BUILD_FLAGS_PPC="-arch ppc -mmacosx-version-min=10.4" - -# Intel 32-bit compiler flags -CONFIG_X86="--host=i386-apple-darwin" -CC_X86="gcc" -CXX_X86="g++" -BUILD_FLAGS_X86="-arch i386 -mmacosx-version-min=10.4" - -# Intel 64-bit compiler flags -CONFIG_X64="--host=x86_64-apple-darwin" -CC_X64="gcc" -CXX_X64="g++" -BUILD_FLAGS_X64="-arch x86_64 -mmacosx-version-min=10.6" - -# -# Find the configure script -# -srcdir=`dirname $0`/.. -auxdir=$srcdir/build-scripts -cd $srcdir - -allow_ppc="yes" -which gcc-4.0 >/dev/null 2>/dev/null -if [ "x$?" = "x1" ]; then - #echo "WARNING: Can't find gcc-4.0, which means you don't have Xcode 3." - #echo "WARNING: Therefore, we can't do PowerPC support." - allow_ppc="no" -fi - -# -# Figure out which phase to build: -# all, -# configure, configure-ppc, configure-x86, configure-x64 -# make, make-ppc, make-x86, make-x64, merge -# install -# clean -if test x"$1" = x; then - phase=all -else - phase="$1" -fi -case $phase in - all) - configure_ppc="$allow_ppc" - configure_x86="yes" - configure_x64="yes" - make_ppc="$allow_ppc" - make_x86="yes" - make_x64="yes" - merge="yes" - ;; - configure) - configure_ppc="$allow_ppc" - configure_x86="yes" - configure_x64="yes" - ;; - configure-ppc) - configure_ppc="$allow_ppc" - ;; - configure-x86) - configure_x86="yes" - ;; - configure-x64) - configure_x64="yes" - ;; - make) - make_ppc="$allow_ppc" - make_x86="yes" - make_x64="yes" - merge="yes" - ;; - make-ppc) - make_ppc="$allow_ppc" - ;; - make-x86) - make_x86="yes" - ;; - make-x64) - make_x64="yes" - ;; - merge) - merge="yes" - ;; - install) - install_bin="yes" - install_hdrs="yes" - install_lib="yes" - install_data="yes" - install_man="yes" - ;; - install-bin) - install_bin="yes" - ;; - install-hdrs) - install_hdrs="yes" - ;; - install-lib) - install_lib="yes" - ;; - install-data) - install_data="yes" - ;; - install-man) - install_man="yes" - ;; - clean) - clean_ppc="yes" - clean_x86="yes" - clean_x64="yes" - ;; - clean-ppc) - clean_ppc="yes" - ;; - clean-x86) - clean_x86="yes" - ;; - clean-x64) - clean_x64="yes" - ;; - *) - echo "Usage: $0 [all|configure[-ppc|-x86|-x64]|make[-ppc|-x86|-x64]|merge|install|clean[-ppc|-x86|-x64]]" - exit 1 - ;; -esac -case `uname -p` in - *86) - native_path=x86 - ;; - *powerpc) - native_path=ppc - ;; - x86_64) - native_path=x64 - ;; - *) - echo "Couldn't figure out native architecture path" - exit 1 - ;; -esac - -# -# Create the build directories -# -for dir in build build/ppc build/x86 build/x64; do - if test -d $dir; then - : - else - mkdir $dir || exit 1 - fi -done - - -# -# Build the PowerPC 32-bit binary -# -if test x$configure_ppc = xyes; then - (cd build/ppc && \ - sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $BUILD_FLAGS_PPC $CFLAGS_PPC" LDFLAGS="$BUILD_FLAGS_PPC $LFLAGS_PPC") || exit 2 -fi -if test x$make_ppc = xyes; then - (cd build/ppc && make -j$NJOB) || exit 3 -fi -# -# Build the Intel 32-bit binary -# -if test x$configure_x86 = xyes; then - (cd build/x86 && \ - sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $BUILD_FLAGS_X86 $CFLAGS_X86" LDFLAGS="$BUILD_FLAGS_X86 $LFLAGS_X86") || exit 2 -fi -if test x$make_x86 = xyes; then - (cd build/x86 && make -j$NJOB) || exit 3 -fi - -# -# Build the Intel 64-bit binary -# -if test x$configure_x64 = xyes; then - (cd build/x64 && \ - sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X64 CC="$CC_X64" CXX="$CXX_X64" CFLAGS="$CFLAGS $BUILD_FLAGS_X64 $CFLAGS_X64" LDFLAGS="$BUILD_FLAGS_X64 $LFLAGS_X64") || exit 2 -fi -if test x$make_x64 = xyes; then - (cd build/x64 && make -j$NJOB) || exit 3 -fi - -# -# Combine into fat binary -# -if test x$merge = xyes; then - output=.libs - sh $auxdir/mkinstalldirs build/$output - cd build - target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'` - (lipo -create -o $output/$target `find . -mindepth 4 -maxdepth 4 -type f -name "*.dylib"` && - ln -sf $target $output/libSDL.dylib && - lipo -create -o $output/libSDL.a */build/.libs/libSDL.a && - cp $native_path/build/.libs/libSDL.la $output && - cp $native_path/build/.libs/libSDL.lai $output && - cp $native_path/build/libSDL.la . && - lipo -create -o $output/libSDLmain.a */build/.libs/libSDLmain.a && - cp $native_path/build/.libs/libSDLmain.la $output && - cp $native_path/build/.libs/libSDLmain.lai $output && - cp $native_path/build/libSDLmain.la . && - echo "Build complete!" && - echo "Files can be found in the build directory.") || exit 4 - cd .. -fi - -# -# Install -# -do_install() -{ - echo $* - $* || exit 5 -} -if test x$prefix = x; then - prefix=/usr/local -fi -if test x$exec_prefix = x; then - exec_prefix=$prefix -fi -if test x$bindir = x; then - bindir=$exec_prefix/bin -fi -if test x$libdir = x; then - libdir=$exec_prefix/lib -fi -if test x$includedir = x; then - includedir=$prefix/include -fi -if test x$datadir = x; then - datadir=$prefix/share -fi -if test x$mandir = x; then - mandir=$prefix/man -fi -if test x$install_bin = xyes; then - do_install sh $auxdir/mkinstalldirs $bindir - do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config -fi -if test x$install_hdrs = xyes; then - do_install sh $auxdir/mkinstalldirs $includedir/SDL - for src in $srcdir/include/*.h; do \ - file=`echo $src | sed -e 's|^.*/||'`; \ - do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \ - done - do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h -fi -if test x$install_lib = xyes; then - do_install sh $auxdir/mkinstalldirs $libdir - do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la - do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDLmain.la $libdir/libSDLmain.la -fi -if test x$install_data = xyes; then - do_install sh $auxdir/mkinstalldirs $datadir/aclocal - do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4 - do_install sh $auxdir/mkinstalldirs $libdir/pkgconfig - do_install /usr/bin/install -m 644 build/$native_path/sdl.pc $libdir/pkgconfig/sdl.pc -fi -if test x$install_man = xyes; then - do_install sh $auxdir/mkinstalldirs $mandir/man3 - for src in $srcdir/docs/man3/*.3; do \ - file=`echo $src | sed -e 's|^.*/||'`; \ - do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \ - done -fi - -# -# Clean up -# -do_clean() -{ - echo $* - $* || exit 6 -} -if test x$clean_ppc = xyes; then - do_clean rm -r build/ppc -fi -if test x$clean_x86 = xyes; then - do_clean rm -r build/x86 -fi -if test x$clean_x64 = xyes; then - do_clean rm -r build/x64 -fi diff --git a/build-scripts/g++-fat.sh b/build-scripts/g++-fat.sh new file mode 100755 index 0000000000..6e4f53e7ca --- /dev/null +++ b/build-scripts/g++-fat.sh @@ -0,0 +1,101 @@ +#!/bin/sh +# +# Build Universal binaries on Mac OS X, thanks Ryan! +# +# Usage: ./configure CXX="sh g++-fat.sh" && make && rm -rf x86 x64 + +DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer" + +# Intel 32-bit compiler flags (10.6 runtime compatibility) +GCC_COMPILE_X86="g++ -arch i386 -mmacosx-version-min=10.5 \ +-I/usr/local/include" + +GCC_LINK_X86="-mmacosx-version-min=10.5" + +# Intel 64-bit compiler flags (10.6 runtime compatibility) +GCC_COMPILE_X64="g++ -arch x86_64 -mmacosx-version-min=10.6 \ +-I/usr/local/include" + +GCC_LINK_X64="-mmacosx-version-min=10.6" + +# Output both PowerPC and Intel object files +args="$*" +compile=yes +link=yes +while test x$1 != x; do + case $1 in + --version) exec g++ $1;; + -v) exec g++ $1;; + -V) exec g++ $1;; + -print-prog-name=*) exec g++ $1;; + -print-search-dirs) exec g++ $1;; + -E) GCC_COMPILE_X86="$GCC_COMPILE_X86 -E" + GCC_COMPILE_X64="$GCC_COMPILE_X64 -E" + compile=no; link=no;; + -c) link=no;; + -o) output=$2;; + *.c|*.cc|*.cpp|*.S) source=$1;; + esac + shift +done +if test x$link = xyes; then + GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86" + GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64" +fi +if test x"$output" = x; then + if test x$link = xyes; then + output=a.out + elif test x$compile = xyes; then + output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o + fi +fi + +# Compile X86 32-bit +if test x"$output" != x; then + dir=x86/`dirname $output` + if test -d $dir; then + : + else + mkdir -p $dir + fi +fi +set -- $args +while test x$1 != x; do + if test -f "x86/$1" && test "$1" != "$output"; then + x86_args="$x86_args x86/$1" + else + x86_args="$x86_args $1" + fi + shift +done +$GCC_COMPILE_X86 $x86_args || exit $? +if test x"$output" != x; then + cp $output x86/$output +fi + +# Compile X86 32-bit +if test x"$output" != x; then + dir=x64/`dirname $output` + if test -d $dir; then + : + else + mkdir -p $dir + fi +fi +set -- $args +while test x$1 != x; do + if test -f "x64/$1" && test "$1" != "$output"; then + x64_args="$x64_args x64/$1" + else + x64_args="$x64_args $1" + fi + shift +done +$GCC_COMPILE_X64 $x64_args || exit $? +if test x"$output" != x; then + cp $output x64/$output +fi + +if test x"$output" != x; then + lipo -create -o $output x86/$output x64/$output +fi diff --git a/build-scripts/gcc-fat.sh b/build-scripts/gcc-fat.sh new file mode 100755 index 0000000000..edabb0d87b --- /dev/null +++ b/build-scripts/gcc-fat.sh @@ -0,0 +1,102 @@ +#!/bin/sh +# +# Build Universal binaries on Mac OS X, thanks Ryan! +# +# Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf x86 x64 + +DEVELOPER="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer" + +# Intel 32-bit compiler flags (10.5 runtime compatibility) +GCC_COMPILE_X86="gcc -arch i386 -mmacosx-version-min=10.5 \ +-I/usr/local/include" + +GCC_LINK_X86="-mmacosx-version-min=10.5" + +# Intel 64-bit compiler flags (10.6 runtime compatibility) +GCC_COMPILE_X64="gcc -arch x86_64 -mmacosx-version-min=10.6 \ +-DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ +-I/usr/local/include" + +GCC_LINK_X64="-mmacosx-version-min=10.6" + +# Output both PowerPC and Intel object files +args="$*" +compile=yes +link=yes +while test x$1 != x; do + case $1 in + --version) exec gcc $1;; + -v) exec gcc $1;; + -V) exec gcc $1;; + -print-prog-name=*) exec gcc $1;; + -print-search-dirs) exec gcc $1;; + -E) GCC_COMPILE_X86="$GCC_COMPILE_X86 -E" + GCC_COMPILE_X64="$GCC_COMPILE_X64 -E" + compile=no; link=no;; + -c) link=no;; + -o) output=$2;; + *.c|*.cc|*.cpp|*.S) source=$1;; + esac + shift +done +if test x$link = xyes; then + GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86" + GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64" +fi +if test x"$output" = x; then + if test x$link = xyes; then + output=a.out + elif test x$compile = xyes; then + output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o + fi +fi + +# Compile X86 32-bit +if test x"$output" != x; then + dir=x86/`dirname $output` + if test -d $dir; then + : + else + mkdir -p $dir + fi +fi +set -- $args +while test x$1 != x; do + if test -f "x86/$1" && test "$1" != "$output"; then + x86_args="$x86_args x86/$1" + else + x86_args="$x86_args $1" + fi + shift +done +$GCC_COMPILE_X86 $x86_args || exit $? +if test x"$output" != x; then + cp $output x86/$output +fi + +# Compile X86 32-bit +if test x"$output" != x; then + dir=x64/`dirname $output` + if test -d $dir; then + : + else + mkdir -p $dir + fi +fi +set -- $args +while test x$1 != x; do + if test -f "x64/$1" && test "$1" != "$output"; then + x64_args="$x64_args x64/$1" + else + x64_args="$x64_args $1" + fi + shift +done +$GCC_COMPILE_X64 $x64_args || exit $? +if test x"$output" != x; then + cp $output x64/$output +fi + +if test x"$output" != x; then + lipo -create -o $output x86/$output x64/$output +fi diff --git a/build-scripts/iosbuild.sh b/build-scripts/iosbuild.sh new file mode 100755 index 0000000000..eeb5716244 --- /dev/null +++ b/build-scripts/iosbuild.sh @@ -0,0 +1,277 @@ +#!/bin/sh +# +# Build a fat binary for iOS +# Based on fatbuild.sh and code from the Ignifuga Game Engine + +# Number of CPUs (for make -j) +NCPU=`sysctl -n hw.ncpu` +if test x$NJOB = x; then + NJOB=$NCPU +fi + +# SDK path +XCODE_PATH=`xcode-select --print-path` +if [ -z "$XCODE_PATH" ]; then + echo "Could not find XCode location (use xcode-select -switch to set the correct path)" + exit 1 +fi + +prepare_environment() { + ARCH=$1 + + if test x$SDK_VERSION = x; then + export SDK_VERSION=`xcodebuild -showsdks | grep iphoneos | sed "s|.*iphoneos||"` + if [ -z "$XCODE_PATH" ]; then + echo "Could not find a valid iOS SDK" + exit 1 + fi + fi + + case $ARCH in + armv6) + DEV_PATH="$XCODE_PATH/Platforms/iPhoneOS.platform/Developer" + SDK_PATH="$DEV_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk" + ;; + armv7) + DEV_PATH="$XCODE_PATH/Platforms/iPhoneOS.platform/Developer" + SDK_PATH="$DEV_PATH/SDKs/iPhoneOS$SDK_VERSION.sdk" + ;; + i386) + DEV_PATH="$XCODE_PATH/Platforms/iPhoneSimulator.platform/Developer" + SDK_PATH="$DEV_PATH/SDKs/iPhoneSimulator$SDK_VERSION.sdk" + ;; + *) + echo "Unknown Architecture $ARCH" + exit 1 + ;; + esac + + if [ ! -d "$SDK_PATH" ]; then + echo "Could not find iOS SDK at $SDK_PATH" + exit 1 + fi + + if test x$MIN_OS_VERSION = x; then + export MIN_OS_VERSION="3.0" + fi + + # Environment flags + CFLAGS="-g -O2 -pipe -no-cpp-precomp -isysroot $SDK_PATH \ + -miphoneos-version-min=$MIN_OS_VERSION -I$SDK_PATH/usr/include/" + LDFLAGS="-L$SDK_PATH/usr/lib/ -isysroot $SDK_PATH \ + -miphoneos-version-min=$MIN_OS_VERSION -static-libgcc" + export CXXFLAGS="$CFLAGS" + export CXXCPP="$DEV_PATH/usr/bin/llvm-cpp-4.2" + export CPP="$CXXCPP" + export CXX="$DEV_PATH/usr/bin/llvm-g++-4.2" + export CC="$DEV_PATH/usr/bin/llvm-gcc-4.2" + export LD="$DEV_PATH/usr/bin/ld" + export AR="$DEV_PATH/usr/bin/ar" + export AS="$DEV_PATH/usr/bin/ls" + export NM="$DEV_PATH/usr/bin/nm" + export RANLIB="$DEV_PATH/usr/bin/ranlib" + export STRIP="$DEV_PATH/usr/bin/strip" + + # We dynamically load X11, so using the system X11 headers is fine. + CONFIG_FLAGS="--disable-shared --enable-static" + + case $ARCH in + armv6) + export CONFIG_FLAGS="$CONFIG_FLAGS --host=armv6-apple-darwin" + export CFLAGS="$CFLAGS -arch armv6" + export LDFLAGS="$LDFLAGS -arch armv6" + ;; + armv7) + export CONFIG_FLAGS="$CONFIG_FLAGS --host=armv7-apple-darwin" + export CFLAGS="$CFLAGS -arch armv7" + export LDFLAGS="$LDFLAGS -arch armv7" + ;; + i386) + export CONFIG_FLAGS="$CONFIG_FLAGS --host=i386-apple-darwin" + export CFLAGS="$CFLAGS -arch i386" + export LDFLAGS="$LDFLAGS -arch i386" + ;; + *) + echo "Unknown Architecture $ARCH" + exit 1 + ;; + esac +} + +prepare_environment "armv6" +echo "Building with iOS SDK v$SDK_VERSION for iOS >= $MIN_OS_VERSION" + +# +# Find the configure script +# +srcdir=`dirname $0`/.. +srcdir=`cd $srcdir && pwd` +auxdir=$srcdir/build-scripts +cd $srcdir + +# +# Figure out which phase to build: +# all, +# configure, configure-armv6, configure-armv7, configure-i386 +# make, make-armv6, make-armv7, make-i386, merge +# clean +if test x"$1" = x; then + phase=all +else + phase="$1" +fi +case $phase in + all) + configure_armv6="yes" + configure_armv7="yes" + configure_i386="yes" + make_armv6="yes" + make_armv7="yes" + make_i386="yes" + merge="yes" + ;; + configure) + configure_armv6="yes" + configure_armv7="yes" + configure_i386="yes" + ;; + configure-armv6) + configure_armv6="yes" + ;; + configure-armv7) + configure_armv7="yes" + ;; + configure-i386) + configure_i386="yes" + ;; + make) + make_armv6="yes" + make_armv7="yes" + make_i386="yes" + merge="yes" + ;; + make-armv6) + make_armv6="yes" + ;; + make-armv7) + make_armv7="yes" + ;; + make-i386) + make_i386="yes" + ;; + merge) + merge="yes" + ;; + clean) + clean_armv6="yes" + clean_armv7="yes" + clean_i386="yes" + ;; + clean-armv6) + clean_armv6="yes" + ;; + clean-armv7) + clean_armv7="yes" + ;; + clean-i386) + clean_i386="yes" + ;; + *) + echo "Usage: $0 [all|configure[-armv6|-armv7|-i386]|make[-armv6|-armv7|-i386]|merge|clean[-armv6|-armv7|-i386]]" + exit 1 + ;; +esac + +# +# Create the build directories +# +for dir in build build/armv6 build/armv7 build/i386; do + if test -d $dir; then + : + else + mkdir $dir || exit 1 + fi +done + +# +# Build the armv6 binary +# +prepare_environment "armv6" +if test x$configure_armv6 = xyes; then + (cd build/armv6 && \ + sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2 + # configure is not yet fully ready for iOS, some manual patching is required + cp include/* build/armv6/include + cp include/SDL_config_iphoneos.h build/armv6/include/SDL_config.h || exit 2 + sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/armv6/Makefile || exit 2 + sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/armv6/Makefile || exit 2 +fi +if test x$make_armv6 = xyes; then + (cd build/armv6 && make -j$NJOB) || exit 3 +fi +# +# Build the armv7 binary +# +prepare_environment "armv7" +if test x$configure_armv7 = xyes; then + (cd build/armv7 && \ + sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2 + # configure is not yet fully ready for iOS, some manual patching is required + cp include/* build/armv7/include + cp include/SDL_config_iphoneos.h build/armv7/include/SDL_config.h || exit 2 + sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/armv7/Makefile || exit 2 + sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/armv7/Makefile || exit 2 +fi +if test x$make_armv7 = xyes; then + (cd build/armv7 && make -j$NJOB) || exit 3 +fi +# +# Build the i386 binary +# +prepare_environment "i386" +if test x$configure_i386 = xyes; then + (cd build/i386 && \ + sh ../../configure $CONFIG_FLAGS CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS") || exit 2 + # configure is not yet fully ready for iOS, some manual patching is required + cp include/* build/i386/include + cp include/SDL_config_iphoneos.h build/i386/include/SDL_config.h || exit 2 + sed -i "" -e "s|^EXTRA_CFLAGS.*|EXTRA_CFLAGS=-I./include|g" build/i386/Makefile || exit 2 + sed -i "" -e "s|^EXTRA_LDFLAGS.*|EXTRA_LDFLAGS=-lm|g" build/i386/Makefile || exit 2 +fi +if test x$make_i386 = xyes; then + (cd build/i386 && make -j$NJOB) || exit 3 +fi + +# +# Combine into fat binary +# +if test x$merge = xyes; then + output=ios/lib + sh $auxdir/mkinstalldirs build/$output + cd build + target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'` + (lipo -create -o $output/libSDL2.a armv6/build/.libs/libSDL2.a armv7/build/.libs/libSDL2.a i386/build/.libs/libSDL2.a && + lipo -create -o $output/libSDL2main.a armv6/build/libSDL2main.a armv7/build/libSDL2main.a i386/build/libSDL2main.a && + cp -r armv6/include ios + echo "Build complete!" && + echo "Files can be found under the build/ios directory.") || exit 4 + cd .. +fi + +# +# Clean up +# +do_clean() +{ + echo $* + $* || exit 6 +} +if test x$clean_armv6 = xyes; then + do_clean rm -r build/armv6 +fi +if test x$clean_armv7 = xyes; then + do_clean rm -r build/armv7 +fi +if test x$clean_i386 = xyes; then + do_clean rm -r build/i386 +fi diff --git a/build-scripts/ltmain.sh b/build-scripts/ltmain.sh old mode 100644 new mode 100755 index 5e04f0862f..63ae69dc6f --- a/build-scripts/ltmain.sh +++ b/build-scripts/ltmain.sh @@ -1,9 +1,9 @@ -# Generated from ltmain.m4sh. -# ltmain.sh (GNU libtool) 2.2.6 +# libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -32,50 +32,57 @@ # # Provide generalized library-building support services. # -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long help message +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory # -# MODE-ARGS vary depending on the MODE. +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6 -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . -PROGRAM=ltmain.sh +PROGRAM=libtool PACKAGE=libtool -VERSION=2.2.6 +VERSION=2.4.2 TIMESTAMP="" -package_revision=1.3012 +package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -91,10 +98,15 @@ fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + # NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -107,24 +119,28 @@ do lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL $lt_unset CDPATH +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" : ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/usr/bin/grep -E"} -: ${FGREP="/usr/bin/grep -F"} -: ${GREP="/usr/bin/grep"} -: ${LN_S="ln -s"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} -: ${SED="/opt/local/bin/gsed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} @@ -144,6 +160,27 @@ IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -158,33 +195,183 @@ basename="s,^.*/,," # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } -# Generated shell functions inserted here. +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} # The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -196,7 +383,7 @@ case $progpath in ;; *) save_IFS="$IFS" - IFS=: + IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break @@ -215,6 +402,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -243,7 +439,7 @@ opt_warning=: # name if it has been set yet. func_echo () { - $ECHO "$progname${mode+: }$mode: $*" + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... @@ -258,18 +454,25 @@ func_verbose () : } +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + # func_error arg... # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -326,9 +529,9 @@ func_mkdir_p () case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -378,7 +581,7 @@ func_mktempdir () func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "X$my_tmpdir" | $Xsed + $ECHO "$my_tmpdir" } @@ -392,7 +595,7 @@ func_quote_for_eval () { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -419,7 +622,7 @@ func_quote_for_expand () { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ + my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -488,15 +691,39 @@ func_show_eval_locale () fi } - - +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} # func_version # Echo version message to standard output and exit. func_version () { - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ @@ -509,22 +736,28 @@ func_version () # Echo short help message to standard output and exit. func_usage () { - $SED -n '/^# Usage:/,/# -h/ { + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - $ECHO + echo $ECHO "run \`$progname --help | more' for full usage" exit $? } -# func_help -# Echo long help message to standard output and exit. +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. func_help () { + $opt_debug + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -534,11 +767,18 @@ func_help () s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p - }' < "$progpath" - exit $? + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi } # func_missing_arg argname @@ -546,63 +786,106 @@ func_help () # exit_cmd. func_missing_arg () { - func_error "missing argument for $1" + $opt_debug + + func_error "missing argument for $1." exit_cmd=exit } -exit_cmd=: +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -636,16 +919,16 @@ func_config () # Display the features supported by this script. func_features () { - $ECHO "host: $host" + echo "host: $host" if test "$build_libtool_libs" = yes; then - $ECHO "enable shared libraries" + echo "enable shared libraries" else - $ECHO "disable shared libraries" + echo "disable shared libraries" fi if test "$build_old_libs" = yes; then - $ECHO "enable static libraries" + echo "enable static libraries" else - $ECHO "disable static libraries" + echo "disable static libraries" fi exit $? @@ -692,117 +975,209 @@ func_enable_tag () esac } -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () { + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - # Parse non-mode specific arguments: - while test "$#" -gt 0; do +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do opt="$1" shift - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" + --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" - opt_debug='set -x' $opt_debug ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift + --dry-run|--dryrun|-n) + opt_dry_run=: ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" shift ;; - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: + opt_preserve_dup_deps=: ;; - - --verbose| -v) preserve_args="$preserve_args $opt" + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) opt_silent=false +func_append preserve_args " $opt" ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" shift ;; + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -810,82 +1185,44 @@ func_enable_tag () opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} + $opt_help || { + # Sanity checks first: + func_check_version_match -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" fi - exit $EXIT_MISMATCH - fi -} - - -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi - test -z "$mode" && func_fatal_error "error: you must specify a MODE." + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} +## ----------- ## +## Main. ## +## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. @@ -950,12 +1287,9 @@ func_ltwrapper_executable_p () # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_ltwrapper_scriptname_result="" - if func_ltwrapper_executable_p "$1"; then - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" - fi + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file @@ -1001,6 +1335,37 @@ func_source () } +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1013,13 +1378,15 @@ func_infer_tag () if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) @@ -1030,11 +1397,13 @@ func_infer_tag () CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" + func_append_quoted CC_quoted "$arg" done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. @@ -1097,6 +1466,486 @@ EOF } } + +################################################## +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # +################################################## + +# func_convert_core_file_wine_to_w32 ARG +# Helper function used by file name conversion functions when $build is *nix, +# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. +# +# ARG is the $build file name to be converted to w32 format. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will +# be empty on error (or when ARG is empty) +func_convert_core_file_wine_to_w32 () +{ + $opt_debug + func_convert_core_file_wine_to_w32_result="$1" + if test -n "$1"; then + # Unfortunately, winepath does not exit with a non-zero error code, so we + # are forced to check the contents of stdout. On the other hand, if the + # command is not found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both error code of + # zero AND non-empty stdout, which explains the odd construction: + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + # func_mode_compile arg... func_mode_compile () { @@ -1137,12 +1986,12 @@ func_mode_compile () ;; -pie | -fpie | -fPIE) - pie_flag="$pie_flag $arg" + func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" + func_append later " $arg" continue ;; @@ -1163,15 +2012,14 @@ func_mode_compile () save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_quote_for_eval "$arg" - lastarg="$lastarg $func_quote_for_eval_result" + func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" + func_append base_compile " $lastarg" continue ;; @@ -1187,8 +2035,7 @@ func_mode_compile () esac # case $arg_mode # Aesthetically quote the previous argument. - func_quote_for_eval "$lastarg" - base_compile="$base_compile $func_quote_for_eval_result" + func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in @@ -1213,7 +2060,7 @@ func_mode_compile () *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx) + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; @@ -1288,7 +2135,7 @@ func_mode_compile () # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -1319,17 +2166,16 @@ compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - removelist="$removelist $output_obj" + func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - removelist="$removelist $lockfile" + func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -1349,7 +2195,7 @@ compiler." if test -z "$output_obj"; then # Place PIC objects in $objdir - command="$command -o $lobj" + func_append command " -o $lobj" fi func_show_eval_locale "$command" \ @@ -1396,11 +2242,11 @@ compiler." command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - command="$command -o $obj" + func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" + func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -1445,13 +2291,13 @@ compiler." } $opt_help || { -test "$mode" = compile && func_mode_compile ${1+"$@"} + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $mode in + case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -1482,10 +2328,11 @@ This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -1538,7 +2385,7 @@ either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: - -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." @@ -1558,6 +2405,8 @@ The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) @@ -1586,6 +2435,11 @@ The following components of LINK-COMMAND are treated specially: -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. @@ -1619,18 +2473,44 @@ Otherwise, only FILE itself is deleted using RM." ;; *) - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac - $ECHO + echo $ECHO "Try \`$progname --help' for more information about other modes." - - exit $? } - # Now that we've collected a possible --mode arg, show help if necessary - $opt_help && func_mode_help +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi # func_mode_execute arg... @@ -1643,13 +2523,16 @@ func_mode_execute () func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do + for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -1671,7 +2554,7 @@ func_mode_execute () dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" + func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -1712,7 +2595,7 @@ func_mode_execute () for file do case $file in - -*) ;; + -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then @@ -1728,8 +2611,7 @@ func_mode_execute () ;; esac # Quote arguments (to preserve shell metacharacters). - func_quote_for_eval "$file" - args="$args $func_quote_for_eval_result" + func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then @@ -1754,29 +2636,66 @@ func_mode_execute () # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - $ECHO "export $shlibpath_var" + echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } -test "$mode" = execute && func_mode_execute ${1+"$@"} +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug - libdirs="$nonopt" + libs= + libdirs= admincmds= - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -1786,7 +2705,7 @@ func_mode_finish () if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || admincmds="$admincmds + $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done @@ -1795,53 +2714,55 @@ func_mode_finish () # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS - $ECHO "X----------------------------------------------------------------------" | $Xsed - $ECHO "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - $ECHO - $ECHO "If you ever happen to want to link against installed libraries" - $ECHO "in a given directory, LIBDIR, you must either use libtool, and" - $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" - $ECHO "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" - $ECHO " during execution" - fi - if test -n "$runpath_var"; then - $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" - $ECHO " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $ECHO + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo - $ECHO "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" - $ECHO "pages." - ;; - *) - $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - $ECHO "X----------------------------------------------------------------------" | $Xsed + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi exit $EXIT_SUCCESS } -test "$mode" = finish && func_mode_finish ${1+"$@"} +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -1852,7 +2773,7 @@ func_mode_install () # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - $ECHO "X$nonopt" | $GREP shtool >/dev/null; then + case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -1866,7 +2787,12 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac # We need to accept at least all the BSD install flags. dest= @@ -1876,10 +2802,12 @@ func_mode_install () install_type= isdir=no stripme= + no_mode=: for arg do + arg2= if test -n "$dest"; then - files="$files $dest" + func_append files " $dest" dest=$arg continue fi @@ -1887,10 +2815,9 @@ func_mode_install () case $arg in -d) isdir=yes ;; -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac + if $install_cp; then :; else + prev=$arg + fi ;; -g | -m | -o) prev=$arg @@ -1904,6 +2831,10 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi prev= else dest=$arg @@ -1914,7 +2845,11 @@ func_mode_install () # Aesthetically quote the argument. func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -1923,6 +2858,13 @@ func_mode_install () test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" @@ -1977,10 +2919,13 @@ func_mode_install () case $file in *.$libext) # Do the static libraries later. - staticlibs="$staticlibs $file" + func_append staticlibs " $file" ;; *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -1994,23 +2939,23 @@ func_mode_install () if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; + *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; + *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - dir="$dir$objdir" + func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -2023,9 +2968,9 @@ func_mode_install () if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2043,7 +2988,7 @@ func_mode_install () test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. - func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in @@ -2083,7 +3028,7 @@ func_mode_install () func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) @@ -2183,7 +3128,7 @@ func_mode_install () if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no @@ -2202,7 +3147,7 @@ func_mode_install () file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -2221,7 +3166,7 @@ func_mode_install () } else # Install the binary that we compiled earlier. - file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -2257,11 +3202,13 @@ func_mode_install () # Set up the ranlib parameters. oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $oldlib" 'exit $?' + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. @@ -2280,7 +3227,7 @@ func_mode_install () fi } -test "$mode" = install && func_mode_install ${1+"$@"} +test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -2323,6 +3270,22 @@ func_generate_dlsyms () extern \"C\" { #endif +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + /* External symbol declarations for the compiler. */\ " @@ -2332,10 +3295,11 @@ extern \"C\" { $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_verbose "extracting global C symbols from \`$progfile'" - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -2371,7 +3335,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -2384,10 +3348,52 @@ extern \"C\" { func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac done $opt_dry_run || { @@ -2415,36 +3421,19 @@ extern \"C\" { if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; -" - case $host in - *cygwin* | *mingw* | *cegcc* ) - $ECHO >> "$output_objdir/$my_dlsyms" "\ -/* DATA imports from DLLs on WIN32 con't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs. */" - lt_dlsym_const= ;; - *osf5*) - echo >> "$output_objdir/$my_dlsyms" "\ -/* This system does not cope well with relocations in const data */" - lt_dlsym_const= ;; - *) - lt_dlsym_const=const ;; - esac - - $ECHO >> "$output_objdir/$my_dlsyms" "\ -extern $lt_dlsym_const lt_dlsymlist +extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -$lt_dlsym_const lt_dlsymlist +LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -2457,7 +3446,7 @@ lt_${my_prefix}_LTX_preloaded_symbols[] = eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - $ECHO >> "$output_objdir/$my_dlsyms" "\ + echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -2484,7 +3473,7 @@ static const void *lt_preloaded_setup() { # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; @@ -2500,7 +3489,7 @@ static const void *lt_preloaded_setup() { for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) symtab_cflags="$symtab_cflags $arg" ;; + *) func_append symtab_cflags " $arg" ;; esac done @@ -2515,16 +3504,16 @@ static const void *lt_preloaded_setup() { case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -2538,8 +3527,8 @@ static const void *lt_preloaded_setup() { # really was required. # Nullify the symbol file. - compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } @@ -2549,6 +3538,7 @@ static const void *lt_preloaded_setup() { # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug @@ -2559,9 +3549,11 @@ func_win32_libid () win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ @@ -2590,6 +3582,131 @@ func_win32_libid () $ECHO "$win32_libid_type" } +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} # func_extract_an_archive dir oldlib @@ -2598,7 +3715,18 @@ func_extract_an_archive () $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else @@ -2669,7 +3797,7 @@ func_extract_archives () darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -2684,25 +3812,30 @@ func_extract_archives () func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } - -# func_emit_wrapper_part1 [arg=no] +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. # -# Emit the first part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part1 () +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () { - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 - fi + func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL @@ -2718,7 +3851,6 @@ func_emit_wrapper_part1 () # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible @@ -2749,31 +3881,135 @@ if test \"\$libtool_install_magic\" = \"$magic\"; then else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - ECHO=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$ECHO works! - : - else - # Restart under the correct shell, and then maybe \$ECHO will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ " - $ECHO "\ + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -2783,30 +4019,13 @@ else esac fi - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done -" -} -# end: func_emit_wrapper_part1 - -# func_emit_wrapper_part2 [arg=no] -# -# Emit the second part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part2 () -{ - func_emit_wrapper_part2_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part2_arg1=$1 - fi - - $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -2814,7 +4033,7 @@ func_emit_wrapper_part2 () fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -2869,6 +4088,18 @@ func_emit_wrapper_part2 () if test -f \"\$progdir/\$program\"; then" + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -2877,253 +4108,28 @@ func_emit_wrapper_part2 () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 + func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } -# end: func_emit_wrapper_part2 - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - # split this up so that func_emit_cwrapperexe_src - # can call each part independently. - func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" - func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" -} - - -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_path_tmp1=`( cmd //c echo "$1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_tmp1=`cygpath -w "$1"` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result="" - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - #func_error "Could not determine host path corresponding to" - #func_error " '$1'" - #func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_to_host_pathlist_tmp2="$1" - # Once set for this call, this variable should not be - # reassigned. It is used in tha fallback case. - func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e 's|^:*||' -e 's|:*$||'` - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" - fi - fi - fi - IFS=: - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result" ; then - func_error "Could not determine the host path(s) corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout @@ -3141,31 +4147,23 @@ func_emit_cwrapperexe_src () This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "$SHELL $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. */ EOF cat <<"EOF" +#ifdef _MSC_VER +# define _CRT_SECURE_NO_DEPRECATE 1 +#endif #include #include #ifdef _MSC_VER # include # include # include -# define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include -# define HAVE_SETENV -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif # endif #endif #include @@ -3177,6 +4175,44 @@ int setenv (const char *, const char *, int); #include #include +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) @@ -3192,14 +4228,7 @@ int setenv (const char *, const char *, int); # define S_IXGRP 0 #endif -#ifdef _MSC_VER -# define S_IXUSR _S_IEXEC -# define stat _stat -# ifndef _INTPTR_T_DEFINED -# define intptr_t int -# endif -#endif - +/* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -3230,10 +4259,6 @@ int setenv (const char *, const char *, int); # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ -#ifdef __CYGWIN__ -# define FOPEN_WB "wb" -#endif - #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -3246,22 +4271,13 @@ int setenv (const char *, const char *, int); if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#undef LTWRAPPER_DEBUGPRINTF -#if defined DEBUGWRAPPER -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args -static void -ltwrapper_debugprintf (const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); -} +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; #else -# define LTWRAPPER_DEBUGPRINTF(args) +static int lt_debug = 0; #endif -const char *program_name = NULL; +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -3271,41 +4287,27 @@ char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_fatal (const char *message, ...); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_opt_process_env_set (const char *arg); -void lt_opt_process_env_prepend (const char *arg); -void lt_opt_process_env_append (const char *arg); -int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); - -static const char *script_text_part1 = -EOF - - func_emit_wrapper_part1 yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - cat <"))); + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", + nonnull (lt_argv_zero)); for (i = 0; i < newargc; i++) { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", + i, nonnull (newargz[i])); } EOF @@ -3561,11 +4523,14 @@ EOF mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ + newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); + lt_debugprintf (__FILE__, __LINE__, + "(main) failed to launch target \"%s\": %s\n", + lt_argv_zero, nonnull (strerror (errno))); return 127; } return rval; @@ -3587,7 +4552,7 @@ xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) - lt_fatal ("Memory exhausted"); + lt_fatal (__FILE__, __LINE__, "memory exhausted"); return p; } @@ -3621,8 +4586,8 @@ check_executable (const char *path) { struct stat st; - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3639,8 +4604,8 @@ make_executable (const char *path) int rval = 0; struct stat st; - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", - path ? (*path ? path : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); if ((!path) || (!*path)) return 0; @@ -3666,8 +4631,8 @@ find_executable (const char *wrapper) int tmp_len; char *concat_name; - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; @@ -3720,7 +4685,8 @@ find_executable (const char *wrapper) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -3745,7 +4711,8 @@ find_executable (const char *wrapper) } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -3771,8 +4738,9 @@ chase_symlinks (const char *pathspec) int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", - tmp_pathspec)); + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -3794,8 +4762,9 @@ chase_symlinks (const char *pathspec) } else { - char *errstr = strerror (errno); - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); @@ -3808,7 +4777,8 @@ chase_symlinks (const char *pathspec) tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal ("Could not follow symlinks for %s", pathspec); + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -3834,11 +4804,25 @@ strendzap (char *str, const char *pat) return str; } +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + static void -lt_error_core (int exit_status, const char *mode, +lt_error_core (int exit_status, const char *file, + int line, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s: %s: ", program_name, mode); + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -3847,20 +4831,32 @@ lt_error_core (int exit_status, const char *mode, } void -lt_fatal (const char *message, ...) +lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + void lt_setenv (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ @@ -3905,95 +4901,12 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) return new_value; } -int -lt_split_name_value (const char *arg, char** name, char** value) -{ - const char *p; - int len; - if (!arg || !*arg) - return 1; - - p = strchr (arg, (int)'='); - - if (!p) - return 1; - - *value = xstrdup (++p); - - len = strlen (arg) - strlen (*value); - *name = XMALLOC (char, len); - strncpy (*name, arg, len-1); - (*name)[len - 1] = '\0'; - - return 0; -} - -void -lt_opt_process_env_set (const char *arg) -{ - char *name = NULL; - char *value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); - } - - lt_setenv (name, value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_prepend (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_append (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 1); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - void lt_update_exe_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4012,9 +4925,9 @@ lt_update_exe_path (const char *name, const char *value) void lt_update_lib_path (const char *name, const char *value) { - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); if (name && *name && value && *value) { @@ -4024,11 +4937,158 @@ lt_update_lib_path (const char *name, const char *value) } } +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} EOF } # end: func_emit_cwrapperexe_src +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + # func_mode_link arg... func_mode_link () { @@ -4073,6 +5133,7 @@ func_mode_link () new_inherited_linker_flags= avoid_version=no + bindir= dlfiles= dlprefiles= dlself=no @@ -4165,6 +5226,11 @@ func_mode_link () esac case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -4196,9 +5262,9 @@ func_mode_link () ;; *) if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" + func_append dlfiles " $arg" else - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $arg" fi prev= continue @@ -4222,7 +5288,7 @@ func_mode_link () *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later + *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; @@ -4241,7 +5307,7 @@ func_mode_link () moreargs= for fil in `cat "$save_arg"` do -# moreargs="$moreargs $fil" +# func_append moreargs " $fil" arg=$fil # A libtool-controlled object. @@ -4270,7 +5336,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4282,7 +5348,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4352,12 +5418,12 @@ func_mode_link () if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) rpath="$rpath $arg" ;; + *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; + *) func_append xrpath " $arg" ;; esac fi prev= @@ -4369,28 +5435,28 @@ func_mode_link () continue ;; weak) - weak_libs="$weak_libs $arg" + func_append weak_libs " $arg" prev= continue ;; xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - compiler_flags="$compiler_flags $qarg" + func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -4426,6 +5492,11 @@ func_mode_link () continue ;; + -bindir) + prev=bindir + continue + ;; + -dlopen) prev=dlfiles continue @@ -4476,15 +5547,16 @@ func_mode_link () ;; -L*) - func_stripname '-L' '' "$arg" - dir=$func_stripname_result - if test -z "$dir"; then + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -4496,24 +5568,30 @@ func_mode_link () ;; esac case "$deplibs " in - *" -L$dir "*) ;; + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) dllsearchpath="$dllsearchpath:$dir";; + *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -4523,7 +5601,7 @@ func_mode_link () -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -4537,7 +5615,7 @@ func_mode_link () ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -4557,7 +5635,7 @@ func_mode_link () ;; esac fi - deplibs="$deplibs $arg" + func_append deplibs " $arg" continue ;; @@ -4569,21 +5647,22 @@ func_mode_link () # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot) - compiler_flags="$compiler_flags $arg" + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - compiler_flags="$compiler_flags $arg" + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; + * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; @@ -4650,13 +5729,17 @@ func_mode_link () # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac continue ;; @@ -4709,8 +5792,8 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $func_quote_for_eval_result" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4725,9 +5808,9 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - arg="$arg $wl$func_quote_for_eval_result" - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" - linker_flags="$linker_flags $func_quote_for_eval_result" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -4755,23 +5838,27 @@ func_mode_link () arg="$func_quote_for_eval_result" ;; - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -F/path gives path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC - # @file GCC response files + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - compiler_flags="$compiler_flags $arg" + func_append compiler_flags " $arg" continue ;; @@ -4783,7 +5870,7 @@ func_mode_link () *.$objext) # A standard object. - objs="$objs $arg" + func_append objs " $arg" ;; *.lo) @@ -4814,7 +5901,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" + func_append dlfiles " $pic_object" prev= continue else @@ -4826,7 +5913,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" + func_append dlprefiles " $pic_object" prev= fi @@ -4871,24 +5958,25 @@ func_mode_link () *.$libext) # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" + func_append deplibs " $arg" + func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. + func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" + func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" + func_append dlprefiles " $func_resolve_sysroot_result" prev= else - deplibs="$deplibs $arg" + func_append deplibs " $func_resolve_sysroot_result" fi continue ;; @@ -4926,7 +6014,7 @@ func_mode_link () if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi @@ -4935,6 +6023,8 @@ func_mode_link () func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -4955,12 +6045,12 @@ func_mode_link () # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - libs="$libs $deplib" + func_append libs " $deplib" done if test "$linkmode" = lib; then @@ -4973,9 +6063,9 @@ func_mode_link () if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac - pre_post_deps="$pre_post_deps $pre_post_dep" + func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= @@ -5042,17 +6132,19 @@ func_mode_link () for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= + func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$lib" ;; + *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + func_basename "$deplib" + deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; - *) deplibs="$deplibs $deplib" ;; + *) func_append deplibs " $deplib" ;; esac done done @@ -5068,16 +6160,17 @@ func_mode_link () lib= found=no case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - compiler_flags="$compiler_flags $deplib" + func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5162,7 +6255,7 @@ func_mode_link () if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi @@ -5175,7 +6268,8 @@ func_mode_link () test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then @@ -5189,7 +6283,8 @@ func_mode_link () finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" @@ -5200,17 +6295,21 @@ func_mode_link () -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" - dir=$func_stripname_result + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; + *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) lib="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" @@ -5228,7 +6327,7 @@ func_mode_link () match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -5238,15 +6337,15 @@ func_mode_link () ;; esac if test "$valid_a_lib" != yes; then - $ECHO + echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because the file extensions .$libext of this argument makes me believe" - $ECHO "*** that it is just a static archive that I should not use here." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -5273,11 +6372,11 @@ func_mode_link () if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - newdlprefiles="$newdlprefiles $deplib" + func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - newdlfiles="$newdlfiles $deplib" + func_append newdlfiles " $deplib" fi fi continue @@ -5319,20 +6418,20 @@ func_mode_link () # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then @@ -5343,20 +6442,20 @@ func_mode_link () func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done continue fi # $pass = conv @@ -5364,9 +6463,15 @@ func_mode_link () # Get the name of the library we link against. linklib= - for l in $old_library $library_names; do - linklib="$l" - done + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi @@ -5383,9 +6488,9 @@ func_mode_link () # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" + func_append dlprefiles " $lib $dependency_libs" else - newdlfiles="$newdlfiles $lib" + func_append newdlfiles " $lib" fi continue fi # $pass = dlopen @@ -5407,14 +6512,14 @@ func_mode_link () # Find the relevant object directory and library name. if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else - dir="$libdir" - absdir="$libdir" + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else @@ -5422,12 +6527,12 @@ func_mode_link () dir="$ladir" absdir="$abs_ladir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later - notinst_path="$notinst_path $abs_ladir" + func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" @@ -5438,20 +6543,46 @@ func_mode_link () if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac fi # $pass = dlpreopen if test -z "$libdir"; then @@ -5469,7 +6600,7 @@ func_mode_link () if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" + func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no @@ -5482,7 +6613,8 @@ func_mode_link () for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - newlib_search_path="$newlib_search_path $func_stripname_result" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? @@ -5493,12 +6625,12 @@ func_mode_link () # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_duplicate_deps ; then + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... @@ -5513,7 +6645,7 @@ func_mode_link () # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; - *) temp_rpath="$temp_rpath$absdir:" ;; + *) func_append temp_rpath "$absdir:" ;; esac fi @@ -5525,7 +6657,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5534,7 +6666,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5559,12 +6691,12 @@ func_mode_link () case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" + func_append notinst_deplibs " $lib" need_relink=yes fi ;; @@ -5581,7 +6713,7 @@ func_mode_link () fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - $ECHO + echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -5599,7 +6731,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" + *) func_append compile_rpath " $absdir" ;; esac ;; esac @@ -5608,7 +6740,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" + *) func_append finalize_rpath " $libdir" ;; esac ;; esac @@ -5662,7 +6794,7 @@ func_mode_link () linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$mode" != relink; then + if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= @@ -5684,9 +6816,9 @@ func_mode_link () if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then - $ECHO - $ECHO "*** And there doesn't seem to be a static archive available" - $ECHO "*** The link will probably fail, sorry" + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi @@ -5713,12 +6845,12 @@ func_mode_link () test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" + add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5740,7 +6872,7 @@ func_mode_link () if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then @@ -5754,13 +6886,13 @@ func_mode_link () test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi - if test "$linkmode" = prog || test "$mode" = relink; then + if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= @@ -5774,7 +6906,7 @@ func_mode_link () elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then @@ -5791,7 +6923,7 @@ func_mode_link () if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" + func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi @@ -5826,21 +6958,21 @@ func_mode_link () # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - $ECHO + echo $ECHO "*** Warning: This system can not link to static lib archive $lib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - $ECHO "*** But as you try to build a module library, libtool will still create " - $ECHO "*** a static module, that should work as long as the dlopening application" - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -5868,37 +7000,46 @@ func_mode_link () temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; + *) func_append xrpath " $temp_xrpath";; esac;; - *) temp_deplibs="$temp_deplibs $libdir";; + *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi - newlib_search_path="$newlib_search_path $absdir" + func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - if $opt_duplicate_deps ; then + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi - tmp_libs="$tmp_libs $deplib" + func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do + path= case $deplib in -L*) path="$deplib" ;; *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir="$func_dirname_result" + dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; @@ -5925,8 +7066,8 @@ func_mode_link () if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi @@ -5959,7 +7100,7 @@ func_mode_link () compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -5976,7 +7117,7 @@ func_mode_link () for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; + *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= @@ -6034,10 +7175,10 @@ func_mode_link () -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac ;; - *) tmp_libs="$tmp_libs $deplib" ;; + *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" @@ -6053,7 +7194,7 @@ func_mode_link () ;; esac if test -n "$i" ; then - tmp_libs="$tmp_libs $i" + func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs @@ -6094,7 +7235,7 @@ func_mode_link () # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" - objs="$objs$old_deplibs" + func_append objs "$old_deplibs" ;; lib) @@ -6127,10 +7268,10 @@ func_mode_link () if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else - $ECHO + echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - libobjs="$libobjs $objs" + func_append libobjs " $objs" fi fi @@ -6189,13 +7330,14 @@ func_mode_link () # which has an extra 1 added just for fun # case $version_type in + # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|sunos) + freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" @@ -6305,7 +7447,7 @@ func_mode_link () versuffix="$major.$revision" ;; - linux) + linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" @@ -6328,7 +7470,7 @@ func_mode_link () done # Make executables depend on our current version. - verstring="$verstring:${current}.0" + func_append verstring ":${current}.0" ;; qnx) @@ -6396,10 +7538,10 @@ func_mode_link () fi func_generate_dlsyms "$libname" "$libname" "yes" - libobjs="$libobjs $symfileobj" + func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= - if test "$mode" != relink; then + if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -6415,7 +7557,7 @@ func_mode_link () continue fi fi - removelist="$removelist $p" + func_append removelist " $p" ;; *) ;; esac @@ -6426,27 +7568,28 @@ func_mode_link () # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" + func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -6460,7 +7603,7 @@ func_mode_link () for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; + *) func_append dlfiles " $lib" ;; esac done @@ -6470,19 +7613,19 @@ func_mode_link () for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; + *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - deplibs="$deplibs System.ltframework" + func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -6499,7 +7642,7 @@ func_mode_link () *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" + func_append deplibs " -lc" fi ;; esac @@ -6548,7 +7691,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6559,21 +7702,21 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which I believe you do not have" - $ECHO "*** because a test_compile did reveal that the linker did not use it for" - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which I believe you do not have" + echo "*** because a test_compile did reveal that the linker did not use it for" + echo "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6591,7 +7734,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" i="" ;; esac @@ -6602,29 +7745,29 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: dynamic linker does not accept needed library $i." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because a test_compile did reveal that the linker did not use this one" - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because a test_compile did reveal that the linker did not use this one" + echo "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - $ECHO + echo $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - $ECHO "*** make it link in! You will probably need to install it or some" - $ECHO "*** library that it depends on before this library will be fully" - $ECHO "*** functional. Installing it before continuing would be even better." + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." fi ;; *) - newdeplibs="$newdeplibs $i" + func_append newdeplibs " $i" ;; esac done @@ -6641,15 +7784,27 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + if test "$want_nocaseglob" = yes; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -6666,13 +7821,13 @@ EOF potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6681,12 +7836,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else @@ -6697,7 +7852,7 @@ EOF ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. @@ -6713,7 +7868,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" ;; esac @@ -6724,9 +7879,9 @@ EOF potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi @@ -6735,12 +7890,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - $ECHO + echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - $ECHO "*** I have the capability to make that library automatically link in when" - $ECHO "*** you link to this library. But I can only do this if you have a" - $ECHO "*** shared version of the library, which you do not appear to have" - $ECHO "*** because I did check the linker path looking for a file starting" + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else @@ -6751,32 +7906,32 @@ EOF ;; *) # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" + func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | - $GREP . >/dev/null; then - $ECHO + case $tmp_deplibs in + *[!\ \ ]*) + echo if test "X$deplibs_check_method" = "Xnone"; then - $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + echo "*** Warning: inter-library dependencies are not supported in this platform." else - $ECHO "*** Warning: inter-library dependencies are not known to be supported." + echo "*** Warning: inter-library dependencies are not known to be supported." fi - $ECHO "*** All declared inter-library dependencies are being dropped." + echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - fi + ;; + esac ;; esac versuffix=$versuffix_save @@ -6788,23 +7943,23 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then - $ECHO - $ECHO "*** Warning: libtool could not satisfy all declared inter-library" + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - $ECHO "*** a static module, that should work as long as the dlopening" - $ECHO "*** application is linked with the -dlopen flag." + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - $ECHO - $ECHO "*** However, this would only work if libtool was able to extract symbol" - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" - $ECHO "*** not find such a program. So, this module is probably useless." - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -6814,16 +7969,16 @@ EOF build_libtool_libs=no fi else - $ECHO "*** The inter-library dependencies that have been dropped here will be" - $ECHO "*** automatically added whenever a program is linked with this library" - $ECHO "*** or is declared to -dlopen it." + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then - $ECHO - $ECHO "*** Since this library must not contain undefined symbols," - $ECHO "*** because either the platform does not support them or" - $ECHO "*** it was explicitly requested with -no-undefined," - $ECHO "*** libtool will only create a static version of it." + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module @@ -6840,9 +7995,9 @@ EOF # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -6855,7 +8010,7 @@ EOF *) case " $deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -6865,10 +8020,10 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" @@ -6880,15 +8035,22 @@ EOF # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -6897,18 +8059,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" + func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done @@ -6916,17 +8078,13 @@ EOF if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -6934,7 +8092,7 @@ EOF fi shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -6960,18 +8118,18 @@ EOF linknames= for link do - linknames="$linknames $link" + func_append linknames " $link" done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - delfiles="$delfiles $export_symbols" + func_append delfiles " $export_symbols" fi orig_export_symbols= @@ -7002,13 +8160,45 @@ EOF $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do + for cmd1 in $cmds; do IFS="$save_ifs" - eval cmd=\"$cmd\" - func_len " $cmd" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -7030,7 +8220,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then @@ -7042,7 +8232,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7052,7 +8242,7 @@ EOF case " $convenience " in *" $test_deplib "*) ;; *) - tmp_deplibs="$tmp_deplibs $test_deplib" + func_append tmp_deplibs " $test_deplib" ;; esac done @@ -7072,21 +8262,21 @@ EOF test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" + func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -7131,7 +8321,8 @@ EOF save_libobjs=$libobjs fi save_output=$output - output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + func_basename "$output" + output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. @@ -7144,13 +8335,16 @@ EOF if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" - $ECHO 'INPUT (' > $output + echo 'INPUT (' > $output for obj in $save_libobjs do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - $ECHO ')' >> $output - delfiles="$delfiles $output" + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -7164,10 +8358,12 @@ EOF fi for obj do - $ECHO "$obj" >> $output + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output done - delfiles="$delfiles $output" - output=$firstobj\"$file_list_spec$output\" + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -7191,17 +8387,19 @@ EOF # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext - objlist=$obj + objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -7211,11 +8409,12 @@ EOF # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - delfiles="$delfiles $output" + func_append delfiles " $output" else output= @@ -7249,7 +8448,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7270,7 +8469,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -7282,7 +8481,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" + func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -7323,10 +8522,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - libobjs="$libobjs $func_extract_archives_result" + func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -7342,7 +8541,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -7354,7 +8553,7 @@ EOF IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$mode" = relink; then + if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -7435,18 +8634,21 @@ EOF if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' @@ -7506,8 +8708,8 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac @@ -7518,14 +8720,14 @@ EOF if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -7539,7 +8741,7 @@ EOF *) case " $compile_deplibs " in *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; + func_append new_libs " -L$path/$objdir" ;; esac ;; esac @@ -7549,17 +8751,17 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac ;; - *) new_libs="$new_libs $deplib" ;; + *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -7567,7 +8769,7 @@ EOF # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) func_append finalize_rpath " $libdir" ;; esac done fi @@ -7586,18 +8788,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi case $host in @@ -7606,12 +8808,12 @@ EOF case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) dllsearchpath="$dllsearchpath:$libdir";; + *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) dllsearchpath="$dllsearchpath:$testbindir";; + *) func_append dllsearchpath ":$testbindir";; esac ;; esac @@ -7637,18 +8839,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" + func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + *) func_append finalize_perm_rpath " $libdir" ;; esac fi done @@ -7662,8 +8864,8 @@ EOF if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" @@ -7675,15 +8877,15 @@ EOF wrappers_required=yes case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; - *cegcc) - # Disable wrappers for cegcc, we are cross compiling anyway. - wrappers_required=no - ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no @@ -7692,13 +8894,19 @@ EOF esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -7721,7 +8929,7 @@ EOF # We should set the runpath_var. rpath= for dir in $perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7729,7 +8937,7 @@ EOF # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" + func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -7739,11 +8947,18 @@ EOF # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + exit $EXIT_SUCCESS fi @@ -7758,7 +8973,7 @@ EOF if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -7770,13 +8985,19 @@ EOF fi # Replace the output file specification. - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + # Now create the wrapper script. func_verbose "creating $output" @@ -7794,18 +9015,7 @@ EOF fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $ECHO for shipping. - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -7885,7 +9095,7 @@ EOF else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - oldobjs="$oldobjs $symfileobj" + func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" @@ -7893,10 +9103,10 @@ EOF if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. @@ -7907,10 +9117,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_extract_archives $gentop $dlprefiles - oldobjs="$oldobjs $func_extract_archives_result" + func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -7926,9 +9136,9 @@ EOF done | sort | sort -uc >/dev/null 2>&1); then : else - $ECHO "copying selected object files to avoid basename conflicts..." + echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" + func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -7952,18 +9162,30 @@ EOF esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" ;; - *) oldobjs="$oldobjs $obj" ;; + *) func_append oldobjs " $obj" ;; esac done fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -8037,7 +9259,7 @@ EOF done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -8057,12 +9279,23 @@ EOF *.la) func_basename "$deplib" name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - newdependency_libs="$newdependency_libs $libdir/$name" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -8076,9 +9309,9 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlfiles="$newdlfiles $libdir/$name" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; - *) newdlfiles="$newdlfiles $lib" ;; + *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" @@ -8095,7 +9328,7 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - newdlprefiles="$newdlprefiles $libdir/$name" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done @@ -8107,7 +9340,7 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlfiles="$newdlfiles $abs" + func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -8116,15 +9349,33 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - newdlprefiles="$newdlprefiles $abs" + func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; esac $ECHO > $output "\ # $outputname - a libtool library file @@ -8183,7 +9434,7 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -{ test "$mode" = link || test "$mode" = relink; } && +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} @@ -8203,9 +9454,9 @@ func_mode_uninstall () for arg do case $arg in - -f) RM="$RM $arg"; rmforce=yes ;; - -*) RM="$RM $arg" ;; - *) files="$files $arg" ;; + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; esac done @@ -8214,24 +9465,23 @@ func_mode_uninstall () rmdirs= - origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - objdir="$origobjdir" + odir="$objdir" else - objdir="$dir/$origobjdir" + odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" - test "$mode" = uninstall && objdir="$dir" + test "$opt_mode" = uninstall && odir="$dir" - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; esac fi @@ -8257,18 +9507,17 @@ func_mode_uninstall () # Delete the libtool libraries and symlinks. for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" + func_append rmfiles " $odir/$n" done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test -n "$old_library" && func_append rmfiles " $odir/$old_library" - case "$mode" in + case "$opt_mode" in clean) - case " $library_names " in - # " " in the beginning catches empty $dlname + case " $library_names " in *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -8296,19 +9545,19 @@ func_mode_uninstall () # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" + func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" + func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) - if test "$mode" = clean ; then + if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) @@ -8318,7 +9567,7 @@ func_mode_uninstall () noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - rmfiles="$rmfiles $file" + func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. @@ -8327,7 +9576,7 @@ func_mode_uninstall () func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" + func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -8335,12 +9584,12 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" + func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" + func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi @@ -8348,7 +9597,6 @@ func_mode_uninstall () esac func_show_eval "$RM $rmfiles" 'exit_status=1' done - objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -8360,16 +9608,16 @@ func_mode_uninstall () exit $exit_status } -{ test "$mode" = uninstall || test "$mode" = clean; } && +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$mode" && { +test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$mode'" + func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" diff --git a/build-scripts/makedep.sh b/build-scripts/makedep.sh deleted file mode 100755 index 3b3863b4c2..0000000000 --- a/build-scripts/makedep.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -# -# Generate dependencies from a list of source files - -# Check to make sure our environment variables are set -if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$output" = x; then - echo "SOURCES, INCLUDE, and output needs to be set" - exit 1 -fi -cache_prefix=".#$$" - -generate_var() -{ - echo $1 | sed -e 's|^.*/||' -e 's|\.|_|g' -} - -search_deps() -{ - base=`echo $1 | sed 's|/[^/]*$||'` - grep '#include "' <$1 | sed -e 's|.*"\([^"]*\)".*|\1|' | \ - while read file - do cache=${cache_prefix}_`generate_var $file` - if test -f $cache; then - : # We already ahve this cached - else - : >$cache - for path in $base `echo $INCLUDE | sed 's|-I||g'` - do dep="$path/$file" - if test -f "$dep"; then - echo " $dep \\" >>$cache - search_deps $dep >>$cache - break - fi - done - fi - cat $cache - done -} - -:>${output}.new -for src in $SOURCES -do echo "Generating dependencies for $src" - ext=`echo $src | sed 's|.*\.\(.*\)|\1|'` - obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.lo|g"` - echo "\$(objects)/$obj: $src \\" >>${output}.new - - # No search to be done with Windows resource files - if test x"$ext" != x"rc"; then - search_deps $src | sort | uniq >>${output}.new - fi - case $ext in - c) cat >>${output}.new <<__EOF__ - - \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ - -__EOF__ - ;; - cc) cat >>${output}.new <<__EOF__ - - \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ - -__EOF__ - ;; - m) cat >>${output}.new <<__EOF__ - - \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ - -__EOF__ - ;; - asm) cat >>${output}.new <<__EOF__ - - \$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) -I\$(srcdir)/src/hermes/ $src -o \$@ - -__EOF__ - ;; - S) cat >>${output}.new <<__EOF__ - - \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@ - -__EOF__ - ;; - rc) cat >>${output}.new <<__EOF__ - - \$(LIBTOOL) --tag=RC --mode=compile \$(WINDRES) $src -o \$@ - -__EOF__ - ;; - *) echo "Unknown file extension: $ext";; - esac - echo "" >>${output}.new -done -mv ${output}.new ${output} -rm -f ${cache_prefix}* diff --git a/build-scripts/showrev.sh b/build-scripts/showrev.sh new file mode 100755 index 0000000000..2a68fe694e --- /dev/null +++ b/build-scripts/showrev.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Print the current source revision, if available + +# FIXME: this prints the tip, which isn't useful if you're on a different +# branch, or just not sync'd to the tip. +hg tip --template 'hg-{rev}:{node|short}' || (echo "hg-0:baadf00d"; exit 1) diff --git a/build-scripts/strip_fPIC.sh b/build-scripts/strip_fPIC.sh index 45d34ba478..8719b896e5 100755 --- a/build-scripts/strip_fPIC.sh +++ b/build-scripts/strip_fPIC.sh @@ -5,8 +5,8 @@ command="" while [ $# -gt 0 ]; do case "$1" in - -fPIC) - # Ignore -fPIC option + -?PIC) + # Ignore -fPIC and -DPIC options ;; -fno-common) # Ignore -fPIC and -DPIC options diff --git a/build-scripts/updaterev.sh b/build-scripts/updaterev.sh new file mode 100755 index 0000000000..485d045807 --- /dev/null +++ b/build-scripts/updaterev.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Generate a header file with the current source revision + +outdir=`pwd` +cd `dirname $0` +srcdir=.. +header=$outdir/include/SDL_revision.h + +rev=`sh showrev.sh 2>/dev/null` +if [ "$rev" != "" -a "$rev" != "hg-0:baadf00d" ]; then + revnum=`echo $rev | sed 's,hg-\([0-9]*\).*,\1,'` + echo "#define SDL_REVISION \"$rev\"" >"$header.new" + echo "#define SDL_REVISION_NUMBER $revnum" >>"$header.new" + if diff $header $header.new >/dev/null 2>&1; then + rm "$header.new" + else + mv "$header.new" "$header" + fi +fi diff --git a/cmake/macros.cmake b/cmake/macros.cmake new file mode 100644 index 0000000000..c234a566c0 --- /dev/null +++ b/cmake/macros.cmake @@ -0,0 +1,73 @@ +macro(SET_OPTION _NAME _DESC) + list(APPEND ALLOPTIONS ${_NAME}) + if(${ARGC} EQUAL 3) + set(_DEFLT ${ARGV2}) + else() + set(_DEFLT OFF) + endif() + option(${_NAME} ${_DESC} ${_DEFLT}) +endmacro() + +macro(DEP_OPTION _NAME _DESC _DEFLT _DEPTEST _FAILDFLT) + list(APPEND ALLOPTIONS ${_NAME}) + cmake_dependent_option(${_NAME} ${_DESC} ${_DEFLT} ${_DEPTEST} ${_FAILDFLT}) +endmacro() + +macro(OPTION_STRING _NAME _DESC _VALUE) + list(APPEND ALLOPTIONS ${_NAME}) + set(${_NAME} ${_VALUE} CACHE STRING "${_DESC}") + set(HAVE_${_NAME} ${_VALUE}) +ENDMACRO() + +# Message Output +macro(MESSAGE_WARN _TEXT) + message(STATUS "*** WARNING: ${_TEXT}") +endmacro() + +macro(MESSAGE_ERROR _TEXT) + message(FATAL_ERROR "*** ERROR: ${_TEXT}") +endmacro() + +macro(MESSAGE_BOOL_OPTION _NAME _VALUE) + if(${_VALUE}) + message(STATUS " ${_NAME}:\tON") + else() + message(STATUS " ${_NAME}:\tOFF") + endif() +endmacro() + +macro(MESSAGE_TESTED_OPTION _NAME) + set(_REQVALUE ${${_NAME}}) + set(_PAD " ") + if(${ARGC} EQUAL 2) + set(_PAD ${ARGV1}) + endif() + if(NOT HAVE_${_NAME}) + set(HAVE_${_NAME} OFF) + elseif("${HAVE_${_NAME}}" MATCHES "1|TRUE|YES|Y") + set(HAVE_${_NAME} ON) + endif() + message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_NAME}}") +endmacro() + +macro(LISTTOSTR _LIST _OUTPUT) + if(${ARGC} EQUAL 3) + # prefix for each element + set(_LPREFIX ${ARGV2}) + else() + set(_LPREFIX "") + endif() + # Do not use string(REPLACE ";" " ") here to avoid messing up list + # entries + foreach(_ITEM ${${_LIST}}) + set(${_OUTPUT} "${_LPREFIX}${_ITEM} ${${_OUTPUT}}") + endforeach() +endmacro() + +macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR) + set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}") + set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}") + CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR}) + set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}") +endmacro() + diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake new file mode 100644 index 0000000000..14fb327b1a --- /dev/null +++ b/cmake/sdlchecks.cmake @@ -0,0 +1,857 @@ +macro(CheckDLOPEN) + check_function_exists(dlopen HAVE_DLOPEN) + if(NOT HAVE_DLOPEN) + foreach(_LIBNAME dl tdl) + check_library_exists("${_LIBNAME}" "dlopen" "" DLOPEN_LIB) + if(DLOPEN_LIB) + list(APPEND EXTRA_LIBS ${_LIBNAME}) + set(_DLLIB ${_LIBNAME}) + set(HAVE_DLOPEN TRUE) + break() + endif(DLOPEN_LIB) + endforeach() + endif() + + if(HAVE_DLOPEN) + if(_DLLIB) + set(CMAKE_REQUIRED_LIBRARIES ${_DLLIB}) + endif() + check_c_source_compiles(" + #include + int main(int argc, char **argv) { + void *handle = dlopen(\"\", RTLD_NOW); + const char *loaderror = (char *) dlerror(); + }" HAVE_DLOPEN) + set(CMAKE_REQUIRED_LIBRARIES) + endif() + + if (HAVE_DLOPEN) + set(SDL_LOADSO_DLOPEN 1) + set(HAVE_SDL_DLOPEN TRUE) + file(GLOB DLOPEN_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dlopen/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${DLOPEN_SOURCES}) + set(HAVE_SDL_LOADSO TRUE) + endif() +endmacro(CheckDLOPEN) + +# Requires: +# - n/a +macro(CheckOSS) + if(OSS) + set(OSS_HEADER_FILE "sys/soundcard.h") + check_c_source_compiles(" + #include + int main() { int arg = SNDCTL_DSP_SETFRAGMENT; }" OSS_FOUND) + if(NOT OSS_FOUND) + set(OSS_HEADER_FILE "soundcard.h") + check_c_source_compiles(" + #include + int main() { int arg = SNDCTL_DSP_SETFRAGMENT; }" OSS_FOUND) + endif(NOT OSS_FOUND) + + if(OSS_FOUND) + set(HAVE_OSS TRUE) + file(GLOB OSS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/dsp/*.c) + if(OSS_HEADER_FILE STREQUAL "soundcard.h") + set(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1) + endif(OSS_HEADER_FILE STREQUAL "soundcard.h") + set(SDL_AUDIO_DRIVER_OSS 1) + set(SOURCE_FILES ${SOURCE_FILES} ${OSS_SOURCES}) + if(NETBSD OR OPENBSD) + list(APPEND EXTRA_LIBS ossaudio) + endif(NETBSD OR OPENBSD) + set(HAVE_SDL_AUDIO TRUE) + endif(OSS_FOUND) + endif(OSS) +endmacro(CheckOSS) + +# Requires: +# - n/a +# Optional: +# - ALSA_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckALSA) + if(ALSA) + CHECK_INCLUDE_FILE(alsa/asoundlib.h HAVE_ASOUNDLIB_H) + if(HAVE_ASOUNDLIB_H) + CHECK_LIBRARY_EXISTS(asound snd_pcm_open "" HAVE_LIBASOUND) + set(HAVE_ALSA TRUE) + file(GLOB ALSA_SOURCES ${SDL2_SOURCE_DIR}/src/audio/alsa/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${ALSA_SOURCES}) + set(SDL_AUDIO_DRIVER_ALSA 1) + if(ALSA_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic ALSA loading") + else() + find_library(_ALSA_LIB asound) + get_filename_component(F_ALSA_LIB ${_ALSA_LIB} NAME) + set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${F_ALSA_LIB}\"") + set(HAVE_ALSA_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(ALSA_SHARED) + list(APPEND EXTRA_LIBS asound) + endif(ALSA_SHARED) + set(HAVE_SDL_AUDIO TRUE) + endif(HAVE_ASOUNDLIB_H) + endif(ALSA) +endmacro(CheckALSA) + +# Requires: +# - PkgCheckModules +# Optional: +# - PULSEAUDIO_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckPulseAudio) + if(PULSEAUDIO) + pkg_check_modules(PKG_PULSEAUDIO libpulse-simple) + if(PKG_PULSEAUDIO_FOUND) + set(HAVE_PULSEAUDIO TRUE) + file(GLOB PULSEAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/pulseaudio/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${PULSEAUDIO_SOURCES}) + set(SDL_AUDIO_DRIVER_PULSEAUDIO 1) + list(APPEND EXTRA_CFLAGS ${PKG_PULSEAUDIO_CFLAGS}) + if(PULSEAUDIO_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic PulseAudio loading") + else() + find_library(D_PULSE_LIB pulse-simple) + get_filename_component(F_PULSE_LIB ${D_PULSE_LIB} NAME) + set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${F_PULSE_LIB}\"") + set(HAVE_PULSEAUDIO_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(PULSEAUDIO_SHARED) + list(APPEND EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS}) + endif(PULSEAUDIO_SHARED) + set(HAVE_SDL_AUDIO TRUE) + endif(PKG_PULSEAUDIO_FOUND) + endif(PULSEAUDIO) +endmacro(CheckPulseAudio) + +# Requires: +# - PkgCheckModules +# Optional: +# - ESD_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckESD) + if(ESD) + pkg_check_modules(PKG_ESD esound) + if(PKG_ESD_FOUND) + set(HAVE_ESD TRUE) + file(GLOB ESD_SOURCES ${SDL2_SOURCE_DIR}/src/audio/esd/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${ESD_SOURCES}) + set(SDL_AUDIO_DRIVER_ESD 1) + list(APPEND EXTRA_CFLAGS ${PKG_ESD_CFLAGS}) + if(ESD_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic ESD loading") + else() + find_library(D_ESD_LIB esd) + get_filename_component(F_ESD_LIB ${D_ESD_LIB} NAME) + set(SDL_AUDIO_DRIVER_ESD_DYNAMIC "\"${F_ESD_LIB}\"") + set(HAVE_ESD_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(ESD_SHARED) + list(APPEND EXTRA_LDFLAGS ${PKG_ESD_LDFLAGS}) + endif(ESD_SHARED) + set(HAVE_SDL_AUDIO TRUE) + endif(PKG_ESD_FOUND) + endif(ESD) +endmacro(CheckESD) + +# Requires: +# - n/a +# Optional: +# - ARTS_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckARTS) + if(ARTS) + find_program(ARTS_CONFIG arts-config) + if(ARTS_CONFIG) + execute_process(CMD_ARTSCFLAGS ${ARTS_CONFIG} --cflags + OUTPUT_VARIABLE ARTS_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + list(APPEND EXTRA_CFLAGS ${ARTS_CFLAGS}) + execute_process(CMD_ARTSLIBS ${ARTS_CONFIG} --libs + OUTPUT_VARIABLE ARTS_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) + file(GLOB ARTS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/arts/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${ARTS_SOURCES}) + set(SDL_AUDIO_DRIVER_ARTS 1) + set(HAVE_ARTS TRUE) + if(ARTS_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic ARTS loading") + else() + # TODO + find_library(D_ARTS_LIB artsc) + get_filename_component(F_ARTS_LIB ${D_ARTS_LIB} NAME) + set(SDL_AUDIO_DRIVER_ARTS_DYNAMIC "\"${F_ARTS_LIB}\"") + set(HAVE_ARTS_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(ARTS_SHARED) + list(APPEND EXTRA_LDFLAGS ${ARTS_LIBS}) + endif(ARTS_SHARED) + set(HAVE_SDL_AUDIO TRUE) + endif(ARTS_CONFIG) + endif(ARTS) +endmacro(CheckARTS) + +# Requires: +# - n/a +# Optional: +# - NAS_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckNAS) + if(NAS) + # TODO: set include paths properly, so the NAS headers are found + check_include_file(audio/audiolib.h HAVE_NAS_H) + find_library(D_NAS_LIB audio) + if(HAVE_NAS_H AND D_NAS_LIB) + set(HAVE_NAS TRUE) + file(GLOB NAS_SOURCES ${SDL2_SOURCE_DIR}/src/audio/nas/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${NAS_SOURCES}) + set(SDL_AUDIO_DRIVER_NAS 1) + if(NAS_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic NAS loading") + else() + get_filename_component(F_NAS_LIB ${D_NAS_LIB} NAME) + set(SDL_AUDIO_DRIVER_NAS_DYNAMIC "\"${F_NAS_LIB}\"") + set(HAVE_NAS_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(NAS_SHARED) + list(APPEND EXTRA_LIBS ${D_NAS_LIB}) + endif(NAS_SHARED) + set(HAVE_SDL_AUDIO TRUE) + endif(HAVE_NAS_H AND D_NAS_LIB) + endif(NAS) +endmacro(CheckNAS) + +# Requires: +# - n/a +# Optional: +# - SNDIO_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckSNDIO) + if(SNDIO) + # TODO: set include paths properly, so the sndio headers are found + check_include_file(sndio.h HAVE_SNDIO_H) + find_library(D_SNDIO_LIB audio) + if(HAVE_SNDIO_H AND D_SNDIO_LIB) + set(HAVE_SNDIO TRUE) + file(GLOB SNDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sndio/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${SNDIO_SOURCES}) + set(SDL_AUDIO_DRIVER_SNDIO 1) + if(SNDIO_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic sndio loading") + else() + get_filename_component(F_SNDIO_LIB ${D_SNDIO_LIB} NAME) + set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${F_SNDIO_LIB}\"") + set(HAVE_SNDIO_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(SNDIO_SHARED) + list(APPEND EXTRA_LIBS ${D_SNDIO_LIB}) + endif(SNDIO_SHARED) + set(HAVE_SDL_AUDIO TRUE) + endif(HAVE_SNDIO_H AND D_SNDIO_LIB) + endif(SNDIO) +endmacro(CheckSNDIO) + +# Requires: +# - PkgCheckModules +# Optional: +# - FUSIONSOUND_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckFusionSound) + if(FUSIONSOUND) + pkg_check_modules(PKG_FUSIONSOUND fusionsound>=1.0.0) + if(PKG_FUSIONSOUND_FOUND) + set(HAVE_FUSIONSOUND TRUE) + file(GLOB FUSIONSOUND_SOURCES ${SDL2_SOURCE_DIR}/src/audio/fusionsound/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${FUSIONSOUND_SOURCES}) + set(SDL_AUDIO_DRIVER_FUSIONSOUND 1) + list(APPEND EXTRA_CFLAGS ${PKG_FUSIONSOUND_CFLAGS}) + if(FUSIONSOUND_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic FusionSound loading") + else() + find_library(D_FUSIONSOUND_LIB fusionsound) + get_filename_component(F_FUSIONSOUND_LIB ${D_FUSIONSOUND_LIB} NAME) + set(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "\"${F_FUSIONSOUND_LIB}\"") + set(HAVE_FUSIONSOUND_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(FUSIONSOUND_SHARED) + list(APPEND EXTRA_LDFLAGS ${PKG_FUSIONSOUND_LDFLAGS}) + endif(FUSIONSOUND_SHARED) + set(HAVE_SDL_AUDIO TRUE) + endif(PKG_FUSIONSOUND_FOUND) + endif(FUSIONSOUND) +endmacro(CheckFusionSound) + +# Requires: +# - n/a +# Optional: +# - X11_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckX11) + if(VIDEO_X11) + foreach(_LIB X11 Xext Xcursor Xinerama Xi Xrandr Xrender Xss Xxf86vm) + string(TOUPPER ${_LIB} _LNAME) + find_library(${_LNAME}_LIB ${_LIB}) + if(${_LNAME}_LIB) + # reduce the library name for shared linking + get_filename_component(_TMP ${${_LNAME}_LIB} NAME) + set(${_LNAME}_LIB ${_TMP}) + endif() + endforeach() + + check_include_file(X11/Xcursor/Xcursor.h HAVE_XCURSOR_H) + check_include_file(X11/extensions/Xinerama.h HAVE_XINERAMA_H) + check_include_file(X11/extensions/XInput2.h HAVE_XINPUT_H) + check_include_file(X11/extensions/Xrandr.h HAVE_XRANDR_H) + check_include_file(X11/extensions/Xrender.h HAVE_XRENDER_H) + check_include_file(X11/extensions/scrnsaver.h HAVE_XSS_H) + check_include_file(X11/extensions/shape.h HAVE_XSHAPE_H) + check_include_files("X11/Xlib.h;X11/extensions/xf86vmode.h" HAVE_XF86VM_H) + check_include_files("X11/Xlib.h;X11/Xproto.h;X11/extensions/Xext.h" HAVE_XEXT_H) + + if(X11_LIB) + if(NOT HAVE_XEXT_H) + message_error("Missing Xext.h, maybe you need to install the libxext-dev package?") + endif() + + set(HAVE_VIDEO_X11 TRUE) + set(HAVE_SDL_VIDEO TRUE) + + file(GLOB X11_SOURCES ${SDL2_SOURCE_DIR}/src/video/x11/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${X11_SOURCES}) + set(SDL_VIDEO_DRIVER_X11 1) + + if(HAVE_GCC_FVISIBILITY) + set(X11_SYMBOLS_PRIVATE TRUE) + else() + set(X11_SYMBOLS_PRIVATE FALSE) + endif(HAVE_GCC_FVISIBILITY) + + if(APPLE) + set(X11_SHARED OFF) + set(X11_SYMBOLS_PRIVATE TRUE) + endif(APPLE) + + check_function_exists("shmat" HAVE_SHMAT) + if(NOT HAVE_SHMAT) + check_library_exists(ipc shmat "" HAVE_SHMAT) + if(HAVE_SHMAT) + list(APPEND EXTRA_LIBS ipc) + endif(HAVE_SHMAT) + if(NOT HAVE_SHMAT) + add_definitions(-DNO_SHARED_MEMORY) + endif(NOT HAVE_SHMAT) + endif(NOT HAVE_SHMAT) + + if(X11_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic X11 loading") + set(HAVE_X11_SHARED FALSE) + if(X11_SYMBOLS_PRIVATE) + message_warn("You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading") + set(HAVE_X11_SHARED TRUE) + endif(X11_SYMBOLS_PRIVATE) + else(NOT HAVE_DLOPEN) + set(HAVE_X11_SHARED TRUE) + endif() + if(HAVE_X11_SHARED) + set(SDL_VIDEO_DRIVER_X11_DYNAMIC "\"${X11_LIB}\"") + set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "\"${XEXT_LIB}\"") + else(HAVE_X11_SHARED) + list(APPEND EXTRA_LIBS ${X11_LIB} ${XEXT_LIB}) + endif(HAVE_X11_SHARED) + endif(X11_SHARED) + + set(CMAKE_REQUIRED_LIBRARIES ${X11_LIB} ${X11_LIB}) + check_c_source_compiles(" + #include + #include + #include + #include + extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f); + int main(int argc, char **argv) {}" HAVE_CONST_XEXT_ADDDISPLAY) + if(HAVE_CONST_XEXT_ADDDISPLAY) + set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1) + endif(HAVE_CONST_XEXT_ADDDISPLAY) + + check_c_source_compiles(" + #include + int main(int argc, char **argv) { + Display *display; + XEvent event; + XGenericEventCookie *cookie = &event.xcookie; + XNextEvent(display, &event); + XGetEventData(display, cookie); + XFreeEventData(display, cookie); }" HAVE_XGENERICEVENT) + if(HAVE_XGENERICEVENT) + set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1) + endif(HAVE_XGENERICEVENT) + + check_c_source_compiles(" + #include + extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len); + int main(int argc, char **argv) {}" HAVE_CONST_XDATA32) + if(HAVE_CONST_XDATA32) + set(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1) + endif(HAVE_CONST_XDATA32) + + check_function_exists(XkbKeycodeToKeysym SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM) + + if(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H) + set(HAVE_VIDEO_X11_XCURSOR TRUE) + if(HAVE_X11_SHARED AND XCURSOR_LIB) + set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "\"${XCURSOR_LIB}\"") + else(HAVE_X11_SHARED AND XCURSOR_LIB) + list(APPEND EXTRA_LIBS ${XCURSOR_LIB}) + endif(HAVE_X11_SHARED AND XCURSOR_LIB) + set(SDL_VIDEO_DRIVER_X11_XCURSOR 1) + endif(VIDEO_X11_XCURSOR AND HAVE_XCURSOR_H) + + if(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H) + set(HAVE_VIDEO_X11_XINERAMA TRUE) + if(HAVE_X11_SHARED AND XINERAMA_LIB) + set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "\"${XINERAMA_LIB}\"") + else(HAVE_X11_SHARED AND XINERAMA_LIB) + list(APPEND EXTRA_LIBS ${XINERAMA_LIB}) + endif(HAVE_X11_SHARED AND XINERAMA_LIB) + set(SDL_VIDEO_DRIVER_X11_XINERAMA 1) + endif(VIDEO_X11_XINERAMA AND HAVE_XINERAMA_H) + + if(VIDEO_X11_XINPUT AND HAVE_XINPUT_H) + set(HAVE_VIDEO_X11_XINPUT TRUE) + if(HAVE_X11_SHARED AND XI_LIB) + set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "\"${XI_LIB}\"") + else(HAVE_X11_SHARED AND XI_LIB) + list(APPEND EXTRA_LIBS ${XI_LIB}) + endif(HAVE_X11_SHARED AND XI_LIB) + set(SDL_VIDEO_DRIVER_X11_XINPUT2 1) + + # Check for multitouch + check_c_source_compiles(" + #include + #include + #include + int event_type = XI_TouchBegin; + XITouchClassInfo *t; + Status XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) + { + return (Status)0; + } + int main(int argc, char **argv) {}" HAVE_XINPUT2_MULTITOUCH) + if(HAVE_XINPUT2_MULTITOUCH) + set(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1) + endif(HAVE_XINPUT2_MULTITOUCH) + endif(VIDEO_X11_XINPUT AND HAVE_XINPUT_H) + + if(VIDEO_X11_XRANDR AND HAVE_XRANDR_H) + if(HAVE_X11_SHARED AND XRANDR_LIB) + set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "\"${XRANDR_LIB}\"") + else(HAVE_X11_SHARED AND XRANDR_LIB) + list(APPEND EXTRA_LIBS ${XRANDR_LIB}) + endif(HAVE_X11_SHARED AND XRANDR_LIB) + set(SDL_VIDEO_DRIVER_X11_XRANDR 1) + set(HAVE_VIDEO_X11_XRANDR TRUE) + endif(VIDEO_X11_XRANDR AND HAVE_XRANDR_H) + + if(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H) + if(HAVE_X11_SHARED AND XSS_LIB) + set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "\"${XSS_LIB}\"") + else(HAVE_X11_SHARED AND XSS_LIB) + list(APPEND EXTRA_LIBS ${XSS_LIB}) + endif(HAVE_X11_SHARED AND XSS_LIB) + set(SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1) + set(HAVE_VIDEO_X11_XSCRNSAVER TRUE) + endif(VIDEO_X11_XSCRNSAVER AND HAVE_XSS_H) + + if(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H) + set(SDL_VIDEO_DRIVER_X11_XSHAPE 1) + set(HAVE_VIDEO_X11_XSHAPE TRUE) + endif(VIDEO_X11_XSHAPE AND HAVE_XSHAPE_H) + + if(VIDEO_X11_XVM AND HAVE_XF86VM_H) + if(HAVE_X11_SHARED AND XF86VMODE_LIB) + set(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "\"${XF86VMODE_LIB}\"") + else(HAVE_X11_SHARED AND XF86VMODE_LIB) + list(APPEND EXTRA_LIBS ${XF86VMODE_LIB}) + endif(HAVE_X11_SHARED AND XF86VMODE_LIB) + set(SDL_VIDEO_DRIVER_X11_XVIDMODE 1) + set(HAVE_VIDEO_X11_XVM TRUE) + endif(VIDEO_X11_XVM AND HAVE_XF86VM_H) + + set(CMAKE_REQUIRED_LIBRARIES) + endif(X11_LIB) + endif(VIDEO_X11) +endmacro(CheckX11) + +# Requires: +# - n/a +# +macro(CheckCOCOA) + if(VIDEO_COCOA) + check_objc_source_compiles(" + #import + int main (int argc, char** argv) {}" HAVE_VIDEO_COCOA) + if(HAVE_VIDEO_COCOA) + file(GLOB COCOA_SOURCES ${SDL2_SOURCE_DIR}/src/video/cocoa/*.m) + set_source_files_properties(${COCOA_SOURCES} PROPERTIES LANGUAGE C) + set(SOURCE_FILES ${SOURCE_FILES} ${COCOA_SOURCES}) + set(SDL_VIDEO_DRIVER_COCOA 1) + set(HAVE_SDL_VIDEO TRUE) + endif(HAVE_VIDEO_COCOA) + endif(VIDEO_COCOA) +endmacro(CheckCOCOA) + +# Requires: +# - PkgCheckModules +# Optional: +# - DIRECTFB_SHARED opt +# - HAVE_DLOPEN opt +macro(CheckDirectFB) + if(VIDEO_DIRECTFB) + pkg_check_modules(PKG_DIRECTFB directfb>=1.0.0) + if(PKG_DIRECTFB_FOUND) + set(HAVE_VIDEO_DIRECTFB TRUE) + file(GLOB DIRECTFB_SOURCES ${SDL2_SOURCE_DIR}/src/video/directfb/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${DIRECTFB_SOURCES}) + set(SDL_VIDEO_DRIVER_DIRECTFB 1) + set(SDL_VIDEO_RENDER_DIRECTFB 1) + list(APPEND EXTRA_CFLAGS ${PKG_DIRECTFB_CFLAGS}) + if(DIRECTFB_SHARED) + if(NOT HAVE_DLOPEN) + message_warn("You must have SDL_LoadObject() support for dynamic DirectFB loading") + else() + find_library(D_DIRECTFB_LIB directfb) + get_filename_component(F_DIRECTFB_LIB ${D_DIRECTFB_LIB} NAME) + set(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC "\"${F_DIRECTFB_LIB}\"") + set(HAVE_DIRECTFB_SHARED TRUE) + endif(NOT HAVE_DLOPEN) + else(DIRECTFB_SHARED) + list(APPEND EXTRA_LDFLAGS ${PKG_DIRECTFB_LDFLAGS}) + endif(DIRECTFB_SHARED) + set(HAVE_SDL_VIDEO TRUE) + endif(PKG_DIRECTFB_FOUND) + endif(VIDEO_DIRECTFB) +endmacro(CheckDirectFB) + +# Requires: +# - nada +macro(CheckOpenGLX11) + if(VIDEO_OPENGL) + check_c_source_compiles(" + #include + #include + int main(int argc, char** argv) {}" HAVE_VIDEO_OPENGL) + + if(HAVE_VIDEO_OPENGL) + set(HAVE_VIDEO_OPENGL TRUE) + set(SDL_VIDEO_OPENGL 1) + set(SDL_VIDEO_OPENGL_GLX 1) + set(SDL_VIDEO_RENDER_OGL 1) + list(APPEND EXTRA_LIBS GL) + endif(HAVE_VIDEO_OPENGL) + endif(VIDEO_OPENGL) +endmacro(CheckOpenGLX11) + +# Requires: +# - nada +macro(CheckOpenGLESX11) + if(VIDEO_OPENGLES) + check_c_source_compiles(" + #include + int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES) + if(HAVE_VIDEO_OPENGLES) + check_c_source_compiles(" + #include + #include + int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V1) + if(HAVE_VIDEO_OPENGLES_V1) + set(SDL_VIDEO_OPENGL_ES 1) + set(SDL_VIDEO_RENDER_OGL_ES 1) + endif(HAVE_VIDEO_OPENGLES_V1) + check_c_source_compiles(" + #include + #include + int main (int argc, char** argv) {}" HAVE_VIDEO_OPENGLES_V2) + if(HAVE_VIDEO_OPENGLES_V2) + set(SDL_VIDEO_OPENGL_ES2 1) + set(SDL_VIDEO_RENDER_OGL_ES2 1) + endif(HAVE_VIDEO_OPENGLES_V2) + endif(HAVE_VIDEO_OPENGLES) + endif(VIDEO_OPENGLES) +endmacro(CheckOpenGLESX11) + +# Rquires: +# - nada +# Optional: +# - THREADS opt +# Sets: +# PTHREAD_CFLAGS +# PTHREAD_LIBS +macro(CheckPTHREAD) + if(PTHREADS) + if(LINUX) + set(PTHREAD_CFLAGS "-D_REENTRANT") + set(PTHREAD_LDFLAGS "-pthread") + elseif(BSDI) + set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE") + set(PTHREAD_LDFLAGS "") + elseif(DARWIN) + set(PTHREAD_CFLAGS "-D_THREAD_SAFE") + # causes Carbon.p complaints? + # set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE") + set(PTHREAD_LDFLAGS "") + elseif(FREEBSD) + set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE") + set(PTHREAD_LDFLAGS "-pthread") + elseif(NETBSD) + set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE") + set(PTHREAD_LDFLAGS "-lpthread") + elseif(OPENBSD) + set(PTHREAD_CFLAGS "-D_REENTRANT") + set(PTHREAD_LDFLAGS "-pthread") + elseif(SOLARIS) + set(PTHREAD_CFLAGS "-D_REENTRANT") + set(PTHREAD_LDFLAGS "-pthread -lposix4") + elseif(SYSV5) + set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread") + set(PTHREAD_LDFLAGS "") + elseif(AIX) + set(PTHREAD_CFLAGS "-D_REENTRANT -mthreads") + set(PTHREAD_LDFLAGS "-pthread") + elseif(HPUX) + set(PTHREAD_CFLAGS "-D_REENTRANT") + set(PTHREAD_LDFLAGS "-L/usr/lib -pthread") + else() + set(PTHREAD_CFLAGS "-D_REENTRANT") + set(PTHREAD_LDFLAGS "-lpthread") + endif(LINUX) + + # Run some tests + set(CMAKE_REQUIRED_FLAGS "${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS}") + check_c_source_runs(" + #include + int main(int argc, char** argv) { + pthread_attr_t type; + pthread_attr_init(&type); + return 0; + }" HAVE_PTHREADS) + if(HAVE_PTHREADS) + set(SDL_THREAD_PTHREAD 1) + list(APPEND EXTRA_CFLAGS ${PTHREAD_CFLAGS}) + list(APPEND EXTRA_LDFLAGS ${PTHREAD_LDFLAGS}) + set(SDL_CFLAGS "${SDL_CFLAGS} ${PTHREAD_CFLAGS}") + list(APPEND SDL_LIBS ${PTHREAD_LDFLAGS}) + + check_c_source_compiles(" + #include + int main(int argc, char **argv) { + pthread_mutexattr_t attr; + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + return 0; + }" HAVE_RECURSIVE_MUTEXES) + if(HAVE_RECURSIVE_MUTEXES) + set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1) + else(HAVE_RECURSIVE_MUTEXES) + check_c_source_compiles(" + #include + int main(int argc, char **argv) { + pthread_mutexattr_t attr; + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + return 0; + }" HAVE_RECURSIVE_MUTEXES_NP) + if(HAVE_RECURSIVE_MUTEXES_NP) + set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1) + endif(HAVE_RECURSIVE_MUTEXES_NP) + endif(HAVE_RECURSIVE_MUTEXES) + + if(PTHREADS_SEM) + check_c_source_compiles("#include + #include + int main(int argc, char **argv) { return 0; }" HAVE_PTHREADS_SEM) + if(HAVE_PTHREADS_SEM) + check_c_source_compiles(" + #include + #include + int main(int argc, char **argv) { + sem_timedwait(NULL, NULL); + return 0; + }" HAVE_SEM_TIMEDWAIT) + endif(HAVE_PTHREADS_SEM) + endif(PTHREADS_SEM) + + check_c_source_compiles(" + #include + int main(int argc, char** argv) { + pthread_spin_trylock(NULL); + return 0; + }" HAVE_PTHREAD_SPINLOCK) + + check_c_source_compiles(" + #include + #include + int main(int argc, char** argv) { return 0; }" HAVE_PTHREAD_NP_H) + check_function_exists(pthread_setname_np HAVE_PTHREAD_setNAME_NP) + check_function_exists(pthread_set_name_np HAVE_PTHREAD_set_NAME_NP) + set(CMAKE_REQUIRED_FLAGS) + + set(SOURCE_FILES ${SOURCE_FILES} + ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c + ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_sysmutex.c # Can be faked, if necessary + ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syscond.c # Can be faked, if necessary + ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_systls.c + ) + if(HAVE_PTHREADS_SEM) + set(SOURCE_FILES ${SOURCE_FILES} + ${SDL2_SOURCE_DIR}/src/thread/pthread/SDL_syssem.c) + else(HAVE_PTHREADS_SEM) + set(SOURCE_FILES ${SOURCE_FILES} + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syssem.c) + endif(HAVE_PTHREADS_SEM) + set(HAVE_SDL_THREADS TRUE) + endif(HAVE_PTHREADS) + endif(PTHREADS) +endmacro(CheckPTHREAD) + +# Requires +# - nada +# Optional: +# Sets: +# USB_LIBS +# USB_CFLAGS +macro(CheckUSBHID) + check_library_exists(usbhid hid_init "" LIBUSBHID) + if(LIBUSBHID) + check_include_file(usbhid.h HAVE_USBHID_H) + if(HAVE_USBHID_H) + set(USB_CFLAGS "-DHAVE_USBHID_H") + endif(HAVE_USBHID_H) + + check_include_file(libusbhid.h HAVE_LIBUSBHID_H) + if(HAVE_LIBUSBHID_H) + set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSBHID_H") + endif(HAVE_LIBUSBHID_H) + set(USB_LIBS ${USB_LIBS} usbhid) + else(LIBUSBHID) + check_include_file(usb.h HAVE_USB_H) + if(HAVE_USB_H) + set(USB_CFLAGS "-DHAVE_USB_H") + endif(HAVE_USB_H) + check_include_file(libusb.h HAVE_LIBUSB_H) + if(HAVE_LIBUSB_H) + set(USB_CFLAGS "${USB_CFLAGS} -DHAVE_LIBUSB_H") + endif(HAVE_LIBUSB_H) + check_library_exists(usb hid_init "" LIBUSB) + if(LIBUSB) + set(USB_LIBS ${USB_LIBS} usb) + endif(LIBUSB) + endif(LIBUSBHID) + + set(CMAKE_REQUIRED_FLAGS "${USB_CFLAGS}") + set(CMAKE_REQUIRED_LIBRARIES "${USB_LIBS}") + check_c_source_compiles(" + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + # include + # include + #else + # include + # include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + int main(int argc, char **argv) { + struct report_desc *repdesc; + struct usb_ctl_report *repbuf; + hid_kind_t hidkind; + return 0; + }" HAVE_USBHID) + if(HAVE_USBHID) + check_c_source_compiles(" + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + # include + # include + #else + # include + # include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + int main(int argc, char** argv) { + struct usb_ctl_report buf; + if (buf.ucr_data) { } + return 0; + }" HAVE_USBHID_UCR_DATA) + if(HAVE_USBHID_UCR_DATA) + set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_UCR_DATA") + endif(HAVE_USBHID_UCR_DATA) + + check_c_source_compiles(" + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + #include + #include + #else + #include + #include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + int main(int argc, char **argv) { + report_desc_t d; + hid_start_parse(d, 1, 1); + return 0; + }" HAVE_USBHID_NEW) + if(HAVE_USBHID_NEW) + set(USB_CFLAGS "${USB_CFLAGS} -DUSBHID_NEW") + endif(HAVE_USBHID_NEW) + + check_c_source_compiles(" + #include + int main(int argc, char** argv) { + struct joystick t; + return 0; + }" HAVE_MACHINE_JOYSTICK) + if(HAVE_MACHINE_JOYSTICK) + set(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1) + endif(HAVE_MACHINE_JOYSTICK) + set(SDL_JOYSTICK_USBHID 1) + file(GLOB BSD_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/bsd/*.c) + set(SOURCE_FILES ${SOURCE_FILES} ${BSD_JOYSTICK_SOURCES}) + list(APPEND EXTRA_CFLAGS ${USB_CFLAGS}) + list(APPEND EXTRA_LIBS ${USB_LIBS}) + set(HAVE_SDL_JOYSTICK TRUE) + + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_REQUIRED_FLAGS) + endif(HAVE_USBHID) +endmacro(CheckUSBHID) diff --git a/configure b/configure new file mode 100755 index 0000000000..38084c2721 --- /dev/null +++ b/configure @@ -0,0 +1,25122 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="README.txt" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +EXTRA_LDFLAGS +BUILD_LDFLAGS +EXTRA_CFLAGS +BUILD_CFLAGS +SDLTEST_OBJECTS +SDLMAIN_OBJECTS +VERSION_OBJECTS +OBJECTS +INCLUDE +ac_aux_dir +ENABLE_STATIC_FALSE +ENABLE_STATIC_TRUE +ENABLE_SHARED_FALSE +ENABLE_SHARED_TRUE +SDL_RLD_FLAGS +SDL_STATIC_LIBS +SDL_LIBS +SDL_CFLAGS +DIRECTFBCONFIG +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +XMKMF +ARTSCONFIG +PKG_CONFIG +ESD_LIBS +ESD_CFLAGS +ESD_CONFIG +ALSA_LIBS +ALSA_CFLAGS +POW_LIB +LIBOBJS +ALLOCA +WINDRES +SET_MAKE +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +CXXCPP +ac_ct_CXX +CXXFLAGS +CXX +LT_AGE +LT_REVISION +LT_CURRENT +LT_RELEASE +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +AWK +RANLIB +STRIP +ac_ct_AR +AR +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +OBJDUMP +DLLTOOL +AS +SDL_VERSION +SDL_BINARY_AGE +SDL_INTERFACE_AGE +SDL_MICRO_VERSION +SDL_MINOR_VERSION +SDL_MAJOR_VERSION +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_assertions +enable_dependency_tracking +enable_libc +enable_gcc_atomics +enable_atomic +enable_audio +enable_video +enable_render +enable_events +enable_joystick +enable_haptic +enable_power +enable_threads +enable_timers +enable_file +enable_loadso +enable_cpuinfo +enable_assembly +enable_ssemath +enable_mmx +enable_3dnow +enable_sse +enable_sse2 +enable_altivec +enable_oss +enable_alsa +with_alsa_prefix +with_alsa_inc_prefix +enable_alsatest +enable_alsa_shared +enable_esd +with_esd_prefix +with_esd_exec_prefix +enable_esdtest +enable_esd_shared +enable_pulseaudio +enable_pulseaudio_shared +enable_arts +enable_arts_shared +enable_nas +enable_nas_shared +enable_sndio +enable_sndio_shared +enable_diskaudio +enable_dummyaudio +enable_video_x11 +with_x +enable_x11_shared +enable_video_x11_xcursor +enable_video_x11_xinerama +enable_video_x11_xinput +enable_video_x11_xrandr +enable_video_x11_scrnsaver +enable_video_x11_xshape +enable_video_x11_vm +enable_video_cocoa +enable_video_directfb +enable_directfb_shared +enable_fusionsound +enable_fusionsound_shared +enable_video_dummy +enable_video_opengl +enable_video_opengles +enable_libudev +enable_dbus +enable_input_tslib +enable_pthreads +enable_pthread_sem +enable_directx +enable_sdl_dlopen +enable_clock_gettime +enable_rpath +enable_render_d3d +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +XMKMF' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-assertions Enable internal sanity checks + (auto/disabled/release/enabled/paranoid) + [[default=auto]] + --enable-dependency-tracking + Use gcc -MMD -MT dependency tracking [[default=yes]] + --enable-libc Use the system C library [[default=yes]] + --enable-gcc-atomics Use gcc builtin atomics [[default=yes]] + --enable-atomic Enable the atomic operations subsystem + [[default=yes]] + --enable-audio Enable the audio subsystem [[default=yes]] + --enable-video Enable the video subsystem [[default=yes]] + --enable-render Enable the render subsystem [[default=yes]] + --enable-events Enable the events subsystem [[default=yes]] + --enable-joystick Enable the joystick subsystem [[default=yes]] + --enable-haptic Enable the haptic (force feedback) subsystem + [[default=yes]] + --enable-power Enable the power subsystem [[default=yes]] + --enable-threads Enable the threading subsystem [[default=yes]] + --enable-timers Enable the timer subsystem [[default=yes]] + --enable-file Enable the file subsystem [[default=yes]] + --enable-loadso Enable the shared object loading subsystem + [[default=yes]] + --enable-cpuinfo Enable the cpuinfo subsystem [[default=yes]] + --enable-atomic Enable the atomic operations [[default=yes]] + --enable-assembly Enable assembly routines [[default=yes]] + --enable-ssemath Allow GCC to use SSE floating point math + [[default=no]] + --enable-mmx use MMX assembly routines [[default=yes]] + --enable-3dnow use 3DNow! assembly routines [[default=yes]] + --enable-sse use SSE assembly routines [[default=yes]] + --enable-sse2 use SSE2 assembly routines [[default=no]] + --enable-altivec use Altivec assembly routines [[default=yes]] + --enable-oss support the OSS audio API [[default=maybe]] + --enable-alsa support the ALSA audio API [[default=yes]] + --disable-alsatest Do not try to compile and run a test Alsa program + --enable-alsa-shared dynamically load ALSA audio support [[default=yes]] + --enable-esd support the Enlightened Sound Daemon [[default=yes]] + --disable-esdtest Do not try to compile and run a test ESD program + --enable-esd-shared dynamically load ESD audio support [[default=yes]] + --enable-pulseaudio use PulseAudio [[default=yes]] + --enable-pulseaudio-shared + dynamically load PulseAudio support [[default=yes]] + --enable-arts support the Analog Real Time Synthesizer + [[default=yes]] + --enable-arts-shared dynamically load aRts audio support [[default=yes]] + --enable-nas support the NAS audio API [[default=yes]] + --enable-nas-shared dynamically load NAS audio support [[default=yes]] + --enable-sndio support the sndio audio API [[default=yes]] + --enable-sndio-shared dynamically load sndio audio support [[default=yes]] + --enable-diskaudio support the disk writer audio driver [[default=yes]] + --enable-dummyaudio support the dummy audio driver [[default=yes]] + --enable-video-x11 use X11 video driver [[default=yes]] + --enable-x11-shared dynamically load X11 support [[default=maybe]] + --enable-video-x11-xcursor + enable X11 Xcursor support [[default=yes]] + --enable-video-x11-xinerama + enable X11 Xinerama support [[default=yes]] + --enable-video-x11-xinput + enable X11 XInput extension for manymouse, tablets, + etc [[default=yes]] + --enable-video-x11-xrandr + enable X11 Xrandr extension for fullscreen + [[default=yes]] + --enable-video-x11-scrnsaver + enable X11 screensaver extension [[default=yes]] + --enable-video-x11-xshape + enable X11 XShape support [[default=yes]] + --enable-video-x11-vm use X11 VM extension for fullscreen [[default=yes]] + --enable-video-cocoa use Cocoa video driver [[default=yes]] + --enable-video-directfb use DirectFB video driver [[default=no]] + --enable-directfb-shared + dynamically load directfb support [[default=yes]] + --enable-fusionsound use FusionSound audio driver [[default=no]] + --enable-fusionsound-shared + dynamically load fusionsound audio support + [[default=yes]] + --enable-video-dummy use dummy video driver [[default=yes]] + --enable-video-opengl include OpenGL support [[default=yes]] + --enable-video-opengles include OpenGL ES support [[default=yes]] + --enable-libudev enable libudev support [[default=yes]] + --enable-dbus enable D-Bus support [[default=yes]] + --enable-input-tslib use the Touchscreen library for input + [[default=yes]] + --enable-pthreads use POSIX threads for multi-threading + [[default=yes]] + --enable-pthread-sem use pthread semaphores [[default=yes]] + --enable-directx use DirectX for Windows audio/video [[default=yes]] + --enable-sdl-dlopen use dlopen for shared object loading [[default=yes]] + --enable-clock_gettime use clock_gettime() instead of gettimeofday() on + UNIX [[default=yes]] + --enable-rpath use an rpath when linking SDL [[default=yes]] + --enable-render-d3d enable the Direct3D render driver [[default=yes]] + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional) + --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional) + --with-esd-prefix=PFX Prefix where ESD is installed (optional) + --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional) + --with-x use the X Window System + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers include/SDL_config.h" + +ac_aux_dir= +for ac_dir in build-scripts "$srcdir"/build-scripts; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-scripts \"$srcdir\"/build-scripts" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + + +orig_CFLAGS="$CFLAGS" + +# +# Making releases: +# Edit include/SDL_version.h and change the version, then: +# SDL_MICRO_VERSION += 1; +# SDL_INTERFACE_AGE += 1; +# SDL_BINARY_AGE += 1; +# if any functions have been added, set SDL_INTERFACE_AGE to 0. +# if backwards compatibility has been broken, +# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0. +# +SDL_MAJOR_VERSION=2 +SDL_MINOR_VERSION=0 +SDL_MICRO_VERSION=0 +SDL_INTERFACE_AGE=0 +SDL_BINARY_AGE=0 +SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION + + + + + + + + +# libtool versioning +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + lt_cv_deplibs_check_method=pass_all + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + lt_cv_deplibs_check_method=pass_all + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION +LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE` +LT_REVISION=$SDL_INTERFACE_AGE +LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE` + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec_CXX='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + gnu*) + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no + + GCC_CXX="$GXX" + LD_CXX="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + #soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo ${libname} | sed -e 's/^lib//'`${shared_ext}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + #soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +WINDRES=$ac_cv_prog_WINDRES +if test -n "$WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 +$as_echo "$WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_WINDRES"; then + ac_ct_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_WINDRES+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_WINDRES"; then + ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_WINDRES="windres" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES +if test -n "$ac_ct_WINDRES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_WINDRES" >&5 +$as_echo "$ac_ct_WINDRES" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_WINDRES" = x; then + WINDRES=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + WINDRES=$ac_ct_WINDRES + fi +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + +case "$host" in + *-*-mingw32*) + # Except on msys, where make can't handle full pathnames (bug 1972) + ;; + *) + srcdir=`cd $srcdir && pwd` + ;; +esac + +INCLUDE="-I$srcdir/include" +if test x$srcdir != x.; then + INCLUDE="-Iinclude $INCLUDE" +elif test -d .hg; then + as_fn_error $? " +*** When building from Mercurial you should configure and build in a + separate directory so you don't clobber SDL_config.h, SDL_revision.h +" "$LINENO" 5 +fi +BASE_CFLAGS="" +BASE_LDFLAGS="" +case "$host" in + *-*-cygwin*) + # We build SDL on cygwin without the UNIX emulation layer + save_CFLAGS="$CFLAGS" + have_no_cygwin=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mno-cygwin option" >&5 +$as_echo_n "checking for GCC -mno-cygwin option... " >&6; } + CFLAGS="$save_CFLAGS -mno-cygwin" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_no_cygwin=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_no_cygwin" >&5 +$as_echo "$have_no_cygwin" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_no_cygwin = xyes; then + BASE_CFLAGS="-mno-cygwin" + BASE_LDFLAGS="-mno-cygwin" + fi + BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw" + ;; +esac +# Uncomment the following line if you want to force SDL and applications +# built with it to be compiled for a particular architecture. +#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]") +BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H" +# The default optimization for SDL is -O3 (Bug #31) +if test "x$orig_CFLAGS" = x; then + BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'` +fi +EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS" +BUILD_LDFLAGS="$LDFLAGS" +EXTRA_LDFLAGS="$BASE_LDFLAGS" +## These are common directories to find software packages +#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do +# if test -d $path/include; then +# EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include" +# fi +# if test -d $path/lib; then +# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib" +# fi +#done +SDL_CFLAGS="$BASE_CFLAGS" +SDL_LIBS="-lSDL2 $BASE_LDFLAGS" +CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS" +CFLAGS="$CFLAGS $EXTRA_CFLAGS" +LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" + +base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'` + +find_lib() +{ + gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'` + gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'` + env_lib_path=`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'` + if test "$cross_compiling" = yes; then + host_lib_path="" + else + host_lib_path="/usr/$base_libdir /usr/local/$base_libdir" + fi + for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do + lib=`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1` + if test x$lib != x; then + echo $lib + return + fi + done +} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } +if ${ac_cv_c_volatile+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +volatile int x; +int * volatile y = (int *) 0; +return !x && !y; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_volatile=yes +else + ac_cv_c_volatile=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 +$as_echo "$ac_cv_c_volatile" >&6; } +if test $ac_cv_c_volatile = no; then + +$as_echo "#define volatile /**/" >>confdefs.h + +fi + + +# Check whether --enable-assertions was given. +if test "${enable_assertions+set}" = set; then : + enableval=$enable_assertions; +else + enable_assertions=auto +fi + +case "$enable_assertions" in + auto) # Use optimization settings to determine assertion level + ;; + disabled) + +$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 0" >>confdefs.h + + ;; + release) + +$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 1" >>confdefs.h + + ;; + enabled) + +$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 2" >>confdefs.h + + ;; + paranoid) + +$as_echo "#define SDL_DEFAULT_ASSERT_LEVEL 3" >>confdefs.h + + ;; + *) + as_fn_error $? "*** unknown assertion level. stop." "$LINENO" 5 + ;; +esac + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +else + enable_dependency_tracking=yes +fi + +if test x$enable_dependency_tracking = xyes; then + have_gcc_mmd_mt=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -MMD -MT option" >&5 +$as_echo_n "checking for GCC -MMD -MT option... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if !defined(__GNUC__) || __GNUC__ < 3 + #error Dependency tracking requires GCC 3.0 or newer + #endif + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_mmd_mt=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_mmd_mt" >&5 +$as_echo "$have_gcc_mmd_mt" >&6; } + + if test x$have_gcc_mmd_mt = xyes; then + DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@" + fi +fi + +# Actually this doesn't work on OpenBSD and BeOS +#AC_MSG_CHECKING(for linker option --no-undefined) +#have_no_undefined=no +#save_LDFLAGS="$LDFLAGS" +#LDFLAGS="$LDFLAGS -Wl,--no-undefined" +#AC_TRY_LINK([ +#],[ +#],[ +#have_no_undefined=yes +#EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined" +#]) +#LDFLAGS="$save_LDFLAGS" +#AC_MSG_RESULT($have_no_undefined) + +# Check whether --enable-libc was given. +if test "${enable_libc+set}" = set; then : + enableval=$enable_libc; +else + enable_libc=yes +fi + +if test x$enable_libc = xyes; then + +$as_echo "#define HAVE_LIBC 1" >>confdefs.h + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + + for ac_header in sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for M_PI in math.h" >&5 +$as_echo_n "checking for M_PI in math.h... " >&6; } +if ${ac_cv_define_M_PI+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef M_PI +YES_IS_DEFINED +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "YES_IS_DEFINED" >/dev/null 2>&1; then : + ac_cv_define_M_PI=yes +else + ac_cv_define_M_PI=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_define_M_PI" >&5 +$as_echo "$ac_cv_define_M_PI" >&6; } + if test "$ac_cv_define_M_PI" = "yes" ; then + +$as_echo "#define HAVE_M_PI /**/" >>confdefs.h + + fi + + + case "$host" in + *-*-cygwin* | *-*-mingw32*) + ;; + *) + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes +else + ac_cv_working_alloca_h=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then + +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes +else + ac_cv_func_alloca_works=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } + +if test $ac_cv_func_alloca_works = yes; then + +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + +else + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + +$as_echo "#define C_ALLOCA 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray +#else +wenotbecray +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes +else + ac_cv_os_cray=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + + break +fi + + done +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} + +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 +else + ac_cv_c_stack_direction=-1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF + + +fi + + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if ${ac_cv_func_memcmp_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_memcmp_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + + if test x$ac_cv_func_memcmp_working = xyes; then + +$as_echo "#define HAVE_MEMCMP 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if ${ac_cv_func_strtod+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + + if test x$ac_cv_func_strtod = xyes; then + +$as_echo "#define HAVE_STRTOD 1" >>confdefs.h + + fi + ac_fn_c_check_func "$LINENO" "mprotect" "ac_cv_func_mprotect" +if test "x$ac_cv_func_mprotect" = xyes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_MPROTECT 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + + for ac_func in malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm" +fi + + for ac_func in atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 +$as_echo_n "checking for iconv_open in -liconv... " >&6; } +if ${ac_cv_lib_iconv_iconv_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char iconv_open (); +int +main () +{ +return iconv_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_iconv_iconv_open=yes +else + ac_cv_lib_iconv_iconv_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 +$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; } +if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then : + LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv" +fi + + for ac_func in iconv +do : + ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv" +if test "x$ac_cv_func_iconv" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ICONV 1 +_ACEOF + +fi +done + + + ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include +" +if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes; then : + $as_echo "#define HAVE_SA_SIGACTION 1" >>confdefs.h + +fi + +fi + + +# Check whether --enable-gcc-atomics was given. +if test "${enable_gcc_atomics+set}" = set; then : + enableval=$enable_gcc_atomics; +else + enable_gcc_atomics=yes +fi + +if test x$enable_gcc_atomics = xyes; then + have_gcc_atomics=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC builtin atomic operations" >&5 +$as_echo_n "checking for GCC builtin atomic operations... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + int a; + void *x, *y, *z; + __sync_lock_test_and_set(&a, 4); + __sync_lock_test_and_set(&x, y); + __sync_fetch_and_add(&a, 1); + __sync_bool_compare_and_swap(&a, 5, 10); + __sync_bool_compare_and_swap(&x, y, z); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + have_gcc_atomics=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_atomics" >&5 +$as_echo "$have_gcc_atomics" >&6; } + + if test x$have_gcc_atomics = xyes; then + +$as_echo "#define HAVE_GCC_ATOMICS 1" >>confdefs.h + + else + # See if we have the minimum operation needed for GCC atomics + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + int a; + __sync_lock_test_and_set(&a, 1); + __sync_lock_release(&a); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + have_gcc_sync_lock_test_and_set=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test x$have_gcc_sync_lock_test_and_set = xyes; then + +$as_echo "#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1" >>confdefs.h + + fi + fi +fi + +# Standard C sources +SOURCES="$SOURCES $srcdir/src/*.c" +SOURCES="$SOURCES $srcdir/src/atomic/*.c" +SOURCES="$SOURCES $srcdir/src/audio/*.c" +SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c" +SOURCES="$SOURCES $srcdir/src/events/*.c" +SOURCES="$SOURCES $srcdir/src/file/*.c" +SOURCES="$SOURCES $srcdir/src/haptic/*.c" +SOURCES="$SOURCES $srcdir/src/joystick/*.c" +SOURCES="$SOURCES $srcdir/src/libm/*.c" +SOURCES="$SOURCES $srcdir/src/power/*.c" +SOURCES="$SOURCES $srcdir/src/render/*.c" +SOURCES="$SOURCES $srcdir/src/render/*/*.c" +SOURCES="$SOURCES $srcdir/src/stdlib/*.c" +SOURCES="$SOURCES $srcdir/src/thread/*.c" +SOURCES="$SOURCES $srcdir/src/timer/*.c" +SOURCES="$SOURCES $srcdir/src/video/*.c" + + +# Check whether --enable-atomic was given. +if test "${enable_atomic+set}" = set; then : + enableval=$enable_atomic; +else + enable_atomic=yes +fi + +if test x$enable_atomic != xyes; then + +$as_echo "#define SDL_ATOMIC_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-audio was given. +if test "${enable_audio+set}" = set; then : + enableval=$enable_audio; +else + enable_audio=yes +fi + +if test x$enable_audio != xyes; then + +$as_echo "#define SDL_AUDIO_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-video was given. +if test "${enable_video+set}" = set; then : + enableval=$enable_video; +else + enable_video=yes +fi + +if test x$enable_video != xyes; then + +$as_echo "#define SDL_VIDEO_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-render was given. +if test "${enable_render+set}" = set; then : + enableval=$enable_render; +else + enable_render=yes +fi + +if test x$enable_render != xyes; then + +$as_echo "#define SDL_RENDER_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-events was given. +if test "${enable_events+set}" = set; then : + enableval=$enable_events; +else + enable_events=yes +fi + +if test x$enable_events != xyes; then + +$as_echo "#define SDL_EVENTS_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-joystick was given. +if test "${enable_joystick+set}" = set; then : + enableval=$enable_joystick; +else + enable_joystick=yes +fi + +if test x$enable_joystick != xyes; then + +$as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-haptic was given. +if test "${enable_haptic+set}" = set; then : + enableval=$enable_haptic; +else + enable_haptic=yes +fi + +if test x$enable_haptic != xyes; then + +$as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-power was given. +if test "${enable_power+set}" = set; then : + enableval=$enable_power; +else + enable_power=yes +fi + +if test x$enable_power != xyes; then + +$as_echo "#define SDL_POWER_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; +else + enable_threads=yes +fi + +if test x$enable_threads != xyes; then + +$as_echo "#define SDL_THREADS_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-timers was given. +if test "${enable_timers+set}" = set; then : + enableval=$enable_timers; +else + enable_timers=yes +fi + +if test x$enable_timers != xyes; then + +$as_echo "#define SDL_TIMERS_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-file was given. +if test "${enable_file+set}" = set; then : + enableval=$enable_file; +else + enable_file=yes +fi + +if test x$enable_file != xyes; then + +$as_echo "#define SDL_FILE_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-loadso was given. +if test "${enable_loadso+set}" = set; then : + enableval=$enable_loadso; +else + enable_loadso=yes +fi + +if test x$enable_loadso != xyes; then + +$as_echo "#define SDL_LOADSO_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-cpuinfo was given. +if test "${enable_cpuinfo+set}" = set; then : + enableval=$enable_cpuinfo; +else + enable_cpuinfo=yes +fi + +if test x$enable_cpuinfo != xyes; then + +$as_echo "#define SDL_CPUINFO_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-atomic was given. +if test "${enable_atomic+set}" = set; then : + enableval=$enable_atomic; +else + enable_atomic=yes +fi + +if test x$enable_atomic != xyes; then + +$as_echo "#define SDL_ATOMIC_DISABLED 1" >>confdefs.h + +fi +# Check whether --enable-assembly was given. +if test "${enable_assembly+set}" = set; then : + enableval=$enable_assembly; +else + enable_assembly=yes +fi + +if test x$enable_assembly = xyes; then + +$as_echo "#define SDL_ASSEMBLY_ROUTINES 1" >>confdefs.h + + + # Make sure that we don't generate floating point code that would + # cause illegal instruction exceptions on older processors + case "$host" in + *-*-darwin*) + # Don't need to worry about Apple hardware, it's all SSE capable + default_ssemath=yes + ;; + *64-*-*) + # x86 64-bit architectures all have SSE instructions + default_ssemath=yes + ;; + *) + default_ssemath=no + ;; + esac + # Check whether --enable-ssemath was given. +if test "${enable_ssemath+set}" = set; then : + enableval=$enable_ssemath; +else + enable_ssemath=$default_ssemath +fi + + if test x$enable_ssemath = xno; then + if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387" + fi + fi + + # Check whether --enable-mmx was given. +if test "${enable_mmx+set}" = set; then : + enableval=$enable_mmx; +else + enable_mmx=yes +fi + + if test x$enable_mmx = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_mmx=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mmmx option" >&5 +$as_echo_n "checking for GCC -mmmx option... " >&6; } + mmx_CFLAGS="-mmmx" + CFLAGS="$save_CFLAGS $mmx_CFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __MMX__ + #error Assembler CPP flag not enabled + #endif + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_mmx=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_mmx" >&5 +$as_echo "$have_gcc_mmx" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_mmx = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS" + fi + fi + + # Check whether --enable-3dnow was given. +if test "${enable_3dnow+set}" = set; then : + enableval=$enable_3dnow; +else + enable_3dnow=yes +fi + + if test x$enable_3dnow = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_3dnow=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -m3dnow option" >&5 +$as_echo_n "checking for GCC -m3dnow option... " >&6; } + amd3dnow_CFLAGS="-m3dnow" + CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef __3dNOW__ + #error Assembler CPP flag not enabled + #endif + +int +main () +{ + + void *p = 0; + _m_prefetch(p); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + have_gcc_3dnow=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_3dnow" >&5 +$as_echo "$have_gcc_3dnow" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_3dnow = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS" + fi + fi + + # Check whether --enable-sse was given. +if test "${enable_sse+set}" = set; then : + enableval=$enable_sse; +else + enable_sse=yes +fi + + if test x$enable_sse = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_sse=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -msse option" >&5 +$as_echo_n "checking for GCC -msse option... " >&6; } + sse_CFLAGS="-msse" + CFLAGS="$save_CFLAGS $sse_CFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __SSE__ + #error Assembler CPP flag not enabled + #endif + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_sse=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_sse" >&5 +$as_echo "$have_gcc_sse" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_sse = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS" + fi + fi + + # Check whether --enable-sse2 was given. +if test "${enable_sse2+set}" = set; then : + enableval=$enable_sse2; +else + enable_sse2=$default_ssemath +fi + + if test x$enable_sse2 = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_sse2=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -msse2 option" >&5 +$as_echo_n "checking for GCC -msse2 option... " >&6; } + sse2_CFLAGS="-msse2" + CFLAGS="$save_CFLAGS $sse2_CFLAGS" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __SSE2__ + #error Assembler CPP flag not enabled + #endif + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_sse2=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_sse2" >&5 +$as_echo "$have_gcc_sse2" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_sse2 = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS" + fi + fi + + # Check whether --enable-altivec was given. +if test "${enable_altivec+set}" = set; then : + enableval=$enable_altivec; +else + enable_altivec=yes +fi + + if test x$enable_altivec = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_altivec=no + have_altivec_h_hdr=no + altivec_CFLAGS="-maltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC altivec.h and -maltivec option" >&5 +$as_echo_n "checking for Altivec with GCC altivec.h and -maltivec option... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_altivec=yes + have_altivec_h_hdr=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5 +$as_echo "$have_gcc_altivec" >&6; } + + if test x$have_gcc_altivec = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC -maltivec option" >&5 +$as_echo_n "checking for Altivec with GCC -maltivec option... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + vector unsigned int vzero() { + return vec_splat_u32(0); + } + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_altivec=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5 +$as_echo "$have_gcc_altivec" >&6; } + fi + + if test x$have_gcc_altivec = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC altivec.h and -faltivec option" >&5 +$as_echo_n "checking for Altivec with GCC altivec.h and -faltivec option... " >&6; } + altivec_CFLAGS="-faltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_altivec=yes + have_altivec_h_hdr=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5 +$as_echo "$have_gcc_altivec" >&6; } + fi + + if test x$have_gcc_altivec = xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Altivec with GCC -faltivec option" >&5 +$as_echo_n "checking for Altivec with GCC -faltivec option... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + vector unsigned int vzero() { + return vec_splat_u32(0); + } + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_altivec=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_altivec" >&5 +$as_echo "$have_gcc_altivec" >&6; } + fi + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_altivec = xyes; then + +$as_echo "#define SDL_ALTIVEC_BLITTERS 1" >>confdefs.h + + if test x$have_altivec_h_hdr = xyes; then + +$as_echo "#define HAVE_ALTIVEC_H 1" >>confdefs.h + + fi + EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS" + fi + fi +fi + +CheckOSS() +{ + # Check whether --enable-oss was given. +if test "${enable_oss+set}" = set; then : + enableval=$enable_oss; +else + enable_oss=maybe +fi + + + # OpenBSD "has" OSS, but it's not really for app use. They want you to + # use sndio instead. So on there, we default to disabled. You can force + # it on if you really want, though. + if test x$enable_oss = xmaybe; then + enable_oss=yes + case "$host" in + *-*-openbsd*) + enable_oss=no;; + esac + fi + + if test x$enable_audio = xyes -a x$enable_oss = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSS audio support" >&5 +$as_echo_n "checking for OSS audio support... " >&6; } + have_oss=no + if test x$have_oss != xyes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + int arg = SNDCTL_DSP_SETFRAGMENT; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_oss=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test x$have_oss != xyes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + int arg = SNDCTL_DSP_SETFRAGMENT; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_oss=yes + +$as_echo "#define SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_oss" >&5 +$as_echo "$have_oss" >&6; } + if test x$have_oss = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_OSS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c" + have_audio=yes + + # We may need to link with ossaudio emulation library + case "$host" in + *-*-openbsd*|*-*-netbsd*) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";; + esac + fi + fi +} + +CheckALSA() +{ + # Check whether --enable-alsa was given. +if test "${enable_alsa+set}" = set; then : + enableval=$enable_alsa; +else + enable_alsa=yes +fi + + if test x$enable_audio = xyes -a x$enable_alsa = xyes; then + alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + + +# Check whether --with-alsa-prefix was given. +if test "${with_alsa_prefix+set}" = set; then : + withval=$with_alsa_prefix; alsa_prefix="$withval" +else + alsa_prefix="" +fi + + + +# Check whether --with-alsa-inc-prefix was given. +if test "${with_alsa_inc_prefix+set}" = set; then : + withval=$with_alsa_inc_prefix; alsa_inc_prefix="$withval" +else + alsa_inc_prefix="" +fi + + +# Check whether --enable-alsatest was given. +if test "${enable_alsatest+set}" = set; then : + enableval=$enable_alsatest; enable_alsatest="$enableval" +else + enable_alsatest=yes +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA CFLAGS" >&5 +$as_echo_n "checking for ALSA CFLAGS... " >&6; } +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_CFLAGS" >&5 +$as_echo "$ALSA_CFLAGS" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA LDFLAGS" >&5 +$as_echo_n "checking for ALSA LDFLAGS... " >&6; } +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS=`echo $LIBS | sed 's/-lm//'` +LIBS=`echo $LIBS | sed 's/-ldl//'` +LIBS=`echo $LIBS | sed 's/-lpthread//'` +LIBS=`echo $LIBS | sed 's/ //'` +LIBS="$ALSA_LIBS $LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5 +$as_echo "$ALSA_LIBS" >&6; } + +min_alsa_version=0.9.0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libasound headers version >= $min_alsa_version" >&5 +$as_echo_n "checking for libasound headers version >= $min_alsa_version... " >&6; } +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ + +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 +$as_echo "found." >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not present." >&5 +$as_echo "not present." >&6; } + + alsa_found=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +if test "x$enable_alsatest" = "xyes"; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_ctl_open in -lasound" >&5 +$as_echo_n "checking for snd_ctl_open in -lasound... " >&6; } +if ${ac_cv_lib_asound_snd_ctl_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char snd_ctl_open (); +int +main () +{ +return snd_ctl_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_asound_snd_ctl_open=yes +else + ac_cv_lib_asound_snd_ctl_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_ctl_open" >&5 +$as_echo "$ac_cv_lib_asound_snd_ctl_open" >&6; } +if test "x$ac_cv_lib_asound_snd_ctl_open" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBASOUND 1 +_ACEOF + + LIBS="-lasound $LIBS" + +else + + alsa_found=no + +fi + +fi + +if test "x$alsa_found" = "xyes" ; then + have_alsa=yes + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + have_alsa=no + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + + + + + # Restore all flags from before the ALSA detection runs + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + if test x$have_alsa = xyes; then + # Check whether --enable-alsa-shared was given. +if test "${enable_alsa_shared+set}" = set; then : + enableval=$enable_alsa_shared; +else + enable_alsa_shared=yes +fi + + alsa_lib=`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` + + +$as_echo "#define SDL_AUDIO_DRIVER_ALSA 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_alsa_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ALSA loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ALSA loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then + echo "-- dynamic libasound -> $alsa_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "$alsa_lib" +_ACEOF + + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS" + fi + have_audio=yes + fi + fi +} + +CheckESD() +{ + # Check whether --enable-esd was given. +if test "${enable_esd+set}" = set; then : + enableval=$enable_esd; +else + enable_esd=yes +fi + + if test x$enable_audio = xyes -a x$enable_esd = xyes; then + +# Check whether --with-esd-prefix was given. +if test "${with_esd_prefix+set}" = set; then : + withval=$with_esd_prefix; esd_prefix="$withval" +else + esd_prefix="" +fi + + +# Check whether --with-esd-exec-prefix was given. +if test "${with_esd_exec_prefix+set}" = set; then : + withval=$with_esd_exec_prefix; esd_exec_prefix="$withval" +else + esd_exec_prefix="" +fi + +# Check whether --enable-esdtest was given. +if test "${enable_esdtest+set}" = set; then : + enableval=$enable_esdtest; +else + enable_esdtest=yes +fi + + + if test x$esd_exec_prefix != x ; then + esd_args="$esd_args --exec-prefix=$esd_exec_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_exec_prefix/bin/esd-config + fi + fi + if test x$esd_prefix != x ; then + esd_args="$esd_args --prefix=$esd_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_prefix/bin/esd-config + fi + fi + + # Extract the first word of "esd-config", so it can be a program name with args. +set dummy esd-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ESD_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ESD_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ESD_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no" + ;; +esac +fi +ESD_CONFIG=$ac_cv_path_ESD_CONFIG +if test -n "$ESD_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ESD_CONFIG" >&5 +$as_echo "$ESD_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + min_esd_version=0.2.8 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ESD - version >= $min_esd_version" >&5 +$as_echo_n "checking for ESD - version >= $min_esd_version... " >&6; } + no_esd="" + if test "$ESD_CONFIG" = "no" ; then + no_esd=yes + else + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` + + esd_major_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + esd_minor_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_esdtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + rm -f conf.esdtest + if test "$cross_compiling" = yes; then : + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.esdtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_esd_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_esd_version"); + exit(1); + } + + if (($esd_major_version > major) || + (($esd_major_version == major) && ($esd_minor_version > minor)) || + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); + printf("*** to point to the correct copy of esd-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + no_esd=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_esd" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_esd=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + if test "$ESD_CONFIG" = "no" ; then + echo "*** The esd-config script installed by ESD could not be found" + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ESD_CONFIG environment variable to the" + echo "*** full path to esd-config." + else + if test -f conf.esdtest ; then + : + else + echo "*** Could not run ESD test program, checking why..." + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding ESD or finding the wrong" + echo "*** version of ESD. If it is not finding ESD, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means ESD was incorrectly installed" + echo "*** or that you have moved ESD since it was installed. In the latter case, you" + echo "*** may want to edit the esd-config script: $ESD_CONFIG" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + ESD_CFLAGS="" + ESD_LIBS="" + have_esd=no + fi + + + rm -f conf.esdtest + + if test x$have_esd = xyes; then + # Check whether --enable-esd-shared was given. +if test "${enable_esd_shared+set}" = set; then : + enableval=$enable_esd_shared; +else + enable_esd_shared=yes +fi + + esd_lib=`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` + + +$as_echo "#define SDL_AUDIO_DRIVER_ESD 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_esd_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ESD loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_esd_shared = xyes && test x$esd_lib != x; then + echo "-- dynamic libesd -> $esd_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_AUDIO_DRIVER_ESD_DYNAMIC "$esd_lib" +_ACEOF + + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS" + fi + have_audio=yes + fi + fi +} + +CheckPulseAudio() +{ + # Check whether --enable-pulseaudio was given. +if test "${enable_pulseaudio+set}" = set; then : + enableval=$enable_pulseaudio; +else + enable_pulseaudio=yes +fi + + if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then + audio_pulseaudio=no + + PULSEAUDIO_REQUIRED_VERSION=0.9 + + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support" >&5 +$as_echo_n "checking for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support... " >&6; } + if test x$PKG_CONFIG != xno; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then + PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple` + PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple` + audio_pulseaudio=yes + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $audio_pulseaudio" >&5 +$as_echo "$audio_pulseaudio" >&6; } + + if test x$audio_pulseaudio = xyes; then + # Check whether --enable-pulseaudio-shared was given. +if test "${enable_pulseaudio_shared+set}" = set; then : + enableval=$enable_pulseaudio_shared; +else + enable_pulseaudio_shared=yes +fi + + pulseaudio_lib=`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` + + +$as_echo "#define SDL_AUDIO_DRIVER_PULSEAUDIO 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_pulseaudio_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic PulseAudio loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic PulseAudio loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then + echo "-- dynamic libpulse-simple -> $pulseaudio_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "$pulseaudio_lib" +_ACEOF + + + case "$host" in + # On Solaris, pulseaudio must be linked deferred explicitly + # to prevent undefined symbol failures. + *-*-solaris*) + PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'` + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred" + esac + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS" + fi + have_audio=yes + fi + fi +} + +CheckARTSC() +{ + # Check whether --enable-arts was given. +if test "${enable_arts+set}" = set; then : + enableval=$enable_arts; +else + enable_arts=yes +fi + + if test x$enable_audio = xyes -a x$enable_arts = xyes; then + # Extract the first word of "artsc-config", so it can be a program name with args. +set dummy artsc-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ARTSCONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ARTSCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ARTSCONFIG="$ARTSCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ARTSCONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ARTSCONFIG=$ac_cv_path_ARTSCONFIG +if test -n "$ARTSCONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARTSCONFIG" >&5 +$as_echo "$ARTSCONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then + : # arts isn't installed + else + ARTS_CFLAGS=`$ARTSCONFIG --cflags` + ARTS_LIBS=`$ARTSCONFIG --libs` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for aRts development environment" >&5 +$as_echo_n "checking for aRts development environment... " >&6; } + audio_arts=no + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $ARTS_CFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + arts_stream_t stream; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + audio_arts=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$save_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $audio_arts" >&5 +$as_echo "$audio_arts" >&6; } + if test x$audio_arts = xyes; then + # Check whether --enable-arts-shared was given. +if test "${enable_arts_shared+set}" = set; then : + enableval=$enable_arts_shared; +else + enable_arts_shared=yes +fi + + arts_lib=`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` + + +$as_echo "#define SDL_AUDIO_DRIVER_ARTS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS" + if test x$have_loadso != xyes && \ + test x$enable_arts_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic ARTS loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_arts_shared = xyes && test x$arts_lib != x; then + echo "-- dynamic libartsc -> $arts_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_AUDIO_DRIVER_ARTS_DYNAMIC "$arts_lib" +_ACEOF + + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS" + fi + have_audio=yes + fi + fi + fi +} + +CheckNAS() +{ + # Check whether --enable-nas was given. +if test "${enable_nas+set}" = set; then : + enableval=$enable_nas; +else + enable_nas=yes +fi + + if test x$enable_audio = xyes -a x$enable_nas = xyes; then + ac_fn_c_check_header_mongrel "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default" +if test "x$ac_cv_header_audio_audiolib_h" = xyes; then : + have_nas_hdr=yes +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AuOpenServer in -laudio" >&5 +$as_echo_n "checking for AuOpenServer in -laudio... " >&6; } +if ${ac_cv_lib_audio_AuOpenServer+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-laudio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char AuOpenServer (); +int +main () +{ +return AuOpenServer (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_audio_AuOpenServer=yes +else + ac_cv_lib_audio_AuOpenServer=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_audio_AuOpenServer" >&5 +$as_echo "$ac_cv_lib_audio_AuOpenServer" >&6; } +if test "x$ac_cv_lib_audio_AuOpenServer" = xyes; then : + have_nas_lib=yes +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NAS audio support" >&5 +$as_echo_n "checking for NAS audio support... " >&6; } + have_nas=no + + if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then + have_nas=yes + NAS_LIBS="-laudio" + + elif test -r /usr/X11R6/include/audio/audiolib.h; then + have_nas=yes + NAS_CFLAGS="-I/usr/X11R6/include/" + NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5 +$as_echo "$have_nas" >&6; } + + if test x$have_nas = xyes; then + # Check whether --enable-nas-shared was given. +if test "${enable_nas_shared+set}" = set; then : + enableval=$enable_nas_shared; +else + enable_nas_shared=yes +fi + + nas_lib=`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` + + if test x$have_loadso != xyes && \ + test x$enable_nas_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic NAS loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_nas_shared = xyes && test x$nas_lib != x; then + echo "-- dynamic libaudio -> $nas_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_AUDIO_DRIVER_NAS_DYNAMIC "$nas_lib" +_ACEOF + + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS" + fi + + +$as_echo "#define SDL_AUDIO_DRIVER_NAS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" + have_audio=yes + fi + fi +} + +CheckSNDIO() +{ + # Check whether --enable-sndio was given. +if test "${enable_sndio+set}" = set; then : + enableval=$enable_sndio; +else + enable_sndio=yes +fi + + if test x$enable_audio = xyes -a x$enable_sndio = xyes; then + ac_fn_c_check_header_mongrel "$LINENO" "sndio.h" "ac_cv_header_sndio_h" "$ac_includes_default" +if test "x$ac_cv_header_sndio_h" = xyes; then : + have_sndio_hdr=yes +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sio_open in -lsndio" >&5 +$as_echo_n "checking for sio_open in -lsndio... " >&6; } +if ${ac_cv_lib_sndio_sio_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsndio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sio_open (); +int +main () +{ +return sio_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_sndio_sio_open=yes +else + ac_cv_lib_sndio_sio_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndio_sio_open" >&5 +$as_echo "$ac_cv_lib_sndio_sio_open" >&6; } +if test "x$ac_cv_lib_sndio_sio_open" = xyes; then : + have_sndio_lib=yes +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sndio audio support" >&5 +$as_echo_n "checking for sndio audio support... " >&6; } + have_sndio=no + + if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then + have_sndio=yes + SNDIO_LIBS="-lsndio" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sndio" >&5 +$as_echo "$have_sndio" >&6; } + + if test x$have_sndio = xyes; then + # Check whether --enable-sndio-shared was given. +if test "${enable_sndio_shared+set}" = set; then : + enableval=$enable_sndio_shared; +else + enable_sndio_shared=yes +fi + + sndio_lib=`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` + + if test x$have_loadso != xyes && \ + test x$enable_sndio_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic sndio loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then + echo "-- dynamic libsndio -> $sndio_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "$sndio_lib" +_ACEOF + + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS" + fi + + +$as_echo "#define SDL_AUDIO_DRIVER_SNDIO 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS" + have_audio=yes + fi + fi +} + +CheckDiskAudio() +{ + # Check whether --enable-diskaudio was given. +if test "${enable_diskaudio+set}" = set; then : + enableval=$enable_diskaudio; +else + enable_diskaudio=yes +fi + + if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_DISK 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/disk/*.c" + fi +} + +CheckDummyAudio() +{ + # Check whether --enable-dummyaudio was given. +if test "${enable_dummyaudio+set}" = set; then : + enableval=$enable_dummyaudio; +else + enable_dummyaudio=yes +fi + + if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_DUMMY 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c" + fi +} + +CheckVisibilityHidden() +{ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -fvisibility=hidden option" >&5 +$as_echo_n "checking for GCC -fvisibility=hidden option... " >&6; } + have_gcc_fvisibility=no + + visibility_CFLAGS="-fvisibility=hidden" + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if !defined(__GNUC__) || __GNUC__ < 4 + #error SDL only uses visibility attributes in GCC 4 or newer + #endif + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_fvisibility=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_fvisibility" >&5 +$as_echo "$have_gcc_fvisibility" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_fvisibility = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS" + fi +} + +CheckStackBoundary() +{ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mpreferred-stack-boundary option" >&5 +$as_echo_n "checking for GCC -mpreferred-stack-boundary option... " >&6; } + have_gcc_preferred_stack_boundary=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int x = 0; + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_preferred_stack_boundary=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_preferred_stack_boundary" >&5 +$as_echo "$have_gcc_preferred_stack_boundary" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_preferred_stack_boundary = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2" + fi +} + + +CheckWarnAll() +{ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -Wall option" >&5 +$as_echo_n "checking for GCC -Wall option... " >&6; } + have_gcc_Wall=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -Wall" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int x = 0; + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_gcc_Wall=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_Wall" >&5 +$as_echo "$have_gcc_Wall" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_Wall = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for necessary GCC -Wno-multichar option" >&5 +$as_echo_n "checking for necessary GCC -Wno-multichar option... " >&6; } + need_gcc_Wno_multichar=no + case "$host" in + *-*-beos* | *-*-haiku*) + need_gcc_Wno_multichar=yes + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $need_gcc_Wno_multichar" >&5 +$as_echo "$need_gcc_Wno_multichar" >&6; } + if test x$need_gcc_Wno_multichar = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar" + fi + fi +} + + +CheckX11() +{ + + + # Check whether --enable-video-x11 was given. +if test "${enable_video_x11+set}" = set; then : + enableval=$enable_video_x11; +else + enable_video_x11=yes +fi + + if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then + case "$host" in + *-*-darwin*) + # This isn't necessary for X11, but fixes GLX detection + if test "x$x_includes" = xNONE && \ + test "x$x_libraries" = xNONE && \ + test -d /usr/X11R6/include && \ + test -d /usr/X11R6/lib; then + x_includes="/usr/X11R6/include" + x_libraries="/usr/X11R6/lib" + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R7/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R7 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R7/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R7 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # We can compile using X headers with no special include directory. +ac_x_includes= +else + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + + if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" +else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +$as_echo "neither works" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (); +int +main () +{ +return XOpenDisplay (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_dnet_ntoa=yes +else + ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } +if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = xyes; then : + +fi + + if test $ac_cv_func_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nsl_gethostbyname=yes +else + ac_cv_lib_nsl_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bsd_gethostbyname=yes +else + ac_cv_lib_bsd_gethostbyname=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = xyes; then : + +fi + + if test $ac_cv_func_connect = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if ${ac_cv_lib_socket_connect+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char connect (); +int +main () +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_connect=yes +else + ac_cv_lib_socket_connect=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = xyes; then : + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" +if test "x$ac_cv_func_remove" = xyes; then : + +fi + + if test $ac_cv_func_remove = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } +if ${ac_cv_lib_posix_remove+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char remove (); +int +main () +{ +return remove (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix_remove=yes +else + ac_cv_lib_posix_remove=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" +if test "x$ac_cv_func_shmat" = xyes; then : + +fi + + if test $ac_cv_func_shmat = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } +if ${ac_cv_lib_ipc_shmat+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (); +int +main () +{ +return shmat (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ipc_shmat=yes +else + ac_cv_lib_ipc_shmat=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = xyes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } +if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (); +int +main () +{ +return IceConnectionNumber (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ICE_IceConnectionNumber=yes +else + ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + + if test x$have_x = xyes; then + # Only allow dynamically loaded X11 if the X11 function pointers + # will not end up in the global namespace, which causes problems + # with other libraries calling X11 functions. + x11_symbols_private=$have_gcc_fvisibility + + # Check whether --enable-x11-shared was given. +if test "${enable_x11_shared+set}" = set; then : + enableval=$enable_x11_shared; +else + enable_x11_shared=maybe +fi + + + case "$host" in + *-*-darwin*) + x11_symbols_private=yes + x11_lib='/usr/X11R6/lib/libX11.6.dylib' + x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' + xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib' + xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib' + xinput_lib='/usr/X11R6/lib/libXi.6.dylib' + xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib' + xrender_lib='/usr/X11R6/lib/libXrender.1.dylib' + xss_lib='/usr/X11R6/lib/libXss.1.dylib' + xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib' + ;; + *-*-openbsd*) + x11_lib='libX11.so' + x11ext_lib='libXext.so' + xcursor_lib='libXcursor.so' + xinerama_lib='libXinerama.so' + xinput_lib='libXi.so' + xrandr_lib='libXrandr.so' + xrender_lib='libXrender.so' + xss_lib='libXss.so' + xvidmode_lib='libXxf86vm.so' + ;; + *) + x11_lib=`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + x11ext_lib=`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + xcursor_lib=`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + xinerama_lib=`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + xinput_lib=`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + xrandr_lib=`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + xrender_lib=`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + xss_lib=`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + xvidmode_lib=`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'` + ;; + esac + + if test x$ac_cv_func_shmat != xyes; then + X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY" + fi + CFLAGS="$CFLAGS $X_CFLAGS" + LDFLAGS="$LDFLAGS $X_LIBS" + + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xext.h" "ac_cv_header_X11_extensions_Xext_h" "#include + #include + +" +if test "x$ac_cv_header_X11_extensions_Xext_h" = xyes; then : + have_xext_h_hdr=yes +else + have_xext_h_hdr=no +fi + + + if test x$have_xext_h_hdr != xyes; then + as_fn_error $? " +*** Missing Xext.h, maybe you need to install the libxext-dev package? + " "$LINENO" 5 + fi + + +$as_echo "#define SDL_VIDEO_DRIVER_X11 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/video/x11/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS" + + # Needed so SDL applications can include SDL_syswm.h + SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS" + + if test x$enable_x11_shared = xmaybe; then + enable_x11_shared=$x11_symbols_private + fi + if test x$have_loadso != xyes && \ + test x$enable_x11_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic X11 loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic X11 loading" >&2;} + enable_x11_shared=no + fi + if test x$x11_symbols_private != xyes && \ + test x$enable_x11_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading" >&5 +$as_echo "$as_me: WARNING: You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading" >&2;} + enable_x11_shared=no + fi + + if test x$have_loadso = xyes && \ + test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then + echo "-- dynamic libX11 -> $x11_lib" + echo "-- dynamic libX11ext -> $x11ext_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "$x11_lib" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "$x11ext_lib" +_ACEOF + + else + enable_x11_shared=no + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext" + fi + have_video=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const parameter to XextAddDisplay" >&5 +$as_echo_n "checking for const parameter to XextAddDisplay... " >&6; } + have_const_param_XextAddDisplay=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f); + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_const_param_XextAddDisplay=yes + $as_echo "#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_XextAddDisplay" >&5 +$as_echo "$have_const_param_XextAddDisplay" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const parameter to _XData32" >&5 +$as_echo_n "checking for const parameter to _XData32... " >&6; } + have_const_param_xdata32=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len); + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_const_param_xdata32=yes + $as_echo "#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_const_param_xdata32" >&5 +$as_echo "$have_const_param_xdata32" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XGenericEvent" >&5 +$as_echo_n "checking for XGenericEvent... " >&6; } + have_XGenericEvent=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + +Display *display; +XEvent event; +XGenericEventCookie *cookie = &event.xcookie; +XNextEvent(display, &event); +XGetEventData(display, cookie); +XFreeEventData(display, cookie); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_XGenericEvent=yes + $as_echo "#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_XGenericEvent" >&5 +$as_echo "$have_XGenericEvent" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XkbKeycodeToKeysym in -lX11" >&5 +$as_echo_n "checking for XkbKeycodeToKeysym in -lX11... " >&6; } +if ${ac_cv_lib_X11_XkbKeycodeToKeysym+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XkbKeycodeToKeysym (); +int +main () +{ +return XkbKeycodeToKeysym (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_X11_XkbKeycodeToKeysym=yes +else + ac_cv_lib_X11_XkbKeycodeToKeysym=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5 +$as_echo "$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6; } +if test "x$ac_cv_lib_X11_XkbKeycodeToKeysym" = xyes; then : + +$as_echo "#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1" >>confdefs.h + +fi + + + # Check whether --enable-video-x11-xcursor was given. +if test "${enable_video_x11_xcursor+set}" = set; then : + enableval=$enable_video_x11_xcursor; +else + enable_video_x11_xcursor=yes +fi + + if test x$enable_video_x11_xcursor = xyes; then + definitely_enable_video_x11_xcursor=no + ac_fn_c_check_header_compile "$LINENO" "X11/Xcursor/Xcursor.h" "ac_cv_header_X11_Xcursor_Xcursor_h" "#include + +" +if test "x$ac_cv_header_X11_Xcursor_Xcursor_h" = xyes; then : + have_xcursor_h_hdr=yes +else + have_xcursor_h_hdr=no +fi + + + if test x$have_xcursor_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then + echo "-- dynamic libXcursor -> $xcursor_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR "$xcursor_lib" +_ACEOF + + definitely_enable_video_x11_xcursor=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XcursorImageCreate in -lXcursor" >&5 +$as_echo_n "checking for XcursorImageCreate in -lXcursor... " >&6; } +if ${ac_cv_lib_Xcursor_XcursorImageCreate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXcursor $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XcursorImageCreate (); +int +main () +{ +return XcursorImageCreate (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xcursor_XcursorImageCreate=yes +else + ac_cv_lib_Xcursor_XcursorImageCreate=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xcursor_XcursorImageCreate" >&5 +$as_echo "$ac_cv_lib_Xcursor_XcursorImageCreate" >&6; } +if test "x$ac_cv_lib_Xcursor_XcursorImageCreate" = xyes; then : + have_xcursor_lib=yes +fi + + if test x$have_xcursor_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor" + definitely_enable_video_x11_xcursor=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xcursor = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XCURSOR 1" >>confdefs.h + + fi + # Check whether --enable-video-x11-xinerama was given. +if test "${enable_video_x11_xinerama+set}" = set; then : + enableval=$enable_video_x11_xinerama; +else + enable_video_x11_xinerama=yes +fi + + if test x$enable_video_x11_xinerama = xyes; then + definitely_enable_video_x11_xinerama=no + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "#include + +" +if test "x$ac_cv_header_X11_extensions_Xinerama_h" = xyes; then : + have_xinerama_h_hdr=yes +else + have_xinerama_h_hdr=no +fi + + + if test x$have_xinerama_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then + echo "-- dynamic libXinerama -> $xinerama_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "$xinerama_lib" +_ACEOF + + definitely_enable_video_x11_xinerama=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaQueryExtension in -lXinerama" >&5 +$as_echo_n "checking for XineramaQueryExtension in -lXinerama... " >&6; } +if ${ac_cv_lib_Xinerama_XineramaQueryExtension+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXinerama $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XineramaQueryExtension (); +int +main () +{ +return XineramaQueryExtension (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xinerama_XineramaQueryExtension=yes +else + ac_cv_lib_Xinerama_XineramaQueryExtension=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5 +$as_echo "$ac_cv_lib_Xinerama_XineramaQueryExtension" >&6; } +if test "x$ac_cv_lib_Xinerama_XineramaQueryExtension" = xyes; then : + have_xinerama_lib=yes +fi + + if test x$have_xinerama_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama" + definitely_enable_video_x11_xinerama=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xinerama = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XINERAMA 1" >>confdefs.h + + fi + # Check whether --enable-video-x11-xinput was given. +if test "${enable_video_x11_xinput+set}" = set; then : + enableval=$enable_video_x11_xinput; +else + enable_video_x11_xinput=yes +fi + + if test x$enable_video_x11_xinput = xyes; then + definitely_enable_video_x11_xinput=no + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XInput2.h" "ac_cv_header_X11_extensions_XInput2_h" "#include + +" +if test "x$ac_cv_header_X11_extensions_XInput2_h" = xyes; then : + have_xinput_h_hdr=yes +else + have_xinput_h_hdr=no +fi + + + if test x$have_xinput_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then + echo "-- dynamic libXi -> $xinput_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "$xinput_lib" +_ACEOF + + definitely_enable_video_x11_xinput=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDevice in -lXi" >&5 +$as_echo_n "checking for XOpenDevice in -lXi... " >&6; } +if ${ac_cv_lib_Xi_XOpenDevice+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXi $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDevice (); +int +main () +{ +return XOpenDevice (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xi_XOpenDevice=yes +else + ac_cv_lib_Xi_XOpenDevice=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xi_XOpenDevice" >&5 +$as_echo "$ac_cv_lib_Xi_XOpenDevice" >&6; } +if test "x$ac_cv_lib_Xi_XOpenDevice" = xyes; then : + have_xinput_lib=yes +fi + + if test x$have_xinput_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi" + definitely_enable_video_x11_xinput=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xinput = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XINPUT2 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xinput2 multitouch" >&5 +$as_echo_n "checking for xinput2 multitouch... " >&6; } + have_xinput2_multitouch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + +int +main () +{ + +int event_type = XI_TouchBegin; +XITouchClassInfo *t; +Status +XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) +{ + return (Status)0; +} + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_xinput2_multitouch=yes + $as_echo "#define SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_xinput2_multitouch" >&5 +$as_echo "$have_xinput2_multitouch" >&6; } + fi + # Check whether --enable-video-x11-xrandr was given. +if test "${enable_video_x11_xrandr+set}" = set; then : + enableval=$enable_video_x11_xrandr; +else + enable_video_x11_xrandr=yes +fi + + if test x$enable_video_x11_xrandr = xyes; then + definitely_enable_video_x11_xrandr=no + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "#include + +" +if test "x$ac_cv_header_X11_extensions_Xrandr_h" = xyes; then : + have_xrandr_h_hdr=yes +else + have_xrandr_h_hdr=no +fi + + + if test x$have_xrandr_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then + echo "-- dynamic libXrandr -> $xrandr_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "$xrandr_lib" +_ACEOF + + definitely_enable_video_x11_xrandr=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRQueryExtension in -lXrandr" >&5 +$as_echo_n "checking for XRRQueryExtension in -lXrandr... " >&6; } +if ${ac_cv_lib_Xrandr_XRRQueryExtension+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXrandr $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XRRQueryExtension (); +int +main () +{ +return XRRQueryExtension (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xrandr_XRRQueryExtension=yes +else + ac_cv_lib_Xrandr_XRRQueryExtension=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5 +$as_echo "$ac_cv_lib_Xrandr_XRRQueryExtension" >&6; } +if test "x$ac_cv_lib_Xrandr_XRRQueryExtension" = xyes; then : + have_xrandr_lib=yes +fi + + if test x$have_xrandr_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr" + definitely_enable_video_x11_xrandr=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xrandr = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XRANDR 1" >>confdefs.h + + fi + # Check whether --enable-video-x11-scrnsaver was given. +if test "${enable_video_x11_scrnsaver+set}" = set; then : + enableval=$enable_video_x11_scrnsaver; +else + enable_video_x11_scrnsaver=yes +fi + + if test x$enable_video_x11_scrnsaver = xyes; then + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/scrnsaver.h" "ac_cv_header_X11_extensions_scrnsaver_h" "#include + +" +if test "x$ac_cv_header_X11_extensions_scrnsaver_h" = xyes; then : + have_scrnsaver_h_hdr=yes +else + have_scrnsaver_h_hdr=no +fi + + + if test x$have_scrnsaver_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then + echo "-- dynamic libXss -> $xss_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "$xss_lib" +_ACEOF + + definitely_enable_video_x11_scrnsaver=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverSuspend in -lXss" >&5 +$as_echo_n "checking for XScreenSaverSuspend in -lXss... " >&6; } +if ${ac_cv_lib_Xss_XScreenSaverSuspend+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXss $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XScreenSaverSuspend (); +int +main () +{ +return XScreenSaverSuspend (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xss_XScreenSaverSuspend=yes +else + ac_cv_lib_Xss_XScreenSaverSuspend=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xss_XScreenSaverSuspend" >&5 +$as_echo "$ac_cv_lib_Xss_XScreenSaverSuspend" >&6; } +if test "x$ac_cv_lib_Xss_XScreenSaverSuspend" = xyes; then : + have_xss_lib=yes +fi + + if test x$have_xss_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss" + definitely_enable_video_x11_scrnsaver=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_scrnsaver = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1" >>confdefs.h + + fi + # Check whether --enable-video-x11-xshape was given. +if test "${enable_video_x11_xshape+set}" = set; then : + enableval=$enable_video_x11_xshape; +else + enable_video_x11_xshape=yes +fi + + if test x$enable_video_x11_xshape = xyes; then + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/shape.h" "ac_cv_header_X11_extensions_shape_h" "#include + +" +if test "x$ac_cv_header_X11_extensions_shape_h" = xyes; then : + have_shape_h_hdr=yes +else + have_shape_h_hdr=no +fi + + + if test x$have_shape_h_hdr = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XSHAPE 1" >>confdefs.h + + fi + fi + # Check whether --enable-video-x11-vm was given. +if test "${enable_video_x11_vm+set}" = set; then : + enableval=$enable_video_x11_vm; +else + enable_video_x11_vm=yes +fi + + if test x$enable_video_x11_vm = xyes; then + definitely_enable_video_x11_vm=no + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/xf86vmode.h" "ac_cv_header_X11_extensions_xf86vmode_h" "#include + +" +if test "x$ac_cv_header_X11_extensions_xf86vmode_h" = xyes; then : + have_vm_h_hdr=yes +else + have_vm_h_hdr=no +fi + + + if test x$have_vm_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then + echo "-- dynamic libXxf86vm -> $xvidmode_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "$xvidmode_lib" +_ACEOF + + definitely_enable_video_x11_vm=yes + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XF86VidModeQueryVersion in -lXxf86vm" >&5 +$as_echo_n "checking for XF86VidModeQueryVersion in -lXxf86vm... " >&6; } +if ${ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXxf86vm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XF86VidModeQueryVersion (); +int +main () +{ +return XF86VidModeQueryVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=yes +else + ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&5 +$as_echo "$ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" >&6; } +if test "x$ac_cv_lib_Xxf86vm_XF86VidModeQueryVersion" = xyes; then : + have_vm_lib=yes +fi + + if test x$have_vm_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm" + definitely_enable_video_x11_vm=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_vm = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1" >>confdefs.h + + fi + fi + fi +} + +CheckBWINDOW() +{ + if test x$enable_video = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_BWINDOW 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc" + have_video=yes + fi +} + +CheckCOCOA() +{ + # Check whether --enable-video-cocoa was given. +if test "${enable_video_cocoa+set}" = set; then : + enableval=$enable_video_cocoa; +else + enable_video_cocoa=yes +fi + + if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -x objective-c" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cocoa framework" >&5 +$as_echo_n "checking for Cocoa framework... " >&6; } + have_cocoa=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #import + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_cocoa=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cocoa" >&5 +$as_echo "$have_cocoa" >&6; } + CFLAGS="$save_CFLAGS" + if test x$have_cocoa = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_COCOA 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m" + have_video=yes + fi + fi +} + +CheckDirectFB() +{ + # Check whether --enable-video-directfb was given. +if test "${enable_video_directfb+set}" = set; then : + enableval=$enable_video_directfb; +else + enable_video_directfb=no +fi + + if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then + video_directfb=no + + DIRECTFB_REQUIRED_VERSION=1.0.0 + for ac_prog in directfb-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DIRECTFBCONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DIRECTFBCONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_DIRECTFBCONFIG="$DIRECTFBCONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$prefix/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DIRECTFBCONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DIRECTFBCONFIG=$ac_cv_path_DIRECTFBCONFIG +if test -n "$DIRECTFBCONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRECTFBCONFIG" >&5 +$as_echo "$DIRECTFBCONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DIRECTFBCONFIG" && break +done +test -n "$DIRECTFBCONFIG" || DIRECTFBCONFIG="no" + + if test x$DIRECTFBCONFIG = xno; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$PKG_CONFIG != xno; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then + DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb` + DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb` + DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb` + video_directfb=yes + fi + fi + else + set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'` + NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3` + set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'` + HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3` + if test $HAVE_VERSION -ge $NEED_VERSION; then + DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags` + DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs` + DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix` + video_directfb=yes + fi + fi + if test x$video_directfb = xyes; then + # SuSE 11.1 installs directfb-config without directfb-devel + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS" + ac_fn_c_check_header_mongrel "$LINENO" "directfb.h" "ac_cv_header_directfb_h" "$ac_includes_default" +if test "x$ac_cv_header_directfb_h" = xyes; then : + have_directfb_hdr=yes +else + have_directfb_hdr=no +fi + + + CPPFLAGS="$save_CPPFLAGS" + video_directfb=$have_directfb_hdr + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DirectFB $DIRECTFB_REQUIRED_VERSION support" >&5 +$as_echo_n "checking for DirectFB $DIRECTFB_REQUIRED_VERSION support... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_directfb" >&5 +$as_echo "$video_directfb" >&6; } + + if test x$video_directfb = xyes; then + # Check whether --enable-directfb-shared was given. +if test "${enable_directfb_shared+set}" = set; then : + enableval=$enable_directfb_shared; +else + enable_directfb_shared=yes +fi + + + +$as_echo "#define SDL_VIDEO_DRIVER_DIRECTFB 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_DIRECTFB 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/video/directfb/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for directfb dynamic loading support" >&5 +$as_echo_n "checking for directfb dynamic loading support... " >&6; } + directfb_shared=no + directfb_lib=`find_lib "libdirectfb.so.*" "$DIRECTFB_LIBS"` + # | sed 's/.*\/\(.*\)/\1/; q'`] +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"directfb $directfb_lib\"" >&5 +$as_echo "$as_me: WARNING: \"directfb $directfb_lib\"" >&2;} + if test x$have_loadso != xyes && \ + test x$enable_directfb_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic directfb loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic directfb loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then + directfb_shared=yes + echo "-- $directfb_lib_spec -> $directfb_lib" + +cat >>confdefs.h <<_ACEOF +#define SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC "$directfb_lib" +_ACEOF + + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $directfb_shared" >&5 +$as_echo "$directfb_shared" >&6; } + have_video=yes + fi + fi +} + +CheckFusionSound() +{ + # Check whether --enable-fusionsound was given. +if test "${enable_fusionsound+set}" = set; then : + enableval=$enable_fusionsound; +else + enable_fusionsound=no +fi + + if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then + fusionsound=no + + FUSIONSOUND_REQUIRED_VERSION=1.1.1 + + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FusionSound $FUSIONSOUND_REQUIRED_VERSION support" >&5 +$as_echo_n "checking for FusionSound $FUSIONSOUND_REQUIRED_VERSION support... " >&6; } + if test x$PKG_CONFIG != xno; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then + FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound` + FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound` + fusionsound=yes + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fusionsound" >&5 +$as_echo "$fusionsound" >&6; } + + if test x$fusionsound = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_FUSIONSOUND 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS" + + # Check whether --enable-fusionsound-shared was given. +if test "${enable_fusionsound_shared+set}" = set; then : + enableval=$enable_fusionsound_shared; +else + enable_fusionsound_shared=yes +fi + + fusionsound_shared=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FusionSound dynamic loading support" >&5 +$as_echo_n "checking for FusionSound dynamic loading support... " >&6; } + if test x$have_loadso != xyes && \ + test x$enable_fusionsound_shared = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&5 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic fusionsound loading" >&2;} + fi + if test x$have_loadso = xyes && \ + test x$enable_fusionsound_shared = xyes; then + +cat >>confdefs.h <<_ACEOF +#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" +_ACEOF + + fusionsound_shared=yes + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $fusionsound_shared" >&5 +$as_echo "$fusionsound_shared" >&6; } + + have_audio=yes + fi + fi +} + +CheckDummyVideo() +{ + # Check whether --enable-video-dummy was given. +if test "${enable_video_dummy+set}" = set; then : + enableval=$enable_video_dummy; +else + enable_video_dummy=yes +fi + + if test x$enable_video_dummy = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_DUMMY 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/video/dummy/*.c" + have_video=yes + fi +} + +# Check whether --enable-video-opengl was given. +if test "${enable_video_opengl+set}" = set; then : + enableval=$enable_video_opengl; +else + enable_video_opengl=yes +fi + + +CheckOpenGLX11() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL (GLX) support" >&5 +$as_echo_n "checking for OpenGL (GLX) support... " >&6; } + video_opengl=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + video_opengl=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengl" >&5 +$as_echo "$video_opengl" >&6; } + if test x$video_opengl = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_OPENGL_GLX 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h + + fi + fi +} + +# Check whether --enable-video-opengles was given. +if test "${enable_video_opengles+set}" = set; then : + enableval=$enable_video_opengles; +else + enable_video_opengles=yes +fi + + +CheckOpenGLESX11() +{ + if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES (EGL) support" >&5 +$as_echo_n "checking for OpenGL ES (EGL) support... " >&6; } + video_opengles=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + video_opengles=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles" >&5 +$as_echo "$video_opengles" >&6; } + if test x$video_opengles = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v1 headers" >&5 +$as_echo_n "checking for OpenGL ES v1 headers... " >&6; } + video_opengles_v1=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + video_opengles_v1=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v1" >&5 +$as_echo "$video_opengles_v1" >&6; } + if test x$video_opengles_v1 = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL_ES 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_OGL_ES 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v2 headers" >&5 +$as_echo_n "checking for OpenGL ES v2 headers... " >&6; } + video_opengles_v2=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + video_opengles_v2=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v2" >&5 +$as_echo "$video_opengles_v2" >&6; } + if test x$video_opengles_v2 = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL_ES2 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_OGL_ES2 1" >>confdefs.h + + fi + fi + fi +} + +CheckWINDOWSGL() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_OPENGL_WGL 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h + + fi +} + +CheckBeGL() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_OPENGL_BGL 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h + + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL" + fi +} + +CheckMacGL() +{ + if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then + +$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_OPENGL_CGL 1" >>confdefs.h + + +$as_echo "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h + + case "$host" in + *-*-darwin*) + if test x$enable_video_cocoa = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL" + fi + esac + fi +} + +CheckInputEvents() +{ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux 2.4 unified input interface" >&5 +$as_echo_n "checking for Linux 2.4 unified input interface... " >&6; } + use_input_events=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + #ifndef EVIOCGNAME + #error EVIOCGNAME() ioctl not available + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + use_input_events=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_input_events" >&5 +$as_echo "$use_input_events" >&6; } + if test x$use_input_events = xyes; then + +$as_echo "#define SDL_INPUT_LINUXEV 1" >>confdefs.h + + fi +} + +CheckLibUDev() +{ + # Check whether --enable-libudev was given. +if test "${enable_libudev+set}" = set; then : + enableval=$enable_libudev; +else + enable_libudev=yes +fi + + if test x$enable_libudev = xyes; then + ac_fn_c_check_header_mongrel "$LINENO" "libudev.h" "ac_cv_header_libudev_h" "$ac_includes_default" +if test "x$ac_cv_header_libudev_h" = xyes; then : + have_libudev_h_hdr=yes +else + have_libudev_h_hdr=no +fi + + + if test x$have_libudev_h_hdr = xyes; then + +$as_echo "#define HAVE_LIBUDEV_H 1" >>confdefs.h + + fi + fi +} + +CheckDBus() +{ + # Check whether --enable-dbus was given. +if test "${enable_dbus+set}" = set; then : + enableval=$enable_dbus; +else + enable_dbus=yes +fi + + if test x$enable_dbus = xyes; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x$PKG_CONFIG != xno; then + DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1` + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS $DBUS_CFLAGS" + ac_fn_c_check_header_mongrel "$LINENO" "dbus/dbus.h" "ac_cv_header_dbus_dbus_h" "$ac_includes_default" +if test "x$ac_cv_header_dbus_dbus_h" = xyes; then : + have_dbus_dbus_h_hdr=yes +else + have_dbus_dbus_h_hdr=no +fi + + + CFLAGS="$save_CFLAGS" + if test x$have_dbus_dbus_h_hdr = xyes; then + +$as_echo "#define HAVE_DBUS_DBUS_H 1" >>confdefs.h + + EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS" + fi + fi + fi +} + +CheckTslib() +{ + # Check whether --enable-input-tslib was given. +if test "${enable_input_tslib+set}" = set; then : + enableval=$enable_input_tslib; +else + enable_input_tslib=yes +fi + + if test x$enable_input_tslib = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Touchscreen library support" >&5 +$as_echo_n "checking for Touchscreen library support... " >&6; } + enable_input_tslib=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include "tslib.h" + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + enable_input_tslib=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_input_tslib" >&5 +$as_echo "$enable_input_tslib" >&6; } + if test x$enable_input_tslib = xyes; then + +$as_echo "#define SDL_INPUT_TSLIB 1" >>confdefs.h + + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts" + fi + fi +} + +CheckPTHREAD() +{ + # Check whether --enable-pthreads was given. +if test "${enable_pthreads+set}" = set; then : + enableval=$enable_pthreads; +else + enable_pthreads=yes +fi + + # Check whether --enable-pthread-sem was given. +if test "${enable_pthread_sem+set}" = set; then : + enableval=$enable_pthread_sem; +else + enable_pthread_sem=yes +fi + + case "$host" in + *-*-linux*|*-*-uclinux*) + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread" + ;; + *-*-bsdi*) + pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + pthread_lib="" + ;; + *-*-darwin*) + pthread_cflags="-D_THREAD_SAFE" +# causes Carbon.p complaints? +# pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + ;; + *-*-freebsd*|*-*-dragonfly*) + pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + pthread_lib="-pthread" + ;; + *-*-netbsd*) + pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" + pthread_lib="-lpthread" + ;; + *-*-openbsd*) + pthread_cflags="-D_REENTRANT" + pthread_lib="-pthread" + ;; + *-*-solaris2.9) + # From Solaris 9+, posix4's preferred name is rt. + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread -lrt" + ;; + *-*-solaris2.10) + # Solaris 10+ merged pthread into libc. + pthread_cflags="-D_REENTRANT" + pthread_lib="-lrt" + ;; + *-*-solaris*) + # Solaris 11+ merged rt into libc. + pthread_cflags="-D_REENTRANT" + pthread_lib="" + ;; + *-*-sysv5*) + pthread_cflags="-D_REENTRANT -Kthread" + pthread_lib="" + ;; + *-*-aix*) + pthread_cflags="-D_REENTRANT -mthreads" + pthread_lib="-lpthread" + ;; + *-*-hpux11*) + pthread_cflags="-D_REENTRANT" + pthread_lib="-L/usr/lib -lpthread" + ;; + *) + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread" + ;; + esac + if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then + # Save the original compiler flags and libraries + ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" + # Add the pthread compiler flags and libraries + CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib" + # Check to see if we have pthread support on this system + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthreads" >&5 +$as_echo_n "checking for pthreads... " >&6; } + use_pthreads=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + pthread_attr_t type; + pthread_attr_init(&type); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + use_pthreads=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_pthreads" >&5 +$as_echo "$use_pthreads" >&6; } + # Restore the compiler flags and libraries + CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" + + # Do futher testing if we have pthread support... + if test x$use_pthreads = xyes; then + +$as_echo "#define SDL_THREAD_PTHREAD 1" >>confdefs.h + + EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib" + SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" + SDL_LIBS="$SDL_LIBS $pthread_lib" + + # Save the original compiler flags and libraries + ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" + # Add the pthread compiler flags and libraries + CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib" + + # Check to see if recursive mutexes are available + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recursive mutexes" >&5 +$as_echo_n "checking for recursive mutexes... " >&6; } + has_recursive_mutexes=no + if test x$has_recursive_mutexes = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + pthread_mutexattr_t attr; + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + has_recursive_mutexes=yes + +$as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test x$has_recursive_mutexes = xno; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + pthread_mutexattr_t attr; + pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + has_recursive_mutexes=yes + +$as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_recursive_mutexes" >&5 +$as_echo "$has_recursive_mutexes" >&6; } + + # Check to see if pthread semaphore support is missing + if test x$enable_pthread_sem = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread semaphores" >&5 +$as_echo_n "checking for pthread semaphores... " >&6; } + have_pthread_sem=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_pthread_sem=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_pthread_sem" >&5 +$as_echo "$have_pthread_sem" >&6; } + fi + if test x$have_pthread_sem = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_timedwait" >&5 +$as_echo_n "checking for sem_timedwait... " >&6; } + have_sem_timedwait=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + sem_timedwait(NULL, NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + have_sem_timedwait=yes + $as_echo "#define HAVE_SEM_TIMEDWAIT 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sem_timedwait" >&5 +$as_echo "$have_sem_timedwait" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_spin_trylock" >&5 +$as_echo_n "checking for pthread_spin_trylock... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_spin_trylock (); +int +main () +{ +return pthread_spin_trylock (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + has_pthread_spin_trylock=yes + +$as_echo "#define HAVE_PTHREAD_SPINLOCK 1" >>confdefs.h + + +else + + has_pthread_spin_trylock=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_pthread_spin_trylock" >&5 +$as_echo "$has_pthread_spin_trylock" >&6; } + + ac_fn_c_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" " #include +" +if test "x$ac_cv_header_pthread_np_h" = xyes; then : + have_pthread_np_h=yes +else + have_pthread_np_h=no +fi + + + if test x$have_pthread_np_h = xyes; then + +$as_echo "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h + + fi + + # Check to see if pthread naming is available + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np" >&5 +$as_echo_n "checking for pthread_setname_np... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_setname_np (); +int +main () +{ +return pthread_setname_np (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + has_pthread_setname_np=yes + +$as_echo "#define HAVE_PTHREAD_SETNAME_NP 1" >>confdefs.h + + +else + + has_pthread_setname_np=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_pthread_setname_np" >&5 +$as_echo "$has_pthread_setname_np" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_set_name_np" >&5 +$as_echo_n "checking for pthread_set_name_np... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_set_name_np (); +int +main () +{ +return pthread_set_name_np (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + has_pthread_set_name_np=yes + +$as_echo "#define HAVE_PTHREAD_SET_NAME_NP 1" >>confdefs.h + + +else + + has_pthread_set_name_np=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_pthread_set_name_np" >&5 +$as_echo "$has_pthread_set_name_np" >&6; } + + # Restore the compiler flags and libraries + CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" + + # Basic thread creation functions + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c" + + # Semaphores + # We can fake these with mutexes and condition variables if necessary + if test x$have_pthread_sem = xyes; then + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c" + else + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c" + fi + + # Mutexes + # We can fake these with semaphores if necessary + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c" + + # Condition variables + # We can fake these with semaphores and mutexes if necessary + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c" + + # Thread local storage + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c" + + have_threads=yes + fi + fi +} + +CheckWINDOWS() +{ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Windows compiler" >&5 +$as_echo_n "checking Windows compiler... " >&6; } + have_win32_gcc=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_win32_gcc=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_win32_gcc" >&5 +$as_echo "$have_win32_gcc" >&6; } + if test x$have_win32_gcc != xyes; then + as_fn_error $? " +*** Your compiler ($CC) does not produce Windows executables! + " "$LINENO" 5 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Windows CE" >&5 +$as_echo_n "checking Windows CE... " >&6; } + have_wince=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__) +#error This is not Windows CE +#endif + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_wince=yes + as_fn_error $? " +*** Sorry, Windows CE is no longer supported. + " "$LINENO" 5 + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_wince" >&5 +$as_echo "$have_wince" >&6; } + + # This fixes Windows stack alignment with newer GCC + CheckStackBoundary +} + +CheckDIRECTX() +{ + # Check whether --enable-directx was given. +if test "${enable_directx+set}" = set; then : + enableval=$enable_directx; +else + enable_directx=yes +fi + + if test x$enable_directx = xyes; then + ac_fn_c_check_header_mongrel "$LINENO" "d3d9.h" "ac_cv_header_d3d9_h" "$ac_includes_default" +if test "x$ac_cv_header_d3d9_h" = xyes; then : + have_d3d=yes +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "ddraw.h" "ac_cv_header_ddraw_h" "$ac_includes_default" +if test "x$ac_cv_header_ddraw_h" = xyes; then : + have_ddraw=yes +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "dsound.h" "ac_cv_header_dsound_h" "$ac_includes_default" +if test "x$ac_cv_header_dsound_h" = xyes; then : + have_dsound=yes +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "dinput.h" "ac_cv_header_dinput_h" "$ac_includes_default" +if test "x$ac_cv_header_dinput_h" = xyes; then : + have_dinput=yes +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "xaudio2.h" "ac_cv_header_xaudio2_h" "$ac_includes_default" +if test "x$ac_cv_header_xaudio2_h" = xyes; then : + have_xaudio2=yes +fi + + + + # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers. + # FIXME: ...so force it off for now. + case "$host" in + *-*-cygwin*) + have_dinput=false + ;; + esac + fi +} + +CheckDLOPEN() +{ + # Check whether --enable-sdl-dlopen was given. +if test "${enable_sdl_dlopen+set}" = set; then : + enableval=$enable_sdl_dlopen; +else + enable_sdl_dlopen=yes +fi + + if test x$enable_sdl_dlopen = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } + have_dlopen=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + void *handle = dlopen("", RTLD_NOW); + const char *loaderror = (char *) dlerror(); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_dlopen=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dlopen" >&5 +$as_echo "$have_dlopen" >&6; } + + if test x$have_dlopen = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lc" >&5 +$as_echo_n "checking for dlopen in -lc... " >&6; } +if ${ac_cv_lib_c_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_dlopen=yes +else + ac_cv_lib_c_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_dlopen" >&5 +$as_echo "$ac_cv_lib_c_dlopen" >&6; } +if test "x$ac_cv_lib_c_dlopen" = xyes; then : + EXTRA_LDFLAGS="$EXTRA_LDFLAGS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lltdl" >&5 +$as_echo_n "checking for dlopen in -lltdl... " >&6; } +if ${ac_cv_lib_ltdl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lltdl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ltdl_dlopen=yes +else + ac_cv_lib_ltdl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_dlopen" >&5 +$as_echo "$ac_cv_lib_ltdl_dlopen" >&6; } +if test "x$ac_cv_lib_ltdl_dlopen" = xyes; then : + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl" +fi + +fi + +fi + + +$as_echo "#define SDL_LOADSO_DLOPEN 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c" + have_loadso=yes + fi + fi +} + +CheckUSBHID() +{ + if test x$enable_joystick = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusbhid" >&5 +$as_echo_n "checking for hid_init in -lusbhid... " >&6; } +if ${ac_cv_lib_usbhid_hid_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusbhid $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char hid_init (); +int +main () +{ +return hid_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usbhid_hid_init=yes +else + ac_cv_lib_usbhid_hid_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usbhid_hid_init" >&5 +$as_echo "$ac_cv_lib_usbhid_hid_init" >&6; } +if test "x$ac_cv_lib_usbhid_hid_init" = xyes; then : + have_libusbhid=yes +fi + + if test x$have_libusbhid = xyes; then + ac_fn_c_check_header_mongrel "$LINENO" "usbhid.h" "ac_cv_header_usbhid_h" "$ac_includes_default" +if test "x$ac_cv_header_usbhid_h" = xyes; then : + USB_CFLAGS="-DHAVE_USBHID_H" +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "libusbhid.h" "ac_cv_header_libusbhid_h" "$ac_includes_default" +if test "x$ac_cv_header_libusbhid_h" = xyes; then : + USB_CFLAGS="-DHAVE_LIBUSBHID_H" +fi + + + USB_LIBS="$USB_LIBS -lusbhid" + else + ac_fn_c_check_header_mongrel "$LINENO" "usb.h" "ac_cv_header_usb_h" "$ac_includes_default" +if test "x$ac_cv_header_usb_h" = xyes; then : + USB_CFLAGS="-DHAVE_USB_H" +fi + + + ac_fn_c_check_header_mongrel "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default" +if test "x$ac_cv_header_libusb_h" = xyes; then : + USB_CFLAGS="-DHAVE_LIBUSB_H" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hid_init in -lusb" >&5 +$as_echo_n "checking for hid_init in -lusb... " >&6; } +if ${ac_cv_lib_usb_hid_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char hid_init (); +int +main () +{ +return hid_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_usb_hid_init=yes +else + ac_cv_lib_usb_hid_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_hid_init" >&5 +$as_echo "$ac_cv_lib_usb_hid_init" >&6; } +if test "x$ac_cv_lib_usb_hid_init" = xyes; then : + USB_LIBS="$USB_LIBS -lusb" +fi + + fi + + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $USB_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usbhid" >&5 +$as_echo_n "checking for usbhid... " >&6; } + have_usbhid=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + # include + # include + #else + # include + # include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + +int +main () +{ + + struct report_desc *repdesc; + struct usb_ctl_report *repbuf; + hid_kind_t hidkind; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_usbhid=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid" >&5 +$as_echo "$have_usbhid" >&6; } + + if test x$have_usbhid = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ucr_data member of usb_ctl_report" >&5 +$as_echo_n "checking for ucr_data member of usb_ctl_report... " >&6; } + have_usbhid_ucr_data=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + # include + # include + #else + # include + # include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + +int +main () +{ + + struct usb_ctl_report buf; + if (buf.ucr_data) { } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_usbhid_ucr_data=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x$have_usbhid_ucr_data = xyes; then + USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_ucr_data" >&5 +$as_echo "$have_usbhid_ucr_data" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new usbhid API" >&5 +$as_echo_n "checking for new usbhid API... " >&6; } + have_usbhid_new=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #if defined(HAVE_USB_H) + #include + #endif + #ifdef __DragonFly__ + #include + #include + #else + #include + #include + #endif + #if defined(HAVE_USBHID_H) + #include + #elif defined(HAVE_LIBUSB_H) + #include + #elif defined(HAVE_LIBUSBHID_H) + #include + #endif + +int +main () +{ + + report_desc_t d; + hid_start_parse(d, 1, 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_usbhid_new=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x$have_usbhid_new = xyes; then + USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_usbhid_new" >&5 +$as_echo "$have_usbhid_new" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct joystick in machine/joystick.h" >&5 +$as_echo_n "checking for struct joystick in machine/joystick.h... " >&6; } + have_machine_joystick=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + struct joystick t; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + have_machine_joystick=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x$have_machine_joystick = xyes; then + +$as_echo "#define SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_machine_joystick" >&5 +$as_echo "$have_machine_joystick" >&6; } + + +$as_echo "#define SDL_JOYSTICK_USBHID 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS" + have_joystick=yes + fi + CFLAGS="$save_CFLAGS" + fi +} + +CheckClockGettime() +{ + # Check whether --enable-clock_gettime was given. +if test "${enable_clock_gettime+set}" = set; then : + enableval=$enable_clock_gettime; +else + enable_clock_gettime=yes +fi + + if test x$enable_clock_gettime = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : + have_clock_gettime=yes +fi + + if test x$have_clock_gettime = xyes; then + +$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lc" >&5 +$as_echo_n "checking for clock_gettime in -lc... " >&6; } +if ${ac_cv_lib_c_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_clock_gettime=yes +else + ac_cv_lib_c_clock_gettime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_clock_gettime" >&5 +$as_echo "$ac_cv_lib_c_clock_gettime" >&6; } +if test "x$ac_cv_lib_c_clock_gettime" = xyes; then : + have_clock_gettime=yes +fi + + if test x$have_clock_gettime = xyes; then + +$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + + EXTRA_LDFLAGS="$EXTRA_LDFLAGS" + fi + fi + fi +} + +CheckLinuxVersion() +{ + ac_fn_c_check_header_mongrel "$LINENO" "linux/version.h" "ac_cv_header_linux_version_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_version_h" = xyes; then : + have_linux_version_h=yes +fi + + + if test x$have_linux_version_h = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H" + fi +} + +CheckRPATH() +{ + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; +else + enable_rpath=yes +fi + +} + +case "$host" in + *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*) + case "$host" in + *-*-linux*) ARCH=linux ;; + *-*-uclinux*) ARCH=linux ;; + *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;; + *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;; + *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;; + *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants + *-*-bsdi*) ARCH=bsdi ;; + *-*-freebsd*) ARCH=freebsd ;; + *-*-dragonfly*) ARCH=freebsd ;; + *-*-netbsd*) ARCH=netbsd ;; + *-*-openbsd*) ARCH=openbsd ;; + *-*-sysv5*) ARCH=sysv5 ;; + *-*-solaris*) ARCH=solaris ;; + *-*-hpux*) ARCH=hpux ;; + *-*-aix*) ARCH=aix ;; + *-*-minix*) ARCH=minix ;; + esac + CheckVisibilityHidden + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckDLOPEN + CheckOSS + CheckALSA + CheckPulseAudio + CheckARTSC + CheckESD + CheckNAS + CheckSNDIO + CheckX11 + CheckDirectFB + CheckFusionSound + CheckOpenGLX11 + CheckOpenGLESX11 + CheckLibUDev + CheckDBus + CheckInputEvents + CheckTslib + CheckUSBHID + CheckPTHREAD + CheckClockGettime + CheckLinuxVersion + CheckRPATH + # Set up files for the audio library + if test x$enable_audio = xyes; then + case $ARCH in + sysv5|solaris|hpux) + +$as_echo "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" + have_audio=yes + ;; + netbsd) # Don't use this on OpenBSD, it's busted. + +$as_echo "#define SDL_AUDIO_DRIVER_BSD 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c" + have_audio=yes + ;; + aix) + +$as_echo "#define SDL_AUDIO_DRIVER_PAUDIO 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" + have_audio=yes + ;; + esac + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + case $ARCH in + linux) + +$as_echo "#define SDL_JOYSTICK_LINUX 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" + have_joystick=yes + ;; + esac + fi + # Set up files for the haptic library + if test x$enable_haptic = xyes; then + if test x$use_input_events = xyes; then + case $ARCH in + linux) + +$as_echo "#define SDL_HAPTIC_LINUX 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c" + have_haptic=yes + ;; + esac + fi + fi + # Set up files for the power library + if test x$enable_power = xyes; then + case $ARCH in + linux) + +$as_echo "#define SDL_POWER_LINUX 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/power/linux/*.c" + have_power=yes + ;; + esac + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + +$as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + ;; + *-*-cygwin* | *-*-mingw32*) + ARCH=win32 + if test "$build" != "$host"; then # cross-compiling + # Default cross-compile location + ac_default_prefix=/usr/local/cross-tools/$host + else + # Look for the location of the tools and install there + if test "$BUILD_PREFIX" != ""; then + ac_default_prefix=$BUILD_PREFIX + fi + fi + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckWINDOWS + CheckWINDOWSGL + CheckDIRECTX + + # Set up the core platform files + SOURCES="$SOURCES $srcdir/src/core/windows/*.c" + + # Set up files for the video library + if test x$enable_video = xyes; then + +$as_echo "#define SDL_VIDEO_DRIVER_WINDOWS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/video/windows/*.c" + have_video=yes + # Check whether --enable-render-d3d was given. +if test "${enable_render_d3d+set}" = set; then : + enableval=$enable_render_d3d; +else + enable_render_d3d=yes +fi + + if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then + +$as_echo "#define SDL_VIDEO_RENDER_D3D 1" >>confdefs.h + + fi + fi + # Set up files for the audio library + if test x$enable_audio = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_WINMM 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c" + if test x$have_dsound = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_DSOUND 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c" + fi + if test x$have_xaudio2 = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_XAUDIO2 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c" + fi + have_audio=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + if test x$have_dinput = xyes; then + +$as_echo "#define SDL_JOYSTICK_DINPUT 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_dxjoystick.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8" + else + +$as_echo "#define SDL_JOYSTICK_WINMM 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_mmjoystick.c" + fi + have_joystick=yes + fi + if test x$enable_haptic = xyes; then + if test x$have_dinput = xyes; then + +$as_echo "#define SDL_HAPTIC_DINPUT 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/haptic/windows/SDL_syshaptic.c" + have_haptic=yes + fi + fi + if test x$enable_power = xyes; then + +$as_echo "#define SDL_POWER_WINDOWS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c" + have_power=yes + fi + # Set up files for the thread library + if test x$enable_threads = xyes; then + +$as_echo "#define SDL_THREAD_WINDOWS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/thread/windows/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + +$as_echo "#define SDL_TIMER_WINDOWS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/timer/windows/*.c" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then + +$as_echo "#define SDL_LOADSO_WINDOWS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c" + have_loadso=yes + fi + # Set up the system libraries we need + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -XCClinker -static-libgcc" + # The Windows platform requires special setup + VERSION_SOURCES="$srcdir/src/main/windows/*.rc" + SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c" + SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" + SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows" + + # Check to see if this is a mingw or cygwin build + have_mingw32= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmingw32" >&5 +$as_echo_n "checking for main in -lmingw32... " >&6; } +if ${ac_cv_lib_mingw32_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmingw32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mingw32_main=yes +else + ac_cv_lib_mingw32_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mingw32_main" >&5 +$as_echo "$ac_cv_lib_mingw32_main" >&6; } +if test "x$ac_cv_lib_mingw32_main" = xyes; then : + have_mingw32=yes +fi + + if test x$have_mingw32 = xyes; then + SDL_LIBS="-lmingw32 $SDL_LIBS" + else + SDL_LIBS="-lcygwin $SDL_LIBS" + fi + ;; + *-*-beos* | *-*-haiku*) + ARCH=beos + ac_default_prefix=/boot/common + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckBWINDOW + CheckBeGL + # Set up files for the audio library + if test x$enable_audio = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_BEOSAUDIO 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc" + have_audio=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + +$as_echo "#define SDL_JOYSTICK_BEOS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc" + have_joystick=yes + fi + # Set up files for the thread library + if test x$enable_threads = xyes; then + +$as_echo "#define SDL_THREAD_BEOS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/thread/beos/*.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" + SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" + have_threads=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + +$as_echo "#define SDL_TIMER_BEOS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/timer/beos/*.c" + have_timers=yes + fi + # Set up files for the shared object loading library + if test x$enable_loadso = xyes; then + +$as_echo "#define SDL_LOADSO_BEOS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c" + have_loadso=yes + fi + # Set up files for the system power library + if test x$enable_power = xyes; then + +$as_echo "#define SDL_POWER_BEOS 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/power/beos/*.c" + have_power=yes + fi + # The BeOS platform requires special setup. + SOURCES="$srcdir/src/main/beos/*.cc $SOURCES" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding" + ;; + arm*-apple-darwin*) + # iOS - We are not writing anything to confdefs.h because you have to replace + # SDL_config.h for SDL_config_iphoneos.h anyway + ARCH=ios + + CheckVisibilityHidden + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckDLOPEN + CheckCOCOA + CheckPTHREAD + + + # Set up files for the audio library + if test x$enable_audio = xyes; then + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" + have_audio=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m" + have_joystick=yes + fi + # Set up files for the haptic library + #if test x$enable_haptic = xyes; then + # SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" + # have_haptic=yes + # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + #fi + # Set up files for the power library + if test x$enable_power = xyes; then + SOURCES="$SOURCES $srcdir/src/power/uikit/*.m" + have_power=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + # Set up additional files for the file library + if test x$enable_file = xyes; then + SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m" + fi + # The iOS platform requires special setup. + SOURCES="$SOURCES $srcdir/src/video/uikit/*.m" + EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics" + ;; + *-*-darwin* ) + # This could be either full "Mac OS X", or plain "Darwin" which is + # just the OS X kernel sans upper layers like Carbon and Cocoa. + # Next line is broken, and a few files below require Mac OS X (full) + ARCH=macosx + + # Mac OS X builds with both the Carbon and OSX APIs at the moment + EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON" + EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX" + + CheckVisibilityHidden + CheckDummyVideo + CheckDiskAudio + CheckDummyAudio + CheckDLOPEN + CheckCOCOA + CheckX11 + CheckMacGL + CheckOpenGLX11 + CheckPTHREAD + + # Good optimization on Mac OS X, yes... + EXTRA_CFLAGS="$EXTRA_CFLAGS -falign-loops=16" + + # Need this or things might misbuild on a G3. + EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL" + + # Set up files for the audio library + if test x$enable_audio = xyes; then + +$as_echo "#define SDL_AUDIO_DRIVER_COREAUDIO 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" + have_audio=yes + fi + # Set up files for the joystick library + if test x$enable_joystick = xyes; then + +$as_echo "#define SDL_JOYSTICK_IOKIT 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c" + have_joystick=yes + fi + # Set up files for the haptic library + if test x$enable_haptic = xyes; then + +$as_echo "#define SDL_HAPTIC_IOKIT 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" + have_haptic=yes + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + fi + # Set up files for the power library + if test x$enable_power = xyes; then + +$as_echo "#define SDL_POWER_MACOSX 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/power/macosx/*.c" + have_power=yes + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + +$as_echo "#define SDL_TIMER_UNIX 1" >>confdefs.h + + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" + have_timers=yes + fi + # Set up additional files for the file library + if test x$enable_file = xyes; then + SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m" + fi + # The Mac OS X platform requires special setup. + EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" + # If audio is used, add the AudioUnit framework + if test x$enable_audio = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" + fi + ;; + *) + as_fn_error $? " +*** Unsupported host: Please add to configure.in + " "$LINENO" 5 + ;; +esac + +CheckWarnAll + +# Verify that we have all the platform specific files we need + +if test x$have_joystick != xyes; then + if test x$enable_joystick = xyes; then + +$as_echo "#define SDL_JOYSTICK_DISABLED 1" >>confdefs.h + + fi + SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c" +fi +if test x$have_haptic != xyes; then + if test x$enable_haptic = xyes; then + +$as_echo "#define SDL_HAPTIC_DISABLED 1" >>confdefs.h + + fi + SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c" +fi +if test x$have_threads != xyes; then + if test x$enable_threads = xyes; then + +$as_echo "#define SDL_THREADS_DISABLED 1" >>confdefs.h + + fi + SOURCES="$SOURCES $srcdir/src/thread/generic/*.c" +fi +if test x$have_timers != xyes; then + if test x$enable_timers = xyes; then + +$as_echo "#define SDL_TIMERS_DISABLED 1" >>confdefs.h + + fi + SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c" +fi +if test x$have_loadso != xyes; then + if test x$enable_loadso = xyes; then + +$as_echo "#define SDL_LOADSO_DISABLED 1" >>confdefs.h + + fi + SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c" +fi +if test x$SDLMAIN_SOURCES = x; then + SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c" +fi +SDLTEST_SOURCES="$srcdir/src/test/*.c" + +OBJECTS=`echo $SOURCES` +DEPENDS=`echo $SOURCES | tr ' ' '\n'` +for EXT in asm cc m c S; do + OBJECTS=`echo "$OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.'$EXT',$(objects)/\1.lo,g'` + DEPENDS=`echo "$DEPENDS" | sed "s,^\\([^ ]*\\)/\\([^ ]*\\)\\.$EXT\\$,\\\\ +\\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` +done + +VERSION_OBJECTS=`echo $VERSION_SOURCES` +VERSION_DEPENDS=`echo $VERSION_SOURCES` +VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.rc,$(objects)/\1.o,g'` +VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.rc,\\\\ +\\$(objects)/\\2.o: \\1/\\2.rc\\\\ + \\$(WINDRES) \\$< \\$@,g"` + +SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES` +SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES` +SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.o,g'` +SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\\\ +\\$(objects)/\\2.o: \\1/\\2.c\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` + +SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES` +SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES` +SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[^ ]*/\([^ ]*\)\.c,$(objects)/\1.o,g'` +SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([^ ]*\\)/\\([^ ]*\\)\\.c,\\\\ +\\$(objects)/\\2.o: \\1/\\2.c\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` + +# Set runtime shared library paths as needed + +if test "x$enable_rpath" = "xyes"; then + if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then + SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}" + fi + if test $ARCH = solaris; then + SDL_RLD_FLAGS="-R\${libdir}" + fi +else + SDL_RLD_FLAGS="" +fi + +SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS" + + + + + +if test x$enable_shared = xyes; then + ENABLE_SHARED_TRUE= + ENABLE_SHARED_FALSE="#" +else + ENABLE_SHARED_TRUE="#" + ENABLE_SHARED_FALSE= +fi +if test x$enable_static = xyes; then + ENABLE_STATIC_TRUE= + ENABLE_STATIC_FALSE="#" +else + ENABLE_STATIC_TRUE="#" + ENABLE_STATIC_FALSE= +fi + + + + + + + + + + + + + + + + + +cat >Makefile.rules <<__EOF__ + +# Build rules for objects +-include \$(OBJECTS:.lo=.d) + +# Special dependency for SDL.c, since it depends on SDL_revision.h +$srcdir/src/SDL.c: update-revision +$DEPENDS +$VERSION_DEPENDS +$SDLMAIN_DEPENDS +$SDLTEST_DEPENDS +__EOF__ + +ac_config_files="$ac_config_files Makefile:Makefile.in:Makefile.rules sdl2-config SDL2.spec sdl2.pc" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in AS \ +DLLTOOL \ +OBJDUMP \ +SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "include/SDL_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/SDL_config.h" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:Makefile.in:Makefile.rules" ;; + "sdl2-config") CONFIG_FILES="$CONFIG_FILES sdl2-config" ;; + "SDL2.spec") CONFIG_FILES="$CONFIG_FILES SDL2.spec" ;; + "sdl2.pc") CONFIG_FILES="$CONFIG_FILES sdl2.pc" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="CXX " + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Assembler program. +AS=$lt_AS + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Object dumper program. +OBJDUMP=$lt_OBJDUMP + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + +chmod a+x sdl2-config diff --git a/configure.in b/configure.in index 08c8e1e97c..252efe4be1 100644 --- a/configure.in +++ b/configure.in @@ -1,13 +1,16 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(README) +AC_INIT(README.txt) AC_CONFIG_HEADER(include/SDL_config.h) -AC_GNU_SOURCE -AC_CONFIG_AUX_DIRS($srcdir/build-scripts) +AC_CONFIG_AUX_DIR(build-scripts) +AC_CONFIG_MACRO_DIR([acinclude]) + +dnl Save the CFLAGS to see whether they were passed in or generated +orig_CFLAGS="$CFLAGS" dnl Set various version strings - taken gratefully from the GTk sources # # Making releases: -# Edit include/SDL/SDL_version.h and change the version, then: +# Edit include/SDL_version.h and change the version, then: # SDL_MICRO_VERSION += 1; # SDL_INTERFACE_AGE += 1; # SDL_BINARY_AGE += 1; @@ -15,11 +18,11 @@ dnl Set various version strings - taken gratefully from the GTk sources # if backwards compatibility has been broken, # set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0. # -SDL_MAJOR_VERSION=1 -SDL_MINOR_VERSION=2 -SDL_MICRO_VERSION=15 -SDL_INTERFACE_AGE=4 -SDL_BINARY_AGE=15 +SDL_MAJOR_VERSION=2 +SDL_MINOR_VERSION=0 +SDL_MICRO_VERSION=0 +SDL_INTERFACE_AGE=0 +SDL_BINARY_AGE=0 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION AC_SUBST(SDL_MAJOR_VERSION) @@ -44,14 +47,7 @@ AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) dnl Detect the canonical build and host environments -AC_CONFIG_AUX_DIR([build-scripts]) dnl AC_CANONICAL_HOST -AC_C_BIGENDIAN -if test x$ac_cv_c_bigendian = xyes; then - AC_DEFINE(SDL_BYTEORDER, 4321) -else - AC_DEFINE(SDL_BYTEORDER, 1234) -fi dnl Check for tools AC_PROG_LIBTOOL @@ -61,28 +57,59 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AC_CHECK_TOOL(WINDRES, [windres], [:]) +dnl Make sure that srcdir is a full pathname +case "$host" in + *-*-mingw32*) + # Except on msys, where make can't handle full pathnames (bug 1972) + ;; + *) + srcdir=`cd $srcdir && pwd` + ;; +esac + dnl Set up the compiler and linker flags INCLUDE="-I$srcdir/include" if test x$srcdir != x.; then - # Remove SDL_config.h from the source directory, since it's the - # default one, and we want to include the one that we generate. - if test -f $srcdir/include/SDL_config.h; then - rm $srcdir/include/SDL_config.h - fi INCLUDE="-Iinclude $INCLUDE" +elif test -d .hg; then + AC_MSG_ERROR([ +*** When building from Mercurial you should configure and build in a + separate directory so you don't clobber SDL_config.h, SDL_revision.h +]) fi +BASE_CFLAGS="" +BASE_LDFLAGS="" case "$host" in *-*-cygwin*) # We build SDL on cygwin without the UNIX emulation layer - BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin" - BASE_LDFLAGS="-mno-cygwin" - ;; - *) - BASE_CFLAGS="-D_GNU_SOURCE=1" - BASE_LDFLAGS="" + save_CFLAGS="$CFLAGS" + have_no_cygwin=no + AC_MSG_CHECKING(for GCC -mno-cygwin option) + CFLAGS="$save_CFLAGS -mno-cygwin" + + AC_TRY_COMPILE([ + ],[ + ],[ + have_no_cygwin=yes + ]) + AC_MSG_RESULT($have_no_cygwin) + CFLAGS="$save_CFLAGS" + + if test x$have_no_cygwin = xyes; then + BASE_CFLAGS="-mno-cygwin" + BASE_LDFLAGS="-mno-cygwin" + fi + BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw" ;; esac -BUILD_CFLAGS="$CFLAGS $CPPFLAGS" +# Uncomment the following line if you want to force SDL and applications +# built with it to be compiled for a particular architecture. +#AX_GCC_ARCHFLAG([no], [BASE_CFLAGS="$BASE_CFLAGS $ax_cv_gcc_archflag]") +BUILD_CFLAGS="$CFLAGS $CPPFLAGS -DUSING_GENERATED_CONFIG_H" +# The default optimization for SDL is -O3 (Bug #31) +if test "x$orig_CFLAGS" = x; then + BUILD_CFLAGS=`echo $BUILD_CFLAGS | sed 's/-O2/-O3/'` +fi EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS" BUILD_LDFLAGS="$LDFLAGS" EXTRA_LDFLAGS="$BASE_LDFLAGS" @@ -96,7 +123,7 @@ EXTRA_LDFLAGS="$BASE_LDFLAGS" # fi #done SDL_CFLAGS="$BASE_CFLAGS" -SDL_LIBS="-lSDL $BASE_LDFLAGS" +SDL_LIBS="-lSDL2 $BASE_LDFLAGS" CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS" CFLAGS="$CFLAGS $EXTRA_CFLAGS" LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" @@ -116,7 +143,7 @@ find_lib() host_lib_path="/usr/$base_libdir /usr/local/$base_libdir" fi for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do - lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`] + lib=[`ls -- $path/$1 2>/dev/null | sed -e '/\.so\..*\./d' -e 's,.*/,,' | sort | tail -1`] if test x$lib != x; then echo $lib return @@ -129,12 +156,74 @@ AC_C_CONST AC_C_INLINE AC_C_VOLATILE +dnl See whether we want assertions for debugging/sanity checking SDL itself. +AC_ARG_ENABLE(assertions, +AC_HELP_STRING([--enable-assertions], + [Enable internal sanity checks (auto/disabled/release/enabled/paranoid) [[default=auto]]]), + , enable_assertions=auto) +case "$enable_assertions" in + auto) # Use optimization settings to determine assertion level + ;; + disabled) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 0, [ ]) + ;; + release) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 1, [ ]) + ;; + enabled) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 2, [ ]) + ;; + paranoid) + AC_DEFINE(SDL_DEFAULT_ASSERT_LEVEL, 3, [ ]) + ;; + *) + AC_MSG_ERROR([*** unknown assertion level. stop.]) + ;; +esac + +dnl See whether we can use gcc style dependency tracking +AC_ARG_ENABLE(dependency-tracking, +AC_HELP_STRING([--enable-dependency-tracking], + [Use gcc -MMD -MT dependency tracking [[default=yes]]]), + , enable_dependency_tracking=yes) +if test x$enable_dependency_tracking = xyes; then + have_gcc_mmd_mt=no + AC_MSG_CHECKING(for GCC -MMD -MT option) + AC_TRY_COMPILE([ + #if !defined(__GNUC__) || __GNUC__ < 3 + #error Dependency tracking requires GCC 3.0 or newer + #endif + ],[ + ],[ + have_gcc_mmd_mt=yes + ]) + AC_MSG_RESULT($have_gcc_mmd_mt) + + if test x$have_gcc_mmd_mt = xyes; then + DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@" + fi +fi + +# Actually this doesn't work on OpenBSD and BeOS +#AC_MSG_CHECKING(for linker option --no-undefined) +#have_no_undefined=no +#save_LDFLAGS="$LDFLAGS" +#LDFLAGS="$LDFLAGS -Wl,--no-undefined" +#AC_TRY_LINK([ +#],[ +#],[ +#have_no_undefined=yes +#EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined" +#]) +#LDFLAGS="$save_LDFLAGS" +#AC_MSG_RESULT($have_no_undefined) + dnl See whether we are allowed to use the system C library AC_ARG_ENABLE(libc, AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]), , enable_libc=yes) if test x$enable_libc = xyes; then - AC_DEFINE(HAVE_LIBC) + AC_DEFINE(HAVE_LIBC, 1, [ ]) dnl Check for C library headers AC_HEADER_STDC @@ -142,13 +231,9 @@ if test x$enable_libc = xyes; then dnl Check for typedefs, structures, etc. AC_TYPE_SIZE_T - if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then - AC_CHECK_TYPE(int64_t) - if test x$ac_cv_type_int64_t = xyes; then - AC_DEFINE(SDL_HAS_64BIT_TYPE) - fi - have_inttypes=yes - fi + + dnl Check for defines + AC_CHECK_DEFINE(M_PI, math.h) dnl Checks for library functions. case "$host" in @@ -161,11 +246,11 @@ if test x$enable_libc = xyes; then AC_FUNC_MEMCMP if test x$ac_cv_func_memcmp_working = xyes; then - AC_DEFINE(HAVE_MEMCMP) + AC_DEFINE(HAVE_MEMCMP, 1, [ ]) fi AC_FUNC_STRTOD if test x$ac_cv_func_strtod = xyes; then - AC_DEFINE(HAVE_STRTOD) + AC_DEFINE(HAVE_STRTOD, 1, [ ]) fi AC_CHECK_FUNC(mprotect, AC_TRY_COMPILE([ @@ -173,67 +258,75 @@ if test x$enable_libc = xyes; then #include ],[ ],[ - AC_DEFINE(HAVE_MPROTECT) + AC_DEFINE(HAVE_MPROTECT, 1, [ ]) ]), ) - AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep) + AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname) + + AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) + AC_CHECK_FUNCS(atan atan2 ceil copysign cos cosf fabs floor log pow scalbn sin sinf sqrt) - AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"]) - AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) + AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"]) + AC_CHECK_FUNCS(iconv) AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include ]) fi -if test x$have_inttypes != xyes; then - AC_CHECK_SIZEOF(char, 1) - AC_CHECK_SIZEOF(short, 2) - AC_CHECK_SIZEOF(int, 4) - AC_CHECK_SIZEOF(long, 4) - AC_CHECK_SIZEOF(long long, 8) - if test x$ac_cv_sizeof_char = x1; then - AC_DEFINE(int8_t, signed char) - AC_DEFINE(uint8_t, unsigned char) - fi - if test x$ac_cv_sizeof_short = x2; then - AC_DEFINE(int16_t, signed short) - AC_DEFINE(uint16_t, unsigned short) - else - if test x$ac_cv_sizeof_int = x2; then - AC_DEFINE(int16_t, signed int) - AC_DEFINE(uint16_t, unsigned int) - fi - fi - if test x$ac_cv_sizeof_int = x4; then - AC_DEFINE(int32_t, signed int) - AC_DEFINE(uint32_t, unsigned int) - else - if test x$ac_cv_sizeof_long = x4; then - AC_DEFINE(int32_t, signed long) - AC_DEFINE(uint32_t, unsigned long) - fi - fi - if test x$ac_cv_sizeof_long = x8; then - AC_DEFINE(int64_t, signed long) - AC_DEFINE(uint64_t, unsigned long) - AC_DEFINE(SDL_HAS_64BIT_TYPE) +dnl AC_CHECK_SIZEOF(void*) + +dnl See whether we can use gcc atomic operations on this architecture +AC_ARG_ENABLE(gcc-atomics, +AC_HELP_STRING([--enable-gcc-atomics], + [Use gcc builtin atomics [[default=yes]]]), + , enable_gcc_atomics=yes) +if test x$enable_gcc_atomics = xyes; then + have_gcc_atomics=no + AC_MSG_CHECKING(for GCC builtin atomic operations) + AC_TRY_LINK([ + ],[ + int a; + void *x, *y, *z; + __sync_lock_test_and_set(&a, 4); + __sync_lock_test_and_set(&x, y); + __sync_fetch_and_add(&a, 1); + __sync_bool_compare_and_swap(&a, 5, 10); + __sync_bool_compare_and_swap(&x, y, z); + ],[ + have_gcc_atomics=yes + ]) + AC_MSG_RESULT($have_gcc_atomics) + + if test x$have_gcc_atomics = xyes; then + AC_DEFINE(HAVE_GCC_ATOMICS, 1, [ ]) else - if test x$ac_cv_sizeof_long_long = x8; then - AC_DEFINE(int64_t, signed long long) - AC_DEFINE(uint64_t, unsigned long long) - AC_DEFINE(SDL_HAS_64BIT_TYPE) + # See if we have the minimum operation needed for GCC atomics + AC_TRY_LINK([ + ],[ + int a; + __sync_lock_test_and_set(&a, 1); + __sync_lock_release(&a); + ],[ + have_gcc_sync_lock_test_and_set=yes + ]) + if test x$have_gcc_sync_lock_test_and_set = xyes; then + AC_DEFINE(HAVE_GCC_SYNC_LOCK_TEST_AND_SET, 1, [ ]) fi fi - AC_DEFINE(size_t, unsigned int) - AC_DEFINE(uintptr_t, unsigned long) fi # Standard C sources SOURCES="$SOURCES $srcdir/src/*.c" +SOURCES="$SOURCES $srcdir/src/atomic/*.c" SOURCES="$SOURCES $srcdir/src/audio/*.c" -SOURCES="$SOURCES $srcdir/src/cdrom/*.c" SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c" SOURCES="$SOURCES $srcdir/src/events/*.c" SOURCES="$SOURCES $srcdir/src/file/*.c" +SOURCES="$SOURCES $srcdir/src/haptic/*.c" +SOURCES="$SOURCES $srcdir/src/joystick/*.c" +SOURCES="$SOURCES $srcdir/src/libm/*.c" +SOURCES="$SOURCES $srcdir/src/power/*.c" +SOURCES="$SOURCES $srcdir/src/render/*.c" +SOURCES="$SOURCES $srcdir/src/render/*/*.c" SOURCES="$SOURCES $srcdir/src/stdlib/*.c" SOURCES="$SOURCES $srcdir/src/thread/*.c" SOURCES="$SOURCES $srcdir/src/timer/*.c" @@ -241,81 +334,353 @@ SOURCES="$SOURCES $srcdir/src/video/*.c" dnl Enable/disable various subsystems of the SDL library +AC_ARG_ENABLE(atomic, +AC_HELP_STRING([--enable-atomic], [Enable the atomic operations subsystem [[default=yes]]]), + , enable_atomic=yes) +if test x$enable_atomic != xyes; then + AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ]) +fi AC_ARG_ENABLE(audio, AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]), , enable_audio=yes) if test x$enable_audio != xyes; then - AC_DEFINE(SDL_AUDIO_DISABLED) + AC_DEFINE(SDL_AUDIO_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(video, AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]), , enable_video=yes) if test x$enable_video != xyes; then - AC_DEFINE(SDL_VIDEO_DISABLED) + AC_DEFINE(SDL_VIDEO_DISABLED, 1, [ ]) +fi +AC_ARG_ENABLE(render, +AC_HELP_STRING([--enable-render], [Enable the render subsystem [[default=yes]]]), + , enable_render=yes) +if test x$enable_render != xyes; then + AC_DEFINE(SDL_RENDER_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(events, AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]), , enable_events=yes) if test x$enable_events != xyes; then - AC_DEFINE(SDL_EVENTS_DISABLED) + AC_DEFINE(SDL_EVENTS_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(joystick, AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]), , enable_joystick=yes) if test x$enable_joystick != xyes; then - AC_DEFINE(SDL_JOYSTICK_DISABLED) -else - SOURCES="$SOURCES $srcdir/src/joystick/*.c" + AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ]) fi -AC_ARG_ENABLE(cdrom, -AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]), - , enable_cdrom=yes) -if test x$enable_cdrom != xyes; then - AC_DEFINE(SDL_CDROM_DISABLED) +AC_ARG_ENABLE(haptic, +AC_HELP_STRING([--enable-haptic], [Enable the haptic (force feedback) subsystem [[default=yes]]]), + , enable_haptic=yes) +if test x$enable_haptic != xyes; then + AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ]) +fi +AC_ARG_ENABLE(power, +AC_HELP_STRING([--enable-power], [Enable the power subsystem [[default=yes]]]), + , enable_power=yes) +if test x$enable_power != xyes; then + AC_DEFINE(SDL_POWER_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]), , enable_threads=yes) if test x$enable_threads != xyes; then - AC_DEFINE(SDL_THREADS_DISABLED) + AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(timers, AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]), , enable_timers=yes) if test x$enable_timers != xyes; then - AC_DEFINE(SDL_TIMERS_DISABLED) + AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(file, AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]), , enable_file=yes) if test x$enable_file != xyes; then - AC_DEFINE(SDL_FILE_DISABLED) + AC_DEFINE(SDL_FILE_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(loadso, AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]), , enable_loadso=yes) if test x$enable_loadso != xyes; then - AC_DEFINE(SDL_LOADSO_DISABLED) + AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(cpuinfo, AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]), , enable_cpuinfo=yes) if test x$enable_cpuinfo != xyes; then - AC_DEFINE(SDL_CPUINFO_DISABLED) + AC_DEFINE(SDL_CPUINFO_DISABLED, 1, [ ]) +fi +AC_ARG_ENABLE(atomic, +AC_HELP_STRING([--enable-atomic], [Enable the atomic operations [[default=yes]]]), + , enable_atomic=yes) +if test x$enable_atomic != xyes; then + AC_DEFINE(SDL_ATOMIC_DISABLED, 1, [ ]) fi AC_ARG_ENABLE(assembly, AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]), , enable_assembly=yes) if test x$enable_assembly = xyes; then - AC_DEFINE(SDL_ASSEMBLY_ROUTINES) + AC_DEFINE(SDL_ASSEMBLY_ROUTINES, 1, [ ]) + + # Make sure that we don't generate floating point code that would + # cause illegal instruction exceptions on older processors + case "$host" in + *-*-darwin*) + # Don't need to worry about Apple hardware, it's all SSE capable + default_ssemath=yes + ;; + *64-*-*) + # x86 64-bit architectures all have SSE instructions + default_ssemath=yes + ;; + *) + default_ssemath=no + ;; + esac + AC_ARG_ENABLE(ssemath, +AC_HELP_STRING([--enable-ssemath], [Allow GCC to use SSE floating point math [[default=no]]]), + , enable_ssemath=$default_ssemath) + if test x$enable_ssemath = xno; then + if test x$have_gcc_sse = xyes -o x$have_gcc_sse2 = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpmath=387" + fi + fi + + dnl Check for various instruction support + AC_ARG_ENABLE(mmx, +AC_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=yes]]]), + , enable_mmx=yes) + if test x$enable_mmx = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_mmx=no + AC_MSG_CHECKING(for GCC -mmmx option) + mmx_CFLAGS="-mmmx" + CFLAGS="$save_CFLAGS $mmx_CFLAGS" + + AC_TRY_COMPILE([ + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __MMX__ + #error Assembler CPP flag not enabled + #endif + ],[ + ],[ + have_gcc_mmx=yes + ]) + AC_MSG_RESULT($have_gcc_mmx) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_mmx = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $mmx_CFLAGS" + fi + fi + + AC_ARG_ENABLE(3dnow, +AC_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=yes]]]), + , enable_3dnow=yes) + if test x$enable_3dnow = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_3dnow=no + AC_MSG_CHECKING(for GCC -m3dnow option) + amd3dnow_CFLAGS="-m3dnow" + CFLAGS="$save_CFLAGS $amd3dnow_CFLAGS" + + AC_TRY_LINK([ + #include + #ifndef __3dNOW__ + #error Assembler CPP flag not enabled + #endif + ],[ + void *p = 0; + _m_prefetch(p); + ],[ + have_gcc_3dnow=yes + ]) + AC_MSG_RESULT($have_gcc_3dnow) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_3dnow = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $amd3dnow_CFLAGS" + fi + fi + + AC_ARG_ENABLE(sse, +AC_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=yes]]]), + , enable_sse=yes) + if test x$enable_sse = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_sse=no + AC_MSG_CHECKING(for GCC -msse option) + sse_CFLAGS="-msse" + CFLAGS="$save_CFLAGS $sse_CFLAGS" + + AC_TRY_COMPILE([ + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __SSE__ + #error Assembler CPP flag not enabled + #endif + ],[ + ],[ + have_gcc_sse=yes + ]) + AC_MSG_RESULT($have_gcc_sse) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_sse = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $sse_CFLAGS" + fi + fi + + AC_ARG_ENABLE(sse2, +AC_HELP_STRING([--enable-sse2], [use SSE2 assembly routines [[default=no]]]), + , enable_sse2=$default_ssemath) + if test x$enable_sse2 = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_sse2=no + AC_MSG_CHECKING(for GCC -msse2 option) + sse2_CFLAGS="-msse2" + CFLAGS="$save_CFLAGS $sse2_CFLAGS" + + AC_TRY_COMPILE([ + #ifdef __MINGW32__ + #include <_mingw.h> + #ifdef __MINGW64_VERSION_MAJOR + #include + #else + #include + #endif + #else + #include + #endif + #ifndef __SSE2__ + #error Assembler CPP flag not enabled + #endif + ],[ + ],[ + have_gcc_sse2=yes + ]) + AC_MSG_RESULT($have_gcc_sse2) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_sse2 = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $sse2_CFLAGS" + fi + fi + + AC_ARG_ENABLE(altivec, +AC_HELP_STRING([--enable-altivec], [use Altivec assembly routines [[default=yes]]]), + , enable_altivec=yes) + if test x$enable_altivec = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_altivec=no + have_altivec_h_hdr=no + altivec_CFLAGS="-maltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + + AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option) + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + have_altivec_h_hdr=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC -maltivec option) + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option) + altivec_CFLAGS="-faltivec" + CFLAGS="$save_CFLAGS $altivec_CFLAGS" + AC_TRY_COMPILE([ + #include + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + have_altivec_h_hdr=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + + if test x$have_gcc_altivec = xno; then + AC_MSG_CHECKING(for Altivec with GCC -faltivec option) + AC_TRY_COMPILE([ + vector unsigned int vzero() { + return vec_splat_u32(0); + } + ],[ + ],[ + have_gcc_altivec=yes + ]) + AC_MSG_RESULT($have_gcc_altivec) + fi + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_altivec = xyes; then + AC_DEFINE(SDL_ALTIVEC_BLITTERS, 1, [ ]) + if test x$have_altivec_h_hdr = xyes; then + AC_DEFINE(HAVE_ALTIVEC_H, 1, [ ]) + fi + EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS" + fi + fi fi dnl See if the OSS audio interface is supported CheckOSS() { AC_ARG_ENABLE(oss, -AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]), - , enable_oss=yes) +AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=maybe]]]), + , enable_oss=maybe) + + # OpenBSD "has" OSS, but it's not really for app use. They want you to + # use sndio instead. So on there, we default to disabled. You can force + # it on if you really want, though. + if test x$enable_oss = xmaybe; then + enable_oss=yes + case "$host" in + *-*-openbsd*) + enable_oss=no;; + esac + fi + if test x$enable_audio = xyes -a x$enable_oss = xyes; then AC_MSG_CHECKING(for OSS audio support) have_oss=no @@ -335,14 +700,13 @@ AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]), int arg = SNDCTL_DSP_SETFRAGMENT; ],[ have_oss=yes - AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H) + AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H, 1, [ ]) ]) fi AC_MSG_RESULT($have_oss) if test x$have_oss = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_OSS) + AC_DEFINE(SDL_AUDIO_DRIVER_OSS, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c" - SOURCES="$SOURCES $srcdir/src/audio/dma/*.c" have_audio=yes # We may need to link with ossaudio emulation library @@ -372,7 +736,7 @@ AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[de , enable_alsa_shared=yes) alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - AC_DEFINE(SDL_AUDIO_DRIVER_ALSA) + AC_DEFINE(SDL_AUDIO_DRIVER_ALSA, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS" if test x$have_loadso != xyes && \ @@ -382,7 +746,7 @@ AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[de if test x$have_loadso = xyes && \ test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then echo "-- dynamic libasound -> $alsa_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib") + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib", [ ]) else EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS" fi @@ -391,68 +755,6 @@ AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[de fi } -dnl Check whether we want to use IRIX 6.5+ native audio or not -CheckDMEDIA() -{ - if test x$enable_audio = xyes; then - AC_MSG_CHECKING(for dmedia audio support) - have_dmedia=no - AC_TRY_COMPILE([ - #include - ],[ - ALport audio_port; - ],[ - have_dmedia=yes - ]) - AC_MSG_RESULT($have_dmedia) - # Set up files for the audio library - if test x$have_dmedia = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA) - SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio" - have_audio=yes - fi - fi -} - -dnl Check whether we want to use Tru64 UNIX native audio or not -CheckMME() -{ - dnl Make sure we are running on an Tru64 UNIX - case $ARCH in - osf) - ;; - *) - return - ;; - esac - if test x$enable_audio = xyes; then - AC_MSG_CHECKING(for MME audio support) - MME_CFLAGS="-I/usr/include/mme" - MME_LIBS="-lmme" - have_mme=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $MME_CFLAGS" - AC_TRY_COMPILE([ - #include - ],[ - HWAVEOUT sound; - ],[ - have_mme=yes - ]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT($have_mme) - # Set up files for the audio library - if test x$have_mme = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO) - SOURCES="$SOURCES $srcdir/src/audio/mme/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS" - have_audio=yes - fi - fi -} - dnl Find the ESD includes and libraries CheckESD() { @@ -467,7 +769,7 @@ AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[defa , enable_esd_shared=yes) esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - AC_DEFINE(SDL_AUDIO_DRIVER_ESD) + AC_DEFINE(SDL_AUDIO_DRIVER_ESD, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/esd/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS" if test x$have_loadso != xyes && \ @@ -477,7 +779,7 @@ AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[defa if test x$have_loadso = xyes && \ test x$enable_esd_shared = xyes && test x$esd_lib != x; then echo "-- dynamic libesd -> $esd_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib") + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", [ ]) else EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS" fi @@ -493,40 +795,48 @@ CheckPulseAudio() AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]), , enable_pulseaudio=yes) if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then - audio_pulse=no + audio_pulseaudio=no - PULSE_REQUIRED_VERSION=0.9 + PULSEAUDIO_REQUIRED_VERSION=0.9 AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - AC_MSG_CHECKING(for PulseAudio $PULSE_REQUIRED_VERSION support) + AC_MSG_CHECKING(for PulseAudio $PULSEAUDIO_REQUIRED_VERSION support) if test x$PKG_CONFIG != xno; then - if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSE_REQUIRED_VERSION libpulse-simple; then - PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple` - PULSE_LIBS=`$PKG_CONFIG --libs libpulse-simple` - audio_pulse=yes + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSEAUDIO_REQUIRED_VERSION libpulse-simple; then + PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple` + PULSEAUDIO_LIBS=`$PKG_CONFIG --libs libpulse-simple` + audio_pulseaudio=yes fi fi - AC_MSG_RESULT($audio_pulse) + AC_MSG_RESULT($audio_pulseaudio) - if test x$audio_pulse = xyes; then + if test x$audio_pulseaudio = xyes; then AC_ARG_ENABLE(pulseaudio-shared, AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]), , enable_pulseaudio_shared=yes) - pulse_lib=[`find_lib "libpulse-simple.so.*" "$PULSE_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - AC_DEFINE(SDL_AUDIO_DRIVER_PULSE) - SOURCES="$SOURCES $srcdir/src/audio/pulse/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSE_CFLAGS" + AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSEAUDIO_CFLAGS" if test x$have_loadso != xyes && \ test x$enable_pulseaudio_shared = xyes; then AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading]) fi if test x$have_loadso = xyes && \ - test x$enable_pulseaudio_shared = xyes && test x$pulse_lib != x; then - echo "-- dynamic libpulse-simple -> $pulse_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib") + test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then + echo "-- dynamic libpulse-simple -> $pulseaudio_lib" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ]) + + case "$host" in + # On Solaris, pulseaudio must be linked deferred explicitly + # to prevent undefined symbol failures. + *-*-solaris*) + PULSEAUDIO_LIBS=`echo $PULSEAUDIO_LIBS | sed 's/\-l/-Wl,-l/g'` + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSEAUDIO_LIBS -Wl,-znodeferred" + esac else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_LIBS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSEAUDIO_LIBS" fi have_audio=yes fi @@ -564,7 +874,7 @@ AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[de , enable_arts_shared=yes) arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] - AC_DEFINE(SDL_AUDIO_DRIVER_ARTS) + AC_DEFINE(SDL_AUDIO_DRIVER_ARTS, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/arts/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS" if test x$have_loadso != xyes && \ @@ -574,7 +884,7 @@ AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[de if test x$have_loadso = xyes && \ test x$enable_arts_shared = xyes && test x$arts_lib != x; then echo "-- dynamic libartsc -> $arts_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib") + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib", [ ]) else EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS" fi @@ -606,12 +916,6 @@ AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]), NAS_CFLAGS="-I/usr/X11R6/include/" NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" - dnl On IRIX, the NAS includes are in a different directory, - dnl and libnas must be explicitly linked in - - elif test -r /usr/freeware/include/nas/audiolib.h; then - have_nas=yes - NAS_LIBS="-lnas -lXt" fi AC_MSG_RESULT($have_nas) @@ -629,12 +933,12 @@ AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[defa if test x$have_loadso = xyes && \ test x$enable_nas_shared = xyes && test x$nas_lib != x; then echo "-- dynamic libaudio -> $nas_lib" - AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib") + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib", [ ]) else EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS" fi - AC_DEFINE(SDL_AUDIO_DRIVER_NAS) + AC_DEFINE(SDL_AUDIO_DRIVER_NAS, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/nas/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS" have_audio=yes @@ -642,6 +946,52 @@ AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[defa fi } +dnl See if the sndio audio interface is supported +CheckSNDIO() +{ + AC_ARG_ENABLE(sndio, +AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]), + , enable_sndio=yes) + if test x$enable_audio = xyes -a x$enable_sndio = xyes; then + AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes) + AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes) + + AC_MSG_CHECKING(for sndio audio support) + have_sndio=no + + if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then + have_sndio=yes + SNDIO_LIBS="-lsndio" + fi + + AC_MSG_RESULT($have_sndio) + + if test x$have_sndio = xyes; then + AC_ARG_ENABLE(sndio-shared, +AC_HELP_STRING([--enable-sndio-shared], [dynamically load sndio audio support [[default=yes]]]), + , enable_sndio_shared=yes) + sndio_lib=[`find_lib "libsndio.so.*" "$SNDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + + if test x$have_loadso != xyes && \ + test x$enable_sndio_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic sndio loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_sndio_shared = xyes && test x$sndio_lib != x; then + echo "-- dynamic libsndio -> $sndio_lib" + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC, "$sndio_lib", [ ]) + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS" + fi + + AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $SNDIO_CFLAGS" + have_audio=yes + fi + fi +} + dnl rcg07142001 See if the user wants the disk writer audio driver... CheckDiskAudio() { @@ -649,7 +999,7 @@ CheckDiskAudio() AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]), , enable_diskaudio=yes) if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_DISK) + AC_DEFINE(SDL_AUDIO_DRIVER_DISK, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/disk/*.c" fi } @@ -661,200 +1011,17 @@ CheckDummyAudio() AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]), , enable_dummyaudio=yes) if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY) + AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c" fi } -dnl Set up the Atari Audio driver -CheckAtariAudio() +dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually). +dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility +CheckVisibilityHidden() { - AC_ARG_ENABLE(mintaudio, -AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]), - , enable_mintaudio=yes) - if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then - mintaudio=no - AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes) - if test x$have_mint_falcon_hdr = xyes; then - mintaudio=yes - AC_DEFINE(SDL_AUDIO_DRIVER_MINT) - SOURCES="$SOURCES $srcdir/src/audio/mint/*.c" - SOURCES="$SOURCES $srcdir/src/audio/mint/*.S" - have_audio=yes - fi - fi -} - -dnl See if we can use x86 assembly blitters -# NASM is available from: http://nasm.sourceforge.net -CheckNASM() -{ - dnl Make sure we are running on an x86 platform - case $host in - i?86*) - ;; - *) - # Nope, bail early. - return - ;; - esac - - dnl Mac OS X might report itself as "i386" but generate x86_64 code. - dnl So see what size we think a pointer is, and bail if not 32-bit. - AC_CHECK_SIZEOF([void *], 4) - if test x$ac_cv_sizeof_void_p != x4; then - return - fi - - dnl Check for NASM (for assembly blit routines) - AC_ARG_ENABLE(nasm, -AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]), - , enable_nasm=yes) - if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then - CompileNASM() - { - # Usage: CompileNASM - AC_MSG_CHECKING(to see if $NASM supports $1) - if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then - CompileNASM_ret="yes" - else - CompileNASM_ret="no" - fi - rm -f $1 $1.o - AC_MSG_RESULT($CompileNASM_ret) - test "$CompileNASM_ret" = "yes" - } - - if test x"$NASMFLAGS" = x; then - case $ARCH in - win32) - NASMFLAGS="-f win32" - ;; - macosx) - NASMFLAGS="-f macho" - ;; - *) - NASMFLAGS="-f elf32" - ;; - esac - fi - - AC_PATH_PROG(NASM, nasm) - echo "%ifidn __OUTPUT_FORMAT__,elf32" > unquoted-sections - echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections - echo "%endif" >> unquoted-sections - CompileNASM unquoted-sections || NASM="" - - if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then - AC_DEFINE(SDL_HERMES_BLITTERS) - SOURCES="$SOURCES $srcdir/src/hermes/*.asm" - NASMFLAGS="$NASMFLAGS -I $srcdir/src/hermes/" - - dnl See if hidden visibility is supported - echo "GLOBAL _bar:function hidden" > symbol-visibility - echo "_bar:" >> symbol-visibility - CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY" - - AC_SUBST(NASM) - AC_SUBST(NASMFLAGS) - - case "$host" in - # this line is needed for QNX, because it's not defined the __ELF__ - *-*-qnx*) - EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";; - *-*-solaris*) - EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";; - esac - fi - fi -} - -dnl Check for altivec instruction support using gas syntax -CheckAltivec() -{ - AC_ARG_ENABLE(altivec, -AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]), - , enable_altivec=yes) - if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then - save_CFLAGS="$CFLAGS" - have_gcc_altivec=no - have_altivec_h_hdr=no - altivec_CFLAGS="-maltivec" - CFLAGS="$save_CFLAGS $altivec_CFLAGS" - - AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option) - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - have_altivec_h_hdr=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - - if test x$have_gcc_altivec = xno; then - AC_MSG_CHECKING(for Altivec with GCC -maltivec option) - AC_TRY_COMPILE([ - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - fi - - if test x$have_gcc_altivec = xno; then - AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option) - altivec_CFLAGS="-faltivec" - CFLAGS="$save_CFLAGS $altivec_CFLAGS" - AC_TRY_COMPILE([ - #include - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - have_altivec_h_hdr=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - fi - - if test x$have_gcc_altivec = xno; then - AC_MSG_CHECKING(for Altivec with GCC -faltivec option) - AC_TRY_COMPILE([ - vector unsigned int vzero() { - return vec_splat_u32(0); - } - ],[ - ],[ - have_gcc_altivec=yes - ]) - AC_MSG_RESULT($have_gcc_altivec) - fi - CFLAGS="$save_CFLAGS" - - if test x$have_gcc_altivec = xyes; then - AC_DEFINE(SDL_ALTIVEC_BLITTERS) - if test x$have_altivec_h_hdr = xyes; then - AC_DEFINE(HAVE_ALTIVEC_H) - fi - EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS" - fi - fi -} - -dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually). -dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility -CheckVisibilityHidden() -{ - AC_MSG_CHECKING(for GCC -fvisibility=hidden option) - have_gcc_fvisibility=no + AC_MSG_CHECKING(for GCC -fvisibility=hidden option) + have_gcc_fvisibility=no visibility_CFLAGS="-fvisibility=hidden" save_CFLAGS="$CFLAGS" @@ -875,6 +1042,30 @@ CheckVisibilityHidden() fi } +dnl See if GCC's -mpreferred-stack-boundary is supported. +dnl Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296 +CheckStackBoundary() +{ + AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option) + have_gcc_preferred_stack_boundary=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2" + AC_TRY_COMPILE([ + int x = 0; + ],[ + ],[ + have_gcc_preferred_stack_boundary=yes + ]) + AC_MSG_RESULT($have_gcc_preferred_stack_boundary) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_preferred_stack_boundary = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2" + fi +} + + dnl See if GCC's -Wall is supported. CheckWarnAll() { @@ -911,59 +1102,11 @@ CheckWarnAll() } -dnl Do the iPod thing -CheckIPod() -{ - AC_ARG_ENABLE(ipod, -AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [[default=no]]]), - , enable_ipod=no) - - if test x$enable_ipod = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD" - AC_DEFINE(SDL_VIDEO_DRIVER_IPOD) - SOURCES="$SOURCES $srcdir/src/video/ipod/*.c" - fi -} - -dnl Find the nanox include and library directories -CheckNANOX() -{ - AC_ARG_ENABLE(video-nanox, - AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]), - , enable_video_nanox=no) - - if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then - AC_ARG_ENABLE(nanox-debug, - AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]), - , enable_nanox_debug=no) - if test x$enable_nanox_debug = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG" - fi - - AC_ARG_ENABLE(nanox-share-memory, - AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]), - , enable_nanox_share_memory=no) - if test x$enable_nanox_share_memory = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY" - fi - - AC_ARG_ENABLE(nanox_direct_fb, - AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]), - , enable_nanox_direct_fb=no) - if test x$enable_nanox_direct_fb = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB" - fi - - AC_DEFINE(SDL_VIDEO_DRIVER_NANOX) - SOURCES="$SOURCES $srcdir/src/video/nanox/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X" - have_video=yes - fi -} - dnl Find the X11 include and library directories CheckX11() { + + AC_ARG_ENABLE(video-x11, AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]), , enable_video_x11=yes) @@ -971,7 +1114,10 @@ AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]), case "$host" in *-*-darwin*) # This isn't necessary for X11, but fixes GLX detection - if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then + if test "x$x_includes" = xNONE && \ + test "x$x_libraries" = xNONE && \ + test -d /usr/X11R6/include && \ + test -d /usr/X11R6/lib; then x_includes="/usr/X11R6/include" x_libraries="/usr/X11R6/lib" fi @@ -990,40 +1136,67 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma , enable_x11_shared=maybe) case "$host" in - *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs... + *-*-darwin*) x11_symbols_private=yes x11_lib='/usr/X11R6/lib/libX11.6.dylib' x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' - xrender_lib='/usr/X11R6/lib/libXrender.1.dylib' + xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib' + xinerama_lib='/usr/X11R6/lib/libXinerama.1.dylib' + xinput_lib='/usr/X11R6/lib/libXi.6.dylib' xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib' + xrender_lib='/usr/X11R6/lib/libXrender.1.dylib' + xss_lib='/usr/X11R6/lib/libXss.1.dylib' + xvidmode_lib='/usr/X11R6/lib/libXxf86vm.1.dylib' ;; - *-*-osf*) - x11_lib='libX11.so' - x11ext_lib='libXext.so' - ;; - *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32 + *-*-openbsd*) x11_lib='libX11.so' x11ext_lib='libXext.so' + xcursor_lib='libXcursor.so' + xinerama_lib='libXinerama.so' + xinput_lib='libXi.so' + xrandr_lib='libXrandr.so' + xrender_lib='libXrender.so' + xss_lib='libXss.so' + xvidmode_lib='libXxf86vm.so' ;; *) x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] - xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xcursor_lib=[`find_lib "libXcursor.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xinerama_lib=[`find_lib "libXinerama.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xvidmode_lib=[`find_lib "libXxf86vm.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] ;; esac - X_CFLAGS="$X_CFLAGS -DXTHREADS" if test x$ac_cv_func_shmat != xyes; then X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY" fi CFLAGS="$CFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" - AC_DEFINE(SDL_VIDEO_DRIVER_X11) + AC_CHECK_HEADER(X11/extensions/Xext.h, + have_xext_h_hdr=yes, + have_xext_h_hdr=no, + [#include + #include + ]) + if test x$have_xext_h_hdr != xyes; then + AC_MSG_ERROR([ +*** Missing Xext.h, maybe you need to install the libxext-dev package? + ]) + fi + + AC_DEFINE(SDL_VIDEO_DRIVER_X11, 1, [ ]) SOURCES="$SOURCES $srcdir/src/video/x11/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS" + # Needed so SDL applications can include SDL_syswm.h + SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS" + if test x$enable_x11_shared = xmaybe; then enable_x11_shared=$x11_symbols_private fi @@ -1042,60 +1215,160 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then echo "-- dynamic libX11 -> $x11_lib" echo "-- dynamic libX11ext -> $x11ext_lib" - AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib") - AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib") + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib", [ ]) + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib", [ ]) else enable_x11_shared=no EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext" fi have_video=yes - AC_ARG_ENABLE(dga, -AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [[default=yes]]]), - , enable_dga=yes) - if test x$enable_dga = xyes; then - SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c" - fi - AC_ARG_ENABLE(video-dga, -AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]), - , enable_video_dga=yes) - if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_DGA) - SOURCES="$SOURCES $srcdir/src/video/dga/*.c" - fi - AC_ARG_ENABLE(video-x11-dgamouse, -AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]), - , enable_video_x11_dgamouse=yes) - if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE) - fi - AC_ARG_ENABLE(video-x11-vm, -AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]), - , enable_video_x11_vm=yes) - if test x$enable_video_x11_vm = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE) - SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c" + AC_MSG_CHECKING(for const parameter to XextAddDisplay) + have_const_param_XextAddDisplay=no + AC_TRY_COMPILE([ + #include + #include + #include + #include + extern XExtDisplayInfo* XextAddDisplay(XExtensionInfo* a,Display* b,_Xconst char* c,XExtensionHooks* d,int e,XPointer f); + ],[ + ],[ + have_const_param_XextAddDisplay=yes + AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY) + ]) + AC_MSG_RESULT($have_const_param_XextAddDisplay) + + AC_MSG_CHECKING(for const parameter to _XData32) + have_const_param_xdata32=no + AC_TRY_COMPILE([ + #include + extern int _XData32(Display *dpy,register _Xconst long *data,unsigned len); + ],[ + ],[ + have_const_param_xdata32=yes + AC_DEFINE(SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32) + ]) + AC_MSG_RESULT($have_const_param_xdata32) + + dnl AC_CHECK_LIB(X11, XGetEventData, AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS, 1, [Have XGenericEvent])) + AC_MSG_CHECKING([for XGenericEvent]) + have_XGenericEvent=no + AC_TRY_COMPILE([ + #include + ],[ +Display *display; +XEvent event; +XGenericEventCookie *cookie = &event.xcookie; +XNextEvent(display, &event); +XGetEventData(display, cookie); +XFreeEventData(display, cookie); + ],[ + have_XGenericEvent=yes + AC_DEFINE(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS) + ]) + AC_MSG_RESULT($have_XGenericEvent) + + AC_CHECK_LIB(X11, XkbKeycodeToKeysym, AC_DEFINE(SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM, 1, [Have XkbKeycodeToKeysym])) + + AC_ARG_ENABLE(video-x11-xcursor, +AC_HELP_STRING([--enable-video-x11-xcursor], [enable X11 Xcursor support [[default=yes]]]), + , enable_video_x11_xcursor=yes) + if test x$enable_video_x11_xcursor = xyes; then + definitely_enable_video_x11_xcursor=no + AC_CHECK_HEADER(X11/Xcursor/Xcursor.h, + have_xcursor_h_hdr=yes, + have_xcursor_h_hdr=no, + [#include + ]) + if test x$have_xcursor_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xcursor_lib != x ; then + echo "-- dynamic libXcursor -> $xcursor_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR, "$xcursor_lib", [ ]) + definitely_enable_video_x11_xcursor=yes + else + AC_CHECK_LIB(Xcursor, XcursorImageCreate, have_xcursor_lib=yes) + if test x$have_xcursor_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXcursor" + definitely_enable_video_x11_xcursor=yes + fi + fi + fi fi - AC_ARG_ENABLE(video-x11-xv, -AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]), - , enable_video_x11_xv=yes) - if test x$enable_video_x11_xv = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV) - SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c" + if test x$definitely_enable_video_x11_xcursor = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XCURSOR, 1, [ ]) fi AC_ARG_ENABLE(video-x11-xinerama, AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]), , enable_video_x11_xinerama=yes) if test x$enable_video_x11_xinerama = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA) - SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c" + definitely_enable_video_x11_xinerama=no + AC_CHECK_HEADER(X11/extensions/Xinerama.h, + have_xinerama_h_hdr=yes, + have_xinerama_h_hdr=no, + [#include + ]) + if test x$have_xinerama_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xinerama_lib != x ; then + echo "-- dynamic libXinerama -> $xinerama_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA, "$xinerama_lib", [ ]) + definitely_enable_video_x11_xinerama=yes + else + AC_CHECK_LIB(Xinerama, XineramaQueryExtension, have_xinerama_lib=yes) + if test x$have_xinerama_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXinerama" + definitely_enable_video_x11_xinerama=yes + fi + fi + fi fi - AC_ARG_ENABLE(video-x11-xme, -AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]), - , enable_video_x11_xme=yes) - if test x$enable_video_x11_xme = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME) - SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c" + if test x$definitely_enable_video_x11_xinerama = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA, 1, [ ]) + fi + AC_ARG_ENABLE(video-x11-xinput, +AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]), + , enable_video_x11_xinput=yes) + if test x$enable_video_x11_xinput = xyes; then + definitely_enable_video_x11_xinput=no + AC_CHECK_HEADER(X11/extensions/XInput2.h, + have_xinput_h_hdr=yes, + have_xinput_h_hdr=no, + [#include + ]) + if test x$have_xinput_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then + echo "-- dynamic libXi -> $xinput_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2, "$xinput_lib", [ ]) + definitely_enable_video_x11_xinput=yes + else + AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes) + if test x$have_xinput_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi" + definitely_enable_video_x11_xinput=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xinput = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2, 1, [ ]) + AC_MSG_CHECKING(for xinput2 multitouch) + have_xinput2_multitouch=no + AC_TRY_COMPILE([ + #include + #include + #include + ],[ +int event_type = XI_TouchBegin; +XITouchClassInfo *t; +Status +XIAllowTouchEvents(Display *a,int b,unsigned int c,Window d,int f) +{ + return (Status)0; +} + ],[ + have_xinput2_multitouch=yes + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH) + ]) + AC_MSG_RESULT($have_xinput2_multitouch) fi AC_ARG_ENABLE(video-x11-xrandr, AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]), @@ -1109,55 +1382,87 @@ AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for ful ]) if test x$have_xrandr_h_hdr = xyes; then if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then - echo "-- dynamic libXrender -> $xrender_lib" echo "-- dynamic libXrandr -> $xrandr_lib" - AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib") - AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib") + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib", [ ]) definitely_enable_video_x11_xrandr=yes else - AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes) AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes) - if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender" + if test x$have_xrandr_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr" definitely_enable_video_x11_xrandr=yes fi fi fi fi if test x$definitely_enable_video_x11_xrandr = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR) + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR, 1, [ ]) + fi + AC_ARG_ENABLE(video-x11-scrnsaver, +AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension [[default=yes]]]), + , enable_video_x11_scrnsaver=yes) + if test x$enable_video_x11_scrnsaver = xyes; then + AC_CHECK_HEADER(X11/extensions/scrnsaver.h, + have_scrnsaver_h_hdr=yes, + have_scrnsaver_h_hdr=no, + [#include + ]) + if test x$have_scrnsaver_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xss_lib != x ; then + echo "-- dynamic libXss -> $xss_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS, "$xss_lib", [ ]) + definitely_enable_video_x11_scrnsaver=yes + else + AC_CHECK_LIB(Xss, XScreenSaverSuspend, have_xss_lib=yes) + if test x$have_xss_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXss" + definitely_enable_video_x11_scrnsaver=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_scrnsaver = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSCRNSAVER, 1, [ ]) + fi + AC_ARG_ENABLE(video-x11-xshape, +AC_HELP_STRING([--enable-video-x11-xshape], [enable X11 XShape support [[default=yes]]]), + , enable_video_x11_xshape=yes) + if test x$enable_video_x11_xshape = xyes; then + AC_CHECK_HEADER(X11/extensions/shape.h, + have_shape_h_hdr=yes, + have_shape_h_hdr=no, + [#include + ]) + if test x$have_shape_h_hdr = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XSHAPE, 1, [ ]) + fi + fi + AC_ARG_ENABLE(video-x11-vm, +AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]), + , enable_video_x11_vm=yes) + if test x$enable_video_x11_vm = xyes; then + definitely_enable_video_x11_vm=no + AC_CHECK_HEADER(X11/extensions/xf86vmode.h, + have_vm_h_hdr=yes, + have_vm_h_hdr=no, + [#include + ]) + if test x$have_vm_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xvidmode_lib != x ; then + echo "-- dynamic libXxf86vm -> $xvidmode_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE, "$xvidmode_lib", [ ]) + definitely_enable_video_x11_vm=yes + else + AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, have_vm_lib=yes) + if test x$have_vm_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXxf86vm" + definitely_enable_video_x11_vm=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_vm = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XVIDMODE, 1, [ ]) fi - fi - fi -} - -dnl Check for QNX photon video driver -CheckPHOTON() -{ - AC_ARG_ENABLE(video-photon, -AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]), - , enable_video_photon=yes) - if test x$enable_video = xyes -a x$enable_video_photon = xyes; then - AC_MSG_CHECKING(for QNX Photon support) - video_photon=no - AC_TRY_COMPILE([ - #include - #include - #include - #include - ],[ - PgDisplaySettings_t *visual; - ],[ - video_photon=yes - ]) - AC_MSG_RESULT($video_photon) - if test x$video_photon = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON) - SOURCES="$SOURCES $srcdir/src/video/photon/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph" - have_video=yes - - CheckOpenGLQNX fi fi } @@ -1166,42 +1471,17 @@ dnl Set up the BWindow video driver if enabled CheckBWINDOW() { if test x$enable_video = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW) + AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW, 1, [ ]) SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc" have_video=yes fi } -dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin) -CheckCARBON() -{ - AC_ARG_ENABLE(video-carbon, -AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [[default=no]]]), - , enable_video_carbon=no) - if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then - AC_MSG_CHECKING(for Carbon framework) - have_carbon=no - AC_TRY_COMPILE([ - #include - ],[ - ],[ - have_carbon=yes - ]) - AC_MSG_RESULT($have_carbon) - if test x$have_carbon = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX) - SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c" - SOURCES="$SOURCES $srcdir/src/video/macrom/*.c" - have_video=yes - fi - fi -} - -dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin) +dnl Set up the Cocoa video driver for Mac OS X (but not Darwin) CheckCOCOA() { AC_ARG_ENABLE(video-cocoa, -AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default=yes]]]), +AC_HELP_STRING([--enable-video-cocoa], [use Cocoa video driver [[default=yes]]]), , enable_video_cocoa=yes) if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then save_CFLAGS="$CFLAGS" @@ -1218,35 +1498,8 @@ AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default= AC_MSG_RESULT($have_cocoa) CFLAGS="$save_CFLAGS" if test x$have_cocoa = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ) - SOURCES="$SOURCES $srcdir/src/video/quartz/*.m" - have_video=yes - fi - fi -} - -dnl Find the framebuffer console includes -CheckFBCON() -{ - AC_ARG_ENABLE(video-fbcon, -AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=yes]]]), - , enable_video_fbcon=yes) - if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then - AC_MSG_CHECKING(for framebuffer console support) - video_fbcon=no - AC_TRY_COMPILE([ - #include - #include - #include - ],[ - ],[ - video_fbcon=yes - ]) - AC_MSG_RESULT($video_fbcon) - if test x$video_fbcon = xyes; then - AC_CHECK_FUNCS(getpagesize) - AC_DEFINE(SDL_VIDEO_DRIVER_FBCON) - SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c" + AC_DEFINE(SDL_VIDEO_DRIVER_COCOA, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/video/cocoa/*.m" have_video=yes fi fi @@ -1256,379 +1509,125 @@ dnl Find DirectFB CheckDirectFB() { AC_ARG_ENABLE(video-directfb, -AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]), - , enable_video_directfb=yes) +AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=no]]]), + , enable_video_directfb=no) if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then video_directfb=no - DIRECTFB_REQUIRED_VERSION=0.9.15 - - AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no) + DIRECTFB_REQUIRED_VERSION=1.0.0 + AC_PATH_PROGS(DIRECTFBCONFIG, directfb-config, no, [$prefix/bin:$PATH]) if test x$DIRECTFBCONFIG = xno; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG != xno; then if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb` DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb` + DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb` video_directfb=yes fi fi else set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'` NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3` - set -- `directfb-config --version | sed 's/\./ /g'` + set -- `$DIRECTFBCONFIG --version | sed 's/\./ /g'` HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3` if test $HAVE_VERSION -ge $NEED_VERSION; then DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags` DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs` + DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix` video_directfb=yes fi fi if test x$video_directfb = xyes; then # SuSE 11.1 installs directfb-config without directfb-devel - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $DIRECTFB_CFLAGS" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $DIRECTFB_CFLAGS" AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no) - CFLAGS="$save_CFLAGS" + CPPFLAGS="$save_CPPFLAGS" video_directfb=$have_directfb_hdr fi AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support) AC_MSG_RESULT($video_directfb) if test x$video_directfb = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB) + AC_ARG_ENABLE(directfb-shared, +AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]), + , enable_directfb_shared=yes) + + AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_DIRECTFB, 1, [ ]) SOURCES="$SOURCES $srcdir/src/video/directfb/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS" - have_video=yes - fi - fi -} - -dnl See if we're running on PlayStation 2 hardware -CheckPS2GS() -{ - AC_ARG_ENABLE(video-ps2gs, -AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]), - , enable_video_ps2gs=yes) - if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then - AC_MSG_CHECKING(for PlayStation 2 GS support) - video_ps2gs=no - AC_TRY_COMPILE([ - #include - #include - ],[ - ],[ - video_ps2gs=yes - ]) - AC_MSG_RESULT($video_ps2gs) - if test x$video_ps2gs = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS) - SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c" - have_video=yes - fi - fi -} - -dnl See if we're running on PlayStation 3 Cell hardware -CheckPS3() -{ - AC_ARG_ENABLE(video-ps3, - AC_HELP_STRING([--enable-video-ps3], [use PlayStation 3 Cell driver [[default=yes]]]), - , enable_video_ps3=yes) - if test x$enable_video = xyes -a x$enable_video_ps3 = xyes; then - AC_MSG_CHECKING(for PlayStation 3 Cell support) - video_ps3=no - AC_TRY_COMPILE([ - #include - #include - #include - ],[ - ],[ - video_ps3=yes - ]) - AC_MSG_RESULT($video_ps3) - if test x$video_ps3 = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_PS3) - SOURCES="$SOURCES $srcdir/src/video/ps3/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lbilin_scaler_spu -lfb_writer_spu -lyuv2rgb_spu -L/opt/cell/sdk/usr/lib -lspe2" - have_video=yes - fi - fi -} - -dnl Find the GGI includes -CheckGGI() -{ - AC_ARG_ENABLE(video-ggi, -AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [[default=no]]]), - , enable_video_ggi=no) - if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then - AC_MSG_CHECKING(for GGI support) - video_ggi=no - AC_TRY_COMPILE([ - #include - #include - ],[ - ],[ - video_ggi=yes - ]) - AC_MSG_RESULT($video_ggi) - if test x$video_ggi = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_GGI) - SOURCES="$SOURCES $srcdir/src/video/ggi/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg" - have_video=yes - fi - fi -} - -dnl Find the SVGAlib includes and libraries -CheckSVGA() -{ - AC_ARG_ENABLE(video-svga, -AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]), - , enable_video_svga=yes) - if test x$enable_video = xyes -a x$enable_video_svga = xyes; then - AC_MSG_CHECKING(for SVGAlib (1.4.0+) support) - video_svga=no - AC_TRY_COMPILE([ - #include - #include - #include - ],[ - if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) { - exit(0); - } - ],[ - video_svga=yes - ]) - AC_MSG_RESULT($video_svga) - if test x$video_svga = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB) - SOURCES="$SOURCES $srcdir/src/video/svga/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga" - have_video=yes - fi - fi -} -dnl Find the VGL includes and libraries -CheckVGL() -{ - AC_ARG_ENABLE(video-vgl, -AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]), - , enable_video_vgl=yes) - if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then - AC_MSG_CHECKING(for libVGL support) - video_vgl=no - AC_TRY_COMPILE([ - #include - #include - #include - #include - ],[ - VGLBitmap bitmap; - bitmap.Type = VIDBUF32; - bitmap.PixelBytes = 4; - exit(bitmap.Bitmap); - ],[ - video_vgl=yes - ]) - AC_MSG_RESULT($video_vgl) - if test x$video_vgl = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_VGL) - SOURCES="$SOURCES $srcdir/src/video/vgl/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl" + AC_MSG_CHECKING(for directfb dynamic loading support) + directfb_shared=no + directfb_lib=[`find_lib "libdirectfb.so.*" "$DIRECTFB_LIBS"`] + # | sed 's/.*\/\(.*\)/\1/; q'`] +AC_MSG_WARN("directfb $directfb_lib") + if test x$have_loadso != xyes && \ + test x$enable_directfb_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then + directfb_shared=yes + echo "-- $directfb_lib_spec -> $directfb_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib", [ ]) + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS" + fi + AC_MSG_RESULT($directfb_shared) have_video=yes fi fi } -dnl Set up the wscons video driver if enabled -CheckWscons() +dnl Find FusionSound +CheckFusionSound() { - AC_ARG_ENABLE(video-wscons, -AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]), - , enable_video_wscons=yes) - if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then - AC_MSG_CHECKING(for wscons support) - video_wscons=no - AC_TRY_COMPILE([ - #include - #include - #include - ],[ - int wsmode = WSDISPLAYIO_MODE_DUMBFB; - ],[ - video_wscons=yes - ]) - AC_MSG_RESULT($video_wscons) - if test x$video_wscons = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS) - SOURCES="$SOURCES $srcdir/src/video/wscons/*.c" - have_video=yes - fi - fi -} + AC_ARG_ENABLE(fusionsound, +AC_HELP_STRING([--enable-fusionsound], [use FusionSound audio driver [[default=no]]]), + , enable_fusionsound=no) + if test x$enable_audio = xyes -a x$enable_fusionsound = xyes; then + fusionsound=no + FUSIONSOUND_REQUIRED_VERSION=1.1.1 -dnl Find the AAlib includes -CheckAAlib() -{ - AC_ARG_ENABLE(video-aalib, -AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [[default=no]]]), - , enable_video_aalib=no) - if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then - AC_MSG_CHECKING(for AAlib support) - video_aalib=no - AC_TRY_COMPILE([ - #include - ],[ - ],[ - video_aalib=yes - ]) - AC_MSG_RESULT($video_aalib) - if test x$video_aalib = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_AALIB) - SOURCES="$SOURCES $srcdir/src/video/aalib/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa" - have_video=yes - fi - fi -} - -dnl Find the libcaca includes -CheckCaca() -{ - AC_ARG_ENABLE(video-caca, -AC_HELP_STRING([--enable-video-caca], [use libcaca video driver [[default=no]]]), - , enable_video_caca=no) - if test x$enable_video = xyes -a x$enable_video_caca = xyes; then - video_caca=no - AC_PATH_PROG(CACACONFIG, caca-config, no) - if test x$CACACONFIG != xno; then - AC_MSG_CHECKING(for libcaca support) - CACA_CFLAGS=`$CACACONFIG --cflags` - CACA_LDFLAGS=`$CACACONFIG --libs` - save_CFLAGS="$CFLAGS" - AC_TRY_COMPILE([ - #include - ],[ - ],[ - video_caca=yes - ]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT($video_caca) - if test x$video_caca = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_CACA) - EXTRA_CFLAGS="$EXTRA_CFLAGS $CACA_CFLAGS" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LDFLAGS" - SOURCES="$SOURCES $srcdir/src/video/caca/*.c" + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + AC_MSG_CHECKING(for FusionSound $FUSIONSOUND_REQUIRED_VERSION support) + if test x$PKG_CONFIG != xno; then + if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $FUSIONSOUND_REQUIRED_VERSION fusionsound; then + FUSIONSOUND_CFLAGS=`$PKG_CONFIG --cflags fusionsound` + FUSIONSOUND_LIBS=`$PKG_CONFIG --libs fusionsound` + fusionsound=yes fi fi - fi -} + AC_MSG_RESULT($fusionsound) -dnl Set up the QTopia video driver if enabled -CheckQtopia() -{ - AC_ARG_ENABLE(video-qtopia, -AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]), - , enable_video_qtopia=no) - if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then - AC_MSG_CHECKING(for Qtopia support) - video_qtopia=no - QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions" - AC_LANG_CPLUSPLUS - OLD_CXX="$CXXFLAGS" - CXXFLAGS="$QTOPIA_FLAGS" - AC_TRY_COMPILE([ - #include - ],[ - ],[ - video_qtopia=yes - ]) - CXXFLAGS="$OLD_CXX" - AC_MSG_RESULT($video_qtopia) - if test x$video_qtopia = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA) - SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc" - SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc" - SDLMAIN_LDFLAGS="-static" - EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS" - SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main" - SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte" - have_video=yes - fi - AC_LANG_C - fi -} - -dnl Set up the PicoGUI video driver if enabled -CheckPicoGUI() -{ - AC_ARG_ENABLE(video-picogui, -AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]), - , enable_video_picogui=no) - if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then - AC_MSG_CHECKING(for PicoGUI support) - video_picogui=no - AC_TRY_COMPILE([ - #include - ],[ - ],[ - video_picogui=yes - ]) - AC_MSG_RESULT($video_picogui) - if test x$video_picogui = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI) - SOURCES="$SOURCES $srcdir/src/video/picogui/*.c" - SDL_LIBS="$SDL_LIBS -lpgui" - have_video=yes - fi - fi -} - -dnl Set up the Atari Bios keyboard driver -CheckAtariBiosEvent() -{ - SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c" - SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S" -} - -dnl Set up the Atari Xbios driver -CheckAtariXbiosVideo() -{ - AC_ARG_ENABLE(xbios, -AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]), - , enable_video_xbios=yes) - video_xbios=no - if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then - video_xbios=yes - AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS) - SOURCES="$SOURCES $srcdir/src/video/xbios/*.c" - have_video=yes - fi -} - -dnl Set up the Atari Gem driver -CheckAtariGemVideo() -{ - AC_ARG_ENABLE(gem, -AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]), - , enable_video_gem=yes) - if test x$enable_video = xyes -a x$enable_video_gem = xyes; then - video_gem=no - AC_CHECK_HEADER(gem.h, have_gem_hdr=yes) - AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes) - if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then - video_gem=yes - AC_DEFINE(SDL_VIDEO_DRIVER_GEM) - SOURCES="$SOURCES $srcdir/src/video/gem/*.c" - SDL_LIBS="$SDL_LIBS -lgem" - have_video=yes + if test x$fusionsound = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_FUSIONSOUND, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/fusionsound/*.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS $FUSIONSOUND_CFLAGS" + + AC_ARG_ENABLE(fusionsound-shared, +AC_HELP_STRING([--enable-fusionsound-shared], [dynamically load fusionsound audio support [[default=yes]]]), + , enable_fusionsound_shared=yes) + fusionsound_shared=no + AC_MSG_CHECKING(for FusionSound dynamic loading support) + if test x$have_loadso != xyes && \ + test x$enable_fusionsound_shared = xyes; then + AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic fusionsound loading]) + fi + if test x$have_loadso = xyes && \ + test x$enable_fusionsound_shared = xyes; then + AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC, "libfusionsound.so", [ ]) + fusionsound_shared=yes + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $FUSIONSOUND_LIBS" + fi + AC_MSG_RESULT($fusionsound_shared) + + have_audio=yes fi fi } @@ -1640,7 +1639,7 @@ CheckDummyVideo() AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]), , enable_video_dummy=yes) if test x$enable_video_dummy = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY) + AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY, 1, [ ]) SOURCES="$SOURCES $srcdir/src/video/dummy/*.c" have_video=yes fi @@ -1648,7 +1647,7 @@ AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]) dnl Check to see if OpenGL support is desired AC_ARG_ENABLE(video-opengl, -AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [[default=yes]]]), +AC_HELP_STRING([--enable-video-opengl], [include OpenGL support [[default=yes]]]), , enable_video_opengl=yes) dnl Find OpenGL @@ -1660,45 +1659,77 @@ CheckOpenGLX11() AC_TRY_COMPILE([ #include #include - #include ],[ ],[ video_opengl=yes ]) AC_MSG_RESULT($video_opengl) if test x$video_opengl = xyes; then - AC_DEFINE(SDL_VIDEO_OPENGL) - AC_DEFINE(SDL_VIDEO_OPENGL_GLX) + AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ]) + AC_DEFINE(SDL_VIDEO_OPENGL_GLX, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ]) fi fi } -dnl Find QNX RtP OpenGL -CheckOpenGLQNX() +dnl Check to see if OpenGL ES support is desired +AC_ARG_ENABLE(video-opengles, +AC_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [[default=yes]]]), + , enable_video_opengles=yes) + +dnl Find OpenGL ES +CheckOpenGLESX11() { - if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then - AC_MSG_CHECKING(for OpenGL (Photon) support) - video_opengl=no + if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then + AC_MSG_CHECKING(for OpenGL ES (EGL) support) + video_opengles=no AC_TRY_COMPILE([ - #include + #include ],[ ],[ - video_opengl=yes + video_opengles=yes ]) - AC_MSG_RESULT($video_opengl) - if test x$video_opengl = xyes; then - AC_DEFINE(SDL_VIDEO_OPENGL) - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL" + AC_MSG_RESULT($video_opengles) + if test x$video_opengles = xyes; then + AC_MSG_CHECKING(for OpenGL ES v1 headers) + video_opengles_v1=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + video_opengles_v1=yes + ]) + AC_MSG_RESULT($video_opengles_v1) + if test x$video_opengles_v1 = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ]) + fi + AC_MSG_CHECKING(for OpenGL ES v2 headers) + video_opengles_v2=no + AC_TRY_COMPILE([ + #include + #include + ],[ + ],[ + video_opengles_v2=yes + ]) + AC_MSG_RESULT($video_opengles_v2) + if test x$video_opengles_v2 = xyes; then + AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ]) + fi fi fi } -dnl Check for Win32 OpenGL -CheckWIN32GL() +dnl Check for Windows OpenGL +CheckWINDOWSGL() { if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then - AC_DEFINE(SDL_VIDEO_OPENGL) - AC_DEFINE(SDL_VIDEO_OPENGL_WGL) + AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ]) + AC_DEFINE(SDL_VIDEO_OPENGL_WGL, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ]) fi } @@ -1706,7 +1737,9 @@ dnl Check for BeOS OpenGL CheckBeGL() { if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then - AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ]) + AC_DEFINE(SDL_VIDEO_OPENGL_BGL, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ]) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL" fi } @@ -1715,70 +1748,22 @@ dnl Check for MacOS OpenGL CheckMacGL() { if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then - AC_DEFINE(SDL_VIDEO_OPENGL) + AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ]) + AC_DEFINE(SDL_VIDEO_OPENGL_CGL, 1, [ ]) + AC_DEFINE(SDL_VIDEO_RENDER_OGL, 1, [ ]) case "$host" in *-*-darwin*) if test x$enable_video_cocoa = xyes; then EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL" fi - if test x$enable_video_carbon = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL" - fi esac fi } -dnl Check for Mesa offscreen rendering -CheckAtariOSMesa() -{ - if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then - AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes) - AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm) - - # Static linking to -lOSMesa - AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no) - if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then - # -lOSMesa is really the static library - if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then - OSMESA_LIBS="-lOSMesa" - fi - else - # -lOSMesa is a loader for OSMesa.ldg - OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags` - OSMESA_LIBS=`$OSMESA_CONFIG --libs` - fi - AC_DEFINE(SDL_VIDEO_OPENGL) - AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA) - SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS" - SDL_LIBS="$SDL_LIBS $OSMESA_LIBS" - - AC_ARG_ENABLE(osmesa-shared, -AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]), - , enable_osmesa_shared=yes) - if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then - # Dynamic linking - if test "x$have_osmesa_hdr" = "xyes"; then - AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC) - fi - fi - fi -} - -AC_ARG_ENABLE(screensaver, -AC_HELP_STRING([--enable-screensaver], [enable screensaver by default while any SDL application is running [[default=no]]]), - , enable_screensaver=no) -if test x$enable_screensaver = xno; then - AC_DEFINE(SDL_VIDEO_DISABLE_SCREENSAVER) -fi - dnl See if we can use the new unified event interface in Linux 2.4 CheckInputEvents() { dnl Check for Linux 2.4 unified input event interface support - AC_ARG_ENABLE(input-events, -AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]), - , enable_input_events=yes) - if test x$enable_input_events = xyes; then AC_MSG_CHECKING(for Linux 2.4 unified input interface) use_input_events=no AC_TRY_COMPILE([ @@ -1792,7 +1777,46 @@ AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [ ]) AC_MSG_RESULT($use_input_events) if test x$use_input_events = xyes; then - AC_DEFINE(SDL_INPUT_LINUXEV) + AC_DEFINE(SDL_INPUT_LINUXEV, 1, [ ]) + fi +} + +dnl See if the platform offers libudev for device enumeration and hotplugging. +CheckLibUDev() +{ + AC_ARG_ENABLE(libudev, +AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]), + , enable_libudev=yes) + if test x$enable_libudev = xyes; then + AC_CHECK_HEADER(libudev.h, + have_libudev_h_hdr=yes, + have_libudev_h_hdr=no) + if test x$have_libudev_h_hdr = xyes; then + AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ]) + fi + fi +} + +dnl See if the platform offers libdbus for various IPC techniques. +CheckDBus() +{ + AC_ARG_ENABLE(dbus, +AC_HELP_STRING([--enable-dbus], [enable D-Bus support [[default=yes]]]), + , enable_dbus=yes) + if test x$enable_dbus = xyes; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + if test x$PKG_CONFIG != xno; then + DBUS_CFLAGS=`$PKG_CONFIG --cflags dbus-1` + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS $DBUS_CFLAGS" + AC_CHECK_HEADER(dbus/dbus.h, + have_dbus_dbus_h_hdr=yes, + have_dbus_dbus_h_hdr=no) + CFLAGS="$save_CFLAGS" + if test x$have_dbus_dbus_h_hdr = xyes; then + AC_DEFINE(HAVE_DBUS_DBUS_H, 1, [ ]) + EXTRA_CFLAGS="$EXTRA_CFLAGS $DBUS_CFLAGS" + fi fi fi } @@ -1814,39 +1838,12 @@ AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[ ]) AC_MSG_RESULT($enable_input_tslib) if test x$enable_input_tslib = xyes; then - AC_DEFINE(SDL_INPUT_TSLIB) + AC_DEFINE(SDL_INPUT_TSLIB, 1, [ ]) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts" fi fi } -dnl See if we can use GNU pth library for threads -CheckPTH() -{ - dnl Check for pth support - AC_ARG_ENABLE(pth, -AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]), - , enable_pth=yes) - if test x$enable_threads = xyes -a x$enable_pth = xyes; then - AC_PATH_PROG(PTH_CONFIG, pth-config, no) - if test "$PTH_CONFIG" = "no"; then - use_pth=no - else - use_pth=yes - fi - AC_MSG_CHECKING(pth) - AC_MSG_RESULT($use_pth) - if test "x$use_pth" = xyes; then - AC_DEFINE(SDL_THREAD_PTH) - SOURCES="$SOURCES $srcdir/src/thread/pth/*.c" - SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c" - SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`" - SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`" - have_threads=yes - fi - fi -} - dnl See what type of thread model to use on Linux and Solaris CheckPTHREAD() { @@ -1884,18 +1881,25 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) pthread_cflags="-D_REENTRANT" pthread_lib="-pthread" ;; + *-*-solaris2.9) + # From Solaris 9+, posix4's preferred name is rt. + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread -lrt" + ;; + *-*-solaris2.10) + # Solaris 10+ merged pthread into libc. + pthread_cflags="-D_REENTRANT" + pthread_lib="-lrt" + ;; *-*-solaris*) + # Solaris 11+ merged rt into libc. pthread_cflags="-D_REENTRANT" - pthread_lib="-lpthread -lposix4" + pthread_lib="" ;; *-*-sysv5*) pthread_cflags="-D_REENTRANT -Kthread" pthread_lib="" ;; - *-*-irix*) - pthread_cflags="-D_SGI_MP_SOURCE" - pthread_lib="-lpthread" - ;; *-*-aix*) pthread_cflags="-D_REENTRANT -mthreads" pthread_lib="-lpthread" @@ -1904,24 +1908,12 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) pthread_cflags="-D_REENTRANT" pthread_lib="-L/usr/lib -lpthread" ;; - *-*-qnx*) - pthread_cflags="" - pthread_lib="" - ;; - *-*-osf*) - pthread_cflags="-D_REENTRANT" - if test x$ac_cv_prog_gcc = xyes; then - pthread_lib="-lpthread -lrt" - else - pthread_lib="-lpthread -lexc -lrt" - fi - ;; *) pthread_cflags="-D_REENTRANT" pthread_lib="-lpthread" ;; esac - if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then + if test x$enable_threads = xyes -a x$enable_pthreads = xyes; then # Save the original compiler flags and libraries ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" # Add the pthread compiler flags and libraries @@ -1943,7 +1935,7 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) # Do futher testing if we have pthread support... if test x$use_pthreads = xyes; then - AC_DEFINE(SDL_THREAD_PTHREAD) + AC_DEFINE(SDL_THREAD_PTHREAD, 1, [ ]) EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags" EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib" SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags" @@ -1965,7 +1957,7 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); ],[ has_recursive_mutexes=yes - AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX) + AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX, 1, [ ]) ]) fi if test x$has_recursive_mutexes = xno; then @@ -1976,7 +1968,7 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); ],[ has_recursive_mutexes=yes - AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP) + AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP, 1, [ ]) ]) fi AC_MSG_RESULT($has_recursive_mutexes) @@ -2009,6 +2001,39 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) AC_MSG_RESULT($have_sem_timedwait) fi + AC_MSG_CHECKING(for pthread_spin_trylock) + AC_TRY_LINK_FUNC(pthread_spin_trylock, [ + has_pthread_spin_trylock=yes + AC_DEFINE(HAVE_PTHREAD_SPINLOCK, 1, [ ]) + ],[ + has_pthread_spin_trylock=no + ]) + AC_MSG_RESULT($has_pthread_spin_trylock) + + AC_CHECK_HEADER(pthread_np.h, have_pthread_np_h=yes, have_pthread_np_h=no, [ #include ]) + if test x$have_pthread_np_h = xyes; then + AC_DEFINE(HAVE_PTHREAD_NP_H, 1, [ ]) + fi + + # Check to see if pthread naming is available + AC_MSG_CHECKING(for pthread_setname_np) + AC_TRY_LINK_FUNC(pthread_setname_np, [ + has_pthread_setname_np=yes + AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [ ]) + ],[ + has_pthread_setname_np=no + ]) + AC_MSG_RESULT($has_pthread_setname_np) + + AC_MSG_CHECKING(for pthread_set_name_np) + AC_TRY_LINK_FUNC(pthread_set_name_np, [ + has_pthread_set_name_np=yes + AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP, 1, [ ]) + ],[ + has_pthread_set_name_np=no + ]) + AC_MSG_RESULT($has_pthread_set_name_np) + # Restore the compiler flags and libraries CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs" @@ -2031,17 +2056,18 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) # We can fake these with semaphores and mutexes if necessary SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c" + # Thread local storage + SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systls.c" + have_threads=yes - else - CheckPTH fi fi } -dnl Determine whether the compiler can produce Win32 executables -CheckWIN32() +dnl Determine whether the compiler can produce Windows executables +CheckWINDOWS() { - AC_MSG_CHECKING(Win32 compiler) + AC_MSG_CHECKING(Windows compiler) have_win32_gcc=no AC_TRY_COMPILE([ #include @@ -2052,45 +2078,49 @@ CheckWIN32() AC_MSG_RESULT($have_win32_gcc) if test x$have_win32_gcc != xyes; then AC_MSG_ERROR([ -*** Your compiler ($CC) does not produce Win32 executables! +*** Your compiler ($CC) does not produce Windows executables! ]) fi - dnl See if the user wants to redirect standard output to files - AC_ARG_ENABLE(stdio-redirect, -AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]), - , enable_stdio_redirect=yes) - if test x$enable_stdio_redirect != xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT" - fi + AC_MSG_CHECKING(Windows CE) + have_wince=no + AC_TRY_COMPILE([ +#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__) +#error This is not Windows CE +#endif + ],[ + ],[ + have_wince=yes + AC_MSG_ERROR([ +*** Sorry, Windows CE is no longer supported. + ]) + ]) + AC_MSG_RESULT($have_wince) - if test x$enable_video = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB) - SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c" - SOURCES="$SOURCES $srcdir/src/video/windib/*.c" - have_video=yes - fi + # This fixes Windows stack alignment with newer GCC + CheckStackBoundary } dnl Find the DirectX includes and libraries CheckDIRECTX() { AC_ARG_ENABLE(directx, -AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]), +AC_HELP_STRING([--enable-directx], [use DirectX for Windows audio/video [[default=yes]]]), , enable_directx=yes) if test x$enable_directx = xyes; then - have_directx=no + AC_CHECK_HEADER(d3d9.h, have_d3d=yes) AC_CHECK_HEADER(ddraw.h, have_ddraw=yes) AC_CHECK_HEADER(dsound.h, have_dsound=yes) - AC_CHECK_HEADER(dinput.h, use_dinput=yes) - if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then - have_directx=yes - fi - if test x$enable_video = xyes -a x$have_directx = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW) - SOURCES="$SOURCES $srcdir/src/video/windx5/*.c" - have_video=yes - fi + AC_CHECK_HEADER(dinput.h, have_dinput=yes) + AC_CHECK_HEADER(xaudio2.h, have_xaudio2=yes) + + # FIXME: latest Cygwin finds dinput headers, but we die on other win32 headers. + # FIXME: ...so force it off for now. + case "$host" in + *-*-cygwin*) + have_dinput=false + ;; + esac fi } @@ -2106,9 +2136,8 @@ AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[de AC_TRY_COMPILE([ #include ],[ - #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED <= 1020 - #error Use dlcompat for Mac OS X 10.2 compatibility - #endif + void *handle = dlopen("", RTLD_NOW); + const char *loaderror = (char *) dlerror(); ],[ have_dlopen=yes ]) @@ -2118,31 +2147,13 @@ AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[de AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS", AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl", AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl"))) - AC_DEFINE(SDL_LOADSO_DLOPEN) + AC_DEFINE(SDL_LOADSO_DLOPEN, 1, [ ]) SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c" have_loadso=yes fi fi } -dnl Set up the Atari LDG (shared object loader) -CheckAtariLdg() -{ - AC_ARG_ENABLE(atari-ldg, -AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]), - , enable_atari_ldg=yes) - if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then - AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes) - AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem) - if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then - AC_DEFINE(SDL_LOADSO_LDG) - SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c" - SDL_LIBS="$SDL_LIBS -lldg -lgem" - have_loadso=yes - fi - fi -} - dnl Check for the usbhid(3) library on *BSD CheckUSBHID() { @@ -2266,11 +2277,11 @@ CheckUSBHID() have_machine_joystick=yes ]) if test x$have_machine_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H) + AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H, 1, [ ]) fi AC_MSG_RESULT($have_machine_joystick) - AC_DEFINE(SDL_JOYSTICK_USBHID) + AC_DEFINE(SDL_JOYSTICK_USBHID, 1, [ ]) SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c" EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS" EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS" @@ -2284,13 +2295,19 @@ dnl Check for clock_gettime() CheckClockGettime() { AC_ARG_ENABLE(clock_gettime, -AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=no]]]), - , enable_clock_gettime=no) +AC_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [[default=yes]]]), + , enable_clock_gettime=yes) if test x$enable_clock_gettime = xyes; then AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes) if test x$have_clock_gettime = xyes; then - AC_DEFINE(HAVE_CLOCK_GETTIME) + AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ]) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt" + else + AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes) + if test x$have_clock_gettime = xyes; then + AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ]) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS" + fi fi fi } @@ -2314,18 +2331,7 @@ AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]] dnl Set up the configuration based on the host platform! case "$host" in - arm-*-elf*) # FIXME: Can we get more specific for iPodLinux? - ARCH=linux - CheckDummyVideo - CheckIPod - # Set up files for the timer library - if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_UNIX) - SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" - have_timers=yes - fi - ;; - *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*) + *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-aix*|*-*-minix*) case "$host" in *-*-linux*) ARCH=linux ;; *-*-uclinux*) ARCH=linux ;; @@ -2341,40 +2347,28 @@ case "$host" in *-*-sysv5*) ARCH=sysv5 ;; *-*-solaris*) ARCH=solaris ;; *-*-hpux*) ARCH=hpux ;; - *-*-irix*) ARCH=irix ;; *-*-aix*) ARCH=aix ;; - *-*-osf*) ARCH=osf ;; + *-*-minix*) ARCH=minix ;; esac CheckVisibilityHidden CheckDummyVideo CheckDiskAudio CheckDummyAudio CheckDLOPEN - CheckNASM - CheckAltivec CheckOSS - CheckDMEDIA - CheckMME CheckALSA + CheckPulseAudio CheckARTSC CheckESD - CheckPulseAudio CheckNAS + CheckSNDIO CheckX11 - CheckNANOX - CheckFBCON CheckDirectFB - CheckPS2GS - CheckPS3 - CheckGGI - CheckSVGA - CheckVGL - CheckWscons - CheckAAlib - CheckCaca - CheckQtopia - CheckPicoGUI + CheckFusionSound CheckOpenGLX11 + CheckOpenGLESX11 + CheckLibUDev + CheckDBus CheckInputEvents CheckTslib CheckUSBHID @@ -2386,17 +2380,17 @@ case "$host" in if test x$enable_audio = xyes; then case $ARCH in sysv5|solaris|hpux) - AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO) + AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" have_audio=yes ;; - netbsd|openbsd) - AC_DEFINE(SDL_AUDIO_DRIVER_BSD) + netbsd) # Don't use this on OpenBSD, it's busted. + AC_DEFINE(SDL_AUDIO_DRIVER_BSD, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c" have_audio=yes ;; aix) - AC_DEFINE(SDL_AUDIO_DRIVER_PAUD) + AC_DEFINE(SDL_AUDIO_DRIVER_PAUDIO, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c" have_audio=yes ;; @@ -2406,90 +2400,37 @@ case "$host" in if test x$enable_joystick = xyes; then case $ARCH in linux) - AC_DEFINE(SDL_JOYSTICK_LINUX) + AC_DEFINE(SDL_JOYSTICK_LINUX, 1, [ ]) SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c" have_joystick=yes ;; esac fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - case $ARCH in - linux|solaris) - AC_DEFINE(SDL_CDROM_LINUX) - SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c" - have_cdrom=yes - ;; - *freebsd*) - AC_DEFINE(SDL_CDROM_FREEBSD) - SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c" - have_cdrom=yes - ;; - *openbsd*|*netbsd*) - AC_DEFINE(SDL_CDROM_OPENBSD) - SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c" - have_cdrom=yes - ;; - bsdi) - AC_DEFINE(SDL_CDROM_BSDI) - SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c" - have_cdrom=yes - ;; - aix) - AC_DEFINE(SDL_CDROM_AIX) - SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c" - have_cdrom=yes - ;; - osf) - AC_DEFINE(SDL_CDROM_OSF) - SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c" - have_cdrom=yes - ;; - esac - fi - # Set up files for the thread library - if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then - AC_DEFINE(SDL_THREAD_SPROC) - SOURCES="$SOURCES $srcdir/src/thread/irix/*.c" - SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" - SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" - have_threads=yes - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_UNIX) - SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" - have_timers=yes - fi - ;; - *-*-qnx*) - ARCH=qnx - CheckDummyVideo - CheckDiskAudio - CheckDummyAudio - # CheckNASM - CheckDLOPEN - CheckNAS - CheckPHOTON - CheckX11 - CheckOpenGLX11 - CheckPTHREAD - # Set up files for the audio library - if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO) - SOURCES="$SOURCES $srcdir/src/audio/nto/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound" - have_audio=yes - fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - AC_DEFINE(SDL_CDROM_QNX) - SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c" - have_cdrom=yes + # Set up files for the haptic library + if test x$enable_haptic = xyes; then + if test x$use_input_events = xyes; then + case $ARCH in + linux) + AC_DEFINE(SDL_HAPTIC_LINUX, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/haptic/linux/*.c" + have_haptic=yes + ;; + esac + fi + fi + # Set up files for the power library + if test x$enable_power = xyes; then + case $ARCH in + linux) + AC_DEFINE(SDL_POWER_LINUX, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/power/linux/*.c" + have_power=yes + ;; + esac fi # Set up files for the timer library if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_UNIX) + AC_DEFINE(SDL_TIMER_UNIX, 1, [ ]) SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" have_timers=yes fi @@ -2498,7 +2439,7 @@ case "$host" in ARCH=win32 if test "$build" != "$host"; then # cross-compiling # Default cross-compile location - ac_default_prefix=/usr/local/cross-tools/i386-mingw32 + ac_default_prefix=/usr/local/cross-tools/$host else # Look for the location of the tools and install there if test "$BUILD_PREFIX" != ""; then @@ -2508,139 +2449,122 @@ case "$host" in CheckDummyVideo CheckDiskAudio CheckDummyAudio - CheckWIN32 - CheckWIN32GL + CheckWINDOWS + CheckWINDOWSGL CheckDIRECTX - CheckNASM + + # Set up the core platform files + SOURCES="$SOURCES $srcdir/src/core/windows/*.c" + + # Set up files for the video library + if test x$enable_video = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/video/windows/*.c" + have_video=yes + AC_ARG_ENABLE(render-d3d, +AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]), + , enable_render_d3d=yes) + if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then + AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ]) + fi + fi # Set up files for the audio library if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT) - SOURCES="$SOURCES $srcdir/src/audio/windib/*.c" - if test x$have_directx = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND) - SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c" + AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c" + if test x$have_dsound = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c" + fi + if test x$have_xaudio2 = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c" fi have_audio=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_WINMM) - SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c" + if test x$have_dinput = xyes; then + AC_DEFINE(SDL_JOYSTICK_DINPUT, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_dxjoystick.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8" + else + AC_DEFINE(SDL_JOYSTICK_WINMM, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/joystick/windows/SDL_mmjoystick.c" + fi have_joystick=yes fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - AC_DEFINE(SDL_CDROM_WIN32) - SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c" - have_cdrom=yes + if test x$enable_haptic = xyes; then + if test x$have_dinput = xyes; then + AC_DEFINE(SDL_HAPTIC_DINPUT, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/haptic/windows/SDL_syshaptic.c" + have_haptic=yes + fi + fi + if test x$enable_power = xyes; then + AC_DEFINE(SDL_POWER_WINDOWS, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/power/windows/SDL_syspower.c" + have_power=yes fi # Set up files for the thread library if test x$enable_threads = xyes; then - AC_DEFINE(SDL_THREAD_WIN32) - SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c" - SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c" - SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c" + AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/thread/windows/*.c" SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" have_threads=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_WIN32) - SOURCES="$SOURCES $srcdir/src/timer/win32/*.c" + AC_DEFINE(SDL_TIMER_WINDOWS, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/timer/windows/*.c" have_timers=yes fi # Set up files for the shared object loading library if test x$enable_loadso = xyes; then - AC_DEFINE(SDL_LOADSO_WIN32) - SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c" + AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c" have_loadso=yes fi # Set up the system libraries we need - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm" - if test x$have_directx = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid" - fi - # The Win32 platform requires special setup - SOURCES="$SOURCES $srcdir/src/main/win32/*.rc" - SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c" - SDLMAIN_LDFLAGS="-static" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -XCClinker -static-libgcc" + # The Windows platform requires special setup + VERSION_SOURCES="$srcdir/src/main/windows/*.rc" + SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c" SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" - SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows" - ;; - *-wince*) - ARCH=win32 - CheckDummyVideo - CheckDiskAudio - CheckDummyAudio - CheckWIN32 - CheckNASM - SOURCES="$SOURCES $srcdir/src/video/gapi/*.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -D_WIN32_WCE=0x420" - if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT) - SOURCES="$SOURCES $srcdir/src/audio/windib/*.c" - have_audio=yes - fi - # Set up files for the thread library - if test x$enable_threads = xyes; then - AC_DEFINE(SDL_THREAD_WIN32) - SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c" - SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c" - SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c" - SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" - have_threads=yes - fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_WINCE) - SOURCES="$SOURCES $srcdir/src/timer/wince/*.c" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lmmtimer" - have_timers=yes - fi - # Set up files for the shared object loading library - if test x$enable_loadso = xyes; then - AC_DEFINE(SDL_LOADSO_WIN32) - SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c" - have_loadso=yes + SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows" + + # Check to see if this is a mingw or cygwin build + have_mingw32= + AC_CHECK_LIB(mingw32, main, [have_mingw32=yes]) + if test x$have_mingw32 = xyes; then + SDL_LIBS="-lmingw32 $SDL_LIBS" + else + SDL_LIBS="-lcygwin $SDL_LIBS" fi - # Set up the system libraries we need - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl" - # The Win32 platform requires special setup - SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c" - SDLMAIN_LDFLAGS="-static" - SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420" - SDL_LIBS="-lSDLmain $SDL_LIBS" ;; *-*-beos* | *-*-haiku*) ARCH=beos - ac_default_prefix=/boot/develop/tools/gnupro + ac_default_prefix=/boot/common CheckDummyVideo CheckDiskAudio CheckDummyAudio - CheckNASM CheckBWINDOW CheckBeGL # Set up files for the audio library if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO) + AC_DEFINE(SDL_AUDIO_DRIVER_BEOSAUDIO, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc" have_audio=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_BEOS) + AC_DEFINE(SDL_JOYSTICK_BEOS, 1, [ ]) SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc" have_joystick=yes fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - AC_DEFINE(SDL_CDROM_BEOS) - SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc" - have_cdrom=yes - fi # Set up files for the thread library if test x$enable_threads = xyes; then - AC_DEFINE(SDL_THREAD_BEOS) + AC_DEFINE(SDL_THREAD_BEOS, 1, [ ]) SOURCES="$SOURCES $srcdir/src/thread/beos/*.c" SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c" SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c" @@ -2648,188 +2572,154 @@ case "$host" in fi # Set up files for the timer library if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_BEOS) + AC_DEFINE(SDL_TIMER_BEOS, 1, [ ]) SOURCES="$SOURCES $srcdir/src/timer/beos/*.c" have_timers=yes fi # Set up files for the shared object loading library if test x$enable_loadso = xyes; then - case "$host" in - *-*-beos*) - AC_DEFINE(SDL_LOADSO_BEOS) - SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c" - ;; - *-*-haiku*) - AC_DEFINE(SDL_LOADSO_DLOPEN) - SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c" - ;; - esac + AC_DEFINE(SDL_LOADSO_BEOS, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c" have_loadso=yes fi + # Set up files for the system power library + if test x$enable_power = xyes; then + AC_DEFINE(SDL_POWER_BEOS, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/power/beos/*.c" + have_power=yes + fi # The BeOS platform requires special setup. SOURCES="$srcdir/src/main/beos/*.cc $SOURCES" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding" ;; - *-*-darwin* ) - # This could be either full "Mac OS X", or plain "Darwin" which is - # just the OS X kernel sans upper layers like Carbon and Cocoa. - # Next line is broken, and a few files below require Mac OS X (full) - ARCH=macosx - - # Mac OS X builds with both the Carbon and OSX APIs at the moment - EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX" - - # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point - # is -lm which is not needed under Mac OS X. But for some reasons it - # also tends to contain spurious -L switches, which we don't want to - # use here or in sdl-config. Hence we reset it. - EXTRA_LDFLAGS="" + arm*-apple-darwin*) + # iOS - We are not writing anything to confdefs.h because you have to replace + # SDL_config.h for SDL_config_iphoneos.h anyway + ARCH=ios CheckVisibilityHidden CheckDummyVideo CheckDiskAudio CheckDummyAudio CheckDLOPEN - CheckNASM - - # Set up files for the shared object loading library - # (this needs to be done before the dynamic X11 check) - if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then - AC_DEFINE(SDL_LOADSO_DLCOMPAT) - SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c" - have_loadso=yes - fi - CheckCOCOA - CheckCARBON - CheckX11 - CheckMacGL - CheckOpenGLX11 CheckPTHREAD - CheckAltivec - # Need this or things might misbuild on a G3. - EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL" # Set up files for the audio library if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO) - SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c" + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" have_audio=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_IOKIT) - SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c" + SOURCES="$SOURCES $srcdir/src/joystick/iphoneos/*.m" have_joystick=yes - need_iokit_framework=yes fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - AC_DEFINE(SDL_CDROM_MACOSX) - SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c" - have_cdrom=yes + # Set up files for the haptic library + #if test x$enable_haptic = xyes; then + # SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" + # have_haptic=yes + # EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + #fi + # Set up files for the power library + if test x$enable_power = xyes; then + SOURCES="$SOURCES $srcdir/src/power/uikit/*.m" + have_power=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_UNIX) SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" have_timers=yes fi - # The Mac OS X platform requires special setup. - SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m" - SDLMAIN_LDFLAGS="-static" - EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" - SDL_LIBS="-lSDLmain $SDL_LIBS" - if test x$enable_video_cocoa = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" - need_iokit_framework=yes - fi - if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then - # The Cocoa backend still needs Carbon - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ApplicationServices" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" - fi - # If either the audio or CD driver is used, add the AudioUnit framework - if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" - fi - # Some subsystems reference IOKit... - if test x$need_iokit_framework = xyes; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" + # Set up additional files for the file library + if test x$enable_file = xyes; then + SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m" fi + # The iOS platform requires special setup. + SOURCES="$SOURCES $srcdir/src/video/uikit/*.m" + EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm -liconv -lobjc" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Foundation" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,UIKit" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGLES" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,QuartzCore" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreGraphics" ;; - *-*-mint*) - ARCH=mint + *-*-darwin* ) + # This could be either full "Mac OS X", or plain "Darwin" which is + # just the OS X kernel sans upper layers like Carbon and Cocoa. + # Next line is broken, and a few files below require Mac OS X (full) + ARCH=macosx + + # Mac OS X builds with both the Carbon and OSX APIs at the moment + EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON" + EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX" + + CheckVisibilityHidden CheckDummyVideo CheckDiskAudio CheckDummyAudio - CheckAtariBiosEvent - CheckAtariXbiosVideo - CheckAtariGemVideo - CheckAtariAudio - CheckAtariLdg - CheckAtariOSMesa - CheckPTH + CheckDLOPEN + CheckCOCOA + CheckX11 + CheckMacGL + CheckOpenGLX11 + CheckPTHREAD + + # Good optimization on Mac OS X, yes... + EXTRA_CFLAGS="$EXTRA_CFLAGS -falign-loops=16" + + # Need this or things might misbuild on a G3. + EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL" + # Set up files for the audio library - if test x$enable_threads = xyes -a x$enable_pth = xyes; then - if test x$enable_audio = xyes; then - AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO) - SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" - have_audio=yes - fi + if test x$enable_audio = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/coreaudio/*.c" + have_audio=yes fi # Set up files for the joystick library if test x$enable_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_MINT) - SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c" + AC_DEFINE(SDL_JOYSTICK_IOKIT, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c" have_joystick=yes fi - # Set up files for the cdrom library - if test x$enable_cdrom = xyes; then - AC_DEFINE(SDL_CDROM_MINT) - SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c" - have_cdrom=yes + # Set up files for the haptic library + if test x$enable_haptic = xyes; then + AC_DEFINE(SDL_HAPTIC_IOKIT, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/haptic/darwin/*.c" + have_haptic=yes + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ForceFeedback" + fi + # Set up files for the power library + if test x$enable_power = xyes; then + AC_DEFINE(SDL_POWER_MACOSX, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/power/macosx/*.c" + have_power=yes fi # Set up files for the timer library if test x$enable_timers = xyes; then - if test x$enable_threads = xyes -a x$enable_pth = xyes; then - AC_DEFINE(SDL_TIMER_UNIX) - SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" - else - AC_DEFINE(SDL_TIMER_MINT) - SOURCES="$SOURCES $srcdir/src/timer/mint/*.c" - SOURCES="$SOURCES $srcdir/src/timer/mint/*.S" - fi + AC_DEFINE(SDL_TIMER_UNIX, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/timer/unix/*.c" have_timers=yes fi - ;; - *-riscos) - ARCH=riscos - CheckOSS - CheckPTHREAD - # Set up files for the video library - if test x$enable_video = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS) - SOURCES="$SOURCES $srcdir/src/video/riscos/*.c" - SOURCES="$SOURCES $srcdir/src/video/riscos/*.S" - have_video=yes - fi - # Set up files for the joystick library - if test x$enable_joystick = xyes; then - AC_DEFINE(SDL_JOYSTICK_RISCOS) - SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c" - have_joystick=yes + # Set up additional files for the file library + if test x$enable_file = xyes; then + SOURCES="$SOURCES $srcdir/src/file/cocoa/*.m" fi - # Set up files for the timer library - if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMER_RISCOS) - SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c" - have_timers=yes + # The Mac OS X platform requires special setup. + EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lobjc" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit" + # If audio is used, add the AudioUnit framework + if test x$enable_audio = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" fi - # The RISC OS platform requires special setup. - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz" ;; *) AC_MSG_ERROR([ @@ -2843,57 +2733,75 @@ CheckWarnAll # Verify that we have all the platform specific files we need -if test x$enable_joystick = xyes; then - if test x$have_joystick != xyes; then - # Wants joystick subsystem, but doesn't have a platform-specific backend... - AC_DEFINE(SDL_JOYSTICK_DUMMY) +if test x$have_joystick != xyes; then + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_DISABLED, 1, [ ]) + fi SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c" - fi fi -if test x$have_cdrom != xyes; then - if test x$enable_cdrom = xyes; then - AC_DEFINE(SDL_CDROM_DISABLED) +if test x$have_haptic != xyes; then + if test x$enable_haptic = xyes; then + AC_DEFINE(SDL_HAPTIC_DISABLED, 1, [ ]) fi - SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c" + SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c" fi if test x$have_threads != xyes; then if test x$enable_threads = xyes; then - AC_DEFINE(SDL_THREADS_DISABLED) + AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ]) fi SOURCES="$SOURCES $srcdir/src/thread/generic/*.c" fi if test x$have_timers != xyes; then if test x$enable_timers = xyes; then - AC_DEFINE(SDL_TIMERS_DISABLED) + AC_DEFINE(SDL_TIMERS_DISABLED, 1, [ ]) fi SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c" fi if test x$have_loadso != xyes; then if test x$enable_loadso = xyes; then - AC_DEFINE(SDL_LOADSO_DISABLED) + AC_DEFINE(SDL_LOADSO_DISABLED, 1, [ ]) fi SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c" fi if test x$SDLMAIN_SOURCES = x; then SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c" - SDLMAIN_LDFLAGS="-static" fi - -OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'` -OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'` -OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'` -OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` -OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'` -OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'` - -SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'` -SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'` -SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` +SDLTEST_SOURCES="$srcdir/src/test/*.c" + +OBJECTS=`echo $SOURCES` +DEPENDS=`echo $SOURCES | tr ' ' '\n'` +for EXT in asm cc m c S; do + OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'` + DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\ +\\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` +done + +VERSION_OBJECTS=`echo $VERSION_SOURCES` +VERSION_DEPENDS=`echo $VERSION_SOURCES` +VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'` +VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\ +\\$(objects)/\\2.o: \\1/\\2.rc\\\\ + \\$(WINDRES) \\$< \\$@,g"` + +SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES` +SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES` +SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'` +SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\ +\\$(objects)/\\2.o: \\1/\\2.c\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` + +SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES` +SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES` +SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'` +SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\ +\\$(objects)/\\2.o: \\1/\\2.c\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` # Set runtime shared library paths as needed if test "x$enable_rpath" = "xyes"; then - if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then + if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = linux -o $ARCH = netbsd; then SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}" fi if test $ARCH = solaris; then @@ -2903,21 +2811,7 @@ else SDL_RLD_FLAGS="" fi -case "$ARCH" in - macosx) - if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then - SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa" - fi - if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then - SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon" - fi - # Evil hack to allow static linking on Mac OS X - SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS" - ;; - *) - SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS" - ;; -esac +SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS" dnl Expand the cflags and libraries needed by apps using SDL AC_SUBST(SDL_CFLAGS) @@ -2946,20 +2840,31 @@ AC_SUBST(ENABLE_STATIC_FALSE) dnl Expand the sources and objects needed to build the library AC_SUBST(ac_aux_dir) AC_SUBST(INCLUDE) -AC_SUBST(SOURCES) AC_SUBST(OBJECTS) -AC_SUBST(SDLMAIN_SOURCES) +AC_SUBST(VERSION_OBJECTS) AC_SUBST(SDLMAIN_OBJECTS) -AC_SUBST(SDLMAIN_LDFLAGS) +AC_SUBST(SDLTEST_OBJECTS) AC_SUBST(BUILD_CFLAGS) AC_SUBST(EXTRA_CFLAGS) AC_SUBST(BUILD_LDFLAGS) AC_SUBST(EXTRA_LDFLAGS) AC_SUBST(WINDRES) -AC_OUTPUT([ - Makefile sdl-config SDL.spec SDL.qpg sdl.pc -], [ - : >build-deps - if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend +cat >Makefile.rules <<__EOF__ + +# Build rules for objects +-include \$(OBJECTS:.lo=.d) + +# Special dependency for SDL.c, since it depends on SDL_revision.h +$srcdir/src/SDL.c: update-revision +$DEPENDS +$VERSION_DEPENDS +$SDLMAIN_DEPENDS +$SDLTEST_DEPENDS +__EOF__ + +AC_CONFIG_FILES([ + Makefile:Makefile.in:Makefile.rules sdl2-config SDL2.spec sdl2.pc ]) +AC_OUTPUT +chmod a+x sdl2-config diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000..1065a8a95b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,66 @@ +libsdl2 (2.0.0) UNRELEASED; urgency=low + + * SDL is now a native debian package. + * Removed udeb package + * Disabled DirectFB support by default, to avoid runtime dependencies + + -- Sam Lantinga Fri, 15 Feb 2013 08:55:04 -0800 + +libsdl2 (2.0.0~20130127-1) UNRELEASED; urgency=low + + * New upstream snapshot. + + -- Sam Hocevar Wed, 30 Jan 2013 23:01:12 +0100 + +libsdl2 (2.0.0~20130103-1) unstable; urgency=low + + [ Manuel A. Fernandez Montecelo ] + * debian/control: + - Updating maintainers/permissions: + - Add myself and Felix Geyer + - Update Build-Depends: + - Remove a few obsolete items + - Add items added lately to libsdl1.2, such as libts (touch screen) + support + - Add "libsdl2-dbg", analog to libsdl1.2-dbg + - Change "XC-Package-Type: udeb" to "Package-Type" + * debian/compat: set level 9 + * debian/source/format: Set to "3.0 (quilt)" + - Remove README.source, not needed with new format + * debian/sdl2-config.1: Fix typo, "progams"->"programs" + * debian/libsdl2-dev.install: + - Remove "usr/lib/*/*.la", discouraged + - Add man pages: "usr/share/man/man3/*" + * debian/libsdl2-dev.manpages: add file to install local "sdl2-config.1" + * debian/sources: Removed, possible obsolete file from long ago? + * debian/copyright: + - Upstream updated to zlib/libpng + - Copyright-file format conversion to 1.0 + - Complete revamp and detailed research about copyright and licenses used, + it's very messy but hopefully complete + + [ Felix Geyer ] + * Simplify debian/rules by using dh(1). + + -- Manuel A. Fernandez Montecelo Sun, 27 Jan 2013 16:40:49 +0100 + +libsdl2 (2.0~20120220c-1) experimental; urgency=low + + * Upstream version was renamed to 2.0 (Closes: #669367). + * New upstream snapshot (Closes: #671506). + * This package no longer conflicts with libsdl-1.2. + * debian/rules: add multiarch support (Closes: #669364). + + * debian/patches/fix_joystick_misc_axes.diff: fix a joystick remapping + bug causing some axes to malfunction. + * debian/patches/external_header_paths.diff: provide additional CFLAGS + so that headers such as SDL_syswm.h can be included (Closes: #669363). + + -- Sam Hocevar Thu, 17 May 2012 19:03:59 +0200 + +libsdl-1.3 (1.3.0~20111204-1) experimental; urgency=low + + * Initial upload from upstream snapshot. + + -- Sam Hocevar Sun, 04 Dec 2011 14:35:05 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000000..ec635144f6 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000..e116e9b34c --- /dev/null +++ b/debian/control @@ -0,0 +1,75 @@ +Source: libsdl2 +Priority: optional +Section: libs +Maintainer: Debian SDL packages maintainers +Uploaders: Barry deFreese , + Sam Hocevar , + Manuel A. Fernandez Montecelo , + Felix Geyer , + Sam Lantinga +Standards-Version: 3.9.3 +Build-Depends: debhelper (>= 9), + dh-autoreconf, + dpkg-dev (>= 1.16.1~), + libasound2-dev [linux-any], + libgl1-mesa-dev, + libpulse-dev, + libudev-dev [linux-any], + libdbus-1-dev [linux-any], + libusb2-dev [kfreebsd-any], + libusbhid-dev [kfreebsd-any], + libx11-dev, + libxcursor-dev, + libxext-dev, + libxi-dev, + libxinerama-dev, + libxrandr-dev, + libxss-dev, + libxt-dev, + libxxf86vm-dev +Homepage: http://www.libsdl.org/ + +Package: libsdl2 +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends}, + libudev0 [linux-any], + libdbus-1-3 [linux-any] +Conflicts: libsdl-1.3-0 +Replaces: libsdl-1.3-0 +Description: Simple DirectMedia Layer + SDL is a library that allows programs portable low level access to + a video framebuffer, audio output, mouse, and keyboard. + . + This package contains the shared library, compiled with X11 graphics drivers and OSS, ALSA and PulseAudio sound drivers. + +Package: libsdl2-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, + libsdl2 (= ${binary:Version}), + libc6-dev, + libgl1-mesa-dev +Conflicts: libsdl-1.3-dev +Replaces: libsdl-1.3-dev +Description: Simple DirectMedia Layer development files + SDL is a library that allows programs portable low level access to a video + framebuffer, audio output, mouse, and keyboard. + . + This package contains files needed if you wish to use the SDL library in your own programs. + +Package: libsdl2-dbg +Priority: extra +Section: debug +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, + libsdl2 (= ${binary:Version}), +Description: Simple DirectMedia Layer debug files + SDL is a library that allows programs portable low level access to a video + framebuffer, audio output, mouse, and keyboard. + . + This package contains the debug symbols for the SDL library. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000..a53d19be09 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,362 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: SDL +Upstream-Contact: Sam Lantinga +Source: http://www.libsdl.org/ + +Files: * +Copyright: 1997-2012 Sam Lantinga +License: zlib/libpng + +Files: src/libm/* +Copyright: 1993 by Sun Microsystems, Inc. All rights reserved. +License: SunPro + +Files: src/main/windows/SDL_windows_main.c +Copyright: 1998 Sam Lantinga +License: PublicDomain_Sam_Lantinga +Comment: SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 + +Files: src/render/mmx.h +Copyright: 1997-99 by H. Dietz and R. Fisher +License: zlib/libpng +Comment: + Copyright but no mention to license. + . + Included since long ago with SDL (and its Debian package) under directory + src/video/mmx.h + +Files: src/render/SDL_yuv_sw.c +Copyright: 1995 Erik Corry + 1995 The Regents of the University of California + 1995 Brown University +License: BrownUn_UnCalifornia_ErikCorry + +Files: src/stdlib/SDL_qsort.c +Copyright: 1998 Gareth McCaughan +License: Gareth_McCaughan + +Files: src/test/SDL_test_md5.c +Copyright: 1997-2012 Sam Lantinga + 1990 RSA Data Security, Inc. +License: zlib/libpng and RSA_Data_Security + +Files: src/thread/windows/win_ce_semaphore.c +Copyright: 1998, Johnson M. Hart (with corrections 2001 by Rainer Loritz) +License: Johnson_M._Hart + +Files: src/video/x11/imKStoUCS.c + src/video/x11/imKStoUCS.h +Copyright: 1994-2003 The XFree86 Project, Inc. +License: MIT/X11 + +Files: test/testhaptic.c +Copyright: 1997-2011 Sam Lantinga + 2008 Edgar Simo Serra +License: BSD_3_clause + +Files: test/testrumble.c +Copyright: 1997-2011 Sam Lantinga + 2011 Edgar Simo Serra +License: BSD_3_clause + +Files: test/shapes/* +Copyright: none +License: zlib/libpng +Comment: No specific information about the images + +Files: Xcode/TemplatesForXcode*/*/main.c +Copyright: none +License: zlib/libpng +Comment: SDL files, no copyright or license notice + +Files: Xcode/TemplatesForXcode*/*/atlantis/* +Copyright: 1993, 1994, Silicon Graphics, Inc. +License: SGI_atlantis + +Files: Xcode/TemplatesForXcode*/*/atlantis/atlantis.c +Copyright: 1994 Mark J. Kilgard + 1993, 1994, Silicon Graphics, Inc. +License: SGI_atlantis +Comment: See license for full copyright notice, this one is the same except for + the additional copyright holder + +Files: Xcode/SDLTest/sdlcommon_prefix.h +Copyright: 2003 Darrell Walisser +License: zlib/libpng +Comment: + Created by Darrell Walisser on Wed Aug 06 2003. + Copyright (c) 2003 __MyCompanyName__. All rights reserved. + +Files: debian/* +Copyright: 2011-2012, Manuel A. Fernandez Montecelo + 2011-2012, Felix Geyer + 2011, Roman Vasiyarov + 2010, Jon Dowland + 2009, Barry deFreese + 2007-2008, Aurelien Jarno + 2007-2008, Sam Hocevar (Debian packages) + 2002-2007, Josselin Mouette + 2001, Christian T. Steigies + 2001, Branden Robinson +License: LGPL-2.1+ + + +License: zlib/libpng + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +License: LGPL-2.1+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at + your option) any later version. + . + On Debian systems, the complete text of version 2.1 of the GNU Lesser + Public License can be found in '/usr/share/common-licenses/LGPL-2.1'. + +License: MIT/X11 + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is fur- + nished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- + NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- + NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + Except as contained in this notice, the name of the XFree86 Project shall not + be used in advertising or otherwise to promote the sale, use or other deal- + ings in this Software without prior written authorization from the XFree86 + Project. + +License: BSD_3_clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the LibQxt project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Comment: + Copyright (C) 1997-2011 Sam Lantinga + . + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. + . + . + Copyright (c) 2011, Edgar Simo Serra + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the Simple Directmedia Layer (SDL) nor the names of + its contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BrownUn_UnCalifornia_ErikCorry + /* This code was derived from code carrying the following copyright notices: + * Copyright (c) 1995 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Copyright (c) 1995 Erik Corry + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, + * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF + * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" + * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, + * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Portions of this software Copyright (c) 1995 Brown University. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement + * is hereby granted, provided that the above copyright notice and the + * following two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN + * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" + * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, + * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +License: Gareth_McCaughan + You may use it in anything you like; you may make money + out of it; you may distribute it in object form or as + part of an executable without including source code; + you don't have to credit me. (But it would be nice if + you did.) + +License: Johnson_M._Hart + Permission is granted for any and all use providing that this + copyright is properly acknowledged. + There are no assurances of suitability for any use whatsoever. + +License: SunPro + Developed at SunPro, a Sun Microsystems, Inc. business. + Permission to use, copy, modify, and distribute this + software is freely granted, provided that this notice + is preserved. + +License: PublicDomain_Sam_Lantinga + Placed in the public domain by Sam Lantinga 4/13/98 + +License: PublicDomain_Edgar_Simo + Written by Edgar Simo "bobbens" + . + Released under Public Domain. + +License: RSA_Data_Security + *********************************************************************** + ** utl_md5.c -- the source code for MD5 routines ** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. ** + *********************************************************************** + *********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + *********************************************************************** + +License: SGI_atlantis + (c) Copyright 1993, 1994, Silicon Graphics, Inc. + ALL RIGHTS RESERVED + Permission to use, copy, modify, and distribute this software for + any purpose and without fee is hereby granted, provided that the above + copyright notice appear in all copies and that both the copyright notice + and this permission notice appear in supporting documentation, and that + the name of Silicon Graphics, Inc. not be used in advertising + or publicity pertaining to distribution of the software without specific, + written prior permission. + . + THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + . + US Government Users Restricted Rights + Use, duplication, or disclosure by the Government is subject to + restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + (c)(1)(ii) of the Rights in Technical Data and Computer Software + clause at DFARS 252.227-7013 and/or in similar or successor + clauses in the FAR or the DOD or NASA FAR Supplement. + Unpublished-- rights reserved under the copyright laws of the + United States. Contractor/manufacturer is Silicon Graphics, + Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + . + OpenGL(TM) is a trademark of Silicon Graphics, Inc. diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000000..2e2e9c4ee6 --- /dev/null +++ b/debian/docs @@ -0,0 +1,4 @@ +BUGS.txt +CREDITS.txt +README.txt +README-SDL.txt diff --git a/debian/libsdl2-dev.install b/debian/libsdl2-dev.install new file mode 100644 index 0000000000..7f99ff427c --- /dev/null +++ b/debian/libsdl2-dev.install @@ -0,0 +1,8 @@ +usr/bin/sdl2-config +usr/include/SDL2 +usr/lib/*/libSDL2*.so +usr/lib/*/libSDL2.a +usr/lib/*/libSDL2main.a +usr/lib/*/libSDL2_test.a +usr/lib/*/pkgconfig/sdl2.pc +usr/share/aclocal/sdl2.m4 diff --git a/debian/libsdl2-dev.manpages b/debian/libsdl2-dev.manpages new file mode 100644 index 0000000000..150752ce9b --- /dev/null +++ b/debian/libsdl2-dev.manpages @@ -0,0 +1 @@ +debian/sdl2-config.1 diff --git a/debian/libsdl2.install b/debian/libsdl2.install new file mode 100644 index 0000000000..e4193c74c9 --- /dev/null +++ b/debian/libsdl2.install @@ -0,0 +1 @@ +usr/lib/*/libSDL2-2.0.so.0* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000..3f4d8e629b --- /dev/null +++ b/debian/rules @@ -0,0 +1,41 @@ +#!/usr/bin/make -f + +DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +confflags = --disable-rpath --disable-video-directfb \ + --disable-nas --disable-esd --disable-arts \ + --disable-alsa-shared --disable-pulseaudio-shared \ + --disable-x11-shared + +%: + dh $@ --parallel + +override_dh_auto_configure: + dh_auto_configure -Bbuilddir/all -- $(confflags) + +override_dh_auto_build: + dh_auto_build -Bbuilddir/all + tar czf debian/examples.tar.gz test + +override_dh_auto_install: + dh_auto_install -Bbuilddir/all + +override_dh_auto_clean: + dh_auto_clean -Bbuilddir/all + rm -f debian/examples.tar.gz + +override_dh_install: + dh_install --remaining-packages --fail-missing -XlibSDL2.la + +override_dh_installexamples: + dh_installexamples -plibsdl2-dev debian/examples.tar.gz + dh_installexamples --remaining-packages + +override_dh_link: + # to address lintian warning + # W: libsdl2-2.0-0: dev-pkg-without-shlib-symlink usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.0.0 usr/lib/x86_64-linux-gnu/libSDL2-2.0.so + dh_link -plibsdl2-dev usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so.0.0.0 usr/lib/$(DEB_HOST_MULTIARCH)/libSDL2-2.0.so + +override_dh_strip: + dh_strip --dbg-package=libsdl2-dbg diff --git a/debian/sdl2-config.1 b/debian/sdl2-config.1 new file mode 100644 index 0000000000..c4f4106fae --- /dev/null +++ b/debian/sdl2-config.1 @@ -0,0 +1,86 @@ +.TH sdl2-config 1 "2012-02-20" "SDL 2.0" +.SH NAME +sdl2-config \- script to get information about the installed version of SDL +.SH SYNOPSIS +.B sdl2-config +[ --prefix= +.IR DIR ] +[ --exec-prefix= +.IR DIR ] +[ --version ] [ --libs | --library-libs | --plugin-libs ] [ --cflags ] +.SH DESCRIPTION +.B sdl2-config +is a tool that is used to configure and determine the compiler and linker +flags that should be used to compile and link programs, libraries, and +plugins that use SDL. It is also used internally by the m4 macros that are +included with SDL. +.SH OPTIONS +.TP +.B --cflags +Print the compiler flags that are necessary to compile a program or library +that uses SDL. +.TP +.BI --exec-prefix= DIR +If specified, use +.I DIR +instead of the installation exec prefix that SDL was build with when +computing the output for the --cflags, --libs, --library-libs, and +--plugin-libs options. This option must be specified before any of the +--cflags, --libs, --library-libs, and --plugin-libs options. +.TP +.B --libs +Print the linker flags that are necessary to link a program that uses SDL. +.TP +.B --static-libs +Print the linker flags that are necessary to statically link a program that uses SDL. +.TP +.B --library-libs +Print the linker flags that are necessary to link a library that uses SDL. +(This excludes any static objects required for linking, since these must be +linked only by executable programs.) +.TP +.B --plugin-libs +Print the linker flags that are necessary to link an SDL-using object that +is to be accessed via +.IR dlopen (3). +This may include static objects with PIC symbol information. This option +should +.B not +be used for ordinary shared libraries or standalone applications. +.TP +.BI --prefix= DIR +If specified, use PREFIX instead of the installation prefix that SDL was +built with when computing the output for the --cflags, --libs, +--library-libs, and --plugin-libs options. This option is also used for +the exec prefix if --exec-prefix was not specified. This option must be +specified before any of the --cflags, --libs, --library-libs, and +--plugin-libs options. +.TP +.B --version +Prints the currently installed version of SDL on standard output. +.SH EXAMPLES +.TP +gcc -o main.o $(sdl2-config --cflags) main.c +is how you might use +.B sdl2-config +to compile a C source file for an executable program. +.TP +gcc -o my_app $(sdl2-config --libs) main.o util.o +is how you might use +.B sdl2-config +to link compiled objects into an executable program. +.TP +gcc -o libSDL_nifty-2.0.so.0.0.1 $(sdl --library-libs) read.o write.o munge.o +is how you might use +.B sdl2-config +to link compiled objects into a shared library. +.TP +gcc -o libnifty_xmms.so $(sdl --plugin-libs) stream.o blit.o deinterlace.o +is how you might use +.B sdl2-config +to link compiled objects into a plugin for use by another program. +.SH AUTHOR +The Simple DirectMedia Layer (SDL) library was written by Sam Lantinga. +.PP +This manual page was written by Branden Robinson, originally for Progeny +Linux Systems, Inc., and the Debian Project. diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000..89ae9db8f8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000000..07dc20117d --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.libsdl.org/release/SDL-([\d.]+)\.tar\.gz diff --git a/docs.html b/docs.html deleted file mode 100644 index 7916dfa1de..0000000000 --- a/docs.html +++ /dev/null @@ -1,698 +0,0 @@ - -SDL Stable Release - - -[separator] -

-This source is stable, and is fully tested on all supported platforms.
-Please send bug reports or questions to the SDL mailing list:
-http://www.libsdl.org/mailing-list.php
-The latest stable release may be found on the - SDL website. -

- -

API Documentation

- -[separator] - -

SDL 1.2.15 Release Notes

-

-SDL 1.2.15 is a minor bug fix release. -

- -

General Notes

- -
-

- Fixed assembly register clobbering in CPU info routines -

-

- Fixed memory stomp when using stretch blit on large images -

-

- Fixed pixel corruption with overlapping blits -

-

- SDL_JOYSTICK_DEVICE can be a colon separated list of joystick devices -

-

- Disabled MMX blitters since they don't compile on modern compilers -

-
- -

Unix Notes

- -
-

- Fixed crash in joystick code on newer Linux kernels -

-

- Fixed channel swizzling for ALSA target with 6-channel output -

-

- Use the OpenGL GLX_EXT_swap_control extension if available -

-

- XRandR support is disabled by default because it causes desktop reconfiguring. It can be enabled with the SDL_VIDEO_X11_XRANDR=1 environment variable, or by applying this patch: http://hg.libsdl.org/SDL/raw-rev/8ec3036098df -

-
- -

Windows Notes

- -
-

- Fixed SDL_GL_ACCELERATED_VISUAL handling -

-

- Fixed application state handling with ALT-Tab -

-

- Fixed occasional crash handling WM_ACTIVATEAPP in Direct X code -

-

- Fixed UTF-8 decoding of Russian characters -

-
- -

Mac OS X Notes

- -
-

- Fixed building and running on Mac OS X 10.7 (Lion) -

-
- -[separator] - -

SDL 1.2.14 Release Notes

-

-SDL 1.2.14 is a significant bug fix release and a recommended update. -

- -

General Notes

- -
-

- Fixed flicker when resizing the SDL window -

-

- Fixed crash in SDL_SetGammaRamp() -

-

- Fixed freeze in SDL_memset() with 0 length when assembly code is disabled. -

-

- Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys. -

-

- Fixed audio quality problem when converting between 22050 Hz and 44100 Hz. -

-

- Fixed a threading crash when a few threads are rapidly created and complete. -

-

- Increased accuracy of alpha blending routines. -

-

- Fixed crash loading BMP files saved with the scanlines inverted. -

-

- Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event. -

-

- Added doxygen documentation for the SDL API headers. -

-
- -

Unix Notes

- -
-

- Fixed potential memory corruption due to assembly bug with SDL_revcpy() -

-

- Fixed crashes trying to detect SSE features on x86_64 architecture. -

-

- Fixed assembly for GCC optimized 50% alpha blending blits. -

-

- Added configure option --enable-screensaver, to allow enabling the screensaver by default. -

-

- Use XResetScreenSaver() instead of disabling screensaver entirely. -

-

- Removed the maximum window size limitation on X11. -

-

- Fixed SDL_GL_SWAP_CONTROL on X11. -

-

- Fixed setting the X11 window input hint. -

-

- Fixed distorted X11 window icon for some visuals. -

-

- Fixed detecting X11 libraries for dynamic loading on 64-bit Linux. -

-

- SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control. -

-

- Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11. -

-

- The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen. -

-

- Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console. -
- Valid values are: -

    -
  • not set - Not rotating, no shadow. -
  • "NONE" - Not rotating, but still using shadow. -
  • "CW" - Rotating screen clockwise. -
  • "UD" - Rotating screen upside down. -
  • "CCW" - Rotating screen counter clockwise. -
-

-

- Fixed DirectFB detection on some Linux distributions. -

-

- Added code to use the PS3 SPE processors for YUV conversion on Linux. -

-

- Updated ALSA support to the latest stable API -

-

- ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.) -

-

- Improved support for PulseAudio -

-

- The Network Audio System support is now dynamically loaded at runtime. -

-

- Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels. -

-

- Fixed crash in SDL_Quit() when a joystick has been unplugged. -

-
- -

Windows Notes

- -
-

- Verified 100% compatibility with Windows 7. -

-

- Prevent loss of OpenGL context when setting the video mode in response to a window resize event. -

-

- Fixed video initialization with SDL_WINDOWID on Windows XP. -

-

- Improved mouse input responsiveness for first-person-shooter games. -

-

- IME messages are now generated for localized input. -

-

- SDL_RWFromFile() takes a UTF-8 filename when opening a file. -

-

- The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt. -

-

- Fixed dynamic object loading on Windows CE. -

-
- -

Mac OS X Notes

- -
-

- SDL now builds on Mac OS X 10.6 (Snow Leopard). -
- Eric Wing posted a good rundown on the numerous changes here: http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html -

-

- The X11 video driver is built by default. -

-

- Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target. -

-

- Fixed setting the starting working directory in release builds. -

-
- -[separator] - -

SDL 1.2.13 Release Notes

-

-SDL 1.2.13 is a minor bug fix release. -

- -

General Notes

- -
-

- Fixed link error when building with Intel Compiler 10. -

-

- Removed stray C++ comment from public headers. -

-
- -

Unix Notes

- -
-

- Fixed crash in SDL_SoftStretch() on secure operating systems. -

-

- Fixed undefined symbol on X11 implementations without UTF-8 support. -

-

- Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver. -

-

- Scan for all joysticks on Linux instead of stopping at one that was removed. -

-

- Fixed use of sdl-config arguments in sdl.m4 -

-
- -

Windows Notes

- -
-

- Fixed crash when a video driver reports higher than 32 bpp video modes. -

-

- Fixed restoring the desktop after setting a 24-bit OpenGL video mode. -

-

- Fixed window titles on Windows 95/98/ME. -

-

- Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons. -

-

- Added support for quoted command line arguments. -

-
- -

Mac OS X Notes

- -
-

- SDL now builds on Mac OS X 10.5 (Leopard). -

-

- Fixed high frequency crash involving text input. -

-

- Fixed beeping when the escape key is pressed and UNICODE translation is enabled. -

-

- Improved trackpad scrolling support. -

-

- Fixed joystick hat reporting for certain joysticks. -

-
- -[separator] - -

SDL 1.2.12 Release Notes

-

-SDL 1.2.12 is a minor bug fix release. -

- -

General Notes

- -
-

- Added support for the PulseAudio sound server: http://www.pulseaudio.org/ -

-

- Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11. -

-

- Fixed buffer overrun crash when resampling audio rates. -

-

- Fixed audio bug where converting to mono was doubling the volume. -

-

- Fixed off-by-one error in the C implementation of SDL_revcpy() -

-

- Fixed compiling with Sun Studio. -

-

- Support for AmigaOS has been removed from the main SDL code. -

-

- Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code. -

-

- Unofficial support for the S60/SymbianOS platform has been added. -

-

- Unofficial support for the Nintendo DS platform has been added. -

-

- Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only). -

-
- -

Unix Notes

- -
-

- Fixed detection of X11 DGA mouse support. -

-

- Improved XIM support for asian character sets. -

-

- The GFX_Display has been added to the X11 window information in SDL_syswm.h. -

-

- Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels. -

-

- Fixed hang or crash at startup if aRts can't access the hardware. -

-

- Fixed relative mouse mode when the cursor starts outside the X11 window. -

-

- Fixed accidental free of stack memory in X11 mouse acceleration code. -

-

- Closed minor memory leak in XME code. -

-

- Fixed TEXTRELs in the library to resolve some PIC issues. -

-
- -

Windows Notes

- -
-

- The GDI video driver makes better use of the palette in 8-bit modes. -

-

- The windib driver now supports more mouse buttons with WM_XBUTTON events. -

-

- On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed. -

-

- Added support for UTF-8 window titles on Windows. -

-

- Fixed joystick detection on Windows. -

-

- Improved performance with Win32 file I/O. -

-

- Fixed HBITMAP leak in GAPI driver. -

-
- -

Mac OS X Notes

- -
-

- Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X. -

-

- Fixed YUV overlay crash inside Quicktime on Intel Mac OS X. -

-

- Fixed blitting alignment in Altivec alpha blit functions. -

-

- Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X. -

-

- Fixed joystick calibration code on Mac OS X. -

-

- Fixed mouse jitter when multiple motion events are queued up in Mac OS X. -

-

- Fixed changing the cursor in fullscreen mode on Mac OS X. -

-
- -

Mac OS Classic Notes

- -
-

- Added support for gamma ramps to both toolbox and DrawSprocket video drivers. -

-
- -

BeOS Notes

- -
-

- Implemented mouse grabbing and mouse relative mode on BeOS. -

-
- -[separator] - -

SDL 1.2.11 Release Notes

-

-SDL 1.2.11 is a minor bug fix release. -

- -

Unix Notes

- -
-

- Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX. -

-

- Fixed building SDL with Xinerama disabled. -

-

- Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen(). -

-

- Added pkgconfig configuration support. -

-
- -

Windows Notes

- -
-

- Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL. -

-

- The Win32 window positioning code works properly for windows with menus. -

-

- DirectSound audio quality has been improved on certain sound cards. -

-

- Fixed 5.1 audio channel ordering on Windows and Mac OS X. -

-

- Plugged a couple of minor memory leaks in the windib video driver. -

-

- Fixed type collision with stdint.h when building with gcc on Win32. -

-

- Fixed building with the Digital Mars Compiler on Win32. -

-
- -

Mac OS X Notes

- -
-

- The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above. -

-
- -[separator] - -

SDL 1.2.10 Release Notes

-

-SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes. -

-

API enhancements

-
    -
  • - If SDL_OpenAudio() is passed zero for the desired format - fields, the following environment variables will be used - to fill them in: -
    
    -		SDL_AUDIO_FREQUENCY
    -		SDL_AUDIO_FORMAT
    -		SDL_AUDIO_CHANNELS
    -		SDL_AUDIO_SAMPLES
    -
    - If an environment variable is not specified, it will be set - to a reasonable default value. -
  • - SDL_SetVideoMode() now accepts 0 for width or height and will use - the current video mode (or the desktop mode if no mode has been set.) -
  • - Added current_w and current_h to the SDL_VideoInfo structure, - which is set to the desktop resolution during video intialization, - and then set to the current resolution when a video mode is set. -
  • - SDL_GL_LoadLibrary() will load the system default OpenGL library - if it is passed NULL as a parameter. -
  • - Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. -
  • - Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. -
  • - SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms. -
  • - Added SDL_GetKeyRepeat() to query the key repeat settings. -
  • - Added the "dummy" audio driver, which can be used to emulate audio - output without a sound card. -
  • - Added SDL_config.h, with defaults for various build environments. -
- -

General Notes

- -
-

- The SDL website now has an RSS feed! -

- The SDL development source code is now managed with Subversion. -

- SDL now uses the Bugzilla bug tracking system, hosted by icculus.org. -

- SDL is licensed under version 2.1 of the GNU Lesser General Public License. -

- The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform. -

- SDL_opengl.h has been updated with the latest glext.h from http://oss.sgi.com/projects/ogl-sample/registry/ -

- Alex Volkov contributed highly optimized RGB <-> RGBA blitters. -

- -

Unix Notes

- -
-

- The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed. -

- The XiG XME extension code is now included in the X11 video driver by default. -

- XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1. -

- Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0. -

- XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file. -

- SDL windows are no longer transparent in X11 compositing systems like XGL. -

- The mouse is properly released by the X11 video driver if the fullscreen window loses focus. -

- The X11 input driver now uses XIM to handle international input. -

- The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3. -

- Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver. -

- The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images. -

- The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling. -

- The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back. -

- The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings. -

- The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse. -

- The SVGAlib video driver now has support for banked (non-linear) video modes. -

- A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details. -

- Many patches have been incorporated from *BSD ports. -

- -

Windows Notes

- -
-

- The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx". -

- SDL has been ported to 64-bit Windows. -

- Dmitry Yakimov contributed a GAPI video driver for Windows CE. -

- The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3. -

- Dialog boxes are now shown when SDL is in windowed OpenGL mode. -

- The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes. -

- An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored. -

- Window positions are retained when switching between fullscreen and windowed modes. -

- ToUnicode() is used, when available, for improved handling of international keyboard input. -

- The PrtScrn is now treated normally with both key down and key up events. -

- Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications. -

- Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting. -

- An MCI error when playing the last track on a CD-ROM has been fixed. -

- OpenWatcom projects for building SDL have been provided by Marc Peter. -

- -

Mac OS X Notes

- -
-

- SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details. -

- The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed. -

- Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker. -

- Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs. -

- -

OS/2 Notes

- -
-

- Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details. -

- -[separator] - - - diff --git a/docs/html/audio.html b/docs/html/audio.html deleted file mode 100644 index 94075e2cb8..0000000000 --- a/docs/html/audio.html +++ /dev/null @@ -1,242 +0,0 @@ -Audio
SDL Library Documentation
PrevNext

Chapter 10. Audio

Table of Contents
SDL_AudioSpec -- Audio Specification Structure
SDL_OpenAudio -- Opens the audio device with the desired parameters.
SDL_PauseAudio -- Pauses and unpauses the audio callback processing
SDL_GetAudioStatus -- Get the current audio state
SDL_LoadWAV -- Load a WAVE file
SDL_FreeWAV -- Frees previously opened WAV data
SDL_AudioCVT -- Audio Conversion Structure
SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion
SDL_ConvertAudio -- Convert audio data to a desired audio format.
SDL_MixAudio -- Mix audio data
SDL_LockAudio -- Lock out the callback function
SDL_UnlockAudio -- Unlock the callback function
SDL_CloseAudio -- Shuts down audio processing and closes the audio device.

Sound on the computer is translated from waves that you hear into a series of -values, or samples, each representing the amplitude of the wave. When these -samples are sent in a stream to a sound card, an approximation of the original -wave can be recreated. The more bits used to represent the amplitude, and the -greater frequency these samples are gathered, the closer the approximated -sound is to the original, and the better the quality of sound.

This library supports both 8 and 16 bit signed and unsigned sound samples, -at frequencies ranging from 11025 Hz to 44100 Hz, depending on the -underlying hardware. If the hardware doesn't support the desired audio -format or frequency, it can be emulated if desired (See -SDL_OpenAudio())

A commonly supported audio format is 16 bits per sample at 22050 Hz.


PrevHomeNext
SDL_JoystickCloseUpSDL_AudioSpec
\ No newline at end of file diff --git a/docs/html/cdrom.html b/docs/html/cdrom.html deleted file mode 100644 index bdd6bfd827..0000000000 --- a/docs/html/cdrom.html +++ /dev/null @@ -1,260 +0,0 @@ -CD-ROM
SDL Library Documentation
PrevNext

Chapter 11. CD-ROM

Table of Contents
SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.
SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.
SDL_CDOpen -- Opens a CD-ROM drive for access.
SDL_CDStatus -- Returns the current status of the given drive.
SDL_CDPlay -- Play a CD
SDL_CDPlayTracks -- Play the given CD track(s)
SDL_CDPause -- Pauses a CDROM
SDL_CDResume -- Resumes a CDROM
SDL_CDStop -- Stops a CDROM
SDL_CDEject -- Ejects a CDROM
SDL_CDClose -- Closes a SDL_CD handle
SDL_CD -- CDROM Drive Information
SDL_CDtrack -- CD Track Information Structure

SDL supports audio control of up to 32 local CD-ROM drives at once.

You use this API to perform all the basic functions of a CD player, -including listing the tracks, playing, stopping, and ejecting the CD-ROM. -(Currently, multi-changer CD drives are not supported.)

Before you call any of the SDL CD-ROM functions, you must first call -"SDL_Init(SDL_INIT_CDROM)", which scans the system for -CD-ROM drives, and sets the program up for audio control. Check the -return code, which should be 0, to see if there -were any errors in starting up.

After you have initialized the library, you can find out how many drives -are available using the SDL_CDNumDrives() function. -The first drive listed is the system default CD-ROM drive. After you have -chosen a drive, and have opened it with SDL_CDOpen(), -you can check the status and start playing if there's a CD in the drive.

A CD-ROM is organized into one or more tracks, each consisting of a certain -number of "frames". Each frame is ~2K in size, and at normal playing speed, -a CD plays 75 frames per second. SDL works with the number of frames on a -CD, but this can easily be converted to the more familiar minutes/seconds -format by using the FRAMES_TO_MSF() macro.


PrevHomeNext
SDL_CloseAudioUpSDL_CDNumDrives
\ No newline at end of file diff --git a/docs/html/event.html b/docs/html/event.html deleted file mode 100644 index f2bddb2c0a..0000000000 --- a/docs/html/event.html +++ /dev/null @@ -1,216 +0,0 @@ -Events
SDL Library Documentation
PrevNext

Chapter 8. Events

Introduction

Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to: -

SDL_Init(SDL_INIT_VIDEO);
-Internally, SDL stores all the events waiting to be handled in an event queue. Using functions like SDL_PollEvent and SDL_PeepEvents you can observe and handle waiting input events.

The key to event handling in SDL is the SDL_Event union. The event queue itself is composed of a series of SDL_Event unions, one for each waiting event. SDL_Event unions are read from the queue with the SDL_PollEvent function and it is then up to the application to process the information stored with them.


PrevHomeNext
SDL_WM_GrabInputUpSDL Event Structures.
\ No newline at end of file diff --git a/docs/html/eventfunctions.html b/docs/html/eventfunctions.html deleted file mode 100644 index f68a29a3bf..0000000000 --- a/docs/html/eventfunctions.html +++ /dev/null @@ -1,481 +0,0 @@ -Event Functions.
SDL Library Documentation
PrevChapter 8. EventsNext

Event Functions.

Table of Contents
SDL_PumpEvents -- Pumps the event loop, gathering events from the input devices.
SDL_PeepEvents -- Checks the event queue for messages and optionally returns them.
SDL_PollEvent -- Polls for currently pending events.
SDL_WaitEvent -- Waits indefinitely for the next available event.
SDL_PushEvent -- Pushes an event onto the event queue
SDL_SetEventFilter -- Sets up a filter to process all events before they are posted -to the event queue.
SDL_GetEventFilter -- Retrieves a pointer to he event filter
SDL_EventState -- This function allows you to set the state of processing certain events.
SDL_GetKeyState -- Get a snapshot of the current keyboard state
SDL_GetModState -- Get the state of modifier keys.
SDL_SetModState -- Set the current key modifier state
SDL_GetKeyName -- Get the name of an SDL virtual keysym
SDL_EnableUNICODE -- Enable UNICODE translation
SDL_EnableKeyRepeat -- Set keyboard repeat rate.
SDL_GetMouseState -- Retrieve the current state of the mouse
SDL_GetRelativeMouseState -- Retrieve the current state of the mouse
SDL_GetAppState -- Get the state of the application
SDL_JoystickEventState -- Enable/disable joystick event polling

SDL_PumpEventsPumps the event loop, gathering events from the input devices
SDL_PeepEventsChecks the event queue for messages and optionally returns them
SDL_PollEventPolls for currently pending events
SDL_WaitEventWaits indefinitely for the next available event
SDL_PushEventPushes an event onto the event queue
SDL_SetEventFilterSets up a filter to process all events
SDL_EventStateAllows you to set the state of processing certain events
SDL_GetKeyStateGet a snapshot of the current keyboard state
SDL_GetModStateGet the state of modifier keys
SDL_SetModStateSet the state of modifier keys
SDL_GetKeyNameGet the name of an SDL virtual keysym
SDL_EnableUNICODEEnable UNICODE translation
SDL_EnableKeyRepeatSet keyboard repeat rate
SDL_GetMouseStateRetrieve the current state of the mouse
SDL_GetRelativeMouseStateRetrieve the current state of the mouse
SDL_GetAppStateGet the state of the application
SDL_JoystickEventStateEnable/disable joystick event polling


PrevHomeNext
SDLKeyUpSDL_PumpEvents
\ No newline at end of file diff --git a/docs/html/eventstructures.html b/docs/html/eventstructures.html deleted file mode 100644 index c959296220..0000000000 --- a/docs/html/eventstructures.html +++ /dev/null @@ -1,233 +0,0 @@ -SDL Event Structures.
SDL Library Documentation
PrevChapter 8. EventsNext

SDL Event Structures.

Table of Contents
SDL_Event -- General event structure
SDL_ActiveEvent -- Application visibility event structure
SDL_KeyboardEvent -- Keyboard event structure
SDL_MouseMotionEvent -- Mouse motion event structure
SDL_MouseButtonEvent -- Mouse button event structure
SDL_JoyAxisEvent -- Joystick axis motion event structure
SDL_JoyButtonEvent -- Joystick button event structure
SDL_JoyHatEvent -- Joystick hat position change event structure
SDL_JoyBallEvent -- Joystick trackball motion event structure
SDL_ResizeEvent -- Window resize event structure
SDL_ExposeEvent -- Quit requested event
SDL_SysWMEvent -- Platform-dependent window manager event.
SDL_UserEvent -- A user-defined event type
SDL_QuitEvent -- Quit requested event
SDL_keysym -- Keysym structure
SDLKey -- Keysym definitions.

PrevHomeNext
EventsUpSDL_Event
\ No newline at end of file diff --git a/docs/html/general.html b/docs/html/general.html deleted file mode 100644 index 0beb5919f8..0000000000 --- a/docs/html/general.html +++ /dev/null @@ -1,225 +0,0 @@ -General
SDL Library Documentation
PrevNext

Chapter 5. General

Table of Contents
SDL_Init -- Initializes SDL
SDL_InitSubSystem -- Initialize subsystems
SDL_QuitSubSystem -- Shut down a subsystem
SDL_Quit -- Shut down SDL
SDL_WasInit -- Check which subsystems are initialized
SDL_GetError -- Get SDL error string
SDL_envvars -- SDL environment variables

Before SDL can be used in a program it must be initialized with SDL_Init. SDL_Init initializes all the subsystems that the user requests (video, audio, joystick, timers and/or cdrom). Once SDL is initialized with SDL_Init subsystems can be shut down and initialized as needed using SDL_InitSubSystem and SDL_QuitSubSystem.

SDL must also be shut down before the program exits to make sure it cleans up correctly. Calling SDL_Quit shuts down all subsystems and frees any resources allocated to SDL.


PrevHomeNext
SDL ReferenceUpSDL_Init
\ No newline at end of file diff --git a/docs/html/guide.html b/docs/html/guide.html deleted file mode 100644 index 2c1297ee2b..0000000000 --- a/docs/html/guide.html +++ /dev/null @@ -1,174 +0,0 @@ -SDL Guide
SDL Library Documentation
PrevNext

I. SDL Guide


PrevHomeNext
SDL Library Documentation Preface
\ No newline at end of file diff --git a/docs/html/guideaboutsdldoc.html b/docs/html/guideaboutsdldoc.html deleted file mode 100644 index cdb0d783c2..0000000000 --- a/docs/html/guideaboutsdldoc.html +++ /dev/null @@ -1,148 +0,0 @@ -About SDLdoc
SDL Library Documentation
PrevPrefaceNext

About SDLdoc

SDLdoc (The SDL Documentation Project) was formed to completely rewrite the SDL documentation and to keep it continually up to date. The team consists completely of volunteers ranging from people working with SDL in their spare time to people who use SDL in their everyday working lives.

The latest version of this documentation can always be found here: http://sdldoc.csn.ul.ie Downloadable PS, man pages and html tarballs are available at http://sdldoc.csn.ul.ie/pub/


PrevHomeNext
PrefaceUpCredits
\ No newline at end of file diff --git a/docs/html/guideaudioexamples.html b/docs/html/guideaudioexamples.html deleted file mode 100644 index afb7522be7..0000000000 --- a/docs/html/guideaudioexamples.html +++ /dev/null @@ -1,228 +0,0 @@ -Audio Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Audio Examples

Opening the audio device

    SDL_AudioSpec wanted;
-    extern void fill_audio(void *udata, Uint8 *stream, int len);
-
-    /* Set the audio format */
-    wanted.freq = 22050;
-    wanted.format = AUDIO_S16;
-    wanted.channels = 2;    /* 1 = mono, 2 = stereo */
-    wanted.samples = 1024;  /* Good low-latency value for callback */
-    wanted.callback = fill_audio;
-    wanted.userdata = NULL;
-
-    /* Open the audio device, forcing the desired format */
-    if ( SDL_OpenAudio(&wanted, NULL) < 0 ) {
-        fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
-        return(-1);
-    }
-    return(0);

Playing audio

    static Uint8 *audio_chunk;
-    static Uint32 audio_len;
-    static Uint8 *audio_pos;
-
-    /* The audio function callback takes the following parameters:
-       stream:  A pointer to the audio buffer to be filled
-       len:     The length (in bytes) of the audio buffer
-    */
-    void fill_audio(void *udata, Uint8 *stream, int len)
-    {
-        /* Only play if we have data left */
-        if ( audio_len == 0 )
-            return;
-
-        /* Mix as much data as possible */
-        len = ( len > audio_len ? audio_len : len );
-        SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);
-        audio_pos += len;
-        audio_len -= len;
-    }
-
-    /* Load the audio data ... */
-
-    ;;;;;
-
-    audio_pos = audio_chunk;
-
-    /* Let the callback function play the audio chunk */
-    SDL_PauseAudio(0);
-
-    /* Do some processing */
-
-    ;;;;;
-
-    /* Wait for sound to complete */
-    while ( audio_len > 0 ) {
-        SDL_Delay(100);         /* Sleep 1/10 second */
-    }
-    SDL_CloseAudio();


PrevHomeNext
Event ExamplesUpCDROM Examples
\ No newline at end of file diff --git a/docs/html/guidebasicsinit.html b/docs/html/guidebasicsinit.html deleted file mode 100644 index faafdbd920..0000000000 --- a/docs/html/guidebasicsinit.html +++ /dev/null @@ -1,240 +0,0 @@ -Initializing SDL
SDL Library Documentation
PrevChapter 1. The BasicsNext

Initializing SDL

SDL is composed of eight subsystems - Audio, CDROM, Event Handling, File I/O, Joystick Handling, Threading, Timers and Video. Before you can use any of these subsystems they must be initialized by calling SDL_Init (or SDL_InitSubSystem). SDL_Init must be called before any other SDL function. It automatically initializes the Event Handling, File I/O and Threading subsystems and it takes a parameter specifying which other subsystems to initialize. So, to initialize the default subsystems and the Video subsystems you would call: -

    SDL_Init ( SDL_INIT_VIDEO );
-To initialize the default subsystems, the Video subsystem and the Timers subsystem you would call: -
    SDL_Init ( SDL_INIT_VIDEO | SDL_INIT_TIMER );

SDL_Init is complemented by SDL_Quit (and SDL_QuitSubSystem). SDL_Quit shuts down all subsystems, including the default ones. It should always be called before a SDL application exits.

With SDL_Init and SDL_Quit firmly embedded in your programmers toolkit you can write your first and most basic SDL application. However, we must be prepare to handle errors. Many SDL functions return a value and indicates whether the function has succeeded or failed, SDL_Init, for instance, returns -1 if it could not initialize a subsystem. SDL provides a useful facility that allows you to determine exactly what the problem was, every time an error occurs within SDL an error message is stored which can be retrieved using SDL_GetError. Use this often, you can never know too much about an error.

Example 1-1. Initializing SDL

#include "SDL.h"   /* All SDL App's need this */
-#include <stdio.h>
-
-int main(int argc, char *argv[]) {
-    
-    printf("Initializing SDL.\n");
-    
-    /* Initialize defaults, Video and Audio */
-    if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) { 
-        printf("Could not initialize SDL: %s.\n", SDL_GetError());
-        exit(-1);
-    }
-
-    printf("SDL initialized.\n");
-
-    printf("Quiting SDL.\n");
-    
-    /* Shutdown all subsystems */
-    SDL_Quit();
-    
-    printf("Quiting....\n");
-
-    exit(0);
-}

PrevHomeNext
The BasicsUpGraphics and Video
\ No newline at end of file diff --git a/docs/html/guidecdromexamples.html b/docs/html/guidecdromexamples.html deleted file mode 100644 index 2bc5a16cb5..0000000000 --- a/docs/html/guidecdromexamples.html +++ /dev/null @@ -1,275 +0,0 @@ -CDROM Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

CDROM Examples

Listing CD-ROM drives

    #include "SDL.h"
-
-    /* Initialize SDL first */
-    if ( SDL_Init(SDL_INIT_CDROM) < 0 ) {
-        fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
-        exit(1);
-    }
-    atexit(SDL_Quit);
-
-    /* Find out how many CD-ROM drives are connected to the system */
-    printf("Drives available: %d\n", SDL_CDNumDrives());
-    for ( i=0; i<SDL_CDNumDrives(); ++i ) {
-        printf("Drive %d:  \"%s\"\n", i, SDL_CDName(i));
-    }

Opening the default drive

    SDL_CD *cdrom;
-    CDstatus status;
-    char *status_str;
-
-    cdrom = SDL_CDOpen(0);
-    if ( cdrom == NULL ) {
-        fprintf(stderr, "Couldn't open default CD-ROM drive: %s\n",
-                        SDL_GetError());
-        exit(2);
-    }
-
-    status = SDL_CDStatus(cdrom);
-    switch (status) {
-        case CD_TRAYEMPTY:
-            status_str = "tray empty";
-            break;
-        case CD_STOPPED:
-            status_str = "stopped";
-            break;
-        case CD_PLAYING:
-            status_str = "playing";
-            break;
-        case CD_PAUSED:
-            status_str = "paused";
-            break;
-        case CD_ERROR:
-            status_str = "error state";
-            break;
-    }
-    printf("Drive status: %s\n", status_str);
-    if ( status >= CD_PLAYING ) {
-        int m, s, f;
-        FRAMES_TO_MSF(cdrom->cur_frame, &m, &s, &f);
-        printf("Currently playing track %d, %d:%2.2d\n",
-        cdrom->track[cdrom->cur_track].id, m, s);
-    }

Listing the tracks on a CD

    SDL_CD *cdrom;          /* Assuming this has already been set.. */
-    int i;
-    int m, s, f;
-
-    SDL_CDStatus(cdrom);
-    printf("Drive tracks: %d\n", cdrom->numtracks);
-    for ( i=0; i<cdrom->numtracks; ++i ) {
-        FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
-        if ( f > 0 )
-            ++s;
-        printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
-        cdrom->track[i].id, m, s);
-    }

Play an entire CD

    SDL_CD *cdrom;          /* Assuming this has already been set.. */
-
-    // Play entire CD:
-    if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
-        SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
-
-        // Play last track:
-        if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
-            SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
-        }
-
-        // Play first and second track and 10 seconds of third track:
-        if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
-            SDL_CDPlayTracks(cdrom, 0, 0, 2, CD_FPS * 10);


PrevHomeNext
Audio ExamplesUpTime Examples
\ No newline at end of file diff --git a/docs/html/guidecredits.html b/docs/html/guidecredits.html deleted file mode 100644 index b66b28f54d..0000000000 --- a/docs/html/guidecredits.html +++ /dev/null @@ -1,195 +0,0 @@ -Credits
SDL Library Documentation
PrevPrefaceNext

Credits

Sam Lantinga, slouken@libsdl.org
Martin Donlon, akawaka@skynet.ie
Mattias Engdegård
Julian Peterson
Ken Jordan
Maxim Sobolev
Wesley Poole
Michael Vance
Andreas Umbach
Andreas Hofmeister


PrevHomeNext
About SDLdocUpThe Basics
\ No newline at end of file diff --git a/docs/html/guideeventexamples.html b/docs/html/guideeventexamples.html deleted file mode 100644 index 300136947c..0000000000 --- a/docs/html/guideeventexamples.html +++ /dev/null @@ -1,247 +0,0 @@ -Event Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Event Examples

Filtering and Handling Events

#include <stdio.h>
-#include <stdlib.h>
-
-#include "SDL.h"
-
-/* This function may run in a separate event thread */
-int FilterEvents(const SDL_Event *event) {
-    static int boycott = 1;
-
-    /* This quit event signals the closing of the window */
-    if ( (event->type == SDL_QUIT) && boycott ) {
-        printf("Quit event filtered out -- try again.\n");
-        boycott = 0;
-        return(0);
-    }
-    if ( event->type == SDL_MOUSEMOTION ) {
-        printf("Mouse moved to (%d,%d)\n",
-                event->motion.x, event->motion.y);
-        return(0);    /* Drop it, we've handled it */
-    }
-    return(1);
-}
-
-int main(int argc, char *argv[])
-{
-    SDL_Event event;
-
-    /* Initialize the SDL library (starts the event loop) */
-    if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
-        fprintf(stderr,
-                "Couldn't initialize SDL: %s\n", SDL_GetError());
-        exit(1);
-    }
-
-    /* Clean up on exit, exit on window close and interrupt */
-    atexit(SDL_Quit);
-
-    /* Ignore key events */
-    SDL_EventState(SDL_KEYDOWN, SDL_IGNORE);
-    SDL_EventState(SDL_KEYUP, SDL_IGNORE);
-
-    /* Filter quit and mouse motion events */
-    SDL_SetEventFilter(FilterEvents);
-
-    /* The mouse isn't much use unless we have a display for reference */
-    if ( SDL_SetVideoMode(640, 480, 8, 0) == NULL ) {
-        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
-                        SDL_GetError());
-        exit(1);
-    }
-
-    /* Loop waiting for ESC+Mouse_Button */
-    while ( SDL_WaitEvent(&event) >= 0 ) {
-        switch (event.type) {
-            case SDL_ACTIVEEVENT: {
-                if ( event.active.state & SDL_APPACTIVE ) {
-                    if ( event.active.gain ) {
-                        printf("App activated\n");
-                    } else {
-                        printf("App iconified\n");
-                    }
-                }
-            }
-            break;
-                    
-            case SDL_MOUSEBUTTONDOWN: {
-                Uint8 *keys;
-
-                keys = SDL_GetKeyState(NULL);
-                if ( keys[SDLK_ESCAPE] == SDL_PRESSED ) {
-                    printf("Bye bye...\n");
-                    exit(0);
-                }
-                printf("Mouse button pressed\n");
-            }
-            break;
-
-            case SDL_QUIT: {
-                printf("Quit requested, quitting.\n");
-                exit(0);
-            }
-            break;
-        }
-    }
-    /* This should never happen */
-    printf("SDL_WaitEvent error: %s\n", SDL_GetError());
-    exit(1);
-}


PrevHomeNext
ExamplesUpAudio Examples
\ No newline at end of file diff --git a/docs/html/guideexamples.html b/docs/html/guideexamples.html deleted file mode 100644 index 5b9a8471df..0000000000 --- a/docs/html/guideexamples.html +++ /dev/null @@ -1,188 +0,0 @@ -Examples
SDL Library Documentation
PrevNext

Chapter 4. Examples

Introduction

For the moment these examples are taken directly from the old SDL documentation. By the 1.2 release these examples should hopefully deal with most common SDL programming problems.


PrevHomeNext
Handling the KeyboardUpEvent Examples
\ No newline at end of file diff --git a/docs/html/guideinput.html b/docs/html/guideinput.html deleted file mode 100644 index 9b9bbe1e68..0000000000 --- a/docs/html/guideinput.html +++ /dev/null @@ -1,739 +0,0 @@ -Input handling
SDL Library Documentation
PrevNext

Chapter 3. Input handling

Handling Joysticks

Initialization

The first step in using a joystick in a SDL program is to initialize the Joystick subsystems of SDL. This done by passing the SDL_INIT_JOYSTICK flag to SDL_Init. The joystick flag will usually be used in conjunction with other flags (like the video flag) because the joystick is usually used to control something.

Example 3-1. Initializing SDL with Joystick Support

    if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0)
-    {
-        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
-        exit(1);
-    }

This will attempt to start SDL with both the video and the joystick subsystems activated.

Querying

If we have reached this point then we can safely assume that the SDL library has been initialized and that the Joystick subsystem is active. We can now call some video and/or sound functions to get things going before we need the joystick. Eventually we have to make sure that there is actually a joystick to work with. It's wise to always check even if you know a joystick will be present on the system because it can also help detect when the joystick is unplugged. The function used to check for joysticks is SDL_NumJoysticks.

This function simply returns the number of joysticks available on the system. If it is at least one then we are in good shape. The next step is to determine which joystick the user wants to use. If the number of joysticks available is only one then it is safe to assume that one joystick is the one the user wants to use. SDL has a function to get the name of the joysticks as assigned by the operations system and that function is SDL_JoystickName. The joystick is specified by an index where 0 is the first joystick and the last joystick is the number returned by SDL_NumJoysticks - 1. In the demonstration a list of all available joysticks is printed to stdout.

Example 3-2. Querying the Number of Available Joysticks

    printf("%i joysticks were found.\n\n", SDL_NumJoysticks() );
-    printf("The names of the joysticks are:\n");
-		
-    for( i=0; i < SDL_NumJoysticks(); i++ ) 
-    {
-        printf("    %s\n", SDL_JoystickName(i));
-    }

Opening a Joystick and Receiving Joystick Events

SDL's event driven architecture makes working with joysticks a snap. Joysticks can trigger 4 different types of events: -

SDL_JoyAxisEventOccurs when an axis changes
SDL_JoyBallEventOccurs when a joystick trackball's position changes
SDL_JoyHatEventOccurs when a hat's position changes
SDL_JoyButtonEventOccurs when a button is pressed or released

Events are received from all joysticks opened. The first thing that needs to be done in order to receive joystick events is to call SDL_JoystickEventState with the SDL_ENABLE flag. Next you must open the joysticks that you want to receive events from. This is done with the SDL_JoystickOpen function. For the example we are only interested in events from the first joystick on the system, regardless of what it may be. To receive events from it we would do this:

Example 3-3. Opening a Joystick

    SDL_Joystick *joystick;
-
-    SDL_JoystickEventState(SDL_ENABLE);
-    joystick = SDL_JoystickOpen(0);

If we wanted to receive events for other joysticks we would open them with calls to SDL_JoystickOpen just like we opened joystick 0, except we would store the SDL_Joystick structure they return in a different pointer. We only need the joystick pointer when we are querying the joysticks or when we are closing the joystick.

Up to this point all the code we have is used just to initialize the joysticks in order to read values at run time. All we need now is an event loop, which is something that all SDL programs should have anyway to receive the systems quit events. We must now add code to check the event loop for at least some of the above mentioned events. Let's assume our event loop looks like this: -

    SDL_Event event;
-    /* Other initializtion code goes here */   
-
-    /* Start main game loop here */
-
-    while(SDL_PollEvent(&event))
-    {  
-        switch(event.type)
-        {  
-            case SDL_KEYDOWN:
-            /* handle keyboard stuff here */				
-            break;
-
-            case SDL_QUIT:
-            /* Set whatever flags are necessary to */
-            /* end the main game loop here */
-            break;
-        }
-    }
-
-    /* End loop here */
-To handle Joystick events we merely add cases for them, first we'll add axis handling code. Axis checks can get kinda of tricky because alot of the joystick events received are junk. Joystick axis have a tendency to vary just a little between polling due to the way they are designed. To compensate for this you have to set a threshold for changes and ignore the events that have'nt exceeded the threshold. 10% is usually a good threshold value. This sounds a lot more complicated than it is. Here is the Axis event handler:

Example 3-4. Joystick Axis Events

    case SDL_JOYAXISMOTION:  /* Handle Joystick Motion */
-    if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) 
-    {
-      /* code goes here */
-    }
-    break;

Another trick with axis events is that up-down and left-right movement are two different sets of axes. The most important axis is axis 0 (left-right) and axis 1 (up-down). To handle them seperatly in the code we do the following:

Example 3-5. More Joystick Axis Events

    case SDL_JOYAXISMOTION:  /* Handle Joystick Motion */
-    if ( ( event.jaxis.value < -3200 ) || (event.jaxis.value > 3200 ) ) 
-    {
-        if( event.jaxis.axis == 0) 
-        {
-            /* Left-right movement code goes here */
-        }
-
-        if( event.jaxis.axis == 1) 
-        {
-            /* Up-Down movement code goes here */
-        }
-    }
-    break;

Ideally the code here should use event.jaxis.value to scale something. For example lets assume you are using the joystick to control the movement of a spaceship. If the user is using an analog joystick and they push the stick a little bit they expect to move less than if they pushed it a lot. Designing your code for this situation is preferred because it makes the experience for users of analog controls better and remains the same for users of digital controls.

If your joystick has any additional axis then they may be used for other sticks or throttle controls and those axis return values too just with different event.jaxis.axis values.

Button handling is simple compared to the axis checking.

Example 3-6. Joystick Button Events

    case SDL_JOYBUTTONDOWN:  /* Handle Joystick Button Presses */
-    if ( event.jbutton.button == 0 ) 
-    {
-        /* code goes here */
-    }
-    break;

Button checks are simpler than axis checks because a button can only be pressed or not pressed. The SDL_JOYBUTTONDOWN event is triggered when a button is pressed and the SDL_JOYBUTTONUP event is fired when a button is released. We do have to know what button was pressed though, that is done by reading the event.jbutton.button field.

Lastly when we are through using our joysticks we should close them with a call to SDL_JoystickClose. To close our opened joystick 0 we would do this at the end of our program: -

    SDL_JoystickClose(joystick);

Advanced Joystick Functions

That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis with a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:

Example 3-7. Joystick Ball Events

    case SDL_JOYBALLMOTION:  /* Handle Joyball Motion */
-    if( event.jball.ball == 0 )
-    {
-      /* ball handling */
-    }
-    break;

The above checks the first joyball on the joystick. The change in position will be stored in event.jball.xrel and event.jball.yrel.

Finally we have the hat event. Hats report only the direction they are pushed in. We check hat's position with the bitmasks: - -

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT

- -Also there are some predefined combinations of the above: -

SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN

- -Our case for the hat may resemble the following:

Example 3-8. Joystick Hat Events

    case SDL_JOYHATMOTION:  /* Handle Hat Motion */
-    if ( event.jhat.value & SDL_HAT_UP )
-    {
-        /* Do up stuff here */
-    }
-
-    if ( event.jhat.value & SDL_HAT_LEFT )
-    {
-        /* Do left stuff here */
-    }
-
-    if ( event.jhat.value & SDL_HAT_RIGHTDOWN )
-    {
-        /* Do right and down together stuff here */
-    }
-    break;

In addition to the queries for number of joysticks on the system and their names there are additional functions to query the capabilities of attached joysticks: -

SDL_JoystickNumAxesReturns the number of joysitck axes
SDL_JoystickNumButtonsReturns the number of joysitck buttons
SDL_JoystickNumBallsReturns the number of joysitck balls
SDL_JoystickNumHatsReturns the number of joysitck hats

- -To use these functions we just have to pass in the joystick structure we got when we opened the joystick. For Example:

Example 3-9. Querying Joystick Characteristics

    int number_of_buttons;
-    SDL_Joystick *joystick;
-
-    joystick = SDL_JoystickOpen(0);
-    number_of_buttons = SDL_JoystickNumButtons(joystick);

This block of code would get the number of buttons on the first joystick in the system.


PrevHomeNext
Using OpenGL With SDLUpHandling the Keyboard
\ No newline at end of file diff --git a/docs/html/guideinputkeyboard.html b/docs/html/guideinputkeyboard.html deleted file mode 100644 index 787036c7f2..0000000000 --- a/docs/html/guideinputkeyboard.html +++ /dev/null @@ -1,746 +0,0 @@ -Handling the Keyboard
SDL Library Documentation
PrevChapter 3. Input handlingNext

Handling the Keyboard

Keyboard Related Structures

It should make it a lot easier to understand this tutorial is you are familiar with the data types involved in keyboard access, so I'll explain them first.

SDLKey

SDLKey is an enumerated type defined in SDL/include/SDL_keysym.h and detailed here. Each SDLKey symbol represents a key, SDLK_a corresponds to the 'a' key on a keyboard, SDLK_SPACE corresponds to the space bar, and so on.

SDLMod

SDLMod is an enumerated type, similar to SDLKey, however it enumerates keyboard modifiers (Control, Alt, Shift). The full list of modifier symbols is here. SDLMod values can be AND'd together to represent several modifiers.

SDL_keysym

typedef struct{
-  Uint8 scancode;
-  SDLKey sym;
-  SDLMod mod;
-  Uint16 unicode;
-} SDL_keysym;

The SDL_keysym structure describes a key press or a key release. The scancode field is hardware specific and should be ignored unless you know what your doing. The sym field is the SDLKey value of the key being pressed or released. The mod field describes the state of the keyboard modifiers at the time the key press or release occurred. So a value of KMOD_NUM | KMOD_CAPS | KMOD_LSHIFT would mean that Numlock, Capslock and the left shift key were all press (or enabled in the case of the lock keys). Finally, the unicode field stores the 16-bit unicode value of the key.

Note: It should be noted and understood that this field is only valid when the SDL_keysym is describing a key press, not a key release. Unicode values only make sense on a key press because the unicode value describes an international character and only key presses produce characters. More information on Unicode can be found at www.unicode.org

Note: Unicode translation must be enabled using the SDL_EnableUNICODE function.

SDL_KeyboardEvent

typedef struct{
-  Uint8 type;
-  Uint8 state;
-  SDL_keysym keysym;
-} SDL_KeyboardEvent;

The SDL_KeyboardEvent describes a keyboard event (obviously). The key member of the SDL_Event union is a SDL_KeyboardEvent structure. The type field specifies whether the event is a key release (SDL_KEYUP) or a key press (SDL_KEYDOWN) event. The state is largely redundant, it reports the same information as the type field but uses different values (SDL_RELEASED and SDL_PRESSED). The keysym contains information of the key press or release that this event represents (see above).

Reading Keyboard Events

Reading keybaord events from the event queue is quite simple (the event queue and using it is described here). We read events using SDL_PollEvent in a while() loop and check for SDL_KEYUP and SDL_KEYDOWN events using a switch statement, like so:

Example 3-10. Reading Keyboard Events

  SDL_Event event;
-  .
-  .
-  /* Poll for events. SDL_PollEvent() returns 0 when there are no  */
-  /* more events on the event queue, our while loop will exit when */
-  /* that occurs.                                                  */
-  while( SDL_PollEvent( &event ) ){
-    /* We are only worried about SDL_KEYDOWN and SDL_KEYUP events */
-    switch( event.type ){
-      case SDL_KEYDOWN:
-        printf( "Key press detected\n" );
-        break;
-
-      case SDL_KEYUP:
-        printf( "Key release detected\n" );
-        break;
-
-      default:
-        break;
-    }
-  }
-  .
-  .

This is a very basic example. No information about the key press or release is interpreted. We will explore the other extreme out our first full example below - reporting all available information about a keyboard event.

A More Detailed Look

Before we can read events SDL must be initialised with SDL_Init and a video mode must be set using SDL_SetVideoMode. There are, however, two other functions we must use to obtain all the information required. We must enable unicode translation by calling SDL_EnableUNICODE(1) and we must convert SDLKey values into something printable, using SDL_GetKeyName

Note: It is useful to note that unicode values < 0x80 translate directly a characters ASCII value. THis is used in the example below

Example 3-11. Interpreting Key Event Information


    #include "SDL.h"
-
-    /* Function Prototypes */
-    void PrintKeyInfo( SDL_KeyboardEvent *key );
-    void PrintModifiers( SDLMod mod );
-
-    /* main */
-    int main( int argc, char *argv[] ){
-        
-        SDL_Event event;
-        int quit = 0;
-        
-        /* Initialise SDL */
-        if( SDL_Init( SDL_INIT_VIDEO ) < 0){
-            fprintf( stderr, "Could not initialise SDL: %s\n", SDL_GetError() );
-            exit( -1 );
-        }
-
-        /* Set a video mode */
-        if( !SDL_SetVideoMode( 320, 200, 0, 0 ) ){
-            fprintf( stderr, "Could not set video mode: %s\n", SDL_GetError() );
-            SDL_Quit();
-            exit( -1 );
-        }
-
-        /* Enable Unicode translation */
-        SDL_EnableUNICODE( 1 );
-
-        /* Loop until an SDL_QUIT event is found */
-        while( !quit ){
-
-            /* Poll for events */
-            while( SDL_PollEvent( &event ) ){
-                
-                switch( event.type ){
-                    /* Keyboard event */
-                    /* Pass the event data onto PrintKeyInfo() */
-                    case SDL_KEYDOWN:
-                    case SDL_KEYUP:
-                        PrintKeyInfo( &event.key );
-                        break;
-
-                    /* SDL_QUIT event (window close) */
-                    case SDL_QUIT:
-                        quit = 1;
-                        break;
-
-                    default:
-                        break;
-                }
-
-            }
-
-        }
-
-        /* Clean up */
-        SDL_Quit();
-        exit( 0 );
-    }
-
-    /* Print all information about a key event */
-    void PrintKeyInfo( SDL_KeyboardEvent *key ){
-        /* Is it a release or a press? */
-        if( key->type == SDL_KEYUP )
-            printf( "Release:- " );
-        else
-            printf( "Press:- " );
-
-        /* Print the hardware scancode first */
-        printf( "Scancode: 0x%02X", key->keysym.scancode );
-        /* Print the name of the key */
-        printf( ", Name: %s", SDL_GetKeyName( key->keysym.sym ) );
-        /* We want to print the unicode info, but we need to make */
-        /* sure its a press event first (remember, release events */
-        /* don't have unicode info                                */
-        if( key->type == SDL_KEYDOWN ){
-            /* If the Unicode value is less than 0x80 then the    */
-            /* unicode value can be used to get a printable       */
-            /* representation of the key, using (char)unicode.    */
-            printf(", Unicode: " );
-            if( key->keysym.unicode < 0x80 && key->keysym.unicode > 0 ){
-                printf( "%c (0x%04X)", (char)key->keysym.unicode,
-                        key->keysym.unicode );
-            }
-            else{
-                printf( "? (0x%04X)", key->keysym.unicode );
-            }
-        }
-        printf( "\n" );
-        /* Print modifier info */
-        PrintModifiers( key->keysym.mod );
-    }
-
-    /* Print modifier info */
-    void PrintModifiers( SDLMod mod ){
-        printf( "Modifers: " );
-
-        /* If there are none then say so and return */
-        if( mod == KMOD_NONE ){
-            printf( "None\n" );
-            return;
-        }
-
-        /* Check for the presence of each SDLMod value */
-        /* This looks messy, but there really isn't    */
-        /* a clearer way.                              */
-        if( mod & KMOD_NUM ) printf( "NUMLOCK " );
-        if( mod & KMOD_CAPS ) printf( "CAPSLOCK " );
-        if( mod & KMOD_LCTRL ) printf( "LCTRL " );
-        if( mod & KMOD_RCTRL ) printf( "RCTRL " );
-        if( mod & KMOD_RSHIFT ) printf( "RSHIFT " );
-        if( mod & KMOD_LSHIFT ) printf( "LSHIFT " );
-        if( mod & KMOD_RALT ) printf( "RALT " );
-        if( mod & KMOD_LALT ) printf( "LALT " );
-        if( mod & KMOD_CTRL ) printf( "CTRL " );
-        if( mod & KMOD_SHIFT ) printf( "SHIFT " );
-        if( mod & KMOD_ALT ) printf( "ALT " );
-        printf( "\n" );
-    }

Game-type Input

I have found that people using keyboard events for games and other interactive applications don't always understand one fundemental point.

Keyboard events only take place when a keys state changes from being unpressed to pressed, and vice versa.

Imagine you have an image of an alien that you wish to move around using the cursor keys: when you pressed the left arrow key you want him to slide over to the left, and when you press the down key you want him to slide down the screen. Examine the following code; it highlights an error that many people have made. -

    /* Alien screen coordinates */
-    int alien_x=0, alien_y=0;
-    .
-    .
-    /* Initialise SDL and video modes and all that */
-    .
-    /* Main game loop */
-    /* Check for events */
-    while( SDL_PollEvent( &event ) ){
-        switch( event.type ){
-            /* Look for a keypress */
-            case SDL_KEYDOWN:
-                /* Check the SDLKey values and move change the coords */
-                switch( event.key.keysym.sym ){
-                    case SDLK_LEFT:
-                        alien_x -= 1;
-                        break;
-                    case SDLK_RIGHT:
-                        alien_x += 1;
-                        break;
-                    case SDLK_UP:
-                        alien_y -= 1;
-                        break;
-                    case SDLK_DOWN:
-                        alien_y += 1;
-                        break;
-                    default:
-                        break;
-                }
-            }
-        }
-    }
-    .
-    .
-At first glance you may think this is a perfectly reasonable piece of code for the task, but it isn't. Like I said keyboard events only occur when a key changes state, so the user would have to press and release the left cursor key 100 times to move the alien 100 pixels to the left.

To get around this problem we must not use the events to change the position of the alien, we use the events to set flags which are then used in a seperate section of code to move the alien. Something like this:

Example 3-12. Proper Game Movement

    /* Alien screen coordinates */
-    int alien_x=0, alien_y=0;
-    int alien_xvel=0, alien_yvel=0;
-    .
-    .
-    /* Initialise SDL and video modes and all that */
-    .
-    /* Main game loop */
-    /* Check for events */
-    while( SDL_PollEvent( &event ) ){
-        switch( event.type ){
-            /* Look for a keypress */
-            case SDL_KEYDOWN:
-                /* Check the SDLKey values and move change the coords */
-                switch( event.key.keysym.sym ){
-                    case SDLK_LEFT:
-                        alien_xvel = -1;
-                        break;
-                    case SDLK_RIGHT:
-                        alien_xvel =  1;
-                        break;
-                    case SDLK_UP:
-                        alien_yvel = -1;
-                        break;
-                    case SDLK_DOWN:
-                        alien_yvel =  1;
-                        break;
-                    default:
-                        break;
-                }
-                break;
-            /* We must also use the SDL_KEYUP events to zero the x */
-            /* and y velocity variables. But we must also be       */
-            /* careful not to zero the velocities when we shouldn't*/
-            case SDL_KEYUP:
-                switch( event.key.keysym.sym ){
-                    case SDLK_LEFT:
-                        /* We check to make sure the alien is moving */
-                        /* to the left. If it is then we zero the    */
-                        /* velocity. If the alien is moving to the   */
-                        /* right then the right key is still press   */
-                        /* so we don't tocuh the velocity            */
-                        if( alien_xvel < 0 )
-                            alien_xvel = 0;
-                        break;
-                    case SDLK_RIGHT:
-                        if( alien_xvel > 0 )
-                            alien_xvel = 0;
-                        break;
-                    case SDLK_UP:
-                        if( alien_yvel < 0 )
-                            alien_yvel = 0;
-                        break;
-                    case SDLK_DOWN:
-                        if( alien_yvel > 0 )
-                            alien_yvel = 0;
-                        break;
-                    default:
-                        break;
-                }
-                break;
-            
-            default:
-                break;
-        }
-    }
-    .
-    .
-    /* Update the alien position */
-    alien_x += alien_xvel;
-    alien_y += alien_yvel;

As can be seen, we use two extra variables, alien_xvel and alien_yvel, which represent the motion of the ship, it is these variables that we update when we detect keypresses and releases.


PrevHomeNext
Input handlingUpExamples
\ No newline at end of file diff --git a/docs/html/guidepreface.html b/docs/html/guidepreface.html deleted file mode 100644 index 9986fc6b75..0000000000 --- a/docs/html/guidepreface.html +++ /dev/null @@ -1,178 +0,0 @@ -Preface
SDL Library Documentation
PrevNext

Preface

About SDL

The SDL library is designed to make it easy to write games that run on Linux, *BSD, MacOS, Win32 and BeOS using the various native high-performance media interfaces, (for video, audio, etc) and presenting a single source-code level API to your application. SDL is a fairly low level API, but using it, completely portable applications can be written with a great deal of flexibility.


PrevHomeNext
SDL GuideUpAbout SDLdoc
\ No newline at end of file diff --git a/docs/html/guidethebasics.html b/docs/html/guidethebasics.html deleted file mode 100644 index 4f32363f38..0000000000 --- a/docs/html/guidethebasics.html +++ /dev/null @@ -1,173 +0,0 @@ -The Basics
SDL Library Documentation
PrevNext

Chapter 1. The Basics

Introduction

The SDL Guide section is pretty incomplete. If you feel you have anything to add mail akawaka@skynet.ie or visit http://akawaka.csn.ul.ie/tne/.


PrevHomeNext
CreditsUpInitializing SDL
\ No newline at end of file diff --git a/docs/html/guidetimeexamples.html b/docs/html/guidetimeexamples.html deleted file mode 100644 index 42b5019ebf..0000000000 --- a/docs/html/guidetimeexamples.html +++ /dev/null @@ -1,183 +0,0 @@ -Time Examples
SDL Library Documentation
PrevChapter 4. ExamplesNext

Time Examples

Time based game loop

#define TICK_INTERVAL    30
-
-static Uint32 next_time;
-
-Uint32 time_left(void)
-{
-    Uint32 now;
-
-    now = SDL_GetTicks();
-    if(next_time <= now)
-        return 0;
-    else
-        return next_time - now;
-}
-
-
-/* main game loop */
-
-    next_time = SDL_GetTicks() + TICK_INTERVAL;
-    while ( game_running ) {
-        update_game_state();
-        SDL_Delay(time_left());
-        next_time += TICK_INTERVAL;
-    }


PrevHomeNext
CDROM ExamplesUpSDL Reference
\ No newline at end of file diff --git a/docs/html/guidevideo.html b/docs/html/guidevideo.html deleted file mode 100644 index 85da77d1fd..0000000000 --- a/docs/html/guidevideo.html +++ /dev/null @@ -1,463 +0,0 @@ -Graphics and Video
SDL Library Documentation
PrevNext

Chapter 2. Graphics and Video

Introduction to SDL Video

Video is probably the most common thing that SDL is used for, and -so it has the most complete subsystem. Here are a few -examples to demonstrate the basics.

Initializing the Video Display

This is what almost all SDL programs have to do in one way or -another.

Example 2-1. Initializing the Video Display

    SDL_Surface *screen;
-
-    /* Initialize the SDL library */
-    if( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
-        fprintf(stderr,
-                "Couldn't initialize SDL: %s\n", SDL_GetError());
-        exit(1);
-    }
-
-    /* Clean up on exit */
-    atexit(SDL_Quit);
-    
-    /*
-     * Initialize the display in a 640x480 8-bit palettized mode,
-     * requesting a software surface
-     */
-    screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
-    if ( screen == NULL ) {
-        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
-                        SDL_GetError());
-        exit(1);
-    }

Initializing the Best Video Mode

If you have a preference for a certain pixel depth but will accept any -other, use SDL_SetVideoMode with SDL_ANYFORMAT as below. You can also -use SDL_VideoModeOK() to find the native video mode that is closest to -the mode you request.

Example 2-2. Initializing the Best Video Mode

    /* Have a preference for 8-bit, but accept any depth */
-    screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE|SDL_ANYFORMAT);
-    if ( screen == NULL ) {
-        fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
-                        SDL_GetError());
-        exit(1);
-    }
-    printf("Set 640x480 at %d bits-per-pixel mode\n",
-           screen->format->BitsPerPixel);

Loading and Displaying a BMP File

The following function loads and displays a BMP file given as -argument, once SDL is initialised and a video mode has been set.

Example 2-3. Loading and Displaying a BMP File

void display_bmp(char *file_name)
-{
-    SDL_Surface *image;
-
-    /* Load the BMP file into a surface */
-    image = SDL_LoadBMP(file_name);
-    if (image == NULL) {
-        fprintf(stderr, "Couldn't load %s: %s\n", file_name, SDL_GetError());
-        return;
-    }
-
-    /*
-     * Palettized screen modes will have a default palette (a standard
-     * 8*8*4 colour cube), but if the image is palettized as well we can
-     * use that palette for a nicer colour matching
-     */
-    if (image->format->palette && screen->format->palette) {
-    SDL_SetColors(screen, image->format->palette->colors, 0,
-                  image->format->palette->ncolors);
-    }
-
-    /* Blit onto the screen surface */
-    if(SDL_BlitSurface(image, NULL, screen, NULL) < 0)
-        fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
-
-    SDL_UpdateRect(screen, 0, 0, image->w, image->h);
-
-    /* Free the allocated BMP surface */
-    SDL_FreeSurface(image);
-}

Drawing Directly to the Display

The following two functions can be used to get and set single -pixels of a surface. They are carefully written to work with any depth -currently supported by SDL. Remember to lock the surface before -calling them, and to unlock it before calling any other SDL -functions.

To convert between pixel values and their red, green, blue -components, use SDL_GetRGB() and SDL_MapRGB().

Example 2-4. getpixel()

/*
- * Return the pixel value at (x, y)
- * NOTE: The surface must be locked before calling this!
- */
-Uint32 getpixel(SDL_Surface *surface, int x, int y)
-{
-    int bpp = surface->format->BytesPerPixel;
-    /* Here p is the address to the pixel we want to retrieve */
-    Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
-
-    switch(bpp) {
-    case 1:
-        return *p;
-
-    case 2:
-        return *(Uint16 *)p;
-
-    case 3:
-        if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
-            return p[0] << 16 | p[1] << 8 | p[2];
-        else
-            return p[0] | p[1] << 8 | p[2] << 16;
-
-    case 4:
-        return *(Uint32 *)p;
-
-    default:
-        return 0;       /* shouldn't happen, but avoids warnings */
-    }
-}

Example 2-5. putpixel()

/*
- * Set the pixel at (x, y) to the given value
- * NOTE: The surface must be locked before calling this!
- */
-void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
-{
-    int bpp = surface->format->BytesPerPixel;
-    /* Here p is the address to the pixel we want to set */
-    Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
-
-    switch(bpp) {
-    case 1:
-        *p = pixel;
-        break;
-
-    case 2:
-        *(Uint16 *)p = pixel;
-        break;
-
-    case 3:
-        if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
-            p[0] = (pixel >> 16) & 0xff;
-            p[1] = (pixel >> 8) & 0xff;
-            p[2] = pixel & 0xff;
-        } else {
-            p[0] = pixel & 0xff;
-            p[1] = (pixel >> 8) & 0xff;
-            p[2] = (pixel >> 16) & 0xff;
-        }
-        break;
-
-    case 4:
-        *(Uint32 *)p = pixel;
-        break;
-    }
-}

The following code uses the putpixel() function above to set a -yellow pixel in the middle of the screen.

Example 2-6. Using putpixel()


    /* Code to set a yellow pixel at the center of the screen */
-
-    int x, y;
-    Uint32 yellow;
-
-    /* Map the color yellow to this display (R=0xff, G=0xFF, B=0x00)
-       Note:  If the display is palettized, you must set the palette first.
-    */
-    yellow = SDL_MapRGB(screen->format, 0xff, 0xff, 0x00);
-
-    x = screen->w / 2;
-    y = screen->h / 2;
-
-    /* Lock the screen for direct access to the pixels */
-    if ( SDL_MUSTLOCK(screen) ) {
-        if ( SDL_LockSurface(screen) < 0 ) {
-            fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError());
-            return;
-        }
-    }
-
-    putpixel(screen, x, y, yellow);
-
-    if ( SDL_MUSTLOCK(screen) ) {
-        SDL_UnlockSurface(screen);
-    }
-    /* Update just the part of the display that we've changed */
-    SDL_UpdateRect(screen, x, y, 1, 1);
-
-    return;

PrevHomeNext
Initializing SDLUpUsing OpenGL With SDL
\ No newline at end of file diff --git a/docs/html/guidevideoopengl.html b/docs/html/guidevideoopengl.html deleted file mode 100644 index 0abd567186..0000000000 --- a/docs/html/guidevideoopengl.html +++ /dev/null @@ -1,730 +0,0 @@ -Using OpenGL With SDL
SDL Library Documentation
PrevChapter 2. Graphics and VideoNext

Using OpenGL With SDL

SDL has the ability to create and use OpenGL contexts on several platforms(Linux/X11, Win32, BeOS, MacOS Classic/Toolbox, Mac OS X, FreeBSD/X11 and Solaris/X11). This allows you to use SDL's audio, event handling, threads and times in your OpenGL applications (a function often performed by GLUT).

Initialisation

Initialising SDL to use OpenGL is not very different to initialising SDL normally. There are three differences; you must pass SDL_OPENGL to SDL_SetVideoMode, you must specify several GL attributes (depth buffer size, framebuffer sizes) using SDL_GL_SetAttribute and finally, if you wish to use double buffering you must specify it as a GL attribute, not by passing the SDL_DOUBLEBUF flag to SDL_SetVideoMode.

Example 2-7. Initializing SDL with OpenGL

    /* Information about the current video settings. */
-    const SDL_VideoInfo* info = NULL;
-    /* Dimensions of our window. */
-    int width = 0;
-    int height = 0;
-    /* Color depth in bits of our window. */
-    int bpp = 0;
-    /* Flags we will pass into SDL_SetVideoMode. */
-    int flags = 0;
-
-    /* First, initialize SDL's video subsystem. */
-    if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
-        /* Failed, exit. */
-        fprintf( stderr, "Video initialization failed: %s\n",
-             SDL_GetError( ) );
-        quit_tutorial( 1 );
-    }
-
-    /* Let's get some video information. */
-    info = SDL_GetVideoInfo( );
-
-    if( !info ) {
-        /* This should probably never happen. */
-        fprintf( stderr, "Video query failed: %s\n",
-             SDL_GetError( ) );
-        quit_tutorial( 1 );
-    }
-
-    /*
-     * Set our width/height to 640/480 (you would
-     * of course let the user decide this in a normal
-     * app). We get the bpp we will request from
-     * the display. On X11, VidMode can't change
-     * resolution, so this is probably being overly
-     * safe. Under Win32, ChangeDisplaySettings
-     * can change the bpp.
-     */
-    width = 640;
-    height = 480;
-    bpp = info->vfmt->BitsPerPixel;
-
-    /*
-     * Now, we want to setup our requested
-     * window attributes for our OpenGL window.
-     * We want *at least* 5 bits of red, green
-     * and blue. We also want at least a 16-bit
-     * depth buffer.
-     *
-     * The last thing we do is request a double
-     * buffered window. '1' turns on double
-     * buffering, '0' turns it off.
-     *
-     * Note that we do not use SDL_DOUBLEBUF in
-     * the flags to SDL_SetVideoMode. That does
-     * not affect the GL attribute state, only
-     * the standard 2D blitting setup.
-     */
-    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
-    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
-    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
-    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
-    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
-
-    /*
-     * We want to request that SDL provide us
-     * with an OpenGL window, in a fullscreen
-     * video mode.
-     *
-     * EXERCISE:
-     * Make starting windowed an option, and
-     * handle the resize events properly with
-     * glViewport.
-     */
-    flags = SDL_OPENGL | SDL_FULLSCREEN;
-
-    /*
-     * Set the video mode
-     */
-    if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
-        /* 
-         * This could happen for a variety of reasons,
-         * including DISPLAY not being set, the specified
-         * resolution not being available, etc.
-         */
-        fprintf( stderr, "Video mode set failed: %s\n",
-             SDL_GetError( ) );
-        quit_tutorial( 1 );
-    }

Drawing

Apart from initialisation, using OpenGL within SDL is the same as using OpenGL -with any other API, e.g. GLUT. You still use all the same function calls and -data types. However if you are using a double-buffered display, then you must -use -SDL_GL_SwapBuffers() -to swap the buffers and update the display. To request double-buffering -with OpenGL, use -SDL_GL_SetAttribute -with SDL_GL_DOUBLEBUFFER, and use -SDL_GL_GetAttribute -to see if you actually got it.

A full example code listing is now presented below.

Example 2-8. SDL and OpenGL

/*
- * SDL OpenGL Tutorial.
- * (c) Michael Vance, 2000
- * briareos@lokigames.com
- *
- * Distributed under terms of the LGPL. 
- */
-
-#include <SDL/SDL.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-static GLboolean should_rotate = GL_TRUE;
-
-static void quit_tutorial( int code )
-{
-    /*
-     * Quit SDL so we can release the fullscreen
-     * mode and restore the previous video settings,
-     * etc.
-     */
-    SDL_Quit( );
-
-    /* Exit program. */
-    exit( code );
-}
-
-static void handle_key_down( SDL_keysym* keysym )
-{
-
-    /* 
-     * We're only interested if 'Esc' has
-     * been presssed.
-     *
-     * EXERCISE: 
-     * Handle the arrow keys and have that change the
-     * viewing position/angle.
-     */
-    switch( keysym->sym ) {
-    case SDLK_ESCAPE:
-        quit_tutorial( 0 );
-        break;
-    case SDLK_SPACE:
-        should_rotate = !should_rotate;
-        break;
-    default:
-        break;
-    }
-
-}
-
-static void process_events( void )
-{
-    /* Our SDL event placeholder. */
-    SDL_Event event;
-
-    /* Grab all the events off the queue. */
-    while( SDL_PollEvent( &event ) ) {
-
-        switch( event.type ) {
-        case SDL_KEYDOWN:
-            /* Handle key presses. */
-            handle_key_down( &event.key.keysym );
-            break;
-        case SDL_QUIT:
-            /* Handle quit requests (like Ctrl-c). */
-            quit_tutorial( 0 );
-            break;
-        }
-
-    }
-
-}
-
-static void draw_screen( void )
-{
-    /* Our angle of rotation. */
-    static float angle = 0.0f;
-
-    /*
-     * EXERCISE:
-     * Replace this awful mess with vertex
-     * arrays and a call to glDrawElements.
-     *
-     * EXERCISE:
-     * After completing the above, change
-     * it to use compiled vertex arrays.
-     *
-     * EXERCISE:
-     * Verify my windings are correct here ;).
-     */
-    static GLfloat v0[] = { -1.0f, -1.0f,  1.0f };
-    static GLfloat v1[] = {  1.0f, -1.0f,  1.0f };
-    static GLfloat v2[] = {  1.0f,  1.0f,  1.0f };
-    static GLfloat v3[] = { -1.0f,  1.0f,  1.0f };
-    static GLfloat v4[] = { -1.0f, -1.0f, -1.0f };
-    static GLfloat v5[] = {  1.0f, -1.0f, -1.0f };
-    static GLfloat v6[] = {  1.0f,  1.0f, -1.0f };
-    static GLfloat v7[] = { -1.0f,  1.0f, -1.0f };
-    static GLubyte red[]    = { 255,   0,   0, 255 };
-    static GLubyte green[]  = {   0, 255,   0, 255 };
-    static GLubyte blue[]   = {   0,   0, 255, 255 };
-    static GLubyte white[]  = { 255, 255, 255, 255 };
-    static GLubyte yellow[] = {   0, 255, 255, 255 };
-    static GLubyte black[]  = {   0,   0,   0, 255 };
-    static GLubyte orange[] = { 255, 255,   0, 255 };
-    static GLubyte purple[] = { 255,   0, 255,   0 };
-
-    /* Clear the color and depth buffers. */
-    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-
-    /* We don't want to modify the projection matrix. */
-    glMatrixMode( GL_MODELVIEW );
-    glLoadIdentity( );
-
-    /* Move down the z-axis. */
-    glTranslatef( 0.0, 0.0, -5.0 );
-
-    /* Rotate. */
-    glRotatef( angle, 0.0, 1.0, 0.0 );
-
-    if( should_rotate ) {
-
-        if( ++angle > 360.0f ) {
-            angle = 0.0f;
-        }
-
-    }
-
-    /* Send our triangle data to the pipeline. */
-    glBegin( GL_TRIANGLES );
-
-    glColor4ubv( red );
-    glVertex3fv( v0 );
-    glColor4ubv( green );
-    glVertex3fv( v1 );
-    glColor4ubv( blue );
-    glVertex3fv( v2 );
-
-    glColor4ubv( red );
-    glVertex3fv( v0 );
-    glColor4ubv( blue );
-    glVertex3fv( v2 );
-    glColor4ubv( white );
-    glVertex3fv( v3 );
-
-    glColor4ubv( green );
-    glVertex3fv( v1 );
-    glColor4ubv( black );
-    glVertex3fv( v5 );
-    glColor4ubv( orange );
-    glVertex3fv( v6 );
-
-    glColor4ubv( green );
-    glVertex3fv( v1 );
-    glColor4ubv( orange );
-    glVertex3fv( v6 );
-    glColor4ubv( blue );
-    glVertex3fv( v2 );
-
-    glColor4ubv( black );
-    glVertex3fv( v5 );
-    glColor4ubv( yellow );
-    glVertex3fv( v4 );
-    glColor4ubv( purple );
-    glVertex3fv( v7 );
-
-    glColor4ubv( black );
-    glVertex3fv( v5 );
-    glColor4ubv( purple );
-    glVertex3fv( v7 );
-    glColor4ubv( orange );
-    glVertex3fv( v6 );
-
-    glColor4ubv( yellow );
-    glVertex3fv( v4 );
-    glColor4ubv( red );
-    glVertex3fv( v0 );
-    glColor4ubv( white );
-    glVertex3fv( v3 );
-
-    glColor4ubv( yellow );
-    glVertex3fv( v4 );
-    glColor4ubv( white );
-    glVertex3fv( v3 );
-    glColor4ubv( purple );
-    glVertex3fv( v7 );
-
-    glColor4ubv( white );
-    glVertex3fv( v3 );
-    glColor4ubv( blue );
-    glVertex3fv( v2 );
-    glColor4ubv( orange );
-    glVertex3fv( v6 );
-
-    glColor4ubv( white );
-    glVertex3fv( v3 );
-    glColor4ubv( orange );
-    glVertex3fv( v6 );
-    glColor4ubv( purple );
-    glVertex3fv( v7 );
-
-    glColor4ubv( green );
-    glVertex3fv( v1 );
-    glColor4ubv( red );
-    glVertex3fv( v0 );
-    glColor4ubv( yellow );
-    glVertex3fv( v4 );
-
-    glColor4ubv( green );
-    glVertex3fv( v1 );
-    glColor4ubv( yellow );
-    glVertex3fv( v4 );
-    glColor4ubv( black );
-    glVertex3fv( v5 );
-
-    glEnd( );
-
-    /*
-     * EXERCISE:
-     * Draw text telling the user that 'Spc'
-     * pauses the rotation and 'Esc' quits.
-     * Do it using vetors and textured quads.
-     */
-
-    /*
-     * Swap the buffers. This this tells the driver to
-     * render the next frame from the contents of the
-     * back-buffer, and to set all rendering operations
-     * to occur on what was the front-buffer.
-     *
-     * Double buffering prevents nasty visual tearing
-     * from the application drawing on areas of the
-     * screen that are being updated at the same time.
-     */
-    SDL_GL_SwapBuffers( );
-}
-
-static void setup_opengl( int width, int height )
-{
-    float ratio = (float) width / (float) height;
-
-    /* Our shading model--Gouraud (smooth). */
-    glShadeModel( GL_SMOOTH );
-
-    /* Culling. */
-    glCullFace( GL_BACK );
-    glFrontFace( GL_CCW );
-    glEnable( GL_CULL_FACE );
-
-    /* Set the clear color. */
-    glClearColor( 0, 0, 0, 0 );
-
-    /* Setup our viewport. */
-    glViewport( 0, 0, width, height );
-
-    /*
-     * Change to the projection matrix and set
-     * our viewing volume.
-     */
-    glMatrixMode( GL_PROJECTION );
-    glLoadIdentity( );
-    /*
-     * EXERCISE:
-     * Replace this with a call to glFrustum.
-     */
-    gluPerspective( 60.0, ratio, 1.0, 1024.0 );
-}
-
-int main( int argc, char* argv[] )
-{
-    /* Information about the current video settings. */
-    const SDL_VideoInfo* info = NULL;
-    /* Dimensions of our window. */
-    int width = 0;
-    int height = 0;
-    /* Color depth in bits of our window. */
-    int bpp = 0;
-    /* Flags we will pass into SDL_SetVideoMode. */
-    int flags = 0;
-
-    /* First, initialize SDL's video subsystem. */
-    if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
-        /* Failed, exit. */
-        fprintf( stderr, "Video initialization failed: %s\n",
-             SDL_GetError( ) );
-        quit_tutorial( 1 );
-    }
-
-    /* Let's get some video information. */
-    info = SDL_GetVideoInfo( );
-
-    if( !info ) {
-        /* This should probably never happen. */
-        fprintf( stderr, "Video query failed: %s\n",
-             SDL_GetError( ) );
-        quit_tutorial( 1 );
-    }
-
-    /*
-     * Set our width/height to 640/480 (you would
-     * of course let the user decide this in a normal
-     * app). We get the bpp we will request from
-     * the display. On X11, VidMode can't change
-     * resolution, so this is probably being overly
-     * safe. Under Win32, ChangeDisplaySettings
-     * can change the bpp.
-     */
-    width = 640;
-    height = 480;
-    bpp = info->vfmt->BitsPerPixel;
-
-    /*
-     * Now, we want to setup our requested
-     * window attributes for our OpenGL window.
-     * We want *at least* 5 bits of red, green
-     * and blue. We also want at least a 16-bit
-     * depth buffer.
-     *
-     * The last thing we do is request a double
-     * buffered window. '1' turns on double
-     * buffering, '0' turns it off.
-     *
-     * Note that we do not use SDL_DOUBLEBUF in
-     * the flags to SDL_SetVideoMode. That does
-     * not affect the GL attribute state, only
-     * the standard 2D blitting setup.
-     */
-    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
-    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
-    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
-    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
-    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
-
-    /*
-     * We want to request that SDL provide us
-     * with an OpenGL window, in a fullscreen
-     * video mode.
-     *
-     * EXERCISE:
-     * Make starting windowed an option, and
-     * handle the resize events properly with
-     * glViewport.
-     */
-    flags = SDL_OPENGL | SDL_FULLSCREEN;
-
-    /*
-     * Set the video mode
-     */
-    if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
-        /* 
-         * This could happen for a variety of reasons,
-         * including DISPLAY not being set, the specified
-         * resolution not being available, etc.
-         */
-        fprintf( stderr, "Video mode set failed: %s\n",
-             SDL_GetError( ) );
-        quit_tutorial( 1 );
-    }
-
-    /*
-     * At this point, we should have a properly setup
-     * double-buffered window for use with OpenGL.
-     */
-    setup_opengl( width, height );
-
-    /*
-     * Now we want to begin our normal app process--
-     * an event loop with a lot of redrawing.
-     */
-    while( 1 ) {
-        /* Process incoming events. */
-        process_events( );
-        /* Draw the screen. */
-        draw_screen( );
-    }
-
-    /*
-     * EXERCISE:
-     * Record timings using SDL_GetTicks() and
-     * and print out frames per second at program
-     * end.
-     */
-
-    /* Never reached. */
-    return 0;
-}

PrevHomeNext
Graphics and VideoUpInput handling
\ No newline at end of file diff --git a/docs/html/index.html b/docs/html/index.html deleted file mode 100644 index f86ff191d3..0000000000 --- a/docs/html/index.html +++ /dev/null @@ -1,1156 +0,0 @@ -
Table of Contents
I. SDL Guide
Preface
About SDL
About SDLdoc
Credits
1. The Basics
Introduction
Initializing SDL
2. Graphics and Video
Introduction to SDL Video
Using OpenGL With SDL
3. Input handling
Handling Joysticks
Handling the Keyboard
4. Examples
Introduction
Event Examples
Audio Examples
CDROM Examples
Time Examples
II. SDL Reference
5. General
SDL_Init -- Initializes SDL
SDL_InitSubSystem -- Initialize subsystems
SDL_QuitSubSystem -- Shut down a subsystem
SDL_Quit -- Shut down SDL
SDL_WasInit -- Check which subsystems are initialized
SDL_GetError -- Get SDL error string
SDL_envvars -- SDL environment variables
6. Video
SDL_GetVideoSurface -- returns a pointer to the current display surface
SDL_GetVideoInfo -- returns a pointer to information about the video hardware
SDL_VideoDriverName -- Obtain the name of the video driver
SDL_ListModes -- Returns a pointer to an array of available screen dimensions for -the given format and video flags
SDL_VideoModeOK -- Check to see if a particular video mode is supported.
SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.
SDL_UpdateRect -- Makes sure the given area is updated on the given screen.
SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.
SDL_Flip -- Swaps screen buffers
SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.
SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.
SDL_SetGamma -- Sets the color gamma function for the display
SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display
SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display
SDL_MapRGB -- Map a RGB color value to a pixel format.
SDL_MapRGBA -- Map a RGBA color value to a pixel format.
SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.
SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.
SDL_CreateRGBSurface -- Create an empty SDL_Surface
SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data
SDL_FreeSurface -- Frees (deletes) a SDL_Surface
SDL_LockSurface -- Lock a surface for directly access.
SDL_UnlockSurface -- Unlocks a previously locked surface.
SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.
SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.
SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and -RLE acceleration.
SDL_SetAlpha -- Adjust the alpha properties of a surface
SDL_SetClipRect -- Sets the clipping rectangle for a surface.
SDL_GetClipRect -- Gets the clipping rectangle for a surface.
SDL_ConvertSurface -- Converts a surface to the same format as another surface.
SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.
SDL_FillRect -- This function performs a fast fill of the given rectangle with some color
SDL_DisplayFormat -- Convert a surface to the display format
SDL_DisplayFormatAlpha -- Convert a surface to the display format
SDL_WarpMouse -- Set the position of the mouse cursor.
SDL_CreateCursor -- Creates a new mouse cursor.
SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.
SDL_SetCursor -- Set the currently active mouse cursor.
SDL_GetCursor -- Get the currently active mouse cursor.
SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.
SDL_GL_LoadLibrary -- Specify an OpenGL library
SDL_GL_GetProcAddress -- Get the address of a GL function
SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute
SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute
SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display
SDL_CreateYUVOverlay -- Create a YUV video overlay
SDL_LockYUVOverlay -- Lock an overlay
SDL_UnlockYUVOverlay -- Unlock an overlay
SDL_DisplayYUVOverlay -- Blit the overlay to the display
SDL_FreeYUVOverlay -- Free a YUV video overlay
SDL_GLattr -- SDL GL Attributes
SDL_Rect -- Defines a rectangular area
SDL_Color -- Format independent color description
SDL_Palette -- Color palette for 8-bit pixel formats
SDL_PixelFormat -- Stores surface format information
SDL_Surface -- Graphical Surface Structure
SDL_VideoInfo -- Video Target information
SDL_Overlay -- YUV video overlay
7. Window Management
SDL_WM_SetCaption -- Sets the window tile and icon name.
SDL_WM_GetCaption -- Gets the window title and icon name.
SDL_WM_SetIcon -- Sets the icon for the display window.
SDL_WM_IconifyWindow -- Iconify/Minimise the window
SDL_WM_ToggleFullScreen -- Toggles fullscreen mode
SDL_WM_GrabInput -- Grabs mouse and keyboard input.
8. Events
Introduction
SDL Event Structures.
Event Functions.
9. Joystick
SDL_NumJoysticks -- Count available joysticks.
SDL_JoystickName -- Get joystick name.
SDL_JoystickOpen -- Opens a joystick for use.
SDL_JoystickOpened -- Determine if a joystick has been opened
SDL_JoystickIndex -- Get the index of an SDL_Joystick.
SDL_JoystickNumAxes -- Get the number of joystick axes
SDL_JoystickNumBalls -- Get the number of joystick trackballs
SDL_JoystickNumHats -- Get the number of joystick hats
SDL_JoystickNumButtons -- Get the number of joysitck buttons
SDL_JoystickUpdate -- Updates the state of all joysticks
SDL_JoystickGetAxis -- Get the current state of an axis
SDL_JoystickGetHat -- Get the current state of a joystick hat
SDL_JoystickGetButton -- Get the current state of a given button on a given joystick
SDL_JoystickGetBall -- Get relative trackball motion
SDL_JoystickClose -- Closes a previously opened joystick
10. Audio
SDL_AudioSpec -- Audio Specification Structure
SDL_OpenAudio -- Opens the audio device with the desired parameters.
SDL_PauseAudio -- Pauses and unpauses the audio callback processing
SDL_GetAudioStatus -- Get the current audio state
SDL_LoadWAV -- Load a WAVE file
SDL_FreeWAV -- Frees previously opened WAV data
SDL_AudioCVT -- Audio Conversion Structure
SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion
SDL_ConvertAudio -- Convert audio data to a desired audio format.
SDL_MixAudio -- Mix audio data
SDL_LockAudio -- Lock out the callback function
SDL_UnlockAudio -- Unlock the callback function
SDL_CloseAudio -- Shuts down audio processing and closes the audio device.
11. CD-ROM
SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.
SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.
SDL_CDOpen -- Opens a CD-ROM drive for access.
SDL_CDStatus -- Returns the current status of the given drive.
SDL_CDPlay -- Play a CD
SDL_CDPlayTracks -- Play the given CD track(s)
SDL_CDPause -- Pauses a CDROM
SDL_CDResume -- Resumes a CDROM
SDL_CDStop -- Stops a CDROM
SDL_CDEject -- Ejects a CDROM
SDL_CDClose -- Closes a SDL_CD handle
SDL_CD -- CDROM Drive Information
SDL_CDtrack -- CD Track Information Structure
12. Multi-threaded Programming
SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.
SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.
SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread
SDL_WaitThread -- Wait for a thread to finish.
SDL_KillThread -- Gracelessly terminates the thread.
SDL_CreateMutex -- Create a mutex
SDL_DestroyMutex -- Destroy a mutex
SDL_mutexP -- Lock a mutex
SDL_mutexV -- Unlock a mutex
SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.
SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.
SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.
SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.
SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.
SDL_SemPost -- Unlock a semaphore.
SDL_SemValue -- Return the current value of a semaphore.
SDL_CreateCond -- Create a condition variable
SDL_DestroyCond -- Destroy a condition variable
SDL_CondSignal -- Restart a thread wait on a condition variable
SDL_CondBroadcast -- Restart all threads waiting on a condition variable
SDL_CondWait -- Wait on a condition variable
SDL_CondWaitTimeout -- Wait on a condition variable, with timeout
13. Time
SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.
SDL_Delay -- Wait a specified number of milliseconds before returning.
SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has -elapsed.
SDL_RemoveTimer -- Remove a timer which was added with -SDL_AddTimer.
SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has -elapsed.

  Next
  SDL Guide
\ No newline at end of file diff --git a/docs/html/joystick.html b/docs/html/joystick.html deleted file mode 100644 index 05da008b3b..0000000000 --- a/docs/html/joystick.html +++ /dev/null @@ -1,296 +0,0 @@ -Joystick
SDL Library Documentation
PrevNext

Chapter 9. Joystick

Table of Contents
SDL_NumJoysticks -- Count available joysticks.
SDL_JoystickName -- Get joystick name.
SDL_JoystickOpen -- Opens a joystick for use.
SDL_JoystickOpened -- Determine if a joystick has been opened
SDL_JoystickIndex -- Get the index of an SDL_Joystick.
SDL_JoystickNumAxes -- Get the number of joystick axes
SDL_JoystickNumBalls -- Get the number of joystick trackballs
SDL_JoystickNumHats -- Get the number of joystick hats
SDL_JoystickNumButtons -- Get the number of joysitck buttons
SDL_JoystickUpdate -- Updates the state of all joysticks
SDL_JoystickGetAxis -- Get the current state of an axis
SDL_JoystickGetHat -- Get the current state of a joystick hat
SDL_JoystickGetButton -- Get the current state of a given button on a given joystick
SDL_JoystickGetBall -- Get relative trackball motion
SDL_JoystickClose -- Closes a previously opened joystick

Joysticks, and other similar input devices, have a very strong role in game playing and SDL provides comprehensive support for them. Axes, Buttons, POV Hats and trackballs are all supported.

Joystick support is initialized by passed the SDL_INIT_JOYSTICK flag to SDL_Init. Once initilized joysticks must be opened using SDL_JoystickOpen.

While using the functions describe in this secton may seem like the best way to access and read from joysticks, in most cases they aren't. Ideally joysticks should be read using the event system. To enable this, you must set the joystick event processing state with SDL_JoystickEventState. Joysticks must be opened before they can be used of course.

Note: If you are not handling the joystick via the event queue then you must explicitly request a joystick update by calling SDL_JoystickUpdate.

Note: Force Feedback is not yet supported. Sam (slouken@libsdl.org) is soliciting suggestions from people with force-feedback experience on the best way to design the API.


PrevHomeNext
SDL_JoystickEventStateUpSDL_NumJoysticks
\ No newline at end of file diff --git a/docs/html/reference.html b/docs/html/reference.html deleted file mode 100644 index e7707a7504..0000000000 --- a/docs/html/reference.html +++ /dev/null @@ -1,194 +0,0 @@ -SDL Reference
SDL Library Documentation
PrevNext

II. SDL Reference


PrevHomeNext
Time Examples General
\ No newline at end of file diff --git a/docs/html/sdlactiveevent.html b/docs/html/sdlactiveevent.html deleted file mode 100644 index d3f2821e72..0000000000 --- a/docs/html/sdlactiveevent.html +++ /dev/null @@ -1,335 +0,0 @@ -SDL_ActiveEvent
SDL Library Documentation
PrevNext

SDL_ActiveEvent

Name

SDL_ActiveEvent -- Application visibility event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 gain;
-  Uint8 state;
-} SDL_ActiveEvent;

Structure Data

typeSDL_ACTIVEEVENT.
gain0 if the event is a loss or 1 if it is a gain.
stateSDL_APPMOUSEFOCUS if mouse focus was gained or lost, SDL_APPINPUTFOCUS if input focus was gained or lost, or SDL_APPACTIVE if the application was iconified (gain=0) or restored(gain=1).

Description

SDL_ActiveEvent is a member of the SDL_Event union and is used when an event of type SDL_ACTIVEEVENT is reported.

When the mouse leaves or enters the window area a SDL_APPMOUSEFOCUS type activation event occurs, if the mouse entered the window then gain will be 1, otherwise gain will be 0. A SDL_APPINPUTFOCUS type activation event occurs when the application loses or gains keyboard focus. This usually occurs when another application is made active. Finally, a SDL_APPACTIVE type event occurs when the application is either minimised/iconified (gain=0) or restored.

Note: This event does not occur when an application window is first created.


PrevHomeNext
SDL_EventUpSDL_KeyboardEvent
\ No newline at end of file diff --git a/docs/html/sdladdtimer.html b/docs/html/sdladdtimer.html deleted file mode 100644 index 81c49e56d6..0000000000 --- a/docs/html/sdladdtimer.html +++ /dev/null @@ -1,296 +0,0 @@ -SDL_AddTimer
SDL Library Documentation
PrevNext

SDL_AddTimer

Name

SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has -elapsed.

Synopsis

#include "SDL.h"

SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);

Callback

/* type definition for the "new" timer callback function */
-typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);

Description

Adds a callback function to be run after the specified number of -milliseconds has elapsed. The callback function is passed the current -timer interval and the user supplied parameter from the -SDL_AddTimer call and returns the next timer -interval. If the returned value from the callback is the same as the one -passed in, the periodic alarm continues, otherwise a new alarm is -scheduled.

To cancel a currently running timer call -SDL_RemoveTimer with the -timer ID returned from -SDL_AddTimer.

The timer callback function may run in a different thread than your -main program, and so shouldn't call any functions from within itself. -You may always call SDL_PushEvent, however.

The granularity of the timer is platform-dependent, but you should count -on it being at least 10 ms as this is the most common number. -This means that if -you request a 16 ms timer, your callback will run approximately 20 ms -later on an unloaded system. If you wanted to set a flag signaling -a frame update at 30 frames per second (every 33 ms), you might set a -timer for 30 ms (see example below). - -If you use this function, you need to pass SDL_INIT_TIMER -to SDL_Init.

Return Value

Returns an ID value for the added timer or -NULL if there was an error.

Examples

my_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);


PrevHomeNext
SDL_DelayUpSDL_RemoveTimer
\ No newline at end of file diff --git a/docs/html/sdlaudiocvt.html b/docs/html/sdlaudiocvt.html deleted file mode 100644 index ff39209080..0000000000 --- a/docs/html/sdlaudiocvt.html +++ /dev/null @@ -1,556 +0,0 @@ -SDL_AudioCVT
SDL Library Documentation
PrevNext

SDL_AudioCVT

Name

SDL_AudioCVT -- Audio Conversion Structure

Structure Definition

typedef struct{
-  int needed;
-  Uint16 src_format;
-  Uint16 dest_format;
-  double rate_incr;
-  Uint8 *buf;
-  int len;
-  int len_cvt;
-  int len_mult;
-  double len_ratio;
-  void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
-  int filter_index;
-} SDL_AudioCVT;

Structure Data

neededSet to one if the conversion is possible
src_formatAudio format of the source
dest_formatAudio format of the destination
rate_incrRate conversion increment
bufAudio buffer
lenLength of the original audio buffer in bytes
len_cvtLength of converted audio buffer in bytes (calculated)
len_multbuf must be len*len_mult bytes in size(calculated)
len_ratioFinal audio size is len*len_ratio
filters[10](..)Pointers to functions needed for this conversion
filter_indexCurrent conversion function

Description

The SDL_AudioCVT is used to convert audio data between different formats. A SDL_AudioCVT structure is created with the SDL_BuildAudioCVT function, while the actual conversion is done by the SDL_ConvertAudio function.

Many of the fields in the SDL_AudioCVT structure should be considered private and their function will not be discussed here.

Uint8 *buf

This points to the audio data that will be used in the conversion. It is both the source and the destination, which means the converted audio data overwrites the original data. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure buf is large enough. See below.

int len

This is the length of the original audio data in bytes.

int len_mult

As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data. The length of buf should be len*len_mult.

double len_ratio

When you have finished converting your audio data, you need to know how much of your audio buffer is valid. len*len_ratio is the size of the converted audio data in bytes. This is very similar to len_mult, however when the convert audio data is shorter than the original len_mult would be 1. len_ratio, on the other hand, would be a fractional number between 0 and 1.


PrevHomeNext
SDL_FreeWAVUpSDL_BuildAudioCVT
\ No newline at end of file diff --git a/docs/html/sdlaudiospec.html b/docs/html/sdlaudiospec.html deleted file mode 100644 index fc6fa75035..0000000000 --- a/docs/html/sdlaudiospec.html +++ /dev/null @@ -1,589 +0,0 @@ -SDL_AudioSpec
SDL Library Documentation
PrevNext

SDL_AudioSpec

Name

SDL_AudioSpec -- Audio Specification Structure

Structure Definition

typedef struct{
-  int freq;
-  Uint16 format;
-  Uint8 channels;
-  Uint8 silence;
-  Uint16 samples;
-  Uint32 size;
-  void (*callback)(void *userdata, Uint8 *stream, int len);
-  void *userdata;
-} SDL_AudioSpec;

Structure Data

freqAudio frequency in samples per second
formatAudio data format
channelsNumber of channels: 1 mono, 2 stereo
silenceAudio buffer silence value (calculated)
samplesAudio buffer size in samples
sizeAudio buffer size in bytes (calculated)
callback(..)Callback function for filling the audio buffer
userdataPointer the user data which is passed to the callback function

Description

The SDL_AudioSpec structure is used to describe the format of some audio data. This structure is used by SDL_OpenAudio and SDL_LoadWAV. While all fields are used by SDL_OpenAudio only freq, format, samples and channels are used by SDL_LoadWAV. We will detail these common members here.

freq

The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better.

format

Specifies the size and type of each sample element -

AUDIO_U8

Unsigned 8-bit samples

AUDIO_S8

Signed 8-bit samples

AUDIO_U16 or AUDIO_U16LSB

Unsigned 16-bit little-endian samples

AUDIO_S16 or AUDIO_S16LSB

Signed 16-bit little-endian samples

AUDIO_U16MSB

Unsigned 16-bit big-endian samples

AUDIO_S16MSB

Signed 16-bit big-endian samples

AUDIO_U16SYS

Either AUDIO_U16LSB or AUDIO_U16MSB depending on you systems endianness

AUDIO_S16SYS

Either AUDIO_S16LSB or AUDIO_S16MSB depending on you systems endianness

channelsThe number of seperate sound channels. 1 is mono (single channel), 2 is stereo (dual channel).
samplesWhen used with SDL_OpenAudio this refers to the size of the audio buffer in samples. A sample a chunk of audio data of the size specified in format mulitplied by the number of channels. When the SDL_AudioSpec is used with SDL_LoadWAV samples is set to 4096.


PrevHomeNext
AudioUpSDL_OpenAudio
\ No newline at end of file diff --git a/docs/html/sdlblitsurface.html b/docs/html/sdlblitsurface.html deleted file mode 100644 index 3123ff5dde..0000000000 --- a/docs/html/sdlblitsurface.html +++ /dev/null @@ -1,339 +0,0 @@ -SDL_BlitSurface
SDL Library Documentation
PrevNext

SDL_BlitSurface

Name

SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.

Synopsis

#include "SDL.h"

int SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);

Description

This performs a fast blit from the source surface to the destination surface.

The width and height in srcrect determine the -size of the copied rectangle. Only the position is used in the -dstrect (the width and height are ignored).

If srcrect is NULL, the -entire surface is copied. If dstrect is -NULL, then the destination position (upper left -corner) is (0, 0).

The final blit rectangle is saved in -dstrect after all clipping is performed -(srcrect is not modified).

The blit function should not be called on a locked surface.

The results of blitting operations vary greatly depending on whether SDL_SRCAPLHA is set or not. See SDL_SetAlpha for an explaination of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain. -

if (source surface has SDL_SRCALPHA set) {
-    if (source surface has alpha channel (that is, format->Amask != 0))
-        blit using per-pixel alpha, ignoring any colour key
-    else {
-        if (source surface has SDL_SRCCOLORKEY set)
-            blit using the colour key AND the per-surface alpha value
-        else
-            blit using the per-surface alpha value
-    }
-} else {
-    if (source surface has SDL_SRCCOLORKEY set)
-        blit using the colour key
-    else
-        ordinary opaque rectangular blit
-}

Return Value

If the blit is successful, it returns 0, -otherwise it returns -1.

If either of the surfaces were in video memory, and the blit returns --2, the video memory was lost, so it should be -reloaded with artwork and re-blitted: -

        while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
-                while ( SDL_LockSurface(image)) < 0 )
-                        SDL_Delay(10);
-                -- Write image pixels to image->pixels --
-                SDL_UnlockSurface(image);
-        }
-This happens under DirectX 5.0 when the system switches away from your -fullscreen application. Locking the surface will also fail until you -have access to the video memory again.


PrevHomeNext
SDL_ConvertSurfaceUpSDL_FillRect
\ No newline at end of file diff --git a/docs/html/sdlbuildaudiocvt.html b/docs/html/sdlbuildaudiocvt.html deleted file mode 100644 index 2e8420e8a9..0000000000 --- a/docs/html/sdlbuildaudiocvt.html +++ /dev/null @@ -1,291 +0,0 @@ -SDL_BuildAudioCVT
SDL Library Documentation
PrevNext

SDL_BuildAudioCVT

Name

SDL_BuildAudioCVT -- Initializes a SDL_AudioCVT structure for conversion

Synopsis

#include "SDL.h"

int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate);

Description

Before an SDL_AudioCVT structure can be used to convert audio data it must be initialized with source and destination information.

src_format and dst_format are the source and destination format of the conversion. (For information on audio formats see SDL_AudioSpec). src_channels and dst_channels are the number of channels in the source and destination formats. Finally, src_rate and dst_rate are the frequency or samples-per-second of the source and destination formats. Once again, see SDL_AudioSpec.

Return Values

Returns -1 if the filter could not be built or 1 if it could.

Examples

See SDL_ConvertAudio.


PrevHomeNext
SDL_AudioCVTUpSDL_ConvertAudio
\ No newline at end of file diff --git a/docs/html/sdlcd.html b/docs/html/sdlcd.html deleted file mode 100644 index 6f8a7cdf60..0000000000 --- a/docs/html/sdlcd.html +++ /dev/null @@ -1,359 +0,0 @@ -SDL_CD
SDL Library Documentation
PrevNext

SDL_CD

Name

SDL_CD -- CDROM Drive Information

Structure Definition

typedef struct{
-  int id;
-  CDstatus status;
-  int numtracks;
-  int cur_track;
-  int cur_frame;
-  SDL_CDtrack track[SDL_MAX_TRACKS+1];
-} SDL_CD;

Structure Data

idPrivate drive identifier
statusDrive status
numtracksNumber of tracks on the CD
cur_trackCurrent track
cur_frameCurrent frame offset within the track
track[SDL_MAX_TRACKS+1]Array of track descriptions. (see SDL_CDtrack)

Description

An SDL_CD structure is returned by SDL_CDOpen. It represents an opened CDROM device and stores information on the layout of the tracks on the disc.

A frame is the base data unit of a CD. CD_FPS frames is equal to 1 second of music. SDL provides two macros for converting between time and frames: FRAMES_TO_MSF(f, M,S,F) and MSF_TO_FRAMES.

Examples

int min, sec, frame;
-int frame_offset;
-
-FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
-printf("Current Position: %d minutes, %d seconds, %d frames\n", min, sec, frame);
-
-frame_offset=MSF_TO_FRAMES(min, sec, frame);

PrevHomeNext
SDL_CDCloseUpSDL_CDtrack
\ No newline at end of file diff --git a/docs/html/sdlcdclose.html b/docs/html/sdlcdclose.html deleted file mode 100644 index 2a984a8b47..0000000000 --- a/docs/html/sdlcdclose.html +++ /dev/null @@ -1,217 +0,0 @@ -SDL_CDClose
SDL Library Documentation
PrevNext

SDL_CDClose

Name

SDL_CDClose -- Closes a SDL_CD handle

Synopsis

#include "SDL.h"

void SDL_CDClose(SDL_CD *cdrom);

Description

Closes the given cdrom handle.

See Also

SDL_CDOpen, -SDL_CD


PrevHomeNext
SDL_CDEjectUpSDL_CD
\ No newline at end of file diff --git a/docs/html/sdlcdeject.html b/docs/html/sdlcdeject.html deleted file mode 100644 index 03a3b780b5..0000000000 --- a/docs/html/sdlcdeject.html +++ /dev/null @@ -1,226 +0,0 @@ -SDL_CDEject
SDL Library Documentation
PrevNext

SDL_CDEject

Name

SDL_CDEject -- Ejects a CDROM

Synopsis

#include "SDL.h"

int SDL_CDEject(SDL_CD *cdrom);

Description

Ejects the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.

See Also

SDL_CD


PrevHomeNext
SDL_CDStopUpSDL_CDClose
\ No newline at end of file diff --git a/docs/html/sdlcdname.html b/docs/html/sdlcdname.html deleted file mode 100644 index 55a18e26e3..0000000000 --- a/docs/html/sdlcdname.html +++ /dev/null @@ -1,239 +0,0 @@ -SDL_CDName
SDL Library Documentation
PrevNext

SDL_CDName

Name

SDL_CDName -- Returns a human-readable, system-dependent identifier for the CD-ROM.

Synopsis

#include "SDL.h"

const char *SDL_CDName(int drive);

Description

Returns a human-readable, system-dependent identifier for the CD-ROM. drive is the index of the drive. Drive indices start to 0 and end at SDL_CDNumDrives()-1.

Examples

  • "/dev/cdrom"

  • "E:"

  • "/dev/disk/ide/1/master"


PrevHomeNext
SDL_CDNumDrivesUpSDL_CDOpen
\ No newline at end of file diff --git a/docs/html/sdlcdnumdrives.html b/docs/html/sdlcdnumdrives.html deleted file mode 100644 index 9816a739bb..0000000000 --- a/docs/html/sdlcdnumdrives.html +++ /dev/null @@ -1,205 +0,0 @@ -SDL_CDNumDrives
SDL Library Documentation
PrevNext

SDL_CDNumDrives

Name

SDL_CDNumDrives -- Returns the number of CD-ROM drives on the system.

Synopsis

#include "SDL.h"

int SDL_CDNumDrives(void);

Description

Returns the number of CD-ROM drives on the system.

See Also

SDL_CDOpen


PrevHomeNext
CD-ROMUpSDL_CDName
\ No newline at end of file diff --git a/docs/html/sdlcdopen.html b/docs/html/sdlcdopen.html deleted file mode 100644 index 09a6bd9f78..0000000000 --- a/docs/html/sdlcdopen.html +++ /dev/null @@ -1,275 +0,0 @@ -SDL_CDOpen
SDL Library Documentation
PrevNext

SDL_CDOpen

Name

SDL_CDOpen -- Opens a CD-ROM drive for access.

Synopsis

#include "SDL.h"

SDL_CD *SDL_CDOpen(int drive);

Description

Opens a CD-ROM drive for access. It returns a SDL_CD structure on success, or NULL if the drive was invalid or busy. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a NULL CD-ROM handle.

Drives are numbered starting with 0. -Drive 0 is the system default CD-ROM.

Examples

SDL_CD *cdrom;
-int cur_track;
-int min, sec, frame;
-SDL_Init(SDL_INIT_CDROM);
-atexit(SDL_Quit);
-
-/* Check for CD drives */
-if(!SDL_CDNumDrives()){
-  /* None found */
-  fprintf(stderr, "No CDROM devices available\n");
-  exit(-1);
-}
-
-/* Open the default drive */
-cdrom=SDL_CDOpen(0);
-
-/* Did if open? Check if cdrom is NULL */
-if(!cdrom){
-  fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
-  exit(-1);
-}
-
-/* Print Volume info */
-printf("Name: %s\n", SDL_CDName(0));
-printf("Tracks: %d\n", cdrom->numtracks);
-for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
-  FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
-  printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
-}
-
-SDL_CDClose(cdrom);

PrevHomeNext
SDL_CDNameUpSDL_CDStatus
\ No newline at end of file diff --git a/docs/html/sdlcdpause.html b/docs/html/sdlcdpause.html deleted file mode 100644 index 4def8e362e..0000000000 --- a/docs/html/sdlcdpause.html +++ /dev/null @@ -1,233 +0,0 @@ -SDL_CDPause
SDL Library Documentation
PrevNext

SDL_CDPause

Name

SDL_CDPause -- Pauses a CDROM

Synopsis

#include "SDL.h"

int SDL_CDPause(SDL_CD *cdrom);

Description

Pauses play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDPlayTracksUpSDL_CDResume
\ No newline at end of file diff --git a/docs/html/sdlcdplay.html b/docs/html/sdlcdplay.html deleted file mode 100644 index dc6489cc8d..0000000000 --- a/docs/html/sdlcdplay.html +++ /dev/null @@ -1,243 +0,0 @@ -SDL_CDPlay
SDL Library Documentation
PrevNext

SDL_CDPlay

Name

SDL_CDPlay -- Play a CD

Synopsis

#include "SDL.h"

int SDL_CDPlay(SDL_CD *cdrom, int start, int length);

Description

Plays the given cdrom, starting a frame start for length frames.

Return Values

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDStatusUpSDL_CDPlayTracks
\ No newline at end of file diff --git a/docs/html/sdlcdplaytracks.html b/docs/html/sdlcdplaytracks.html deleted file mode 100644 index 7546181904..0000000000 --- a/docs/html/sdlcdplaytracks.html +++ /dev/null @@ -1,325 +0,0 @@ -SDL_CDPlayTracks
SDL Library Documentation
PrevNext

SDL_CDPlayTracks

Name

SDL_CDPlayTracks -- Play the given CD track(s)

Synopsis

#include "SDL.h"

int SDL_CDPlayTracks(SDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes));

Description

SDL_CDPlayTracks plays the given CD starting at track -start_track, for ntracks tracks.

start_frame is the frame offset, from the beginning of the start_track, at which to start. nframes is the frame offset, from the beginning of the last track (start_track+ntracks), at which to end playing.

SDL_CDPlayTracks should only be called after calling -SDL_CDStatus -to get track information about the CD.

Note: Data tracks are ignored.

Return Value

Returns 0, or -1 -if there was an error.

Examples

/* assuming cdrom is a previously opened device */
-/* Play the entire CD */
-if(CD_INDRIVE(SDL_CDStatus(cdrom)))
-  SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
-
-/* Play the first track */
-if(CD_INDRIVE(SDL_CDStatus(cdrom)))
-  SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
-
-/* Play first 15 seconds of the 2nd track */
-if(CD_INDRIVE(SDL_CDStatus(cdrom)))
-  SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);
-


PrevHomeNext
SDL_CDPlayUpSDL_CDPause
\ No newline at end of file diff --git a/docs/html/sdlcdresume.html b/docs/html/sdlcdresume.html deleted file mode 100644 index 4a25ab69b6..0000000000 --- a/docs/html/sdlcdresume.html +++ /dev/null @@ -1,233 +0,0 @@ -SDL_CDResume
SDL Library Documentation
PrevNext

SDL_CDResume

Name

SDL_CDResume -- Resumes a CDROM

Synopsis

#include "SDL.h"

int SDL_CDResume(SDL_CD *cdrom);

Description

Resumes play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CDPauseUpSDL_CDStop
\ No newline at end of file diff --git a/docs/html/sdlcdstatus.html b/docs/html/sdlcdstatus.html deleted file mode 100644 index 3ebf9657e6..0000000000 --- a/docs/html/sdlcdstatus.html +++ /dev/null @@ -1,273 +0,0 @@ -SDL_CDStatus
SDL Library Documentation
PrevNext

SDL_CDStatus

Name

SDL_CDStatus -- Returns the current status of the given drive.

Synopsis

#include "SDL.h"

CDstatus SDL_CDStatus(SDL_CD *cdrom);

/* Given a status, returns true if there's a disk in the drive */
-#define CD_INDRIVE(status)      ((int)status > 0)

Description

This function returns the current status of the given drive. Status is described like so: -

typedef enum {
-  CD_TRAYEMPTY,
-  CD_STOPPED,
-  CD_PLAYING,
-  CD_PAUSED,
-  CD_ERROR = -1
-} CDstatus;

If the drive has a CD in it, the table of contents of the CD and current -play position of the CD will be stored in the SDL_CD structure.

The macro CD_INDRIVE is provided for convenience, -and given a status returns true if there's a disk in the drive.

Note: SDL_CDStatus also updates the SDL_CD structure passed to it.

Example

int playTrack(int track)
-{
-  int playing = 0;
-
-  if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
-  /* clamp to the actual number of tracks on the CD */
-    if (track >= cdrom->numtracks) {
-      track = cdrom->numtracks-1;
-    }
-
-    if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
-      playing = 1;
-    }
-  }
-  return playing;
-}

See Also

SDL_CD


PrevHomeNext
SDL_CDOpenUpSDL_CDPlay
\ No newline at end of file diff --git a/docs/html/sdlcdstop.html b/docs/html/sdlcdstop.html deleted file mode 100644 index 68f8d81bed..0000000000 --- a/docs/html/sdlcdstop.html +++ /dev/null @@ -1,226 +0,0 @@ -SDL_CDStop
SDL Library Documentation
PrevNext

SDL_CDStop

Name

SDL_CDStop -- Stops a CDROM

Synopsis

#include "SDL.h"

int SDL_CDStop(SDL_CD *cdrom);

Description

Stops play on the given cdrom.

Return Value

Returns 0 on success, or -1 on an error.

See Also

SDL_CDPlay,


PrevHomeNext
SDL_CDResumeUpSDL_CDEject
\ No newline at end of file diff --git a/docs/html/sdlcdtrack.html b/docs/html/sdlcdtrack.html deleted file mode 100644 index bbb04bbd25..0000000000 --- a/docs/html/sdlcdtrack.html +++ /dev/null @@ -1,313 +0,0 @@ -SDL_CDtrack
SDL Library Documentation
PrevNext

SDL_CDtrack

Name

SDL_CDtrack -- CD Track Information Structure

Structure Definition

typedef struct{
-  Uint8 id;
-  Uint8 type;
-  Uint32 length;
-  Uint32 offset;
-} SDL_CDtrack;

Structure Data

idTrack number (0-99)
typeSDL_AUDIO_TRACK or SDL_DATA_TRACK
lengthLength, in frames, of this track
offsetFrame offset to the beginning of this track

Description

SDL_CDtrack stores data on each track on a CD, its fields should be pretty self explainatory. It is a member a the SDL_CD structure.

Note: Frames can be converted to standard timings. There are CD_FPS frames per second, so SDL_CDtrack.length/CD_FPS=length_in_seconds.

See Also

SDL_CD


PrevHomeNext
SDL_CDUpMulti-threaded Programming
\ No newline at end of file diff --git a/docs/html/sdlcloseaudio.html b/docs/html/sdlcloseaudio.html deleted file mode 100644 index 599f058e44..0000000000 --- a/docs/html/sdlcloseaudio.html +++ /dev/null @@ -1,205 +0,0 @@ -SDL_CloseAudio
SDL Library Documentation
PrevNext

SDL_CloseAudio

Name

SDL_CloseAudio -- Shuts down audio processing and closes the audio device.

Synopsis

#include "SDL.h"

void SDL_CloseAudio(void);

Description

This function shuts down audio processing and closes the audio device.

See Also

SDL_OpenAudio


PrevHomeNext
SDL_UnlockAudioUpCD-ROM
\ No newline at end of file diff --git a/docs/html/sdlcolor.html b/docs/html/sdlcolor.html deleted file mode 100644 index c8b7d44fc9..0000000000 --- a/docs/html/sdlcolor.html +++ /dev/null @@ -1,300 +0,0 @@ -SDL_Color
SDL Library Documentation
PrevNext

SDL_Color

Name

SDL_Color -- Format independent color description

Structure Definition

typedef struct{
-  Uint8 r;
-  Uint8 g;
-  Uint8 b;
-  Uint8 unused;
-} SDL_Color;

Structure Data

rRed intensity
gGreen intensity
bBlue intensity
unusedUnused

Description

SDL_Color describes a color in a format independent way. You can convert a SDL_Color to a pixel value for a certain pixel format using SDL_MapRGB.


PrevHomeNext
SDL_RectUpSDL_Palette
\ No newline at end of file diff --git a/docs/html/sdlcondbroadcast.html b/docs/html/sdlcondbroadcast.html deleted file mode 100644 index 9b0fc83e0f..0000000000 --- a/docs/html/sdlcondbroadcast.html +++ /dev/null @@ -1,224 +0,0 @@ -SDL_CondBroadcast
SDL Library Documentation
PrevNext

SDL_CondBroadcast

Name

SDL_CondBroadcast -- Restart all threads waiting on a condition variable

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_CondBroadcast(SDL_cond *cond);

Description

Restarts all threads that are waiting on the condition variable, cond. Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CondSignalUpSDL_CondWait
\ No newline at end of file diff --git a/docs/html/sdlcondsignal.html b/docs/html/sdlcondsignal.html deleted file mode 100644 index 24e9175994..0000000000 --- a/docs/html/sdlcondsignal.html +++ /dev/null @@ -1,224 +0,0 @@ -SDL_CondSignal
SDL Library Documentation
PrevNext

SDL_CondSignal

Name

SDL_CondSignal -- Restart a thread wait on a condition variable

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_CondSignal(SDL_cond *cond);

Description

Restart one of the threads that are waiting on the condition variable, cond. Returns 0 on success of -1 on an error.


PrevHomeNext
SDL_DestroyCondUpSDL_CondBroadcast
\ No newline at end of file diff --git a/docs/html/sdlcondwait.html b/docs/html/sdlcondwait.html deleted file mode 100644 index 8f15452589..0000000000 --- a/docs/html/sdlcondwait.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_CondWait
SDL Library Documentation
PrevNext

SDL_CondWait

Name

SDL_CondWait -- Wait on a condition variable

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);

Description

Wait on the condition variable cond and unlock the provided mutex. The mutex must the locked before entering this function. Returns 0 when it is signalled, or -1 on an error.


PrevHomeNext
SDL_CondBroadcastUpSDL_CondWaitTimeout
\ No newline at end of file diff --git a/docs/html/sdlcondwaittimeout.html b/docs/html/sdlcondwaittimeout.html deleted file mode 100644 index deed50bfe2..0000000000 --- a/docs/html/sdlcondwaittimeout.html +++ /dev/null @@ -1,230 +0,0 @@ -SDL_CondWaitTimeout
SDL Library Documentation
PrevNext

SDL_CondWaitTimeout

Name

SDL_CondWaitTimeout -- Wait on a condition variable, with timeout

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);

Description

Wait on the condition variable cond for, at most, ms milliseconds. mut is unlocked so it must be locked when the function is called. Returns SDL_MUTEX_TIMEDOUT if the condition is not signalled in the allotted time, 0 if it was signalled or -1 on an error.

See Also

SDL_CondWait


PrevHomeNext
SDL_CondWaitUpTime
\ No newline at end of file diff --git a/docs/html/sdlconvertaudio.html b/docs/html/sdlconvertaudio.html deleted file mode 100644 index 52f122968a..0000000000 --- a/docs/html/sdlconvertaudio.html +++ /dev/null @@ -1,407 +0,0 @@ -SDL_ConvertAudio
SDL Library Documentation
PrevNext

SDL_ConvertAudio

Name

SDL_ConvertAudio -- Convert audio data to a desired audio format.

Synopsis

#include "SDL.h"

int SDL_ConvertAudio(SDL_AudioCVT *cvt);

Description

SDL_ConvertAudio takes one parameter, cvt, which was previously initilized. Initilizing a SDL_AudioCVT is a two step process. First of all, the structure must be passed to SDL_BuildAudioCVT along with source and destination format parameters. Secondly, the cvt->buf and cvt->len fields must be setup. cvt->buf should point to the audio data and cvt->len should be set to the length of the audio data in bytes. Remember, the length of the buffer pointed to by buf show be len*len_mult bytes in length.

Once the SDL_AudioCVTstructure is initilized then we can pass it to SDL_ConvertAudio, which will convert the audio data pointer to by cvt->buf. If SDL_ConvertAudio returned 0 then the conversion was completed successfully, otherwise -1 is returned.

If the conversion completed successfully then the converted audio data can be read from cvt->buf. The amount of valid, converted, audio data in the buffer is equal to cvt->len*cvt->len_ratio.

Examples

/* Converting some WAV data to hardware format */
-void my_audio_callback(void *userdata, Uint8 *stream, int len);
-
-SDL_AudioSpec *desired, *obtained;
-SDL_AudioSpec wav_spec;
-SDL_AudioCVT  wav_cvt;
-Uint32 wav_len;
-Uint8 *wav_buf;
-int ret;
-
-/* Allocated audio specs */
-desired = malloc(sizeof(SDL_AudioSpec));
-obtained = malloc(sizeof(SDL_AudioSpec));
-
-/* Set desired format */
-desired->freq=22050;
-desired->format=AUDIO_S16LSB;
-desired->samples=8192;
-desired->callback=my_audio_callback;
-desired->userdata=NULL;
-
-/* Open the audio device */
-if ( SDL_OpenAudio(desired, obtained) < 0 ){
-  fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
-  exit(-1);
-}
-        
-free(desired);
-
-/* Load the test.wav */
-if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buf, &wav_len) == NULL ){
-  fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
-  SDL_CloseAudio();
-  free(obtained);
-  exit(-1);
-}
-                                            
-/* Build AudioCVT */
-ret = SDL_BuildAudioCVT(&wav_cvt,
-                        wav_spec.format, wav_spec.channels, wav_spec.freq,
-                        obtained->format, obtained->channels, obtained->freq);
-
-/* Check that the convert was built */
-if(ret==-1){
-  fprintf(stderr, "Couldn't build converter!\n");
-  SDL_CloseAudio();
-  free(obtained);
-  SDL_FreeWAV(wav_buf);
-}
-
-/* Setup for conversion */
-wav_cvt.buf = malloc(wav_len * wav_cvt.len_mult);
-wav_cvt.len = wav_len;
-memcpy(wav_cvt.buf, wav_buf, wav_len);
-
-/* We can delete to original WAV data now */
-SDL_FreeWAV(wav_buf);
-
-/* And now we're ready to convert */
-SDL_ConvertAudio(&wav_cvt);
-
-/* do whatever */
-.
-.
-.
-.
-

PrevHomeNext
SDL_BuildAudioCVTUpSDL_MixAudio
\ No newline at end of file diff --git a/docs/html/sdlconvertsurface.html b/docs/html/sdlconvertsurface.html deleted file mode 100644 index cc21f7833e..0000000000 --- a/docs/html/sdlconvertsurface.html +++ /dev/null @@ -1,271 +0,0 @@ -SDL_ConvertSurface
SDL Library Documentation
PrevNext

SDL_ConvertSurface

Name

SDL_ConvertSurface -- Converts a surface to the same format as another surface.

Synopsis

#include "SDL/SDL.h"

SDL_Surface *SDL_ConvertSurface(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);

Description

Creates a new surface of the specified format, and then copies and maps -the given surface to it. If this function fails, it returns -NULL.

The flags parameter is passed to -SDL_CreateRGBSurface -and has those semantics.

This function is used internally by -SDL_DisplayFormat.

This function can only be called after SDL_Init.

Return Value

Returns either a pointer to the new surface, or -NULL on error.


PrevHomeNext
SDL_GetClipRectUpSDL_BlitSurface
\ No newline at end of file diff --git a/docs/html/sdlcreatecond.html b/docs/html/sdlcreatecond.html deleted file mode 100644 index 02fcdb2b3e..0000000000 --- a/docs/html/sdlcreatecond.html +++ /dev/null @@ -1,240 +0,0 @@ -SDL_CreateCond
SDL Library Documentation
PrevNext

SDL_CreateCond

Name

SDL_CreateCond -- Create a condition variable

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

SDL_cond *SDL_CreateCond(void);

Description

Creates a condition variable.

Examples

SDL_cond *cond;
-
-cond=SDL_CreateCond();
-.
-.
-/* Do stuff */
-
-.
-.
-SDL_DestroyCond(cond);

PrevHomeNext
SDL_SemValueUpSDL_DestroyCond
\ No newline at end of file diff --git a/docs/html/sdlcreatecursor.html b/docs/html/sdlcreatecursor.html deleted file mode 100644 index a444165ff0..0000000000 --- a/docs/html/sdlcreatecursor.html +++ /dev/null @@ -1,398 +0,0 @@ -SDL_CreateCursor
SDL Library Documentation
PrevNext

SDL_CreateCursor

Name

SDL_CreateCursor -- Creates a new mouse cursor.

Synopsis

#include "SDL.h"

SDL_Cursor *SDL_CreateCursor(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);

Description

Create a cursor using the specified data and mask (in MSB format). -The cursor width must be a multiple of 8 bits.

The cursor is created in black and white according to the following: -

Data / MaskResulting pixel on screen
0 / 1White
1 / 1Black
0 / 0Transparent
1 / 0Inverted color if possible, black if not.

Cursors created with this function must be freed with -SDL_FreeCursor.

Example

/* Stolen from the mailing list */
-/* Creates a new mouse cursor from an XPM */
-
-
-/* XPM */
-static const char *arrow[] = {
-  /* width height num_colors chars_per_pixel */
-  "    32    32        3            1",
-  /* colors */
-  "X c #000000",
-  ". c #ffffff",
-  "  c None",
-  /* pixels */
-  "X                               ",
-  "XX                              ",
-  "X.X                             ",
-  "X..X                            ",
-  "X...X                           ",
-  "X....X                          ",
-  "X.....X                         ",
-  "X......X                        ",
-  "X.......X                       ",
-  "X........X                      ",
-  "X.....XXXXX                     ",
-  "X..X..X                         ",
-  "X.X X..X                        ",
-  "XX  X..X                        ",
-  "X    X..X                       ",
-  "     X..X                       ",
-  "      X..X                      ",
-  "      X..X                      ",
-  "       XX                       ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "                                ",
-  "0,0"
-};
-
-static SDL_Cursor *init_system_cursor(const char *image[])
-{
-  int i, row, col;
-  Uint8 data[4*32];
-  Uint8 mask[4*32];
-  int hot_x, hot_y;
-
-  i = -1;
-  for ( row=0; row<32; ++row ) {
-    for ( col=0; col<32; ++col ) {
-      if ( col % 8 ) {
-        data[i] <<= 1;
-        mask[i] <<= 1;
-      } else {
-        ++i;
-        data[i] = mask[i] = 0;
-      }
-      switch (image[4+row][col]) {
-        case 'X':
-          data[i] |= 0x01;
-          mask[i] |= 0x01;
-          break;
-        case '.':
-          mask[i] |= 0x01;
-          break;
-        case ' ':
-          break;
-      }
-    }
-  }
-  sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
-  return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
-}

PrevHomeNext
SDL_WarpMouseUpSDL_FreeCursor
\ No newline at end of file diff --git a/docs/html/sdlcreatemutex.html b/docs/html/sdlcreatemutex.html deleted file mode 100644 index 53ed48bb20..0000000000 --- a/docs/html/sdlcreatemutex.html +++ /dev/null @@ -1,249 +0,0 @@ -SDL_CreateMutex
SDL Library Documentation
PrevNext

SDL_CreateMutex

Name

SDL_CreateMutex -- Create a mutex

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

SDL_mutex *SDL_CreateMutex(void);

Description

Create a new, unlocked mutex.

Examples

SDL_mutex *mut;
-
-mut=SDL_CreateMutex();
-.
-.
-if(SDL_mutexP(mut)==-1){
-  fprintf(stderr, "Couldn't lock mutex\n");
-  exit(-1);
-}
-.
-/* Do stuff while mutex is locked */
-.
-.
-if(SDL_mutexV(mut)==-1){
-  fprintf(stderr, "Couldn't unlock mutex\n");
-  exit(-1);
-}
-
-SDL_DestroyMutex(mut);

PrevHomeNext
SDL_KillThreadUpSDL_DestroyMutex
\ No newline at end of file diff --git a/docs/html/sdlcreatergbsurface.html b/docs/html/sdlcreatergbsurface.html deleted file mode 100644 index 736ec8f96f..0000000000 --- a/docs/html/sdlcreatergbsurface.html +++ /dev/null @@ -1,458 +0,0 @@ -SDL_CreateRGBSurface
SDL Library Documentation
PrevNext

SDL_CreateRGBSurface

Name

SDL_CreateRGBSurface -- Create an empty SDL_Surface

Synopsis

#include "SDL.h"

SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);

Description

Allocate an empty surface (must be called after SDL_SetVideoMode)

If depth is 8 bits an empty palette is allocated for the surface, otherwise a 'packed-pixel' SDL_PixelFormat is created using the [RGBA]mask's provided (see SDL_PixelFormat). The flags specifies the type of surface that should be created, it is an OR'd combination of the following possible values.

SDL_SWSURFACESDL will create the surface in system memory. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.
SDL_HWSURFACESDL will attempt to create the surface in video memory. This will allow SDL to take advantage of Video->Video blits (which are often accelerated).
SDL_SRCCOLORKEYThis flag turns on colourkeying for blits from this surface. If -SDL_HWSURFACE is also specified and colourkeyed blits -are hardware-accelerated, then SDL will attempt to place the surface in -video memory. -Use SDL_SetColorKey -to set or clear this flag after surface creation.
SDL_SRCALPHAThis flag turns on alpha-blending for blits from this surface. If -SDL_HWSURFACE is also specified and alpha-blending blits -are hardware-accelerated, then the surface will be placed in video memory if -possible. -Use SDL_SetAlpha to -set or clear this flag after surface creation.

Note: If an alpha-channel is specified (that is, if Amask is -nonzero), then the SDL_SRCALPHA flag is automatically -set. You may remove this flag by calling -SDL_SetAlpha -after surface creation.

Return Value

Returns the created surface, or NULL upon error.

Example

    /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order,
-       as expected by OpenGL for textures */
-    SDL_Surface *surface;
-    Uint32 rmask, gmask, bmask, amask;
-
-    /* SDL interprets each pixel as a 32-bit number, so our masks must depend
-       on the endianness (byte order) of the machine */
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-    rmask = 0xff000000;
-    gmask = 0x00ff0000;
-    bmask = 0x0000ff00;
-    amask = 0x000000ff;
-#else
-    rmask = 0x000000ff;
-    gmask = 0x0000ff00;
-    bmask = 0x00ff0000;
-    amask = 0xff000000;
-#endif
-
-    surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
-                                   rmask, gmask, bmask, amask);
-    if(surface == NULL) {
-        fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError());
-        exit(1);
-    }

PrevHomeNext
SDL_GetRGBAUpSDL_CreateRGBSurfaceFrom
\ No newline at end of file diff --git a/docs/html/sdlcreatergbsurfacefrom.html b/docs/html/sdlcreatergbsurfacefrom.html deleted file mode 100644 index 6acfdccae8..0000000000 --- a/docs/html/sdlcreatergbsurfacefrom.html +++ /dev/null @@ -1,256 +0,0 @@ -SDL_CreateRGBSurfaceFrom
SDL Library Documentation
PrevNext

SDL_CreateRGBSurfaceFrom

Name

SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data

Synopsis

#include "SDL.h"

SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);

Description

Creates an SDL_Surface from the provided pixel data.

The data stored in pixels is assumed to be of the depth specified in the parameter list. The pixel data is not copied into the SDL_Surface structure so it should not be freed until the surface has been freed with a called to SDL_FreeSurface. pitch is the length of each scanline in bytes.

See SDL_CreateRGBSurface for a more detailed description of the other parameters.

Return Value

Returns the created surface, or NULL upon error.


PrevHomeNext
SDL_CreateRGBSurfaceUpSDL_FreeSurface
\ No newline at end of file diff --git a/docs/html/sdlcreatesemaphore.html b/docs/html/sdlcreatesemaphore.html deleted file mode 100644 index 43dcbf5bff..0000000000 --- a/docs/html/sdlcreatesemaphore.html +++ /dev/null @@ -1,303 +0,0 @@ -SDL_CreateSemaphore
SDL Library Documentation
PrevNext

SDL_CreateSemaphore

Name

SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

SDL_sem *SDL_CreateSemaphore(Uint32 initial_value);

Description

SDL_CreateSemaphore() creates a new semaphore and -initializes it with the value initial_value. -Each locking operation on the semaphore by -SDL_SemWait, -SDL_SemTryWait or -SDL_SemWaitTimeout -will atomically decrement the semaphore value. The locking operation will be blocked -if the semaphore value is not positive (greater than zero). Each unlock operation by -SDL_SemPost -will atomically increment the semaphore value.

Return Value

Returns a pointer to an initialized semaphore or -NULL if there was an error.

Examples

SDL_sem *my_sem;
-
-my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
-
-if (my_sem == NULL) {
-        return CREATE_SEM_FAILED;
-}


PrevHomeNext
SDL_mutexVUpSDL_DestroySemaphore
\ No newline at end of file diff --git a/docs/html/sdlcreatethread.html b/docs/html/sdlcreatethread.html deleted file mode 100644 index ca3c2d9201..0000000000 --- a/docs/html/sdlcreatethread.html +++ /dev/null @@ -1,223 +0,0 @@ -SDL_CreateThread
SDL Library Documentation
PrevNext

SDL_CreateThread

Name

SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

SDL_Thread *SDL_CreateThread(int (*fn)(void *), void *data);

Description

SDL_CreateThread creates a new thread of execution -that shares all of its parent's global memory, signal handlers, -file descriptors, etc, and runs the function fn -passed the void pointer data -The thread quits when this function returns.


PrevHomeNext
Multi-threaded ProgrammingUpSDL_ThreadID
\ No newline at end of file diff --git a/docs/html/sdlcreateyuvoverlay.html b/docs/html/sdlcreateyuvoverlay.html deleted file mode 100644 index c24ef6ee2e..0000000000 --- a/docs/html/sdlcreateyuvoverlay.html +++ /dev/null @@ -1,256 +0,0 @@ -SDL_CreateYUVOverlay
SDL Library Documentation
PrevNext

SDL_CreateYUVOverlay

Name

SDL_CreateYUVOverlay -- Create a YUV video overlay

Synopsis

#include "SDL.h"

SDL_Overlay *SDL_CreateYUVOverlay(int width, int height, Uint32 format, SDL_Surface *display);

Description

SDL_CreateYUVOverlay creates a YUV overlay of the specified width, height and format (see SDL_Overlay for a list of available formats), for the provided display. A SDL_Overlay structure is returned.

The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.


PrevHomeNext
SDL_GL_SwapBuffersUpSDL_LockYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdldelay.html b/docs/html/sdldelay.html deleted file mode 100644 index a5417fa66f..0000000000 --- a/docs/html/sdldelay.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_Delay
SDL Library Documentation
PrevNext

SDL_Delay

Name

SDL_Delay -- Wait a specified number of milliseconds before returning.

Synopsis

#include "SDL.h"

void SDL_Delay(Uint32 ms);

Description

Wait a specified number of milliseconds before returning. SDL_Delay will wait at least the specified time, but possible longer due to OS scheduling.

Note: Count on a delay granularity of at least 10 ms. -Some platforms have shorter clock ticks but this is the most common.

See Also

SDL_AddTimer


PrevHomeNext
SDL_GetTicksUpSDL_AddTimer
\ No newline at end of file diff --git a/docs/html/sdldestroycond.html b/docs/html/sdldestroycond.html deleted file mode 100644 index ac0804286a..0000000000 --- a/docs/html/sdldestroycond.html +++ /dev/null @@ -1,206 +0,0 @@ -SDL_DestroyCond
SDL Library Documentation
PrevNext

SDL_DestroyCond

Name

SDL_DestroyCond -- Destroy a condition variable

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

void SDL_DestroyCond(SDL_cond *cond);

Description

Destroys a condition variable.


PrevHomeNext
SDL_CreateCondUpSDL_CondSignal
\ No newline at end of file diff --git a/docs/html/sdldestroymutex.html b/docs/html/sdldestroymutex.html deleted file mode 100644 index 949bfc5d54..0000000000 --- a/docs/html/sdldestroymutex.html +++ /dev/null @@ -1,209 +0,0 @@ -SDL_DestroyMutex
SDL Library Documentation
PrevNext

SDL_DestroyMutex

Name

SDL_DestroyMutex -- Destroy a mutex

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

void SDL_DestroyMutex(SDL_mutex *mutex);

Description

Destroy a previously created mutex.


PrevHomeNext
SDL_CreateMutexUpSDL_mutexP
\ No newline at end of file diff --git a/docs/html/sdldestroysemaphore.html b/docs/html/sdldestroysemaphore.html deleted file mode 100644 index d32bdfaf57..0000000000 --- a/docs/html/sdldestroysemaphore.html +++ /dev/null @@ -1,278 +0,0 @@ -SDL_DestroySemaphore
SDL Library Documentation
PrevNext

SDL_DestroySemaphore

Name

SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

void SDL_DestroySemaphore(SDL_sem *sem);

Description

SDL_DestroySemaphore destroys the semaphore pointed to -by sem that was created by -SDL_CreateSemaphore. -It is not safe to destroy a semaphore if there are threads currently blocked -waiting on it.

Examples

if (my_sem != NULL) {
-        SDL_DestroySemaphore(my_sem);
-        my_sem = NULL;
-}


PrevHomeNext
SDL_CreateSemaphoreUpSDL_SemWait
\ No newline at end of file diff --git a/docs/html/sdldisplayformat.html b/docs/html/sdldisplayformat.html deleted file mode 100644 index c91adfe50a..0000000000 --- a/docs/html/sdldisplayformat.html +++ /dev/null @@ -1,262 +0,0 @@ -SDL_DisplayFormat
SDL Library Documentation
PrevNext

SDL_DisplayFormat

Name

SDL_DisplayFormat -- Convert a surface to the display format

Synopsis

#include "SDL.h"

SDL_Surface *SDL_DisplayFormat(SDL_Surface *surface);

Description

This function takes a surface and copies it to a new surface of the -pixel format and colors of the video framebuffer, suitable for fast -blitting onto the display surface. It calls -SDL_ConvertSurface

If you want to take advantage of hardware colorkey or alpha blit -acceleration, you should set the colorkey and alpha value before -calling this function.

If you want an alpha channel, see SDL_DisplayFormatAlpha.

Return Value

If the conversion fails or runs out of memory, it returns -NULL


PrevHomeNext
SDL_FillRectUpSDL_DisplayFormatAlpha
\ No newline at end of file diff --git a/docs/html/sdldisplayformatalpha.html b/docs/html/sdldisplayformatalpha.html deleted file mode 100644 index 6e88604d02..0000000000 --- a/docs/html/sdldisplayformatalpha.html +++ /dev/null @@ -1,250 +0,0 @@ -SDL_DisplayFormatAlpha
SDL Library Documentation
PrevNext

SDL_DisplayFormatAlpha

Name

SDL_DisplayFormatAlpha -- Convert a surface to the display format

Synopsis

#include "SDL.h"

SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface);

Description

This function takes a surface and copies it to a new surface of the -pixel format and colors of the video framebuffer plus an alpha channel, -suitable for fast blitting onto the display surface. It calls -SDL_ConvertSurface

If you want to take advantage of hardware colorkey or alpha blit -acceleration, you should set the colorkey and alpha value before -calling this function.

This function can be used to convert a colourkey to an alpha channel, -if the SDL_SRCCOLORKEY flag is set on the surface. -The generated surface will then be transparent (alpha=0) where the -pixels match the colourkey, and opaque (alpha=255) elsewhere.

Return Value

If the conversion fails or runs out of memory, it returns -NULL


PrevHomeNext
SDL_DisplayFormatUpSDL_WarpMouse
\ No newline at end of file diff --git a/docs/html/sdldisplayyuvoverlay.html b/docs/html/sdldisplayyuvoverlay.html deleted file mode 100644 index 456c9985df..0000000000 --- a/docs/html/sdldisplayyuvoverlay.html +++ /dev/null @@ -1,246 +0,0 @@ -SDL_DisplayYUVOverlay
SDL Library Documentation
PrevNext

SDL_DisplayYUVOverlay

Name

SDL_DisplayYUVOverlay -- Blit the overlay to the display

Synopsis

#include "SDL.h"

int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);

Description

Blit the overlay to the surface specified when it was created. The SDL_Rect structure, dstrect, specifies the position and size of the destination. If the dstrect is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling.

Return Values

Returns 0 on success


PrevHomeNext
SDL_UnlockYUVOverlayUpSDL_FreeYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlenablekeyrepeat.html b/docs/html/sdlenablekeyrepeat.html deleted file mode 100644 index 878feb14f3..0000000000 --- a/docs/html/sdlenablekeyrepeat.html +++ /dev/null @@ -1,238 +0,0 @@ -SDL_EnableKeyRepeat
SDL Library Documentation
PrevNext

SDL_EnableKeyRepeat

Name

SDL_EnableKeyRepeat -- Set keyboard repeat rate.

Synopsis

#include "SDL.h"

int SDL_EnableKeyRepeat(int delay, int interval);

Description

Enables or disables the keyboard repeat rate. delay specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by interval. Both delay and interval are expressed in milliseconds.

Setting delay to 0 disables key repeating completely. Good default values are SDL_DEFAULT_REPEAT_DELAY and SDL_DEFAULT_REPEAT_INTERVAL.

Return Value

Returns 0 on success and -1 on failure.


PrevHomeNext
SDL_EnableUNICODEUpSDL_GetMouseState
\ No newline at end of file diff --git a/docs/html/sdlenableunicode.html b/docs/html/sdlenableunicode.html deleted file mode 100644 index 855debbc99..0000000000 --- a/docs/html/sdlenableunicode.html +++ /dev/null @@ -1,252 +0,0 @@ -SDL_EnableUNICODE
SDL Library Documentation
PrevNext

SDL_EnableUNICODE

Name

SDL_EnableUNICODE -- Enable UNICODE translation

Synopsis

#include "SDL.h"

int SDL_EnableUNICODE(int enable);

Description

Enables/Disables Unicode keyboard translation.

To obtain the character codes corresponding to received keyboard events, -Unicode translation must first be turned on using this function. The -translation incurs a slight overhead for each keyboard event and is therefore -disabled by default. For each subsequently received key down event, the -unicode member of the -SDL_keysym structure -will then contain the corresponding character code, or zero for keysyms that do -not correspond to any character code.

A value of 1 for enable enables Unicode translation; -0 disables it, and -1 leaves it unchanged (useful for querying the current -translation mode).

Note that only key press events will be translated, not release events.

Return Value

Returns the previous translation mode (0 or 1).

See Also

SDL_keysym


PrevHomeNext
SDL_GetKeyNameUpSDL_EnableKeyRepeat
\ No newline at end of file diff --git a/docs/html/sdlenvvars.html b/docs/html/sdlenvvars.html deleted file mode 100644 index 8999ed1f1f..0000000000 --- a/docs/html/sdlenvvars.html +++ /dev/null @@ -1,1227 +0,0 @@ -SDL_envvars
SDL Library Documentation
PrevNext

SDL_envvars

Name

SDL_envvars -- SDL environment variables

Description

Not a function, set using setenv()

Several environment variables are available to modify the -behaviour of SDL. Using these variables isn't recommened and the names -and presence of these variables aren't guaranteed from one release to -the next. However, they can be very useful for debugging -purposes.

Video

SDL_FBACCEL

If set to 0, disable hardware acceleration in the linux fbcon driver.

SDL_FBDEV

Frame buffer device to use in the linux fbcon driver, instead of /dev/fb0

SDL_FULLSCREEN_UPDATE

In the ps2gs driver, sets the SDL_ASYNCBLIT flag on the -display surface.

SDL_VIDEODRIVER

Selectes the video driver for SDL to use. Possible values, in the -order they are tried if this variable is not set:

x11

dga

(the XFree86 DGA2)

nanox

(Linux)

fbcon

(Linux)

directfb

(Linux)

ps2gs

(Playstation 2)

ggi

vgl

(BSD)

svgalib

(Linux)

aalib

directx

(Win32)

windib

(Win32)

bwindow

(BeOS)

toolbox

(MacOS Classic)

DSp

(MacOS Classic)

Quartz

(Mac OS X)

CGX

(Amiga)

photon

(QNX)

dummy

SDL_VIDEO_CENTERED

If set, tries to center the SDL window when running in X11 windowed -mode, or using the CyberGrafix driver.

SDL_VIDEO_GL_DRIVER

The openGL driver (shared library) to use for X11. Default is libGL.so.1

SDL_VIDEO_X11_DGAMOUSE

With XFree86, enables use of DGA mouse if set.

SDL_VIDEO_X11_MOUSEACCEL

For X11, sets the mouse acceleration. The value should be a string -on the form:

"n/d/t"

where n and d are the -acceleration numerator/denumerators (so mouse movement is accelerated by -n/d), and -t is the threshold above which acceleration applies -(counted as number of pixels the mouse moves at once).

SDL_VIDEO_X11_NODIRECTCOLOR

If set, don't attempt to use DirectColor visuals even if they are -present. (SDL will use them otherwise for gamma correction). -This is needed with older X servers when using the XVideo extension.

SDL_VIDEO_X11_VISUALID

ID of an X11 visual to use, overriding SDL's default visual selection -algorithm. It can be in decimal or in hex (prefixed by 0x).

SDL_VIDEO_YUV_DIRECT

If set, display YUV overlay directly on the video surface if possible, -instead of on the surface passed to -SDL_CreateYUVOverlay.

SDL_VIDEO_YUV_HWACCEL

If not set or set to a nonzero value, SDL will attempt to use -hardware YUV acceleration for video playback.

SDL_WINDOWID

For X11 or Win32, contains the ID number of the window to be used by -SDL instead of creating its own window. Either in decimal or -in hex (prefixed by 0x).

Events/Input

SDL_MOUSE_RELATIVE

If set to 0, do not use mouse relative mode in X11. The default is -to use it if the mouse is hidden and input is grabbed.

SDL_MOUSEDEV

The mouse device to use for the linux fbcon driver. If not set, -SDL first tries to use GPM in repeater mode, then various other -devices (/dev/pcaux, /dev/adbmouse, /dev/mouse etc).

SDL_MOUSEDEV_IMPS2

If set, SDL will not try to auto-detect the IMPS/2 protocol of -a PS/2 mouse but use it right away. For the fbcon and ps2gs drivers.

SDL_MOUSEDRV

For the linux fbcon driver: if set to ELO, use the ELO touchscreen -controller as a pointer device

SDL_NO_RAWKBD

For the libvga driver: If set, do not attempt to put the keyboard in raw mode.

SDL_NOMOUSE

If set, the linux fbcon driver will not use a mouse at all.

SDL_NO_LOCK_KEYS

Disable CAPS-LOCK and NUM-LOCK suppression of down+up key events, -suitable for games where the player needs these keys to do more than just toggle. -A value of 1 will effect both CAPS-LOCK and NUM-LOCK. -A value of 2 will effect only CAPS-LOCK. -A value of 3 will effect only NUM-LOCK. -All other values have no effect. -

Audio

AUDIODEV

The audio device to use, if SDL_PATH_DSP isn't set.

SDL_AUDIODRIVER

Selects the audio driver for SDL to use. Possible values, in the -order they are tried if this variable is not set:

openbsd

(OpenBSD)

dsp

(OSS /dev/dsp: Linux, Solaris, BSD etc)

alsa

(Linux)

pulse

(PulseAudio daemon)

audio

(Unix style /dev/audio: SunOS, Solaris etc)

AL

(Irix)

artsc

(ARTS audio daemon)

esd

(esound audio daemon)

nas

(NAS audio daemon)

dma

(OSS /dev/dsp, using DMA)

dsound

(Win32 DirectX)

waveout

(Win32 WaveOut)

baudio

(BeOS)

sndmgr

(MacOS SoundManager)

paud

(AIX)

AHI

(Amiga)

disk

(all; output to file)

SDL_DISKAUDIOFILE

The name of the output file for the "disk" audio driver. If not -set, the name sdlaudio.raw is used.

SDL_DISKAUDIODELAY

For the "disk" audio driver, how long to wait (in ms) before writing -a full sound buffer. The default is 150 ms.

SDL_DSP_NOSELECT

For some audio drivers (alsa, paud, dma and dsp), don't use select() -but a timed method instead. May cure some audio problems, or cause -others.

SDL_PATH_DSP

The audio device to use. If not set, SDL tries AUDIODEV and then -a platform-dependent default value (/dev/audio on Solaris, -/dev/dsp on Linux etc).

CD-ROM

SDL_CDROM

A colon-separated list of CD-ROM devices to use, in addition to -the standard devices (typically /dev/cdrom, platform-dependent).

Debugging

SDL_DEBUG

If set, causes every call to SDL_SetError (that -is, every time SDL signals an error) to also print an error message on -stderr.

Joystick

SDL_JOYSTICK_DEVICE

Joystick device to use in the linux joystick driver, in addition -to the usual: /dev/js*, /dev/input/event*, /dev/input/js*

SDL_LINUX_JOYSTICK

Special joystick configuration string for linux. The format is

"name numaxes numhats numballs"

where name is the name string of the joystick -(possibly in single quotes), and the rest are the number of axes, hats -and balls respectively.


PrevHomeNext
SDL_GetErrorUpVideo
diff --git a/docs/html/sdlevent.html b/docs/html/sdlevent.html deleted file mode 100644 index dfd21b7fe6..0000000000 --- a/docs/html/sdlevent.html +++ /dev/null @@ -1,994 +0,0 @@ -SDL_Event
SDL Library Documentation
PrevNext

SDL_Event

Name

SDL_Event -- General event structure

Structure Definition

typedef union{
-  Uint8 type;
-  SDL_ActiveEvent active;
-  SDL_KeyboardEvent key;
-  SDL_MouseMotionEvent motion;
-  SDL_MouseButtonEvent button;
-  SDL_JoyAxisEvent jaxis;
-  SDL_JoyBallEvent jball;
-  SDL_JoyHatEvent jhat;
-  SDL_JoyButtonEvent jbutton;
-  SDL_ResizeEvent resize;
-  SDL_ExposeEvent expose;
-  SDL_QuitEvent quit;
-  SDL_UserEvent user;
-  SDL_SysWMEvent syswm;
-} SDL_Event;

Description

The SDL_Event union is the core to all event handling is SDL, its probably the most important structure after SDL_Surface. SDL_Event is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event type.

Event typeEvent Structure
SDL_ACTIVEEVENTSDL_ActiveEvent
SDL_KEYDOWN/UPSDL_KeyboardEvent
SDL_MOUSEMOTIONSDL_MouseMotionEvent
SDL_MOUSEBUTTONDOWN/UPSDL_MouseButtonEvent
SDL_JOYAXISMOTIONSDL_JoyAxisEvent
SDL_JOYBALLMOTIONSDL_JoyBallEvent
SDL_JOYHATMOTIONSDL_JoyHatEvent
SDL_JOYBUTTONDOWN/UPSDL_JoyButtonEvent
SDL_QUITSDL_QuitEvent
SDL_SYSWMEVENTSDL_SysWMEvent
SDL_VIDEORESIZESDL_ResizeEvent
SDL_VIDEOEXPOSESDL_ExposeEvent
SDL_USEREVENTSDL_UserEvent

Use

The SDL_Event structure has two uses

  • Reading events on the event queue

  • Placing events on the event queue

Reading events from the event queue is done with either SDL_PollEvent or SDL_PeepEvents. We'll use SDL_PollEvent and step through an example.

First off, we create an empty SDL_Event structure. -

SDL_Event test_event;
-SDL_PollEvent removes the next event from the event queue, if there are no events on the queue it returns 0 otherwise it returns 1. We use a while loop to process each event in turn. -
while(SDL_PollEvent(&test_event)) {
-The SDL_PollEvent function take a pointer to an SDL_Event structure that is to be filled with event information. We know that if SDL_PollEvent removes an event from the queue then the event information will be placed in our test_event structure, but we also know that the type of event will be placed in the type member of test_event. So to handle each event type seperately we use a switch statement. -
  switch(test_event.type) {
-We need to know what kind of events we're looking for and the event type's of those events. So lets assume we want to detect where the user is moving the mouse pointer within our application. We look through our event types and notice that SDL_MOUSEMOTION is, more than likely, the event we're looking for. A little more research tells use that SDL_MOUSEMOTION events are handled within the SDL_MouseMotionEvent structure which is the motion member of SDL_Event. We can check for the SDL_MOUSEMOTION event type within our switch statement like so: -
    case SDL_MOUSEMOTION:
-All we need do now is read the information out of the motion member of test_event. -
      printf("We got a motion event.\n");
-      printf("Current mouse position is: (%d, %d)\n", test_event.motion.x, test_event.motion.y);
-      break;
-    default:
-      printf("Unhandled Event!\n");
-      break;
-  }
-}
-printf("Event queue empty.\n");

It is also possible to push events onto the event queue and so use it as a two-way communication path. Both SDL_PushEvent and SDL_PeepEvents allow you to place events onto the event queue. This is usually used to place a SDL_USEREVENT on the event queue, however you could use it to post fake input events if you wished. Creating your own events is a simple matter of choosing the event type you want, setting the type member and filling the appropriate member structure with information. -

SDL_Event user_event;
-
-user_event.type=SDL_USEREVENT;
-user_event.user.code=2;
-user_event.user.data1=NULL;
-user_event.user.data2=NULL;
-SDL_PushEvent(&user_event);


PrevHomeNext
SDL Event Structures.UpSDL_ActiveEvent
diff --git a/docs/html/sdleventstate.html b/docs/html/sdleventstate.html deleted file mode 100644 index b9a24486cb..0000000000 --- a/docs/html/sdleventstate.html +++ /dev/null @@ -1,276 +0,0 @@ -SDL_EventState
SDL Library Documentation
PrevNext

SDL_EventState

Name

SDL_EventState -- This function allows you to set the state of processing certain events.

Synopsis

#include "SDL.h"

Uint8 SDL_EventState(Uint8 type, int state);

Description

This function allows you to set the state of processing certain event type's.

If state is set to SDL_IGNORE, -that event type will be automatically dropped from the event queue and will -not be filtered.

If state is set to SDL_ENABLE, -that event type will be processed normally.

If state is set to SDL_QUERY, -SDL_EventState will return the current processing -state of the specified event type.

A list of event type's can be found in the SDL_Event section.

See Also

SDL_Event


PrevHomeNext
SDL_GetEventFilterUpSDL_GetKeyState
\ No newline at end of file diff --git a/docs/html/sdlexposeevent.html b/docs/html/sdlexposeevent.html deleted file mode 100644 index 82c2a3e7e2..0000000000 --- a/docs/html/sdlexposeevent.html +++ /dev/null @@ -1,252 +0,0 @@ -SDL_ExposeEvent
SDL Library Documentation
PrevNext

SDL_ExposeEvent

Name

SDL_ExposeEvent -- Quit requested event

Structure Definition

typedef struct{
-  Uint8 type
-} SDL_ExposeEvent;

Structure Data

typeSDL_VIDEOEXPOSE

Description

SDL_ExposeEvent is a member of the SDL_Event union and is used whan an event of type SDL_VIDEOEXPOSE is reported.

A VIDEOEXPOSE event is triggered when the screen has been modified -outside of the application, usually by the window manager and needs to -be redrawn.


PrevHomeNext
SDL_ResizeEventUpSDL_SysWMEvent
diff --git a/docs/html/sdlfillrect.html b/docs/html/sdlfillrect.html deleted file mode 100644 index 4ace062e2d..0000000000 --- a/docs/html/sdlfillrect.html +++ /dev/null @@ -1,291 +0,0 @@ -SDL_FillRect
SDL Library Documentation
PrevNext

SDL_FillRect

Name

SDL_FillRect -- This function performs a fast fill of the given rectangle with some color

Synopsis

#include "SDL.h"

int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);

Description

This function performs a fast fill of the given rectangle with -color. If dstrect -is NULL, the whole surface will be filled with -color.

The color should be a pixel of the format used by the surface, and -can be generated by the -SDL_MapRGB or SDL_MapRGBA -functions. If the color value contains an alpha value then the -destination is simply "filled" with that alpha information, no blending -takes place.

If there is a clip rectangle set on the destination (set via -SDL_SetClipRect) then this -function will clip based on the intersection of the clip rectangle and -the dstrect rectangle and the dstrect rectangle -will be modified to represent the area actually filled.

Return Value

This function returns 0 on success, or --1 on error.


PrevHomeNext
SDL_BlitSurfaceUpSDL_DisplayFormat
\ No newline at end of file diff --git a/docs/html/sdlflip.html b/docs/html/sdlflip.html deleted file mode 100644 index b480f99aa8..0000000000 --- a/docs/html/sdlflip.html +++ /dev/null @@ -1,259 +0,0 @@ -SDL_Flip
SDL Library Documentation
PrevNext

SDL_Flip

Name

SDL_Flip -- Swaps screen buffers

Synopsis

#include "SDL.h"

int SDL_Flip(SDL_Surface *screen);

Description

On hardware that supports double-buffering, this function sets up a flip -and returns. The hardware will wait for vertical retrace, and then swap -video buffers before the next video surface blit or lock will return. -On hardware that doesn't support double-buffering, this is equivalent -to calling SDL_UpdateRect(screen, 0, 0, 0, 0)

The SDL_DOUBLEBUF flag must have been passed to -SDL_SetVideoMode, - when -setting the video mode for this function to perform hardware flipping.

Return Value

This function returns 0 if successful, or --1 if there was an error.


PrevHomeNext
SDL_UpdateRectsUpSDL_SetColors
\ No newline at end of file diff --git a/docs/html/sdlfreecursor.html b/docs/html/sdlfreecursor.html deleted file mode 100644 index 01a4f7c257..0000000000 --- a/docs/html/sdlfreecursor.html +++ /dev/null @@ -1,209 +0,0 @@ -SDL_FreeCursor
SDL Library Documentation
PrevNext

SDL_FreeCursor

Name

SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.

Synopsis

#include "SDL.h"

void SDL_FreeCursor(SDL_Cursor *cursor);

Description

Frees a SDL_Cursor that was created using -SDL_CreateCursor.


PrevHomeNext
SDL_CreateCursorUpSDL_SetCursor
\ No newline at end of file diff --git a/docs/html/sdlfreesurface.html b/docs/html/sdlfreesurface.html deleted file mode 100644 index 84b6048109..0000000000 --- a/docs/html/sdlfreesurface.html +++ /dev/null @@ -1,219 +0,0 @@ -SDL_FreeSurface
SDL Library Documentation
PrevNext

SDL_FreeSurface

Name

SDL_FreeSurface -- Frees (deletes) a SDL_Surface

Synopsis

#include "SDL.h"

void SDL_FreeSurface(SDL_Surface *surface);

Description

Frees the resources used by a previously created SDL_Surface. If the surface was created using -SDL_CreateRGBSurfaceFrom then the pixel data is not freed.


PrevHomeNext
SDL_CreateRGBSurfaceFromUpSDL_LockSurface
\ No newline at end of file diff --git a/docs/html/sdlfreewav.html b/docs/html/sdlfreewav.html deleted file mode 100644 index 24242c4b0f..0000000000 --- a/docs/html/sdlfreewav.html +++ /dev/null @@ -1,222 +0,0 @@ -SDL_FreeWAV
SDL Library Documentation
PrevNext

SDL_FreeWAV

Name

SDL_FreeWAV -- Frees previously opened WAV data

Synopsis

#include "SDL.h"

void SDL_FreeWAV(Uint8 *audio_buf);

Description

After a WAVE file has been opened with SDL_LoadWAV its data can eventually be freed with SDL_FreeWAV. audio_buf is a pointer to the buffer created by SDL_LoadWAV.

See Also

SDL_LoadWAV


PrevHomeNext
SDL_LoadWAVUpSDL_AudioCVT
\ No newline at end of file diff --git a/docs/html/sdlfreeyuvoverlay.html b/docs/html/sdlfreeyuvoverlay.html deleted file mode 100644 index e82340d9e2..0000000000 --- a/docs/html/sdlfreeyuvoverlay.html +++ /dev/null @@ -1,233 +0,0 @@ -SDL_FreeYUVOverlay
SDL Library Documentation
PrevNext

SDL_FreeYUVOverlay

Name

SDL_FreeYUVOverlay -- Free a YUV video overlay

Synopsis

#include "SDL.h"

void SDL_FreeYUVOverlay(SDL_Overlay *overlay);

Description

Frees and overlay created by SDL_CreateYUVOverlay.


PrevHomeNext
SDL_DisplayYUVOverlayUpSDL_GLattr
\ No newline at end of file diff --git a/docs/html/sdlgetappstate.html b/docs/html/sdlgetappstate.html deleted file mode 100644 index d09e2e0f08..0000000000 --- a/docs/html/sdlgetappstate.html +++ /dev/null @@ -1,263 +0,0 @@ -SDL_GetAppState
SDL Library Documentation
PrevNext

SDL_GetAppState

Name

SDL_GetAppState -- Get the state of the application

Synopsis

#include "SDL.h"

Uint8 SDL_GetAppState(void);

Description

This function returns the current state of the application. The value returned is a bitwise combination of:

SDL_APPMOUSEFOCUSThe application has mouse focus.
SDL_APPINPUTFOCUSThe application has keyboard focus
SDL_APPACTIVEThe application is visible


PrevHomeNext
SDL_GetRelativeMouseStateUpSDL_JoystickEventState
\ No newline at end of file diff --git a/docs/html/sdlgetaudiostatus.html b/docs/html/sdlgetaudiostatus.html deleted file mode 100644 index 3fc3a09119..0000000000 --- a/docs/html/sdlgetaudiostatus.html +++ /dev/null @@ -1,221 +0,0 @@ -SDL_GetAudioStatus
SDL Library Documentation
PrevNext

SDL_GetAudioStatus

Name

SDL_GetAudioStatus -- Get the current audio state

Synopsis

#include "SDL.h"

SDL_audiostatusSDL_GetAudioStatus(void);

Description

typedef enum{
-  SDL_AUDIO_STOPPED,
-  SDL_AUDIO_PAUSED,
-  SDL_AUDIO_PLAYING
-} SDL_audiostatus;

Returns either SDL_AUDIO_STOPPED, SDL_AUDIO_PAUSED or SDL_AUDIO_PLAYING depending on the current audio state.


PrevHomeNext
SDL_PauseAudioUpSDL_LoadWAV
\ No newline at end of file diff --git a/docs/html/sdlgetcliprect.html b/docs/html/sdlgetcliprect.html deleted file mode 100644 index f00ac77f8f..0000000000 --- a/docs/html/sdlgetcliprect.html +++ /dev/null @@ -1,229 +0,0 @@ -SDL_GetClipRect
SDL Library Documentation
PrevNext

SDL_GetClipRect

Name

SDL_GetClipRect -- Gets the clipping rectangle for a surface.

Synopsis

#include "SDL.h"

void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);

Description

Gets the clipping rectangle for a surface. When this surface is the -destination of a blit, only the area within the clip rectangle is -drawn into.

The rectangle pointed to by rect will be -filled with the clipping rectangle of the surface.


PrevHomeNext
SDL_SetClipRectUpSDL_ConvertSurface
\ No newline at end of file diff --git a/docs/html/sdlgetcursor.html b/docs/html/sdlgetcursor.html deleted file mode 100644 index 72ecbc7c09..0000000000 --- a/docs/html/sdlgetcursor.html +++ /dev/null @@ -1,219 +0,0 @@ -SDL_GetCursor
SDL Library Documentation
PrevNext

SDL_GetCursor

Name

SDL_GetCursor -- Get the currently active mouse cursor.

Synopsis

#include "SDL.h"

SDL_Cursor *SDL_GetCursor(void);

Description

Returns the currently active mouse cursor.


PrevHomeNext
SDL_SetCursorUpSDL_ShowCursor
\ No newline at end of file diff --git a/docs/html/sdlgeterror.html b/docs/html/sdlgeterror.html deleted file mode 100644 index cdf57924a9..0000000000 --- a/docs/html/sdlgeterror.html +++ /dev/null @@ -1,205 +0,0 @@ -SDL_GetError
SDL Library Documentation
PrevNext

SDL_GetError

Name

SDL_GetError -- Get SDL error string

Synopsis

#include "SDL/SDL.h"

char *SDL_GetError(void);

Description

SDL_GetError returns a NULL terminated string containing information about the last internal SDL error.

Return Value

SDL_GetError returns a string containing the last error.


PrevHomeNext
SDL_WasInitUpSDL_envvars
\ No newline at end of file diff --git a/docs/html/sdlgeteventfilter.html b/docs/html/sdlgeteventfilter.html deleted file mode 100644 index d254d34a52..0000000000 --- a/docs/html/sdlgeteventfilter.html +++ /dev/null @@ -1,235 +0,0 @@ -SDL_GetEventFilter
SDL Library Documentation
PrevNext

SDL_GetEventFilter

Name

SDL_GetEventFilter -- Retrieves a pointer to he event filter

Synopsis

#include "SDL.h"

SDL_EventFilter SDL_GetEventFilter(void);

Description

This function retrieces a pointer to the event filter that was previously set using SDL_SetEventFilter. An SDL_EventFilter function is defined as: -

typedef int (*SDL_EventFilter)(const SDL_Event *event);

Return Value

Returns a pointer to the event filter or NULL if no filter has been set.


PrevHomeNext
SDL_SetEventFilterUpSDL_EventState
\ No newline at end of file diff --git a/docs/html/sdlgetgammaramp.html b/docs/html/sdlgetgammaramp.html deleted file mode 100644 index bfcc03c4d3..0000000000 --- a/docs/html/sdlgetgammaramp.html +++ /dev/null @@ -1,219 +0,0 @@ -SDL_GetGammaRamp
SDL Library Documentation
PrevNext

SDL_GetGammaRamp

Name

SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display

Synopsis

#include "SDL.h"

int SDL_GetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);

Description

Gets the gamma translation lookup tables currently used by the display. -Each table is an array of 256 Uint16 values.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error.


PrevHomeNext
SDL_SetGammaUpSDL_SetGammaRamp
\ No newline at end of file diff --git a/docs/html/sdlgetkeyname.html b/docs/html/sdlgetkeyname.html deleted file mode 100644 index 6c51c9497a..0000000000 --- a/docs/html/sdlgetkeyname.html +++ /dev/null @@ -1,216 +0,0 @@ -SDL_GetKeyName
SDL Library Documentation
PrevNext

SDL_GetKeyName

Name

SDL_GetKeyName -- Get the name of an SDL virtual keysym

Synopsis

#include "SDL.h"

char *SDL_GetKeyName(SDLKey key);

Description

Returns the SDL-defined name of the SDLKey key.

See Also

SDLKey


PrevHomeNext
SDL_SetModStateUpSDL_EnableUNICODE
\ No newline at end of file diff --git a/docs/html/sdlgetkeystate.html b/docs/html/sdlgetkeystate.html deleted file mode 100644 index 1c16f2e50c..0000000000 --- a/docs/html/sdlgetkeystate.html +++ /dev/null @@ -1,253 +0,0 @@ -SDL_GetKeyState
SDL Library Documentation
PrevNext

SDL_GetKeyState

Name

SDL_GetKeyState -- Get a snapshot of the current keyboard state

Synopsis

#include "SDL.h"

Uint8 *SDL_GetKeyState(int *numkeys);

Description

Gets a snapshot of the current keyboard state. The current state is return as a pointer to an array, the size of this array is stored in numkeys. The array is indexed by the SDLK_* symbols. A value of 1 means the key is pressed and a value of 0 means its not. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller.

Note: Use SDL_PumpEvents to update the state array.

Example

Uint8 *keystate = SDL_GetKeyState(NULL);
-if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed.\n");


PrevHomeNext
SDL_EventStateUpSDL_GetModState
\ No newline at end of file diff --git a/docs/html/sdlgetmodstate.html b/docs/html/sdlgetmodstate.html deleted file mode 100644 index 64d2f35621..0000000000 --- a/docs/html/sdlgetmodstate.html +++ /dev/null @@ -1,257 +0,0 @@ -SDL_GetModState
SDL Library Documentation
PrevNext

SDL_GetModState

Name

SDL_GetModState -- Get the state of modifier keys.

Synopsis

#include "SDL.h"

SDLMod SDL_GetModState(void);

Description

Returns the current state of the modifier keys (CTRL, ALT, etc.).

Return Value

The return value can be an OR'd combination of the SDLMod enum.

SDLMod

typedef enum {
-  KMOD_NONE  = 0x0000,
-  KMOD_LSHIFT= 0x0001,
-  KMOD_RSHIFT= 0x0002,
-  KMOD_LCTRL = 0x0040,
-  KMOD_RCTRL = 0x0080,
-  KMOD_LALT  = 0x0100,
-  KMOD_RALT  = 0x0200,
-  KMOD_LMETA = 0x0400,
-  KMOD_RMETA = 0x0800,
-  KMOD_NUM   = 0x1000,
-  KMOD_CAPS  = 0x2000,
-  KMOD_MODE  = 0x4000,
-} SDLMod;
-SDL also defines the following symbols for convenience: -
#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
-#define KMOD_SHIFT  (KMOD_LSHIFT|KMOD_RSHIFT)
-#define KMOD_ALT  (KMOD_LALT|KMOD_RALT)
-#define KMOD_META (KMOD_LMETA|KMOD_RMETA)


PrevHomeNext
SDL_GetKeyStateUpSDL_SetModState
\ No newline at end of file diff --git a/docs/html/sdlgetmousestate.html b/docs/html/sdlgetmousestate.html deleted file mode 100644 index d96a55b8d1..0000000000 --- a/docs/html/sdlgetmousestate.html +++ /dev/null @@ -1,253 +0,0 @@ -SDL_GetMouseState
SDL Library Documentation
PrevNext

SDL_GetMouseState

Name

SDL_GetMouseState -- Retrieve the current state of the mouse

Synopsis

#include "SDL.h"

Uint8 SDL_GetMouseState(int *x, int *y);

Description

The current button state is returned as a button bitmask, which can -be tested using the SDL_BUTTON(X) macros, and x and y are set to the -current mouse cursor position. You can pass NULL for either x or y.

Example

SDL_PumpEvents();
-if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1))
-  printf("Mouse Button 1(left) is pressed.\n");

PrevHomeNext
SDL_EnableKeyRepeatUpSDL_GetRelativeMouseState
\ No newline at end of file diff --git a/docs/html/sdlgetrelativemousestate.html b/docs/html/sdlgetrelativemousestate.html deleted file mode 100644 index 52a51066b5..0000000000 --- a/docs/html/sdlgetrelativemousestate.html +++ /dev/null @@ -1,235 +0,0 @@ -SDL_GetRelativeMouseState
SDL Library Documentation
PrevNext

SDL_GetRelativeMouseState

Name

SDL_GetRelativeMouseState -- Retrieve the current state of the mouse

Synopsis

#include "SDL.h"

Uint8 SDL_GetRelativeMouseState(int *x, int *y);

Description

The current button state is returned as a button bitmask, which can -be tested using the SDL_BUTTON(X) macros, and x and y are set to the change in the mouse position since the last call to SDL_GetRelativeMouseState or since event initialization. You can pass NULL for either x or y.


PrevHomeNext
SDL_GetMouseStateUpSDL_GetAppState
\ No newline at end of file diff --git a/docs/html/sdlgetrgb.html b/docs/html/sdlgetrgb.html deleted file mode 100644 index 47774dc2ed..0000000000 --- a/docs/html/sdlgetrgb.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_GetRGB
SDL Library Documentation
PrevNext

SDL_GetRGB

Name

SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.

Synopsis

#include "SDL.h"

void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b);

Description

Get RGB component values from a pixel stored in the specified pixel format.

This function uses the entire 8-bit [0..255] range when converting color -components from pixel formats with less than 8-bits per RGB component -(e.g., a completely white pixel in 16-bit RGB565 format would return -[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).


PrevHomeNext
SDL_MapRGBAUpSDL_GetRGBA
\ No newline at end of file diff --git a/docs/html/sdlgetrgba.html b/docs/html/sdlgetrgba.html deleted file mode 100644 index a9e1093ad5..0000000000 --- a/docs/html/sdlgetrgba.html +++ /dev/null @@ -1,222 +0,0 @@ -SDL_GetRGBA
SDL Library Documentation
PrevNext

SDL_GetRGBA

Name

SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.

Synopsis

#include "SDL.h"

void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);

Description

Get RGBA component values from a pixel stored in the specified pixel format.

This function uses the entire 8-bit [0..255] range when converting color -components from pixel formats with less than 8-bits per RGB component -(e.g., a completely white pixel in 16-bit RGB565 format would return -[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).

If the surface has no alpha component, the alpha will be returned as 0xff -(100% opaque).


PrevHomeNext
SDL_GetRGBUpSDL_CreateRGBSurface
\ No newline at end of file diff --git a/docs/html/sdlgetthreadid.html b/docs/html/sdlgetthreadid.html deleted file mode 100644 index 4bc59cb69c..0000000000 --- a/docs/html/sdlgetthreadid.html +++ /dev/null @@ -1,209 +0,0 @@ -SDL_GetThreadID
SDL Library Documentation
PrevNext

SDL_GetThreadID

Name

SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

Uint32 SDL_GetThreadID(SDL_Thread *thread);

Description

Returns the ID of a SDL_Thread created by SDL_CreateThread.


PrevHomeNext
SDL_ThreadIDUpSDL_WaitThread
\ No newline at end of file diff --git a/docs/html/sdlgetticks.html b/docs/html/sdlgetticks.html deleted file mode 100644 index 0911aae1a5..0000000000 --- a/docs/html/sdlgetticks.html +++ /dev/null @@ -1,206 +0,0 @@ -SDL_GetTicks
SDL Library Documentation
PrevNext

SDL_GetTicks

Name

SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.

Synopsis

#include "SDL.h"

Uint32 SDL_GetTicks(void);

Description

Get the number of milliseconds since the SDL library initialization. -Note that this value wraps if the program runs for more than ~49 days.

See Also

SDL_Delay


PrevHomeNext
TimeUpSDL_Delay
\ No newline at end of file diff --git a/docs/html/sdlgetvideoinfo.html b/docs/html/sdlgetvideoinfo.html deleted file mode 100644 index 25c4b458aa..0000000000 --- a/docs/html/sdlgetvideoinfo.html +++ /dev/null @@ -1,226 +0,0 @@ -SDL_GetVideoInfo
SDL Library Documentation
PrevNext

SDL_GetVideoInfo

Name

SDL_GetVideoInfo -- returns a pointer to information about the video hardware

Synopsis

#include "SDL.h"

SDL_VideoInfo *SDL_GetVideoInfo(void);

Description

This function returns a read-only pointer to information about the video -hardware. If this is called before SDL_SetVideoMode, the -vfmt member of the returned structure will contain the -pixel format of the "best" video mode.


PrevHomeNext
SDL_GetVideoSurfaceUpSDL_VideoDriverName
\ No newline at end of file diff --git a/docs/html/sdlgetvideosurface.html b/docs/html/sdlgetvideosurface.html deleted file mode 100644 index 905b1f6ac4..0000000000 --- a/docs/html/sdlgetvideosurface.html +++ /dev/null @@ -1,208 +0,0 @@ -SDL_GetVideoSurface
SDL Library Documentation
PrevNext

SDL_GetVideoSurface

Name

SDL_GetVideoSurface -- returns a pointer to the current display surface

Synopsis

#include "SDL.h"

SDL_Surface *SDL_GetVideoSurface(void);

Description

This function returns a pointer to the current display surface. -If SDL is doing format conversion on the display surface, this -function returns the publicly visible surface, not the real video -surface.

See Also

SDL_Surface


PrevHomeNext
VideoUpSDL_GetVideoInfo
\ No newline at end of file diff --git a/docs/html/sdlglattr.html b/docs/html/sdlglattr.html deleted file mode 100644 index 0ae01272a4..0000000000 --- a/docs/html/sdlglattr.html +++ /dev/null @@ -1,379 +0,0 @@ -SDL_GLattr
SDL Library Documentation
PrevNext

SDL_GLattr

Name

SDL_GLattr -- SDL GL Attributes

Attributes

SDL_GL_RED_SIZESize of the framebuffer red component, in bits
SDL_GL_GREEN_SIZESize of the framebuffer green component, in bits
SDL_GL_BLUE_SIZESize of the framebuffer blue component, in bits
SDL_GL_ALPHA_SIZESize of the framebuffer alpha component, in bits
SDL_GL_DOUBLEBUFFER0 or 1, enable or disable double buffering
SDL_GL_BUFFER_SIZESize of the framebuffer, in bits
SDL_GL_DEPTH_SIZESize of the depth buffer, in bits
SDL_GL_STENCIL_SIZESize of the stencil buffer, in bits
SDL_GL_ACCUM_RED_SIZESize of the accumulation buffer red component, in bits
SDL_GL_ACCUM_GREEN_SIZESize of the accumulation buffer green component, in bits
SDL_GL_ACCUM_BLUE_SIZESize of the accumulation buffer blue component, in bits
SDL_GL_ACCUM_ALPHA_SIZESize of the accumulation buffer alpha component, in bits

Description

While you can set most OpenGL attributes normally, the attributes list above must be known before SDL sets the video mode. These attributes a set and read with SDL_GL_SetAttribute and SDL_GL_GetAttribute.


PrevHomeNext
SDL_FreeYUVOverlayUpSDL_Rect
\ No newline at end of file diff --git a/docs/html/sdlglgetattribute.html b/docs/html/sdlglgetattribute.html deleted file mode 100644 index 26c8913bd2..0000000000 --- a/docs/html/sdlglgetattribute.html +++ /dev/null @@ -1,247 +0,0 @@ -SDL_GL_GetAttribute
SDL Library Documentation
PrevNext

SDL_GL_GetAttribute

Name

SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute

Synopsis

#include "SDL.h"

int SDL_GL_GetAttribute(SDLGLattr attr, int *value);

Description

Places the value of the SDL/OpenGL attribute attr into value. This is useful after a call to SDL_SetVideoMode to check whether your attributes have been set as you expected.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_GL_GetProcAddressUpSDL_GL_SetAttribute
\ No newline at end of file diff --git a/docs/html/sdlglgetprocaddress.html b/docs/html/sdlglgetprocaddress.html deleted file mode 100644 index a6cf6e4c11..0000000000 --- a/docs/html/sdlglgetprocaddress.html +++ /dev/null @@ -1,262 +0,0 @@ -SDL_GL_GetProcAddress
SDL Library Documentation
PrevNext

SDL_GL_GetProcAddress

Name

SDL_GL_GetProcAddress -- Get the address of a GL function

Synopsis

#include "SDL.h"

void *SDL_GL_GetProcAddress(const char* proc);

Description

Returns the address of the GL function proc, or NULL if the function is not found. If the GL library is loaded at runtime, with SDL_GL_LoadLibrary, then all GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL extensions.

Example

typedef void (*GL_ActiveTextureARB_Func)(unsigned int);
-GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
-int has_multitexture=1;
-.
-.
-.
-/* Get function pointer */
-glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
-
-/* Check for a valid function ptr */
-if(!glActiveTextureARB_ptr){
-  fprintf(stderr, "Multitexture Extensions not present.\n");
-  has_multitexture=0;
-}
-.
-.
-.
-.
-if(has_multitexture){
-  glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
-  .
-  .
-}
-else{
-  .
-  .
-}

PrevHomeNext
SDL_GL_LoadLibraryUpSDL_GL_GetAttribute
\ No newline at end of file diff --git a/docs/html/sdlglloadlibrary.html b/docs/html/sdlglloadlibrary.html deleted file mode 100644 index d3c4c6d79d..0000000000 --- a/docs/html/sdlglloadlibrary.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_GL_LoadLibrary
SDL Library Documentation
PrevNext

SDL_GL_LoadLibrary

Name

SDL_GL_LoadLibrary -- Specify an OpenGL library

Synopsis

#include "SDL.h"

int SDL_GL_LoadLibrary(const char *path);

Description

If you wish, you may load the OpenGL library at runtime, this must be done before SDL_SetVideoMode is called. The path of the GL library is passed to SDL_GL_LoadLibrary and it returns 0 on success, or -1 on an error. You must then use SDL_GL_GetProcAddress to retrieve function pointers to GL functions.


PrevHomeNext
SDL_ShowCursorUpSDL_GL_GetProcAddress
\ No newline at end of file diff --git a/docs/html/sdlglsetattribute.html b/docs/html/sdlglsetattribute.html deleted file mode 100644 index ffb1204b0e..0000000000 --- a/docs/html/sdlglsetattribute.html +++ /dev/null @@ -1,286 +0,0 @@ -SDL_GL_SetAttribute
SDL Library Documentation
PrevNext

SDL_GL_SetAttribute

Name

SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute

Synopsis

#include "SDL.h"

int SDL_GL_SetAttribute(SDL_GLattr attr, int value);

Description

Sets the OpenGL attribute attr to value. The attributes you set don't take effect until after a call to SDL_SetVideoMode. You should use SDL_GL_GetAttribute to check the values after a SDL_SetVideoMode call.

Return Value

Returns 0 on success, or -1 on error.

Example

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
-SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
-SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
-SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
-SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
-if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) {
-  fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
-  SDL_Quit();
-  return;
-}

Note: The SDL_DOUBLEBUF flag is not required to enable double buffering when setting an OpenGL video mode. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute.


PrevHomeNext
SDL_GL_GetAttributeUpSDL_GL_SwapBuffers
\ No newline at end of file diff --git a/docs/html/sdlglswapbuffers.html b/docs/html/sdlglswapbuffers.html deleted file mode 100644 index fa383414d4..0000000000 --- a/docs/html/sdlglswapbuffers.html +++ /dev/null @@ -1,212 +0,0 @@ -SDL_GL_SwapBuffers
SDL Library Documentation
PrevNext

SDL_GL_SwapBuffers

Name

SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display

Synopsis

#include "SDL.h"

void SDL_GL_SwapBuffers(void );

Description

Swap the OpenGL buffers, if double-buffering is supported.


PrevHomeNext
SDL_GL_SetAttributeUpSDL_CreateYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlinit.html b/docs/html/sdlinit.html deleted file mode 100644 index 11f27b81d1..0000000000 --- a/docs/html/sdlinit.html +++ /dev/null @@ -1,368 +0,0 @@ -SDL_Init
SDL Library Documentation
PrevNext

SDL_Init

Name

SDL_Init -- Initializes SDL

Synopsis

#include "SDL.h"

int SDL_Init(Uint32 flags);

Description

Initializes SDL. This should be called before all other SDL functions. The flags parameter specifies what part(s) of SDL to initialize.

SDL_INIT_TIMERInitializes the timer subsystem.
SDL_INIT_AUDIOInitializes the audio subsystem.
SDL_INIT_VIDEOInitializes the video subsystem.
SDL_INIT_CDROMInitializes the cdrom subsystem.
SDL_INIT_JOYSTICKInitializes the joystick subsystem.
SDL_INIT_EVERYTHINGInitialize all of the above.
SDL_INIT_NOPARACHUTEPrevents SDL from catching fatal signals.
SDL_INIT_EVENTTHREAD 

Return Value

Returns -1 on an error or 0 on success.


PrevHomeNext
GeneralUpSDL_InitSubSystem
\ No newline at end of file diff --git a/docs/html/sdlinitsubsystem.html b/docs/html/sdlinitsubsystem.html deleted file mode 100644 index 917fd1068e..0000000000 --- a/docs/html/sdlinitsubsystem.html +++ /dev/null @@ -1,283 +0,0 @@ -SDL_InitSubSystem
SDL Library Documentation
PrevNext

SDL_InitSubSystem

Name

SDL_InitSubSystem -- Initialize subsystems

Synopsis

#include "SDL.h"

int SDL_InitSubSystem(Uint32 flags);

Description

After SDL has been initialized with SDL_Init you may initialize uninitialized subsystems with SDL_InitSubSystem. The flags parameter is the same as that used in SDL_Init.

Examples

/* Seperating Joystick and Video initialization. */
-SDL_Init(SDL_INIT_VIDEO);
-.
-.
-SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
-.
-/* Do Some Video stuff */
-.
-.
-/* Initialize the joystick subsystem */
-SDL_InitSubSystem(SDL_INIT_JOYSTICK);
-
-/* Do some stuff with video and joystick */
-.
-.
-.
-/* Shut them both down */
-SDL_Quit();

Return Value

Returns -1 on an error or 0 on success.


PrevHomeNext
SDL_InitUpSDL_QuitSubSystem
\ No newline at end of file diff --git a/docs/html/sdljoyaxisevent.html b/docs/html/sdljoyaxisevent.html deleted file mode 100644 index 9f0166959f..0000000000 --- a/docs/html/sdljoyaxisevent.html +++ /dev/null @@ -1,330 +0,0 @@ -SDL_JoyAxisEvent
SDL Library Documentation
PrevNext

SDL_JoyAxisEvent

Name

SDL_JoyAxisEvent -- Joystick axis motion event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 which;
-  Uint8 axis;
-  Sint16 value;
-} SDL_JoyAxisEvent;

Structure Data

typeSDL_JOYAXISMOTION
whichJoystick device index
axisJoystick axis index
valueAxis value (range: -32768 to 32767)

Description

SDL_JoyAxisEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYAXISMOTION is reported.

A SDL_JOYAXISMOTION event occurs when ever a user moves an axis on the joystick. The field which is the index of the joystick that reported the event and axis is the index of the axis (for a more detailed explaination see the Joystick section). value is the current position of the axis.


PrevHomeNext
SDL_MouseButtonEventUpSDL_JoyButtonEvent
\ No newline at end of file diff --git a/docs/html/sdljoyballevent.html b/docs/html/sdljoyballevent.html deleted file mode 100644 index 4ab96fe0e8..0000000000 --- a/docs/html/sdljoyballevent.html +++ /dev/null @@ -1,340 +0,0 @@ -SDL_JoyBallEvent
SDL Library Documentation
PrevNext

SDL_JoyBallEvent

Name

SDL_JoyBallEvent -- Joystick trackball motion event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 which;
-  Uint8 ball;
-  Sint16 xrel, yrel;
-} SDL_JoyBallEvent;

Structure Data

typeSDL_JOYBALLMOTION
whichJoystick device index
ballJoystick trackball index
xrel, yrelThe relative motion in the X/Y direction

Description

SDL_JoyBallEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYBALLMOTION is reported.

A SDL_JOYBALLMOTION event occurs when a user moves a trackball on the joystick. The field which is the index of the joystick that reported the event and ball is the index of the trackball (for a more detailed explaination see the Joystick section). Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in xrel and yrel.


PrevHomeNext
SDL_JoyHatEventUpSDL_ResizeEvent
\ No newline at end of file diff --git a/docs/html/sdljoybuttonevent.html b/docs/html/sdljoybuttonevent.html deleted file mode 100644 index d1d9c1ef63..0000000000 --- a/docs/html/sdljoybuttonevent.html +++ /dev/null @@ -1,351 +0,0 @@ -SDL_JoyButtonEvent
SDL Library Documentation
PrevNext

SDL_JoyButtonEvent

Name

SDL_JoyButtonEvent -- Joystick button event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 which;
-  Uint8 button;
-  Uint8 state;
-} SDL_JoyButtonEvent;

Structure Data

typeSDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP
whichJoystick device index
buttonJoystick button index
stateSDL_PRESSED or SDL_RELEASED

Description

SDL_JoyButtonEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP is reported.

A SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP event occurs when ever a user presses or releases a button on a joystick. The field which is the index of the joystick that reported the event and button is the index of the button (for a more detailed explaination see the Joystick section). state is the current state or the button which is either SDL_PRESSED or SDL_RELEASED.


PrevHomeNext
SDL_JoyAxisEventUpSDL_JoyHatEvent
\ No newline at end of file diff --git a/docs/html/sdljoyhatevent.html b/docs/html/sdljoyhatevent.html deleted file mode 100644 index 5e115be231..0000000000 --- a/docs/html/sdljoyhatevent.html +++ /dev/null @@ -1,413 +0,0 @@ -SDL_JoyHatEvent
SDL Library Documentation
PrevNext

SDL_JoyHatEvent

Name

SDL_JoyHatEvent -- Joystick hat position change event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 which;
-  Uint8 hat;
-  Uint8 value;
-} SDL_JoyHatEvent;

Structure Data

typeSDL_JOY
whichJoystick device index
hatJoystick hat index
valueHat position

Description

SDL_JoyHatEvent is a member of the SDL_Event union and is used when an event of type SDL_JOYHATMOTION is reported.

A SDL_JOYHATMOTION event occurs when ever a user moves a hat on the joystick. The field which is the index of the joystick that reported the event and hat is the index of the hat (for a more detailed exlaination see the Joystick section). value is the current position of the hat. It is a logically OR'd combination of the following values (whose meanings should be pretty obvious:) :

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT

The following defines are also provided:

SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN


PrevHomeNext
SDL_JoyButtonEventUpSDL_JoyBallEvent
\ No newline at end of file diff --git a/docs/html/sdljoystickclose.html b/docs/html/sdljoystickclose.html deleted file mode 100644 index efb44e0fe6..0000000000 --- a/docs/html/sdljoystickclose.html +++ /dev/null @@ -1,223 +0,0 @@ -SDL_JoystickClose
SDL Library Documentation
PrevNext

SDL_JoystickClose

Name

SDL_JoystickClose -- Closes a previously opened joystick

Synopsis

#include "SDL.h"

void SDL_JoystickClose(SDL_Joystick *joystick);

Description

Close a joystick that was previously opened with SDL_JoystickOpen.


PrevHomeNext
SDL_JoystickGetBallUpAudio
\ No newline at end of file diff --git a/docs/html/sdljoystickeventstate.html b/docs/html/sdljoystickeventstate.html deleted file mode 100644 index 11b148a126..0000000000 --- a/docs/html/sdljoystickeventstate.html +++ /dev/null @@ -1,290 +0,0 @@ -SDL_JoystickEventState
SDL Library Documentation
PrevNext

SDL_JoystickEventState

Name

SDL_JoystickEventState -- Enable/disable joystick event polling

Synopsis

#include "SDL.h"

int SDL_JoystickEventState(int state);

Description

This function is used to enable or disable joystick event processing. With joystick event processing disabled you will have to update joystick states with SDL_JoystickUpdate and read the joystick information manually. state is either SDL_QUERY, SDL_ENABLE or SDL_IGNORE.

Note: Joystick event handling is prefered

Return Value

If state is SDL_QUERY then the current state is returned, otherwise the new processing state is returned.


PrevHomeNext
SDL_GetAppStateUpJoystick
\ No newline at end of file diff --git a/docs/html/sdljoystickgetaxis.html b/docs/html/sdljoystickgetaxis.html deleted file mode 100644 index 40a17b4cc2..0000000000 --- a/docs/html/sdljoystickgetaxis.html +++ /dev/null @@ -1,271 +0,0 @@ -SDL_JoystickGetAxis
SDL Library Documentation
PrevNext

SDL_JoystickGetAxis

Name

SDL_JoystickGetAxis -- Get the current state of an axis

Synopsis

#include "SDL.h"

Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);

Description

SDL_JoystickGetAxis returns the current state of the given axis on the given joystick.

On most modern joysticks the X axis is usually represented by axis 0 and the Y axis by axis 1. The value returned by SDL_JoystickGetAxis is a signed integer (-32768 to 32768) representing the current position of the axis, it maybe necessary to impose certain tolerances on these values to account for jitter. It is worth noting that some joysticks use axes 2 and 3 for extra buttons.

Return Value

Returns a 16-bit signed integer representing the current position of the axis.

Examples

Sint16 x_move, y_move;
-SDL_Joystick *joy1;
-.
-.
-x_move=SDL_JoystickGetAxis(joy1, 0);
-y_move=SDL_JoystickGetAxis(joy1, 1);


PrevHomeNext
SDL_JoystickUpdateUpSDL_JoystickGetHat
\ No newline at end of file diff --git a/docs/html/sdljoystickgetball.html b/docs/html/sdljoystickgetball.html deleted file mode 100644 index 0da252ab1a..0000000000 --- a/docs/html/sdljoystickgetball.html +++ /dev/null @@ -1,262 +0,0 @@ -SDL_JoystickGetBall
SDL Library Documentation
PrevNext

SDL_JoystickGetBall

Name

SDL_JoystickGetBall -- Get relative trackball motion

Synopsis

#include "SDL.h"

int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);

Description

Get the ball axis change.

Trackballs can only return relative motion since the last call to SDL_JoystickGetBall, these motion deltas a placed into dx and dy.

Return Value

Returns 0 on success or -1 on failure

Examples

int delta_x, delta_y;
-SDL_Joystick *joy;
-.
-.
-.
-SDL_JoystickUpdate();
-if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
-  printf("TrackBall Read Error!\n");
-printf("Trackball Delta- X:%d, Y:%d\n", delta_x, delta_y);


PrevHomeNext
SDL_JoystickGetButtonUpSDL_JoystickClose
\ No newline at end of file diff --git a/docs/html/sdljoystickgetbutton.html b/docs/html/sdljoystickgetbutton.html deleted file mode 100644 index 680e3569d0..0000000000 --- a/docs/html/sdljoystickgetbutton.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_JoystickGetButton
SDL Library Documentation
PrevNext

SDL_JoystickGetButton

Name

SDL_JoystickGetButton -- Get the current state of a given button on a given joystick

Synopsis

#include "SDL.h"

Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button);

Description

SDL_JoystickGetButton returns the current state of the given button on the given joystick.

Return Value

1 if the button is pressed. Otherwise, 0.


PrevHomeNext
SDL_JoystickGetHatUpSDL_JoystickGetBall
\ No newline at end of file diff --git a/docs/html/sdljoystickgethat.html b/docs/html/sdljoystickgethat.html deleted file mode 100644 index c638abb7c2..0000000000 --- a/docs/html/sdljoystickgethat.html +++ /dev/null @@ -1,297 +0,0 @@ -SDL_JoystickGetHat
SDL Library Documentation
PrevNext

SDL_JoystickGetHat

Name

SDL_JoystickGetHat -- Get the current state of a joystick hat

Synopsis

#include "SDL.h"

Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);

Description

SDL_JoystickGetHat returns the current state of the given hat on the given joystick.

Return Value

The current state is returned as a Uint8 which is defined as an OR'd combination of one or more of the following

SDL_HAT_CENTERED
SDL_HAT_UP
SDL_HAT_RIGHT
SDL_HAT_DOWN
SDL_HAT_LEFT
SDL_HAT_RIGHTUP
SDL_HAT_RIGHTDOWN
SDL_HAT_LEFTUP
SDL_HAT_LEFTDOWN


PrevHomeNext
SDL_JoystickGetAxisUpSDL_JoystickGetButton
\ No newline at end of file diff --git a/docs/html/sdljoystickindex.html b/docs/html/sdljoystickindex.html deleted file mode 100644 index 868a75addb..0000000000 --- a/docs/html/sdljoystickindex.html +++ /dev/null @@ -1,218 +0,0 @@ -SDL_JoystickIndex
SDL Library Documentation
PrevNext

SDL_JoystickIndex

Name

SDL_JoystickIndex -- Get the index of an SDL_Joystick.

Synopsis

#include "SDL.h"

int SDL_JoystickIndex(SDL_Joystick *joystick);

Description

Returns the index of a given SDL_Joystick structure.

Return Value

Index number of the joystick.


PrevHomeNext
SDL_JoystickOpenedUpSDL_JoystickNumAxes
\ No newline at end of file diff --git a/docs/html/sdljoystickname.html b/docs/html/sdljoystickname.html deleted file mode 100644 index 0add817dc5..0000000000 --- a/docs/html/sdljoystickname.html +++ /dev/null @@ -1,238 +0,0 @@ -SDL_JoystickName
SDL Library Documentation
PrevNext

SDL_JoystickName

Name

SDL_JoystickName -- Get joystick name.

Synopsis

#include "SDL.h"

const char *SDL_JoystickName(int index);

Description

Get the implementation dependent name of joystick. The index parameter refers to the N'th joystick on the system.

Return Value

Returns a char pointer to the joystick name.

Examples

/* Print the names of all attached joysticks */
-int num_joy, i;
-num_joy=SDL_NumJoysticks();
-printf("%d joysticks found\n", num_joy);
-for(i=0;i<num_joy;i++)
-  printf("%s\n", SDL_JoystickName(i));


PrevHomeNext
SDL_NumJoysticksUpSDL_JoystickOpen
\ No newline at end of file diff --git a/docs/html/sdljoysticknumaxes.html b/docs/html/sdljoysticknumaxes.html deleted file mode 100644 index 53b67f5239..0000000000 --- a/docs/html/sdljoysticknumaxes.html +++ /dev/null @@ -1,225 +0,0 @@ -SDL_JoystickNumAxes
SDL Library Documentation
PrevNext

SDL_JoystickNumAxes

Name

SDL_JoystickNumAxes -- Get the number of joystick axes

Synopsis

#include "SDL.h"

int SDL_JoystickNumAxes(SDL_Joystick *joystick);

Description

Return the number of axes available from a previously opened SDL_Joystick.

Return Value

Number of axes.


PrevHomeNext
SDL_JoystickIndexUpSDL_JoystickNumBalls
\ No newline at end of file diff --git a/docs/html/sdljoysticknumballs.html b/docs/html/sdljoysticknumballs.html deleted file mode 100644 index 0a8405dc93..0000000000 --- a/docs/html/sdljoysticknumballs.html +++ /dev/null @@ -1,225 +0,0 @@ -SDL_JoystickNumBalls
SDL Library Documentation
PrevNext

SDL_JoystickNumBalls

Name

SDL_JoystickNumBalls -- Get the number of joystick trackballs

Synopsis

#include "SDL.h"

int SDL_JoystickNumBalls(SDL_Joystick *joystick);

Description

Return the number of trackballs available from a previously opened SDL_Joystick.

Return Value

Number of trackballs.


PrevHomeNext
SDL_JoystickNumAxesUpSDL_JoystickNumHats
\ No newline at end of file diff --git a/docs/html/sdljoysticknumbuttons.html b/docs/html/sdljoysticknumbuttons.html deleted file mode 100644 index 625b893a6a..0000000000 --- a/docs/html/sdljoysticknumbuttons.html +++ /dev/null @@ -1,225 +0,0 @@ -SDL_JoystickNumButtons
SDL Library Documentation
PrevNext

SDL_JoystickNumButtons

Name

SDL_JoystickNumButtons -- Get the number of joysitck buttons

Synopsis

#include "SDL.h"

int SDL_JoystickNumButtons(SDL_Joystick *joystick);

Description

Return the number of buttons available from a previously opened SDL_Joystick.

Return Value

Number of buttons.


PrevHomeNext
SDL_JoystickNumHatsUpSDL_JoystickUpdate
\ No newline at end of file diff --git a/docs/html/sdljoysticknumhats.html b/docs/html/sdljoysticknumhats.html deleted file mode 100644 index ed53235854..0000000000 --- a/docs/html/sdljoysticknumhats.html +++ /dev/null @@ -1,225 +0,0 @@ -SDL_JoystickNumHats
SDL Library Documentation
PrevNext

SDL_JoystickNumHats

Name

SDL_JoystickNumHats -- Get the number of joystick hats

Synopsis

#include "SDL.h"

int SDL_JoystickNumHats(SDL_Joystick *joystick);

Description

Return the number of hats available from a previously opened SDL_Joystick.

Return Value

Number of hats.


PrevHomeNext
SDL_JoystickNumBallsUpSDL_JoystickNumButtons
\ No newline at end of file diff --git a/docs/html/sdljoystickopen.html b/docs/html/sdljoystickopen.html deleted file mode 100644 index e608c4370f..0000000000 --- a/docs/html/sdljoystickopen.html +++ /dev/null @@ -1,259 +0,0 @@ -SDL_JoystickOpen
SDL Library Documentation
PrevNext

SDL_JoystickOpen

Name

SDL_JoystickOpen -- Opens a joystick for use.

Synopsis

#include "SDL.h"

SDL_Joystick *SDL_JoystickOpen(int index);

Description

Opens a joystick for use within SDL. The index refers to the N'th joystick in the system. A joystick must be opened before it game be used.

Return Value

Returns a SDL_Joystick structure on success. NULL on failure.

Examples

SDL_Joystick *joy;
-// Check for joystick
-if(SDL_NumJoysticks()>0){
-  // Open joystick
-  joy=SDL_JoystickOpen(0);
-  
-  if(joy)
-  {
-    printf("Opened Joystick 0\n");
-    printf("Name: %s\n", SDL_JoystickName(0));
-    printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
-    printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
-    printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
-  }
-  else
-    printf("Couldn't open Joystick 0\n");
-  
-  // Close if opened
-  if(SDL_JoystickOpened(0))
-    SDL_JoystickClose(joy);
-}


PrevHomeNext
SDL_JoystickNameUpSDL_JoystickOpened
\ No newline at end of file diff --git a/docs/html/sdljoystickopened.html b/docs/html/sdljoystickopened.html deleted file mode 100644 index 5275a099de..0000000000 --- a/docs/html/sdljoystickopened.html +++ /dev/null @@ -1,233 +0,0 @@ -SDL_JoystickOpened
SDL Library Documentation
PrevNext

SDL_JoystickOpened

Name

SDL_JoystickOpened -- Determine if a joystick has been opened

Synopsis

#include "SDL.h"

int SDL_JoystickOpened(int index);

Description

Determines whether a joystick has already been opened within the application. index refers to the N'th joystick on the system.

Return Value

Returns 1 if the joystick has been opened, or 0 if it has not.


PrevHomeNext
SDL_JoystickOpenUpSDL_JoystickIndex
\ No newline at end of file diff --git a/docs/html/sdljoystickupdate.html b/docs/html/sdljoystickupdate.html deleted file mode 100644 index 0cb37dc226..0000000000 --- a/docs/html/sdljoystickupdate.html +++ /dev/null @@ -1,211 +0,0 @@ -SDL_JoystickUpdate
SDL Library Documentation
PrevNext

SDL_JoystickUpdate

Name

SDL_JoystickUpdate -- Updates the state of all joysticks

Synopsis

#include "SDL.h"

void SDL_JoystickUpdate(void);

Description

Updates the state(position, buttons, etc.) of all open joysticks. If joystick events have been enabled with SDL_JoystickEventState then this is called automatically in the event loop.


PrevHomeNext
SDL_JoystickNumButtonsUpSDL_JoystickGetAxis
\ No newline at end of file diff --git a/docs/html/sdlkey.html b/docs/html/sdlkey.html deleted file mode 100644 index 6591884d1e..0000000000 --- a/docs/html/sdlkey.html +++ /dev/null @@ -1,2630 +0,0 @@ -SDLKey
SDL Library Documentation
PrevNext

SDLKey

Name

SDLKey -- Keysym definitions.

Description

Table 8-1. SDL Keysym definitions

SDLKeyASCII valueCommon name
SDLK_BACKSPACE'\b'backspace
SDLK_TAB'\t'tab
SDLK_CLEAR clear
SDLK_RETURN'\r'return
SDLK_PAUSE pause
SDLK_ESCAPE'^['escape
SDLK_SPACE' 'space
SDLK_EXCLAIM'!'exclaim
SDLK_QUOTEDBL'"'quotedbl
SDLK_HASH'#'hash
SDLK_DOLLAR'$'dollar
SDLK_AMPERSAND'&'ampersand
SDLK_QUOTE'''quote
SDLK_LEFTPAREN'('left parenthesis
SDLK_RIGHTPAREN')'right parenthesis
SDLK_ASTERISK'*'asterisk
SDLK_PLUS'+'plus sign
SDLK_COMMA','comma
SDLK_MINUS'-'minus sign
SDLK_PERIOD'.'period
SDLK_SLASH'/'forward slash
SDLK_0'0'0
SDLK_1'1'1
SDLK_2'2'2
SDLK_3'3'3
SDLK_4'4'4
SDLK_5'5'5
SDLK_6'6'6
SDLK_7'7'7
SDLK_8'8'8
SDLK_9'9'9
SDLK_COLON':'colon
SDLK_SEMICOLON';'semicolon
SDLK_LESS'<'less-than sign
SDLK_EQUALS'='equals sign
SDLK_GREATER'>'greater-than sign
SDLK_QUESTION'?'question mark
SDLK_AT'@'at
SDLK_LEFTBRACKET'['left bracket
SDLK_BACKSLASH'\'backslash
SDLK_RIGHTBRACKET']'right bracket
SDLK_CARET'^'caret
SDLK_UNDERSCORE'_'underscore
SDLK_BACKQUOTE'`'grave
SDLK_a'a'a
SDLK_b'b'b
SDLK_c'c'c
SDLK_d'd'd
SDLK_e'e'e
SDLK_f'f'f
SDLK_g'g'g
SDLK_h'h'h
SDLK_i'i'i
SDLK_j'j'j
SDLK_k'k'k
SDLK_l'l'l
SDLK_m'm'm
SDLK_n'n'n
SDLK_o'o'o
SDLK_p'p'p
SDLK_q'q'q
SDLK_r'r'r
SDLK_s's's
SDLK_t't't
SDLK_u'u'u
SDLK_v'v'v
SDLK_w'w'w
SDLK_x'x'x
SDLK_y'y'y
SDLK_z'z'z
SDLK_DELETE'^?'delete
SDLK_KP0 keypad 0
SDLK_KP1 keypad 1
SDLK_KP2 keypad 2
SDLK_KP3 keypad 3
SDLK_KP4 keypad 4
SDLK_KP5 keypad 5
SDLK_KP6 keypad 6
SDLK_KP7 keypad 7
SDLK_KP8 keypad 8
SDLK_KP9 keypad 9
SDLK_KP_PERIOD'.'keypad period
SDLK_KP_DIVIDE'/'keypad divide
SDLK_KP_MULTIPLY'*'keypad multiply
SDLK_KP_MINUS'-'keypad minus
SDLK_KP_PLUS'+'keypad plus
SDLK_KP_ENTER'\r'keypad enter
SDLK_KP_EQUALS'='keypad equals
SDLK_UP up arrow
SDLK_DOWN down arrow
SDLK_RIGHT right arrow
SDLK_LEFT left arrow
SDLK_INSERT insert
SDLK_HOME home
SDLK_END end
SDLK_PAGEUP page up
SDLK_PAGEDOWN page down
SDLK_F1 F1
SDLK_F2 F2
SDLK_F3 F3
SDLK_F4 F4
SDLK_F5 F5
SDLK_F6 F6
SDLK_F7 F7
SDLK_F8 F8
SDLK_F9 F9
SDLK_F10 F10
SDLK_F11 F11
SDLK_F12 F12
SDLK_F13 F13
SDLK_F14 F14
SDLK_F15 F15
SDLK_NUMLOCK numlock
SDLK_CAPSLOCK capslock
SDLK_SCROLLOCK scrollock
SDLK_RSHIFT right shift
SDLK_LSHIFT left shift
SDLK_RCTRL right ctrl
SDLK_LCTRL left ctrl
SDLK_RALT right alt
SDLK_LALT left alt
SDLK_RMETA right meta
SDLK_LMETA left meta
SDLK_LSUPER left windows key
SDLK_RSUPER right windows key
SDLK_MODE mode shift
SDLK_HELP help
SDLK_PRINT print-screen
SDLK_SYSREQ SysRq
SDLK_BREAK break
SDLK_MENU menu
SDLK_POWER power
SDLK_EURO euro
- -

Table 8-2. SDL modifier definitions

SDL ModifierMeaning
KMOD_NONENo modifiers applicable
KMOD_NUMNumlock is down
KMOD_CAPSCapslock is down
KMOD_LCTRLLeft Control is down
KMOD_RCTRLRight Control is down
KMOD_RSHIFTRight Shift is down
KMOD_LSHIFTLeft Shift is down
KMOD_RALTRight Alt is down
KMOD_LALTLeft Alt is down
KMOD_CTRLA Control key is down
KMOD_SHIFTA Shift key is down
KMOD_ALTAn Alt key is down


PrevHomeNext
SDL_keysymUpEvent Functions.
\ No newline at end of file diff --git a/docs/html/sdlkeyboardevent.html b/docs/html/sdlkeyboardevent.html deleted file mode 100644 index 1a6962c74a..0000000000 --- a/docs/html/sdlkeyboardevent.html +++ /dev/null @@ -1,375 +0,0 @@ -SDL_KeyboardEvent
SDL Library Documentation
PrevNext

SDL_KeyboardEvent

Name

SDL_KeyboardEvent -- Keyboard event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 state;
-  SDL_keysym keysym;
-} SDL_KeyboardEvent;

Structure Data

typeSDL_KEYDOWN or SDL_KEYUP
stateSDL_PRESSED or SDL_RELEASED
keysymContains key press information

Description

SDL_KeyboardEvent is a member of the SDL_Event union and is used when an event of type SDL_KEYDOWN or SDL_KEYUP is reported.

The type and state actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (type=SDK_KEYUP or state=SDL_RELEASED) and when a key is pressed (type=SDL_KEYDOWN or state=SDL_PRESSED). The information on what key was pressed or released is in the keysym structure.

Note: Repeating SDL_KEYDOWN events will occur if key repeat is enabled (see SDL_EnableKeyRepeat).


PrevHomeNext
SDL_ActiveEventUpSDL_MouseMotionEvent
\ No newline at end of file diff --git a/docs/html/sdlkeysym.html b/docs/html/sdlkeysym.html deleted file mode 100644 index 7a22f79513..0000000000 --- a/docs/html/sdlkeysym.html +++ /dev/null @@ -1,355 +0,0 @@ -SDL_keysym
SDL Library Documentation
PrevNext

SDL_keysym

Name

SDL_keysym -- Keysym structure

Structure Definition

typedef struct{
-  Uint8 scancode;
-  SDLKey sym;
-  SDLMod mod;
-  Uint16 unicode;
-} SDL_keysym;

Structure Data

scancodeHardware specific scancode
symSDL virtual keysym
modCurrent key modifiers
unicodeTranslated character

Description

The SDL_keysym structure is used by reporting key presses and releases since it is a part of the SDL_KeyboardEvent.

The scancode field should generally be left alone, it is the hardware dependent scancode returned by the keyboard. The sym field is extremely useful. It is the SDL-defined value of the key (see SDL Key Syms. This field is very useful when you are checking for certain key presses, like so: -

.
-.
-while(SDL_PollEvent(&event)){
-  switch(event.type){
-    case SDL_KEYDOWN:
-      if(event.key.keysym.sym==SDLK_LEFT)
-        move_left();
-      break;
-    .
-    .
-    .
-  }
-}
-.
-.
-mod stores the current state of the keyboard modifiers as explained in SDL_GetModState. The unicode is only used when UNICODE translation is enabled with SDL_EnableUNICODE. If unicode is non-zero then this a the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: -
char ch;
-if ( (keysym.unicode & 0xFF80) == 0 ) {
-  ch = keysym.unicode & 0x7F;
-}
-else {
-  printf("An International Character.\n");
-}
-UNICODE translation does have a slight overhead so don't enable it unless its needed.

See Also

SDLKey


PrevHomeNext
SDL_QuitEventUpSDLKey
\ No newline at end of file diff --git a/docs/html/sdlkillthread.html b/docs/html/sdlkillthread.html deleted file mode 100644 index 2ce7b9b58f..0000000000 --- a/docs/html/sdlkillthread.html +++ /dev/null @@ -1,223 +0,0 @@ -SDL_KillThread
SDL Library Documentation
PrevNext

SDL_KillThread

Name

SDL_KillThread -- Gracelessly terminates the thread.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

void SDL_KillThread(SDL_Thread *thread);

Description

SDL_KillThread gracelessly terminates the thread -associated with thread. If possible, you should -use some other form of IPC to signal the thread to quit.


PrevHomeNext
SDL_WaitThreadUpSDL_CreateMutex
\ No newline at end of file diff --git a/docs/html/sdllistmodes.html b/docs/html/sdllistmodes.html deleted file mode 100644 index ee7bc0eeec..0000000000 --- a/docs/html/sdllistmodes.html +++ /dev/null @@ -1,310 +0,0 @@ -SDL_ListModes
SDL Library Documentation
PrevNext

SDL_ListModes

Name

SDL_ListModes -- Returns a pointer to an array of available screen dimensions for -the given format and video flags

Synopsis

#include "SDL.h"

SDL_Rect **SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);

Description

Return a pointer to an array of available screen dimensions for the given -format and video flags, sorted largest to smallest. Returns -NULL if there are no dimensions available for a particular -format, or -1 if any dimension is okay for -the given format.

If format is NULL, the mode list -will be for the format returned by SDL_GetVideoInfo()->vfmt. The flag parameter is an OR'd combination of surface flags. The flags are the same as those used SDL_SetVideoMode and they play a strong role in deciding what modes are valid. For instance, if you pass SDL_HWSURFACE as a flag only modes that support hardware video surfaces will be returned.

Example

SDL_Rect **modes;
-int i;
-.
-.
-.
-
-/* Get available fullscreen/hardware modes */
-modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
-
-/* Check is there are any modes available */
-if(modes == (SDL_Rect **)0){
-  printf("No modes available!\n");
-  exit(-1);
-}
-
-/* Check if our resolution is restricted */
-if(modes == (SDL_Rect **)-1){
-  printf("All resolutions available.\n");
-}
-else{
-  /* Print valid modes */
-  printf("Available Modes\n");
-  for(i=0;modes[i];++i)
-    printf("  %d x %d\n", modes[i]->w, modes[i]->h);
-}
-.
-.

PrevHomeNext
SDL_VideoDriverNameUpSDL_VideoModeOK
\ No newline at end of file diff --git a/docs/html/sdlloadbmp.html b/docs/html/sdlloadbmp.html deleted file mode 100644 index 41556e34ae..0000000000 --- a/docs/html/sdlloadbmp.html +++ /dev/null @@ -1,219 +0,0 @@ -SDL_LoadBMP
SDL Library Documentation
PrevNext

SDL_LoadBMP

Name

SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.

Synopsis

#include "SDL.h"

SDL_Surface *SDL_LoadBMP(const char *file);

Description

Loads a surface from a named Windows BMP file.

Return Value

Returns the new surface, or NULL -if there was an error.

See Also

SDL_SaveBMP


PrevHomeNext
SDL_UnlockSurfaceUpSDL_SaveBMP
\ No newline at end of file diff --git a/docs/html/sdlloadwav.html b/docs/html/sdlloadwav.html deleted file mode 100644 index 8abb73ec36..0000000000 --- a/docs/html/sdlloadwav.html +++ /dev/null @@ -1,296 +0,0 @@ -SDL_LoadWAV
SDL Library Documentation
PrevNext

SDL_LoadWAV

Name

SDL_LoadWAV -- Load a WAVE file

Synopsis

#include "SDL.h"

SDL_AudioSpec *SDL_LoadWAV(const char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);

Description

SDL_LoadWAV -This function loads a WAVE file into memory.

If this function succeeds, it returns the given -SDL_AudioSpec, -filled with the audio data format of the wave data, and sets -audio_buf to a malloc'd -buffer containing the audio data, and sets audio_len -to the length of that audio buffer, in bytes. You need to free the audio -buffer with SDL_FreeWAV when you are -done with it.

This function returns NULL and sets the SDL -error message if the wave file cannot be opened, uses an unknown data format, -or is corrupt. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported.

Example

SDL_AudioSpec wav_spec;
-Uint32 wav_length;
-Uint8 *wav_buffer;
-
-/* Load the WAV */
-if( SDL_LoadWAV("test.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){
-  fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
-  exit(-1);
-}
-.
-.
-.
-/* Do stuff with the WAV */
-.
-.
-/* Free It */
-SDL_FreeWAV(wav_buffer);

PrevHomeNext
SDL_GetAudioStatusUpSDL_FreeWAV
\ No newline at end of file diff --git a/docs/html/sdllockaudio.html b/docs/html/sdllockaudio.html deleted file mode 100644 index 0e6fc292b4..0000000000 --- a/docs/html/sdllockaudio.html +++ /dev/null @@ -1,208 +0,0 @@ -SDL_LockAudio
SDL Library Documentation
PrevNext

SDL_LockAudio

Name

SDL_LockAudio -- Lock out the callback function

Synopsis

#include "SDL.h"

void SDL_LockAudio(void);

Description

The lock manipulated by these functions protects the callback function. -During a LockAudio period, you can be guaranteed that the -callback function is not running. Do not call these from the callback -function or you will cause deadlock.


PrevHomeNext
SDL_MixAudioUpSDL_UnlockAudio
\ No newline at end of file diff --git a/docs/html/sdllocksurface.html b/docs/html/sdllocksurface.html deleted file mode 100644 index 40c8959ea0..0000000000 --- a/docs/html/sdllocksurface.html +++ /dev/null @@ -1,306 +0,0 @@ -SDL_LockSurface
SDL Library Documentation
PrevNext

SDL_LockSurface

Name

SDL_LockSurface -- Lock a surface for directly access.

Synopsis

#include "SDL.h"

int SDL_LockSurface(SDL_Surface *surface);

Description

SDL_LockSurface sets up a surface for directly -accessing the pixels. Between calls to SDL_LockSurface -and SDL_UnlockSurface, you can write to and read from -surface->pixels, using the pixel format stored in -surface->format. Once you are done accessing the -surface, you should use SDL_UnlockSurface to release it.

Not all surfaces require locking. -If SDL_MUSTLOCK(surface) -evaluates to 0, then you can read and write to the -surface at any time, and the pixel format of the surface will not change.

No operating system or library calls should be made between lock/unlock -pairs, as critical system locks may be held during this time.

It should be noted, that since SDL 1.1.8 surface locks are recursive. This means that you can lock a surface multiple times, but each lock must have a match unlock. -

    .
-    .
-    SDL_LockSurface( surface );
-    .
-    /* Surface is locked */
-    /* Direct pixel access on surface here */
-    .
-    SDL_LockSurface( surface );
-    .
-    /* More direct pixel access on surface */
-    .
-    SDL_UnlockSurface( surface );
-    /* Surface is still locked */
-    /* Note: Is versions < 1.1.8, the surface would have been */
-    /* no longer locked at this stage                         */
-    .
-    SDL_UnlockSurface( surface );
-    /* Surface is now unlocked */
-    .
-    .

Return Value

SDL_LockSurface returns 0, -or -1 if the surface couldn't be locked.


PrevHomeNext
SDL_FreeSurfaceUpSDL_UnlockSurface
\ No newline at end of file diff --git a/docs/html/sdllockyuvoverlay.html b/docs/html/sdllockyuvoverlay.html deleted file mode 100644 index 74e6ce673d..0000000000 --- a/docs/html/sdllockyuvoverlay.html +++ /dev/null @@ -1,252 +0,0 @@ -SDL_LockYUVOverlay
SDL Library Documentation
PrevNext

SDL_LockYUVOverlay

Name

SDL_LockYUVOverlay -- Lock an overlay

Synopsis

#include "SDL.h"

int SDL_LockYUVOverlay(SDL_Overlay *overlay);

Description

Much the same as SDL_LockSurface, SDL_LockYUVOverlay locks the overlay for direct access to pixel data.

Return Value

Returns 0 on success, or -1 on an error.


PrevHomeNext
SDL_CreateYUVOverlayUpSDL_UnlockYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlmaprgb.html b/docs/html/sdlmaprgb.html deleted file mode 100644 index 5086d0c7dc..0000000000 --- a/docs/html/sdlmaprgb.html +++ /dev/null @@ -1,254 +0,0 @@ -SDL_MapRGB
SDL Library Documentation
PrevNext

SDL_MapRGB

Name

SDL_MapRGB -- Map a RGB color value to a pixel format.

Synopsis

#include "SDL.h"

Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b);

Description

Maps the RGB color value to the specified pixel format and returns the -pixel value as a 32-bit int.

If the format has a palette (8-bit) the index of the closest matching -color in the palette will be returned.

If the specified pixel format has an alpha component it will be returned -as all 1 bits (fully opaque).

Return Value

A pixel value best approximating the given RGB color value for a given -pixel format. If the pixel format bpp (color depth) is less than 32-bpp -then the unused upper bits of the return value can safely be ignored -(e.g., with a 16-bpp format the return value can be assigned to a -Uint16, and similarly a Uint8 for an 8-bpp -format).


PrevHomeNext
SDL_SetGammaRampUpSDL_MapRGBA
\ No newline at end of file diff --git a/docs/html/sdlmaprgba.html b/docs/html/sdlmaprgba.html deleted file mode 100644 index e6bff276f7..0000000000 --- a/docs/html/sdlmaprgba.html +++ /dev/null @@ -1,242 +0,0 @@ -SDL_MapRGBA
SDL Library Documentation
PrevNext

SDL_MapRGBA

Name

SDL_MapRGBA -- Map a RGBA color value to a pixel format.

Synopsis

#include "SDL.h"

Uint32 SDL_MapRGBA(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a);

Description

Maps the RGBA color value to the specified pixel format and returns the -pixel value as a 32-bit int.

If the format has a palette (8-bit) the index of the closest matching -color in the palette will be returned.

If the specified pixel format has no alpha component the alpha value -will be ignored (as it will be in formats with a palette).

Return Value

A pixel value best approximating the given RGBA color value for a given -pixel format. If the pixel format bpp (color depth) is less than 32-bpp -then the unused upper bits of the return value can safely be ignored -(e.g., with a 16-bpp format the return value can be assigned to a -Uint16, and similarly a Uint8 for an 8-bpp -format).


PrevHomeNext
SDL_MapRGBUpSDL_GetRGB
\ No newline at end of file diff --git a/docs/html/sdlmixaudio.html b/docs/html/sdlmixaudio.html deleted file mode 100644 index 6cbf0f0dbd..0000000000 --- a/docs/html/sdlmixaudio.html +++ /dev/null @@ -1,237 +0,0 @@ -SDL_MixAudio
SDL Library Documentation
PrevNext

SDL_MixAudio

Name

SDL_MixAudio -- Mix audio data

Synopsis

#include "SDL.h"

void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume);

Description

This function takes two audio buffers of len bytes each -of the playing audio format and mixes them, performing addition, volume -adjustment, and overflow clipping. The volume ranges -from 0 to SDL_MIX_MAXVOLUME and should be set to the maximum -value for full audio volume. Note this does not change hardware volume. This is -provided for convenience -- you can mix your own audio data.

Note: Do not use this function for mixing together more than two streams of sample -data. The output from repeated application of this function may be distorted -by clipping, because there is no accumulator with greater range than the -input (not to mention this being an inefficient way of doing it). -Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead.


PrevHomeNext
SDL_ConvertAudioUpSDL_LockAudio
\ No newline at end of file diff --git a/docs/html/sdlmousebuttonevent.html b/docs/html/sdlmousebuttonevent.html deleted file mode 100644 index b0b40df97a..0000000000 --- a/docs/html/sdlmousebuttonevent.html +++ /dev/null @@ -1,346 +0,0 @@ -SDL_MouseButtonEvent
SDL Library Documentation
PrevNext

SDL_MouseButtonEvent

Name

SDL_MouseButtonEvent -- Mouse button event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 button;
-  Uint8 state;
-  Uint16 x, y;
-} SDL_MouseButtonEvent;

Structure Data

typeSDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP
buttonThe mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)
stateSDL_PRESSED or SDL_RELEASED
x, yThe X/Y coordinates of the mouse at press/release time

Description

SDL_MouseButtonEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP is reported.

When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into button, the position of the mouse when this event occured is stored in the x and the y fields. Like SDL_KeyboardEvent, information on whether the event was a press or a release event is stored in both the type and state fields, but this should be obvious.


PrevHomeNext
SDL_MouseMotionEventUpSDL_JoyAxisEvent
\ No newline at end of file diff --git a/docs/html/sdlmousemotionevent.html b/docs/html/sdlmousemotionevent.html deleted file mode 100644 index 3cc7cb5c6a..0000000000 --- a/docs/html/sdlmousemotionevent.html +++ /dev/null @@ -1,365 +0,0 @@ -SDL_MouseMotionEvent
SDL Library Documentation
PrevNext

SDL_MouseMotionEvent

Name

SDL_MouseMotionEvent -- Mouse motion event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  Uint8 state;
-  Uint16 x, y;
-  Sint16 xrel, yrel;
-} SDL_MouseMotionEvent;

Structure Data

typeSDL_MOUSEMOTION
stateThe current button state
x, yThe X/Y coordinates of the mouse
xrel, yrelRelative motion in the X/Y direction

Description

SDL_MouseMotionEvent is a member of the SDL_Event union and is used when an event of type SDL_MOUSEMOTION is reported.

Simply put, a SDL_MOUSEMOTION type event occurs when a user moves the mouse within the application window or when SDL_WarpMouse is called. Both the absolute (x and y) and relative (xrel and yrel) coordinates are reported along with the current button states (state). The button state can be interpreted using the SDL_BUTTON macro (see SDL_GetMouseState).

If the cursor is hidden (SDL_ShowCursor(0)) and the input is grabbed (SDL_WM_GrabInput(SDL_GRAB_ON)), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.


PrevHomeNext
SDL_KeyboardEventUpSDL_MouseButtonEvent
\ No newline at end of file diff --git a/docs/html/sdlmutexp.html b/docs/html/sdlmutexp.html deleted file mode 100644 index fc32ca5996..0000000000 --- a/docs/html/sdlmutexp.html +++ /dev/null @@ -1,241 +0,0 @@ -SDL_mutexP
SDL Library Documentation
PrevNext

SDL_mutexP

Name

SDL_mutexP -- Lock a mutex

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_mutexP(SDL_mutex *mutex);

Description

Locks the mutex, which was previously created with SDL_CreateMutex. If the mutex is already locked then SDL_mutexP will not return until it is unlocked. Returns 0 on success, or -1 on an error.

SDL also defines a macro #define SDL_LockMutex(m) SDL_mutexP(m).


PrevHomeNext
SDL_DestroyMutexUpSDL_mutexV
\ No newline at end of file diff --git a/docs/html/sdlmutexv.html b/docs/html/sdlmutexv.html deleted file mode 100644 index 06a68bdc5e..0000000000 --- a/docs/html/sdlmutexv.html +++ /dev/null @@ -1,235 +0,0 @@ -SDL_mutexV
SDL Library Documentation
PrevNext

SDL_mutexV

Name

SDL_mutexV -- Unlock a mutex

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_mutexV(SDL_mutex *mutex);

Description

Unlocks the mutex, which was previously created with SDL_CreateMutex. Returns 0 on success, or -1 on an error.

SDL also defines a macro #define SDL_UnlockMutex(m) SDL_mutexV(m).


PrevHomeNext
SDL_mutexPUpSDL_CreateSemaphore
\ No newline at end of file diff --git a/docs/html/sdlnumjoysticks.html b/docs/html/sdlnumjoysticks.html deleted file mode 100644 index 68e3e3a72e..0000000000 --- a/docs/html/sdlnumjoysticks.html +++ /dev/null @@ -1,222 +0,0 @@ -SDL_NumJoysticks
SDL Library Documentation
PrevNext

SDL_NumJoysticks

Name

SDL_NumJoysticks -- Count available joysticks.

Synopsis

#include "SDL.h"

int SDL_NumJoysticks(void);

Description

Counts the number of joysticks attached to the system.

Return Value

Returns the number of attached joysticks


PrevHomeNext
JoystickUpSDL_JoystickName
\ No newline at end of file diff --git a/docs/html/sdlopenaudio.html b/docs/html/sdlopenaudio.html deleted file mode 100644 index bcfed54a7f..0000000000 --- a/docs/html/sdlopenaudio.html +++ /dev/null @@ -1,578 +0,0 @@ -SDL_OpenAudio
SDL Library Documentation
PrevNext

SDL_OpenAudio

Name

SDL_OpenAudio -- Opens the audio device with the desired parameters.

Synopsis

#include "SDL.h"

int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);

Description

This function opens the audio device with the desired parameters, and -returns 0 if successful, placing the actual hardware parameters in the -structure pointed to by obtained. If obtained is NULL, the audio -data passed to the callback function will be guaranteed to be in the -requested format, and will be automatically converted to the hardware -audio format if necessary. This function returns -1 if it failed -to open the audio device, or couldn't set up the audio thread.

To open the audio device a desired SDL_AudioSpec must be created. -

SDL_AudioSpec *desired;
-.
-.
-desired = malloc(sizeof(SDL_AudioSpec));
-You must then fill this structure with your desired audio specifications.

desired->freq

The desired audio frequency in samples-per-second.

desired->format

The desired audio format (see SDL_AudioSpec)

desired->samples

The desired size of the audio buffer in samples. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time. A stereo sample consists of both right and left channels in LR ordering. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq

desired->callback

This should be set to a function that will be called when the audio device is ready for more data. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling SDL_LockAudio and SDL_UnlockAudio in your code. The callback prototype is: -

void callback(void *userdata, Uint8 *stream, int len);
-userdata is the pointer stored in userdata field of the SDL_AudioSpec. stream is a pointer to the audio buffer you want to fill with information and len is the length of the audio buffer in bytes.

desired->userdata

This pointer is passed as the first parameter to the callback function.

SDL_OpenAudio reads these fields from the desired SDL_AudioSpec structure pass to the function and attempts to find an audio configuration matching your desired. As mentioned above, if the obtained parameter is NULL then SDL with convert from your desired audio settings to the hardware settings as it plays.

If obtained is NULL then the desired SDL_AudioSpec is your working specification, otherwise the obtained SDL_AudioSpec becomes the working specification and the desirec specification can be deleted. The data in the working specification is used when building SDL_AudioCVT's for converting loaded data to the hardware format.

SDL_OpenAudio calculates the size and silence fields for both the desired and obtained specifications. The size field stores the total size of the audio buffer in bytes, while the silence stores the value used to represent silence in the audio buffer

The audio device starts out playing silence when it's opened, and should be enabled for playing by calling SDL_PauseAudio(0) when you are ready for your audio callback function to be called. Since the audio driver may modify the requested size of the audio buffer, you should allocate any local mixing buffers after you open the audio device.

Examples

/* Prototype of our callback function */
-void my_audio_callback(void *userdata, Uint8 *stream, int len);
-
-/* Open the audio device */
-SDL_AudioSpec *desired, *obtained;
-SDL_AudioSpec *hardware_spec;
-
-/* Allocate a desired SDL_AudioSpec */
-desired = malloc(sizeof(SDL_AudioSpec));
-
-/* Allocate space for the obtained SDL_AudioSpec */
-obtained = malloc(sizeof(SDL_AudioSpec));
-
-/* 22050Hz - FM Radio quality */
-desired->freq=22050;
-
-/* 16-bit signed audio */
-desired->format=AUDIO_S16LSB;
-
-/* Mono */
-desired->channels=0;
-
-/* Large audio buffer reduces risk of dropouts but increases response time */
-desired->samples=8192;
-
-/* Our callback function */
-desired->callback=my_audio_callback;
-
-desired->userdata=NULL;
-
-/* Open the audio device */
-if ( SDL_OpenAudio(desired, obtained) < 0 ){
-  fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
-  exit(-1);
-}
-/* desired spec is no longer needed */
-free(desired);
-hardware_spec=obtained;
-.
-.
-/* Prepare callback for playing */
-.
-.
-.
-/* Start playing */
-SDL_PauseAudio(0);

PrevHomeNext
SDL_AudioSpecUpSDL_PauseAudio
\ No newline at end of file diff --git a/docs/html/sdloverlay.html b/docs/html/sdloverlay.html deleted file mode 100644 index 422919edc9..0000000000 --- a/docs/html/sdloverlay.html +++ /dev/null @@ -1,362 +0,0 @@ -SDL_Overlay
SDL Library Documentation
PrevNext

SDL_Overlay

Name

SDL_Overlay -- YUV video overlay

Structure Definition

typedef struct{
-  Uint32 format;
-  int w, h;
-  int planes;
-  Uint16 *pitches;
-  Uint8 **pixels;
-  Uint32 hw_overlay:1;
-} SDL_Overlay;

Structure Data

formatOverlay format (see below)
w, hWidth and height of overlay
planesNumber of planes in the overlay. Usually either 1 or 3
pitchesAn array of pitches, one for each plane. Pitch is the length of a row in bytes.
pixelsAn array of pointers to teh data of each plane. The overlay should be locked before these pointers are used.
hw_overlayThis will be set to 1 if the overlay is hardware accelerated.

Description

A SDL_Overlay is similar to a SDL_Surface except it stores a YUV overlay. All the fields are read only, except for pixels which should be locked before use. The format field stores the format of the overlay which is one of the following: -

#define SDL_YV12_OVERLAY  0x32315659  /* Planar mode: Y + V + U */
-#define SDL_IYUV_OVERLAY  0x56555949  /* Planar mode: Y + U + V */
-#define SDL_YUY2_OVERLAY  0x32595559  /* Packed mode: Y0+U0+Y1+V0 */
-#define SDL_UYVY_OVERLAY  0x59565955  /* Packed mode: U0+Y0+V0+Y1 */
-#define SDL_YVYU_OVERLAY  0x55595659  /* Packed mode: Y0+V0+Y1+U0 */
-More information on YUV formats can be found at http://www.webartz.com/fourcc/indexyuv.htm.


PrevHomeNext
SDL_VideoInfoUpWindow Management
\ No newline at end of file diff --git a/docs/html/sdlpalette.html b/docs/html/sdlpalette.html deleted file mode 100644 index 6498ac40ba..0000000000 --- a/docs/html/sdlpalette.html +++ /dev/null @@ -1,301 +0,0 @@ -SDL_Palette
SDL Library Documentation
PrevNext

SDL_Palette

Name

SDL_Palette -- Color palette for 8-bit pixel formats

Structure Definition

typedef struct{
-  int ncolors;
-  SDL_Color *colors;
-} SDL_Palette;

Structure Data

ncolorsNumber of colors used in this palette
colorsPointer to SDL_Color structures that make up the palette.

Description

Each pixel in an 8-bit surface is an index into the colors field of the SDL_Palette structure store in SDL_PixelFormat. A SDL_Palette should never need to be created manually. It is automatically created when SDL allocates a SDL_PixelFormat for a surface. The colors values of a SDL_Surfaces palette can be set with the SDL_SetColors.


PrevHomeNext
SDL_ColorUpSDL_PixelFormat
\ No newline at end of file diff --git a/docs/html/sdlpauseaudio.html b/docs/html/sdlpauseaudio.html deleted file mode 100644 index 39d5a0f0f9..0000000000 --- a/docs/html/sdlpauseaudio.html +++ /dev/null @@ -1,221 +0,0 @@ -SDL_PauseAudio
SDL Library Documentation
PrevNext

SDL_PauseAudio

Name

SDL_PauseAudio -- Pauses and unpauses the audio callback processing

Synopsis

#include "SDL.h"

void SDL_PauseAudio(int pause_on);

Description

This function pauses and unpauses the audio callback processing. -It should be called with pause_on=0 after opening the audio -device to start playing sound. This is so you can safely initialize -data for your callback function after opening the audio device. -Silence will be written to the audio device during the pause.


PrevHomeNext
SDL_OpenAudioUpSDL_GetAudioStatus
\ No newline at end of file diff --git a/docs/html/sdlpeepevents.html b/docs/html/sdlpeepevents.html deleted file mode 100644 index d5a0ff6f9f..0000000000 --- a/docs/html/sdlpeepevents.html +++ /dev/null @@ -1,321 +0,0 @@ -SDL_PeepEvents
SDL Library Documentation
PrevNext

SDL_PeepEvents

Name

SDL_PeepEvents -- Checks the event queue for messages and optionally returns them.

Synopsis

#include "SDL.h"

int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask);

Description

Checks the event queue for messages and optionally returns them.

If action is SDL_ADDEVENT, up to -numevents events will be added to the back of the event - queue.

If action is SDL_PEEKEVENT, up to -numevents events at the front of the event queue, -matching mask, -will be returned and will not be removed from the queue.

If action is SDL_GETEVENT, up to -numevents events at the front of the event queue, -matching mask, -will be returned and will be removed from the queue.

The mask parameter is an bitwise OR of -SDL_EVENTMASK(event_type), for all -event types you are interested in.

This function is thread-safe.

Return Value

This function returns the number of events actually stored, or --1 if there was an error.


PrevHomeNext
SDL_PumpEventsUpSDL_PollEvent
\ No newline at end of file diff --git a/docs/html/sdlpixelformat.html b/docs/html/sdlpixelformat.html deleted file mode 100644 index 000ddc08b1..0000000000 --- a/docs/html/sdlpixelformat.html +++ /dev/null @@ -1,528 +0,0 @@ -SDL_PixelFormat
SDL Library Documentation
PrevNext

SDL_PixelFormat

Name

SDL_PixelFormat -- Stores surface format information

Structure Definition

typedef struct SDL_PixelFormat {
-  SDL_Palette *palette;
-  Uint8  BitsPerPixel;
-  Uint8  BytesPerPixel;
-  Uint8  Rloss, Gloss, Bloss, Aloss;
-  Uint8  Rshift, Gshift, Bshift, Ashift;
-  Uint32 Rmask, Gmask, Bmask, Amask;
-  Uint32 colorkey;
-  Uint8  alpha;
-} SDL_PixelFormat;

Structure Data

palettePointer to the palette, or NULL if the BitsPerPixel>8
BitsPerPixelThe number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32.
BytesPerPixelThe number of bytes used to represent each pixel in a surface. Usually one to four.
[RGBA]maskBinary mask used to retrieve individual color values
[RGBA]lossPrecision loss of each color component (2[RGBA]loss)
[RGBA]shiftBinary left shift of each color component in the pixel value
colorkeyPixel value of transparent pixels
alphaOverall surface alpha value

Description

A SDL_PixelFormat describes the format of the pixel data stored at the pixels field of a SDL_Surface. Every surface stores a SDL_PixelFormat in the format field.

If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential.

8-bit pixel formats are the easiest to understand. Since its an 8-bit format, we have 8 BitsPerPixel and 1 BytesPerPixel. Since BytesPerPixel is 1, all pixels are represented by a Uint8 which contains an index into palette->colors. So, to determine the color of a pixel in a 8-bit surface: we read the color index from surface->pixels and we use that index to read the SDL_Color structure from surface->format->palette->colors. Like so: -

SDL_Surface *surface;
-SDL_PixelFormat *fmt;
-SDL_Color *color;
-Uint8 index;
-
-.
-.
-
-/* Create surface */
-.
-.
-fmt=surface->format;
-
-/* Check the bitdepth of the surface */
-if(fmt->BitsPerPixel!=8){
-  fprintf(stderr, "Not an 8-bit surface.\n");
-  return(-1);
-}
-
-/* Lock the surface */
-SDL_LockSurface(surface);
-
-/* Get the topleft pixel */
-index=*(Uint8 *)surface->pixels;
-color=fmt->palette->colors[index];
-
-/* Unlock the surface */
-SDL_UnlockSurface(surface);
-printf("Pixel Color-> Red: %d, Green: %d, Blue: %d. Index: %d\n",
-          color->r, color->g, color->b, index);
-.
-.

Pixel formats above 8-bit are an entirely different experience. They are -considered to be "TrueColor" formats and the color information is stored in the -pixels themselves, not in a palette. The mask, shift and loss fields tell us -how the color information is encoded. The mask fields allow us to isolate each -color component, the shift fields tell us the number of bits to the right of -each component in the pixel value and the loss fields tell us the number of -bits lost from each component when packing 8-bit color component in a pixel. -

/* Extracting color components from a 32-bit color value */
-SDL_PixelFormat *fmt;
-SDL_Surface *surface;
-Uint32 temp, pixel;
-Uint8 red, green, blue, alpha;
-.
-.
-.
-fmt=surface->format;
-SDL_LockSurface(surface);
-pixel=*((Uint32*)surface->pixels);
-SDL_UnlockSurface(surface);
-
-/* Get Red component */
-temp=pixel&fmt->Rmask; /* Isolate red component */
-temp=temp>>fmt->Rshift;/* Shift it down to 8-bit */
-temp=temp<<fmt->Rloss; /* Expand to a full 8-bit number */
-red=(Uint8)temp;
-
-/* Get Green component */
-temp=pixel&fmt->Gmask; /* Isolate green component */
-temp=temp>>fmt->Gshift;/* Shift it down to 8-bit */
-temp=temp<<fmt->Gloss; /* Expand to a full 8-bit number */
-green=(Uint8)temp;
-
-/* Get Blue component */
-temp=pixel&fmt->Bmask; /* Isolate blue component */
-temp=temp>>fmt->Bshift;/* Shift it down to 8-bit */
-temp=temp<<fmt->Bloss; /* Expand to a full 8-bit number */
-blue=(Uint8)temp;
-
-/* Get Alpha component */
-temp=pixel&fmt->Amask; /* Isolate alpha component */
-temp=temp>>fmt->Ashift;/* Shift it down to 8-bit */
-temp=temp<<fmt->Aloss; /* Expand to a full 8-bit number */
-alpha=(Uint8)temp;
-
-printf("Pixel Color -> R: %d,  G: %d,  B: %d,  A: %d\n", red, green, blue, alpha);
-.
-.
-.


PrevHomeNext
SDL_PaletteUpSDL_Surface
diff --git a/docs/html/sdlpollevent.html b/docs/html/sdlpollevent.html deleted file mode 100644 index f97c22d963..0000000000 --- a/docs/html/sdlpollevent.html +++ /dev/null @@ -1,269 +0,0 @@ -SDL_PollEvent
SDL Library Documentation
PrevNext

SDL_PollEvent

Name

SDL_PollEvent -- Polls for currently pending events.

Synopsis

#include "SDL.h"

int SDL_PollEvent(SDL_Event *event);

Description

Polls for currently pending events, and returns 1 -if there are any pending events, or 0 if there -are none available.

If event is not NULL, the next -event is removed from the queue and stored in that area.

Examples

SDL_Event event; /* Event structure */
-
-.
-.
-.
-/* Check for events */
-while(SDL_PollEvent(&event)){  /* Loop until there are no events left on the queue */
-  switch(event.type){  /* Process the appropiate event type */
-    case SDL_KEYDOWN:  /* Handle a KEYDOWN event */         
-      printf("Oh! Key press\n");
-      break;
-    case SDL_MOUSEMOTION:
-      .
-      .
-      .
-    default: /* Report an unhandled event */
-      printf("I don't know what this event is!\n");
-  }
-}


PrevHomeNext
SDL_PeepEventsUpSDL_WaitEvent
\ No newline at end of file diff --git a/docs/html/sdlpumpevents.html b/docs/html/sdlpumpevents.html deleted file mode 100644 index a7e528f19a..0000000000 --- a/docs/html/sdlpumpevents.html +++ /dev/null @@ -1,244 +0,0 @@ -SDL_PumpEvents
SDL Library Documentation
PrevNext

SDL_PumpEvents

Name

SDL_PumpEvents -- Pumps the event loop, gathering events from the input devices.

Synopsis

#include "SDL.h"

void SDL_PumpEvents(void);

Description

Pumps the event loop, gathering events from the input devices.

SDL_PumpEvents gathers all the pending input information from devices and places it on the event queue. Without calls to SDL_PumpEvents no events would ever be placed on the queue. Often calls the need for SDL_PumpEvents is hidden from the user since SDL_PollEvent and SDL_WaitEvent implicitly call SDL_PumpEvents. However, if you are not polling or waiting for events (e.g. you are filtering them), then you must call SDL_PumpEvents to force an event queue update.

Note: You can only call this function in the thread that set the video mode.


PrevHomeNext
Event Functions.UpSDL_PeepEvents
\ No newline at end of file diff --git a/docs/html/sdlpushevent.html b/docs/html/sdlpushevent.html deleted file mode 100644 index 6905385c32..0000000000 --- a/docs/html/sdlpushevent.html +++ /dev/null @@ -1,266 +0,0 @@ -SDL_PushEvent
SDL Library Documentation
PrevNext

SDL_PushEvent

Name

SDL_PushEvent -- Pushes an event onto the event queue

Synopsis

#include "SDL.h"

int SDL_PushEvent(SDL_Event *event);

Description

The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. event is a pointer to the event structure you wish to push onto the queue.

Note: Pushing device input events onto the queue doesn't modify the state of the device within SDL.

Return Value

Returns 0 on success or -1 if the event couldn't be pushed.

Examples

See SDL_Event.


PrevHomeNext
SDL_WaitEventUpSDL_SetEventFilter
\ No newline at end of file diff --git a/docs/html/sdlquit.html b/docs/html/sdlquit.html deleted file mode 100644 index 1f31c82558..0000000000 --- a/docs/html/sdlquit.html +++ /dev/null @@ -1,244 +0,0 @@ -SDL_Quit
SDL Library Documentation
PrevNext

SDL_Quit

Name

SDL_Quit -- Shut down SDL

Synopsis

#include "SDL.h"

void SDL_Quit(void);

Description

SDL_Quit shuts down all SDL subsystems and frees the resources allocated to them. This should always be called before you exit. For the sake of simplicity you can set SDL_Quit as your atexit call, like: -

SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
-atexit(SDL_Quit);
-.
-.

Note: While using atexit maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code. Plus, using atexit in a library is a sure way to crash dynamically loaded code


PrevHomeNext
SDL_QuitSubSystemUpSDL_WasInit
\ No newline at end of file diff --git a/docs/html/sdlquitevent.html b/docs/html/sdlquitevent.html deleted file mode 100644 index d575f38b7b..0000000000 --- a/docs/html/sdlquitevent.html +++ /dev/null @@ -1,263 +0,0 @@ -SDL_QuitEvent
SDL Library Documentation
PrevNext

SDL_QuitEvent

Name

SDL_QuitEvent -- Quit requested event

Structure Definition

typedef struct{
-  Uint8 type
-} SDL_QuitEvent;

Structure Data

typeSDL_QUIT

Description

SDL_QuitEvent is a member of the SDL_Event union and is used whan an event of type SDL_QUIT is reported.

As can be seen, the SDL_QuitEvent structure serves no useful purpose. The event itself, on the other hand, is very important. If you filter out or ignore a quit event then it is impossible for the user to close the window. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible.

Note: The macro SDL_QuitRequested will return non-zero if a quit event is pending


PrevHomeNext
SDL_UserEventUpSDL_keysym
\ No newline at end of file diff --git a/docs/html/sdlquitsubsystem.html b/docs/html/sdlquitsubsystem.html deleted file mode 100644 index 877e3ce118..0000000000 --- a/docs/html/sdlquitsubsystem.html +++ /dev/null @@ -1,248 +0,0 @@ -SDL_QuitSubSystem
SDL Library Documentation
PrevNext

SDL_QuitSubSystem

Name

SDL_QuitSubSystem -- Shut down a subsystem

Synopsis

#include "SDL.h"

void SDL_QuitSubSystem(Uint32 flags);

Description

SDL_QuitSubSystem allows you to shut down a subsystem that has been previously initialized by SDL_Init or SDL_InitSubSystem. The flags tells SDL_QuitSubSystem which subsystems to shut down, it uses the same values that are passed to SDL_Init.


PrevHomeNext
SDL_InitSubSystemUpSDL_Quit
\ No newline at end of file diff --git a/docs/html/sdlrect.html b/docs/html/sdlrect.html deleted file mode 100644 index ba4a80be69..0000000000 --- a/docs/html/sdlrect.html +++ /dev/null @@ -1,258 +0,0 @@ -SDL_Rect
SDL Library Documentation
PrevNext

SDL_Rect

Name

SDL_Rect -- Defines a rectangular area

Structure Definition

typedef struct{
-  Sint16 x, y;
-  Uint16 w, h;
-} SDL_Rect;

Structure Data

x, yPosition of the upper-left corner of the rectangle
w, hThe width and height of the rectangle

Description

A SDL_Rect defines a rectangular area of pixels. It is used by SDL_BlitSurface to define blitting regions and by several other video functions.


PrevHomeNext
SDL_GLattrUpSDL_Color
\ No newline at end of file diff --git a/docs/html/sdlremovetimer.html b/docs/html/sdlremovetimer.html deleted file mode 100644 index 26a3d11f7b..0000000000 --- a/docs/html/sdlremovetimer.html +++ /dev/null @@ -1,236 +0,0 @@ -SDL_RemoveTimer
SDL Library Documentation
PrevNext

SDL_RemoveTimer

Name

SDL_RemoveTimer -- Remove a timer which was added with -SDL_AddTimer.

Synopsis

#include "SDL.h"

SDL_bool SDL_RemoveTimer(SDL_TimerID id);

Description

Removes a timer callback previously added with -SDL_AddTimer.

Return Value

Returns a boolean value indicating success.

Examples

SDL_RemoveTimer(my_timer_id);

See Also

SDL_AddTimer


PrevHomeNext
SDL_AddTimerUpSDL_SetTimer
\ No newline at end of file diff --git a/docs/html/sdlresizeevent.html b/docs/html/sdlresizeevent.html deleted file mode 100644 index 1d446a54cd..0000000000 --- a/docs/html/sdlresizeevent.html +++ /dev/null @@ -1,307 +0,0 @@ -SDL_ResizeEvent
SDL Library Documentation
PrevNext

SDL_ResizeEvent

Name

SDL_ResizeEvent -- Window resize event structure

Structure Definition

typedef struct{
-  Uint8 type;
-  int w, h;
-} SDL_ResizeEvent;

Structure Data

typeSDL_VIDEORESIZE
w, hNew width and height of the window

Description

SDL_ResizeEvent is a member of the SDL_Event union and is used when an event of type SDL_VIDEORESIZE is reported.

When SDL_RESIZABLE is passed as a flag to SDL_SetVideoMode the user is allowed to resize the applications window. When the window is resized an SDL_VIDEORESIZE is report, with the new window width and height values stored in w and h, respectively. When an SDL_VIDEORESIZE is recieved the window should be resized to the new dimensions using SDL_SetVideoMode.


PrevHomeNext
SDL_JoyBallEventUpSDL_ExposeEvent
\ No newline at end of file diff --git a/docs/html/sdlsavebmp.html b/docs/html/sdlsavebmp.html deleted file mode 100644 index 4c318ed756..0000000000 --- a/docs/html/sdlsavebmp.html +++ /dev/null @@ -1,236 +0,0 @@ -SDL_SaveBMP
SDL Library Documentation
PrevNext

SDL_SaveBMP

Name

SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.

Synopsis

#include "SDL.h"

int SDL_SaveBMP(SDL_Surface *surface, const char *file);

Description

Saves the SDL_Surface surface as a Windows BMP file named file.

Return Value

Returns 0 if successful or --1 -if there was an error.

See Also

SDL_LoadBMP


PrevHomeNext
SDL_LoadBMPUpSDL_SetColorKey
\ No newline at end of file diff --git a/docs/html/sdlsempost.html b/docs/html/sdlsempost.html deleted file mode 100644 index 18fb01ab2f..0000000000 --- a/docs/html/sdlsempost.html +++ /dev/null @@ -1,299 +0,0 @@ -SDL_SemPost
SDL Library Documentation
PrevNext

SDL_SemPost

Name

SDL_SemPost -- Unlock a semaphore.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_SemPost(SDL_sem *sem);

Description

SDL_SemPost unlocks the semaphore pointed to by -sem and atomically increments the semaphores value. -Threads that were blocking on the semaphore may be scheduled after this call -succeeds.

SDL_SemPost should be called after a semaphore is locked by a successful call to -SDL_SemWait, -SDL_SemTryWait or -SDL_SemWaitTimeout.

Return Value

Returns 0 if successful or --1 if there was an error (leaving the semaphore unchanged).

Examples

SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemWaitTimeoutUpSDL_SemValue
\ No newline at end of file diff --git a/docs/html/sdlsemtrywait.html b/docs/html/sdlsemtrywait.html deleted file mode 100644 index 86f47a1c83..0000000000 --- a/docs/html/sdlsemtrywait.html +++ /dev/null @@ -1,319 +0,0 @@ -SDL_SemTryWait
SDL Library Documentation
PrevNext

SDL_SemTryWait

Name

SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_SemTryWait(SDL_sem *sem);

Description

SDL_SemTryWait is a non-blocking varient of -SDL_SemWait. If the value of the semaphore -pointed to by sem is positive it will atomically -decrement the semaphore value and return 0, otherwise it will return -SDL_MUTEX_TIMEDOUT instead of suspending the thread.

After SDL_SemTryWait is successful, the semaphore -can be released and its count atomically incremented by a successful call to -SDL_SemPost.

Return Value

Returns 0 if the semaphore was successfully locked or -either SDL_MUTEX_TIMEDOUT or -1 -if the thread would have suspended or there was an error, respectivly.

If the semaphore was not successfully locked, the semaphore will be unchanged.

Examples

res = SDL_SemTryWait(my_sem);
-
-if (res == SDL_MUTEX_TIMEDOUT) {
-        return TRY_AGAIN;
-}
-if (res == -1) {
-        return WAIT_ERROR;
-}
-
-...
-
-SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemWaitUpSDL_SemWaitTimeout
\ No newline at end of file diff --git a/docs/html/sdlsemvalue.html b/docs/html/sdlsemvalue.html deleted file mode 100644 index 7867369b1b..0000000000 --- a/docs/html/sdlsemvalue.html +++ /dev/null @@ -1,273 +0,0 @@ -SDL_SemValue
SDL Library Documentation
PrevNext

SDL_SemValue

Name

SDL_SemValue -- Return the current value of a semaphore.

Synopsis

#include "SDL.h"
-#include "SDL/SDL_thread.h"

Uint32 SDL_SemValue(SDL_sem *sem);

Description

SDL_SemValue() returns the current semaphore value from -the semaphore pointed to by sem.

Return Value

Returns current value of the semaphore.

Examples

  sem_value = SDL_SemValue(my_sem);


PrevHomeNext
SDL_SemPostUpSDL_CreateCond
\ No newline at end of file diff --git a/docs/html/sdlsemwait.html b/docs/html/sdlsemwait.html deleted file mode 100644 index 5e98d552ee..0000000000 --- a/docs/html/sdlsemwait.html +++ /dev/null @@ -1,298 +0,0 @@ -SDL_SemWait
SDL Library Documentation
PrevNext

SDL_SemWait

Name

SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_SemWait(SDL_sem *sem);

Description

SDL_SemWait() suspends the calling thread until either -the semaphore pointed to by sem has a positive value, -the call is interrupted by a signal or error. If the call is successful it -will atomically decrement the semaphore value.

After SDL_SemWait() is successful, the semaphore -can be released and its count atomically incremented by a successful call to -SDL_SemPost.

Return Value

Returns 0 if successful or --1 if there was an error (leaving the semaphore unchanged).

Examples

if (SDL_SemWait(my_sem) == -1) {
-        return WAIT_FAILED;
-}
-
-...
-
-SDL_SemPost(my_sem);


PrevHomeNext
SDL_DestroySemaphoreUpSDL_SemTryWait
\ No newline at end of file diff --git a/docs/html/sdlsemwaittimeout.html b/docs/html/sdlsemwaittimeout.html deleted file mode 100644 index 788f5b7250..0000000000 --- a/docs/html/sdlsemwaittimeout.html +++ /dev/null @@ -1,322 +0,0 @@ -SDL_SemWaitTimeout
SDL Library Documentation
PrevNext

SDL_SemWaitTimeout

Name

SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);

Description

SDL_SemWaitTimeout() is a varient of -SDL_SemWait -with a maximum timeout value. -If the value of the semaphore pointed to by sem is -positive (greater than zero) it will atomically decrement the semaphore value -and return 0, otherwise it will wait up to timeout -milliseconds trying to lock the semaphore. This function is to be avoided if -possible since on some platforms it is implemented by polling the semaphore -every millisecond in a busy loop.

After SDL_SemWaitTimeout() is successful, the semaphore -can be released and its count atomically incremented by a successful call to -SDL_SemPost.

Return Value

Returns 0 if the semaphore was successfully locked or -either SDL_MUTEX_TIMEDOUT or -1 -if the timeout period was exceeded or there was an error, respectivly.

If the semaphore was not successfully locked, the semaphore will be unchanged.

Examples

res = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC);
-
-if (res == SDL_MUTEX_TIMEDOUT) {
-        return TRY_AGAIN;
-}
-if (res == -1) {
-        return WAIT_ERROR;
-}
-
-...
-
-SDL_SemPost(my_sem);


PrevHomeNext
SDL_SemTryWaitUpSDL_SemPost
\ No newline at end of file diff --git a/docs/html/sdlsetalpha.html b/docs/html/sdlsetalpha.html deleted file mode 100644 index fc844981f1..0000000000 --- a/docs/html/sdlsetalpha.html +++ /dev/null @@ -1,500 +0,0 @@ -SDL_SetAlpha
SDL Library Documentation
PrevNext

SDL_SetAlpha

Name

SDL_SetAlpha -- Adjust the alpha properties of a surface

Synopsis

#include "SDL.h"

int SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);

Description

Note: This function and the semantics of SDL alpha blending have changed since version 1.1.4. Up until version 1.1.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent. This has now been inverted: 0 (SDL_ALPHA_TRANSPARENT) is now considered transparent and 255 (SDL_ALPHA_OPAQUE) is now considered opaque.

SDL_SetAlpha is used for setting the per-surface alpha -value and/or enabling and disabling alpha blending.

Thesurface parameter specifies which surface whose alpha -attributes you wish to adjust. flags is used to specify -whether alpha blending should be used (SDL_SRCALPHA) and -whether the surface should use RLE acceleration for blitting -(SDL_RLEACCEL). flags can be an OR'd -combination of these two options, one of these options or 0. If -SDL_SRCALPHA is not passed as a flag then all alpha -information is ignored when blitting the surface. The -alpha parameter is the per-surface alpha value; a -surface need not have an alpha channel to use per-surface alpha and blitting -can still be accelerated with SDL_RLEACCEL.

Note: The per-surface alpha value of 128 is considered a special case and -is optimised, so it's much faster than other per-surface values.

Alpha effects surface blitting in the following ways:

RGBA->RGB with SDL_SRCALPHA

The source is alpha-blended with the destination, using the alpha channel. SDL_SRCCOLORKEY and the per-surface alpha are ignored.

RGBA->RGB without SDL_SRCALPHA

The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored.

RGB->RGBA with SDL_SRCALPHA

The source is alpha-blended with the destination using the per-surface alpha -value. If SDL_SRCCOLORKEY is set, only the pixels not -matching the colorkey value are copied. The alpha channel of the copied pixels -is set to opaque.

RGB->RGBA without SDL_SRCALPHA

The RGB data is copied from the source and the alpha value of the copied pixels -is set to opaque. If SDL_SRCCOLORKEY is set, only the pixels -not matching the colorkey value are copied.

RGBA->RGBA with SDL_SRCALPHA

The source is alpha-blended with the destination using the source alpha -channel. The alpha channel in the destination surface is left untouched. -SDL_SRCCOLORKEY is ignored.

RGBA->RGBA without SDL_SRCALPHA

The RGBA data is copied to the destination surface. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

RGB->RGB with SDL_SRCALPHA

The source is alpha-blended with the destination using the per-surface alpha value. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

RGB->RGB without SDL_SRCALPHA

The RGB data is copied from the source. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.

Note: Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha -of the destination surface. This means that you cannot compose two arbitrary -RGBA surfaces this way and get the result you would expect from "overlaying" -them; the destination alpha will work as a mask.

Also note that per-pixel and per-surface alpha cannot be combined; -the per-pixel alpha is always used if available

Return Value

This function returns 0, or --1 if there was an error.


PrevHomeNext
SDL_SetColorKeyUpSDL_SetClipRect
\ No newline at end of file diff --git a/docs/html/sdlsetcliprect.html b/docs/html/sdlsetcliprect.html deleted file mode 100644 index 03898d55ac..0000000000 --- a/docs/html/sdlsetcliprect.html +++ /dev/null @@ -1,241 +0,0 @@ -SDL_SetClipRect
SDL Library Documentation
PrevNext

SDL_SetClipRect

Name

SDL_SetClipRect -- Sets the clipping rectangle for a surface.

Synopsis

#include "SDL.h"

void SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect);

Description

Sets the clipping rectangle for a surface. When this surface is the -destination of a blit, only the area within the clip rectangle will be -drawn into.

The rectangle pointed to by rect will be -clipped to the edges of the surface so that the clip rectangle for a -surface can never fall outside the edges of the surface.

If rect is NULL the clipping -rectangle will be set to the full size of the surface.


PrevHomeNext
SDL_SetAlphaUpSDL_GetClipRect
\ No newline at end of file diff --git a/docs/html/sdlsetcolorkey.html b/docs/html/sdlsetcolorkey.html deleted file mode 100644 index 0cb6695791..0000000000 --- a/docs/html/sdlsetcolorkey.html +++ /dev/null @@ -1,321 +0,0 @@ -SDL_SetColorKey
SDL Library Documentation
PrevNext

SDL_SetColorKey

Name

SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and -RLE acceleration.

Synopsis

#include "SDL.h"

int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key);

Description

Sets the color key (transparent pixel) in a blittable surface and enables or - disables RLE blit acceleration.

RLE acceleration can substantially speed up blitting of images with large -horizontal runs of transparent pixels (i.e., pixels that match the -key value). The key must be of the same pixel format as the surface, SDL_MapRGB is often useful for obtaining an acceptable value.

If flag is SDL_SRCCOLORKEY then -key is the transparent pixel value in the source image of a -blit.

If flag is OR'd with -SDL_RLEACCEL then the surface will be draw using RLE -acceleration when drawn with -SDL_BlitSurface. The surface will -actually be encoded for RLE acceleration the first time -SDL_BlitSurface or -SDL_DisplayFormat is called on the -surface.

If flag is 0, this function clears -any current color key.

Return Value

This function returns 0, or --1 if there was an error.


PrevHomeNext
SDL_SaveBMPUpSDL_SetAlpha
\ No newline at end of file diff --git a/docs/html/sdlsetcolors.html b/docs/html/sdlsetcolors.html deleted file mode 100644 index 569564598b..0000000000 --- a/docs/html/sdlsetcolors.html +++ /dev/null @@ -1,358 +0,0 @@ -SDL_SetColors
SDL Library Documentation
PrevNext

SDL_SetColors

Name

SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.

Synopsis

#include "SDL.h"

int SDL_SetColors(SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);

Description

Sets a portion of the colormap for the given 8-bit surface.

When surface is the surface associated with the current -display, the display colormap will be updated with the requested colors. If -SDL_HWPALETTE was set in SDL_SetVideoMode flags, -SDL_SetColors will always return 1, -and the palette is guaranteed to be set the way you desire, even if the window -colormap has to be warped or run under emulation.

The color components of a -SDL_Color -structure are 8-bits in size, giving you a total of 2563 -=16777216 colors.

Palettized (8-bit) screen surfaces with the SDL_HWPALETTE -flag have two palettes, a logical palette that is used for mapping blits -to/from the surface and a physical palette (that determines how the -hardware will map the colors to the display). SDL_SetColors -modifies both palettes (if present), and is equivalent to calling -SDL_SetPalette with the -flags set to -(SDL_LOGPAL | SDL_PHYSPAL).

Return Value

If surface is not a palettized surface, this function -does nothing, returning 0. If all of the colors were set -as passed to SDL_SetColors, it will return -1. If not all the color entries were set exactly as -given, it will return 0, and you should look at the -surface palette to determine the actual color palette.

Example

/* Create a display surface with a grayscale palette */
-SDL_Surface *screen;
-SDL_Color colors[256];
-int i;
-.
-.
-.
-/* Fill colors with color information */
-for(i=0;i<256;i++){
-  colors[i].r=i;
-  colors[i].g=i;
-  colors[i].b=i;
-}
-
-/* Create display */
-screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
-if(!screen){
-  printf("Couldn't set video mode: %s\n", SDL_GetError());
-  exit(-1);
-}
-
-/* Set palette */
-SDL_SetColors(screen, colors, 0, 256);
-.
-.
-.
-.

PrevHomeNext
SDL_FlipUpSDL_SetPalette
\ No newline at end of file diff --git a/docs/html/sdlsetcursor.html b/docs/html/sdlsetcursor.html deleted file mode 100644 index 9c5443e53e..0000000000 --- a/docs/html/sdlsetcursor.html +++ /dev/null @@ -1,222 +0,0 @@ -SDL_SetCursor
SDL Library Documentation
PrevNext

SDL_SetCursor

Name

SDL_SetCursor -- Set the currently active mouse cursor.

Synopsis

#include "SDL.h"

void SDL_SetCursor(SDL_Cursor *cursor);

Description

Sets the currently active cursor to -the specified one. -If the cursor is currently visible, the change will be immediately -represented on the display.


PrevHomeNext
SDL_FreeCursorUpSDL_GetCursor
diff --git a/docs/html/sdlseteventfilter.html b/docs/html/sdlseteventfilter.html deleted file mode 100644 index 0808bab3c6..0000000000 --- a/docs/html/sdlseteventfilter.html +++ /dev/null @@ -1,284 +0,0 @@ -SDL_SetEventFilter
SDL Library Documentation
PrevNext

SDL_SetEventFilter

Name

SDL_SetEventFilter -- Sets up a filter to process all events before they are posted -to the event queue.

Synopsis

#include "SDL.h"

void SDL_SetEventFilter(SDL_EventFilter filter);

Description

This function sets up a filter to process all events before they are posted -to the event queue. This is a very powerful and flexible feature. The filter -is prototyped as: -

typedef int (*SDL_EventFilter)(const SDL_Event *event);
-If the filter returns 1, then the event will be -added to the internal queue. If it returns 0, -then the event will be dropped from the queue. This allows selective -filtering of dynamically.

There is one caveat when dealing with the SDL_QUITEVENT event type. The -event filter is only called when the window manager desires to close the -application window. If the event filter returns 1, then the window will -be closed, otherwise the window will remain open if possible. -If the quit event is generated by an interrupt signal, it will bypass the -internal queue and be delivered to the application at the next event poll.

Note: Events pushed onto the queue with SDL_PushEvent or SDL_PeepEvents do not get passed through the event filter.

Note: Be Careful! The event filter function may run in a different thread so be careful what you do within it.


PrevHomeNext
SDL_PushEventUpSDL_GetEventFilter
\ No newline at end of file diff --git a/docs/html/sdlsetgamma.html b/docs/html/sdlsetgamma.html deleted file mode 100644 index 6443a966a2..0000000000 --- a/docs/html/sdlsetgamma.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_SetGamma
SDL Library Documentation
PrevNext

SDL_SetGamma

Name

SDL_SetGamma -- Sets the color gamma function for the display

Synopsis

#include "SDL.h"

int SDL_SetGamma(float redgamma, float greengamma, float bluegamma);

Description

Sets the "gamma function" for the display of each color component. Gamma -controls the brightness/contrast of colors displayed on the screen. -A gamma value of 1.0 is identity (i.e., no adjustment -is made).

This function adjusts the gamma based on the "gamma function" parameter, -you can directly specify lookup tables for gamma adjustment with -SDL_SetGammaRamp.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error (or if gamma adjustment is not supported).


PrevHomeNext
SDL_SetPaletteUpSDL_GetGammaRamp
\ No newline at end of file diff --git a/docs/html/sdlsetgammaramp.html b/docs/html/sdlsetgammaramp.html deleted file mode 100644 index 79599c8d51..0000000000 --- a/docs/html/sdlsetgammaramp.html +++ /dev/null @@ -1,230 +0,0 @@ -SDL_SetGammaRamp
SDL Library Documentation
PrevNext

SDL_SetGammaRamp

Name

SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display

Synopsis

#include "SDL.h"

int SDL_SetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);

Description

Sets the gamma lookup tables for the display for each color component. -Each table is an array of 256 Uint16 values, representing a mapping -between the input and output for that channel. The input is the index -into the array, and the output is the 16-bit gamma value at that index, -scaled to the output color precision. You may pass NULL to any of the -channels to leave them unchanged.

This function adjusts the gamma based on lookup tables, you can also -have the gamma calculated based on a "gamma function" parameter with -SDL_SetGamma.

Not all display hardware is able to change gamma.

Return Value

Returns -1 on error (or if gamma adjustment is not supported).


PrevHomeNext
SDL_GetGammaRampUpSDL_MapRGB
\ No newline at end of file diff --git a/docs/html/sdlsetmodstate.html b/docs/html/sdlsetmodstate.html deleted file mode 100644 index ee69a3f5df..0000000000 --- a/docs/html/sdlsetmodstate.html +++ /dev/null @@ -1,237 +0,0 @@ -SDL_SetModState
SDL Library Documentation
PrevNext

SDL_SetModState

Name

SDL_SetModState -- Set the current key modifier state

Synopsis

#include "SDL.h"

void SDL_SetModState(SDLMod modstate);

Description

The inverse of SDL_GetModState, SDL_SetModState allows you to impose modifier key states on your application.

Simply pass your desired modifier states into modstate. This value my be a logical OR'd combination of the following:

typedef enum {
-  KMOD_NONE  = 0x0000,
-  KMOD_LSHIFT= 0x0001,
-  KMOD_RSHIFT= 0x0002,
-  KMOD_LCTRL = 0x0040,
-  KMOD_RCTRL = 0x0080,
-  KMOD_LALT  = 0x0100,
-  KMOD_RALT  = 0x0200,
-  KMOD_LMETA = 0x0400,
-  KMOD_RMETA = 0x0800,
-  KMOD_NUM   = 0x1000,
-  KMOD_CAPS  = 0x2000,
-  KMOD_MODE  = 0x4000,
-} SDLMod;

PrevHomeNext
SDL_GetModStateUpSDL_GetKeyName
\ No newline at end of file diff --git a/docs/html/sdlsetpalette.html b/docs/html/sdlsetpalette.html deleted file mode 100644 index 1622f1590f..0000000000 --- a/docs/html/sdlsetpalette.html +++ /dev/null @@ -1,352 +0,0 @@ -SDL_SetPalette
SDL Library Documentation
PrevNext

SDL_SetPalette

Name

SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.

Synopsis

#include "SDL.h"

int SDL_SetPalette(SDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors);

Description

Sets a portion of the palette for the given 8-bit surface.

Palettized (8-bit) screen surfaces with the -SDL_HWPALETTE flag have two palettes, a logical -palette that is used for mapping blits to/from the surface and a -physical palette (that determines how the hardware will map the colors -to the display). SDL_BlitSurface -always uses the logical palette when blitting surfaces (if it has to -convert between surface pixel formats). Because of this, it is often -useful to modify only one or the other palette to achieve various -special color effects (e.g., screen fading, color flashes, screen dimming).

This function can modify either the logical or physical palette by -specifing SDL_LOGPAL or -SDL_PHYSPALthe in the flags -parameter.

When surface is the surface associated with the current -display, the display colormap will be updated with the requested colors. If -SDL_HWPALETTE was set in SDL_SetVideoMode flags, -SDL_SetPalette will always return 1, -and the palette is guaranteed to be set the way you desire, even if the window -colormap has to be warped or run under emulation.

The color components of a -SDL_Color structure -are 8-bits in size, giving you a total of -2563=16777216 colors.

Return Value

If surface is not a palettized surface, this function -does nothing, returning 0. If all of the colors were set -as passed to SDL_SetPalette, it will return -1. If not all the color entries were set exactly as -given, it will return 0, and you should look at the -surface palette to determine the actual color palette.

Example

        /* Create a display surface with a grayscale palette */
-        SDL_Surface *screen;
-        SDL_Color colors[256];
-        int i;
-        .
-        .
-        .
-        /* Fill colors with color information */
-        for(i=0;i<256;i++){
-          colors[i].r=i;
-          colors[i].g=i;
-          colors[i].b=i;
-        }
-
-        /* Create display */
-        screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
-        if(!screen){
-          printf("Couldn't set video mode: %s\n", SDL_GetError());
-          exit(-1);
-        }
-
-        /* Set palette */
-        SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256);
-        .
-        .
-        .
-        .

PrevHomeNext
SDL_SetColorsUpSDL_SetGamma
\ No newline at end of file diff --git a/docs/html/sdlsettimer.html b/docs/html/sdlsettimer.html deleted file mode 100644 index 40b737ce85..0000000000 --- a/docs/html/sdlsettimer.html +++ /dev/null @@ -1,267 +0,0 @@ -SDL_SetTimer
SDL Library Documentation
Prev 

SDL_SetTimer

Name

SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has -elapsed.

Synopsis

#include "SDL.h"

int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);

Callback

/* Function prototype for the timer callback function */ -typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);

Description

Set a callback to run after the specified number of milliseconds has -elapsed. The callback function is passed the current timer interval -and returns the next timer interval. If the returned value is the -same as the one passed in, the periodic alarm continues, otherwise a -new alarm is scheduled.

To cancel a currently running timer, call -SDL_SetTimer(0, NULL);

The timer callback function may run in a different thread than your -main constant, and so shouldn't call any functions from within itself.

The maximum resolution of this timer is 10 ms, which means that if -you request a 16 ms timer, your callback will run approximately 20 ms -later on an unloaded system. If you wanted to set a flag signaling -a frame update at 30 frames per second (every 33 ms), you might set a -timer for 30 ms (see example below).

If you use this function, you need to pass SDL_INIT_TIMER -to SDL_Init().

Note: This function is kept for compatibility but has been superseded -by the new timer functions -SDL_AddTimer and -SDL_RemoveTimer which support -multiple timers.

Examples

SDL_SetTimer((33/10)*10, my_callback);

See Also

SDL_AddTimer


PrevHome 
SDL_RemoveTimerUp 
\ No newline at end of file diff --git a/docs/html/sdlsetvideomode.html b/docs/html/sdlsetvideomode.html deleted file mode 100644 index 8b309b048f..0000000000 --- a/docs/html/sdlsetvideomode.html +++ /dev/null @@ -1,558 +0,0 @@ -SDL_SetVideoMode
SDL Library Documentation
PrevNext

SDL_SetVideoMode

Name

SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.

Synopsis

#include "SDL.h"

SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);

Description

Set up a video mode with the specified width, height and bits-per-pixel.

If bpp is 0, it is treated as the -current display bits per pixel.

The flags parameter is the same as the flags field of the SDL_Surface structure. OR'd combinations of the following values are valid.

SDL_SWSURFACECreate the video surface in system memory
SDL_HWSURFACECreate the video surface in video memory
SDL_ASYNCBLITEnables the use of asynchronous updates of the display surface. This will -usually slow down blitting on single CPU machines, but may provide a speed -increase on SMP systems.
SDL_ANYFORMATNormally, if a video surface of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface. Passing SDL_ANYFORMAT prevents this and causes SDL to use the video surface, regardless of its pixel depth.
SDL_HWPALETTEGive SDL exclusive palette access. Without this flag you may not always get the the colors you request with SDL_SetColors or SDL_SetPalette.
SDL_DOUBLEBUFEnable hardware double buffering; only valid with SDL_HWSURFACE. Calling -SDL_Flip will flip the -buffers and update the screen. All drawing will take place on the surface -that is not displayed at the moment. If double buffering could not be enabled -then SDL_Flip will just perform a -SDL_UpdateRect -on the entire screen.
SDL_FULLSCREENSDL will attempt to use a fullscreen mode. If a hardware resolution change is -not possible (for whatever reason), the next higher resolution will be used and -the display window centered on a black background.
SDL_OPENGLCreate an OpenGL rendering context. You should have previously set OpenGL video attributes with SDL_GL_SetAttribute.
SDL_OPENGLBLITCreate an OpenGL rendering context, like above, but allow normal blitting -operations. The screen (2D) surface may have an alpha channel, and -SDL_UpdateRects -must be used for updating changes to the screen surface. NOTE: This option -is kept for compatibility only, and is not recommended for -new code.
SDL_RESIZABLECreate a resizable window. When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL_SetVideoMode can be called again with the new size.
SDL_NOFRAMEIf possible, SDL_NOFRAME causes SDL to create a window with no title bar or frame decoration. Fullscreen modes automatically have this flag set.

Note: Whatever flags SDL_SetVideoMode could satisfy are set in the flags member of the returned surface.

Note: The bpp parameter is the number of bits per pixel, -so a bpp of 24 uses the packed representation of -3 bytes/pixel. For the more common 4 bytes/pixel mode, use a -bpp of 32. Somewhat oddly, both 15 and 16 will -request a 2 bytes/pixel mode, but different pixel formats.

Return Value

The framebuffer surface, or NULL if it fails. -The surface returned is freed by SDL_Quit() and should nt be freed by -the caller.


PrevHomeNext
SDL_VideoModeOKUpSDL_UpdateRect
\ No newline at end of file diff --git a/docs/html/sdlshowcursor.html b/docs/html/sdlshowcursor.html deleted file mode 100644 index 5a8f19da22..0000000000 --- a/docs/html/sdlshowcursor.html +++ /dev/null @@ -1,239 +0,0 @@ -SDL_ShowCursor
SDL Library Documentation
PrevNext

SDL_ShowCursor

Name

SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.

Synopsis

#include "SDL.h"

int SDL_ShowCursor(int toggle);

Description

Toggle whether or not the cursor is shown on the screen. Passing SDL_ENABLE displays the cursor and passing SDL_DISABLE hides it. The current state of the mouse cursor can be queried by passing SDL_QUERY, either SDL_DISABLE or SDL_ENABLE will be returned.

The cursor starts off displayed, but can be turned off.

Return Value

Returns the current state of the cursor.


PrevHomeNext
SDL_GetCursorUpSDL_GL_LoadLibrary
\ No newline at end of file diff --git a/docs/html/sdlsurface.html b/docs/html/sdlsurface.html deleted file mode 100644 index fda55f173f..0000000000 --- a/docs/html/sdlsurface.html +++ /dev/null @@ -1,597 +0,0 @@ -SDL_Surface
SDL Library Documentation
PrevNext

SDL_Surface

Name

SDL_Surface -- Graphical Surface Structure

Structure Definition

typedef struct SDL_Surface {
-        Uint32 flags;                           /* Read-only */
-        SDL_PixelFormat *format;                /* Read-only */
-        int w, h;                               /* Read-only */
-        Uint16 pitch;                           /* Read-only */
-        void *pixels;                           /* Read-write */
-
-        /* clipping information */
-        SDL_Rect clip_rect;                     /* Read-only */
-
-        /* Reference count -- used when freeing surface */
-        int refcount;                           /* Read-mostly */
-
-	/* This structure also contains private fields not shown here */
-} SDL_Surface;

Structure Data

flagsSurface flags
formatPixel format
w, hWidth and height of the surface
pitchLength of a surface scanline in bytes
pixelsPointer to the actual pixel data
clip_rectsurface clip rectangle

Description

SDL_Surface's represent areas of "graphical" -memory, memory that can be drawn to. The video framebuffer is returned -as a SDL_Surface by -SDL_SetVideoMode -and SDL_GetVideoSurface. -Most of the fields should be pretty obvious. -w and h are the -width and height of the surface in pixels. -pixels is a pointer to the actual pixel data, -the surface should be locked -before accessing this field. The clip_rect field -is the clipping rectangle as set by -SDL_SetClipRect.

The following are supported in the -flags field.

SDL_SWSURFACESurface is stored in system memory
SDL_HWSURFACESurface is stored in video memory
SDL_ASYNCBLITSurface uses asynchronous blits if possible
SDL_ANYFORMATAllows any pixel-format (Display surface)
SDL_HWPALETTESurface has exclusive palette
SDL_DOUBLEBUFSurface is double buffered (Display surface)
SDL_FULLSCREENSurface is full screen (Display Surface)
SDL_OPENGLSurface has an OpenGL context (Display Surface)
SDL_OPENGLBLITSurface supports OpenGL blitting (Display Surface)
SDL_RESIZABLESurface is resizable (Display Surface)
SDL_HWACCELSurface blit uses hardware acceleration
SDL_SRCCOLORKEYSurface use colorkey blitting
SDL_RLEACCELColorkey blitting is accelerated with RLE
SDL_SRCALPHASurface blit uses alpha blending
SDL_PREALLOCSurface uses preallocated memory


PrevHomeNext
SDL_PixelFormatUpSDL_VideoInfo
\ No newline at end of file diff --git a/docs/html/sdlsyswmevent.html b/docs/html/sdlsyswmevent.html deleted file mode 100644 index fd7180ee21..0000000000 --- a/docs/html/sdlsyswmevent.html +++ /dev/null @@ -1,233 +0,0 @@ -SDL_SysWMEvent
SDL Library Documentation
PrevNext

SDL_SysWMEvent

Name

SDL_SysWMEvent -- Platform-dependent window manager event.

Description

The system window manager event contains a pointer to system-specific -information about unknown window manager events. If you enable this event -using -SDL_EventState(), -it will be generated whenever unhandled events are received from the window -manager. This can be used, for example, to implement cut-and-paste in your -application. - -

typedef struct {
-         Uint8 type;   /* Always SDL_SYSWMEVENT */
-         SDL_SysWMmsg *msg;
- } SDL_SysWMEvent;
- -If you want to obtain system-specific information about the window manager, -you can fill the version member of a SDL_SysWMinfo -structure (details can be found in SDL_syswm.h, which must be included) using the SDL_VERSION() macro found in -SDL_version.h, and pass it to the -function: -

int SDL_GetWMInfo(SDL_SysWMinfo *info);


PrevHomeNext
SDL_ExposeEventUpSDL_UserEvent
\ No newline at end of file diff --git a/docs/html/sdlthreadid.html b/docs/html/sdlthreadid.html deleted file mode 100644 index e0bde2e2a3..0000000000 --- a/docs/html/sdlthreadid.html +++ /dev/null @@ -1,190 +0,0 @@ -SDL_ThreadID
SDL Library Documentation
PrevNext

SDL_ThreadID

Name

SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

Uint32 SDL_ThreadID(void);

Description

Get the 32-bit thread identifier for the current thread.


PrevHomeNext
SDL_CreateThreadUpSDL_GetThreadID
\ No newline at end of file diff --git a/docs/html/sdlunlockaudio.html b/docs/html/sdlunlockaudio.html deleted file mode 100644 index 0019bd692a..0000000000 --- a/docs/html/sdlunlockaudio.html +++ /dev/null @@ -1,211 +0,0 @@ -SDL_UnlockAudio
SDL Library Documentation
PrevNext

SDL_UnlockAudio

Name

SDL_UnlockAudio -- Unlock the callback function

Synopsis

#include "SDL.h"

void SDL_UnlockAudio(void);

Description

Unlocks a previous SDL_LockAudio call.


PrevHomeNext
SDL_LockAudioUpSDL_CloseAudio
\ No newline at end of file diff --git a/docs/html/sdlunlocksurface.html b/docs/html/sdlunlocksurface.html deleted file mode 100644 index 13ba5fc8e2..0000000000 --- a/docs/html/sdlunlocksurface.html +++ /dev/null @@ -1,219 +0,0 @@ -SDL_UnlockSurface
SDL Library Documentation
PrevNext

SDL_UnlockSurface

Name

SDL_UnlockSurface -- Unlocks a previously locked surface.

Synopsis

#include "SDL.h"

void SDL_UnlockSurface(SDL_Surface *surface);

Description

Surfaces that were previously locked using SDL_LockSurface must be unlocked with SDL_UnlockSurface. Surfaces should be unlocked as soon as possible.

It should be noted that since 1.1.8, surface locks are recursive. See SDL_LockSurface.


PrevHomeNext
SDL_LockSurfaceUpSDL_LoadBMP
\ No newline at end of file diff --git a/docs/html/sdlunlockyuvoverlay.html b/docs/html/sdlunlockyuvoverlay.html deleted file mode 100644 index 936ed9eaf7..0000000000 --- a/docs/html/sdlunlockyuvoverlay.html +++ /dev/null @@ -1,225 +0,0 @@ -SDL_UnlockYUVOverlay
SDL Library Documentation
PrevNext

SDL_UnlockYUVOverlay

Name

SDL_UnlockYUVOverlay -- Unlock an overlay

Synopsis

#include "SDL.h"

void SDL_UnlockYUVOverlay(SDL_Overlay *overlay);

Description

The opposite to SDL_LockYUVOverlay. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed.


PrevHomeNext
SDL_LockYUVOverlayUpSDL_DisplayYUVOverlay
\ No newline at end of file diff --git a/docs/html/sdlupdaterect.html b/docs/html/sdlupdaterect.html deleted file mode 100644 index f54d9f5e24..0000000000 --- a/docs/html/sdlupdaterect.html +++ /dev/null @@ -1,266 +0,0 @@ -SDL_UpdateRect
SDL Library Documentation
PrevNext

SDL_UpdateRect

Name

SDL_UpdateRect -- Makes sure the given area is updated on the given screen.

Synopsis

#include "SDL.h"

void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);

Description

Makes sure the given area is updated on the given screen. The rectangle must -be confined within the screen boundaries (no clipping is done).

If 'x', 'y', 'w' -and 'h' are all 0, -SDL_UpdateRect will update the -entire screen.

This function should not be called while 'screen' is -locked.


PrevHomeNext
SDL_SetVideoModeUpSDL_UpdateRects
\ No newline at end of file diff --git a/docs/html/sdlupdaterects.html b/docs/html/sdlupdaterects.html deleted file mode 100644 index 0553a7a9d0..0000000000 --- a/docs/html/sdlupdaterects.html +++ /dev/null @@ -1,255 +0,0 @@ -SDL_UpdateRects
SDL Library Documentation
PrevNext

SDL_UpdateRects

Name

SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.

Synopsis

#include "SDL.h"

void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);

Description

Makes sure the given list of rectangles is updated on the given screen. -The rectangles must all be confined within the screen boundaries (no -clipping is done).

This function should not be called while screen is -locked.

Note: It is adviced to call this function only once per frame, since each -call has some processing overhead. This is no restriction since you -can pass any number of rectangles each time.

The rectangles are not automatically merged or checked for overlap. In -general, the programmer can use his knowledge about his particular -rectangles to merge them in an efficient way, to avoid overdraw.


PrevHomeNext
SDL_UpdateRectUpSDL_Flip
\ No newline at end of file diff --git a/docs/html/sdluserevent.html b/docs/html/sdluserevent.html deleted file mode 100644 index 178769c51d..0000000000 --- a/docs/html/sdluserevent.html +++ /dev/null @@ -1,337 +0,0 @@ -SDL_UserEvent
SDL Library Documentation
PrevNext

SDL_UserEvent

Name

SDL_UserEvent -- A user-defined event type

Structure Definition

typedef struct{
-  Uint8 type;
-  int code;
-  void *data1;
-  void *data2;
-} SDL_UserEvent;

Structure Data

typeSDL_USEREVENT through to SDL_NUMEVENTS-1
codeUser defined event code
data1User defined data pointer
data2User defined data pointer

Description

SDL_UserEvent is in the user member of the structure SDL_Event. This event is unique, it is never created by SDL but only by the user. The event can be pushed onto the event queue using SDL_PushEvent. The contents of the structure members or completely up to the programmer, the only requirement is that type is a value from SDL_USEREVENT to SDL_NUMEVENTS-1 (inclusive).

Examples

SDL_Event event;
-
-event.type = SDL_USEREVENT;
-event.user.code = my_event_code;
-event.user.data1 = significant_data;
-event.user.data2 = 0;
-SDL_PushEvent(&event);


PrevHomeNext
SDL_SysWMEventUpSDL_QuitEvent
\ No newline at end of file diff --git a/docs/html/sdlvideodrivername.html b/docs/html/sdlvideodrivername.html deleted file mode 100644 index 141965623f..0000000000 --- a/docs/html/sdlvideodrivername.html +++ /dev/null @@ -1,243 +0,0 @@ -SDL_VideoDriverName
SDL Library Documentation
PrevNext

SDL_VideoDriverName

Name

SDL_VideoDriverName -- Obtain the name of the video driver

Synopsis

#include "SDL.h"

char *SDL_VideoDriverName(char *namebuf, int maxlen);

Description

The buffer pointed to by namebuf is filled up to a maximum of maxlen characters (include the NULL terminator) with the name of the initialised video driver. The driver name is a simple one word identifier like "x11" or "windib".

Return Value

Returns NULL if video has not been initialised with SDL_Init or a pointer to namebuf otherwise.


PrevHomeNext
SDL_GetVideoInfoUpSDL_ListModes
\ No newline at end of file diff --git a/docs/html/sdlvideoinfo.html b/docs/html/sdlvideoinfo.html deleted file mode 100644 index 3a0da31dad..0000000000 --- a/docs/html/sdlvideoinfo.html +++ /dev/null @@ -1,408 +0,0 @@ -SDL_VideoInfo
SDL Library Documentation
PrevNext

SDL_VideoInfo

Name

SDL_VideoInfo -- Video Target information

Structure Definition

typedef struct{
-  Uint32 hw_available:1;
-  Uint32 wm_available:1;
-  Uint32 blit_hw:1;
-  Uint32 blit_hw_CC:1;
-  Uint32 blit_hw_A:1;
-  Uint32 blit_sw:1;
-  Uint32 blit_sw_CC:1;
-  Uint32 blit_sw_A:1;
-  Uint32 blit_fill;
-  Uint32 video_mem;
-  SDL_PixelFormat *vfmt;
-} SDL_VideoInfo;

Structure Data

hw_availableIs it possible to create hardware surfaces?
wm_availableIs there a window manager available
blit_hwAre hardware to hardware blits accelerated?
blit_hw_CCAre hardware to hardware colorkey blits accelerated?
blit_hw_AAre hardware to hardware alpha blits accelerated?
blit_swAre software to hardware blits accelerated?
blit_sw_CCAre software to hardware colorkey blits accelerated?
blit_sw_AAre software to hardware alpha blits accelerated?
blit_fillAre color fills accelerated?
video_memTotal amount of video memory in Kilobytes
vfmtPixel format of the video device

Description

This (read-only) structure is returned by SDL_GetVideoInfo. It contains information on either the 'best' available mode (if called before SDL_SetVideoMode) or the current video mode.


PrevHomeNext
SDL_SurfaceUpSDL_Overlay
\ No newline at end of file diff --git a/docs/html/sdlvideomodeok.html b/docs/html/sdlvideomodeok.html deleted file mode 100644 index 5d2d6c4eb9..0000000000 --- a/docs/html/sdlvideomodeok.html +++ /dev/null @@ -1,270 +0,0 @@ -SDL_VideoModeOK
SDL Library Documentation
PrevNext

SDL_VideoModeOK

Name

SDL_VideoModeOK -- Check to see if a particular video mode is supported.

Synopsis

#include "SDL.h"

int SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);

Description

SDL_VideoModeOK returns 0 -if the requested mode is not supported under any bit depth, or returns the -bits-per-pixel of the closest available mode with the given width, height and requested surface flags (see SDL_SetVideoMode).

The bits-per-pixel value returned is only a suggested mode. You can usually request and bpp you want when setting the video mode and SDL will emulate that color depth with a shadow video surface.

The arguments to SDL_VideoModeOK are the same ones you -would pass to SDL_SetVideoMode

Example

SDL_Surface *screen;
-Uint32 bpp;
-.
-.
-.
-printf("Checking mode 640x480@16bpp.\n");
-bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE);
-
-if(!bpp){
-  printf("Mode not available.\n");
-  exit(-1);
-}
-
-printf("SDL Recommends 640x480@%dbpp.\n", bpp);
-screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE);
-.
-.

PrevHomeNext
SDL_ListModesUpSDL_SetVideoMode
\ No newline at end of file diff --git a/docs/html/sdlwaitevent.html b/docs/html/sdlwaitevent.html deleted file mode 100644 index b473d3b06e..0000000000 --- a/docs/html/sdlwaitevent.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_WaitEvent
SDL Library Documentation
PrevNext

SDL_WaitEvent

Name

SDL_WaitEvent -- Waits indefinitely for the next available event.

Synopsis

#include "SDL.h"

int SDL_WaitEvent(SDL_Event *event);

Description

Waits indefinitely for the next available event, returning -1, or 0 if there was -an error while waiting for events.

If event is not NULL, the next -event is removed from the queue and stored in that area.


PrevHomeNext
SDL_PollEventUpSDL_PushEvent
\ No newline at end of file diff --git a/docs/html/sdlwaitthread.html b/docs/html/sdlwaitthread.html deleted file mode 100644 index 2becfbc47f..0000000000 --- a/docs/html/sdlwaitthread.html +++ /dev/null @@ -1,231 +0,0 @@ -SDL_WaitThread
SDL Library Documentation
PrevNext

SDL_WaitThread

Name

SDL_WaitThread -- Wait for a thread to finish.

Synopsis

#include "SDL.h"
-#include "SDL_thread.h"

void SDL_WaitThread(SDL_Thread *thread, int *status);

Description

Wait for a thread to finish (timeouts are not supported).

Return Value

The return code for the thread function is placed in the area pointed to by -status, if status is not -NULL.


PrevHomeNext
SDL_GetThreadIDUpSDL_KillThread
\ No newline at end of file diff --git a/docs/html/sdlwarpmouse.html b/docs/html/sdlwarpmouse.html deleted file mode 100644 index e7b2d8d79f..0000000000 --- a/docs/html/sdlwarpmouse.html +++ /dev/null @@ -1,205 +0,0 @@ -SDL_WarpMouse
SDL Library Documentation
PrevNext

SDL_WarpMouse

Name

SDL_WarpMouse -- Set the position of the mouse cursor.

Synopsis

#include "SDL.h"

void SDL_WarpMouse(Uint16 x, Uint16 y);

Description

Set the position of the mouse cursor (generates a mouse motion event).


PrevHomeNext
SDL_DisplayFormatAlphaUpSDL_CreateCursor
\ No newline at end of file diff --git a/docs/html/sdlwasinit.html b/docs/html/sdlwasinit.html deleted file mode 100644 index b4effeb680..0000000000 --- a/docs/html/sdlwasinit.html +++ /dev/null @@ -1,284 +0,0 @@ -SDL_WasInit
SDL Library Documentation
PrevNext

SDL_WasInit

Name

SDL_WasInit -- Check which subsystems are initialized

Synopsis

#include "SDL.h"

Uint32 SDL_WasInit(Uint32 flags);

Description

SDL_WasInit allows you to see which SDL subsytems have been initialized. flags is a bitwise OR'd combination of the subsystems you wish to check (see SDL_Init for a list of subsystem flags).

Return Value

SDL_WasInit returns a bitwised OR'd combination of the initialized subsystems.

Examples


/* Here are several ways you can use SDL_WasInit() */
-
-/* Get init data on all the subsystems */
-Uint32 subsystem_init;
-
-subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);
-
-if(subsystem_init&SDL_INIT_VIDEO)
-  printf("Video is initialized.\n");
-else
-  printf("Video is not initialized.\n");
-
-
-
-/* Just check for one specfic subsystem */
-
-if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
-  printf("Video is initialized.\n");
-else
-  printf("Video is not initialized.\n");
-
-
-
-
-/* Check for two subsystems */
-
-Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;
-
-if(SDL_WasInit(subsystem_mask)==subsystem_mask)
-  printf("Video and Audio initialized.\n");
-else
-  printf("Video and Audio not initialized.\n");

PrevHomeNext
SDL_QuitUpSDL_GetError
\ No newline at end of file diff --git a/docs/html/sdlwmgetcaption.html b/docs/html/sdlwmgetcaption.html deleted file mode 100644 index 829c68aaa1..0000000000 --- a/docs/html/sdlwmgetcaption.html +++ /dev/null @@ -1,222 +0,0 @@ -SDL_WM_GetCaption
SDL Library Documentation
PrevNext

SDL_WM_GetCaption

Name

SDL_WM_GetCaption -- Gets the window title and icon name.

Synopsis

#include "SDL.h"

void SDL_WM_GetCaption(char **title, char **icon);

Description

Set pointers to the window title and icon name.


PrevHomeNext
SDL_WM_SetCaptionUpSDL_WM_SetIcon
\ No newline at end of file diff --git a/docs/html/sdlwmgrabinput.html b/docs/html/sdlwmgrabinput.html deleted file mode 100644 index 740dcd6b29..0000000000 --- a/docs/html/sdlwmgrabinput.html +++ /dev/null @@ -1,224 +0,0 @@ -SDL_WM_GrabInput
SDL Library Documentation
PrevNext

SDL_WM_GrabInput

Name

SDL_WM_GrabInput -- Grabs mouse and keyboard input.

Synopsis

#include "SDL.h"

SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode);

Description

Grabbing means that the mouse is confined to the application window, -and nearly all keyboard input is passed directly to the application, -and not interpreted by a window manager, if any.

When mode is SDL_GRAB_QUERY the grab mode is not changed, but the current grab mode is returned.

typedef enum {
-  SDL_GRAB_QUERY,
-  SDL_GRAB_OFF,
-  SDL_GRAB_ON
-} SDL_GrabMode;
-

Return Value

The current/new SDL_GrabMode.


PrevHomeNext
SDL_WM_ToggleFullScreenUpEvents
\ No newline at end of file diff --git a/docs/html/sdlwmiconifywindow.html b/docs/html/sdlwmiconifywindow.html deleted file mode 100644 index 1113656862..0000000000 --- a/docs/html/sdlwmiconifywindow.html +++ /dev/null @@ -1,211 +0,0 @@ -SDL_WM_IconifyWindow
SDL Library Documentation
PrevNext

SDL_WM_IconifyWindow

Name

SDL_WM_IconifyWindow -- Iconify/Minimise the window

Synopsis

#include "SDL.h"

int SDL_WM_IconifyWindow(void);

Description

If the application is running in a window managed environment SDL attempts to iconify/minimise it. If SDL_WM_IconifyWindow is successful, the application will receive a SDL_APPACTIVE loss event.

Return Value

Returns non-zero on success or 0 if iconification is not support or was refused by the window manager.


PrevHomeNext
SDL_WM_SetIconUpSDL_WM_ToggleFullScreen
\ No newline at end of file diff --git a/docs/html/sdlwmsetcaption.html b/docs/html/sdlwmsetcaption.html deleted file mode 100644 index bc47c278bd..0000000000 --- a/docs/html/sdlwmsetcaption.html +++ /dev/null @@ -1,212 +0,0 @@ -SDL_WM_SetCaption
SDL Library Documentation
PrevNext

SDL_WM_SetCaption

Name

SDL_WM_SetCaption -- Sets the window tile and icon name.

Synopsis

#include "SDL.h"

void SDL_WM_SetCaption(const char *title, const char *icon);

Description

Sets the title-bar and icon name of the display window.


PrevHomeNext
Window ManagementUpSDL_WM_GetCaption
\ No newline at end of file diff --git a/docs/html/sdlwmseticon.html b/docs/html/sdlwmseticon.html deleted file mode 100644 index 12eb207c69..0000000000 --- a/docs/html/sdlwmseticon.html +++ /dev/null @@ -1,260 +0,0 @@ -SDL_WM_SetIcon
SDL Library Documentation
PrevNext

SDL_WM_SetIcon

Name

SDL_WM_SetIcon -- Sets the icon for the display window.

Synopsis

#include "SDL.h"

void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);

Description

Sets the icon for the display window. Win32 icons must be 32x32.

This function must be called before the first call to -SDL_SetVideoMode.

The mask is a bitmask that describes the shape of the -icon. If mask is NULL, then the shape is determined by -the colorkey of icon, if any, or makes the icon -rectangular (no transparency) otherwise.

If mask is non-NULL, it points to a bitmap with bits set -where the corresponding pixel should be visible. The format of the bitmap is as -follows: Scanlines come in the usual top-down order. Each scanline consists of -(width / 8) bytes, rounded up. The most significant bit of each byte represents -the leftmost pixel.

Example

SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);

PrevHomeNext
SDL_WM_GetCaptionUpSDL_WM_IconifyWindow
\ No newline at end of file diff --git a/docs/html/sdlwmtogglefullscreen.html b/docs/html/sdlwmtogglefullscreen.html deleted file mode 100644 index b7973de551..0000000000 --- a/docs/html/sdlwmtogglefullscreen.html +++ /dev/null @@ -1,205 +0,0 @@ -SDL_WM_ToggleFullScreen
SDL Library Documentation
PrevNext

SDL_WM_ToggleFullScreen

Name

SDL_WM_ToggleFullScreen -- Toggles fullscreen mode

Synopsis

#include "SDL.h"

int SDL_WM_ToggleFullScreen(SDL_Surface *surface);

Description

Toggles the application between windowed and fullscreen mode, if supported. (X11 is the only target currently supported, BeOS support is experimental).

Return Value

Returns 0 on failure or 1 on success.


PrevHomeNext
SDL_WM_IconifyWindowUpSDL_WM_GrabInput
\ No newline at end of file diff --git a/docs/html/thread.html b/docs/html/thread.html deleted file mode 100644 index 8ef2c92850..0000000000 --- a/docs/html/thread.html +++ /dev/null @@ -1,313 +0,0 @@ -Multi-threaded Programming
SDL Library Documentation
PrevNext

Chapter 12. Multi-threaded Programming

Table of Contents
SDL_CreateThread -- Creates a new thread of execution that shares its parent's properties.
SDL_ThreadID -- Get the 32-bit thread identifier for the current thread.
SDL_GetThreadID -- Get the SDL thread ID of a SDL_Thread
SDL_WaitThread -- Wait for a thread to finish.
SDL_KillThread -- Gracelessly terminates the thread.
SDL_CreateMutex -- Create a mutex
SDL_DestroyMutex -- Destroy a mutex
SDL_mutexP -- Lock a mutex
SDL_mutexV -- Unlock a mutex
SDL_CreateSemaphore -- Creates a new semaphore and assigns an initial value to it.
SDL_DestroySemaphore -- Destroys a semaphore that was created by SDL_CreateSemaphore.
SDL_SemWait -- Lock a semaphore and suspend the thread if the semaphore value is zero.
SDL_SemTryWait -- Attempt to lock a semaphore but don't suspend the thread.
SDL_SemWaitTimeout -- Lock a semaphore, but only wait up to a specified maximum time.
SDL_SemPost -- Unlock a semaphore.
SDL_SemValue -- Return the current value of a semaphore.
SDL_CreateCond -- Create a condition variable
SDL_DestroyCond -- Destroy a condition variable
SDL_CondSignal -- Restart a thread wait on a condition variable
SDL_CondBroadcast -- Restart all threads waiting on a condition variable
SDL_CondWait -- Wait on a condition variable
SDL_CondWaitTimeout -- Wait on a condition variable, with timeout

SDL provides functions for creating threads, mutexes, semphores and condition variables.

In general, you must be very aware of concurrency and data integrity issues -when writing multi-threaded programs. Some good guidelines include: -

  • Don't call SDL video/event functions from separate threads

  • Don't use any library functions in separate threads

  • Don't perform any memory management in separate threads

  • Lock global variables which may be accessed by multiple threads

  • Never terminate threads, always set a flag and wait for them to quit

  • Think very carefully about all possible ways your code may interact

Note: SDL's threading is not implemented on MacOS, due to the lack of preemptive thread support on that OS (Mac OS X doesn't suffer from this problem)


PrevHomeNext
SDL_CDtrackUpSDL_CreateThread
\ No newline at end of file diff --git a/docs/html/time.html b/docs/html/time.html deleted file mode 100644 index 854b7cb57e..0000000000 --- a/docs/html/time.html +++ /dev/null @@ -1,206 +0,0 @@ -Time
SDL Library Documentation
PrevNext

Chapter 13. Time

Table of Contents
SDL_GetTicks -- Get the number of milliseconds since the SDL library initialization.
SDL_Delay -- Wait a specified number of milliseconds before returning.
SDL_AddTimer -- Add a timer which will call a callback after the specified number of milliseconds has -elapsed.
SDL_RemoveTimer -- Remove a timer which was added with -SDL_AddTimer.
SDL_SetTimer -- Set a callback to run after the specified number of milliseconds has -elapsed.

SDL provides several cross-platform functions for dealing with time. -It provides a way to get the current time, a way to wait a little while, -and a simple timer mechanism. These functions give you two ways of moving an -object every x milliseconds: - -

  • Use a timer callback function. This may have the bad effect that it runs in a seperate thread or uses alarm signals, but it's easier to implement.

  • Or you can get the number of milliseconds passed, and move the object if, for example, 30 ms passed.


PrevHomeNext
SDL_CondWaitTimeoutUpSDL_GetTicks
\ No newline at end of file diff --git a/docs/html/video.html b/docs/html/video.html deleted file mode 100644 index 9b1434e62d..0000000000 --- a/docs/html/video.html +++ /dev/null @@ -1,507 +0,0 @@ -Video
SDL Library Documentation
PrevNext

Chapter 6. Video

Table of Contents
SDL_GetVideoSurface -- returns a pointer to the current display surface
SDL_GetVideoInfo -- returns a pointer to information about the video hardware
SDL_VideoDriverName -- Obtain the name of the video driver
SDL_ListModes -- Returns a pointer to an array of available screen dimensions for -the given format and video flags
SDL_VideoModeOK -- Check to see if a particular video mode is supported.
SDL_SetVideoMode -- Set up a video mode with the specified width, height and bits-per-pixel.
SDL_UpdateRect -- Makes sure the given area is updated on the given screen.
SDL_UpdateRects -- Makes sure the given list of rectangles is updated on the given screen.
SDL_Flip -- Swaps screen buffers
SDL_SetColors -- Sets a portion of the colormap for the given 8-bit surface.
SDL_SetPalette -- Sets the colors in the palette of an 8-bit surface.
SDL_SetGamma -- Sets the color gamma function for the display
SDL_GetGammaRamp -- Gets the color gamma lookup tables for the display
SDL_SetGammaRamp -- Sets the color gamma lookup tables for the display
SDL_MapRGB -- Map a RGB color value to a pixel format.
SDL_MapRGBA -- Map a RGBA color value to a pixel format.
SDL_GetRGB -- Get RGB values from a pixel in the specified pixel format.
SDL_GetRGBA -- Get RGBA values from a pixel in the specified pixel format.
SDL_CreateRGBSurface -- Create an empty SDL_Surface
SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data
SDL_FreeSurface -- Frees (deletes) a SDL_Surface
SDL_LockSurface -- Lock a surface for directly access.
SDL_UnlockSurface -- Unlocks a previously locked surface.
SDL_LoadBMP -- Load a Windows BMP file into an SDL_Surface.
SDL_SaveBMP -- Save an SDL_Surface as a Windows BMP file.
SDL_SetColorKey -- Sets the color key (transparent pixel) in a blittable surface and -RLE acceleration.
SDL_SetAlpha -- Adjust the alpha properties of a surface
SDL_SetClipRect -- Sets the clipping rectangle for a surface.
SDL_GetClipRect -- Gets the clipping rectangle for a surface.
SDL_ConvertSurface -- Converts a surface to the same format as another surface.
SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.
SDL_FillRect -- This function performs a fast fill of the given rectangle with some color
SDL_DisplayFormat -- Convert a surface to the display format
SDL_DisplayFormatAlpha -- Convert a surface to the display format
SDL_WarpMouse -- Set the position of the mouse cursor.
SDL_CreateCursor -- Creates a new mouse cursor.
SDL_FreeCursor -- Frees a cursor created with SDL_CreateCursor.
SDL_SetCursor -- Set the currently active mouse cursor.
SDL_GetCursor -- Get the currently active mouse cursor.
SDL_ShowCursor -- Toggle whether or not the cursor is shown on the screen.
SDL_GL_LoadLibrary -- Specify an OpenGL library
SDL_GL_GetProcAddress -- Get the address of a GL function
SDL_GL_GetAttribute -- Get the value of a special SDL/OpenGL attribute
SDL_GL_SetAttribute -- Set a special SDL/OpenGL attribute
SDL_GL_SwapBuffers -- Swap OpenGL framebuffers/Update Display
SDL_CreateYUVOverlay -- Create a YUV video overlay
SDL_LockYUVOverlay -- Lock an overlay
SDL_UnlockYUVOverlay -- Unlock an overlay
SDL_DisplayYUVOverlay -- Blit the overlay to the display
SDL_FreeYUVOverlay -- Free a YUV video overlay
SDL_GLattr -- SDL GL Attributes
SDL_Rect -- Defines a rectangular area
SDL_Color -- Format independent color description
SDL_Palette -- Color palette for 8-bit pixel formats
SDL_PixelFormat -- Stores surface format information
SDL_Surface -- Graphical Surface Structure
SDL_VideoInfo -- Video Target information
SDL_Overlay -- YUV video overlay

SDL presents a very simple interface to the display framebuffer. The -framebuffer is represented as an offscreen surface to which you can write -directly. If you want the screen to show what you have written, call the update function which will -guarantee that the desired portion of the screen is updated.

Before you call any of the SDL video functions, you must first call -SDL_Init(SDL_INIT_VIDEO), which initializes the video -and events in the SDL library. Check the return code, which should be -0, to see if there were any errors in starting up.

If you use both sound and video in your application, you need to call -SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) before opening the -sound device, otherwise under Win32 DirectX, you won't be able to set -full-screen display modes.

After you have initialized the library, you can start up the video display in a -number of ways. The easiest way is to pick a common screen resolution and -depth and just initialize the video, checking for errors. You will probably -get what you want, but SDL may be emulating your requested mode and converting -the display on update. The best way is to -query, for the best -video mode closest to the desired one, and then -convert -your images to that pixel format.

SDL currently supports any bit depth >= 8 bits per pixel. 8 bpp formats are -considered 8-bit palettized modes, while 12, 15, 16, 24, and 32 bits per pixel -are considered "packed pixel" modes, meaning each pixel contains the RGB color -components packed in the bits of the pixel.

After you have initialized your video mode, you can take the surface that was -returned, and write to it like any other framebuffer, calling the update -routine as you go.

When you have finished your video access and are ready to quit your -application, you should call "SDL_Quit()" to shutdown the -video and events.


PrevHomeNext
SDL_envvarsUpSDL_GetVideoSurface
\ No newline at end of file diff --git a/docs/html/wm.html b/docs/html/wm.html deleted file mode 100644 index f53a349c16..0000000000 --- a/docs/html/wm.html +++ /dev/null @@ -1,188 +0,0 @@ -Window Management
SDL Library Documentation
PrevNext

Chapter 7. Window Management

Table of Contents
SDL_WM_SetCaption -- Sets the window tile and icon name.
SDL_WM_GetCaption -- Gets the window title and icon name.
SDL_WM_SetIcon -- Sets the icon for the display window.
SDL_WM_IconifyWindow -- Iconify/Minimise the window
SDL_WM_ToggleFullScreen -- Toggles fullscreen mode
SDL_WM_GrabInput -- Grabs mouse and keyboard input.

SDL provides a small set of window management functions which allow applications to change their title and toggle from windowed mode to fullscreen (if available)


PrevHomeNext
SDL_OverlayUpSDL_WM_SetCaption
\ No newline at end of file diff --git a/docs/images/rainbow.gif b/docs/images/rainbow.gif deleted file mode 100644 index 07eb184f7e..0000000000 Binary files a/docs/images/rainbow.gif and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 7d572533e2..0000000000 --- a/docs/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - -Simple DirectMedia Layer Introduction - - -
-

Simple DirectMedia Layer Introduction

-

-This library is designed to make it easy to write games that run on many -different platforms using the various native high-performance media interfaces, -(for video, audio, etc) and presenting a single source-code level API to -your application. This is a fairly low level API, but using this, completely -portable applications can be written with a great deal of flexibility. -

-An introduction to SDL can be found online at: - - http://www.libsdl.org/intro.php -

-Tutorials on a variety of topics can be found online at: - - http://www.libsdl.org/tutorials.php -

-Documentation in Wiki form can be found online at: - - http://www.libsdl.org/cgi/docwiki.cgi/ -

-Enjoy! -

-    Sam Lantinga - -

-


-

Table of Contents

- -
diff --git a/docs/man3/SDLKey.3 b/docs/man3/SDLKey.3 deleted file mode 100644 index dc74dfaac7..0000000000 --- a/docs/man3/SDLKey.3 +++ /dev/null @@ -1,161 +0,0 @@ -.TH "SDLKey" "3" "Wed 11 Oct 2000, 22:28" "SDL" "SDL API Reference" -.SH "NAME" -SDLKey \- SDL Keysym Definitions -.SH "SDL Keysym definitions" -.PP -\fBSDLKey ASCII value Common Name\fR -.nf -\f(CWSDLK_BACKSPACE '\\b' backspace -SDLK_TAB '\\t' tab -SDLK_CLEAR clear -SDLK_RETURN '\\r' return -SDLK_PAUSE pause -SDLK_ESCAPE '^[' escape -SDLK_SPACE ' ' space -SDLK_EXCLAIM '!' exclaim -SDLK_QUOTEDBL '"' quotedbl -SDLK_HASH '#' hash -SDLK_DOLLAR '$' dollar -SDLK_AMPERSAND '&' ampersand -SDLK_QUOTE ''' quote -SDLK_LEFTPAREN '(' left parenthesis -SDLK_RIGHTPAREN ')' right parenthesis -SDLK_ASTERISK '*' asterisk -SDLK_PLUS '+' plus sign -SDLK_COMMA ',' comma -SDLK_MINUS '-' minus sign -SDLK_PERIOD '.' period -SDLK_SLASH '/' forward slash -SDLK_0 '0' 0 -SDLK_1 '1' 1 -SDLK_2 '2' 2 -SDLK_3 '3' 3 -SDLK_4 '4' 4 -SDLK_5 '5' 5 -SDLK_6 '6' 6 -SDLK_7 '7' 7 -SDLK_8 '8' 8 -SDLK_9 '9' 9 -SDLK_COLON ':' colon -SDLK_SEMICOLON ';' semicolon -SDLK_LESS '<' less-than sign -SDLK_EQUALS '=' equals sign -SDLK_GREATER '>' greater-than sign -SDLK_QUESTION '?' question mark -SDLK_AT '@' at -SDLK_LEFTBRACKET '[' left bracket -SDLK_BACKSLASH '\\' backslash -SDLK_RIGHTBRACKET ']' right bracket -SDLK_CARET '^' caret -SDLK_UNDERSCORE '_' underscore -SDLK_BACKQUOTE '`' grave -SDLK_a 'a' a -SDLK_b 'b' b -SDLK_c 'c' c -SDLK_d 'd' d -SDLK_e 'e' e -SDLK_f 'f' f -SDLK_g 'g' g -SDLK_h 'h' h -SDLK_i 'i' i -SDLK_j 'j' j -SDLK_k 'k' k -SDLK_l 'l' l -SDLK_m 'm' m -SDLK_n 'n' n -SDLK_o 'o' o -SDLK_p 'p' p -SDLK_q 'q' q -SDLK_r 'r' r -SDLK_s 's' s -SDLK_t 't' t -SDLK_u 'u' u -SDLK_v 'v' v -SDLK_w 'w' w -SDLK_x 'x' x -SDLK_y 'y' y -SDLK_z 'z' z -SDLK_DELETE '^?' delete -SDLK_KP0 keypad 0 -SDLK_KP1 keypad 1 -SDLK_KP2 keypad 2 -SDLK_KP3 keypad 3 -SDLK_KP4 keypad 4 -SDLK_KP5 keypad 5 -SDLK_KP6 keypad 6 -SDLK_KP7 keypad 7 -SDLK_KP8 keypad 8 -SDLK_KP9 keypad 9 -SDLK_KP_PERIOD '.' keypad period -SDLK_KP_DIVIDE '/' keypad divide -SDLK_KP_MULTIPLY '*' keypad multiply -SDLK_KP_MINUS '-' keypad minus -SDLK_KP_PLUS '+' keypad plus -SDLK_KP_ENTER '\\r' keypad enter -SDLK_KP_EQUALS '=' keypad equals -SDLK_UP up arrow -SDLK_DOWN down arrow -SDLK_RIGHT right arrow -SDLK_LEFT left arrow -SDLK_INSERT insert -SDLK_HOME home -SDLK_END end -SDLK_PAGEUP page up -SDLK_PAGEDOWN page down -SDLK_F1 F1 -SDLK_F2 F2 -SDLK_F3 F3 -SDLK_F4 F4 -SDLK_F5 F5 -SDLK_F6 F6 -SDLK_F7 F7 -SDLK_F8 F8 -SDLK_F9 F9 -SDLK_F10 F10 -SDLK_F11 F11 -SDLK_F12 F12 -SDLK_F13 F13 -SDLK_F14 F14 -SDLK_F15 F15 -SDLK_NUMLOCK numlock -SDLK_CAPSLOCK capslock -SDLK_SCROLLOCK scrollock -SDLK_RSHIFT right shift -SDLK_LSHIFT left shift -SDLK_RCTRL right ctrl -SDLK_LCTRL left ctrl -SDLK_RALT right alt -SDLK_LALT left alt -SDLK_RMETA right meta -SDLK_LMETA left meta -SDLK_LSUPER left windows key -SDLK_RSUPER right windows key -SDLK_MODE mode shift -SDLK_HELP help -SDLK_PRINT print-screen -SDLK_SYSREQ SysRq -SDLK_BREAK break -SDLK_MENU menu -SDLK_POWER power -SDLK_EURO euro\fR -.fi - - -.SH "SDL modifier definitions" -.PP -\fBSDL Modifier Meaning\fR -.nf -\f(CWKMOD_NONE No modifiers applicable -KMOD_NUM Numlock is down -KMOD_CAPS Capslock is down -KMOD_LCTRL Left Control is down -KMOD_RCTRL Right Control is down -KMOD_RSHIFT Right Shift is down -KMOD_LSHIFT Left Shift is down -KMOD_RALT Right Alt is down -KMOD_LALT Left Alt is down -KMOD_CTRL A Control key is down -KMOD_SHIFT A Shift key is down -KMOD_ALT An Alt key is down\fR -.fi - diff --git a/docs/man3/SDL_ActiveEvent.3 b/docs/man3/SDL_ActiveEvent.3 deleted file mode 100644 index 068e7c01ad..0000000000 --- a/docs/man3/SDL_ActiveEvent.3 +++ /dev/null @@ -1,38 +0,0 @@ -.TH "SDL_ActiveEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ActiveEvent \- Application visibility event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 gain; - Uint8 state; -} SDL_ActiveEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_ACTIVEEVENT\&.\fP -.TP 20 -\fBgain\fR -0 if the event is a loss or 1 if it is a gain\&. -.TP 20 -\fBstate\fR -\fBSDL_APPMOUSEFOCUS\fP if mouse focus was gained or lost, \fBSDL_APPINPUTFOCUS\fP if input focus was gained or lost, or \fBSDL_APPACTIVE\fP if the application was iconified (\fBgain\fR=0) or restored(\fBgain\fR=1)\&. -.SH "DESCRIPTION" -.PP -\fBSDL_ActiveEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_ACTIVEEVENT\fP is reported\&. -.PP -When the mouse leaves or enters the window area a \fBSDL_APPMOUSEFOCUS\fP type activation event occurs, if the mouse entered the window then \fBgain\fR will be 1, otherwise \fBgain\fR will be 0\&. A \fBSDL_APPINPUTFOCUS\fP type activation event occurs when the application loses or gains keyboard focus\&. This usually occurs when another application is made active\&. Finally, a \fBSDL_APPACTIVE\fP type event occurs when the application is either minimised/iconified (\fBgain\fR=0) or restored\&. -.PP -.RS -\fBNote: -.PP -This event does not occur when an application window is first created\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_GetAppState\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_AddTimer.3 b/docs/man3/SDL_AddTimer.3 deleted file mode 100644 index bc494ed4b8..0000000000 --- a/docs/man3/SDL_AddTimer.3 +++ /dev/null @@ -1,38 +0,0 @@ -.TH "SDL_AddTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_AddTimer \- Add a timer which will call a callback after the specified number of milliseconds has elapsed\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_TimerID \fBSDL_AddTimer\fP\fR(\fBUint32 interval, SDL_NewTimerCallback callback, void *param\fR); -.SH "CALLBACK" -.PP -.nf -\f(CW/* type definition for the "new" timer callback function */ -typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);\fR -.fi -.PP -.SH "DESCRIPTION" -.PP -Adds a callback function to be run after the specified number of milliseconds has elapsed\&. The callback function is passed the current timer interval and the user supplied parameter from the \fBSDL_AddTimer\fP call and returns the next timer interval\&. If the returned value from the callback is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled\&. -.PP -To cancel a currently running timer call \fISDL_RemoveTimer\fR with the timer ID returned from \fBSDL_AddTimer\fP\&. -.PP -The timer callback function may run in a different thread than your main program, and so shouldn\&'t call any functions from within itself\&. You may always call \fISDL_PushEvent\fR, however\&. -.PP -The granularity of the timer is platform-dependent, but you should count on it being at least 10 ms as this is the most common number\&. This means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system\&. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below)\&. If you use this function, you need to pass \fBSDL_INIT_TIMER\fP to \fISDL_Init\fR\&. -.SH "RETURN VALUE" -.PP -Returns an ID value for the added timer or \fBNULL\fR if there was an error\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWmy_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_RemoveTimer\fP\fR, \fI\fBSDL_PushEvent\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_AudioCVT.3 b/docs/man3/SDL_AudioCVT.3 deleted file mode 100644 index f5e348952d..0000000000 --- a/docs/man3/SDL_AudioCVT.3 +++ /dev/null @@ -1,68 +0,0 @@ -.TH "SDL_AudioCVT" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_AudioCVT \- Audio Conversion Structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - int needed; - Uint16 src_format; - Uint16 dest_format; - double rate_incr; - Uint8 *buf; - int len; - int len_cvt; - int len_mult; - double len_ratio; - void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); - int filter_index; -} SDL_AudioCVT;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBneeded\fR -Set to one if the conversion is possible -.TP 20 -\fBsrc_format\fR -Audio format of the source -.TP 20 -\fBdest_format\fR -Audio format of the destination -.TP 20 -\fBrate_incr\fR -Rate conversion increment -.TP 20 -\fBbuf\fR -Audio buffer -.TP 20 -\fBlen\fR -Length of the original audio buffer in bytes -.TP 20 -\fBlen_cvt\fR -Length of converted audio buffer in bytes (calculated) -.TP 20 -\fBlen_mult\fR -\fBbuf\fR must be \fBlen\fR*\fBlen_mult\fR bytes in size(calculated) -.TP 20 -\fBlen_ratio\fR -Final audio size is \fBlen\fR*\fBlen_ratio\fR -.TP 20 -\fBfilters[10](\&.\&.)\fR -Pointers to functions needed for this conversion -.TP 20 -\fBfilter_index\fR -Current conversion function -.SH "DESCRIPTION" -.PP -The \fBSDL_AudioCVT\fR is used to convert audio data between different formats\&. A \fBSDL_AudioCVT\fR structure is created with the \fI\fBSDL_BuildAudioCVT\fP\fR function, while the actual conversion is done by the \fI\fBSDL_ConvertAudio\fP\fR function\&. -.PP -Many of the fields in the \fBSDL_AudioCVT\fR structure should be considered private and their function will not be discussed here\&. -.IP "\fBUint8 *\fP\fBbuf\fR" 10This points to the audio data that will be used in the conversion\&. It is both the source and the destination, which means the converted audio data overwrites the original data\&. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure \fBbuf\fR is large enough\&. See below\&. -.IP "\fBint\fP \fBlen\fR" 10This is the length of the original audio data in bytes\&. -.IP "\fBint\fP \fBlen_mult\fR" 10As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data\&. The length of \fBbuf\fR should be \fBlen\fR*\fBlen_mult\fR\&. -.IP "\fBdouble\fP \fBlen_ratio\fR" 10When you have finished converting your audio data, you need to know how much of your audio buffer is valid\&. \fBlen\fR*\fBlen_ratio\fR is the size of the converted audio data in bytes\&. This is very similar to \fBlen_mult\fR, however when the convert audio data is shorter than the original \fBlen_mult\fR would be 1\&. \fBlen_ratio\fR, on the other hand, would be a fractional number between 0 and 1\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioSpec\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_AudioSpec.3 b/docs/man3/SDL_AudioSpec.3 deleted file mode 100644 index c70ffd1735..0000000000 --- a/docs/man3/SDL_AudioSpec.3 +++ /dev/null @@ -1,70 +0,0 @@ -.TH "SDL_AudioSpec" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_AudioSpec \- Audio Specification Structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - int freq; - Uint16 format; - Uint8 channels; - Uint8 silence; - Uint16 samples; - Uint32 size; - void (*callback)(void *userdata, Uint8 *stream, int len); - void *userdata; -} SDL_AudioSpec;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBfreq\fR -Audio frequency in samples per second -.TP 20 -\fBformat\fR -Audio data format -.TP 20 -\fBchannels\fR -Number of channels: 1 mono, 2 stereo -.TP 20 -\fBsilence\fR -Audio buffer silence value (calculated) -.TP 20 -\fBsamples\fR -Audio buffer size in samples -.TP 20 -\fBsize\fR -Audio buffer size in bytes (calculated) -.TP 20 -\fBcallback(\&.\&.)\fR -Callback function for filling the audio buffer -.TP 20 -\fBuserdata\fR -Pointer the user data which is passed to the callback function -.SH "DESCRIPTION" -.PP -The \fBSDL_AudioSpec\fR structure is used to describe the format of some audio data\&. This structure is used by \fI\fBSDL_OpenAudio\fP\fR and \fI\fBSDL_LoadWAV\fP\fR\&. While all fields are used by \fBSDL_OpenAudio\fP only \fBfreq\fR, \fBformat\fR, \fBsamples\fR and \fBchannels\fR are used by \fBSDL_LoadWAV\fP\&. We will detail these common members here\&. -.TP 20 -\fBfreq\fR -The number of samples sent to the sound device every second\&. Common values are 11025, 22050 and 44100\&. The higher the better\&. -.TP 20 -\fBformat\fR -Specifies the size and type of each sample element -.IP "\fBAUDIO_U8\fP" 10Unsigned 8-bit samples -.IP "\fBAUDIO_S8\fP" 10Signed 8-bit samples -.IP "\fBAUDIO_U16\fP or \fBAUDIO_U16LSB\fP" 10Unsigned 16-bit little-endian samples -.IP "\fBAUDIO_S16\fP or \fBAUDIO_S16LSB\fP" 10Signed 16-bit little-endian samples -.IP "\fBAUDIO_U16MSB\fP" 10Unsigned 16-bit big-endian samples -.IP "\fBAUDIO_S16MSB\fP" 10Signed 16-bit big-endian samples -.IP "\fBAUDIO_U16SYS\fP" 10Either \fBAUDIO_U16LSB\fP or \fBAUDIO_U16MSB\fP depending on you systems endianness -.IP "\fBAUDIO_S16SYS\fP" 10Either \fBAUDIO_S16LSB\fP or \fBAUDIO_S16MSB\fP depending on you systems endianness -.TP 20 -\fBchannels\fR -The number of seperate sound channels\&. 1 is mono (single channel), 2 is stereo (dual channel)\&. -.TP 20 -\fBsamples\fR -When used with \fI\fBSDL_OpenAudio\fP\fR this refers to the size of the audio buffer in samples\&. A sample a chunk of audio data of the size specified in \fBformat\fR mulitplied by the number of channels\&. When the \fBSDL_AudioSpec\fR is used with \fI\fBSDL_LoadWAV\fP\fR \fBsamples\fR is set to 4096\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_OpenAudio\fP\fR, \fI\fBSDL_LoadWAV\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_BlitSurface.3 b/docs/man3/SDL_BlitSurface.3 deleted file mode 100644 index 5f62ffb4bb..0000000000 --- a/docs/man3/SDL_BlitSurface.3 +++ /dev/null @@ -1,60 +0,0 @@ -.TH "SDL_BlitSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_BlitSurface \- This performs a fast blit from the source surface to the destination surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_BlitSurface\fP\fR(\fBSDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect\fR); -.SH "DESCRIPTION" -.PP -This performs a fast blit from the source surface to the destination surface\&. -.PP -Only the position is used in the \fBdstrect\fR (the width and height are ignored)\&. -.PP -If either \fBsrcrect\fR or \fBdstrect\fR are \fBNULL\fP, the entire surface (\fBsrc\fR or \fBdst\fR) is copied\&. -.PP -The final blit rectangle is saved in \fBdstrect\fR after all clipping is performed (\fBsrcrect\fR is not modified)\&. -.PP -The blit function should not be called on a locked surface\&. -.PP -The results of blitting operations vary greatly depending on whether \fBSDL_SRCAPLHA\fP is set or not\&. See \fISDL_SetAlpha\fR for an explaination of how this affects your results\&. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain\&. -.PP -.nf -\f(CWif (source surface has SDL_SRCALPHA set) { - if (source surface has alpha channel (that is, format->Amask != 0)) - blit using per-pixel alpha, ignoring any colour key - else { - if (source surface has SDL_SRCCOLORKEY set) - blit using the colour key AND the per-surface alpha value - else - blit using the per-surface alpha value - } -} else { - if (source surface has SDL_SRCCOLORKEY set) - blit using the colour key - else - ordinary opaque rectangular blit -}\fR -.fi -.PP -.SH "RETURN VALUE" -.PP -If the blit is successful, it returns \fB0\fR, otherwise it returns \fB-1\fR\&. -.PP -If either of the surfaces were in video memory, and the blit returns \fB-2\fR, the video memory was lost, so it should be reloaded with artwork and re-blitted: -.PP -.nf -\f(CW while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { - while ( SDL_LockSurface(image)) < 0 ) - Sleep(10); - -- Write image pixels to image->pixels -- - SDL_UnlockSurface(image); - }\fR -.fi -.PP - This happens under DirectX 5\&.0 when the system switches away from your fullscreen application\&. Locking the surface will also fail until you have access to the video memory again\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_FillRect\fP\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_Rect\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_BuildAudioCVT.3 b/docs/man3/SDL_BuildAudioCVT.3 deleted file mode 100644 index dfca664a8b..0000000000 --- a/docs/man3/SDL_BuildAudioCVT.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "SDL_BuildAudioCVT" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_BuildAudioCVT \- Initializes a SDL_AudioCVT structure for conversion -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_BuildAudioCVT\fP\fR(\fBSDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate\fR); -.SH "DESCRIPTION" -.PP -Before an \fI\fBSDL_AudioCVT\fR\fR structure can be used to convert audio data it must be initialized with source and destination information\&. -.PP -\fBsrc_format\fR and \fBdst_format\fR are the source and destination format of the conversion\&. (For information on audio formats see \fI\fB SDL_AudioSpec\fR\fR)\&. \fBsrc_channels\fR and \fBdst_channels\fR are the number of channels in the source and destination formats\&. Finally, \fBsrc_rate\fR and \fBdst_rate\fR are the frequency or samples-per-second of the source and destination formats\&. Once again, see \fI\fBSDL_AudioSpec\fR\fR\&. -.SH "RETURN VALUES" -.PP -Returns \fB-1\fR if the filter could not be built or 1 if it could\&. -.SH "EXAMPLES" -.PP -See \fI\fBSDL_ConvertAudio\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioCVT\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CD.3 b/docs/man3/SDL_CD.3 deleted file mode 100644 index ea218186a0..0000000000 --- a/docs/man3/SDL_CD.3 +++ /dev/null @@ -1,57 +0,0 @@ -.TH "SDL_CD" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CD \- CDROM Drive Information -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - int id; - CDstatus status; - int numtracks; - int cur_track; - int cur_frame; - SDL_CDtrack track[SDL_MAX_TRACKS+1]; -} SDL_CD;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBid\fR -Private drive identifier -.TP 20 -\fBstatus\fR -Drive \fIstatus\fR -.TP 20 -\fBnumtracks\fR -Number of tracks on the CD -.TP 20 -\fBcur_track\fR -Current track -.TP 20 -\fBcur_frame\fR -Current frame offset within the track -.TP 20 -\fBtrack\fR[SDL_MAX_TRACKS+1] -Array of track descriptions\&. (see \fI\fBSDL_CDtrack\fR\fR) -.SH "DESCRIPTION" -.PP -An \fBSDL_CD\fR structure is returned by \fI\fBSDL_CDOpen\fP\fR\&. It represents an opened CDROM device and stores information on the layout of the tracks on the disc\&. -.PP -A frame is the base data unit of a CD\&. \fBCD_FPS\fP frames is equal to 1 second of music\&. SDL provides two macros for converting between time and frames: \fBFRAMES_TO_MSF(f, M,S,F)\fP and \fBMSF_TO_FRAMES\fP\&. -.SH "EXAMPLES" -.PP -.nf -\f(CWint min, sec, frame; -int frame_offset; - -FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame); -printf("Current Position: %d minutes, %d seconds, %d frames -", min, sec, frame); - -frame_offset=MSF_TO_FRAMES(min, sec, frame);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CDtrack\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDClose.3 b/docs/man3/SDL_CDClose.3 deleted file mode 100644 index 9dd29fbab8..0000000000 --- a/docs/man3/SDL_CDClose.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_CDClose" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDClose \- Closes a SDL_CD handle -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_CDClose\fP\fR(\fBSDL_CD *cdrom\fR); -.SH "DESCRIPTION" -.PP -Closes the given \fBcdrom\fR handle\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CD\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDEject.3 b/docs/man3/SDL_CDEject.3 deleted file mode 100644 index 2f2983d8f4..0000000000 --- a/docs/man3/SDL_CDEject.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_CDEject" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDEject \- Ejects a CDROM -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_CDEject\fP\fR(\fBSDL_CD *cdrom\fR); -.SH "DESCRIPTION" -.PP -Ejects the given \fBcdrom\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CD\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDName.3 b/docs/man3/SDL_CDName.3 deleted file mode 100644 index c6f62984a8..0000000000 --- a/docs/man3/SDL_CDName.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "SDL_CDName" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDName \- Returns a human-readable, system-dependent identifier for the CD-ROM\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBconst char *\fBSDL_CDName\fP\fR(\fBint drive\fR); -.SH "DESCRIPTION" -.PP -Returns a human-readable, system-dependent identifier for the CD-ROM\&. \fBdrive\fR is the index of the drive\&. Drive indices start to 0 and end at \fBSDL_CDNumDrives()\fP-1\&. -.SH "EXAMPLES" -.PP -.IP " \(bu" 6 -"/dev/cdrom" -.IP " \(bu" 6 -"E:" -.IP " \(bu" 6 -"/dev/disk/ide/1/master" -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDNumDrives\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDNumDrives.3 b/docs/man3/SDL_CDNumDrives.3 deleted file mode 100644 index ad62b68550..0000000000 --- a/docs/man3/SDL_CDNumDrives.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_CDNumDrives" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDNumDrives \- Returns the number of CD-ROM drives on the system\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_CDNumDrives\fP\fR(\fBvoid\fR) -.SH "DESCRIPTION" -.PP -Returns the number of CD-ROM drives on the system\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDOpen\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDOpen.3 b/docs/man3/SDL_CDOpen.3 deleted file mode 100644 index dbf23fc2b0..0000000000 --- a/docs/man3/SDL_CDOpen.3 +++ /dev/null @@ -1,58 +0,0 @@ -.TH "SDL_CDOpen" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDOpen \- Opens a CD-ROM drive for access\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_CD *\fBSDL_CDOpen\fP\fR(\fBint drive\fR); -.SH "DESCRIPTION" -.PP -Opens a CD-ROM drive for access\&. It returns a \fI\fBSDL_CD\fR\fR structure on success, or \fBNULL\fP if the drive was invalid or busy\&. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a \fBNULL\fP CD-ROM handle\&. -.PP -Drives are numbered starting with 0\&. Drive 0 is the system default CD-ROM\&. -.SH "EXAMPLES" -.PP -.nf -\f(CWSDL_CD *cdrom; -int cur_track; -int min, sec, frame; -SDL_Init(SDL_INIT_CDROM); -atexit(SDL_Quit); - -/* Check for CD drives */ -if(!SDL_CDNumDrives()){ - /* None found */ - fprintf(stderr, "No CDROM devices available -"); - exit(-1); -} - -/* Open the default drive */ -cdrom=SDL_CDOpen(0); - -/* Did if open? Check if cdrom is NULL */ -if(!cdrom){ - fprintf(stderr, "Couldn\&'t open drive: %s -", SDL_GetError()); - exit(-1); -} - -/* Print Volume info */ -printf("Name: %s -", SDL_CDName(0)); -printf("Tracks: %d -", cdrom->numtracks); -for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){ - FRAMES_TO_MSF(cdrom->track[cur_track]\&.length, &min, &sec, &frame); - printf(" Track %d: Length %d:%d -", cur_track, min, sec); -} - -SDL_CDClose(cdrom);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CD\fR\fR, \fI\fBSDL_CDtrack\fR\fR, \fI\fBSDL_CDClose\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDPause.3 b/docs/man3/SDL_CDPause.3 deleted file mode 100644 index bca06c06d9..0000000000 --- a/docs/man3/SDL_CDPause.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_CDPause" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDPause \- Pauses a CDROM -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_CDPause\fP\fR(\fBSDL_CD *cdrom\fR); -.SH "DESCRIPTION" -.PP -Pauses play on the given \fBcdrom\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDResume\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDPlay.3 b/docs/man3/SDL_CDPlay.3 deleted file mode 100644 index 39c25ecd65..0000000000 --- a/docs/man3/SDL_CDPlay.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_CDPlay" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDPlay \- Play a CD -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_CDPlay\fP\fR(\fBSDL_CD *cdrom, int start, int length\fR); -.SH "DESCRIPTION" -.PP -Plays the given \fBcdrom\fR, starting a frame \fBstart\fR for \fBlength\fR frames\&. -.SH "RETURN VALUES" -.PP -Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDPlayTracks\fP\fR, \fI\fBSDL_CDStop\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDPlayTracks.3 b/docs/man3/SDL_CDPlayTracks.3 deleted file mode 100644 index 5a403b3426..0000000000 --- a/docs/man3/SDL_CDPlayTracks.3 +++ /dev/null @@ -1,47 +0,0 @@ -.TH "SDL_CDPlayTracks" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDPlayTracks \- Play the given CD track(s) -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_CDPlayTracks\fP\fR(\fBSDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes)\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_CDPlayTracks\fP plays the given CD starting at track \fBstart_track\fR, for \fBntracks\fR tracks\&. -.PP -\fBstart_frame\fR is the frame offset, from the beginning of the \fBstart_track\fR, at which to start\&. \fBnframes\fR is the frame offset, from the beginning of the last track (\fBstart_track\fR+\fBntracks\fR), at which to end playing\&. -.PP -\fBSDL_CDPlayTracks\fP should only be called after calling \fI\fBSDL_CDStatus\fP\fR to get track information about the CD\&. -.PP -.RS -\fBNote: -.PP -Data tracks are ignored\&. -.RE -.SH "RETURN VALUE" -.PP -Returns \fB0\fR, or \fB-1\fR if there was an error\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CW/* assuming cdrom is a previously opened device */ -/* Play the entire CD */ -if(CD_INDRIVE(SDL_CDStatus(cdrom))) - SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); - -/* Play the first track */ -if(CD_INDRIVE(SDL_CDStatus(cdrom))) - SDL_CDPlayTracks(cdrom, 0, 0, 1, 0); - -/* Play first 15 seconds of the 2nd track */ -if(CD_INDRIVE(SDL_CDStatus(cdrom))) - SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);\fR -.fi -.PP - -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDStatus\fP\fR, \fI\fBSDL_CD\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDResume.3 b/docs/man3/SDL_CDResume.3 deleted file mode 100644 index 86f6c2df35..0000000000 --- a/docs/man3/SDL_CDResume.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_CDResume" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDResume \- Resumes a CDROM -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_CDResume\fP\fR(\fBSDL_CD *cdrom\fR); -.SH "DESCRIPTION" -.PP -Resumes play on the given \fBcdrom\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDPause\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDStatus.3 b/docs/man3/SDL_CDStatus.3 deleted file mode 100644 index 77eed7263f..0000000000 --- a/docs/man3/SDL_CDStatus.3 +++ /dev/null @@ -1,59 +0,0 @@ -.TH "SDL_CDStatus" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDStatus \- Returns the current status of the given drive\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBCDstatus \fBSDL_CDStatus\fP\fR(\fBSDL_CD *cdrom\fR); -\fB/* Given a status, returns true if there\&'s a disk in the drive */ -#define CD_INDRIVE(status) ((int)status > 0) -.SH "DESCRIPTION" -.PP -This function returns the current status of the given drive\&. Status is described like so: -.PP -.nf -\f(CWtypedef enum { - CD_TRAYEMPTY, - CD_STOPPED, - CD_PLAYING, - CD_PAUSED, - CD_ERROR = -1 -} CDstatus;\fR -.fi -.PP -.PP -If the drive has a CD in it, the table of contents of the CD and current play position of the CD will be stored in the SDL_CD structure\&. -.PP -The macro \fBCD_INDRIVE\fP is provided for convenience, and given a status returns true if there\&'s a disk in the drive\&. -.PP -.RS -\fBNote: -.PP -\fBSDL_CDStatus\fP also updates the \fI\fBSDL_CD\fR\fR structure passed to it\&. -.RE -.SH "EXAMPLE" -.PP -.nf -\f(CWint playTrack(int track) -{ - int playing = 0; - - if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { - /* clamp to the actual number of tracks on the CD */ - if (track >= cdrom->numtracks) { - track = cdrom->numtracks-1; - } - - if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) { - playing = 1; - } - } - return playing; -}\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CD\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_CDStop.3 b/docs/man3/SDL_CDStop.3 deleted file mode 100644 index 61e2b23d40..0000000000 --- a/docs/man3/SDL_CDStop.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_CDStop" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDStop \- Stops a CDROM -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_CDStop\fP\fR(\fBSDL_CD *cdrom\fR); -.SH "DESCRIPTION" -.PP -Stops play on the given \fBcdrom\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CDPlay\fP\fR, -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_CDtrack.3 b/docs/man3/SDL_CDtrack.3 deleted file mode 100644 index fdac6eeae2..0000000000 --- a/docs/man3/SDL_CDtrack.3 +++ /dev/null @@ -1,40 +0,0 @@ -.TH "SDL_CDtrack" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CDtrack \- CD Track Information Structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 id; - Uint8 type; - Uint32 length; - Uint32 offset; -} SDL_CDtrack;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBid\fR -Track number (0-99) -.TP 20 -\fBtype\fR -\fBSDL_AUDIO_TRACK\fP or \fBSDL_DATA_TRACK\fP -.TP 20 -\fBlength\fR -Length, in frames, of this track -.TP 20 -\fBoffset\fR -Frame offset to the beginning of this track -.SH "DESCRIPTION" -.PP -\fBSDL_CDtrack\fR stores data on each track on a CD, its fields should be pretty self explainatory\&. It is a member a the \fI\fBSDL_CD\fR\fR structure\&. -.PP -.RS -\fBNote: -.PP -Frames can be converted to standard timings\&. There are \fBCD_FPS\fP frames per second, so \fBSDL_CDtrack\fR\&.\fBlength\fR/\fBCD_FPS\fP=length_in_seconds\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_CD\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_CloseAudio.3 b/docs/man3/SDL_CloseAudio.3 deleted file mode 100644 index 85ff1a4241..0000000000 --- a/docs/man3/SDL_CloseAudio.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_CloseAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CloseAudio \- Shuts down audio processing and closes the audio device\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_CloseAudio\fP\fR(\fBvoid\fR) -.SH "DESCRIPTION" -.PP -This function shuts down audio processing and closes the audio device\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_OpenAudio\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_Color.3 b/docs/man3/SDL_Color.3 deleted file mode 100644 index e96ee8ae5b..0000000000 --- a/docs/man3/SDL_Color.3 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "SDL_Color" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Color \- Format independent color description -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 unused; -} SDL_Color;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBr\fR -Red intensity -.TP 20 -\fBg\fR -Green intensity -.TP 20 -\fBb\fR -Blue intensity -.TP 20 -\fBunused\fR -Unused -.SH "DESCRIPTION" -.PP -\fBSDL_Color\fR describes a color in a format independent way\&. You can convert a \fBSDL_Color\fR to a pixel value for a certain pixel format using \fI\fBSDL_MapRGB\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_SetColors\fP\fR, \fI\fBSDL_Palette\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CondBroadcast.3 b/docs/man3/SDL_CondBroadcast.3 deleted file mode 100644 index efc50b90b1..0000000000 --- a/docs/man3/SDL_CondBroadcast.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_CondBroadcast" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CondBroadcast \- Restart all threads waiting on a condition variable -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_CondBroadcast\fP\fR(\fBSDL_cond *cond\fR); -.SH "DESCRIPTION" -.PP -Restarts all threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_CondWait\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CondSignal.3 b/docs/man3/SDL_CondSignal.3 deleted file mode 100644 index b09c875438..0000000000 --- a/docs/man3/SDL_CondSignal.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_CondSignal" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CondSignal \- Restart a thread wait on a condition variable -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_CondSignal\fP\fR(\fBSDL_cond *cond\fR); -.SH "DESCRIPTION" -.PP -Restart one of the threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success of \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondBroadcast\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CondWait.3 b/docs/man3/SDL_CondWait.3 deleted file mode 100644 index 642f512bb9..0000000000 --- a/docs/man3/SDL_CondWait.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_CondWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CondWait \- Wait on a condition variable -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_CondWait\fP\fR(\fBSDL_cond *cond, SDL_mutex *mut\fR); -.SH "DESCRIPTION" -.PP -Wait on the condition variable \fBcond\fR and unlock the provided mutex\&. The mutex must the locked before entering this function\&. Returns \fB0\fR when it is signalled, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CondWaitTimeout\fP\fR, \fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_mutexP\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CondWaitTimeout.3 b/docs/man3/SDL_CondWaitTimeout.3 deleted file mode 100644 index 7b3424db15..0000000000 --- a/docs/man3/SDL_CondWaitTimeout.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_CondWaitTimeout" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CondWaitTimeout \- Wait on a condition variable, with timeout -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_CondWaitTimeout\fP\fR(\fBSDL_cond *cond, SDL_mutex *mutex, Uint32 ms\fR); -.SH "DESCRIPTION" -.PP -Wait on the condition variable \fBcond\fR for, at most, \fBms\fR milliseconds\&. \fBmut\fR is unlocked so it must be locked when the function is called\&. Returns \fBSDL_MUTEX_TIMEDOUT\fP if the condition is not signalled in the allotted time, \fB0\fR if it was signalled or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CondWait\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_ConvertAudio.3 b/docs/man3/SDL_ConvertAudio.3 deleted file mode 100644 index 73ef974f8e..0000000000 --- a/docs/man3/SDL_ConvertAudio.3 +++ /dev/null @@ -1,95 +0,0 @@ -.TH "SDL_ConvertAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ConvertAudio \- Convert audio data to a desired audio format\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_ConvertAudio\fP\fR(\fBSDL_AudioCVT *cvt\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_ConvertAudio\fP takes one parameter, \fBcvt\fR, which was previously initilized\&. Initilizing a \fI\fBSDL_AudioCVT\fR\fR is a two step process\&. First of all, the structure must be passed to \fI\fBSDL_BuildAudioCVT\fP\fR along with source and destination format parameters\&. Secondly, the \fBcvt\fR->\fBbuf\fR and \fBcvt\fR->\fBlen\fR fields must be setup\&. \fBcvt\fR->\fBbuf\fR should point to the audio data and \fBcvt\fR->\fBlen\fR should be set to the length of the audio data in bytes\&. Remember, the length of the buffer pointed to by \fBbuf\fR show be \fBlen\fR*\fBlen_mult\fR bytes in length\&. -.PP -Once the \fBSDL_AudioCVT\fRstructure is initilized then we can pass it to \fBSDL_ConvertAudio\fP, which will convert the audio data pointer to by \fBcvt\fR->\fBbuf\fR\&. If \fBSDL_ConvertAudio\fP returned \fB0\fR then the conversion was completed successfully, otherwise \fB-1\fR is returned\&. -.PP -If the conversion completed successfully then the converted audio data can be read from \fBcvt\fR->\fBbuf\fR\&. The amount of valid, converted, audio data in the buffer is equal to \fBcvt\fR->\fBlen\fR*\fBcvt\fR->\fBlen_ratio\fR\&. -.SH "EXAMPLES" -.PP -.nf -\f(CW/* Converting some WAV data to hardware format */ -void my_audio_callback(void *userdata, Uint8 *stream, int len); - -SDL_AudioSpec *desired, *obtained; -SDL_AudioSpec wav_spec; -SDL_AudioCVT wav_cvt; -Uint32 wav_len; -Uint8 *wav_buf; -int ret; - -/* Allocated audio specs */ -desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); -obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); - -/* Set desired format */ -desired->freq=22050; -desired->format=AUDIO_S16LSB; -desired->samples=8192; -desired->callback=my_audio_callback; -desired->userdata=NULL; - -/* Open the audio device */ -if ( SDL_OpenAudio(desired, obtained) < 0 ){ - fprintf(stderr, "Couldn\&'t open audio: %s -", SDL_GetError()); - exit(-1); -} - -free(desired); - -/* Load the test\&.wav */ -if( SDL_LoadWAV("test\&.wav", &wav_spec, &wav_buf, &wav_len) == NULL ){ - fprintf(stderr, "Could not open test\&.wav: %s -", SDL_GetError()); - SDL_CloseAudio(); - free(obtained); - exit(-1); -} - -/* Build AudioCVT */ -ret = SDL_BuildAudioCVT(&wav_cvt, - wav_spec\&.format, wav_spec\&.channels, wav_spec\&.freq, - obtained->format, obtained->channels, obtained->freq); - -/* Check that the convert was built */ -if(ret==-1){ - fprintf(stderr, "Couldn\&'t build converter! -"); - SDL_CloseAudio(); - free(obtained); - SDL_FreeWAV(wav_buf); -} - -/* Setup for conversion */ -wav_cvt\&.buf=(Uint8 *)malloc(wav_len*wav_cvt\&.len_mult); -wav_cvt\&.len=wav_len; -memcpy(wav_cvt\&.buf, wav_buf, wav_len); - -/* We can delete to original WAV data now */ -SDL_FreeWAV(wav_buf); - -/* And now we\&'re ready to convert */ -SDL_ConvertAudio(&wav_cvt); - -/* do whatever */ -\&. -\&. -\&. -\&. - -\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_AudioCVT\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_ConvertSurface.3 b/docs/man3/SDL_ConvertSurface.3 deleted file mode 100644 index cb24e34109..0000000000 --- a/docs/man3/SDL_ConvertSurface.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "SDL_ConvertSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ConvertSurface \- Converts a surface to the same format as another surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL/SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_ConvertSurface\fP\fR(\fBSDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags\fR); -.SH "DESCRIPTION" -.PP -Creates a new surface of the specified format, and then copies and maps the given surface to it\&. If this function fails, it returns \fBNULL\fP\&. -.PP -The \fBflags\fR parameter is passed to \fI\fBSDL_CreateRGBSurface\fP\fR and has those semantics\&. -.PP -This function is used internally by \fI\fBSDL_DisplayFormat\fP\fR\&. -.PP -This function can only be called after SDL_Init\&. -.SH "RETURN VALUE" -.PP -Returns either a pointer to the new surface, or \fBNULL\fP on error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_DisplayFormat\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateCond.3 b/docs/man3/SDL_CreateCond.3 deleted file mode 100644 index e8c289670f..0000000000 --- a/docs/man3/SDL_CreateCond.3 +++ /dev/null @@ -1,31 +0,0 @@ -.TH "SDL_CreateCond" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateCond \- Create a condition variable -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBSDL_cond *\fBSDL_CreateCond\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -Creates a condition variable\&. -.SH "EXAMPLES" -.PP -.nf -\f(CWSDL_cond *cond; - -cond=SDL_CreateCond(); -\&. -\&. -/* Do stuff */ - -\&. -\&. -SDL_DestroyCond(cond);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_DestroyCond\fP\fR, \fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondSignal\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateCursor.3 b/docs/man3/SDL_CreateCursor.3 deleted file mode 100644 index ef205c3d84..0000000000 --- a/docs/man3/SDL_CreateCursor.3 +++ /dev/null @@ -1,120 +0,0 @@ -.TH "SDL_CreateCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateCursor \- Creates a new mouse cursor\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Cursor *\fBSDL_CreateCursor\fP\fR(\fBUint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y\fR); -.SH "DESCRIPTION" -.PP -Create a cursor using the specified \fBdata\fR and \fBmask\fR (in MSB format)\&. The cursor width must be a multiple of 8 bits\&. -.PP -The cursor is created in black and white according to the following: -.TP 20 -\fBData / Mask\fR -\fBResulting pixel on screen\fR -.TP 20 -0 / 1 -White -.TP 20 -1 / 1 -Black -.TP 20 -0 / 0 -Transparent -.TP 20 -1 / 0 -Inverted color if possible, black if not\&. -.PP -Cursors created with this function must be freed with \fISDL_FreeCursor\fR\&. -.SH "EXAMPLE" -.PP -.nf -\f(CW/* Stolen from the mailing list */ -/* Creates a new mouse cursor from an XPM */ - - -/* XPM */ -static const char *arrow[] = { - /* width height num_colors chars_per_pixel */ - " 32 32 3 1", - /* colors */ - "X c #000000", - "\&. c #ffffff", - " c None", - /* pixels */ - "X ", - "XX ", - "X\&.X ", - "X\&.\&.X ", - "X\&.\&.\&.X ", - "X\&.\&.\&.\&.X ", - "X\&.\&.\&.\&.\&.X ", - "X\&.\&.\&.\&.\&.\&.X ", - "X\&.\&.\&.\&.\&.\&.\&.X ", - "X\&.\&.\&.\&.\&.\&.\&.\&.X ", - "X\&.\&.\&.\&.\&.XXXXX ", - "X\&.\&.X\&.\&.X ", - "X\&.X X\&.\&.X ", - "XX X\&.\&.X ", - "X X\&.\&.X ", - " X\&.\&.X ", - " X\&.\&.X ", - " X\&.\&.X ", - " XX ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "0,0" -}; - -static SDL_Cursor *init_system_cursor(const char *image[]) -{ - int i, row, col; - Uint8 data[4*32]; - Uint8 mask[4*32]; - int hot_x, hot_y; - - i = -1; - for ( row=0; row<32; ++row ) { - for ( col=0; col<32; ++col ) { - if ( col % 8 ) { - data[i] <<= 1; - mask[i] <<= 1; - } else { - ++i; - data[i] = mask[i] = 0; - } - switch (image[4+row][col]) { - case \&'X\&': - data[i] |= 0x01; - k[i] |= 0x01; - break; - case \&'\&.\&': - mask[i] |= 0x01; - break; - case \&' \&': - break; - } - } - } - sscanf(image[4+row], "%d,%d", &hot_x, &hot_y); - return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); -}\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_FreeCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateMutex.3 b/docs/man3/SDL_CreateMutex.3 deleted file mode 100644 index c665e1ce78..0000000000 --- a/docs/man3/SDL_CreateMutex.3 +++ /dev/null @@ -1,43 +0,0 @@ -.TH "SDL_CreateMutex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateMutex \- Create a mutex -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBSDL_mutex *\fBSDL_CreateMutex\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -Create a new, unlocked mutex\&. -.SH "EXAMPLES" -.PP -.nf -\f(CWSDL_mutex *mut; - -mut=SDL_CreateMutex(); -\&. -\&. -if(SDL_mutexP(mut)==-1){ - fprintf(stderr, "Couldn\&'t lock mutex -"); - exit(-1); -} -\&. -/* Do stuff while mutex is locked */ -\&. -\&. -if(SDL_mutexV(mut)==-1){ - fprintf(stderr, "Couldn\&'t unlock mutex -"); - exit(-1); -} - -SDL_DestroyMutex(mut); -\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_mutexP\fP\fR, \fI\fBSDL_mutexV\fP\fR, \fI\fBSDL_DestroyMutex\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateRGBSurface.3 b/docs/man3/SDL_CreateRGBSurface.3 deleted file mode 100644 index 142b7b7b7c..0000000000 --- a/docs/man3/SDL_CreateRGBSurface.3 +++ /dev/null @@ -1,69 +0,0 @@ -.TH "SDL_CreateRGBSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateRGBSurface \- Create an empty SDL_Surface -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_CreateRGBSurface\fP\fR(\fBUint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR); -.SH "DESCRIPTION" -.PP -Allocate an empty surface (must be called after \fISDL_SetVideoMode\fR) -.PP -If \fBdepth\fR is 8 bits an empty palette is allocated for the surface, otherwise a \&'packed-pixel\&' \fI\fBSDL_PixelFormat\fR\fR is created using the \fB[RGBA]mask\fR\&'s provided (see \fI\fBSDL_PixelFormat\fR\fR)\&. The \fBflags\fR specifies the type of surface that should be created, it is an OR\&'d combination of the following possible values\&. -.TP 20 -\fBSDL_SWSURFACE\fP -SDL will create the surface in system memory\&. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting\&. -.TP 20 -\fBSDL_HWSURFACE\fP -SDL will attempt to create the surface in video memory\&. This will allow SDL to take advantage of Video->Video blits (which are often accelerated)\&. -.TP 20 -\fBSDL_SRCCOLORKEY\fP -This flag turns on colourkeying for blits from this surface\&. If \fBSDL_HWSURFACE\fP is also specified and colourkeyed blits are hardware-accelerated, then SDL will attempt to place the surface in video memory\&. Use \fI\fBSDL_SetColorKey\fP\fR to set or clear this flag after surface creation\&. -.TP 20 -\fBSDL_SRCALPHA\fP -This flag turns on alpha-blending for blits from this surface\&. If \fBSDL_HWSURFACE\fP is also specified and alpha-blending blits are hardware-accelerated, then the surface will be placed in video memory if possible\&. Use \fI\fBSDL_SetAlpha\fP\fR to set or clear this flag after surface creation\&. -.PP -.RS -\fBNote: -.PP -If an alpha-channel is specified (that is, if \fBAmask\fR is nonzero), then the \fBSDL_SRCALPHA\fP flag is automatically set\&. You may remove this flag by calling \fI\fBSDL_SetAlpha\fP\fR after surface creation\&. -.RE -.SH "RETURN VALUE" -.PP -Returns the created surface, or \fBNULL\fR upon error\&. -.SH "EXAMPLE" -.PP -.nf -\f(CW /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order, - as expected by OpenGL for textures */ - SDL_Surface *surface; - Uint32 rmask, gmask, bmask, amask; - - /* SDL interprets each pixel as a 32-bit number, so our masks must depend - on the endianness (byte order) of the machine */ -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - rmask = 0xff000000; - gmask = 0x00ff0000; - bmask = 0x0000ff00; - amask = 0x000000ff; -#else - rmask = 0x000000ff; - gmask = 0x0000ff00; - bmask = 0x00ff0000; - amask = 0xff000000; -#endif - - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, - rmask, gmask, bmask, amask); - if(surface == NULL) { - fprintf(stderr, "CreateRGBSurface failed: %s -", SDL_GetError()); - exit(1); - }\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateRGBSurfaceFrom\fP\fR, \fI\fBSDL_FreeSurface\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR \fI\fBSDL_SetAlpha\fP\fR \fI\fBSDL_SetColorKey\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateRGBSurfaceFrom.3 b/docs/man3/SDL_CreateRGBSurfaceFrom.3 deleted file mode 100644 index 5330c1b2b0..0000000000 --- a/docs/man3/SDL_CreateRGBSurfaceFrom.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_CreateRGBSurfaceFrom" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateRGBSurfaceFrom \- Create an SDL_Surface from pixel data -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_CreateRGBSurfaceFrom\fP\fR(\fBvoid *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR); -.SH "DESCRIPTION" -.PP -Creates an SDL_Surface from the provided pixel data\&. -.PP -The data stored in \fBpixels\fR is assumed to be of the \fBdepth\fR specified in the parameter list\&. The pixel data is not copied into the \fBSDL_Surface\fR structure so it should not be freed until the surface has been freed with a called to \fISDL_FreeSurface\fR\&. \fBpitch\fR is the length of each scanline in bytes\&. -.PP -See \fI\fBSDL_CreateRGBSurface\fP\fR for a more detailed description of the other parameters\&. -.SH "RETURN VALUE" -.PP -Returns the created surface, or \fBNULL\fR upon error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_FreeSurface\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_CreateSemaphore.3 b/docs/man3/SDL_CreateSemaphore.3 deleted file mode 100644 index b803ead79d..0000000000 --- a/docs/man3/SDL_CreateSemaphore.3 +++ /dev/null @@ -1,32 +0,0 @@ -.TH "SDL_CreateSemaphore" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateSemaphore \- Creates a new semaphore and assigns an initial value to it\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBSDL_sem *\fBSDL_CreateSemaphore\fP\fR(\fBUint32 initial_value\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_CreateSemaphore()\fP creates a new semaphore and initializes it with the value \fBinitial_value\fR\&. Each locking operation on the semaphore by \fISDL_SemWait\fR, \fISDL_SemTryWait\fR or \fISDL_SemWaitTimeout\fR will atomically decrement the semaphore value\&. The locking operation will be blocked if the semaphore value is not positive (greater than zero)\&. Each unlock operation by \fISDL_SemPost\fR will atomically increment the semaphore value\&. -.SH "RETURN VALUE" -.PP -Returns a pointer to an initialized semaphore or \fBNULL\fR if there was an error\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWSDL_sem *my_sem; - -my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE); - -if (my_sem == NULL) { - return CREATE_SEM_FAILED; -}\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateThread.3 b/docs/man3/SDL_CreateThread.3 deleted file mode 100644 index ab9e79ff8d..0000000000 --- a/docs/man3/SDL_CreateThread.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_CreateThread" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateThread \- Creates a new thread of execution that shares its parent\&'s properties\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBSDL_Thread *\fBSDL_CreateThread\fP\fR(\fBint (*fn)(void *), void *data\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_CreateThread\fP creates a new thread of execution that shares all of its parent\&'s global memory, signal handlers, file descriptors, etc, and runs the function \fBfn\fR passed the void pointer \fBdata\fR The thread quits when this function returns\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_KillThread\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_CreateYUVOverlay.3 b/docs/man3/SDL_CreateYUVOverlay.3 deleted file mode 100644 index fda6bc89a8..0000000000 --- a/docs/man3/SDL_CreateYUVOverlay.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "SDL_CreateYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_CreateYUVOverlay \- Create a YUV video overlay -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Overlay *\fBSDL_CreateYUVOverlay\fP\fR(\fBint width, int height, Uint32 format, SDL_Surface *display\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_CreateYUVOverlay\fP creates a YUV overlay of the specified \fBwidth\fR, \fBheight\fR and \fBformat\fR (see \fI\fBSDL_Overlay\fR\fR for a list of available formats), for the provided \fBdisplay\fR\&. A \fI\fBSDL_Overlay\fR\fR structure is returned\&. -.PP -The term \&'overlay\&' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Delay.3 b/docs/man3/SDL_Delay.3 deleted file mode 100644 index bfa80b151d..0000000000 --- a/docs/man3/SDL_Delay.3 +++ /dev/null @@ -1,21 +0,0 @@ -.TH "SDL_Delay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Delay \- Wait a specified number of milliseconds before returning\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_Delay\fP\fR(\fBUint32 ms\fR); -.SH "DESCRIPTION" -.PP -Wait a specified number of milliseconds before returning\&. \fBSDL_Delay\fP will wait at \fIleast\fP the specified time, but possible longer due to OS scheduling\&. -.PP -.RS -\fBNote: -.PP -Count on a delay granularity of \fIat least\fP 10 ms\&. Some platforms have shorter clock ticks but this is the most common\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_AddTimer\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_DestroyCond.3 b/docs/man3/SDL_DestroyCond.3 deleted file mode 100644 index 308b9d0696..0000000000 --- a/docs/man3/SDL_DestroyCond.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_DestroyCond" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_DestroyCond \- Destroy a condition variable -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBvoid \fBSDL_DestroyCond\fP\fR(\fBSDL_cond *cond\fR); -.SH "DESCRIPTION" -.PP -Destroys a condition variable\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateCond\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_DestroyMutex.3 b/docs/man3/SDL_DestroyMutex.3 deleted file mode 100644 index 1582e499c0..0000000000 --- a/docs/man3/SDL_DestroyMutex.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_DestroyMutex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_DestroyMutex \- Destroy a mutex -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBvoid \fBSDL_DestroyMutex\fP\fR(\fBSDL_mutex *mutex\fR); -.SH "DESCRIPTION" -.PP -Destroy a previously \fIcreated\fR mutex\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateMutex\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_DestroySemaphore.3 b/docs/man3/SDL_DestroySemaphore.3 deleted file mode 100644 index 892334fecb..0000000000 --- a/docs/man3/SDL_DestroySemaphore.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "SDL_DestroySemaphore" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_DestroySemaphore \- Destroys a semaphore that was created by \fISDL_CreateSemaphore\fR\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBvoid \fBSDL_DestroySemaphore\fP\fR(\fBSDL_sem *sem\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_DestroySemaphore\fP destroys the semaphore pointed to by \fBsem\fR that was created by \fI\fBSDL_CreateSemaphore\fP\fR\&. It is not safe to destroy a semaphore if there are threads currently blocked waiting on it\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWif (my_sem != NULL) { - SDL_DestroySemaphore(my_sem); - my_sem = NULL; -}\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_DisplayFormat.3 b/docs/man3/SDL_DisplayFormat.3 deleted file mode 100644 index ca16e2a451..0000000000 --- a/docs/man3/SDL_DisplayFormat.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_DisplayFormat" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_DisplayFormat \- Convert a surface to the display format -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_DisplayFormat\fP\fR(\fBSDL_Surface *surface\fR); -.SH "DESCRIPTION" -.PP -This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR -.PP -If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&. -.PP -If you want an alpha channel, see \fISDL_DisplayFormatAlpha\fR\&. -.SH "RETURN VALUE" -.PP -If the conversion fails or runs out of memory, it returns \fBNULL\fR -.SH "SEE ALSO" -.PP -\fI\fBSDL_ConvertSurface\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR \fI\fBSDL_SetAlpha\fP\fR, \fI\fBSDL_SetColorKey\fP\fR, \fI\fBSDL_Surface\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_DisplayFormatAlpha.3 b/docs/man3/SDL_DisplayFormatAlpha.3 deleted file mode 100644 index a87ddd54f1..0000000000 --- a/docs/man3/SDL_DisplayFormatAlpha.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_DisplayFormatAlpha" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_DisplayFormatAlpha \- Convert a surface to the display format -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_DisplayFormatAlpha\fP\fR(\fBSDL_Surface *surface\fR); -.SH "DESCRIPTION" -.PP -This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer plus an alpha channel, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR -.PP -If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&. -.PP -This function can be used to convert a colourkey to an alpha channel, if the \fBSDL_SRCCOLORKEY\fP flag is set on the surface\&. The generated surface will then be transparent (alpha=0) where the pixels match the colourkey, and opaque (alpha=255) elsewhere\&. -.SH "RETURN VALUE" -.PP -If the conversion fails or runs out of memory, it returns \fBNULL\fR -.SH "SEE ALSO" -.PP -\fISDL_ConvertSurface\fR, \fISDL_SetAlpha\fR, \fISDL_SetColorKey\fR, \fISDL_DisplayFormat\fR, \fISDL_Surface\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_DisplayYUVOverlay.3 b/docs/man3/SDL_DisplayYUVOverlay.3 deleted file mode 100644 index d89d94cc37..0000000000 --- a/docs/man3/SDL_DisplayYUVOverlay.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_DisplayYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_DisplayYUVOverlay \- Blit the overlay to the display -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_DisplayYUVOverlay\fP\fR(\fBSDL_Overlay *overlay, SDL_Rect *dstrect\fR); -.SH "DESCRIPTION" -.PP -Blit the \fBoverlay\fR to the surface specified when it was \fIcreated\fR\&. The \fI\fBSDL_Rect\fR\fR structure, \fBdstrect\fR, specifies the position and size of the destination\&. If the \fBdstrect\fR is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling\&. -.SH "RETURN VALUES" -.PP -Returns 0 on success -.SH "SEE ALSO" -.PP -\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_EnableKeyRepeat.3 b/docs/man3/SDL_EnableKeyRepeat.3 deleted file mode 100644 index ea4b231b96..0000000000 --- a/docs/man3/SDL_EnableKeyRepeat.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "SDL_EnableKeyRepeat" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_EnableKeyRepeat \- Set keyboard repeat rate\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_EnableKeyRepeat\fP\fR(\fBint delay, int interval\fR); -.SH "DESCRIPTION" -.PP -Enables or disables the keyboard repeat rate\&. \fBdelay\fR specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by \fBinterval\fR\&. Both \fBdelay\fR and \fBinterval\fR are expressed in milliseconds\&. -.PP -Setting \fBdelay\fR to 0 disables key repeating completely\&. Good default values are \fBSDL_DEFAULT_REPEAT_DELAY\fP and \fISDL_DEFAULT_REPEAT_INTERVAL\fP\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success and \fB-1\fR on failure\&. -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_EnableUNICODE.3 b/docs/man3/SDL_EnableUNICODE.3 deleted file mode 100644 index d9d2027009..0000000000 --- a/docs/man3/SDL_EnableUNICODE.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "SDL_EnableUNICODE" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_EnableUNICODE \- Enable UNICODE translation -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_EnableUNICODE\fP\fR(\fBint enable\fR); -.SH "DESCRIPTION" -.PP -Enables/Disables Unicode keyboard translation\&. -.PP -To obtain the character codes corresponding to received keyboard events, Unicode translation must first be turned on using this function\&. The translation incurs a slight overhead for each keyboard event and is therefore disabled by default\&. For each subsequently received key down event, the \fBunicode\fR member of the \fI\fBSDL_keysym\fR\fR structure will then contain the corresponding character code, or zero for keysyms that do not correspond to any character code\&. -.PP -A value of 1 for \fBenable\fR enables Unicode translation; 0 disables it, and -1 leaves it unchanged (useful for querying the current translation mode)\&. -.PP -Note that only key press events will be translated, not release events\&. -.SH "RETURN VALUE" -.PP -Returns the previous translation mode (\fB0\fR or \fB1\fR)\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_keysym\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_Event.3 b/docs/man3/SDL_Event.3 deleted file mode 100644 index b508f19db8..0000000000 --- a/docs/man3/SDL_Event.3 +++ /dev/null @@ -1,182 +0,0 @@ -.TH "SDL_Event" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Event \- General event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef union{ - Uint8 type; - SDL_ActiveEvent active; - SDL_KeyboardEvent key; - SDL_MouseMotionEvent motion; - SDL_MouseButtonEvent button; - SDL_JoyAxisEvent jaxis; - SDL_JoyBallEvent jball; - SDL_JoyHatEvent jhat; - SDL_JoyButtonEvent jbutton; - SDL_ResizeEvent resize; - SDL_ExposeEvent expose; - SDL_QuitEvent quit; - SDL_UserEvent user; - SDL_SysWMEvent syswm; -} SDL_Event;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -The type of event -.TP 20 -\fBactive\fR -\fIActivation event\fR -.TP 20 -\fBkey\fR -\fIKeyboard event\fR -.TP 20 -\fBmotion\fR -\fIMouse motion event\fR -.TP 20 -\fBbutton\fR -\fIMouse button event\fR -.TP 20 -\fBjaxis\fR -\fIJoystick axis motion event\fR -.TP 20 -\fBjball\fR -\fIJoystick trackball motion event\fR -.TP 20 -\fBjhat\fR -\fIJoystick hat motion event\fR -.TP 20 -\fBjbutton\fR -\fIJoystick button event\fR -.TP 20 -\fBresize\fR -\fIApplication window resize event\fR -.TP 20 -\fBexpose\fR -\fIApplication window expose event\fR -.TP 20 -\fBquit\fR -\fIApplication quit request event\fR -.TP 20 -\fBuser\fR -\fIUser defined event\fR -.TP 20 -\fBsyswm\fR -\fIUndefined window manager event\fR -.SH "DESCRIPTION" -.PP -The \fBSDL_Event\fR union is the core to all event handling is SDL, its probably the most important structure after \fBSDL_Surface\fR\&. \fBSDL_Event\fR is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event \fBtype\fR\&. -.PP -.TP 20 -\fBEvent \fBtype\fR\fR -\fBEvent Structure\fR -.TP 20 -\fBSDL_ACTIVEEVENT\fP -\fI\fBSDL_ActiveEvent\fR\fR -.TP 20 -\fBSDL_KEYDOWN/UP\fP -\fI\fBSDL_KeyboardEvent\fR\fR -.TP 20 -\fBSDL_MOUSEMOTION\fP -\fI\fBSDL_MouseMotionEvent\fR\fR -.TP 20 -\fBSDL_MOUSEBUTTONDOWN/UP\fP -\fI\fBSDL_MouseButtonEvent\fR\fR -.TP 20 -\fBSDL_JOYAXISMOTION\fP -\fI\fBSDL_JoyAxisEvent\fR\fR -.TP 20 -\fBSDL_JOYBALLMOTION\fP -\fI\fBSDL_JoyBallEvent\fR\fR -.TP 20 -\fBSDL_JOYHATMOTION\fP -\fI\fBSDL_JoyHatEvent\fR\fR -.TP 20 -\fBSDL_JOYBUTTONDOWN/UP\fP -\fI\fBSDL_JoyButtonEvent\fR\fR -.TP 20 -\fBSDL_QUIT\fP -\fI\fBSDL_QuitEvent\fR\fR -.TP 20 -\fBSDL_SYSWMEVENT\fP -\fI\fBSDL_SysWMEvent\fR\fR -.TP 20 -\fBSDL_VIDEORESIZE\fP -\fI\fBSDL_ResizeEvent\fR\fR -.TP 20 -\fBSDL_VIDEOEXPOSE\fP -\fI\fBSDL_ExposeEvent\fR\fR -.TP 20 -\fBSDL_USEREVENT\fP -\fI\fBSDL_UserEvent\fR\fR -.SH "USE" -.PP -The \fBSDL_Event\fR structure has two uses -.IP " \(bu" 6 -Reading events on the event queue -.IP " \(bu" 6 -Placing events on the event queue -.PP -Reading events from the event queue is done with either \fI\fBSDL_PollEvent\fP\fR or \fI\fBSDL_PeepEvents\fP\fR\&. We\&'ll use \fBSDL_PollEvent\fP and step through an example\&. -.PP -First off, we create an empty \fBSDL_Event\fR structure\&. -.PP -.nf -\f(CWSDL_Event test_event;\fR -.fi -.PP - \fBSDL_PollEvent\fP removes the next event from the event queue, if there are no events on the queue it returns \fB0\fR otherwise it returns \fB1\fR\&. We use a \fBwhile\fP loop to process each event in turn\&. -.PP -.nf -\f(CWwhile(SDL_PollEvent(&test_event)) {\fR -.fi -.PP - The \fBSDL_PollEvent\fP function take a pointer to an \fBSDL_Event\fR structure that is to be filled with event information\&. We know that if \fBSDL_PollEvent\fP removes an event from the queue then the event information will be placed in our \fBtest_event\fR structure, but we also know that the \fItype\fP of event will be placed in the \fBtype\fR member of \fBtest_event\fR\&. So to handle each event \fBtype\fR seperately we use a \fBswitch\fP statement\&. -.PP -.nf -\f(CW switch(test_event\&.type) {\fR -.fi -.PP - We need to know what kind of events we\&'re looking for \fIand\fP the event \fBtype\fR\&'s of those events\&. So lets assume we want to detect where the user is moving the mouse pointer within our application\&. We look through our event types and notice that \fBSDL_MOUSEMOTION\fP is, more than likely, the event we\&'re looking for\&. A little \fImore\fR research tells use that \fBSDL_MOUSEMOTION\fP events are handled within the \fI\fBSDL_MouseMotionEvent\fR\fR structure which is the \fBmotion\fR member of \fBSDL_Event\fR\&. We can check for the \fBSDL_MOUSEMOTION\fP event \fBtype\fR within our \fBswitch\fP statement like so: -.PP -.nf -\f(CW case SDL_MOUSEMOTION:\fR -.fi -.PP - All we need do now is read the information out of the \fBmotion\fR member of \fBtest_event\fR\&. -.PP -.nf -\f(CW printf("We got a motion event\&. -"); - printf("Current mouse position is: (%d, %d) -", test_event\&.motion\&.x, test_event\&.motion\&.y); - break; - default: - printf("Unhandled Event! -"); - break; - } -} -printf("Event queue empty\&. -");\fR -.fi -.PP -.PP -It is also possible to push events onto the event queue and so use it as a two-way communication path\&. Both \fI\fBSDL_PushEvent\fP\fR and \fI\fBSDL_PeepEvents\fP\fR allow you to place events onto the event queue\&. This is usually used to place a \fBSDL_USEREVENT\fP on the event queue, however you could use it to post fake input events if you wished\&. Creating your own events is a simple matter of choosing the event type you want, setting the \fBtype\fR member and filling the appropriate member structure with information\&. -.PP -.nf -\f(CWSDL_Event user_event; - -user_event\&.type=SDL_USEREVENT; -user_event\&.user\&.code=2; -user_event\&.user\&.data1=NULL; -user_event\&.user\&.data2=NULL; -SDL_PushEvent(&user_event);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PushEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_EventState.3 b/docs/man3/SDL_EventState.3 deleted file mode 100644 index 5ee6ab56ad..0000000000 --- a/docs/man3/SDL_EventState.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "SDL_EventState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_EventState \- This function allows you to set the state of processing certain events\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint8 \fBSDL_EventState\fP\fR(\fBUint8 type, int state\fR); -.SH "DESCRIPTION" -.PP -This function allows you to set the state of processing certain event \fBtype\fR\&'s\&. -.PP -If \fBstate\fR is set to \fBSDL_IGNORE\fP, that event \fBtype\fR will be automatically dropped from the event queue and will not be filtered\&. -.PP -If \fBstate\fR is set to \fBSDL_ENABLE\fP, that event \fBtype\fR will be processed normally\&. -.PP -If \fBstate\fR is set to \fBSDL_QUERY\fP, \fBSDL_EventState\fP will return the current processing state of the specified event \fBtype\fR\&. -.PP -A list of event \fBtype\fR\&'s can be found in the \fI\fBSDL_Event\fR\fR section\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_ExposeEvent.3 b/docs/man3/SDL_ExposeEvent.3 deleted file mode 100644 index e1aa5c30f8..0000000000 --- a/docs/man3/SDL_ExposeEvent.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "SDL_ExposeEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ExposeEvent \- Quit requested event -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type -} SDL_ExposeEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_VIDEOEXPOSE\fP -.SH "DESCRIPTION" -.PP -\fBSDL_ExposeEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used whan an event of type \fBSDL_VIDEOEXPOSE\fP is reported\&. -.PP -A VIDEOEXPOSE event is triggered when the screen has been modified outside of the application, usually by the window manager and needs to be redrawn\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_FillRect.3 b/docs/man3/SDL_FillRect.3 deleted file mode 100644 index c2b83abaf3..0000000000 --- a/docs/man3/SDL_FillRect.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_FillRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_FillRect \- This function performs a fast fill of the given rectangle with some color -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_FillRect\fP\fR(\fBSDL_Surface *dst, SDL_Rect *dstrect, Uint32 color\fR); -.SH "DESCRIPTION" -.PP -This function performs a fast fill of the given rectangle with \fBcolor\fR\&. If \fBdstrect\fR is \fBNULL\fP, the whole surface will be filled with \fBcolor\fR\&. -.PP -The color should be a pixel of the format used by the surface, and can be generated by the \fISDL_MapRGB\fR or \fISDL_MapRGBA\fR functions\&. If the color value contains an alpha value then the destination is simply "filled" with that alpha information, no blending takes place\&. -.PP -If there is a clip rectangle set on the destination (set via \fISDL_SetClipRect\fR) then this function will clip based on the intersection of the clip rectangle and the \fBdstrect\fR rectangle and the dstrect rectangle will be modified to represent the area actually filled\&. -.SH "RETURN VALUE" -.PP -This function returns \fB0\fR on success, or \fB-1\fR on error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Rect\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Flip.3 b/docs/man3/SDL_Flip.3 deleted file mode 100644 index b3b2d65dc0..0000000000 --- a/docs/man3/SDL_Flip.3 +++ /dev/null @@ -1,20 +0,0 @@ -.TH "SDL_Flip" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Flip \- Swaps screen buffers -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_Flip\fP\fR(\fBSDL_Surface *screen\fR); -.SH "DESCRIPTION" -.PP -On hardware that supports double-buffering, this function sets up a flip and returns\&. The hardware will wait for vertical retrace, and then swap video buffers before the next video surface blit or lock will return\&. On hardware that doesn\&'t support double-buffering, this is equivalent to calling \fISDL_UpdateRect\fR\fB(screen, 0, 0, 0, 0)\fR -.PP -The \fBSDL_DOUBLEBUF\fP flag must have been passed to \fISDL_SetVideoMode\fR, when setting the video mode for this function to perform hardware flipping\&. -.SH "RETURN VALUE" -.PP -This function returns \fB0\fR if successful, or \fB-1\fR if there was an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_UpdateRect\fP\fR, \fI\fBSDL_Surface\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_FreeCursor.3 b/docs/man3/SDL_FreeCursor.3 deleted file mode 100644 index 22277ea496..0000000000 --- a/docs/man3/SDL_FreeCursor.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_FreeCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_FreeCursor \- Frees a cursor created with SDL_CreateCursor\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_FreeCursor\fP\fR(\fBSDL_Cursor *cursor\fR); -.SH "DESCRIPTION" -.PP -Frees a \fBSDL_Cursor\fR that was created using \fISDL_CreateCursor\fR\&. -.SH "SEE ALSO" -.PP -\fISDL_CreateCursor\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_FreeSurface.3 b/docs/man3/SDL_FreeSurface.3 deleted file mode 100644 index d8491392f0..0000000000 --- a/docs/man3/SDL_FreeSurface.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_FreeSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_FreeSurface \- Frees (deletes) a SDL_Surface -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_FreeSurface\fP\fR(\fBSDL_Surface *surface\fR); -.SH "DESCRIPTION" -.PP -Frees the resources used by a previously created \fBSDL_Surface\fR\&. If the surface was created using \fISDL_CreateRGBSurfaceFrom\fR then the pixel data is not freed\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateRGBSurface\fP\fR \fI\fBSDL_CreateRGBSurfaceFrom\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_FreeWAV.3 b/docs/man3/SDL_FreeWAV.3 deleted file mode 100644 index a7cd1483c0..0000000000 --- a/docs/man3/SDL_FreeWAV.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_FreeWAV" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_FreeWAV \- Frees previously opened WAV data -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_FreeWAV\fP\fR(\fBUint8 *audio_buf\fR); -.SH "DESCRIPTION" -.PP -After a WAVE file has been opened with \fI\fBSDL_LoadWAV\fP\fR its data can eventually be freed with \fBSDL_FreeWAV\fP\&. \fBaudio_buf\fR is a pointer to the buffer created by \fBSDL_LoadWAV\fP\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_LoadWAV\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_FreeYUVOverlay.3 b/docs/man3/SDL_FreeYUVOverlay.3 deleted file mode 100644 index 3971a93fda..0000000000 --- a/docs/man3/SDL_FreeYUVOverlay.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_FreeYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_FreeYUVOverlay \- Free a YUV video overlay -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_FreeYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR); -.SH "DESCRIPTION" -.PP -Frees and \fI\fBoverlay\fR\fR created by \fI\fBSDL_CreateYUVOverlay\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_GetAttribute.3 b/docs/man3/SDL_GL_GetAttribute.3 deleted file mode 100644 index 9135da283c..0000000000 --- a/docs/man3/SDL_GL_GetAttribute.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_GL_GetAttribute" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GL_GetAttribute \- Get the value of a special SDL/OpenGL attribute -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_GL_GetAttribute\fP\fR(\fBSDLGLattr attr, int *value\fR); -.SH "DESCRIPTION" -.PP -Places the value of the SDL/OpenGL \fIattribute\fR \fBattr\fR into \fBvalue\fR\&. This is useful after a call to \fI\fBSDL_SetVideoMode\fP\fR to check whether your attributes have been \fIset\fR as you expected\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GL_SetAttribute\fP\fR, \fIGL Attributes\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_GetProcAddress.3 b/docs/man3/SDL_GL_GetProcAddress.3 deleted file mode 100644 index 4fcc7a40b5..0000000000 --- a/docs/man3/SDL_GL_GetProcAddress.3 +++ /dev/null @@ -1,48 +0,0 @@ -.TH "SDL_GL_GetProcAddress" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GL_GetProcAddress \- Get the address of a GL function -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid *\fBSDL_GL_GetProcAddress\fP\fR(\fBconst char* proc\fR); -.SH "DESCRIPTION" -.PP -Returns the address of the GL function \fBproc\fR, or \fBNULL\fR if the function is not found\&. If the GL library is loaded at runtime, with \fI\fBSDL_GL_LoadLibrary\fP\fR, then \fIall\fP GL functions must be retrieved this way\&. Usually this is used to retrieve function pointers to OpenGL extensions\&. -.SH "EXAMPLE" -.PP -.nf -\f(CWtypedef void (*GL_ActiveTextureARB_Func)(unsigned int); -GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0; -int has_multitexture=1; -\&. -\&. -\&. -/* Get function pointer */ -glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB"); - -/* Check for a valid function ptr */ -if(!glActiveTextureARB_ptr){ - fprintf(stderr, "Multitexture Extensions not present\&. -"); - has_multitexture=0; -} -\&. -\&. -\&. -\&. -if(has_multitexture){ - glActiveTextureARB_ptr(GL_TEXTURE0_ARB); - \&. - \&. -} -else{ - \&. - \&. -}\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_GL_LoadLibrary\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_LoadLibrary.3 b/docs/man3/SDL_GL_LoadLibrary.3 deleted file mode 100644 index e6544c9ca4..0000000000 --- a/docs/man3/SDL_GL_LoadLibrary.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GL_LoadLibrary" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GL_LoadLibrary \- Specify an OpenGL library -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_GL_LoadLibrary\fP\fR(\fBconst char *path\fR); -.SH "DESCRIPTION" -.PP -If you wish, you may load the OpenGL library at runtime, this must be done before \fI\fBSDL_SetVideoMode\fP\fR is called\&. The \fBpath\fR of the GL library is passed to \fBSDL_GL_LoadLibrary\fP and it returns \fB0\fR on success, or \fB-1\fR on an error\&. You must then use \fI\fBSDL_GL_GetProcAddress\fP\fR to retrieve function pointers to GL functions\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GL_GetProcAddress\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_SetAttribute.3 b/docs/man3/SDL_GL_SetAttribute.3 deleted file mode 100644 index deb38e71b9..0000000000 --- a/docs/man3/SDL_GL_SetAttribute.3 +++ /dev/null @@ -1,40 +0,0 @@ -.TH "SDL_GL_SetAttribute" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GL_SetAttribute \- Set a special SDL/OpenGL attribute -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_GL_SetAttribute\fP\fR(\fBSDL_GLattr attr, int value\fR); -.SH "DESCRIPTION" -.PP -Sets the OpenGL \fIattribute\fR \fBattr\fR to \fBvalue\fR\&. The attributes you set don\&'t take effect until after a call to \fI\fBSDL_SetVideoMode\fP\fR\&. You should use \fI\fBSDL_GL_GetAttribute\fP\fR to check the values after a \fBSDL_SetVideoMode\fP call\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success, or \fB-1\fR on error\&. -.SH "EXAMPLE" -.PP -.nf -\f(CWSDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 ); -SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 ); -SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 ); -SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); -SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); -if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) { - fprintf(stderr, "Couldn\&'t set GL mode: %s -", SDL_GetError()); - SDL_Quit(); - return; -}\fR -.fi -.PP -.PP -.RS -\fBNote: -.PP -The \fBSDL_DOUBLEBUF\fP flag is not required to enable double buffering when setting an OpenGL video mode\&. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_GL_GetAttribute\fP\fR, \fIGL Attributes\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GL_SwapBuffers.3 b/docs/man3/SDL_GL_SwapBuffers.3 deleted file mode 100644 index 31d31cf3ee..0000000000 --- a/docs/man3/SDL_GL_SwapBuffers.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GL_SwapBuffers" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GL_SwapBuffers \- Swap OpenGL framebuffers/Update Display -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_GL_SwapBuffers\fP\fR(\fBvoid \fR); -.SH "DESCRIPTION" -.PP -Swap the OpenGL buffers, if double-buffering is supported\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GL_SetAttribute\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GLattr.3 b/docs/man3/SDL_GLattr.3 deleted file mode 100644 index 23d3726259..0000000000 --- a/docs/man3/SDL_GLattr.3 +++ /dev/null @@ -1,47 +0,0 @@ -.TH "SDL_GLattr" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GLattr \- SDL GL Attributes -.SH "ATTRIBUTES" -.TP 20 -\fBSDL_GL_RED_SIZE\fP -Size of the framebuffer red component, in bits -.TP 20 -\fBSDL_GL_GREEN_SIZE\fP -Size of the framebuffer green component, in bits -.TP 20 -\fBSDL_GL_BLUE_SIZE\fP -Size of the framebuffer blue component, in bits -.TP 20 -\fBSDL_GL_ALPHA_SIZE\fP -Size of the framebuffer alpha component, in bits -.TP 20 -\fBSDL_GL_DOUBLEBUFFER\fP -0 or 1, enable or disable double buffering -.TP 20 -\fBSDL_GL_BUFFER_SIZE\fP -Size of the framebuffer, in bits -.TP 20 -\fBSDL_GL_DEPTH_SIZE\fP -Size of the depth buffer, in bits -.TP 20 -\fBSDL_GL_STENCIL_SIZE\fP -Size of the stencil buffer, in bits -.TP 20 -\fBSDL_GL_ACCUM_RED_SIZE\fP -Size of the accumulation buffer red component, in bits -.TP 20 -\fBSDL_GL_ACCUM_GREEN_SIZE\fP -Size of the accumulation buffer green component, in bits -.TP 20 -\fBSDL_GL_ACCUM_BLUE_SIZE\fP -Size of the accumulation buffer blue component, in bits -.TP 20 -\fBSDL_GL_ACCUM_ALPHA_SIZE\fP -Size of the accumulation buffer alpha component, in bits -.SH "DESCRIPTION" -.PP -While you can set most OpenGL attributes normally, the attributes list above must be known \fIbefore\fP SDL sets the video mode\&. These attributes a set and read with \fI\fBSDL_GL_SetAttribute\fP\fR and \fI\fBSDL_GL_GetAttribute\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GL_SetAttribute\fP\fR, \fI\fBSDL_GL_GetAttribute\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetAppState.3 b/docs/man3/SDL_GetAppState.3 deleted file mode 100644 index 9d644a142a..0000000000 --- a/docs/man3/SDL_GetAppState.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "SDL_GetAppState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -\fBSDL_GetAppState\fP \- Get the state of the application -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint8 \fBSDL_GetAppState\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -This function returns the current state of the application\&. The value returned is a bitwise combination of: -.TP 20 -\fBSDL_APPMOUSEFOCUS\fP -The application has mouse focus\&. -.TP 20 -\fBSDL_APPINPUTFOCUS\fP -The application has keyboard focus -.TP 20 -\fBSDL_APPACTIVE\fP -The application is visible -.SH "SEE ALSO" -.PP -\fI\fBSDL_ActiveEvent\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetAudioStatus.3 b/docs/man3/SDL_GetAudioStatus.3 deleted file mode 100644 index 9895c9556c..0000000000 --- a/docs/man3/SDL_GetAudioStatus.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "SDL_GetAudioStatus" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetAudioStatus \- Get the current audio state -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_audiostatus\fBSDL_GetAudioStatus\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -.nf -\f(CWtypedef enum{ - SDL_AUDIO_STOPPED, - SDL_AUDIO_PAUSED, - SDL_AUDIO_PLAYING -} SDL_audiostatus;\fR -.fi -.PP -.PP -Returns either \fBSDL_AUDIO_STOPPED\fP, \fBSDL_AUDIO_PAUSED\fP or \fBSDL_AUDIO_PLAYING\fP depending on the current audio state\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_PauseAudio\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_GetClipRect.3 b/docs/man3/SDL_GetClipRect.3 deleted file mode 100644 index b911ff6b41..0000000000 --- a/docs/man3/SDL_GetClipRect.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "SDL_GetClipRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetClipRect \- Gets the clipping rectangle for a surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_GetClipRect\fP\fR(\fBSDL_Surface *surface, SDL_Rect *rect\fR); -.SH "DESCRIPTION" -.PP -Gets the clipping rectangle for a surface\&. When this surface is the destination of a blit, only the area within the clip rectangle is drawn into\&. -.PP -The rectangle pointed to by \fBrect\fR will be filled with the clipping rectangle of the surface\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetClipRect\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Surface\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetCursor.3 b/docs/man3/SDL_GetCursor.3 deleted file mode 100644 index ce5ba72a90..0000000000 --- a/docs/man3/SDL_GetCursor.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GetCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetCursor \- Get the currently active mouse cursor\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Cursor *\fBSDL_GetCursor\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -Returns the currently active mouse cursor\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetError.3 b/docs/man3/SDL_GetError.3 deleted file mode 100644 index ecdb98cf1e..0000000000 --- a/docs/man3/SDL_GetError.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GetError" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetError \- Get SDL error string -.SH "SYNOPSIS" -.PP -\fB#include "SDL/SDL\&.h" -.sp -\fBchar *\fBSDL_GetError\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_GetError\fP returns a NULL terminated string containing information about the last internal SDL error\&. -.SH "RETURN VALUE" -.PP -\fBSDL_GetError\fP returns a string containing the last error\&. -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_GetEventFilter.3 b/docs/man3/SDL_GetEventFilter.3 deleted file mode 100644 index 41bf33795c..0000000000 --- a/docs/man3/SDL_GetEventFilter.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "SDL_GetEventFilter" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetEventFilter \- Retrieves a pointer to he event filter -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_EventFilter \fBSDL_GetEventFilter\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -This function retrieces a pointer to the event filter that was previously set using \fI\fBSDL_SetEventFilter\fP\fR\&. An SDL_EventFilter function is defined as: -.PP -.nf -\f(CWtypedef int (*SDL_EventFilter)(const SDL_Event *event);\fR -.fi -.PP -.SH "RETURN VALUE" -.PP -Returns a pointer to the event filter or \fBNULL\fP if no filter has been set\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetGamma.3 b/docs/man3/SDL_GetGamma.3 deleted file mode 100644 index f3493aa8e0..0000000000 --- a/docs/man3/SDL_GetGamma.3 +++ /dev/null @@ -1,21 +0,0 @@ -.TH "SDL_GetGamma" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetGamma \- Gets the gamma of the display -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_GetGamma\fP\fR(\fBfloat *red, float *green, float *blue\fR); -.SH "DESCRIPTION" -.PP -Gets the color gamma of the display\&. The gamma value for each color component will be place in the parameters \fBred\fR, \fBgreen\fR and \fBblue\fR\&. The values can range from 0\&.1 to 10\&. -.PP -.RS -\fBNote: -.PP -This function currently only works on XFreee 4\&.0 and up\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetGamma\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetGammaRamp.3 b/docs/man3/SDL_GetGammaRamp.3 deleted file mode 100644 index c1116d52e6..0000000000 --- a/docs/man3/SDL_GetGammaRamp.3 +++ /dev/null @@ -1,20 +0,0 @@ -.TH "SDL_GetGammaRamp" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetGammaRamp \- Gets the color gamma lookup tables for the display -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_GetGammaRamp\fP\fR(\fBUint16 *redtable, Uint16 *greentable, Uint16 *bluetable\fR); -.SH "DESCRIPTION" -.PP -Gets the gamma translation lookup tables currently used by the display\&. Each table is an array of 256 Uint16 values\&. -.PP -Not all display hardware is able to change gamma\&. -.SH "RETURN VALUE" -.PP -Returns -1 on error\&. -.SH "SEE ALSO" -.PP -\fISDL_SetGamma\fR \fISDL_SetGammaRamp\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetKeyName.3 b/docs/man3/SDL_GetKeyName.3 deleted file mode 100644 index fc76ca8fa5..0000000000 --- a/docs/man3/SDL_GetKeyName.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GetKeyName" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetKeyName \- Get the name of an SDL virtual keysym -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBchar *\fBSDL_GetKeyName\fP\fR(\fBSDLKey key\fR); -.SH "DESCRIPTION" -.PP -Returns the SDL-defined name of the \fI\fBSDLKey\fR\fR \fBkey\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDLKey\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetKeyState.3 b/docs/man3/SDL_GetKeyState.3 deleted file mode 100644 index f679c81c61..0000000000 --- a/docs/man3/SDL_GetKeyState.3 +++ /dev/null @@ -1,30 +0,0 @@ -.TH "SDL_GetKeyState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetKeyState \- Get a snapshot of the current keyboard state -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint8 *\fBSDL_GetKeyState\fP\fR(\fBint *numkeys\fR); -.SH "DESCRIPTION" -.PP -Gets a snapshot of the current keyboard state\&. The current state is return as a pointer to an array, the size of this array is stored in \fBnumkeys\fR\&. The array is indexed by the \fI\fBSDLK_*\fP\fR symbols\&. A value of 1 means the key is pressed and a value of 0 means its not\&. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller\&. -.PP -.RS -\fBNote: -.PP -Use \fI\fBSDL_PumpEvents\fP\fR to update the state array\&. -.RE -.SH "EXAMPLE" -.PP -.PP -.nf -\f(CWUint8 *keystate = SDL_GetKeyState(NULL); -if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed\&. -");\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL Key Symbols\fP\fR, \fI\fBSDL_PumpEvents\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetModState.3 b/docs/man3/SDL_GetModState.3 deleted file mode 100644 index 5cff3d5db8..0000000000 --- a/docs/man3/SDL_GetModState.3 +++ /dev/null @@ -1,54 +0,0 @@ -.TH "SDL_GetModState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetModState \- Get the state of modifier keys\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDLMod \fBSDL_GetModState\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -Returns the current state of the modifier keys (CTRL, ALT, etc\&.)\&. -.SH "RETURN VALUE" -.PP -The return value can be an OR\&'d combination of the SDLMod enum\&. -.PP -.PP -.RS -\fBSDLMod\fR -.PP -.PP -.nf -\f(CWtypedef enum { - KMOD_NONE = 0x0000, - KMOD_LSHIFT= 0x0001, - KMOD_RSHIFT= 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LMETA = 0x0400, - KMOD_RMETA = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, -} SDLMod;\fR -.fi -.PP -.RE - SDL also defines the following symbols for convenience: -.PP -.RS -.PP -.nf -\f(CW#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_META (KMOD_LMETA|KMOD_RMETA)\fR -.fi -.PP -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetKeyState\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetMouseState.3 b/docs/man3/SDL_GetMouseState.3 deleted file mode 100644 index e92aa43977..0000000000 --- a/docs/man3/SDL_GetMouseState.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "SDL_GetMouseState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetMouseState \- Retrieve the current state of the mouse -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint8 \fBSDL_GetMouseState\fP\fR(\fBint *x, int *y\fR); -.SH "DESCRIPTION" -.PP -The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the current mouse cursor position\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&. -.SH "EXAMPLE" -.PP -.nf -\f(CWSDL_PumpEvents(); -if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1)) - printf("Mouse Button 1(left) is pressed\&. -");\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetRelativeMouseState\fP\fR, \fI\fBSDL_PumpEvents\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetRGB.3 b/docs/man3/SDL_GetRGB.3 deleted file mode 100644 index f21a162234..0000000000 --- a/docs/man3/SDL_GetRGB.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "SDL_GetRGB" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetRGB \- Get RGB values from a pixel in the specified pixel format\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_GetRGB\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b\fR); -.SH "DESCRIPTION" -.PP -Get RGB component values from a pixel stored in the specified pixel format\&. -.PP -This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_PixelFormat\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetRGBA.3 b/docs/man3/SDL_GetRGBA.3 deleted file mode 100644 index eba9dfbb23..0000000000 --- a/docs/man3/SDL_GetRGBA.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "SDL_GetRGBA" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetRGBA \- Get RGBA values from a pixel in the specified pixel format\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_GetRGBA\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a\fR); -.SH "DESCRIPTION" -.PP -Get RGBA component values from a pixel stored in the specified pixel format\&. -.PP -This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&. -.PP -If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque)\&. -.SH "SEE ALSO" -.PP -\fISDL_GetRGB\fR, \fISDL_MapRGB\fR, \fISDL_MapRGBA\fR, \fISDL_PixelFormat\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetRelativeMouseState.3 b/docs/man3/SDL_GetRelativeMouseState.3 deleted file mode 100644 index 349f47d819..0000000000 --- a/docs/man3/SDL_GetRelativeMouseState.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GetRelativeMouseState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetRelativeMouseState \- Retrieve the current state of the mouse -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint8 \fBSDL_GetRelativeMouseState\fP\fR(\fBint *x, int *y\fR); -.SH "DESCRIPTION" -.PP -The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the change in the mouse position since the last call to \fBSDL_GetRelativeMouseState\fP or since event initialization\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetMouseState\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_GetThreadID.3 b/docs/man3/SDL_GetThreadID.3 deleted file mode 100644 index 6385aeb922..0000000000 --- a/docs/man3/SDL_GetThreadID.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_GetThreadID" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetThreadID \- Get the SDL thread ID of a SDL_Thread -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBUint32 \fBSDL_GetThreadID\fP\fR(\fBSDL_Thread *thread\fR); -.SH "DESCRIPTION" -.PP -Returns the ID of a \fBSDL_Thread\fR created by \fISDL_CreateThread\fR\&. -.SH "SEE ALSO" -.PP -\fISDL_CreateThread\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_GetTicks.3 b/docs/man3/SDL_GetTicks.3 deleted file mode 100644 index 4615737b4c..0000000000 --- a/docs/man3/SDL_GetTicks.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GetTicks" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetTicks \- Get the number of milliseconds since the SDL library initialization\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint32 \fBSDL_GetTicks\fP\fR(\fBvoid\fR) -.SH "DESCRIPTION" -.PP -Get the number of milliseconds since the SDL library initialization\&. Note that this value wraps if the program runs for more than ~49 days\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Delay\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetVideoInfo.3 b/docs/man3/SDL_GetVideoInfo.3 deleted file mode 100644 index b82b28e162..0000000000 --- a/docs/man3/SDL_GetVideoInfo.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GetVideoInfo" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetVideoInfo \- returns a pointer to information about the video hardware -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_VideoInfo *\fBSDL_GetVideoInfo\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -This function returns a read-only pointer to \fIinformation\fR about the video hardware\&. If this is called before \fISDL_SetVideoMode\fR, the \fBvfmt\fR member of the returned structure will contain the pixel format of the "best" video mode\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_VideoInfo\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_GetVideoSurface.3 b/docs/man3/SDL_GetVideoSurface.3 deleted file mode 100644 index 4a5d7eb96a..0000000000 --- a/docs/man3/SDL_GetVideoSurface.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_GetVideoSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_GetVideoSurface \- returns a pointer to the current display surface -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_GetVideoSurface\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -This function returns a pointer to the current display surface\&. If SDL is doing format conversion on the display surface, this function returns the publicly visible surface, not the real video surface\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Surface\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Init.3 b/docs/man3/SDL_Init.3 deleted file mode 100644 index 5f50054791..0000000000 --- a/docs/man3/SDL_Init.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "SDL_Init" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Init \- Initializes SDL -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_Init\fP\fR(\fBUint32 flags\fR); -.SH "DESCRIPTION" -.PP -Initializes SDL\&. This should be called before all other SDL functions\&. The \fBflags\fR parameter specifies what part(s) of SDL to initialize\&. -.TP 20 -\fBSDL_INIT_TIMER\fP -Initializes the \fItimer\fR subsystem\&. -.TP 20 -\fBSDL_INIT_AUDIO\fP -Initializes the \fIaudio\fR subsystem\&. -.TP 20 -\fBSDL_INIT_VIDEO\fP -Initializes the \fIvideo\fR subsystem\&. -.TP 20 -\fBSDL_INIT_CDROM\fP -Initializes the \fIcdrom\fR subsystem\&. -.TP 20 -\fBSDL_INIT_JOYSTICK\fP -Initializes the \fIjoystick\fR subsystem\&. -.TP 20 -\fBSDL_INIT_EVERYTHING\fP -Initialize all of the above\&. -.TP 20 -\fBSDL_INIT_NOPARACHUTE\fP -Prevents SDL from catching fatal signals\&. -.TP 20 -\fBSDL_INIT_EVENTTHREAD\fP -.SH "RETURN VALUE" -.PP -Returns \fB-1\fR on an error or \fB0\fR on success\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Quit\fP\fR, \fI\fBSDL_InitSubSystem\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_InitSubSystem.3 b/docs/man3/SDL_InitSubSystem.3 deleted file mode 100644 index f0a82a5284..0000000000 --- a/docs/man3/SDL_InitSubSystem.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "SDL_InitSubSystem" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_InitSubSystem \- Initialize subsystems -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_InitSubSystem\fP\fR(\fBUint32 flags\fR); -.SH "DESCRIPTION" -.PP -After SDL has been initialized with \fI\fBSDL_Init\fP\fR you may initialize uninitialized subsystems with \fBSDL_InitSubSystem\fP\&. The \fBflags\fR parameter is the same as that used in \fI\fBSDL_Init\fP\fR\&. -.SH "EXAMPLES" -.PP -.nf -\f(CW/* Seperating Joystick and Video initialization\&. */ -SDL_Init(SDL_INIT_VIDEO); -\&. -\&. -SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN); -\&. -/* Do Some Video stuff */ -\&. -\&. -/* Initialize the joystick subsystem */ -SDL_InitSubSystem(SDL_INIT_JOYSTICK); - -/* Do some stuff with video and joystick */ -\&. -\&. -\&. -/* Shut them both down */ -SDL_Quit();\fR -.fi -.PP -.SH "RETURN VALUE" -.PP -Returns \fB-1\fR on an error or \fB0\fR on success\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Quit\fP\fR, \fI\fBSDL_QuitSubSystem\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoyAxisEvent.3 b/docs/man3/SDL_JoyAxisEvent.3 deleted file mode 100644 index f8301fd70b..0000000000 --- a/docs/man3/SDL_JoyAxisEvent.3 +++ /dev/null @@ -1,36 +0,0 @@ -.TH "SDL_JoyAxisEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoyAxisEvent \- Joystick axis motion event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 which; - Uint8 axis; - Sint16 value; -} SDL_JoyAxisEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_JOYAXISMOTION\fP -.TP 20 -\fBwhich\fR -Joystick device index -.TP 20 -\fBaxis\fR -Joystick axis index -.TP 20 -\fBvalue\fR -Axis value (range: -32768 to 32767) -.SH "DESCRIPTION" -.PP -\fBSDL_JoyAxisEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYAXISMOTION\fP is reported\&. -.PP -A \fBSDL_JOYAXISMOTION\fP event occurs when ever a user moves an axis on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBaxis\fR is the index of the axis (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the axis\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetAxis\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoyBallEvent.3 b/docs/man3/SDL_JoyBallEvent.3 deleted file mode 100644 index 7f42f7ba69..0000000000 --- a/docs/man3/SDL_JoyBallEvent.3 +++ /dev/null @@ -1,36 +0,0 @@ -.TH "SDL_JoyBallEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoyBallEvent \- Joystick trackball motion event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 which; - Uint8 ball; - Sint16 xrel, yrel; -} SDL_JoyBallEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_JOYBALLMOTION\fP -.TP 20 -\fBwhich\fR -Joystick device index -.TP 20 -\fBball\fR -Joystick trackball index -.TP 20 -\fBxrel\fR, \fByrel\fR -The relative motion in the X/Y direction -.SH "DESCRIPTION" -.PP -\fBSDL_JoyBallEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBALLMOTION\fP is reported\&. -.PP -A \fBSDL_JOYBALLMOTION\fP event occurs when a user moves a trackball on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBball\fR is the index of the trackball (for a more detailed explaination see the \fIJoystick section\fR)\&. Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in \fBxrel\fR and \fByrel\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetBall\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoyButtonEvent.3 b/docs/man3/SDL_JoyButtonEvent.3 deleted file mode 100644 index dfd0793a89..0000000000 --- a/docs/man3/SDL_JoyButtonEvent.3 +++ /dev/null @@ -1,36 +0,0 @@ -.TH "SDL_JoyButtonEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoyButtonEvent \- Joystick button event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 which; - Uint8 button; - Uint8 state; -} SDL_JoyButtonEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP -.TP 20 -\fBwhich\fR -Joystick device index -.TP 20 -\fBbutton\fR -Joystick button index -.TP 20 -\fBstate\fR -\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP -.SH "DESCRIPTION" -.PP -\fBSDL_JoyButtonEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP is reported\&. -.PP -A \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP event occurs when ever a user presses or releases a button on a joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBbutton\fR is the index of the button (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBstate\fR is the current state or the button which is either \fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetButton\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoyHatEvent.3 b/docs/man3/SDL_JoyHatEvent.3 deleted file mode 100644 index 5817ad68f8..0000000000 --- a/docs/man3/SDL_JoyHatEvent.3 +++ /dev/null @@ -1,56 +0,0 @@ -.TH "SDL_JoyHatEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoyHatEvent \- Joystick hat position change event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 which; - Uint8 hat; - Uint8 value; -} SDL_JoyHatEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_JOY\fP -.TP 20 -\fBwhich\fR -Joystick device index -.TP 20 -\fBhat\fR -Joystick hat index -.TP 20 -\fBvalue\fR -Hat position -.SH "DESCRIPTION" -.PP -\fBSDL_JoyHatEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYHATMOTION\fP is reported\&. -.PP -A \fBSDL_JOYHATMOTION\fP event occurs when ever a user moves a hat on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBhat\fR is the index of the hat (for a more detailed exlaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the hat\&. It is a logically OR\&'d combination of the following values (whose meanings should be pretty obvious:) : -.IP "" 10 -\fBSDL_HAT_CENTERED\fP -.IP "" 10 -\fBSDL_HAT_UP\fP -.IP "" 10 -\fBSDL_HAT_RIGHT\fP -.IP "" 10 -\fBSDL_HAT_DOWN\fP -.IP "" 10 -\fBSDL_HAT_LEFT\fP -.PP -The following defines are also provided: -.IP "" 10 -\fBSDL_HAT_RIGHTUP\fP -.IP "" 10 -\fBSDL_HAT_RIGHTDOWN\fP -.IP "" 10 -\fBSDL_HAT_LEFTUP\fP -.IP "" 10 -\fBSDL_HAT_LEFTDOWN\fP -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetHat\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoystickClose.3 b/docs/man3/SDL_JoystickClose.3 deleted file mode 100644 index 281702f116..0000000000 --- a/docs/man3/SDL_JoystickClose.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_JoystickClose" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickClose \- Closes a previously opened joystick -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_JoystickClose\fP\fR(\fBSDL_Joystick *joystick\fR); -.SH "DESCRIPTION" -.PP -Close a \fBjoystick\fR that was previously opened with \fI\fBSDL_JoystickOpen\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickOpened\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickEventState.3 b/docs/man3/SDL_JoystickEventState.3 deleted file mode 100644 index 7e410f3626..0000000000 --- a/docs/man3/SDL_JoystickEventState.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "SDL_JoystickEventState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickEventState \- Enable/disable joystick event polling -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_JoystickEventState\fP\fR(\fBint state\fR); -.SH "DESCRIPTION" -.PP -This function is used to enable or disable joystick event processing\&. With joystick event processing disabled you will have to update joystick states with \fI\fBSDL_JoystickUpdate\fP\fR and read the joystick information manually\&. \fBstate\fR is either \fBSDL_QUERY\fP, \fBSDL_ENABLE\fP or \fBSDL_IGNORE\fP\&. -.PP -.RS -\fBNote: -.PP -Joystick event handling is prefered -.RE -.SH "RETURN VALUE" -.PP -If \fBstate\fR is \fBSDL_QUERY\fP then the current state is returned, otherwise the new processing \fBstate\fR is returned\&. -.SH "SEE ALSO" -.PP -\fISDL Joystick Functions\fR, \fI\fBSDL_JoystickUpdate\fP\fR, \fI\fBSDL_JoyAxisEvent\fR\fR, \fI\fBSDL_JoyBallEvent\fR\fR, \fI\fBSDL_JoyButtonEvent\fR\fR, \fI\fBSDL_JoyHatEvent\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_JoystickGetAxis.3 b/docs/man3/SDL_JoystickGetAxis.3 deleted file mode 100644 index 0a80b3405a..0000000000 --- a/docs/man3/SDL_JoystickGetAxis.3 +++ /dev/null @@ -1,32 +0,0 @@ -.TH "SDL_JoystickGetAxis" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickGetAxis \- Get the current state of an axis -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSint16 \fBSDL_JoystickGetAxis\fP\fR(\fBSDL_Joystick *joystick, int axis\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_JoystickGetAxis\fP returns the current state of the given \fBaxis\fR on the given \fBjoystick\fR\&. -.PP -On most modern joysticks the X axis is usually represented by \fBaxis\fR 0 and the Y axis by \fBaxis\fR 1\&. The value returned by \fBSDL_JoystickGetAxis\fP is a signed integer (-32768 to 32768) representing the current position of the \fBaxis\fR, it maybe necessary to impose certain tolerances on these values to account for jitter\&. It is worth noting that some joysticks use axes 2 and 3 for extra buttons\&. -.SH "RETURN VALUE" -.PP -Returns a 16-bit signed integer representing the current position of the \fBaxis\fR\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWSint16 x_move, y_move; -SDL_Joystick *joy1; -\&. -\&. -x_move=SDL_JoystickGetAxis(joy1, 0); -y_move=SDL_JoystickGetAxis(joy1, 1);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickNumAxes\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickGetBall.3 b/docs/man3/SDL_JoystickGetBall.3 deleted file mode 100644 index 124c910709..0000000000 --- a/docs/man3/SDL_JoystickGetBall.3 +++ /dev/null @@ -1,37 +0,0 @@ -.TH "SDL_JoystickGetBall" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickGetBall \- Get relative trackball motion -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_JoystickGetBall\fP\fR(\fBSDL_Joystick *joystick, int ball, int *dx, int *dy\fR); -.SH "DESCRIPTION" -.PP -Get the \fBball\fR axis change\&. -.PP -Trackballs can only return relative motion since the last call to \fBSDL_JoystickGetBall\fP, these motion deltas a placed into \fBdx\fR and \fBdy\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success or \fB-1\fR on failure -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWint delta_x, delta_y; -SDL_Joystick *joy; -\&. -\&. -\&. -SDL_JoystickUpdate(); -if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1) - printf("TrackBall Read Error! -"); -printf("Trackball Delta- X:%d, Y:%d -", delta_x, delta_y);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickNumBalls\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickGetButton.3 b/docs/man3/SDL_JoystickGetButton.3 deleted file mode 100644 index e7b336b34b..0000000000 --- a/docs/man3/SDL_JoystickGetButton.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_JoystickGetButton" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickGetButton \- Get the current state of a given button on a given joystick -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint8 \fBSDL_JoystickGetButton\fP\fR(\fBSDL_Joystick *joystick, int button\fR); -.SH "DESCRIPTION" -.PP -SDL_JoystickGetButton returns the current state of the given \fBbutton\fR on the given \fBjoystick\fR\&. -.SH "RETURN VALUE" -.PP -\fB1\fR if the button is pressed\&. Otherwise, \fB0\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickNumButtons\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickGetHat.3 b/docs/man3/SDL_JoystickGetHat.3 deleted file mode 100644 index cdbd910557..0000000000 --- a/docs/man3/SDL_JoystickGetHat.3 +++ /dev/null @@ -1,36 +0,0 @@ -.TH "SDL_JoystickGetHat" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickGetHat \- Get the current state of a joystick hat -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint8 \fBSDL_JoystickGetHat\fP\fR(\fBSDL_Joystick *joystick, int hat\fR); -.SH "DESCRIPTION" -.PP -SDL_JoystickGetHat returns the current state of the given \fBhat\fR on the given \fBjoystick\fR\&. -.SH "RETURN VALUE" -.PP -The current state is returned as a Uint8 which is defined as an OR\&'d combination of one or more of the following -.IP "" 10 -\fBSDL_HAT_CENTERED\fP -.IP "" 10 -\fBSDL_HAT_UP\fP -.IP "" 10 -\fBSDL_HAT_RIGHT\fP -.IP "" 10 -\fBSDL_HAT_DOWN\fP -.IP "" 10 -\fBSDL_HAT_LEFT\fP -.IP "" 10 -\fBSDL_HAT_RIGHTUP\fP -.IP "" 10 -\fBSDL_HAT_RIGHTDOWN\fP -.IP "" 10 -\fBSDL_HAT_LEFTUP\fP -.IP "" 10 -\fBSDL_HAT_LEFTDOWN\fP -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickNumHats\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickIndex.3 b/docs/man3/SDL_JoystickIndex.3 deleted file mode 100644 index 611e4b67a8..0000000000 --- a/docs/man3/SDL_JoystickIndex.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_JoystickIndex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickIndex \- Get the index of an SDL_Joystick\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_JoystickIndex\fP\fR(\fBSDL_Joystick *joystick\fR); -.SH "DESCRIPTION" -.PP -Returns the index of a given \fBSDL_Joystick\fR structure\&. -.SH "RETURN VALUE" -.PP -Index number of the joystick\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickOpen\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickName.3 b/docs/man3/SDL_JoystickName.3 deleted file mode 100644 index 364297e0d9..0000000000 --- a/docs/man3/SDL_JoystickName.3 +++ /dev/null @@ -1,32 +0,0 @@ -.TH "SDL_JoystickName" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickName \- Get joystick name\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBconst char *\fBSDL_JoystickName\fP\fR(\fBint index\fR); -.SH "DESCRIPTION" -.PP -Get the implementation dependent name of joystick\&. The \fBindex\fR parameter refers to the N\&'th joystick on the system\&. -.SH "RETURN VALUE" -.PP -Returns a char pointer to the joystick name\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CW/* Print the names of all attached joysticks */ -int num_joy, i; -num_joy=SDL_NumJoysticks(); -printf("%d joysticks found -", num_joy); -for(i=0;i0){ - // Open joystick - joy=SDL_JoystickOpen(0); - - if(joy) - { - printf("Opened Joystick 0 -"); - printf("Name: %s -", SDL_JoystickName(0)); - printf("Number of Axes: %d -", SDL_JoystickNumAxes(joy)); - printf("Number of Buttons: %d -", SDL_JoystickNumButtons(joy)); - printf("Number of Balls: %d -", SDL_JoystickNumBalls(joy)); - } - else - printf("Couldn\&'t open Joystick 0 -"); - - // Close if opened - if(SDL_JoystickOpened(0)) - SDL_JoystickClose(joy); -}\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickClose\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickOpened.3 b/docs/man3/SDL_JoystickOpened.3 deleted file mode 100644 index 9d82e09b32..0000000000 --- a/docs/man3/SDL_JoystickOpened.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_JoystickOpened" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickOpened \- Determine if a joystick has been opened -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_JoystickOpened\fP\fR(\fBint index\fR); -.SH "DESCRIPTION" -.PP -Determines whether a joystick has already been opened within the application\&. \fBindex\fR refers to the N\&'th joystick on the system\&. -.SH "RETURN VALUE" -.PP -Returns \fB1\fR if the joystick has been opened, or \fB0\fR if it has not\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickClose\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_JoystickUpdate.3 b/docs/man3/SDL_JoystickUpdate.3 deleted file mode 100644 index 7d1035b1cc..0000000000 --- a/docs/man3/SDL_JoystickUpdate.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_JoystickUpdate" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_JoystickUpdate \- Updates the state of all joysticks -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_JoystickUpdate\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -Updates the state(position, buttons, etc\&.) of all open joysticks\&. If joystick events have been enabled with \fI\fBSDL_JoystickEventState\fP\fR then this is called automatically in the event loop\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickEventState\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_KeyboardEvent.3 b/docs/man3/SDL_KeyboardEvent.3 deleted file mode 100644 index 4aeea79220..0000000000 --- a/docs/man3/SDL_KeyboardEvent.3 +++ /dev/null @@ -1,38 +0,0 @@ -.TH "SDL_KeyboardEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_KeyboardEvent \- Keyboard event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 state; - SDL_keysym keysym; -} SDL_KeyboardEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_KEYDOWN\fP or \fBSDL_KEYUP\fP -.TP 20 -\fBstate\fR -\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP -.TP 20 -\fBkeysym\fR -Contains key press information -.SH "DESCRIPTION" -.PP -\fBSDL_KeyboardEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_KEYDOWN\fP or \fBSDL_KEYUP\fP is reported\&. -.PP -The \fBtype\fR and \fBstate\fR actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (\fBtype\fR=\fBSDK_KEYUP\fP or \fBstate\fR=\fBSDL_RELEASED\fP) and when a key is pressed (\fBtype\fR=\fBSDL_KEYDOWN\fP or \fBstate\fR=\fBSDL_PRESSED\fP)\&. The information on what key was pressed or released is in the \fI\fBkeysym\fR\fR structure\&. -.PP -.RS -\fBNote: -.PP -Repeating \fBSDL_KEYDOWN\fP events will occur if key repeat is enabled (see \fI\fBSDL_EnableKeyRepeat\fP\fR)\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_keysym\fR\fR, \fI\fBSDL_EnableKeyRepeat\fP\fR, \fI\fBSDL_EnableUNICODE\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_KillThread.3 b/docs/man3/SDL_KillThread.3 deleted file mode 100644 index 2a34f11f83..0000000000 --- a/docs/man3/SDL_KillThread.3 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "SDL_KillThread" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_KillThread \- Gracelessly terminates the thread\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBvoid \fBSDL_KillThread\fP\fR(\fBSDL_Thread *thread\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_KillThread\fP gracelessly terminates the thread associated with \fBthread\fR\&. If possible, you should use some other form of IPC to signal the thread to quit\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateThread\fP\fR, \fI\fBSDL_WaitThread\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_ListModes.3 b/docs/man3/SDL_ListModes.3 deleted file mode 100644 index 3cc9376afb..0000000000 --- a/docs/man3/SDL_ListModes.3 +++ /dev/null @@ -1,53 +0,0 @@ -.TH "SDL_ListModes" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ListModes \- Returns a pointer to an array of available screen dimensions for the given format and video flags -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Rect **\fBSDL_ListModes\fP\fR(\fBSDL_PixelFormat *format, Uint32 flags\fR); -.SH "DESCRIPTION" -.PP -Return a pointer to an array of available screen dimensions for the given format and video flags, sorted largest to smallest\&. Returns \fBNULL\fP if there are no dimensions available for a particular format, or \fB-1\fR if any dimension is okay for the given format\&. -.PP -If \fBformat\fR is \fBNULL\fP, the mode list will be for the format returned by \fISDL_GetVideoInfo()\fR->\fBvfmt\fR\&. The \fBflag\fR parameter is an OR\&'d combination of \fIsurface\fR flags\&. The flags are the same as those used \fI\fBSDL_SetVideoMode\fP\fR and they play a strong role in deciding what modes are valid\&. For instance, if you pass \fBSDL_HWSURFACE\fP as a flag only modes that support hardware video surfaces will be returned\&. -.SH "EXAMPLE" -.PP -.nf -\f(CWSDL_Rect **modes; -int i; -\&. -\&. -\&. - -/* Get available fullscreen/hardware modes */ -modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); - -/* Check is there are any modes available */ -if(modes == (SDL_Rect **)0){ - printf("No modes available! -"); - exit(-1); -} - -/* Check if or resolution is restricted */ -if(modes == (SDL_Rect **)-1){ - printf("All resolutions available\&. -"); -} -else{ - /* Print valid modes */ - printf("Available Modes -"); - for(i=0;modes[i];++i) - printf(" %d x %d -", modes[i]->w, modes[i]->h); -} -\&. -\&.\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GetVideoInfo\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_PixelFormat\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_LoadBMP.3 b/docs/man3/SDL_LoadBMP.3 deleted file mode 100644 index 7e3b4af3a9..0000000000 --- a/docs/man3/SDL_LoadBMP.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_LoadBMP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_LoadBMP \- Load a Windows BMP file into an SDL_Surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_LoadBMP\fP\fR(\fBconst char *file\fR); -.SH "DESCRIPTION" -.PP -Loads a surface from a named Windows BMP file\&. -.SH "RETURN VALUE" -.PP -Returns the new surface, or \fBNULL\fP if there was an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_SaveBMP\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_LoadWAV.3 b/docs/man3/SDL_LoadWAV.3 deleted file mode 100644 index 490ff67ef6..0000000000 --- a/docs/man3/SDL_LoadWAV.3 +++ /dev/null @@ -1,42 +0,0 @@ -.TH "SDL_LoadWAV" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_LoadWAV \- Load a WAVE file -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_AudioSpec *\fBSDL_LoadWAV\fP\fR(\fBconst char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_LoadWAV\fP This function loads a WAVE \fBfile\fR into memory\&. -.PP -If this function succeeds, it returns the given \fI\fBSDL_AudioSpec\fP\fR, filled with the audio data format of the wave data, and sets \fBaudio_buf\fR to a \fBmalloc\fP\&'d buffer containing the audio data, and sets \fBaudio_len\fR to the length of that audio buffer, in bytes\&. You need to free the audio buffer with \fI\fBSDL_FreeWAV\fP\fR when you are done with it\&. -.PP -This function returns \fBNULL\fP and sets the SDL error message if the wave file cannot be opened, uses an unknown data format, or is corrupt\&. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported\&. -.SH "EXAMPLE" -.PP -.nf -\f(CWSDL_AudioSpec wav_spec; -Uint32 wav_length; -Uint8 *wav_buffer; - -/* Load the WAV */ -if( SDL_LoadWAV("test\&.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){ - fprintf(stderr, "Could not open test\&.wav: %s -", SDL_GetError()); - exit(-1); -} -\&. -\&. -\&. -/* Do stuff with the WAV */ -\&. -\&. -/* Free It */ -SDL_FreeWAV(wav_buffer);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_AudioSpec\fR\fR, \fI\fBSDL_OpenAudio\fP\fR, \fI\fBSDL_FreeWAV\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_LockAudio.3 b/docs/man3/SDL_LockAudio.3 deleted file mode 100644 index 8c141fd67e..0000000000 --- a/docs/man3/SDL_LockAudio.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_LockAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_LockAudio \- Lock out the callback function -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_LockAudio\fP\fR(\fBvoid\fR) -.SH "DESCRIPTION" -.PP -The lock manipulated by these functions protects the callback function\&. During a LockAudio period, you can be guaranteed that the callback function is not running\&. Do not call these from the callback function or you will cause deadlock\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_OpenAudio\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_LockSurface.3 b/docs/man3/SDL_LockSurface.3 deleted file mode 100644 index 6db3ad7bd5..0000000000 --- a/docs/man3/SDL_LockSurface.3 +++ /dev/null @@ -1,48 +0,0 @@ -.TH "SDL_LockSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_LockSurface \- Lock a surface for directly access\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_LockSurface\fP\fR(\fBSDL_Surface *surface\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_LockSurface\fP sets up a surface for directly accessing the pixels\&. Between calls to \fBSDL_LockSurface\fP and \fBSDL_UnlockSurface\fP, you can write to and read from \fBsurface->\fBpixels\fR\fR, using the pixel format stored in \fBsurface->\fBformat\fR\fR\&. Once you are done accessing the surface, you should use \fBSDL_UnlockSurface\fP to release it\&. -.PP -Not all surfaces require locking\&. If \fBSDL_MUSTLOCK\fP(\fBsurface\fR) evaluates to \fB0\fR, then you can read and write to the surface at any time, and the pixel format of the surface will not change\&. -.PP -No operating system or library calls should be made between lock/unlock pairs, as critical system locks may be held during this time\&. -.PP -It should be noted, that since SDL 1\&.1\&.8 surface locks are recursive\&. This means that you can lock a surface multiple times, but each lock must have a match unlock\&. -.PP -.nf -\f(CW \&. - \&. - SDL_LockSurface( surface ); - \&. - /* Surface is locked */ - /* Direct pixel access on surface here */ - \&. - SDL_LockSurface( surface ); - \&. - /* More direct pixel access on surface */ - \&. - SDL_UnlockSurface( surface ); - /* Surface is still locked */ - /* Note: Is versions < 1\&.1\&.8, the surface would have been */ - /* no longer locked at this stage */ - \&. - SDL_UnlockSurface( surface ); - /* Surface is now unlocked */ - \&. - \&.\fR -.fi -.PP -.SH "RETURN VALUE" -.PP -\fBSDL_LockSurface\fP returns \fB0\fR, or \fB-1\fR if the surface couldn\&'t be locked\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_UnlockSurface\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_LockYUVOverlay.3 b/docs/man3/SDL_LockYUVOverlay.3 deleted file mode 100644 index 286d96fdec..0000000000 --- a/docs/man3/SDL_LockYUVOverlay.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_LockYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_LockYUVOverlay \- Lock an overlay -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_LockYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR); -.SH "DESCRIPTION" -.PP -Much the same as \fI\fBSDL_LockSurface\fP\fR, \fBSDL_LockYUVOverlay\fP locks the \fI\fBoverlay\fR\fR for direct access to pixel data\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_Overlay\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_MapRGB.3 b/docs/man3/SDL_MapRGB.3 deleted file mode 100644 index 1e4c963b49..0000000000 --- a/docs/man3/SDL_MapRGB.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_MapRGB" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_MapRGB \- Map a RGB color value to a pixel format\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint32 \fBSDL_MapRGB\fP\fR(\fBSDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b\fR); -.SH "DESCRIPTION" -.PP -Maps the RGB color value to the specified pixel format and returns the pixel value as a 32-bit int\&. -.PP -If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned\&. -.PP -If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque)\&. -.SH "RETURN VALUE" -.PP -A pixel value best approximating the given RGB color value for a given pixel format\&. If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e\&.g\&., with a 16-bpp format the return value can be assigned to a \fBUint16\fP, and similarly a \fBUint8\fP for an 8-bpp format)\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetRGB\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_PixelFormat\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_MapRGBA.3 b/docs/man3/SDL_MapRGBA.3 deleted file mode 100644 index 03d78d8c02..0000000000 --- a/docs/man3/SDL_MapRGBA.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_MapRGBA" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_MapRGBA \- Map a RGBA color value to a pixel format\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint32 \fBSDL_MapRGBA\fP\fR(\fBSDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a\fR); -.SH "DESCRIPTION" -.PP -Maps the RGBA color value to the specified pixel format and returns the pixel value as a 32-bit int\&. -.PP -If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned\&. -.PP -If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette)\&. -.SH "RETURN VALUE" -.PP -A pixel value best approximating the given RGBA color value for a given pixel format\&. If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e\&.g\&., with a 16-bpp format the return value can be assigned to a \fBUint16\fP, and similarly a \fBUint8\fP for an 8-bpp format)\&. -.SH "SEE ALSO" -.PP -\fISDL_GetRGB\fR, \fISDL_GetRGBA\fR, \fISDL_MapRGB\fR, \fISDL_PixelFormat\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_MixAudio.3 b/docs/man3/SDL_MixAudio.3 deleted file mode 100644 index b98660df6f..0000000000 --- a/docs/man3/SDL_MixAudio.3 +++ /dev/null @@ -1,21 +0,0 @@ -.TH "SDL_MixAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_MixAudio \- Mix audio data -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_MixAudio\fP\fR(\fBUint8 *dst, Uint8 *src, Uint32 len, int volume\fR); -.SH "DESCRIPTION" -.PP -This function takes two audio buffers of \fBlen\fR bytes each of the playing audio format and mixes them, performing addition, volume adjustment, and overflow clipping\&. The \fBvolume\fR ranges from 0 to \fBSDL_MIX_MAXVOLUME\fP and should be set to the maximum value for full audio volume\&. Note this does not change hardware volume\&. This is provided for convenience -- you can mix your own audio data\&. -.PP -.RS -\fBNote: -.PP -Do not use this function for mixing together more than two streams of sample data\&. The output from repeated application of this function may be distorted by clipping, because there is no accumulator with greater range than the input (not to mention this being an inefficient way of doing it)\&. Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_OpenAudio\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_MouseButtonEvent.3 b/docs/man3/SDL_MouseButtonEvent.3 deleted file mode 100644 index d2d34a02b2..0000000000 --- a/docs/man3/SDL_MouseButtonEvent.3 +++ /dev/null @@ -1,36 +0,0 @@ -.TH "SDL_MouseButtonEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_MouseButtonEvent \- Mouse button event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 button; - Uint8 state; - Uint16 x, y; -} SDL_MouseButtonEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_MOUSEBUTTONDOWN\fP or \fBSDL_MOUSEBUTTONUP\fP -.TP 20 -\fBbutton\fR -The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT) -.TP 20 -\fBstate\fR -\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP -.TP 20 -\fBx\fR, \fBy\fR -The X/Y coordinates of the mouse at press/release time -.SH "DESCRIPTION" -.PP -\fBSDL_MouseButtonEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_MOUSEBUTTONDOWN\fP or \fBSDL_MOUSEBUTTONUP\fP is reported\&. -.PP -When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into \fBbutton\fR, the position of the mouse when this event occured is stored in the \fBx\fR and the \fBy\fR fields\&. Like \fI\fBSDL_KeyboardEvent\fR\fR, information on whether the event was a press or a release event is stored in both the \fBtype\fR and \fBstate\fR fields, but this should be obvious\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_MouseMotionEvent\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_MouseMotionEvent.3 b/docs/man3/SDL_MouseMotionEvent.3 deleted file mode 100644 index c1b036d2a9..0000000000 --- a/docs/man3/SDL_MouseMotionEvent.3 +++ /dev/null @@ -1,38 +0,0 @@ -.TH "SDL_MouseMotionEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_MouseMotionEvent \- Mouse motion event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - Uint8 state; - Uint16 x, y; - Sint16 xrel, yrel; -} SDL_MouseMotionEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_MOUSEMOTION\fP -.TP 20 -\fBstate\fR -The current button state -.TP 20 -\fBx\fR, \fBy\fR -The X/Y coordinates of the mouse -.TP 20 -\fBxrel\fR, \fByrel\fR -Relative motion in the X/Y direction -.SH "DESCRIPTION" -.PP -\fBSDL_MouseMotionEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_MOUSEMOTION\fP is reported\&. -.PP -Simply put, a \fBSDL_MOUSEMOTION\fP type event occurs when a user moves the mouse within the application window or when \fI\fBSDL_WarpMouse\fP\fR is called\&. Both the absolute (\fBx\fR and \fBy\fR) and relative (\fBxrel\fR and \fByrel\fR) coordinates are reported along with the current button states (\fBstate\fR)\&. The button state can be interpreted using the \fBSDL_BUTTON\fP macro (see \fI\fBSDL_GetMouseState\fP\fR)\&. -.PP -If the cursor is hidden (\fI\fBSDL_ShowCursor\fP(0)\fR) and the input is grabbed (\fI\fBSDL_WM_GrabInput\fP(SDL_GRAB_ON)\fR), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen\&. This is currently only implemented on Windows and Linux/Unix-a-likes\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_MouseButtonEvent\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_NumJoysticks.3 b/docs/man3/SDL_NumJoysticks.3 deleted file mode 100644 index c737a1c5c8..0000000000 --- a/docs/man3/SDL_NumJoysticks.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_NumJoysticks" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_NumJoysticks \- Count available joysticks\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_NumJoysticks\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -Counts the number of joysticks attached to the system\&. -.SH "RETURN VALUE" -.PP -Returns the number of attached joysticks -.SH "SEE ALSO" -.PP -\fI\fBSDL_JoystickName\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_OpenAudio.3 b/docs/man3/SDL_OpenAudio.3 deleted file mode 100644 index 38a232ce71..0000000000 --- a/docs/man3/SDL_OpenAudio.3 +++ /dev/null @@ -1,97 +0,0 @@ -.TH "SDL_OpenAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_OpenAudio \- Opens the audio device with the desired parameters\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_OpenAudio\fP\fR(\fBSDL_AudioSpec *desired, SDL_AudioSpec *obtained\fR); -.SH "DESCRIPTION" -.PP -This function opens the audio device with the \fBdesired\fR parameters, and returns 0 if successful, placing the actual hardware parameters in the structure pointed to by \fBobtained\fR\&. If \fBobtained\fR is NULL, the audio data passed to the callback function will be guaranteed to be in the requested format, and will be automatically converted to the hardware audio format if necessary\&. This function returns -1 if it failed to open the audio device, or couldn\&'t set up the audio thread\&. -.PP -To open the audio device a \fBdesired\fR \fI\fBSDL_AudioSpec\fR\fR must be created\&. -.PP -.nf -\f(CWSDL_AudioSpec *desired; -\&. -\&. -desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));\fR -.fi -.PP - You must then fill this structure with your desired audio specifications\&. -.IP "\fBdesired\fR->\fBfreq\fR" 10The desired audio frequency in samples-per-second\&. -.IP "\fBdesired\fR->\fBformat\fR" 10The desired audio format (see \fI\fBSDL_AudioSpec\fR\fR) -.IP "\fBdesired\fR->\fBsamples\fR" 10The desired size of the audio buffer in samples\&. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware\&. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed\&. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time\&. A stereo sample consists of both right and left channels in LR ordering\&. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq -.IP "\fBdesired\fR->\fBcallback\fR" 10This should be set to a function that will be called when the audio device is ready for more data\&. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer\&. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling \fI\fBSDL_LockAudio\fP\fR and \fI\fBSDL_UnlockAudio\fP\fR in your code\&. The callback prototype is: -.PP -.nf -\f(CWvoid callback(void *userdata, Uint8 *stream, int len);\fR -.fi -.PP - \fBuserdata\fR is the pointer stored in \fBuserdata\fR field of the \fBSDL_AudioSpec\fR\&. \fBstream\fR is a pointer to the audio buffer you want to fill with information and \fBlen\fR is the length of the audio buffer in bytes\&. -.IP "\fBdesired\fR->\fBuserdata\fR" 10This pointer is passed as the first parameter to the \fBcallback\fP function\&. -.PP -\fBSDL_OpenAudio\fP reads these fields from the \fBdesired\fR \fBSDL_AudioSpec\fR structure pass to the function and attempts to find an audio configuration matching your \fBdesired\fR\&. As mentioned above, if the \fBobtained\fR parameter is \fBNULL\fP then SDL with convert from your \fBdesired\fR audio settings to the hardware settings as it plays\&. -.PP -If \fBobtained\fR is \fBNULL\fP then the \fBdesired\fR \fBSDL_AudioSpec\fR is your working specification, otherwise the \fBobtained\fR \fBSDL_AudioSpec\fR becomes the working specification and the \fBdesirec\fR specification can be deleted\&. The data in the working specification is used when building \fBSDL_AudioCVT\fR\&'s for converting loaded data to the hardware format\&. -.PP -\fBSDL_OpenAudio\fP calculates the \fBsize\fR and \fBsilence\fR fields for both the \fBdesired\fR and \fBobtained\fR specifications\&. The \fBsize\fR field stores the total size of the audio buffer in bytes, while the \fBsilence\fR stores the value used to represent silence in the audio buffer -.PP -The audio device starts out playing \fBsilence\fR when it\&'s opened, and should be enabled for playing by calling \fI\fBSDL_PauseAudio\fP(\fB0\fR)\fR when you are ready for your audio \fBcallback\fR function to be called\&. Since the audio driver may modify the requested \fBsize\fR of the audio buffer, you should allocate any local mixing buffers after you open the audio device\&. -.SH "EXAMPLES" -.PP -.nf -\f(CW/* Prototype of our callback function */ -void my_audio_callback(void *userdata, Uint8 *stream, int len); - -/* Open the audio device */ -SDL_AudioSpec *desired, *obtained; -SDL_AudioSpec *hardware_spec; - -/* Allocate a desired SDL_AudioSpec */ -desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); - -/* Allocate space for the obtained SDL_AudioSpec */ -obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); - -/* 22050Hz - FM Radio quality */ -desired->freq=22050; - -/* 16-bit signed audio */ -desired->format=AUDIO_S16LSB; - -/* Mono */ -desired->channels=0; - -/* Large audio buffer reduces risk of dropouts but increases response time */ -desired->samples=8192; - -/* Our callback function */ -desired->callback=my_audio_callback; - -desired->userdata=NULL; - -/* Open the audio device */ -if ( SDL_OpenAudio(desired, obtained) < 0 ){ - fprintf(stderr, "Couldn\&'t open audio: %s -", SDL_GetError()); - exit(-1); -} -/* desired spec is no longer needed */ -free(desired); -hardware_spec=obtained; -\&. -\&. -/* Prepare callback for playing */ -\&. -\&. -\&. -/* Start playing */ -SDL_PauseAudio(0);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_AudioSpec\fP\fR, \fI\fBSDL_LockAudio\fP\fR, \fI\fBSDL_UnlockAudio\fP\fR, \fI\fBSDL_PauseAudio\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_Overlay.3 b/docs/man3/SDL_Overlay.3 deleted file mode 100644 index a852e918f6..0000000000 --- a/docs/man3/SDL_Overlay.3 +++ /dev/null @@ -1,52 +0,0 @@ -.TH "SDL_Overlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Overlay \- YUV video overlay -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint32 format; - int w, h; - int planes; - Uint16 *pitches; - Uint8 **pixels; - Uint32 hw_overlay:1; -} SDL_Overlay;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBformat\fR -Overlay format (see below) -.TP 20 -\fBw, h\fR -Width and height of overlay -.TP 20 -\fBplanes\fR -Number of planes in the overlay\&. Usually either 1 or 3 -.TP 20 -\fBpitches\fR -An array of pitches, one for each plane\&. Pitch is the length of a row in bytes\&. -.TP 20 -\fBpixels\fR -An array of pointers to teh data of each plane\&. The overlay should be locked before these pointers are used\&. -.TP 20 -\fBhw_overlay\fR -This will be set to 1 if the overlay is hardware accelerated\&. -.SH "DESCRIPTION" -.PP -A \fBSDL_Overlay\fR is similar to a \fI\fBSDL_Surface\fR\fR except it stores a YUV overlay\&. All the fields are read only, except for \fBpixels\fR which should be \fIlocked\fR before use\&. The \fBformat\fR field stores the format of the overlay which is one of the following: -.PP -.nf -\f(CW#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */ -#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */ -#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */ -#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */ -#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */\fR -.fi -.PP - More information on YUV formats can be found at \fIhttp://www\&.webartz\&.com/fourcc/indexyuv\&.htm (link to URL http://www.webartz.com/fourcc/indexyuv.htm) \fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_LockYUVOverlay\fP\fR, \fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Palette.3 b/docs/man3/SDL_Palette.3 deleted file mode 100644 index ea5e406d56..0000000000 --- a/docs/man3/SDL_Palette.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "SDL_Palette" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Palette \- Color palette for 8-bit pixel formats -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - int ncolors; - SDL_Color *colors; -} SDL_Palette;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBncolors\fR -Number of colors used in this palette -.TP 20 -\fBcolors\fR -Pointer to \fI\fBSDL_Color\fR\fR structures that make up the palette\&. -.SH "DESCRIPTION" -.PP -Each pixel in an 8-bit surface is an index into the \fBcolors\fR field of the \fBSDL_Palette\fR structure store in \fI\fBSDL_PixelFormat\fR\fR\&. A \fBSDL_Palette\fR should never need to be created manually\&. It is automatically created when SDL allocates a \fBSDL_PixelFormat\fR for a surface\&. The colors values of a \fI\fBSDL_Surface\fR\fRs palette can be set with the \fI\fBSDL_SetColors\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Color\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_SetColors\fP\fR \fI\fBSDL_SetPalette\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_PauseAudio.3 b/docs/man3/SDL_PauseAudio.3 deleted file mode 100644 index 1ca979a81b..0000000000 --- a/docs/man3/SDL_PauseAudio.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_PauseAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_PauseAudio \- Pauses and unpauses the audio callback processing -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_PauseAudio\fP\fR(\fBint pause_on\fR); -.SH "DESCRIPTION" -.PP -This function pauses and unpauses the audio callback processing\&. It should be called with \fBpause_on\fR=0 after opening the audio device to start playing sound\&. This is so you can safely initialize data for your callback function after opening the audio device\&. Silence will be written to the audio device during the pause\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetAudioStatus\fP\fR, \fI\fBSDL_OpenAudio\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_PeepEvents.3 b/docs/man3/SDL_PeepEvents.3 deleted file mode 100644 index 016542df8f..0000000000 --- a/docs/man3/SDL_PeepEvents.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "SDL_PeepEvents" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_PeepEvents \- Checks the event queue for messages and optionally returns them\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_PeepEvents\fP\fR(\fBSDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask\fR); -.SH "DESCRIPTION" -.PP -Checks the event queue for messages and optionally returns them\&. -.PP -If \fBaction\fR is \fBSDL_ADDEVENT\fP, up to \fBnumevents\fR events will be added to the back of the event queue\&. -.PP -If \fBaction\fR is \fBSDL_PEEKEVENT\fP, up to \fBnumevents\fR events at the front of the event queue, matching \fI\fBmask\fR\fR, will be returned and will not be removed from the queue\&. -.PP -If \fBaction\fR is \fBSDL_GETEVENT\fP, up to \fBnumevents\fR events at the front of the event queue, matching \fI\fBmask\fR\fR, will be returned and will be removed from the queue\&. -.PP -This function is thread-safe\&. -.SH "RETURN VALUE" -.PP -This function returns the number of events actually stored, or \fB-1\fR if there was an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PushEvent\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_PixelFormat.3 b/docs/man3/SDL_PixelFormat.3 deleted file mode 100644 index f91593ebb0..0000000000 --- a/docs/man3/SDL_PixelFormat.3 +++ /dev/null @@ -1,140 +0,0 @@ -.TH "SDL_PixelFormat" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_PixelFormat \- Stores surface format information -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct SDL_PixelFormat { - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 Rloss, Gloss, Bloss, Aloss; - Uint8 Rshift, Gshift, Bshift, Ashift; - Uint32 Rmask, Gmask, Bmask, Amask; - Uint32 colorkey; - Uint8 alpha; -} SDL_PixelFormat;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBpalette\fR -Pointer to the \fIpalette\fR, or \fBNULL\fP if the \fBBitsPerPixel\fR>8 -.TP 20 -\fBBitsPerPixel\fR -The number of bits used to represent each pixel in a surface\&. Usually 8, 16, 24 or 32\&. -.TP 20 -\fBBytesPerPixel\fR -The number of bytes used to represent each pixel in a surface\&. Usually one to four\&. -.TP 20 -\fB[RGBA]mask\fR -Binary mask used to retrieve individual color values -.TP 20 -\fB[RGBA]loss\fR -Precision loss of each color component (2^[RGBA]loss) -.TP 20 -\fB[RGBA]shift\fR -Binary left shift of each color component in the pixel value -.TP 20 -\fBcolorkey\fR -Pixel value of transparent pixels -.TP 20 -\fBalpha\fR -Overall surface alpha value -.SH "DESCRIPTION" -.PP -A \fBSDL_PixelFormat\fR describes the format of the pixel data stored at the \fBpixels\fR field of a \fI\fBSDL_Surface\fR\fR\&. Every surface stores a \fBSDL_PixelFormat\fR in the \fBformat\fR field\&. -.PP -If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential\&. -.PP -8-bit pixel formats are the easiest to understand\&. Since its an 8-bit format, we have 8 \fBBitsPerPixel\fR and 1 \fBBytesPerPixel\fR\&. Since \fBBytesPerPixel\fR is 1, all pixels are represented by a Uint8 which contains an index into \fBpalette\fR->\fBcolors\fR\&. So, to determine the color of a pixel in a 8-bit surface: we read the color index from \fBsurface\fR->\fBpixels\fR and we use that index to read the \fI\fBSDL_Color\fR\fR structure from \fBsurface\fR->\fBformat\fR->\fBpalette\fR->\fBcolors\fR\&. Like so: -.PP -.nf -\f(CWSDL_Surface *surface; -SDL_PixelFormat *fmt; -SDL_Color *color; -Uint8 index; - -\&. -\&. - -/* Create surface */ -\&. -\&. -fmt=surface->format; - -/* Check the bitdepth of the surface */ -if(fmt->BitsPerPixel!=8){ - fprintf(stderr, "Not an 8-bit surface\&. -"); - return(-1); -} - -/* Lock the surface */ -SDL_LockSurface(surface); - -/* Get the topleft pixel */ -index=*(Uint8 *)surface->pixels; -color=fmt->palette->colors[index]; - -/* Unlock the surface */ -SDL_UnlockSurface(surface); -printf("Pixel Color-> Red: %d, Green: %d, Blue: %d\&. Index: %d -", - color->r, color->g, color->b, index); -\&. -\&.\fR -.fi -.PP -.PP -Pixel formats above 8-bit are an entirely different experience\&. They are considered to be "TrueColor" formats and the color information is stored in the pixels themselves, not in a palette\&. The mask, shift and loss fields tell us how the color information is encoded\&. The mask fields allow us to isolate each color component, the shift fields tell us the number of bits to the right of each component in the pixel value and the loss fields tell us the number of bits lost from each component when packing 8-bit color component in a pixel\&. -.PP -.nf -\f(CW/* Extracting color components from a 32-bit color value */ -SDL_PixelFormat *fmt; -SDL_Surface *surface; -Uint32 temp, pixel; -Uint8 red, green, blue, alpha; -\&. -\&. -\&. -fmt=surface->format; -SDL_LockSurface(surface); -pixel=*((Uint32*)surface->pixels); -SDL_UnlockSurface(surface); - -/* Get Red component */ -temp=pixel&fmt->Rmask; /* Isolate red component */ -temp=temp>>fmt->Rshift;/* Shift it down to 8-bit */ -temp=temp<Rloss; /* Expand to a full 8-bit number */ -red=(Uint8)temp; - -/* Get Green component */ -temp=pixel&fmt->Gmask; /* Isolate green component */ -temp=temp>>fmt->Gshift;/* Shift it down to 8-bit */ -temp=temp<Gloss; /* Expand to a full 8-bit number */ -green=(Uint8)temp; - -/* Get Blue component */ -temp=pixel&fmt->Bmask; /* Isolate blue component */ -temp=temp>>fmt->Bshift;/* Shift it down to 8-bit */ -temp=temp<Bloss; /* Expand to a full 8-bit number */ -blue=(Uint8)temp; - -/* Get Alpha component */ -temp=pixel&fmt->Amask; /* Isolate alpha component */ -temp=temp>>fmt->Ashift;/* Shift it down to 8-bit */ -temp=temp<Aloss; /* Expand to a full 8-bit number */ -alpha=(Uint8)temp; - -printf("Pixel Color -> R: %d, G: %d, B: %d, A: %d -", red, green, blue, alpha); -\&. -\&. -\&.\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_Surface\fR\fR, \fI\fBSDL_MapRGB\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_PollEvent.3 b/docs/man3/SDL_PollEvent.3 deleted file mode 100644 index 6197f7e1b6..0000000000 --- a/docs/man3/SDL_PollEvent.3 +++ /dev/null @@ -1,44 +0,0 @@ -.TH "SDL_PollEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_PollEvent \- Polls for currently pending events\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_PollEvent\fP\fR(\fBSDL_Event *event\fR); -.SH "DESCRIPTION" -.PP -Polls for currently pending events, and returns \fB1\fR if there are any pending events, or \fB0\fR if there are none available\&. -.PP -If \fBevent\fR is not \fBNULL\fP, the next event is removed from the queue and stored in that area\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWSDL_Event event; /* Event structure */ - -\&. -\&. -\&. -/* Check for events */ -while(SDL_PollEvent(&event)){ /* Loop until there are no events left on the queue */ - switch(event\&.type){ /* Process the appropiate event type */ - case SDL_KEYDOWN: /* Handle a KEYDOWN event */ - printf("Oh! Key press -"); - break; - case SDL_MOUSEMOTION: - \&. - \&. - \&. - default: /* Report an unhandled event */ - printf("I don\&'t know what this event is! -"); - } -}\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_WaitEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_PumpEvents.3 b/docs/man3/SDL_PumpEvents.3 deleted file mode 100644 index 62cc13d9e0..0000000000 --- a/docs/man3/SDL_PumpEvents.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "SDL_PumpEvents" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_PumpEvents \- Pumps the event loop, gathering events from the input devices\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_PumpEvents\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -Pumps the event loop, gathering events from the input devices\&. -.PP -\fBSDL_PumpEvents\fP gathers all the pending input information from devices and places it on the event queue\&. Without calls to \fBSDL_PumpEvents\fP no events would ever be placed on the queue\&. Often calls the need for \fBSDL_PumpEvents\fP is hidden from the user since \fI\fBSDL_PollEvent\fP\fR and \fI\fBSDL_WaitEvent\fP\fR implicitly call \fBSDL_PumpEvents\fP\&. However, if you are not polling or waiting for events (e\&.g\&. your filtering them), then you must call \fBSDL_PumpEvents\fP to force an event queue update\&. -.PP -.RS -\fBNote: -.PP -You can only call this function in the thread that set the video mode\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_PollEvent\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_PushEvent.3 b/docs/man3/SDL_PushEvent.3 deleted file mode 100644 index 4be188f125..0000000000 --- a/docs/man3/SDL_PushEvent.3 +++ /dev/null @@ -1,27 +0,0 @@ -.TH "SDL_PushEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_PushEvent \- Pushes an event onto the event queue -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_PushEvent\fP\fR(\fBSDL_Event *event\fR); -.SH "DESCRIPTION" -.PP -The event queue can actually be used as a two way communication channel\&. Not only can events be read from the queue, but the user can also push their own events onto it\&. \fBevent\fR is a pointer to the event structure you wish to push onto the queue\&. -.PP -.RS -\fBNote: -.PP -Pushing device input events onto the queue doesn\&'t modify the state of the device within SDL\&. -.RE -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on success or \fB-1\fR if the event couldn\&'t be pushed\&. -.SH "EXAMPLES" -.PP -See \fI\fBSDL_Event\fR\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR, \fI\fBSDL_Event\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_Quit.3 b/docs/man3/SDL_Quit.3 deleted file mode 100644 index 42fe8c1b2d..0000000000 --- a/docs/man3/SDL_Quit.3 +++ /dev/null @@ -1,29 +0,0 @@ -.TH "SDL_Quit" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Quit \- Shut down SDL -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_Quit\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_Quit\fP shuts down all SDL subsystems and frees the resources allocated to them\&. This should always be called before you exit\&. For the sake of simplicity you can set \fBSDL_Quit\fP as your \fBatexit\fP call, like: -.PP -.nf -\f(CWSDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); -atexit(SDL_Quit); -\&. -\&.\fR -.fi -.PP -.PP -.RS -\fBNote: -.PP -While using \fBatexit\fP maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code\&. Plus, using \fBatexit\fP in a library is a sure way to crash dynamically loaded code -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_QuitSubsystem\fP\fR, \fI\fBSDL_Init\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_QuitEvent.3 b/docs/man3/SDL_QuitEvent.3 deleted file mode 100644 index c357e2a31c..0000000000 --- a/docs/man3/SDL_QuitEvent.3 +++ /dev/null @@ -1,30 +0,0 @@ -.TH "SDL_QuitEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_QuitEvent \- Quit requested event -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type -} SDL_QuitEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_QUIT\fP -.SH "DESCRIPTION" -.PP -\fBSDL_QuitEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used whan an event of type \fBSDL_QUIT\fP is reported\&. -.PP -As can be seen, the SDL_QuitEvent structure serves no useful purpose\&. The event itself, on the other hand, is very important\&. If you filter out or ignore a quit event then it is impossible for the user to close the window\&. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible\&. -.PP -.RS -\fBNote: -.PP -The macro \fBSDL_QuitRequested\fP will return non-zero if a quit event is pending -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_QuitSubSystem.3 b/docs/man3/SDL_QuitSubSystem.3 deleted file mode 100644 index 79e3ca592d..0000000000 --- a/docs/man3/SDL_QuitSubSystem.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_QuitSubSystem" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_QuitSubSystem \- Shut down a subsystem -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_QuitSubSystem\fP\fR(\fBUint32 flags\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_QuitSubSystem\fP allows you to shut down a subsystem that has been previously initialized by \fI\fBSDL_Init\fP\fR or \fI\fBSDL_InitSubSystem\fP\fR\&. The \fBflags\fR tells \fBSDL_QuitSubSystem\fP which subsystems to shut down, it uses the same values that are passed to \fI\fBSDL_Init\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Quit\fP\fR, \fI\fBSDL_Init\fP\fR, \fI\fBSDL_InitSubSystem\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_RWFromFile.3 b/docs/man3/SDL_RWFromFile.3 deleted file mode 100644 index 9ea68b93d7..0000000000 --- a/docs/man3/SDL_RWFromFile.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_FunctionName" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_FunctionName \- Short description of function -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBreturn type\fBSDL_FunctionName\fP\fR(\fBparameter\fR); -.SH "DESCRIPTION" -.PP -Full description -.SH "EXAMPLES" -.PP -examples here -.SH "SEE ALSO" -.PP -\fISDL_AnotherFunction\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_Rect.3 b/docs/man3/SDL_Rect.3 deleted file mode 100644 index 8db224de65..0000000000 --- a/docs/man3/SDL_Rect.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "SDL_Rect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Rect \- Defines a rectangular area -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Sint16 x, y; - Uint16 w, h; -} SDL_Rect;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBx, y\fR -Position of the upper-left corner of the rectangle -.TP 20 -\fBw, h\fR -The width and height of the rectangle -.SH "DESCRIPTION" -.PP -A \fBSDL_Rect\fR defines a rectangular area of pixels\&. It is used by \fI\fBSDL_BlitSurface\fP\fR to define blitting regions and by several other video functions\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_UpdateRect\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_RemoveTimer.3 b/docs/man3/SDL_RemoveTimer.3 deleted file mode 100644 index 1203c6f54f..0000000000 --- a/docs/man3/SDL_RemoveTimer.3 +++ /dev/null @@ -1,25 +0,0 @@ -.TH "SDL_RemoveTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_RemoveTimer \- Remove a timer which was added with \fISDL_AddTimer\fR\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_bool \fBSDL_RemoveTimer\fP\fR(\fBSDL_TimerID id\fR); -.SH "DESCRIPTION" -.PP -Removes a timer callback previously added with \fISDL_AddTimer\fR\&. -.SH "RETURN VALUE" -.PP -Returns a boolean value indicating success\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWSDL_RemoveTimer(my_timer_id);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_AddTimer\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_ResizeEvent.3 b/docs/man3/SDL_ResizeEvent.3 deleted file mode 100644 index 7b0a5e2650..0000000000 --- a/docs/man3/SDL_ResizeEvent.3 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "SDL_ResizeEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ResizeEvent \- Window resize event structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - int w, h; -} SDL_ResizeEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_VIDEORESIZE\fP -.TP 20 -\fBw\fR, \fBh\fR -New width and height of the window -.SH "DESCRIPTION" -.PP -\fBSDL_ResizeEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_VIDEORESIZE\fP is reported\&. -.PP -When \fBSDL_RESIZABLE\fP is passed as a \fBflag\fR to \fI\fBSDL_SetVideoMode\fP\fR the user is allowed to resize the applications window\&. When the window is resized an \fBSDL_VIDEORESIZE\fP is report, with the new window width and height values stored in \fBw\fR and \fBh\fR, respectively\&. When an \fBSDL_VIDEORESIZE\fP is received the window should be resized to the new dimensions using \fI\fBSDL_SetVideoMode\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetVideoMode\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_SaveBMP.3 b/docs/man3/SDL_SaveBMP.3 deleted file mode 100644 index 61e00dd51d..0000000000 --- a/docs/man3/SDL_SaveBMP.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_SaveBMP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SaveBMP \- Save an SDL_Surface as a Windows BMP file\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SaveBMP\fP\fR(\fBSDL_Surface *surface, const char *file\fR); -.SH "DESCRIPTION" -.PP -Saves the \fBSDL_Surface\fR \fBsurface\fR as a Windows BMP file named \fBfile\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR if successful or \fB-1\fR if there was an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_LoadBMP\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SemPost.3 b/docs/man3/SDL_SemPost.3 deleted file mode 100644 index 5487d2d5ac..0000000000 --- a/docs/man3/SDL_SemPost.3 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "SDL_SemPost" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SemPost \- Unlock a semaphore\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_SemPost\fP\fR(\fBSDL_sem *sem\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_SemPost\fP unlocks the semaphore pointed to by \fBsem\fR and atomically increments the semaphores value\&. Threads that were blocking on the semaphore may be scheduled after this call succeeds\&. -.PP -\fBSDL_SemPost\fP should be called after a semaphore is locked by a successful call to \fISDL_SemWait\fR, \fISDL_SemTryWait\fR or \fISDL_SemWaitTimeout\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR if successful or \fB-1\fR if there was an error (leaving the semaphore unchanged)\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWSDL_SemPost(my_sem);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemValue\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemTryWait.3 b/docs/man3/SDL_SemTryWait.3 deleted file mode 100644 index aee9aff191..0000000000 --- a/docs/man3/SDL_SemTryWait.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "SDL_SemTryWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SemTryWait \- Attempt to lock a semaphore but don\&'t suspend the thread\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_SemTryWait\fP\fR(\fBSDL_sem *sem\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_SemTryWait\fP is a non-blocking varient of \fI\fBSDL_SemWait\fP\fR\&. If the value of the semaphore pointed to by \fBsem\fR is positive it will atomically decrement the semaphore value and return 0, otherwise it will return \fBSDL_MUTEX_TIMEOUT\fR instead of suspending the thread\&. -.PP -After \fBSDL_SemTryWait\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR if the semaphore was successfully locked or either \fBSDL_MUTEX_TIMEOUT\fR or \fB-1\fR if the thread would have suspended or there was an error, respectivly\&. -.PP -If the semaphore was not successfully locked, the semaphore will be unchanged\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWres = SDL_SemTryWait(my_sem); - -if (res == SDL_MUTEX_TIMEOUT) { - return TRY_AGAIN; -} -if (res == -1) { - return WAIT_ERROR; -} - -\&.\&.\&. - -SDL_SemPost(my_sem);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemValue.3 b/docs/man3/SDL_SemValue.3 deleted file mode 100644 index 0703143999..0000000000 --- a/docs/man3/SDL_SemValue.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "SDL_SemValue" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SemValue \- Return the current value of a semaphore\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL/SDL_thread\&.h" -.sp -\fBUint32 \fBSDL_SemValue\fP\fR(\fBSDL_sem *sem\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_SemValue()\fP returns the current semaphore value from the semaphore pointed to by \fBsem\fR\&. -.SH "RETURN VALUE" -.PP -Returns current value of the semaphore\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CW sem_value = SDL_SemValue(my_sem);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemWait.3 b/docs/man3/SDL_SemWait.3 deleted file mode 100644 index b7bba3fb73..0000000000 --- a/docs/man3/SDL_SemWait.3 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "SDL_SemWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SemWait \- Lock a semaphore and suspend the thread if the semaphore value is zero\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_SemWait\fP\fR(\fBSDL_sem *sem\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_SemWait()\fP suspends the calling thread until either the semaphore pointed to by \fBsem\fR has a positive value, the call is interrupted by a signal or error\&. If the call is successful it will atomically decrement the semaphore value\&. -.PP -After \fBSDL_SemWait()\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR if successful or \fB-1\fR if there was an error (leaving the semaphore unchanged)\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWif (SDL_SemWait(my_sem) == -1) { - return WAIT_FAILED; -} - -\&.\&.\&. - -SDL_SemPost(my_sem);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SemWaitTimeout.3 b/docs/man3/SDL_SemWaitTimeout.3 deleted file mode 100644 index 8afd1cb609..0000000000 --- a/docs/man3/SDL_SemWaitTimeout.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "SDL_SemWaitTimeout" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SemWaitTimeout \- Lock a semaphore, but only wait up to a specified maximum time\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_SemWaitTimeout\fP\fR(\fBSDL_sem *sem, Uint32 timeout\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_SemWaitTimeout()\fP is a varient of \fISDL_SemWait\fR with a maximum timeout value\&. If the value of the semaphore pointed to by \fBsem\fR is positive (greater than zero) it will atomically decrement the semaphore value and return 0, otherwise it will wait up to \fBtimeout\fR milliseconds trying to lock the semaphore\&. This function is to be avoided if possible since on some platforms it is implemented by polling the semaphore every millisecond in a busy loop\&. -.PP -After \fBSDL_SemWaitTimeout()\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR if the semaphore was successfully locked or either \fBSDL_MUTEX_TIMEOUT\fR or \fB-1\fR if the timeout period was exceeded or there was an error, respectivly\&. -.PP -If the semaphore was not successfully locked, the semaphore will be unchanged\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWres = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC); - -if (res == SDL_MUTEX_TIMEOUT) { - return TRY_AGAIN; -} -if (res == -1) { - return WAIT_ERROR; -} - -\&.\&.\&. - -SDL_SemPost(my_sem);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SetAlpha.3 b/docs/man3/SDL_SetAlpha.3 deleted file mode 100644 index 282ecdedc5..0000000000 --- a/docs/man3/SDL_SetAlpha.3 +++ /dev/null @@ -1,66 +0,0 @@ -.TH "SDL_SetAlpha" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetAlpha \- Adjust the alpha properties of a surface -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SetAlpha\fP\fR(\fBSDL_Surface *surface, Uint32 flag, Uint8 alpha\fR); -.SH "DESCRIPTION" -.PP -.RS -\fBNote: -.PP -This function and the semantics of SDL alpha blending have changed since version 1\&.1\&.4\&. Up until version 1\&.1\&.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent\&. This has now been inverted: 0 (\fBSDL_ALPHA_TRANSPARENT\fP) is now considered transparent and 255 (\fBSDL_ALPHA_OPAQUE\fP) is now considered opaque\&. -.RE -.PP -\fBSDL_SetAlpha\fP is used for setting the per-surface alpha value and/or enabling and disabling alpha blending\&. -.PP -The\fBsurface\fR parameter specifies which surface whose alpha attributes you wish to adjust\&. \fBflags\fR is used to specify whether alpha blending should be used (\fBSDL_SRCALPHA\fP) and whether the surface should use RLE acceleration for blitting (\fBSDL_RLEACCEL\fP)\&. \fBflags\fR can be an OR\&'d combination of these two options, one of these options or 0\&. If \fBSDL_SRCALPHA\fP is not passed as a flag then all alpha information is ignored when blitting the surface\&. The \fBalpha\fR parameter is the per-surface alpha value; a surface need not have an alpha channel to use per-surface alpha and blitting can still be accelerated with \fBSDL_RLEACCEL\fP\&. -.PP -.RS -\fBNote: -.PP -The per-surface alpha value of 128 is considered a special case and is optimised, so it\&'s much faster than other per-surface values\&. -.RE -.PP -Alpha effects surface blitting in the following ways: -.TP 20 -RGBA->RGB with \fBSDL_SRCALPHA\fP -The source is alpha-blended with the destination, using the alpha channel\&. \fBSDL_SRCCOLORKEY\fP and the per-surface alpha are ignored\&. -.TP 20 -RGBA->RGB without \fBSDL_SRCALPHA\fP -The RGB data is copied from the source\&. The source alpha channel and the per-surface alpha value are ignored\&. -.TP 20 -RGB->RGBA with \fBSDL_SRCALPHA\fP -The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. The alpha channel of the copied pixels is set to opaque\&. -.TP 20 -RGB->RGBA without \fBSDL_SRCALPHA\fP -The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. -.TP 20 -RGBA->RGBA with \fBSDL_SRCALPHA\fP -The source is alpha-blended with the destination using the source alpha channel\&. The alpha channel in the destination surface is left untouched\&. \fBSDL_SRCCOLORKEY\fP is ignored\&. -.TP 20 -RGBA->RGBA without \fBSDL_SRCALPHA\fP -The RGBA data is copied to the destination surface\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. -.TP 20 -RGB->RGB with \fBSDL_SRCALPHA\fP -The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. -.TP 20 -RGB->RGB without \fBSDL_SRCALPHA\fP -The RGB data is copied from the source\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. -.PP -.RS -\fBNote: -.PP - Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha of the destination surface\&. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them; the destination alpha will work as a mask\&. -.PP -Also note that per-pixel and per-surface alpha cannot be combined; the per-pixel alpha is always used if available -.RE -.SH "RETURN VALUE" -.PP -This function returns \fB0\fR, or \fB-1\fR if there was an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR, \fI\fBSDL_BlitSurface\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetClipRect.3 b/docs/man3/SDL_SetClipRect.3 deleted file mode 100644 index a1bde0818c..0000000000 --- a/docs/man3/SDL_SetClipRect.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "SDL_SetClipRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetClipRect \- Sets the clipping rectangle for a surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_SetClipRect\fP\fR(\fBSDL_Surface *surface, SDL_Rect *rect\fR); -.SH "DESCRIPTION" -.PP -Sets the clipping rectangle for a surface\&. When this surface is the destination of a blit, only the area within the clip rectangle will be drawn into\&. -.PP -The rectangle pointed to by \fBrect\fR will be clipped to the edges of the surface so that the clip rectangle for a surface can never fall outside the edges of the surface\&. -.PP -If \fBrect\fR is \fBNULL\fP the clipping rectangle will be set to the full size of the surface\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetClipRect\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Surface\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetColorKey.3 b/docs/man3/SDL_SetColorKey.3 deleted file mode 100644 index 36f88934a1..0000000000 --- a/docs/man3/SDL_SetColorKey.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "SDL_SetColorKey" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetColorKey \- Sets the color key (transparent pixel) in a blittable surface and RLE acceleration\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SetColorKey\fP\fR(\fBSDL_Surface *surface, Uint32 flag, Uint32 key\fR); -.SH "DESCRIPTION" -.PP - Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration\&. -.PP -RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i\&.e\&., pixels that match the \fBkey\fR value)\&. The \fBkey\fR must be of the same pixel format as the \fBsurface\fR, \fI\fBSDL_MapRGB\fP\fR is often useful for obtaining an acceptable value\&. -.PP -If \fBflag\fR is \fBSDL_SRCCOLORKEY\fP then \fBkey\fR is the transparent pixel value in the source image of a blit\&. -.PP -If \fBflag\fR is OR\&'d with \fBSDL_RLEACCEL\fP then the surface will be draw using RLE acceleration when drawn with \fISDL_BlitSurface\fR\&. The surface will actually be encoded for RLE acceleration the first time \fISDL_BlitSurface\fR or \fISDL_DisplayFormat\fR is called on the surface\&. -.PP -If \fBflag\fR is 0, this function clears any current color key\&. -.SH "RETURN VALUE" -.PP -This function returns \fB0\fR, or \fB-1\fR if there was an error\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_DisplayFormat\fP\fR, \fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_SetAlpha\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetColors.3 b/docs/man3/SDL_SetColors.3 deleted file mode 100644 index 7137a6c37d..0000000000 --- a/docs/man3/SDL_SetColors.3 +++ /dev/null @@ -1,57 +0,0 @@ -.TH "SDL_SetColors" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetColors \- Sets a portion of the colormap for the given 8-bit surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SetColors\fP\fR(\fBSDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors\fR); -.SH "DESCRIPTION" -.PP -Sets a portion of the colormap for the given 8-bit surface\&. -.PP -When \fBsurface\fR is the surface associated with the current display, the display colormap will be updated with the requested colors\&. If \fBSDL_HWPALETTE\fP was set in \fISDL_SetVideoMode\fR flags, \fBSDL_SetColors\fP will always return \fB1\fR, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation\&. -.PP -The color components of a \fI\fBSDL_Color\fR\fR structure are 8-bits in size, giving you a total of 256^3 =16777216 colors\&. -.PP -Palettized (8-bit) screen surfaces with the \fBSDL_HWPALETTE\fP flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display)\&. \fBSDL_SetColors\fP modifies both palettes (if present), and is equivalent to calling \fISDL_SetPalette\fR with the \fBflags\fR set to \fB(SDL_LOGPAL | SDL_PHYSPAL)\fP\&. -.SH "RETURN VALUE" -.PP -If \fBsurface\fR is not a palettized surface, this function does nothing, returning \fB0\fR\&. If all of the colors were set as passed to \fBSDL_SetColors\fP, it will return \fB1\fR\&. If not all the color entries were set exactly as given, it will return \fB0\fR, and you should look at the surface palette to determine the actual color palette\&. -.SH "EXAMPLE" -.PP -.nf -\f(CW/* Create a display surface with a grayscale palette */ -SDL_Surface *screen; -SDL_Color colors[256]; -int i; -\&. -\&. -\&. -/* Fill colors with color information */ -for(i=0;i<256;i++){ - colors[i]\&.r=i; - colors[i]\&.g=i; - colors[i]\&.b=i; -} - -/* Create display */ -screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE); -if(!screen){ - printf("Couldn\&'t set video mode: %s -", SDL_GetError()); - exit(-1); -} - -/* Set palette */ -SDL_SetColors(screen, colors, 0, 256); -\&. -\&. -\&. -\&.\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_Color\fR\fR \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_SetPalette\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetCursor.3 b/docs/man3/SDL_SetCursor.3 deleted file mode 100644 index 78c4cf9f58..0000000000 --- a/docs/man3/SDL_SetCursor.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_SetCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetCursor \- Set the currently active mouse cursor\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_SetCursor\fP\fR(\fBSDL_Cursor *cursor\fR); -.SH "DESCRIPTION" -.PP -Sets the currently active cursor to the specified one\&. If the cursor is currently visible, the change will be immediately represented on the display\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetCursor\fP\fR, \fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetEventFilter.3 b/docs/man3/SDL_SetEventFilter.3 deleted file mode 100644 index 8d3ed034e3..0000000000 --- a/docs/man3/SDL_SetEventFilter.3 +++ /dev/null @@ -1,35 +0,0 @@ -.TH "SDL_SetEventFilter" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetEventFilter \- Sets up a filter to process all events before they are posted to the event queue\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_SetEventFilter\fP\fR(\fBSDL_EventFilter filter\fR); -.SH "DESCRIPTION" -.PP -This function sets up a filter to process all events before they are posted to the event queue\&. This is a very powerful and flexible feature\&. The filter is prototyped as: -.PP -.nf -\f(CWtypedef int (*SDL_EventFilter)(const SDL_Event *event);\fR -.fi -.PP - If the filter returns \fB1\fR, then the event will be added to the internal queue\&. If it returns \fB0\fR, then the event will be dropped from the queue\&. This allows selective filtering of dynamically\&. -.PP -There is one caveat when dealing with the \fBSDL_QUITEVENT\fP event type\&. The event filter is only called when the window manager desires to close the application window\&. If the event filter returns 1, then the window will be closed, otherwise the window will remain open if possible\&. If the quit event is generated by an interrupt signal, it will bypass the internal queue and be delivered to the application at the next event poll\&. -.PP -.RS -\fBNote: -.PP -Events pushed onto the queue with \fI\fBSDL_PushEvent\fP\fR or \fI\fBSDL_PeepEvents\fP\fR do not get passed through the event filter\&. -.RE -.PP -.RS -\fBNote: -.PP -\fIBe Careful!\fP The event filter function may run in a different thread so be careful what you do within it\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_GetEventFilter\fP\fR, \fI\fBSDL_PushEvent\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59 diff --git a/docs/man3/SDL_SetGamma.3 b/docs/man3/SDL_SetGamma.3 deleted file mode 100644 index 4897272d01..0000000000 --- a/docs/man3/SDL_SetGamma.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_SetGamma" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetGamma \- Sets the color gamma function for the display -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SetGamma\fP\fR(\fBfloat redgamma, float greengamma, float bluegamma\fR); -.SH "DESCRIPTION" -.PP -Sets the "gamma function" for the display of each color component\&. Gamma controls the brightness/contrast of colors displayed on the screen\&. A gamma value of 1\&.0 is identity (i\&.e\&., no adjustment is made)\&. -.PP -This function adjusts the gamma based on the "gamma function" parameter, you can directly specify lookup tables for gamma adjustment with \fISDL_SetGammaRamp\fR\&. -.PP -Not all display hardware is able to change gamma\&. -.SH "RETURN VALUE" -.PP -Returns -1 on error (or if gamma adjustment is not supported)\&. -.SH "SEE ALSO" -.PP -\fISDL_GetGammaRamp\fR \fISDL_SetGammaRamp\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetGammaRamp.3 b/docs/man3/SDL_SetGammaRamp.3 deleted file mode 100644 index 52bf9f5914..0000000000 --- a/docs/man3/SDL_SetGammaRamp.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "SDL_SetGammaRamp" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetGammaRamp \- Sets the color gamma lookup tables for the display -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SetGammaRamp\fP\fR(\fBUint16 *redtable, Uint16 *greentable, Uint16 *bluetable\fR); -.SH "DESCRIPTION" -.PP -Sets the gamma lookup tables for the display for each color component\&. Each table is an array of 256 Uint16 values, representing a mapping between the input and output for that channel\&. The input is the index into the array, and the output is the 16-bit gamma value at that index, scaled to the output color precision\&. You may pass NULL to any of the channels to leave them unchanged\&. -.PP -This function adjusts the gamma based on lookup tables, you can also have the gamma calculated based on a "gamma function" parameter with \fISDL_SetGamma\fR\&. -.PP -Not all display hardware is able to change gamma\&. -.SH "RETURN VALUE" -.PP -Returns -1 on error (or if gamma adjustment is not supported)\&. -.SH "SEE ALSO" -.PP -\fISDL_SetGamma\fR \fISDL_GetGammaRamp\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetModState.3 b/docs/man3/SDL_SetModState.3 deleted file mode 100644 index f356ca1e5f..0000000000 --- a/docs/man3/SDL_SetModState.3 +++ /dev/null @@ -1,35 +0,0 @@ -.TH "SDL_SetModState" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetModState \- Set the current key modifier state -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_SetModState\fP\fR(\fBSDLMod modstate\fR); -.SH "DESCRIPTION" -.PP -The inverse of \fI\fBSDL_GetModState\fP\fR, \fBSDL_SetModState\fP allows you to impose modifier key states on your application\&. -.PP -Simply pass your desired modifier states into \fBmodstate\fR\&. This value my be a logical OR\&'d combination of the following: -.PP -.nf -\f(CWtypedef enum { - KMOD_NONE = 0x0000, - KMOD_LSHIFT= 0x0001, - KMOD_RSHIFT= 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LMETA = 0x0400, - KMOD_RMETA = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, -} SDLMod;\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_GetModState\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_SetPalette.3 b/docs/man3/SDL_SetPalette.3 deleted file mode 100644 index a2ca3f618e..0000000000 --- a/docs/man3/SDL_SetPalette.3 +++ /dev/null @@ -1,59 +0,0 @@ -.TH "SDL_SetPalette" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetPalette \- Sets the colors in the palette of an 8-bit surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SetPalette\fP\fR(\fBSDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors\fR); -.SH "DESCRIPTION" -.PP -Sets a portion of the palette for the given 8-bit surface\&. -.PP -Palettized (8-bit) screen surfaces with the \fBSDL_HWPALETTE\fP flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display)\&. \fISDL_BlitSurface\fR always uses the logical palette when blitting surfaces (if it has to convert between surface pixel formats)\&. Because of this, it is often useful to modify only one or the other palette to achieve various special color effects (e\&.g\&., screen fading, color flashes, screen dimming)\&. -.PP -This function can modify either the logical or physical palette by specifing \fBSDL_LOGPAL\fP or \fBSDL_PHYSPAL\fPthe in the \fBflags\fR parameter\&. -.PP -When \fBsurface\fR is the surface associated with the current display, the display colormap will be updated with the requested colors\&. If \fBSDL_HWPALETTE\fP was set in \fISDL_SetVideoMode\fR flags, \fBSDL_SetPalette\fP will always return \fB1\fR, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation\&. -.PP -The color components of a \fI\fBSDL_Color\fR\fR structure are 8-bits in size, giving you a total of 256^3=16777216 colors\&. -.SH "RETURN VALUE" -.PP -If \fBsurface\fR is not a palettized surface, this function does nothing, returning \fB0\fR\&. If all of the colors were set as passed to \fBSDL_SetPalette\fP, it will return \fB1\fR\&. If not all the color entries were set exactly as given, it will return \fB0\fR, and you should look at the surface palette to determine the actual color palette\&. -.SH "EXAMPLE" -.PP -.nf -\f(CW /* Create a display surface with a grayscale palette */ - SDL_Surface *screen; - SDL_Color colors[256]; - int i; - \&. - \&. - \&. - /* Fill colors with color information */ - for(i=0;i<256;i++){ - colors[i]\&.r=i; - colors[i]\&.g=i; - colors[i]\&.b=i; - } - - /* Create display */ - screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE); - if(!screen){ - printf("Couldn\&'t set video mode: %s -", SDL_GetError()); - exit(-1); - } - - /* Set palette */ - SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256); - \&. - \&. - \&. - \&.\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fISDL_SetColors\fR, \fISDL_SetVideoMode\fR, \fISDL_Surface\fR, \fISDL_Color\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetTimer.3 b/docs/man3/SDL_SetTimer.3 deleted file mode 100644 index 418ac86b7d..0000000000 --- a/docs/man3/SDL_SetTimer.3 +++ /dev/null @@ -1,39 +0,0 @@ -.TH "SDL_SetTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetTimer \- Set a callback to run after the specified number of milliseconds has elapsed\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_SetTimer\fP\fR(\fBUint32 interval, SDL_TimerCallback callback\fR); -.SH "CALLBACK" -.PP -/* Function prototype for the timer callback function */ typedef Uint32 (*SDL_TimerCallback)(Uint32 interval); -.SH "DESCRIPTION" -.PP -Set a callback to run after the specified number of milliseconds has elapsed\&. The callback function is passed the current timer interval and returns the next timer interval\&. If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled\&. -.PP -To cancel a currently running timer, call \fBSDL_SetTimer(0, NULL);\fP -.PP -The timer callback function may run in a different thread than your main constant, and so shouldn\&'t call any functions from within itself\&. -.PP -The maximum resolution of this timer is 10 ms, which means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system\&. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below)\&. -.PP -If you use this function, you need to pass \fBSDL_INIT_TIMER\fP to \fBSDL_Init()\fP\&. -.PP -.RS -\fBNote: -.PP -This function is kept for compatibility but has been superseded by the new timer functions \fISDL_AddTimer\fR and \fISDL_RemoveTimer\fR which support multiple timers\&. -.RE -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWSDL_SetTimer((33/10)*10, my_callback);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_AddTimer\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SetVideoMode.3 b/docs/man3/SDL_SetVideoMode.3 deleted file mode 100644 index 95defb1836..0000000000 --- a/docs/man3/SDL_SetVideoMode.3 +++ /dev/null @@ -1,67 +0,0 @@ -.TH "SDL_SetVideoMode" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SetVideoMode \- Set up a video mode with the specified width, height and bits-per-pixel\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_Surface *\fBSDL_SetVideoMode\fP\fR(\fBint width, int height, int bpp, Uint32 flags\fR); -.SH "DESCRIPTION" -.PP -Set up a video mode with the specified width, height and bits-per-pixel\&. -.PP -If \fBbpp\fR is 0, it is treated as the current display bits per pixel\&. -.PP -The \fBflags\fR parameter is the same as the \fBflags\fR field of the \fI\fBSDL_Surface\fR\fR structure\&. OR\&'d combinations of the following values are valid\&. -.TP 20 -\fBSDL_SWSURFACE\fP -Create the video surface in system memory -.TP 20 -\fBSDL_HWSURFACE\fP -Create the video surface in video memory -.TP 20 -\fBSDL_ASYNCBLIT\fP -Enables the use of asynchronous updates of the display surface\&. This will usually slow down blitting on single CPU machines, but may provide a speed increase on SMP systems\&. -.TP 20 -\fBSDL_ANYFORMAT\fP -Normally, if a video surface of the requested bits-per-pixel (\fBbpp\fR) is not available, SDL will emulate one with a shadow surface\&. Passing \fBSDL_ANYFORMAT\fP prevents this and causes SDL to use the video surface, regardless of its pixel depth\&. -.TP 20 -\fBSDL_HWPALETTE\fP -Give SDL exclusive palette access\&. Without this flag you may not always get the the colors you request with \fI\fBSDL_SetColors\fP\fR or \fI\fBSDL_SetPalette\fP\fR\&. -.TP 20 -\fBSDL_DOUBLEBUF\fP -Enable hardware double buffering; only valid with SDL_HWSURFACE\&. Calling \fI\fBSDL_Flip\fP\fR will flip the buffers and update the screen\&. All drawing will take place on the surface that is not displayed at the moment\&. If double buffering could not be enabled then \fBSDL_Flip\fP will just perform a \fI\fBSDL_UpdateRect\fP\fR on the entire screen\&. -.TP 20 -\fBSDL_FULLSCREEN\fP -SDL will attempt to use a fullscreen mode\&. If a hardware resolution change is not possible (for whatever reason), the next higher resolution will be used and the display window centered on a black background\&. -.TP 20 -\fBSDL_OPENGL\fP -Create an OpenGL rendering context\&. You should have previously set OpenGL video attributes with \fI\fBSDL_GL_SetAttribute\fP\fR\&. -.TP 20 -\fBSDL_OPENGLBLIT\fP -Create an OpenGL rendering context, like above, but allow normal blitting operations\&. The screen (2D) surface may have an alpha channel, and \fI\fBSDL_UpdateRects\fP\fR must be used for updating changes to the screen surface\&. -.TP 20 -\fBSDL_RESIZABLE\fP -Create a resizable window\&. When the window is resized by the user a \fI\fBSDL_VIDEORESIZE\fP\fR event is generated and \fBSDL_SetVideoMode\fP can be called again with the new size\&. -.TP 20 -\fBSDL_NOFRAME\fP -If possible, \fBSDL_NOFRAME\fP causes SDL to create a window with no title bar or frame decoration\&. Fullscreen modes automatically have this flag set\&. -.PP -.RS -\fBNote: -.PP -Whatever \fBflags\fR \fBSDL_SetVideoMode\fP could satisfy are set in the \fBflags\fR member of the returned surface\&. -.RE -.PP -.RS -\fBNote: -.PP -The \fBbpp\fR parameter is the number of bits per pixel, so a \fBbpp\fR of 24 uses the packed representation of 3 bytes/pixel\&. For the more common 4 bytes/pixel mode, use a \fBbpp\fR of 32\&. Somewhat oddly, both 15 and 16 will request a 2 bytes/pixel mode, but different pixel formats\&. -.RE -.SH "RETURN VALUE" -.PP -The framebuffer surface, or \fBNULL\fR if it fails\&. The surface returned is freed by SDL_Quit() and should nt be freed by the caller\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_SetColors\fP\fR, \fI\fBSDL_Flip\fP\fR, \fI\fBSDL_Surface\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_ShowCursor.3 b/docs/man3/SDL_ShowCursor.3 deleted file mode 100644 index 0376415c0e..0000000000 --- a/docs/man3/SDL_ShowCursor.3 +++ /dev/null @@ -1,20 +0,0 @@ -.TH "SDL_ShowCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ShowCursor \- Toggle whether or not the cursor is shown on the screen\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_ShowCursor\fP\fR(\fBint toggle\fR); -.SH "DESCRIPTION" -.PP -Toggle whether or not the cursor is shown on the screen\&. Passing \fBSDL_ENABLE\fP displays the cursor and passing \fBSDL_DISABLE\fP hides it\&. The current state of the mouse cursor can be queried by passing \fBSDL_QUERY\fP, either \fBSDL_DISABLE\fP or \fBSDL_ENABLE\fP will be returned\&. -.PP -The cursor starts off displayed, but can be turned off\&. -.SH "RETURN VALUE" -.PP -Returns the current state of the cursor\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_Surface.3 b/docs/man3/SDL_Surface.3 deleted file mode 100644 index 03d6ff9dc8..0000000000 --- a/docs/man3/SDL_Surface.3 +++ /dev/null @@ -1,96 +0,0 @@ -.TH "SDL_Surface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_Surface \- Graphical Surface Structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct SDL_Surface { - Uint32 flags; /* Read-only */ - SDL_PixelFormat *format; /* Read-only */ - int w, h; /* Read-only */ - Uint16 pitch; /* Read-only */ - void *pixels; /* Read-write */ - - /* clipping information */ - SDL_Rect clip_rect; /* Read-only */ - - /* Reference count -- used when freeing surface */ - int refcount; /* Read-mostly */ - - /* This structure also contains private fields not shown here */ -} SDL_Surface;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBflags\fR -Surface flags -.TP 20 -\fBformat\fR -Pixel \fIformat\fR -.TP 20 -\fBw, h\fR -Width and height of the surface -.TP 20 -\fBpitch\fR -Length of a surface scanline in bytes -.TP 20 -\fBpixels\fR -Pointer to the actual pixel data -.TP 20 -\fBclip_rect\fR -surface clip \fIrectangle\fR -.SH "DESCRIPTION" -.PP -\fBSDL_Surface\fR\&'s represent areas of "graphical" memory, memory that can be drawn to\&. The video framebuffer is returned as a \fBSDL_Surface\fR by \fI\fBSDL_SetVideoMode\fP\fR and \fI\fBSDL_GetVideoSurface\fP\fR\&. Most of the fields should be pretty obvious\&. \fBw\fR and \fBh\fR are the width and height of the surface in pixels\&. \fBpixels\fR is a pointer to the actual pixel data, the surface should be \fIlocked\fR before accessing this field\&. The \fBclip_rect\fR field is the clipping rectangle as set by \fI\fBSDL_SetClipRect\fP\fR\&. -.PP -The following are supported in the \fBflags\fR field\&. -.TP 20 -\fBSDL_SWSURFACE\fP -Surface is stored in system memory -.TP 20 -\fBSDL_HWSURFACE\fP -Surface is stored in video memory -.TP 20 -\fBSDL_ASYNCBLIT\fP -Surface uses asynchronous blits if possible -.TP 20 -\fBSDL_ANYFORMAT\fP -Allows any pixel-format (Display surface) -.TP 20 -\fBSDL_HWPALETTE\fP -Surface has exclusive palette -.TP 20 -\fBSDL_DOUBLEBUF\fP -Surface is double buffered (Display surface) -.TP 20 -\fBSDL_FULLSCREEN\fP -Surface is full screen (Display Surface) -.TP 20 -\fBSDL_OPENGL\fP -Surface has an OpenGL context (Display Surface) -.TP 20 -\fBSDL_OPENGLBLIT\fP -Surface supports OpenGL blitting (Display Surface) -.TP 20 -\fBSDL_RESIZABLE\fP -Surface is resizable (Display Surface) -.TP 20 -\fBSDL_HWACCEL\fP -Surface blit uses hardware acceleration -.TP 20 -\fBSDL_SRCCOLORKEY\fP -Surface use colorkey blitting -.TP 20 -\fBSDL_RLEACCEL\fP -Colorkey blitting is accelerated with RLE -.TP 20 -\fBSDL_SRCALPHA\fP -Surface blit uses alpha blending -.TP 20 -\fBSDL_PREALLOC\fP -Surface uses preallocated memory -.SH "SEE ALSO" -.PP -\fI\fBSDL_PixelFormat\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_SysWMEvent.3 b/docs/man3/SDL_SysWMEvent.3 deleted file mode 100644 index ca1b7abff9..0000000000 --- a/docs/man3/SDL_SysWMEvent.3 +++ /dev/null @@ -1,21 +0,0 @@ -.TH "SDL_SysWMEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_SysWMEvent \- Platform-dependent window manager event\&. -.SH "DESCRIPTION" -.PP -The system window manager event contains a pointer to system-specific information about unknown window manager events\&. If you enable this event using \fI\fBSDL_EventState()\fP\fR, it will be generated whenever unhandled events are received from the window manager\&. This can be used, for example, to implement cut-and-paste in your application\&. -.PP -.nf -\f(CWtypedef struct { - Uint8 type; /* Always SDL_SysWM */ - } SDL_SysWMEvent;\fR -.fi -.PP - If you want to obtain system-specific information about the window manager, you can fill the version member of a \fBSDL_SysWMinfo\fR structure (details can be found in \fBSDL_syswm\&.h\fP, which must be included) using the \fBSDL_VERSION()\fP macro found in \fBSDL_version\&.h\fP, and pass it to the function: -.PP -.sp -\fBint \fBSDL_GetWMInfo\fP\fR(\fBSDL_SysWMinfo *info\fR); -.SH "SEE ALSO" -.PP -\fI\fBSDL_EventState\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_ThreadID.3 b/docs/man3/SDL_ThreadID.3 deleted file mode 100644 index 10e2cf8321..0000000000 --- a/docs/man3/SDL_ThreadID.3 +++ /dev/null @@ -1,13 +0,0 @@ -.TH "SDL_ThreadID" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_ThreadID \- Get the 32-bit thread identifier for the current thread\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBUint32 \fBSDL_ThreadID\fP\fR(\fBvoid\fR) -.SH "DESCRIPTION" -.PP -Get the 32-bit thread identifier for the current thread\&. -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_UnlockAudio.3 b/docs/man3/SDL_UnlockAudio.3 deleted file mode 100644 index 85063191a2..0000000000 --- a/docs/man3/SDL_UnlockAudio.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_UnlockAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" -.SH "NAME" -SDL_UnlockAudio \- Unlock the callback function -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_UnlockAudio\fP\fR(\fBvoid\fR) -.SH "DESCRIPTION" -.PP -Unlocks a previous \fI\fBSDL_LockAudio\fP\fR call\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_OpenAudio\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 diff --git a/docs/man3/SDL_UnlockSurface.3 b/docs/man3/SDL_UnlockSurface.3 deleted file mode 100644 index a3fe5c9b6c..0000000000 --- a/docs/man3/SDL_UnlockSurface.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "SDL_UnlockSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_UnlockSurface \- Unlocks a previously locked surface\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_UnlockSurface\fP\fR(\fBSDL_Surface *surface\fR); -.SH "DESCRIPTION" -.PP -Surfaces that were previously locked using \fBSDL_LockSurface\fP must be unlocked with \fBSDL_UnlockSurface\fP\&. Surfaces should be unlocked as soon as possible\&. -.PP -It should be noted that since 1\&.1\&.8, surface locks are recursive\&. See \fI\fBSDL_LockSurface\fP\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_LockSurface\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UnlockYUVOverlay.3 b/docs/man3/SDL_UnlockYUVOverlay.3 deleted file mode 100644 index 1e6b7217eb..0000000000 --- a/docs/man3/SDL_UnlockYUVOverlay.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_UnlockYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_UnlockYUVOverlay \- Unlock an overlay -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_UnlockYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR); -.SH "DESCRIPTION" -.PP -The opposite to \fI\fBSDL_LockYUVOverlay\fP\fR\&. Unlocks a previously locked overlay\&. An overlay must be unlocked before it can be displayed\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_Overlay\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UpdateRect.3 b/docs/man3/SDL_UpdateRect.3 deleted file mode 100644 index a101a83863..0000000000 --- a/docs/man3/SDL_UpdateRect.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "SDL_UpdateRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_UpdateRect \- Makes sure the given area is updated on the given screen\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_UpdateRect\fP\fR(\fBSDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h\fR); -.SH "DESCRIPTION" -.PP -Makes sure the given area is updated on the given screen\&. The rectangle must be confined within the screen boundaries (no clipping is done)\&. -.PP -If \&'\fBx\fR\&', \&'\fBy\fR\&', \&'\fBw\fR\&' and \&'\fBh\fR\&' are all 0, \fBSDL_UpdateRect\fP will update the entire screen\&. -.PP -This function should not be called while \&'\fBscreen\fR\&' is \fIlocked\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_UpdateRects\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_LockSurface\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UpdateRects.3 b/docs/man3/SDL_UpdateRects.3 deleted file mode 100644 index 9ffdb08e05..0000000000 --- a/docs/man3/SDL_UpdateRects.3 +++ /dev/null @@ -1,25 +0,0 @@ -.TH "SDL_UpdateRects" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_UpdateRects \- Makes sure the given list of rectangles is updated on the given screen\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_UpdateRects\fP\fR(\fBSDL_Surface *screen, int numrects, SDL_Rect *rects\fR); -.SH "DESCRIPTION" -.PP -Makes sure the given list of rectangles is updated on the given screen\&. The rectangles must all be confined within the screen boundaries (no clipping is done)\&. -.PP -This function should not be called while \fBscreen\fR is \fIlocked\fR\&. -.PP -.RS -\fBNote: -.PP -It is adviced to call this function only once per frame, since each call has some processing overhead\&. This is no restriction since you can pass any number of rectangles each time\&. -.PP -The rectangles are not automatically merged or checked for overlap\&. In general, the programmer can use his knowledge about his particular rectangles to merge them in an efficient way, to avoid overdraw\&. -.RE -.SH "SEE ALSO" -.PP -\fI\fBSDL_UpdateRect\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_LockSurface\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_UserEvent.3 b/docs/man3/SDL_UserEvent.3 deleted file mode 100644 index d92ec5356a..0000000000 --- a/docs/man3/SDL_UserEvent.3 +++ /dev/null @@ -1,47 +0,0 @@ -.TH "SDL_UserEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_UserEvent \- A user-defined event type -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 type; - int code; - void *data1; - void *data2; -} SDL_UserEvent;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBtype\fR -\fBSDL_USEREVENT\fP through to \fBSDL_NUMEVENTS-1\fP -.TP 20 -\fBcode\fR -User defined event code -.TP 20 -\fBdata1\fR -User defined data pointer -.TP 20 -\fBdata2\fR -User defined data pointer -.SH "DESCRIPTION" -.PP -\fBSDL_UserEvent\fR is in the \fBuser\fR member of the structure \fI\fBSDL_Event\fR\fR\&. This event is unique, it is never created by SDL but only by the user\&. The event can be pushed onto the event queue using \fI\fBSDL_PushEvent\fP\fR\&. The contents of the structure members or completely up to the programmer, the only requirement is that \fBtype\fR is a value from \fBSDL_USEREVENT\fP to \fBSDL_NUMEVENTS-1\fP (inclusive)\&. -.SH "EXAMPLES" -.PP -.PP -.nf -\f(CWSDL_Event event; - -event\&.type = SDL_USEREVENT; -event\&.user\&.code = my_event_code; -event\&.user\&.data1 = significant_data; -event\&.user\&.data2 = 0; -SDL_PushEvent(&event);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PushEvent\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_VideoDriverName.3 b/docs/man3/SDL_VideoDriverName.3 deleted file mode 100644 index e8563b6503..0000000000 --- a/docs/man3/SDL_VideoDriverName.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_VideoDriverName" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_VideoDriverName \- Obtain the name of the video driver -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBchar *\fBSDL_VideoDriverName\fP\fR(\fBchar *namebuf, int maxlen\fR); -.SH "DESCRIPTION" -.PP -The buffer pointed to by \fBnamebuf\fR is filled up to a maximum of \fBmaxlen\fR characters (include the NULL terminator) with the name of the initialised video driver\&. The driver name is a simple one word identifier like "x11" or "windib"\&. -.SH "RETURN VALUE" -.PP -Returns \fBNULL\fP if video has not been initialised with \fBSDL_Init\fP or a pointer to \fBnamebuf\fR otherwise\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Init\fP\fR \fI\fBSDL_InitSubSystem\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_VideoInfo.3 b/docs/man3/SDL_VideoInfo.3 deleted file mode 100644 index c62e1ffdd3..0000000000 --- a/docs/man3/SDL_VideoInfo.3 +++ /dev/null @@ -1,62 +0,0 @@ -.TH "SDL_VideoInfo" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_VideoInfo \- Video Target information -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint32 hw_available:1; - Uint32 wm_available:1; - Uint32 blit_hw:1; - Uint32 blit_hw_CC:1; - Uint32 blit_hw_A:1; - Uint32 blit_sw:1; - Uint32 blit_sw_CC:1; - Uint32 blit_sw_A:1; - Uint32 blit_fill; - Uint32 video_mem; - SDL_PixelFormat *vfmt; -} SDL_VideoInfo;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBhw_available\fR -Is it possible to create hardware surfaces? -.TP 20 -\fBwm_available\fR -Is there a window manager available -.TP 20 -\fBblit_hw\fR -Are hardware to hardware blits accelerated? -.TP 20 -\fBblit_hw_CC\fR -Are hardware to hardware colorkey blits accelerated? -.TP 20 -\fBblit_hw_A\fR -Are hardware to hardware alpha blits accelerated? -.TP 20 -\fBblit_sw\fR -Are software to hardware blits accelerated? -.TP 20 -\fBblit_sw_CC\fR -Are software to hardware colorkey blits accelerated? -.TP 20 -\fBblit_sw_A\fR -Are software to hardware alpha blits accelerated? -.TP 20 -\fBblit_fill\fR -Are color fills accelerated? -.TP 20 -\fBvideo_mem\fR -Total amount of video memory in Kilobytes -.TP 20 -\fBvfmt\fR -\fIPixel format\fR of the video device -.SH "DESCRIPTION" -.PP -This (read-only) structure is returned by \fI\fBSDL_GetVideoInfo\fP\fR\&. It contains information on either the \&'best\&' available mode (if called before \fI\fBSDL_SetVideoMode\fP\fR) or the current video mode\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_GetVideoInfo\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_VideoModeOK.3 b/docs/man3/SDL_VideoModeOK.3 deleted file mode 100644 index 72c9a90733..0000000000 --- a/docs/man3/SDL_VideoModeOK.3 +++ /dev/null @@ -1,44 +0,0 @@ -.TH "SDL_VideoModeOK" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_VideoModeOK \- Check to see if a particular video mode is supported\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_VideoModeOK\fP\fR(\fBint width, int height, int bpp, Uint32 flags\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_VideoModeOK\fP returns \fB0\fR if the requested mode is not supported under any bit depth, or returns the bits-per-pixel of the closest available mode with the given width, height and requested \fIsurface\fR flags (see \fI\fBSDL_SetVideoMode\fP\fR)\&. -.PP -The bits-per-pixel value returned is only a suggested mode\&. You can usually request and bpp you want when \fIsetting\fR the video mode and SDL will emulate that color depth with a shadow video surface\&. -.PP -The arguments to \fBSDL_VideoModeOK\fP are the same ones you would pass to \fISDL_SetVideoMode\fR -.SH "EXAMPLE" -.PP -.nf -\f(CWSDL_Surface *screen; -Uint32 bpp; -\&. -\&. -\&. -printf("Checking mode 640x480@16bpp\&. -"); -bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE); - -if(!bpp){ - printf("Mode not available\&. -"); - exit(-1); -} - -printf("SDL Recommends 640x480@%dbpp\&. -", bpp); -screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE); -\&. -\&.\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GetVideoInfo\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WM_GetCaption.3 b/docs/man3/SDL_WM_GetCaption.3 deleted file mode 100644 index 68ed8b2323..0000000000 --- a/docs/man3/SDL_WM_GetCaption.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_WM_GetCaption" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WM_GetCaption \- Gets the window title and icon name\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_WM_GetCaption\fP\fR(\fBchar **title, char **icon\fR); -.SH "DESCRIPTION" -.PP -Set pointers to the window \fBtitle\fR and \fBicon\fR name\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_WM_SetCaption\fP\fR, \fI\fBSDL_WM_SetIcon\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WM_GrabInput.3 b/docs/man3/SDL_WM_GrabInput.3 deleted file mode 100644 index 556681e70d..0000000000 --- a/docs/man3/SDL_WM_GrabInput.3 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "SDL_WM_GrabInput" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WM_GrabInput \- Grabs mouse and keyboard input\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBSDL_GrabMode \fBSDL_WM_GrabInput\fP\fR(\fBSDL_GrabMode mode\fR); -.SH "DESCRIPTION" -.PP -Grabbing means that the mouse is confined to the application window, and nearly all keyboard input is passed directly to the application, and not interpreted by a window manager, if any\&. -.PP -When \fBmode\fR is \fBSDL_GRAB_QUERY\fP the grab mode is not changed, but the current grab mode is returned\&. -.PP -.PP -.nf -\f(CWtypedef enum { - SDL_GRAB_QUERY, - SDL_GRAB_OFF, - SDL_GRAB_ON -} SDL_GrabMode;\fR -.fi -.PP - -.SH "RETURN VALUE" -.PP -The current/new \fBSDL_GrabMode\fR\&. -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WM_IconifyWindow.3 b/docs/man3/SDL_WM_IconifyWindow.3 deleted file mode 100644 index 922df8f53f..0000000000 --- a/docs/man3/SDL_WM_IconifyWindow.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_WM_IconifyWindow" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WM_IconifyWindow \- Iconify/Minimise the window -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_WM_IconifyWindow\fP\fR(\fBvoid\fR); -.SH "DESCRIPTION" -.PP -If the application is running in a window managed environment SDL attempts to iconify/minimise it\&. If \fBSDL_WM_IconifyWindow\fP is successful, the application will receive a \fI\fBSDL_APPACTIVE\fP\fR loss event\&. -.SH "RETURN VALUE" -.PP -Returns non-zero on success or \fB0\fR if iconification is not support or was refused by the window manager\&. -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WM_SetCaption.3 b/docs/man3/SDL_WM_SetCaption.3 deleted file mode 100644 index 847ff5d45d..0000000000 --- a/docs/man3/SDL_WM_SetCaption.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_WM_SetCaption" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WM_SetCaption \- Sets the window tile and icon name\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_WM_SetCaption\fP\fR(\fBconst char *title, const char *icon\fR); -.SH "DESCRIPTION" -.PP -Sets the title-bar and icon name of the display window\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_WM_GetCaption\fP\fR, \fI\fBSDL_WM_SetIcon\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WM_SetIcon.3 b/docs/man3/SDL_WM_SetIcon.3 deleted file mode 100644 index 3f3a51966a..0000000000 --- a/docs/man3/SDL_WM_SetIcon.3 +++ /dev/null @@ -1,27 +0,0 @@ -.TH "SDL_WM_SetIcon" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WM_SetIcon \- Sets the icon for the display window\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_WM_SetIcon\fP\fR(\fBSDL_Surface *icon, Uint8 *mask\fR); -.SH "DESCRIPTION" -.PP -Sets the icon for the display window\&. Win32 icons must be 32x32\&. -.PP -This function must be called before the first call to \fISDL_SetVideoMode\fR\&. -.PP -It takes an \fBicon\fR surface, and a \fBmask\fR in MSB format\&. -.PP -If \fBmask\fR is \fBNULL\fP, the entire icon surface will be used as the icon\&. -.SH "EXAMPLE" -.PP -.nf -\f(CWSDL_WM_SetIcon(SDL_LoadBMP("icon\&.bmp"), NULL);\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_WM_SetCaption\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WM_ToggleFullScreen.3 b/docs/man3/SDL_WM_ToggleFullScreen.3 deleted file mode 100644 index d4cf8de151..0000000000 --- a/docs/man3/SDL_WM_ToggleFullScreen.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_WM_ToggleFullScreen" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WM_ToggleFullScreen \- Toggles fullscreen mode -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_WM_ToggleFullScreen\fP\fR(\fBSDL_Surface *surface\fR); -.SH "DESCRIPTION" -.PP -Toggles the application between windowed and fullscreen mode, if supported\&. (X11 is the only target currently supported, BeOS support is experimental)\&. -.SH "RETURN VALUE" -.PP -Returns \fB0\fR on failure or \fB1\fR on success\&. -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02 diff --git a/docs/man3/SDL_WaitEvent.3 b/docs/man3/SDL_WaitEvent.3 deleted file mode 100644 index adadb4aa61..0000000000 --- a/docs/man3/SDL_WaitEvent.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "SDL_WaitEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WaitEvent \- Waits indefinitely for the next available event\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBint \fBSDL_WaitEvent\fP\fR(\fBSDL_Event *event\fR); -.SH "DESCRIPTION" -.PP -Waits indefinitely for the next available event, returning \fB1\fR, or \fB0\fR if there was an error while waiting for events\&. -.PP -If \fBevent\fR is not \fBNULL\fP, the next event is removed from the queue and stored in that area\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PollEvent\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_WaitThread.3 b/docs/man3/SDL_WaitThread.3 deleted file mode 100644 index 11679fc2b5..0000000000 --- a/docs/man3/SDL_WaitThread.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "SDL_WaitThread" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WaitThread \- Wait for a thread to finish\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBvoid \fBSDL_WaitThread\fP\fR(\fBSDL_Thread *thread, int *status\fR); -.SH "DESCRIPTION" -.PP -Wait for a thread to finish (timeouts are not supported)\&. -.SH "RETURN VALUE" -.PP -The return code for the thread function is placed in the area pointed to by \fBstatus\fR, if \fBstatus\fR is not \fBNULL\fR\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateThread\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WarpMouse.3 b/docs/man3/SDL_WarpMouse.3 deleted file mode 100644 index 5cab3cef07..0000000000 --- a/docs/man3/SDL_WarpMouse.3 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "SDL_WarpMouse" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WarpMouse \- Set the position of the mouse cursor\&. -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBvoid \fBSDL_WarpMouse\fP\fR(\fBUint16 x, Uint16 y\fR); -.SH "DESCRIPTION" -.PP -Set the position of the mouse cursor (generates a mouse motion event)\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_MouseMotionEvent\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_WasInit.3 b/docs/man3/SDL_WasInit.3 deleted file mode 100644 index 5bc75c5edb..0000000000 --- a/docs/man3/SDL_WasInit.3 +++ /dev/null @@ -1,63 +0,0 @@ -.TH "SDL_WasInit" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_WasInit \- Check which subsystems are initialized -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -.sp -\fBUint32 \fBSDL_WasInit\fP\fR(\fBUint32 flags\fR); -.SH "DESCRIPTION" -.PP -\fBSDL_WasInit\fP allows you to see which SDL subsytems have been \fIinitialized\fR\&. \fBflags\fR is a bitwise OR\&'d combination of the subsystems you wish to check (see \fI\fBSDL_Init\fP\fR for a list of subsystem flags)\&. -.SH "RETURN VALUE" -.PP -\fBSDL_WasInit\fP returns a bitwised OR\&'d combination of the initialized subsystems\&. -.SH "EXAMPLES" -.PP -.nf -\f(CW -/* Here are several ways you can use SDL_WasInit() */ - -/* Get init data on all the subsystems */ -Uint32 subsystem_init; - -subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING); - -if(subsystem_init&SDL_INIT_VIDEO) - printf("Video is initialized\&. -"); -else - printf("Video is not initialized\&. -"); - - - -/* Just check for one specfic subsystem */ - -if(SDL_WasInit(SDL_INIT_VIDEO)!=0) - printf("Video is initialized\&. -"); -else - printf("Video is not initialized\&. -"); - - - - -/* Check for two subsystems */ - -Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO; - -if(SDL_WasInit(subsystem_mask)==subsystem_mask) - printf("Video and Audio initialized\&. -"); -else - printf("Video and Audio not initialized\&. -"); -\fR -.fi -.PP -.SH "SEE ALSO" -.PP -\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Subsystem\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_keysym.3 b/docs/man3/SDL_keysym.3 deleted file mode 100644 index 52065c15a0..0000000000 --- a/docs/man3/SDL_keysym.3 +++ /dev/null @@ -1,69 +0,0 @@ -.TH "SDL_keysym" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" -.SH "NAME" -SDL_keysym \- Keysym structure -.SH "STRUCTURE DEFINITION" -.PP -.nf -\f(CWtypedef struct{ - Uint8 scancode; - SDLKey sym; - SDLMod mod; - Uint16 unicode; -} SDL_keysym;\fR -.fi -.PP -.SH "STRUCTURE DATA" -.TP 20 -\fBscancode\fR -Hardware specific scancode -.TP 20 -\fBsym\fR -SDL virtual keysym -.TP 20 -\fBmod\fR -Current key modifiers -.TP 20 -\fBunicode\fR -Translated character -.SH "DESCRIPTION" -.PP -The \fBSDL_keysym\fR structure is used by reporting key presses and releases since it is a part of the \fI\fBSDL_KeyboardEvent\fR\fR\&. -.PP -The \fBscancode\fR field should generally be left alone, it is the hardware dependent scancode returned by the keyboard\&. The \fBsym\fR field is extremely useful\&. It is the SDL-defined value of the key (see \fISDL Key Syms\fR\&. This field is very useful when you are checking for certain key presses, like so: -.PP -.nf -\f(CW\&. -\&. -while(SDL_PollEvent(&event)){ - switch(event\&.type){ - case SDL_KEYDOWN: - if(event\&.key\&.keysym\&.sym==SDLK_LEFT) - move_left(); - break; - \&. - \&. - \&. - } -} -\&. -\&.\fR -.fi -.PP - \fBmod\fR stores the current state of the keyboard modifiers as explained in \fI\fBSDL_GetModState\fP\fR\&. The \fBunicode\fR is only used when UNICODE translation is enabled with \fI\fBSDL_EnableUNICODE\fP\fR\&. If \fBunicode\fR is non-zero then this a the UNICODE character corresponding to the keypress\&. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character: -.PP -.nf -\f(CWchar ch; -if ( (keysym\&.unicode & 0xFF80) == 0 ) { - ch = keysym\&.unicode & 0x7F; -} -else { - printf("An International Character\&. -"); -}\fR -.fi -.PP - UNICODE translation does have a slight overhead so don\&'t enable it unless its needed\&. -.SH "SEE ALSO" -.PP -\fI\fBSDLKey\fR\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00 diff --git a/docs/man3/SDL_mutexP.3 b/docs/man3/SDL_mutexP.3 deleted file mode 100644 index 3f2171629e..0000000000 --- a/docs/man3/SDL_mutexP.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_mutexP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_mutexP \- Lock a mutex -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_mutexP\fP\fR(\fBSDL_mutex *mutex\fR); -.SH "DESCRIPTION" -.PP -Locks the \fBmutex\fR, which was previously created with \fI\fBSDL_CreateMutex\fP\fR\&. If the mutex is already locked then \fBSDL_mutexP\fP will not return until it is \fIunlocked\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.PP -SDL also defines a macro \fB#define SDL_LockMutex(m) SDL_mutexP(m)\fP\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateMutex\fP\fR, \fI\fBSDL_mutexV\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/docs/man3/SDL_mutexV.3 b/docs/man3/SDL_mutexV.3 deleted file mode 100644 index e914abb7d6..0000000000 --- a/docs/man3/SDL_mutexV.3 +++ /dev/null @@ -1,18 +0,0 @@ -.TH "SDL_mutexV" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" -.SH "NAME" -SDL_mutexV \- Unlock a mutex -.SH "SYNOPSIS" -.PP -\fB#include "SDL\&.h" -#include "SDL_thread\&.h" -.sp -\fBint \fBSDL_mutexV\fP\fR(\fBSDL_mutex *mutex\fR); -.SH "DESCRIPTION" -.PP -Unlocks the \fBmutex\fR, which was previously created with \fI\fBSDL_CreateMutex\fP\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&. -.PP -SDL also defines a macro \fB#define SDL_UnlockMutex(m) SDL_mutexV(m)\fP\&. -.SH "SEE ALSO" -.PP -\fI\fBSDL_CreateMutex\fP\fR, \fI\fBSDL_mutexP\fP\fR -.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 diff --git a/include/SDL.h b/include/SDL.h index 6087b7cdd4..f2d760c2ed 100644 --- a/include/SDL.h +++ b/include/SDL.h @@ -1,47 +1,93 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL.h +/** + * \file SDL.h + * * Main include header for the SDL library */ +/** + * \mainpage Simple DirectMedia Layer (SDL) + * + * http://www.libsdl.org/ + * + * \section intro_sec Introduction + * + * This is the Simple DirectMedia Layer, a general API that provides low + * level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, + * and 2D framebuffer across multiple platforms. + * + * SDL is written in C, but works with C++ natively, and has bindings to + * several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, + * Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, + * Pike, Pliant, Python, Ruby, and Smalltalk. + * + * This library is distributed under the zlib license, which can be + * found in the file "COPYING". This license allows you to use SDL + * freely for any purpose as long as you retain the copyright notice. + * + * The best way to learn how to use SDL is to check out the header files in + * the "include" subdirectory and the programs in the "test" subdirectory. + * The header files and test programs are well commented and always up to date. + * More documentation and FAQs are available online at: + * http://wiki.libsdl.org/ + * + * If you need help with the library, or just want to discuss SDL related + * issues, you can join the developers mailing list: + * http://www.libsdl.org/mailing-list.php + * + * Enjoy! + * Sam Lantinga (slouken@libsdl.org) + */ + #ifndef _SDL_H #define _SDL_H #include "SDL_main.h" #include "SDL_stdinc.h" +#include "SDL_assert.h" +#include "SDL_atomic.h" #include "SDL_audio.h" -#include "SDL_cdrom.h" +#include "SDL_clipboard.h" #include "SDL_cpuinfo.h" #include "SDL_endian.h" #include "SDL_error.h" #include "SDL_events.h" +#include "SDL_joystick.h" +#include "SDL_gamecontroller.h" +#include "SDL_haptic.h" +#include "SDL_hints.h" #include "SDL_loadso.h" +#include "SDL_log.h" +#include "SDL_messagebox.h" #include "SDL_mutex.h" +#include "SDL_power.h" +#include "SDL_render.h" #include "SDL_rwops.h" +#include "SDL_system.h" #include "SDL_thread.h" #include "SDL_timer.h" -#include "SDL_video.h" #include "SDL_version.h" +#include "SDL_video.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -49,46 +95,57 @@ extern "C" { #endif -/** @file SDL.h - * @note As of version 0.5, SDL is loaded dynamically into the application - */ +/* As of version 0.5, SDL is loaded dynamically into the application */ -/** @name SDL_INIT Flags - * These are the flags which may be passed to SDL_Init() -- you should +/** + * \name SDL_INIT_* + * + * These are the flags which may be passed to SDL_Init(). You should * specify the subsystems which you will be using in your application. */ /*@{*/ -#define SDL_INIT_TIMER 0x00000001 -#define SDL_INIT_AUDIO 0x00000010 -#define SDL_INIT_VIDEO 0x00000020 -#define SDL_INIT_CDROM 0x00000100 -#define SDL_INIT_JOYSTICK 0x00000200 -#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ -#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ -#define SDL_INIT_EVERYTHING 0x0000FFFF +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ +#define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ +#define SDL_INIT_HAPTIC 0x00001000 +#define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ +#define SDL_INIT_EVENTS 0x00004000 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#define SDL_INIT_EVERYTHING ( \ + SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ + SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \ + ) /*@}*/ -/** This function loads the SDL dynamically linked library and initializes - * the subsystems specified by 'flags' (and those satisfying dependencies) - * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup - * signal handlers for some commonly ignored fatal signals (like SIGSEGV) +/** + * This function initializes the subsystems specified by \c flags + * Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + * signal handlers for some commonly ignored fatal signals (like SIGSEGV). */ extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); -/** This function initializes specific SDL subsystems */ +/** + * This function initializes specific SDL subsystems + */ extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); -/** This function cleans up specific SDL subsystems */ +/** + * This function cleans up specific SDL subsystems + */ extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); -/** This function returns mask of the specified subsystems which have - * been initialized. - * If 'flags' is 0, it returns a mask of all initialized subsystems. +/** + * This function returns a mask of the specified subsystems which have + * previously been initialized. + * + * If \c flags is 0, it returns a mask of all initialized subsystems. */ extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); -/** This function cleans up all initialized subsystems and unloads the - * dynamically linked library. You should call it upon all exit conditions. +/** + * This function cleans up all initialized subsystems. You should + * call it upon all exit conditions. */ extern DECLSPEC void SDLCALL SDL_Quit(void); @@ -99,3 +156,5 @@ extern DECLSPEC void SDLCALL SDL_Quit(void); #include "close_code.h" #endif /* _SDL_H */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_active.h b/include/SDL_active.h deleted file mode 100644 index cd854e8928..0000000000 --- a/include/SDL_active.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_active.h - * Include file for SDL application focus event handling - */ - -#ifndef _SDL_active_h -#define _SDL_active_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** @name The available application states */ -/*@{*/ -#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ -#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ -#define SDL_APPACTIVE 0x04 /**< The application is active */ -/*@}*/ - -/* Function prototypes */ -/** - * This function returns the current state of the application, which is a - * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and - * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to - * see your application, otherwise it has been iconified or disabled. - */ -extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_active_h */ diff --git a/include/SDL_assert.h b/include/SDL_assert.h new file mode 100644 index 0000000000..5a6afc5e2b --- /dev/null +++ b/include/SDL_assert.h @@ -0,0 +1,237 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_assert_h +#define _SDL_assert_h + +#include "SDL_config.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef SDL_ASSERT_LEVEL +#ifdef SDL_DEFAULT_ASSERT_LEVEL +#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL +#elif defined(_DEBUG) || defined(DEBUG) || \ + (defined(__GNUC__) && !defined(__OPTIMIZE__)) +#define SDL_ASSERT_LEVEL 2 +#else +#define SDL_ASSERT_LEVEL 1 +#endif +#endif /* SDL_ASSERT_LEVEL */ + +/* +These are macros and not first class functions so that the debugger breaks +on the assertion line and not in some random guts of SDL, and so each +assert can have unique static variables associated with it. +*/ + +#if defined(_MSC_VER) +/* Don't include intrin.h here because it contains C++ code */ + extern void __cdecl __debugbreak(void); + #define SDL_TriggerBreakpoint() __debugbreak() +#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif defined(HAVE_SIGNAL_H) + #include + #define SDL_TriggerBreakpoint() raise(SIGTRAP) +#else + /* How do we trigger breakpoints on this platform? */ + #define SDL_TriggerBreakpoint() +#endif + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ +# define SDL_FUNCTION __func__ +#elif ((__GNUC__ >= 2) || defined(_MSC_VER)) +# define SDL_FUNCTION __FUNCTION__ +#else +# define SDL_FUNCTION "???" +#endif +#define SDL_FILE __FILE__ +#define SDL_LINE __LINE__ + +/* +sizeof (x) makes the compiler still parse the expression even without +assertions enabled, so the code is always checked at compile time, but +doesn't actually generate code for it, so there are no side effects or +expensive checks at run time, just the constant size of what x WOULD be, +which presumably gets optimized out as unused. +This also solves the problem of... + + int somevalue = blah(); + SDL_assert(somevalue == 1); + +...which would cause compiles to complain that somevalue is unused if we +disable assertions. +*/ + +#define SDL_disabled_assert(condition) \ + do { (void) sizeof ((condition)); } while (0) + +typedef enum +{ + SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ + SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ + SDL_ASSERTION_ABORT, /**< Terminate the program. */ + SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ + SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ +} SDL_assert_state; + +typedef struct SDL_assert_data +{ + int always_ignore; + unsigned int trigger_count; + const char *condition; + const char *filename; + int linenum; + const char *function; + const struct SDL_assert_data *next; +} SDL_assert_data; + +#if (SDL_ASSERT_LEVEL > 0) + +/* Never call this directly. Use the SDL_assert* macros. */ +extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, + const char *, + const char *, int); + +/* the do {} while(0) avoids dangling else problems: + if (x) SDL_assert(y); else blah(); + ... without the do/while, the "else" could attach to this macro's "if". + We try to handle just the minimum we need here in a macro...the loop, + the static vars, and break points. The heavy lifting is handled in + SDL_ReportAssertion(), in SDL_assert.c. +*/ +#define SDL_enabled_assert(condition) \ + do { \ + while ( !(condition) ) { \ + static struct SDL_assert_data assert_data = { \ + 0, 0, #condition, 0, 0, 0, 0 \ + }; \ + const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \ + SDL_FUNCTION, \ + SDL_FILE, \ + SDL_LINE); \ + if (state == SDL_ASSERTION_RETRY) { \ + continue; /* go again. */ \ + } else if (state == SDL_ASSERTION_BREAK) { \ + SDL_TriggerBreakpoint(); \ + } \ + break; /* not retrying. */ \ + } \ + } while (0) + +#endif /* enabled assertions support code */ + +/* Enable various levels of assertions. */ +#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_disabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) +#else +# error Unknown assertion level. +#endif + + +typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)( + const SDL_assert_data* data, void* userdata); + +/** + * \brief Set an application-defined assertion handler. + * + * This allows an app to show its own assertion UI and/or force the + * response to an assertion failure. If the app doesn't provide this, SDL + * will try to do the right thing, popping up a system-specific GUI dialog, + * and probably minimizing any fullscreen windows. + * + * This callback may fire from any thread, but it runs wrapped in a mutex, so + * it will only fire from one thread at a time. + * + * Setting the callback to NULL restores SDL's original internal handler. + * + * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! + * + * \return SDL_assert_state value of how to handle the assertion failure. + * + * \param handler Callback function, called when an assertion fails. + * \param userdata A pointer passed to the callback as-is. + */ +extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( + SDL_AssertionHandler handler, + void *userdata); + +/** + * \brief Get a list of all assertion failures. + * + * Get all assertions triggered since last call to SDL_ResetAssertionReport(), + * or the start of the program. + * + * The proper way to examine this data looks something like this: + * + * + * const SDL_assert_data *item = SDL_GetAssertionReport(); + * while (item) { + * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", + * item->condition, item->function, item->filename, + * item->linenum, item->trigger_count, + * item->always_ignore ? "yes" : "no"); + * item = item->next; + * } + * + * + * \return List of all assertions. + * \sa SDL_ResetAssertionReport + */ +extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void); + +/** + * \brief Reset the list of all assertion failures. + * + * Reset list of all assertions triggered. + * + * \sa SDL_GetAssertionReport + */ +extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_assert_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_atomic.h b/include/SDL_atomic.h new file mode 100644 index 0000000000..7bd669d1ac --- /dev/null +++ b/include/SDL_atomic.h @@ -0,0 +1,359 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_atomic.h + * + * Atomic operations. + * + * IMPORTANT: + * If you are not an expert in concurrent lockless programming, you should + * only be using the atomic lock and reference counting functions in this + * file. In all other cases you should be protecting your data structures + * with full mutexes. + * + * The list of "safe" functions to use are: + * SDL_AtomicLock() + * SDL_AtomicUnlock() + * SDL_AtomicIncRef() + * SDL_AtomicDecRef() + * + * Seriously, here be dragons! + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * You can find out a little more about lockless programming and the + * subtle issues that can arise here: + * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx + * + * There's also lots of good information here: + * http://www.1024cores.net/home/lock-free-algorithms + * http://preshing.com/ + * + * These operations may or may not actually be implemented using + * processor specific atomic operations. When possible they are + * implemented as true processor specific atomic operations. When that + * is not possible the are implemented using locks that *do* use the + * available atomic operations. + * + * All of the atomic operations that modify memory are full memory barriers. + */ + +#ifndef _SDL_atomic_h_ +#define _SDL_atomic_h_ + +#include "SDL_stdinc.h" +#include "SDL_platform.h" + +#include "begin_code.h" + +/* Need to do this here because intrin.h has C++ code in it */ +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) +#include +#define HAVE_MSC_ATOMICS 1 +#endif + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name SDL AtomicLock + * + * The atomic locks are efficient spinlocks using CPU instructions, + * but are vulnerable to starvation and can spin forever if a thread + * holding a lock has been terminated. For this reason you should + * minimize the code executed inside an atomic lock and never do + * expensive things like API or system calls while holding them. + * + * The atomic locks are not safe to lock recursively. + * + * Porting Note: + * The spin lock functions and type are required and can not be + * emulated because they are used in the atomic emulation code. + */ +/*@{*/ + +typedef int SDL_SpinLock; + +/** + * \brief Try to lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + * + * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); + +/** + * \brief Lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); + +/** + * \brief Unlock a spin lock by setting it to 0. Always returns immediately + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); + +/*@}*//*SDL AtomicLock*/ + + +/** + * The compiler barrier prevents the compiler from reordering + * reads and writes to globally visible variables across the call. + */ +#if defined(_MSC_VER) && (_MSC_VER > 1200) +void _ReadWriteBarrier(void); +#pragma intrinsic(_ReadWriteBarrier) +#define SDL_CompilerBarrier() _ReadWriteBarrier() +#elif defined(__GNUC__) +#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") +#else +#define SDL_CompilerBarrier() \ +{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } +#endif + +/** + * Memory barriers are designed to prevent reads and writes from being + * reordered by the compiler and being seen out of order on multi-core CPUs. + * + * A typical pattern would be for thread A to write some data and a flag, + * and for thread B to read the flag and get the data. In this case you + * would insert a release barrier between writing the data and the flag, + * guaranteeing that the data write completes no later than the flag is + * written, and you would insert an acquire barrier between reading the + * flag and reading the data, to ensure that all the reads associated + * with the flag have completed. + * + * In this pattern you should always see a release barrier paired with + * an acquire barrier and you should gate the data reads/writes with a + * single flag variable. + * + * For more information on these semantics, take a look at the blog post: + * http://preshing.com/20120913/acquire-and-release-semantics + */ +#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") +#elif defined(__GNUC__) && defined(__arm__) +#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) +#ifdef __thumb__ +/* The mcr instruction isn't available in thumb mode, use real functions */ +extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease(); +extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire(); +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#endif /* __thumb__ */ +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") +#endif /* __GNUC__ && __arm__ */ +#else +/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ +#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() +#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() +#endif + + +/* Platform specific optimized versions of the atomic functions, + * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE + */ +#if defined(SDL_ATOMIC_DISABLED) && SDL_ATOMIC_DISABLED +#define SDL_DISABLE_ATOMIC_INLINE +#endif +#ifndef SDL_DISABLE_ATOMIC_INLINE + +#ifdef HAVE_MSC_ATOMICS + +#define SDL_AtomicSet(a, v) _InterlockedExchange((long*)&(a)->value, (v)) +#define SDL_AtomicAdd(a, v) _InterlockedExchangeAdd((long*)&(a)->value, (v)) +#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval)) +#define SDL_AtomicSetPtr(a, v) _InterlockedExchangePointer((a), (v)) +#if _M_IX86 +#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval)) +#else +#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchangePointer((a), (newval), (oldval)) == (oldval)) +#endif + +#elif defined(__MACOSX__) +#include + +#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value) +#ifdef __LP64__ +#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a)) +#else +#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a)) +#endif + +#elif defined(HAVE_GCC_ATOMICS) + +#define SDL_AtomicSet(a, v) __sync_lock_test_and_set(&(a)->value, v) +#define SDL_AtomicAdd(a, v) __sync_fetch_and_add(&(a)->value, v) +#define SDL_AtomicSetPtr(a, v) __sync_lock_test_and_set(a, v) +#define SDL_AtomicCAS(a, oldval, newval) __sync_bool_compare_and_swap(&(a)->value, oldval, newval) +#define SDL_AtomicCASPtr(a, oldval, newval) __sync_bool_compare_and_swap(a, oldval, newval) + +#endif + +#endif /* !SDL_DISABLE_ATOMIC_INLINE */ + + +/** + * \brief A type representing an atomic integer value. It is a struct + * so people don't accidentally use numeric operations on it. + */ +#ifndef SDL_atomic_t_defined +typedef struct { int value; } SDL_atomic_t; +#endif + +/** + * \brief Set an atomic variable to a new value if it is currently an old value. + * + * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +#ifndef SDL_AtomicCAS +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); +#endif + +/** + * \brief Set an atomic variable to a value. + * + * \return The previous value of the atomic variable. + */ +#ifndef SDL_AtomicSet +SDL_FORCE_INLINE int SDL_AtomicSet(SDL_atomic_t *a, int v) +{ + int value; + do { + value = a->value; + } while (!SDL_AtomicCAS(a, value, v)); + return value; +} +#endif + +/** + * \brief Get the value of an atomic variable + */ +#ifndef SDL_AtomicGet +SDL_FORCE_INLINE int SDL_AtomicGet(SDL_atomic_t *a) +{ + int value = a->value; + SDL_CompilerBarrier(); + return value; +} +#endif + +/** + * \brief Add to an atomic variable. + * + * \return The previous value of the atomic variable. + * + * \note This same style can be used for any number operation + */ +#ifndef SDL_AtomicAdd +SDL_FORCE_INLINE int SDL_AtomicAdd(SDL_atomic_t *a, int v) +{ + int value; + do { + value = a->value; + } while (!SDL_AtomicCAS(a, value, (value + v))); + return value; +} +#endif + +/** + * \brief Increment an atomic variable used as a reference count. + */ +#ifndef SDL_AtomicIncRef +#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) +#endif + +/** + * \brief Decrement an atomic variable used as a reference count. + * + * \return SDL_TRUE if the variable reached zero after decrementing, + * SDL_FALSE otherwise + */ +#ifndef SDL_AtomicDecRef +#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) +#endif + +/** + * \brief Set a pointer to a new value if it is currently an old value. + * + * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +#ifndef SDL_AtomicCASPtr +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void* *a, void *oldval, void *newval); +#endif + +/** + * \brief Set a pointer to a value atomically. + * + * \return The previous value of the pointer. + */ +#ifndef SDL_AtomicSetPtr +SDL_FORCE_INLINE void* SDL_AtomicSetPtr(void* *a, void* v) +{ + void* value; + do { + value = *a; + } while (!SDL_AtomicCASPtr(a, value, v)); + return value; +} +#endif + +/** + * \brief Get the value of a pointer atomically. + */ +#ifndef SDL_AtomicGetPtr +SDL_FORCE_INLINE void* SDL_AtomicGetPtr(void* *a) +{ + void* value = *a; + SDL_CompilerBarrier(); + return value; +} +#endif + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif + +#include "close_code.h" + +#endif /* _SDL_atomic_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_audio.h b/include/SDL_audio.h index e879c98966..0b6f28af6e 100644 --- a/include/SDL_audio.h +++ b/include/SDL_audio.h @@ -1,28 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /** - * @file SDL_audio.h - * Access to the raw audio mixing buffer for the SDL library + * \file SDL_audio.h + * + * Access to the raw audio mixing buffer for the SDL library. */ #ifndef _SDL_audio_h @@ -42,109 +42,193 @@ extern "C" { #endif /** - * When filling in the desired audio spec structure, - * - 'desired->freq' should be the desired audio frequency in samples-per-second. - * - 'desired->format' should be the desired audio format. - * - 'desired->samples' is the desired size of the audio buffer, in samples. - * This number should be a power of two, and may be adjusted by the audio - * driver to a value more suitable for the hardware. Good values seem to - * range between 512 and 8096 inclusive, depending on the application and - * CPU speed. Smaller values yield faster response time, but can lead - * to underflow if the application is doing heavy processing and cannot - * fill the audio buffer in time. A stereo sample consists of both right - * and left channels in LR ordering. - * Note that the number of samples is directly related to time by the - * following formula: ms = (samples*1000)/freq - * - 'desired->size' is the size in bytes of the audio buffer, and is - * calculated by SDL_OpenAudio(). - * - 'desired->silence' is the value used to set the buffer to silence, - * and is calculated by SDL_OpenAudio(). - * - 'desired->callback' should be set to a function that will be called - * when the audio device is ready for more data. It is passed a pointer - * to the audio buffer, and the length in bytes of the audio buffer. - * This function usually runs in a separate thread, and so you should - * protect data structures that it accesses by calling SDL_LockAudio() - * and SDL_UnlockAudio() in your code. - * - 'desired->userdata' is passed as the first parameter to your callback - * function. + * \brief Audio format flags. + * + * These are what the 16 bits in SDL_AudioFormat currently mean... + * (Unspecified bits are always zero). * - * @note The calculated values in this structure are calculated by SDL_OpenAudio() + * \verbatim + ++-----------------------sample is signed if set + || + || ++-----------sample is bigendian if set + || || + || || ++---sample is float if set + || || || + || || || +---sample bit size---+ + || || || | | + 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + \endverbatim * + * There are macros in SDL 2.0 and later to query these bits. */ -typedef struct SDL_AudioSpec { - int freq; /**< DSP frequency -- samples per second */ - Uint16 format; /**< Audio data format */ - Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ - Uint8 silence; /**< Audio buffer silence value (calculated) */ - Uint16 samples; /**< Audio buffer size in samples (power of 2) */ - Uint16 padding; /**< Necessary for some compile environments */ - Uint32 size; /**< Audio buffer size in bytes (calculated) */ - /** - * This function is called when the audio device needs more data. - * - * @param[out] stream A pointer to the audio data buffer - * @param[in] len The length of the audio buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - */ - void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); - void *userdata; -} SDL_AudioSpec; +typedef Uint16 SDL_AudioFormat; + +/** + * \name Audio flags + */ +/*@{*/ + +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#define SDL_AUDIO_MASK_DATATYPE (1<<8) +#define SDL_AUDIO_MASK_ENDIAN (1<<12) +#define SDL_AUDIO_MASK_SIGNED (1<<15) +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) +#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) +#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) +#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) +#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) +#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) + +/** + * \name Audio format flags + * + * Defaults to LSB byte order. + */ +/*@{*/ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB +/*@}*/ + +/** + * \name int32 support + */ +/*@{*/ +#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ +#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ +#define AUDIO_S32 AUDIO_S32LSB +/*@}*/ /** - * @name Audio format flags - * defaults to LSB byte order + * \name float32 support */ /*@{*/ -#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ -#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ -#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ -#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ -#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ -#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ -#define AUDIO_U16 AUDIO_U16LSB -#define AUDIO_S16 AUDIO_S16LSB +#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ +#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ +#define AUDIO_F32 AUDIO_F32LSB +/*@}*/ /** - * @name Native audio byte ordering + * \name Native audio byte ordering */ /*@{*/ #if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define AUDIO_U16SYS AUDIO_U16LSB -#define AUDIO_S16SYS AUDIO_S16LSB +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#define AUDIO_S32SYS AUDIO_S32LSB +#define AUDIO_F32SYS AUDIO_F32LSB #else -#define AUDIO_U16SYS AUDIO_U16MSB -#define AUDIO_S16SYS AUDIO_S16MSB +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#define AUDIO_S32SYS AUDIO_S32MSB +#define AUDIO_F32SYS AUDIO_F32MSB #endif /*@}*/ +/** + * \name Allow change flags + * + * Which audio format changes are allowed when opening a device. + */ +/*@{*/ +#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 +#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 +#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 +#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE) /*@}*/ +/*@}*//*Audio flags*/ + +/** + * This function is called when the audio device needs more data. + * + * \param userdata An application-specific parameter saved in + * the SDL_AudioSpec structure + * \param stream A pointer to the audio data buffer. + * \param len The length of that buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ +typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, + int len); + +/** + * The calculated values in this structure are calculated by SDL_OpenAudio(). + */ +typedef struct SDL_AudioSpec +{ + int freq; /**< DSP frequency -- samples per second */ + SDL_AudioFormat format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + SDL_AudioCallback callback; + void *userdata; +} SDL_AudioSpec; + + +struct SDL_AudioCVT; +typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, + SDL_AudioFormat format); -/** A structure to hold a set of audio conversion filters and buffers */ -typedef struct SDL_AudioCVT { - int needed; /**< Set to 1 if conversion possible */ - Uint16 src_format; /**< Source audio format */ - Uint16 dst_format; /**< Target audio format */ - double rate_incr; /**< Rate conversion increment */ - Uint8 *buf; /**< Buffer to hold entire audio data */ - int len; /**< Length of original audio buffer */ - int len_cvt; /**< Length of converted audio buffer */ - int len_mult; /**< buffer must be len*len_mult big */ - double len_ratio; /**< Given len, final size is len*len_ratio */ - void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); - int filter_index; /**< Current audio conversion function */ -} SDL_AudioCVT; +/** + * A structure to hold a set of audio conversion filters and buffers. + */ +#ifdef __GNUC__ +/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't + pad it out to 88 bytes to guarantee ABI compatibility between compilers. + vvv + The next time we rev the ABI, make sure to size the ints and add padding. +*/ +#define SDL_AUDIOCVT_PACKED __attribute__((packed)) +#else +#define SDL_AUDIOCVT_PACKED +#endif +/* */ +typedef struct SDL_AudioCVT +{ + int needed; /**< Set to 1 if conversion possible */ + SDL_AudioFormat src_format; /**< Source audio format */ + SDL_AudioFormat dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + SDL_AudioFilter filters[10]; /**< Filter list */ + int filter_index; /**< Current audio conversion function */ +} SDL_AUDIOCVT_PACKED SDL_AudioCVT; /* Function prototypes */ /** - * @name Audio Init and Quit - * These functions are used internally, and should not be used unless you - * have a specific need to specify the audio driver you want to use. - * You should normally use SDL_Init() or SDL_InitSubSystem(). + * \name Driver discovery functions + * + * These functions return the list of built in audio drivers, in the + * order that they are normally initialized by default. + */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); +extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); +/*@}*/ + +/** + * \name Initialization and cleanup + * + * \internal These functions are used internally, and should not be used unless + * you have a specific need to specify the audio driver you want to + * use. You should normally use SDL_Init() or SDL_InitSubSystem(). */ /*@{*/ extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); @@ -152,128 +236,264 @@ extern DECLSPEC void SDLCALL SDL_AudioQuit(void); /*@}*/ /** - * This function fills the given character buffer with the name of the - * current audio driver, and returns a pointer to it if the audio driver has - * been initialized. It returns NULL if no driver has been initialized. + * This function returns the name of the current audio driver, or NULL + * if no driver has been initialized. + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by \c obtained. If \c obtained is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * When filling in the desired audio spec structure, + * - \c desired->freq should be the desired audio frequency in samples-per- + * second. + * - \c desired->format should be the desired audio format. + * - \c desired->samples is the desired size of the audio buffer, in + * samples. This number should be a power of two, and may be adjusted by + * the audio driver to a value more suitable for the hardware. Good values + * seem to range between 512 and 8096 inclusive, depending on the + * application and CPU speed. Smaller values yield faster response time, + * but can lead to underflow if the application is doing heavy processing + * and cannot fill the audio buffer in time. A stereo sample consists of + * both right and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: \code ms = (samples*1000)/freq \endcode + * - \c desired->size is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - \c desired->silence is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - \c desired->callback should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. + * - \c desired->userdata is passed as the first parameter to your callback + * function. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, + SDL_AudioSpec * obtained); + +/** + * SDL Audio Device IDs. + * + * A successful call to SDL_OpenAudio() is always device id 1, and legacy + * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls + * always returns devices >= 2 on success. The legacy calls are good both + * for backwards compatibility and when you don't care about multiple, + * specific, or capture devices. + */ +typedef Uint32 SDL_AudioDeviceID; + +/** + * Get the number of available devices exposed by the current driver. + * Only valid after a successfully initializing the audio subsystem. + * Returns -1 if an explicit list of devices can't be determined; this is + * not an error. For example, if SDL is set up to talk to a remote audio + * server, it can't list every one available on the Internet, but it will + * still allow a specific host to be specified to SDL_OpenAudioDevice(). + * + * In many common cases, when this function returns a value <= 0, it can still + * successfully open the default device (NULL for first argument of + * SDL_OpenAudioDevice()). + */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); + +/** + * Get the human-readable name of a specific audio device. + * Must be a value between 0 and (number of audio devices-1). + * Only valid after a successfully initializing the audio subsystem. + * The values returned by this function reflect the latest call to + * SDL_GetNumAudioDevices(); recall that function to redetect available + * hardware. + * + * The string returned by this function is UTF-8 encoded, read-only, and + * managed internally. You are not to free it. If you need to keep the + * string for any length of time, you should make your own copy of it, as it + * will be invalid next time any of several other SDL functions is called. */ -extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); +extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, + int iscapture); + /** - * This function opens the audio device with the desired parameters, and - * returns 0 if successful, placing the actual hardware parameters in the - * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio - * data passed to the callback function will be guaranteed to be in the - * requested format, and will be automatically converted to the hardware - * audio format if necessary. This function returns -1 if it failed - * to open the audio device, or couldn't set up the audio thread. + * Open a specific audio device. Passing in a device name of NULL requests + * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). * - * The audio device starts out playing silence when it's opened, and should - * be enabled for playing by calling SDL_PauseAudio(0) when you are ready - * for your audio callback function to be called. Since the audio driver - * may modify the requested size of the audio buffer, you should allocate - * any local mixing buffers after you open the audio device. + * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but + * some drivers allow arbitrary and driver-specific strings, such as a + * hostname/IP address for a remote audio server, or a filename in the + * diskaudio driver. * - * @sa SDL_AudioSpec + * \return 0 on error, a valid device ID that is >= 2 on success. + * + * SDL_OpenAudio(), unlike this function, always acts on device ID 1. */ -extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); +extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char + *device, + int iscapture, + const + SDL_AudioSpec * + desired, + SDL_AudioSpec * + obtained, + int + allowed_changes); -typedef enum { - SDL_AUDIO_STOPPED = 0, - SDL_AUDIO_PLAYING, - SDL_AUDIO_PAUSED -} SDL_audiostatus; -/** Get the current audio state */ -extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); /** - * This function pauses and unpauses the audio callback processing. - * It should be called with a parameter of 0 after opening the audio - * device to start playing sound. This is so you can safely initialize - * data for your callback function after opening the audio device. - * Silence will be written to the audio device during the pause. + * \name Audio state + * + * Get the current audio state. */ +/*@{*/ +typedef enum +{ + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_AudioStatus; +extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); + +extern DECLSPEC SDL_AudioStatus SDLCALL +SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); +/*@}*//*Audio State*/ + +/** + * \name Pause audio functions + * + * These functions pause and unpause the audio callback processing. + * They should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +/*@{*/ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); +extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, + int pause_on); +/*@}*//*Pause audio functions*/ /** - * This function loads a WAVE from the data source, automatically freeing - * that source if 'freesrc' is non-zero. For example, to load a WAVE file, - * you could do: - * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode + * This function loads a WAVE from the data source, automatically freeing + * that source if \c freesrc is non-zero. For example, to load a WAVE file, + * you could do: + * \code + * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + * \endcode * - * If this function succeeds, it returns the given SDL_AudioSpec, - * filled with the audio data format of the wave data, and sets - * 'audio_buf' to a malloc()'d buffer containing the audio data, - * and sets 'audio_len' to the length of that audio buffer, in bytes. - * You need to free the audio buffer with SDL_FreeWAV() when you are - * done with it. + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * \c *audio_buf to a malloc()'d buffer containing the audio data, + * and sets \c *audio_len to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. * - * This function returns NULL and sets the SDL error message if the - * wave file cannot be opened, uses an unknown data format, or is - * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. */ -extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); +extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, + int freesrc, + SDL_AudioSpec * spec, + Uint8 ** audio_buf, + Uint32 * audio_len); -/** Compatibility convenience function -- loads a WAV from a file */ +/** + * Loads a WAV from a file. + * Compatibility convenience function. + */ #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ - SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) /** - * This function frees data previously allocated with SDL_LoadWAV_RW() + * This function frees data previously allocated with SDL_LoadWAV_RW() */ -extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); /** - * This function takes a source format and rate and a destination format - * and rate, and initializes the 'cvt' structure with information needed - * by SDL_ConvertAudio() to convert a buffer of audio data from one format - * to the other. + * This function takes a source format and rate and a destination format + * and rate, and initializes the \c cvt structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. * - * @return This function returns 0, or -1 if there was an error. + * \return -1 if the format conversion is not supported, 0 if there's + * no conversion needed, or 1 if the audio filter is set up. */ -extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, - Uint16 src_format, Uint8 src_channels, int src_rate, - Uint16 dst_format, Uint8 dst_channels, int dst_rate); +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_format, + Uint8 src_channels, + int src_rate, + SDL_AudioFormat dst_format, + Uint8 dst_channels, + int dst_rate); /** - * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), - * created an audio buffer cvt->buf, and filled it with cvt->len bytes of - * audio data in the source format, this function will convert it in-place - * to the desired format. - * The data conversion may expand the size of the audio data, so the buffer - * cvt->buf should be allocated after the cvt structure is initialized by - * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. + * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), + * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * + * The data conversion may expand the size of the audio data, so the buffer + * \c cvt->buf should be allocated after the \c cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. */ -extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); - +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); #define SDL_MIX_MAXVOLUME 128 /** - * This takes two audio buffers of the playing audio format and mixes - * them, performing addition, volume adjustment, and overflow clipping. - * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume. Note this does not change hardware volume. - * This is provided for convenience -- you can mix your own audio data. + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. */ -extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, + Uint32 len, int volume); /** - * @name Audio Locks - * The lock manipulated by these functions protects the callback function. - * During a LockAudio/UnlockAudio pair, you can be guaranteed that the - * callback function is not running. Do not call these from the callback - * function or you will cause deadlock. + * This works like SDL_MixAudio(), but you specify the audio format instead of + * using the format of audio device 1. Thus it can be used when no audio + * device is open at all. + */ +extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, + const Uint8 * src, + SDL_AudioFormat format, + Uint32 len, int volume); + +/** + * \name Audio lock functions + * + * The lock manipulated by these functions protects the callback function. + * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that + * the callback function is not running. Do not call these from the callback + * function or you will cause deadlock. */ /*@{*/ extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); -/*@}*/ +extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); +/*@}*//*Audio lock functions*/ /** - * This function shuts down audio processing and closes the audio device. + * This function shuts down audio processing and closes the audio device. */ extern DECLSPEC void SDLCALL SDL_CloseAudio(void); - +extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -282,3 +502,5 @@ extern DECLSPEC void SDLCALL SDL_CloseAudio(void); #include "close_code.h" #endif /* _SDL_audio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_bits.h b/include/SDL_bits.h new file mode 100644 index 0000000000..b1ed20bf72 --- /dev/null +++ b/include/SDL_bits.h @@ -0,0 +1,97 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_bits.h + * + * Functions for fiddling with bits and bitmasks. + */ + +#ifndef _SDL_bits_h +#define _SDL_bits_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_bits.h + */ + +/** + * Get the index of the most significant bit. Result is undefined when called + * with 0. This operation can also be stated as "count leading zeroes" and + * "log base 2". + * + * \return Index of the most significant bit, or -1 if the value is 0. + */ +SDL_FORCE_INLINE int +SDL_MostSignificantBitIndex32(Uint32 x) +{ +#if defined(__GNUC__) && __GNUC__ >= 4 + /* Count Leading Zeroes builtin in GCC. + * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html + */ + if (x == 0) { + return -1; + } + return 31 - __builtin_clz(x); +#else + /* Based off of Bit Twiddling Hacks by Sean Eron Anderson + * , released in the public domain. + * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog + */ + const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; + const int S[] = {1, 2, 4, 8, 16}; + + int msbIndex = 0; + int i; + + if (x == 0) { + return -1; + } + + for (i = 4; i >= 0; i--) + { + if (x & b[i]) + { + x >>= S[i]; + msbIndex |= S[i]; + } + } + + return msbIndex; +#endif +} + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_bits_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_blendmode.h b/include/SDL_blendmode.h new file mode 100644 index 0000000000..85aa474595 --- /dev/null +++ b/include/SDL_blendmode.h @@ -0,0 +1,63 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_blendmode.h + * + * Header file declaring the SDL_BlendMode enumeration + */ + +#ifndef _SDL_blendmode_h +#define _SDL_blendmode_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + */ +typedef enum +{ + SDL_BLENDMODE_NONE = 0x00000000, /**< no blending + dstRGBA = srcRGBA */ + SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) */ + SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending + dstRGB = (srcRGB * srcA) + dstRGB + dstA = dstA */ + SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate + dstRGB = srcRGB * dstRGB + dstA = dstA */ +} SDL_BlendMode; + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_byteorder.h b/include/SDL_byteorder.h deleted file mode 100644 index 47332c3df7..0000000000 --- a/include/SDL_byteorder.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_byteorder.h - * @deprecated Use SDL_endian.h instead - */ - -/* DEPRECATED */ -#include "SDL_endian.h" diff --git a/include/SDL_cdrom.h b/include/SDL_cdrom.h deleted file mode 100644 index febb19dcc7..0000000000 --- a/include/SDL_cdrom.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** - * @file SDL_cdrom.h - * This is the CD-audio control API for Simple DirectMedia Layer - */ - -#ifndef _SDL_cdrom_h -#define _SDL_cdrom_h - -#include "SDL_stdinc.h" -#include "SDL_error.h" - -#include "begin_code.h" -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file SDL_cdrom.h - * In order to use these functions, SDL_Init() must have been called - * with the SDL_INIT_CDROM flag. This causes SDL to scan the system - * for CD-ROM drives, and load appropriate drivers. - */ - -/** The maximum number of CD-ROM tracks on a disk */ -#define SDL_MAX_TRACKS 99 - -/** @name Track Types - * The types of CD-ROM track possible - */ -/*@{*/ -#define SDL_AUDIO_TRACK 0x00 -#define SDL_DATA_TRACK 0x04 -/*@}*/ - -/** The possible states which a CD-ROM drive can be in. */ -typedef enum { - CD_TRAYEMPTY, - CD_STOPPED, - CD_PLAYING, - CD_PAUSED, - CD_ERROR = -1 -} CDstatus; - -/** Given a status, returns true if there's a disk in the drive */ -#define CD_INDRIVE(status) ((int)(status) > 0) - -typedef struct SDL_CDtrack { - Uint8 id; /**< Track number */ - Uint8 type; /**< Data or audio track */ - Uint16 unused; - Uint32 length; /**< Length, in frames, of this track */ - Uint32 offset; /**< Offset, in frames, from start of disk */ -} SDL_CDtrack; - -/** This structure is only current as of the last call to SDL_CDStatus() */ -typedef struct SDL_CD { - int id; /**< Private drive identifier */ - CDstatus status; /**< Current drive status */ - - /** The rest of this structure is only valid if there's a CD in drive */ - /*@{*/ - int numtracks; /**< Number of tracks on disk */ - int cur_track; /**< Current track position */ - int cur_frame; /**< Current frame offset within current track */ - SDL_CDtrack track[SDL_MAX_TRACKS+1]; - /*@}*/ -} SDL_CD; - -/** @name Frames / MSF Conversion Functions - * Conversion functions from frames to Minute/Second/Frames and vice versa - */ -/*@{*/ -#define CD_FPS 75 -#define FRAMES_TO_MSF(f, M,S,F) { \ - int value = f; \ - *(F) = value%CD_FPS; \ - value /= CD_FPS; \ - *(S) = value%60; \ - value /= 60; \ - *(M) = value; \ -} -#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) -/*@}*/ - -/* CD-audio API functions: */ - -/** - * Returns the number of CD-ROM drives on the system, or -1 if - * SDL_Init() has not been called with the SDL_INIT_CDROM flag. - */ -extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); - -/** - * Returns a human-readable, system-dependent identifier for the CD-ROM. - * Example: - * - "/dev/cdrom" - * - "E:" - * - "/dev/disk/ide/1/master" - */ -extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); - -/** - * Opens a CD-ROM drive for access. It returns a drive handle on success, - * or NULL if the drive was invalid or busy. This newly opened CD-ROM - * becomes the default CD used when other CD functions are passed a NULL - * CD-ROM handle. - * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. - */ -extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); - -/** - * This function returns the current status of the given drive. - * If the drive has a CD in it, the table of contents of the CD and current - * play position of the CD will be stored in the SDL_CD structure. - */ -extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); - -/** - * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' - * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play - * until the end of the CD. This function will skip data tracks. - * This function should only be called after calling SDL_CDStatus() to - * get track information about the CD. - * For example: - * @code - * // Play entire CD: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) - * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); - * // Play last track: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { - * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); - * } - * // Play first and second track and 10 seconds of third track: - * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) - * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); - * @endcode - * - * @return This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, - int start_track, int start_frame, int ntracks, int nframes); - -/** - * Play the given CD starting at 'start' frame for 'length' frames. - * @return It returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); - -/** Pause play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); - -/** Resume play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); - -/** Stop play - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); - -/** Eject CD-ROM - * @return returns 0, or -1 on error - */ -extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); - -/** Closes the handle for the CD-ROM drive */ -extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include "close_code.h" - -#endif /* _SDL_video_h */ diff --git a/include/SDL_clipboard.h b/include/SDL_clipboard.h new file mode 100644 index 0000000000..1f5742d167 --- /dev/null +++ b/include/SDL_clipboard.h @@ -0,0 +1,71 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_clipboard.h + * + * Include file for SDL clipboard handling + */ + +#ifndef _SDL_clipboard_h +#define _SDL_clipboard_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Put UTF-8 text into the clipboard + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); + +/** + * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() + * + * \sa SDL_SetClipboardText() + */ +extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); + +/** + * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_clipboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_config.h b/include/SDL_config.h new file mode 100644 index 0000000000..7440940add --- /dev/null +++ b/include/SDL_config.h @@ -0,0 +1,51 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/** + * \file SDL_config.h + */ + +/* Add any platform that doesn't build using the configure system. */ +#if defined(__WIN32__) +#include "SDL_config_windows.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__IPHONEOS__) +#include "SDL_config_iphoneos.h" +#elif defined(__ANDROID__) +#include "SDL_config_android.h" +#elif defined(__PSP__) +#include "SDL_config_psp.h" +#else +/* This is a minimal configuration just to get SDL running on new platforms */ +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#ifdef USING_GENERATED_CONFIG_H +#error Wrong SDL_config.h, check your include path? +#endif + +#endif /* _SDL_config_h */ diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake new file mode 100644 index 0000000000..12c14fa245 --- /dev/null +++ b/include/SDL_config.h.cmake @@ -0,0 +1,369 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C language features */ +#cmakedefine const @HAVE_CONST@ +#cmakedefine inline @HAVE_INLINE@ +#cmakedefine volatile @HAVE_VOLATILE@ + +/* C datatypes */ +/* Define SIZEOF_VOIDP for 64/32 architectures */ +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ +#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ +#cmakedefine HAVE_PTHREAD_SPINLOCK @HAVE_PTHREAD_SPINLOCK@ + +/* Comment this if you want to build without any C library requirements */ +#cmakedefine HAVE_LIBC 1 +#if HAVE_LIBC + +/* Useful headers */ +#cmakedefine HAVE_ALLOCA_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_STDIO_H 1 +#cmakedefine STDC_HEADERS 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_MEMORY_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_CTYPE_H 1 +#cmakedefine HAVE_MATH_H 1 +#cmakedefine HAVE_ICONV_H 1 +#cmakedefine HAVE_SIGNAL_H 1 +#cmakedefine HAVE_ALTIVEC_H 1 +#cmakedefine HAVE_PTHREAD_NP_H 1 +#cmakedefine HAVE_LIBUDEV_H 1 +#cmakedefine HAVE_DBUS_DBUS_H 1 + +/* C library functions */ +#cmakedefine HAVE_MALLOC 1 +#cmakedefine HAVE_CALLOC 1 +#cmakedefine HAVE_REALLOC 1 +#cmakedefine HAVE_FREE 1 +#cmakedefine HAVE_ALLOCA 1 +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +#cmakedefine HAVE_GETENV 1 +#cmakedefine HAVE_SETENV 1 +#cmakedefine HAVE_PUTENV 1 +#cmakedefine HAVE_UNSETENV 1 +#endif +#cmakedefine HAVE_QSORT 1 +#cmakedefine HAVE_ABS 1 +#cmakedefine HAVE_BCOPY 1 +#cmakedefine HAVE_MEMSET 1 +#cmakedefine HAVE_MEMCPY 1 +#cmakedefine HAVE_MEMMOVE 1 +#cmakedefine HAVE_MEMCMP 1 +#cmakedefine HAVE_STRLEN 1 +#cmakedefine HAVE_STRLCPY 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE_STRDUP 1 +#cmakedefine HAVE__STRREV 1 +#cmakedefine HAVE__STRUPR 1 +#cmakedefine HAVE__STRLWR 1 +#cmakedefine HAVE_INDEX 1 +#cmakedefine HAVE_RINDEX 1 +#cmakedefine HAVE_STRCHR 1 +#cmakedefine HAVE_STRRCHR 1 +#cmakedefine HAVE_STRSTR 1 +#cmakedefine HAVE_ITOA 1 +#cmakedefine HAVE__LTOA 1 +#cmakedefine HAVE__UITOA 1 +#cmakedefine HAVE__ULTOA 1 +#cmakedefine HAVE_STRTOL 1 +#cmakedefine HAVE_STRTOUL 1 +#cmakedefine HAVE__I64TOA 1 +#cmakedefine HAVE__UI64TOA 1 +#cmakedefine HAVE_STRTOLL 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_STRTOD 1 +#cmakedefine HAVE_ATOI 1 +#cmakedefine HAVE_ATOF 1 +#cmakedefine HAVE_STRCMP 1 +#cmakedefine HAVE_STRNCMP 1 +#cmakedefine HAVE__STRICMP 1 +#cmakedefine HAVE_STRCASECMP 1 +#cmakedefine HAVE__STRNICMP 1 +#cmakedefine HAVE_STRNCASECMP 1 +#cmakedefine HAVE_SSCANF 1 +#cmakedefine HAVE_SNPRINTF 1 +#cmakedefine HAVE_VSNPRINTF 1 +#cmakedefine HAVE_M_PI 1 +#cmakedefine HAVE_ATAN 1 +#cmakedefine HAVE_ATAN2 1 +#cmakedefine HAVE_CEIL 1 +#cmakedefine HAVE_COPYSIGN 1 +#cmakedefine HAVE_COS 1 +#cmakedefine HAVE_COSF 1 +#cmakedefine HAVE_FABS 1 +#cmakedefine HAVE_FLOOR 1 +#cmakedefine HAVE_LOG 1 +#cmakedefine HAVE_POW 1 +#cmakedefine HAVE_SCALBN 1 +#cmakedefine HAVE_SIN 1 +#cmakedefine HAVE_SINF 1 +#cmakedefine HAVE_SQRT 1 +#cmakedefine HAVE_FSEEKO 1 +#cmakedefine HAVE_FSEEKO64 1 +#cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SA_SIGACTION 1 +#cmakedefine HAVE_SETJMP 1 +#cmakedefine HAVE_NANOSLEEP 1 +#cmakedefine HAVE_SYSCONF 1 +#cmakedefine HAVE_SYSCTLBYNAME 1 +#cmakedefine HAVE_CLOCK_GETTIME 1 +#cmakedefine HAVE_GETPAGESIZE 1 +#cmakedefine HAVE_MPROTECT 1 +#cmakedefine HAVE_ICONV 1 +#cmakedefine HAVE_PTHREAD_SETNAME_NP 1 +#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 +#cmakedefine HAVE_SEM_TIMEDWAIT 1 +#elif __WIN32__ +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STDDEF_H 1 +#else +/* We may need some replacement for stdarg.h here */ +#include +#endif /* HAVE_LIBC */ + +/* SDL internal assertion support */ +#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ + +/* Allow disabling of core subsystems */ +#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@ +#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@ +#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@ +#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@ +#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@ +#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@ +#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@ +#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@ +#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@ +#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@ +#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@ +#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@ +#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@ + +/* Enable various audio drivers */ +#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@ +#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_BEOSAUDIO @SDL_AUDIO_DRIVER_BEOSAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_BSD @SDL_AUDIO_DRIVER_BSD@ +#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ +#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ +#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@ +#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@ +#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@ +#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ +#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@ +#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ +#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ + +/* Enable various input drivers */ +#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ +#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ +#cmakedefine SDL_JOYSTICK_BEOS @SDL_JOYSTICK_BEOS@ +#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ +#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ +#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ +#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ +#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ +#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ +#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ +#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ +#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ +#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ + +/* Enable various shared object loading systems */ +#cmakedefine SDL_LOADSO_BEOS @SDL_LOADSO_BEOS@ +#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@ +#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ +#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ +#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ + +/* Enable various threading systems */ +#cmakedefine SDL_THREAD_BEOS @SDL_THREAD_BEOS@ +#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@ +#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ + +/* Enable various timer systems */ +#cmakedefine SDL_TIMER_BEOS @SDL_TIMER_BEOS@ +#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ +#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ +#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ +#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@ + +/* Enable various video drivers */ +#cmakedefine SDL_VIDEO_DRIVER_BWINDOW @SDL_VIDEO_DRIVER_BWINDOW@ +#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@ +#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@ +#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32@ +#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@ +#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ + +#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@ +#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@ +#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@ + +/* Enable OpenGL support */ +#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@ +#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@ +#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@ +#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@ +#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@ +#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@ + +/* Enable system power support */ +#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ +#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ +#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ +#cmakedefine SDL_POWER_BEOS @SDL_POWER_BEOS@ +#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ + +/* Enable assembly routines */ +#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@ +#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@ + + +/* Platform specific definitions */ +#if !defined(__WIN32__) +# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +typedef unsigned int size_t; +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +# endif /* if (stdint.h isn't available) */ +#else /* __WIN32__ */ +# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +# elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +# ifndef _UINTPTR_T_DEFINED +# ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +# else +typedef unsigned int uintptr_t; +# endif +#define _UINTPTR_T_DEFINED +# endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +# endif +# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +# endif +# else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +# ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +# endif +typedef unsigned int uintptr_t; +# endif /* __GNUC__ || _MSC_VER */ +# endif /* !_STDINT_H_ && !HAVE_STDINT_H */ +#endif /* __WIN32__ */ + +#endif /* _SDL_config_h */ diff --git a/include/SDL_config.h.default b/include/SDL_config.h.default deleted file mode 100644 index 09ba38a711..0000000000 --- a/include/SDL_config.h.default +++ /dev/null @@ -1,45 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_h -#define _SDL_config_h - -#include "SDL_platform.h" - -/* Add any platform that doesn't build using the configure system */ -#if defined(__DREAMCAST__) -#include "SDL_config_dreamcast.h" -#elif defined(__MACOS__) -#include "SDL_config_macos.h" -#elif defined(__MACOSX__) -#include "SDL_config_macosx.h" -#elif defined(__SYMBIAN32__) -#include "SDL_config_symbian.h" /* must be before win32! */ -#elif defined(__WIN32__) -#include "SDL_config_win32.h" -#elif defined(__OS2__) -#include "SDL_config_os2.h" -#else -#include "SDL_config_minimal.h" -#endif /* platform config */ - -#endif /* _SDL_config_h */ diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 8bb1773c0e..04ee110521 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -1,36 +1,39 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #ifndef _SDL_config_h #define _SDL_config_h -/* This is a set of defines to configure the SDL features */ +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ /* General platform specific identifiers */ #include "SDL_platform.h" /* Make sure that this isn't included by Visual C++ */ #ifdef _MSC_VER -#error You should copy include/SDL_config.h.default to include/SDL_config.h +#error You should run hg revert SDL_config.h #endif /* C language features */ @@ -39,20 +42,14 @@ #undef volatile /* C datatypes */ -#undef size_t -#undef int8_t -#undef uint8_t -#undef int16_t -#undef uint16_t -#undef int32_t -#undef uint32_t -#undef int64_t -#undef uint64_t -#undef uintptr_t -#undef SDL_HAS_64BIT_TYPE - -/* Endianness */ -#undef SDL_BYTEORDER +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif +#undef HAVE_GCC_ATOMICS +#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET +#undef HAVE_PTHREAD_SPINLOCK /* Comment this if you want to build without any C library requirements */ #undef HAVE_LIBC @@ -76,6 +73,9 @@ #undef HAVE_ICONV_H #undef HAVE_SIGNAL_H #undef HAVE_ALTIVEC_H +#undef HAVE_PTHREAD_NP_H +#undef HAVE_LIBUDEV_H +#undef HAVE_DBUS_DBUS_H /* C library functions */ #undef HAVE_MALLOC @@ -83,8 +83,9 @@ #undef HAVE_REALLOC #undef HAVE_FREE #undef HAVE_ALLOCA -#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */ +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ #undef HAVE_GETENV +#undef HAVE_SETENV #undef HAVE_PUTENV #undef HAVE_UNSETENV #endif @@ -129,184 +130,180 @@ #undef HAVE_SSCANF #undef HAVE_SNPRINTF #undef HAVE_VSNPRINTF -#undef HAVE_ICONV +#undef HAVE_M_PI +#undef HAVE_ATAN +#undef HAVE_ATAN2 +#undef HAVE_CEIL +#undef HAVE_COPYSIGN +#undef HAVE_COS +#undef HAVE_COSF +#undef HAVE_FABS +#undef HAVE_FLOOR +#undef HAVE_LOG +#undef HAVE_POW +#undef HAVE_SCALBN +#undef HAVE_SIN +#undef HAVE_SINF +#undef HAVE_SQRT +#undef HAVE_FSEEKO +#undef HAVE_FSEEKO64 #undef HAVE_SIGACTION #undef HAVE_SA_SIGACTION #undef HAVE_SETJMP #undef HAVE_NANOSLEEP +#undef HAVE_SYSCONF +#undef HAVE_SYSCTLBYNAME #undef HAVE_CLOCK_GETTIME #undef HAVE_GETPAGESIZE #undef HAVE_MPROTECT +#undef HAVE_ICONV +#undef HAVE_PTHREAD_SETNAME_NP +#undef HAVE_PTHREAD_SET_NAME_NP #undef HAVE_SEM_TIMEDWAIT #else -/* We may need some replacement for stdarg.h here */ -#include +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 #endif /* HAVE_LIBC */ +/* SDL internal assertion support */ +#undef SDL_DEFAULT_ASSERT_LEVEL + /* Allow disabling of core subsystems */ +#undef SDL_ATOMIC_DISABLED #undef SDL_AUDIO_DISABLED -#undef SDL_CDROM_DISABLED #undef SDL_CPUINFO_DISABLED #undef SDL_EVENTS_DISABLED #undef SDL_FILE_DISABLED #undef SDL_JOYSTICK_DISABLED +#undef SDL_HAPTIC_DISABLED #undef SDL_LOADSO_DISABLED +#undef SDL_RENDER_DISABLED #undef SDL_THREADS_DISABLED #undef SDL_TIMERS_DISABLED #undef SDL_VIDEO_DISABLED +#undef SDL_POWER_DISABLED /* Enable various audio drivers */ #undef SDL_AUDIO_DRIVER_ALSA #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC #undef SDL_AUDIO_DRIVER_ARTS #undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC -#undef SDL_AUDIO_DRIVER_BAUDIO +#undef SDL_AUDIO_DRIVER_PULSEAUDIO +#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_BEOSAUDIO #undef SDL_AUDIO_DRIVER_BSD #undef SDL_AUDIO_DRIVER_COREAUDIO -#undef SDL_AUDIO_DRIVER_DART -#undef SDL_AUDIO_DRIVER_DC #undef SDL_AUDIO_DRIVER_DISK #undef SDL_AUDIO_DRIVER_DUMMY -#undef SDL_AUDIO_DRIVER_DMEDIA +#undef SDL_AUDIO_DRIVER_XAUDIO2 #undef SDL_AUDIO_DRIVER_DSOUND -#undef SDL_AUDIO_DRIVER_PULSE -#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC #undef SDL_AUDIO_DRIVER_ESD #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC -#undef SDL_AUDIO_DRIVER_MINT -#undef SDL_AUDIO_DRIVER_MMEAUDIO #undef SDL_AUDIO_DRIVER_NAS #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC +#undef SDL_AUDIO_DRIVER_SNDIO +#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC #undef SDL_AUDIO_DRIVER_OSS #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H -#undef SDL_AUDIO_DRIVER_PAUD -#undef SDL_AUDIO_DRIVER_QNXNTO -#undef SDL_AUDIO_DRIVER_SNDMGR +#undef SDL_AUDIO_DRIVER_PAUDIO +#undef SDL_AUDIO_DRIVER_QSA #undef SDL_AUDIO_DRIVER_SUNAUDIO -#undef SDL_AUDIO_DRIVER_WAVEOUT - -/* Enable various cdrom drivers */ -#undef SDL_CDROM_AIX -#undef SDL_CDROM_BEOS -#undef SDL_CDROM_BSDI -#undef SDL_CDROM_DC -#undef SDL_CDROM_DUMMY -#undef SDL_CDROM_FREEBSD -#undef SDL_CDROM_LINUX -#undef SDL_CDROM_MACOS -#undef SDL_CDROM_MACOSX -#undef SDL_CDROM_MINT -#undef SDL_CDROM_OPENBSD -#undef SDL_CDROM_OS2 -#undef SDL_CDROM_OSF -#undef SDL_CDROM_QNX -#undef SDL_CDROM_WIN32 +#undef SDL_AUDIO_DRIVER_WINMM +#undef SDL_AUDIO_DRIVER_FUSIONSOUND +#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC /* Enable various input drivers */ #undef SDL_INPUT_LINUXEV #undef SDL_INPUT_TSLIB #undef SDL_JOYSTICK_BEOS -#undef SDL_JOYSTICK_DC +#undef SDL_JOYSTICK_DINPUT #undef SDL_JOYSTICK_DUMMY #undef SDL_JOYSTICK_IOKIT #undef SDL_JOYSTICK_LINUX -#undef SDL_JOYSTICK_MACOS -#undef SDL_JOYSTICK_MINT -#undef SDL_JOYSTICK_OS2 -#undef SDL_JOYSTICK_RISCOS #undef SDL_JOYSTICK_WINMM #undef SDL_JOYSTICK_USBHID #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#undef SDL_HAPTIC_DUMMY +#undef SDL_HAPTIC_LINUX +#undef SDL_HAPTIC_IOKIT +#undef SDL_HAPTIC_DINPUT /* Enable various shared object loading systems */ #undef SDL_LOADSO_BEOS -#undef SDL_LOADSO_DLCOMPAT #undef SDL_LOADSO_DLOPEN #undef SDL_LOADSO_DUMMY #undef SDL_LOADSO_LDG -#undef SDL_LOADSO_MACOS -#undef SDL_LOADSO_OS2 -#undef SDL_LOADSO_WIN32 +#undef SDL_LOADSO_WINDOWS /* Enable various threading systems */ #undef SDL_THREAD_BEOS -#undef SDL_THREAD_DC -#undef SDL_THREAD_OS2 -#undef SDL_THREAD_PTH #undef SDL_THREAD_PTHREAD #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP -#undef SDL_THREAD_SPROC -#undef SDL_THREAD_WIN32 +#undef SDL_THREAD_WINDOWS /* Enable various timer systems */ #undef SDL_TIMER_BEOS -#undef SDL_TIMER_DC #undef SDL_TIMER_DUMMY -#undef SDL_TIMER_MACOS -#undef SDL_TIMER_MINT -#undef SDL_TIMER_OS2 -#undef SDL_TIMER_RISCOS #undef SDL_TIMER_UNIX -#undef SDL_TIMER_WIN32 -#undef SDL_TIMER_WINCE +#undef SDL_TIMER_WINDOWS /* Enable various video drivers */ -#undef SDL_VIDEO_DRIVER_AALIB #undef SDL_VIDEO_DRIVER_BWINDOW -#undef SDL_VIDEO_DRIVER_CACA -#undef SDL_VIDEO_DRIVER_DC -#undef SDL_VIDEO_DRIVER_DDRAW -#undef SDL_VIDEO_DRIVER_DGA +#undef SDL_VIDEO_DRIVER_COCOA #undef SDL_VIDEO_DRIVER_DIRECTFB -#undef SDL_VIDEO_DRIVER_DRAWSPROCKET +#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC #undef SDL_VIDEO_DRIVER_DUMMY -#undef SDL_VIDEO_DRIVER_FBCON -#undef SDL_VIDEO_DRIVER_GAPI -#undef SDL_VIDEO_DRIVER_GEM -#undef SDL_VIDEO_DRIVER_GGI -#undef SDL_VIDEO_DRIVER_IPOD -#undef SDL_VIDEO_DRIVER_NANOX -#undef SDL_VIDEO_DRIVER_OS2FS -#undef SDL_VIDEO_DRIVER_PHOTON -#undef SDL_VIDEO_DRIVER_PICOGUI -#undef SDL_VIDEO_DRIVER_PS2GS -#undef SDL_VIDEO_DRIVER_PS3 -#undef SDL_VIDEO_DRIVER_QTOPIA -#undef SDL_VIDEO_DRIVER_QUARTZ -#undef SDL_VIDEO_DRIVER_RISCOS -#undef SDL_VIDEO_DRIVER_SVGALIB -#undef SDL_VIDEO_DRIVER_TOOLBOX -#undef SDL_VIDEO_DRIVER_VGL -#undef SDL_VIDEO_DRIVER_WINDIB -#undef SDL_VIDEO_DRIVER_WSCONS +#undef SDL_VIDEO_DRIVER_WINDOWS #undef SDL_VIDEO_DRIVER_X11 -#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE #undef SDL_VIDEO_DRIVER_X11_DYNAMIC #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR -#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER -#undef SDL_VIDEO_DRIVER_X11_VIDMODE +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE +#undef SDL_VIDEO_DRIVER_X11_XCURSOR #undef SDL_VIDEO_DRIVER_X11_XINERAMA -#undef SDL_VIDEO_DRIVER_X11_XME +#undef SDL_VIDEO_DRIVER_X11_XINPUT2 +#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH #undef SDL_VIDEO_DRIVER_X11_XRANDR -#undef SDL_VIDEO_DRIVER_X11_XV -#undef SDL_VIDEO_DRIVER_XBIOS +#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#undef SDL_VIDEO_DRIVER_X11_XSHAPE +#undef SDL_VIDEO_DRIVER_X11_XVIDMODE +#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS +#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 +#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY +#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM + +#undef SDL_VIDEO_RENDER_D3D +#undef SDL_VIDEO_RENDER_OGL +#undef SDL_VIDEO_RENDER_OGL_ES +#undef SDL_VIDEO_RENDER_OGL_ES2 +#undef SDL_VIDEO_RENDER_DIRECTFB /* Enable OpenGL support */ #undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_ES +#undef SDL_VIDEO_OPENGL_BGL +#undef SDL_VIDEO_OPENGL_CGL #undef SDL_VIDEO_OPENGL_GLX #undef SDL_VIDEO_OPENGL_WGL #undef SDL_VIDEO_OPENGL_OSMESA #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC -/* Disable screensaver */ -#undef SDL_VIDEO_DISABLE_SCREENSAVER +/* Enable system power support */ +#undef SDL_POWER_LINUX +#undef SDL_POWER_WINDOWS +#undef SDL_POWER_MACOSX +#undef SDL_POWER_BEOS +#undef SDL_POWER_HARDWIRED /* Enable assembly routines */ #undef SDL_ASSEMBLY_ROUTINES -#undef SDL_HERMES_BLITTERS #undef SDL_ALTIVEC_BLITTERS #endif /* _SDL_config_h */ diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h new file mode 100644 index 0000000000..e0c019f248 --- /dev/null +++ b/include/SDL_config_android.h @@ -0,0 +1,138 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_android_h +#define _SDL_config_android_h + +#include "SDL_platform.h" + +/** + * \file SDL_config_android.h + * + * This is a configuration that can be used to build SDL for Android + */ + +#include + +#define HAVE_GCC_ATOMICS 1 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 + +#define SIZEOF_VOIDP 4 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_ANDROID 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_ANDROID 1 +#define SDL_HAPTIC_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_ANDROID 1 + +/* Enable OpenGL ES */ +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Enable system power support */ +#define SDL_POWER_ANDROID 1 + +#endif /* _SDL_config_android_h */ diff --git a/include/SDL_config_dreamcast.h b/include/SDL_config_dreamcast.h deleted file mode 100644 index fb03098e72..0000000000 --- a/include/SDL_config_dreamcast.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_dreamcast_h -#define _SDL_config_dreamcast_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -typedef unsigned long uintptr_t; -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRDUP 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DC 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_DC 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_DC 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_DUMMY 1 - -/* Enable various threading systems */ -#define SDL_THREAD_DC 1 - -/* Enable various timer systems */ -#define SDL_TIMER_DC 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DC 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_dreamcast_h */ diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h new file mode 100644 index 0000000000..b27b18973e --- /dev/null +++ b/include/SDL_config_iphoneos.h @@ -0,0 +1,151 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_iphoneos_h +#define _SDL_config_iphoneos_h + +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define HAVE_GCC_ATOMICS 1 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 + +/* enable iPhone version of Core Audio driver */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* Enable Unix style SO loading */ +/* Technically this works, but it violates the iPhone developer agreement */ +/* #define SDL_LOADSO_DLOPEN 1 */ + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Supported video drivers */ +#define SDL_VIDEO_DRIVER_UIKIT 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* enable OpenGL ES */ +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Enable system power support */ +#define SDL_POWER_UIKIT 1 + +/* enable iPhone keyboard support */ +#define SDL_IPHONE_KEYBOARD 1 + +/* enable joystick subsystem */ +#define SDL_JOYSTICK_DISABLED 0 + +/* Set max recognized G-force from accelerometer + See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed + */ +#define SDL_IPHONE_MAX_GFORCE 5.0 + +#endif /* _SDL_config_iphoneos_h */ diff --git a/include/SDL_config_macos.h b/include/SDL_config_macos.h deleted file mode 100644 index 4fe1715aa1..0000000000 --- a/include/SDL_config_macos.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_macos_h -#define _SDL_config_macos_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#include - -typedef SInt8 int8_t; -typedef UInt8 uint8_t; -typedef SInt16 int16_t; -typedef UInt16 uint16_t; -typedef SInt32 int32_t; -typedef UInt32 uint32_t; -typedef SInt64 int64_t; -typedef UInt64 uint64_t; -typedef unsigned long uintptr_t; - -#define SDL_HAS_64BIT_TYPE 1 - -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_SSCANF 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_SNDMGR 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#if TARGET_API_MAC_CARBON -#define SDL_CDROM_DUMMY 1 -#else -#define SDL_CDROM_MACOS 1 -#endif - -/* Enable various input drivers */ -#if TARGET_API_MAC_CARBON -#define SDL_JOYSTICK_DUMMY 1 -#else -#define SDL_JOYSTICK_MACOS 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_MACOS 1 - -/* Enable various threading systems */ -#define SDL_THREADS_DISABLED 1 - -/* Enable various timer systems */ -#define SDL_TIMER_MACOS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 -#define SDL_VIDEO_DRIVER_TOOLBOX 1 - -/* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 - -#endif /* _SDL_config_macos_h */ diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h index 84be61777c..68a0ebb9be 100644 --- a/include/SDL_config_macosx.h +++ b/include/SDL_config_macosx.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #ifndef _SDL_config_macosx_h @@ -30,121 +29,152 @@ /* This is a set of defines to configure the SDL features */ -#define SDL_HAS_64BIT_TYPE 1 +#ifdef __LP64__ + #define SIZEOF_VOIDP 8 +#else + #define SIZEOF_VOIDP 4 +#endif /* Useful headers */ -/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ -#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) -#define HAVE_ALLOCA_H 1 -#endif -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 /* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 #define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SIGACTION 1 -#define HAVE_SETJMP 1 -#define HAVE_NANOSLEEP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 /* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_COREAUDIO 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_MACOSX 1 +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */ -#define SDL_JOYSTICK_IOKIT 1 +#define SDL_JOYSTICK_IOKIT 1 +#define SDL_HAPTIC_IOKIT 1 /* Enable various shared object loading systems */ -#ifdef __ppc__ -/* For Mac OS X 10.2 compatibility */ -#define SDL_LOADSO_DLCOMPAT 1 -#else -#define SDL_LOADSO_DLOPEN 1 -#endif +#define SDL_LOADSO_DLOPEN 1 /* Enable various threading systems */ -#define SDL_THREAD_PTHREAD 1 -#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 /* Enable various timer systems */ -#define SDL_TIMER_UNIX 1 +#define SDL_TIMER_UNIX 1 /* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) -#define SDL_VIDEO_DRIVER_TOOLBOX 1 -#else -#define SDL_VIDEO_DRIVER_QUARTZ 1 -#endif -#define SDL_VIDEO_DRIVER_DGA 1 -#define SDL_VIDEO_DRIVER_X11 1 -#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 +#define SDL_VIDEO_DRIVER_COCOA 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#undef SDL_VIDEO_DRIVER_X11 #define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" -#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" -#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" #define SDL_VIDEO_DRIVER_X11_XINERAMA 1 -#define SDL_VIDEO_DRIVER_X11_XME 1 #define SDL_VIDEO_DRIVER_X11_XRANDR 1 -#define SDL_VIDEO_DRIVER_X11_XV 1 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 +#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 +#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 + +#ifdef MAC_OS_X_VERSION_10_8 +/* + * No matter the versions targeted, this is the 10.8 or later SDK, so you have + * to use the external Xquartz, which is a more modern Xlib. Previous SDKs + * used an older Xlib. + */ +#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 +#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 +#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif /* Enable OpenGL support */ -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_GLX 1 +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_CGL +#define SDL_VIDEO_OPENGL_CGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_GLX +#define SDL_VIDEO_OPENGL_GLX 1 +#endif -/* Disable screensaver */ -#define SDL_VIDEO_DISABLE_SCREENSAVER 1 +/* Enable system power support */ +#define SDL_POWER_MACOSX 1 /* Enable assembly routines */ -#define SDL_ASSEMBLY_ROUTINES 1 +#define SDL_ASSEMBLY_ROUTINES 1 #ifdef __ppc__ -#define SDL_ALTIVEC_BLITTERS 1 +#define SDL_ALTIVEC_BLITTERS 1 #endif #endif /* _SDL_config_macosx_h */ diff --git a/include/SDL_config_minimal.h b/include/SDL_config_minimal.h index d10db7c62f..fe3cebc7ed 100644 --- a/include/SDL_config_minimal.h +++ b/include/SDL_config_minimal.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #ifndef _SDL_config_minimal_h @@ -25,38 +24,55 @@ #include "SDL_platform.h" -/* This is the minimal configuration that can be used to build SDL */ +/** + * \file SDL_config_minimal.h + * + * This is the minimal configuration that can be used to build SDL. + */ -#include +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) +/* Here are some reasonable defaults */ +typedef unsigned int size_t; typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; -typedef unsigned int size_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; typedef unsigned long uintptr_t; +#else +#define HAVE_STDINT_H 1 +#endif /* Visual Studio 2008 */ -/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ -#define SDL_AUDIO_DRIVER_DUMMY 1 +#ifdef __GNUC__ +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 +#endif -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 +#define SDL_LOADSO_DISABLED 1 /* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 +#define SDL_THREADS_DISABLED 1 /* Enable the stub timer support (src/timer/dummy/\*.c) */ -#define SDL_TIMERS_DISABLED 1 +#define SDL_TIMERS_DISABLED 1 /* Enable the dummy video driver (src/video/dummy/\*.c) */ -#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 #endif /* _SDL_config_minimal_h */ diff --git a/include/SDL_config_nds.h b/include/SDL_config_nds.h deleted file mode 100644 index cb4d61f692..0000000000 --- a/include/SDL_config_nds.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_nds_h -#define _SDL_config_nds_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -/* General platform specific identifiers */ -#include "SDL_platform.h" - -/* C datatypes */ -#define SDL_HAS_64BIT_TYPE 1 - -/* Endianness */ -#define SDL_BYTEORDER 1234 - -/* Useful headers */ -#define HAVE_ALLOCA_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_STRING_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_ICONV_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOULL 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRNCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_NDS 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_NDS 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -/* Enable the stub thread support (src/thread/generic/\*.c) */ -#define SDL_THREADS_DISABLED 1 - -/* Enable various timer systems */ -#define SDL_TIMER_NDS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_NDS 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -#endif /* _SDL_config_nds_h */ diff --git a/include/SDL_config_os2.h b/include/SDL_config_os2.h deleted file mode 100644 index 42edd20e89..0000000000 --- a/include/SDL_config_os2.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_os2_h -#define _SDL_config_os2_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef unsigned int size_t; -typedef unsigned long uintptr_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; - -#define SDL_HAS_64BIT_TYPE 1 - -/* Use Watcom's LIBC */ -#define HAVE_LIBC 1 - -/* Useful headers */ -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRING_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_GETENV 1 -#define HAVE_PUTENV 1 -#define HAVE_UNSETENV 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_BCOPY 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE_STRLCPY 1 -#define HAVE_STRLCAT 1 -#define HAVE_STRDUP 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_INDEX 1 -#define HAVE_RINDEX 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__UITOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE__I64TOA 1 -#define HAVE__UI64TOA 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_STRICMP 1 -#define HAVE_STRCASECMP 1 -#define HAVE_SSCANF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SETJMP 1 -#define HAVE_CLOCK_GETTIME 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_DART 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#define SDL_CDROM_OS2 1 - -/* Enable various input drivers */ -#define SDL_JOYSTICK_OS2 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_OS2 1 - -/* Enable various threading systems */ -#define SDL_THREAD_OS2 1 - -/* Enable various timer systems */ -#define SDL_TIMER_OS2 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_OS2FS 1 - -/* Enable OpenGL support */ -/* Nothing here yet for OS/2... :( */ - -/* Enable assembly routines where available */ -#define SDL_ASSEMBLY_ROUTINES 1 - -#endif /* _SDL_config_os2_h */ diff --git a/include/SDL_config_pandora.h b/include/SDL_config_pandora.h new file mode 100644 index 0000000000..b93a1bc1a5 --- /dev/null +++ b/include/SDL_config_pandora.h @@ -0,0 +1,124 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define SDL_BYTEORDER 1234 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_OSS 1 + +#define SDL_INPUT_LINUXEV 1 +#define SDL_INPUT_TSLIB 1 +#define SDL_JOYSTICK_LINUX 1 +#define SDL_HAPTIC_LINUX 1 + +#define SDL_LOADSO_DLOPEN 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 + +#define SDL_TIMER_UNIX 1 + +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_PANDORA 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_OPENGL_ES 1 + +#endif /* _SDL_config_h */ diff --git a/include/SDL_config_psp.h b/include/SDL_config_psp.h new file mode 100644 index 0000000000..bf456f6880 --- /dev/null +++ b/include/SDL_config_psp.h @@ -0,0 +1,136 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_psp_h +#define _SDL_config_psp_h + +#include "SDL_platform.h" + + + +#ifdef __GNUC__ +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 +#endif + +#define HAVE_GCC_ATOMICS 1 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +//#define HAVE_SYSCONF 1 +//#define HAVE_SIGACTION 1 + + +/* PSP isn't that sophisticated */ +#define LACKS_SYS_MMAN_H 1 + +/* Enable the stub thread support (src/thread/psp/\*.c) */ +#define SDL_THREAD_PSP 1 + +/* Enable the stub timer support (src/timer/psp/\*.c) */ +#define SDL_TIMERS_PSP 1 + +/* Enable the stub joystick driver (src/joystick/psp/\*.c) */ +#define SDL_JOYSTICK_PSP 1 + +/* Enable the stub audio driver (src/audio/psp/\*.c) */ +#define SDL_AUDIO_DRIVER_PSP 1 + +/* PSP video dirver */ +#define SDL_VIDEO_DRIVER_PSP 1 + +/* PSP render dirver */ +#define SDL_VIDEO_RENDER_PSP 1 + +#define SDL_POWER_PSP 1 + +/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* PSP can't load shared object (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + + +#endif /* _SDL_config_psp_h */ diff --git a/include/SDL_config_symbian.h b/include/SDL_config_symbian.h deleted file mode 100644 index e917ac6e7d..0000000000 --- a/include/SDL_config_symbian.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* - -Symbian version Markus Mertama - -*/ - - -#ifndef _SDL_CONFIG_SYMBIAN_H -#define _SDL_CONFIG_SYMBIAN_H - -#include "SDL_platform.h" - -/* This is the minimal configuration that can be used to build SDL */ - - -#include -#include - - -#ifdef __GCCE__ -#define SYMBIAN32_GCCE -#endif - -#ifndef _SIZE_T_DEFINED -typedef unsigned int size_t; -#endif - -#ifndef _INTPTR_T_DECLARED -typedef unsigned int uintptr_t; -#endif - -#ifndef _INT8_T_DECLARED -typedef signed char int8_t; -#endif - -#ifndef _UINT8_T_DECLARED -typedef unsigned char uint8_t; -#endif - -#ifndef _INT16_T_DECLARED -typedef signed short int16_t; -#endif - -#ifndef _UINT16_T_DECLARED -typedef unsigned short uint16_t; -#endif - -#ifndef _INT32_T_DECLARED -typedef signed int int32_t; -#endif - -#ifndef _UINT32_T_DECLARED -typedef unsigned int uint32_t; -#endif - -#ifndef _INT64_T_DECLARED -typedef signed long long int64_t; -#endif - -#ifndef _UINT64_T_DECLARED -typedef unsigned long long uint64_t; -#endif - -#define SDL_AUDIO_DRIVER_EPOCAUDIO 1 - - -/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ -#define SDL_CDROM_DISABLED 1 - -/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ -#define SDL_JOYSTICK_DISABLED 1 - -/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ -#define SDL_LOADSO_DISABLED 1 - -#define SDL_THREAD_SYMBIAN 1 - -#define SDL_VIDEO_DRIVER_EPOC 1 - -#define SDL_VIDEO_OPENGL 0 - -#define SDL_HAS_64BIT_TYPE 1 - -#define HAVE_LIBC 1 -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 - -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -/*#define HAVE_ALLOCA 1*/ -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRUPR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -/*#define HAVE__STRICMP 1*/ -#define HAVE__STRNICMP 1 -#define HAVE_SSCANF 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 - - - -#endif /* _SDL_CONFIG_SYMBIAN_H */ diff --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h deleted file mode 100644 index da2c15dd7e..0000000000 --- a/include/SDL_config_win32.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_config_win32_h -#define _SDL_config_win32_h - -#include "SDL_platform.h" - -/* This is a set of defines to configure the SDL features */ - -#if defined(__GNUC__) || defined(__DMC__) -#define HAVE_STDINT_H 1 -#elif defined(_MSC_VER) -typedef signed __int8 int8_t; -typedef unsigned __int8 uint8_t; -typedef signed __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef signed __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#ifndef _UINTPTR_T_DEFINED -#ifdef _WIN64 -typedef unsigned __int64 uintptr_t; -#else -typedef unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) -#define DWORD_PTR DWORD -#endif -#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) -#define LONG_PTR LONG -#endif -#else /* !__GNUC__ && !_MSC_VER */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed short int16_t; -typedef unsigned short uint16_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef signed long long int64_t; -typedef unsigned long long uint64_t; -#ifndef _SIZE_T_DEFINED_ -#define _SIZE_T_DEFINED_ -typedef unsigned int size_t; -#endif -typedef unsigned int uintptr_t; -#endif /* __GNUC__ || _MSC_VER */ -#define SDL_HAS_64BIT_TYPE 1 - -/* Enabled for SDL 1.2 (binary compatibility) */ -#define HAVE_LIBC 1 -#ifdef HAVE_LIBC -/* Useful headers */ -#define HAVE_STDIO_H 1 -#define STDC_HEADERS 1 -#define HAVE_STRING_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_MATH_H 1 -#ifndef _WIN32_WCE -#define HAVE_SIGNAL_H 1 -#endif - -/* C library functions */ -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ALLOCA 1 -#define HAVE_QSORT 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE__STRLWR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_ITOA 1 -#define HAVE__LTOA 1 -#define HAVE__ULTOA 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -#define HAVE_STRTOLL 1 -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE__STRICMP 1 -#define HAVE__STRNICMP 1 -#define HAVE_SSCANF 1 -#else -#define HAVE_STDARG_H 1 -#define HAVE_STDDEF_H 1 -#endif - -/* Enable various audio drivers */ -#ifndef _WIN32_WCE -#define SDL_AUDIO_DRIVER_DSOUND 1 -#endif -#define SDL_AUDIO_DRIVER_WAVEOUT 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various cdrom drivers */ -#ifdef _WIN32_WCE -#define SDL_CDROM_DISABLED 1 -#else -#define SDL_CDROM_WIN32 1 -#endif - -/* Enable various input drivers */ -#ifdef _WIN32_WCE -#define SDL_JOYSTICK_DISABLED 1 -#else -#define SDL_JOYSTICK_WINMM 1 -#endif - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WIN32 1 - -/* Enable various threading systems */ -#define SDL_THREAD_WIN32 1 - -/* Enable various timer systems */ -#ifdef _WIN32_WCE -#define SDL_TIMER_WINCE 1 -#else -#define SDL_TIMER_WIN32 1 -#endif - -/* Enable various video drivers */ -#ifdef _WIN32_WCE -#define SDL_VIDEO_DRIVER_GAPI 1 -#endif -#ifndef _WIN32_WCE -#define SDL_VIDEO_DRIVER_DDRAW 1 -#endif -#define SDL_VIDEO_DRIVER_DUMMY 1 -#define SDL_VIDEO_DRIVER_WINDIB 1 - -/* Enable OpenGL support */ -#ifndef _WIN32_WCE -#define SDL_VIDEO_OPENGL 1 -#define SDL_VIDEO_OPENGL_WGL 1 -#endif - -/* Disable screensaver */ -#define SDL_VIDEO_DISABLE_SCREENSAVER 1 - -/* Enable assembly routines (Win64 doesn't have inline asm) */ -#ifndef _WIN64 -#define SDL_ASSEMBLY_ROUTINES 1 -#endif - -#endif /* _SDL_config_win32_h */ diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h new file mode 100644 index 0000000000..0b7621564d --- /dev/null +++ b/include/SDL_config_windows.h @@ -0,0 +1,189 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_windows_h +#define _SDL_config_windows_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DSOUND 1 +#define SDL_AUDIO_DRIVER_XAUDIO2 1 +#define SDL_AUDIO_DRIVER_WINMM 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_HAPTIC_DINPUT 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WINDOWS 1 + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 + +#ifndef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 1 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_windows_h */ diff --git a/include/SDL_config_wiz.h b/include/SDL_config_wiz.h new file mode 100644 index 0000000000..9be04d92a9 --- /dev/null +++ b/include/SDL_config_wiz.h @@ -0,0 +1,119 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +#define SDL_BYTEORDER 1234 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_POW 1 + +#define SDL_CDROM_DISABLED 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_OSS 1 + +#define SDL_INPUT_LINUXEV 1 +#define SDL_INPUT_TSLIB 1 +#define SDL_JOYSTICK_LINUX 1 +#define SDL_HAPTIC_LINUX 1 + +#define SDL_LOADSO_DLOPEN 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 + +#define SDL_TIMER_UNIX 1 + +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_PANDORA 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_OPENGL_ES 1 + +#endif /* _SDL_config_h */ diff --git a/include/SDL_copying.h b/include/SDL_copying.h index b5b64f2994..3a8fb758a1 100644 --- a/include/SDL_copying.h +++ b/include/SDL_copying.h @@ -1,22 +1,20 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ - diff --git a/include/SDL_cpuinfo.h b/include/SDL_cpuinfo.h index 4200d6d170..dde3074f03 100644 --- a/include/SDL_cpuinfo.h +++ b/include/SDL_cpuinfo.h @@ -1,28 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /** - * @file SDL_cpuinfo.h - * CPU feature detection for SDL + * \file SDL_cpuinfo.h + * + * CPU feature detection for SDL. */ #ifndef _SDL_cpuinfo_h @@ -30,35 +30,110 @@ #include "SDL_stdinc.h" +/* Need to do this here because intrin.h has C++ code in it */ +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) +#include +#ifndef _WIN64 +#define __MMX__ +#define __3dNOW__ +#endif +#define __SSE__ +#define __SSE2__ +#elif defined(__MINGW64_VERSION_MAJOR) +#include +#else +#ifdef __ALTIVEC__ +#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__) +#include +#undef pixel +#endif +#endif +#ifdef __MMX__ +#include +#endif +#ifdef __3dNOW__ +#include +#endif +#ifdef __SSE__ +#include +#endif +#ifdef __SSE2__ +#include +#endif +#endif + #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif -/** This function returns true if the CPU has the RDTSC instruction */ +/* This is a guess for the cacheline size used for padding. + * Most x86 processors have a 64 byte cache line. + * The 64-bit PowerPC processors have a 128 byte cache line. + * We'll use the larger value to be generally safe. + */ +#define SDL_CACHELINE_SIZE 128 + +/** + * This function returns the number of CPU cores available. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); + +/** + * This function returns the L1 cache line size of the CPU + * + * This is useful for determining multi-threaded structure padding + * or SIMD prefetch sizes. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); + +/** + * This function returns true if the CPU has the RDTSC instruction. + */ extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); -/** This function returns true if the CPU has MMX features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); +/** + * This function returns true if the CPU has AltiVec features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); -/** This function returns true if the CPU has MMX Ext. features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); +/** + * This function returns true if the CPU has MMX features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); -/** This function returns true if the CPU has 3DNow features */ +/** + * This function returns true if the CPU has 3DNow! features. + */ extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); -/** This function returns true if the CPU has 3DNow! Ext. features */ -extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); - -/** This function returns true if the CPU has SSE features */ +/** + * This function returns true if the CPU has SSE features. + */ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); -/** This function returns true if the CPU has SSE2 features */ +/** + * This function returns true if the CPU has SSE2 features. + */ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); -/** This function returns true if the CPU has AltiVec features */ -extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); +/** + * This function returns true if the CPU has SSE3 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); + +/** + * This function returns true if the CPU has SSE4.1 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); + +/** + * This function returns true if the CPU has SSE4.2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -67,3 +142,5 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); #include "close_code.h" #endif /* _SDL_cpuinfo_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_endian.h b/include/SDL_endian.h index 068da918f4..c58edcca02 100644 --- a/include/SDL_endian.h +++ b/include/SDL_endian.h @@ -1,27 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /** - * @file SDL_endian.h + * \file SDL_endian.h + * * Functions for reading and writing endian-specific values */ @@ -30,15 +30,15 @@ #include "SDL_stdinc.h" -/** @name SDL_ENDIANs - * The two types of endianness +/** + * \name The two types of endianness */ /*@{*/ -#define SDL_LIL_ENDIAN 1234 -#define SDL_BIG_ENDIAN 4321 +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 /*@}*/ -#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ #ifdef __linux__ #include #define SDL_BYTEORDER __BYTE_ORDER @@ -48,9 +48,9 @@ (defined(__MIPS__) && defined(__MISPEB__)) || \ defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ defined(__sparc__) -#define SDL_BYTEORDER SDL_BIG_ENDIAN +#define SDL_BYTEORDER SDL_BIG_ENDIAN #else -#define SDL_BYTEORDER SDL_LIL_ENDIAN +#define SDL_BYTEORDER SDL_LIL_ENDIAN #endif #endif /* __linux __ */ #endif /* !SDL_BYTEORDER */ @@ -63,147 +63,170 @@ extern "C" { #endif /** - * @name SDL_Swap Functions - * Use inline functions for compilers that support them, and static - * functions for those that do not. Because these functions become - * static for compilers that do not support inline functions, this - * header should only be included in files that actually use them. + * \file SDL_endian.h */ -/*@{*/ #if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint16 SDL_Swap16(Uint16 x) + !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) { - __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); - return x; + __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); + return x; } #elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint16 SDL_Swap16(Uint16 x) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) { - __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); - return x; + __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); + return x; } #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint16 SDL_Swap16(Uint16 x) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) { - int result; + int result; - __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); - return (Uint16)result; + __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); + return (Uint16)result; } -#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -static __inline__ Uint16 SDL_Swap16(Uint16 x) +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) { - __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); - return x; + __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; } #else -static __inline__ Uint16 SDL_Swap16(Uint16 x) { - return SDL_static_cast(Uint16, ((x<<8)|(x>>8))); +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); } #endif -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint32 SDL_Swap32(Uint32 x) +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) { - __asm__("bswap %0" : "=r" (x) : "0" (x)); - return x; + __asm__("bswap %0": "=r"(x):"0"(x)); + return x; } #elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint32 SDL_Swap32(Uint32 x) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) { - __asm__("bswapl %0" : "=r" (x) : "0" (x)); - return x; + __asm__("bswapl %0": "=r"(x):"0"(x)); + return x; } #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) -static __inline__ Uint32 SDL_Swap32(Uint32 x) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) { - Uint32 result; + Uint32 result; - __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); - __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); - __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); - return result; + __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); + __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); + __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); + return result; } -#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) -static __inline__ Uint32 SDL_Swap32(Uint32 x) +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) { - __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); - return x; + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; } #else -static __inline__ Uint32 SDL_Swap32(Uint32 x) { - return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24))); +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | + ((x >> 8) & 0x0000FF00) | (x >> 24))); } #endif -#ifdef SDL_HAS_64BIT_TYPE -#if defined(__GNUC__) && defined(__i386__) && \ - !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) -static __inline__ Uint64 SDL_Swap64(Uint64 x) +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) { - union { - struct { Uint32 a,b; } s; - Uint64 u; - } v; - v.u = x; - __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" - : "=r" (v.s.a), "=r" (v.s.b) - : "0" (v.s.a), "1" (v.s.b)); - return v.u; + union + { + struct + { + Uint32 a, b; + } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), + "1"(v.s. + b)); + return v.u; } #elif defined(__GNUC__) && defined(__x86_64__) -static __inline__ Uint64 SDL_Swap64(Uint64 x) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) { - __asm__("bswapq %0" : "=r" (x) : "0" (x)); - return x; + __asm__("bswapq %0": "=r"(x):"0"(x)); + return x; } #else -static __inline__ Uint64 SDL_Swap64(Uint64 x) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) { - Uint32 hi, lo; - - /* Separate into high and low 32-bit values and swap them */ - lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x >>= 32; - hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); - x = SDL_Swap32(lo); - x <<= 32; - x |= SDL_Swap32(hi); - return (x); + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return (x); } #endif -#else -/* This is mainly to keep compilers from complaining in SDL code. - * If there is no real 64-bit datatype, then compilers will complain about - * the fake 64-bit datatype that SDL provides when it compiles user code. - */ -#define SDL_Swap64(X) (X) -#endif /* SDL_HAS_64BIT_TYPE */ -/*@}*/ + + +SDL_FORCE_INLINE float +SDL_SwapFloat(float x) +{ + union + { + float f; + Uint32 ui32; + } swapper; + swapper.f = x; + swapper.ui32 = SDL_Swap32(swapper.ui32); + return swapper.f; +} + /** - * @name SDL_SwapLE and SDL_SwapBE Functions - * Byteswap item from the specified endianness to the native endianness + * \name Swap to native + * Byteswap item from the specified endianness to the native endianness. */ /*@{*/ #if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define SDL_SwapLE16(X) (X) -#define SDL_SwapLE32(X) (X) -#define SDL_SwapLE64(X) (X) -#define SDL_SwapBE16(X) SDL_Swap16(X) -#define SDL_SwapBE32(X) SDL_Swap32(X) -#define SDL_SwapBE64(X) SDL_Swap64(X) +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapFloatLE(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) #else -#define SDL_SwapLE16(X) SDL_Swap16(X) -#define SDL_SwapLE32(X) SDL_Swap32(X) -#define SDL_SwapLE64(X) SDL_Swap64(X) -#define SDL_SwapBE16(X) (X) -#define SDL_SwapBE32(X) (X) -#define SDL_SwapBE64(X) (X) +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#define SDL_SwapFloatBE(X) (X) #endif -/*@}*/ +/*@}*//*Swap to native*/ /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -212,3 +235,5 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x) #include "close_code.h" #endif /* _SDL_endian_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_error.h b/include/SDL_error.h index 4e1cce3b17..229b268027 100644 --- a/include/SDL_error.h +++ b/include/SDL_error.h @@ -1,28 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /** - * @file SDL_error.h - * Simple error message routines for SDL + * \file SDL_error.h + * + * Simple error message routines for SDL. */ #ifndef _SDL_error_h @@ -36,32 +36,34 @@ extern "C" { #endif -/** - * @name Public functions - */ -/*@{*/ -extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); -extern DECLSPEC char * SDLCALL SDL_GetError(void); +/* Public functions */ +/* SDL_SetError() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...); +extern DECLSPEC const char *SDLCALL SDL_GetError(void); extern DECLSPEC void SDLCALL SDL_ClearError(void); -/*@}*/ /** - * @name Private functions - * @internal Private error message function - used internally + * \name Internal error functions + * + * \internal + * Private error reporting function - used internally. */ /*@{*/ -#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) -#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) -typedef enum { - SDL_ENOMEM, - SDL_EFREAD, - SDL_EFWRITE, - SDL_EFSEEK, - SDL_UNSUPPORTED, - SDL_LASTERROR +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) +typedef enum +{ + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR } SDL_errorcode; -extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); -/*@}*/ +/* SDL_Error() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); +/*@}*//*Internal error functions*/ /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -70,3 +72,5 @@ extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); #include "close_code.h" #endif /* _SDL_error_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_events.h b/include/SDL_events.h index 94b4202518..b997b5ec8b 100644 --- a/include/SDL_events.h +++ b/include/SDL_events.h @@ -1,28 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /** - * @file SDL_events.h - * Include file for SDL event handling + * \file SDL_events.h + * + * Include file for SDL event handling. */ #ifndef _SDL_events_h @@ -30,11 +30,14 @@ #include "SDL_stdinc.h" #include "SDL_error.h" -#include "SDL_active.h" +#include "SDL_video.h" #include "SDL_keyboard.h" #include "SDL_mouse.h" #include "SDL_joystick.h" +#include "SDL_gamecontroller.h" #include "SDL_quit.h" +#include "SDL_gesture.h" +#include "SDL_touch.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -42,310 +45,669 @@ extern "C" { #endif -/** @name General keyboard/mouse state definitions */ -/*@{*/ -#define SDL_RELEASED 0 -#define SDL_PRESSED 1 -/*@}*/ +/* General keyboard/mouse state definitions */ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 -/** Event enumerations */ -typedef enum { - SDL_NOEVENT = 0, /**< Unused (do not remove) */ - SDL_ACTIVEEVENT, /**< Application loses/gains visibility */ - SDL_KEYDOWN, /**< Keys pressed */ - SDL_KEYUP, /**< Keys released */ - SDL_MOUSEMOTION, /**< Mouse moved */ - SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ - SDL_MOUSEBUTTONUP, /**< Mouse button released */ - SDL_JOYAXISMOTION, /**< Joystick axis motion */ - SDL_JOYBALLMOTION, /**< Joystick trackball motion */ - SDL_JOYHATMOTION, /**< Joystick hat position change */ - SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ - SDL_JOYBUTTONUP, /**< Joystick button released */ - SDL_QUIT, /**< User-requested quit */ - SDL_SYSWMEVENT, /**< System specific event */ - SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */ - SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */ - SDL_VIDEORESIZE, /**< User resized video mode */ - SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */ - SDL_EVENT_RESERVED2, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED3, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED4, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED5, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED6, /**< Reserved for future use.. */ - SDL_EVENT_RESERVED7, /**< Reserved for future use.. */ - /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ - SDL_USEREVENT = 24, - /** This last event is only for bounding internal arrays - * It is the number of bits in the event mask datatype -- Uint32 - */ - SDL_NUMEVENTS = 32 +/** + * \brief The types of events that can be delivered. + */ +typedef enum +{ + SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ + + /* Application events */ + SDL_QUIT = 0x100, /**< User-requested quit */ + + /* These application events have special meaning on iOS, see README-ios.txt for details */ + SDL_APP_TERMINATING, /**< The application is being terminated by the OS + Called on iOS in applicationWillTerminate() + Called on Android in onDestroy() + */ + SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. + Called on iOS in applicationDidReceiveMemoryWarning() + Called on Android in onLowMemory() + */ + SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background + Called on iOS in applicationWillResignActive() + Called on Android in onPause() + */ + SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time + Called on iOS in applicationDidEnterBackground() + Called on Android in onPause() + */ + SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground + Called on iOS in applicationWillEnterForeground() + Called on Android in onResume() + */ + SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive + Called on iOS in applicationDidBecomeActive() + Called on Android in onResume() + */ + + /* Window events */ + SDL_WINDOWEVENT = 0x200, /**< Window state change */ + SDL_SYSWMEVENT, /**< System specific event */ + + /* Keyboard events */ + SDL_KEYDOWN = 0x300, /**< Key pressed */ + SDL_KEYUP, /**< Key released */ + SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ + SDL_TEXTINPUT, /**< Keyboard text input */ + + /* Mouse events */ + SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_MOUSEWHEEL, /**< Mouse wheel motion */ + + /* Joystick events */ + SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ + SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ + + /* Game controller events */ + SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ + SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ + SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ + SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ + SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ + SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ + + /* Touch events */ + SDL_FINGERDOWN = 0x700, + SDL_FINGERUP, + SDL_FINGERMOTION, + + /* Gesture events */ + SDL_DOLLARGESTURE = 0x800, + SDL_DOLLARRECORD, + SDL_MULTIGESTURE, + + /* Clipboard events */ + SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ + + /* Drag and drop events */ + SDL_DROPFILE = 0x1000, /**< The system requests a file open */ + + /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, + * and should be allocated with SDL_RegisterEvents() + */ + SDL_USEREVENT = 0x8000, + + /** + * This last event is only for bounding internal arrays + */ + SDL_LASTEVENT = 0xFFFF } SDL_EventType; -/** @name Predefined event masks */ -/*@{*/ -#define SDL_EVENTMASK(X) (1<<(X)) -typedef enum { - SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), - SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), - SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), - SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| - SDL_EVENTMASK(SDL_KEYUP), - SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), - SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), - SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| - SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| - SDL_EVENTMASK(SDL_MOUSEBUTTONUP), - SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), - SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), - SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), - SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), - SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| - SDL_EVENTMASK(SDL_JOYBALLMOTION)| - SDL_EVENTMASK(SDL_JOYHATMOTION)| - SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| - SDL_EVENTMASK(SDL_JOYBUTTONUP), - SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), - SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), - SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), - SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) -} SDL_EventMask ; -#define SDL_ALLEVENTS 0xFFFFFFFF -/*@}*/ +/** + * \brief Fields shared by every event + */ +typedef struct SDL_CommonEvent +{ + Uint32 type; + Uint32 timestamp; +} SDL_CommonEvent; + +/** + * \brief Window state change event data (event.window.*) + */ +typedef struct SDL_WindowEvent +{ + Uint32 type; /**< ::SDL_WINDOWEVENT */ + Uint32 timestamp; + Uint32 windowID; /**< The associated window */ + Uint8 event; /**< ::SDL_WindowEventID */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint32 data1; /**< event dependent data */ + Sint32 data2; /**< event dependent data */ +} SDL_WindowEvent; -/** Application visibility event structure */ -typedef struct SDL_ActiveEvent { - Uint8 type; /**< SDL_ACTIVEEVENT */ - Uint8 gain; /**< Whether given states were gained or lost (1/0) */ - Uint8 state; /**< A mask of the focus states */ -} SDL_ActiveEvent; - -/** Keyboard event structure */ -typedef struct SDL_KeyboardEvent { - Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ - Uint8 which; /**< The keyboard device index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - SDL_keysym keysym; +/** + * \brief Keyboard button event structure (event.key.*) + */ +typedef struct SDL_KeyboardEvent +{ + Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 repeat; /**< Non-zero if this is a key repeat */ + Uint8 padding2; + Uint8 padding3; + SDL_Keysym keysym; /**< The key that was pressed or released */ } SDL_KeyboardEvent; -/** Mouse motion event structure */ -typedef struct SDL_MouseMotionEvent { - Uint8 type; /**< SDL_MOUSEMOTION */ - Uint8 which; /**< The mouse device index */ - Uint8 state; /**< The current button state */ - Uint16 x, y; /**< The X/Y coordinates of the mouse */ - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ +#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text editing event structure (event.edit.*) + */ +typedef struct SDL_TextEditingEvent +{ + Uint32 type; /**< ::SDL_TEXTEDITING */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ + Sint32 start; /**< The start cursor of selected editing text */ + Sint32 length; /**< The length of selected editing text */ +} SDL_TextEditingEvent; + + +#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text input event structure (event.text.*) + */ +typedef struct SDL_TextInputEvent +{ + Uint32 type; /**< ::SDL_TEXTINPUT */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ +} SDL_TextInputEvent; + +/** + * \brief Mouse motion event structure (event.motion.*) + */ +typedef struct SDL_MouseMotionEvent +{ + Uint32 type; /**< ::SDL_MOUSEMOTION */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint32 state; /**< The current button state */ + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ + Sint32 xrel; /**< The relative motion in the X direction */ + Sint32 yrel; /**< The relative motion in the Y direction */ } SDL_MouseMotionEvent; -/** Mouse button event structure */ -typedef struct SDL_MouseButtonEvent { - Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ - Uint8 which; /**< The mouse device index */ - Uint8 button; /**< The mouse button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */ +/** + * \brief Mouse button event structure (event.button.*) + */ +typedef struct SDL_MouseButtonEvent +{ + Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ } SDL_MouseButtonEvent; -/** Joystick axis motion event structure */ -typedef struct SDL_JoyAxisEvent { - Uint8 type; /**< SDL_JOYAXISMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 axis; /**< The joystick axis index */ - Sint16 value; /**< The axis value (range: -32768 to 32767) */ +/** + * \brief Mouse wheel event structure (event.wheel.*) + */ +typedef struct SDL_MouseWheelEvent +{ + Uint32 type; /**< ::SDL_MOUSEWHEEL */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Sint32 x; /**< The amount scrolled horizontally */ + Sint32 y; /**< The amount scrolled vertically */ +} SDL_MouseWheelEvent; + +/** + * \brief Joystick axis motion event structure (event.jaxis.*) + */ +typedef struct SDL_JoyAxisEvent +{ + Uint32 type; /**< ::SDL_JOYAXISMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The joystick axis index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; } SDL_JoyAxisEvent; -/** Joystick trackball motion event structure */ -typedef struct SDL_JoyBallEvent { - Uint8 type; /**< SDL_JOYBALLMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 ball; /**< The joystick trackball index */ - Sint16 xrel; /**< The relative motion in the X direction */ - Sint16 yrel; /**< The relative motion in the Y direction */ +/** + * \brief Joystick trackball motion event structure (event.jball.*) + */ +typedef struct SDL_JoyBallEvent +{ + Uint32 type; /**< ::SDL_JOYBALLMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 ball; /**< The joystick trackball index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ } SDL_JoyBallEvent; -/** Joystick hat position change event structure */ -typedef struct SDL_JoyHatEvent { - Uint8 type; /**< SDL_JOYHATMOTION */ - Uint8 which; /**< The joystick device index */ - Uint8 hat; /**< The joystick hat index */ - Uint8 value; /**< The hat position value: - * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP - * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT - * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN - * Note that zero means the POV is centered. - */ +/** + * \brief Joystick hat position change event structure (event.jhat.*) + */ +typedef struct SDL_JoyHatEvent +{ + Uint32 type; /**< ::SDL_JOYHATMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value. + * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP + * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT + * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN + * + * Note that zero means the POV is centered. + */ + Uint8 padding1; + Uint8 padding2; } SDL_JoyHatEvent; -/** Joystick button event structure */ -typedef struct SDL_JoyButtonEvent { - Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ - Uint8 which; /**< The joystick device index */ - Uint8 button; /**< The joystick button index */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +/** + * \brief Joystick button event structure (event.jbutton.*) + */ +typedef struct SDL_JoyButtonEvent +{ + Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; } SDL_JoyButtonEvent; -/** The "window resized" event - * When you get this event, you are responsible for setting a new video - * mode with the new width and height. +/** + * \brief Joystick device event structure (event.jdevice.*) + */ +typedef struct SDL_JoyDeviceEvent +{ + Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ + Uint32 timestamp; + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ +} SDL_JoyDeviceEvent; + + +/** + * \brief Game controller axis motion event structure (event.caxis.*) + */ +typedef struct SDL_ControllerAxisEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_ControllerAxisEvent; + + +/** + * \brief Game controller button event structure (event.cbutton.*) + */ +typedef struct SDL_ControllerButtonEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The controller button (SDL_GameControllerButton) */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_ControllerButtonEvent; + + +/** + * \brief Controller device event structure (event.cdevice.*) + */ +typedef struct SDL_ControllerDeviceEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ + Uint32 timestamp; + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ +} SDL_ControllerDeviceEvent; + + +/** + * \brief Touch finger event structure (event.tfinger.*) + */ +typedef struct SDL_TouchFingerEvent +{ + Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device id */ + SDL_FingerID fingerId; + float x; /**< Normalized in the range 0...1 */ + float y; /**< Normalized in the range 0...1 */ + float dx; /**< Normalized in the range 0...1 */ + float dy; /**< Normalized in the range 0...1 */ + float pressure; /**< Normalized in the range 0...1 */ +} SDL_TouchFingerEvent; + + +/** + * \brief Multiple Finger Gesture Event (event.mgesture.*) + */ +typedef struct SDL_MultiGestureEvent +{ + Uint32 type; /**< ::SDL_MULTIGESTURE */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device index */ + float dTheta; + float dDist; + float x; + float y; + Uint16 numFingers; + Uint16 padding; +} SDL_MultiGestureEvent; + + +/** + * \brief Dollar Gesture Event (event.dgesture.*) */ -typedef struct SDL_ResizeEvent { - Uint8 type; /**< SDL_VIDEORESIZE */ - int w; /**< New width */ - int h; /**< New height */ -} SDL_ResizeEvent; +typedef struct SDL_DollarGestureEvent +{ + Uint32 type; /**< ::SDL_DOLLARGESTURE */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device id */ + SDL_GestureID gestureId; + Uint32 numFingers; + float error; + float x; /**< Normalized center of gesture */ + float y; /**< Normalized center of gesture */ +} SDL_DollarGestureEvent; -/** The "screen redraw" event */ -typedef struct SDL_ExposeEvent { - Uint8 type; /**< SDL_VIDEOEXPOSE */ -} SDL_ExposeEvent; -/** The "quit requested" event */ -typedef struct SDL_QuitEvent { - Uint8 type; /**< SDL_QUIT */ +/** + * \brief An event used to request a file open by the system (event.drop.*) + * This event is disabled by default, you can enable it with SDL_EventState() + * \note If you enable this event, you must free the filename in the event. + */ +typedef struct SDL_DropEvent +{ + Uint32 type; /**< ::SDL_DROPFILE */ + Uint32 timestamp; + char *file; /**< The file name, which should be freed with SDL_free() */ +} SDL_DropEvent; + + +/** + * \brief The "quit requested" event + */ +typedef struct SDL_QuitEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; } SDL_QuitEvent; -/** A user-defined event type */ -typedef struct SDL_UserEvent { - Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ - int code; /**< User defined event code */ - void *data1; /**< User defined data pointer */ - void *data2; /**< User defined data pointer */ +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; +} SDL_OSEvent; + +/** + * \brief A user-defined event type (event.user.*) + */ +typedef struct SDL_UserEvent +{ + Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ + Uint32 timestamp; + Uint32 windowID; /**< The associated window if any */ + Sint32 code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ } SDL_UserEvent; -/** If you want to use this event, you should include SDL_syswm.h */ + struct SDL_SysWMmsg; typedef struct SDL_SysWMmsg SDL_SysWMmsg; -typedef struct SDL_SysWMEvent { - Uint8 type; - SDL_SysWMmsg *msg; + +/** + * \brief A video driver dependent system event (event.syswm.*) + * This event is disabled by default, you can enable it with SDL_EventState() + * + * \note If you want to use this event, you should include SDL_syswm.h. + */ +typedef struct SDL_SysWMEvent +{ + Uint32 type; /**< ::SDL_SYSWMEVENT */ + Uint32 timestamp; + SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ } SDL_SysWMEvent; -/** General event structure */ -typedef union SDL_Event { - Uint8 type; - SDL_ActiveEvent active; - SDL_KeyboardEvent key; - SDL_MouseMotionEvent motion; - SDL_MouseButtonEvent button; - SDL_JoyAxisEvent jaxis; - SDL_JoyBallEvent jball; - SDL_JoyHatEvent jhat; - SDL_JoyButtonEvent jbutton; - SDL_ResizeEvent resize; - SDL_ExposeEvent expose; - SDL_QuitEvent quit; - SDL_UserEvent user; - SDL_SysWMEvent syswm; +/** + * \brief General event structure + */ +typedef union SDL_Event +{ + Uint32 type; /**< Event type, shared with all events */ + SDL_CommonEvent common; /**< Common event data */ + SDL_WindowEvent window; /**< Window event data */ + SDL_KeyboardEvent key; /**< Keyboard event data */ + SDL_TextEditingEvent edit; /**< Text editing event data */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ + SDL_DropEvent drop; /**< Drag and drop event data */ + + /* This is necessary for ABI compatibility between Visual C++ and GCC + Visual C++ will respect the push pack pragma and use 52 bytes for + this structure, and GCC will use the alignment of the largest datatype + within the union, which is 8 bytes. + + So... we'll add padding to force the size to be 56 bytes for both. + */ + Uint8 padding[56]; } SDL_Event; /* Function prototypes */ -/** Pumps the event loop, gathering events from the input devices. +/** + * Pumps the event loop, gathering events from the input devices. + * * This function updates the event queue and internal input device state. + * * This should only be run in the thread that sets the video mode. */ extern DECLSPEC void SDLCALL SDL_PumpEvents(void); -typedef enum { - SDL_ADDEVENT, - SDL_PEEKEVENT, - SDL_GETEVENT +/*@{*/ +typedef enum +{ + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT } SDL_eventaction; /** * Checks the event queue for messages and optionally returns them. * - * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to + * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to * the back of the event queue. - * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front - * of the event queue, matching 'mask', will be returned and will not - * be removed from the queue. - * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front - * of the event queue, matching 'mask', will be returned and will be - * removed from the queue. * - * @return - * This function returns the number of events actually stored, or -1 - * if there was an error. + * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will not be removed from the queue. + * + * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will be removed from the queue. + * + * \return The number of events actually stored, or -1 if there was an error. * * This function is thread-safe. */ -extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, - SDL_eventaction action, Uint32 mask); +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, + SDL_eventaction action, + Uint32 minType, Uint32 maxType); +/*@}*/ -/** Polls for currently pending events, and returns 1 if there are any pending - * events, or 0 if there are none available. If 'event' is not NULL, the next - * event is removed from the queue and stored in that area. +/** + * Checks to see if certain event types are in the event queue. */ -extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); -/** Waits indefinitely for the next available event, returning 1, or 0 if there - * was an error while waiting for events. If 'event' is not NULL, the next - * event is removed from the queue and stored in that area. +/** + * This function clears events from the event queue */ -extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); +extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); +extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); -/** Add an event to the event queue. - * This function returns 0 on success, or -1 if the event queue was full - * or there was some other error. +/** + * \brief Polls for currently pending events. + * + * \return 1 if there are any pending events, or 0 if there are none available. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. */ -extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); -/** @name Event Filtering */ -/*@{*/ -typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); /** - * This function sets up a filter to process all events before they - * change internal state and are posted to the internal event queue. + * \brief Waits indefinitely for the next available event. * - * The filter is protypted as: - * @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode + * \return 1, or 0 if there was an error while waiting for events. * - * If the filter returns 1, then the event will be added to the internal queue. - * If it returns 0, then the event will be dropped from the queue, but the - * internal state will still be updated. This allows selective filtering of - * dynamically arriving events. + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); + +/** + * \brief Waits until the specified timeout (in milliseconds) for the next + * available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + * \param timeout The timeout (in milliseconds) to wait for next event. + */ +extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, + int timeout); + +/** + * \brief Add an event to the event queue. + * + * \return 1 on success, 0 if the event was filtered, or -1 if the event queue + * was full or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); + +typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); + +/** + * Sets up a filter to process all events before they change internal state and + * are posted to the internal event queue. + * + * The filter is prototyped as: + * \code + * int SDL_EventFilter(void *userdata, SDL_Event * event); + * \endcode * - * @warning Be very careful of what you do in the event filter function, as - * it may run in a different thread! + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. * - * There is one caveat when dealing with the SDL_QUITEVENT event type. The - * event filter is only called when the window manager desires to close the - * application window. If the event filter returns 1, then the window will - * be closed, otherwise the window will remain open if possible. - * If the quit event is generated by an interrupt signal, it will bypass the - * internal queue and be delivered to the application at the next event poll. + * \warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the ::SDL_QuitEvent event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. */ -extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, + void *userdata); /** * Return the current event filter - can be used to "chain" filters. - * If there is no event filter set, this function returns NULL. + * If there is no event filter set, this function returns SDL_FALSE. */ -extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); -/*@}*/ +extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, + void **userdata); + +/** + * Add a function which is called when an event is added to the queue. + */ +extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Remove an event watch function added with SDL_AddEventWatch() + */ +extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Run the filter function on the current event queue, removing any + * events for which the filter returns 0. + */ +extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, + void *userdata); -/** @name Event State */ /*@{*/ -#define SDL_QUERY -1 -#define SDL_IGNORE 0 -#define SDL_DISABLE 0 -#define SDL_ENABLE 1 +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 + +/** + * This function allows you to set the state of processing certain events. + * - If \c state is set to ::SDL_IGNORE, that event will be automatically + * dropped from the event queue and will not event be filtered. + * - If \c state is set to ::SDL_ENABLE, that event will be processed + * normally. + * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the + * current processing state of the specified event. + */ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); /*@}*/ +#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) /** -* This function allows you to set the state of processing certain events. -* If 'state' is set to SDL_IGNORE, that event will be automatically dropped -* from the event queue and will not event be filtered. -* If 'state' is set to SDL_ENABLE, that event will be processed normally. -* If 'state' is set to SDL_QUERY, SDL_EventState() will return the -* current processing state of the specified event. -*/ -extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); + * This function allocates a set of user-defined events, and returns + * the beginning event number for that set of events. + * + * If there aren't enough user-defined events left, this function + * returns (Uint32)-1 + */ +extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -354,3 +716,5 @@ extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); #include "close_code.h" #endif /* _SDL_events_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_gamecontroller.h b/include/SDL_gamecontroller.h new file mode 100644 index 0000000000..e55749ce35 --- /dev/null +++ b/include/SDL_gamecontroller.h @@ -0,0 +1,298 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gamecontroller.h + * + * Include file for SDL game controller event handling + */ + +#ifndef _SDL_gamecontroller_h +#define _SDL_gamecontroller_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_gamecontroller.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for game controllers, and load appropriate drivers. + * + * If you would like to receive controller updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/* The gamecontroller structure used to identify an SDL game controller */ +struct _SDL_GameController; +typedef struct _SDL_GameController SDL_GameController; + + +typedef enum +{ + SDL_CONTROLLER_BINDTYPE_NONE = 0, + SDL_CONTROLLER_BINDTYPE_BUTTON, + SDL_CONTROLLER_BINDTYPE_AXIS, + SDL_CONTROLLER_BINDTYPE_HAT +} SDL_GameControllerBindType; + +/** + * Get the SDL joystick layer binding for this controller button/axis mapping + */ +typedef struct SDL_GameControllerButtonBind +{ + SDL_GameControllerBindType bindType; + union + { + int button; + int axis; + struct { + int hat; + int hat_mask; + } hat; + } value; + +} SDL_GameControllerButtonBind; + + +/** + * To count the number of game controllers in the system for the following: + * int nJoysticks = SDL_NumJoysticks(); + * int nGameControllers = 0; + * for ( int i = 0; i < nJoysticks; i++ ) { + * if ( SDL_IsGameController(i) ) { + * nGameControllers++; + * } + * } + * + * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: + * guid,name,mappings + * + * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. + * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. + * The mapping format for joystick is: + * bX - a joystick button, index X + * hX.Y - hat X with value Y + * aX - axis X of the joystick + * Buttons can be used as a controller axis and vice versa. + * + * This string shows an example of a valid mapping for a controller + * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", + * + */ + +/** + * Add or update an existing mapping configuration + * + * \return 1 if mapping is added, 0 if updated, -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString ); + +/** + * Get a mapping string for a GUID + * + * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid ); + +/** + * Get a mapping string for an open GameController + * + * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller ); + +/** + * Is the joystick on this index supported by the game controller interface? + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); + + +/** + * Get the implementation dependent name of a game controller. + * This can be called before any controllers are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); + +/** + * Open a game controller for use. + * The index passed as an argument refers to the N'th game controller on the system. + * This index is the value which will identify this controller in future controller + * events. + * + * \return A controller identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); + +/** + * Return the name for this currently opened controller + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); + +/** + * Returns SDL_TRUE if the controller has been opened and currently connected, + * or SDL_FALSE if it has not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); + +/** + * Get the underlying joystick object used by a controller + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); + +/** + * Enable/disable controller event polling. + * + * If controller events are disabled, you must call SDL_GameControllerUpdate() + * yourself and check the state of the controller when you want controller + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); + +/** + * Update the current state of the open game controllers. + * + * This is called automatically by the event loop if any game controller + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); + + +/** + * The list of axes available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_AXIS_INVALID = -1, + SDL_CONTROLLER_AXIS_LEFTX, + SDL_CONTROLLER_AXIS_LEFTY, + SDL_CONTROLLER_AXIS_RIGHTX, + SDL_CONTROLLER_AXIS_RIGHTY, + SDL_CONTROLLER_AXIS_TRIGGERLEFT, + SDL_CONTROLLER_AXIS_TRIGGERRIGHT, + SDL_CONTROLLER_AXIS_MAX +} SDL_GameControllerAxis; + +/** + * turn this string into a axis mapping + */ +extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString); + +/** + * turn this axis enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * Get the current state of an axis control on a game controller. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * The list of buttons available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_BUTTON_INVALID = -1, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_MAX +} SDL_GameControllerButton; + +/** + * turn this string into a button mapping + */ +extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString); + +/** + * turn this button enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + + +/** + * Get the current state of a button on a game controller. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + +/** + * Close a controller previously opened with SDL_GameControllerOpen(). + */ +extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_gamecontroller_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_gesture.h b/include/SDL_gesture.h new file mode 100644 index 0000000000..21f10ead73 --- /dev/null +++ b/include/SDL_gesture.h @@ -0,0 +1,87 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gesture.h + * + * Include file for SDL gesture event handling. + */ + +#ifndef _SDL_gesture_h +#define _SDL_gesture_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "SDL_touch.h" + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_GestureID; + +/* Function prototypes */ + +/** + * \brief Begin Recording a gesture on the specified touch, or all touches (-1) + * + * + */ +extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); + + +/** + * \brief Save all currently loaded Dollar Gesture templates + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *src); + +/** + * \brief Save a currently loaded Dollar Gesture template + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *src); + + +/** + * \brief Load Dollar Gesture templates from a file + * + * + */ +extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_gesture_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_getenv.h b/include/SDL_getenv.h deleted file mode 100644 index bea630077c..0000000000 --- a/include/SDL_getenv.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/** @file SDL_getenv.h - * @deprecated Use SDL_stdinc.h instead - */ - -/* DEPRECATED */ -#include "SDL_stdinc.h" diff --git a/include/SDL_haptic.h b/include/SDL_haptic.h new file mode 100644 index 0000000000..da555c9c3c --- /dev/null +++ b/include/SDL_haptic.h @@ -0,0 +1,1225 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_haptic.h + * + * \brief The SDL Haptic subsystem allows you to control haptic (force feedback) + * devices. + * + * The basic usage is as follows: + * - Initialize the Subsystem (::SDL_INIT_HAPTIC). + * - Open a Haptic Device. + * - SDL_HapticOpen() to open from index. + * - SDL_HapticOpenFromJoystick() to open from an existing joystick. + * - Create an effect (::SDL_HapticEffect). + * - Upload the effect with SDL_HapticNewEffect(). + * - Run the effect with SDL_HapticRunEffect(). + * - (optional) Free the effect with SDL_HapticDestroyEffect(). + * - Close the haptic device with SDL_HapticClose(). + * + * \par Simple rumble example: + * \code + * SDL_Haptic *haptic; + * + * // Open the device + * haptic = SDL_HapticOpen( 0 ); + * if (haptic == NULL) + * return -1; + * + * // Initialize simple rumble + * if (SDL_HapticRumbleInit( haptic ) != 0) + * return -1; + * + * // Play effect at 50% strength for 2 seconds + * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) + * return -1; + * SDL_Delay( 2000 ); + * + * // Clean up + * SDL_HapticClose( haptic ); + * \endcode + * + * \par Complete example: + * \code + * int test_haptic( SDL_Joystick * joystick ) { + * SDL_Haptic *haptic; + * SDL_HapticEffect effect; + * int effect_id; + * + * // Open the device + * haptic = SDL_HapticOpenFromJoystick( joystick ); + * if (haptic == NULL) return -1; // Most likely joystick isn't haptic + * + * // See if it can do sine waves + * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { + * SDL_HapticClose(haptic); // No sine effect + * return -1; + * } + * + * // Create the effect + * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default + * effect.type = SDL_HAPTIC_SINE; + * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates + * effect.periodic.direction.dir[0] = 18000; // Force comes from south + * effect.periodic.period = 1000; // 1000 ms + * effect.periodic.magnitude = 20000; // 20000/32767 strength + * effect.periodic.length = 5000; // 5 seconds long + * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength + * effect.periodic.fade_length = 1000; // Takes 1 second to fade away + * + * // Upload the effect + * effect_id = SDL_HapticNewEffect( haptic, &effect ); + * + * // Test the effect + * SDL_HapticRunEffect( haptic, effect_id, 1 ); + * SDL_Delay( 5000); // Wait for the effect to finish + * + * // We destroy the effect, although closing the device also does this + * SDL_HapticDestroyEffect( haptic, effect_id ); + * + * // Close the device + * SDL_HapticClose(haptic); + * + * return 0; // Success + * } + * \endcode + * + * You can also find out more information on my blog: + * http://bobbens.dyndns.org/journal/2010/sdl_haptic/ + * + * \author Edgar Simo Serra + */ + +#ifndef _SDL_haptic_h +#define _SDL_haptic_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * \typedef SDL_Haptic + * + * \brief The haptic structure used to identify an SDL haptic. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + */ +struct _SDL_Haptic; +typedef struct _SDL_Haptic SDL_Haptic; + + +/** + * \name Haptic features + * + * Different haptic features a device can have. + */ +/*@{*/ + +/** + * \name Haptic effects + */ +/*@{*/ + +/** + * \brief Constant effect supported. + * + * Constant haptic effect. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_CONSTANT (1<<0) + +/** + * \brief Sine wave effect supported. + * + * Periodic haptic effect that simulates sine waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SINE (1<<1) + +/** + * \brief Left/Right effect supported. + * + * Haptic effect for direct control over high/low frequency motors. + * + * \sa SDL_HapticLeftRight + * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, + * we ran out of bits, and this is important for XInput devices. + */ +#define SDL_HAPTIC_LEFTRIGHT (1<<2) + +/* !!! FIXME: put this back when we have more bits in 2.1 */ +/*#define SDL_HAPTIC_SQUARE (1<<2)*/ + +/** + * \brief Triangle wave effect supported. + * + * Periodic haptic effect that simulates triangular waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_TRIANGLE (1<<3) + +/** + * \brief Sawtoothup wave effect supported. + * + * Periodic haptic effect that simulates saw tooth up waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHUP (1<<4) + +/** + * \brief Sawtoothdown wave effect supported. + * + * Periodic haptic effect that simulates saw tooth down waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) + +/** + * \brief Ramp effect supported. + * + * Ramp haptic effect. + * + * \sa SDL_HapticRamp + */ +#define SDL_HAPTIC_RAMP (1<<6) + +/** + * \brief Spring effect supported - uses axes position. + * + * Condition haptic effect that simulates a spring. Effect is based on the + * axes position. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_SPRING (1<<7) + +/** + * \brief Damper effect supported - uses axes velocity. + * + * Condition haptic effect that simulates dampening. Effect is based on the + * axes velocity. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_DAMPER (1<<8) + +/** + * \brief Inertia effect supported - uses axes acceleration. + * + * Condition haptic effect that simulates inertia. Effect is based on the axes + * acceleration. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_INERTIA (1<<9) + +/** + * \brief Friction effect supported - uses axes movement. + * + * Condition haptic effect that simulates friction. Effect is based on the + * axes movement. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_FRICTION (1<<10) + +/** + * \brief Custom effect is supported. + * + * User defined custom haptic effect. + */ +#define SDL_HAPTIC_CUSTOM (1<<11) + +/*@}*//*Haptic effects*/ + +/* These last few are features the device has, not effects */ + +/** + * \brief Device can set global gain. + * + * Device supports setting the global gain. + * + * \sa SDL_HapticSetGain + */ +#define SDL_HAPTIC_GAIN (1<<12) + +/** + * \brief Device can set autocenter. + * + * Device supports setting autocenter. + * + * \sa SDL_HapticSetAutocenter + */ +#define SDL_HAPTIC_AUTOCENTER (1<<13) + +/** + * \brief Device can be queried for effect status. + * + * Device can be queried for effect status. + * + * \sa SDL_HapticGetEffectStatus + */ +#define SDL_HAPTIC_STATUS (1<<14) + +/** + * \brief Device can be paused. + * + * \sa SDL_HapticPause + * \sa SDL_HapticUnpause + */ +#define SDL_HAPTIC_PAUSE (1<<15) + + +/** + * \name Direction encodings + */ +/*@{*/ + +/** + * \brief Uses polar coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_POLAR 0 + +/** + * \brief Uses cartesian coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_CARTESIAN 1 + +/** + * \brief Uses spherical coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_SPHERICAL 2 + +/*@}*//*Direction encodings*/ + +/*@}*//*Haptic features*/ + +/* + * Misc defines. + */ + +/** + * \brief Used to play a device an infinite number of times. + * + * \sa SDL_HapticRunEffect + */ +#define SDL_HAPTIC_INFINITY 4294967295U + + +/** + * \brief Structure that represents a haptic direction. + * + * Directions can be specified by: + * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. + * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. + * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. + * + * Cardinal directions of the haptic device are relative to the positioning + * of the device. North is considered to be away from the user. + * + * The following diagram represents the cardinal directions: + * \verbatim + .--. + |__| .-------. + |=.| |.-----.| + |--| || || + | | |'-----'| + |__|~')_____(' + [ COMPUTER ] + + + North (0,-1) + ^ + | + | + (1,0) West <----[ HAPTIC ]----> East (-1,0) + | + | + v + South (0,1) + + + [ USER ] + \|||/ + (o o) + ---ooO-(_)-Ooo--- + \endverbatim + * + * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a + * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses + * the first \c dir parameter. The cardinal directions would be: + * - North: 0 (0 degrees) + * - East: 9000 (90 degrees) + * - South: 18000 (180 degrees) + * - West: 27000 (270 degrees) + * + * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions + * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses + * the first three \c dir parameters. The cardinal directions would be: + * - North: 0,-1, 0 + * - East: -1, 0, 0 + * - South: 0, 1, 0 + * - West: 1, 0, 0 + * + * The Z axis represents the height of the effect if supported, otherwise + * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you + * can use any multiple you want, only the direction matters. + * + * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. + * The first two \c dir parameters are used. The \c dir parameters are as + * follows (all values are in hundredths of degrees): + * - Degrees from (1, 0) rotated towards (0, 1). + * - Degrees towards (0, 0, 1) (device needs at least 3 axes). + * + * + * Example of force coming from the south with all encodings (force coming + * from the south means the user will have to pull the stick to counteract): + * \code + * SDL_HapticDirection direction; + * + * // Cartesian directions + * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. + * direction.dir[0] = 0; // X position + * direction.dir[1] = 1; // Y position + * // Assuming the device has 2 axes, we don't need to specify third parameter. + * + * // Polar directions + * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. + * direction.dir[0] = 18000; // Polar only uses first parameter + * + * // Spherical coordinates + * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding + * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. + * \endcode + * + * \sa SDL_HAPTIC_POLAR + * \sa SDL_HAPTIC_CARTESIAN + * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HapticEffect + * \sa SDL_HapticNumAxes + */ +typedef struct SDL_HapticDirection +{ + Uint8 type; /**< The type of encoding. */ + Sint32 dir[3]; /**< The encoded direction. */ +} SDL_HapticDirection; + + +/** + * \brief A structure containing a template for a Constant effect. + * + * The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect. + * + * A constant effect applies a constant force in the specified direction + * to the joystick. + * + * \sa SDL_HAPTIC_CONSTANT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticConstant +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Constant */ + Sint16 level; /**< Strength of the constant effect. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticConstant; + +/** + * \brief A structure containing a template for a Periodic effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SINE + * - ::SDL_HAPTIC_LEFTRIGHT + * - ::SDL_HAPTIC_TRIANGLE + * - ::SDL_HAPTIC_SAWTOOTHUP + * - ::SDL_HAPTIC_SAWTOOTHDOWN + * + * A periodic effect consists in a wave-shaped effect that repeats itself + * over time. The type determines the shape of the wave and the parameters + * determine the dimensions of the wave. + * + * Phase is given by hundredth of a cycle meaning that giving the phase a value + * of 9000 will displace it 25% of its period. Here are sample values: + * - 0: No phase displacement. + * - 9000: Displaced 25% of its period. + * - 18000: Displaced 50% of its period. + * - 27000: Displaced 75% of its period. + * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. + * + * Examples: + * \verbatim + SDL_HAPTIC_SINE + __ __ __ __ + / \ / \ / \ / + / \__/ \__/ \__/ + + SDL_HAPTIC_SQUARE + __ __ __ __ __ + | | | | | | | | | | + | |__| |__| |__| |__| | + + SDL_HAPTIC_TRIANGLE + /\ /\ /\ /\ /\ + / \ / \ / \ / \ / + / \/ \/ \/ \/ + + SDL_HAPTIC_SAWTOOTHUP + /| /| /| /| /| /| /| + / | / | / | / | / | / | / | + / |/ |/ |/ |/ |/ |/ | + + SDL_HAPTIC_SAWTOOTHDOWN + \ |\ |\ |\ |\ |\ |\ | + \ | \ | \ | \ | \ | \ | \ | + \| \| \| \| \| \| \| + \endverbatim + * + * \sa SDL_HAPTIC_SINE + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HAPTIC_TRIANGLE + * \sa SDL_HAPTIC_SAWTOOTHUP + * \sa SDL_HAPTIC_SAWTOOTHDOWN + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticPeriodic +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, + ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or + ::SDL_HAPTIC_SAWTOOTHDOWN */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Periodic */ + Uint16 period; /**< Period of the wave. */ + Sint16 magnitude; /**< Peak value. */ + Sint16 offset; /**< Mean value of the wave. */ + Uint16 phase; /**< Horizontal shift given by hundredth of a cycle. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticPeriodic; + +/** + * \brief A structure containing a template for a Condition effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SPRING: Effect based on axes position. + * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. + * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. + * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. + * + * Direction is handled by condition internals instead of a direction member. + * The condition effect specific members have three parameters. The first + * refers to the X axis, the second refers to the Y axis and the third + * refers to the Z axis. The right terms refer to the positive side of the + * axis and the left terms refer to the negative side of the axis. Please + * refer to the ::SDL_HapticDirection diagram for which side is positive and + * which is negative. + * + * \sa SDL_HapticDirection + * \sa SDL_HAPTIC_SPRING + * \sa SDL_HAPTIC_DAMPER + * \sa SDL_HAPTIC_INERTIA + * \sa SDL_HAPTIC_FRICTION + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCondition +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, + ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ + SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Condition */ + Uint16 right_sat[3]; /**< Level when joystick is to the positive side. */ + Uint16 left_sat[3]; /**< Level when joystick is to the negative side. */ + Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ + Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ + Uint16 deadband[3]; /**< Size of the dead zone. */ + Sint16 center[3]; /**< Position of the dead zone. */ +} SDL_HapticCondition; + +/** + * \brief A structure containing a template for a Ramp effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. + * + * The ramp effect starts at start strength and ends at end strength. + * It augments in linear fashion. If you use attack and fade with a ramp + * the effects get added to the ramp effect making the effect become + * quadratic instead of linear. + * + * \sa SDL_HAPTIC_RAMP + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticRamp +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_RAMP */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Ramp */ + Sint16 start; /**< Beginning strength level. */ + Sint16 end; /**< Ending strength level. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticRamp; + +/** + * \brief A structure containing a template for a Left/Right effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. + * + * The Left/Right effect is used to explicitly control the large and small + * motors, commonly found in modern game controllers. One motor is high + * frequency, the other is low frequency. + * + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticLeftRight +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + + /* Rumble */ + Uint16 large_magnitude; /**< Control of the large controller motor. */ + Uint16 small_magnitude; /**< Control of the small controller motor. */ +} SDL_HapticLeftRight; + +/** + * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. + * + * A custom force feedback effect is much like a periodic effect, where the + * application can define its exact shape. You will have to allocate the + * data yourself. Data should consist of channels * samples Uint16 samples. + * + * If channels is one, the effect is rotated using the defined direction. + * Otherwise it uses the samples in data for the different axes. + * + * \sa SDL_HAPTIC_CUSTOM + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCustom +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Custom */ + Uint8 channels; /**< Axes to use, minimum of one. */ + Uint16 period; /**< Sample periods. */ + Uint16 samples; /**< Amount of samples. */ + Uint16 *data; /**< Should contain channels*samples items. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticCustom; + +/** + * \brief The generic template for any haptic effect. + * + * All values max at 32767 (0x7FFF). Signed values also can be negative. + * Time values unless specified otherwise are in milliseconds. + * + * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 + * value. Neither delay, interval, attack_length nor fade_length support + * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. + * + * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of + * ::SDL_HAPTIC_INFINITY. + * + * Button triggers may not be supported on all devices, it is advised to not + * use them if possible. Buttons start at index 1 instead of index 0 like + * the joystick. + * + * If both attack_length and fade_level are 0, the envelope is not used, + * otherwise both values are used. + * + * Common parts: + * \code + * // Replay - All effects have this + * Uint32 length; // Duration of effect (ms). + * Uint16 delay; // Delay before starting effect. + * + * // Trigger - All effects have this + * Uint16 button; // Button that triggers effect. + * Uint16 interval; // How soon before effect can be triggered again. + * + * // Envelope - All effects except condition effects have this + * Uint16 attack_length; // Duration of the attack (ms). + * Uint16 attack_level; // Level at the start of the attack. + * Uint16 fade_length; // Duration of the fade out (ms). + * Uint16 fade_level; // Level at the end of the fade. + * \endcode + * + * + * Here we have an example of a constant effect evolution in time: + * \verbatim + Strength + ^ + | + | effect level --> _________________ + | / \ + | / \ + | / \ + | / \ + | attack_level --> | \ + | | | <--- fade_level + | + +--------------------------------------------------> Time + [--] [---] + attack_length fade_length + + [------------------][-----------------------] + delay length + \endverbatim + * + * Note either the attack_level or the fade_level may be above the actual + * effect level. + * + * \sa SDL_HapticConstant + * \sa SDL_HapticPeriodic + * \sa SDL_HapticCondition + * \sa SDL_HapticRamp + * \sa SDL_HapticLeftRight + * \sa SDL_HapticCustom + */ +typedef union SDL_HapticEffect +{ + /* Common for all force feedback effects */ + Uint16 type; /**< Effect type. */ + SDL_HapticConstant constant; /**< Constant effect. */ + SDL_HapticPeriodic periodic; /**< Periodic effect. */ + SDL_HapticCondition condition; /**< Condition effect. */ + SDL_HapticRamp ramp; /**< Ramp effect. */ + SDL_HapticLeftRight leftright; /**< Left/Right effect. */ + SDL_HapticCustom custom; /**< Custom effect. */ +} SDL_HapticEffect; + + +/* Function prototypes */ +/** + * \brief Count the number of haptic devices attached to the system. + * + * \return Number of haptic devices detected on the system. + */ +extern DECLSPEC int SDLCALL SDL_NumHaptics(void); + +/** + * \brief Get the implementation dependent name of a Haptic device. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + * + * \param device_index Index of the device to get its name. + * \return Name of the device or NULL on error. + * + * \sa SDL_NumHaptics + */ +extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); + +/** + * \brief Opens a Haptic device for usage. + * + * The index passed as an argument refers to the N'th Haptic device on this + * system. + * + * When opening a haptic device, its gain will be set to maximum and + * autocenter will be disabled. To modify these values use + * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). + * + * \param device_index Index of the device to open. + * \return Device identifier or NULL on error. + * + * \sa SDL_HapticIndex + * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + * \sa SDL_HapticSetGain + * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticPause + * \sa SDL_HapticStopAll + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); + +/** + * \brief Checks if the haptic device at index has been opened. + * + * \param device_index Index to check to see if it has been opened. + * \return 1 if it has been opened or 0 if it hasn't. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticIndex + */ +extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); + +/** + * \brief Gets the index of a haptic device. + * + * \param haptic Haptic device to get the index of. + * \return The index of the haptic device or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpened + */ +extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); + +/** + * \brief Gets whether or not the current mouse has haptic capabilities. + * + * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. + * + * \sa SDL_HapticOpenFromMouse + */ +extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); + +/** + * \brief Tries to open a haptic device from the current mouse. + * + * \return The haptic device identifier or NULL on error. + * + * \sa SDL_MouseIsHaptic + * \sa SDL_HapticOpen + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); + +/** + * \brief Checks to see if a joystick has haptic features. + * + * \param joystick Joystick to test for haptic capabilities. + * \return 1 if the joystick is haptic, 0 if it isn't + * or -1 if an error ocurred. + * + * \sa SDL_HapticOpenFromJoystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); + +/** + * \brief Opens a Haptic device for usage from a Joystick device. + * + * You must still close the haptic device seperately. It will not be closed + * with the joystick. + * + * When opening from a joystick you should first close the haptic device before + * closing the joystick device. If not, on some implementations the haptic + * device will also get unallocated and you'll be unable to use force feedback + * on that device. + * + * \param joystick Joystick to create a haptic device from. + * \return A valid haptic device identifier on success or NULL on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticClose + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * + joystick); + +/** + * \brief Closes a Haptic device previously opened with SDL_HapticOpen(). + * + * \param haptic Haptic device to close. + */ +extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can store. + * + * On some platforms this isn't fully supported, and therefore is an + * approximation. Always check to see if your created effect was actually + * created and do not rely solely on SDL_HapticNumEffects(). + * + * \param haptic The haptic device to query effect max. + * \return The number of effects the haptic device can store or + * -1 on error. + * + * \sa SDL_HapticNumEffectsPlaying + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can play at the same + * time. + * + * This is not supported on all platforms, but will always return a value. + * Added here for the sake of completeness. + * + * \param haptic The haptic device to query maximum playing effects. + * \return The number of effects the haptic device can play at the same time + * or -1 on error. + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); + +/** + * \brief Gets the haptic devices supported features in bitwise matter. + * + * Example: + * \code + * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { + * printf("We have constant haptic effect!"); + * } + * \endcode + * + * \param haptic The haptic device to query. + * \return Haptic features in bitwise manner (OR'd). + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticEffectSupported + */ +extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); + + +/** + * \brief Gets the number of haptic axes the device has. + * + * \sa SDL_HapticDirection + */ +extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); + +/** + * \brief Checks to see if effect is supported by haptic. + * + * \param haptic Haptic device to check on. + * \param effect Effect to check to see if it is supported. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticQuery + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, + SDL_HapticEffect * + effect); + +/** + * \brief Creates a new haptic effect on the device. + * + * \param haptic Haptic device to create the effect on. + * \param effect Properties of the effect to create. + * \return The id of the effect on success or -1 on error. + * + * \sa SDL_HapticUpdateEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, + SDL_HapticEffect * effect); + +/** + * \brief Updates the properties of an effect. + * + * Can be used dynamically, although behaviour when dynamically changing + * direction may be strange. Specifically the effect may reupload itself + * and start playing from the start. You cannot change the type either when + * running SDL_HapticUpdateEffect(). + * + * \param haptic Haptic device that has the effect. + * \param effect Effect to update. + * \param data New effect properties to use. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticNewEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, + int effect, + SDL_HapticEffect * data); + +/** + * \brief Runs the haptic effect on its associated haptic device. + * + * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over + * repeating the envelope (attack and fade) every time. If you only want the + * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length + * parameter. + * + * \param haptic Haptic device to run the effect on. + * \param effect Identifier of the haptic effect to run. + * \param iterations Number of iterations to run the effect. Use + * ::SDL_HAPTIC_INFINITY for infinity. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticStopEffect + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticGetEffectStatus + */ +extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, + int effect, + Uint32 iterations); + +/** + * \brief Stops the haptic effect on its associated haptic device. + * + * \param haptic Haptic device to stop the effect on. + * \param effect Identifier of the effect to stop. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Destroys a haptic effect on the device. + * + * This will stop the effect if it's running. Effects are automatically + * destroyed when the device is closed. + * + * \param haptic Device to destroy the effect on. + * \param effect Identifier of the effect to destroy. + * + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Gets the status of the current effect on the haptic device. + * + * Device must support the ::SDL_HAPTIC_STATUS feature. + * + * \param haptic Haptic device to query the effect status on. + * \param effect Identifier of the effect to query its status. + * \return 0 if it isn't playing, 1 if it is playing or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticStopEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, + int effect); + +/** + * \brief Sets the global gain of the device. + * + * Device must support the ::SDL_HAPTIC_GAIN feature. + * + * The user may specify the maximum gain by setting the environment variable + * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to + * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the + * maximum. + * + * \param haptic Haptic device to set the gain on. + * \param gain Value to set the gain to, should be between 0 and 100. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); + +/** + * \brief Sets the global autocenter of the device. + * + * Autocenter should be between 0 and 100. Setting it to 0 will disable + * autocentering. + * + * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. + * + * \param haptic Haptic device to set autocentering on. + * \param autocenter Value to set autocenter to, 0 disables autocentering. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, + int autocenter); + +/** + * \brief Pauses a haptic device. + * + * Device must support the ::SDL_HAPTIC_PAUSE feature. Call + * SDL_HapticUnpause() to resume playback. + * + * Do not modify the effects nor add new ones while the device is paused. + * That can cause all sorts of weird errors. + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticUnpause + */ +extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); + +/** + * \brief Unpauses a haptic device. + * + * Call to unpause after SDL_HapticPause(). + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticPause + */ +extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); + +/** + * \brief Stops all the currently playing effects on a haptic device. + * + * \param haptic Haptic device to stop. + * \return 0 on success or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); + +/** + * \brief Checks to see if rumble is supported on a haptic device. + * + * \param haptic Haptic device to check to see if it supports rumble. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); + +/** + * \brief Initializes the haptic device for simple rumble playback. + * + * \param haptic Haptic device to initialize for simple rumble playback. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); + +/** + * \brief Runs simple rumble on a haptic device + * + * \param haptic Haptic device to play rumble effect on. + * \param strength Strength of the rumble to play as a 0-1 float value. + * \param length Length of the rumble to play in milliseconds. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); + +/** + * \brief Stops the simple rumble on a haptic device. + * + * \param haptic Haptic to stop the rumble on. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_haptic_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_hints.h b/include/SDL_hints.h new file mode 100644 index 0000000000..74b63ee099 --- /dev/null +++ b/include/SDL_hints.h @@ -0,0 +1,339 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_hints.h + * + * Official documentation for SDL configuration variables + * + * This file contains functions to set and get configuration hints, + * as well as listing each of them alphabetically. + * + * The convention for naming hints is SDL_HINT_X, where "SDL_X" is + * the environment variable that can be used to override the default. + * + * In general these hints are just that - they may or may not be + * supported or applicable on any given platform, but they provide + * a way for an application or user to give the library a hint as + * to how they would like the library to work. + */ + +#ifndef _SDL_hints_h +#define _SDL_hints_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. + * + * SDL can try to accelerate the SDL screen surface by using streaming + * textures with a 3D rendering engine. This variable controls whether and + * how this is done. + * + * This variable can be set to the following values: + * "0" - Disable 3D acceleration + * "1" - Enable 3D acceleration, using the default renderer. + * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) + * + * By default SDL tries to make a best guess for each platform whether + * to use acceleration or not. + */ +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" + +/** + * \brief A variable specifying which render driver to use. + * + * If the application doesn't pick a specific renderer to use, this variable + * specifies the name of the preferred renderer. If the preferred renderer + * can't be initialized, the normal default renderer is used. + * + * This variable is case insensitive and can be set to the following values: + * "direct3d" + * "opengl" + * "opengles2" + * "opengles" + * "software" + * + * The default varies by platform, but it's the first one in the list that + * is available on the current platform. + */ +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" + +/** + * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. + * + * This variable can be set to the following values: + * "0" - Disable shaders + * "1" - Enable shaders + * + * By default shaders are used if OpenGL supports them. + */ +#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" + +/** + * \brief A variable controlling the scaling quality + * + * This variable can be set to the following values: + * "0" or "nearest" - Nearest pixel sampling + * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) + * "2" or "best" - Currently this is the same as "linear" + * + * By default nearest pixel sampling is used + */ +#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" + +/** + * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. + * + * This variable can be set to the following values: + * "0" - Disable vsync + * "1" - Enable vsync + * + * By default SDL does not sync screen surface updates with vertical refresh. + */ +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" + +/** + * \brief A variable controlling whether the X11 VidMode extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XVidMode + * "1" - Enable XVidMode + * + * By default SDL will use XVidMode if it is available. + */ +#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" + +/** + * \brief A variable controlling whether the X11 Xinerama extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable Xinerama + * "1" - Enable Xinerama + * + * By default SDL will use Xinerama if it is available. + */ +#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" + +/** + * \brief A variable controlling whether the X11 XRandR extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XRandR + * "1" - Enable XRandR + * + * By default SDL will not use XRandR because of window manager issues. + */ +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * \brief A variable controlling whether grabbing input grabs the keyboard + * + * This variable can be set to the following values: + * "0" - Grab will affect only the mouse + * "1" - Grab will affect mouse and keyboard + * + * By default SDL will not grab the keyboard so system shortcuts still work. + */ +#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" + +/** + * \brief Minimize your SDL_Window if it loses key focus when in Fullscreen mode. Defaults to true. + * + */ +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + + +/** + * \brief A variable controlling whether the idle timer is disabled on iOS. + * + * When an iOS app does not receive touches for some time, the screen is + * dimmed automatically. For games where the accelerometer is the only input + * this is problematic. This functionality can be disabled by setting this + * hint. + * + * This variable can be set to the following values: + * "0" - Enable idle timer + * "1" - Disable idle timer + */ +#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" + +/** + * \brief A variable controlling which orientations are allowed on iOS. + * + * In some circumstances it is necessary to be able to explicitly control + * which UI orientations are allowed. + * + * This variable is a space delimited list of the following values: + * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" + */ +#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" + + +/** + * \brief A variable that lets you disable the detection and use of Xinput gamepad devices + * + * The variable can be set to the following values: + * "0" - Disable XInput timer (only uses direct input) + * "1" - Enable XInput timer (the default) + */ +#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" + + +/** + * \brief A variable that lets you manually hint extra gamecontroller db entries + * + * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + */ +#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" + + +/** + * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. + * + * The variable can be set to the following values: + * "0" - Disable joystick & gamecontroller input events when the + * application is in the background. + * "1" - Enable joystick & gamecontroller input events when the + * application is in the backgroumd. + * + * The default value is "0". This hint may be set at any time. + */ +#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" + + +/** + * \brief If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it. + * This is a debugging aid for developers and not expected to be used by end users. The default is "1" + * + * This variable can be set to the following values: + * "0" - don't allow topmost + * "1" - allow topmost + */ +#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" + + +/** + * \brief A variable that controls the timer resolution, in milliseconds. + * + * The higher resolution the timer, the more frequently the CPU services + * timer interrupts, and the more precise delays are, but this takes up + * power and CPU time. This hint is only used on Windows 7 and earlier. + * + * See this blog post for more information: + * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ + * + * If this variable is set to "0", the system timer resolution is not set. + * + * The default value is "1". This hint may be set at any time. + */ +#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" + + + +/** + * \brief An enumeration of hint priorities + */ +typedef enum +{ + SDL_HINT_DEFAULT, + SDL_HINT_NORMAL, + SDL_HINT_OVERRIDE +} SDL_HintPriority; + + +/** + * \brief Set a hint with a specific priority + * + * The priority controls the behavior when setting a hint that already + * has a value. Hints will replace existing hints of their priority and + * lower. Environment variables are considered to have override priority. + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, + const char *value, + SDL_HintPriority priority); + +/** + * \brief Set a hint with normal priority + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, + const char *value); + +/** + * \brief Get a hint + * + * \return The string value of a hint variable. + */ +extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); + +/** + * \brief Add a function to watch a particular hint + * + * \param name The hint to watch + * \param callback The function to call when the hint value changes + * \param userdata A pointer to pass to the callback function + */ +typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Remove a function watching a particular hint + * + * \param name The hint being watched + * \param callback The function being called when the hint value changes + * \param userdata A pointer being passed to the callback function + */ +extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Clear all hints + * + * This function is called during SDL_Quit() to free stored hints. + */ +extern DECLSPEC void SDLCALL SDL_ClearHints(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_hints_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_joystick.h b/include/SDL_joystick.h index 708d1a9f09..2667403483 100644 --- a/include/SDL_joystick.h +++ b/include/SDL_joystick.h @@ -1,27 +1,39 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_joystick.h +/** + * \file SDL_joystick.h + * * Include file for SDL joystick event handling + * + * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks, with the exact joystick + * behind a device_index changing as joysticks are plugged and unplugged. + * + * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted + * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. + * + * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of + * the device (a X360 wired controller for example). This identifier is platform dependent. + * + * */ #ifndef _SDL_joystick_h @@ -36,146 +48,198 @@ extern "C" { #endif -/** @file SDL_joystick.h - * @note In order to use these functions, SDL_Init() must have been called - * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system - * for joysticks, and load appropriate drivers. +/** + * \file SDL_joystick.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + * + * If you would like to receive joystick updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS */ -/** The joystick structure used to identify an SDL joystick */ +/* The joystick structure used to identify an SDL joystick */ struct _SDL_Joystick; typedef struct _SDL_Joystick SDL_Joystick; +/* A structure that encodes the stable unique id for a joystick device */ +typedef struct { + Uint8 data[16]; +} SDL_JoystickGUID; + +typedef Sint32 SDL_JoystickID; + + /* Function prototypes */ /** - * Count the number of joysticks attached to the system + * Count the number of joysticks attached to the system right now */ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); /** - * Get the implementation dependent name of a joystick. - * - * This can be called before any joysticks are opened. - * If no name can be found, this function returns NULL. + * Get the implementation dependent name of a joystick. + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. */ -extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); +extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); /** - * Open a joystick for use. + * Open a joystick for use. + * The index passed as an argument refers tothe N'th joystick on the system. + * This index is the value which will identify this joystick in future joystick + * events. * - * @param[in] device_index - * The index passed as an argument refers to - * the N'th joystick on the system. This index is the value which will - * identify this joystick in future joystick events. - * - * @return This function returns a joystick identifier, or NULL if an error occurred. + * \return A joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Return the name for this currently opened joystick. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); + +/** + * Return the GUID for the joystick at this index + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); + +/** + * Return the GUID for this opened joystick + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); + +/** + * Return a string representation for this guid. pszGUID must point to at least 33 bytes + * (32 for the string plus a NULL terminator). */ -extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); +extern DECLSPEC void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); /** - * Returns 1 if the joystick has been opened, or 0 if it has not. + * convert a string into a joystick formatted guid */ -extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); /** - * Get the device index of an opened joystick. + * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. */ -extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); /** - * Get the number of general axis controls on a joystick + * Get the instance ID of an opened joystick or -1 if the joystick is invalid. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); /** - * Get the number of trackballs on a joystick + * Get the number of general axis controls on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); + +/** + * Get the number of trackballs on a joystick. * - * Joystick trackballs have only relative motion events associated - * with them and their state cannot be polled. + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); /** - * Get the number of POV hats on a joystick + * Get the number of POV hats on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); /** - * Get the number of buttons on a joystick + * Get the number of buttons on a joystick. */ -extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); /** - * Update the current state of the open joysticks. + * Update the current state of the open joysticks. * - * This is called automatically by the event loop if any joystick - * events are enabled. + * This is called automatically by the event loop if any joystick + * events are enabled. */ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); /** - * Enable/disable joystick event polling. + * Enable/disable joystick event polling. * - * If joystick events are disabled, you must call SDL_JoystickUpdate() - * yourself and check the state of the joystick when you want joystick - * information. + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. * - * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. */ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); /** - * Get the current state of an axis control on a joystick + * Get the current state of an axis control on a joystick. * - * @param[in] axis The axis indices start at index 0. + * The state is a value ranging from -32768 to 32767. * - * @return The state is a value ranging from -32768 to 32767. + * The axis indices start at index 0. */ -extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, + int axis); /** - * @name Hat Positions - * The return value of SDL_JoystickGetHat() is one of the following positions: + * \name Hat positions */ /*@{*/ -#define SDL_HAT_CENTERED 0x00 -#define SDL_HAT_UP 0x01 -#define SDL_HAT_RIGHT 0x02 -#define SDL_HAT_DOWN 0x04 -#define SDL_HAT_LEFT 0x08 -#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) -#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) -#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) -#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) /*@}*/ -/** - * Get the current state of a POV hat on a joystick - * - * @param[in] hat The hat indices start at index 0. - */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); - /** - * Get the ball axis change since the last poll + * Get the current state of a POV hat on a joystick. + * + * The hat indices start at index 0. * - * @param[in] ball The ball indices start at index 0. + * \return The return value is one of the following positions: + * - ::SDL_HAT_CENTERED + * - ::SDL_HAT_UP + * - ::SDL_HAT_RIGHT + * - ::SDL_HAT_DOWN + * - ::SDL_HAT_LEFT + * - ::SDL_HAT_RIGHTUP + * - ::SDL_HAT_RIGHTDOWN + * - ::SDL_HAT_LEFTUP + * - ::SDL_HAT_LEFTDOWN + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, + int hat); + +/** + * Get the ball axis change since the last poll. * - * @return This returns 0, or -1 if you passed it invalid parameters. + * \return 0, or -1 if you passed it invalid parameters. + * + * The ball indices start at index 0. */ -extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, + int ball, int *dx, int *dy); /** - * Get the current state of a button on a joystick + * Get the current state of a button on a joystick. * - * @param[in] button The button indices start at index 0. + * The button indices start at index 0. */ -extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, + int button); /** - * Close a joystick previously opened with SDL_JoystickOpen() + * Close a joystick previously opened with SDL_JoystickOpen(). */ -extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); /* Ends C function definitions when using C++ */ @@ -185,3 +249,5 @@ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); #include "close_code.h" #endif /* _SDL_joystick_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h index 9d7129c526..e10f9fd15a 100644 --- a/include/SDL_keyboard.h +++ b/include/SDL_keyboard.h @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_keyboard.h +/** + * \file SDL_keyboard.h + * * Include file for SDL keyboard event handling */ @@ -29,7 +30,8 @@ #include "SDL_stdinc.h" #include "SDL_error.h" -#include "SDL_keysym.h" +#include "SDL_keycode.h" +#include "SDL_video.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -37,94 +39,172 @@ extern "C" { #endif -/** Keysym structure - * - * - The scancode is hardware dependent, and should not be used by general - * applications. If no hardware scancode is available, it will be 0. - * - * - The 'unicode' translated character is only available when character - * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, - * this is a UNICODE character corresponding to the keypress. If the - * high 9 bits of the character are 0, then this maps to the equivalent - * ASCII character: - * @code - * char ch; - * if ( (keysym.unicode & 0xFF80) == 0 ) { - * ch = keysym.unicode & 0x7F; - * } else { - * An international character.. - * } - * @endcode - */ -typedef struct SDL_keysym { - Uint8 scancode; /**< hardware specific scancode */ - SDLKey sym; /**< SDL virtual keysym */ - SDLMod mod; /**< current key modifiers */ - Uint16 unicode; /**< translated character */ -} SDL_keysym; - -/** This is the mask which refers to all hotkey bindings */ -#define SDL_ALL_HOTKEYS 0xFFFFFFFF +/** + * \brief The SDL keysym structure, used in key events. + * + * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. + */ +typedef struct SDL_Keysym +{ + SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ + SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ + Uint16 mod; /**< current key modifiers */ + Uint32 unused; +} SDL_Keysym; /* Function prototypes */ + +/** + * \brief Get the window which currently has keyboard focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); + +/** + * \brief Get a snapshot of the current state of the keyboard. + * + * \param numkeys if non-NULL, receives the length of the returned array. + * + * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. + * + * \b Example: + * \code + * const Uint8 *state = SDL_GetKeyboardState(NULL); + * if ( state[SDL_SCANCODE_RETURN] ) { + * printf(" is pressed.\n"); + * } + * \endcode + */ +extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); + +/** + * \brief Get the current key modifier state for the keyboard. + */ +extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); + +/** + * \brief Set the current key modifier state for the keyboard. + * + * \note This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); + +/** + * \brief Get the key code corresponding to the given scancode according + * to the current keyboard layout. + * + * See ::SDL_Keycode for details. + * + * \sa SDL_GetKeyName() + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); + +/** + * \brief Get the scancode corresponding to the given key code according to the + * current keyboard layout. + * + * See ::SDL_Scancode for details. + * + * \sa SDL_GetScancodeName() + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); + /** - * Enable/Disable UNICODE translation of keyboard input. + * \brief Get a human-readable name for a scancode. * - * This translation has some overhead, so translation defaults off. + * \return A pointer to the name for the scancode. + * If the scancode doesn't have a name, this function returns + * an empty string (""). + * + * \sa SDL_Scancode + */ +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); + +/** + * \brief Get a scancode from a human-readable name + * + * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized + * + * \sa SDL_Scancode + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); + +/** + * \brief Get a human-readable name for a key. * - * @param[in] enable - * If 'enable' is 1, translation is enabled. - * If 'enable' is 0, translation is disabled. - * If 'enable' is -1, the translation state is not changed. + * \return A pointer to a UTF-8 string that stays valid at least until the next + * call to this function. If you need it around any longer, you must + * copy it. If the key doesn't have a name, this function returns an + * empty string (""). * - * @return It returns the previous state of keyboard translation. + * \sa SDL_Key */ -extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); +extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); -#define SDL_DEFAULT_REPEAT_DELAY 500 -#define SDL_DEFAULT_REPEAT_INTERVAL 30 /** - * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. + * \brief Get a key code from a human-readable name * - * @param[in] delay - * 'delay' is the initial delay in ms between the time when a key is - * pressed, and keyboard repeat begins. + * \return key code, or SDLK_UNKNOWN if the name wasn't recognized * - * @param[in] interval - * 'interval' is the time in ms between keyboard repeat events. + * \sa SDL_Keycode + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); + +/** + * \brief Start accepting Unicode text input events. + * This function will show the on-screen keyboard if supported. * - * If 'delay' is set to 0, keyboard repeat is disabled. + * \sa SDL_StopTextInput() + * \sa SDL_SetTextInputRect() + * \sa SDL_HasScreenKeyboardSupport() */ -extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); -extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); +extern DECLSPEC void SDLCALL SDL_StartTextInput(void); /** - * Get a snapshot of the current state of the keyboard. - * Returns an array of keystates, indexed by the SDLK_* syms. - * Usage: - * @code - * Uint8 *keystate = SDL_GetKeyState(NULL); - * if ( keystate[SDLK_RETURN] ) //... \ is pressed. - * @endcode + * \brief Return whether or not Unicode text input events are enabled. + * + * \sa SDL_StartTextInput() + * \sa SDL_StopTextInput() */ -extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); +extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); /** - * Get the current key modifier state + * \brief Stop receiving any text input events. + * This function will hide the on-screen keyboard if supported. + * + * \sa SDL_StartTextInput() + * \sa SDL_HasScreenKeyboardSupport() */ -extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); +extern DECLSPEC void SDLCALL SDL_StopTextInput(void); /** - * Set the current key modifier state. - * This does not change the keyboard state, only the key modifier flags. + * \brief Set the rectangle used to type Unicode text inputs. + * This is used as a hint for IME and on-screen keyboard placement. + * + * \sa SDL_StartTextInput() */ -extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); +extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); /** - * Get the name of an SDL virtual keysym + * \brief Returns whether the platform has some screen keyboard support. + * + * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. + * + * \note Not all screen keyboard functions are supported on all platforms. + * + * \sa SDL_IsScreenKeyboardShown() */ -extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); +extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); +/** + * \brief Returns whether the screen keyboard is shown for given window. + * + * \param window The window for which screen keyboard should be queried. + * + * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. + * + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -133,3 +213,5 @@ extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); #include "close_code.h" #endif /* _SDL_keyboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_keycode.h b/include/SDL_keycode.h new file mode 100644 index 0000000000..de584e126b --- /dev/null +++ b/include/SDL_keycode.h @@ -0,0 +1,341 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_keycode.h + * + * Defines constants which identify keyboard keys and modifiers. + */ + +#ifndef _SDL_keycode_h +#define _SDL_keycode_h + +#include "SDL_stdinc.h" +#include "SDL_scancode.h" + +/** + * \brief The SDL virtual key representation. + * + * Values of this type are used to represent keyboard keys using the current + * layout of the keyboard. These values include Unicode values representing + * the unmodified character that would be generated by pressing the key, or + * an SDLK_* constant for those keys that do not generate characters. + */ +typedef Sint32 SDL_Keycode; + +#define SDLK_SCANCODE_MASK (1<<30) +#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) + +enum +{ + SDLK_UNKNOWN = 0, + + SDLK_RETURN = '\r', + SDLK_ESCAPE = '\033', + SDLK_BACKSPACE = '\b', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_PERCENT = '%', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_QUOTE = '\'', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COMMA = ',', + SDLK_MINUS = '-', + SDLK_PERIOD = '.', + SDLK_SLASH = '/', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_COLON = ':', + SDLK_SEMICOLON = ';', + SDLK_LESS = '<', + SDLK_EQUALS = '=', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = '[', + SDLK_BACKSLASH = '\\', + SDLK_RIGHTBRACKET = ']', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_BACKQUOTE = '`', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + + SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), + + SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), + SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), + SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), + SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), + SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), + SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), + SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), + SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), + SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), + SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), + SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), + SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), + + SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), + SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), + SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), + SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), + SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), + SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), + SDLK_DELETE = '\177', + SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), + SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), + SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), + SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), + SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), + SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), + + SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), + SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), + SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), + SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), + SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), + SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), + SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), + SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), + SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), + SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), + SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), + SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), + SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), + SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), + SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), + SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), + SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), + + SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), + SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), + SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), + SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), + SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), + SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), + SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), + SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), + SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), + SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), + SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), + SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), + SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), + SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), + SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), + SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), + SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), + SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), + SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), + SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), + SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), + SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), + SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), + SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), + SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), + SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), + SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), + SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), + SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), + SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), + SDLK_KP_EQUALSAS400 = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), + + SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), + SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), + SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), + SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), + SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), + SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), + SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), + SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), + SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), + SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), + SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), + SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), + + SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), + SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), + SDLK_THOUSANDSSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), + SDLK_DECIMALSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), + SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), + SDLK_CURRENCYSUBUNIT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), + SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), + SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), + SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), + SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), + SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), + SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), + SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), + SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), + SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), + SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), + SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), + SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), + SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), + SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), + SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), + SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), + SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), + SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), + SDLK_KP_DBLAMPERSAND = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), + SDLK_KP_VERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), + SDLK_KP_DBLVERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), + SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), + SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), + SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), + SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), + SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), + SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), + SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), + SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), + SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), + SDLK_KP_MEMSUBTRACT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), + SDLK_KP_MEMMULTIPLY = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), + SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), + SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), + SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), + SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), + SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), + SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), + SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), + SDLK_KP_HEXADECIMAL = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), + + SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), + SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), + SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), + SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), + SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), + SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), + SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), + SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), + + SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), + + SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), + SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), + SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), + SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), + SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), + SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), + SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), + SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), + SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), + SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), + SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), + SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), + SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), + SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), + SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), + SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), + SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), + + SDLK_BRIGHTNESSDOWN = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), + SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), + SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), + SDLK_KBDILLUMTOGGLE = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), + SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), + SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), + SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), + SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) +}; + +/** + * \brief Enumeration of valid key mods (possibly OR'd together). + */ +typedef enum +{ + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDL_Keymod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) + +#endif /* _SDL_keycode_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_keysym.h b/include/SDL_keysym.h deleted file mode 100644 index f2ad12b81e..0000000000 --- a/include/SDL_keysym.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#ifndef _SDL_keysym_h -#define _SDL_keysym_h - -/** What we really want is a mapping of every raw key on the keyboard. - * To support international keyboards, we use the range 0xA1 - 0xFF - * as international virtual keycodes. We'll follow in the footsteps of X11... - * @brief The names of the keys - */ -typedef enum { - /** @name ASCII mapped keysyms - * The keyboard syms have been cleverly chosen to map to ASCII - */ - /*@{*/ - SDLK_UNKNOWN = 0, - SDLK_FIRST = 0, - SDLK_BACKSPACE = 8, - SDLK_TAB = 9, - SDLK_CLEAR = 12, - SDLK_RETURN = 13, - SDLK_PAUSE = 19, - SDLK_ESCAPE = 27, - SDLK_SPACE = 32, - SDLK_EXCLAIM = 33, - SDLK_QUOTEDBL = 34, - SDLK_HASH = 35, - SDLK_DOLLAR = 36, - SDLK_AMPERSAND = 38, - SDLK_QUOTE = 39, - SDLK_LEFTPAREN = 40, - SDLK_RIGHTPAREN = 41, - SDLK_ASTERISK = 42, - SDLK_PLUS = 43, - SDLK_COMMA = 44, - SDLK_MINUS = 45, - SDLK_PERIOD = 46, - SDLK_SLASH = 47, - SDLK_0 = 48, - SDLK_1 = 49, - SDLK_2 = 50, - SDLK_3 = 51, - SDLK_4 = 52, - SDLK_5 = 53, - SDLK_6 = 54, - SDLK_7 = 55, - SDLK_8 = 56, - SDLK_9 = 57, - SDLK_COLON = 58, - SDLK_SEMICOLON = 59, - SDLK_LESS = 60, - SDLK_EQUALS = 61, - SDLK_GREATER = 62, - SDLK_QUESTION = 63, - SDLK_AT = 64, - /* - Skip uppercase letters - */ - SDLK_LEFTBRACKET = 91, - SDLK_BACKSLASH = 92, - SDLK_RIGHTBRACKET = 93, - SDLK_CARET = 94, - SDLK_UNDERSCORE = 95, - SDLK_BACKQUOTE = 96, - SDLK_a = 97, - SDLK_b = 98, - SDLK_c = 99, - SDLK_d = 100, - SDLK_e = 101, - SDLK_f = 102, - SDLK_g = 103, - SDLK_h = 104, - SDLK_i = 105, - SDLK_j = 106, - SDLK_k = 107, - SDLK_l = 108, - SDLK_m = 109, - SDLK_n = 110, - SDLK_o = 111, - SDLK_p = 112, - SDLK_q = 113, - SDLK_r = 114, - SDLK_s = 115, - SDLK_t = 116, - SDLK_u = 117, - SDLK_v = 118, - SDLK_w = 119, - SDLK_x = 120, - SDLK_y = 121, - SDLK_z = 122, - SDLK_DELETE = 127, - /* End of ASCII mapped keysyms */ - /*@}*/ - - /** @name International keyboard syms */ - /*@{*/ - SDLK_WORLD_0 = 160, /* 0xA0 */ - SDLK_WORLD_1 = 161, - SDLK_WORLD_2 = 162, - SDLK_WORLD_3 = 163, - SDLK_WORLD_4 = 164, - SDLK_WORLD_5 = 165, - SDLK_WORLD_6 = 166, - SDLK_WORLD_7 = 167, - SDLK_WORLD_8 = 168, - SDLK_WORLD_9 = 169, - SDLK_WORLD_10 = 170, - SDLK_WORLD_11 = 171, - SDLK_WORLD_12 = 172, - SDLK_WORLD_13 = 173, - SDLK_WORLD_14 = 174, - SDLK_WORLD_15 = 175, - SDLK_WORLD_16 = 176, - SDLK_WORLD_17 = 177, - SDLK_WORLD_18 = 178, - SDLK_WORLD_19 = 179, - SDLK_WORLD_20 = 180, - SDLK_WORLD_21 = 181, - SDLK_WORLD_22 = 182, - SDLK_WORLD_23 = 183, - SDLK_WORLD_24 = 184, - SDLK_WORLD_25 = 185, - SDLK_WORLD_26 = 186, - SDLK_WORLD_27 = 187, - SDLK_WORLD_28 = 188, - SDLK_WORLD_29 = 189, - SDLK_WORLD_30 = 190, - SDLK_WORLD_31 = 191, - SDLK_WORLD_32 = 192, - SDLK_WORLD_33 = 193, - SDLK_WORLD_34 = 194, - SDLK_WORLD_35 = 195, - SDLK_WORLD_36 = 196, - SDLK_WORLD_37 = 197, - SDLK_WORLD_38 = 198, - SDLK_WORLD_39 = 199, - SDLK_WORLD_40 = 200, - SDLK_WORLD_41 = 201, - SDLK_WORLD_42 = 202, - SDLK_WORLD_43 = 203, - SDLK_WORLD_44 = 204, - SDLK_WORLD_45 = 205, - SDLK_WORLD_46 = 206, - SDLK_WORLD_47 = 207, - SDLK_WORLD_48 = 208, - SDLK_WORLD_49 = 209, - SDLK_WORLD_50 = 210, - SDLK_WORLD_51 = 211, - SDLK_WORLD_52 = 212, - SDLK_WORLD_53 = 213, - SDLK_WORLD_54 = 214, - SDLK_WORLD_55 = 215, - SDLK_WORLD_56 = 216, - SDLK_WORLD_57 = 217, - SDLK_WORLD_58 = 218, - SDLK_WORLD_59 = 219, - SDLK_WORLD_60 = 220, - SDLK_WORLD_61 = 221, - SDLK_WORLD_62 = 222, - SDLK_WORLD_63 = 223, - SDLK_WORLD_64 = 224, - SDLK_WORLD_65 = 225, - SDLK_WORLD_66 = 226, - SDLK_WORLD_67 = 227, - SDLK_WORLD_68 = 228, - SDLK_WORLD_69 = 229, - SDLK_WORLD_70 = 230, - SDLK_WORLD_71 = 231, - SDLK_WORLD_72 = 232, - SDLK_WORLD_73 = 233, - SDLK_WORLD_74 = 234, - SDLK_WORLD_75 = 235, - SDLK_WORLD_76 = 236, - SDLK_WORLD_77 = 237, - SDLK_WORLD_78 = 238, - SDLK_WORLD_79 = 239, - SDLK_WORLD_80 = 240, - SDLK_WORLD_81 = 241, - SDLK_WORLD_82 = 242, - SDLK_WORLD_83 = 243, - SDLK_WORLD_84 = 244, - SDLK_WORLD_85 = 245, - SDLK_WORLD_86 = 246, - SDLK_WORLD_87 = 247, - SDLK_WORLD_88 = 248, - SDLK_WORLD_89 = 249, - SDLK_WORLD_90 = 250, - SDLK_WORLD_91 = 251, - SDLK_WORLD_92 = 252, - SDLK_WORLD_93 = 253, - SDLK_WORLD_94 = 254, - SDLK_WORLD_95 = 255, /* 0xFF */ - /*@}*/ - - /** @name Numeric keypad */ - /*@{*/ - SDLK_KP0 = 256, - SDLK_KP1 = 257, - SDLK_KP2 = 258, - SDLK_KP3 = 259, - SDLK_KP4 = 260, - SDLK_KP5 = 261, - SDLK_KP6 = 262, - SDLK_KP7 = 263, - SDLK_KP8 = 264, - SDLK_KP9 = 265, - SDLK_KP_PERIOD = 266, - SDLK_KP_DIVIDE = 267, - SDLK_KP_MULTIPLY = 268, - SDLK_KP_MINUS = 269, - SDLK_KP_PLUS = 270, - SDLK_KP_ENTER = 271, - SDLK_KP_EQUALS = 272, - /*@}*/ - - /** @name Arrows + Home/End pad */ - /*@{*/ - SDLK_UP = 273, - SDLK_DOWN = 274, - SDLK_RIGHT = 275, - SDLK_LEFT = 276, - SDLK_INSERT = 277, - SDLK_HOME = 278, - SDLK_END = 279, - SDLK_PAGEUP = 280, - SDLK_PAGEDOWN = 281, - /*@}*/ - - /** @name Function keys */ - /*@{*/ - SDLK_F1 = 282, - SDLK_F2 = 283, - SDLK_F3 = 284, - SDLK_F4 = 285, - SDLK_F5 = 286, - SDLK_F6 = 287, - SDLK_F7 = 288, - SDLK_F8 = 289, - SDLK_F9 = 290, - SDLK_F10 = 291, - SDLK_F11 = 292, - SDLK_F12 = 293, - SDLK_F13 = 294, - SDLK_F14 = 295, - SDLK_F15 = 296, - /*@}*/ - - /** @name Key state modifier keys */ - /*@{*/ - SDLK_NUMLOCK = 300, - SDLK_CAPSLOCK = 301, - SDLK_SCROLLOCK = 302, - SDLK_RSHIFT = 303, - SDLK_LSHIFT = 304, - SDLK_RCTRL = 305, - SDLK_LCTRL = 306, - SDLK_RALT = 307, - SDLK_LALT = 308, - SDLK_RMETA = 309, - SDLK_LMETA = 310, - SDLK_LSUPER = 311, /**< Left "Windows" key */ - SDLK_RSUPER = 312, /**< Right "Windows" key */ - SDLK_MODE = 313, /**< "Alt Gr" key */ - SDLK_COMPOSE = 314, /**< Multi-key compose key */ - /*@}*/ - - /** @name Miscellaneous function keys */ - /*@{*/ - SDLK_HELP = 315, - SDLK_PRINT = 316, - SDLK_SYSREQ = 317, - SDLK_BREAK = 318, - SDLK_MENU = 319, - SDLK_POWER = 320, /**< Power Macintosh power key */ - SDLK_EURO = 321, /**< Some european keyboards */ - SDLK_UNDO = 322, /**< Atari keyboard has Undo */ - /*@}*/ - - /* Add any other keys here */ - - SDLK_LAST -} SDLKey; - -/** Enumeration of valid key mods (possibly OR'd together) */ -typedef enum { - KMOD_NONE = 0x0000, - KMOD_LSHIFT= 0x0001, - KMOD_RSHIFT= 0x0002, - KMOD_LCTRL = 0x0040, - KMOD_RCTRL = 0x0080, - KMOD_LALT = 0x0100, - KMOD_RALT = 0x0200, - KMOD_LMETA = 0x0400, - KMOD_RMETA = 0x0800, - KMOD_NUM = 0x1000, - KMOD_CAPS = 0x2000, - KMOD_MODE = 0x4000, - KMOD_RESERVED = 0x8000 -} SDLMod; - -#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) -#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) -#define KMOD_ALT (KMOD_LALT|KMOD_RALT) -#define KMOD_META (KMOD_LMETA|KMOD_RMETA) - -#endif /* _SDL_keysym_h */ diff --git a/include/SDL_loadso.h b/include/SDL_loadso.h index 0c5e5362de..790d0a724c 100644 --- a/include/SDL_loadso.h +++ b/include/SDL_loadso.h @@ -1,45 +1,43 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_loadso.h +/** + * \file SDL_loadso.h + * * System dependent library loading routines + * + * Some things to keep in mind: + * \li These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * \li Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * \li Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) */ -/** @file SDL_loadso.h - * Some things to keep in mind: - * - These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * - Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * - Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) - */ - - #ifndef _SDL_loadso_h #define _SDL_loadso_h @@ -53,20 +51,23 @@ extern "C" { #endif /** - * This function dynamically loads a shared object and returns a pointer - * to the object handle (or NULL if there was an error). - * The 'sofile' parameter is a system dependent name of the object file. + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. */ -extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); +extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); /** - * Given an object handle, this function looks up the address of the - * named function in the shared object and returns it. This address - * is no longer valid after calling SDL_UnloadObject(). + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). */ -extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); +extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, + const char *name); -/** Unload a shared object from memory */ +/** + * Unload a shared object from memory. + */ extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); /* Ends C function definitions when using C++ */ @@ -76,3 +77,5 @@ extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); #include "close_code.h" #endif /* _SDL_loadso_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_log.h b/include/SDL_log.h new file mode 100644 index 0000000000..79ae4cde43 --- /dev/null +++ b/include/SDL_log.h @@ -0,0 +1,211 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_log.h + * + * Simple log messages with categories and priorities. + * + * By default logs are quiet, but if you're debugging SDL you might want: + * + * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); + * + * Here's where the messages go on different platforms: + * Windows: debug output stream + * Android: log output + * Others: standard error output (stderr) + */ + +#ifndef _SDL_log_h +#define _SDL_log_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \brief The maximum size of a log message + * + * Messages longer than the maximum size will be truncated + */ +#define SDL_MAX_LOG_MESSAGE 4096 + +/** + * \brief The predefined log categories + * + * By default the application category is enabled at the INFO level, + * the assert category is enabled at the WARN level, test is enabled + * at the VERBOSE level and all other categories are enabled at the + * CRITICAL level. + */ +enum +{ + SDL_LOG_CATEGORY_APPLICATION, + SDL_LOG_CATEGORY_ERROR, + SDL_LOG_CATEGORY_ASSERT, + SDL_LOG_CATEGORY_SYSTEM, + SDL_LOG_CATEGORY_AUDIO, + SDL_LOG_CATEGORY_VIDEO, + SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_INPUT, + SDL_LOG_CATEGORY_TEST, + + /* Reserved for future SDL library use */ + SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_RESERVED2, + SDL_LOG_CATEGORY_RESERVED3, + SDL_LOG_CATEGORY_RESERVED4, + SDL_LOG_CATEGORY_RESERVED5, + SDL_LOG_CATEGORY_RESERVED6, + SDL_LOG_CATEGORY_RESERVED7, + SDL_LOG_CATEGORY_RESERVED8, + SDL_LOG_CATEGORY_RESERVED9, + SDL_LOG_CATEGORY_RESERVED10, + + /* Beyond this point is reserved for application use, e.g. + enum { + MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, + MYAPP_CATEGORY_AWESOME2, + MYAPP_CATEGORY_AWESOME3, + ... + }; + */ + SDL_LOG_CATEGORY_CUSTOM +}; + +/** + * \brief The predefined log priorities + */ +typedef enum +{ + SDL_LOG_PRIORITY_VERBOSE = 1, + SDL_LOG_PRIORITY_DEBUG, + SDL_LOG_PRIORITY_INFO, + SDL_LOG_PRIORITY_WARN, + SDL_LOG_PRIORITY_ERROR, + SDL_LOG_PRIORITY_CRITICAL, + SDL_NUM_LOG_PRIORITIES +} SDL_LogPriority; + + +/** + * \brief Set the priority of all log categories + */ +extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); + +/** + * \brief Set the priority of a particular log category + */ +extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, + SDL_LogPriority priority); + +/** + * \brief Get the priority of a particular log category + */ +extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); + +/** + * \brief Reset all priorities to default. + * + * \note This is called in SDL_Quit(). + */ +extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); + +/** + * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_Log(const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE + */ +extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_DEBUG + */ +extern DECLSPEC void SDLCALL SDL_LogDebug(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_WARN + */ +extern DECLSPEC void SDLCALL SDL_LogWarn(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_ERROR + */ +extern DECLSPEC void SDLCALL SDL_LogError(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL + */ +extern DECLSPEC void SDLCALL SDL_LogCritical(int category, const char *fmt, ...); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessage(int category, + SDL_LogPriority priority, + const char *fmt, ...); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, + SDL_LogPriority priority, + const char *fmt, va_list ap); + +/** + * \brief The prototype for the log output function + */ +typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); + +/** + * \brief Get the current log output function. + */ +extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); + +/** + * \brief This function allows you to replace the default log output + * function with one of your own. + */ +extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_log_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_main.h b/include/SDL_main.h index ab50ef1e29..bbb7e859b3 100644 --- a/include/SDL_main.h +++ b/include/SDL_main.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #ifndef _SDL_main_h @@ -25,82 +24,102 @@ #include "SDL_stdinc.h" -/** @file SDL_main.h - * Redefine main() on Win32 and MacOS so that it is called by winmain.c +/** + * \file SDL_main.h + * + * Redefine main() on some platforms so that it is called by SDL. + */ + +#ifndef SDL_MAIN_HANDLED +#if defined(__WIN32__) +/* On Windows SDL provides WinMain(), which parses the command line and passes + the arguments to your main function. + + If you provide your own WinMain(), you may define SDL_MAIN_HANDLED + */ +#define SDL_MAIN_AVAILABLE + +#elif defined(__IPHONEOS__) +/* On iOS SDL provides a main function that creates an application delegate + and starts the iOS application run loop. + + See src/video/uikit/SDL_uikitappdelegate.m for more details. */ +#define SDL_MAIN_NEEDED -#if defined(__WIN32__) || \ - (defined(__MWERKS__) && !defined(__BEOS__)) || \ - defined(__MACOS__) || defined(__MACOSX__) || \ - defined(__SYMBIAN32__) || defined(QWS) +#elif defined(__ANDROID__) +/* On Android SDL provides a Java class in SDLActivity.java that is the + main activity entry point. + + See README-android.txt for more details on extending that class. + */ +#define SDL_MAIN_NEEDED + +#endif +#endif /* SDL_MAIN_HANDLED */ #ifdef __cplusplus -#define C_LINKAGE "C" +#define C_LINKAGE "C" #else #define C_LINKAGE #endif /* __cplusplus */ -/** The application's main() function must be called with C linkage, +/** + * \file SDL_main.h + * + * The application's main() function must be called with C linkage, * and should be declared like this: - * @code - * #ifdef __cplusplus - * extern "C" - * #endif - * int main(int argc, char *argv[]) - * { - * } - * @endcode + * \code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * \endcode */ -#define main SDL_main -/** The prototype for the application's main() function */ -extern C_LINKAGE int SDL_main(int argc, char *argv[]); +#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) +#define main SDL_main +#endif +/** + * The prototype for the application's main() function + */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); -/** @name From the SDL library code -- needed for registering the app on Win32 */ -/*@{*/ -#ifdef __WIN32__ #include "begin_code.h" #ifdef __cplusplus extern "C" { #endif -/** This should be called from your WinMain() function, if any */ -extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); -/** This can also be called, but is no longer necessary */ -extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); -/** This can also be called, but is no longer necessary (SDL_Quit calls it) */ -extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); -#ifdef __cplusplus -} -#endif -#include "close_code.h" -#endif -/*@}*/ +/* + * This is called by the real SDL main function to let the rest of the + * library know that initialization was done properly. + * + * Calling this yourself without knowing what you're doing can cause + * crashes and hard to diagnose problems with your application. + */ +extern DECLSPEC void SDL_SetMainReady(void); -/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ -/*@{*/ -#if defined(__MACOS__) +#ifdef __WIN32__ -#include "begin_code.h" -#ifdef __cplusplus -extern "C" { -#endif +/** + * This can be called to set the application class at startup + */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, + void *hInst); +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); -/** Forward declaration so we don't need to include QuickDraw.h */ -struct QDGlobals; +#endif /* __WIN32__ */ -/** This should be called from your main() function, if any */ -extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); #ifdef __cplusplus } #endif #include "close_code.h" -#endif -/*@}*/ - -#endif /* Need to redefine main()? */ #endif /* _SDL_main_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_messagebox.h b/include/SDL_messagebox.h new file mode 100644 index 0000000000..cb1a1ccff0 --- /dev/null +++ b/include/SDL_messagebox.h @@ -0,0 +1,144 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_messagebox_h +#define _SDL_messagebox_h + +#include "SDL_stdinc.h" +#include "SDL_video.h" /* For SDL_Window */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief SDL_MessageBox flags. If supported will display warning icon, etc. + */ +typedef enum +{ + SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ + SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ + SDL_MESSAGEBOX_INFORMATION = 0x00000040 /**< informational dialog */ +} SDL_MessageBoxFlags; + +/** + * \brief Flags for SDL_MessageBoxButtonData. + */ +typedef enum +{ + SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ + SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ +} SDL_MessageBoxButtonFlags; + +/** + * \brief Individual button data. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ + int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ + const char * text; /**< The UTF-8 button text */ +} SDL_MessageBoxButtonData; + +/** + * \brief RGB value used in a message box color scheme + */ +typedef struct +{ + Uint8 r, g, b; +} SDL_MessageBoxColor; + +typedef enum +{ + SDL_MESSAGEBOX_COLOR_BACKGROUND, + SDL_MESSAGEBOX_COLOR_TEXT, + SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, + SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, + SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, + SDL_MESSAGEBOX_COLOR_MAX +} SDL_MessageBoxColorType; + +/** + * \brief A set of colors to use for message box dialogs + */ +typedef struct +{ + SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; +} SDL_MessageBoxColorScheme; + +/** + * \brief MessageBox structure containing title, text, window, etc. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxFlags */ + SDL_Window *window; /**< Parent window, can be NULL */ + const char *title; /**< UTF-8 title */ + const char *message; /**< UTF-8 message text */ + + int numbuttons; + const SDL_MessageBoxButtonData *buttons; + + const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ +} SDL_MessageBoxData; + +/** + * \brief Create a modal message box. + * + * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. + * \param buttonid The pointer to which user id of hit button should be copied. + * + * \return -1 on error, otherwise 0 and buttonid contains user id of button + * hit or -1 if dialog was closed. + * + * \note This function should be called on the thread that created the parent + * window, or on the main thread if the messagebox has no parent. It will + * block execution of that thread until the user clicks a button or + * closes the messagebox. + */ +extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); + +/** + * \brief Create a simple modal message box + * + * \param flags ::SDL_MessageBoxFlags + * \param title UTF-8 title text + * \param message UTF-8 message text + * \param window The parent window, or NULL for no parent + * + * \return 0 on success, -1 on error + * + * \sa SDL_ShowMessageBox + */ +extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_messagebox_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h index 7c563b94da..36c29e90a7 100644 --- a/include/SDL_mouse.h +++ b/include/SDL_mouse.h @@ -1,27 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_mouse.h - * Include file for SDL mouse event handling +/** + * \file SDL_mouse.h + * + * Include file for SDL mouse event handling. */ #ifndef _SDL_mouse_h @@ -37,102 +38,180 @@ extern "C" { #endif -typedef struct WMcursor WMcursor; /**< Implementation dependent */ -typedef struct SDL_Cursor { - SDL_Rect area; /**< The area of the mouse cursor */ - Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ - Uint8 *data; /**< B/W cursor data */ - Uint8 *mask; /**< B/W cursor mask */ - Uint8 *save[2]; /**< Place to save cursor area */ - WMcursor *wm_cursor; /**< Window-manager cursor */ -} SDL_Cursor; +typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */ + +/** + * \brief Cursor types for SDL_CreateSystemCursor. + */ +typedef enum +{ + SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ + SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ + SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ + SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ + SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ + SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ + SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ + SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ + SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ + SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ + SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ + SDL_SYSTEM_CURSOR_HAND, /**< Hand */ + SDL_NUM_SYSTEM_CURSORS +} SDL_SystemCursor; /* Function prototypes */ + +/** + * \brief Get the window which currently has mouse focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); + +/** + * \brief Retrieve the current state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse cursor position relative to the focus window for the currently + * selected mouse. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * \brief Retrieve the relative state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * \brief Moves the mouse to the given position within the window. + * + * \param window The window to move the mouse into, or NULL for the current mouse focus + * \param x The x coordinate within the window + * \param y The y coordinate within the window + * + * \note This function generates a mouse motion event + */ +extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, + int x, int y); + /** - * Retrieve the current state of the mouse. - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * current mouse cursor position. You can pass NULL for either x or y. + * \brief Set relative mouse mode. + * + * \param enabled Whether or not to enable relative mode + * + * \return 0 on success, or -1 if relative mode is not supported. + * + * While the mouse is in relative mode, the cursor is hidden, and the + * driver will try to report continuous motion in the current window. + * Only relative motion events will be delivered, the mouse position + * will not change. + * + * \note This function will flush any pending mouse motion. + * + * \sa SDL_GetRelativeMouseMode() */ -extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); +extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); /** - * Retrieve the current state of the mouse. - * The current button state is returned as a button bitmask, which can - * be tested using the SDL_BUTTON(X) macros, and x and y are set to the - * mouse deltas since the last call to SDL_GetRelativeMouseState(). + * \brief Query whether relative mouse mode is enabled. + * + * \sa SDL_SetRelativeMouseMode() */ -extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); +extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); /** - * Set the position of the mouse cursor (generates a mouse motion event) + * \brief Create a cursor, using the specified bitmap data and + * mask (in MSB format). + * + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * + * + * + * + * + * + *
data mask resulting pixel on screen
0 1 White
1 1 Black
0 0 Transparent
1 0 Inverted color if possible, black + * if not.
+ * + * \sa SDL_FreeCursor() */ -extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, + const Uint8 * mask, + int w, int h, int hot_x, + int hot_y); /** - * Create a cursor using the specified data and mask (in MSB format). - * The cursor width must be a multiple of 8 bits. + * \brief Create a color cursor. * - * The cursor is created in black and white according to the following: - * data mask resulting pixel on screen - * 0 1 White - * 1 1 Black - * 0 0 Transparent - * 1 0 Inverted color if possible, black if not. + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, + int hot_x, + int hot_y); + +/** + * \brief Create a system cursor. * - * Cursors created with this function must be freed with SDL_FreeCursor(). + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); + +/** + * \brief Set the active cursor. */ -extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor - (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); /** - * Set the currently active cursor to the specified one. - * If the cursor is currently visible, the change will be immediately - * represented on the display. + * \brief Return the active cursor. */ -extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); /** - * Returns the currently active cursor. + * \brief Return the default cursor. */ -extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); /** - * Deallocates a cursor created with SDL_CreateCursor(). + * \brief Frees a cursor created with SDL_CreateCursor(). + * + * \sa SDL_CreateCursor() */ -extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); /** - * Toggle whether or not the cursor is shown on the screen. - * The cursor start off displayed, but can be turned off. - * SDL_ShowCursor() returns 1 if the cursor was being displayed - * before the call, or 0 if it was not. You can query the current - * state by passing a 'toggle' value of -1. + * \brief Toggle whether or not the cursor is shown. + * + * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current + * state. + * + * \return 1 if the cursor is shown, or 0 if the cursor is hidden. */ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); -/*@{*/ -/** Used as a mask when testing buttons in buttonstate - * Button 1: Left mouse button - * Button 2: Middle mouse button - * Button 3: Right mouse button - * Button 4: Mouse wheel up (may also be a real button) - * Button 5: Mouse wheel down (may also be a real button) - */ -#define SDL_BUTTON(X) (1 << ((X)-1)) -#define SDL_BUTTON_LEFT 1 -#define SDL_BUTTON_MIDDLE 2 -#define SDL_BUTTON_RIGHT 3 -#define SDL_BUTTON_WHEELUP 4 -#define SDL_BUTTON_WHEELDOWN 5 -#define SDL_BUTTON_X1 6 -#define SDL_BUTTON_X2 7 -#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) -#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) -#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) -#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) -#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) -/*@}*/ +/** + * Used as a mask when testing buttons in buttonstate. + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_X1 4 +#define SDL_BUTTON_X2 5 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) + /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -141,3 +220,5 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); #include "close_code.h" #endif /* _SDL_mouse_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_mutex.h b/include/SDL_mutex.h index c8da9b1a00..3efc4a8901 100644 --- a/include/SDL_mutex.h +++ b/include/SDL_mutex.h @@ -1,32 +1,31 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #ifndef _SDL_mutex_h #define _SDL_mutex_h -/** @file SDL_mutex.h - * Functions to provide thread synchronization primitives +/** + * \file SDL_mutex.h * - * @note These are independent of the other SDL routines. + * Functions to provide thread synchronization primitives. */ #include "SDL_stdinc.h" @@ -38,134 +37,208 @@ extern "C" { #endif -/** Synchronization functions which can time out return this value +/** + * Synchronization functions which can time out return this value * if they time out. */ -#define SDL_MUTEX_TIMEDOUT 1 +#define SDL_MUTEX_TIMEDOUT 1 -/** This is the timeout value which corresponds to never time out */ -#define SDL_MUTEX_MAXWAIT (~(Uint32)0) +/** + * This is the timeout value which corresponds to never time out. + */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Mutex functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * \name Mutex functions + */ +/*@{*/ -/** The SDL mutex structure, defined in SDL_mutex.c */ +/* The SDL mutex structure, defined in SDL_mutex.c */ struct SDL_mutex; typedef struct SDL_mutex SDL_mutex; -/** Create a mutex, initialized unlocked */ -extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); +/** + * Create a mutex, initialized unlocked. + */ +extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); -#define SDL_LockMutex(m) SDL_mutexP(m) -/** Lock the mutex - * @return 0, or -1 on error +/** + * Lock the mutex. + * + * \return 0, or -1 on error. */ -extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); +#define SDL_mutexP(m) SDL_LockMutex(m) +extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); -#define SDL_UnlockMutex(m) SDL_mutexV(m) -/** Unlock the mutex - * @return 0, or -1 on error +/** + * Try to lock the mutex * - * It is an error to unlock a mutex that has not been locked by - * the current thread, and doing so results in undefined behavior. + * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error */ -extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); +extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); -/** Destroy a mutex */ -extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); +/** + * Unlock the mutex. + * + * \return 0, or -1 on error. + * + * \warning It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +#define SDL_mutexV(m) SDL_UnlockMutex(m) +extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); -/*@}*/ +/** + * Destroy a mutex. + */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Semaphore functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*@}*//*Mutex functions*/ -/** The SDL semaphore structure, defined in SDL_sem.c */ + +/** + * \name Semaphore functions + */ +/*@{*/ + +/* The SDL semaphore structure, defined in SDL_sem.c */ struct SDL_semaphore; typedef struct SDL_semaphore SDL_sem; -/** Create a semaphore, initialized with value, returns NULL on failure. */ -extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); +/** + * Create a semaphore, initialized with value, returns NULL on failure. + */ +extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); -/** Destroy a semaphore */ -extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); +/** + * Destroy a semaphore. + */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); /** - * This function suspends the calling thread until the semaphore pointed - * to by sem has a positive count. It then atomically decreases the semaphore - * count. + * This function suspends the calling thread until the semaphore pointed + * to by \c sem has a positive count. It then atomically decreases the + * semaphore count. */ -extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); -/** Non-blocking variant of SDL_SemWait(). - * @return 0 if the wait succeeds, - * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. +/** + * Non-blocking variant of SDL_SemWait(). + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would + * block, and -1 on error. */ -extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); -/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if - * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in - * the allotted time, and -1 on error. +/** + * Variant of SDL_SemWait() with a timeout in milliseconds. + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not + * succeed in the allotted time, and -1 on error. * - * On some platforms this function is implemented by looping with a delay - * of 1 ms, and so should be avoided if possible. + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); -/** Atomically increases the semaphore's count (not blocking). - * @return 0, or -1 on error. +/** + * Atomically increases the semaphore's count (not blocking). + * + * \return 0, or -1 on error. */ -extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); -/** Returns the current count of the semaphore */ -extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); +/** + * Returns the current count of the semaphore. + */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); -/*@}*/ +/*@}*//*Semaphore functions*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Condition_variable_functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * \name Condition variable functions + */ /*@{*/ -/** The SDL condition variable structure, defined in SDL_cond.c */ + +/* The SDL condition variable structure, defined in SDL_cond.c */ struct SDL_cond; typedef struct SDL_cond SDL_cond; -/*@}*/ -/** Create a condition variable */ -extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); +/** + * Create a condition variable. + * + * Typical use of condition variables: + * + * Thread A: + * SDL_LockMutex(lock); + * while ( ! condition ) { + * SDL_CondWait(cond, lock); + * } + * SDL_UnlockMutex(lock); + * + * Thread B: + * SDL_LockMutex(lock); + * ... + * condition = true; + * ... + * SDL_CondSignal(cond); + * SDL_UnlockMutex(lock); + * + * There is some discussion whether to signal the condition variable + * with the mutex locked or not. There is some potential performance + * benefit to unlocking first on some platforms, but there are some + * potential race conditions depending on how your code is structured. + * + * In general it's safer to signal the condition variable while the + * mutex is locked. + */ +extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); -/** Destroy a condition variable */ -extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); +/** + * Destroy a condition variable. + */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); -/** Restart one of the threads that are waiting on the condition variable, - * @return 0 or -1 on error. +/** + * Restart one of the threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. */ -extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); -/** Restart all threads that are waiting on the condition variable, - * @return 0 or -1 on error. +/** + * Restart all threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. */ -extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); -/** Wait on the condition variable, unlocking the provided mutex. - * The mutex must be locked before entering this function! +/** + * Wait on the condition variable, unlocking the provided mutex. + * + * \warning The mutex must be locked before entering this function! + * * The mutex is re-locked once the condition variable is signaled. - * @return 0 when it is signaled, or -1 on error. + * + * \return 0 when it is signaled, or -1 on error. */ -extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); -/** Waits for at most 'ms' milliseconds, and returns 0 if the condition - * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not +/** + * Waits for at most \c ms milliseconds, and returns 0 if the condition + * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not * signaled in the allotted time, and -1 on error. - * On some platforms this function is implemented by looping with a delay - * of 1 ms, and so should be avoided if possible. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. */ -extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, + SDL_mutex * mutex, Uint32 ms); + +/*@}*//*Condition variable functions*/ -/*@}*/ /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -175,3 +248,4 @@ extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex #endif /* _SDL_mutex_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_name.h b/include/SDL_name.h index 511619af56..d0469e1f29 100644 --- a/include/SDL_name.h +++ b/include/SDL_name.h @@ -6,6 +6,6 @@ #define NeedFunctionPrototypes 1 #endif -#define SDL_NAME(X) SDL_##X +#define SDL_NAME(X) SDL_##X #endif /* _SDLname_h_ */ diff --git a/include/SDL_opengl.h b/include/SDL_opengl.h index 3d791d69b3..2f120aa95a 100644 --- a/include/SDL_opengl.h +++ b/include/SDL_opengl.h @@ -1,63 +1,81 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_opengl.h - * This is a simple file to encapsulate the OpenGL API headers +/** + * \file SDL_opengl.h + * + * This is a simple file to encapsulate the OpenGL API headers. */ +#ifndef _SDL_opengl_h +#define _SDL_opengl_h + #include "SDL_config.h" +#ifndef __IPHONEOS__ + #ifdef __WIN32__ #define WIN32_LEAN_AND_MEAN #ifndef NOMINMAX -#define NOMINMAX /* Don't defined min() and max() */ +#define NOMINMAX /* Don't defined min() and max() */ #endif #include #endif + +#ifdef __glext_h_ +/* Someone has already included glext.h */ +#define NO_SDL_GLEXT +#endif #ifndef NO_SDL_GLEXT -#define __glext_h_ /* Don't let gl.h include glext.h */ +#define __glext_h_ /* Don't let gl.h include glext.h */ #endif #if defined(__MACOSX__) -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ -#elif defined(__MACOS__) -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ +#define __X_GL_H #else -#include /* Header File For The OpenGL Library */ -#include /* Header File For The GLU Library */ +#include /* Header File For The OpenGL Library */ #endif #ifndef NO_SDL_GLEXT #undef __glext_h_ #endif -/** @name GLext.h - * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. - * It is included here because glext.h is not available on some systems. - * If you don't want this version included, simply define "NO_SDL_GLEXT" +/** + * \file SDL_opengl.h + * + * This file is included because glext.h is not available on some systems. + * If you don't want this version included, simply define ::NO_SDL_GLEXT. + * + * The latest version is available from: + * http://www.opengl.org/registry/ */ -/*@{*/ -#ifndef NO_SDL_GLEXT -#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) + +/** + * \def NO_SDL_GLEXT + * + * Define this if you have your own version of glext.h and want to disable the + * version included in SDL_opengl.h. + */ + +#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) +#ifndef __glext_h_ #define __glext_h_ #ifdef __cplusplus @@ -65,34 +83,34 @@ extern "C" { #endif /* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. +** Copyright (c) 2007-2010 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 64 +/* Function declaration macros - to move into glplatform.h */ + #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) #define WIN32_LEAN_AND_MEAN 1 #include @@ -110,18 +128,12 @@ extern "C" { /*************************************************************/ -/* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/06/20 */ -/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 29 - #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_INT_8_8_8_8 0x8035 #define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A #define GL_TEXTURE_BINDING_3D 0x806A #define GL_PACK_SKIP_IMAGES 0x806B #define GL_PACK_IMAGE_HEIGHT 0x806C @@ -148,17 +160,21 @@ extern "C" { #define GL_TEXTURE_MAX_LOD 0x813B #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #endif +#ifndef GL_VERSION_1_2_DEPRECATED +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#endif + #ifndef GL_ARB_imaging #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 @@ -171,6 +187,9 @@ extern "C" { #define GL_BLEND_EQUATION 0x8009 #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B +#endif + +#ifndef GL_ARB_imaging_DEPRECATED #define GL_CONVOLUTION_1D 0x8010 #define GL_CONVOLUTION_2D 0x8011 #define GL_SEPARABLE_2D 0x8012 @@ -271,12 +290,6 @@ extern "C" { #define GL_TEXTURE30 0x84DE #define GL_TEXTURE31 0x84DF #define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 #define GL_MULTISAMPLE 0x809D #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_ALPHA_TO_ONE 0x809F @@ -285,9 +298,6 @@ extern "C" { #define GL_SAMPLES 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 #define GL_TEXTURE_CUBE_MAP 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 @@ -298,10 +308,6 @@ extern "C" { #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC #define GL_COMPRESSED_RGB 0x84ED #define GL_COMPRESSED_RGBA 0x84EE #define GL_TEXTURE_COMPRESSION_HINT 0x84EF @@ -310,6 +316,22 @@ extern "C" { #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_CLAMP_TO_BORDER 0x812D +#endif + +#ifndef GL_VERSION_1_3_DEPRECATED +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC #define GL_COMBINE 0x8570 #define GL_COMBINE_RGB 0x8571 #define GL_COMBINE_ALPHA 0x8572 @@ -341,16 +363,26 @@ extern "C" { #define GL_BLEND_SRC_RGB 0x80C9 #define GL_BLEND_DST_ALPHA 0x80CA #define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 #define GL_DEPTH_COMPONENT16 0x81A5 #define GL_DEPTH_COMPONENT24 0x81A6 #define GL_DEPTH_COMPONENT32 0x81A7 #define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#endif + +#ifndef GL_VERSION_1_4_DEPRECATED +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 #define GL_FOG_COORDINATE_SOURCE 0x8450 #define GL_FOG_COORDINATE 0x8451 #define GL_FRAGMENT_DEPTH 0x8452 @@ -366,15 +398,8 @@ extern "C" { #define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C #define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D #define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD #define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A #define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D #define GL_COMPARE_R_TO_TEXTURE 0x884E #endif @@ -389,15 +414,6 @@ extern "C" { #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_ARRAY_BUFFER_BINDING 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F #define GL_READ_ONLY 0x88B8 #define GL_WRITE_ONLY 0x88B9 @@ -415,31 +431,42 @@ extern "C" { #define GL_DYNAMIC_READ 0x88E9 #define GL_DYNAMIC_COPY 0x88EA #define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#endif + +#ifndef GL_VERSION_1_5_DEPRECATED +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A #endif #ifndef GL_VERSION_2_0 -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_RGB 0x8009 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 #define GL_CURRENT_VERTEX_ATTRIB 0x8626 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 #define GL_STENCIL_BACK_FUNC 0x8800 #define GL_STENCIL_BACK_FAIL 0x8801 @@ -463,11 +490,8 @@ extern "C" { #define GL_DRAW_BUFFER14 0x8833 #define GL_DRAW_BUFFER15 0x8834 #define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 #define GL_MAX_VERTEX_ATTRIBS 0x8869 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 @@ -518,6 +542,588 @@ extern "C" { #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 #endif +#ifndef GL_VERSION_2_0_DEPRECATED +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +#endif + +#ifndef GL_VERSION_2_1 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#endif + +#ifndef GL_VERSION_2_1_DEPRECATED +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#endif + +#ifndef GL_VERSION_3_0 +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +/* Reuse tokens from ARB_depth_buffer_float */ +/* reuse GL_DEPTH_COMPONENT32F */ +/* reuse GL_DEPTH32F_STENCIL8 */ +/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_DEFAULT */ +/* reuse GL_FRAMEBUFFER_UNDEFINED */ +/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ +/* reuse GL_INDEX */ +/* reuse GL_MAX_RENDERBUFFER_SIZE */ +/* reuse GL_DEPTH_STENCIL */ +/* reuse GL_UNSIGNED_INT_24_8 */ +/* reuse GL_DEPTH24_STENCIL8 */ +/* reuse GL_TEXTURE_STENCIL_SIZE */ +/* reuse GL_TEXTURE_RED_TYPE */ +/* reuse GL_TEXTURE_GREEN_TYPE */ +/* reuse GL_TEXTURE_BLUE_TYPE */ +/* reuse GL_TEXTURE_ALPHA_TYPE */ +/* reuse GL_TEXTURE_DEPTH_TYPE */ +/* reuse GL_UNSIGNED_NORMALIZED */ +/* reuse GL_FRAMEBUFFER_BINDING */ +/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_BINDING */ +/* reuse GL_READ_FRAMEBUFFER */ +/* reuse GL_DRAW_FRAMEBUFFER */ +/* reuse GL_READ_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_SAMPLES */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* reuse GL_FRAMEBUFFER_COMPLETE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ +/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ +/* reuse GL_MAX_COLOR_ATTACHMENTS */ +/* reuse GL_COLOR_ATTACHMENT0 */ +/* reuse GL_COLOR_ATTACHMENT1 */ +/* reuse GL_COLOR_ATTACHMENT2 */ +/* reuse GL_COLOR_ATTACHMENT3 */ +/* reuse GL_COLOR_ATTACHMENT4 */ +/* reuse GL_COLOR_ATTACHMENT5 */ +/* reuse GL_COLOR_ATTACHMENT6 */ +/* reuse GL_COLOR_ATTACHMENT7 */ +/* reuse GL_COLOR_ATTACHMENT8 */ +/* reuse GL_COLOR_ATTACHMENT9 */ +/* reuse GL_COLOR_ATTACHMENT10 */ +/* reuse GL_COLOR_ATTACHMENT11 */ +/* reuse GL_COLOR_ATTACHMENT12 */ +/* reuse GL_COLOR_ATTACHMENT13 */ +/* reuse GL_COLOR_ATTACHMENT14 */ +/* reuse GL_COLOR_ATTACHMENT15 */ +/* reuse GL_DEPTH_ATTACHMENT */ +/* reuse GL_STENCIL_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER */ +/* reuse GL_RENDERBUFFER */ +/* reuse GL_RENDERBUFFER_WIDTH */ +/* reuse GL_RENDERBUFFER_HEIGHT */ +/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ +/* reuse GL_STENCIL_INDEX1 */ +/* reuse GL_STENCIL_INDEX4 */ +/* reuse GL_STENCIL_INDEX8 */ +/* reuse GL_STENCIL_INDEX16 */ +/* reuse GL_RENDERBUFFER_RED_SIZE */ +/* reuse GL_RENDERBUFFER_GREEN_SIZE */ +/* reuse GL_RENDERBUFFER_BLUE_SIZE */ +/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ +/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ +/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ +/* reuse GL_MAX_SAMPLES */ +/* Reuse tokens from ARB_framebuffer_sRGB */ +/* reuse GL_FRAMEBUFFER_SRGB */ +/* Reuse tokens from ARB_half_float_vertex */ +/* reuse GL_HALF_FLOAT */ +/* Reuse tokens from ARB_map_buffer_range */ +/* reuse GL_MAP_READ_BIT */ +/* reuse GL_MAP_WRITE_BIT */ +/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ +/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ +/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ +/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ +/* Reuse tokens from ARB_texture_compression_rgtc */ +/* reuse GL_COMPRESSED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_RG_RGTC2 */ +/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ +/* Reuse tokens from ARB_texture_rg */ +/* reuse GL_RG */ +/* reuse GL_RG_INTEGER */ +/* reuse GL_R8 */ +/* reuse GL_R16 */ +/* reuse GL_RG8 */ +/* reuse GL_RG16 */ +/* reuse GL_R16F */ +/* reuse GL_R32F */ +/* reuse GL_RG16F */ +/* reuse GL_RG32F */ +/* reuse GL_R8I */ +/* reuse GL_R8UI */ +/* reuse GL_R16I */ +/* reuse GL_R16UI */ +/* reuse GL_R32I */ +/* reuse GL_R32UI */ +/* reuse GL_RG8I */ +/* reuse GL_RG8UI */ +/* reuse GL_RG16I */ +/* reuse GL_RG16UI */ +/* reuse GL_RG32I */ +/* reuse GL_RG32UI */ +/* Reuse tokens from ARB_vertex_array_object */ +/* reuse GL_VERTEX_ARRAY_BINDING */ +#endif + +#ifndef GL_VERSION_3_0_DEPRECATED +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_TEXTURE_LUMINANCE_TYPE */ +/* reuse GL_TEXTURE_INTENSITY_TYPE */ +#endif + +#ifndef GL_VERSION_3_1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +/* Reuse tokens from ARB_copy_buffer */ +/* reuse GL_COPY_READ_BUFFER */ +/* reuse GL_COPY_WRITE_BUFFER */ +/* Reuse tokens from ARB_draw_instanced (none) */ +/* Reuse tokens from ARB_uniform_buffer_object */ +/* reuse GL_UNIFORM_BUFFER */ +/* reuse GL_UNIFORM_BUFFER_BINDING */ +/* reuse GL_UNIFORM_BUFFER_START */ +/* reuse GL_UNIFORM_BUFFER_SIZE */ +/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */ +/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */ +/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */ +/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */ +/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */ +/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */ +/* reuse GL_ACTIVE_UNIFORM_BLOCKS */ +/* reuse GL_UNIFORM_TYPE */ +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_INDEX */ +/* reuse GL_UNIFORM_OFFSET */ +/* reuse GL_UNIFORM_ARRAY_STRIDE */ +/* reuse GL_UNIFORM_MATRIX_STRIDE */ +/* reuse GL_UNIFORM_IS_ROW_MAJOR */ +/* reuse GL_UNIFORM_BLOCK_BINDING */ +/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */ +/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_INVALID_INDEX */ +#endif + +#ifndef GL_VERSION_3_2 +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* Reuse tokens from ARB_depth_clamp */ +/* reuse GL_DEPTH_CLAMP */ +/* Reuse tokens from ARB_draw_elements_base_vertex (none) */ +/* Reuse tokens from ARB_fragment_coord_conventions (none) */ +/* Reuse tokens from ARB_provoking_vertex */ +/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +/* Reuse tokens from ARB_seamless_cube_map */ +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ +/* Reuse tokens from ARB_sync */ +/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */ +/* reuse GL_OBJECT_TYPE */ +/* reuse GL_SYNC_CONDITION */ +/* reuse GL_SYNC_STATUS */ +/* reuse GL_SYNC_FLAGS */ +/* reuse GL_SYNC_FENCE */ +/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */ +/* reuse GL_UNSIGNALED */ +/* reuse GL_SIGNALED */ +/* reuse GL_ALREADY_SIGNALED */ +/* reuse GL_TIMEOUT_EXPIRED */ +/* reuse GL_CONDITION_SATISFIED */ +/* reuse GL_WAIT_FAILED */ +/* reuse GL_TIMEOUT_IGNORED */ +/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */ +/* reuse GL_TIMEOUT_IGNORED */ +/* Reuse tokens from ARB_texture_multisample */ +/* reuse GL_SAMPLE_POSITION */ +/* reuse GL_SAMPLE_MASK */ +/* reuse GL_SAMPLE_MASK_VALUE */ +/* reuse GL_MAX_SAMPLE_MASK_WORDS */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_SAMPLES */ +/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */ +/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */ +/* reuse GL_MAX_INTEGER_SAMPLES */ +/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */ +#endif + +#ifndef GL_VERSION_3_3 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +/* Reuse tokens from ARB_blend_func_extended */ +/* reuse GL_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_ALPHA */ +/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */ +/* Reuse tokens from ARB_explicit_attrib_location (none) */ +/* Reuse tokens from ARB_occlusion_query2 */ +/* reuse GL_ANY_SAMPLES_PASSED */ +/* Reuse tokens from ARB_sampler_objects */ +/* reuse GL_SAMPLER_BINDING */ +/* Reuse tokens from ARB_shader_bit_encoding (none) */ +/* Reuse tokens from ARB_texture_rgb10_a2ui */ +/* reuse GL_RGB10_A2UI */ +/* Reuse tokens from ARB_texture_swizzle */ +/* reuse GL_TEXTURE_SWIZZLE_R */ +/* reuse GL_TEXTURE_SWIZZLE_G */ +/* reuse GL_TEXTURE_SWIZZLE_B */ +/* reuse GL_TEXTURE_SWIZZLE_A */ +/* reuse GL_TEXTURE_SWIZZLE_RGBA */ +/* Reuse tokens from ARB_timer_query */ +/* reuse GL_TIME_ELAPSED */ +/* reuse GL_TIMESTAMP */ +/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */ +/* reuse GL_INT_2_10_10_10_REV */ +#endif + +#ifndef GL_VERSION_4_0 +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +/* Reuse tokens from ARB_texture_query_lod (none) */ +/* Reuse tokens from ARB_draw_buffers_blend (none) */ +/* Reuse tokens from ARB_draw_indirect */ +/* reuse GL_DRAW_INDIRECT_BUFFER */ +/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */ +/* Reuse tokens from ARB_gpu_shader5 */ +/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +/* Reuse tokens from ARB_gpu_shader_fp64 */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +/* Reuse tokens from ARB_shader_subroutine */ +/* reuse GL_ACTIVE_SUBROUTINES */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */ +/* reuse GL_MAX_SUBROUTINES */ +/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_COMPATIBLE_SUBROUTINES */ +/* Reuse tokens from ARB_tessellation_shader */ +/* reuse GL_PATCHES */ +/* reuse GL_PATCH_VERTICES */ +/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */ +/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */ +/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */ +/* reuse GL_TESS_GEN_MODE */ +/* reuse GL_TESS_GEN_SPACING */ +/* reuse GL_TESS_GEN_VERTEX_ORDER */ +/* reuse GL_TESS_GEN_POINT_MODE */ +/* reuse GL_ISOLINES */ +/* reuse GL_FRACTIONAL_ODD */ +/* reuse GL_FRACTIONAL_EVEN */ +/* reuse GL_MAX_PATCH_VERTICES */ +/* reuse GL_MAX_TESS_GEN_LEVEL */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_PATCH_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_CONTROL_SHADER */ +/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */ +/* Reuse tokens from ARB_transform_feedback2 */ +/* reuse GL_TRANSFORM_FEEDBACK */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */ +/* reuse GL_TRANSFORM_FEEDBACK_BINDING */ +/* Reuse tokens from ARB_transform_feedback3 */ +/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_VERSION_4_1 +/* Reuse tokens from ARB_ES2_compatibility */ +/* reuse GL_FIXED */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */ +/* reuse GL_LOW_FLOAT */ +/* reuse GL_MEDIUM_FLOAT */ +/* reuse GL_HIGH_FLOAT */ +/* reuse GL_LOW_INT */ +/* reuse GL_MEDIUM_INT */ +/* reuse GL_HIGH_INT */ +/* reuse GL_SHADER_COMPILER */ +/* reuse GL_NUM_SHADER_BINARY_FORMATS */ +/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */ +/* reuse GL_MAX_VARYING_VECTORS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */ +/* Reuse tokens from ARB_get_program_binary */ +/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */ +/* reuse GL_PROGRAM_BINARY_LENGTH */ +/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */ +/* reuse GL_PROGRAM_BINARY_FORMATS */ +/* Reuse tokens from ARB_separate_shader_objects */ +/* reuse GL_VERTEX_SHADER_BIT */ +/* reuse GL_FRAGMENT_SHADER_BIT */ +/* reuse GL_GEOMETRY_SHADER_BIT */ +/* reuse GL_TESS_CONTROL_SHADER_BIT */ +/* reuse GL_TESS_EVALUATION_SHADER_BIT */ +/* reuse GL_ALL_SHADER_BITS */ +/* reuse GL_PROGRAM_SEPARABLE */ +/* reuse GL_ACTIVE_PROGRAM */ +/* reuse GL_PROGRAM_PIPELINE_BINDING */ +/* Reuse tokens from ARB_shader_precision (none) */ +/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */ +/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */ +/* reuse GL_MAX_VIEWPORTS */ +/* reuse GL_VIEWPORT_SUBPIXEL_BITS */ +/* reuse GL_VIEWPORT_BOUNDS_RANGE */ +/* reuse GL_LAYER_PROVOKING_VERTEX */ +/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */ +/* reuse GL_UNDEFINED_VERTEX */ +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -1013,6 +1619,604 @@ extern "C" { #define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF #endif +#ifndef GL_ARB_depth_buffer_float +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#endif + +#ifndef GL_ARB_draw_instanced +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#endif + +#ifndef GL_ARB_framebuffer_object_DEPRECATED +#define GL_INDEX 0x8222 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_HALF_FLOAT 0x140B +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#endif + +#ifndef GL_ARB_texture_rg +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu +#endif + +#ifndef GL_ARB_compatibility +/* ARB_compatibility just defines tokens from core 3.0 */ +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#endif + +#ifndef GL_ARB_shader_texture_lod +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_DEPTH_CLAMP 0x864F +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#endif + +#ifndef GL_ARB_sync +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +#endif + +#ifndef GL_ARB_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_ARB_draw_buffers_blend +#endif + +#ifndef GL_ARB_sample_shading +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#endif + +#ifndef GL_ARB_texture_gather +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#endif + +#ifndef GL_ARB_texture_query_lod +#endif + +#ifndef GL_ARB_shading_language_include +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_SRC1_COLOR 0x88F9 +/* reuse GL_SRC1_ALPHA */ +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#endif + +#ifndef GL_ARB_explicit_attrib_location +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_SAMPLER_BINDING 0x8919 +#endif + +#ifndef GL_ARB_shader_bit_encoding +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_RGB10_A2UI 0x906F +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#endif + +#ifndef GL_ARB_timer_query +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */ +#define GL_INT_2_10_10_10_REV 0x8D9F +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_PATCHES 0x000E +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +/* reuse GL_TRIANGLES */ +/* reuse GL_QUADS */ +#define GL_ISOLINES 0x8E7A +/* reuse GL_EQUAL */ +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +/* reuse GL_CCW */ +/* reuse GL_CW */ +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +/* reuse GL_RGB32F */ +/* reuse GL_RGB32UI */ +/* reuse GL_RGB32I */ +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_ALL_SHADER_BITS 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#endif + +#ifndef GL_ARB_shader_precision +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +/* reuse GL_RGB32I */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +#endif + +#ifndef GL_ARB_viewport_array +/* reuse GL_SCISSOR_BOX */ +/* reuse GL_VIEWPORT */ +/* reuse GL_DEPTH_RANGE */ +/* reuse GL_SCISSOR_TEST */ +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +#endif + +#ifndef GL_ARB_cl_event +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +#endif + +#ifndef GL_ARB_debug_output +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#endif + +#ifndef GL_ARB_robustness +/* reuse GL_NO_ERROR */ +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef GL_ARB_shader_stencil_export +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -2834,9 +4038,9 @@ extern "C" { #endif #ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E #endif #ifndef GL_APPLE_fence @@ -2853,6 +4057,7 @@ extern "C" { #define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E #define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F #define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF #endif @@ -2998,7 +4203,7 @@ extern "C" { #endif #ifndef GL_EXT_blend_equation_separate -#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 #define GL_BLEND_EQUATION_ALPHA_EXT 0x883D #endif @@ -3052,7 +4257,6 @@ extern "C" { #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB @@ -3097,18 +4301,813 @@ extern "C" { #ifndef GL_GREMEDY_string_marker #endif +#ifndef GL_EXT_packed_depth_stencil +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + +#ifndef GL_NV_conditional_render +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +#endif + +#ifndef GL_NV_present_video +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +#endif + +#ifndef GL_EXT_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +#endif + +#ifndef GL_ATI_meminfo +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#endif + +#ifndef GL_AMD_texture_texture4 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +/* reuse GL_RED_SNORM */ +/* reuse GL_RG_SNORM */ +/* reuse GL_RGB_SNORM */ +/* reuse GL_RGBA_SNORM */ +/* reuse GL_R8_SNORM */ +/* reuse GL_RG8_SNORM */ +/* reuse GL_RGB8_SNORM */ +/* reuse GL_RGBA8_SNORM */ +/* reuse GL_R16_SNORM */ +/* reuse GL_RG16_SNORM */ +/* reuse GL_RGB16_SNORM */ +/* reuse GL_RGBA16_SNORM */ +/* reuse GL_SIGNED_NORMALIZED */ +#endif + +#ifndef GL_AMD_draw_buffers_blend +#endif + +#ifndef GL_APPLE_texture_range +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +/* reuse GL_STORAGE_CACHED_APPLE */ +/* reuse GL_STORAGE_SHARED_APPLE */ +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#endif + +#ifndef GL_APPLE_rgb_422 +#define GL_RGB_422_APPLE 0x8A1F +/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */ +/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */ +#endif + +#ifndef GL_NV_video_capture +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +#endif + +#ifndef GL_NV_copy_image +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +#endif + +#ifndef GL_NV_texture_barrier +#endif + +#ifndef GL_AMD_shader_stencil_export +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */ +#endif + +#ifndef GL_AMD_conservative_depth +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 +#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +/* reuse GL_PATCHES */ +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +/* reuse GL_READ_WRITE */ +/* reuse GL_WRITE_ONLY */ +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +/* reuse GL_INT64_NV */ +/* reuse GL_UNSIGNED_INT64_NV */ +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_COVERAGE_SAMPLES_NV 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +#endif + +#ifndef GL_AMD_debug_output +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#endif + /*************************************************************/ #include #ifndef GL_VERSION_2_0 /* GL type for program/shader text */ -typedef char GLchar; /* native character */ +typedef char GLchar; #endif #ifndef GL_VERSION_1_5 /* GL types for handling large vertex buffer objects */ -#ifdef __APPLE__ +#if defined(__APPLE__) typedef long GLintptr; typedef long GLsizeiptr; #else @@ -3119,7 +5118,7 @@ typedef ptrdiff_t GLsizeiptr; #ifndef GL_ARB_vertex_buffer_object /* GL types for handling large vertex buffer objects */ -#ifdef __APPLE__ +#if defined(__APPLE__) typedef long GLintptrARB; typedef long GLsizeiptrARB; #else @@ -3129,16 +5128,16 @@ typedef ptrdiff_t GLsizeiptrARB; #endif #ifndef GL_ARB_shader_objects -/* GL types for handling shader object handles and program/shader text */ -typedef char GLcharARB; /* native character */ +/* GL types for program/shader text and shader object handles */ +typedef char GLcharARB; #if defined(__APPLE__) -typedef void *GLhandleARB; /* shader object handle */ +typedef void *GLhandleARB; #else -typedef unsigned int GLhandleARB; /* shader object handle */ +typedef unsigned int GLhandleARB; #endif #endif -/* GL types for "half" precision (s10e5) float data in host memory */ +/* GL type for "half" precision (s10e5) float data in host memory */ #ifndef GL_ARB_half_float_pixel typedef unsigned short GLhalfARB; #endif @@ -3147,51 +5146,127 @@ typedef unsigned short GLhalfARB; typedef unsigned short GLhalfNV; #endif +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif +#endif + +#ifndef GL_EXT_timer_query +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif + +#ifndef GL_ARB_sync +typedef int64_t GLint64; +typedef uint64_t GLuint64; +typedef struct __GLsync *GLsync; +#endif + +#ifndef GL_ARB_cl_event +/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ +struct _cl_context; +struct _cl_event; +#endif + +#ifndef GL_ARB_debug_output +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_AMD_debug_output +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_NV_vdpau_interop +typedef GLintptr GLvdpauSurfaceNV; +#endif + #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_2_DEPRECATED +#define GL_VERSION_1_2_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogram (GLenum target); +GLAPI void APIENTRY glResetMinmax (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); @@ -3224,62 +5299,73 @@ typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenu typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif #ifndef GL_VERSION_1_3 #define GL_VERSION_1_3 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum); -GLAPI void APIENTRY glClientActiveTexture (GLenum); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glActiveTexture (GLenum texture); +GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_3_DEPRECATED +#define GL_VERSION_1_3_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientActiveTexture (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); @@ -3317,77 +5403,75 @@ typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); #endif #ifndef GL_VERSION_1_4 #define GL_VERSION_1_4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glFogCoordf (GLfloat); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *); -GLAPI void APIENTRY glFogCoordd (GLdouble); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameteri (GLenum, GLint); -GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); -GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos2i (GLint, GLint); -GLAPI void APIENTRY glWindowPos2iv (const GLint *); -GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *); -GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3iv (const GLint *); -GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_VERSION_1_4_DEPRECATED +#define GL_VERSION_1_4_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordf (GLfloat coord); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); +GLAPI void APIENTRY glFogCoordd (GLdouble coord); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2iv (const GLint *v); +GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); +GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3iv (const GLint *v); +GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); @@ -3426,25 +5510,25 @@ typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); #ifndef GL_VERSION_1_5 #define GL_VERSION_1_5 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQuery (GLuint); -GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); -GLAPI void APIENTRY glEndQuery (GLenum); -GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint); -GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQuery (GLuint id); +GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQuery (GLenum target); +GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); @@ -3470,104 +5554,104 @@ typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname #ifndef GL_VERSION_2_0 #define GL_VERSION_2_0 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); -GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); -GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); -GLAPI void APIENTRY glAttachShader (GLuint, GLuint); -GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); -GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GLAPI void APIENTRY glCompileShader (GLuint shader); GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum); -GLAPI void APIENTRY glDeleteProgram (GLuint); -GLAPI void APIENTRY glDeleteShader (GLuint); -GLAPI void APIENTRY glDetachShader (GLuint, GLuint); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); -GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgram (GLuint); -GLAPI GLboolean APIENTRY glIsShader (GLuint); -GLAPI void APIENTRY glLinkProgram (GLuint); -GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); -GLAPI void APIENTRY glUseProgram (GLuint); -GLAPI void APIENTRY glUniform1f (GLint, GLfloat); -GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1i (GLint, GLint); -GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glValidateProgram (GLuint); -GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI GLuint APIENTRY glCreateShader (GLenum type); +GLAPI void APIENTRY glDeleteProgram (GLuint program); +GLAPI void APIENTRY glDeleteShader (GLuint shader); +GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgram (GLuint program); +GLAPI GLboolean APIENTRY glIsShader (GLuint shader); +GLAPI void APIENTRY glLinkProgram (GLuint program); +GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +GLAPI void APIENTRY glUseProgram (GLuint program); +GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glValidateProgram (GLuint program); +GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); @@ -3659,43 +5743,278 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); #endif +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +/* OpenGL 3.0 also reuses entry points from these extensions: */ +/* ARB_framebuffer_object */ +/* ARB_map_buffer_range */ +/* ARB_vertex_array_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); +GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); +GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +#endif + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +/* OpenGL 3.1 also reuses entry points from these extensions: */ +/* ARB_copy_buffer */ +/* ARB_uniform_buffer_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); +#endif + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +/* OpenGL 3.2 also reuses entry points from these extensions: */ +/* ARB_draw_elements_base_vertex */ +/* ARB_provoking_vertex */ +/* ARB_sync */ +/* ARB_texture_multisample */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +/* OpenGL 3.3 also reuses entry points from these extensions: */ +/* ARB_blend_func_extended */ +/* ARB_sampler_objects */ +/* ARB_explicit_attrib_location, but it has none */ +/* ARB_occlusion_query2 (no entry points) */ +/* ARB_shader_bit_encoding (no entry points) */ +/* ARB_texture_rgb10_a2ui (no entry points) */ +/* ARB_texture_swizzle (no entry points) */ +/* ARB_timer_query */ +/* ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 +/* OpenGL 4.0 also reuses entry points from these extensions: */ +/* ARB_texture_query_lod (no entry points) */ +/* ARB_draw_indirect */ +/* ARB_gpu_shader5 (no entry points) */ +/* ARB_gpu_shader_fp64 */ +/* ARB_shader_subroutine */ +/* ARB_tessellation_shader */ +/* ARB_texture_buffer_object_rgb32 (no entry points) */ +/* ARB_texture_cube_map_array (no entry points) */ +/* ARB_texture_gather (no entry points) */ +/* ARB_transform_feedback2 */ +/* ARB_transform_feedback3 */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLclampf value); +GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 +/* OpenGL 4.1 also reuses entry points from these extensions: */ +/* ARB_ES2_compatibility */ +/* ARB_get_program_binary */ +/* ARB_separate_shader_objects */ +/* ARB_shader_precision (no entry points) */ +/* ARB_vertex_attrib_64bit */ +/* ARB_viewport_array */ +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); @@ -3736,10 +6055,10 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); @@ -3750,7 +6069,7 @@ typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); #ifndef GL_ARB_multisample #define GL_ARB_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); #endif @@ -3766,13 +6085,13 @@ typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean i #ifndef GL_ARB_texture_compression #define GL_ARB_texture_compression 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); @@ -3790,8 +6109,8 @@ typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint #ifndef GL_ARB_point_parameters #define GL_ARB_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); @@ -3800,16 +6119,16 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLflo #ifndef GL_ARB_vertex_blend #define GL_ARB_vertex_blend 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); -GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); -GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); -GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); -GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); -GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexBlendARB (GLint); +GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); +GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); +GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); +GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); +GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); +GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); +GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); +GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexBlendARB (GLint count); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); @@ -3826,11 +6145,11 @@ typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); #ifndef GL_ARB_matrix_palette #define GL_ARB_matrix_palette 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); @@ -3870,22 +6189,22 @@ typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type #ifndef GL_ARB_window_pos #define GL_ARB_window_pos 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); @@ -3908,68 +6227,68 @@ typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); #ifndef GL_ARB_vertex_program #define GL_ARB_vertex_program 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); @@ -4043,17 +6362,17 @@ typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); -GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); @@ -4071,14 +6390,14 @@ typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pn #ifndef GL_ARB_occlusion_query #define GL_ARB_occlusion_query 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); -GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); -GLAPI void APIENTRY glEndQueryARB (GLenum); -GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); +GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQueryARB (GLenum target); +GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); @@ -4093,45 +6412,45 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, #ifndef GL_ARB_shader_objects #define GL_ARB_shader_objects 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); -GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); -GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1iARB (GLint, GLint); -GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); @@ -4177,9 +6496,9 @@ typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei m #ifndef GL_ARB_vertex_shader #define GL_ARB_vertex_shader 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); @@ -4209,7 +6528,7 @@ typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, #ifndef GL_ARB_draw_buffers #define GL_ARB_draw_buffers 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); #endif @@ -4221,7 +6540,7 @@ typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs) #ifndef GL_ARB_color_buffer_float #define GL_ARB_color_buffer_float 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); #endif @@ -4238,68 +6557,920 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); #define GL_ARB_pixel_buffer_object 1 #endif -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 #endif -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #endif -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmap (GLenum target); +GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); #endif -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 #endif -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); #endif -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); #endif -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); #endif -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArray (GLuint array); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertex (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +#endif + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GLAPI GLboolean APIENTRY glIsSync (GLsync sync); +GLAPI void APIENTRY glDeleteSync (GLsync sync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); +typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +#endif + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +#endif + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShadingARB (GLclampf value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +#endif + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +#endif + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +#endif + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); +#endif + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); +GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); +GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +#endif + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); +GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); +GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); +GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); +GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); +GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedback (void); +GLAPI void APIENTRY glResumeTransformFeedback (void); +GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); +GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); +GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); +GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReleaseShaderCompiler (void); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f); +GLAPI void APIENTRY glClearDepthf (GLclampf d); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLclampf d); +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* *strings); +GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); +GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); +GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* *strings); +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); +#endif + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); +GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); +GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd *v); +GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f); +GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); +#endif + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); +GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); @@ -4311,16 +7482,16 @@ typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint lev #ifndef GL_EXT_histogram #define GL_EXT_histogram 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogramEXT (GLenum target); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); @@ -4337,19 +7508,19 @@ typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); #ifndef GL_EXT_convolution #define GL_EXT_convolution 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); @@ -4366,20 +7537,20 @@ typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum f typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #endif -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 #endif #ifndef GL_SGI_color_table #define GL_SGI_color_table 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); @@ -4393,7 +7564,7 @@ typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GL #ifndef GL_SGIX_pixel_texture #define GL_SGIX_pixel_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #endif @@ -4401,12 +7572,12 @@ typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); @@ -4419,8 +7590,8 @@ typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, G #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); @@ -4437,12 +7608,12 @@ typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, #ifndef GL_EXT_texture_object #define GL_EXT_texture_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); @@ -4455,8 +7626,8 @@ typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint #ifndef GL_SGIS_detail_texture #define GL_SGIS_detail_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); @@ -4465,8 +7636,8 @@ typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat * #ifndef GL_SGIS_sharpen_texture #define GL_SGIS_sharpen_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); @@ -4483,8 +7654,8 @@ typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat #ifndef GL_SGIS_multisample #define GL_SGIS_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); @@ -4497,15 +7668,15 @@ typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); #ifndef GL_EXT_vertex_array #define GL_EXT_vertex_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glArrayElementEXT (GLint i); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); @@ -4545,7 +7716,7 @@ typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLs #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); +GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #endif @@ -4573,10 +7744,10 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #ifndef GL_SGIX_sprite #define GL_SGIX_sprite 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); @@ -4591,8 +7762,8 @@ typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLi #ifndef GL_EXT_point_parameters #define GL_EXT_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); @@ -4601,8 +7772,8 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLflo #ifndef GL_SGIS_point_parameters #define GL_SGIS_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); @@ -4612,11 +7783,11 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfl #define GL_SGIX_instruments 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); @@ -4633,7 +7804,7 @@ typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); #ifndef GL_SGIX_framezoom #define GL_SGIX_framezoom 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); +GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #endif @@ -4649,10 +7820,10 @@ typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #ifndef GL_SGIX_polynomial_ffd #define GL_SGIX_polynomial_ffd 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); @@ -4663,7 +7834,7 @@ typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mas #ifndef GL_SGIX_reference_plane #define GL_SGIX_reference_plane 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); #endif @@ -4683,8 +7854,8 @@ typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); #ifndef GL_SGIS_fog_function #define GL_SGIS_fog_function 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); @@ -4697,12 +7868,12 @@ typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); #ifndef GL_HP_image_transform #define GL_HP_image_transform 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); @@ -4723,8 +7894,8 @@ typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); @@ -4737,7 +7908,7 @@ typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei s #ifndef GL_PGI_misc_hints #define GL_PGI_misc_hints 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); +GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); #endif @@ -4745,10 +7916,10 @@ typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); #ifndef GL_EXT_paletted_texture #define GL_EXT_paletted_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); @@ -4763,12 +7934,12 @@ typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GL #ifndef GL_SGIX_list_priority #define GL_SGIX_list_priority 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); +GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); +GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); @@ -4801,7 +7972,7 @@ typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname #ifndef GL_EXT_index_material #define GL_EXT_index_material 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #endif @@ -4809,7 +7980,7 @@ typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #ifndef GL_EXT_index_func #define GL_EXT_index_func 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); #endif @@ -4821,7 +7992,7 @@ typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); #ifndef GL_EXT_compiled_vertex_array #define GL_EXT_compiled_vertex_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); GLAPI void APIENTRY glUnlockArraysEXT (void); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); @@ -4831,8 +8002,8 @@ typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); #ifndef GL_EXT_cull_vertex #define GL_EXT_cull_vertex 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); @@ -4845,24 +8016,24 @@ typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *par #ifndef GL_SGIX_fragment_lighting #define GL_SGIX_fragment_lighting 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); +GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); @@ -4895,7 +8066,7 @@ typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #ifndef GL_EXT_draw_range_elements #define GL_EXT_draw_range_elements 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); #endif @@ -4911,9 +8082,9 @@ typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint star #ifndef GL_EXT_light_texture #define GL_EXT_light_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); +GLAPI void APIENTRY glTextureLightEXT (GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); @@ -4931,12 +8102,12 @@ typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); #ifndef GL_SGIX_async #define GL_SGIX_async 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); @@ -4957,10 +8128,10 @@ typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); #ifndef GL_INTEL_parallel_arrays #define GL_INTEL_parallel_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); @@ -4975,10 +8146,10 @@ typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type #ifndef GL_EXT_pixel_transform #define GL_EXT_pixel_transform 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); @@ -5001,23 +8172,23 @@ typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, G #ifndef GL_EXT_secondary_color #define GL_EXT_secondary_color 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); @@ -5041,7 +8212,7 @@ typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum t #ifndef GL_EXT_texture_perturb_normal #define GL_EXT_texture_perturb_normal 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); +GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #endif @@ -5049,21 +8220,21 @@ typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); #endif #ifndef GL_EXT_fog_coord #define GL_EXT_fog_coord 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); @@ -5079,28 +8250,28 @@ typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei strid #ifndef GL_EXT_coordinate_frame #define GL_EXT_coordinate_frame 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); +GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); +GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); @@ -5153,14 +8324,14 @@ typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); #ifndef GL_SUN_global_alpha #define GL_SUN_global_alpha 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); @@ -5175,13 +8346,13 @@ typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); #ifndef GL_SUN_triangle_list #define GL_SUN_triangle_list 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); @@ -5195,46 +8366,46 @@ typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsize #ifndef GL_SUN_vertex #define GL_SUN_vertex 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); @@ -5281,7 +8452,7 @@ typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FV #ifndef GL_EXT_blend_func_separate #define GL_EXT_blend_func_separate 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif @@ -5289,7 +8460,7 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenu #ifndef GL_INGR_blend_func_separate #define GL_INGR_blend_func_separate 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif @@ -5333,9 +8504,9 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLen #ifndef GL_EXT_vertex_weighting #define GL_EXT_vertex_weighting 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); @@ -5350,7 +8521,7 @@ typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum t #define GL_NV_vertex_array_range 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); @@ -5359,19 +8530,19 @@ typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvo #ifndef GL_NV_register_combiners #define GL_NV_register_combiners 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); @@ -5415,30 +8586,30 @@ typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); #ifndef GL_MESA_window_pos #define GL_MESA_window_pos 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); @@ -5473,8 +8644,8 @@ typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); #ifndef GL_IBM_multimode_draw_arrays #define GL_IBM_multimode_draw_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); @@ -5483,14 +8654,14 @@ typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, #ifndef GL_IBM_vertex_array_lists #define GL_IBM_vertex_array_lists 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); @@ -5529,7 +8700,7 @@ typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, #ifndef GL_3DFX_tbuffer #define GL_3DFX_tbuffer 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #endif @@ -5537,8 +8708,8 @@ typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #ifndef GL_EXT_multisample #define GL_EXT_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); +GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); @@ -5563,7 +8734,7 @@ typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #ifndef GL_SGIS_texture_color_mask #define GL_SGIS_texture_color_mask 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #endif @@ -5571,7 +8742,7 @@ typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean #ifndef GL_SGIX_igloo_interface #define GL_SGIX_igloo_interface 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); #endif @@ -5587,13 +8758,13 @@ typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid #ifndef GL_NV_fence #define GL_NV_fence 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFinishFenceNV (GLuint); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); +GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GLAPI void APIENTRY glFinishFenceNV (GLuint fence); +GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); @@ -5607,15 +8778,15 @@ typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #ifndef GL_NV_evaluators #define GL_NV_evaluators 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); -GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); @@ -5635,8 +8806,8 @@ typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); #ifndef GL_NV_register_combiners2 #define GL_NV_register_combiners2 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); @@ -5665,70 +8836,70 @@ typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, G #ifndef GL_NV_vertex_program #define GL_NV_vertex_program 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); -GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); +GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); +GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); +GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); @@ -5823,10 +8994,10 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei cou #ifndef GL_ATI_envmap_bumpmap #define GL_ATI_envmap_bumpmap 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); @@ -5837,20 +9008,20 @@ typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloa #ifndef GL_ATI_fragment_shader #define GL_ATI_fragment_shader 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); GLAPI void APIENTRY glBeginFragmentShaderATI (void); GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); +GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); @@ -5871,8 +9042,8 @@ typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, cons #ifndef GL_ATI_pn_triangles #define GL_ATI_pn_triangles 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); @@ -5881,18 +9052,18 @@ typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); #ifndef GL_ATI_vertex_array_object #define GL_ATI_vertex_array_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); -GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); @@ -5913,46 +9084,46 @@ typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBeginVertexShaderEXT (void); GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); -GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); -GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); -GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); +GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); +GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); +GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); +GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); +GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); +GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); +GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); +GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); +GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); @@ -6001,51 +9172,51 @@ typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum v #ifndef GL_ATI_vertex_streams #define GL_ATI_vertex_streams 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); +GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); +GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); @@ -6097,9 +9268,9 @@ typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat para #ifndef GL_ATI_element_array #define GL_ATI_element_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); @@ -6109,7 +9280,7 @@ typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint #ifndef GL_SUN_mesh_array #define GL_SUN_mesh_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); #endif @@ -6129,13 +9300,13 @@ typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, G #ifndef GL_NV_occlusion_query #define GL_NV_occlusion_query 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); @@ -6149,8 +9320,8 @@ typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pnam #ifndef GL_NV_point_sprite #define GL_NV_point_sprite 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); @@ -6171,7 +9342,7 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint #ifndef GL_EXT_stencil_two_side #define GL_EXT_stencil_two_side 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #endif @@ -6187,11 +9358,11 @@ typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #ifndef GL_APPLE_element_array #define GL_APPLE_element_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); @@ -6203,14 +9374,14 @@ typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, #ifndef GL_APPLE_fence #define GL_APPLE_fence 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); @@ -6225,23 +9396,23 @@ typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); #ifndef GL_APPLE_vertex_array_object #define GL_APPLE_vertex_array_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #endif #ifndef GL_APPLE_vertex_array_range #define GL_APPLE_vertex_array_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); @@ -6259,7 +9430,7 @@ typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLin #ifndef GL_ATI_draw_buffers #define GL_ATI_draw_buffers 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); #endif @@ -6287,12 +9458,12 @@ typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs) #define GL_NV_fragment_program 1 /* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); @@ -6305,52 +9476,52 @@ typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsiz #ifndef GL_NV_half_float #define GL_NV_half_float 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); @@ -6403,8 +9574,8 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, c #ifndef GL_NV_pixel_data_range #define GL_NV_pixel_data_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); @@ -6414,7 +9585,7 @@ typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); #define GL_NV_primitive_restart 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); @@ -6431,8 +9602,8 @@ typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); #ifndef GL_ATI_map_object_buffer #define GL_ATI_map_object_buffer 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); @@ -6441,8 +9612,8 @@ typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); #ifndef GL_ATI_separate_stencil #define GL_ATI_separate_stencil 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); @@ -6451,9 +9622,9 @@ typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLen #ifndef GL_ATI_vertex_attrib_array_object #define GL_ATI_vertex_attrib_array_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); @@ -6467,7 +9638,7 @@ typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); #endif @@ -6479,7 +9650,7 @@ typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); #ifndef GL_EXT_blend_equation_separate #define GL_EXT_blend_equation_separate 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); #endif @@ -6515,23 +9686,23 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLen #ifndef GL_EXT_framebuffer_object #define GL_EXT_framebuffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); @@ -6555,11 +9726,1391 @@ typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); #ifndef GL_GREMEDY_string_marker #define GL_GREMEDY_string_marker 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); #endif +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#endif + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#endif + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#endif + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +#endif + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); +GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#endif + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#endif + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); +GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); +GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); +GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +#endif + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_AMD_vertex_shader_tesselator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); +GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +#endif + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +#endif + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#endif + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); +GLAPI void APIENTRY glActiveProgramEXT (GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); +GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); +GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); +GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); +GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); +GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); +GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); +#endif + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureBarrierNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); +#endif + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +#endif + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); +GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); +GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); +GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); +#endif + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +GLAPI void APIENTRY glVDPAUFiniNV (void); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); +GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +#endif + #ifdef __cplusplus } @@ -6567,4 +11118,9 @@ typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid #endif #endif /* NO_SDL_GLEXT */ -/*@}*/ + +#endif /* !__IPHONEOS__ */ + +#endif /* _SDL_opengl_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_opengles.h b/include/SDL_opengles.h new file mode 100644 index 0000000000..00e60f5c17 --- /dev/null +++ b/include/SDL_opengles.h @@ -0,0 +1,38 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES 1.X API headers. + */ + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif diff --git a/include/SDL_opengles2.h b/include/SDL_opengles2.h new file mode 100644 index 0000000000..7697626f4a --- /dev/null +++ b/include/SDL_opengles2.h @@ -0,0 +1,38 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. + */ + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif diff --git a/include/SDL_pixels.h b/include/SDL_pixels.h new file mode 100644 index 0000000000..5e17cba53d --- /dev/null +++ b/include/SDL_pixels.h @@ -0,0 +1,427 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_pixels.h + * + * Header for the enumerated pixel format definitions. + */ + +#ifndef _SDL_pixels_h +#define _SDL_pixels_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Transparency definitions + * + * These define alpha as the opacity of a surface. + */ +/*@{*/ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/*@}*/ + +/** Pixel type. */ +enum +{ + SDL_PIXELTYPE_UNKNOWN, + SDL_PIXELTYPE_INDEX1, + SDL_PIXELTYPE_INDEX4, + SDL_PIXELTYPE_INDEX8, + SDL_PIXELTYPE_PACKED8, + SDL_PIXELTYPE_PACKED16, + SDL_PIXELTYPE_PACKED32, + SDL_PIXELTYPE_ARRAYU8, + SDL_PIXELTYPE_ARRAYU16, + SDL_PIXELTYPE_ARRAYU32, + SDL_PIXELTYPE_ARRAYF16, + SDL_PIXELTYPE_ARRAYF32 +}; + +/** Bitmap pixel order, high bit -> low bit. */ +enum +{ + SDL_BITMAPORDER_NONE, + SDL_BITMAPORDER_4321, + SDL_BITMAPORDER_1234 +}; + +/** Packed component order, high bit -> low bit. */ +enum +{ + SDL_PACKEDORDER_NONE, + SDL_PACKEDORDER_XRGB, + SDL_PACKEDORDER_RGBX, + SDL_PACKEDORDER_ARGB, + SDL_PACKEDORDER_RGBA, + SDL_PACKEDORDER_XBGR, + SDL_PACKEDORDER_BGRX, + SDL_PACKEDORDER_ABGR, + SDL_PACKEDORDER_BGRA +}; + +/** Array component order, low byte -> high byte. */ +enum +{ + SDL_ARRAYORDER_NONE, + SDL_ARRAYORDER_RGB, + SDL_ARRAYORDER_RGBA, + SDL_ARRAYORDER_ARGB, + SDL_ARRAYORDER_BGR, + SDL_ARRAYORDER_BGRA, + SDL_ARRAYORDER_ABGR +}; + +/** Packed component layout. */ +enum +{ + SDL_PACKEDLAYOUT_NONE, + SDL_PACKEDLAYOUT_332, + SDL_PACKEDLAYOUT_4444, + SDL_PACKEDLAYOUT_1555, + SDL_PACKEDLAYOUT_5551, + SDL_PACKEDLAYOUT_565, + SDL_PACKEDLAYOUT_8888, + SDL_PACKEDLAYOUT_2101010, + SDL_PACKEDLAYOUT_1010102 +}; + +#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) + +#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ + ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ + ((bits) << 8) | ((bytes) << 0)) + +#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) +#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) +#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) +#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) +#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) +#define SDL_BYTESPERPIXEL(X) \ + (SDL_ISPIXELFORMAT_FOURCC(X) ? \ + ((((X) == SDL_PIXELFORMAT_YUY2) || \ + ((X) == SDL_PIXELFORMAT_UYVY) || \ + ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) + +#define SDL_ISPIXELFORMAT_INDEXED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) + +#define SDL_ISPIXELFORMAT_ALPHA(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) + +/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ +#define SDL_ISPIXELFORMAT_FOURCC(format) \ + ((format) && (SDL_PIXELFLAG(format) != 1)) + +/* Note: If you modify this list, update SDL_GetPixelFormatName() */ +enum +{ + SDL_PIXELFORMAT_UNKNOWN, + SDL_PIXELFORMAT_INDEX1LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX1MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX4LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX4MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX8 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), + SDL_PIXELFORMAT_RGB332 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_332, 8, 1), + SDL_PIXELFORMAT_RGB444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_RGB555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_BGR555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_ARGB4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_RGBA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ABGR4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_BGRA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ARGB1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_RGBA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_ABGR1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_BGRA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_RGB565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_BGR565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_RGB24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, + 24, 3), + SDL_PIXELFORMAT_BGR24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, + 24, 3), + SDL_PIXELFORMAT_RGB888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_RGBX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGR888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGRX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_ARGB8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_RGBA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ABGR8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_BGRA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ARGB2101010 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_2101010, 32, 4), + + SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), + SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ + SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), + SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), + SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), + SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U') +}; + +typedef struct SDL_Color +{ + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 a; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette +{ + int ncolors; + SDL_Color *colors; + Uint32 version; + int refcount; +} SDL_Palette; + +/** + * \note Everything in the pixel format structure is read-only. + */ +typedef struct SDL_PixelFormat +{ + Uint32 format; + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 padding[2]; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + int refcount; + struct SDL_PixelFormat *next; +} SDL_PixelFormat; + +/** + * \brief Get the human readable name of a pixel format + */ +extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); + +/** + * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. + * + * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. + * + * \sa SDL_MasksToPixelFormatEnum() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, + int *bpp, + Uint32 * Rmask, + Uint32 * Gmask, + Uint32 * Bmask, + Uint32 * Amask); + +/** + * \brief Convert a bpp and RGBA masks to an enumerated pixel format. + * + * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion + * wasn't possible. + * + * \sa SDL_PixelFormatEnumToMasks() + */ +extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); + +/** + * \brief Create an SDL_PixelFormat structure from a pixel format enum. + */ +extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); + +/** + * \brief Free an SDL_PixelFormat structure. + */ +extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); + +/** + * \brief Create a palette structure with the specified number of color + * entries. + * + * \return A new palette, or NULL if there wasn't enough memory. + * + * \note The palette entries are initialized to white. + * + * \sa SDL_FreePalette() + */ +extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); + +/** + * \brief Set the palette for a pixel format structure. + */ +extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, + SDL_Palette *palette); + +/** + * \brief Set a range of colors in a palette. + * + * \param palette The palette to modify. + * \param colors An array of colors to copy into the palette. + * \param firstcolor The index of the first palette entry to modify. + * \param ncolors The number of entries to modify. + * + * \return 0 on success, or -1 if not all of the colors could be set. + */ +extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, + const SDL_Color * colors, + int firstcolor, int ncolors); + +/** + * \brief Free a palette created with SDL_AllocPalette(). + * + * \sa SDL_AllocPalette() + */ +extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); + +/** + * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. + * + * \sa SDL_MapRGBA + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b); + +/** + * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. + * + * \sa SDL_MapRGB + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the RGB components from a pixel of the specified format. + * + * \sa SDL_GetRGBA + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b); + +/** + * \brief Get the RGBA components from a pixel of the specified format. + * + * \sa SDL_GetRGB + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Calculate a 256 entry gamma ramp for a gamma value. + */ +extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_pixels_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_platform.h b/include/SDL_platform.h index 48540a85d4..1e8e0d9f42 100644 --- a/include/SDL_platform.h +++ b/include/SDL_platform.h @@ -1,27 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_platform.h - * Try to get a standard set of platform defines +/** + * \file SDL_platform.h + * + * Try to get a standard set of platform defines. */ #ifndef _SDL_platform_h @@ -29,82 +30,122 @@ #if defined(_AIX) #undef __AIX__ -#define __AIX__ 1 +#define __AIX__ 1 #endif #if defined(__BEOS__) #undef __BEOS__ -#define __BEOS__ 1 +#define __BEOS__ 1 #endif #if defined(__HAIKU__) #undef __HAIKU__ -#define __HAIKU__ 1 +#define __HAIKU__ 1 #endif #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) #undef __BSDI__ -#define __BSDI__ 1 +#define __BSDI__ 1 #endif #if defined(_arch_dreamcast) #undef __DREAMCAST__ -#define __DREAMCAST__ 1 +#define __DREAMCAST__ 1 #endif #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) #undef __FREEBSD__ -#define __FREEBSD__ 1 -#endif -#if defined(__HAIKU__) -#undef __HAIKU__ -#define __HAIKU__ 1 +#define __FREEBSD__ 1 #endif #if defined(hpux) || defined(__hpux) || defined(__hpux__) #undef __HPUX__ -#define __HPUX__ 1 +#define __HPUX__ 1 #endif #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) #undef __IRIX__ -#define __IRIX__ 1 +#define __IRIX__ 1 #endif #if defined(linux) || defined(__linux) || defined(__linux__) #undef __LINUX__ -#define __LINUX__ 1 +#define __LINUX__ 1 +#endif +#if defined(ANDROID) +#undef __ANDROID__ +#undef __LINUX__ /*do we need to do this?*/ +#define __ANDROID__ 1 #endif + #if defined(__APPLE__) +/* lets us know what version of Mac OS X we're compiling on */ +#include "AvailabilityMacros.h" +#include "TargetConditionals.h" +#if TARGET_OS_IPHONE +/* if compiling for iPhone */ +#undef __IPHONEOS__ +#define __IPHONEOS__ 1 #undef __MACOSX__ -#define __MACOSX__ 1 -#elif defined(macintosh) -#undef __MACOS__ -#define __MACOS__ 1 -#endif +#else +/* if not compiling for iPhone */ +#undef __MACOSX__ +#define __MACOSX__ 1 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +# error SDL for Mac OS X only supports deploying on 10.5 and above. +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +# error SDL for Mac OS X must be built with a 10.6 SDK or above. +#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ +#endif /* TARGET_OS_IPHONE */ +#endif /* defined(__APPLE__) */ + #if defined(__NetBSD__) #undef __NETBSD__ -#define __NETBSD__ 1 +#define __NETBSD__ 1 #endif #if defined(__OpenBSD__) #undef __OPENBSD__ -#define __OPENBSD__ 1 +#define __OPENBSD__ 1 #endif #if defined(__OS2__) #undef __OS2__ -#define __OS2__ 1 +#define __OS2__ 1 #endif #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) #undef __OSF__ -#define __OSF__ 1 +#define __OSF__ 1 #endif #if defined(__QNXNTO__) #undef __QNXNTO__ -#define __QNXNTO__ 1 +#define __QNXNTO__ 1 #endif #if defined(riscos) || defined(__riscos) || defined(__riscos__) #undef __RISCOS__ -#define __RISCOS__ 1 +#define __RISCOS__ 1 #endif #if defined(__SVR4) #undef __SOLARIS__ -#define __SOLARIS__ 1 +#define __SOLARIS__ 1 #endif -#if defined(WIN32) || defined(_WIN32) +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) #undef __WIN32__ -#define __WIN32__ 1 +#define __WIN32__ 1 #endif +#if defined(__PSP__) +#undef __PSP__ +#define __PSP__ 1 +#endif + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Gets the name of the platform. + */ +extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" #endif /* _SDL_platform_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_power.h b/include/SDL_power.h new file mode 100644 index 0000000000..4f70c5bb16 --- /dev/null +++ b/include/SDL_power.h @@ -0,0 +1,75 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_power_h +#define _SDL_power_h + +/** + * \file SDL_power.h + * + * Header for the SDL power management routines. + */ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The basic state for the system's power supply. + */ +typedef enum +{ + SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ + SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ + SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ + SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ + SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ +} SDL_PowerState; + + +/** + * \brief Get the current power supply details. + * + * \param secs Seconds of battery life left. You can pass a NULL here if + * you don't care. Will return -1 if we can't determine a + * value, or we're not running on a battery. + * + * \param pct Percentage of battery life left, between 0 and 100. You can + * pass a NULL here if you don't care. Will return -1 if we + * can't determine a value, or we're not running on a battery. + * + * \return The state of the battery (if any). + */ +extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_power_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_quit.h b/include/SDL_quit.h index abd2ec6c94..485e42db04 100644 --- a/include/SDL_quit.h +++ b/include/SDL_quit.h @@ -1,27 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_quit.h - * Include file for SDL quit event handling +/** + * \file SDL_quit.h + * + * Include file for SDL quit event handling. */ #ifndef _SDL_quit_h @@ -30,26 +31,28 @@ #include "SDL_stdinc.h" #include "SDL_error.h" -/** @file SDL_quit.h - * An SDL_QUITEVENT is generated when the user tries to close the application +/** + * \file SDL_quit.h + * + * An ::SDL_QUIT event is generated when the user tries to close the application * window. If it is ignored or filtered out, the window will remain open. * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will + * is allowed to close. When the window is closed, screen updates will * complete, but have no effect. * * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) * and SIGTERM (system termination request), if handlers do not already - * exist, that generate SDL_QUITEVENT events as well. There is no way - * to determine the cause of an SDL_QUITEVENT, but setting a signal + * exist, that generate ::SDL_QUIT events as well. There is no way + * to determine the cause of an ::SDL_QUIT event, but setting a signal * handler in your application will override the default generation of * quit events for that signal. + * + * \sa SDL_Quit() */ -/** @file SDL_quit.h - * There are no functions directly affecting the quit event - */ +/* There are no functions directly affecting the quit event */ #define SDL_QuitRequested() \ - (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) + (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) #endif /* _SDL_quit_h */ diff --git a/include/SDL_rect.h b/include/SDL_rect.h new file mode 100644 index 0000000000..c8af7c197a --- /dev/null +++ b/include/SDL_rect.h @@ -0,0 +1,138 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_rect.h + * + * Header file for SDL_rect definition and management functions. + */ + +#ifndef _SDL_rect_h +#define _SDL_rect_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_pixels.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a point + * + * \sa SDL_EnclosePoints + */ +typedef struct +{ + int x; + int y; +} SDL_Point; + +/** + * \brief A rectangle, with the origin at the upper left. + * + * \sa SDL_RectEmpty + * \sa SDL_RectEquals + * \sa SDL_HasIntersection + * \sa SDL_IntersectRect + * \sa SDL_UnionRect + * \sa SDL_EnclosePoints + */ +typedef struct SDL_Rect +{ + int x, y; + int w, h; +} SDL_Rect; + +/** + * \brief Returns true if the rectangle has no area. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) +{ + return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Returns true if the two rectangles are equal. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) +{ + return (a && b && (a->x == b->x) && (a->y == b->y) && + (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Determine whether two rectangles intersect. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, + const SDL_Rect * B); + +/** + * \brief Calculate the intersection of two rectangles. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate the union of two rectangles. + */ +extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate a minimal rectangle enclosing a set of points + * + * \return SDL_TRUE if any points were within the clipping rect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, + int count, + const SDL_Rect * clip, + SDL_Rect * result); + +/** + * \brief Calculate the intersection of a rectangle and line segment. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * + rect, int *X1, + int *Y1, int *X2, + int *Y2); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rect_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_render.h b/include/SDL_render.h new file mode 100644 index 0000000000..1e24619f01 --- /dev/null +++ b/include/SDL_render.h @@ -0,0 +1,845 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_render.h + * + * Header file for SDL 2D rendering functions. + * + * This API supports the following features: + * * single pixel points + * * single pixel lines + * * filled rectangles + * * texture images + * + * The primitives may be drawn in opaque, blended, or additive modes. + * + * The texture images may be drawn in opaque, blended, or additive modes. + * They can have an additional color tint or alpha modulation applied to + * them, and may also be stretched with linear interpolation. + * + * This API is designed to accelerate simple 2D operations. You may + * want more functionality such as polygons and particle effects and + * in that case you should use SDL's OpenGL/Direct3D support or one + * of the many good 3D engines. + * + * These functions must be called from the main thread. + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 + */ + +#ifndef _SDL_render_h +#define _SDL_render_h + +#include "SDL_stdinc.h" +#include "SDL_rect.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Flags used when creating a rendering context + */ +typedef enum +{ + SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ + SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware + acceleration */ + SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized + with the refresh rate */ + SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports + rendering to texture */ +} SDL_RendererFlags; + +/** + * \brief Information on the capabilities of a render driver or context. + */ +typedef struct SDL_RendererInfo +{ + const char *name; /**< The name of the renderer */ + Uint32 flags; /**< Supported ::SDL_RendererFlags */ + Uint32 num_texture_formats; /**< The number of available texture formats */ + Uint32 texture_formats[16]; /**< The available texture formats */ + int max_texture_width; /**< The maximimum texture width */ + int max_texture_height; /**< The maximimum texture height */ +} SDL_RendererInfo; + +/** + * \brief The access pattern allowed for a texture. + */ +typedef enum +{ + SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ + SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ + SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ +} SDL_TextureAccess; + +/** + * \brief The texture channel modulation used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ + SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ + SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ +} SDL_TextureModulate; + +/** + * \brief Flip constants for SDL_RenderCopyEx + */ +typedef enum +{ + SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ + SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ + SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ +} SDL_RendererFlip; + +/** + * \brief A structure representing rendering state + */ +struct SDL_Renderer; +typedef struct SDL_Renderer SDL_Renderer; + +/** + * \brief An efficient driver-specific representation of pixel data + */ +struct SDL_Texture; +typedef struct SDL_Texture SDL_Texture; + + +/* Function prototypes */ + +/** + * \brief Get the number of 2D rendering drivers available for the current + * display. + * + * A render driver is a set of code that handles rendering and texture + * management on a particular display. Normally there is only one, but + * some drivers may have several available with different capabilities. + * + * \sa SDL_GetRenderDriverInfo() + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); + +/** + * \brief Get information about a specific 2D rendering driver for the current + * display. + * + * \param index The index of the driver to query information about. + * \param info A pointer to an SDL_RendererInfo struct to be filled with + * information on the rendering driver. + * + * \return 0 on success, -1 if the index was out of range. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, + SDL_RendererInfo * info); + +/** + * \brief Create a window and default renderer + * + * \param width The width of the window + * \param height The height of the window + * \param window_flags The flags used to create the window + * \param window A pointer filled with the window, or NULL on error + * \param renderer A pointer filled with the renderer, or NULL on error + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( + int width, int height, Uint32 window_flags, + SDL_Window **window, SDL_Renderer **renderer); + + +/** + * \brief Create a 2D rendering context for a window. + * + * \param window The window where rendering is displayed. + * \param index The index of the rendering driver to initialize, or -1 to + * initialize the first one supporting the requested flags. + * \param flags ::SDL_RendererFlags. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateSoftwareRenderer() + * \sa SDL_GetRendererInfo() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, + int index, Uint32 flags); + +/** + * \brief Create a 2D software rendering context for a surface. + * + * \param surface The surface where rendering is done. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateRenderer() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); + +/** + * \brief Get the renderer associated with a window. + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); + +/** + * \brief Get information about a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, + SDL_RendererInfo * info); + +/** + * \brief Get the output size of a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, + int *w, int *h); + +/** + * \brief Create a texture for a rendering context. + * + * \param renderer The renderer. + * \param format The format of the texture. + * \param access One of the enumerated values in ::SDL_TextureAccess. + * \param w The width of the texture in pixels. + * \param h The height of the texture in pixels. + * + * \return The created texture is returned, or 0 if no rendering context was + * active, the format was unsupported, or the width or height were out + * of range. + * + * \sa SDL_QueryTexture() + * \sa SDL_UpdateTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, + Uint32 format, + int access, int w, + int h); + +/** + * \brief Create a texture from an existing surface. + * + * \param renderer The renderer. + * \param surface The surface containing pixel data used to fill the texture. + * + * \return The created texture is returned, or 0 on error. + * + * \note The surface is not modified or freed by this function. + * + * \sa SDL_QueryTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); + +/** + * \brief Query the attributes of a texture + * + * \param texture A texture to be queried. + * \param format A pointer filled in with the raw format of the texture. The + * actual format may differ, but pixel transfers will use this + * format. + * \param access A pointer filled in with the actual access to the texture. + * \param w A pointer filled in with the width of the texture in pixels. + * \param h A pointer filled in with the height of the texture in pixels. + * + * \return 0 on success, or -1 if the texture is not valid. + */ +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, + Uint32 * format, int *access, + int *w, int *h); + +/** + * \brief Set an additional color value used in render copy operations. + * + * \param texture The texture to update. + * \param r The red color value multiplied into copy operations. + * \param g The green color value multiplied into copy operations. + * \param b The blue color value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or color modulation + * is not supported. + * + * \sa SDL_GetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in render copy operations. + * + * \param texture The texture to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in render copy operations. + * + * \param texture The texture to update. + * \param alpha The alpha value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or alpha modulation + * is not supported. + * + * \sa SDL_GetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in render copy operations. + * + * \param texture The texture to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for texture copy operations. + * + * \param texture The texture to update. + * \param blendMode ::SDL_BlendMode to use for texture blending. + * + * \return 0 on success, or -1 if the texture is not valid or the blend mode is + * not supported. + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for texture copy operations. + * + * \param texture The texture to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode *blendMode); + +/** + * \brief Update the given texture rectangle with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param pixels The raw pixel data. + * \param pitch The number of bytes between rows of pixel data. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note This is a fairly slow function. + */ +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const void *pixels, int pitch); + +/** + * \brief Lock a portion of the texture for write-only pixel access. + * + * \param texture The texture to lock for access, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param rect A pointer to the rectangle to lock for access. If the rect + * is NULL, the entire texture will be locked. + * \param pixels This is filled in with a pointer to the locked pixels, + * appropriately offset by the locked area. + * \param pitch This is filled in with the pitch of the locked pixels. + * + * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. + * + * \sa SDL_UnlockTexture() + */ +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, + const SDL_Rect * rect, + void **pixels, int *pitch); + +/** + * \brief Unlock a texture, uploading the changes to video memory, if needed. + * + * \sa SDL_LockTexture() + */ +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); + +/** + * \brief Determines whether a window supports the use of render targets + * + * \param renderer The renderer that will be checked + * + * \return SDL_TRUE if supported, SDL_FALSE if not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); + +/** + * \brief Set a texture as the current rendering target. + * + * \param renderer The renderer. + * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target + * + * \return 0 on success, or -1 on error + * + * \sa SDL_GetRenderTarget() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, + SDL_Texture *texture); + +/** + * \brief Get the current render target or NULL for the default render target. + * + * \return The current render target + * + * \sa SDL_SetRenderTarget() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); + +/** + * \brief Set device independent resolution for rendering + * + * \param renderer The renderer for which resolution should be set. + * \param w The width of the logical resolution + * \param h The height of the logical resolution + * + * This function uses the viewport and scaling functionality to allow a fixed logical + * resolution for rendering, regardless of the actual output resolution. If the actual + * output resolution doesn't have the same aspect ratio the output rendering will be + * centered within the output display. + * + * If the output display is a window, mouse events in the window will be filtered + * and scaled so they seem to arrive within the logical resolution. + * + * \note If this function results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. + * + * \sa SDL_RenderGetLogicalSize() + * \sa SDL_RenderSetScale() + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); + +/** + * \brief Get device independent resolution for rendering + * + * \param renderer The renderer from which resolution should be queried. + * \param w A pointer filled with the width of the logical resolution + * \param h A pointer filled with the height of the logical resolution + * + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); + +/** + * \brief Set the drawing area for rendering on the current target. + * + * \param renderer The renderer for which the drawing area should be set. + * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. + * + * The x,y of the viewport rect represents the origin for rendering. + * + * \return 0 on success, or -1 on error + * + * \note If the window associated with the renderer is resized, the viewport is automatically reset. + * + * \sa SDL_RenderGetViewport() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the drawing area for the current target. + * + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Set the clip rectangle for the current target. + * + * \param renderer The renderer for which clip rectangle should be set. + * \param rect A pointer to the rectangle to set as the clip rectangle, or + * NULL to disable clipping. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_RenderGetClipRect() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the clip rectangle for the current target. + * + * \param renderer The renderer from which clip rectangle should be queried. + * \param rect A pointer filled in with the current clip rectangle, or + * an empty rectangle if clipping is disabled. + * + * \sa SDL_RenderSetClipRect() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Set the drawing scale for rendering on the current target. + * + * \param renderer The renderer for which the drawing scale should be set. + * \param scaleX The horizontal scaling factor + * \param scaleY The vertical scaling factor + * + * The drawing coordinates are scaled by the x/y scaling factors + * before they are used by the renderer. This allows resolution + * independent drawing with a single coordinate system. + * + * \note If this results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. For best results use integer scaling factors. + * + * \sa SDL_RenderGetScale() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, + float scaleX, float scaleY); + +/** + * \brief Get the drawing scale for the current target. + * + * \param renderer The renderer from which drawing scale should be queried. + * \param scaleX A pointer filled in with the horizontal scaling factor + * \param scaleY A pointer filled in with the vertical scaling factor + * + * \sa SDL_RenderSetScale() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, + float *scaleX, float *scaleY); + +/** + * \brief Set the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer for which drawing color should be set. + * \param r The red value used to draw on the rendering target. + * \param g The green value used to draw on the rendering target. + * \param b The blue value used to draw on the rendering target. + * \param a The alpha value used to draw on the rendering target, usually + * ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer from which drawing color should be queried. + * \param r A pointer to the red value used to draw on the rendering target. + * \param g A pointer to the green value used to draw on the rendering target. + * \param b A pointer to the blue value used to draw on the rendering target. + * \param a A pointer to the alpha value used to draw on the rendering target, + * usually ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Set the blend mode used for drawing operations (Fill and Line). + * + * \param renderer The renderer for which blend mode should be set. + * \param blendMode ::SDL_BlendMode to use for blending. + * + * \return 0 on success, or -1 on error + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for drawing operations. + * + * \param renderer The renderer from which blend mode should be queried. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_SetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode *blendMode); + +/** + * \brief Clear the current rendering target with the drawing color + * + * This function clears the entire rendering target, ignoring the viewport. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); + +/** + * \brief Draw a point on the current rendering target. + * + * \param renderer The renderer which should draw a point. + * \param x The x coordinate of the point. + * \param y The y coordinate of the point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, + int x, int y); + +/** + * \brief Draw multiple points on the current rendering target. + * + * \param renderer The renderer which should draw multiple points. + * \param points The points to draw + * \param count The number of points to draw + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a line on the current rendering target. + * + * \param renderer The renderer which should draw a line. + * \param x1 The x coordinate of the start point. + * \param y1 The y coordinate of the start point. + * \param x2 The x coordinate of the end point. + * \param y2 The y coordinate of the end point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, + int x1, int y1, int x2, int y2); + +/** + * \brief Draw a series of connected lines on the current rendering target. + * + * \param renderer The renderer which should draw multiple lines. + * \param points The points along the lines + * \param count The number of points, drawing count-1 lines + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a rectangle on the current rendering target. + * + * \param renderer The renderer which should draw a rectangle. + * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Draw some number of rectangles on the current rendering target. + * + * \param renderer The renderer which should draw multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Fill a rectangle on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill a rectangle. + * \param rect A pointer to the destination rectangle, or NULL for the entire + * rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Fill some number of rectangles on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Copy a portion of the texture to the current rendering target. + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect); + +/** + * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect + * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done aroud dstrect.w/2, dstrect.h/2) + * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect, + const double angle, + const SDL_Point *center, + const SDL_RendererFlip flip); + +/** + * \brief Read pixels from the current rendering target. + * + * \param renderer The renderer from which pixels should be read. + * \param rect A pointer to the rectangle to read, or NULL for the entire + * render target. + * \param format The desired format of the pixel data, or 0 to use the format + * of the rendering target + * \param pixels A pointer to be filled in with the pixel data + * \param pitch The pitch of the pixels parameter. + * + * \return 0 on success, or -1 if pixel reading is not supported. + * + * \warning This is a very slow operation, and should not be used frequently. + */ +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, + const SDL_Rect * rect, + Uint32 format, + void *pixels, int pitch); + +/** + * \brief Update the screen with rendering performed. + */ +extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); + +/** + * \brief Destroy the specified texture. + * + * \sa SDL_CreateTexture() + * \sa SDL_CreateTextureFromSurface() + */ +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); + +/** + * \brief Destroy the rendering context for a window and free associated + * textures. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); + + +/** + * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with + * OpenGL instructions. + * + * \param texture The SDL texture to bind + * \param texw A pointer to a float that will be filled with the texture width + * \param texh A pointer to a float that will be filled with the texture height + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); + +/** + * \brief Unbind a texture from the current OpenGL/ES/ES2 context. + * + * \param texture The SDL texture to unbind + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_render_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_revision.h b/include/SDL_revision.h new file mode 100644 index 0000000000..d70fd694ea --- /dev/null +++ b/include/SDL_revision.h @@ -0,0 +1,2 @@ +#define SDL_REVISION "hg-0:aaaaaaaaaaah" +#define SDL_REVISION_NUMBER 0 diff --git a/include/SDL_rwops.h b/include/SDL_rwops.h index 98361d7e19..0461ff7829 100644 --- a/include/SDL_rwops.h +++ b/include/SDL_rwops.h @@ -1,28 +1,29 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_rwops.h +/** + * \file SDL_rwops.h + * * This file provides a general interface for SDL to read and write - * data sources. It can easily be extended to files, memory, etc. + * data streams. It can easily be extended to files, memory, etc. */ #ifndef _SDL_rwops_h @@ -37,114 +38,188 @@ extern "C" { #endif -/** This is the read/write operation structure -- very basic */ - -typedef struct SDL_RWops { - /** Seek to 'offset' relative to whence, one of stdio's whence values: - * SEEK_SET, SEEK_CUR, SEEK_END - * Returns the final offset in the data source. - */ - int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); - - /** Read up to 'maxnum' objects each of size 'size' from the data - * source to the area pointed at by 'ptr'. - * Returns the number of objects read, or -1 if the read failed. - */ - int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); - - /** Write exactly 'num' objects each of size 'objsize' from the area - * pointed at by 'ptr' to data source. - * Returns 'num', or -1 if the write failed. - */ - int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); - - /** Close and free an allocated SDL_FSops structure */ - int (SDLCALL *close)(struct SDL_RWops *context); - - Uint32 type; - union { -#if defined(__WIN32__) && !defined(__SYMBIAN32__) - struct { - int append; - void *h; - struct { - void *data; - int size; - int left; - } buffer; - } win32io; +/* RWops Types */ +#define SDL_RWOPS_UNKNOWN 0 /* Unknown stream type */ +#define SDL_RWOPS_WINFILE 1 /* Win32 file */ +#define SDL_RWOPS_STDFILE 2 /* Stdio file */ +#define SDL_RWOPS_JNIFILE 3 /* Android asset */ +#define SDL_RWOPS_MEMORY 4 /* Memory stream */ +#define SDL_RWOPS_MEMORY_RO 5 /* Read-Only memory stream */ + +/** + * This is the read/write operation structure -- very basic. + */ +typedef struct SDL_RWops +{ + /** + * Return the size of the file in this rwops, or -1 if unknown + */ + Sint64 (SDLCALL * size) (struct SDL_RWops * context); + + /** + * Seek to \c offset relative to \c whence, one of stdio's whence values: + * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END + * + * \return the final offset in the data stream, or -1 on error. + */ + Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, + int whence); + + /** + * Read up to \c maxnum objects each of size \c size from the data + * stream to the area pointed at by \c ptr. + * + * \return the number of objects read, or 0 at error or end of file. + */ + size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, + size_t size, size_t maxnum); + + /** + * Write exactly \c num objects each of size \c size from the area + * pointed at by \c ptr to data stream. + * + * \return the number of objects written, or 0 at error or end of file. + */ + size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, + size_t size, size_t num); + + /** + * Close and free an allocated SDL_RWops structure. + * + * \return 0 if successful or -1 on write error when flushing data. + */ + int (SDLCALL * close) (struct SDL_RWops * context); + + Uint32 type; + union + { +#if defined(ANDROID) + struct + { + void *fileNameRef; + void *inputStreamRef; + void *readableByteChannelRef; + void *readMethod; + void *assetFileDescriptorRef; + long position; + long size; + long offset; + int fd; + } androidio; +#elif defined(__WIN32__) + struct + { + SDL_bool append; + void *h; + struct + { + void *data; + size_t size; + size_t left; + } buffer; + } windowsio; #endif -#ifdef HAVE_STDIO_H - struct { - int autoclose; - FILE *fp; - } stdio; + +#ifdef HAVE_STDIO_H + struct + { + SDL_bool autoclose; + FILE *fp; + } stdio; #endif - struct { - Uint8 *base; - Uint8 *here; - Uint8 *stop; - } mem; - struct { - void *data1; - } unknown; - } hidden; + struct + { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct + { + void *data1; + void *data2; + } unknown; + } hidden; } SDL_RWops; -/** @name Functions to create SDL_RWops structures from various data sources */ +/** + * \name RWFrom functions + * + * Functions to create SDL_RWops structures from various data streams. + */ /*@{*/ -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, + const char *mode); #ifdef HAVE_STDIO_H -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, + SDL_bool autoclose); +#else +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, + SDL_bool autoclose); #endif -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); -extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, + int size); -extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); -extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); +/*@}*//*RWFrom functions*/ -/*@}*/ -/** @name Seek Reference Points */ -/*@{*/ -#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ -#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ -#define RW_SEEK_END 2 /**< Seek relative to the end of data */ -/*@}*/ +extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); -/** @name Macros to easily read and write from an SDL_RWops structure */ +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ + +/** + * \name Read/write macros + * + * Macros to easily read and write from an SDL_RWops structure. + */ /*@{*/ -#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) -#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) -#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) -#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) -#define SDL_RWclose(ctx) (ctx)->close(ctx) -/*@}*/ - -/** @name Read an item of the specified endianness and return in native format */ +#define SDL_RWsize(ctx) (ctx)->size(ctx) +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/*@}*//*Read/write macros*/ + + +/** + * \name Read endian functions + * + * Read an item of the specified endianness and return in native format. + */ /*@{*/ -extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src); -extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src); -extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src); -extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); -/*@}*/ - -/** @name Write an item of native format to the specified endianness */ +extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); +/*@}*//*Read endian functions*/ + +/** + * \name Write endian functions + * + * Write an item of native format to the specified endianness. + */ /*@{*/ -extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value); -extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value); -extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value); -extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); -/*@}*/ +extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); +/*@}*//*Write endian functions*/ + /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -153,3 +228,5 @@ extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); #include "close_code.h" #endif /* _SDL_rwops_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_scancode.h b/include/SDL_scancode.h new file mode 100644 index 0000000000..d3f8748116 --- /dev/null +++ b/include/SDL_scancode.h @@ -0,0 +1,401 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_scancode.h + * + * Defines keyboard scancodes. + */ + +#ifndef _SDL_scancode_h +#define _SDL_scancode_h + +#include "SDL_stdinc.h" + +/** + * \brief The SDL keyboard scancode representation. + * + * Values of this type are used to represent keyboard keys, among other places + * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the + * SDL_Event structure. + * + * The values in this enumeration are based on the USB usage page standard: + * http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf + */ +typedef enum +{ + SDL_SCANCODE_UNKNOWN = 0, + + /** + * \name Usage page 0x07 + * + * These values are from usage page 0x07 (USB keyboard page). + */ + /*@{*/ + + SDL_SCANCODE_A = 4, + SDL_SCANCODE_B = 5, + SDL_SCANCODE_C = 6, + SDL_SCANCODE_D = 7, + SDL_SCANCODE_E = 8, + SDL_SCANCODE_F = 9, + SDL_SCANCODE_G = 10, + SDL_SCANCODE_H = 11, + SDL_SCANCODE_I = 12, + SDL_SCANCODE_J = 13, + SDL_SCANCODE_K = 14, + SDL_SCANCODE_L = 15, + SDL_SCANCODE_M = 16, + SDL_SCANCODE_N = 17, + SDL_SCANCODE_O = 18, + SDL_SCANCODE_P = 19, + SDL_SCANCODE_Q = 20, + SDL_SCANCODE_R = 21, + SDL_SCANCODE_S = 22, + SDL_SCANCODE_T = 23, + SDL_SCANCODE_U = 24, + SDL_SCANCODE_V = 25, + SDL_SCANCODE_W = 26, + SDL_SCANCODE_X = 27, + SDL_SCANCODE_Y = 28, + SDL_SCANCODE_Z = 29, + + SDL_SCANCODE_1 = 30, + SDL_SCANCODE_2 = 31, + SDL_SCANCODE_3 = 32, + SDL_SCANCODE_4 = 33, + SDL_SCANCODE_5 = 34, + SDL_SCANCODE_6 = 35, + SDL_SCANCODE_7 = 36, + SDL_SCANCODE_8 = 37, + SDL_SCANCODE_9 = 38, + SDL_SCANCODE_0 = 39, + + SDL_SCANCODE_RETURN = 40, + SDL_SCANCODE_ESCAPE = 41, + SDL_SCANCODE_BACKSPACE = 42, + SDL_SCANCODE_TAB = 43, + SDL_SCANCODE_SPACE = 44, + + SDL_SCANCODE_MINUS = 45, + SDL_SCANCODE_EQUALS = 46, + SDL_SCANCODE_LEFTBRACKET = 47, + SDL_SCANCODE_RIGHTBRACKET = 48, + SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return + * key on ISO keyboards and at the right end + * of the QWERTY row on ANSI keyboards. + * Produces REVERSE SOLIDUS (backslash) and + * VERTICAL LINE in a US layout, REVERSE + * SOLIDUS and VERTICAL LINE in a UK Mac + * layout, NUMBER SIGN and TILDE in a UK + * Windows layout, DOLLAR SIGN and POUND SIGN + * in a Swiss German layout, NUMBER SIGN and + * APOSTROPHE in a German layout, GRAVE + * ACCENT and POUND SIGN in a French Mac + * layout, and ASTERISK and MICRO SIGN in a + * French Windows layout. + */ + SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code + * instead of 49 for the same key, but all + * OSes I've seen treat the two codes + * identically. So, as an implementor, unless + * your keyboard generates both of those + * codes and your OS treats them differently, + * you should generate SDL_SCANCODE_BACKSLASH + * instead of this code. As a user, you + * should not rely on this code because SDL + * will never generate it with most (all?) + * keyboards. + */ + SDL_SCANCODE_SEMICOLON = 51, + SDL_SCANCODE_APOSTROPHE = 52, + SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI + * and ISO keyboards). Produces GRAVE ACCENT and + * TILDE in a US Windows layout and in US and UK + * Mac layouts on ANSI keyboards, GRAVE ACCENT + * and NOT SIGN in a UK Windows layout, SECTION + * SIGN and PLUS-MINUS SIGN in US and UK Mac + * layouts on ISO keyboards, SECTION SIGN and + * DEGREE SIGN in a Swiss German layout (Mac: + * only on ISO keyboards), CIRCUMFLEX ACCENT and + * DEGREE SIGN in a German layout (Mac: only on + * ISO keyboards), SUPERSCRIPT TWO and TILDE in a + * French Windows layout, COMMERCIAL AT and + * NUMBER SIGN in a French Mac layout on ISO + * keyboards, and LESS-THAN SIGN and GREATER-THAN + * SIGN in a Swiss German, German, or French Mac + * layout on ANSI keyboards. + */ + SDL_SCANCODE_COMMA = 54, + SDL_SCANCODE_PERIOD = 55, + SDL_SCANCODE_SLASH = 56, + + SDL_SCANCODE_CAPSLOCK = 57, + + SDL_SCANCODE_F1 = 58, + SDL_SCANCODE_F2 = 59, + SDL_SCANCODE_F3 = 60, + SDL_SCANCODE_F4 = 61, + SDL_SCANCODE_F5 = 62, + SDL_SCANCODE_F6 = 63, + SDL_SCANCODE_F7 = 64, + SDL_SCANCODE_F8 = 65, + SDL_SCANCODE_F9 = 66, + SDL_SCANCODE_F10 = 67, + SDL_SCANCODE_F11 = 68, + SDL_SCANCODE_F12 = 69, + + SDL_SCANCODE_PRINTSCREEN = 70, + SDL_SCANCODE_SCROLLLOCK = 71, + SDL_SCANCODE_PAUSE = 72, + SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but + does send code 73, not 117) */ + SDL_SCANCODE_HOME = 74, + SDL_SCANCODE_PAGEUP = 75, + SDL_SCANCODE_DELETE = 76, + SDL_SCANCODE_END = 77, + SDL_SCANCODE_PAGEDOWN = 78, + SDL_SCANCODE_RIGHT = 79, + SDL_SCANCODE_LEFT = 80, + SDL_SCANCODE_DOWN = 81, + SDL_SCANCODE_UP = 82, + + SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards + */ + SDL_SCANCODE_KP_DIVIDE = 84, + SDL_SCANCODE_KP_MULTIPLY = 85, + SDL_SCANCODE_KP_MINUS = 86, + SDL_SCANCODE_KP_PLUS = 87, + SDL_SCANCODE_KP_ENTER = 88, + SDL_SCANCODE_KP_1 = 89, + SDL_SCANCODE_KP_2 = 90, + SDL_SCANCODE_KP_3 = 91, + SDL_SCANCODE_KP_4 = 92, + SDL_SCANCODE_KP_5 = 93, + SDL_SCANCODE_KP_6 = 94, + SDL_SCANCODE_KP_7 = 95, + SDL_SCANCODE_KP_8 = 96, + SDL_SCANCODE_KP_9 = 97, + SDL_SCANCODE_KP_0 = 98, + SDL_SCANCODE_KP_PERIOD = 99, + + SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO + * keyboards have over ANSI ones, + * located between left shift and Y. + * Produces GRAVE ACCENT and TILDE in a + * US or UK Mac layout, REVERSE SOLIDUS + * (backslash) and VERTICAL LINE in a + * US or UK Windows layout, and + * LESS-THAN SIGN and GREATER-THAN SIGN + * in a Swiss German, German, or French + * layout. */ + SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ + SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, + * not a physical key - but some Mac keyboards + * do have a power key. */ + SDL_SCANCODE_KP_EQUALS = 103, + SDL_SCANCODE_F13 = 104, + SDL_SCANCODE_F14 = 105, + SDL_SCANCODE_F15 = 106, + SDL_SCANCODE_F16 = 107, + SDL_SCANCODE_F17 = 108, + SDL_SCANCODE_F18 = 109, + SDL_SCANCODE_F19 = 110, + SDL_SCANCODE_F20 = 111, + SDL_SCANCODE_F21 = 112, + SDL_SCANCODE_F22 = 113, + SDL_SCANCODE_F23 = 114, + SDL_SCANCODE_F24 = 115, + SDL_SCANCODE_EXECUTE = 116, + SDL_SCANCODE_HELP = 117, + SDL_SCANCODE_MENU = 118, + SDL_SCANCODE_SELECT = 119, + SDL_SCANCODE_STOP = 120, + SDL_SCANCODE_AGAIN = 121, /**< redo */ + SDL_SCANCODE_UNDO = 122, + SDL_SCANCODE_CUT = 123, + SDL_SCANCODE_COPY = 124, + SDL_SCANCODE_PASTE = 125, + SDL_SCANCODE_FIND = 126, + SDL_SCANCODE_MUTE = 127, + SDL_SCANCODE_VOLUMEUP = 128, + SDL_SCANCODE_VOLUMEDOWN = 129, +/* not sure whether there's a reason to enable these */ +/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ +/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ +/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ + SDL_SCANCODE_KP_COMMA = 133, + SDL_SCANCODE_KP_EQUALSAS400 = 134, + + SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see + footnotes in USB doc */ + SDL_SCANCODE_INTERNATIONAL2 = 136, + SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ + SDL_SCANCODE_INTERNATIONAL4 = 138, + SDL_SCANCODE_INTERNATIONAL5 = 139, + SDL_SCANCODE_INTERNATIONAL6 = 140, + SDL_SCANCODE_INTERNATIONAL7 = 141, + SDL_SCANCODE_INTERNATIONAL8 = 142, + SDL_SCANCODE_INTERNATIONAL9 = 143, + SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ + SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ + SDL_SCANCODE_LANG3 = 146, /**< Katakana */ + SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ + SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ + SDL_SCANCODE_LANG6 = 149, /**< reserved */ + SDL_SCANCODE_LANG7 = 150, /**< reserved */ + SDL_SCANCODE_LANG8 = 151, /**< reserved */ + SDL_SCANCODE_LANG9 = 152, /**< reserved */ + + SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ + SDL_SCANCODE_SYSREQ = 154, + SDL_SCANCODE_CANCEL = 155, + SDL_SCANCODE_CLEAR = 156, + SDL_SCANCODE_PRIOR = 157, + SDL_SCANCODE_RETURN2 = 158, + SDL_SCANCODE_SEPARATOR = 159, + SDL_SCANCODE_OUT = 160, + SDL_SCANCODE_OPER = 161, + SDL_SCANCODE_CLEARAGAIN = 162, + SDL_SCANCODE_CRSEL = 163, + SDL_SCANCODE_EXSEL = 164, + + SDL_SCANCODE_KP_00 = 176, + SDL_SCANCODE_KP_000 = 177, + SDL_SCANCODE_THOUSANDSSEPARATOR = 178, + SDL_SCANCODE_DECIMALSEPARATOR = 179, + SDL_SCANCODE_CURRENCYUNIT = 180, + SDL_SCANCODE_CURRENCYSUBUNIT = 181, + SDL_SCANCODE_KP_LEFTPAREN = 182, + SDL_SCANCODE_KP_RIGHTPAREN = 183, + SDL_SCANCODE_KP_LEFTBRACE = 184, + SDL_SCANCODE_KP_RIGHTBRACE = 185, + SDL_SCANCODE_KP_TAB = 186, + SDL_SCANCODE_KP_BACKSPACE = 187, + SDL_SCANCODE_KP_A = 188, + SDL_SCANCODE_KP_B = 189, + SDL_SCANCODE_KP_C = 190, + SDL_SCANCODE_KP_D = 191, + SDL_SCANCODE_KP_E = 192, + SDL_SCANCODE_KP_F = 193, + SDL_SCANCODE_KP_XOR = 194, + SDL_SCANCODE_KP_POWER = 195, + SDL_SCANCODE_KP_PERCENT = 196, + SDL_SCANCODE_KP_LESS = 197, + SDL_SCANCODE_KP_GREATER = 198, + SDL_SCANCODE_KP_AMPERSAND = 199, + SDL_SCANCODE_KP_DBLAMPERSAND = 200, + SDL_SCANCODE_KP_VERTICALBAR = 201, + SDL_SCANCODE_KP_DBLVERTICALBAR = 202, + SDL_SCANCODE_KP_COLON = 203, + SDL_SCANCODE_KP_HASH = 204, + SDL_SCANCODE_KP_SPACE = 205, + SDL_SCANCODE_KP_AT = 206, + SDL_SCANCODE_KP_EXCLAM = 207, + SDL_SCANCODE_KP_MEMSTORE = 208, + SDL_SCANCODE_KP_MEMRECALL = 209, + SDL_SCANCODE_KP_MEMCLEAR = 210, + SDL_SCANCODE_KP_MEMADD = 211, + SDL_SCANCODE_KP_MEMSUBTRACT = 212, + SDL_SCANCODE_KP_MEMMULTIPLY = 213, + SDL_SCANCODE_KP_MEMDIVIDE = 214, + SDL_SCANCODE_KP_PLUSMINUS = 215, + SDL_SCANCODE_KP_CLEAR = 216, + SDL_SCANCODE_KP_CLEARENTRY = 217, + SDL_SCANCODE_KP_BINARY = 218, + SDL_SCANCODE_KP_OCTAL = 219, + SDL_SCANCODE_KP_DECIMAL = 220, + SDL_SCANCODE_KP_HEXADECIMAL = 221, + + SDL_SCANCODE_LCTRL = 224, + SDL_SCANCODE_LSHIFT = 225, + SDL_SCANCODE_LALT = 226, /**< alt, option */ + SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ + SDL_SCANCODE_RCTRL = 228, + SDL_SCANCODE_RSHIFT = 229, + SDL_SCANCODE_RALT = 230, /**< alt gr, option */ + SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ + + SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered + * by any of the above, but since there's a + * special KMOD_MODE for it I'm adding it here + */ + + /*@}*//*Usage page 0x07*/ + + /** + * \name Usage page 0x0C + * + * These values are mapped from usage page 0x0C (USB consumer page). + */ + /*@{*/ + + SDL_SCANCODE_AUDIONEXT = 258, + SDL_SCANCODE_AUDIOPREV = 259, + SDL_SCANCODE_AUDIOSTOP = 260, + SDL_SCANCODE_AUDIOPLAY = 261, + SDL_SCANCODE_AUDIOMUTE = 262, + SDL_SCANCODE_MEDIASELECT = 263, + SDL_SCANCODE_WWW = 264, + SDL_SCANCODE_MAIL = 265, + SDL_SCANCODE_CALCULATOR = 266, + SDL_SCANCODE_COMPUTER = 267, + SDL_SCANCODE_AC_SEARCH = 268, + SDL_SCANCODE_AC_HOME = 269, + SDL_SCANCODE_AC_BACK = 270, + SDL_SCANCODE_AC_FORWARD = 271, + SDL_SCANCODE_AC_STOP = 272, + SDL_SCANCODE_AC_REFRESH = 273, + SDL_SCANCODE_AC_BOOKMARKS = 274, + + /*@}*//*Usage page 0x0C*/ + + /** + * \name Walther keys + * + * These are values that Christian Walther added (for mac keyboard?). + */ + /*@{*/ + + SDL_SCANCODE_BRIGHTNESSDOWN = 275, + SDL_SCANCODE_BRIGHTNESSUP = 276, + SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display + switch, video mode switch */ + SDL_SCANCODE_KBDILLUMTOGGLE = 278, + SDL_SCANCODE_KBDILLUMDOWN = 279, + SDL_SCANCODE_KBDILLUMUP = 280, + SDL_SCANCODE_EJECT = 281, + SDL_SCANCODE_SLEEP = 282, + + SDL_SCANCODE_APP1 = 283, + SDL_SCANCODE_APP2 = 284, + + /*@}*//*Walther keys*/ + + /* Add any other keys here. */ + + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes + for array bounds */ +} SDL_Scancode; + +#endif /* _SDL_scancode_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_shape.h b/include/SDL_shape.h new file mode 100644 index 0000000000..63f850c942 --- /dev/null +++ b/include/SDL_shape.h @@ -0,0 +1,143 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_shape_h +#define _SDL_shape_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file SDL_shape.h + * + * Header file for the shaped window API. + */ + +#define SDL_NONSHAPEABLE_WINDOW -1 +#define SDL_INVALID_SHAPE_ARGUMENT -2 +#define SDL_WINDOW_LACKS_SHAPE -3 + +/** + * \brief Create a window that can be shaped with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: + * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, + * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, + * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. + * + * \return The window created, or NULL if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); + +/** + * \brief Return whether the given window is a shaped window. + * + * \param window The window to query for being shaped. + * + * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. + * \sa SDL_CreateShapedWindow + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); + +/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ +typedef enum { + /** \brief The default mode, a binarized alpha cutoff of 1. */ + ShapeModeDefault, + /** \brief A binarized alpha cutoff with a given integer value. */ + ShapeModeBinarizeAlpha, + /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ + ShapeModeReverseBinarizeAlpha, + /** \brief A color key is applied. */ + ShapeModeColorKey +} WindowShapeMode; + +#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) + +/** \brief A union containing parameters for shaped windows. */ +typedef union { + /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */ + Uint8 binarizationCutoff; + SDL_Color colorKey; +} SDL_WindowShapeParams; + +/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ +typedef struct SDL_WindowShapeMode { + /** \brief The mode of these window-shape parameters. */ + WindowShapeMode mode; + /** \brief Window-shape parameters. */ + SDL_WindowShapeParams parameters; +} SDL_WindowShapeMode; + +/** + * \brief Set the shape and parameters of a shaped window. + * + * \param window The shaped window whose parameters should be set. + * \param shape A surface encoding the desired shape for the window. + * \param shape_mode The parameters to set for the shaped window. + * + * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW + * if the SDL_Window* given does not reference a valid shaped window. + * + * \sa SDL_WindowShapeMode + * \sa SDL_GetShapedWindowMode. + */ +extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); + +/** + * \brief Get the shape parameters of a shaped window. + * + * \param window The shaped window whose parameters should be retrieved. + * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. + * + * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode + * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if + * the SDL_Window* given is a shapeable window currently lacking a shape. + * + * \sa SDL_WindowShapeMode + * \sa SDL_SetWindowShape + */ +extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_shape_h */ diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 35a4fdde59..7fa9c1049f 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -1,27 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_stdinc.h - * This is a general header that includes C language support +/** + * \file SDL_stdinc.h + * + * This is a general header that includes C language support. */ #ifndef _SDL_stdinc_h @@ -29,7 +30,6 @@ #include "SDL_config.h" - #ifdef HAVE_SYS_TYPES_H #include #endif @@ -70,58 +70,96 @@ #ifdef HAVE_CTYPE_H # include #endif +#ifdef HAVE_MATH_H +# include +#endif #if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) # include #endif -/** The number of elements in an array */ -#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) -#define SDL_TABLESIZE(table) SDL_arraysize(table) - -/* Use proper C++ casts when compiled as C++ to be compatible with the option - -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ +/** + * The number of elements in an array. + */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/** + * \name Cast operators + * + * Use proper C++ casts when compiled as C++ to be compatible with the option + * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). + */ +/*@{*/ #ifdef __cplusplus #define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) #define SDL_static_cast(type, expression) static_cast(expression) +#define SDL_const_cast(type, expression) const_cast(expression) #else #define SDL_reinterpret_cast(type, expression) ((type)(expression)) #define SDL_static_cast(type, expression) ((type)(expression)) +#define SDL_const_cast(type, expression) ((type)(expression)) #endif +/*@}*//*Cast operators*/ + +/* Define a four character code as a Uint32 */ +#define SDL_FOURCC(A, B, C, D) \ + ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) -/** @name Basic data types */ +/** + * \name Basic data types + */ /*@{*/ -typedef enum { - SDL_FALSE = 0, - SDL_TRUE = 1 + +typedef enum +{ + SDL_FALSE = 0, + SDL_TRUE = 1 } SDL_bool; -typedef int8_t Sint8; -typedef uint8_t Uint8; -typedef int16_t Sint16; -typedef uint16_t Uint16; -typedef int32_t Sint32; -typedef uint32_t Uint32; - -#ifdef SDL_HAS_64BIT_TYPE -typedef int64_t Sint64; -#ifndef SYMBIAN32_GCCE -typedef uint64_t Uint64; -#endif -#else -/* This is really just a hack to prevent the compiler from complaining */ -typedef struct { - Uint32 hi; - Uint32 lo; -} Uint64, Sint64; -#endif +/** + * \brief A signed 8-bit integer type. + */ +typedef int8_t Sint8; +/** + * \brief An unsigned 8-bit integer type. + */ +typedef uint8_t Uint8; +/** + * \brief A signed 16-bit integer type. + */ +typedef int16_t Sint16; +/** + * \brief An unsigned 16-bit integer type. + */ +typedef uint16_t Uint16; +/** + * \brief A signed 32-bit integer type. + */ +typedef int32_t Sint32; +/** + * \brief An unsigned 32-bit integer type. + */ +typedef uint32_t Uint32; + +/** + * \brief A signed 64-bit integer type. + */ +typedef int64_t Sint64; +/** + * \brief An unsigned 64-bit integer type. + */ +typedef uint64_t Uint64; + +/*@}*//*Basic data types*/ -/*@}*/ -/** @name Make sure the types really have the right sizes */ -/*@{*/ #define SDL_COMPILE_TIME_ASSERT(name, x) \ typedef int SDL_dummy_ ## name[(x) * 2 - 1] - +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); @@ -130,27 +168,28 @@ SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); -/*@}*/ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ -/** @name Enum Size Check - * Check to make sure enums are the size of ints, for structure packing. - * For both Watcom C/C++ and Borland C/C++ the compiler option that makes - * enums having the size of an int must be enabled. - * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). - */ -/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ -#ifdef __MWERKS__ -#pragma enumsalwaysint on -#endif +/* Check to make sure enums are the size of ints, for structure packing. + For both Watcom C/C++ and Borland C/C++ the compiler option that makes + enums having the size of an int must be enabled. + This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). +*/ -typedef enum { - DUMMY_ENUM_VALUE +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +#if !defined(__ANDROID__) + /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ +typedef enum +{ + DUMMY_ENUM_VALUE } SDL_DUMMY_ENUM; -#ifndef __NDS__ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); #endif -/*@}*/ +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -158,30 +197,6 @@ SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); extern "C" { #endif -#ifdef HAVE_MALLOC -#define SDL_malloc malloc -#else -extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); -#endif - -#ifdef HAVE_CALLOC -#define SDL_calloc calloc -#else -extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); -#endif - -#ifdef HAVE_REALLOC -#define SDL_realloc realloc -#else -extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); -#endif - -#ifdef HAVE_FREE -#define SDL_free free -#else -extern DECLSPEC void SDLCALL SDL_free(void *mem); -#endif - #if defined(HAVE_ALLOCA) && !defined(alloca) # if defined(HAVE_ALLOCA_H) # include @@ -197,11 +212,11 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem); # elif defined(__DMC__) # include # elif defined(__AIX__) - #pragma alloca +#pragma alloca # elif defined(__MRC__) - void *alloca (unsigned); +void *alloca(unsigned); # else - char *alloca (); +char *alloca(); # endif #endif #ifdef HAVE_ALLOCA @@ -212,404 +227,159 @@ extern DECLSPEC void SDLCALL SDL_free(void *mem); #define SDL_stack_free(data) SDL_free(data) #endif -#ifdef HAVE_GETENV -#define SDL_getenv getenv -#else -extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); -#endif +extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); +extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); +extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); +extern DECLSPEC void SDLCALL SDL_free(void *mem); -#ifdef HAVE_PUTENV -#define SDL_putenv putenv -#else -extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); -#endif +extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); +extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); -#ifdef HAVE_QSORT -#define SDL_qsort qsort -#else -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)); -#endif +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); -#ifdef HAVE_ABS -#define SDL_abs abs -#else -#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) -#endif +extern DECLSPEC int SDLCALL SDL_abs(int x); -#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) -#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) +/* !!! FIXME: these have side effects. You probably shouldn't use them. */ +/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) -#ifdef HAVE_CTYPE_H -#define SDL_isdigit(X) isdigit(X) -#define SDL_isspace(X) isspace(X) -#define SDL_toupper(X) toupper(X) -#define SDL_tolower(X) tolower(X) -#else -#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) -#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) -#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) -#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) -#endif +extern DECLSPEC int SDLCALL SDL_isdigit(int x); +extern DECLSPEC int SDLCALL SDL_isspace(int x); +extern DECLSPEC int SDLCALL SDL_toupper(int x); +extern DECLSPEC int SDLCALL SDL_tolower(int x); -#ifdef HAVE_MEMSET -#define SDL_memset memset -#else -extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); -#endif +extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len); -#if defined(__GNUC__) && defined(i386) -#define SDL_memset4(dst, val, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; stosl\n\t" \ - : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ - : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memset4 -#define SDL_memset4(dst, val, len) \ -do { \ - unsigned _count = (len); \ - unsigned _n = (_count + 3) / 4; \ - Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ - Uint32 _val = (val); \ - if (len == 0) break; \ - switch (_count % 4) { \ - case 0: do { *_p++ = _val; \ - case 3: *_p++ = _val; \ - case 2: *_p++ = _val; \ - case 1: *_p++ = _val; \ - } while ( --_n ); \ - } \ -} while(0) -#endif +#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) +#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl\n\t" \ - "testb $2,%b4\n\t" \ - "je 1f\n\t" \ - "movsw\n" \ - "1:\ttestb $1,%b4\n\t" \ - "je 2f\n\t" \ - "movsb\n" \ - "2:" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy -#ifdef HAVE_MEMCPY -#define SDL_memcpy memcpy -#elif defined(HAVE_BCOPY) -#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) -#else -extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); -#endif +/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ +SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t dwords) +{ +#if defined(__GNUC__) && defined(i386) + int u0, u1, u2; + __asm__ __volatile__ ( + "cld \n\t" + "rep ; stosl \n\t" + : "=&D" (u0), "=&a" (u1), "=&c" (u2) + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) + : "memory" + ); +#else + size_t _n = (dwords + 3) / 4; + Uint32 *_p = SDL_static_cast(Uint32 *, dst); + Uint32 _val = (val); + if (dwords == 0) + return; + switch (dwords % 4) + { + case 0: do { *_p++ = _val; + case 3: *_p++ = _val; + case 2: *_p++ = _val; + case 1: *_p++ = _val; + } while ( --_n ); + } #endif +} -/* We can count on memcpy existing on Mac OS X and being well-tuned. */ -#if defined(__MACH__) && defined(__APPLE__) -#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) -#elif defined(__GNUC__) && defined(i386) -#define SDL_memcpy4(dst, src, len) \ -do { \ - int ecx, edi, esi; \ - __asm__ __volatile__ ( \ - "cld\n\t" \ - "rep ; movsl" \ - : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ - : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ - : "memory" ); \ -} while(0) -#endif -#ifndef SDL_memcpy4 -#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) -#endif -#if defined(__GNUC__) && defined(i386) -#define SDL_revcpy(dst, src, len) \ -do { \ - int u0, u1, u2; \ - char *dstp = SDL_static_cast(char *, dst); \ - char *srcp = SDL_static_cast(char *, src); \ - int n = (len); \ - if ( n >= 4 ) { \ - __asm__ __volatile__ ( \ - "std\n\t" \ - "rep ; movsl\n\t" \ - "cld\n\t" \ - : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ - : "0" (n >> 2), \ - "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ - : "memory" ); \ - } \ - switch (n & 3) { \ - case 3: dstp[2] = srcp[2]; \ - case 2: dstp[1] = srcp[1]; \ - case 1: dstp[0] = srcp[0]; \ - break; \ - default: \ - break; \ - } \ -} while(0) -#endif -#ifndef SDL_revcpy -extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); -#endif +extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); -#ifdef HAVE_MEMMOVE -#define SDL_memmove memmove -#elif defined(HAVE_BCOPY) -#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) -#else -#define SDL_memmove(dst, src, len) \ -do { \ - if ( dst < src ) { \ - SDL_memcpy(dst, src, len); \ - } else { \ - SDL_revcpy(dst, src, len); \ - } \ -} while(0) -#endif +SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t dwords) +{ + return SDL_memcpy(dst, src, dwords * 4); +} -#ifdef HAVE_MEMCMP -#define SDL_memcmp memcmp -#else +extern DECLSPEC void *SDLCALL SDL_memmove(void *dst, const void *src, size_t len); extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); -#endif -#ifdef HAVE_STRLEN -#define SDL_strlen strlen -#else -extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); -#endif +extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); +extern DECLSPEC size_t SDLCALL SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen); -#ifdef HAVE_STRLCPY -#define SDL_strlcpy strlcpy -#else +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); -#endif - -#ifdef HAVE_STRLCAT -#define SDL_strlcat strlcat -#else +extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes); extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); -#endif - -#ifdef HAVE_STRDUP -#define SDL_strdup strdup -#else -extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); -#endif +extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); +extern DECLSPEC char *SDLCALL SDL_strrev(char *str); +extern DECLSPEC char *SDLCALL SDL_strupr(char *str); +extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); +extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); + +extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); + +extern DECLSPEC int SDLCALL SDL_atoi(const char *str); +extern DECLSPEC double SDLCALL SDL_atof(const char *str); +extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); +extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); -#ifdef HAVE__STRREV -#define SDL_strrev _strrev -#else -extern DECLSPEC char * SDLCALL SDL_strrev(char *string); -#endif - -#ifdef HAVE__STRUPR -#define SDL_strupr _strupr -#else -extern DECLSPEC char * SDLCALL SDL_strupr(char *string); -#endif - -#ifdef HAVE__STRLWR -#define SDL_strlwr _strlwr -#else -extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); -#endif - -#ifdef HAVE_STRCHR -#define SDL_strchr strchr -#elif defined(HAVE_INDEX) -#define SDL_strchr index -#else -extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); -#endif - -#ifdef HAVE_STRRCHR -#define SDL_strrchr strrchr -#elif defined(HAVE_RINDEX) -#define SDL_strrchr rindex -#else -extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); -#endif - -#ifdef HAVE_STRSTR -#define SDL_strstr strstr -#else -extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); -#endif - -#ifdef HAVE_ITOA -#define SDL_itoa itoa -#else -#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) -#endif - -#ifdef HAVE__LTOA -#define SDL_ltoa _ltoa -#else -extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); -#endif - -#ifdef HAVE__UITOA -#define SDL_uitoa _uitoa -#else -#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) -#endif - -#ifdef HAVE__ULTOA -#define SDL_ultoa _ultoa -#else -extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); -#endif - -#ifdef HAVE_STRTOL -#define SDL_strtol strtol -#else -extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); -#endif - -#ifdef HAVE_STRTOUL -#define SDL_strtoul strtoul -#else -extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); -#endif - -#ifdef SDL_HAS_64BIT_TYPE - -#ifdef HAVE__I64TOA -#define SDL_lltoa _i64toa -#else -extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); -#endif - -#ifdef HAVE__UI64TOA -#define SDL_ulltoa _ui64toa -#else -extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); -#endif - -#ifdef HAVE_STRTOLL -#define SDL_strtoll strtoll -#else -extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); -#endif - -#ifdef HAVE_STRTOULL -#define SDL_strtoull strtoull -#else -extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); -#endif - -#endif /* SDL_HAS_64BIT_TYPE */ - -#ifdef HAVE_STRTOD -#define SDL_strtod strtod -#else -extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); -#endif - -#ifdef HAVE_ATOI -#define SDL_atoi atoi -#else -#define SDL_atoi(X) SDL_strtol(X, NULL, 0) -#endif - -#ifdef HAVE_ATOF -#define SDL_atof atof -#else -#define SDL_atof(X) SDL_strtod(X, NULL) -#endif - -#ifdef HAVE_STRCMP -#define SDL_strcmp strcmp -#else extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); -#endif - -#ifdef HAVE_STRNCMP -#define SDL_strncmp strncmp -#else extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); -#endif - -#ifdef HAVE_STRCASECMP -#define SDL_strcasecmp strcasecmp -#elif defined(HAVE__STRICMP) -#define SDL_strcasecmp _stricmp -#else extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); -#endif - -#ifdef HAVE_STRNCASECMP -#define SDL_strncasecmp strncasecmp -#elif defined(HAVE__STRNICMP) -#define SDL_strncasecmp _strnicmp -#else -extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); -#endif +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); -#ifdef HAVE_SSCANF -#define SDL_sscanf sscanf -#else extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); -#endif - -#ifdef HAVE_SNPRINTF -#define SDL_snprintf snprintf -#else extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); -#endif - -#ifdef HAVE_VSNPRINTF -#define SDL_vsnprintf vsnprintf -#else extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); -#endif - -/** @name SDL_ICONV Error Codes - * The SDL implementation of iconv() returns these error codes - */ -/*@{*/ -#define SDL_ICONV_ERROR (size_t)-1 -#define SDL_ICONV_E2BIG (size_t)-2 -#define SDL_ICONV_EILSEQ (size_t)-3 -#define SDL_ICONV_EINVAL (size_t)-4 -/*@}*/ -#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -#define SDL_iconv_t iconv_t -#define SDL_iconv_open iconv_open -#define SDL_iconv_close iconv_close -#else +#ifndef HAVE_M_PI +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#endif +#endif + +extern DECLSPEC double SDLCALL SDL_atan(double x); +extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); +extern DECLSPEC double SDLCALL SDL_ceil(double x); +extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); +extern DECLSPEC double SDLCALL SDL_cos(double x); +extern DECLSPEC float SDLCALL SDL_cosf(float x); +extern DECLSPEC double SDLCALL SDL_fabs(double x); +extern DECLSPEC double SDLCALL SDL_floor(double x); +extern DECLSPEC double SDLCALL SDL_log(double x); +extern DECLSPEC double SDLCALL SDL_pow(double x, double y); +extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); +extern DECLSPEC double SDLCALL SDL_sin(double x); +extern DECLSPEC float SDLCALL SDL_sinf(float x); +extern DECLSPEC double SDLCALL SDL_sqrt(double x); + +/* The SDL implementation of iconv() returns these error codes */ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 + +/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ typedef struct _SDL_iconv_t *SDL_iconv_t; -extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, + const char *fromcode); extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); -#endif -extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); -/** This function converts a string between encodings in one pass, returning a +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, + size_t * inbytesleft, char **outbuf, + size_t * outbytesleft); +/** + * This function converts a string between encodings in one pass, returning a * string that must be freed with SDL_free() or NULL on error. */ -extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); -#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) +extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, + const char *fromcode, + const char *inbuf, + size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -618,3 +388,5 @@ extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char * #include "close_code.h" #endif /* _SDL_stdinc_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_surface.h b/include/SDL_surface.h new file mode 100644 index 0000000000..fece797437 --- /dev/null +++ b/include/SDL_surface.h @@ -0,0 +1,503 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_surface.h + * + * Header file for ::SDL_Surface definition and management functions. + */ + +#ifndef _SDL_surface_h +#define _SDL_surface_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_blendmode.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Surface flags + * + * These are the currently supported flags for the ::SDL_Surface. + * + * \internal + * Used internally (read-only). + */ +/*@{*/ +#define SDL_SWSURFACE 0 /**< Just here for compatibility */ +#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ +#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ +#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ +/*@}*//*Surface flags*/ + +/** + * Evaluates to true if the surface needs to be locked before access. + */ +#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) + +/** + * \brief A collection of pixels used in software blitting. + * + * \note This structure should be treated as read-only, except for \c pixels, + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface +{ + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + int pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + + /** Application data associated with the surface */ + void *userdata; /**< Read-write */ + + /** information needed for surfaces requiring locks */ + int locked; /**< Read-only */ + void *lock_data; /**< Read-only */ + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** + * \brief The type of function used for surface blitting functions. + */ +typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, + struct SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * Allocate and free an RGB surface. + * + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * + * If the function runs out of memory, it will return NULL. + * + * \param flags The \c flags are obsolete and should be set to 0. + * \param width The width in pixels of the surface to create. + * \param height The height in pixels of the surface to create. + * \param depth The depth in bits of the surface to create. + * \param Rmask The red mask of the surface to create. + * \param Gmask The green mask of the surface to create. + * \param Bmask The blue mask of the surface to create. + * \param Amask The alpha mask of the surface to create. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, + int height, + int depth, + int pitch, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); + +/** + * \brief Set the palette used by a surface. + * + * \return 0, or -1 if the surface format doesn't use a palette. + * + * \note A single palette can be shared with many surfaces. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, + SDL_Palette * palette); + +/** + * \brief Sets up a surface for directly accessing the pixels. + * + * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write + * to and read from \c surface->pixels, using the pixel format stored in + * \c surface->format. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + * + * \sa SDL_UnlockSurface() + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); +/** \sa SDL_LockSurface() */ +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); + +/** + * Load a surface from a seekable SDL data stream (memory or file). + * + * If \c freesrc is non-zero, the stream will be closed after being read. + * + * The new surface should be freed with SDL_FreeSurface(). + * + * \return the new surface, or NULL if there was an error. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, + int freesrc); + +/** + * Load a surface from a file. + * + * Convenience macro. + */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data stream (memory or file). + * + * If \c freedst is non-zero, the stream will be closed after being written. + * + * \return 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface * surface, SDL_RWops * dst, int freedst); + +/** + * Save a surface to a file. + * + * Convenience macro. + */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * \brief Sets the RLE acceleration hint for a surface. + * + * \return 0 on success, or -1 if the surface is not valid + * + * \note If RLE is enabled, colorkey and alpha blending blits are much faster, + * but the surface must be locked before directly accessing the pixels. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, + int flag); + +/** + * \brief Sets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param flag Non-zero to enable colorkey and 0 to disable colorkey + * \param key The transparent pixel in the native surface format + * + * \return 0 on success, or -1 if the surface is not valid + * + * You can pass SDL_RLEACCEL to enable RLE accelerated blits. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, + int flag, Uint32 key); + +/** + * \brief Gets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param key A pointer filled in with the transparent pixel in the native + * surface format + * + * \return 0 on success, or -1 if the surface is not valid or colorkey is not + * enabled. + */ +extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, + Uint32 * key); + +/** + * \brief Set an additional color value used in blit operations. + * + * \param surface The surface to update. + * \param r The red color value multiplied into blit operations. + * \param g The green color value multiplied into blit operations. + * \param b The blue color value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in blit operations. + * + * \param surface The surface to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in blit operations. + * + * \param surface The surface to update. + * \param alpha The alpha value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in blit operations. + * + * \param surface The surface to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for blit operations. + * + * \param surface The surface to update. + * \param blendMode ::SDL_BlendMode to use for blit blending. + * + * \return 0 on success, or -1 if the parameters are not valid. + * + * \sa SDL_GetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for blit operations. + * + * \param surface The surface to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode *blendMode); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, + const SDL_Rect * rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * + * \c rect must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, + SDL_Rect * rect); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface + (SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags); +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat + (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); + +/** + * \brief Copy a block of pixels of one format to another format + * + * \return 0 on success, or -1 if there was an error + */ +extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, + Uint32 src_format, + const void * src, int src_pitch, + Uint32 dst_format, + void * dst, int dst_pitch); + +/** + * Performs a fast fill of the given rectangle with \c color. + * + * If \c rect is NULL, the whole surface will be filled with \c color. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); +extern DECLSPEC int SDLCALL SDL_FillRects + (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); + +/** + * Performs a fast blit from the source surface to the destination surface. + * + * This assumes that the source and destination rectangles are + * the same size. If either \c srcrect or \c dstrect are NULL, the entire + * surface (\c src or \c dst) is copied. The final blit rectangles are saved + * in \c srcrect and \c dstrect after all clipping is performed. + * + * \return If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without blending and colorkey + * are defined as follows: + * \verbatim + RGBA->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB, set destination alpha to source per-surface alpha value. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + + RGBA->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + \endverbatim + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** + * This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * \brief Perform a fast, low quality, stretch blit between two surfaces of the + * same pixel format. + * + * \note This function uses a static buffer, and is not thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, + const SDL_Rect * srcrect, + SDL_Surface * dst, + const SDL_Rect * dstrect); + +#define SDL_BlitScaled SDL_UpperBlitScaled + +/** + * This is the public scaled blit function, SDL_BlitScaled(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlitScaled() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlitScaled + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * scaled blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlitScaled + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_surface_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_system.h b/include/SDL_system.h new file mode 100644 index 0000000000..26e9eaa0a9 --- /dev/null +++ b/include/SDL_system.h @@ -0,0 +1,105 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_system.h + * + * Include file for platform specific SDL API functions + */ + +#ifndef _SDL_system_h +#define _SDL_system_h + +#include "SDL_stdinc.h" + +#if defined(__IPHONEOS__) && __IPHONEOS__ +#include "SDL_video.h" +#include "SDL_keyboard.h" +#endif + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Platform specific functions for iOS */ +#if defined(__IPHONEOS__) && __IPHONEOS__ + +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); + +#endif /* __IPHONEOS__ */ + + +/* Platform specific functions for Android */ +#if defined(__ANDROID__) && __ANDROID__ + +/* Get the JNI environment for the current thread + This returns JNIEnv*, but the prototype is void* so we don't need jni.h + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(); + +/* Get the SDL Activity object for the application + This returns jobject, but the prototype is void* so we don't need jni.h + The jobject returned by SDL_AndroidGetActivity is a local reference. + It is the caller's responsibility to properly release it + (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(); + +/* See the official Android developer guide for more information: + http://developer.android.com/guide/topics/data/data-storage.html +*/ +#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 +#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 + +/* Get the path used for internal storage for this application. + This path is unique to your application and cannot be written to + by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(); + +/* Get the current state of external storage, a bitmask of these values: + SDL_ANDROID_EXTERNAL_STORAGE_READ + SDL_ANDROID_EXTERNAL_STORAGE_WRITE + If external storage is currently unavailable, this will return 0. +*/ +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(); + +/* Get the path used for external storage for this application. + This path is unique to your application, but is public and can be + written to by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(); + +#endif /* __ANDROID__ */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_system_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 78433c6aa4..5e4454f86e 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -1,27 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_syswm.h - * Include file for SDL custom system window manager hooks +/** + * \file SDL_syswm.h + * + * Include file for SDL custom system window manager hooks. */ #ifndef _SDL_syswm_h @@ -29,6 +30,7 @@ #include "SDL_stdinc.h" #include "SDL_error.h" +#include "SDL_video.h" #include "SDL_version.h" #include "begin_code.h" @@ -37,17 +39,23 @@ extern "C" { #endif -/** @file SDL_syswm.h - * Your application has access to a special type of event 'SDL_SYSWMEVENT', +/** + * \file SDL_syswm.h + * + * Your application has access to a special type of event ::SDL_SYSWMEVENT, * which contains window-manager specific information and arrives whenever * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState() + * you can enable it with SDL_EventState(). */ #ifdef SDL_PROTOTYPES_ONLY struct SDL_SysWMinfo; -typedef struct SDL_SysWMinfo SDL_SysWMinfo; #else +#if defined(SDL_VIDEO_DRIVER_WINDOWS) +#define WIN32_LEAN_AND_MEAN +#include +#endif + /* This is the structure for custom window manager events */ #if defined(SDL_VIDEO_DRIVER_X11) #if defined(__APPLE__) && defined(__MACH__) @@ -63,158 +71,159 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo; #undef Cursor #endif -/** These are the various supported subsystems under UNIX */ -typedef enum { - SDL_SYSWM_X11 -} SDL_SYSWM_TYPE; - -/** The UNIX custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union { - XEvent xevent; - } event; -}; +#endif /* defined(SDL_VIDEO_DRIVER_X11) */ -/** The UNIX custom window manager information structure. - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. - */ -typedef struct SDL_SysWMinfo { - SDL_version version; - SDL_SYSWM_TYPE subsystem; - union { - struct { - Display *display; /**< The X11 display */ - Window window; /**< The X11 display window */ - /** These locking functions should be called around - * any X11 functions using the display variable, - * but not the gfxdisplay variable. - * They lock the event thread, so should not be - * called around event functions or from event filters. - */ - /*@{*/ - void (*lock_func)(void); - void (*unlock_func)(void); - /*@}*/ - - /** @name Introduced in SDL 1.0.2 */ - /*@{*/ - Window fswindow; /**< The X11 fullscreen window */ - Window wmwindow; /**< The X11 managed input window */ - /*@}*/ - - /** @name Introduced in SDL 1.2.12 */ - /*@{*/ - Display *gfxdisplay; /**< The X11 display to which rendering is done */ - /*@}*/ - } x11; - } info; -} SDL_SysWMinfo; - -#elif defined(SDL_VIDEO_DRIVER_NANOX) -#include - -/** The generic custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; -}; - -/** The windows custom window manager information structure */ -typedef struct SDL_SysWMinfo { - SDL_version version ; - GR_WINDOW_ID window ; /* The display window */ -} SDL_SysWMinfo; - -#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) -#define WIN32_LEAN_AND_MEAN -#include - -/** The windows custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - HWND hwnd; /**< The window for the message */ - UINT msg; /**< The type of message */ - WPARAM wParam; /**< WORD message parameter */ - LPARAM lParam; /**< LONG message parameter */ -}; +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) +#include +#endif -/** The windows custom window manager information structure */ -typedef struct SDL_SysWMinfo { - SDL_version version; - HWND window; /**< The Win32 display window */ - HGLRC hglrc; /**< The OpenGL context, if any */ -} SDL_SysWMinfo; +#if defined(SDL_VIDEO_DRIVER_COCOA) +#ifdef __OBJC__ +#include +#else +typedef struct _NSWindow NSWindow; +#endif +#endif -#elif defined(SDL_VIDEO_DRIVER_RISCOS) +#if defined(SDL_VIDEO_DRIVER_UIKIT) +#ifdef __OBJC__ +#include +#else +typedef struct _UIWindow UIWindow; +#endif +#endif -/** RISC OS custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int eventCode; /**< The window for the message */ - int pollBlock[64]; -}; +/** + * These are the various supported windowing subsystems + */ +typedef enum +{ + SDL_SYSWM_UNKNOWN, + SDL_SYSWM_WINDOWS, + SDL_SYSWM_X11, + SDL_SYSWM_DIRECTFB, + SDL_SYSWM_COCOA, + SDL_SYSWM_UIKIT, +} SDL_SYSWM_TYPE; -/** The RISC OS custom window manager information structure */ -typedef struct SDL_SysWMinfo { - SDL_version version; - int wimpVersion; /**< Wimp version running under */ - int taskHandle; /**< The RISC OS task handle */ - int window; /**< The RISC OS display window */ -} SDL_SysWMinfo; - -#elif defined(SDL_VIDEO_DRIVER_PHOTON) -#include -#include - -/** The QNX custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; +/** + * The custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct { + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct { + XEvent event; + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct { + DFBEvent event; + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { + /* No Cocoa window events yet */ + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { + /* No UIKit window events yet */ + } uikit; +#endif + /* Can't have an empty union */ + int dummy; + } msg; }; -/** The QNX custom window manager information structure */ -typedef struct SDL_SysWMinfo { - SDL_version version; - int data; -} SDL_SysWMinfo; - -#else - -/** The generic custom event structure */ -struct SDL_SysWMmsg { - SDL_version version; - int data; +/** + * The custom window manager information structure. + * + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct + { + HWND window; /**< The window handle */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct + { + Display *display; /**< The X11 display */ + Window window; /**< The X11 window */ + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct + { + IDirectFB *dfb; /**< The directfb main interface */ + IDirectFBWindow *window; /**< The directfb window handle */ + IDirectFBSurface *surface; /**< The directfb client surface */ + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { + NSWindow *window; /* The Cocoa window */ + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { + UIWindow *window; /* The UIKit window */ + } uikit; +#endif + /* Can't have an empty union */ + int dummy; + } info; }; -/** The generic custom window manager information structure */ -typedef struct SDL_SysWMinfo { - SDL_version version; - int data; -} SDL_SysWMinfo; - -#endif /* video driver type */ - #endif /* SDL_PROTOTYPES_ONLY */ +typedef struct SDL_SysWMinfo SDL_SysWMinfo; + /* Function prototypes */ /** - * This function gives you custom hooks into the window manager information. - * It fills the structure pointed to by 'info' with custom information and - * returns 0 if the function is not implemented, 1 if the function is - * implemented and no error occurred, and -1 if the version member of - * the 'info' structure is not filled in or not supported. + * \brief This function allows access to driver-dependent window information. + * + * \param window The window about which information is being requested + * \param info This structure must be initialized with the SDL version, and is + * then filled in with information about the given window. * - * You typically use this function like this: - * @code - * SDL_SysWMinfo info; - * SDL_VERSION(&info.version); - * if ( SDL_GetWMInfo(&info) ) { ... } - * @endcode + * \return SDL_TRUE if the function is implemented and the version member of + * the \c info struct is valid, SDL_FALSE otherwise. + * + * You typically use this function like this: + * \code + * SDL_SysWMinfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } + * \endcode */ -extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, + SDL_SysWMinfo * info); /* Ends C function definitions when using C++ */ @@ -224,3 +233,5 @@ extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); #include "close_code.h" #endif /* _SDL_syswm_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test.h b/include/SDL_test.h new file mode 100644 index 0000000000..7e0de08948 --- /dev/null +++ b/include/SDL_test.h @@ -0,0 +1,68 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef _SDL_test_h +#define _SDL_test_h + +#include "SDL.h" +#include "SDL_test_common.h" +#include "SDL_test_font.h" +#include "SDL_test_random.h" +#include "SDL_test_fuzzer.h" +#include "SDL_test_crc32.h" +#include "SDL_test_md5.h" +#include "SDL_test_log.h" +#include "SDL_test_assert.h" +#include "SDL_test_harness.h" +#include "SDL_test_images.h" +#include "SDL_test_compare.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Global definitions */ + +/* + * Note: Maximum size of SDLTest log message is less than SDLs limit + * to ensure we can fit additional information such as the timestamp. + */ +#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_assert.h b/include/SDL_test_assert.h new file mode 100644 index 0000000000..beba16f5ed --- /dev/null +++ b/include/SDL_test_assert.h @@ -0,0 +1,105 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_assert.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Assert API for test code and test cases + * + */ + +#ifndef _SDL_test_assert_h +#define _SDL_test_assert_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Fails the assert. + */ +#define ASSERT_FAIL 0 + +/** + * \brief Passes the assert. + */ +#define ASSERT_PASS 1 + +/** + * \brief Assert that logs and break execution flow on failures. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_Assert(int assertCondition, const char *assertDescription, ...); + +/** + * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + * + * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired. + */ +int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...); + +/** + * \brief Explicitely pass without checking an assertion condition. Updates assertion counter. + * + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_AssertPass(const char *assertDescription, ...); + +/** + * \brief Resets the assert summary counters to zero. + */ +void SDLTest_ResetAssertSummary(); + +/** + * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. + */ +void SDLTest_LogAssertSummary(); + + +/** + * \brief Converts the current assert summary state to a test result. + * + * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT + */ +int SDLTest_AssertSummaryToTestResult(); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_assert_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_common.h b/include/SDL_test_common.h new file mode 100644 index 0000000000..f07acf7c15 --- /dev/null +++ b/include/SDL_test_common.h @@ -0,0 +1,186 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_common.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* Ported from original test\common.h file. */ + +#ifndef _SDL_test_common_h +#define _SDL_test_common_h + +#include "SDL.h" + +#if defined(__PSP__) +#define DEFAULT_WINDOW_WIDTH 480 +#define DEFAULT_WINDOW_HEIGHT 272 +#else +#define DEFAULT_WINDOW_WIDTH 640 +#define DEFAULT_WINDOW_HEIGHT 480 +#endif + +#define VERBOSE_VIDEO 0x00000001 +#define VERBOSE_MODES 0x00000002 +#define VERBOSE_RENDER 0x00000004 +#define VERBOSE_EVENT 0x00000008 +#define VERBOSE_AUDIO 0x00000010 + +typedef struct +{ + /* SDL init flags */ + char **argv; + Uint32 flags; + Uint32 verbose; + + /* Video info */ + const char *videodriver; + int display; + const char *window_title; + const char *window_icon; + Uint32 window_flags; + int window_x; + int window_y; + int window_w; + int window_h; + int window_minW; + int window_minH; + int window_maxW; + int window_maxH; + int logical_w; + int logical_h; + float scale; + int depth; + int refresh_rate; + int num_windows; + SDL_Window **windows; + + /* Renderer info */ + const char *renderdriver; + Uint32 render_flags; + SDL_bool skip_renderer; + SDL_Renderer **renderers; + + /* Audio info */ + const char *audiodriver; + SDL_AudioSpec audiospec; + + /* GL settings */ + int gl_red_size; + int gl_green_size; + int gl_blue_size; + int gl_alpha_size; + int gl_buffer_size; + int gl_depth_size; + int gl_stencil_size; + int gl_double_buffer; + int gl_accum_red_size; + int gl_accum_green_size; + int gl_accum_blue_size; + int gl_accum_alpha_size; + int gl_stereo; + int gl_multisamplebuffers; + int gl_multisamplesamples; + int gl_retained_backing; + int gl_accelerated; + int gl_major_version; + int gl_minor_version; + int gl_debug; +} SDLTest_CommonState; + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Parse command line parameters and create common state. + * + * \param argv Array of command line parameters + * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO) + * + * \returns Returns a newly allocated common state object. + */ +SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); + +/** + * \brief Process one common argument. + * + * \param state The common state describing the test window to create. + * \param index The index of the argument to process in argv[]. + * + * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error. + */ +int SDLTest_CommonArg(SDLTest_CommonState * state, int index); + +/** + * \brief Returns common usage information + * + * \param state The common state describing the test window to create. + * + * \returns String with usage information + */ +const char *SDLTest_CommonUsage(SDLTest_CommonState * state); + +/** + * \brief Open test window. + * + * \param state The common state describing the test window to create. + * + * \returns True if initialization succeeded, false otherwise + */ +SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); + +/** + * \brief Common event handler for test windows. + * + * \param state The common state used to create test window. + * \param event The event to handle. + * \param done Flag indicating we are done. + * + */ +void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done); + +/** + * \brief Close test window. + * + * \param state The common state used to create test window. + * + */ +void SDLTest_CommonQuit(SDLTest_CommonState * state); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_common_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_compare.h b/include/SDL_test_compare.h new file mode 100644 index 0000000000..98ca8ce81e --- /dev/null +++ b/include/SDL_test_compare.h @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_compare.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines comparison functions (i.e. for surfaces). + +*/ + +#ifndef _SDL_test_compare_h +#define _SDL_test_compare_h + +#include "SDL.h" + +#include "SDL_test_images.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Compares a surface and with reference image data for equality + * + * \param surface Surface used in comparison + * \param referenceSurface Test Surface used in comparison + * \param allowable_error Allowable difference (squared) in blending accuracy. + * + * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. + */ +int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_compare_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_crc32.h b/include/SDL_test_crc32.h new file mode 100644 index 0000000000..f0a84a48c2 --- /dev/null +++ b/include/SDL_test_crc32.h @@ -0,0 +1,124 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_crc32.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Implements CRC32 calculations (default output is Perl String::CRC32 compatible). + +*/ + +#ifndef _SDL_test_crc32_h +#define _SDL_test_crc32_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* ------------ Definitions --------- */ + +/* Definition shared by all CRC routines */ + +#ifndef CrcUint32 + #define CrcUint32 unsigned int +#endif +#ifndef CrcUint8 + #define CrcUint8 unsigned char +#endif + +#ifdef ORIGINAL_METHOD + #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ +#else + #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ +#endif + +/** + * Data structure for CRC32 (checksum) computation + */ + typedef struct { + CrcUint32 crc32_table[256]; /* CRC table */ + } SDLTest_Crc32Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * /brief Initialize the CRC context + * + * Note: The function initializes the crc table required for all crc calculations. + * + * /param crcContext pointer to context variable + * + * /returns 0 for OK, -1 on error + * + */ + int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); + + +/** + * /brief calculate a crc32 from a data block + * + * /param crcContext pointer to context variable + * /param inBuf input buffer to checksum + * /param inLen length of input buffer + * /param crc32 pointer to Uint32 to store the final CRC into + * + * /returns 0 for OK, -1 on error + * + */ +int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + +/* Same routine broken down into three steps */ +int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + + +/** + * /brief clean up CRC context + * + * /param crcContext pointer to context variable + * + * /returns 0 for OK, -1 on error + * +*/ + +int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_crc32_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_font.h b/include/SDL_test_font.h new file mode 100644 index 0000000000..aa9286b4aa --- /dev/null +++ b/include/SDL_test_font.h @@ -0,0 +1,62 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_font.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef _SDL_test_font_h +#define _SDL_test_font_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Draw a string in the currently set font. + * + * \param renderer The renderer to draw on. + * \param x The X coordinate of the upper left corner of the string. + * \param y The Y coordinate of the upper left corner of the string. + * \param s The string to draw. + * + * \returns Returns 0 on success, -1 on failure. + */ +int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_font_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_fuzzer.h b/include/SDL_test_fuzzer.h new file mode 100644 index 0000000000..a528ddc5e2 --- /dev/null +++ b/include/SDL_test_fuzzer.h @@ -0,0 +1,384 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_fuzzer.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Data generators for fuzzing test data in a reproducible way. + +*/ + +#ifndef _SDL_test_fuzzer_h +#define _SDL_test_fuzzer_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* + Based on GSOC code by Markus Kauppila +*/ + + +/** + * \file + * Note: The fuzzer implementation uses a static instance of random context + * internally which makes it thread-UNsafe. + */ + +/** + * Initializes the fuzzer for a test + * + * /param execKey Execution "Key" that initializes the random number generator uniquely for the test. + * + */ +void SDLTest_FuzzerInit(Uint64 execKey); + + +/** + * Returns a random Uint8 + * + * \returns Generated integer + */ +Uint8 SDLTest_RandomUint8(); + +/** + * Returns a random Sint8 + * + * \returns Generated signed integer + */ +Sint8 SDLTest_RandomSint8(); + + +/** + * Returns a random Uint16 + * + * \returns Generated integer + */ +Uint16 SDLTest_RandomUint16(); + +/** + * Returns a random Sint16 + * + * \returns Generated signed integer + */ +Sint16 SDLTest_RandomSint16(); + + +/** + * Returns a random integer + * + * \returns Generated integer + */ +Sint32 SDLTest_RandomSint32(); + + +/** + * Returns a random positive integer + * + * \returns Generated integer + */ +Uint32 SDLTest_RandomUint32(); + +/** + * Returns random Uint64. + * + * \returns Generated integer + */ +Uint64 SDLTest_RandomUint64(); + + +/** + * Returns random Sint64. + * + * \returns Generated signed integer + */ +Sint64 SDLTest_RandomSint64(); + +/** + * \returns random float in range [0.0 - 1.0[ + */ +float SDLTest_RandomUnitFloat(); + +/** + * \returns random double in range [0.0 - 1.0[ + */ +double SDLTest_RandomUnitDouble(); + +/** + * \returns random float. + * + */ +float SDLTest_RandomFloat(); + +/** + * \returns random double. + * + */ +double SDLTest_RandomDouble(); + +/** + * Returns a random boundary value for Uint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100 + * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT8_MIN with error set + */ +Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); + + +/** + * Returns a random boundary value for Sint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100 + * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT16_MIN with error set + */ +Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100 + * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT32_MIN with error set + */ +Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100 + * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT64_MIN with error set + */ +Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); + + +/** + * Returns integer in range [min, max] (inclusive). + * Min and max values can be negative values. + * If Max in smaller tham min, then the values are swapped. + * Min and max are the same value, that value will be returned. + * + * \param min Minimum inclusive value of returned random number + * \param max Maximum inclusive value of returned random number + * + * \returns Generated random integer in range + */ +Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); + + +/** + * Generates random null-terminated string. The minimum length for + * the string is 1 character, maximum length for the string is 255 + * characters and it can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiString(); + + +/** + * Generates random null-terminated string. The maximum length for + * the string is defined by the maxLength parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param maxLength The maximum length of the generated string. + * + * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); + + +/** + * Generates random null-terminated string. The length for + * the string is defined by the size parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param size The length of the generated string + * + * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringOfSize(int size); + +/** + * Returns the invocation count for the fuzzer since last ...FuzzerInit. + */ +int SDLTest_GetFuzzerInvocationCount(); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_fuzzer_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_harness.h b/include/SDL_test_harness.h new file mode 100644 index 0000000000..d2da04f1ed --- /dev/null +++ b/include/SDL_test_harness.h @@ -0,0 +1,123 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_harness.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + Defines types for test case definitions and the test execution harness API. + + Based on original GSOC code by Markus Kauppila +*/ + +#ifndef _SDL_test_harness_h +#define _SDL_test_harness_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +//! Definitions for test case structures +#define TEST_ENABLED 1 +#define TEST_DISABLED 0 + +//! Definition of all the possible test return values of the test case method +#define TEST_ABORTED -1 +#define TEST_STARTED 0 +#define TEST_COMPLETED 1 +#define TEST_SKIPPED 2 + +//! Definition of all the possible test results for the harness +#define TEST_RESULT_PASSED 0 +#define TEST_RESULT_FAILED 1 +#define TEST_RESULT_NO_ASSERT 2 +#define TEST_RESULT_SKIPPED 3 +#define TEST_RESULT_SETUP_FAILURE 4 + +//!< Function pointer to a test case setup function (run before every test) +typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); + +//!< Function pointer to a test case function +typedef int (*SDLTest_TestCaseFp)(void *arg); + +//!< Function pointer to a test case teardown function (run after every test) +typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); + +/** + * Holds information about a single test case. + */ +typedef struct SDLTest_TestCaseReference { + /*!< Func2Stress */ + SDLTest_TestCaseFp testCase; + /*!< Short name (or function name) "Func2Stress" */ + char *name; + /*!< Long name or full description "This test pushes func2() to the limit." */ + char *description; + /*!< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ + int enabled; +} SDLTest_TestCaseReference; + +/** + * Holds information about a test suite (multiple test cases). + */ +typedef struct SDLTest_TestSuiteReference { + /*!< "PlatformSuite" */ + char *name; + /*!< The function that is run before each test. NULL skips. */ + SDLTest_TestCaseSetUpFp testSetUp; + /*!< The test cases that are run as part of the suite. Last item should be NULL. */ + const SDLTest_TestCaseReference **testCases; + /*!< The function that is run after each test. NULL skips. */ + SDLTest_TestCaseTearDownFp testTearDown; +} SDLTest_TestSuiteReference; + + +/** + * \brief Execute a test suite using the given run seed and execution key. + * + * \param testSuites Suites containing the test case. + * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. + * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. + * \param filter Filter specification. NULL disables. Case sensitive. + * \param testIterations Number of iterations to run each test case. + * + * \returns Test run result; 0 when all tests passed, 1 if any tests failed. + */ +int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_harness_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_images.h b/include/SDL_test_images.h new file mode 100644 index 0000000000..21cf39ff7f --- /dev/null +++ b/include/SDL_test_images.h @@ -0,0 +1,78 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_images.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines some images for tests. + +*/ + +#ifndef _SDL_test_images_h +#define _SDL_test_images_h + +#include "SDL.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + *Type for test images. + */ +typedef struct SDLTest_SurfaceImage_s { + int width; + int height; + unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ + const char *pixel_data; +} SDLTest_SurfaceImage_t; + +/* Test images */ +SDL_Surface *SDLTest_ImageBlit(); +SDL_Surface *SDLTest_ImageBlitColor(); +SDL_Surface *SDLTest_ImageBlitAlpha(); +SDL_Surface *SDLTest_ImageBlitBlendAdd(); +SDL_Surface *SDLTest_ImageBlitBlend(); +SDL_Surface *SDLTest_ImageBlitBlendMod(); +SDL_Surface *SDLTest_ImageBlitBlendNone(); +SDL_Surface *SDLTest_ImageBlitBlendAll(); +SDL_Surface *SDLTest_ImageFace(); +SDL_Surface *SDLTest_ImagePrimitives(); +SDL_Surface *SDLTest_ImagePrimitivesBlend(); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_images_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_log.h b/include/SDL_test_log.h new file mode 100644 index 0000000000..a581d2e754 --- /dev/null +++ b/include/SDL_test_log.h @@ -0,0 +1,67 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_log.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Wrapper to log in the TEST category + * + */ + +#ifndef _SDL_test_log_h +#define _SDL_test_log_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Prints given message with a timestamp in the TEST category and INFO priority. + * + * \param fmt Message to be logged + */ +void SDLTest_Log(const char *fmt, ...); + +/** + * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. + * + * \param fmt Message to be logged + */ +void SDLTest_LogError(const char *fmt, ...); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_log_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_md5.h b/include/SDL_test_md5.h new file mode 100644 index 0000000000..b0d4b7b041 --- /dev/null +++ b/include/SDL_test_md5.h @@ -0,0 +1,129 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_md5.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + *********************************************************************** + ** Header file for implementation of MD5 ** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** + ** Revised (for MD5): RLR 4/27/91 ** + ** -- G modified to have y&~z instead of y&z ** + ** -- FF, GG, HH modified to add in last register done ** + ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** + ** -- distinct additive constant for each step ** + ** -- round 4 added, working mod 7 ** + *********************************************************************** +*/ + +/* + *********************************************************************** + ** Message-digest routines: ** + ** To form the message digest for a message M ** + ** (1) Initialize a context buffer mdContext using MD5Init ** + ** (2) Call MD5Update on mdContext and M ** + ** (3) Call MD5Final on mdContext ** + ** The message digest is now in mdContext->digest[0...15] ** + *********************************************************************** +*/ + +#ifndef _SDL_test_md5_h +#define _SDL_test_md5_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------ Definitions --------- */ + +/* typedef a 32-bit type */ + typedef unsigned long int MD5UINT4; + +/* Data structure for MD5 (Message-Digest) computation */ + typedef struct { + MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ + MD5UINT4 buf[4]; /* scratch buffer */ + unsigned char in[64]; /* input buffer */ + unsigned char digest[16]; /* actual digest after Md5Final call */ + } SDLTest_Md5Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * /brief initialize the context + * + * /param mdContext pointer to context variable + * + * Note: The function initializes the message-digest context + * mdContext. Call before each new use of the context - + * all fields are set to zero. + */ + void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); + + +/** + * /brief update digest from variable length data + * + * /param mdContext pointer to context variable + * /param inBuf pointer to data array/string + * /param inLen length of data array/string + * + * Note: The function updates the message-digest context to account + * for the presence of each of the characters inBuf[0..inLen-1] + * in the message whose digest is being computed. +*/ + + void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, + unsigned int inLen); + + +/* + * /brief complete digest computation + * + * /param mdContext pointer to context variable + * + * Note: The function terminates the message-digest computation and + * ends with the desired message digest in mdContext.digest[0..15]. + * Always call before using the digest[] variable. +*/ + + void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_md5_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_test_random.h b/include/SDL_test_random.h new file mode 100644 index 0000000000..ce6192c257 --- /dev/null +++ b/include/SDL_test_random.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_random.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + A "32-bit Multiply with carry random number generator. Very fast. + Includes a list of recommended multipliers. + + multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. + period: (a*2^31)-1 + +*/ + +#ifndef _SDL_test_random_h +#define _SDL_test_random_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* --- Definitions */ + +/* + * Macros that return a random number in a specific format. + */ +#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) + +/* + * Context structure for the random number generator state. + */ + typedef struct { + unsigned int a; + unsigned int x; + unsigned int c; + unsigned int ah; + unsigned int al; + } SDLTest_RandomContext; + + +/* --- Function prototypes */ + +/** + * \brief Initialize random number generator with two integers. + * + * Note: The random sequence of numbers returned by ...Random() is the + * same for the same two integers and has a period of 2^31. + * + * \param rndContext pointer to context structure + * \param xi integer that defines the random sequence + * \param ci integer that defines the random sequence + * + */ + void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, + unsigned int ci); + +/** + * \brief Initialize random number generator based on current system time. + * + * \param rndContext pointer to context structure + * + */ + void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); + + +/** + * \brief Initialize random number generator based on current system time. + * + * Note: ...RandomInit() or ...RandomInitTime() must have been called + * before using this function. + * + * \param rndContext pointer to context structure + * + * \returns A random number (32bit unsigned integer) + * + */ + unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_random_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_thread.h b/include/SDL_thread.h index 9ebe00edd5..c878c3ab9c 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -1,38 +1,38 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #ifndef _SDL_thread_h #define _SDL_thread_h -/** @file SDL_thread.h - * Header for the SDL thread management routines +/** + * \file SDL_thread.h * - * @note These are independent of the other SDL routines. + * Header for the SDL thread management routines. */ #include "SDL_stdinc.h" #include "SDL_error.h" /* Thread synchronization primitives */ +#include "SDL_atomic.h" #include "SDL_mutex.h" #include "begin_code.h" @@ -41,69 +41,192 @@ extern "C" { #endif -/** The SDL thread structure, defined in SDL_thread.c */ +/* The SDL thread structure, defined in SDL_thread.c */ struct SDL_Thread; typedef struct SDL_Thread SDL_Thread; -/** Create a thread */ -#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) +/* The SDL thread ID */ +typedef unsigned long SDL_threadID; + +/* Thread local storage ID, 0 is the invalid ID */ +typedef unsigned int SDL_TLSID; + +/* The SDL thread priority + * + * Note: On many systems you require special privileges to set high priority. + */ +typedef enum { + SDL_THREAD_PRIORITY_LOW, + SDL_THREAD_PRIORITY_NORMAL, + SDL_THREAD_PRIORITY_HIGH +} SDL_ThreadPriority; + +/* The function passed to SDL_CreateThread() + It is passed a void* user context parameter and returns an int. + */ +typedef int (SDLCALL * SDL_ThreadFunction) (void *data); + +#if defined(__WIN32__) && !defined(HAVE_LIBC) /** - * We compile SDL into a DLL on OS/2. This means, that it's the DLL which + * \file SDL_thread.h + * + * We compile SDL into a DLL. This means, that it's the DLL which * creates a new thread for the calling process with the SDL_CreateThread() * API. There is a problem with this, that only the RTL of the SDL.DLL will - * be initialized for those threads, and not the RTL of the calling application! + * be initialized for those threads, and not the RTL of the calling + * application! + * * To solve this, we make a little hack here. + * * We'll always use the caller's _beginthread() and _endthread() APIs to * start a new thread. This way, if it's the SDL.DLL which uses this API, * then the RTL of SDL.DLL will be used to create the new thread, and if it's * the application, then the RTL of the application will be used. + * * So, in short: - * Always use the _beginthread() and _endthread() of the calling runtime library! + * Always use the _beginthread() and _endthread() of the calling runtime + * library! */ #define SDL_PASSED_BEGINTHREAD_ENDTHREAD -#ifndef _WIN32_WCE -#include /* This has _beginthread() and _endthread() defined! */ -#endif +#include /* This has _beginthread() and _endthread() defined! */ -#ifdef __OS2__ -typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); -typedef void (*pfnSDL_CurrentEndThread)(void); -#else -typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); -#endif +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall * + func) (void + *), + void *arg, unsigned, + unsigned *threadID); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); +/** + * Create a thread. + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +/** + * Create a thread. + */ +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) -#ifdef __OS2__ -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) -#elif defined(_WIN32_WCE) -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) -#else -#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) -#endif #else -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); + +/** + * Create a thread. + * + * Thread naming is a little complicated: Most systems have very small + * limits for the string length (BeOS has 32 bytes, Linux currently has 16, + * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll + * have to see what happens with your system's debugger. The name should be + * UTF-8 (but using the naming limits of C identifiers is a better bet). + * There are no requirements for thread naming conventions, so long as the + * string is null-terminated UTF-8, but these guidelines are helpful in + * choosing a name: + * + * http://stackoverflow.com/questions/149932/naming-conventions-for-threads + * + * If a system imposes requirements, SDL will try to munge the string for + * it (truncate, etc), but the original string contents will be available + * from SDL_GetThreadName(). + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); + #endif -/** Get the 32-bit thread identifier for the current thread */ -extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); +/** + * Get the thread name, as it was specified in SDL_CreateThread(). + * This function returns a pointer to a UTF-8 string that names the + * specified thread, or NULL if it doesn't have a name. This is internal + * memory, not to be free()'d by the caller, and remains valid until the + * specified thread is cleaned up by SDL_WaitThread(). + */ +extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); + +/** + * Get the thread identifier for the current thread. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); + +/** + * Get the thread identifier for the specified thread. + * + * Equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); -/** Get the 32-bit thread identifier for the specified thread, - * equivalent to SDL_ThreadID() if the specified thread is NULL. +/** + * Set the priority for the current thread */ -extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); +extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); -/** Wait for a thread to finish. +/** + * Wait for a thread to finish. + * * The return code for the thread function is placed in the area - * pointed to by 'status', if 'status' is not NULL. + * pointed to by \c status, if \c status is not NULL. */ -extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); -/** Forcefully kill a thread without worrying about its state */ -extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); +/** + * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific. + * + * \return The newly created thread local storage identifier, or 0 on error + * + * \code + * static SDL_SpinLock tls_lock; + * static SDL_TLSID thread_local_storage; + * + * void SetMyThreadData(void *value) + * { + * if (!thread_local_storage) { + * SDL_AtomicLock(&tls_lock); + * if (!thread_local_storage) { + * thread_local_storage = SDL_TLSCreate(); + * } + * SDL_AtomicUnLock(&tls_lock); + * } + * SDL_TLSSet(thread_local_storage, value); + * } + * + * void *GetMyThreadData(void) + * { + * return SDL_TLSGet(thread_local_storage); + * } + * \endcode + * + * \sa SDL_TLSGet() + * \sa SDL_TLSSet() + */ +extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); + +/** + * \brief Get the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * + * \return The value associated with the ID for the current thread, or NULL if no value has been set. + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSSet() + */ +extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); + +/** + * \brief Set the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * \param value The value to associate with the ID for the current thread + * \param destructor A function called when the thread exits, to free the value. + * + * \return 0 on success, -1 on error + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSGet() + */ +extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void*)); /* Ends C function definitions when using C++ */ @@ -113,3 +236,5 @@ extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); #include "close_code.h" #endif /* _SDL_thread_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_timer.h b/include/SDL_timer.h index d764d5f381..e065cf4f9f 100644 --- a/include/SDL_timer.h +++ b/include/SDL_timer.h @@ -1,30 +1,31 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #ifndef _SDL_timer_h #define _SDL_timer_h -/** @file SDL_timer.h - * Header for the SDL time management routines +/** + * \file SDL_timer.h + * + * Header for the SDL time management routines. */ #include "SDL_stdinc.h" @@ -36,85 +37,61 @@ extern "C" { #endif -/** This is the OS scheduler timeslice, in milliseconds */ -#define SDL_TIMESLICE 10 - -/** This is the maximum resolution of the SDL timer on all platforms */ -#define TIMER_RESOLUTION 10 /**< Experimentally determined */ - /** - * Get the number of milliseconds since the SDL library initialization. - * Note that this value wraps if the program runs for more than ~49 days. - */ + * \brief Get the number of milliseconds since the SDL library initialization. + * + * \note This value wraps if the program runs for more than ~49 days. + */ extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); -/** Wait a specified number of milliseconds before returning */ -extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); - -/** Function prototype for the timer callback function */ -typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); +/** + * \brief Get the current value of the high resolution counter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); /** - * Set a callback to run after the specified number of milliseconds has - * elapsed. The callback function is passed the current timer interval - * and returns the next timer interval. If the returned value is the - * same as the one passed in, the periodic alarm continues, otherwise a - * new alarm is scheduled. If the callback returns 0, the periodic alarm - * is cancelled. - * - * To cancel a currently running timer, call SDL_SetTimer(0, NULL); - * - * The timer callback function may run in a different thread than your - * main code, and so shouldn't call any functions from within itself. - * - * The maximum resolution of this timer is 10 ms, which means that if - * you request a 16 ms timer, your callback will run approximately 20 ms - * later on an unloaded system. If you wanted to set a flag signaling - * a frame update at 30 frames per second (every 33 ms), you might set a - * timer for 30 ms: - * @code SDL_SetTimer((33/10)*10, flag_update); @endcode - * - * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). - * - * Under UNIX, you should not use raise or use SIGALRM and this function - * in the same program, as it is implemented using setitimer(). You also - * should not use this function in multi-threaded applications as signals - * to multi-threaded apps have undefined behavior in some implementations. - * - * This function returns 0 if successful, or -1 if there was an error. + * \brief Get the count per second of the high resolution counter */ -extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); -/** @name New timer API - * New timer API, supports multiple timers - * Written by Stephane Peter +/** + * \brief Wait a specified number of milliseconds before returning. */ -/*@{*/ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); /** - * Function prototype for the new timer callback function. - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * Function prototype for the timer callback function. + * + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. */ -typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); +typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); -/** Definition of the timer ID type */ -typedef struct _SDL_TimerID *SDL_TimerID; +/** + * Definition of the timer ID type. + */ +typedef int SDL_TimerID; -/** Add a new timer to the pool of timers already running. - * Returns a timer ID, or NULL when an error occurs. +/** + * \brief Add a new timer to the pool of timers already running. + * + * \return A timer ID, or NULL when an error occurs. */ -extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, + SDL_TimerCallback callback, + void *param); /** - * Remove one of the multiple timers knowing its ID. - * Returns a boolean value indicating success. + * \brief Remove a timer knowing its ID. + * + * \return A boolean value indicating success or failure. + * + * \warning It is not safe to remove a timer multiple times. */ -extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); -/*@}*/ /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -123,3 +100,5 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); #include "close_code.h" #endif /* _SDL_timer_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_touch.h b/include/SDL_touch.h new file mode 100644 index 0000000000..9e6d7c65fb --- /dev/null +++ b/include/SDL_touch.h @@ -0,0 +1,86 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_touch.h + * + * Include file for SDL touch event handling. + */ + +#ifndef _SDL_touch_h +#define _SDL_touch_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_TouchID; +typedef Sint64 SDL_FingerID; + +typedef struct SDL_Finger +{ + SDL_FingerID id; + float x; + float y; + float pressure; +} SDL_Finger; + +/* Used as the device ID for mouse events simulated with touch input */ +#define SDL_TOUCH_MOUSEID ((Uint32)-1) + + +/* Function prototypes */ + +/** + * \brief Get the number of registered touch devices. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); + +/** + * \brief Get the touch ID with the given index, or 0 if the index is invalid. + */ +extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); + +/** + * \brief Get the number of active fingers for a given touch device. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); + +/** + * \brief Get the finger object of the given touch, with the given index. + */ +extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_touch_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_types.h b/include/SDL_types.h index 79d8b28dd0..bb485cdb0e 100644 --- a/include/SDL_types.h +++ b/include/SDL_types.h @@ -1,27 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_types.h - * @deprecated Use SDL_stdinc.h instead. +/** + * \file SDL_types.h + * + * \deprecated */ /* DEPRECATED */ diff --git a/include/SDL_version.h b/include/SDL_version.h index fdc17c64c9..a9ced804d3 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -1,27 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_version.h - * This header defines the current SDL version +/** + * \file SDL_version.h + * + * This header defines the current SDL version. */ #ifndef _SDL_version_h @@ -35,52 +36,120 @@ extern "C" { #endif -/** @name Version Number - * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +/** + * \brief Information the version of SDL in use. + * + * Represents the library's version as three levels: major revision + * (increments with massive changes, additions, and enhancements), + * minor revision (increments with backwards-compatible changes to the + * major revision), and patchlevel (increments with fixes to the minor + * revision). + * + * \sa SDL_VERSION + * \sa SDL_GetVersion */ -/*@{*/ -#define SDL_MAJOR_VERSION 1 -#define SDL_MINOR_VERSION 2 -#define SDL_PATCHLEVEL 15 -/*@}*/ - -typedef struct SDL_version { - Uint8 major; - Uint8 minor; - Uint8 patch; +typedef struct SDL_version +{ + Uint8 major; /**< major version */ + Uint8 minor; /**< minor version */ + Uint8 patch; /**< update version */ } SDL_version; +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_MAJOR_VERSION 2 +#define SDL_MINOR_VERSION 0 +#define SDL_PATCHLEVEL 0 + /** - * This macro can be used to fill a version structure with the compile-time - * version of the SDL library. + * \brief Macro to determine SDL version program was compiled against. + * + * This macro fills in a SDL_version structure with the version of the + * library you compiled against. This is determined by what header the + * compiler uses. Note that if you dynamically linked the library, you might + * have a slightly newer or older version at runtime. That version can be + * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), + * is not a macro. + * + * \param x A pointer to a SDL_version struct to initialize. + * + * \sa SDL_version + * \sa SDL_GetVersion */ -#define SDL_VERSION(X) \ -{ \ - (X)->major = SDL_MAJOR_VERSION; \ - (X)->minor = SDL_MINOR_VERSION; \ - (X)->patch = SDL_PATCHLEVEL; \ +#define SDL_VERSION(x) \ +{ \ + (x)->major = SDL_MAJOR_VERSION; \ + (x)->minor = SDL_MINOR_VERSION; \ + (x)->patch = SDL_PATCHLEVEL; \ } -/** This macro turns the version numbers into a numeric value: - * (1,2,3) -> (1203) - * This assumes that there will never be more than 100 patchlevels +/** + * This macro turns the version numbers into a numeric value: + * \verbatim + (1,2,3) -> (1203) + \endverbatim + * + * This assumes that there will never be more than 100 patchlevels. */ -#define SDL_VERSIONNUM(X, Y, Z) \ - ((X)*1000 + (Y)*100 + (Z)) +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) -/** This is the version number macro for the current SDL version */ +/** + * This is the version number macro for the current SDL version. + */ #define SDL_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) -/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ +/** + * This macro will evaluate to true if compiled with SDL at least X.Y.Z. + */ #define SDL_VERSION_ATLEAST(X, Y, Z) \ - (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** + * \brief Get the version of SDL that is linked against your program. + * + * If you are linking to SDL dynamically, then it is possible that the + * current version will be different than the version you compiled against. + * This function returns the current version, while SDL_VERSION() is a + * macro that tells you what version you compiled with. + * + * \code + * SDL_version compiled; + * SDL_version linked; + * + * SDL_VERSION(&compiled); + * SDL_GetVersion(&linked); + * printf("We compiled against SDL version %d.%d.%d ...\n", + * compiled.major, compiled.minor, compiled.patch); + * printf("But we linked against SDL version %d.%d.%d.\n", + * linked.major, linked.minor, linked.patch); + * \endcode + * + * This function may be called safely at any time, even before SDL_Init(). + * + * \sa SDL_VERSION + */ +extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); -/** This function gets the version of the dynamically linked SDL library. - * it should NOT be used to fill a version structure, instead you should - * use the SDL_Version() macro. +/** + * \brief Get the code revision of SDL that is linked against your program. + * + * Returns an arbitrary string (a hash value) uniquely identifying the + * exact revision of the SDL library in use, and is only useful in comparing + * against other revisions. It is NOT an incrementing number. */ -extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); +extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); + +/** + * \brief Get the revision number of SDL that is linked against your program. + * + * Returns a number uniquely identifying the exact revision of the SDL + * library in use. It is an incrementing number based on commits to + * hg.libsdl.org. + */ +extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus @@ -89,3 +158,5 @@ extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); #include "close_code.h" #endif /* _SDL_version_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_video.h b/include/SDL_video.h index f9c4e07025..f3a9619773 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -1,35 +1,37 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** @file SDL_video.h - * Header file for access to the SDL raw framebuffer window +/** + * \file SDL_video.h + * + * Header file for SDL video functions. */ #ifndef _SDL_video_h #define _SDL_video_h #include "SDL_stdinc.h" -#include "SDL_error.h" -#include "SDL_rwops.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -37,197 +39,131 @@ extern "C" { #endif -/** @name Transparency definitions - * These define alpha as the opacity of a surface - */ -/*@{*/ -#define SDL_ALPHA_OPAQUE 255 -#define SDL_ALPHA_TRANSPARENT 0 -/*@}*/ - -/** @name Useful data types */ -/*@{*/ -typedef struct SDL_Rect { - Sint16 x, y; - Uint16 w, h; -} SDL_Rect; - -typedef struct SDL_Color { - Uint8 r; - Uint8 g; - Uint8 b; - Uint8 unused; -} SDL_Color; -#define SDL_Colour SDL_Color - -typedef struct SDL_Palette { - int ncolors; - SDL_Color *colors; -} SDL_Palette; -/*@}*/ - -/** Everything in the pixel format structure is read-only */ -typedef struct SDL_PixelFormat { - SDL_Palette *palette; - Uint8 BitsPerPixel; - Uint8 BytesPerPixel; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - - /** RGB color key information */ - Uint32 colorkey; - /** Alpha value information (per-surface alpha) */ - Uint8 alpha; -} SDL_PixelFormat; - -/** This structure should be treated as read-only, except for 'pixels', - * which, if not NULL, contains the raw pixel data for the surface. - */ -typedef struct SDL_Surface { - Uint32 flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ - int w, h; /**< Read-only */ - Uint16 pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - int offset; /**< Private */ - - /** Hardware-specific surface info */ - struct private_hwdata *hwdata; - - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - Uint32 unused1; /**< for binary compatibility */ - - /** Allow recursive locks */ - Uint32 locked; /**< Private */ - - /** info for fast blit mapping to other surfaces */ - struct SDL_BlitMap *map; /**< Private */ - - /** format version, bumped at every change to invalidate blit maps */ - unsigned int format_version; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ -} SDL_Surface; - -/** @name SDL_Surface Flags - * These are the currently supported flags for the SDL_surface - */ -/*@{*/ - -/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ -/*@{*/ -#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ -#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ -#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ -/*@}*/ - -/** Available for SDL_SetVideoMode() */ -/*@{*/ -#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ -#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ -#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ -#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ -#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ -#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ -#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ -#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ -/*@}*/ - -/** Used internally (read-only) */ -/*@{*/ -#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ -#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ -#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ -#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ -#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ -#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ -/*@}*/ - -/*@}*/ - -/** Evaluates to true if the surface needs to be locked before access */ -#define SDL_MUSTLOCK(surface) \ - (surface->offset || \ - ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) - -/** typedef for private surface blitting functions */ -typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, - struct SDL_Surface *dst, SDL_Rect *dstrect); - - -/** Useful for determining the video hardware capabilities */ -typedef struct SDL_VideoInfo { - Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ - Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ - Uint32 UnusedBits1 :6; - Uint32 UnusedBits2 :1; - Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ - Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ - Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ - Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ - Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ - Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ - Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ - Uint32 UnusedBits3 :16; - Uint32 video_mem; /**< The total amount of video memory (in K) */ - SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ - int current_w; /**< Value: The current video mode width */ - int current_h; /**< Value: The current video mode height */ -} SDL_VideoInfo; - - -/** @name Overlay Formats - * The most common video overlay formats. - * For an explanation of these pixel formats, see: - * http://www.webartz.com/fourcc/indexyuv.htm - * - * For information on the relationship between color spaces, see: - * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html - */ -/*@{*/ -#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ -#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ -#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ -#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ -#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ -/*@}*/ - -/** The YUV hardware video overlay */ -typedef struct SDL_Overlay { - Uint32 format; /**< Read-only */ - int w, h; /**< Read-only */ - int planes; /**< Read-only */ - Uint16 *pitches; /**< Read-only */ - Uint8 **pixels; /**< Read-write */ - - /** @name Hardware-specific surface info */ - /*@{*/ - struct private_yuvhwfuncs *hwfuncs; - struct private_yuvhwdata *hwdata; - /*@{*/ - - /** @name Special flags */ - /*@{*/ - Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ - Uint32 UnusedBits :31; - /*@}*/ -} SDL_Overlay; - - -/** Public enumeration for setting the OpenGL window attributes. */ -typedef enum { +/** + * \brief The structure that defines a display mode + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + * \sa SDL_GetDesktopDisplayMode() + * \sa SDL_GetCurrentDisplayMode() + * \sa SDL_GetClosestDisplayMode() + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +typedef struct +{ + Uint32 format; /**< pixel format */ + int w; /**< width */ + int h; /**< height */ + int refresh_rate; /**< refresh rate (or zero for unspecified) */ + void *driverdata; /**< driver-specific data, initialize to 0 */ +} SDL_DisplayMode; + +/** + * \brief The type used to identify a window + * + * \sa SDL_CreateWindow() + * \sa SDL_CreateWindowFrom() + * \sa SDL_DestroyWindow() + * \sa SDL_GetWindowData() + * \sa SDL_GetWindowFlags() + * \sa SDL_GetWindowGrab() + * \sa SDL_GetWindowPosition() + * \sa SDL_GetWindowSize() + * \sa SDL_GetWindowTitle() + * \sa SDL_HideWindow() + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + * \sa SDL_RaiseWindow() + * \sa SDL_RestoreWindow() + * \sa SDL_SetWindowData() + * \sa SDL_SetWindowFullscreen() + * \sa SDL_SetWindowGrab() + * \sa SDL_SetWindowIcon() + * \sa SDL_SetWindowPosition() + * \sa SDL_SetWindowSize() + * \sa SDL_SetWindowBordered() + * \sa SDL_SetWindowTitle() + * \sa SDL_ShowWindow() + */ +typedef struct SDL_Window SDL_Window; + +/** + * \brief The flags on a window + * + * \sa SDL_GetWindowFlags() + */ +typedef enum +{ + SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ + SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ + SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ + SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ + SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ + SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ + SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ + SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ + SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ + SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ + SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), + SDL_WINDOW_FOREIGN = 0x00000800 /**< window not created by SDL */ +} SDL_WindowFlags; + +/** + * \brief Used to indicate that you don't care what the window position is. + */ +#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000 +#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) +#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) +#define SDL_WINDOWPOS_ISUNDEFINED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) + +/** + * \brief Used to indicate that the window position should be centered. + */ +#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000 +#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) +#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) +#define SDL_WINDOWPOS_ISCENTERED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) + +/** + * \brief Event subtype for window events + */ +typedef enum +{ + SDL_WINDOWEVENT_NONE, /**< Never used */ + SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ + SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ + SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be + redrawn */ + SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 + */ + SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ + SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as a result of an API call or through the system or user changing the window size. */ + SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ + SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ + SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size + and position */ + SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ + SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ + SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ + SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ + SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the + window be closed */ +} SDL_WindowEventID; + +/** + * \brief An opaque handle to an OpenGL context. + */ +typedef void *SDL_GLContext; + +/** + * \brief OpenGL configuration attributes + */ +typedef enum +{ SDL_GL_RED_SIZE, SDL_GL_GREEN_SIZE, SDL_GL_BLUE_SIZE, @@ -244,704 +180,768 @@ typedef enum { SDL_GL_MULTISAMPLEBUFFERS, SDL_GL_MULTISAMPLESAMPLES, SDL_GL_ACCELERATED_VISUAL, - SDL_GL_SWAP_CONTROL + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_EGL, + SDL_GL_CONTEXT_FLAGS, + SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_SHARE_WITH_CURRENT_CONTEXT } SDL_GLattr; -/** @name flags for SDL_SetPalette() */ -/*@{*/ -#define SDL_LOGPAL 0x01 -#define SDL_PHYSPAL 0x02 -/*@}*/ +typedef enum +{ + SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, + SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, + SDL_GL_CONTEXT_PROFILE_ES = 0x0004 +} SDL_GLprofile; + +typedef enum +{ + SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 +} SDL_GLcontextFlag; + /* Function prototypes */ /** - * @name Video Init and Quit - * These functions are used internally, and should not be used unless you - * have a specific need to specify the video driver you want to use. - * You should normally use SDL_Init() or SDL_InitSubSystem(). + * \brief Get the number of video drivers compiled into SDL + * + * \sa SDL_GetVideoDriver() */ -/*@{*/ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); + /** - * Initializes the video subsystem. Sets up a connection - * to the window manager, etc, and determines the current video mode and - * pixel format, but does not initialize a window or graphics mode. - * Note that event handling is activated by this routine. + * \brief Get the name of a built in video driver. + * + * \note The video drivers are presented in the order in which they are + * normally checked during initialization. * - * If you use both sound and video in your application, you need to call - * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, - * you won't be able to set full-screen display modes. + * \sa SDL_GetNumVideoDrivers() + */ +extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); + +/** + * \brief Initialize the video subsystem, optionally specifying a video driver. + * + * \param driver_name Initialize a specific driver by name, or NULL for the + * default video driver. + * + * \return 0 on success, -1 on error + * + * This function initializes the video subsystem; setting up a connection + * to the window manager, etc, and determines the available display modes + * and pixel formats, but does not initialize a window or graphics mode. + * + * \sa SDL_VideoQuit() + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); + +/** + * \brief Shuts down the video subsystem. + * + * This function closes all windows, and restores the original video mode. + * + * \sa SDL_VideoInit() */ -extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); extern DECLSPEC void SDLCALL SDL_VideoQuit(void); -/*@}*/ /** - * This function fills the given character buffer with the name of the - * video driver, and returns a pointer to it if the video driver has - * been initialized. It returns NULL if no driver has been initialized. + * \brief Returns the name of the currently initialized video driver. + * + * \return The name of the current video driver or NULL if no driver + * has been initialized + * + * \sa SDL_GetNumVideoDrivers() + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); + +/** + * \brief Returns the number of available video displays. + * + * \sa SDL_GetDisplayBounds() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); + +/** + * \brief Get the name of a display in UTF-8 encoding + * + * \return The name of a display, or NULL for an invalid display index. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); + +/** + * \brief Get the desktop area represented by a display, with the primary + * display located at 0,0 + * + * \return 0 on success, or -1 if the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); + +/** + * \brief Returns the number of available display modes. + * + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); + +/** + * \brief Fill in information about a specific display mode. + * + * \note The display modes are sorted in this priority: + * \li bits per pixel -> more colors to fewer colors + * \li width -> largest to smallest + * \li height -> largest to smallest + * \li refresh rate -> highest to lowest + * + * \sa SDL_GetNumDisplayModes() */ -extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); +extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, + SDL_DisplayMode * mode); /** - * This function returns a pointer to the current display surface. - * If SDL is doing format conversion on the display surface, this - * function returns the publicly visible surface, not the real video - * surface. + * \brief Fill in information about the desktop display mode. */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); +extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); /** - * This function returns a read-only pointer to information about the - * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' - * member of the returned structure will contain the pixel format of the - * "best" video mode. + * \brief Fill in information about the current display mode. */ -extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); +extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); + /** - * Check to see if a particular video mode is supported. - * It returns 0 if the requested mode is not supported under any bit depth, - * or returns the bits-per-pixel of the closest available mode with the - * given width and height. If this bits-per-pixel is different from the - * one used when setting the video mode, SDL_SetVideoMode() will succeed, - * but will emulate the requested bits-per-pixel with a shadow surface. + * \brief Get the closest match to the requested display mode. + * + * \param displayIndex The index of display from which mode should be queried. + * \param mode The desired display mode + * \param closest A pointer to a display mode to be filled in with the closest + * match of the available display modes. * - * The arguments to SDL_VideoModeOK() are the same ones you would pass to - * SDL_SetVideoMode() + * \return The passed in value \c closest, or NULL if no matching video mode + * was available. + * + * The available display modes are scanned, and \c closest is filled in with the + * closest mode matching the requested mode and returned. The mode format and + * refresh_rate default to the desktop mode if they are 0. The modes are + * scanned with size being first priority, format being second priority, and + * finally checking the refresh_rate. If all the available modes are too + * small, then NULL is returned. + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() */ -extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); +extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); /** - * Return a pointer to an array of available screen dimensions for the - * given format and video flags, sorted largest to smallest. Returns - * NULL if there are no dimensions available for a particular format, - * or (SDL_Rect **)-1 if any dimension is okay for the given format. + * \brief Get the display index associated with a window. * - * If 'format' is NULL, the mode list will be for the format given - * by SDL_GetVideoInfo()->vfmt + * \return the display index of the display containing the center of the + * window, or -1 on error. */ -extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); /** - * Set up a video mode with the specified width, height and bits-per-pixel. + * \brief Set the display mode used when a fullscreen window is visible. * - * If 'bpp' is 0, it is treated as the current display bits per pixel. + * By default the window's dimensions and the desktop format and refresh rate + * are used. * - * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the - * requested bits-per-pixel, but will return whatever video pixel format is - * available. The default is to emulate the requested pixel format if it - * is not natively available. + * \param window The window for which the display mode should be set. + * \param mode The mode to use, or NULL for the default mode. * - * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in - * video memory, if possible, and you may have to call SDL_LockSurface() - * in order to access the raw framebuffer. Otherwise, the video surface - * will be created in system memory. + * \return 0 on success, or -1 if setting the display mode failed. * - * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle - * updates asynchronously, but you must always lock before accessing pixels. - * SDL will wait for updates to complete before returning from the lock. + * \sa SDL_GetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, + const SDL_DisplayMode + * mode); + +/** + * \brief Fill in information about the display mode used when a fullscreen + * window is visible. * - * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee - * that the colors set by SDL_SetColors() will be the colors you get. - * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all - * of the colors exactly the way they are requested, and you should look - * at the video surface structure to determine the actual palette. - * If SDL cannot guarantee that the colors you request can be set, - * i.e. if the colormap is shared, then the video surface may be created - * under emulation in system memory, overriding the SDL_HWSURFACE flag. + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, + SDL_DisplayMode * mode); + +/** + * \brief Get the pixel format associated with the window. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); + +/** + * \brief Create a window with the specified position, dimensions, and flags. * - * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set - * a fullscreen video mode. The default is to create a windowed mode - * if the current graphics system has a window manager. - * If the SDL library is able to set a fullscreen video mode, this flag - * will be set in the surface that is returned. + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of any of the following: + * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, + * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, + * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED. * - * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up - * two surfaces in video memory and swap between them when you call - * SDL_Flip(). This is usually slower than the normal single-buffering - * scheme, but prevents "tearing" artifacts caused by modifying video - * memory while the monitor is refreshing. It should only be used by - * applications that redraw the entire screen on every update. + * \return The id of the window created, or zero if window creation failed. * - * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the - * window manager, if any, to resize the window at runtime. When this - * occurs, SDL will send a SDL_VIDEORESIZE event to you application, - * and you must respond to the event by re-calling SDL_SetVideoMode() - * with the requested size (or another size that suits the application). + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, + int x, int y, int w, + int h, Uint32 flags); + +/** + * \brief Create an SDL window from an existing native window. * - * If SDL_NOFRAME is set in 'flags', the SDL library will create a window - * without any title bar or frame decoration. Fullscreen video modes have - * this flag set automatically. + * \param data A pointer to driver-dependent window creation data * - * This function returns the video framebuffer surface, or NULL if it fails. + * \return The id of the window created, or zero if window creation failed. * - * If you rely on functionality provided by certain video flags, check the - * flags of the returned surface to make sure that functionality is available. - * SDL will fall back to reduced functionality if the exact flags you wanted - * are not available. + * \sa SDL_DestroyWindow() */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode - (int width, int height, int bpp, Uint32 flags); +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); -/** @name SDL_Update Functions - * These functions should not be called while 'screen' is locked. +/** + * \brief Get the numeric ID of a window, for logging purposes. */ -/*@{*/ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); + /** - * Makes sure the given list of rectangles is updated on the given screen. + * \brief Get a window from a stored ID, or NULL if it doesn't exist. */ -extern DECLSPEC void SDLCALL SDL_UpdateRects - (SDL_Surface *screen, int numrects, SDL_Rect *rects); +extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); + +/** + * \brief Get the window flags. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); + +/** + * \brief Set the title of a window, in UTF-8 format. + * + * \sa SDL_GetWindowTitle() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, + const char *title); + /** - * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire - * screen. + * \brief Get the title of a window, in UTF-8 format. + * + * \sa SDL_SetWindowTitle() */ -extern DECLSPEC void SDLCALL SDL_UpdateRect - (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); -/*@}*/ +extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); /** - * On hardware that supports double-buffering, this function sets up a flip - * and returns. The hardware will wait for vertical retrace, and then swap - * video buffers before the next video surface blit or lock will return. - * On hardware that doesn not support double-buffering, this is equivalent - * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); - * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when - * setting the video mode for this function to perform hardware flipping. - * This function returns 0 if successful, or -1 if there was an error. + * \brief Set the icon for a window. + * + * \param window The window for which the icon should be set. + * \param icon The icon for the window. */ -extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); +extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, + SDL_Surface * icon); /** - * Set the gamma correction for each of the color channels. - * The gamma values range (approximately) between 0.1 and 10.0 - * - * If this function isn't supported directly by the hardware, it will - * be emulated using gamma ramps, if available. If successful, this - * function returns 0, otherwise it returns -1. + * \brief Associate an arbitrary named pointer with a window. + * + * \param window The window to associate with the pointer. + * \param name The name of the pointer. + * \param userdata The associated pointer. + * + * \return The previous value associated with 'name' + * + * \note The name is case-sensitive. + * + * \sa SDL_GetWindowData() */ -extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); +extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, + const char *name, + void *userdata); /** - * Set the gamma translation table for the red, green, and blue channels - * of the video hardware. Each table is an array of 256 16-bit quantities, - * representing a mapping between the input and output for that channel. - * The input is the index into the array, and the output is the 16-bit - * gamma value at that index, scaled to the output color precision. - * - * You may pass NULL for any of the channels to leave it unchanged. - * If the call succeeds, it will return 0. If the display driver or - * hardware does not support gamma translation, or otherwise fails, - * this function will return -1. + * \brief Retrieve the data pointer associated with a window. + * + * \param window The window to query. + * \param name The name of the pointer. + * + * \return The value associated with 'name' + * + * \sa SDL_SetWindowData() + */ +extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, + const char *name); + +/** + * \brief Set the position of a window. + * + * \param window The window to reposition. + * \param x The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or + ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or + ::SDL_WINDOWPOS_UNDEFINED. + * + * \note The window coordinate origin is the upper left of the display. + * + * \sa SDL_GetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, + int x, int y); + +/** + * \brief Get the position of a window. + * + * \param window The window to query. + * \param x Pointer to variable for storing the x position, may be NULL + * \param y Pointer to variable for storing the y position, may be NULL + * + * \sa SDL_SetWindowPosition() */ -extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); +extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, + int *x, int *y); /** - * Retrieve the current values of the gamma translation tables. - * - * You must pass in valid pointers to arrays of 256 16-bit quantities. - * Any of the pointers may be NULL to ignore that channel. - * If the call succeeds, it will return 0. If the display driver or - * hardware does not support gamma translation, or otherwise fails, - * this function will return -1. + * \brief Set the size of a window's client area. + * + * \param window The window to resize. + * \param w The width of the window, must be >0 + * \param h The height of the window, must be >0 + * + * \note You can't change the size of a fullscreen window, it automatically + * matches the size of the display mode. + * + * \sa SDL_GetWindowSize() */ -extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); +extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, + int h); /** - * Sets a portion of the colormap for the given 8-bit surface. If 'surface' - * is not a palettized surface, this function does nothing, returning 0. - * If all of the colors were set as passed to SDL_SetColors(), it will - * return 1. If not all the color entries were set exactly as given, - * it will return 0, and you should look at the surface palette to - * determine the actual color palette. - * - * When 'surface' is the surface associated with the current display, the - * display colormap will be updated with the requested colors. If - * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() - * will always return 1, and the palette is guaranteed to be set the way - * you desire, even if the window colormap has to be warped or run under - * emulation. + * \brief Get the size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the width, may be NULL + * \param h Pointer to variable for storing the height, may be NULL + * + * \sa SDL_SetWindowSize() */ -extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, - SDL_Color *colors, int firstcolor, int ncolors); +extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, + int *h); /** - * Sets a portion of the colormap for a given 8-bit surface. - * 'flags' is one or both of: - * SDL_LOGPAL -- set logical palette, which controls how blits are mapped - * to/from the surface, - * SDL_PHYSPAL -- set physical palette, which controls how pixels look on - * the screen - * Only screens have physical palettes. Separate change of physical/logical - * palettes is only possible if the screen has SDL_HWPALETTE set. - * - * The return value is 1 if all colours could be set as requested, and 0 - * otherwise. - * - * SDL_SetColors() is equivalent to calling this function with - * flags = (SDL_LOGPAL|SDL_PHYSPAL). + * \brief Set the minimum size of a window's client area. + * + * \param window The window to set a new minimum size. + * \param min_w The minimum width of the window, must be >0 + * \param min_h The minimum height of the window, must be >0 + * + * \note You can't change the minimum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() */ -extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, - SDL_Color *colors, int firstcolor, - int ncolors); +extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, + int min_w, int min_h); /** - * Maps an RGB triple to an opaque pixel value for a given pixel format + * \brief Get the minimum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the minimum width, may be NULL + * \param h Pointer to variable for storing the minimum height, may be NULL + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGB -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b); +extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, + int *w, int *h); /** - * Maps an RGBA quadruple to a pixel value for a given pixel format + * \brief Set the maximum size of a window's client area. + * + * \param window The window to set a new maximum size. + * \param max_w The maximum width of the window, must be >0 + * \param max_h The maximum height of the window, must be >0 + * + * \note You can't change the maximum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() */ -extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); +extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, + int max_w, int max_h); /** - * Maps a pixel value into the RGB components for a given pixel format - */ -extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * const fmt, - Uint8 *r, Uint8 *g, Uint8 *b); + * \brief Get the maximum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the maximum width, may be NULL + * \param h Pointer to variable for storing the maximum height, may be NULL + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, + int *w, int *h); /** - * Maps a pixel value into the RGBA components for a given pixel format + * \brief Set the border state of a window. + * + * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and + * add or remove the border from the actual window. This is a no-op if the + * window's border already matches the requested state. + * + * \param window The window of which to change the border state. + * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. + * + * \note You can't change the border state of a fullscreen window. + * + * \sa SDL_GetWindowFlags() */ -extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * const fmt, - Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); - -/** @sa SDL_CreateRGBSurface */ -#define SDL_AllocSurface SDL_CreateRGBSurface +extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, + SDL_bool bordered); + /** - * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) - * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. - * If the depth is greater than 8 bits, the pixel format is set using the - * flags '[RGB]mask'. - * If the function runs out of memory, it will return NULL. + * \brief Show a window. * - * The 'flags' tell what kind of surface to create. - * SDL_SWSURFACE means that the surface should be created in system memory. - * SDL_HWSURFACE means that the surface should be created in video memory, - * with the same format as the display surface. This is useful for surfaces - * that will not change much, to take advantage of hardware acceleration - * when being blitted to the display surface. - * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with - * this surface, but you must always lock it before accessing the pixels. - * SDL will wait for current blits to finish before returning from the lock. - * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. - * If the hardware supports acceleration of colorkey blits between - * two surfaces in video memory, SDL will try to place the surface in - * video memory. If this isn't possible or if there is no hardware - * acceleration available, the surface will be placed in system memory. - * SDL_SRCALPHA means that the surface will be used for alpha blits and - * if the hardware supports hardware acceleration of alpha blits between - * two surfaces in video memory, to place the surface in video memory - * if possible, otherwise it will be placed in system memory. - * If the surface is created in video memory, blits will be _much_ faster, - * but the surface format must be identical to the video surface format, - * and the only way to access the pixels member of the surface is to use - * the SDL_LockSurface() and SDL_UnlockSurface() calls. - * If the requested surface actually resides in video memory, SDL_HWSURFACE - * will be set in the flags member of the returned surface. If for some - * reason the surface could not be placed in video memory, it will not have - * the SDL_HWSURFACE flag set, and will be created in system memory instead. + * \sa SDL_HideWindow() */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface - (Uint32 flags, int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -/** @sa SDL_CreateRGBSurface */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, - int width, int height, int depth, int pitch, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); +extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); /** - * SDL_LockSurface() sets up a surface for directly accessing the pixels. - * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write - * to and read from 'surface->pixels', using the pixel format stored in - * 'surface->format'. Once you are done accessing the surface, you should - * use SDL_UnlockSurface() to release it. + * \brief Hide a window. * - * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates - * to 0, then you can read and write to the surface at any time, and the - * pixel format of the surface will not change. In particular, if the - * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you - * will not need to lock the display surface before accessing it. - * - * No operating system or library calls should be made between lock/unlock - * pairs, as critical system locks may be held during this time. + * \sa SDL_ShowWindow() + */ +extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); + +/** + * \brief Raise a window above other windows and set the input focus. + */ +extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); + +/** + * \brief Make a window as large as possible. * - * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + * \sa SDL_RestoreWindow() */ -extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); -extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); +extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); /** - * Load a surface from a seekable SDL data source (memory or file.) - * If 'freesrc' is non-zero, the source will be closed after being read. - * Returns the new surface, or NULL if there was an error. - * The new surface should be freed with SDL_FreeSurface(). + * \brief Minimize a window to an iconic representation. + * + * \sa SDL_RestoreWindow() */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); +extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); -/** Convenience macro -- load a surface from a file */ -#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) +/** + * \brief Restore the size and position of a minimized or maximized window. + * + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + */ +extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); /** - * Save a surface to a seekable SDL data source (memory or file.) - * If 'freedst' is non-zero, the source will be closed after being written. - * Returns 0 if successful or -1 if there was an error. + * \brief Set a window's fullscreen state. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() */ -extern DECLSPEC int SDLCALL SDL_SaveBMP_RW - (SDL_Surface *surface, SDL_RWops *dst, int freedst); - -/** Convenience macro -- save a surface to a file */ -#define SDL_SaveBMP(surface, file) \ - SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) - -/** - * Sets the color key (transparent pixel) in a blittable surface. - * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), - * 'key' will be the transparent pixel in the source image of a blit. - * SDL_RLEACCEL requests RLE acceleration for the surface if present, - * and removes RLE acceleration if absent. - * If 'flag' is 0, this function clears any current color key. - * This function returns 0, or -1 if there was an error. - */ -extern DECLSPEC int SDLCALL SDL_SetColorKey - (SDL_Surface *surface, Uint32 flag, Uint32 key); - -/** - * This function sets the alpha value for the entire surface, as opposed to - * using the alpha component of each pixel. This value measures the range - * of transparency of the surface, 0 being completely transparent to 255 - * being completely opaque. An 'alpha' value of 255 causes blits to be - * opaque, the source pixels copied to the destination (the default). Note - * that per-surface alpha can be combined with colorkey transparency. - * - * If 'flag' is 0, alpha blending is disabled for the surface. - * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. - * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the - * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. - * - * The 'alpha' parameter is ignored for surfaces that have an alpha channel. - */ -extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); - -/** - * Sets the clipping rectangle for the destination surface in a blit. - * - * If the clip rectangle is NULL, clipping will be disabled. - * If the clip rectangle doesn't intersect the surface, the function will - * return SDL_FALSE and blits will be completely clipped. Otherwise the - * function returns SDL_TRUE and blits to the surface will be clipped to - * the intersection of the surface area and the clipping rectangle. - * - * Note that blits are automatically clipped to the edges of the source - * and destination surfaces. - */ -extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); - -/** - * Gets the clipping rectangle for the destination surface in a blit. - * 'rect' must be a pointer to a valid rectangle which will be filled - * with the correct values. - */ -extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); - -/** - * Creates a new surface of the specified format, and then copies and maps - * the given surface to it so the blit of the converted surface will be as - * fast as possible. If this function fails, it returns NULL. - * - * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those - * semantics. You can also pass SDL_RLEACCEL in the flags parameter and - * SDL will try to RLE accelerate colorkey and alpha blits in the resulting - * surface. - * - * This function is used internally by SDL_DisplayFormat(). - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface - (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); - -/** - * This performs a fast blit from the source surface to the destination - * surface. It assumes that the source and destination rectangles are - * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire - * surface (src or dst) is copied. The final blit rectangles are saved - * in 'srcrect' and 'dstrect' after all clipping is performed. - * If the blit is successful, it returns 0, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without alpha and colorkey - * are defined as follows: +extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, + Uint32 flags); + +/** + * \brief Get the SDL surface associated with the window. + * + * \return The window's framebuffer surface, or NULL on error. * - * RGBA->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using alpha-channel). - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy RGB. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value); - * set destination alpha to opaque. - * SDL_SRCALPHA not set: - * copy RGB, set destination alpha to source per-surface alpha value. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * RGBA->RGBA: - * SDL_SRCALPHA set: - * alpha-blend (using the source alpha channel) the RGB values; - * leave destination alpha untouched. [Note: is this correct?] - * SDL_SRCCOLORKEY ignored. - * SDL_SRCALPHA not set: - * copy all of RGBA to the destination. - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * RGB values of the source colour key, ignoring alpha in the - * comparison. - * - * RGB->RGB: - * SDL_SRCALPHA set: - * alpha-blend (using the source per-surface alpha value). - * SDL_SRCALPHA not set: - * copy RGB. - * both: - * if SDL_SRCCOLORKEY set, only copy the pixels matching the - * source colour key. - * - * If either of the surfaces were in video memory, and the blit returns -2, - * the video memory was lost, so it should be reloaded with artwork and - * re-blitted: - * @code - * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { - * while ( SDL_LockSurface(image) < 0 ) - * Sleep(10); - * -- Write image pixels to image->pixels -- - * SDL_UnlockSurface(image); - * } - * @endcode + * A new surface will be created with the optimal format for the window, + * if necessary. This surface will be freed when the window is destroyed. * - * This happens under DirectX 5.0 when the system switches away from your - * fullscreen application. The lock will also fail until you have access - * to the video memory again. + * \note You may not combine this with 3D or the rendering API on this window. * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. + * \sa SDL_UpdateWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() */ -#define SDL_BlitSurface SDL_UpperBlit +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); -/** This is the public blit function, SDL_BlitSurface(), and it performs - * rectangle validation and clipping before passing it to SDL_LowerBlit() +/** + * \brief Copy the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() */ -extern DECLSPEC int SDLCALL SDL_UpperBlit - (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); -/** This is a semi-private blit function and it performs low-level surface - * blitting only. - */ -extern DECLSPEC int SDLCALL SDL_LowerBlit - (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); - -/** - * This function performs a fast fill of the given rectangle with 'color' - * The given rectangle is clipped to the destination surface clip area - * and the final fill rectangle is saved in the passed in pointer. - * If 'dstrect' is NULL, the whole surface will be filled with 'color' - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * This function returns 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillRect - (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); - -/** - * This function takes a surface and copies it to a new surface of the - * pixel format and colors of the video framebuffer, suitable for fast - * blitting onto the display surface. It calls SDL_ConvertSurface() - * - * If you want to take advantage of hardware colorkey or alpha blit - * acceleration, you should set the colorkey and alpha value before - * calling this function. - * - * If the conversion fails or runs out of memory, it returns NULL - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); - -/** - * This function takes a surface and copies it to a new surface of the - * pixel format and colors of the video framebuffer (if possible), - * suitable for fast alpha blitting onto the display surface. - * The new surface will always have an alpha channel. - * - * If you want to take advantage of hardware colorkey or alpha blit - * acceleration, you should set the colorkey and alpha value before - * calling this function. - * - * If the conversion fails or runs out of memory, it returns NULL - */ -extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name YUV video surface overlay functions */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); -/** This function creates a video output overlay - * Calling the returned surface an overlay is something of a misnomer because - * the contents of the display surface underneath the area where the overlay - * is shown is undefined - it may be overwritten with the converted YUV data. +/** + * \brief Copy a number of rectangles on the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRect() */ -extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, - Uint32 format, SDL_Surface *display); +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, + const SDL_Rect * rects, + int numrects); -/** Lock an overlay for direct access, and unlock it when you are done */ -extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); -extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); +/** + * \brief Set a window's input grab mode. + * + * \param window The window for which the input grab mode should be set. + * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. + * + * \sa SDL_GetWindowGrab() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, + SDL_bool grabbed); -/** Blit a video overlay to the display surface. - * The contents of the video surface underneath the blit destination are - * not defined. - * The width and height of the destination rectangle may be different from - * that of the overlay, but currently only 2x scaling is supported. +/** + * \brief Get a window's input grab mode. + * + * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. + * + * \sa SDL_SetWindowGrab() */ -extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); -/** Free a video overlay */ -extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); +/** + * \brief Set the brightness (gamma correction) for a window. + * + * \return 0 on success, or -1 if setting the brightness isn't supported. + * + * \sa SDL_GetWindowBrightness() + * \sa SDL_SetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); -/*@}*/ +/** + * \brief Get the brightness (gamma correction) for a window. + * + * \return The last brightness value passed to SDL_SetWindowBrightness() + * + * \sa SDL_SetWindowBrightness() + */ +extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name OpenGL support functions. */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * \brief Set the gamma ramp for a window. + * + * \param window The window for which the gamma ramp should be set. + * \param red The translation table for the red channel, or NULL. + * \param green The translation table for the green channel, or NULL. + * \param blue The translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * \sa SDL_GetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, + const Uint16 * red, + const Uint16 * green, + const Uint16 * blue); /** - * Dynamically load an OpenGL library, or the default one if path is NULL + * \brief Get the gamma ramp for a window. + * + * \param window The window from which the gamma ramp should be queried. + * \param red A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the red channel, or NULL. + * \param green A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the green channel, or NULL. + * \param blue A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. * - * If you do this, you need to retrieve all of the GL functions used in - * your program from the dynamic library using SDL_GL_GetProcAddress(). + * \sa SDL_SetWindowGammaRamp() */ -extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); +extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, + Uint16 * red, + Uint16 * green, + Uint16 * blue); /** - * Get the address of a GL function + * \brief Destroy a window. */ -extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); +extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); + /** - * Set an attribute of the OpenGL subsystem before intialization. + * \brief Returns whether the screensaver is currently enabled (default on). + * + * \sa SDL_EnableScreenSaver() + * \sa SDL_DisableScreenSaver() */ -extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); /** - * Get an attribute of the OpenGL subsystem from the windowing - * interface, such as glX. This is of course different from getting - * the values from SDL's internal OpenGL subsystem, which only - * stores the values you request before initialization. + * \brief Allow the screen to be blanked by a screensaver * - * Developers should track the values they pass into SDL_GL_SetAttribute - * themselves if they want to retrieve these values. + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_DisableScreenSaver() */ -extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); +extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); /** - * Swap the OpenGL buffers, if double-buffering is supported. + * \brief Prevent the screen from being blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_EnableScreenSaver() */ -extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); +extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); -/** @name OpenGL Internal Functions - * Internal functions that should not be called unless you have read - * and understood the source code for these functions. + +/** + * \name OpenGL support functions */ /*@{*/ -extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); -extern DECLSPEC void SDLCALL SDL_GL_Lock(void); -extern DECLSPEC void SDLCALL SDL_GL_Unlock(void); -/*@}*/ -/*@}*/ +/** + * \brief Dynamically load an OpenGL library. + * + * \param path The platform dependent OpenGL library name, or NULL to open the + * default OpenGL library. + * + * \return 0 on success, or -1 if the library couldn't be loaded. + * + * This should be done after initializing the video driver, but before + * creating any OpenGL windows. If no OpenGL library is loaded, the default + * library will be loaded upon creation of the first OpenGL window. + * + * \note If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + * + * \sa SDL_GL_GetProcAddress() + * \sa SDL_GL_UnloadLibrary() + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/** @name Window Manager Functions */ -/** These functions allow interaction with the window manager, if any. */ /*@{*/ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * \brief Get the address of an OpenGL function. + */ +extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); /** - * Sets the title and icon text of the display window (UTF-8 encoded) + * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). + * + * \sa SDL_GL_LoadLibrary() */ -extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); +extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); + /** - * Gets the title and icon text of the display window (UTF-8 encoded) + * \brief Return true if an OpenGL extension is supported for the current + * context. */ -extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); +extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char + *extension); /** - * Sets the icon for the display window. - * This function must be called before the first call to SDL_SetVideoMode(). - * It takes an icon surface, and a mask in MSB format. - * If 'mask' is NULL, the entire icon surface will be used as the icon. + * \brief Set an OpenGL window attribute before window creation. */ -extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); /** - * This function iconifies the window, and returns 1 if it succeeded. - * If the function succeeds, it generates an SDL_APPACTIVE loss event. - * This function is a noop and returns 0 in non-windowed environments. + * \brief Get the actual value for an attribute from the current context. */ -extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); /** - * Toggle fullscreen mode without changing the contents of the screen. - * If the display surface does not require locking before accessing - * the pixel information, then the memory pointers will not change. + * \brief Create an OpenGL context for use with an OpenGL window, and make it + * current. * - * If this function was able to toggle fullscreen mode (change from - * running in a window to fullscreen, or vice-versa), it will return 1. - * If it is not implemented, or fails, it returns 0. + * \sa SDL_GL_DeleteContext() + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * + window); + +/** + * \brief Set up an OpenGL context for rendering into an OpenGL window. * - * The next call to SDL_SetVideoMode() will set the mode fullscreen - * attribute based on the flags parameter - if SDL_FULLSCREEN is not - * set, then the display will be windowed by default where supported. + * \note The context must have been created with a compatible window. + */ +extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, + SDL_GLContext context); + +/** + * \brief Get the currently active OpenGL window. + */ +extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); + +/** + * \brief Get the currently active OpenGL context. + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); + +/** + * \brief Set the swap interval for the current OpenGL context. + * + * \param interval 0 for immediate updates, 1 for updates synchronized with the + * vertical retrace. If the system supports it, you may + * specify -1 to allow late swaps to happen immediately + * instead of waiting for the next retrace. * - * This is currently only implemented in the X11 video driver. + * \return 0 on success, or -1 if setting the swap interval is not supported. + * + * \sa SDL_GL_GetSwapInterval() */ -extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); +extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); -typedef enum { - SDL_GRAB_QUERY = -1, - SDL_GRAB_OFF = 0, - SDL_GRAB_ON = 1, - SDL_GRAB_FULLSCREEN /**< Used internally */ -} SDL_GrabMode; /** - * This function allows you to set and query the input grab state of - * the application. It returns the new input grab state. + * \brief Get the swap interval for the current OpenGL context. + * + * \return 0 if there is no vertical retrace synchronization, 1 if the buffer + * swap is synchronized with the vertical retrace, and -1 if late + * swaps happen immediately instead of waiting for the next retrace. + * If the system can't determine the swap interval, or there isn't a + * valid current context, this will return 0 as a safe default. * - * Grabbing means that the mouse is confined to the application window, - * and nearly all keyboard input is passed directly to the application, - * and not interpreted by a window manager, if any. + * \sa SDL_GL_SetSwapInterval() */ -extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); +extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); + +/** + * \brief Swap the OpenGL buffers for a window, if double-buffering is + * supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); + +/** + * \brief Delete an OpenGL context. + * + * \sa SDL_GL_CreateContext() + */ +extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); + +/*@}*//*OpenGL support functions*/ -/*@}*/ -/** @internal Not in public API at the moment - do not use! */ -extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); - /* Ends C function definitions when using C++ */ #ifdef __cplusplus } @@ -949,3 +949,5 @@ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, #include "close_code.h" #endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/begin_code.h b/include/begin_code.h index 27e2f7bc75..dd1f0616d0 100644 --- a/include/begin_code.h +++ b/include/begin_code.h @@ -1,129 +1,84 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ -/** - * @file begin_code.h +/** + * \file begin_code.h + * * This file sets things up for C dynamic library function definitions, * static inlined functions, and structures aligned at 4-byte alignment. * If you don't like ugly C preprocessor code, don't look at this file. :) */ -/** - * @file begin_code.h - * This shouldn't be nested -- included it around code only. - */ +/* This shouldn't be nested -- included it around code only. */ #ifdef _begin_code_h #error Nested inclusion of begin_code.h #endif #define _begin_code_h -/** - * @def DECLSPEC - * Some compilers use a special export keyword - */ +/* Some compilers use a special export keyword */ #ifndef DECLSPEC # if defined(__BEOS__) || defined(__HAIKU__) # if defined(__GNUC__) -# define DECLSPEC +# define DECLSPEC __declspec(dllexport) # else -# define DECLSPEC __declspec(export) +# define DECLSPEC __declspec(export) # endif # elif defined(__WIN32__) # ifdef __BORLANDC__ # ifdef BUILD_SDL -# define DECLSPEC -# else -# define DECLSPEC __declspec(dllimport) -# endif -# else -# define DECLSPEC __declspec(dllexport) -# endif -# elif defined(__OS2__) -# ifdef __WATCOMC__ -# ifdef BUILD_SDL -# define DECLSPEC __declspec(dllexport) -# else # define DECLSPEC -# endif -# elif defined (__GNUC__) && __GNUC__ < 4 -# /* Added support for GCC-EMX = 4 -# define DECLSPEC __attribute__ ((visibility("default"))) +# define DECLSPEC __attribute__ ((visibility("default"))) # else # define DECLSPEC # endif # endif #endif -/** - * @def SDLCALL - * By default SDL uses the C calling convention - */ +/* By default SDL uses the C calling convention */ #ifndef SDLCALL -# if defined(__WIN32__) && !defined(__GNUC__) -# define SDLCALL __cdecl -# elif defined(__OS2__) -# if defined (__GNUC__) && __GNUC__ < 4 -# /* Added support for GCC-EMX = 4)) || defined(__clang__) ) +#define SDL_FORCE_INLINE __attribute__((always_inline)) static inline +#else +#define SDL_FORCE_INLINE static __inline__ +#endif +#endif + +/* Apparently this is needed by several Windows compilers */ #if !defined(__MACH__) #ifndef NULL #ifdef __cplusplus diff --git a/include/close_code.h b/include/close_code.h index 19a0024665..4901482d5c 100644 --- a/include/close_code.h +++ b/include/close_code.h @@ -1,46 +1,37 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ /** - * @file close_code.h + * \file close_code.h + * * This file reverses the effects of begin_code.h and should be included * after you finish any function and structure declarations in your headers */ #undef _begin_code_h -/** - * @file close_code.h - * Reset structure packing at previous byte alignment - */ +/* Reset structure packing at previous byte alignment */ #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) #ifdef __BORLANDC__ #pragma nopackwarning #endif -#if (defined(__MWERKS__) && defined(__MACOS__)) -#pragma options align=reset -#pragma enumsalwaysint reset -#else #pragma pack(pop) -#endif #endif /* Compiler needs structure packing set */ - diff --git a/include/doxyfile b/include/doxyfile index 29dcf5b459..495dbc19bc 100644 --- a/include/doxyfile +++ b/include/doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.2.16 +# Doxyfile 1.5.9 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -11,383 +11,702 @@ # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- -# General configuration options +# Project related configuration options #--------------------------------------------------------------------------- -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = SDL -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.2.15 +PROJECT_NUMBER = 2.0.0 -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = docs +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = YES -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean, -# Norwegian, Polish, Portuguese, Romanian, Russian, Slovak, Slovene, -# Spanish, Swedish and Ukrainian. +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. -EXTRACT_ALL = NO +BRIEF_MEMBER_DESC = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. -EXTRACT_PRIVATE = NO +REPEAT_BRIEF = YES -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. -EXTRACT_STATIC = NO +ALWAYS_DETAILED_SEC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. -EXTRACT_LOCAL_CLASSES = NO +INLINE_INHERITED_MEMB = NO -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. -HIDE_UNDOC_MEMBERS = NO +FULL_PATH_NAMES = YES -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these class will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. -HIDE_UNDOC_CLASSES = NO +STRIP_FROM_PATH = -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. -BRIEF_MEMBER_DESC = YES +STRIP_FROM_INC_PATH = -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. -REPEAT_BRIEF = YES +SHORT_NAMES = NO -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) -ALWAYS_DETAILED_SEC = NO +JAVADOC_AUTOBRIEF = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) -INLINE_INHERITED_MEMB = NO +QT_AUTOBRIEF = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. -FULL_PATH_NAMES = NO +MULTILINE_CPP_IS_BRIEF = NO -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. -STRIP_FROM_PATH = +INHERIT_DOCS = YES -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. -INTERNAL_DOCS = NO +SEPARATE_MEMBER_PAGES = NO -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. -STRIP_CODE_COMMENTS = YES +TAB_SIZE = 8 -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower case letters. If set to YES upper case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are adviced to set this option to NO. +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. -CASE_SENSE_NAMES = YES +ALIASES = "defined=\"\def\"" \ + "discussion=\"\par Discussion:\n\"" -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. -SHORT_NAMES = NO +OPTIMIZE_OUTPUT_FOR_C = YES -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. -HIDE_SCOPE_NAMES = NO +OPTIMIZE_OUTPUT_JAVA = NO -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. -VERBATIM_HEADERS = YES +OPTIMIZE_FOR_FORTRAN = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put list of the files that are included by a file in the documentation -# of that file. +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. -SHOW_INCLUDE_FILES = YES +OPTIMIZE_OUTPUT_VHDL = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explict @brief command for a brief description. +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set +# FILE_PATTERNS otherwise the files are not read by doxygen. -JAVADOC_AUTOBRIEF = NO +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = YES + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the # documentation. -DETAILS_AT_TOP = NO +HIDE_FRIEND_COMPOUNDS = NO -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# reimplements. +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. -INHERIT_DOCS = YES +HIDE_IN_BODY_DOCS = NO -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. -DISTRIBUTE_GROUP_DOC = NO +SORT_BRIEF_DOCS = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. -TAB_SIZE = 4 +SORT_BY_SCOPE_NAME = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. -ALIASES = +GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional +# The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. -ENABLED_SECTIONS = +ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consist of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance some of the names that are used will be different. The list -# of all members will be omitted, etc. +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. -OPTIMIZE_OUTPUT_FOR_C = YES +SHOW_DIRECTORIES = YES -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance namespaces will be presented as packages, qualified scopes -# will look different, etc. +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. -OPTIMIZE_OUTPUT_JAVA = NO +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. +FILE_VERSION_FILTER = -SHOW_USED_FILES = YES +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated +# The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written # to stderr. -WARN_LOGFILE = +WARN_LOGFILE = ./doxygen_warn.txt #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = include - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl - -FILE_PATTERNS = *.h - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. +INPUT = . + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl \ + *.h.in \ + *.h.default + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. -RECURSIVE = NO +RECURSIVE = YES -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = +EXCLUDE = ../doxy \ + ../test \ + ../Xcode \ + ../VisualC \ + ../VisualCE \ + ../Xcode-iOS -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. EXCLUDE_SYMLINKS = NO -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* EXCLUDE_PATTERNS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left # blank all files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = * -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. -EXAMPLE_RECURSIVE = NO +EXAMPLE_RECURSIVE = YES -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = +IMAGE_PATH = -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. -INPUT_FILTER = +INPUT_FILTER = -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse. +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO @@ -395,552 +714,842 @@ FILTER_SOURCE_FILES = NO # configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES -# Setting the INLINE_SOURCES tag to YES will include the body +# Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. -INLINE_SOURCES = NO +INLINE_SOURCES = YES + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. -ALPHABETICAL_INDEX = NO +ALPHABETICAL_INDEX = YES -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = +IGNORE_PREFIX = SDL_ \ + SDL #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = +HTML_HEADER = -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = +HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = +HTML_STYLESHEET = -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = YES + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "SDL 2.0 Doxygen" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.libsdl.sdl20 + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = ./sdl20.chm + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the Html help documentation and to the tree view. +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. -TOC_EXPAND = NO +TOC_EXPAND = YES -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. -DISABLE_INDEX = NO +GENERATE_QHP = NO -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = -ENUM_VALUES_PER_LINE = 4 +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+, -# or Internet explorer 4.0+). Note that for large projects the tree generation -# can take a very long time. In such cases it is better to disable this feature. -# Windows users are probably better off using the HTML help feature. +QHP_CUST_FILTER_ATTRS = -GENERATE_TREEVIEW = NO +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 1 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to FRAME, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. Other possible values +# for this tag are: HIERARCHIES, which will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list; +# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which +# disables this behavior completely. For backwards compatibility with previous +# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE +# respectively. + +GENERATE_TREEVIEW = ALL + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be invoked. If left blank `latex' will be used as the default command name. +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. -EXTRA_PACKAGES = +EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! -LATEX_HEADER = +LATEX_HEADER = -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. -PDF_HYPERLINKS = NO +PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. -USE_PDFLATEX = NO +USE_PDFLATEX = YES -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimised for Word 97 and may not look very pretty with +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. -GENERATE_RTF = YES +GENERATE_RTF = NO -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assigments. You only have to provide +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = -# Set optional variables used in the generation of an rtf document. +# Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages -GENERATE_MAN = YES +GENERATE_MAN = NO -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man -# The MAN_EXTENSION tag determines the extension that is added to +# The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. -MAN_LINKS = YES +MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. GENERATE_XML = NO +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by # the preprocessor. -INCLUDE_PATH = +INCLUDE_PATH = -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. -PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 SDLCALL= SNDDECLSPEC= +PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 \ + DECLSPEC= \ + SDLCALL= \ + _WIN32=1 -# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line and do not end with a semicolon. Such function macros are typically -# used for boiler-plate code, and will confuse the parser if not removed. +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- -# The TAGFILES tag can be used to specify one or more tagfiles. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. -GENERATE_TAGFILE = +GENERATE_TAGFILE = ./SDL.tag -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES -# The PERL_PATH should be the absolute path and name of the perl script +# The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). -PERL_PATH = /usr/bin/perl +PERL_PATH = c:\Perl\bin\perl.exe #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superceded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. -CLASS_DIAGRAMS = NO +MSCGEN_PATH = -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = YES + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. -CLASS_GRAPH = NO +CLASS_GRAPH = YES -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. -COLLABORATION_GRAPH = NO +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies -# If set to YES, the inheritance and collaboration graphs will show the +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. -TEMPLATE_RELATIONS = NO +TEMPLATE_RELATIONS = YES -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with # other documented files. -INCLUDE_GRAPH = NO +INCLUDE_GRAPH = YES -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. -DOT_PATH = +DOT_PATH = -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the # \dotfile command). -DOTFILE_DIRS = +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. -MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_DEPTH = 2 -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). -MAX_DOT_GRAPH_HEIGHT = 1024 +DOT_TRANSPARENT = NO -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermedate dot files that are used to generate +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine +# Options related to the search engine #--------------------------------------------------------------------------- -# The SEARCHENGINE tag specifies whether or not a search engine should be +# The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO - -# The CGI_NAME tag should be the name of the CGI script that -# starts the search engine (doxysearch) with the correct parameters. -# A script with this name will be generated by doxygen. - -CGI_NAME = search.cgi - -# The CGI_URL tag should be the absolute URL to the directory where the -# cgi binaries are located. See the documentation of your http daemon for -# details. - -CGI_URL = - -# The DOC_URL tag should be the absolute URL to the directory where the -# documentation is located. If left blank the absolute path to the -# documentation, with file:// prepended to it, will be used. - -DOC_URL = - -# The DOC_ABSPATH tag should be the absolute path to the directory where the -# documentation is located. If left blank the directory on the local machine -# will be used. - -DOC_ABSPATH = - -# The BIN_ABSPATH tag must point to the directory where the doxysearch binary -# is installed. - -BIN_ABSPATH = /usr/local/bin/ - -# The EXT_DOC_PATHS tag can be used to specify one or more paths to -# documentation generated for other projects. This allows doxysearch to search -# the documentation for these projects as well. - -EXT_DOC_PATHS = diff --git a/sdl-config.in b/sdl-config.in deleted file mode 100644 index e0fcc0ced5..0000000000 --- a/sdl-config.in +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -exec_prefix_set=no -libdir=@libdir@ - -@ENABLE_STATIC_FALSE@usage="\ -@ENABLE_STATIC_FALSE@Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" -@ENABLE_STATIC_TRUE@usage="\ -@ENABLE_STATIC_TRUE@Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]" - -if test $# -eq 0; then - echo "${usage}" 1>&2 - exit 1 -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --prefix=*) - prefix=$optarg - if test $exec_prefix_set = no ; then - exec_prefix=$optarg - fi - ;; - --prefix) - echo $prefix - ;; - --exec-prefix=*) - exec_prefix=$optarg - exec_prefix_set=yes - ;; - --exec-prefix) - echo $exec_prefix - ;; - --version) - echo @SDL_VERSION@ - ;; - --cflags) - echo -I@includedir@/SDL @SDL_CFLAGS@ - ;; -@ENABLE_SHARED_TRUE@ --libs) -@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ -@ENABLE_SHARED_TRUE@ ;; -@ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) -@ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) -@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@ -@ENABLE_STATIC_TRUE@ ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done diff --git a/sdl.m4 b/sdl.m4 deleted file mode 100644 index 639eb85179..0000000000 --- a/sdl.m4 +++ /dev/null @@ -1,185 +0,0 @@ -# Configure paths for SDL -# Sam Lantinga 9/21/99 -# stolen from Manish Singh -# stolen back from Frank Belew -# stolen from Manish Singh -# Shamelessly stolen from Owen Taylor - -# serial 1 - -dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS -dnl -AC_DEFUN([AM_PATH_SDL], -[dnl -dnl Get the cflags and libraries from the sdl-config script -dnl -AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], - sdl_prefix="$withval", sdl_prefix="") -AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], - sdl_exec_prefix="$withval", sdl_exec_prefix="") -AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], - , enable_sdltest=yes) - - if test x$sdl_exec_prefix != x ; then - sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" - if test x${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config - fi - fi - if test x$sdl_prefix != x ; then - sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" - if test x${SDL_CONFIG+set} != xset ; then - SDL_CONFIG=$sdl_prefix/bin/sdl-config - fi - fi - - as_save_PATH="$PATH" - if test "x$prefix" != xNONE; then - PATH="$prefix/bin:$prefix/usr/bin:$PATH" - fi - AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH]) - PATH="$as_save_PATH" - min_sdl_version=ifelse([$1], ,0.11.0,$1) - AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) - no_sdl="" - if test "$SDL_CONFIG" = "no" ; then - no_sdl=yes - else - SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags` - SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs` - - sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_sdltest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" -dnl -dnl Now check if the installed SDL is sufficiently new. (Also sanity -dnl checks the results of sdl-config to some extent -dnl - rm -f conf.sdltest - AC_TRY_RUN([ -#include -#include -#include -#include "SDL.h" - -char* -my_strdup (char *str) -{ - char *new_str; - - if (str) - { - new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); - strcpy (new_str, str); - } - else - new_str = NULL; - - return new_str; -} - -int main (int argc, char *argv[]) -{ - int major, minor, micro; - char *tmp_version; - - /* This hangs on some systems (?) - system ("touch conf.sdltest"); - */ - { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } - - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = my_strdup("$min_sdl_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_sdl_version"); - exit(1); - } - - if (($sdl_major_version > major) || - (($sdl_major_version == major) && ($sdl_minor_version > minor)) || - (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); - printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); - printf("*** best to upgrade to the required version.\n"); - printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); - printf("*** to point to the correct copy of sdl-config, and remove the file\n"); - printf("*** config.cache before re-running configure\n"); - return 1; - } -} - -],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - if test "x$no_sdl" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$SDL_CONFIG" = "no" ; then - echo "*** The sdl-config script installed by SDL could not be found" - echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the SDL_CONFIG environment variable to the" - echo "*** full path to sdl-config." - else - if test -f conf.sdltest ; then - : - else - echo "*** Could not run SDL test program, checking why..." - CFLAGS="$CFLAGS $SDL_CFLAGS" - CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" - LIBS="$LIBS $SDL_LIBS" - AC_TRY_LINK([ -#include -#include "SDL.h" - -int main(int argc, char *argv[]) -{ return 0; } -#undef main -#define main K_and_R_C_main -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding SDL or finding the wrong" - echo "*** version of SDL. If it is not finding SDL, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means SDL was incorrectly installed" - echo "*** or that you have moved SDL since it was installed. In the latter case, you" - echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - SDL_CFLAGS="" - SDL_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(SDL_CFLAGS) - AC_SUBST(SDL_LIBS) - rm -f conf.sdltest -]) diff --git a/sdl.pc.in b/sdl.pc.in deleted file mode 100644 index 2d43ac9255..0000000000 --- a/sdl.pc.in +++ /dev/null @@ -1,15 +0,0 @@ -# sdl pkg-config source file - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: sdl -Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. -Version: @SDL_VERSION@ -Requires: -Conflicts: -Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ -Libs.private: @SDL_STATIC_LIBS@ -Cflags: -I${includedir}/SDL @SDL_CFLAGS@ diff --git a/sdl2-config.in b/sdl2-config.in new file mode 100644 index 0000000000..254a345e69 --- /dev/null +++ b/sdl2-config.in @@ -0,0 +1,60 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +exec_prefix_set=no +libdir=@libdir@ + +@ENABLE_STATIC_FALSE@usage="\ +@ENABLE_STATIC_FALSE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" +@ENABLE_STATIC_TRUE@usage="\ +@ENABLE_STATIC_TRUE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --version) + echo @SDL_VERSION@ + ;; + --cflags) + echo -I@includedir@/SDL2 @SDL_CFLAGS@ + ;; +@ENABLE_SHARED_TRUE@ --libs) +@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ +@ENABLE_SHARED_TRUE@ ;; +@ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs) +@ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs) +@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@ +@ENABLE_STATIC_TRUE@ ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done diff --git a/sdl2.m4 b/sdl2.m4 new file mode 100644 index 0000000000..a03b2d2706 --- /dev/null +++ b/sdl2.m4 @@ -0,0 +1,202 @@ +# Configure paths for SDL +# Sam Lantinga 9/21/99 +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +# serial 1 + +dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN([AM_PATH_SDL2], +[dnl +dnl Get the cflags and libraries from the sdl2-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + min_sdl_version=ifelse([$1], ,2.0.0,$1) + + if test "x$sdl_prefix$sdl_exec_prefix" = x ; then + PKG_CHECK_MODULES([SDL], [sdl2 >= $min_sdl_version], + [sdl_pc=yes], + [sdl_pc=no]) + else + sdl_pc=no + if test x$sdl_exec_prefix != x ; then + sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_exec_prefix/bin/sdl2-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" + if test x${SDL2_CONFIG+set} != xset ; then + SDL2_CONFIG=$sdl_prefix/bin/sdl2-config + fi + fi + fi + + if test "x$sdl_pc" = xyes ; then + no_sdl="" + SDL2_CONFIG="pkg-config sdl2" + else + as_save_PATH="$PATH" + if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + fi + AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no, [$PATH]) + PATH="$as_save_PATH" + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + + if test "$SDL2_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL2_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL2_CONFIG $sdl_config_args --libs` + + sdl_major_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL2_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl2-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl2-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl2-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl2-config was wrong, set the environment variable SDL2_CONFIG\n"); + printf("*** to point to the correct copy of sdl2-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + fi + if test "x$no_sdl" = x ; then + ifelse([$2], , :, [$2]) + else + if test "$SDL2_CONFIG" = "no" ; then + echo "*** The sdl2-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL2_CONFIG environment variable to the" + echo "*** full path to sdl2-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) diff --git a/sdl2.pc.in b/sdl2.pc.in new file mode 100644 index 0000000000..b11667dc6b --- /dev/null +++ b/sdl2.pc.in @@ -0,0 +1,15 @@ +# sdl pkg-config source file + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: sdl2 +Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. +Version: @SDL_VERSION@ +Requires: +Conflicts: +Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ +Libs.private: @SDL_STATIC_LIBS@ +Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@ diff --git a/src/SDL.c b/src/SDL.c index 87f1b1af2a..d8c05fb5b2 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -1,350 +1,463 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Initialization code for SDL */ #include "SDL.h" -#include "SDL_fatal.h" -#if !SDL_VIDEO_DISABLED -#include "video/SDL_leaks.h" -#endif - -#if SDL_THREAD_PTH -#include -#endif +#include "SDL_bits.h" +#include "SDL_revision.h" +#include "SDL_assert_c.h" +#include "events/SDL_events_c.h" +#include "haptic/SDL_haptic_c.h" +#include "joystick/SDL_joystick_c.h" /* Initialization/Cleanup routines */ -#if !SDL_JOYSTICK_DISABLED -extern int SDL_JoystickInit(void); -extern void SDL_JoystickQuit(void); -#endif -#if !SDL_CDROM_DISABLED -extern int SDL_CDROMInit(void); -extern void SDL_CDROMQuit(void); -#endif #if !SDL_TIMERS_DISABLED -extern void SDL_StartTicks(void); -extern int SDL_TimerInit(void); +extern int SDL_TimerInit(void); extern void SDL_TimerQuit(void); +extern void SDL_InitTicks(void); +#endif +#if SDL_VIDEO_DRIVER_WINDOWS +extern int SDL_HelperWindowCreate(void); +extern int SDL_HelperWindowDestroy(void); #endif -/* The current SDL version */ -static SDL_version version = - { SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL }; /* The initialized subsystems */ -static Uint32 SDL_initialized = 0; +#ifdef SDL_MAIN_NEEDED +static SDL_bool SDL_MainIsReady = SDL_FALSE; +#else +static SDL_bool SDL_MainIsReady = SDL_TRUE; +#endif +static SDL_bool SDL_bInMainQuit = SDL_FALSE; +static Uint8 SDL_SubsystemRefCount[ 32 ]; + +/* Private helper to increment a subsystem's ref counter. */ +static void +SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem) +{ + int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255); + ++SDL_SubsystemRefCount[subsystem_index]; +} + +/* Private helper to decrement a subsystem's ref counter. */ +static void +SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) +{ + int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + if (SDL_SubsystemRefCount[subsystem_index] > 0) { + --SDL_SubsystemRefCount[subsystem_index]; + } +} + +/* Private helper to check if a system needs init. */ +static SDL_bool +SDL_PrivateShouldInitSubsystem(Uint32 subsystem) +{ + int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + SDL_assert(SDL_SubsystemRefCount[subsystem_index] < 255); + return (SDL_SubsystemRefCount[subsystem_index] == 0); +} + +/* Private helper to check if a system needs to be quit. */ +static SDL_bool +SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) { + int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + if (SDL_SubsystemRefCount[subsystem_index] == 0) { + return SDL_FALSE; + } + + /* If we're in SDL_Quit, we shut down every subsystem, even if refcount + * isn't zero. + */ + return SDL_SubsystemRefCount[subsystem_index] == 1 || SDL_bInMainQuit; +} + +void +SDL_SetMainReady(void) +{ + SDL_MainIsReady = SDL_TRUE; +} + +int +SDL_InitSubSystem(Uint32 flags) +{ + if (!SDL_MainIsReady) { + SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?"); + return -1; + } + + /* Clear the error message */ + SDL_ClearError(); + +#if SDL_VIDEO_DRIVER_WINDOWS + if (SDL_HelperWindowCreate() < 0) { + return -1; + } +#endif + #if !SDL_TIMERS_DISABLED -static Uint32 ticks_started = 0; + SDL_InitTicks(); #endif -#ifdef CHECK_LEAKS -int surfaces_allocated = 0; + if ((flags & SDL_INIT_GAMECONTROLLER)) { + /* game controller implies joystick */ + flags |= SDL_INIT_JOYSTICK; + } + + if ((flags & (SDL_INIT_VIDEO|SDL_INIT_JOYSTICK))) { + /* video or joystick implies events */ + flags |= SDL_INIT_EVENTS; + } + + /* Initialize the event subsystem */ + if ((flags & SDL_INIT_EVENTS)) { +#if !SDL_EVENTS_DISABLED + if (SDL_PrivateShouldInitSubsystem(SDL_INIT_EVENTS)) { + if (SDL_StartEventLoop() < 0) { + return (-1); + } + SDL_QuitInit(); + } + SDL_PrivateSubsystemRefCountIncr(SDL_INIT_EVENTS); +#else + return SDL_SetError("SDL not built with events support"); #endif + } -int SDL_InitSubSystem(Uint32 flags) -{ + /* Initialize the timer subsystem */ + if ((flags & SDL_INIT_TIMER)){ #if !SDL_TIMERS_DISABLED - /* Initialize the timer subsystem */ - if ( ! ticks_started ) { - SDL_StartTicks(); - ticks_started = 1; - } - if ( (flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER) ) { - if ( SDL_TimerInit() < 0 ) { - return(-1); - } - SDL_initialized |= SDL_INIT_TIMER; - } + if (SDL_PrivateShouldInitSubsystem(SDL_INIT_TIMER)) { + if (SDL_TimerInit() < 0) { + return (-1); + } + } + SDL_PrivateSubsystemRefCountIncr(SDL_INIT_TIMER); #else - if ( flags & SDL_INIT_TIMER ) { - SDL_SetError("SDL not built with timer support"); - return(-1); - } + return SDL_SetError("SDL not built with timer support"); #endif + } + /* Initialize the video subsystem */ + if ((flags & SDL_INIT_VIDEO)){ #if !SDL_VIDEO_DISABLED - /* Initialize the video/event subsystem */ - if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) { - if ( SDL_VideoInit(SDL_getenv("SDL_VIDEODRIVER"), - (flags&SDL_INIT_EVENTTHREAD)) < 0 ) { - return(-1); - } - SDL_initialized |= SDL_INIT_VIDEO; - } + if (SDL_PrivateShouldInitSubsystem(SDL_INIT_VIDEO)) { + if (SDL_VideoInit(NULL) < 0) { + return (-1); + } + } + SDL_PrivateSubsystemRefCountIncr(SDL_INIT_VIDEO); #else - if ( flags & SDL_INIT_VIDEO ) { - SDL_SetError("SDL not built with video support"); - return(-1); - } + return SDL_SetError("SDL not built with video support"); #endif + } + /* Initialize the audio subsystem */ + if ((flags & SDL_INIT_AUDIO)){ #if !SDL_AUDIO_DISABLED - /* Initialize the audio subsystem */ - if ( (flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO) ) { - if ( SDL_AudioInit(SDL_getenv("SDL_AUDIODRIVER")) < 0 ) { - return(-1); - } - SDL_initialized |= SDL_INIT_AUDIO; - } + if (SDL_PrivateShouldInitSubsystem(SDL_INIT_AUDIO)) { + if (SDL_AudioInit(NULL) < 0) { + return (-1); + } + } + SDL_PrivateSubsystemRefCountIncr(SDL_INIT_AUDIO); #else - if ( flags & SDL_INIT_AUDIO ) { - SDL_SetError("SDL not built with audio support"); - return(-1); - } + return SDL_SetError("SDL not built with audio support"); #endif + } + /* Initialize the joystick subsystem */ + if ((flags & SDL_INIT_JOYSTICK)){ #if !SDL_JOYSTICK_DISABLED - /* Initialize the joystick subsystem */ - if ( (flags & SDL_INIT_JOYSTICK) && - !(SDL_initialized & SDL_INIT_JOYSTICK) ) { - if ( SDL_JoystickInit() < 0 ) { - return(-1); - } - SDL_initialized |= SDL_INIT_JOYSTICK; - } + if (SDL_PrivateShouldInitSubsystem(SDL_INIT_JOYSTICK)) { + if (SDL_JoystickInit() < 0) { + return (-1); + } + } + SDL_PrivateSubsystemRefCountIncr(SDL_INIT_JOYSTICK); #else - if ( flags & SDL_INIT_JOYSTICK ) { - SDL_SetError("SDL not built with joystick support"); - return(-1); - } + return SDL_SetError("SDL not built with joystick support"); #endif + } -#if !SDL_CDROM_DISABLED - /* Initialize the CD-ROM subsystem */ - if ( (flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM) ) { - if ( SDL_CDROMInit() < 0 ) { - return(-1); - } - SDL_initialized |= SDL_INIT_CDROM; - } + if ((flags & SDL_INIT_GAMECONTROLLER)){ +#if !SDL_JOYSTICK_DISABLED + if (SDL_PrivateShouldInitSubsystem(SDL_INIT_GAMECONTROLLER)) { + if (SDL_GameControllerInit() < 0) { + return (-1); + } + } + SDL_PrivateSubsystemRefCountIncr(SDL_INIT_GAMECONTROLLER); #else - if ( flags & SDL_INIT_CDROM ) { - SDL_SetError("SDL not built with cdrom support"); - return(-1); - } + return SDL_SetError("SDL not built with joystick support"); #endif - return(0); -} + } -int SDL_Init(Uint32 flags) -{ -#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH - if (!pth_init()) { - return -1; - } + /* Initialize the haptic subsystem */ + if ((flags & SDL_INIT_HAPTIC)){ +#if !SDL_HAPTIC_DISABLED + if (SDL_PrivateShouldInitSubsystem(SDL_INIT_HAPTIC)) { + if (SDL_HapticInit() < 0) { + return (-1); + } + } + SDL_PrivateSubsystemRefCountIncr(SDL_INIT_HAPTIC); +#else + return SDL_SetError("SDL not built with haptic (force feedback) support"); #endif + } - /* Clear the error message */ - SDL_ClearError(); - - /* Initialize the desired subsystems */ - if ( SDL_InitSubSystem(flags) < 0 ) { - return(-1); - } + return (0); +} - /* Everything is initialized */ - if ( !(flags & SDL_INIT_NOPARACHUTE) ) { - SDL_InstallParachute(); - } - return(0); +int +SDL_Init(Uint32 flags) +{ + return SDL_InitSubSystem(flags); } -void SDL_QuitSubSystem(Uint32 flags) +void +SDL_QuitSubSystem(Uint32 flags) { - /* Shut down requested initialized subsystems */ -#if !SDL_CDROM_DISABLED - if ( (flags & SDL_initialized & SDL_INIT_CDROM) ) { - SDL_CDROMQuit(); - SDL_initialized &= ~SDL_INIT_CDROM; - } -#endif + /* Shut down requested initialized subsystems */ #if !SDL_JOYSTICK_DISABLED - if ( (flags & SDL_initialized & SDL_INIT_JOYSTICK) ) { - SDL_JoystickQuit(); - SDL_initialized &= ~SDL_INIT_JOYSTICK; - } + if ((flags & SDL_INIT_GAMECONTROLLER)) { + /* game controller implies joystick */ + flags |= SDL_INIT_JOYSTICK; + + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_GAMECONTROLLER)) { + SDL_GameControllerQuit(); + } + SDL_PrivateSubsystemRefCountDecr(SDL_INIT_GAMECONTROLLER); + } + + if ((flags & SDL_INIT_JOYSTICK)) { + /* joystick implies events */ + flags |= SDL_INIT_EVENTS; + + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_JOYSTICK)) { + SDL_JoystickQuit(); + } + SDL_PrivateSubsystemRefCountDecr(SDL_INIT_JOYSTICK); + } #endif + +#if !SDL_HAPTIC_DISABLED + if ((flags & SDL_INIT_HAPTIC)) { + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_HAPTIC)) { + SDL_HapticQuit(); + } + SDL_PrivateSubsystemRefCountDecr(SDL_INIT_HAPTIC); + } +#endif + #if !SDL_AUDIO_DISABLED - if ( (flags & SDL_initialized & SDL_INIT_AUDIO) ) { - SDL_AudioQuit(); - SDL_initialized &= ~SDL_INIT_AUDIO; - } + if ((flags & SDL_INIT_AUDIO)) { + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_AUDIO)) { + SDL_AudioQuit(); + } + SDL_PrivateSubsystemRefCountDecr(SDL_INIT_AUDIO); + } #endif + #if !SDL_VIDEO_DISABLED - if ( (flags & SDL_initialized & SDL_INIT_VIDEO) ) { - SDL_VideoQuit(); - SDL_initialized &= ~SDL_INIT_VIDEO; - } + if ((flags & SDL_INIT_VIDEO)) { + /* video implies events */ + flags |= SDL_INIT_EVENTS; + + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_VIDEO)) { + SDL_VideoQuit(); + } + SDL_PrivateSubsystemRefCountDecr(SDL_INIT_VIDEO); + } #endif + #if !SDL_TIMERS_DISABLED - if ( (flags & SDL_initialized & SDL_INIT_TIMER) ) { - SDL_TimerQuit(); - SDL_initialized &= ~SDL_INIT_TIMER; - } + if ((flags & SDL_INIT_TIMER)) { + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_TIMER)) { + SDL_TimerQuit(); + } + SDL_PrivateSubsystemRefCountDecr(SDL_INIT_TIMER); + } #endif -} -Uint32 SDL_WasInit(Uint32 flags) -{ - if ( ! flags ) { - flags = SDL_INIT_EVERYTHING; - } - return (SDL_initialized&flags); +#if !SDL_EVENTS_DISABLED + if ((flags & SDL_INIT_EVENTS)) { + if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_EVENTS)) { + SDL_QuitQuit(); + SDL_StopEventLoop(); + } + SDL_PrivateSubsystemRefCountDecr(SDL_INIT_EVENTS); + } +#endif } -void SDL_Quit(void) +Uint32 +SDL_WasInit(Uint32 flags) { - /* Quit all subsystems */ -#ifdef DEBUG_BUILD - printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); fflush(stdout); -#endif - SDL_QuitSubSystem(SDL_INIT_EVERYTHING); + int i; + int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount); + Uint32 initialized = 0; -#ifdef CHECK_LEAKS -#ifdef DEBUG_BUILD - printf("[SDL_Quit] : CHECK_LEAKS\n"); fflush(stdout); -#endif + if (!flags) { + flags = SDL_INIT_EVERYTHING; + } - /* Print the number of surfaces not freed */ - if ( surfaces_allocated != 0 ) { - fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n", - surfaces_allocated); - } -#endif -#ifdef DEBUG_BUILD - printf("[SDL_Quit] : SDL_UninstallParachute()\n"); fflush(stdout); -#endif + num_subsystems = SDL_min(num_subsystems, SDL_MostSignificantBitIndex32(flags) + 1); - /* Uninstall any parachute signal handlers */ - SDL_UninstallParachute(); + /* Iterate over each bit in flags, and check the matching subsystem. */ + for (i = 0; i < num_subsystems; ++i) { + if ((flags & 1) && SDL_SubsystemRefCount[i] > 0) { + initialized |= (1 << i); + } -#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH - pth_kill(); -#endif -#ifdef DEBUG_BUILD - printf("[SDL_Quit] : Returning!\n"); fflush(stdout); -#endif + flags >>= 1; + } + return initialized; } -/* Return the library version number */ -const SDL_version * SDL_Linked_Version(void) +void +SDL_Quit(void) { - return(&version); -} + SDL_bInMainQuit = SDL_TRUE; + + /* Quit all subsystems */ +#if SDL_VIDEO_DRIVER_WINDOWS + SDL_HelperWindowDestroy(); +#endif + SDL_QuitSubSystem(SDL_INIT_EVERYTHING); + + SDL_ClearHints(); + SDL_AssertionsQuit(); + SDL_LogResetPriorities(); -#if defined(__OS2__) -/* Building for OS/2 */ -#ifdef __WATCOMC__ + /* Now that every subsystem has been quit, we reset the subsystem refcount + * and the list of initialized subsystems. + */ + SDL_memset( SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount) ); -#define INCL_DOSERRORS -#define INCL_DOSEXCEPTIONS -#include + SDL_bInMainQuit = SDL_FALSE; +} -/* Exception handler to prevent the Audio thread hanging, making a zombie process! */ -ULONG _System SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec, - PEXCEPTIONREGISTRATIONRECORD pERegRec, - PCONTEXTRECORD pCtxRec, - PVOID p) +/* Get the library version number */ +void +SDL_GetVersion(SDL_version * ver) { - if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND) - return XCPT_CONTINUE_SEARCH; - if (pERepRec->fHandlerFlags & EH_UNWINDING) - return XCPT_CONTINUE_SEARCH; - if (pERepRec->fHandlerFlags & EH_NESTED_CALL) - return XCPT_CONTINUE_SEARCH; - - /* Do cleanup at every fatal exception! */ - if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) && - (pERepRec->ExceptionNum != XCPT_BREAKPOINT) && - (pERepRec->ExceptionNum != XCPT_SINGLE_STEP) - ) - { - if (SDL_initialized & SDL_INIT_AUDIO) - { - /* This removes the zombie audio thread in case of emergency. */ -#ifdef DEBUG_BUILD - printf("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n"); -#endif - SDL_CloseAudio(); - } - } - return (XCPT_CONTINUE_SEARCH); + SDL_VERSION(ver); } +/* Get the library source revision */ +const char * +SDL_GetRevision(void) +{ + return SDL_REVISION; +} -EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = {0, SDL_Main_ExceptionHandler}; +/* Get the library source revision number */ +int +SDL_GetRevisionNumber(void) +{ + return SDL_REVISION_NUMBER; +} -/* The main DLL entry for DLL Initialization and Uninitialization: */ -unsigned _System LibMain(unsigned hmod, unsigned termination) +/* Get the name of the platform */ +const char * +SDL_GetPlatform() { - if (termination) - { -#ifdef DEBUG_BUILD -/* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */ -#endif - DosUnsetExceptionHandler(&SDL_Main_xcpthand); - return 1; - } else - { -#ifdef DEBUG_BUILD - /* Make stdout and stderr unbuffered! */ - setbuf(stdout, NULL); - setbuf(stderr, NULL); -#endif - /* Fire up exception handler */ -#ifdef DEBUG_BUILD -/* printf("[SDL DLL Initialization] : Setting exception handler\n"); */ +#if __AIX__ + return "AIX"; +#elif __ANDROID__ + return "Android"; +#elif __BEOS__ + return "BeOS"; +#elif __BSDI__ + return "BSDI"; +#elif __DREAMCAST__ + return "Dreamcast"; +#elif __FREEBSD__ + return "FreeBSD"; +#elif __HAIKU__ + return "Haiku"; +#elif __HPUX__ + return "HP-UX"; +#elif __IRIX__ + return "Irix"; +#elif __LINUX__ + return "Linux"; +#elif __MINT__ + return "Atari MiNT"; +#elif __MACOS__ + return "MacOS Classic"; +#elif __MACOSX__ + return "Mac OS X"; +#elif __NETBSD__ + return "NetBSD"; +#elif __OPENBSD__ + return "OpenBSD"; +#elif __OS2__ + return "OS/2"; +#elif __OSF__ + return "OSF/1"; +#elif __QNXNTO__ + return "QNX Neutrino"; +#elif __RISCOS__ + return "RISC OS"; +#elif __SOLARIS__ + return "Solaris"; +#elif __WIN32__ + return "Windows"; +#elif __IPHONEOS__ + return "iOS"; +#elif __PSP__ + return "PlayStation Portable"; +#else + return "Unknown (see SDL_platform.h)"; #endif - /* Set exception handler */ - DosSetExceptionHandler(&SDL_Main_xcpthand); - - return 1; - } } -#endif /* __WATCOMC__ */ -#elif defined(__WIN32__) && !defined(__SYMBIAN32__) +#if defined(__WIN32__) #if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL)) /* Need to include DllMain() on Watcom C for some reason.. */ -#define WIN32_LEAN_AND_MEAN -#include +#include "core/windows/SDL_windows.h" -BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved ) +BOOL APIENTRY +_DllMainCRTStartup(HANDLE hModule, + DWORD ul_reason_for_call, LPVOID lpReserved) { - switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; + switch (ul_reason_for_call) { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; } #endif /* building DLL with Watcom C */ -#endif /* OS/2 elif __WIN32__ */ +#endif /* __WIN32__ */ + +/* vi: set sts=4 ts=4 sw=4 expandtab: */ diff --git a/src/SDL_assert.c b/src/SDL_assert.c new file mode 100644 index 0000000000..a4cf6434fe --- /dev/null +++ b/src/SDL_assert.c @@ -0,0 +1,367 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL.h" +#include "SDL_atomic.h" +#include "SDL_messagebox.h" +#include "SDL_video.h" +#include "SDL_assert.h" +#include "SDL_assert_c.h" +#include "video/SDL_sysvideo.h" + +#ifdef __WIN32__ +#include "core/windows/SDL_windows.h" + +#ifndef WS_OVERLAPPEDWINDOW +#define WS_OVERLAPPEDWINDOW 0 +#endif +#else /* fprintf, _exit(), etc. */ +#include +#include +#include +#endif + +static SDL_assert_state +SDL_PromptAssertion(const SDL_assert_data *data, void *userdata); + +/* + * We keep all triggered assertions in a singly-linked list so we can + * generate a report later. + */ +static SDL_assert_data *triggered_assertions = NULL; + +static SDL_mutex *assertion_mutex = NULL; +static SDL_AssertionHandler assertion_handler = SDL_PromptAssertion; +static void *assertion_userdata = NULL; + +#ifdef __GNUC__ +static void +debug_print(const char *fmt, ...) __attribute__((format (printf, 1, 2))); +#endif + +static void +debug_print(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + SDL_LogMessageV(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_WARN, fmt, ap); + va_end(ap); +} + + +static void SDL_AddAssertionToReport(SDL_assert_data *data) +{ + /* (data) is always a static struct defined with the assert macros, so + we don't have to worry about copying or allocating them. */ + data->trigger_count++; + if (data->trigger_count == 1) { /* not yet added? */ + data->next = triggered_assertions; + triggered_assertions = data; + } +} + + +static void SDL_GenerateAssertionReport(void) +{ + const SDL_assert_data *item = triggered_assertions; + + /* only do this if the app hasn't assigned an assertion handler. */ + if ((item != NULL) && (assertion_handler != SDL_PromptAssertion)) { + debug_print("\n\nSDL assertion report.\n"); + debug_print("All SDL assertions between last init/quit:\n\n"); + + while (item != NULL) { + debug_print( + "'%s'\n" + " * %s (%s:%d)\n" + " * triggered %u time%s.\n" + " * always ignore: %s.\n", + item->condition, item->function, item->filename, + item->linenum, item->trigger_count, + (item->trigger_count == 1) ? "" : "s", + item->always_ignore ? "yes" : "no"); + item = item->next; + } + debug_print("\n"); + + SDL_ResetAssertionReport(); + } +} + +static void SDL_ExitProcess(int exitcode) +{ +#ifdef __WIN32__ + ExitProcess(exitcode); +#else + _exit(exitcode); +#endif +} + +static void SDL_AbortAssertion(void) +{ + SDL_Quit(); + SDL_ExitProcess(42); +} + + +static SDL_assert_state +SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) +{ +#ifdef __WIN32__ + #define ENDLINE "\r\n" +#else + #define ENDLINE "\n" +#endif + + const char *envr; + SDL_assert_state state = SDL_ASSERTION_ABORT; + SDL_Window *window; + SDL_MessageBoxData messagebox; + SDL_MessageBoxButtonData buttons[] = { + { 0, SDL_ASSERTION_RETRY, "Retry" }, + { 0, SDL_ASSERTION_BREAK, "Break" }, + { 0, SDL_ASSERTION_ABORT, "Abort" }, + { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, + SDL_ASSERTION_IGNORE, "Ignore" }, + { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, + SDL_ASSERTION_ALWAYS_IGNORE, "Always Ignore" } + }; + char *message; + int selected; + + (void) userdata; /* unused in default handler. */ + + message = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE); + if (!message) { + /* Uh oh, we're in real trouble now... */ + return SDL_ASSERTION_ABORT; + } + SDL_snprintf(message, SDL_MAX_LOG_MESSAGE, + "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE + " '%s'", + data->function, data->filename, data->linenum, + data->trigger_count, (data->trigger_count == 1) ? "time" : "times", + data->condition); + + debug_print("\n\n%s\n\n", message); + + /* let env. variable override, so unit tests won't block in a GUI. */ + envr = SDL_getenv("SDL_ASSERT"); + if (envr != NULL) { + SDL_stack_free(message); + + if (SDL_strcmp(envr, "abort") == 0) { + return SDL_ASSERTION_ABORT; + } else if (SDL_strcmp(envr, "break") == 0) { + return SDL_ASSERTION_BREAK; + } else if (SDL_strcmp(envr, "retry") == 0) { + return SDL_ASSERTION_RETRY; + } else if (SDL_strcmp(envr, "ignore") == 0) { + return SDL_ASSERTION_IGNORE; + } else if (SDL_strcmp(envr, "always_ignore") == 0) { + return SDL_ASSERTION_ALWAYS_IGNORE; + } else { + return SDL_ASSERTION_ABORT; /* oh well. */ + } + } + + /* Leave fullscreen mode, if possible (scary!) */ + window = SDL_GetFocusWindow(); + if (window) { + if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) { + SDL_MinimizeWindow(window); + } else { + /* !!! FIXME: ungrab the input if we're not fullscreen? */ + /* No need to mess with the window */ + window = NULL; + } + } + + /* Show a messagebox if we can, otherwise fall back to stdio */ + SDL_zero(messagebox); + messagebox.flags = SDL_MESSAGEBOX_WARNING; + messagebox.window = window; + messagebox.title = "Assertion Failed"; + messagebox.message = message; + messagebox.numbuttons = SDL_arraysize(buttons); + messagebox.buttons = buttons; + + if (SDL_ShowMessageBox(&messagebox, &selected) == 0) { + if (selected == -1) { + state = SDL_ASSERTION_IGNORE; + } else { + state = (SDL_assert_state)selected; + } + } +#ifdef HAVE_STDIO_H + else + { + /* this is a little hacky. */ + for ( ; ; ) { + char buf[32]; + fprintf(stderr, "Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : "); + fflush(stderr); + if (fgets(buf, sizeof (buf), stdin) == NULL) { + break; + } + + if (SDL_strcmp(buf, "a") == 0) { + state = SDL_ASSERTION_ABORT; + break; + } else if (SDL_strcmp(buf, "b") == 0) { + state = SDL_ASSERTION_BREAK; + break; + } else if (SDL_strcmp(buf, "r") == 0) { + state = SDL_ASSERTION_RETRY; + break; + } else if (SDL_strcmp(buf, "i") == 0) { + state = SDL_ASSERTION_IGNORE; + break; + } else if (SDL_strcmp(buf, "A") == 0) { + state = SDL_ASSERTION_ALWAYS_IGNORE; + break; + } + } + } +#endif /* HAVE_STDIO_H */ + + /* Re-enter fullscreen mode */ + if (window) { + SDL_RestoreWindow(window); + } + + SDL_stack_free(message); + + return state; +} + + +SDL_assert_state +SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, + int line) +{ + static int assertion_running = 0; + static SDL_SpinLock spinlock = 0; + SDL_assert_state state = SDL_ASSERTION_IGNORE; + + SDL_AtomicLock(&spinlock); + if (assertion_mutex == NULL) { /* never called SDL_Init()? */ + assertion_mutex = SDL_CreateMutex(); + if (assertion_mutex == NULL) { + SDL_AtomicUnlock(&spinlock); + return SDL_ASSERTION_IGNORE; /* oh well, I guess. */ + } + } + SDL_AtomicUnlock(&spinlock); + + if (SDL_LockMutex(assertion_mutex) < 0) { + return SDL_ASSERTION_IGNORE; /* oh well, I guess. */ + } + + /* doing this because Visual C is upset over assigning in the macro. */ + if (data->trigger_count == 0) { + data->function = func; + data->filename = file; + data->linenum = line; + } + + SDL_AddAssertionToReport(data); + + assertion_running++; + if (assertion_running > 1) { /* assert during assert! Abort. */ + if (assertion_running == 2) { + SDL_AbortAssertion(); + } else if (assertion_running == 3) { /* Abort asserted! */ + SDL_ExitProcess(42); + } else { + while (1) { /* do nothing but spin; what else can you do?! */ } + } + } + + if (!data->always_ignore) { + state = assertion_handler(data, assertion_userdata); + } + + switch (state) + { + case SDL_ASSERTION_ABORT: + SDL_AbortAssertion(); + return SDL_ASSERTION_IGNORE; /* shouldn't return, but oh well. */ + + case SDL_ASSERTION_ALWAYS_IGNORE: + state = SDL_ASSERTION_IGNORE; + data->always_ignore = 1; + break; + + case SDL_ASSERTION_IGNORE: + case SDL_ASSERTION_RETRY: + case SDL_ASSERTION_BREAK: + break; /* macro handles these. */ + } + + assertion_running--; + SDL_UnlockMutex(assertion_mutex); + + return state; +} + + +void SDL_AssertionsQuit(void) +{ + SDL_GenerateAssertionReport(); + if (assertion_mutex != NULL) { + SDL_DestroyMutex(assertion_mutex); + assertion_mutex = NULL; + } +} + +void SDL_SetAssertionHandler(SDL_AssertionHandler handler, void *userdata) +{ + if (handler != NULL) { + assertion_handler = handler; + assertion_userdata = userdata; + } else { + assertion_handler = SDL_PromptAssertion; + assertion_userdata = NULL; + } +} + +const SDL_assert_data *SDL_GetAssertionReport(void) +{ + return triggered_assertions; +} + +void SDL_ResetAssertionReport(void) +{ + SDL_assert_data *next = NULL; + SDL_assert_data *item; + for (item = triggered_assertions; item != NULL; item = next) { + next = (SDL_assert_data *) item->next; + item->always_ignore = SDL_FALSE; + item->trigger_count = 0; + item->next = NULL; + } + + triggered_assertions = NULL; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_assert_c.h b/src/SDL_assert_c.h new file mode 100644 index 0000000000..29802c04ed --- /dev/null +++ b/src/SDL_assert_c.h @@ -0,0 +1,24 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +extern void SDL_AssertionsQuit(void); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_error.c b/src/SDL_error.c index 0f06bd53a3..98ef84ac6f 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -1,238 +1,257 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Simple error handling in SDL */ +#include "SDL_log.h" #include "SDL_error.h" #include "SDL_error_c.h" + /* Routine to get the thread-specific error variable */ #if SDL_THREADS_DISABLED -/* The SDL_arraysize(The ),default (non-thread-safe) global error variable */ +/* The default (non-thread-safe) global error variable */ static SDL_error SDL_global_error; -#define SDL_GetErrBuf() (&SDL_global_error) +#define SDL_GetErrBuf() (&SDL_global_error) #else extern SDL_error *SDL_GetErrBuf(void); #endif /* SDL_THREADS_DISABLED */ -#define SDL_ERRBUFIZE 1024 +#define SDL_ERRBUFIZE 1024 /* Private functions */ -static const char *SDL_LookupString(const char *key) +static const char * +SDL_LookupString(const char *key) { - /* FIXME: Add code to lookup key in language string hash-table */ - return key; + /* FIXME: Add code to lookup key in language string hash-table */ + return key; } /* Public functions */ -void SDL_SetError (const char *fmt, ...) +int +SDL_SetError(const char *fmt, ...) { - va_list ap; - SDL_error *error; - - /* Copy in the key, mark error as valid */ - error = SDL_GetErrBuf(); - error->error = 1; - SDL_strlcpy((char *)error->key, fmt, sizeof(error->key)); - - va_start(ap, fmt); - error->argc = 0; - while ( *fmt ) { - if ( *fmt++ == '%' ) { - while ( *fmt == '.' || (*fmt >= '0' && *fmt <= '9') ) { - ++fmt; - } - switch (*fmt++) { - case 0: /* Malformed format string.. */ - --fmt; - break; - case 'c': - case 'i': - case 'd': - case 'u': - case 'o': - case 'x': - case 'X': - error->args[error->argc++].value_i = - va_arg(ap, int); - break; - case 'f': - error->args[error->argc++].value_f = - va_arg(ap, double); - break; - case 'p': - error->args[error->argc++].value_ptr = - va_arg(ap, void *); - break; - case 's': - { - int i = error->argc; - const char *str = va_arg(ap, const char *); - if (str == NULL) - str = "(null)"; - SDL_strlcpy((char *)error->args[i].buf, str, ERR_MAX_STRLEN); - error->argc++; - } - break; - default: - break; - } - if ( error->argc >= ERR_MAX_ARGS ) { - break; - } - } - } - va_end(ap); - - /* If we are in debug mode, print out an error message */ -#ifdef DEBUG_ERROR - fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError()); -#endif + va_list ap; + SDL_error *error; + + /* Ignore call if invalid format pointer was passed */ + if (fmt == NULL) return -1; + + /* Copy in the key, mark error as valid */ + error = SDL_GetErrBuf(); + error->error = 1; + SDL_strlcpy((char *) error->key, fmt, sizeof(error->key)); + + va_start(ap, fmt); + error->argc = 0; + while (*fmt) { + if (*fmt++ == '%') { + while (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) { + ++fmt; + } + switch (*fmt++) { + case 0: /* Malformed format string.. */ + --fmt; + break; + case 'c': + case 'i': + case 'd': + case 'u': + case 'o': + case 'x': + case 'X': + error->args[error->argc++].value_i = va_arg(ap, int); + break; + case 'f': + error->args[error->argc++].value_f = va_arg(ap, double); + break; + case 'p': + error->args[error->argc++].value_ptr = va_arg(ap, void *); + break; + case 's': + { + int i = error->argc; + const char *str = va_arg(ap, const char *); + if (str == NULL) + str = "(null)"; + SDL_strlcpy((char *) error->args[i].buf, str, + ERR_MAX_STRLEN); + error->argc++; + } + break; + default: + break; + } + if (error->argc >= ERR_MAX_ARGS) { + break; + } + } + } + va_end(ap); + + /* If we are in debug mode, print out an error message */ + SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError()); + + return -1; } /* This function has a bit more overhead than most error functions so that it supports internationalization and thread-safe errors. */ -char *SDL_GetErrorMsg(char *errstr, unsigned int maxlen) +static char * +SDL_GetErrorMsg(char *errstr, unsigned int maxlen) { - SDL_error *error; - - /* Clear the error string */ - *errstr = '\0'; --maxlen; - - /* Get the thread-safe error, and print it out */ - error = SDL_GetErrBuf(); - if ( error->error ) { - const char *fmt; - char *msg = errstr; - int len; - int argi; - - fmt = SDL_LookupString(error->key); - argi = 0; - while ( *fmt && (maxlen > 0) ) { - if ( *fmt == '%' ) { - char tmp[32], *spot = tmp; - *spot++ = *fmt++; - while ( (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) && spot < (tmp+SDL_arraysize(tmp)-2) ) { - *spot++ = *fmt++; - } - *spot++ = *fmt++; - *spot++ = '\0'; - switch (spot[-2]) { - case '%': - *msg++ = '%'; - maxlen -= 1; - break; - case 'c': - case 'i': - case 'd': - case 'u': - case 'o': - case 'x': - case 'X': - len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_i); - msg += len; - maxlen -= len; - break; - case 'f': - len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_f); - msg += len; - maxlen -= len; - break; - case 'p': - len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_ptr); - msg += len; - maxlen -= len; - break; - case 's': - len = SDL_snprintf(msg, maxlen, tmp, SDL_LookupString(error->args[argi++].buf)); - msg += len; - maxlen -= len; - break; - } - } else { - *msg++ = *fmt++; - maxlen -= 1; - } - } - *msg = 0; /* NULL terminate the string */ - } - return(errstr); + SDL_error *error; + + /* Clear the error string */ + *errstr = '\0'; + --maxlen; + + /* Get the thread-safe error, and print it out */ + error = SDL_GetErrBuf(); + if (error->error) { + const char *fmt; + char *msg = errstr; + int len; + int argi; + + fmt = SDL_LookupString(error->key); + argi = 0; + while (*fmt && (maxlen > 0)) { + if (*fmt == '%') { + char tmp[32], *spot = tmp; + *spot++ = *fmt++; + while ((*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) + && spot < (tmp + SDL_arraysize(tmp) - 2)) { + *spot++ = *fmt++; + } + *spot++ = *fmt++; + *spot++ = '\0'; + switch (spot[-2]) { + case '%': + *msg++ = '%'; + maxlen -= 1; + break; + case 'c': + case 'i': + case 'd': + case 'u': + case 'o': + case 'x': + case 'X': + len = + SDL_snprintf(msg, maxlen, tmp, + error->args[argi++].value_i); + msg += len; + maxlen -= len; + break; + case 'f': + len = + SDL_snprintf(msg, maxlen, tmp, + error->args[argi++].value_f); + msg += len; + maxlen -= len; + break; + case 'p': + len = + SDL_snprintf(msg, maxlen, tmp, + error->args[argi++].value_ptr); + msg += len; + maxlen -= len; + break; + case 's': + len = + SDL_snprintf(msg, maxlen, tmp, + SDL_LookupString(error->args[argi++]. + buf)); + msg += len; + maxlen -= len; + break; + } + } else { + *msg++ = *fmt++; + maxlen -= 1; + } + } + *msg = 0; /* NULL terminate the string */ + } + return (errstr); } /* Available for backwards compatibility */ -char *SDL_GetError (void) +const char * +SDL_GetError(void) { - static char errmsg[SDL_ERRBUFIZE]; + static char errmsg[SDL_ERRBUFIZE]; - return((char *)SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE)); + return SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE); } -void SDL_ClearError(void) +void +SDL_ClearError(void) { - SDL_error *error; + SDL_error *error; - error = SDL_GetErrBuf(); - error->error = 0; + error = SDL_GetErrBuf(); + error->error = 0; } /* Very common errors go here */ -void SDL_Error(SDL_errorcode code) +int +SDL_Error(SDL_errorcode code) { - switch (code) { - case SDL_ENOMEM: - SDL_SetError("Out of memory"); - break; - case SDL_EFREAD: - SDL_SetError("Error reading from datastream"); - break; - case SDL_EFWRITE: - SDL_SetError("Error writing to datastream"); - break; - case SDL_EFSEEK: - SDL_SetError("Error seeking in datastream"); - break; - default: - SDL_SetError("Unknown SDL error"); - break; - } + switch (code) { + case SDL_ENOMEM: + return SDL_SetError("Out of memory"); + case SDL_EFREAD: + return SDL_SetError("Error reading from datastream"); + case SDL_EFWRITE: + return SDL_SetError("Error writing to datastream"); + case SDL_EFSEEK: + return SDL_SetError("Error seeking in datastream"); + case SDL_UNSUPPORTED: + return SDL_SetError("That operation is not supported"); + default: + return SDL_SetError("Unknown SDL error"); + } } #ifdef TEST_ERROR -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { - char buffer[BUFSIZ+1]; - - SDL_SetError("Hi there!"); - printf("Error 1: %s\n", SDL_GetError()); - SDL_ClearError(); - SDL_memset(buffer, '1', BUFSIZ); - buffer[BUFSIZ] = 0; - SDL_SetError("This is the error: %s (%f)", buffer, 1.0); - printf("Error 2: %s\n", SDL_GetError()); - exit(0); + char buffer[BUFSIZ + 1]; + + SDL_SetError("Hi there!"); + printf("Error 1: %s\n", SDL_GetError()); + SDL_ClearError(); + SDL_memset(buffer, '1', BUFSIZ); + buffer[BUFSIZ] = 0; + SDL_SetError("This is the error: %s (%f)", buffer, 1.0); + printf("Error 2: %s\n", SDL_GetError()); + exit(0); } #endif + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_error_c.h b/src/SDL_error_c.h index 8e54e42541..2014cc1e77 100644 --- a/src/SDL_error_c.h +++ b/src/SDL_error_c.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -28,31 +27,38 @@ #ifndef _SDL_error_c_h #define _SDL_error_c_h -#define ERR_MAX_STRLEN 128 -#define ERR_MAX_ARGS 5 - -typedef struct SDL_error { - /* This is a numeric value corresponding to the current error */ - int error; - - /* This is a key used to index into a language hashtable containing - internationalized versions of the SDL error messages. If the key - is not in the hashtable, or no hashtable is available, the key is - used directly as an error message format string. - */ - char key[ERR_MAX_STRLEN]; - - /* These are the arguments for the error functions */ - int argc; - union { - void *value_ptr; -#if 0 /* What is a character anyway? (UNICODE issues) */ - unsigned char value_c; +#define ERR_MAX_STRLEN 128 +#define ERR_MAX_ARGS 5 + +typedef struct SDL_error +{ + /* This is a numeric value corresponding to the current error */ + int error; + + /* This is a key used to index into a language hashtable containing + internationalized versions of the SDL error messages. If the key + is not in the hashtable, or no hashtable is available, the key is + used directly as an error message format string. + */ + char key[ERR_MAX_STRLEN]; + + /* These are the arguments for the error functions */ + int argc; + union + { + void *value_ptr; +#if 0 /* What is a character anyway? (UNICODE issues) */ + unsigned char value_c; #endif - int value_i; - double value_f; - char buf[ERR_MAX_STRLEN]; - } args[ERR_MAX_ARGS]; + int value_i; + double value_f; + char buf[ERR_MAX_STRLEN]; + } args[ERR_MAX_ARGS]; } SDL_error; +/* Defined in SDL_thread.c */ +extern SDL_error *SDL_GetErrBuf(void); + #endif /* _SDL_error_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_fatal.c b/src/SDL_fatal.c deleted file mode 100644 index d422a01f88..0000000000 --- a/src/SDL_fatal.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* General fatal signal handling code for SDL */ - -#ifdef HAVE_SIGNAL_H - -#include - -#include "SDL.h" -#include "SDL_fatal.h" - -/* This installs some signal handlers for the more common fatal signals, - so that if the programmer is lazy, the app doesn't die so horribly if - the program crashes. -*/ - -static void SDL_Parachute(int sig) -{ - signal(sig, SIG_DFL); - SDL_Quit(); - raise(sig); -} - -static int SDL_fatal_signals[] = { - SIGSEGV, -#ifdef SIGBUS - SIGBUS, -#endif -#ifdef SIGFPE - SIGFPE, -#endif -#ifdef SIGQUIT - SIGQUIT, -#endif - 0 -}; - -void SDL_InstallParachute(void) -{ - /* Set a handler for any fatal signal not already handled */ - int i; -#ifdef HAVE_SIGACTION - struct sigaction action; - - for ( i=0; SDL_fatal_signals[i]; ++i ) { - sigaction(SDL_fatal_signals[i], NULL, &action); - if ( action.sa_handler == SIG_DFL ) { - action.sa_handler = SDL_Parachute; - sigaction(SDL_fatal_signals[i], &action, NULL); - } - } -#ifdef SIGALRM - /* Set SIGALRM to be ignored -- necessary on Solaris */ - sigaction(SIGALRM, NULL, &action); - if ( action.sa_handler == SIG_DFL ) { - action.sa_handler = SIG_IGN; - sigaction(SIGALRM, &action, NULL); - } -#endif -#else - void (*ohandler)(int); - - for ( i=0; SDL_fatal_signals[i]; ++i ) { - ohandler = signal(SDL_fatal_signals[i], SDL_Parachute); - if ( ohandler != SIG_DFL ) { - signal(SDL_fatal_signals[i], ohandler); - } - } -#endif /* HAVE_SIGACTION */ - return; -} - -void SDL_UninstallParachute(void) -{ - /* Remove a handler for any fatal signal handled */ - int i; -#ifdef HAVE_SIGACTION - struct sigaction action; - - for ( i=0; SDL_fatal_signals[i]; ++i ) { - sigaction(SDL_fatal_signals[i], NULL, &action); - if ( action.sa_handler == SDL_Parachute ) { - action.sa_handler = SIG_DFL; - sigaction(SDL_fatal_signals[i], &action, NULL); - } - } -#else - void (*ohandler)(int); - - for ( i=0; SDL_fatal_signals[i]; ++i ) { - ohandler = signal(SDL_fatal_signals[i], SIG_DFL); - if ( ohandler != SDL_Parachute ) { - signal(SDL_fatal_signals[i], ohandler); - } - } -#endif /* HAVE_SIGACTION */ -} - -#else - -/* No signals on this platform, nothing to do.. */ - -void SDL_InstallParachute(void) -{ - return; -} - -void SDL_UninstallParachute(void) -{ - return; -} - -#endif /* HAVE_SIGNAL_H */ diff --git a/src/SDL_fatal.h b/src/SDL_fatal.h deleted file mode 100644 index 6789784aeb..0000000000 --- a/src/SDL_fatal.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* General fatal signal handling code for SDL */ - -extern void SDL_InstallParachute(void); -extern void SDL_UninstallParachute(void); - diff --git a/src/SDL_hints.c b/src/SDL_hints.c new file mode 100644 index 0000000000..b00e961cc9 --- /dev/null +++ b/src/SDL_hints.c @@ -0,0 +1,225 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_hints.h" +#include "SDL_error.h" + + +/* Assuming there aren't many hints set and they aren't being queried in + critical performance paths, we'll just use linked lists here. + */ +typedef struct SDL_HintWatch { + SDL_HintCallback callback; + void *userdata; + struct SDL_HintWatch *next; +} SDL_HintWatch; + +typedef struct SDL_Hint { + char *name; + char *value; + SDL_HintPriority priority; + SDL_HintWatch *callbacks; + struct SDL_Hint *next; +} SDL_Hint; + +static SDL_Hint *SDL_hints; + +SDL_bool +SDL_SetHintWithPriority(const char *name, const char *value, + SDL_HintPriority priority) +{ + const char *env; + SDL_Hint *hint; + SDL_HintWatch *entry; + + if (!name || !value) { + return SDL_FALSE; + } + + env = SDL_getenv(name); + if (env && priority < SDL_HINT_OVERRIDE) { + return SDL_FALSE; + } + + for (hint = SDL_hints; hint; hint = hint->next) { + if (SDL_strcmp(name, hint->name) == 0) { + if (priority < hint->priority) { + return SDL_FALSE; + } + if (!hint->value || !value || SDL_strcmp(hint->value, value) != 0) { + for (entry = hint->callbacks; entry; ) { + /* Save the next entry in case this one is deleted */ + SDL_HintWatch *next = entry->next; + entry->callback(entry->userdata, name, hint->value, value); + entry = next; + } + if (hint->value) { + SDL_free(hint->value); + } + if (value) { + hint->value = SDL_strdup(value); + } else { + hint->value = NULL; + } + } + hint->priority = priority; + return SDL_TRUE; + } + } + + /* Couldn't find the hint, add a new one */ + hint = (SDL_Hint *)SDL_malloc(sizeof(*hint)); + if (!hint) { + return SDL_FALSE; + } + hint->name = SDL_strdup(name); + hint->value = value ? SDL_strdup(value) : NULL; + hint->priority = priority; + hint->callbacks = NULL; + hint->next = SDL_hints; + SDL_hints = hint; + return SDL_TRUE; +} + +SDL_bool +SDL_SetHint(const char *name, const char *value) +{ + return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL); +} + +const char * +SDL_GetHint(const char *name) +{ + const char *env; + SDL_Hint *hint; + + env = SDL_getenv(name); + for (hint = SDL_hints; hint; hint = hint->next) { + if (SDL_strcmp(name, hint->name) == 0) { + if (!env || hint->priority == SDL_HINT_OVERRIDE) { + return hint->value; + } + break; + } + } + return env; +} + +void +SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) +{ + SDL_Hint *hint; + SDL_HintWatch *entry; + const char *value; + + if (!name || !*name) { + SDL_InvalidParamError("name"); + return; + } + if (!callback) { + SDL_InvalidParamError("callback"); + return; + } + + SDL_DelHintCallback(name, callback, userdata); + + entry = (SDL_HintWatch *)SDL_malloc(sizeof(*entry)); + entry->callback = callback; + entry->userdata = userdata; + + for (hint = SDL_hints; hint; hint = hint->next) { + if (SDL_strcmp(name, hint->name) == 0) { + break; + } + } + if (!hint) { + /* Need to add a hint entry for this watcher */ + hint = (SDL_Hint *)SDL_malloc(sizeof(*hint)); + if (!hint) { + return; + } + hint->name = SDL_strdup(name); + hint->value = NULL; + hint->priority = SDL_HINT_DEFAULT; + hint->callbacks = NULL; + hint->next = SDL_hints; + SDL_hints = hint; + } + + /* Add it to the callbacks for this hint */ + entry->next = hint->callbacks; + hint->callbacks = entry; + + /* Now call it with the current value */ + value = SDL_GetHint(name); + callback(userdata, name, value, value); +} + +void +SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata) +{ + SDL_Hint *hint; + SDL_HintWatch *entry, *prev; + + for (hint = SDL_hints; hint; hint = hint->next) { + if (SDL_strcmp(name, hint->name) == 0) { + prev = NULL; + for (entry = hint->callbacks; entry; entry = entry->next) { + if (callback == entry->callback && userdata == entry->userdata) { + if (prev) { + prev->next = entry->next; + } else { + hint->callbacks = entry->next; + } + SDL_free(entry); + break; + } + prev = entry; + } + return; + } + } +} + +void SDL_ClearHints(void) +{ + SDL_Hint *hint; + SDL_HintWatch *entry; + + while (SDL_hints) { + hint = SDL_hints; + SDL_hints = hint->next; + + SDL_free(hint->name); + if (hint->value) { + SDL_free(hint->value); + } + for (entry = hint->callbacks; entry; ) { + SDL_HintWatch *freeable = entry; + entry = entry->next; + SDL_free(freeable); + } + SDL_free(hint); + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_log.c b/src/SDL_log.c new file mode 100644 index 0000000000..2245946c69 --- /dev/null +++ b/src/SDL_log.c @@ -0,0 +1,431 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* Simple log messages in SDL */ + +#include "SDL_log.h" + +#if HAVE_STDIO_H +#include +#endif + +#if defined(__WIN32__) +#include "core/windows/SDL_windows.h" +#elif defined(__ANDROID__) +#include +#endif + +#define DEFAULT_PRIORITY SDL_LOG_PRIORITY_CRITICAL +#define DEFAULT_ASSERT_PRIORITY SDL_LOG_PRIORITY_WARN +#define DEFAULT_APPLICATION_PRIORITY SDL_LOG_PRIORITY_INFO +#define DEFAULT_TEST_PRIORITY SDL_LOG_PRIORITY_VERBOSE + +/* Forward definition of error function */ +extern int SDL_SetError(const char *fmt, ...); + +typedef struct SDL_LogLevel +{ + int category; + SDL_LogPriority priority; + struct SDL_LogLevel *next; +} SDL_LogLevel; + +/* The default log output function */ +static void SDL_LogOutput(void *userdata, + int category, SDL_LogPriority priority, + const char *message); + +static SDL_LogLevel *SDL_loglevels; +static SDL_LogPriority SDL_default_priority = DEFAULT_PRIORITY; +static SDL_LogPriority SDL_assert_priority = DEFAULT_ASSERT_PRIORITY; +static SDL_LogPriority SDL_application_priority = DEFAULT_APPLICATION_PRIORITY; +static SDL_LogPriority SDL_test_priority = DEFAULT_TEST_PRIORITY; +static SDL_LogOutputFunction SDL_log_function = SDL_LogOutput; +static void *SDL_log_userdata = NULL; + +static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES] = { + NULL, + "VERBOSE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "CRITICAL" +}; + +#ifdef __ANDROID__ +static const char *SDL_category_prefixes[SDL_LOG_CATEGORY_RESERVED1] = { + "APP", + "ERROR", + "SYSTEM", + "AUDIO", + "VIDEO", + "RENDER", + "INPUT" +}; + +static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = { + ANDROID_LOG_VERBOSE, + ANDROID_LOG_DEBUG, + ANDROID_LOG_INFO, + ANDROID_LOG_WARN, + ANDROID_LOG_ERROR, + ANDROID_LOG_FATAL +}; +#endif /* __ANDROID__ */ + + +void +SDL_LogSetAllPriority(SDL_LogPriority priority) +{ + SDL_LogLevel *entry; + + for (entry = SDL_loglevels; entry; entry = entry->next) { + entry->priority = priority; + } + SDL_default_priority = priority; + SDL_assert_priority = priority; + SDL_application_priority = priority; +} + +void +SDL_LogSetPriority(int category, SDL_LogPriority priority) +{ + SDL_LogLevel *entry; + + for (entry = SDL_loglevels; entry; entry = entry->next) { + if (entry->category == category) { + entry->priority = priority; + return; + } + } + + /* Create a new entry */ + entry = (SDL_LogLevel *)SDL_malloc(sizeof(*entry)); + if (entry) { + entry->category = category; + entry->priority = priority; + entry->next = SDL_loglevels; + SDL_loglevels = entry; + } +} + +SDL_LogPriority +SDL_LogGetPriority(int category) +{ + SDL_LogLevel *entry; + + for (entry = SDL_loglevels; entry; entry = entry->next) { + if (entry->category == category) { + return entry->priority; + } + } + + if (category == SDL_LOG_CATEGORY_TEST) { + return SDL_test_priority; + } else if (category == SDL_LOG_CATEGORY_APPLICATION) { + return SDL_application_priority; + } else if (category == SDL_LOG_CATEGORY_ASSERT) { + return SDL_assert_priority; + } else { + return SDL_default_priority; + } +} + +void +SDL_LogResetPriorities(void) +{ + SDL_LogLevel *entry; + + while (SDL_loglevels) { + entry = SDL_loglevels; + SDL_loglevels = entry->next; + SDL_free(entry); + } + + SDL_default_priority = DEFAULT_PRIORITY; + SDL_assert_priority = DEFAULT_ASSERT_PRIORITY; + SDL_application_priority = DEFAULT_APPLICATION_PRIORITY; + SDL_test_priority = DEFAULT_TEST_PRIORITY; +} + +void +SDL_Log(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); + va_end(ap); +} + +void +SDL_LogVerbose(int category, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(category, SDL_LOG_PRIORITY_VERBOSE, fmt, ap); + va_end(ap); +} + +void +SDL_LogDebug(int category, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(category, SDL_LOG_PRIORITY_DEBUG, fmt, ap); + va_end(ap); +} + +void +SDL_LogInfo(int category, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(category, SDL_LOG_PRIORITY_INFO, fmt, ap); + va_end(ap); +} + +void +SDL_LogWarn(int category, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(category, SDL_LOG_PRIORITY_WARN, fmt, ap); + va_end(ap); +} + +void +SDL_LogError(int category, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(category, SDL_LOG_PRIORITY_ERROR, fmt, ap); + va_end(ap); +} + +void +SDL_LogCritical(int category, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(category, SDL_LOG_PRIORITY_CRITICAL, fmt, ap); + va_end(ap); +} + +void +SDL_LogMessage(int category, SDL_LogPriority priority, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + SDL_LogMessageV(category, priority, fmt, ap); + va_end(ap); +} + +#ifdef __ANDROID__ +static const char * +GetCategoryPrefix(int category) +{ + if (category < SDL_LOG_CATEGORY_RESERVED1) { + return SDL_category_prefixes[category]; + } + if (category < SDL_LOG_CATEGORY_CUSTOM) { + return "RESERVED"; + } + return "CUSTOM"; +} +#endif /* __ANDROID__ */ + +void +SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap) +{ + char *message; + size_t len; + + /* Nothing to do if we don't have an output function */ + if (!SDL_log_function) { + return; + } + + /* Make sure we don't exceed array bounds */ + if ((int)priority < 0 || priority >= SDL_NUM_LOG_PRIORITIES) { + return; + } + + /* See if we want to do anything with this message */ + if (priority < SDL_LogGetPriority(category)) { + return; + } + + message = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE); + if (!message) { + return; + } + + SDL_vsnprintf(message, SDL_MAX_LOG_MESSAGE, fmt, ap); + + /* Chop off final endline. */ + len = SDL_strlen(message); + if ((len > 0) && (message[len-1] == '\n')) { + message[--len] = '\0'; + if ((len > 0) && (message[len-1] == '\r')) { /* catch "\r\n", too. */ + message[--len] = '\0'; + } + } + + SDL_log_function(SDL_log_userdata, category, priority, message); + SDL_stack_free(message); +} + +#if defined(__WIN32__) +/* Flag tracking the attachment of the console: 0=unattached, 1=attached, -1=error */ +static int consoleAttached = 0; + +/* Handle to stderr output of console. */ +static HANDLE stderrHandle = NULL; +#endif + +static void +SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, + const char *message) +{ +#if defined(__WIN32__) + /* Way too many allocations here, urgh */ + /* Note: One can't call SDL_SetError here, since that function itself logs. */ + { + char *output; + size_t length; + LPTSTR tstr; + BOOL attachResult; + DWORD attachError; + unsigned long charsWritten; + + /* Maybe attach console and get stderr handle */ + if (consoleAttached == 0) { + attachResult = AttachConsole(ATTACH_PARENT_PROCESS); + if (!attachResult) { + attachError = GetLastError(); + if (attachError == ERROR_INVALID_HANDLE) { + OutputDebugString(TEXT("Parent process has no console")); + consoleAttached = -1; + } else if (attachError == ERROR_GEN_FAILURE) { + OutputDebugString(TEXT("Could not attach to console of parent process")); + consoleAttached = -1; + } else if (attachError == ERROR_ACCESS_DENIED) { + /* Already attached */ + consoleAttached = 1; + } else { + OutputDebugString(TEXT("Error attaching console")); + consoleAttached = -1; + } + } else { + /* Newly attached */ + consoleAttached = 1; + } + + if (consoleAttached == 1) { + stderrHandle = GetStdHandle(STD_ERROR_HANDLE); + } + } + + length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1 + 1; + output = SDL_stack_alloc(char, length); + SDL_snprintf(output, length, "%s: %s\n", SDL_priority_prefixes[priority], message); + tstr = WIN_UTF8ToString(output); + + /* Output to debugger */ + OutputDebugString(tstr); + + /* Screen output to stderr, if console was attached. */ + if (consoleAttached == 1) { + if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) { + OutputDebugString(TEXT("Error calling WriteConsole")); + } + if (charsWritten == ERROR_NOT_ENOUGH_MEMORY) { + OutputDebugString(TEXT("Insufficient heap memory to write message")); + } + } + + SDL_free(tstr); + SDL_stack_free(output); + } +#elif defined(__ANDROID__) + { + char tag[32]; + + SDL_snprintf(tag, SDL_arraysize(tag), "SDL/%s", GetCategoryPrefix(category)); + __android_log_write(SDL_android_priority[priority], tag, message); + } +#elif defined(__APPLE__) && defined(SDL_VIDEO_DRIVER_COCOA) + /* Technically we don't need SDL_VIDEO_DRIVER_COCOA, but that's where this function is defined for now. + */ + extern void SDL_NSLog(const char *text); + { + char *text; + + text = SDL_stack_alloc(char, SDL_MAX_LOG_MESSAGE); + if (text) { + SDL_snprintf(text, SDL_MAX_LOG_MESSAGE, "%s: %s", SDL_priority_prefixes[priority], message); + SDL_NSLog(text); + SDL_stack_free(text); + return; + } + } +#elif defined(__PSP__) + { + FILE* pFile; + pFile = fopen ("SDL_Log.txt", "a"); + fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); + fclose (pFile); + } +#endif +#if HAVE_STDIO_H + fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message); +#endif +} + +void +SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata) +{ + if (callback) { + *callback = SDL_log_function; + } + if (userdata) { + *userdata = SDL_log_userdata; + } +} + +void +SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata) +{ + SDL_log_function = callback; + SDL_log_userdata = userdata; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c new file mode 100644 index 0000000000..c747b12aa2 --- /dev/null +++ b/src/atomic/SDL_atomic.c @@ -0,0 +1,118 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_atomic.h" + +/* Note that we undefine the atomic operations here, in case they are + defined as compiler intrinsics while building SDL but the library user + doesn't have that compiler. That way we always have a working set of + atomic operations built into the library. +*/ +#undef SDL_AtomicCAS +#undef SDL_AtomicCASPtr + +/* + If any of the operations are not provided then we must emulate some + of them. That means we need a nice implementation of spin locks + that avoids the "one big lock" problem. We use a vector of spin + locks and pick which one to use based on the address of the operand + of the function. + + To generate the index of the lock we first shift by 3 bits to get + rid on the zero bits that result from 32 and 64 bit allignment of + data. We then mask off all but 5 bits and use those 5 bits as an + index into the table. + + Picking the lock this way insures that accesses to the same data at + the same time will go to the same lock. OTOH, accesses to different + data have only a 1/32 chance of hitting the same lock. That should + pretty much eliminate the chances of several atomic operations on + different data from waiting on the same "big lock". If it isn't + then the table of locks can be expanded to a new size so long as + the new size is a power of two. + + Contributed by Bob Pendleton, bob@pendleton.com +*/ + +static SDL_SpinLock locks[32]; + +static __inline__ void +enterLock(void *a) +{ + uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f); + + SDL_AtomicLock(&locks[index]); +} + +static __inline__ void +leaveLock(void *a) +{ + uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f); + + SDL_AtomicUnlock(&locks[index]); +} + +DECLSPEC SDL_bool SDLCALL +SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval) +{ + SDL_bool retval = SDL_FALSE; + + enterLock(a); + if (a->value == oldval) { + a->value = newval; + retval = SDL_TRUE; + } + leaveLock(a); + + return retval; +} + +DECLSPEC SDL_bool SDLCALL +SDL_AtomicCASPtr(void **a, void *oldval, void *newval) +{ + SDL_bool retval = SDL_FALSE; + + enterLock(a); + if (*a == oldval) { + *a = newval; + retval = SDL_TRUE; + } + leaveLock(a); + + return retval; +} + +#if defined(__GNUC__) && defined(__arm__) && \ + (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)) +__asm__( +" .align 2\n" +" .globl _SDL_MemoryBarrierRelease\n" +" .globl _SDL_MemoryBarrierAcquire\n" +"_SDL_MemoryBarrierRelease:\n" +"_SDL_MemoryBarrierAcquire:\n" +" mov r0, #0\n" +" mcr p15, 0, r0, c7, c10, 5\n" +" bx lr\n" +); +#endif /* __GNUC__ && __arm__ && ARMV6 */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c new file mode 100644 index 0000000000..f3aeea0e2d --- /dev/null +++ b/src/atomic/SDL_spinlock.c @@ -0,0 +1,126 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_atomic.h" +#include "SDL_mutex.h" +#include "SDL_timer.h" + +/* Don't do the check for Visual Studio 2005, it's safe here */ +#ifdef __WIN32__ +#include "../core/windows/SDL_windows.h" +#endif + +/* This function is where all the magic happens... */ +SDL_bool +SDL_AtomicTryLock(SDL_SpinLock *lock) +{ +#if SDL_ATOMIC_DISABLED + /* Terrible terrible damage */ + static SDL_mutex *_spinlock_mutex; + + if (!_spinlock_mutex) { + /* Race condition on first lock... */ + _spinlock_mutex = SDL_CreateMutex(); + } + SDL_LockMutex(_spinlock_mutex); + if (*lock == 0) { + *lock = 1; + SDL_UnlockMutex(_spinlock_mutex); + return SDL_TRUE; + } else { + SDL_UnlockMutex(_spinlock_mutex); + return SDL_FALSE; + } + +#elif defined(_MSC_VER) + SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long)); + return (InterlockedExchange((long*)lock, 1) == 0); + +#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET + return (__sync_lock_test_and_set(lock, 1) == 0); + +#elif defined(__GNUC__) && defined(__arm__) && \ + (defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \ + defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__) || \ + defined(__ARM_ARCH_5TEJ__)) + int result; + __asm__ __volatile__ ( + "swp %0, %1, [%2]\n" + : "=&r,&r" (result) : "r,0" (1), "r,r" (lock) : "memory"); + return (result == 0); + +#elif defined(__GNUC__) && defined(__arm__) + int result; + __asm__ __volatile__ ( + "ldrex %0, [%2]\nteq %0, #0\nstrexeq %0, %1, [%2]" + : "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory"); + return (result == 0); + +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + int result; + __asm__ __volatile__( + "lock ; xchgl %0, (%1)\n" + : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory"); + return (result == 0); + +#elif defined(__MACOSX__) || defined(__IPHONEOS__) + /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */ + return OSAtomicCompareAndSwap32Barrier(0, 1, lock); + +#elif HAVE_PTHREAD_SPINLOCK + /* pthread instructions */ + return (pthread_spin_trylock(lock) == 0); + +#else +#error Please implement for your platform. + return SDL_FALSE; +#endif +} + +void +SDL_AtomicLock(SDL_SpinLock *lock) +{ + /* FIXME: Should we have an eventual timeout? */ + while (!SDL_AtomicTryLock(lock)) { + SDL_Delay(0); + } +} + +void +SDL_AtomicUnlock(SDL_SpinLock *lock) +{ +#if defined(_MSC_VER) + _ReadWriteBarrier(); + *lock = 0; + +#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET + __sync_lock_release(lock); + +#elif HAVE_PTHREAD_SPINLOCK + pthread_spin_unlock(lock); + +#else + *lock = 0; +#endif +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index beb26e0b4d..4d53e82b18 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1,703 +1,1289 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Allow access to a raw mixing buffer */ #include "SDL.h" +#include "SDL_audio.h" #include "SDL_audio_c.h" #include "SDL_audiomem.h" #include "SDL_sysaudio.h" -#ifdef __OS2__ -/* We'll need the DosSetPriority() API! */ -#define INCL_DOSPROCESS -#include -#endif +#define _THIS SDL_AudioDevice *_this + +static SDL_AudioDriver current_audio; +static SDL_AudioDevice *open_devices[16]; + +/* !!! FIXME: These are wordy and unlocalized... */ +#define DEFAULT_OUTPUT_DEVNAME "System audio output device" +#define DEFAULT_INPUT_DEVNAME "System audio capture device" + + +/* + * Not all of these will be compiled and linked in, but it's convenient + * to have a complete list here and saves yet-another block of #ifdefs... + * Please see bootstrap[], below, for the actual #ifdef mess. + */ +extern AudioBootStrap BSD_AUDIO_bootstrap; +extern AudioBootStrap DSP_bootstrap; +extern AudioBootStrap ALSA_bootstrap; +extern AudioBootStrap PULSEAUDIO_bootstrap; +extern AudioBootStrap QSAAUDIO_bootstrap; +extern AudioBootStrap SUNAUDIO_bootstrap; +extern AudioBootStrap ARTS_bootstrap; +extern AudioBootStrap ESD_bootstrap; +extern AudioBootStrap NAS_bootstrap; +extern AudioBootStrap XAUDIO2_bootstrap; +extern AudioBootStrap DSOUND_bootstrap; +extern AudioBootStrap WINMM_bootstrap; +extern AudioBootStrap PAUDIO_bootstrap; +extern AudioBootStrap BEOSAUDIO_bootstrap; +extern AudioBootStrap COREAUDIO_bootstrap; +extern AudioBootStrap SNDMGR_bootstrap; +extern AudioBootStrap DISKAUD_bootstrap; +extern AudioBootStrap DUMMYAUD_bootstrap; +extern AudioBootStrap DCAUD_bootstrap; +extern AudioBootStrap DART_bootstrap; +extern AudioBootStrap NDSAUD_bootstrap; +extern AudioBootStrap FUSIONSOUND_bootstrap; +extern AudioBootStrap ANDROIDAUD_bootstrap; +extern AudioBootStrap PSPAUD_bootstrap; +extern AudioBootStrap SNDIO_bootstrap; /* Available audio drivers */ -static AudioBootStrap *bootstrap[] = { -#if SDL_AUDIO_DRIVER_PULSE - &PULSE_bootstrap, +static const AudioBootStrap *const bootstrap[] = { +#if SDL_AUDIO_DRIVER_PULSEAUDIO + &PULSEAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_ALSA - &ALSA_bootstrap, + &ALSA_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_SNDIO + &SNDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_BSD - &BSD_AUDIO_bootstrap, + &BSD_AUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_OSS - &DSP_bootstrap, - &DMA_bootstrap, + &DSP_bootstrap, #endif -#if SDL_AUDIO_DRIVER_QNXNTO - &QNXNTOAUDIO_bootstrap, +#if SDL_AUDIO_DRIVER_QSA + &QSAAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_SUNAUDIO - &SUNAUDIO_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_DMEDIA - &DMEDIA_bootstrap, + &SUNAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_ARTS - &ARTS_bootstrap, + &ARTS_bootstrap, #endif #if SDL_AUDIO_DRIVER_ESD - &ESD_bootstrap, + &ESD_bootstrap, #endif #if SDL_AUDIO_DRIVER_NAS - &NAS_bootstrap, + &NAS_bootstrap, +#endif +#if SDL_AUDIO_DRIVER_XAUDIO2 + &XAUDIO2_bootstrap, #endif #if SDL_AUDIO_DRIVER_DSOUND - &DSOUND_bootstrap, + &DSOUND_bootstrap, #endif -#if SDL_AUDIO_DRIVER_WAVEOUT - &WAVEOUT_bootstrap, +#if SDL_AUDIO_DRIVER_WINMM + &WINMM_bootstrap, #endif -#if SDL_AUDIO_DRIVER_PAUD - &Paud_bootstrap, +#if SDL_AUDIO_DRIVER_PAUDIO + &PAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_BAUDIO - &BAUDIO_bootstrap, +#if SDL_AUDIO_DRIVER_BEOSAUDIO + &BEOSAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_COREAUDIO - &COREAUDIO_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_SNDMGR - &SNDMGR_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_MINT - &MINTAUDIO_GSXB_bootstrap, - &MINTAUDIO_MCSN_bootstrap, - &MINTAUDIO_STFA_bootstrap, - &MINTAUDIO_XBIOS_bootstrap, - &MINTAUDIO_DMA8_bootstrap, + &COREAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_DISK - &DISKAUD_bootstrap, + &DISKAUD_bootstrap, #endif #if SDL_AUDIO_DRIVER_DUMMY - &DUMMYAUD_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_DC - &DCAUD_bootstrap, + &DUMMYAUD_bootstrap, #endif -#if SDL_AUDIO_DRIVER_NDS - &NDSAUD_bootstrap, +#if SDL_AUDIO_DRIVER_FUSIONSOUND + &FUSIONSOUND_bootstrap, #endif -#if SDL_AUDIO_DRIVER_MMEAUDIO - &MMEAUDIO_bootstrap, +#if SDL_AUDIO_DRIVER_ANDROID + &ANDROIDAUD_bootstrap, #endif -#if SDL_AUDIO_DRIVER_DART - &DART_bootstrap, +#if SDL_AUDIO_DRIVER_PSP + &PSPAUD_bootstrap, #endif -#if SDL_AUDIO_DRIVER_EPOCAUDIO - &EPOCAudio_bootstrap, -#endif - NULL + NULL }; -SDL_AudioDevice *current_audio = NULL; -/* Various local functions */ -int SDL_AudioInit(const char *driver_name); -void SDL_AudioQuit(void); +static SDL_AudioDevice * +get_audio_device(SDL_AudioDeviceID id) +{ + id--; + if ((id >= SDL_arraysize(open_devices)) || (open_devices[id] == NULL)) { + SDL_SetError("Invalid audio device ID"); + return NULL; + } -/* The general mixing thread function */ -int SDLCALL SDL_RunAudio(void *audiop) -{ - SDL_AudioDevice *audio = (SDL_AudioDevice *)audiop; - Uint8 *stream; - int stream_len; - void *udata; - void (SDLCALL *fill)(void *userdata,Uint8 *stream, int len); - int silence; - - /* Perform any thread setup */ - if ( audio->ThreadInit ) { - audio->ThreadInit(audio); - } - audio->threadid = SDL_ThreadID(); - - /* Set up the mixing function */ - fill = audio->spec.callback; - udata = audio->spec.userdata; - - if ( audio->convert.needed ) { - if ( audio->convert.src_format == AUDIO_U8 ) { - silence = 0x80; - } else { - silence = 0; - } - stream_len = audio->convert.len; - } else { - silence = audio->spec.silence; - stream_len = audio->spec.size; - } - -#ifdef __OS2__ - /* Increase the priority of this thread to make sure that - the audio will be continuous all the time! */ -#ifdef USE_DOSSETPRIORITY - if (SDL_getenv("SDL_USE_TIMECRITICAL_AUDIO")) - { -#ifdef DEBUG_BUILD - printf("[SDL_RunAudio] : Setting priority to TimeCritical+0! (TID%d)\n", SDL_ThreadID()); -#endif - DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); - } - else - { -#ifdef DEBUG_BUILD - printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID()); -#endif - DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0); + return open_devices[id]; +} + + +/* stubs for audio drivers that don't need a specific entry point... */ +static void +SDL_AudioDetectDevices_Default(int iscapture, SDL_AddAudioDevice addfn) +{ /* no-op. */ +} + +static void +SDL_AudioThreadInit_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioWaitDevice_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioPlayDevice_Default(_THIS) +{ /* no-op. */ +} + +static Uint8 * +SDL_AudioGetDeviceBuf_Default(_THIS) +{ + return NULL; +} + +static void +SDL_AudioWaitDone_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioCloseDevice_Default(_THIS) +{ /* no-op. */ +} + +static void +SDL_AudioDeinitialize_Default(void) +{ /* no-op. */ +} + +static int +SDL_AudioOpenDevice_Default(_THIS, const char *devname, int iscapture) +{ + return -1; +} + +static void +SDL_AudioLockDevice_Default(SDL_AudioDevice * device) +{ + if (device->thread && (SDL_ThreadID() == device->threadid)) { + return; + } + SDL_LockMutex(device->mixer_lock); +} + +static void +SDL_AudioUnlockDevice_Default(SDL_AudioDevice * device) +{ + if (device->thread && (SDL_ThreadID() == device->threadid)) { + return; + } + SDL_UnlockMutex(device->mixer_lock); +} + + +static void +finalize_audio_entry_points(void) +{ + /* + * Fill in stub functions for unused driver entry points. This lets us + * blindly call them without having to check for validity first. + */ + +#define FILL_STUB(x) \ + if (current_audio.impl.x == NULL) { \ + current_audio.impl.x = SDL_Audio##x##_Default; \ } -#endif -#endif + FILL_STUB(DetectDevices); + FILL_STUB(OpenDevice); + FILL_STUB(ThreadInit); + FILL_STUB(WaitDevice); + FILL_STUB(PlayDevice); + FILL_STUB(GetDeviceBuf); + FILL_STUB(WaitDone); + FILL_STUB(CloseDevice); + FILL_STUB(LockDevice); + FILL_STUB(UnlockDevice); + FILL_STUB(Deinitialize); +#undef FILL_STUB +} - /* Loop, filling the audio buffers */ - while ( audio->enabled ) { - - /* Fill the current buffer with sound */ - if ( audio->convert.needed ) { - if ( audio->convert.buf ) { - stream = audio->convert.buf; - } else { - continue; - } - } else { - stream = audio->GetAudioBuf(audio); - if ( stream == NULL ) { - stream = audio->fake_stream; - } - } - - SDL_memset(stream, silence, stream_len); - - if ( ! audio->paused ) { - SDL_mutexP(audio->mixer_lock); - (*fill)(udata, stream, stream_len); - SDL_mutexV(audio->mixer_lock); - } - - /* Convert the audio if necessary */ - if ( audio->convert.needed ) { - SDL_ConvertAudio(&audio->convert); - stream = audio->GetAudioBuf(audio); - if ( stream == NULL ) { - stream = audio->fake_stream; - } - SDL_memcpy(stream, audio->convert.buf, - audio->convert.len_cvt); - } - - /* Ready current buffer for play and change current buffer */ - if ( stream != audio->fake_stream ) { - audio->PlayAudio(audio); - } - - /* Wait for an audio buffer to become available */ - if ( stream == audio->fake_stream ) { - SDL_Delay((audio->spec.samples*1000)/audio->spec.freq); - } else { - audio->WaitAudio(audio); - } - } - - /* Wait for the audio to drain.. */ - if ( audio->WaitDone ) { - audio->WaitDone(audio); - } - -#ifdef __OS2__ -#ifdef DEBUG_BUILD - printf("[SDL_RunAudio] : Task exiting. (TID%d)\n", SDL_ThreadID()); -#endif -#endif - return(0); -} - -static void SDL_LockAudio_Default(SDL_AudioDevice *audio) -{ - if ( audio->thread && (SDL_ThreadID() == audio->threadid) ) { - return; - } - SDL_mutexP(audio->mixer_lock); -} - -static void SDL_UnlockAudio_Default(SDL_AudioDevice *audio) -{ - if ( audio->thread && (SDL_ThreadID() == audio->threadid) ) { - return; - } - SDL_mutexV(audio->mixer_lock); -} - -static Uint16 SDL_ParseAudioFormat(const char *string) -{ - Uint16 format = 0; - - switch (*string) { - case 'U': - ++string; - format |= 0x0000; - break; - case 'S': - ++string; - format |= 0x8000; - break; - default: - return 0; - } - switch (SDL_atoi(string)) { - case 8: - string += 1; - format |= 8; - break; - case 16: - string += 2; - format |= 16; - if ( SDL_strcmp(string, "LSB") == 0 -#if SDL_BYTEORDER == SDL_LIL_ENDIAN - || SDL_strcmp(string, "SYS") == 0 -#endif - ) { - format |= 0x0000; - } - if ( SDL_strcmp(string, "MSB") == 0 -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - || SDL_strcmp(string, "SYS") == 0 -#endif - ) { - format |= 0x1000; - } - break; - default: - return 0; - } - return format; +/* Streaming functions (for when the input and output buffer sizes are different) */ +/* Write [length] bytes from buf into the streamer */ +static void +SDL_StreamWrite(SDL_AudioStreamer * stream, Uint8 * buf, int length) +{ + int i; + + for (i = 0; i < length; ++i) { + stream->buffer[stream->write_pos] = buf[i]; + ++stream->write_pos; + } } -int SDL_AudioInit(const char *driver_name) +/* Read [length] bytes out of the streamer into buf */ +static void +SDL_StreamRead(SDL_AudioStreamer * stream, Uint8 * buf, int length) { - SDL_AudioDevice *audio; - int i = 0, idx; + int i; - /* Check to make sure we don't overwrite 'current_audio' */ - if ( current_audio != NULL ) { - SDL_AudioQuit(); - } + for (i = 0; i < length; ++i) { + buf[i] = stream->buffer[stream->read_pos]; + ++stream->read_pos; + } +} - /* Select the proper audio driver */ - audio = NULL; - idx = 0; -#if SDL_AUDIO_DRIVER_ESD - if ( (driver_name == NULL) && (SDL_getenv("ESPEAKER") != NULL) ) { - /* Ahem, we know that if ESPEAKER is set, user probably wants - to use ESD, but don't start it if it's not already running. - This probably isn't the place to do this, but... Shh! :) - */ - for ( i=0; bootstrap[i]; ++i ) { - if ( SDL_strcasecmp(bootstrap[i]->name, "esd") == 0 ) { -#ifdef HAVE_PUTENV - const char *esd_no_spawn; - - /* Don't start ESD if it's not running */ - esd_no_spawn = getenv("ESD_NO_SPAWN"); - if ( esd_no_spawn == NULL ) { - putenv("ESD_NO_SPAWN=1"); - } -#endif - if ( bootstrap[i]->available() ) { - audio = bootstrap[i]->create(0); - break; - } -#ifdef HAVE_UNSETENV - if ( esd_no_spawn == NULL ) { - unsetenv("ESD_NO_SPAWN"); - } +static int +SDL_StreamLength(SDL_AudioStreamer * stream) +{ + return (stream->write_pos - stream->read_pos) % stream->max_len; +} + +/* Initialize the stream by allocating the buffer and setting the read/write heads to the beginning */ +#if 0 +static int +SDL_StreamInit(SDL_AudioStreamer * stream, int max_len, Uint8 silence) +{ + /* First try to allocate the buffer */ + stream->buffer = (Uint8 *) SDL_malloc(max_len); + if (stream->buffer == NULL) { + return -1; + } + + stream->max_len = max_len; + stream->read_pos = 0; + stream->write_pos = 0; + + /* Zero out the buffer */ + SDL_memset(stream->buffer, silence, max_len); + + return 0; +} #endif - } - } - } -#endif /* SDL_AUDIO_DRIVER_ESD */ - if ( audio == NULL ) { - if ( driver_name != NULL ) { -#if 0 /* This will be replaced with a better driver selection API */ - if ( SDL_strrchr(driver_name, ':') != NULL ) { - idx = atoi(SDL_strrchr(driver_name, ':')+1); - } + +/* Deinitialize the stream simply by freeing the buffer */ +static void +SDL_StreamDeinit(SDL_AudioStreamer * stream) +{ + if (stream->buffer != NULL) { + SDL_free(stream->buffer); + } +} + +#if defined(ANDROID) +#include #endif - for ( i=0; bootstrap[i]; ++i ) { - if (SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) { - if ( bootstrap[i]->available() ) { - audio=bootstrap[i]->create(idx); - break; - } - } - } - } else { - for ( i=0; bootstrap[i]; ++i ) { - if ( bootstrap[i]->available() ) { - audio = bootstrap[i]->create(idx); - if ( audio != NULL ) { - break; - } - } - } - } - if ( audio == NULL ) { - SDL_SetError("No available audio device"); -#if 0 /* Don't fail SDL_Init() if audio isn't available. - SDL_OpenAudio() will handle it at that point. *sigh* - */ - return(-1); + +/* The general mixing thread function */ +int SDLCALL +SDL_RunAudio(void *devicep) +{ + SDL_AudioDevice *device = (SDL_AudioDevice *) devicep; + Uint8 *stream; + int stream_len; + void *udata; + void (SDLCALL * fill) (void *userdata, Uint8 * stream, int len); + Uint32 delay; + /* For streaming when the buffer sizes don't match up */ + Uint8 *istream; + int istream_len = 0; + + /* The audio mixing is always a high priority thread */ + SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH); + + /* Perform any thread setup */ + device->threadid = SDL_ThreadID(); + current_audio.impl.ThreadInit(device); + + /* Set up the mixing function */ + fill = device->spec.callback; + udata = device->spec.userdata; + + /* By default do not stream */ + device->use_streamer = 0; + + if (device->convert.needed) { +#if 0 /* !!! FIXME: I took len_div out of the structure. Use rate_incr instead? */ + /* If the result of the conversion alters the length, i.e. resampling is being used, use the streamer */ + if (device->convert.len_mult != 1 || device->convert.len_div != 1) { + /* The streamer's maximum length should be twice whichever is larger: spec.size or len_cvt */ + stream_max_len = 2 * device->spec.size; + if (device->convert.len_mult > device->convert.len_div) { + stream_max_len *= device->convert.len_mult; + stream_max_len /= device->convert.len_div; + } + if (SDL_StreamInit(&device->streamer, stream_max_len, silence) < + 0) + return -1; + device->use_streamer = 1; + + /* istream_len should be the length of what we grab from the callback and feed to conversion, + so that we get close to spec_size. I.e. we want device.spec_size = istream_len * u / d + */ + istream_len = + device->spec.size * device->convert.len_div / + device->convert.len_mult; + } #endif - } - } - current_audio = audio; - if ( current_audio ) { - current_audio->name = bootstrap[i]->name; - if ( !current_audio->LockAudio && !current_audio->UnlockAudio ) { - current_audio->LockAudio = SDL_LockAudio_Default; - current_audio->UnlockAudio = SDL_UnlockAudio_Default; - } - } - return(0); -} - -char *SDL_AudioDriverName(char *namebuf, int maxlen) -{ - if ( current_audio != NULL ) { - SDL_strlcpy(namebuf, current_audio->name, maxlen); - return(namebuf); - } - return(NULL); -} - -int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained) -{ - SDL_AudioDevice *audio; - const char *env; - - /* Start up the audio driver, if necessary */ - if ( ! current_audio ) { - if ( (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) || - (current_audio == NULL) ) { - return(-1); - } - } - audio = current_audio; - - if (audio->opened) { - SDL_SetError("Audio device is already opened"); - return(-1); - } - - /* Verify some parameters */ - if ( desired->freq == 0 ) { - env = SDL_getenv("SDL_AUDIO_FREQUENCY"); - if ( env ) { - desired->freq = SDL_atoi(env); - } - } - if ( desired->freq == 0 ) { - /* Pick some default audio frequency */ - desired->freq = 22050; - } - if ( desired->format == 0 ) { - env = SDL_getenv("SDL_AUDIO_FORMAT"); - if ( env ) { - desired->format = SDL_ParseAudioFormat(env); - } - } - if ( desired->format == 0 ) { - /* Pick some default audio format */ - desired->format = AUDIO_S16; - } - if ( desired->channels == 0 ) { - env = SDL_getenv("SDL_AUDIO_CHANNELS"); - if ( env ) { - desired->channels = (Uint8)SDL_atoi(env); - } - } - if ( desired->channels == 0 ) { - /* Pick a default number of channels */ - desired->channels = 2; - } - switch ( desired->channels ) { - case 1: /* Mono */ - case 2: /* Stereo */ - case 4: /* surround */ - case 6: /* surround with center and lfe */ - break; - default: - SDL_SetError("1 (mono) and 2 (stereo) channels supported"); - return(-1); - } - if ( desired->samples == 0 ) { - env = SDL_getenv("SDL_AUDIO_SAMPLES"); - if ( env ) { - desired->samples = (Uint16)SDL_atoi(env); - } - } - if ( desired->samples == 0 ) { - /* Pick a default of ~46 ms at desired frequency */ - int samples = (desired->freq / 1000) * 46; - int power2 = 1; - while ( power2 < samples ) { - power2 *= 2; - } - desired->samples = power2; - } - if ( desired->callback == NULL ) { - SDL_SetError("SDL_OpenAudio() passed a NULL callback"); - return(-1); - } - -#if SDL_THREADS_DISABLED - /* Uses interrupt driven audio, without thread */ -#else - /* Create a semaphore for locking the sound buffers */ - audio->mixer_lock = SDL_CreateMutex(); - if ( audio->mixer_lock == NULL ) { - SDL_SetError("Couldn't create mixer lock"); - SDL_CloseAudio(); - return(-1); - } -#endif /* SDL_THREADS_DISABLED */ - - /* Calculate the silence and size of the audio specification */ - SDL_CalculateAudioSpec(desired); - - /* Open the audio subsystem */ - SDL_memcpy(&audio->spec, desired, sizeof(audio->spec)); - audio->convert.needed = 0; - audio->enabled = 1; - audio->paused = 1; - - audio->opened = audio->OpenAudio(audio, &audio->spec)+1; - - if ( ! audio->opened ) { - SDL_CloseAudio(); - return(-1); - } - - /* If the audio driver changes the buffer size, accept it */ - if ( audio->spec.samples != desired->samples ) { - desired->samples = audio->spec.samples; - SDL_CalculateAudioSpec(desired); - } - - /* Allocate a fake audio memory buffer */ - audio->fake_stream = SDL_AllocAudioMem(audio->spec.size); - if ( audio->fake_stream == NULL ) { - SDL_CloseAudio(); - SDL_OutOfMemory(); - return(-1); - } - - /* See if we need to do any conversion */ - if ( obtained != NULL ) { - SDL_memcpy(obtained, &audio->spec, sizeof(audio->spec)); - } else if ( desired->freq != audio->spec.freq || - desired->format != audio->spec.format || - desired->channels != audio->spec.channels ) { - /* Build an audio conversion block */ - if ( SDL_BuildAudioCVT(&audio->convert, - desired->format, desired->channels, - desired->freq, - audio->spec.format, audio->spec.channels, - audio->spec.freq) < 0 ) { - SDL_CloseAudio(); - return(-1); - } - if ( audio->convert.needed ) { - audio->convert.len = (int) ( ((double) audio->spec.size) / - audio->convert.len_ratio ); - audio->convert.buf =(Uint8 *)SDL_AllocAudioMem( - audio->convert.len*audio->convert.len_mult); - if ( audio->convert.buf == NULL ) { - SDL_CloseAudio(); - SDL_OutOfMemory(); - return(-1); - } - } - } - - /* Start the audio thread if necessary */ - switch (audio->opened) { - case 1: - /* Start the audio thread */ -#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) && !defined(__SYMBIAN32__) + stream_len = device->convert.len; + } else { + stream_len = device->spec.size; + } + + /* Calculate the delay while paused */ + delay = ((device->spec.samples * 1000) / device->spec.freq); + + /* Determine if the streamer is necessary here */ + if (device->use_streamer == 1) { + /* This code is almost the same as the old code. The difference is, instead of reading + directly from the callback into "stream", then converting and sending the audio off, + we go: callback -> "istream" -> (conversion) -> streamer -> stream -> device. + However, reading and writing with streamer are done separately: + - We only call the callback and write to the streamer when the streamer does not + contain enough samples to output to the device. + - We only read from the streamer and tell the device to play when the streamer + does have enough samples to output. + This allows us to perform resampling in the conversion step, where the output of the + resampling process can be any number. We will have to see what a good size for the + stream's maximum length is, but I suspect 2*max(len_cvt, stream_len) is a good figure. + */ + while (device->enabled) { + + if (device->paused) { + SDL_Delay(delay); + continue; + } + + /* Only read in audio if the streamer doesn't have enough already (if it does not have enough samples to output) */ + if (SDL_StreamLength(&device->streamer) < stream_len) { + /* Set up istream */ + if (device->convert.needed) { + if (device->convert.buf) { + istream = device->convert.buf; + } else { + continue; + } + } else { +/* FIXME: Ryan, this is probably wrong. I imagine we don't want to get + * a device buffer both here and below in the stream output. + */ + istream = current_audio.impl.GetDeviceBuf(device); + if (istream == NULL) { + istream = device->fake_stream; + } + } + + /* Read from the callback into the _input_ stream */ + SDL_LockMutex(device->mixer_lock); + (*fill) (udata, istream, istream_len); + SDL_UnlockMutex(device->mixer_lock); + + /* Convert the audio if necessary and write to the streamer */ + if (device->convert.needed) { + SDL_ConvertAudio(&device->convert); + if (istream == NULL) { + istream = device->fake_stream; + } + /*SDL_memcpy(istream, device->convert.buf, device->convert.len_cvt); */ + SDL_StreamWrite(&device->streamer, device->convert.buf, + device->convert.len_cvt); + } else { + SDL_StreamWrite(&device->streamer, istream, istream_len); + } + } + + /* Only output audio if the streamer has enough to output */ + if (SDL_StreamLength(&device->streamer) >= stream_len) { + /* Set up the output stream */ + if (device->convert.needed) { + if (device->convert.buf) { + stream = device->convert.buf; + } else { + continue; + } + } else { + stream = current_audio.impl.GetDeviceBuf(device); + if (stream == NULL) { + stream = device->fake_stream; + } + } + + /* Now read from the streamer */ + SDL_StreamRead(&device->streamer, stream, stream_len); + + /* Ready current buffer for play and change current buffer */ + if (stream != device->fake_stream) { + current_audio.impl.PlayDevice(device); + /* Wait for an audio buffer to become available */ + current_audio.impl.WaitDevice(device); + } else { + SDL_Delay(delay); + } + } + + } + } else { + /* Otherwise, do not use the streamer. This is the old code. */ + const int silence = (int) device->spec.silence; + + /* Loop, filling the audio buffers */ + while (device->enabled) { + + /* Fill the current buffer with sound */ + if (device->convert.needed) { + if (device->convert.buf) { + stream = device->convert.buf; + } else { + continue; + } + } else { + stream = current_audio.impl.GetDeviceBuf(device); + if (stream == NULL) { + stream = device->fake_stream; + } + } + + SDL_LockMutex(device->mixer_lock); + if (device->paused) { + SDL_memset(stream, silence, stream_len); + } else { + (*fill) (udata, stream, stream_len); + } + SDL_UnlockMutex(device->mixer_lock); + + /* Convert the audio if necessary */ + if (device->convert.needed) { + SDL_ConvertAudio(&device->convert); + stream = current_audio.impl.GetDeviceBuf(device); + if (stream == NULL) { + stream = device->fake_stream; + } + SDL_memcpy(stream, device->convert.buf, + device->convert.len_cvt); + } + + /* Ready current buffer for play and change current buffer */ + if (stream != device->fake_stream) { + current_audio.impl.PlayDevice(device); + /* Wait for an audio buffer to become available */ + current_audio.impl.WaitDevice(device); + } else { + SDL_Delay(delay); + } + } + } + + /* Wait for the audio to drain.. */ + current_audio.impl.WaitDone(device); + + /* If necessary, deinit the streamer */ + if (device->use_streamer == 1) + SDL_StreamDeinit(&device->streamer); + + return (0); +} + + +static SDL_AudioFormat +SDL_ParseAudioFormat(const char *string) +{ +#define CHECK_FMT_STRING(x) if (SDL_strcmp(string, #x) == 0) return AUDIO_##x + CHECK_FMT_STRING(U8); + CHECK_FMT_STRING(S8); + CHECK_FMT_STRING(U16LSB); + CHECK_FMT_STRING(S16LSB); + CHECK_FMT_STRING(U16MSB); + CHECK_FMT_STRING(S16MSB); + CHECK_FMT_STRING(U16SYS); + CHECK_FMT_STRING(S16SYS); + CHECK_FMT_STRING(U16); + CHECK_FMT_STRING(S16); + CHECK_FMT_STRING(S32LSB); + CHECK_FMT_STRING(S32MSB); + CHECK_FMT_STRING(S32SYS); + CHECK_FMT_STRING(S32); + CHECK_FMT_STRING(F32LSB); + CHECK_FMT_STRING(F32MSB); + CHECK_FMT_STRING(F32SYS); + CHECK_FMT_STRING(F32); +#undef CHECK_FMT_STRING + return 0; +} + +int +SDL_GetNumAudioDrivers(void) +{ + return (SDL_arraysize(bootstrap) - 1); +} + +const char * +SDL_GetAudioDriver(int index) +{ + if (index >= 0 && index < SDL_GetNumAudioDrivers()) { + return (bootstrap[index]->name); + } + return (NULL); +} + +int +SDL_AudioInit(const char *driver_name) +{ + int i = 0; + int initialized = 0; + int tried_to_init = 0; + + if (SDL_WasInit(SDL_INIT_AUDIO)) { + SDL_AudioQuit(); /* shutdown driver if already running. */ + } + + SDL_memset(¤t_audio, '\0', sizeof(current_audio)); + SDL_memset(open_devices, '\0', sizeof(open_devices)); + + /* Select the proper audio driver */ + if (driver_name == NULL) { + driver_name = SDL_getenv("SDL_AUDIODRIVER"); + } + + for (i = 0; (!initialized) && (bootstrap[i]); ++i) { + /* make sure we should even try this driver before doing so... */ + const AudioBootStrap *backend = bootstrap[i]; + if ((driver_name && (SDL_strncasecmp(backend->name, driver_name, SDL_strlen(driver_name)) != 0)) || + (!driver_name && backend->demand_only)) { + continue; + } + + tried_to_init = 1; + SDL_memset(¤t_audio, 0, sizeof(current_audio)); + current_audio.name = backend->name; + current_audio.desc = backend->desc; + initialized = backend->init(¤t_audio.impl); + } + + if (!initialized) { + /* specific drivers will set the error message if they fail... */ + if (!tried_to_init) { + if (driver_name) { + SDL_SetError("Audio target '%s' not available", driver_name); + } else { + SDL_SetError("No available audio device"); + } + } + + SDL_memset(¤t_audio, 0, sizeof(current_audio)); + return (-1); /* No driver was available, so fail. */ + } + + finalize_audio_entry_points(); + + return (0); +} + +/* + * Get the current audio driver name + */ +const char * +SDL_GetCurrentAudioDriver() +{ + return current_audio.name; +} + +static void +free_device_list(char ***devices, int *devCount) +{ + int i = *devCount; + if ((i > 0) && (*devices != NULL)) { + while (i--) { + SDL_free((*devices)[i]); + } + } + + if (*devices != NULL) { + SDL_free(*devices); + } + + *devices = NULL; + *devCount = 0; +} + +static +void SDL_AddCaptureAudioDevice(const char *_name) +{ + char *name = NULL; + void *ptr = SDL_realloc(current_audio.inputDevices, + (current_audio.inputDeviceCount+1) * sizeof(char*)); + if (ptr == NULL) { + return; /* oh well. */ + } + + current_audio.inputDevices = (char **) ptr; + name = SDL_strdup(_name); /* if this returns NULL, that's okay. */ + current_audio.inputDevices[current_audio.inputDeviceCount++] = name; +} + +static +void SDL_AddOutputAudioDevice(const char *_name) +{ + char *name = NULL; + void *ptr = SDL_realloc(current_audio.outputDevices, + (current_audio.outputDeviceCount+1) * sizeof(char*)); + if (ptr == NULL) { + return; /* oh well. */ + } + + current_audio.outputDevices = (char **) ptr; + name = SDL_strdup(_name); /* if this returns NULL, that's okay. */ + current_audio.outputDevices[current_audio.outputDeviceCount++] = name; +} + + +int +SDL_GetNumAudioDevices(int iscapture) +{ + int retval = 0; + + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + return -1; + } + + if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) { + return 0; + } + + if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { + return 1; + } + + if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + return 1; + } + + if (iscapture) { + free_device_list(¤t_audio.inputDevices, + ¤t_audio.inputDeviceCount); + current_audio.impl.DetectDevices(iscapture, SDL_AddCaptureAudioDevice); + retval = current_audio.inputDeviceCount; + } else { + free_device_list(¤t_audio.outputDevices, + ¤t_audio.outputDeviceCount); + current_audio.impl.DetectDevices(iscapture, SDL_AddOutputAudioDevice); + retval = current_audio.outputDeviceCount; + } + + return retval; +} + + +const char * +SDL_GetAudioDeviceName(int index, int iscapture) +{ + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + SDL_SetError("Audio subsystem is not initialized"); + return NULL; + } + + if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) { + SDL_SetError("No capture support"); + return NULL; + } + + if (index < 0) { + goto no_such_device; + } + + if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { + return DEFAULT_INPUT_DEVNAME; + } + + if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + return DEFAULT_OUTPUT_DEVNAME; + } + + if (iscapture) { + if (index >= current_audio.inputDeviceCount) { + goto no_such_device; + } + return current_audio.inputDevices[index]; + } else { + if (index >= current_audio.outputDeviceCount) { + goto no_such_device; + } + return current_audio.outputDevices[index]; + } + +no_such_device: + SDL_SetError("No such device"); + return NULL; +} + + +static void +close_audio_device(SDL_AudioDevice * device) +{ + device->enabled = 0; + if (device->thread != NULL) { + SDL_WaitThread(device->thread, NULL); + } + if (device->mixer_lock != NULL) { + SDL_DestroyMutex(device->mixer_lock); + } + if (device->fake_stream != NULL) { + SDL_FreeAudioMem(device->fake_stream); + } + if (device->convert.needed) { + SDL_FreeAudioMem(device->convert.buf); + } + if (device->opened) { + current_audio.impl.CloseDevice(device); + device->opened = 0; + } + SDL_FreeAudioMem(device); +} + + +/* + * Sanity check desired AudioSpec for SDL_OpenAudio() in (orig). + * Fills in a sanitized copy in (prepared). + * Returns non-zero if okay, zero on fatal parameters in (orig). + */ +static int +prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared) +{ + SDL_memcpy(prepared, orig, sizeof(SDL_AudioSpec)); + + if (orig->callback == NULL) { + SDL_SetError("SDL_OpenAudio() passed a NULL callback"); + return 0; + } + + if (orig->freq == 0) { + const char *env = SDL_getenv("SDL_AUDIO_FREQUENCY"); + if ((!env) || ((prepared->freq = SDL_atoi(env)) == 0)) { + prepared->freq = 22050; /* a reasonable default */ + } + } + + if (orig->format == 0) { + const char *env = SDL_getenv("SDL_AUDIO_FORMAT"); + if ((!env) || ((prepared->format = SDL_ParseAudioFormat(env)) == 0)) { + prepared->format = AUDIO_S16; /* a reasonable default */ + } + } + + switch (orig->channels) { + case 0:{ + const char *env = SDL_getenv("SDL_AUDIO_CHANNELS"); + if ((!env) || ((prepared->channels = (Uint8) SDL_atoi(env)) == 0)) { + prepared->channels = 2; /* a reasonable default */ + } + break; + } + case 1: /* Mono */ + case 2: /* Stereo */ + case 4: /* surround */ + case 6: /* surround with center and lfe */ + break; + default: + SDL_SetError("Unsupported number of audio channels."); + return 0; + } + + if (orig->samples == 0) { + const char *env = SDL_getenv("SDL_AUDIO_SAMPLES"); + if ((!env) || ((prepared->samples = (Uint16) SDL_atoi(env)) == 0)) { + /* Pick a default of ~46 ms at desired frequency */ + /* !!! FIXME: remove this when the non-Po2 resampling is in. */ + const int samples = (prepared->freq / 1000) * 46; + int power2 = 1; + while (power2 < samples) { + power2 *= 2; + } + prepared->samples = power2; + } + } + + /* Calculate the silence and size of the audio specification */ + SDL_CalculateAudioSpec(prepared); + + return 1; +} + + +static SDL_AudioDeviceID +open_audio_device(const char *devname, int iscapture, + const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, + int allowed_changes, int min_id) +{ + SDL_AudioDeviceID id = 0; + SDL_AudioSpec _obtained; + SDL_AudioDevice *device; + SDL_bool build_cvt; + int i = 0; + + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + SDL_SetError("Audio subsystem is not initialized"); + return 0; + } + + if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) { + SDL_SetError("No capture support"); + return 0; + } + + if (!obtained) { + obtained = &_obtained; + } + if (!prepare_audiospec(desired, obtained)) { + return 0; + } + + /* If app doesn't care about a specific device, let the user override. */ + if (devname == NULL) { + devname = SDL_getenv("SDL_AUDIO_DEVICE_NAME"); + } + + /* + * Catch device names at the high level for the simple case... + * This lets us have a basic "device enumeration" for systems that + * don't have multiple devices, but makes sure the device name is + * always NULL when it hits the low level. + * + * Also make sure that the simple case prevents multiple simultaneous + * opens of the default system device. + */ + + if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { + if ((devname) && (SDL_strcmp(devname, DEFAULT_INPUT_DEVNAME) != 0)) { + SDL_SetError("No such device"); + return 0; + } + devname = NULL; + + for (i = 0; i < SDL_arraysize(open_devices); i++) { + if ((open_devices[i]) && (open_devices[i]->iscapture)) { + SDL_SetError("Audio device already open"); + return 0; + } + } + } + + if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + if ((devname) && (SDL_strcmp(devname, DEFAULT_OUTPUT_DEVNAME) != 0)) { + SDL_SetError("No such device"); + return 0; + } + devname = NULL; + + for (i = 0; i < SDL_arraysize(open_devices); i++) { + if ((open_devices[i]) && (!open_devices[i]->iscapture)) { + SDL_SetError("Audio device already open"); + return 0; + } + } + } + + device = (SDL_AudioDevice *) SDL_AllocAudioMem(sizeof(SDL_AudioDevice)); + if (device == NULL) { + SDL_OutOfMemory(); + return 0; + } + SDL_memset(device, '\0', sizeof(SDL_AudioDevice)); + device->spec = *obtained; + device->enabled = 1; + device->paused = 1; + device->iscapture = iscapture; + + /* Create a semaphore for locking the sound buffers */ + if (!current_audio.impl.SkipMixerLock) { + device->mixer_lock = SDL_CreateMutex(); + if (device->mixer_lock == NULL) { + close_audio_device(device); + SDL_SetError("Couldn't create mixer lock"); + return 0; + } + } + + /* force a device detection if we haven't done one yet. */ + if ( ((iscapture) && (current_audio.inputDevices == NULL)) || + ((!iscapture) && (current_audio.outputDevices == NULL)) ) + SDL_GetNumAudioDevices(iscapture); + + if (current_audio.impl.OpenDevice(device, devname, iscapture) < 0) { + close_audio_device(device); + return 0; + } + device->opened = 1; + + /* Allocate a fake audio memory buffer */ + device->fake_stream = (Uint8 *)SDL_AllocAudioMem(device->spec.size); + if (device->fake_stream == NULL) { + close_audio_device(device); + SDL_OutOfMemory(); + return 0; + } + + /* See if we need to do any conversion */ + build_cvt = SDL_FALSE; + if (obtained->freq != device->spec.freq) { + if (allowed_changes & SDL_AUDIO_ALLOW_FREQUENCY_CHANGE) { + obtained->freq = device->spec.freq; + } else { + build_cvt = SDL_TRUE; + } + } + if (obtained->format != device->spec.format) { + if (allowed_changes & SDL_AUDIO_ALLOW_FORMAT_CHANGE) { + obtained->format = device->spec.format; + } else { + build_cvt = SDL_TRUE; + } + } + if (obtained->channels != device->spec.channels) { + if (allowed_changes & SDL_AUDIO_ALLOW_CHANNELS_CHANGE) { + obtained->channels = device->spec.channels; + } else { + build_cvt = SDL_TRUE; + } + } + + /* If the audio driver changes the buffer size, accept it. + This needs to be done after the format is modified above, + otherwise it might not have the correct buffer size. + */ + if (device->spec.samples != obtained->samples) { + obtained->samples = device->spec.samples; + SDL_CalculateAudioSpec(obtained); + } + + if (build_cvt) { + /* Build an audio conversion block */ + if (SDL_BuildAudioCVT(&device->convert, + obtained->format, obtained->channels, + obtained->freq, + device->spec.format, device->spec.channels, + device->spec.freq) < 0) { + close_audio_device(device); + return 0; + } + if (device->convert.needed) { + device->convert.len = (int) (((double) device->spec.size) / + device->convert.len_ratio); + + device->convert.buf = + (Uint8 *) SDL_AllocAudioMem(device->convert.len * + device->convert.len_mult); + if (device->convert.buf == NULL) { + close_audio_device(device); + SDL_OutOfMemory(); + return 0; + } + } + } + + /* Find an available device ID and store the structure... */ + for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) { + if (open_devices[id] == NULL) { + open_devices[id] = device; + break; + } + } + + if (id == SDL_arraysize(open_devices)) { + SDL_SetError("Too many open audio devices"); + close_audio_device(device); + return 0; + } + + /* Start the audio thread if necessary */ + if (!current_audio.impl.ProvidesOwnCallbackThread) { + /* Start the audio thread */ + char name[64]; + SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) (id + 1)); +/* !!! FIXME: this is nasty. */ +#if defined(__WIN32__) && !defined(HAVE_LIBC) #undef SDL_CreateThread - audio->thread = SDL_CreateThread(SDL_RunAudio, audio, NULL, NULL); + device->thread = SDL_CreateThread(SDL_RunAudio, name, device, NULL, NULL); #else - audio->thread = SDL_CreateThread(SDL_RunAudio, audio); + device->thread = SDL_CreateThread(SDL_RunAudio, name, device); #endif - if ( audio->thread == NULL ) { - SDL_CloseAudio(); - SDL_SetError("Couldn't create audio thread"); - return(-1); - } - break; + if (device->thread == NULL) { + SDL_CloseAudioDevice(id + 1); + SDL_SetError("Couldn't create audio thread"); + return 0; + } + } + + return id + 1; +} - default: - /* The audio is now playing */ - break; - } - return(0); +int +SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) +{ + SDL_AudioDeviceID id = 0; + + /* Start up the audio driver, if necessary. This is legacy behaviour! */ + if (!SDL_WasInit(SDL_INIT_AUDIO)) { + if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { + return (-1); + } + } + + /* SDL_OpenAudio() is legacy and can only act on Device ID #1. */ + if (open_devices[0] != NULL) { + SDL_SetError("Audio device is already opened"); + return (-1); + } + + if (obtained) { + id = open_audio_device(NULL, 0, desired, obtained, + SDL_AUDIO_ALLOW_ANY_CHANGE, 1); + } else { + id = open_audio_device(NULL, 0, desired, desired, 0, 1); + } + + SDL_assert((id == 0) || (id == 1)); + return ((id == 0) ? -1 : 0); +} + +SDL_AudioDeviceID +SDL_OpenAudioDevice(const char *device, int iscapture, + const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, + int allowed_changes) +{ + return open_audio_device(device, iscapture, desired, obtained, + allowed_changes, 2); +} + +SDL_AudioStatus +SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) +{ + SDL_AudioDevice *device = get_audio_device(devid); + SDL_AudioStatus status = SDL_AUDIO_STOPPED; + if (device && device->enabled) { + if (device->paused) { + status = SDL_AUDIO_PAUSED; + } else { + status = SDL_AUDIO_PLAYING; + } + } + return (status); } -SDL_audiostatus SDL_GetAudioStatus(void) + +SDL_AudioStatus +SDL_GetAudioStatus(void) { - SDL_AudioDevice *audio = current_audio; - SDL_audiostatus status; + return SDL_GetAudioDeviceStatus(1); +} - status = SDL_AUDIO_STOPPED; - if ( audio && audio->enabled ) { - if ( audio->paused ) { - status = SDL_AUDIO_PAUSED; - } else { - status = SDL_AUDIO_PLAYING; - } - } - return(status); +void +SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on) +{ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + current_audio.impl.LockDevice(device); + device->paused = pause_on; + current_audio.impl.UnlockDevice(device); + } } -void SDL_PauseAudio (int pause_on) +void +SDL_PauseAudio(int pause_on) { - SDL_AudioDevice *audio = current_audio; + SDL_PauseAudioDevice(1, pause_on); +} + - if ( audio ) { - audio->paused = pause_on; - } +void +SDL_LockAudioDevice(SDL_AudioDeviceID devid) +{ + /* Obtain a lock on the mixing buffers */ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + current_audio.impl.LockDevice(device); + } } -void SDL_LockAudio (void) +void +SDL_LockAudio(void) { - SDL_AudioDevice *audio = current_audio; + SDL_LockAudioDevice(1); +} - /* Obtain a lock on the mixing buffers */ - if ( audio && audio->LockAudio ) { - audio->LockAudio(audio); - } +void +SDL_UnlockAudioDevice(SDL_AudioDeviceID devid) +{ + /* Obtain a lock on the mixing buffers */ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + current_audio.impl.UnlockDevice(device); + } } -void SDL_UnlockAudio (void) +void +SDL_UnlockAudio(void) { - SDL_AudioDevice *audio = current_audio; + SDL_UnlockAudioDevice(1); +} - /* Release lock on the mixing buffers */ - if ( audio && audio->UnlockAudio ) { - audio->UnlockAudio(audio); - } +void +SDL_CloseAudioDevice(SDL_AudioDeviceID devid) +{ + SDL_AudioDevice *device = get_audio_device(devid); + if (device) { + close_audio_device(device); + open_devices[devid - 1] = NULL; + } } -void SDL_CloseAudio (void) +void +SDL_CloseAudio(void) { - SDL_QuitSubSystem(SDL_INIT_AUDIO); + SDL_CloseAudioDevice(1); } -void SDL_AudioQuit(void) +void +SDL_AudioQuit(void) { - SDL_AudioDevice *audio = current_audio; + SDL_AudioDeviceID i; - if ( audio ) { - audio->enabled = 0; - if ( audio->thread != NULL ) { - SDL_WaitThread(audio->thread, NULL); - } - if ( audio->mixer_lock != NULL ) { - SDL_DestroyMutex(audio->mixer_lock); - } - if ( audio->fake_stream != NULL ) { - SDL_FreeAudioMem(audio->fake_stream); - } - if ( audio->convert.needed ) { - SDL_FreeAudioMem(audio->convert.buf); + if (!current_audio.name) { /* not initialized?! */ + return; + } - } - if ( audio->opened ) { - audio->CloseAudio(audio); - audio->opened = 0; - } - /* Free the driver data */ - audio->free(audio); - current_audio = NULL; - } + for (i = 0; i < SDL_arraysize(open_devices); i++) { + if (open_devices[i] != NULL) { + SDL_CloseAudioDevice(i+1); + } + } + + /* Free the driver data */ + current_audio.impl.Deinitialize(); + free_device_list(¤t_audio.outputDevices, + ¤t_audio.outputDeviceCount); + free_device_list(¤t_audio.inputDevices, + ¤t_audio.inputDeviceCount); + SDL_memset(¤t_audio, '\0', sizeof(current_audio)); + SDL_memset(open_devices, '\0', sizeof(open_devices)); } -#define NUM_FORMATS 6 +#define NUM_FORMATS 10 static int format_idx; static int format_idx_sub; -static Uint16 format_list[NUM_FORMATS][NUM_FORMATS] = { - { AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB }, - { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB }, - { AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8 }, - { AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8 }, - { AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U8, AUDIO_S8 }, - { AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U8, AUDIO_S8 }, +static SDL_AudioFormat format_list[NUM_FORMATS][NUM_FORMATS] = { + {AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, + AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB}, + {AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, + AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB}, + {AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S32LSB, + AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S32MSB, + AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S32LSB, + AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_S32MSB, + AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S16LSB, + AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S16MSB, + AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S16LSB, + AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8}, + {AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_S16MSB, + AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8}, }; -Uint16 SDL_FirstAudioFormat(Uint16 format) +SDL_AudioFormat +SDL_FirstAudioFormat(SDL_AudioFormat format) { - for ( format_idx=0; format_idx < NUM_FORMATS; ++format_idx ) { - if ( format_list[format_idx][0] == format ) { - break; - } - } - format_idx_sub = 0; - return(SDL_NextAudioFormat()); + for (format_idx = 0; format_idx < NUM_FORMATS; ++format_idx) { + if (format_list[format_idx][0] == format) { + break; + } + } + format_idx_sub = 0; + return (SDL_NextAudioFormat()); } -Uint16 SDL_NextAudioFormat(void) +SDL_AudioFormat +SDL_NextAudioFormat(void) { - if ( (format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS) ) { - return(0); - } - return(format_list[format_idx][format_idx_sub++]); + if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) { + return (0); + } + return (format_list[format_idx][format_idx_sub++]); } -void SDL_CalculateAudioSpec(SDL_AudioSpec *spec) +void +SDL_CalculateAudioSpec(SDL_AudioSpec * spec) { - switch (spec->format) { - case AUDIO_U8: - spec->silence = 0x80; - break; - default: - spec->silence = 0x00; - break; - } - spec->size = (spec->format&0xFF)/8; - spec->size *= spec->channels; - spec->size *= spec->samples; + switch (spec->format) { + case AUDIO_U8: + spec->silence = 0x80; + break; + default: + spec->silence = 0x00; + break; + } + spec->size = SDL_AUDIO_BITSIZE(spec->format) / 8; + spec->size *= spec->channels; + spec->size *= spec->samples; } -void SDL_Audio_SetCaption(const char *caption) + +/* + * Moved here from SDL_mixer.c, since it relies on internals of an opened + * audio device (and is deprecated, by the way!). + */ +void +SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume) { - if ((current_audio) && (current_audio->SetCaption)) { - current_audio->SetCaption(current_audio, caption); - } + /* Mix the user-level audio format */ + SDL_AudioDevice *device = get_audio_device(1); + if (device != NULL) { + SDL_AudioFormat format; + if (device->convert.needed) { + format = device->convert.src_format; + } else { + format = device->spec.format; + } + SDL_MixAudioFormat(dst, src, format, len, volume); + } } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_audio_c.h b/src/audio/SDL_audio_c.h index 5fcf2029f7..6abae300bb 100644 --- a/src/audio/SDL_audio_c.h +++ b/src/audio/SDL_audio_c.h @@ -1,35 +1,55 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */ /* Functions to get a list of "close" audio formats */ -extern Uint16 SDL_FirstAudioFormat(Uint16 format); -extern Uint16 SDL_NextAudioFormat(void); +extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format); +extern SDL_AudioFormat SDL_NextAudioFormat(void); /* Function to calculate the size and silence for a SDL_AudioSpec */ -extern void SDL_CalculateAudioSpec(SDL_AudioSpec *spec); +extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec); /* The actual mixing thread function */ extern int SDLCALL SDL_RunAudio(void *audiop); +/* this is used internally to access some autogenerated code. */ +typedef struct +{ + SDL_AudioFormat src_fmt; + SDL_AudioFormat dst_fmt; + SDL_AudioFilter filter; +} SDL_AudioTypeFilters; +extern const SDL_AudioTypeFilters sdl_audio_type_filters[]; + +/* this is used internally to access some autogenerated code. */ +typedef struct +{ + SDL_AudioFormat fmt; + int channels; + int upsample; + int multiple; + SDL_AudioFilter filter; +} SDL_AudioRateFilters; +extern const SDL_AudioRateFilters sdl_audio_rate_filters[]; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 9b8fbcd6e9..fc23b5d586 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -1,1510 +1,1081 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Functions for audio drivers to perform runtime conversion of audio format */ #include "SDL_audio.h" +#include "SDL_audio_c.h" + +#include "SDL_assert.h" +/* #define DEBUG_CONVERT */ /* Effectively mix right and left channels into a single channel */ -void SDLCALL SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format) +static void SDLCALL +SDL_ConvertMono(SDL_AudioCVT * cvt, SDL_AudioFormat format) { - int i; - Sint32 sample; + int i; + Sint32 sample; #ifdef DEBUG_CONVERT - fprintf(stderr, "Converting to mono\n"); + fprintf(stderr, "Converting to mono\n"); #endif - switch (format&0x8018) { - - case AUDIO_U8: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - for ( i=cvt->len_cvt/2; i; --i ) { - sample = src[0] + src[1]; - *dst = (Uint8)(sample / 2); - src += 2; - dst += 1; - } - } - break; - - case AUDIO_S8: { - Sint8 *src, *dst; - - src = (Sint8 *)cvt->buf; - dst = (Sint8 *)cvt->buf; - for ( i=cvt->len_cvt/2; i; --i ) { - sample = src[0] + src[1]; - *dst = (Sint8)(sample / 2); - src += 2; - dst += 1; - } - } - break; - - case AUDIO_U16: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/4; i; --i ) { - sample = (Uint16)((src[0]<<8)|src[1])+ - (Uint16)((src[2]<<8)|src[3]); - sample /= 2; - dst[1] = (sample&0xFF); - sample >>= 8; - dst[0] = (sample&0xFF); - src += 4; - dst += 2; - } - } else { - for ( i=cvt->len_cvt/4; i; --i ) { - sample = (Uint16)((src[1]<<8)|src[0])+ - (Uint16)((src[3]<<8)|src[2]); - sample /= 2; - dst[0] = (sample&0xFF); - sample >>= 8; - dst[1] = (sample&0xFF); - src += 4; - dst += 2; - } - } - } - break; - - case AUDIO_S16: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/4; i; --i ) { - sample = (Sint16)((src[0]<<8)|src[1])+ - (Sint16)((src[2]<<8)|src[3]); - sample /= 2; - dst[1] = (sample&0xFF); - sample >>= 8; - dst[0] = (sample&0xFF); - src += 4; - dst += 2; - } - } else { - for ( i=cvt->len_cvt/4; i; --i ) { - sample = (Sint16)((src[1]<<8)|src[0])+ - (Sint16)((src[3]<<8)|src[2]); - sample /= 2; - dst[0] = (sample&0xFF); - sample >>= 8; - dst[1] = (sample&0xFF); - src += 4; - dst += 2; - } - } - } - break; - } - cvt->len_cvt /= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) { + case AUDIO_U8: + { + Uint8 *src, *dst; + + src = cvt->buf; + dst = cvt->buf; + for (i = cvt->len_cvt / 2; i; --i) { + sample = src[0] + src[1]; + *dst = (Uint8) (sample / 2); + src += 2; + dst += 1; + } + } + break; + + case AUDIO_S8: + { + Sint8 *src, *dst; + + src = (Sint8 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / 2; i; --i) { + sample = src[0] + src[1]; + *dst = (Sint8) (sample / 2); + src += 2; + dst += 1; + } + } + break; + + case AUDIO_U16: + { + Uint8 *src, *dst; + + src = cvt->buf; + dst = cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Uint16) ((src[0] << 8) | src[1]) + + (Uint16) ((src[2] << 8) | src[3]); + sample /= 2; + dst[1] = (sample & 0xFF); + sample >>= 8; + dst[0] = (sample & 0xFF); + src += 4; + dst += 2; + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Uint16) ((src[1] << 8) | src[0]) + + (Uint16) ((src[3] << 8) | src[2]); + sample /= 2; + dst[0] = (sample & 0xFF); + sample >>= 8; + dst[1] = (sample & 0xFF); + src += 4; + dst += 2; + } + } + } + break; + + case AUDIO_S16: + { + Uint8 *src, *dst; + + src = cvt->buf; + dst = cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Sint16) ((src[0] << 8) | src[1]) + + (Sint16) ((src[2] << 8) | src[3]); + sample /= 2; + dst[1] = (sample & 0xFF); + sample >>= 8; + dst[0] = (sample & 0xFF); + src += 4; + dst += 2; + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + sample = (Sint16) ((src[1] << 8) | src[0]) + + (Sint16) ((src[3] << 8) | src[2]); + sample /= 2; + dst[0] = (sample & 0xFF); + sample >>= 8; + dst[1] = (sample & 0xFF); + src += 4; + dst += 2; + } + } + } + break; + + case AUDIO_S32: + { + const Uint32 *src = (const Uint32 *) cvt->buf; + Uint32 *dst = (Uint32 *) cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const Sint64 added = + (((Sint64) (Sint32) SDL_SwapBE32(src[0])) + + ((Sint64) (Sint32) SDL_SwapBE32(src[1]))); + *(dst++) = SDL_SwapBE32((Uint32) ((Sint32) (added / 2))); + } + } else { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const Sint64 added = + (((Sint64) (Sint32) SDL_SwapLE32(src[0])) + + ((Sint64) (Sint32) SDL_SwapLE32(src[1]))); + *(dst++) = SDL_SwapLE32((Uint32) ((Sint32) (added / 2))); + } + } + } + break; + + case AUDIO_F32: + { + const float *src = (const float *) cvt->buf; + float *dst = (float *) cvt->buf; + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const float src1 = SDL_SwapFloatBE(src[0]); + const float src2 = SDL_SwapFloatBE(src[1]); + const double added = ((double) src1) + ((double) src2); + const float halved = (float) (added * 0.5); + *(dst++) = SDL_SwapFloatBE(halved); + } + } else { + for (i = cvt->len_cvt / 8; i; --i, src += 2) { + const float src1 = SDL_SwapFloatLE(src[0]); + const float src2 = SDL_SwapFloatLE(src[1]); + const double added = ((double) src1) + ((double) src2); + const float halved = (float) (added * 0.5); + *(dst++) = SDL_SwapFloatLE(halved); + } + } + } + break; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } } + /* Discard top 4 channels */ -void SDLCALL SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format) +static void SDLCALL +SDL_ConvertStrip(SDL_AudioCVT * cvt, SDL_AudioFormat format) { - int i; - Sint32 lsample, rsample; + int i; #ifdef DEBUG_CONVERT - fprintf(stderr, "Converting down to stereo\n"); + fprintf(stderr, "Converting down from 6 channels to stereo\n"); #endif - switch (format&0x8018) { - - case AUDIO_U8: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - for ( i=cvt->len_cvt/6; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - src += 6; - dst += 2; - } - } - break; - - case AUDIO_S8: { - Sint8 *src, *dst; - - src = (Sint8 *)cvt->buf; - dst = (Sint8 *)cvt->buf; - for ( i=cvt->len_cvt/6; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - src += 6; - dst += 2; - } - } - break; - - case AUDIO_U16: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/12; i; --i ) { - lsample = (Uint16)((src[0]<<8)|src[1]); - rsample = (Uint16)((src[2]<<8)|src[3]); - dst[1] = (lsample&0xFF); - lsample >>= 8; - dst[0] = (lsample&0xFF); - dst[3] = (rsample&0xFF); - rsample >>= 8; - dst[2] = (rsample&0xFF); - src += 12; - dst += 4; - } - } else { - for ( i=cvt->len_cvt/12; i; --i ) { - lsample = (Uint16)((src[1]<<8)|src[0]); - rsample = (Uint16)((src[3]<<8)|src[2]); - dst[0] = (lsample&0xFF); - lsample >>= 8; - dst[1] = (lsample&0xFF); - dst[2] = (rsample&0xFF); - rsample >>= 8; - dst[3] = (rsample&0xFF); - src += 12; - dst += 4; - } - } - } - break; - - case AUDIO_S16: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/12; i; --i ) { - lsample = (Sint16)((src[0]<<8)|src[1]); - rsample = (Sint16)((src[2]<<8)|src[3]); - dst[1] = (lsample&0xFF); - lsample >>= 8; - dst[0] = (lsample&0xFF); - dst[3] = (rsample&0xFF); - rsample >>= 8; - dst[2] = (rsample&0xFF); - src += 12; - dst += 4; - } - } else { - for ( i=cvt->len_cvt/12; i; --i ) { - lsample = (Sint16)((src[1]<<8)|src[0]); - rsample = (Sint16)((src[3]<<8)|src[2]); - dst[0] = (lsample&0xFF); - lsample >>= 8; - dst[1] = (lsample&0xFF); - dst[2] = (rsample&0xFF); - rsample >>= 8; - dst[3] = (rsample&0xFF); - src += 12; - dst += 4; - } - } - } - break; - } - cvt->len_cvt /= 3; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + +#define strip_chans_6_to_2(type) \ + { \ + const type *src = (const type *) cvt->buf; \ + type *dst = (type *) cvt->buf; \ + for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \ + dst[0] = src[0]; \ + dst[1] = src[1]; \ + src += 6; \ + dst += 2; \ + } \ + } + + /* this function only cares about typesize, and data as a block of bits. */ + switch (SDL_AUDIO_BITSIZE(format)) { + case 8: + strip_chans_6_to_2(Uint8); + break; + case 16: + strip_chans_6_to_2(Uint16); + break; + case 32: + strip_chans_6_to_2(Uint32); + break; + } + +#undef strip_chans_6_to_2 + + cvt->len_cvt /= 3; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } } /* Discard top 2 channels of 6 */ -void SDLCALL SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format) +static void SDLCALL +SDL_ConvertStrip_2(SDL_AudioCVT * cvt, SDL_AudioFormat format) { - int i; - Sint32 lsample, rsample; + int i; #ifdef DEBUG_CONVERT - fprintf(stderr, "Converting 6 down to quad\n"); + fprintf(stderr, "Converting 6 down to quad\n"); #endif - switch (format&0x8018) { - - case AUDIO_U8: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - for ( i=cvt->len_cvt/4; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - src += 4; - dst += 2; - } - } - break; - - case AUDIO_S8: { - Sint8 *src, *dst; - - src = (Sint8 *)cvt->buf; - dst = (Sint8 *)cvt->buf; - for ( i=cvt->len_cvt/4; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - src += 4; - dst += 2; - } - } - break; - - case AUDIO_U16: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/8; i; --i ) { - lsample = (Uint16)((src[0]<<8)|src[1]); - rsample = (Uint16)((src[2]<<8)|src[3]); - dst[1] = (lsample&0xFF); - lsample >>= 8; - dst[0] = (lsample&0xFF); - dst[3] = (rsample&0xFF); - rsample >>= 8; - dst[2] = (rsample&0xFF); - src += 8; - dst += 4; - } - } else { - for ( i=cvt->len_cvt/8; i; --i ) { - lsample = (Uint16)((src[1]<<8)|src[0]); - rsample = (Uint16)((src[3]<<8)|src[2]); - dst[0] = (lsample&0xFF); - lsample >>= 8; - dst[1] = (lsample&0xFF); - dst[2] = (rsample&0xFF); - rsample >>= 8; - dst[3] = (rsample&0xFF); - src += 8; - dst += 4; - } - } - } - break; - - case AUDIO_S16: { - Uint8 *src, *dst; - - src = cvt->buf; - dst = cvt->buf; - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/8; i; --i ) { - lsample = (Sint16)((src[0]<<8)|src[1]); - rsample = (Sint16)((src[2]<<8)|src[3]); - dst[1] = (lsample&0xFF); - lsample >>= 8; - dst[0] = (lsample&0xFF); - dst[3] = (rsample&0xFF); - rsample >>= 8; - dst[2] = (rsample&0xFF); - src += 8; - dst += 4; - } - } else { - for ( i=cvt->len_cvt/8; i; --i ) { - lsample = (Sint16)((src[1]<<8)|src[0]); - rsample = (Sint16)((src[3]<<8)|src[2]); - dst[0] = (lsample&0xFF); - lsample >>= 8; - dst[1] = (lsample&0xFF); - dst[2] = (rsample&0xFF); - rsample >>= 8; - dst[3] = (rsample&0xFF); - src += 8; - dst += 4; - } - } - } - break; - } - cvt->len_cvt /= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + +#define strip_chans_6_to_4(type) \ + { \ + const type *src = (const type *) cvt->buf; \ + type *dst = (type *) cvt->buf; \ + for (i = cvt->len_cvt / (sizeof (type) * 6); i; --i) { \ + dst[0] = src[0]; \ + dst[1] = src[1]; \ + dst[2] = src[2]; \ + dst[3] = src[3]; \ + src += 6; \ + dst += 4; \ + } \ + } + + /* this function only cares about typesize, and data as a block of bits. */ + switch (SDL_AUDIO_BITSIZE(format)) { + case 8: + strip_chans_6_to_4(Uint8); + break; + case 16: + strip_chans_6_to_4(Uint16); + break; + case 32: + strip_chans_6_to_4(Uint32); + break; + } + +#undef strip_chans_6_to_4 + + cvt->len_cvt /= 6; + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } } /* Duplicate a mono channel to both stereo channels */ -void SDLCALL SDL_ConvertStereo(SDL_AudioCVT *cvt, Uint16 format) +static void SDLCALL +SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format) { - int i; + int i; #ifdef DEBUG_CONVERT - fprintf(stderr, "Converting to stereo\n"); + fprintf(stderr, "Converting to stereo\n"); #endif - if ( (format & 0xFF) == 16 ) { - Uint16 *src, *dst; - - src = (Uint16 *)(cvt->buf+cvt->len_cvt); - dst = (Uint16 *)(cvt->buf+cvt->len_cvt*2); - for ( i=cvt->len_cvt/2; i; --i ) { - dst -= 2; - src -= 1; - dst[0] = src[0]; - dst[1] = src[0]; - } - } else { - Uint8 *src, *dst; - - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - for ( i=cvt->len_cvt; i; --i ) { - dst -= 2; - src -= 1; - dst[0] = src[0]; - dst[1] = src[0]; - } - } - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + +#define dup_chans_1_to_2(type) \ + { \ + const type *src = (const type *) (cvt->buf + cvt->len_cvt); \ + type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \ + for (i = cvt->len_cvt / sizeof(type); i; --i) { \ + src -= 1; \ + dst -= 2; \ + dst[0] = dst[1] = *src; \ + } \ + } + + /* this function only cares about typesize, and data as a block of bits. */ + switch (SDL_AUDIO_BITSIZE(format)) { + case 8: + dup_chans_1_to_2(Uint8); + break; + case 16: + dup_chans_1_to_2(Uint16); + break; + case 32: + dup_chans_1_to_2(Uint32); + break; + } + +#undef dup_chans_1_to_2 + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } } /* Duplicate a stereo channel to a pseudo-5.1 stream */ -void SDLCALL SDL_ConvertSurround(SDL_AudioCVT *cvt, Uint16 format) +static void SDLCALL +SDL_ConvertSurround(SDL_AudioCVT * cvt, SDL_AudioFormat format) { - int i; + int i; #ifdef DEBUG_CONVERT - fprintf(stderr, "Converting stereo to surround\n"); + fprintf(stderr, "Converting stereo to surround\n"); #endif - switch (format&0x8018) { - - case AUDIO_U8: { - Uint8 *src, *dst, lf, rf, ce; - - src = (Uint8 *)(cvt->buf+cvt->len_cvt); - dst = (Uint8 *)(cvt->buf+cvt->len_cvt*3); - for ( i=cvt->len_cvt; i; --i ) { - dst -= 6; - src -= 2; - lf = src[0]; - rf = src[1]; - ce = (lf/2) + (rf/2); - dst[0] = lf; - dst[1] = rf; - dst[2] = lf - ce; - dst[3] = rf - ce; - dst[4] = ce; - dst[5] = ce; - } - } - break; - - case AUDIO_S8: { - Sint8 *src, *dst, lf, rf, ce; - - src = (Sint8 *)cvt->buf+cvt->len_cvt; - dst = (Sint8 *)cvt->buf+cvt->len_cvt*3; - for ( i=cvt->len_cvt; i; --i ) { - dst -= 6; - src -= 2; - lf = src[0]; - rf = src[1]; - ce = (lf/2) + (rf/2); - dst[0] = lf; - dst[1] = rf; - dst[2] = lf - ce; - dst[3] = rf - ce; - dst[4] = ce; - dst[5] = ce; - } - } - break; - - case AUDIO_U16: { - Uint8 *src, *dst; - Uint16 lf, rf, ce, lr, rr; - - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*3; - - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 12; - src -= 4; - lf = (Uint16)((src[0]<<8)|src[1]); - rf = (Uint16)((src[2]<<8)|src[3]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[1] = (lf&0xFF); - dst[0] = ((lf>>8)&0xFF); - dst[3] = (rf&0xFF); - dst[2] = ((rf>>8)&0xFF); - - dst[1+4] = (lr&0xFF); - dst[0+4] = ((lr>>8)&0xFF); - dst[3+4] = (rr&0xFF); - dst[2+4] = ((rr>>8)&0xFF); - - dst[1+8] = (ce&0xFF); - dst[0+8] = ((ce>>8)&0xFF); - dst[3+8] = (ce&0xFF); - dst[2+8] = ((ce>>8)&0xFF); - } - } else { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 12; - src -= 4; - lf = (Uint16)((src[1]<<8)|src[0]); - rf = (Uint16)((src[3]<<8)|src[2]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[0] = (lf&0xFF); - dst[1] = ((lf>>8)&0xFF); - dst[2] = (rf&0xFF); - dst[3] = ((rf>>8)&0xFF); - - dst[0+4] = (lr&0xFF); - dst[1+4] = ((lr>>8)&0xFF); - dst[2+4] = (rr&0xFF); - dst[3+4] = ((rr>>8)&0xFF); - - dst[0+8] = (ce&0xFF); - dst[1+8] = ((ce>>8)&0xFF); - dst[2+8] = (ce&0xFF); - dst[3+8] = ((ce>>8)&0xFF); - } - } - } - break; - - case AUDIO_S16: { - Uint8 *src, *dst; - Sint16 lf, rf, ce, lr, rr; - - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*3; - - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 12; - src -= 4; - lf = (Sint16)((src[0]<<8)|src[1]); - rf = (Sint16)((src[2]<<8)|src[3]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[1] = (lf&0xFF); - dst[0] = ((lf>>8)&0xFF); - dst[3] = (rf&0xFF); - dst[2] = ((rf>>8)&0xFF); - - dst[1+4] = (lr&0xFF); - dst[0+4] = ((lr>>8)&0xFF); - dst[3+4] = (rr&0xFF); - dst[2+4] = ((rr>>8)&0xFF); - - dst[1+8] = (ce&0xFF); - dst[0+8] = ((ce>>8)&0xFF); - dst[3+8] = (ce&0xFF); - dst[2+8] = ((ce>>8)&0xFF); - } - } else { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 12; - src -= 4; - lf = (Sint16)((src[1]<<8)|src[0]); - rf = (Sint16)((src[3]<<8)|src[2]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[0] = (lf&0xFF); - dst[1] = ((lf>>8)&0xFF); - dst[2] = (rf&0xFF); - dst[3] = ((rf>>8)&0xFF); - - dst[0+4] = (lr&0xFF); - dst[1+4] = ((lr>>8)&0xFF); - dst[2+4] = (rr&0xFF); - dst[3+4] = ((rr>>8)&0xFF); - - dst[0+8] = (ce&0xFF); - dst[1+8] = ((ce>>8)&0xFF); - dst[2+8] = (ce&0xFF); - dst[3+8] = ((ce>>8)&0xFF); - } - } - } - break; - } - cvt->len_cvt *= 3; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + + switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) { + case AUDIO_U8: + { + Uint8 *src, *dst, lf, rf, ce; + + src = (Uint8 *) (cvt->buf + cvt->len_cvt); + dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 3); + for (i = cvt->len_cvt; i; --i) { + dst -= 6; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + dst[4] = ce; + dst[5] = ce; + } + } + break; + + case AUDIO_S8: + { + Sint8 *src, *dst, lf, rf, ce; + + src = (Sint8 *) cvt->buf + cvt->len_cvt; + dst = (Sint8 *) cvt->buf + cvt->len_cvt * 3; + for (i = cvt->len_cvt; i; --i) { + dst -= 6; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + dst[4] = ce; + dst[5] = ce; + } + } + break; + + case AUDIO_U16: + { + Uint8 *src, *dst; + Uint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Uint16) ((src[0] << 8) | src[1]); + rf = (Uint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + + dst[1 + 8] = (ce & 0xFF); + dst[0 + 8] = ((ce >> 8) & 0xFF); + dst[3 + 8] = (ce & 0xFF); + dst[2 + 8] = ((ce >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Uint16) ((src[1] << 8) | src[0]); + rf = (Uint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + + dst[0 + 8] = (ce & 0xFF); + dst[1 + 8] = ((ce >> 8) & 0xFF); + dst[2 + 8] = (ce & 0xFF); + dst[3 + 8] = ((ce >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S16: + { + Uint8 *src, *dst; + Sint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Sint16) ((src[0] << 8) | src[1]); + rf = (Sint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + + dst[1 + 8] = (ce & 0xFF); + dst[0 + 8] = ((ce >> 8) & 0xFF); + dst[3 + 8] = (ce & 0xFF); + dst[2 + 8] = ((ce >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 12; + src -= 4; + lf = (Sint16) ((src[1] << 8) | src[0]); + rf = (Sint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + + dst[0 + 8] = (ce & 0xFF); + dst[1 + 8] = ((ce >> 8) & 0xFF); + dst[2 + 8] = (ce & 0xFF); + dst[3 + 8] = ((ce >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S32: + { + Sint32 lf, rf, ce; + const Uint32 *src = (const Uint32 *) cvt->buf + cvt->len_cvt; + Uint32 *dst = (Uint32 *) cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = (Sint32) SDL_SwapBE32(src[0]); + rf = (Sint32) SDL_SwapBE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = SDL_SwapBE32((Uint32) lf); + dst[1] = SDL_SwapBE32((Uint32) rf); + dst[2] = SDL_SwapBE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapBE32((Uint32) (rf - ce)); + dst[4] = SDL_SwapBE32((Uint32) ce); + dst[5] = SDL_SwapBE32((Uint32) ce); + } + } else { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = (Sint32) SDL_SwapLE32(src[0]); + rf = (Sint32) SDL_SwapLE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapLE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapLE32((Uint32) (rf - ce)); + dst[4] = SDL_SwapLE32((Uint32) ce); + dst[5] = SDL_SwapLE32((Uint32) ce); + } + } + } + break; + + case AUDIO_F32: + { + float lf, rf, ce; + const float *src = (const float *) cvt->buf + cvt->len_cvt; + float *dst = (float *) cvt->buf + cvt->len_cvt * 3; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = SDL_SwapFloatBE(src[0]); + rf = SDL_SwapFloatBE(src[1]); + ce = (lf * 0.5f) + (rf * 0.5f); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapFloatBE(lf - ce); + dst[3] = SDL_SwapFloatBE(rf - ce); + dst[4] = dst[5] = SDL_SwapFloatBE(ce); + } + } else { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 6; + src -= 2; + lf = SDL_SwapFloatLE(src[0]); + rf = SDL_SwapFloatLE(src[1]); + ce = (lf * 0.5f) + (rf * 0.5f); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapFloatLE(lf - ce); + dst[3] = SDL_SwapFloatLE(rf - ce); + dst[4] = dst[5] = SDL_SwapFloatLE(ce); + } + } + } + break; + + } + cvt->len_cvt *= 3; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } } /* Duplicate a stereo channel to a pseudo-4.0 stream */ -void SDLCALL SDL_ConvertSurround_4(SDL_AudioCVT *cvt, Uint16 format) +static void SDLCALL +SDL_ConvertSurround_4(SDL_AudioCVT * cvt, SDL_AudioFormat format) { - int i; + int i; #ifdef DEBUG_CONVERT - fprintf(stderr, "Converting stereo to quad\n"); + fprintf(stderr, "Converting stereo to quad\n"); #endif - switch (format&0x8018) { - - case AUDIO_U8: { - Uint8 *src, *dst, lf, rf, ce; - - src = (Uint8 *)(cvt->buf+cvt->len_cvt); - dst = (Uint8 *)(cvt->buf+cvt->len_cvt*2); - for ( i=cvt->len_cvt; i; --i ) { - dst -= 4; - src -= 2; - lf = src[0]; - rf = src[1]; - ce = (lf/2) + (rf/2); - dst[0] = lf; - dst[1] = rf; - dst[2] = lf - ce; - dst[3] = rf - ce; - } - } - break; - - case AUDIO_S8: { - Sint8 *src, *dst, lf, rf, ce; - - src = (Sint8 *)cvt->buf+cvt->len_cvt; - dst = (Sint8 *)cvt->buf+cvt->len_cvt*2; - for ( i=cvt->len_cvt; i; --i ) { - dst -= 4; - src -= 2; - lf = src[0]; - rf = src[1]; - ce = (lf/2) + (rf/2); - dst[0] = lf; - dst[1] = rf; - dst[2] = lf - ce; - dst[3] = rf - ce; - } - } - break; - - case AUDIO_U16: { - Uint8 *src, *dst; - Uint16 lf, rf, ce, lr, rr; - - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 8; - src -= 4; - lf = (Uint16)((src[0]<<8)|src[1]); - rf = (Uint16)((src[2]<<8)|src[3]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[1] = (lf&0xFF); - dst[0] = ((lf>>8)&0xFF); - dst[3] = (rf&0xFF); - dst[2] = ((rf>>8)&0xFF); - - dst[1+4] = (lr&0xFF); - dst[0+4] = ((lr>>8)&0xFF); - dst[3+4] = (rr&0xFF); - dst[2+4] = ((rr>>8)&0xFF); - } - } else { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 8; - src -= 4; - lf = (Uint16)((src[1]<<8)|src[0]); - rf = (Uint16)((src[3]<<8)|src[2]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[0] = (lf&0xFF); - dst[1] = ((lf>>8)&0xFF); - dst[2] = (rf&0xFF); - dst[3] = ((rf>>8)&0xFF); - - dst[0+4] = (lr&0xFF); - dst[1+4] = ((lr>>8)&0xFF); - dst[2+4] = (rr&0xFF); - dst[3+4] = ((rr>>8)&0xFF); - } - } - } - break; - - case AUDIO_S16: { - Uint8 *src, *dst; - Sint16 lf, rf, ce, lr, rr; - - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - - if ( (format & 0x1000) == 0x1000 ) { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 8; - src -= 4; - lf = (Sint16)((src[0]<<8)|src[1]); - rf = (Sint16)((src[2]<<8)|src[3]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[1] = (lf&0xFF); - dst[0] = ((lf>>8)&0xFF); - dst[3] = (rf&0xFF); - dst[2] = ((rf>>8)&0xFF); - - dst[1+4] = (lr&0xFF); - dst[0+4] = ((lr>>8)&0xFF); - dst[3+4] = (rr&0xFF); - dst[2+4] = ((rr>>8)&0xFF); - } - } else { - for ( i=cvt->len_cvt/4; i; --i ) { - dst -= 8; - src -= 4; - lf = (Sint16)((src[1]<<8)|src[0]); - rf = (Sint16)((src[3]<<8)|src[2]); - ce = (lf/2) + (rf/2); - rr = lf - ce; - lr = rf - ce; - dst[0] = (lf&0xFF); - dst[1] = ((lf>>8)&0xFF); - dst[2] = (rf&0xFF); - dst[3] = ((rf>>8)&0xFF); - - dst[0+4] = (lr&0xFF); - dst[1+4] = ((lr>>8)&0xFF); - dst[2+4] = (rr&0xFF); - dst[3+4] = ((rr>>8)&0xFF); - } - } - } - break; - } - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} - -/* Convert 8-bit to 16-bit - LSB */ -void SDLCALL SDL_Convert16LSB(SDL_AudioCVT *cvt, Uint16 format) -{ - int i; - Uint8 *src, *dst; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting to 16-bit LSB\n"); -#endif - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - for ( i=cvt->len_cvt; i; --i ) { - src -= 1; - dst -= 2; - dst[1] = *src; - dst[0] = 0; - } - format = ((format & ~0x0008) | AUDIO_U16LSB); - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + switch (format & (SDL_AUDIO_MASK_SIGNED | SDL_AUDIO_MASK_BITSIZE)) { + case AUDIO_U8: + { + Uint8 *src, *dst, lf, rf, ce; + + src = (Uint8 *) (cvt->buf + cvt->len_cvt); + dst = (Uint8 *) (cvt->buf + cvt->len_cvt * 2); + for (i = cvt->len_cvt; i; --i) { + dst -= 4; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + } + } + break; + + case AUDIO_S8: + { + Sint8 *src, *dst, lf, rf, ce; + + src = (Sint8 *) cvt->buf + cvt->len_cvt; + dst = (Sint8 *) cvt->buf + cvt->len_cvt * 2; + for (i = cvt->len_cvt; i; --i) { + dst -= 4; + src -= 2; + lf = src[0]; + rf = src[1]; + ce = (lf / 2) + (rf / 2); + dst[0] = lf; + dst[1] = rf; + dst[2] = lf - ce; + dst[3] = rf - ce; + } + } + break; + + case AUDIO_U16: + { + Uint8 *src, *dst; + Uint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 2; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Uint16) ((src[0] << 8) | src[1]); + rf = (Uint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Uint16) ((src[1] << 8) | src[0]); + rf = (Uint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S16: + { + Uint8 *src, *dst; + Sint16 lf, rf, ce, lr, rr; + + src = cvt->buf + cvt->len_cvt; + dst = cvt->buf + cvt->len_cvt * 2; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Sint16) ((src[0] << 8) | src[1]); + rf = (Sint16) ((src[2] << 8) | src[3]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[1] = (lf & 0xFF); + dst[0] = ((lf >> 8) & 0xFF); + dst[3] = (rf & 0xFF); + dst[2] = ((rf >> 8) & 0xFF); + + dst[1 + 4] = (lr & 0xFF); + dst[0 + 4] = ((lr >> 8) & 0xFF); + dst[3 + 4] = (rr & 0xFF); + dst[2 + 4] = ((rr >> 8) & 0xFF); + } + } else { + for (i = cvt->len_cvt / 4; i; --i) { + dst -= 8; + src -= 4; + lf = (Sint16) ((src[1] << 8) | src[0]); + rf = (Sint16) ((src[3] << 8) | src[2]); + ce = (lf / 2) + (rf / 2); + rr = lf - ce; + lr = rf - ce; + dst[0] = (lf & 0xFF); + dst[1] = ((lf >> 8) & 0xFF); + dst[2] = (rf & 0xFF); + dst[3] = ((rf >> 8) & 0xFF); + + dst[0 + 4] = (lr & 0xFF); + dst[1 + 4] = ((lr >> 8) & 0xFF); + dst[2 + 4] = (rr & 0xFF); + dst[3 + 4] = ((rr >> 8) & 0xFF); + } + } + } + break; + + case AUDIO_S32: + { + const Uint32 *src = (const Uint32 *) (cvt->buf + cvt->len_cvt); + Uint32 *dst = (Uint32 *) (cvt->buf + cvt->len_cvt * 2); + Sint32 lf, rf, ce; + + if (SDL_AUDIO_ISBIGENDIAN(format)) { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 4; + src -= 2; + lf = (Sint32) SDL_SwapBE32(src[0]); + rf = (Sint32) SDL_SwapBE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapBE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapBE32((Uint32) (rf - ce)); + } + } else { + for (i = cvt->len_cvt / 8; i; --i) { + dst -= 4; + src -= 2; + lf = (Sint32) SDL_SwapLE32(src[0]); + rf = (Sint32) SDL_SwapLE32(src[1]); + ce = (lf / 2) + (rf / 2); + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = SDL_SwapLE32((Uint32) (lf - ce)); + dst[3] = SDL_SwapLE32((Uint32) (rf - ce)); + } + } + } + break; + } + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } } -/* Convert 8-bit to 16-bit - MSB */ -void SDLCALL SDL_Convert16MSB(SDL_AudioCVT *cvt, Uint16 format) -{ - int i; - Uint8 *src, *dst; -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting to 16-bit MSB\n"); -#endif - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - for ( i=cvt->len_cvt; i; --i ) { - src -= 1; - dst -= 2; - dst[0] = *src; - dst[1] = 0; - } - format = ((format & ~0x0008) | AUDIO_U16MSB); - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} -/* Convert 16-bit to 8-bit */ -void SDLCALL SDL_Convert8(SDL_AudioCVT *cvt, Uint16 format) +int +SDL_ConvertAudio(SDL_AudioCVT * cvt) { - int i; - Uint8 *src, *dst; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting to 8-bit\n"); -#endif - src = cvt->buf; - dst = cvt->buf; - if ( (format & 0x1000) != 0x1000 ) { /* Little endian */ - ++src; - } - for ( i=cvt->len_cvt/2; i; --i ) { - *dst = *src; - src += 2; - dst += 1; - } - format = ((format & ~0x9010) | AUDIO_U8); - cvt->len_cvt /= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} - -/* Toggle signed/unsigned */ -void SDLCALL SDL_ConvertSign(SDL_AudioCVT *cvt, Uint16 format) -{ - int i; - Uint8 *data; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio signedness\n"); -#endif - data = cvt->buf; - if ( (format & 0xFF) == 16 ) { - if ( (format & 0x1000) != 0x1000 ) { /* Little endian */ - ++data; - } - for ( i=cvt->len_cvt/2; i; --i ) { - *data ^= 0x80; - data += 2; - } - } else { - for ( i=cvt->len_cvt; i; --i ) { - *data++ ^= 0x80; - } - } - format = (format ^ 0x8000); - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + /* !!! FIXME: (cvt) should be const; stack-copy it here. */ + /* !!! FIXME: (actually, we can't...len_cvt needs to be updated. Grr.) */ + + /* Make sure there's data to convert */ + if (cvt->buf == NULL) { + SDL_SetError("No buffer allocated for conversion"); + return (-1); + } + /* Return okay if no conversion is necessary */ + cvt->len_cvt = cvt->len; + if (cvt->filters[0] == NULL) { + return (0); + } + + /* Set up the conversion and go! */ + cvt->filter_index = 0; + cvt->filters[0] (cvt, cvt->src_format); + return (0); } -/* Toggle endianness */ -void SDLCALL SDL_ConvertEndian(SDL_AudioCVT *cvt, Uint16 format) -{ - int i; - Uint8 *data, tmp; -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio endianness\n"); -#endif - data = cvt->buf; - for ( i=cvt->len_cvt/2; i; --i ) { - tmp = data[0]; - data[0] = data[1]; - data[1] = tmp; - data += 2; - } - format = (format ^ 0x1000); - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} - -/* Convert rate up by multiple of 2 */ -void SDLCALL SDL_RateMUL2(SDL_AudioCVT *cvt, Uint16 format) +static SDL_AudioFilter +SDL_HandTunedTypeCVT(SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt) { - int i; - Uint8 *src, *dst; + /* + * Fill in any future conversions that are specialized to a + * processor, platform, compiler, or library here. + */ -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate * 2\n"); -#endif - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt; i; --i ) { - src -= 1; - dst -= 2; - dst[0] = src[0]; - dst[1] = src[0]; - } - break; - case 16: - for ( i=cvt->len_cvt/2; i; --i ) { - src -= 2; - dst -= 4; - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[0]; - dst[3] = src[1]; - } - break; - } - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + return NULL; /* no specialized converter code available. */ } -/* Convert rate up by multiple of 2, for stereo */ -void SDLCALL SDL_RateMUL2_c2(SDL_AudioCVT *cvt, Uint16 format) -{ - int i; - Uint8 *src, *dst; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate * 2\n"); -#endif - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt/2; i; --i ) { - src -= 2; - dst -= 4; - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[0]; - dst[3] = src[1]; - } - break; - case 16: - for ( i=cvt->len_cvt/4; i; --i ) { - src -= 4; - dst -= 8; - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[0]; - dst[5] = src[1]; - dst[6] = src[2]; - dst[7] = src[3]; - } - break; - } - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} - -/* Convert rate up by multiple of 2, for quad */ -void SDLCALL SDL_RateMUL2_c4(SDL_AudioCVT *cvt, Uint16 format) +/* + * Find a converter between two data types. We try to select a hand-tuned + * asm/vectorized/optimized function first, and then fallback to an + * autogenerated function that is customized to convert between two + * specific data types. + */ +static int +SDL_BuildAudioTypeCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_fmt, SDL_AudioFormat dst_fmt) { - int i; - Uint8 *src, *dst; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate * 2\n"); -#endif - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt/4; i; --i ) { - src -= 4; - dst -= 8; - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[0]; - dst[5] = src[1]; - dst[6] = src[2]; - dst[7] = src[3]; - } - break; - case 16: - for ( i=cvt->len_cvt/8; i; --i ) { - src -= 8; - dst -= 16; - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; - dst[8] = src[0]; - dst[9] = src[1]; - dst[10] = src[2]; - dst[11] = src[3]; - dst[12] = src[4]; - dst[13] = src[5]; - dst[14] = src[6]; - dst[15] = src[7]; - } - break; - } - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + if (src_fmt != dst_fmt) { + const Uint16 src_bitsize = SDL_AUDIO_BITSIZE(src_fmt); + const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt); + SDL_AudioFilter filter = SDL_HandTunedTypeCVT(src_fmt, dst_fmt); + + /* No hand-tuned converter? Try the autogenerated ones. */ + if (filter == NULL) { + int i; + for (i = 0; sdl_audio_type_filters[i].filter != NULL; i++) { + const SDL_AudioTypeFilters *filt = &sdl_audio_type_filters[i]; + if ((filt->src_fmt == src_fmt) && (filt->dst_fmt == dst_fmt)) { + filter = filt->filter; + break; + } + } + + if (filter == NULL) { + SDL_SetError("No conversion available for these formats"); + return -1; + } + } + + /* Update (cvt) with filter details... */ + cvt->filters[cvt->filter_index++] = filter; + if (src_bitsize < dst_bitsize) { + const int mult = (dst_bitsize / src_bitsize); + cvt->len_mult *= mult; + cvt->len_ratio *= mult; + } else if (src_bitsize > dst_bitsize) { + cvt->len_ratio /= (src_bitsize / dst_bitsize); + } + + return 1; /* added a converter. */ + } + + return 0; /* no conversion necessary. */ } -/* Convert rate up by multiple of 2, for 5.1 */ -void SDLCALL SDL_RateMUL2_c6(SDL_AudioCVT *cvt, Uint16 format) +static SDL_AudioFilter +SDL_HandTunedResampleCVT(SDL_AudioCVT * cvt, int dst_channels, + int src_rate, int dst_rate) { - int i; - Uint8 *src, *dst; + /* + * Fill in any future conversions that are specialized to a + * processor, platform, compiler, or library here. + */ -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate * 2\n"); -#endif - src = cvt->buf+cvt->len_cvt; - dst = cvt->buf+cvt->len_cvt*2; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt/6; i; --i ) { - src -= 6; - dst -= 12; - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[0]; - dst[7] = src[1]; - dst[8] = src[2]; - dst[9] = src[3]; - dst[10] = src[4]; - dst[11] = src[5]; - } - break; - case 16: - for ( i=cvt->len_cvt/12; i; --i ) { - src -= 12; - dst -= 24; - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; - dst[8] = src[8]; - dst[9] = src[9]; - dst[10] = src[10]; - dst[11] = src[11]; - dst[12] = src[0]; - dst[13] = src[1]; - dst[14] = src[2]; - dst[15] = src[3]; - dst[16] = src[4]; - dst[17] = src[5]; - dst[18] = src[6]; - dst[19] = src[7]; - dst[20] = src[8]; - dst[21] = src[9]; - dst[22] = src[10]; - dst[23] = src[11]; - } - break; - } - cvt->len_cvt *= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + return NULL; /* no specialized converter code available. */ } -/* Convert rate down by multiple of 2 */ -void SDLCALL SDL_RateDIV2(SDL_AudioCVT *cvt, Uint16 format) +static int +SDL_FindFrequencyMultiple(const int src_rate, const int dst_rate) { - int i; - Uint8 *src, *dst; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate / 2\n"); + int retval = 0; + + /* If we only built with the arbitrary resamplers, ignore multiples. */ +#if !LESS_RESAMPLERS + int lo, hi; + int div; + + SDL_assert(src_rate != 0); + SDL_assert(dst_rate != 0); + SDL_assert(src_rate != dst_rate); + + if (src_rate < dst_rate) { + lo = src_rate; + hi = dst_rate; + } else { + lo = dst_rate; + hi = src_rate; + } + + /* zero means "not a supported multiple" ... we only do 2x and 4x. */ + if ((hi % lo) != 0) + return 0; /* not a multiple. */ + + div = hi / lo; + retval = ((div == 2) || (div == 4)) ? div : 0; #endif - src = cvt->buf; - dst = cvt->buf; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt/2; i; --i ) { - dst[0] = src[0]; - src += 2; - dst += 1; - } - break; - case 16: - for ( i=cvt->len_cvt/4; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - src += 4; - dst += 2; - } - break; - } - cvt->len_cvt /= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} - -/* Convert rate down by multiple of 2, for stereo */ -void SDLCALL SDL_RateDIV2_c2(SDL_AudioCVT *cvt, Uint16 format) -{ - int i; - Uint8 *src, *dst; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate / 2\n"); -#endif - src = cvt->buf; - dst = cvt->buf; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt/4; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - src += 4; - dst += 2; - } - break; - case 16: - for ( i=cvt->len_cvt/8; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - src += 8; - dst += 4; - } - break; - } - cvt->len_cvt /= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + return retval; } - -/* Convert rate down by multiple of 2, for quad */ -void SDLCALL SDL_RateDIV2_c4(SDL_AudioCVT *cvt, Uint16 format) +static int +SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, int dst_channels, + int src_rate, int dst_rate) { - int i; - Uint8 *src, *dst; - -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate / 2\n"); -#endif - src = cvt->buf; - dst = cvt->buf; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt/8; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - src += 8; - dst += 4; - } - break; - case 16: - for ( i=cvt->len_cvt/16; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; - src += 16; - dst += 8; - } - break; - } - cvt->len_cvt /= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } + if (src_rate != dst_rate) { + SDL_AudioFilter filter = SDL_HandTunedResampleCVT(cvt, dst_channels, + src_rate, dst_rate); + + /* No hand-tuned converter? Try the autogenerated ones. */ + if (filter == NULL) { + int i; + const int upsample = (src_rate < dst_rate) ? 1 : 0; + const int multiple = + SDL_FindFrequencyMultiple(src_rate, dst_rate); + + for (i = 0; sdl_audio_rate_filters[i].filter != NULL; i++) { + const SDL_AudioRateFilters *filt = &sdl_audio_rate_filters[i]; + if ((filt->fmt == cvt->dst_format) && + (filt->channels == dst_channels) && + (filt->upsample == upsample) && + (filt->multiple == multiple)) { + filter = filt->filter; + break; + } + } + + if (filter == NULL) { + SDL_SetError("No conversion available for these rates"); + return -1; + } + } + + /* Update (cvt) with filter details... */ + cvt->filters[cvt->filter_index++] = filter; + if (src_rate < dst_rate) { + const double mult = ((double) dst_rate) / ((double) src_rate); + cvt->len_mult *= (int) SDL_ceil(mult); + cvt->len_ratio *= mult; + } else { + cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate); + } + + return 1; /* added a converter. */ + } + + return 0; /* no conversion necessary. */ } -/* Convert rate down by multiple of 2, for 5.1 */ -void SDLCALL SDL_RateDIV2_c6(SDL_AudioCVT *cvt, Uint16 format) -{ - int i; - Uint8 *src, *dst; -#ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate / 2\n"); -#endif - src = cvt->buf; - dst = cvt->buf; - switch (format & 0xFF) { - case 8: - for ( i=cvt->len_cvt/12; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - src += 12; - dst += 6; - } - break; - case 16: - for ( i=cvt->len_cvt/24; i; --i ) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; - dst[8] = src[8]; - dst[9] = src[9]; - dst[10] = src[10]; - dst[11] = src[11]; - src += 24; - dst += 12; - } - break; - } - cvt->len_cvt /= 2; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} +/* Creates a set of audio filters to convert from one format to another. + Returns -1 if the format conversion is not supported, 0 if there's + no conversion needed, or 1 if the audio filter is set up. +*/ -/* Very slow rate conversion routine */ -void SDLCALL SDL_RateSLOW(SDL_AudioCVT *cvt, Uint16 format) +int +SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_fmt, Uint8 src_channels, int src_rate, + SDL_AudioFormat dst_fmt, Uint8 dst_channels, int dst_rate) { - double ipos; - int i, clen; - + /* + * !!! FIXME: reorder filters based on which grow/shrink the buffer. + * !!! FIXME: ideally, we should do everything that shrinks the buffer + * !!! FIXME: first, so we don't have to process as many bytes in a given + * !!! FIXME: filter and abuse the CPU cache less. This might not be as + * !!! FIXME: good in practice as it sounds in theory, though. + */ + + /* Sanity check target pointer */ + if (cvt == NULL) { + return SDL_InvalidParamError("cvt"); + } + + /* there are no unsigned types over 16 bits, so catch this up front. */ + if ((SDL_AUDIO_BITSIZE(src_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(src_fmt))) { + return SDL_SetError("Invalid source format"); + } + if ((SDL_AUDIO_BITSIZE(dst_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(dst_fmt))) { + return SDL_SetError("Invalid destination format"); + } + + /* prevent possible divisions by zero, etc. */ + if ((src_channels == 0) || (dst_channels == 0)) { + return SDL_SetError("Source or destination channels is zero"); + } + if ((src_rate == 0) || (dst_rate == 0)) { + return SDL_SetError("Source or destination rate is zero"); + } #ifdef DEBUG_CONVERT - fprintf(stderr, "Converting audio rate * %4.4f\n", 1.0/cvt->rate_incr); + printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n", + src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate); #endif - clen = (int)((double)cvt->len_cvt / cvt->rate_incr); - if ( cvt->rate_incr > 1.0 ) { - switch (format & 0xFF) { - case 8: { - Uint8 *output; - - output = cvt->buf; - ipos = 0.0; - for ( i=clen; i; --i ) { - *output = cvt->buf[(int)ipos]; - ipos += cvt->rate_incr; - output += 1; - } - } - break; - - case 16: { - Uint16 *output; - - clen &= ~1; - output = (Uint16 *)cvt->buf; - ipos = 0.0; - for ( i=clen/2; i; --i ) { - *output=((Uint16 *)cvt->buf)[(int)ipos]; - ipos += cvt->rate_incr; - output += 1; - } - } - break; - } - } else { - switch (format & 0xFF) { - case 8: { - Uint8 *output; - - output = cvt->buf+clen; - ipos = (double)cvt->len_cvt; - for ( i=clen; i; --i ) { - ipos -= cvt->rate_incr; - output -= 1; - *output = cvt->buf[(int)ipos]; - } - } - break; - - case 16: { - Uint16 *output; - - clen &= ~1; - output = (Uint16 *)(cvt->buf+clen); - ipos = (double)cvt->len_cvt/2; - for ( i=clen/2; i; --i ) { - ipos -= cvt->rate_incr; - output -= 1; - *output=((Uint16 *)cvt->buf)[(int)ipos]; - } - } - break; - } - } - cvt->len_cvt = clen; - if ( cvt->filters[++cvt->filter_index] ) { - cvt->filters[cvt->filter_index](cvt, format); - } -} -int SDL_ConvertAudio(SDL_AudioCVT *cvt) -{ - /* Make sure there's data to convert */ - if ( cvt->buf == NULL ) { - SDL_SetError("No buffer allocated for conversion"); - return(-1); - } - /* Return okay if no conversion is necessary */ - cvt->len_cvt = cvt->len; - if ( cvt->filters[0] == NULL ) { - return(0); - } - - /* Set up the conversion and go! */ - cvt->filter_index = 0; - cvt->filters[0](cvt, cvt->src_format); - return(0); + /* Start off with no conversion necessary */ + SDL_zerop(cvt); + cvt->src_format = src_fmt; + cvt->dst_format = dst_fmt; + cvt->needed = 0; + cvt->filter_index = 0; + cvt->filters[0] = NULL; + cvt->len_mult = 1; + cvt->len_ratio = 1.0; + cvt->rate_incr = ((double) dst_rate) / ((double) src_rate); + + /* Convert data types, if necessary. Updates (cvt). */ + if (SDL_BuildAudioTypeCVT(cvt, src_fmt, dst_fmt) == -1) { + return -1; /* shouldn't happen, but just in case... */ + } + + /* Channel conversion */ + if (src_channels != dst_channels) { + if ((src_channels == 1) && (dst_channels > 1)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStereo; + cvt->len_mult *= 2; + src_channels = 2; + cvt->len_ratio *= 2; + } + if ((src_channels == 2) && (dst_channels == 6)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertSurround; + src_channels = 6; + cvt->len_mult *= 3; + cvt->len_ratio *= 3; + } + if ((src_channels == 2) && (dst_channels == 4)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertSurround_4; + src_channels = 4; + cvt->len_mult *= 2; + cvt->len_ratio *= 2; + } + while ((src_channels * 2) <= dst_channels) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStereo; + cvt->len_mult *= 2; + src_channels *= 2; + cvt->len_ratio *= 2; + } + if ((src_channels == 6) && (dst_channels <= 2)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStrip; + src_channels = 2; + cvt->len_ratio /= 3; + } + if ((src_channels == 6) && (dst_channels == 4)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertStrip_2; + src_channels = 4; + cvt->len_ratio /= 2; + } + /* This assumes that 4 channel audio is in the format: + Left {front/back} + Right {front/back} + so converting to L/R stereo works properly. + */ + while (((src_channels % 2) == 0) && + ((src_channels / 2) >= dst_channels)) { + cvt->filters[cvt->filter_index++] = SDL_ConvertMono; + src_channels /= 2; + cvt->len_ratio /= 2; + } + if (src_channels != dst_channels) { + /* Uh oh.. */ ; + } + } + + /* Do rate conversion, if necessary. Updates (cvt). */ + if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) == + -1) { + return -1; /* shouldn't happen, but just in case... */ + } + + /* Set up the filter information */ + if (cvt->filter_index != 0) { + cvt->needed = 1; + cvt->src_format = src_fmt; + cvt->dst_format = dst_fmt; + cvt->len = 0; + cvt->buf = NULL; + cvt->filters[cvt->filter_index] = NULL; + } + return (cvt->needed); } -/* Creates a set of audio filters to convert from one format to another. - Returns -1 if the format conversion is not supported, or 1 if the - audio filter is set up. -*/ - -int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, - Uint16 src_format, Uint8 src_channels, int src_rate, - Uint16 dst_format, Uint8 dst_channels, int dst_rate) -{ -/*printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n", - src_format, dst_format, src_channels, dst_channels, src_rate, dst_rate);*/ - /* Start off with no conversion necessary */ - cvt->needed = 0; - cvt->filter_index = 0; - cvt->filters[0] = NULL; - cvt->len_mult = 1; - cvt->len_ratio = 1.0; - - /* First filter: Endian conversion from src to dst */ - if ( (src_format & 0x1000) != (dst_format & 0x1000) - && ((src_format & 0xff) == 16) && ((dst_format & 0xff) == 16)) { - cvt->filters[cvt->filter_index++] = SDL_ConvertEndian; - } - - /* Second filter: Sign conversion -- signed/unsigned */ - if ( (src_format & 0x8000) != (dst_format & 0x8000) ) { - cvt->filters[cvt->filter_index++] = SDL_ConvertSign; - } - - /* Next filter: Convert 16 bit <--> 8 bit PCM */ - if ( (src_format & 0xFF) != (dst_format & 0xFF) ) { - switch (dst_format&0x10FF) { - case AUDIO_U8: - cvt->filters[cvt->filter_index++] = - SDL_Convert8; - cvt->len_ratio /= 2; - break; - case AUDIO_U16LSB: - cvt->filters[cvt->filter_index++] = - SDL_Convert16LSB; - cvt->len_mult *= 2; - cvt->len_ratio *= 2; - break; - case AUDIO_U16MSB: - cvt->filters[cvt->filter_index++] = - SDL_Convert16MSB; - cvt->len_mult *= 2; - cvt->len_ratio *= 2; - break; - } - } - - /* Last filter: Mono/Stereo conversion */ - if ( src_channels != dst_channels ) { - if ( (src_channels == 1) && (dst_channels > 1) ) { - cvt->filters[cvt->filter_index++] = - SDL_ConvertStereo; - cvt->len_mult *= 2; - src_channels = 2; - cvt->len_ratio *= 2; - } - if ( (src_channels == 2) && - (dst_channels == 6) ) { - cvt->filters[cvt->filter_index++] = - SDL_ConvertSurround; - src_channels = 6; - cvt->len_mult *= 3; - cvt->len_ratio *= 3; - } - if ( (src_channels == 2) && - (dst_channels == 4) ) { - cvt->filters[cvt->filter_index++] = - SDL_ConvertSurround_4; - src_channels = 4; - cvt->len_mult *= 2; - cvt->len_ratio *= 2; - } - while ( (src_channels*2) <= dst_channels ) { - cvt->filters[cvt->filter_index++] = - SDL_ConvertStereo; - cvt->len_mult *= 2; - src_channels *= 2; - cvt->len_ratio *= 2; - } - if ( (src_channels == 6) && - (dst_channels <= 2) ) { - cvt->filters[cvt->filter_index++] = - SDL_ConvertStrip; - src_channels = 2; - cvt->len_ratio /= 3; - } - if ( (src_channels == 6) && - (dst_channels == 4) ) { - cvt->filters[cvt->filter_index++] = - SDL_ConvertStrip_2; - src_channels = 4; - cvt->len_ratio /= 2; - } - /* This assumes that 4 channel audio is in the format: - Left {front/back} + Right {front/back} - so converting to L/R stereo works properly. - */ - while ( ((src_channels%2) == 0) && - ((src_channels/2) >= dst_channels) ) { - cvt->filters[cvt->filter_index++] = - SDL_ConvertMono; - src_channels /= 2; - cvt->len_ratio /= 2; - } - if ( src_channels != dst_channels ) { - /* Uh oh.. */; - } - } - - /* Do rate conversion */ - cvt->rate_incr = 0.0; - if ( (src_rate/100) != (dst_rate/100) ) { - Uint32 hi_rate, lo_rate; - int len_mult; - double len_ratio; - void (SDLCALL *rate_cvt)(SDL_AudioCVT *cvt, Uint16 format); - - if ( src_rate > dst_rate ) { - hi_rate = src_rate; - lo_rate = dst_rate; - switch (src_channels) { - case 1: rate_cvt = SDL_RateDIV2; break; - case 2: rate_cvt = SDL_RateDIV2_c2; break; - case 4: rate_cvt = SDL_RateDIV2_c4; break; - case 6: rate_cvt = SDL_RateDIV2_c6; break; - default: return -1; - } - len_mult = 1; - len_ratio = 0.5; - } else { - hi_rate = dst_rate; - lo_rate = src_rate; - switch (src_channels) { - case 1: rate_cvt = SDL_RateMUL2; break; - case 2: rate_cvt = SDL_RateMUL2_c2; break; - case 4: rate_cvt = SDL_RateMUL2_c4; break; - case 6: rate_cvt = SDL_RateMUL2_c6; break; - default: return -1; - } - len_mult = 2; - len_ratio = 2.0; - } - /* If hi_rate = lo_rate*2^x then conversion is easy */ - while ( ((lo_rate*2)/100) <= (hi_rate/100) ) { - cvt->filters[cvt->filter_index++] = rate_cvt; - cvt->len_mult *= len_mult; - lo_rate *= 2; - cvt->len_ratio *= len_ratio; - } - /* We may need a slow conversion here to finish up */ - if ( (lo_rate/100) != (hi_rate/100) ) { -#if 1 - /* The problem with this is that if the input buffer is - say 1K, and the conversion rate is say 1.1, then the - output buffer is 1.1K, which may not be an acceptable - buffer size for the audio driver (not a power of 2) - */ - /* For now, punt and hope the rate distortion isn't great. - */ -#else - if ( src_rate < dst_rate ) { - cvt->rate_incr = (double)lo_rate/hi_rate; - cvt->len_mult *= 2; - cvt->len_ratio /= cvt->rate_incr; - } else { - cvt->rate_incr = (double)hi_rate/lo_rate; - cvt->len_ratio *= cvt->rate_incr; - } - cvt->filters[cvt->filter_index++] = SDL_RateSLOW; -#endif - } - } - - /* Set up the filter information */ - if ( cvt->filter_index != 0 ) { - cvt->needed = 1; - cvt->src_format = src_format; - cvt->dst_format = dst_format; - cvt->len = 0; - cvt->buf = NULL; - cvt->filters[cvt->filter_index] = NULL; - } - return(cvt->needed); -} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_audiodev.c b/src/audio/SDL_audiodev.c index 396156c7db..91b60c3767 100644 --- a/src/audio/SDL_audiodev.c +++ b/src/audio/SDL_audiodev.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -28,6 +27,7 @@ #include #include #include +#include /* For close() */ #include "SDL_stdinc.h" #include "SDL_audiodev_c.h" @@ -40,140 +40,74 @@ #endif #endif #ifndef _PATH_DEV_DSP24 -#define _PATH_DEV_DSP24 "/dev/sound/dsp" +#define _PATH_DEV_DSP24 "/dev/sound/dsp" #endif #ifndef _PATH_DEV_AUDIO -#define _PATH_DEV_AUDIO "/dev/audio" +#define _PATH_DEV_AUDIO "/dev/audio" #endif - -int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic) +static inline void +test_device(const char *fname, int flags, int (*test) (int fd), + SDL_AddAudioDevice addfn) { - const char *audiodev; - int audio_fd; - char audiopath[1024]; - - /* Figure out what our audio device is */ - if ( ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) && - ((audiodev=SDL_getenv("AUDIODEV")) == NULL) ) { - if ( classic ) { - audiodev = _PATH_DEV_AUDIO; - } else { - struct stat sb; - - /* Added support for /dev/sound/\* in Linux 2.4 */ - if ( ((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) && - ((stat(_PATH_DEV_DSP24, &sb) == 0) && S_ISCHR(sb.st_mode)) ) { - audiodev = _PATH_DEV_DSP24; - } else { - audiodev = _PATH_DEV_DSP; - } - } - } - audio_fd = open(audiodev, flags, 0); - - /* If the first open fails, look for other devices */ - if ( (audio_fd < 0) && (SDL_strlen(audiodev) < (sizeof(audiopath)-3)) ) { - int exists, instance; - struct stat sb; - - instance = 1; - do { /* Don't use errno ENOENT - it may not be thread-safe */ - SDL_snprintf(audiopath, SDL_arraysize(audiopath), - "%s%d", audiodev, instance++); - exists = 0; - if ( stat(audiopath, &sb) == 0 ) { - exists = 1; - audio_fd = open(audiopath, flags, 0); - } - } while ( exists && (audio_fd < 0) ); - audiodev = audiopath; - } - if ( path != NULL ) { - SDL_strlcpy(path, audiodev, maxlen); - path[maxlen-1] = '\0'; - } - return(audio_fd); + struct stat sb; + if ((stat(fname, &sb) == 0) && (S_ISCHR(sb.st_mode))) { + const int audio_fd = open(fname, flags, 0); + if (audio_fd >= 0) { + if (test(audio_fd)) { + addfn(fname); + } + close(audio_fd); + } + } } -#elif SDL_AUDIO_DRIVER_PAUD - -/* Get the name of the audio device we use for output */ - -#include -#include - -#include "SDL_stdinc.h" -#include "SDL_audiodev_c.h" - -#ifndef _PATH_DEV_DSP -#define _PATH_DEV_DSP "/dev/%caud%c/%c" -#endif - -char devsettings[][3] = -{ - { 'p', '0', '1' }, { 'p', '0', '2' }, { 'p', '0', '3' }, { 'p', '0', '4' }, - { 'p', '1', '1' }, { 'p', '1', '2' }, { 'p', '1', '3' }, { 'p', '1', '4' }, - { 'p', '2', '1' }, { 'p', '2', '2' }, { 'p', '2', '3' }, { 'p', '2', '4' }, - { 'p', '3', '1' }, { 'p', '3', '2' }, { 'p', '3', '3' }, { 'p', '3', '4' }, - { 'b', '0', '1' }, { 'b', '0', '2' }, { 'b', '0', '3' }, { 'b', '0', '4' }, - { 'b', '1', '1' }, { 'b', '1', '2' }, { 'b', '1', '3' }, { 'b', '1', '4' }, - { 'b', '2', '1' }, { 'b', '2', '2' }, { 'b', '2', '3' }, { 'b', '2', '4' }, - { 'b', '3', '1' }, { 'b', '3', '2' }, { 'b', '3', '3' }, { 'b', '3', '4' }, - { '\0', '\0', '\0' } -}; - -static int OpenUserDefinedDevice(char *path, int maxlen, int flags) +static int +test_stub(int fd) { - const char *audiodev; - int audio_fd; - - /* Figure out what our audio device is */ - if ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) { - audiodev=SDL_getenv("AUDIODEV"); - } - if ( audiodev == NULL ) { - return -1; - } - audio_fd = open(audiodev, flags, 0); - if ( path != NULL ) { - SDL_strlcpy(path, audiodev, maxlen); - path[maxlen-1] = '\0'; - } - return audio_fd; + return 1; } -int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic) +void +SDL_EnumUnixAudioDevices(int iscapture, int classic, int (*test)(int fd), + SDL_AddAudioDevice addfn) { - struct stat sb; - int audio_fd; - char audiopath[1024]; - int cycle; - - audio_fd = OpenUserDefinedDevice(path,maxlen,flags); - if ( audio_fd != -1 ) { - return audio_fd; + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + const char *audiodev; + char audiopath[1024]; + + if (test == NULL) + test = test_stub; + + /* Figure out what our audio device is */ + if (((audiodev = SDL_getenv("SDL_PATH_DSP")) == NULL) && + ((audiodev = SDL_getenv("AUDIODEV")) == NULL)) { + if (classic) { + audiodev = _PATH_DEV_AUDIO; + } else { + struct stat sb; + + /* Added support for /dev/sound/\* in Linux 2.4 */ + if (((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) + && ((stat(_PATH_DEV_DSP24, &sb) == 0) + && S_ISCHR(sb.st_mode))) { + audiodev = _PATH_DEV_DSP24; + } else { + audiodev = _PATH_DEV_DSP; + } + } } - - cycle = 0; - while( devsettings[cycle][0] != '\0' ) { - SDL_snprintf( audiopath, SDL_arraysize(audiopath), - _PATH_DEV_DSP, - devsettings[cycle][0], - devsettings[cycle][1], - devsettings[cycle][2]); - - if ( stat(audiopath, &sb) == 0 ) { - audio_fd = open(audiopath, flags, 0); - if ( audio_fd > 0 ) { - if ( path != NULL ) { - SDL_strlcpy( path, audiopath, maxlen ); - } - return audio_fd; - } - } + test_device(audiodev, flags, test, addfn); + + if (SDL_strlen(audiodev) < (sizeof(audiopath) - 3)) { + int instance = 0; + while (instance++ <= 64) { + SDL_snprintf(audiopath, SDL_arraysize(audiopath), + "%s%d", audiodev, instance); + test_device(audiopath, flags, test, addfn); + } } - return -1; } #endif /* Audio driver selection */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_audiodev_c.h b/src/audio/SDL_audiodev_c.h index 179d0d019f..d439926b96 100644 --- a/src/audio/SDL_audiodev_c.h +++ b/src/audio/SDL_audiodev_c.h @@ -1,26 +1,39 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ +#include "SDL.h" #include "SDL_config.h" +#include "SDL_sysaudio.h" + +/* Open the audio device for playback, and don't block if busy */ +/* #define USE_BLOCKING_WRITES */ + +#ifdef USE_BLOCKING_WRITES +#define OPEN_FLAGS_OUTPUT O_WRONLY +#define OPEN_FLAGS_INPUT O_RDONLY +#else +#define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) +#define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) +#endif -/* Open the audio device, storing the pathname in 'path' */ -extern int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic); +void SDL_EnumUnixAudioDevices(int iscapture, int classic, + int (*test) (int fd), SDL_AddAudioDevice addfn); +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_audiomem.h b/src/audio/SDL_audiomem.h index a473a5e01d..8c027c3a5f 100644 --- a/src/audio/SDL_audiomem.h +++ b/src/audio/SDL_audiomem.h @@ -1,25 +1,25 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" -#define SDL_AllocAudioMem SDL_malloc -#define SDL_FreeAudioMem SDL_free +#define SDL_AllocAudioMem SDL_malloc +#define SDL_FreeAudioMem SDL_free +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_audiotypecvt.c b/src/audio/SDL_audiotypecvt.c new file mode 100644 index 0000000000..6245c534bb --- /dev/null +++ b/src/audio/SDL_audiotypecvt.c @@ -0,0 +1,16015 @@ +/* DO NOT EDIT! This file is generated by sdlgenaudiocvt.pl */ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" +#include "SDL_audio.h" +#include "SDL_audio_c.h" + +#ifndef DEBUG_CONVERT +#define DEBUG_CONVERT 0 +#endif + + +/* If you can guarantee your data and need space, you can eliminate code... */ + +/* Just build the arbitrary resamplers if you're saving code space. */ +#ifndef LESS_RESAMPLERS +#define LESS_RESAMPLERS 0 +#endif + +/* Don't build any resamplers if you're REALLY saving code space. */ +#ifndef NO_RESAMPLERS +#define NO_RESAMPLERS 0 +#endif + +/* Don't build any type converters if you're saving code space. */ +#ifndef NO_CONVERTERS +#define NO_CONVERTERS 0 +#endif + + +/* *INDENT-OFF* */ + +#define DIVBY127 0.0078740157480315f +#define DIVBY32767 3.05185094759972e-05f +#define DIVBY2147483647 4.6566128752458e-10f + +#if !NO_CONVERTERS + +static void SDLCALL +SDL_Convert_U8_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S8.\n"); +#endif + + src = (const Uint8 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) { + const Sint8 val = ((*src) ^ 0x80); + *dst = ((Sint8) val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_U8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) *src) << 8); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) *src) << 8); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = ((((float) *src) * DIVBY127) - 1.0f); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_U8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = ((((float) *src) * DIVBY127) - 1.0f); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U8.\n"); +#endif + + src = (const Uint8 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) { + const Uint8 val = ((((Sint8) *src)) ^ 0x80); + *dst = val; + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((Sint8) *src)) << 8); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Uint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint16 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint16 val = (((Sint16) ((Sint8) *src)) << 8); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint8) *src)) << 24); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint8) *src)) << 24); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = (((float) ((Sint8) *src)) * DIVBY127); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint8 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) { + const float val = (((float) ((Sint8) *src)) * DIVBY127); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (SDL_SwapLE16(*src) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((SDL_SwapLE16(*src)) ^ 0x8000) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = SDL_SwapLE16(*src); + *dst = SDL_SwapBE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint16) SDL_SwapLE16(*src)) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000); + *dst = SDL_SwapLE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000); + *dst = SDL_SwapBE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) SDL_SwapLE16(*src)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (SDL_SwapBE16(*src) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((SDL_SwapBE16(*src)) ^ 0x8000) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = SDL_SwapBE16(*src); + *dst = SDL_SwapLE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_U16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000) >> 8)); + *dst = val; + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S8.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint16) SDL_SwapBE16(*src)) >> 8)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000); + *dst = SDL_SwapLE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) SDL_SwapBE16(*src)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint16 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) { + const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000); + *dst = SDL_SwapBE16(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((Sint32 *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32LSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatLE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint16 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32MSB.\n"); +#endif + + src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { + const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767); + *dst = SDL_SwapFloatBE(val); + } + + cvt->len_cvt *= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 24)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint32) SDL_SwapLE32(*src)) >> 24)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S32MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) SDL_SwapLE32(*src)); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatLE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatBE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 24)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S8.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (((Sint32) SDL_SwapBE32(*src)) >> 24)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S32LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) SDL_SwapBE32(*src)); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32LSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatLE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +static void SDLCALL +SDL_Convert_S32MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const Uint32 *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32MSB.\n"); +#endif + + src = (const Uint32 *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) { + const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647); + *dst = SDL_SwapFloatBE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) ((SDL_SwapFloatLE(*src) + 1.0f) * 127.0f)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (SDL_SwapFloatLE(*src) * 127.0f)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_F32MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const float val = SDL_SwapFloatLE(*src); + *dst = SDL_SwapFloatBE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint8 val = ((Uint8) ((SDL_SwapFloatBE(*src) + 1.0f) * 127.0f)); + *dst = val; + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U8); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint8 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S8.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint8 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint8 val = ((Sint8) (SDL_SwapFloatBE(*src) * 127.0f)); + *dst = ((Sint8) val); + } + + cvt->len_cvt /= 4; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S8); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapLE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapLE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Uint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Uint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f)); + *dst = SDL_SwapBE16(val); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint16 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint16 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f)); + *dst = ((Sint16) SDL_SwapBE16(val)); + } + + cvt->len_cvt /= 2; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapLE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + Sint32 *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32MSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (Sint32 *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0)); + *dst = ((Sint32) SDL_SwapBE32(val)); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB); + } +} + +static void SDLCALL +SDL_Convert_F32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ + int i; + const float *src; + float *dst; + +#if DEBUG_CONVERT + fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_F32LSB.\n"); +#endif + + src = (const float *) cvt->buf; + dst = (float *) cvt->buf; + for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + const float val = SDL_SwapFloatBE(*src); + *dst = SDL_SwapFloatLE(val); + } + + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB); + } +} + +#endif /* !NO_CONVERTERS */ + + +const SDL_AudioTypeFilters sdl_audio_type_filters[] = +{ +#if !NO_CONVERTERS + { AUDIO_U8, AUDIO_S8, SDL_Convert_U8_to_S8 }, + { AUDIO_U8, AUDIO_U16LSB, SDL_Convert_U8_to_U16LSB }, + { AUDIO_U8, AUDIO_S16LSB, SDL_Convert_U8_to_S16LSB }, + { AUDIO_U8, AUDIO_U16MSB, SDL_Convert_U8_to_U16MSB }, + { AUDIO_U8, AUDIO_S16MSB, SDL_Convert_U8_to_S16MSB }, + { AUDIO_U8, AUDIO_S32LSB, SDL_Convert_U8_to_S32LSB }, + { AUDIO_U8, AUDIO_S32MSB, SDL_Convert_U8_to_S32MSB }, + { AUDIO_U8, AUDIO_F32LSB, SDL_Convert_U8_to_F32LSB }, + { AUDIO_U8, AUDIO_F32MSB, SDL_Convert_U8_to_F32MSB }, + { AUDIO_S8, AUDIO_U8, SDL_Convert_S8_to_U8 }, + { AUDIO_S8, AUDIO_U16LSB, SDL_Convert_S8_to_U16LSB }, + { AUDIO_S8, AUDIO_S16LSB, SDL_Convert_S8_to_S16LSB }, + { AUDIO_S8, AUDIO_U16MSB, SDL_Convert_S8_to_U16MSB }, + { AUDIO_S8, AUDIO_S16MSB, SDL_Convert_S8_to_S16MSB }, + { AUDIO_S8, AUDIO_S32LSB, SDL_Convert_S8_to_S32LSB }, + { AUDIO_S8, AUDIO_S32MSB, SDL_Convert_S8_to_S32MSB }, + { AUDIO_S8, AUDIO_F32LSB, SDL_Convert_S8_to_F32LSB }, + { AUDIO_S8, AUDIO_F32MSB, SDL_Convert_S8_to_F32MSB }, + { AUDIO_U16LSB, AUDIO_U8, SDL_Convert_U16LSB_to_U8 }, + { AUDIO_U16LSB, AUDIO_S8, SDL_Convert_U16LSB_to_S8 }, + { AUDIO_U16LSB, AUDIO_S16LSB, SDL_Convert_U16LSB_to_S16LSB }, + { AUDIO_U16LSB, AUDIO_U16MSB, SDL_Convert_U16LSB_to_U16MSB }, + { AUDIO_U16LSB, AUDIO_S16MSB, SDL_Convert_U16LSB_to_S16MSB }, + { AUDIO_U16LSB, AUDIO_S32LSB, SDL_Convert_U16LSB_to_S32LSB }, + { AUDIO_U16LSB, AUDIO_S32MSB, SDL_Convert_U16LSB_to_S32MSB }, + { AUDIO_U16LSB, AUDIO_F32LSB, SDL_Convert_U16LSB_to_F32LSB }, + { AUDIO_U16LSB, AUDIO_F32MSB, SDL_Convert_U16LSB_to_F32MSB }, + { AUDIO_S16LSB, AUDIO_U8, SDL_Convert_S16LSB_to_U8 }, + { AUDIO_S16LSB, AUDIO_S8, SDL_Convert_S16LSB_to_S8 }, + { AUDIO_S16LSB, AUDIO_U16LSB, SDL_Convert_S16LSB_to_U16LSB }, + { AUDIO_S16LSB, AUDIO_U16MSB, SDL_Convert_S16LSB_to_U16MSB }, + { AUDIO_S16LSB, AUDIO_S16MSB, SDL_Convert_S16LSB_to_S16MSB }, + { AUDIO_S16LSB, AUDIO_S32LSB, SDL_Convert_S16LSB_to_S32LSB }, + { AUDIO_S16LSB, AUDIO_S32MSB, SDL_Convert_S16LSB_to_S32MSB }, + { AUDIO_S16LSB, AUDIO_F32LSB, SDL_Convert_S16LSB_to_F32LSB }, + { AUDIO_S16LSB, AUDIO_F32MSB, SDL_Convert_S16LSB_to_F32MSB }, + { AUDIO_U16MSB, AUDIO_U8, SDL_Convert_U16MSB_to_U8 }, + { AUDIO_U16MSB, AUDIO_S8, SDL_Convert_U16MSB_to_S8 }, + { AUDIO_U16MSB, AUDIO_U16LSB, SDL_Convert_U16MSB_to_U16LSB }, + { AUDIO_U16MSB, AUDIO_S16LSB, SDL_Convert_U16MSB_to_S16LSB }, + { AUDIO_U16MSB, AUDIO_S16MSB, SDL_Convert_U16MSB_to_S16MSB }, + { AUDIO_U16MSB, AUDIO_S32LSB, SDL_Convert_U16MSB_to_S32LSB }, + { AUDIO_U16MSB, AUDIO_S32MSB, SDL_Convert_U16MSB_to_S32MSB }, + { AUDIO_U16MSB, AUDIO_F32LSB, SDL_Convert_U16MSB_to_F32LSB }, + { AUDIO_U16MSB, AUDIO_F32MSB, SDL_Convert_U16MSB_to_F32MSB }, + { AUDIO_S16MSB, AUDIO_U8, SDL_Convert_S16MSB_to_U8 }, + { AUDIO_S16MSB, AUDIO_S8, SDL_Convert_S16MSB_to_S8 }, + { AUDIO_S16MSB, AUDIO_U16LSB, SDL_Convert_S16MSB_to_U16LSB }, + { AUDIO_S16MSB, AUDIO_S16LSB, SDL_Convert_S16MSB_to_S16LSB }, + { AUDIO_S16MSB, AUDIO_U16MSB, SDL_Convert_S16MSB_to_U16MSB }, + { AUDIO_S16MSB, AUDIO_S32LSB, SDL_Convert_S16MSB_to_S32LSB }, + { AUDIO_S16MSB, AUDIO_S32MSB, SDL_Convert_S16MSB_to_S32MSB }, + { AUDIO_S16MSB, AUDIO_F32LSB, SDL_Convert_S16MSB_to_F32LSB }, + { AUDIO_S16MSB, AUDIO_F32MSB, SDL_Convert_S16MSB_to_F32MSB }, + { AUDIO_S32LSB, AUDIO_U8, SDL_Convert_S32LSB_to_U8 }, + { AUDIO_S32LSB, AUDIO_S8, SDL_Convert_S32LSB_to_S8 }, + { AUDIO_S32LSB, AUDIO_U16LSB, SDL_Convert_S32LSB_to_U16LSB }, + { AUDIO_S32LSB, AUDIO_S16LSB, SDL_Convert_S32LSB_to_S16LSB }, + { AUDIO_S32LSB, AUDIO_U16MSB, SDL_Convert_S32LSB_to_U16MSB }, + { AUDIO_S32LSB, AUDIO_S16MSB, SDL_Convert_S32LSB_to_S16MSB }, + { AUDIO_S32LSB, AUDIO_S32MSB, SDL_Convert_S32LSB_to_S32MSB }, + { AUDIO_S32LSB, AUDIO_F32LSB, SDL_Convert_S32LSB_to_F32LSB }, + { AUDIO_S32LSB, AUDIO_F32MSB, SDL_Convert_S32LSB_to_F32MSB }, + { AUDIO_S32MSB, AUDIO_U8, SDL_Convert_S32MSB_to_U8 }, + { AUDIO_S32MSB, AUDIO_S8, SDL_Convert_S32MSB_to_S8 }, + { AUDIO_S32MSB, AUDIO_U16LSB, SDL_Convert_S32MSB_to_U16LSB }, + { AUDIO_S32MSB, AUDIO_S16LSB, SDL_Convert_S32MSB_to_S16LSB }, + { AUDIO_S32MSB, AUDIO_U16MSB, SDL_Convert_S32MSB_to_U16MSB }, + { AUDIO_S32MSB, AUDIO_S16MSB, SDL_Convert_S32MSB_to_S16MSB }, + { AUDIO_S32MSB, AUDIO_S32LSB, SDL_Convert_S32MSB_to_S32LSB }, + { AUDIO_S32MSB, AUDIO_F32LSB, SDL_Convert_S32MSB_to_F32LSB }, + { AUDIO_S32MSB, AUDIO_F32MSB, SDL_Convert_S32MSB_to_F32MSB }, + { AUDIO_F32LSB, AUDIO_U8, SDL_Convert_F32LSB_to_U8 }, + { AUDIO_F32LSB, AUDIO_S8, SDL_Convert_F32LSB_to_S8 }, + { AUDIO_F32LSB, AUDIO_U16LSB, SDL_Convert_F32LSB_to_U16LSB }, + { AUDIO_F32LSB, AUDIO_S16LSB, SDL_Convert_F32LSB_to_S16LSB }, + { AUDIO_F32LSB, AUDIO_U16MSB, SDL_Convert_F32LSB_to_U16MSB }, + { AUDIO_F32LSB, AUDIO_S16MSB, SDL_Convert_F32LSB_to_S16MSB }, + { AUDIO_F32LSB, AUDIO_S32LSB, SDL_Convert_F32LSB_to_S32LSB }, + { AUDIO_F32LSB, AUDIO_S32MSB, SDL_Convert_F32LSB_to_S32MSB }, + { AUDIO_F32LSB, AUDIO_F32MSB, SDL_Convert_F32LSB_to_F32MSB }, + { AUDIO_F32MSB, AUDIO_U8, SDL_Convert_F32MSB_to_U8 }, + { AUDIO_F32MSB, AUDIO_S8, SDL_Convert_F32MSB_to_S8 }, + { AUDIO_F32MSB, AUDIO_U16LSB, SDL_Convert_F32MSB_to_U16LSB }, + { AUDIO_F32MSB, AUDIO_S16LSB, SDL_Convert_F32MSB_to_S16LSB }, + { AUDIO_F32MSB, AUDIO_U16MSB, SDL_Convert_F32MSB_to_U16MSB }, + { AUDIO_F32MSB, AUDIO_S16MSB, SDL_Convert_F32MSB_to_S16MSB }, + { AUDIO_F32MSB, AUDIO_S32LSB, SDL_Convert_F32MSB_to_S32LSB }, + { AUDIO_F32MSB, AUDIO_S32MSB, SDL_Convert_F32MSB_to_S32MSB }, + { AUDIO_F32MSB, AUDIO_F32LSB, SDL_Convert_F32MSB_to_F32LSB }, +#endif /* !NO_CONVERTERS */ + { 0, 0, NULL } +}; + + +#if !NO_RESAMPLERS + +static void SDLCALL +SDL_Upsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Uint8 sample0 = src[0]; + Uint8 last_sample0 = sample0; + while (dst >= target) { + dst[0] = sample0; + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst++; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst >= target) { + dst[1] = sample1; + dst[0] = sample0; + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst += 2; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Uint8 sample3 = src[3]; + Uint8 sample2 = src[2]; + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample3 = sample3; + Uint8 last_sample2 = sample2; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst >= target) { + dst[3] = sample3; + dst[2] = sample2; + dst[1] = sample1; + dst[0] = sample0; + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 sample2 = src[2]; + Uint8 sample3 = src[3]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + Uint8 last_sample2 = sample2; + Uint8 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst[2] = sample2; + dst[3] = sample3; + dst += 4; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Uint8 sample5 = src[5]; + Uint8 sample4 = src[4]; + Uint8 sample3 = src[3]; + Uint8 sample2 = src[2]; + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample5 = sample5; + Uint8 last_sample4 = sample4; + Uint8 last_sample3 = sample3; + Uint8 last_sample2 = sample2; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst >= target) { + dst[5] = sample5; + dst[4] = sample4; + dst[3] = sample3; + dst[2] = sample2; + dst[1] = sample1; + dst[0] = sample0; + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 sample2 = src[2]; + Uint8 sample3 = src[3]; + Uint8 sample4 = src[4]; + Uint8 sample5 = src[5]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + Uint8 last_sample2 = sample2; + Uint8 last_sample3 = sample3; + Uint8 last_sample4 = sample4; + Uint8 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst[2] = sample2; + dst[3] = sample3; + dst[4] = sample4; + dst[5] = sample5; + dst += 6; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Uint8 sample7 = src[7]; + Uint8 sample6 = src[6]; + Uint8 sample5 = src[5]; + Uint8 sample4 = src[4]; + Uint8 sample3 = src[3]; + Uint8 sample2 = src[2]; + Uint8 sample1 = src[1]; + Uint8 sample0 = src[0]; + Uint8 last_sample7 = sample7; + Uint8 last_sample6 = sample6; + Uint8 last_sample5 = sample5; + Uint8 last_sample4 = sample4; + Uint8 last_sample3 = sample3; + Uint8 last_sample2 = sample2; + Uint8 last_sample1 = sample1; + Uint8 last_sample0 = sample0; + while (dst >= target) { + dst[7] = sample7; + dst[6] = sample6; + dst[5] = sample5; + dst[4] = sample4; + dst[3] = sample3; + dst[2] = sample2; + dst[1] = sample1; + dst[0] = sample0; + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1); + sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1); + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Uint8 sample0 = src[0]; + Uint8 sample1 = src[1]; + Uint8 sample2 = src[2]; + Uint8 sample3 = src[3]; + Uint8 sample4 = src[4]; + Uint8 sample5 = src[5]; + Uint8 sample6 = src[6]; + Uint8 sample7 = src[7]; + Uint8 last_sample0 = sample0; + Uint8 last_sample1 = sample1; + Uint8 last_sample2 = sample2; + Uint8 last_sample3 = sample3; + Uint8 last_sample4 = sample4; + Uint8 last_sample5 = sample5; + Uint8 last_sample6 = sample6; + Uint8 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = sample0; + dst[1] = sample1; + dst[2] = sample2; + dst[3] = sample3; + dst[4] = sample4; + dst[5] = sample5; + dst[6] = sample6; + dst[7] = sample7; + dst += 8; + sample0 = (Uint8) ((((Sint16) src[0]) + ((Sint16) last_sample0)) >> 1); + sample1 = (Uint8) ((((Sint16) src[1]) + ((Sint16) last_sample1)) >> 1); + sample2 = (Uint8) ((((Sint16) src[2]) + ((Sint16) last_sample2)) >> 1); + sample3 = (Uint8) ((((Sint16) src[3]) + ((Sint16) last_sample3)) >> 1); + sample4 = (Uint8) ((((Sint16) src[4]) + ((Sint16) last_sample4)) >> 1); + sample5 = (Uint8) ((((Sint16) src[5]) + ((Sint16) last_sample5)) >> 1); + sample6 = (Uint8) ((((Sint16) src[6]) + ((Sint16) last_sample6)) >> 1); + sample7 = (Uint8) ((((Sint16) src[7]) + ((Sint16) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample0 = sample0; + while (dst >= target) { + dst[0] = ((Sint8) sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 16; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst++; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst >= target) { + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst += 2; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample3 = sample3; + Sint8 last_sample2 = sample2; + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst >= target) { + dst[3] = ((Sint8) sample3); + dst[2] = ((Sint8) sample2); + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + Sint8 last_sample2 = sample2; + Sint8 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst[2] = ((Sint8) sample2); + dst[3] = ((Sint8) sample3); + dst += 4; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint8 sample5 = ((Sint8) src[5]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample5 = sample5; + Sint8 last_sample4 = sample4; + Sint8 last_sample3 = sample3; + Sint8 last_sample2 = sample2; + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst >= target) { + dst[5] = ((Sint8) sample5); + dst[4] = ((Sint8) sample4); + dst[3] = ((Sint8) sample3); + dst[2] = ((Sint8) sample2); + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 96; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample5 = ((Sint8) src[5]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + Sint8 last_sample2 = sample2; + Sint8 last_sample3 = sample3; + Sint8 last_sample4 = sample4; + Sint8 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst[2] = ((Sint8) sample2); + dst[3] = ((Sint8) sample3); + dst[4] = ((Sint8) sample4); + dst[5] = ((Sint8) sample5); + dst += 6; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint8 sample7 = ((Sint8) src[7]); + Sint8 sample6 = ((Sint8) src[6]); + Sint8 sample5 = ((Sint8) src[5]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 last_sample7 = sample7; + Sint8 last_sample6 = sample6; + Sint8 last_sample5 = sample5; + Sint8 last_sample4 = sample4; + Sint8 last_sample3 = sample3; + Sint8 last_sample2 = sample2; + Sint8 last_sample1 = sample1; + Sint8 last_sample0 = sample0; + while (dst >= target) { + dst[7] = ((Sint8) sample7); + dst[6] = ((Sint8) sample6); + dst[5] = ((Sint8) sample5); + dst[4] = ((Sint8) sample4); + dst[3] = ((Sint8) sample3); + dst[2] = ((Sint8) sample2); + dst[1] = ((Sint8) sample1); + dst[0] = ((Sint8) sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1); + sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1); + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S8, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint8 sample0 = ((Sint8) src[0]); + Sint8 sample1 = ((Sint8) src[1]); + Sint8 sample2 = ((Sint8) src[2]); + Sint8 sample3 = ((Sint8) src[3]); + Sint8 sample4 = ((Sint8) src[4]); + Sint8 sample5 = ((Sint8) src[5]); + Sint8 sample6 = ((Sint8) src[6]); + Sint8 sample7 = ((Sint8) src[7]); + Sint8 last_sample0 = sample0; + Sint8 last_sample1 = sample1; + Sint8 last_sample2 = sample2; + Sint8 last_sample3 = sample3; + Sint8 last_sample4 = sample4; + Sint8 last_sample5 = sample5; + Sint8 last_sample6 = sample6; + Sint8 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint8) sample0); + dst[1] = ((Sint8) sample1); + dst[2] = ((Sint8) sample2); + dst[3] = ((Sint8) sample3); + dst[4] = ((Sint8) sample4); + dst[5] = ((Sint8) sample5); + dst[6] = ((Sint8) sample6); + dst[7] = ((Sint8) sample7); + dst += 8; + sample0 = (Sint8) ((((Sint16) ((Sint8) src[0])) + ((Sint16) last_sample0)) >> 1); + sample1 = (Sint8) ((((Sint16) ((Sint8) src[1])) + ((Sint16) last_sample1)) >> 1); + sample2 = (Sint8) ((((Sint16) ((Sint8) src[2])) + ((Sint16) last_sample2)) >> 1); + sample3 = (Sint8) ((((Sint16) ((Sint8) src[3])) + ((Sint16) last_sample3)) >> 1); + sample4 = (Sint8) ((((Sint16) ((Sint8) src[4])) + ((Sint16) last_sample4)) >> 1); + sample5 = (Sint8) ((((Sint16) ((Sint8) src[5])) + ((Sint16) last_sample5)) >> 1); + sample6 = (Sint8) ((((Sint16) ((Sint8) src[6])) + ((Sint16) last_sample6)) >> 1); + sample7 = (Sint8) ((((Sint16) ((Sint8) src[7])) + ((Sint16) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[0] = SDL_SwapLE16(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst++; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst += 2; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[3] = SDL_SwapLE16(sample3); + dst[2] = SDL_SwapLE16(sample2); + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst[2] = SDL_SwapLE16(sample2); + dst[3] = SDL_SwapLE16(sample3); + dst += 4; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[5] = SDL_SwapLE16(sample5); + dst[4] = SDL_SwapLE16(sample4); + dst[3] = SDL_SwapLE16(sample3); + dst[2] = SDL_SwapLE16(sample2); + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst[2] = SDL_SwapLE16(sample2); + dst[3] = SDL_SwapLE16(sample3); + dst[4] = SDL_SwapLE16(sample4); + dst[5] = SDL_SwapLE16(sample5); + dst += 6; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample7 = SDL_SwapLE16(src[7]); + Uint16 sample6 = SDL_SwapLE16(src[6]); + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 last_sample7 = sample7; + Uint16 last_sample6 = sample6; + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[7] = SDL_SwapLE16(sample7); + dst[6] = SDL_SwapLE16(sample6); + dst[5] = SDL_SwapLE16(sample5); + dst[4] = SDL_SwapLE16(sample4); + dst[3] = SDL_SwapLE16(sample3); + dst[2] = SDL_SwapLE16(sample2); + dst[1] = SDL_SwapLE16(sample1); + dst[0] = SDL_SwapLE16(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapLE16(src[0]); + Uint16 sample1 = SDL_SwapLE16(src[1]); + Uint16 sample2 = SDL_SwapLE16(src[2]); + Uint16 sample3 = SDL_SwapLE16(src[3]); + Uint16 sample4 = SDL_SwapLE16(src[4]); + Uint16 sample5 = SDL_SwapLE16(src[5]); + Uint16 sample6 = SDL_SwapLE16(src[6]); + Uint16 sample7 = SDL_SwapLE16(src[7]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + Uint16 last_sample6 = sample6; + Uint16 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapLE16(sample0); + dst[1] = SDL_SwapLE16(sample1); + dst[2] = SDL_SwapLE16(sample2); + dst[3] = SDL_SwapLE16(sample3); + dst[4] = SDL_SwapLE16(sample4); + dst[5] = SDL_SwapLE16(sample5); + dst[6] = SDL_SwapLE16(sample6); + dst[7] = SDL_SwapLE16(sample7); + dst += 8; + sample0 = (Uint16) ((((Sint32) SDL_SwapLE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapLE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapLE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapLE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapLE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapLE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapLE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample7 = (Uint16) ((((Sint32) SDL_SwapLE16(src[7])) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst++; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst += 2; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst += 4; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst += 6; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7])); + Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6])); + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 last_sample7 = sample7; + Sint16 last_sample6 = sample6; + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[7] = ((Sint16) SDL_SwapLE16(sample7)); + dst[6] = ((Sint16) SDL_SwapLE16(sample6)); + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapLE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapLE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapLE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapLE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapLE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapLE16(src[5])); + Sint16 sample6 = ((Sint16) SDL_SwapLE16(src[6])); + Sint16 sample7 = ((Sint16) SDL_SwapLE16(src[7])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + Sint16 last_sample6 = sample6; + Sint16 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapLE16(sample0)); + dst[1] = ((Sint16) SDL_SwapLE16(sample1)); + dst[2] = ((Sint16) SDL_SwapLE16(sample2)); + dst[3] = ((Sint16) SDL_SwapLE16(sample3)); + dst[4] = ((Sint16) SDL_SwapLE16(sample4)); + dst[5] = ((Sint16) SDL_SwapLE16(sample5)); + dst[6] = ((Sint16) SDL_SwapLE16(sample6)); + dst[7] = ((Sint16) SDL_SwapLE16(sample7)); + dst += 8; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapLE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[0] = SDL_SwapBE16(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst++; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst += 2; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[3] = SDL_SwapBE16(sample3); + dst[2] = SDL_SwapBE16(sample2); + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst[2] = SDL_SwapBE16(sample2); + dst[3] = SDL_SwapBE16(sample3); + dst += 4; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[5] = SDL_SwapBE16(sample5); + dst[4] = SDL_SwapBE16(sample4); + dst[3] = SDL_SwapBE16(sample3); + dst[2] = SDL_SwapBE16(sample2); + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst[2] = SDL_SwapBE16(sample2); + dst[3] = SDL_SwapBE16(sample3); + dst[4] = SDL_SwapBE16(sample4); + dst[5] = SDL_SwapBE16(sample5); + dst += 6; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Uint16 sample7 = SDL_SwapBE16(src[7]); + Uint16 sample6 = SDL_SwapBE16(src[6]); + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 last_sample7 = sample7; + Uint16 last_sample6 = sample6; + Uint16 last_sample5 = sample5; + Uint16 last_sample4 = sample4; + Uint16 last_sample3 = sample3; + Uint16 last_sample2 = sample2; + Uint16 last_sample1 = sample1; + Uint16 last_sample0 = sample0; + while (dst >= target) { + dst[7] = SDL_SwapBE16(sample7); + dst[6] = SDL_SwapBE16(sample6); + dst[5] = SDL_SwapBE16(sample5); + dst[4] = SDL_SwapBE16(sample4); + dst[3] = SDL_SwapBE16(sample3); + dst[2] = SDL_SwapBE16(sample2); + dst[1] = SDL_SwapBE16(sample1); + dst[0] = SDL_SwapBE16(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_U16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Uint16 sample0 = SDL_SwapBE16(src[0]); + Uint16 sample1 = SDL_SwapBE16(src[1]); + Uint16 sample2 = SDL_SwapBE16(src[2]); + Uint16 sample3 = SDL_SwapBE16(src[3]); + Uint16 sample4 = SDL_SwapBE16(src[4]); + Uint16 sample5 = SDL_SwapBE16(src[5]); + Uint16 sample6 = SDL_SwapBE16(src[6]); + Uint16 sample7 = SDL_SwapBE16(src[7]); + Uint16 last_sample0 = sample0; + Uint16 last_sample1 = sample1; + Uint16 last_sample2 = sample2; + Uint16 last_sample3 = sample3; + Uint16 last_sample4 = sample4; + Uint16 last_sample5 = sample5; + Uint16 last_sample6 = sample6; + Uint16 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapBE16(sample0); + dst[1] = SDL_SwapBE16(sample1); + dst[2] = SDL_SwapBE16(sample2); + dst[3] = SDL_SwapBE16(sample3); + dst[4] = SDL_SwapBE16(sample4); + dst[5] = SDL_SwapBE16(sample5); + dst[6] = SDL_SwapBE16(sample6); + dst[7] = SDL_SwapBE16(sample7); + dst += 8; + sample0 = (Uint16) ((((Sint32) SDL_SwapBE16(src[0])) + ((Sint32) last_sample0)) >> 1); + sample1 = (Uint16) ((((Sint32) SDL_SwapBE16(src[1])) + ((Sint32) last_sample1)) >> 1); + sample2 = (Uint16) ((((Sint32) SDL_SwapBE16(src[2])) + ((Sint32) last_sample2)) >> 1); + sample3 = (Uint16) ((((Sint32) SDL_SwapBE16(src[3])) + ((Sint32) last_sample3)) >> 1); + sample4 = (Uint16) ((((Sint32) SDL_SwapBE16(src[4])) + ((Sint32) last_sample4)) >> 1); + sample5 = (Uint16) ((((Sint32) SDL_SwapBE16(src[5])) + ((Sint32) last_sample5)) >> 1); + sample6 = (Uint16) ((((Sint32) SDL_SwapBE16(src[6])) + ((Sint32) last_sample6)) >> 1); + sample7 = (Uint16) ((((Sint32) SDL_SwapBE16(src[7])) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 32; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst++; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst += 2; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst += 4; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 192; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst += 6; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7])); + Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6])); + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 last_sample7 = sample7; + Sint16 last_sample6 = sample6; + Sint16 last_sample5 = sample5; + Sint16 last_sample4 = sample4; + Sint16 last_sample3 = sample3; + Sint16 last_sample2 = sample2; + Sint16 last_sample1 = sample1; + Sint16 last_sample0 = sample0; + while (dst >= target) { + dst[7] = ((Sint16) SDL_SwapBE16(sample7)); + dst[6] = ((Sint16) SDL_SwapBE16(sample6)); + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S16MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint16 sample0 = ((Sint16) SDL_SwapBE16(src[0])); + Sint16 sample1 = ((Sint16) SDL_SwapBE16(src[1])); + Sint16 sample2 = ((Sint16) SDL_SwapBE16(src[2])); + Sint16 sample3 = ((Sint16) SDL_SwapBE16(src[3])); + Sint16 sample4 = ((Sint16) SDL_SwapBE16(src[4])); + Sint16 sample5 = ((Sint16) SDL_SwapBE16(src[5])); + Sint16 sample6 = ((Sint16) SDL_SwapBE16(src[6])); + Sint16 sample7 = ((Sint16) SDL_SwapBE16(src[7])); + Sint16 last_sample0 = sample0; + Sint16 last_sample1 = sample1; + Sint16 last_sample2 = sample2; + Sint16 last_sample3 = sample3; + Sint16 last_sample4 = sample4; + Sint16 last_sample5 = sample5; + Sint16 last_sample6 = sample6; + Sint16 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint16) SDL_SwapBE16(sample0)); + dst[1] = ((Sint16) SDL_SwapBE16(sample1)); + dst[2] = ((Sint16) SDL_SwapBE16(sample2)); + dst[3] = ((Sint16) SDL_SwapBE16(sample3)); + dst[4] = ((Sint16) SDL_SwapBE16(sample4)); + dst[5] = ((Sint16) SDL_SwapBE16(sample5)); + dst[6] = ((Sint16) SDL_SwapBE16(sample6)); + dst[7] = ((Sint16) SDL_SwapBE16(sample7)); + dst += 8; + sample0 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[0]))) + ((Sint32) last_sample0)) >> 1); + sample1 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[1]))) + ((Sint32) last_sample1)) >> 1); + sample2 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[2]))) + ((Sint32) last_sample2)) >> 1); + sample3 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[3]))) + ((Sint32) last_sample3)) >> 1); + sample4 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[4]))) + ((Sint32) last_sample4)) >> 1); + sample5 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[5]))) + ((Sint32) last_sample5)) >> 1); + sample6 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[6]))) + ((Sint32) last_sample6)) >> 1); + sample7 = (Sint16) ((((Sint32) ((Sint16) SDL_SwapBE16(src[7]))) + ((Sint32) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst++; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst += 2; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst += 4; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst += 6; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7])); + Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6])); + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 last_sample7 = sample7; + Sint32 last_sample6 = sample6; + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[7] = ((Sint32) SDL_SwapLE32(sample7)); + dst[6] = ((Sint32) SDL_SwapLE32(sample6)); + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapLE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapLE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapLE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapLE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapLE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapLE32(src[5])); + Sint32 sample6 = ((Sint32) SDL_SwapLE32(src[6])); + Sint32 sample7 = ((Sint32) SDL_SwapLE32(src[7])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + Sint32 last_sample6 = sample6; + Sint32 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapLE32(sample0)); + dst[1] = ((Sint32) SDL_SwapLE32(sample1)); + dst[2] = ((Sint32) SDL_SwapLE32(sample2)); + dst[3] = ((Sint32) SDL_SwapLE32(sample3)); + dst[4] = ((Sint32) SDL_SwapLE32(sample4)); + dst[5] = ((Sint32) SDL_SwapLE32(sample5)); + dst[6] = ((Sint32) SDL_SwapLE32(sample6)); + dst[7] = ((Sint32) SDL_SwapLE32(sample7)); + dst += 8; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapLE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst++; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst += 2; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst += 4; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst += 6; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7])); + Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6])); + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 last_sample7 = sample7; + Sint32 last_sample6 = sample6; + Sint32 last_sample5 = sample5; + Sint32 last_sample4 = sample4; + Sint32 last_sample3 = sample3; + Sint32 last_sample2 = sample2; + Sint32 last_sample1 = sample1; + Sint32 last_sample0 = sample0; + while (dst >= target) { + dst[7] = ((Sint32) SDL_SwapBE32(sample7)); + dst[6] = ((Sint32) SDL_SwapBE32(sample6)); + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_S32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint32 sample0 = ((Sint32) SDL_SwapBE32(src[0])); + Sint32 sample1 = ((Sint32) SDL_SwapBE32(src[1])); + Sint32 sample2 = ((Sint32) SDL_SwapBE32(src[2])); + Sint32 sample3 = ((Sint32) SDL_SwapBE32(src[3])); + Sint32 sample4 = ((Sint32) SDL_SwapBE32(src[4])); + Sint32 sample5 = ((Sint32) SDL_SwapBE32(src[5])); + Sint32 sample6 = ((Sint32) SDL_SwapBE32(src[6])); + Sint32 sample7 = ((Sint32) SDL_SwapBE32(src[7])); + Sint32 last_sample0 = sample0; + Sint32 last_sample1 = sample1; + Sint32 last_sample2 = sample2; + Sint32 last_sample3 = sample3; + Sint32 last_sample4 = sample4; + Sint32 last_sample5 = sample5; + Sint32 last_sample6 = sample6; + Sint32 last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = ((Sint32) SDL_SwapBE32(sample0)); + dst[1] = ((Sint32) SDL_SwapBE32(sample1)); + dst[2] = ((Sint32) SDL_SwapBE32(sample2)); + dst[3] = ((Sint32) SDL_SwapBE32(sample3)); + dst[4] = ((Sint32) SDL_SwapBE32(sample4)); + dst[5] = ((Sint32) SDL_SwapBE32(sample5)); + dst[6] = ((Sint32) SDL_SwapBE32(sample6)); + dst[7] = ((Sint32) SDL_SwapBE32(sample7)); + dst += 8; + sample0 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[0]))) + ((Sint64) last_sample0)) >> 1); + sample1 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[1]))) + ((Sint64) last_sample1)) >> 1); + sample2 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[2]))) + ((Sint64) last_sample2)) >> 1); + sample3 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[3]))) + ((Sint64) last_sample3)) >> 1); + sample4 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[4]))) + ((Sint64) last_sample4)) >> 1); + sample5 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[5]))) + ((Sint64) last_sample5)) >> 1); + sample6 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[6]))) + ((Sint64) last_sample6)) >> 1); + sample7 = (Sint32) ((((Sint64) ((Sint32) SDL_SwapBE32(src[7]))) + ((Sint64) last_sample7)) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample0 = sample0; + while (dst >= target) { + dst[0] = SDL_SwapFloatLE(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst++; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float last_sample0 = sample0; + float last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst += 2; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[3] = SDL_SwapFloatLE(sample3); + dst[2] = SDL_SwapFloatLE(sample2); + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample3 = SDL_SwapFloatLE(src[3]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst[2] = SDL_SwapFloatLE(sample2); + dst[3] = SDL_SwapFloatLE(sample3); + dst += 4; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf); + float sample5 = SDL_SwapFloatLE(src[5]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[5] = SDL_SwapFloatLE(sample5); + dst[4] = SDL_SwapFloatLE(sample4); + dst[3] = SDL_SwapFloatLE(sample3); + dst[2] = SDL_SwapFloatLE(sample2); + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample5 = SDL_SwapFloatLE(src[5]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst[2] = SDL_SwapFloatLE(sample2); + dst[3] = SDL_SwapFloatLE(sample3); + dst[4] = SDL_SwapFloatLE(sample4); + dst[5] = SDL_SwapFloatLE(sample5); + dst += 6; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf); + float sample7 = SDL_SwapFloatLE(src[7]); + float sample6 = SDL_SwapFloatLE(src[6]); + float sample5 = SDL_SwapFloatLE(src[5]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample0 = SDL_SwapFloatLE(src[0]); + float last_sample7 = sample7; + float last_sample6 = sample6; + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[7] = SDL_SwapFloatLE(sample7); + dst[6] = SDL_SwapFloatLE(sample6); + dst[5] = SDL_SwapFloatLE(sample5); + dst[4] = SDL_SwapFloatLE(sample4); + dst[3] = SDL_SwapFloatLE(sample3); + dst[2] = SDL_SwapFloatLE(sample2); + dst[1] = SDL_SwapFloatLE(sample1); + dst[0] = SDL_SwapFloatLE(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32LSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatLE(src[0]); + float sample1 = SDL_SwapFloatLE(src[1]); + float sample2 = SDL_SwapFloatLE(src[2]); + float sample3 = SDL_SwapFloatLE(src[3]); + float sample4 = SDL_SwapFloatLE(src[4]); + float sample5 = SDL_SwapFloatLE(src[5]); + float sample6 = SDL_SwapFloatLE(src[6]); + float sample7 = SDL_SwapFloatLE(src[7]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + float last_sample6 = sample6; + float last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatLE(sample0); + dst[1] = SDL_SwapFloatLE(sample1); + dst[2] = SDL_SwapFloatLE(sample2); + dst[3] = SDL_SwapFloatLE(sample3); + dst[4] = SDL_SwapFloatLE(sample4); + dst[5] = SDL_SwapFloatLE(sample5); + dst[6] = SDL_SwapFloatLE(sample6); + dst[7] = SDL_SwapFloatLE(sample7); + dst += 8; + sample0 = (float) ((((double) SDL_SwapFloatLE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatLE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatLE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatLE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatLE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatLE(src[5])) + ((double) last_sample5)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatLE(src[6])) + ((double) last_sample6)) * 0.5); + sample7 = (float) ((((double) SDL_SwapFloatLE(src[7])) + ((double) last_sample7)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 1; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample0 = sample0; + while (dst >= target) { + dst[0] = SDL_SwapFloatBE(sample0); + dst--; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src--; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_1c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 1 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 64; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample0 = sample0; + while (dst < target) { + src++; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst++; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample0 = sample0; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 2; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 2; + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_2c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 2 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 128; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float last_sample0 = sample0; + float last_sample1 = sample1; + while (dst < target) { + src += 2; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst += 2; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[3] = SDL_SwapFloatBE(sample3); + dst[2] = SDL_SwapFloatBE(sample2); + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 4; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 4; + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_4c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 4 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 256; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample3 = SDL_SwapFloatBE(src[3]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + while (dst < target) { + src += 4; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst[2] = SDL_SwapFloatBE(sample2); + dst[3] = SDL_SwapFloatBE(sample3); + dst += 4; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 6; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf); + float sample5 = SDL_SwapFloatBE(src[5]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[5] = SDL_SwapFloatBE(sample5); + dst[4] = SDL_SwapFloatBE(sample4); + dst[3] = SDL_SwapFloatBE(sample3); + dst[2] = SDL_SwapFloatBE(sample2); + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 6; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 6; + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_6c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 6 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 384; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample5 = SDL_SwapFloatBE(src[5]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + while (dst < target) { + src += 6; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst[2] = SDL_SwapFloatBE(sample2); + dst[3] = SDL_SwapFloatBE(sample3); + dst[4] = SDL_SwapFloatBE(sample4); + dst[5] = SDL_SwapFloatBE(sample5); + dst += 6; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = ((float *) (cvt->buf + dstsize)) - 8; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf); + float sample7 = SDL_SwapFloatBE(src[7]); + float sample6 = SDL_SwapFloatBE(src[6]); + float sample5 = SDL_SwapFloatBE(src[5]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample0 = SDL_SwapFloatBE(src[0]); + float last_sample7 = sample7; + float last_sample6 = sample6; + float last_sample5 = sample5; + float last_sample4 = sample4; + float last_sample3 = sample3; + float last_sample2 = sample2; + float last_sample1 = sample1; + float last_sample0 = sample0; + while (dst >= target) { + dst[7] = SDL_SwapFloatBE(sample7); + dst[6] = SDL_SwapFloatBE(sample6); + dst[5] = SDL_SwapFloatBE(sample5); + dst[4] = SDL_SwapFloatBE(sample4); + dst[3] = SDL_SwapFloatBE(sample3); + dst[2] = SDL_SwapFloatBE(sample2); + dst[1] = SDL_SwapFloatBE(sample1); + dst[0] = SDL_SwapFloatBE(sample0); + dst -= 8; + eps += srcsize; + if ((eps << 1) >= dstsize) { + src -= 8; + sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + eps -= dstsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_8c(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample arbitrary (x%f) AUDIO_F32MSB, 8 channels.\n", cvt->rate_incr); +#endif + + const int srcsize = cvt->len_cvt - 512; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + float sample0 = SDL_SwapFloatBE(src[0]); + float sample1 = SDL_SwapFloatBE(src[1]); + float sample2 = SDL_SwapFloatBE(src[2]); + float sample3 = SDL_SwapFloatBE(src[3]); + float sample4 = SDL_SwapFloatBE(src[4]); + float sample5 = SDL_SwapFloatBE(src[5]); + float sample6 = SDL_SwapFloatBE(src[6]); + float sample7 = SDL_SwapFloatBE(src[7]); + float last_sample0 = sample0; + float last_sample1 = sample1; + float last_sample2 = sample2; + float last_sample3 = sample3; + float last_sample4 = sample4; + float last_sample5 = sample5; + float last_sample6 = sample6; + float last_sample7 = sample7; + while (dst < target) { + src += 8; + eps += dstsize; + if ((eps << 1) >= srcsize) { + dst[0] = SDL_SwapFloatBE(sample0); + dst[1] = SDL_SwapFloatBE(sample1); + dst[2] = SDL_SwapFloatBE(sample2); + dst[3] = SDL_SwapFloatBE(sample3); + dst[4] = SDL_SwapFloatBE(sample4); + dst[5] = SDL_SwapFloatBE(sample5); + dst[6] = SDL_SwapFloatBE(sample6); + dst[7] = SDL_SwapFloatBE(sample7); + dst += 8; + sample0 = (float) ((((double) SDL_SwapFloatBE(src[0])) + ((double) last_sample0)) * 0.5); + sample1 = (float) ((((double) SDL_SwapFloatBE(src[1])) + ((double) last_sample1)) * 0.5); + sample2 = (float) ((((double) SDL_SwapFloatBE(src[2])) + ((double) last_sample2)) * 0.5); + sample3 = (float) ((((double) SDL_SwapFloatBE(src[3])) + ((double) last_sample3)) * 0.5); + sample4 = (float) ((((double) SDL_SwapFloatBE(src[4])) + ((double) last_sample4)) * 0.5); + sample5 = (float) ((((double) SDL_SwapFloatBE(src[5])) + ((double) last_sample5)) * 0.5); + sample6 = (float) ((((double) SDL_SwapFloatBE(src[6])) + ((double) last_sample6)) * 0.5); + sample7 = (float) ((((double) SDL_SwapFloatBE(src[7])) + ((double) last_sample7)) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + eps -= srcsize; + } + } + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + + +#if !LESS_RESAMPLERS + +static void SDLCALL +SDL_Upsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample0 = (Sint16) src[0]; + src--; + dst[1] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint8) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + src += 2; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 1 * 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample0 = (Sint16) src[0]; + src--; + dst[3] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Uint8) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + src += 4; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 2; + dst[3] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + src += 4; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 2 * 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 2; + dst[7] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + src += 8; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 4; + dst[7] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + src += 8; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 4 * 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 4; + dst[15] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint8) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Uint8) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + src += 16; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 6; + dst[11] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint8) sample5; + dst[4] = (Uint8) sample4; + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + src += 12; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 6 * 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 6; + dst[23] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[16] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[15] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[14] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[13] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[12] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[11] = (Uint8) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Uint8) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Uint8) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Uint8) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Uint8) sample5; + dst[4] = (Uint8) sample4; + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + src += 24; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 2; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample7 = (Sint16) src[7]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample7 = (Sint16) src[7]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 8; + dst[15] = (Uint8) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint8) sample7; + dst[6] = (Uint8) sample6; + dst[5] = (Uint8) sample5; + dst[4] = (Uint8) sample4; + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample7 = (Sint16) src[7]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample7 = (Sint16) src[7]; + src += 16; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint8 *dst = ((Uint8 *) (cvt->buf + dstsize)) - 8 * 4; + const Uint8 *src = ((Uint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint8 *target = ((const Uint8 *) cvt->buf); + Sint16 last_sample7 = (Sint16) src[7]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample0 = (Sint16) src[0]; + while (dst >= target) { + const Sint16 sample7 = (Sint16) src[7]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample0 = (Sint16) src[0]; + src -= 8; + dst[31] = (Uint8) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Uint8) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Uint8) ((sample7 + last_sample7) >> 1); + dst[22] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[21] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[20] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[19] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[18] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[17] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[16] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[15] = (Uint8) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Uint8) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Uint8) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Uint8) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Uint8) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Uint8) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Uint8) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Uint8) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Uint8) sample7; + dst[6] = (Uint8) sample6; + dst[5] = (Uint8) sample5; + dst[4] = (Uint8) sample4; + dst[3] = (Uint8) sample3; + dst[2] = (Uint8) sample2; + dst[1] = (Uint8) sample1; + dst[0] = (Uint8) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint8 *dst = (Uint8 *) cvt->buf; + const Uint8 *src = (Uint8 *) cvt->buf; + const Uint8 *target = (const Uint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) src[0]; + Sint16 last_sample1 = (Sint16) src[1]; + Sint16 last_sample2 = (Sint16) src[2]; + Sint16 last_sample3 = (Sint16) src[3]; + Sint16 last_sample4 = (Sint16) src[4]; + Sint16 last_sample5 = (Sint16) src[5]; + Sint16 last_sample6 = (Sint16) src[6]; + Sint16 last_sample7 = (Sint16) src[7]; + while (dst < target) { + const Sint16 sample0 = (Sint16) src[0]; + const Sint16 sample1 = (Sint16) src[1]; + const Sint16 sample2 = (Sint16) src[2]; + const Sint16 sample3 = (Sint16) src[3]; + const Sint16 sample4 = (Sint16) src[4]; + const Sint16 sample5 = (Sint16) src[5]; + const Sint16 sample6 = (Sint16) src[6]; + const Sint16 sample7 = (Sint16) src[7]; + src += 32; + dst[0] = (Uint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src--; + dst[1] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint8) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src += 2; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 1 * 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src--; + dst[3] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Sint8) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src += 4; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 2; + dst[3] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + src += 4; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 2 * 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 2; + dst[7] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + src += 8; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 4; + dst[7] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + src += 8; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 4 * 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 4; + dst[15] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint8) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Sint8) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + src += 16; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 6; + dst[11] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint8) sample5; + dst[4] = (Sint8) sample4; + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + src += 12; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 6 * 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 6; + dst[23] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[16] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[15] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[14] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[13] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[12] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[11] = (Sint8) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Sint8) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Sint8) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Sint8) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Sint8) sample5; + dst[4] = (Sint8) sample4; + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + src += 24; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 2; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 8; + dst[15] = (Sint8) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint8) sample7; + dst[6] = (Sint8) sample6; + dst[5] = (Sint8) sample5; + dst[4] = (Sint8) sample4; + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + src += 16; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint8 *dst = ((Sint8 *) (cvt->buf + dstsize)) - 8 * 4; + const Sint8 *src = ((Sint8 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint8 *target = ((const Sint8 *) cvt->buf); + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + while (dst >= target) { + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + src -= 8; + dst[31] = (Sint8) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Sint8) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Sint8) ((sample7 + last_sample7) >> 1); + dst[22] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[21] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[20] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[19] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[18] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[17] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[16] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[15] = (Sint8) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Sint8) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Sint8) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Sint8) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Sint8) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint8) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint8) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint8) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint8) sample7; + dst[6] = (Sint8) sample6; + dst[5] = (Sint8) sample5; + dst[4] = (Sint8) sample4; + dst[3] = (Sint8) sample3; + dst[2] = (Sint8) sample2; + dst[1] = (Sint8) sample1; + dst[0] = (Sint8) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S8_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S8, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint8 *dst = (Sint8 *) cvt->buf; + const Sint8 *src = (Sint8 *) cvt->buf; + const Sint8 *target = (const Sint8 *) (cvt->buf + dstsize); + Sint16 last_sample0 = (Sint16) ((Sint8) src[0]); + Sint16 last_sample1 = (Sint16) ((Sint8) src[1]); + Sint16 last_sample2 = (Sint16) ((Sint8) src[2]); + Sint16 last_sample3 = (Sint16) ((Sint8) src[3]); + Sint16 last_sample4 = (Sint16) ((Sint8) src[4]); + Sint16 last_sample5 = (Sint16) ((Sint8) src[5]); + Sint16 last_sample6 = (Sint16) ((Sint8) src[6]); + Sint16 last_sample7 = (Sint16) ((Sint8) src[7]); + while (dst < target) { + const Sint16 sample0 = (Sint16) ((Sint8) src[0]); + const Sint16 sample1 = (Sint16) ((Sint8) src[1]); + const Sint16 sample2 = (Sint16) ((Sint8) src[2]); + const Sint16 sample3 = (Sint16) ((Sint8) src[3]); + const Sint16 sample4 = (Sint16) ((Sint8) src[4]); + const Sint16 sample5 = (Sint16) ((Sint8) src[5]); + const Sint16 sample6 = (Sint16) ((Sint8) src[6]); + const Sint16 sample7 = (Sint16) ((Sint8) src[7]); + src += 32; + dst[0] = (Sint8) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint8) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint8) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint8) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint8) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint8) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint8) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint8) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src--; + dst[1] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src += 2; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src--; + dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Uint16) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 2; + dst[3] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 2; + dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 4; + dst[7] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 4; + dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 6; + dst[11] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + src += 12; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 6; + dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[16] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[15] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[14] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[13] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[12] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + src += 24; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 8; + dst[15] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) sample7; + dst[6] = (Uint16) sample6; + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + while (dst >= target) { + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + src -= 8; + dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[22] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[21] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[20] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[19] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[18] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[17] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[16] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Uint16) sample7; + dst[6] = (Uint16) sample6; + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapLE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapLE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapLE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapLE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapLE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapLE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapLE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapLE16(src[7]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapLE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapLE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapLE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapLE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapLE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapLE16(src[7]); + src += 32; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src--; + dst[1] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src += 2; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src--; + dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Sint16) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 2; + dst[3] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 2; + dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 4; + dst[7] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 4; + dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 6; + dst[11] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + src += 12; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 6; + dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[16] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[15] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[14] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[13] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[12] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + src += 24; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 8; + dst[15] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) sample7; + dst[6] = (Sint16) sample6; + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + while (dst >= target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + src -= 8; + dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[22] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[21] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[20] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[19] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[18] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[17] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[16] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint16) sample7; + dst[6] = (Sint16) sample6; + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapLE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapLE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapLE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapLE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapLE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapLE16(src[7])); + src += 32; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src--; + dst[1] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Uint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src += 2; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 1 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src--; + dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Uint16) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 2; + dst[3] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + src += 4; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 2 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 2; + dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 4; + dst[7] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + src += 8; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 4 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 4; + dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 6; + dst[11] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + src += 12; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 6 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 6; + dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[16] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[15] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[14] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[13] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[12] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + src += 24; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 2; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 8; + dst[15] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Uint16) sample7; + dst[6] = (Uint16) sample6; + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + src += 16; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Uint16 *dst = ((Uint16 *) (cvt->buf + dstsize)) - 8 * 4; + const Uint16 *src = ((Uint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Uint16 *target = ((const Uint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + while (dst >= target) { + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + src -= 8; + dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Uint16) ((sample7 + last_sample7) >> 1); + dst[22] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[21] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[20] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[19] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[18] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[17] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[16] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Uint16) sample7; + dst[6] = (Uint16) sample6; + dst[5] = (Uint16) sample5; + dst[4] = (Uint16) sample4; + dst[3] = (Uint16) sample3; + dst[2] = (Uint16) sample2; + dst[1] = (Uint16) sample1; + dst[0] = (Uint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_U16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_U16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Uint16 *dst = (Uint16 *) cvt->buf; + const Uint16 *src = (Uint16 *) cvt->buf; + const Uint16 *target = (const Uint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) SDL_SwapBE16(src[0]); + Sint32 last_sample1 = (Sint32) SDL_SwapBE16(src[1]); + Sint32 last_sample2 = (Sint32) SDL_SwapBE16(src[2]); + Sint32 last_sample3 = (Sint32) SDL_SwapBE16(src[3]); + Sint32 last_sample4 = (Sint32) SDL_SwapBE16(src[4]); + Sint32 last_sample5 = (Sint32) SDL_SwapBE16(src[5]); + Sint32 last_sample6 = (Sint32) SDL_SwapBE16(src[6]); + Sint32 last_sample7 = (Sint32) SDL_SwapBE16(src[7]); + while (dst < target) { + const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]); + const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]); + const Sint32 sample2 = (Sint32) SDL_SwapBE16(src[2]); + const Sint32 sample3 = (Sint32) SDL_SwapBE16(src[3]); + const Sint32 sample4 = (Sint32) SDL_SwapBE16(src[4]); + const Sint32 sample5 = (Sint32) SDL_SwapBE16(src[5]); + const Sint32 sample6 = (Sint32) SDL_SwapBE16(src[6]); + const Sint32 sample7 = (Sint32) SDL_SwapBE16(src[7]); + src += 32; + dst[0] = (Uint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Uint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Uint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Uint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Uint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Uint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Uint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Uint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src--; + dst[1] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint16) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src += 2; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 1 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src--; + dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Sint16) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 2; + dst[3] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + src += 4; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 2; + dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 4; + dst[7] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + src += 8; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 4 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 4; + dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 6; + dst[11] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + src += 12; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 6 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 6; + dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[16] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[15] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[14] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[13] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[12] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + src += 24; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 2; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 8; + dst[15] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint16) sample7; + dst[6] = (Sint16) sample6; + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + src += 16; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 8 * 4; + const Sint16 *src = ((Sint16 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint16 *target = ((const Sint16 *) cvt->buf); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + while (dst >= target) { + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + src -= 8; + dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Sint16) ((sample7 + last_sample7) >> 1); + dst[22] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[21] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[20] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[19] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[18] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[17] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[16] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint16) sample7; + dst[6] = (Sint16) sample6; + dst[5] = (Sint16) sample5; + dst[4] = (Sint16) sample4; + dst[3] = (Sint16) sample3; + dst[2] = (Sint16) sample2; + dst[1] = (Sint16) sample1; + dst[0] = (Sint16) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S16MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S16MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint16 *dst = (Sint16 *) cvt->buf; + const Sint16 *src = (Sint16 *) cvt->buf; + const Sint16 *target = (const Sint16 *) (cvt->buf + dstsize); + Sint32 last_sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + Sint32 last_sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + Sint32 last_sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + Sint32 last_sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + Sint32 last_sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + Sint32 last_sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + Sint32 last_sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + Sint32 last_sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + while (dst < target) { + const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0])); + const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1])); + const Sint32 sample2 = (Sint32) ((Sint16) SDL_SwapBE16(src[2])); + const Sint32 sample3 = (Sint32) ((Sint16) SDL_SwapBE16(src[3])); + const Sint32 sample4 = (Sint32) ((Sint16) SDL_SwapBE16(src[4])); + const Sint32 sample5 = (Sint32) ((Sint16) SDL_SwapBE16(src[5])); + const Sint32 sample6 = (Sint32) ((Sint16) SDL_SwapBE16(src[6])); + const Sint32 sample7 = (Sint32) ((Sint16) SDL_SwapBE16(src[7])); + src += 32; + dst[0] = (Sint16) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint16) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint16) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint16) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint16) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint16) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint16) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint16) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src--; + dst[1] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint32) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src += 2; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src--; + dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Sint32) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 2; + dst[3] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 2; + dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 4; + dst[7] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 4; + dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 6; + dst[11] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + src += 12; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 6; + dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[16] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[15] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[14] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[13] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[12] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + src += 24; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 8; + dst[15] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) sample7; + dst[6] = (Sint32) sample6; + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + while (dst >= target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + src -= 8; + dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[22] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[21] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[20] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[19] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[18] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[17] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[16] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint32) sample7; + dst[6] = (Sint32) sample6; + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapLE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapLE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapLE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapLE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapLE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapLE32(src[7])); + src += 32; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src--; + dst[1] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[0] = (Sint32) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src += 2; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 1 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 1; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src--; + dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[0] = (Sint32) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 2; + dst[3] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + src += 4; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 2 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 2; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 2; + dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 4; + dst[7] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[6] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[5] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[4] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + src += 8; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 4 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 4; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 4; + dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 6; + dst[11] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[10] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[9] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[8] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[7] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[6] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + src += 12; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 6 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 6; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 6; + dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[17] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[16] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[15] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[14] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[13] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[12] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + src += 24; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 2; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 8; + dst[15] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[14] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[13] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[12] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[11] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[10] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[9] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[8] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[7] = (Sint32) sample7; + dst[6] = (Sint32) sample6; + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + src += 16; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + Sint32 *dst = ((Sint32 *) (cvt->buf + dstsize)) - 8 * 4; + const Sint32 *src = ((Sint32 *) (cvt->buf + cvt->len_cvt)) - 8; + const Sint32 *target = ((const Sint32 *) cvt->buf); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + while (dst >= target) { + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + src -= 8; + dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2); + dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2); + dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2); + dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2); + dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2); + dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2); + dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2); + dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2); + dst[23] = (Sint32) ((sample7 + last_sample7) >> 1); + dst[22] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[21] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[20] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[19] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[18] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[17] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[16] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2); + dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2); + dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2); + dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2); + dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2); + dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2); + dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2); + dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2); + dst[7] = (Sint32) sample7; + dst[6] = (Sint32) sample6; + dst[5] = (Sint32) sample5; + dst[4] = (Sint32) sample4; + dst[3] = (Sint32) sample3; + dst[2] = (Sint32) sample2; + dst[1] = (Sint32) sample1; + dst[0] = (Sint32) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_S32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_S32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + Sint32 *dst = (Sint32 *) cvt->buf; + const Sint32 *src = (Sint32 *) cvt->buf; + const Sint32 *target = (const Sint32 *) (cvt->buf + dstsize); + Sint64 last_sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + Sint64 last_sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + Sint64 last_sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + Sint64 last_sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + Sint64 last_sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + Sint64 last_sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + Sint64 last_sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + Sint64 last_sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + while (dst < target) { + const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0])); + const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1])); + const Sint64 sample2 = (Sint64) ((Sint32) SDL_SwapBE32(src[2])); + const Sint64 sample3 = (Sint64) ((Sint32) SDL_SwapBE32(src[3])); + const Sint64 sample4 = (Sint64) ((Sint32) SDL_SwapBE32(src[4])); + const Sint64 sample5 = (Sint64) ((Sint32) SDL_SwapBE32(src[5])); + const Sint64 sample6 = (Sint64) ((Sint32) SDL_SwapBE32(src[6])); + const Sint64 sample7 = (Sint64) ((Sint32) SDL_SwapBE32(src[7])); + src += 32; + dst[0] = (Sint32) ((sample0 + last_sample0) >> 1); + dst[1] = (Sint32) ((sample1 + last_sample1) >> 1); + dst[2] = (Sint32) ((sample2 + last_sample2) >> 1); + dst[3] = (Sint32) ((sample3 + last_sample3) >> 1); + dst[4] = (Sint32) ((sample4 + last_sample4) >> 1); + dst[5] = (Sint32) ((sample5 + last_sample5) >> 1); + dst[6] = (Sint32) ((sample6 + last_sample6) >> 1); + dst[7] = (Sint32) ((sample7 + last_sample7) >> 1); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src--; + dst[1] = (float) ((sample0 + last_sample0) * 0.5); + dst[0] = (float) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src += 2; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src--; + dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[0] = (float) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 2; + dst[3] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 2; + dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 4; + dst[7] = (float) ((sample3 + last_sample3) * 0.5); + dst[6] = (float) ((sample2 + last_sample2) * 0.5); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 4; + dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 6; + dst[11] = (float) ((sample5 + last_sample5) * 0.5); + dst[10] = (float) ((sample4 + last_sample4) * 0.5); + dst[9] = (float) ((sample3 + last_sample3) * 0.5); + dst[8] = (float) ((sample2 + last_sample2) * 0.5); + dst[7] = (float) ((sample1 + last_sample1) * 0.5); + dst[6] = (float) ((sample0 + last_sample0) * 0.5); + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + src += 12; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 6; + dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[17] = (float) ((sample5 + last_sample5) * 0.5); + dst[16] = (float) ((sample4 + last_sample4) * 0.5); + dst[15] = (float) ((sample3 + last_sample3) * 0.5); + dst[14] = (float) ((sample2 + last_sample2) * 0.5); + dst[13] = (float) ((sample1 + last_sample1) * 0.5); + dst[12] = (float) ((sample0 + last_sample0) * 0.5); + dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + src += 24; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf); + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 8; + dst[15] = (float) ((sample7 + last_sample7) * 0.5); + dst[14] = (float) ((sample6 + last_sample6) * 0.5); + dst[13] = (float) ((sample5 + last_sample5) * 0.5); + dst[12] = (float) ((sample4 + last_sample4) * 0.5); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) sample7; + dst[6] = (float) sample6; + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf); + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + while (dst >= target) { + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + src -= 8; + dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25); + dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25); + dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[23] = (float) ((sample7 + last_sample7) * 0.5); + dst[22] = (float) ((sample6 + last_sample6) * 0.5); + dst[21] = (float) ((sample5 + last_sample5) * 0.5); + dst[20] = (float) ((sample4 + last_sample4) * 0.5); + dst[19] = (float) ((sample3 + last_sample3) * 0.5); + dst[18] = (float) ((sample2 + last_sample2) * 0.5); + dst[17] = (float) ((sample1 + last_sample1) * 0.5); + dst[16] = (float) ((sample0 + last_sample0) * 0.5); + dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25); + dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25); + dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[7] = (float) sample7; + dst[6] = (float) sample6; + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32LSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32LSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatLE(src[0]); + double last_sample1 = (double) SDL_SwapFloatLE(src[1]); + double last_sample2 = (double) SDL_SwapFloatLE(src[2]); + double last_sample3 = (double) SDL_SwapFloatLE(src[3]); + double last_sample4 = (double) SDL_SwapFloatLE(src[4]); + double last_sample5 = (double) SDL_SwapFloatLE(src[5]); + double last_sample6 = (double) SDL_SwapFloatLE(src[6]); + double last_sample7 = (double) SDL_SwapFloatLE(src[7]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatLE(src[0]); + const double sample1 = (double) SDL_SwapFloatLE(src[1]); + const double sample2 = (double) SDL_SwapFloatLE(src[2]); + const double sample3 = (double) SDL_SwapFloatLE(src[3]); + const double sample4 = (double) SDL_SwapFloatLE(src[4]); + const double sample5 = (double) SDL_SwapFloatLE(src[5]); + const double sample6 = (double) SDL_SwapFloatLE(src[6]); + const double sample7 = (double) SDL_SwapFloatLE(src[7]); + src += 32; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src--; + dst[1] = (float) ((sample0 + last_sample0) * 0.5); + dst[0] = (float) sample0; + last_sample0 = sample0; + dst -= 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_1c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src += 2; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 1 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 1; + const float *target = ((const float *) cvt->buf); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src--; + dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[0] = (float) sample0; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_1c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 1 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + last_sample0 = sample0; + dst++; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 2; + dst[3] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_2c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + src += 4; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 2 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 2; + const float *target = ((const float *) cvt->buf); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 2; + dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_2c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 2 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + dst += 2; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 4; + dst[7] = (float) ((sample3 + last_sample3) * 0.5); + dst[6] = (float) ((sample2 + last_sample2) * 0.5); + dst[5] = (float) ((sample1 + last_sample1) * 0.5); + dst[4] = (float) ((sample0 + last_sample0) * 0.5); + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_4c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + src += 8; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 4 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 4; + const float *target = ((const float *) cvt->buf); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 4; + dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_4c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 4 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + dst += 4; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 6; + dst[11] = (float) ((sample5 + last_sample5) * 0.5); + dst[10] = (float) ((sample4 + last_sample4) * 0.5); + dst[9] = (float) ((sample3 + last_sample3) * 0.5); + dst[8] = (float) ((sample2 + last_sample2) * 0.5); + dst[7] = (float) ((sample1 + last_sample1) * 0.5); + dst[6] = (float) ((sample0 + last_sample0) * 0.5); + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 12; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_6c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + src += 12; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 6 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 6; + const float *target = ((const float *) cvt->buf); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 6; + dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[17] = (float) ((sample5 + last_sample5) * 0.5); + dst[16] = (float) ((sample4 + last_sample4) * 0.5); + dst[15] = (float) ((sample3 + last_sample3) * 0.5); + dst[14] = (float) ((sample2 + last_sample2) * 0.5); + dst[13] = (float) ((sample1 + last_sample1) * 0.5); + dst[12] = (float) ((sample0 + last_sample0) * 0.5); + dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 24; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_6c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 6 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + src += 24; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + dst += 6; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x2) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 2; + float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 2; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf); + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 8; + dst[15] = (float) ((sample7 + last_sample7) * 0.5); + dst[14] = (float) ((sample6 + last_sample6) * 0.5); + dst[13] = (float) ((sample5 + last_sample5) * 0.5); + dst[12] = (float) ((sample4 + last_sample4) * 0.5); + dst[11] = (float) ((sample3 + last_sample3) * 0.5); + dst[10] = (float) ((sample2 + last_sample2) * 0.5); + dst[9] = (float) ((sample1 + last_sample1) * 0.5); + dst[8] = (float) ((sample0 + last_sample0) * 0.5); + dst[7] = (float) sample7; + dst[6] = (float) sample6; + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 16; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_8c_x2(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x2) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 2; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + src += 16; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Upsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Upsample (x4) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt * 4; + float *dst = ((float *) (cvt->buf + dstsize)) - 8 * 4; + const float *src = ((float *) (cvt->buf + cvt->len_cvt)) - 8; + const float *target = ((const float *) cvt->buf); + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + while (dst >= target) { + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + src -= 8; + dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25); + dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25); + dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25); + dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25); + dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25); + dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25); + dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25); + dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25); + dst[23] = (float) ((sample7 + last_sample7) * 0.5); + dst[22] = (float) ((sample6 + last_sample6) * 0.5); + dst[21] = (float) ((sample5 + last_sample5) * 0.5); + dst[20] = (float) ((sample4 + last_sample4) * 0.5); + dst[19] = (float) ((sample3 + last_sample3) * 0.5); + dst[18] = (float) ((sample2 + last_sample2) * 0.5); + dst[17] = (float) ((sample1 + last_sample1) * 0.5); + dst[16] = (float) ((sample0 + last_sample0) * 0.5); + dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25); + dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25); + dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25); + dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25); + dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25); + dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25); + dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25); + dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25); + dst[7] = (float) sample7; + dst[6] = (float) sample6; + dst[5] = (float) sample5; + dst[4] = (float) sample4; + dst[3] = (float) sample3; + dst[2] = (float) sample2; + dst[1] = (float) sample1; + dst[0] = (float) sample0; + last_sample7 = sample7; + last_sample6 = sample6; + last_sample5 = sample5; + last_sample4 = sample4; + last_sample3 = sample3; + last_sample2 = sample2; + last_sample1 = sample1; + last_sample0 = sample0; + dst -= 32; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +static void SDLCALL +SDL_Downsample_F32MSB_8c_x4(SDL_AudioCVT * cvt, SDL_AudioFormat format) +{ +#if DEBUG_CONVERT + fprintf(stderr, "Downsample (x4) AUDIO_F32MSB, 8 channels.\n"); +#endif + + const int dstsize = cvt->len_cvt / 4; + float *dst = (float *) cvt->buf; + const float *src = (float *) cvt->buf; + const float *target = (const float *) (cvt->buf + dstsize); + double last_sample0 = (double) SDL_SwapFloatBE(src[0]); + double last_sample1 = (double) SDL_SwapFloatBE(src[1]); + double last_sample2 = (double) SDL_SwapFloatBE(src[2]); + double last_sample3 = (double) SDL_SwapFloatBE(src[3]); + double last_sample4 = (double) SDL_SwapFloatBE(src[4]); + double last_sample5 = (double) SDL_SwapFloatBE(src[5]); + double last_sample6 = (double) SDL_SwapFloatBE(src[6]); + double last_sample7 = (double) SDL_SwapFloatBE(src[7]); + while (dst < target) { + const double sample0 = (double) SDL_SwapFloatBE(src[0]); + const double sample1 = (double) SDL_SwapFloatBE(src[1]); + const double sample2 = (double) SDL_SwapFloatBE(src[2]); + const double sample3 = (double) SDL_SwapFloatBE(src[3]); + const double sample4 = (double) SDL_SwapFloatBE(src[4]); + const double sample5 = (double) SDL_SwapFloatBE(src[5]); + const double sample6 = (double) SDL_SwapFloatBE(src[6]); + const double sample7 = (double) SDL_SwapFloatBE(src[7]); + src += 32; + dst[0] = (float) ((sample0 + last_sample0) * 0.5); + dst[1] = (float) ((sample1 + last_sample1) * 0.5); + dst[2] = (float) ((sample2 + last_sample2) * 0.5); + dst[3] = (float) ((sample3 + last_sample3) * 0.5); + dst[4] = (float) ((sample4 + last_sample4) * 0.5); + dst[5] = (float) ((sample5 + last_sample5) * 0.5); + dst[6] = (float) ((sample6 + last_sample6) * 0.5); + dst[7] = (float) ((sample7 + last_sample7) * 0.5); + last_sample0 = sample0; + last_sample1 = sample1; + last_sample2 = sample2; + last_sample3 = sample3; + last_sample4 = sample4; + last_sample5 = sample5; + last_sample6 = sample6; + last_sample7 = sample7; + dst += 8; + } + + cvt->len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +#endif /* !LESS_RESAMPLERS */ +#endif /* !NO_RESAMPLERS */ + + +const SDL_AudioRateFilters sdl_audio_rate_filters[] = +{ +#if !NO_RESAMPLERS + { AUDIO_U8, 1, 0, 0, SDL_Downsample_U8_1c }, + { AUDIO_U8, 1, 1, 0, SDL_Upsample_U8_1c }, + { AUDIO_U8, 2, 0, 0, SDL_Downsample_U8_2c }, + { AUDIO_U8, 2, 1, 0, SDL_Upsample_U8_2c }, + { AUDIO_U8, 4, 0, 0, SDL_Downsample_U8_4c }, + { AUDIO_U8, 4, 1, 0, SDL_Upsample_U8_4c }, + { AUDIO_U8, 6, 0, 0, SDL_Downsample_U8_6c }, + { AUDIO_U8, 6, 1, 0, SDL_Upsample_U8_6c }, + { AUDIO_U8, 8, 0, 0, SDL_Downsample_U8_8c }, + { AUDIO_U8, 8, 1, 0, SDL_Upsample_U8_8c }, + { AUDIO_S8, 1, 0, 0, SDL_Downsample_S8_1c }, + { AUDIO_S8, 1, 1, 0, SDL_Upsample_S8_1c }, + { AUDIO_S8, 2, 0, 0, SDL_Downsample_S8_2c }, + { AUDIO_S8, 2, 1, 0, SDL_Upsample_S8_2c }, + { AUDIO_S8, 4, 0, 0, SDL_Downsample_S8_4c }, + { AUDIO_S8, 4, 1, 0, SDL_Upsample_S8_4c }, + { AUDIO_S8, 6, 0, 0, SDL_Downsample_S8_6c }, + { AUDIO_S8, 6, 1, 0, SDL_Upsample_S8_6c }, + { AUDIO_S8, 8, 0, 0, SDL_Downsample_S8_8c }, + { AUDIO_S8, 8, 1, 0, SDL_Upsample_S8_8c }, + { AUDIO_U16LSB, 1, 0, 0, SDL_Downsample_U16LSB_1c }, + { AUDIO_U16LSB, 1, 1, 0, SDL_Upsample_U16LSB_1c }, + { AUDIO_U16LSB, 2, 0, 0, SDL_Downsample_U16LSB_2c }, + { AUDIO_U16LSB, 2, 1, 0, SDL_Upsample_U16LSB_2c }, + { AUDIO_U16LSB, 4, 0, 0, SDL_Downsample_U16LSB_4c }, + { AUDIO_U16LSB, 4, 1, 0, SDL_Upsample_U16LSB_4c }, + { AUDIO_U16LSB, 6, 0, 0, SDL_Downsample_U16LSB_6c }, + { AUDIO_U16LSB, 6, 1, 0, SDL_Upsample_U16LSB_6c }, + { AUDIO_U16LSB, 8, 0, 0, SDL_Downsample_U16LSB_8c }, + { AUDIO_U16LSB, 8, 1, 0, SDL_Upsample_U16LSB_8c }, + { AUDIO_S16LSB, 1, 0, 0, SDL_Downsample_S16LSB_1c }, + { AUDIO_S16LSB, 1, 1, 0, SDL_Upsample_S16LSB_1c }, + { AUDIO_S16LSB, 2, 0, 0, SDL_Downsample_S16LSB_2c }, + { AUDIO_S16LSB, 2, 1, 0, SDL_Upsample_S16LSB_2c }, + { AUDIO_S16LSB, 4, 0, 0, SDL_Downsample_S16LSB_4c }, + { AUDIO_S16LSB, 4, 1, 0, SDL_Upsample_S16LSB_4c }, + { AUDIO_S16LSB, 6, 0, 0, SDL_Downsample_S16LSB_6c }, + { AUDIO_S16LSB, 6, 1, 0, SDL_Upsample_S16LSB_6c }, + { AUDIO_S16LSB, 8, 0, 0, SDL_Downsample_S16LSB_8c }, + { AUDIO_S16LSB, 8, 1, 0, SDL_Upsample_S16LSB_8c }, + { AUDIO_U16MSB, 1, 0, 0, SDL_Downsample_U16MSB_1c }, + { AUDIO_U16MSB, 1, 1, 0, SDL_Upsample_U16MSB_1c }, + { AUDIO_U16MSB, 2, 0, 0, SDL_Downsample_U16MSB_2c }, + { AUDIO_U16MSB, 2, 1, 0, SDL_Upsample_U16MSB_2c }, + { AUDIO_U16MSB, 4, 0, 0, SDL_Downsample_U16MSB_4c }, + { AUDIO_U16MSB, 4, 1, 0, SDL_Upsample_U16MSB_4c }, + { AUDIO_U16MSB, 6, 0, 0, SDL_Downsample_U16MSB_6c }, + { AUDIO_U16MSB, 6, 1, 0, SDL_Upsample_U16MSB_6c }, + { AUDIO_U16MSB, 8, 0, 0, SDL_Downsample_U16MSB_8c }, + { AUDIO_U16MSB, 8, 1, 0, SDL_Upsample_U16MSB_8c }, + { AUDIO_S16MSB, 1, 0, 0, SDL_Downsample_S16MSB_1c }, + { AUDIO_S16MSB, 1, 1, 0, SDL_Upsample_S16MSB_1c }, + { AUDIO_S16MSB, 2, 0, 0, SDL_Downsample_S16MSB_2c }, + { AUDIO_S16MSB, 2, 1, 0, SDL_Upsample_S16MSB_2c }, + { AUDIO_S16MSB, 4, 0, 0, SDL_Downsample_S16MSB_4c }, + { AUDIO_S16MSB, 4, 1, 0, SDL_Upsample_S16MSB_4c }, + { AUDIO_S16MSB, 6, 0, 0, SDL_Downsample_S16MSB_6c }, + { AUDIO_S16MSB, 6, 1, 0, SDL_Upsample_S16MSB_6c }, + { AUDIO_S16MSB, 8, 0, 0, SDL_Downsample_S16MSB_8c }, + { AUDIO_S16MSB, 8, 1, 0, SDL_Upsample_S16MSB_8c }, + { AUDIO_S32LSB, 1, 0, 0, SDL_Downsample_S32LSB_1c }, + { AUDIO_S32LSB, 1, 1, 0, SDL_Upsample_S32LSB_1c }, + { AUDIO_S32LSB, 2, 0, 0, SDL_Downsample_S32LSB_2c }, + { AUDIO_S32LSB, 2, 1, 0, SDL_Upsample_S32LSB_2c }, + { AUDIO_S32LSB, 4, 0, 0, SDL_Downsample_S32LSB_4c }, + { AUDIO_S32LSB, 4, 1, 0, SDL_Upsample_S32LSB_4c }, + { AUDIO_S32LSB, 6, 0, 0, SDL_Downsample_S32LSB_6c }, + { AUDIO_S32LSB, 6, 1, 0, SDL_Upsample_S32LSB_6c }, + { AUDIO_S32LSB, 8, 0, 0, SDL_Downsample_S32LSB_8c }, + { AUDIO_S32LSB, 8, 1, 0, SDL_Upsample_S32LSB_8c }, + { AUDIO_S32MSB, 1, 0, 0, SDL_Downsample_S32MSB_1c }, + { AUDIO_S32MSB, 1, 1, 0, SDL_Upsample_S32MSB_1c }, + { AUDIO_S32MSB, 2, 0, 0, SDL_Downsample_S32MSB_2c }, + { AUDIO_S32MSB, 2, 1, 0, SDL_Upsample_S32MSB_2c }, + { AUDIO_S32MSB, 4, 0, 0, SDL_Downsample_S32MSB_4c }, + { AUDIO_S32MSB, 4, 1, 0, SDL_Upsample_S32MSB_4c }, + { AUDIO_S32MSB, 6, 0, 0, SDL_Downsample_S32MSB_6c }, + { AUDIO_S32MSB, 6, 1, 0, SDL_Upsample_S32MSB_6c }, + { AUDIO_S32MSB, 8, 0, 0, SDL_Downsample_S32MSB_8c }, + { AUDIO_S32MSB, 8, 1, 0, SDL_Upsample_S32MSB_8c }, + { AUDIO_F32LSB, 1, 0, 0, SDL_Downsample_F32LSB_1c }, + { AUDIO_F32LSB, 1, 1, 0, SDL_Upsample_F32LSB_1c }, + { AUDIO_F32LSB, 2, 0, 0, SDL_Downsample_F32LSB_2c }, + { AUDIO_F32LSB, 2, 1, 0, SDL_Upsample_F32LSB_2c }, + { AUDIO_F32LSB, 4, 0, 0, SDL_Downsample_F32LSB_4c }, + { AUDIO_F32LSB, 4, 1, 0, SDL_Upsample_F32LSB_4c }, + { AUDIO_F32LSB, 6, 0, 0, SDL_Downsample_F32LSB_6c }, + { AUDIO_F32LSB, 6, 1, 0, SDL_Upsample_F32LSB_6c }, + { AUDIO_F32LSB, 8, 0, 0, SDL_Downsample_F32LSB_8c }, + { AUDIO_F32LSB, 8, 1, 0, SDL_Upsample_F32LSB_8c }, + { AUDIO_F32MSB, 1, 0, 0, SDL_Downsample_F32MSB_1c }, + { AUDIO_F32MSB, 1, 1, 0, SDL_Upsample_F32MSB_1c }, + { AUDIO_F32MSB, 2, 0, 0, SDL_Downsample_F32MSB_2c }, + { AUDIO_F32MSB, 2, 1, 0, SDL_Upsample_F32MSB_2c }, + { AUDIO_F32MSB, 4, 0, 0, SDL_Downsample_F32MSB_4c }, + { AUDIO_F32MSB, 4, 1, 0, SDL_Upsample_F32MSB_4c }, + { AUDIO_F32MSB, 6, 0, 0, SDL_Downsample_F32MSB_6c }, + { AUDIO_F32MSB, 6, 1, 0, SDL_Upsample_F32MSB_6c }, + { AUDIO_F32MSB, 8, 0, 0, SDL_Downsample_F32MSB_8c }, + { AUDIO_F32MSB, 8, 1, 0, SDL_Upsample_F32MSB_8c }, +#if !LESS_RESAMPLERS + { AUDIO_U8, 1, 0, 2, SDL_Downsample_U8_1c_x2 }, + { AUDIO_U8, 1, 1, 2, SDL_Upsample_U8_1c_x2 }, + { AUDIO_U8, 1, 0, 4, SDL_Downsample_U8_1c_x4 }, + { AUDIO_U8, 1, 1, 4, SDL_Upsample_U8_1c_x4 }, + { AUDIO_U8, 2, 0, 2, SDL_Downsample_U8_2c_x2 }, + { AUDIO_U8, 2, 1, 2, SDL_Upsample_U8_2c_x2 }, + { AUDIO_U8, 2, 0, 4, SDL_Downsample_U8_2c_x4 }, + { AUDIO_U8, 2, 1, 4, SDL_Upsample_U8_2c_x4 }, + { AUDIO_U8, 4, 0, 2, SDL_Downsample_U8_4c_x2 }, + { AUDIO_U8, 4, 1, 2, SDL_Upsample_U8_4c_x2 }, + { AUDIO_U8, 4, 0, 4, SDL_Downsample_U8_4c_x4 }, + { AUDIO_U8, 4, 1, 4, SDL_Upsample_U8_4c_x4 }, + { AUDIO_U8, 6, 0, 2, SDL_Downsample_U8_6c_x2 }, + { AUDIO_U8, 6, 1, 2, SDL_Upsample_U8_6c_x2 }, + { AUDIO_U8, 6, 0, 4, SDL_Downsample_U8_6c_x4 }, + { AUDIO_U8, 6, 1, 4, SDL_Upsample_U8_6c_x4 }, + { AUDIO_U8, 8, 0, 2, SDL_Downsample_U8_8c_x2 }, + { AUDIO_U8, 8, 1, 2, SDL_Upsample_U8_8c_x2 }, + { AUDIO_U8, 8, 0, 4, SDL_Downsample_U8_8c_x4 }, + { AUDIO_U8, 8, 1, 4, SDL_Upsample_U8_8c_x4 }, + { AUDIO_S8, 1, 0, 2, SDL_Downsample_S8_1c_x2 }, + { AUDIO_S8, 1, 1, 2, SDL_Upsample_S8_1c_x2 }, + { AUDIO_S8, 1, 0, 4, SDL_Downsample_S8_1c_x4 }, + { AUDIO_S8, 1, 1, 4, SDL_Upsample_S8_1c_x4 }, + { AUDIO_S8, 2, 0, 2, SDL_Downsample_S8_2c_x2 }, + { AUDIO_S8, 2, 1, 2, SDL_Upsample_S8_2c_x2 }, + { AUDIO_S8, 2, 0, 4, SDL_Downsample_S8_2c_x4 }, + { AUDIO_S8, 2, 1, 4, SDL_Upsample_S8_2c_x4 }, + { AUDIO_S8, 4, 0, 2, SDL_Downsample_S8_4c_x2 }, + { AUDIO_S8, 4, 1, 2, SDL_Upsample_S8_4c_x2 }, + { AUDIO_S8, 4, 0, 4, SDL_Downsample_S8_4c_x4 }, + { AUDIO_S8, 4, 1, 4, SDL_Upsample_S8_4c_x4 }, + { AUDIO_S8, 6, 0, 2, SDL_Downsample_S8_6c_x2 }, + { AUDIO_S8, 6, 1, 2, SDL_Upsample_S8_6c_x2 }, + { AUDIO_S8, 6, 0, 4, SDL_Downsample_S8_6c_x4 }, + { AUDIO_S8, 6, 1, 4, SDL_Upsample_S8_6c_x4 }, + { AUDIO_S8, 8, 0, 2, SDL_Downsample_S8_8c_x2 }, + { AUDIO_S8, 8, 1, 2, SDL_Upsample_S8_8c_x2 }, + { AUDIO_S8, 8, 0, 4, SDL_Downsample_S8_8c_x4 }, + { AUDIO_S8, 8, 1, 4, SDL_Upsample_S8_8c_x4 }, + { AUDIO_U16LSB, 1, 0, 2, SDL_Downsample_U16LSB_1c_x2 }, + { AUDIO_U16LSB, 1, 1, 2, SDL_Upsample_U16LSB_1c_x2 }, + { AUDIO_U16LSB, 1, 0, 4, SDL_Downsample_U16LSB_1c_x4 }, + { AUDIO_U16LSB, 1, 1, 4, SDL_Upsample_U16LSB_1c_x4 }, + { AUDIO_U16LSB, 2, 0, 2, SDL_Downsample_U16LSB_2c_x2 }, + { AUDIO_U16LSB, 2, 1, 2, SDL_Upsample_U16LSB_2c_x2 }, + { AUDIO_U16LSB, 2, 0, 4, SDL_Downsample_U16LSB_2c_x4 }, + { AUDIO_U16LSB, 2, 1, 4, SDL_Upsample_U16LSB_2c_x4 }, + { AUDIO_U16LSB, 4, 0, 2, SDL_Downsample_U16LSB_4c_x2 }, + { AUDIO_U16LSB, 4, 1, 2, SDL_Upsample_U16LSB_4c_x2 }, + { AUDIO_U16LSB, 4, 0, 4, SDL_Downsample_U16LSB_4c_x4 }, + { AUDIO_U16LSB, 4, 1, 4, SDL_Upsample_U16LSB_4c_x4 }, + { AUDIO_U16LSB, 6, 0, 2, SDL_Downsample_U16LSB_6c_x2 }, + { AUDIO_U16LSB, 6, 1, 2, SDL_Upsample_U16LSB_6c_x2 }, + { AUDIO_U16LSB, 6, 0, 4, SDL_Downsample_U16LSB_6c_x4 }, + { AUDIO_U16LSB, 6, 1, 4, SDL_Upsample_U16LSB_6c_x4 }, + { AUDIO_U16LSB, 8, 0, 2, SDL_Downsample_U16LSB_8c_x2 }, + { AUDIO_U16LSB, 8, 1, 2, SDL_Upsample_U16LSB_8c_x2 }, + { AUDIO_U16LSB, 8, 0, 4, SDL_Downsample_U16LSB_8c_x4 }, + { AUDIO_U16LSB, 8, 1, 4, SDL_Upsample_U16LSB_8c_x4 }, + { AUDIO_S16LSB, 1, 0, 2, SDL_Downsample_S16LSB_1c_x2 }, + { AUDIO_S16LSB, 1, 1, 2, SDL_Upsample_S16LSB_1c_x2 }, + { AUDIO_S16LSB, 1, 0, 4, SDL_Downsample_S16LSB_1c_x4 }, + { AUDIO_S16LSB, 1, 1, 4, SDL_Upsample_S16LSB_1c_x4 }, + { AUDIO_S16LSB, 2, 0, 2, SDL_Downsample_S16LSB_2c_x2 }, + { AUDIO_S16LSB, 2, 1, 2, SDL_Upsample_S16LSB_2c_x2 }, + { AUDIO_S16LSB, 2, 0, 4, SDL_Downsample_S16LSB_2c_x4 }, + { AUDIO_S16LSB, 2, 1, 4, SDL_Upsample_S16LSB_2c_x4 }, + { AUDIO_S16LSB, 4, 0, 2, SDL_Downsample_S16LSB_4c_x2 }, + { AUDIO_S16LSB, 4, 1, 2, SDL_Upsample_S16LSB_4c_x2 }, + { AUDIO_S16LSB, 4, 0, 4, SDL_Downsample_S16LSB_4c_x4 }, + { AUDIO_S16LSB, 4, 1, 4, SDL_Upsample_S16LSB_4c_x4 }, + { AUDIO_S16LSB, 6, 0, 2, SDL_Downsample_S16LSB_6c_x2 }, + { AUDIO_S16LSB, 6, 1, 2, SDL_Upsample_S16LSB_6c_x2 }, + { AUDIO_S16LSB, 6, 0, 4, SDL_Downsample_S16LSB_6c_x4 }, + { AUDIO_S16LSB, 6, 1, 4, SDL_Upsample_S16LSB_6c_x4 }, + { AUDIO_S16LSB, 8, 0, 2, SDL_Downsample_S16LSB_8c_x2 }, + { AUDIO_S16LSB, 8, 1, 2, SDL_Upsample_S16LSB_8c_x2 }, + { AUDIO_S16LSB, 8, 0, 4, SDL_Downsample_S16LSB_8c_x4 }, + { AUDIO_S16LSB, 8, 1, 4, SDL_Upsample_S16LSB_8c_x4 }, + { AUDIO_U16MSB, 1, 0, 2, SDL_Downsample_U16MSB_1c_x2 }, + { AUDIO_U16MSB, 1, 1, 2, SDL_Upsample_U16MSB_1c_x2 }, + { AUDIO_U16MSB, 1, 0, 4, SDL_Downsample_U16MSB_1c_x4 }, + { AUDIO_U16MSB, 1, 1, 4, SDL_Upsample_U16MSB_1c_x4 }, + { AUDIO_U16MSB, 2, 0, 2, SDL_Downsample_U16MSB_2c_x2 }, + { AUDIO_U16MSB, 2, 1, 2, SDL_Upsample_U16MSB_2c_x2 }, + { AUDIO_U16MSB, 2, 0, 4, SDL_Downsample_U16MSB_2c_x4 }, + { AUDIO_U16MSB, 2, 1, 4, SDL_Upsample_U16MSB_2c_x4 }, + { AUDIO_U16MSB, 4, 0, 2, SDL_Downsample_U16MSB_4c_x2 }, + { AUDIO_U16MSB, 4, 1, 2, SDL_Upsample_U16MSB_4c_x2 }, + { AUDIO_U16MSB, 4, 0, 4, SDL_Downsample_U16MSB_4c_x4 }, + { AUDIO_U16MSB, 4, 1, 4, SDL_Upsample_U16MSB_4c_x4 }, + { AUDIO_U16MSB, 6, 0, 2, SDL_Downsample_U16MSB_6c_x2 }, + { AUDIO_U16MSB, 6, 1, 2, SDL_Upsample_U16MSB_6c_x2 }, + { AUDIO_U16MSB, 6, 0, 4, SDL_Downsample_U16MSB_6c_x4 }, + { AUDIO_U16MSB, 6, 1, 4, SDL_Upsample_U16MSB_6c_x4 }, + { AUDIO_U16MSB, 8, 0, 2, SDL_Downsample_U16MSB_8c_x2 }, + { AUDIO_U16MSB, 8, 1, 2, SDL_Upsample_U16MSB_8c_x2 }, + { AUDIO_U16MSB, 8, 0, 4, SDL_Downsample_U16MSB_8c_x4 }, + { AUDIO_U16MSB, 8, 1, 4, SDL_Upsample_U16MSB_8c_x4 }, + { AUDIO_S16MSB, 1, 0, 2, SDL_Downsample_S16MSB_1c_x2 }, + { AUDIO_S16MSB, 1, 1, 2, SDL_Upsample_S16MSB_1c_x2 }, + { AUDIO_S16MSB, 1, 0, 4, SDL_Downsample_S16MSB_1c_x4 }, + { AUDIO_S16MSB, 1, 1, 4, SDL_Upsample_S16MSB_1c_x4 }, + { AUDIO_S16MSB, 2, 0, 2, SDL_Downsample_S16MSB_2c_x2 }, + { AUDIO_S16MSB, 2, 1, 2, SDL_Upsample_S16MSB_2c_x2 }, + { AUDIO_S16MSB, 2, 0, 4, SDL_Downsample_S16MSB_2c_x4 }, + { AUDIO_S16MSB, 2, 1, 4, SDL_Upsample_S16MSB_2c_x4 }, + { AUDIO_S16MSB, 4, 0, 2, SDL_Downsample_S16MSB_4c_x2 }, + { AUDIO_S16MSB, 4, 1, 2, SDL_Upsample_S16MSB_4c_x2 }, + { AUDIO_S16MSB, 4, 0, 4, SDL_Downsample_S16MSB_4c_x4 }, + { AUDIO_S16MSB, 4, 1, 4, SDL_Upsample_S16MSB_4c_x4 }, + { AUDIO_S16MSB, 6, 0, 2, SDL_Downsample_S16MSB_6c_x2 }, + { AUDIO_S16MSB, 6, 1, 2, SDL_Upsample_S16MSB_6c_x2 }, + { AUDIO_S16MSB, 6, 0, 4, SDL_Downsample_S16MSB_6c_x4 }, + { AUDIO_S16MSB, 6, 1, 4, SDL_Upsample_S16MSB_6c_x4 }, + { AUDIO_S16MSB, 8, 0, 2, SDL_Downsample_S16MSB_8c_x2 }, + { AUDIO_S16MSB, 8, 1, 2, SDL_Upsample_S16MSB_8c_x2 }, + { AUDIO_S16MSB, 8, 0, 4, SDL_Downsample_S16MSB_8c_x4 }, + { AUDIO_S16MSB, 8, 1, 4, SDL_Upsample_S16MSB_8c_x4 }, + { AUDIO_S32LSB, 1, 0, 2, SDL_Downsample_S32LSB_1c_x2 }, + { AUDIO_S32LSB, 1, 1, 2, SDL_Upsample_S32LSB_1c_x2 }, + { AUDIO_S32LSB, 1, 0, 4, SDL_Downsample_S32LSB_1c_x4 }, + { AUDIO_S32LSB, 1, 1, 4, SDL_Upsample_S32LSB_1c_x4 }, + { AUDIO_S32LSB, 2, 0, 2, SDL_Downsample_S32LSB_2c_x2 }, + { AUDIO_S32LSB, 2, 1, 2, SDL_Upsample_S32LSB_2c_x2 }, + { AUDIO_S32LSB, 2, 0, 4, SDL_Downsample_S32LSB_2c_x4 }, + { AUDIO_S32LSB, 2, 1, 4, SDL_Upsample_S32LSB_2c_x4 }, + { AUDIO_S32LSB, 4, 0, 2, SDL_Downsample_S32LSB_4c_x2 }, + { AUDIO_S32LSB, 4, 1, 2, SDL_Upsample_S32LSB_4c_x2 }, + { AUDIO_S32LSB, 4, 0, 4, SDL_Downsample_S32LSB_4c_x4 }, + { AUDIO_S32LSB, 4, 1, 4, SDL_Upsample_S32LSB_4c_x4 }, + { AUDIO_S32LSB, 6, 0, 2, SDL_Downsample_S32LSB_6c_x2 }, + { AUDIO_S32LSB, 6, 1, 2, SDL_Upsample_S32LSB_6c_x2 }, + { AUDIO_S32LSB, 6, 0, 4, SDL_Downsample_S32LSB_6c_x4 }, + { AUDIO_S32LSB, 6, 1, 4, SDL_Upsample_S32LSB_6c_x4 }, + { AUDIO_S32LSB, 8, 0, 2, SDL_Downsample_S32LSB_8c_x2 }, + { AUDIO_S32LSB, 8, 1, 2, SDL_Upsample_S32LSB_8c_x2 }, + { AUDIO_S32LSB, 8, 0, 4, SDL_Downsample_S32LSB_8c_x4 }, + { AUDIO_S32LSB, 8, 1, 4, SDL_Upsample_S32LSB_8c_x4 }, + { AUDIO_S32MSB, 1, 0, 2, SDL_Downsample_S32MSB_1c_x2 }, + { AUDIO_S32MSB, 1, 1, 2, SDL_Upsample_S32MSB_1c_x2 }, + { AUDIO_S32MSB, 1, 0, 4, SDL_Downsample_S32MSB_1c_x4 }, + { AUDIO_S32MSB, 1, 1, 4, SDL_Upsample_S32MSB_1c_x4 }, + { AUDIO_S32MSB, 2, 0, 2, SDL_Downsample_S32MSB_2c_x2 }, + { AUDIO_S32MSB, 2, 1, 2, SDL_Upsample_S32MSB_2c_x2 }, + { AUDIO_S32MSB, 2, 0, 4, SDL_Downsample_S32MSB_2c_x4 }, + { AUDIO_S32MSB, 2, 1, 4, SDL_Upsample_S32MSB_2c_x4 }, + { AUDIO_S32MSB, 4, 0, 2, SDL_Downsample_S32MSB_4c_x2 }, + { AUDIO_S32MSB, 4, 1, 2, SDL_Upsample_S32MSB_4c_x2 }, + { AUDIO_S32MSB, 4, 0, 4, SDL_Downsample_S32MSB_4c_x4 }, + { AUDIO_S32MSB, 4, 1, 4, SDL_Upsample_S32MSB_4c_x4 }, + { AUDIO_S32MSB, 6, 0, 2, SDL_Downsample_S32MSB_6c_x2 }, + { AUDIO_S32MSB, 6, 1, 2, SDL_Upsample_S32MSB_6c_x2 }, + { AUDIO_S32MSB, 6, 0, 4, SDL_Downsample_S32MSB_6c_x4 }, + { AUDIO_S32MSB, 6, 1, 4, SDL_Upsample_S32MSB_6c_x4 }, + { AUDIO_S32MSB, 8, 0, 2, SDL_Downsample_S32MSB_8c_x2 }, + { AUDIO_S32MSB, 8, 1, 2, SDL_Upsample_S32MSB_8c_x2 }, + { AUDIO_S32MSB, 8, 0, 4, SDL_Downsample_S32MSB_8c_x4 }, + { AUDIO_S32MSB, 8, 1, 4, SDL_Upsample_S32MSB_8c_x4 }, + { AUDIO_F32LSB, 1, 0, 2, SDL_Downsample_F32LSB_1c_x2 }, + { AUDIO_F32LSB, 1, 1, 2, SDL_Upsample_F32LSB_1c_x2 }, + { AUDIO_F32LSB, 1, 0, 4, SDL_Downsample_F32LSB_1c_x4 }, + { AUDIO_F32LSB, 1, 1, 4, SDL_Upsample_F32LSB_1c_x4 }, + { AUDIO_F32LSB, 2, 0, 2, SDL_Downsample_F32LSB_2c_x2 }, + { AUDIO_F32LSB, 2, 1, 2, SDL_Upsample_F32LSB_2c_x2 }, + { AUDIO_F32LSB, 2, 0, 4, SDL_Downsample_F32LSB_2c_x4 }, + { AUDIO_F32LSB, 2, 1, 4, SDL_Upsample_F32LSB_2c_x4 }, + { AUDIO_F32LSB, 4, 0, 2, SDL_Downsample_F32LSB_4c_x2 }, + { AUDIO_F32LSB, 4, 1, 2, SDL_Upsample_F32LSB_4c_x2 }, + { AUDIO_F32LSB, 4, 0, 4, SDL_Downsample_F32LSB_4c_x4 }, + { AUDIO_F32LSB, 4, 1, 4, SDL_Upsample_F32LSB_4c_x4 }, + { AUDIO_F32LSB, 6, 0, 2, SDL_Downsample_F32LSB_6c_x2 }, + { AUDIO_F32LSB, 6, 1, 2, SDL_Upsample_F32LSB_6c_x2 }, + { AUDIO_F32LSB, 6, 0, 4, SDL_Downsample_F32LSB_6c_x4 }, + { AUDIO_F32LSB, 6, 1, 4, SDL_Upsample_F32LSB_6c_x4 }, + { AUDIO_F32LSB, 8, 0, 2, SDL_Downsample_F32LSB_8c_x2 }, + { AUDIO_F32LSB, 8, 1, 2, SDL_Upsample_F32LSB_8c_x2 }, + { AUDIO_F32LSB, 8, 0, 4, SDL_Downsample_F32LSB_8c_x4 }, + { AUDIO_F32LSB, 8, 1, 4, SDL_Upsample_F32LSB_8c_x4 }, + { AUDIO_F32MSB, 1, 0, 2, SDL_Downsample_F32MSB_1c_x2 }, + { AUDIO_F32MSB, 1, 1, 2, SDL_Upsample_F32MSB_1c_x2 }, + { AUDIO_F32MSB, 1, 0, 4, SDL_Downsample_F32MSB_1c_x4 }, + { AUDIO_F32MSB, 1, 1, 4, SDL_Upsample_F32MSB_1c_x4 }, + { AUDIO_F32MSB, 2, 0, 2, SDL_Downsample_F32MSB_2c_x2 }, + { AUDIO_F32MSB, 2, 1, 2, SDL_Upsample_F32MSB_2c_x2 }, + { AUDIO_F32MSB, 2, 0, 4, SDL_Downsample_F32MSB_2c_x4 }, + { AUDIO_F32MSB, 2, 1, 4, SDL_Upsample_F32MSB_2c_x4 }, + { AUDIO_F32MSB, 4, 0, 2, SDL_Downsample_F32MSB_4c_x2 }, + { AUDIO_F32MSB, 4, 1, 2, SDL_Upsample_F32MSB_4c_x2 }, + { AUDIO_F32MSB, 4, 0, 4, SDL_Downsample_F32MSB_4c_x4 }, + { AUDIO_F32MSB, 4, 1, 4, SDL_Upsample_F32MSB_4c_x4 }, + { AUDIO_F32MSB, 6, 0, 2, SDL_Downsample_F32MSB_6c_x2 }, + { AUDIO_F32MSB, 6, 1, 2, SDL_Upsample_F32MSB_6c_x2 }, + { AUDIO_F32MSB, 6, 0, 4, SDL_Downsample_F32MSB_6c_x4 }, + { AUDIO_F32MSB, 6, 1, 4, SDL_Upsample_F32MSB_6c_x4 }, + { AUDIO_F32MSB, 8, 0, 2, SDL_Downsample_F32MSB_8c_x2 }, + { AUDIO_F32MSB, 8, 1, 2, SDL_Upsample_F32MSB_8c_x2 }, + { AUDIO_F32MSB, 8, 0, 4, SDL_Downsample_F32MSB_8c_x4 }, + { AUDIO_F32MSB, 8, 1, 4, SDL_Upsample_F32MSB_8c_x4 }, +#endif /* !LESS_RESAMPLERS */ +#endif /* !NO_RESAMPLERS */ + { 0, 0, 0, 0, NULL } +}; + +/* 390 converters generated. */ + +/* *INDENT-ON* */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_mixer.c b/src/audio/SDL_mixer.c index b5d4d8bf80..37907596f1 100644 --- a/src/audio/SDL_mixer.c +++ b/src/audio/SDL_mixer.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -27,238 +26,296 @@ #include "SDL_timer.h" #include "SDL_audio.h" #include "SDL_sysaudio.h" -#include "SDL_mixer_MMX.h" -#include "SDL_mixer_MMX_VC.h" -#include "SDL_mixer_m68k.h" /* This table is used to add two sound values together and pin * the value to avoid overflow. (used with permission from ARDI) * Changed to use 0xFE instead of 0xFF for better sound quality. */ -static const Uint8 mix8[] = -{ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, - 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, - 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, - 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, - 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, - 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, - 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, - 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, - 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, - 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, - 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, - 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, - 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, - 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, - 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, - 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, - 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, - 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, - 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, - 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, - 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, - 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE +static const Uint8 mix8[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, + 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, + 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, + 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, + 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, + 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, + 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, + 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, + 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, + 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, + 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, + 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, + 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, + 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, + 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, + 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, + 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, + 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, + 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, + 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE }; /* The volume ranges from 0 - 128 */ -#define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME) -#define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128) +#define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME) +#define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128) + -void SDL_MixAudio (Uint8 *dst, const Uint8 *src, Uint32 len, int volume) +void +SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, + Uint32 len, int volume) { - Uint16 format; + if (volume == 0) { + return; + } - if ( volume == 0 ) { - return; - } - /* Mix the user-level audio format */ - if ( current_audio ) { - if ( current_audio->convert.needed ) { - format = current_audio->convert.src_format; - } else { - format = current_audio->spec.format; - } - } else { - /* HACK HACK HACK */ - format = AUDIO_S16; - } - switch (format) { + switch (format) { - case AUDIO_U8: { -#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES) - SDL_MixAudio_m68k_U8((char*)dst,(char*)src,(unsigned long)len,(long)volume,(char *)mix8); + case AUDIO_U8: + { +#if defined(__GNUC__) && defined(__M68000__) && !defined(__mcoldfire__) && defined(SDL_ASSEMBLY_ROUTINES) + SDL_MixAudio_m68k_U8((char *) dst, (char *) src, + (unsigned long) len, (long) volume, + (char *) mix8); #else - Uint8 src_sample; + Uint8 src_sample; - while ( len-- ) { - src_sample = *src; - ADJUST_VOLUME_U8(src_sample, volume); - *dst = mix8[*dst+src_sample]; - ++dst; - ++src; - } + while (len--) { + src_sample = *src; + ADJUST_VOLUME_U8(src_sample, volume); + *dst = mix8[*dst + src_sample]; + ++dst; + ++src; + } #endif - } - break; + } + break; - case AUDIO_S8: { -#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */ -#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) - if (SDL_HasMMX()) - { - SDL_MixAudio_MMX_S8((char*)dst,(char*)src,(unsigned int)len,(int)volume); - } - else -#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) - if (SDL_HasMMX()) - { - SDL_MixAudio_MMX_S8_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume); - } - else -#endif -#endif + case AUDIO_S8: + { + Sint8 *dst8, *src8; + Sint8 src_sample; + int dst_sample; + const int max_audioval = ((1 << (8 - 1)) - 1); + const int min_audioval = -(1 << (8 - 1)); -#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES) - SDL_MixAudio_m68k_S8((char*)dst,(char*)src,(unsigned long)len,(long)volume); -#else - { - Sint8 *dst8, *src8; - Sint8 src_sample; - int dst_sample; - const int max_audioval = ((1<<(8-1))-1); - const int min_audioval = -(1<<(8-1)); + src8 = (Sint8 *) src; + dst8 = (Sint8 *) dst; + while (len--) { + src_sample = *src8; + ADJUST_VOLUME(src_sample, volume); + dst_sample = *dst8 + src_sample; + if (dst_sample > max_audioval) { + *dst8 = max_audioval; + } else if (dst_sample < min_audioval) { + *dst8 = min_audioval; + } else { + *dst8 = dst_sample; + } + ++dst8; + ++src8; + } + } + break; - src8 = (Sint8 *)src; - dst8 = (Sint8 *)dst; - while ( len-- ) { - src_sample = *src8; - ADJUST_VOLUME(src_sample, volume); - dst_sample = *dst8 + src_sample; - if ( dst_sample > max_audioval ) { - *dst8 = max_audioval; - } else - if ( dst_sample < min_audioval ) { - *dst8 = min_audioval; - } else { - *dst8 = dst_sample; - } - ++dst8; - ++src8; - } - } -#endif - } - break; + case AUDIO_S16LSB: + { + Sint16 src1, src2; + int dst_sample; + const int max_audioval = ((1 << (16 - 1)) - 1); + const int min_audioval = -(1 << (16 - 1)); - case AUDIO_S16LSB: { -#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */ -#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) - if (SDL_HasMMX()) - { - SDL_MixAudio_MMX_S16((char*)dst,(char*)src,(unsigned int)len,(int)volume); - } - else -#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) - if (SDL_HasMMX()) - { - SDL_MixAudio_MMX_S16_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume); - } - else -#endif -#endif + len /= 2; + while (len--) { + src1 = ((src[1]) << 8 | src[0]); + ADJUST_VOLUME(src1, volume); + src2 = ((dst[1]) << 8 | dst[0]); + src += 2; + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + dst[0] = dst_sample & 0xFF; + dst_sample >>= 8; + dst[1] = dst_sample & 0xFF; + dst += 2; + } + } + break; -#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES) - SDL_MixAudio_m68k_S16LSB((short*)dst,(short*)src,(unsigned long)len,(long)volume); + case AUDIO_S16MSB: + { +#if defined(__GNUC__) && defined(__M68000__) && !defined(__mcoldfire__) && defined(SDL_ASSEMBLY_ROUTINES) + SDL_MixAudio_m68k_S16MSB((short *) dst, (short *) src, + (unsigned long) len, (long) volume); #else - { - Sint16 src1, src2; - int dst_sample; - const int max_audioval = ((1<<(16-1))-1); - const int min_audioval = -(1<<(16-1)); + Sint16 src1, src2; + int dst_sample; + const int max_audioval = ((1 << (16 - 1)) - 1); + const int min_audioval = -(1 << (16 - 1)); - len /= 2; - while ( len-- ) { - src1 = ((src[1])<<8|src[0]); - ADJUST_VOLUME(src1, volume); - src2 = ((dst[1])<<8|dst[0]); - src += 2; - dst_sample = src1+src2; - if ( dst_sample > max_audioval ) { - dst_sample = max_audioval; - } else - if ( dst_sample < min_audioval ) { - dst_sample = min_audioval; - } - dst[0] = dst_sample&0xFF; - dst_sample >>= 8; - dst[1] = dst_sample&0xFF; - dst += 2; - } - } + len /= 2; + while (len--) { + src1 = ((src[0]) << 8 | src[1]); + ADJUST_VOLUME(src1, volume); + src2 = ((dst[0]) << 8 | dst[1]); + src += 2; + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + dst[1] = dst_sample & 0xFF; + dst_sample >>= 8; + dst[0] = dst_sample & 0xFF; + dst += 2; + } #endif - } - break; + } + break; - case AUDIO_S16MSB: { -#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES) - SDL_MixAudio_m68k_S16MSB((short*)dst,(short*)src,(unsigned long)len,(long)volume); -#else - Sint16 src1, src2; - int dst_sample; - const int max_audioval = ((1<<(16-1))-1); - const int min_audioval = -(1<<(16-1)); + case AUDIO_S32LSB: + { + const Uint32 *src32 = (Uint32 *) src; + Uint32 *dst32 = (Uint32 *) dst; + Sint64 src1, src2; + Sint64 dst_sample; + const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1); + const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1)); - len /= 2; - while ( len-- ) { - src1 = ((src[0])<<8|src[1]); - ADJUST_VOLUME(src1, volume); - src2 = ((dst[0])<<8|dst[1]); - src += 2; - dst_sample = src1+src2; - if ( dst_sample > max_audioval ) { - dst_sample = max_audioval; - } else - if ( dst_sample < min_audioval ) { - dst_sample = min_audioval; - } - dst[1] = dst_sample&0xFF; - dst_sample >>= 8; - dst[0] = dst_sample&0xFF; - dst += 2; - } -#endif - } - break; + len /= 4; + while (len--) { + src1 = (Sint64) ((Sint32) SDL_SwapLE32(*src32)); + src32++; + ADJUST_VOLUME(src1, volume); + src2 = (Sint64) ((Sint32) SDL_SwapLE32(*dst32)); + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapLE32((Uint32) ((Sint32) dst_sample)); + } + } + break; + + case AUDIO_S32MSB: + { + const Uint32 *src32 = (Uint32 *) src; + Uint32 *dst32 = (Uint32 *) dst; + Sint64 src1, src2; + Sint64 dst_sample; + const Sint64 max_audioval = ((((Sint64) 1) << (32 - 1)) - 1); + const Sint64 min_audioval = -(((Sint64) 1) << (32 - 1)); + + len /= 4; + while (len--) { + src1 = (Sint64) ((Sint32) SDL_SwapBE32(*src32)); + src32++; + ADJUST_VOLUME(src1, volume); + src2 = (Sint64) ((Sint32) SDL_SwapBE32(*dst32)); + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapBE32((Uint32) ((Sint32) dst_sample)); + } + } + break; + + case AUDIO_F32LSB: + { + const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME); + const float fvolume = (float) volume; + const float *src32 = (float *) src; + float *dst32 = (float *) dst; + float src1, src2; + double dst_sample; + /* !!! FIXME: are these right? */ + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; + + len /= 4; + while (len--) { + src1 = ((SDL_SwapFloatLE(*src32) * fvolume) * fmaxvolume); + src2 = SDL_SwapFloatLE(*dst32); + src32++; + + dst_sample = ((double) src1) + ((double) src2); + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapFloatLE((float) dst_sample); + } + } + break; + + case AUDIO_F32MSB: + { + const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME); + const float fvolume = (float) volume; + const float *src32 = (float *) src; + float *dst32 = (float *) dst; + float src1, src2; + double dst_sample; + /* !!! FIXME: are these right? */ + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; + + len /= 4; + while (len--) { + src1 = ((SDL_SwapFloatBE(*src32) * fvolume) * fmaxvolume); + src2 = SDL_SwapFloatBE(*dst32); + src32++; + + dst_sample = ((double) src1) + ((double) src2); + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; + } + *(dst32++) = SDL_SwapFloatBE((float) dst_sample); + } + } + break; - default: /* If this happens... FIXME! */ - SDL_SetError("SDL_MixAudio(): unknown audio format"); - return; - } + default: /* If this happens... FIXME! */ + SDL_SetError("SDL_MixAudio(): unknown audio format"); + return; + } } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_mixer_MMX.c b/src/audio/SDL_mixer_MMX.c deleted file mode 100644 index a2f1d8dfce..0000000000 --- a/src/audio/SDL_mixer_MMX.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples - Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) - This code is licensed under the LGPL (see COPYING for details) - - Assumes buffer size in bytes is a multiple of 16 - Assumes SDL_MIX_MAXVOLUME = 128 -*/ - - -/*********************************************** -* Mixing for 16 bit signed buffers -***********************************************/ - -#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */ -#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) -void SDL_MixAudio_MMX_S16(char* dst,char* src,unsigned int size,int volume) -{ - __asm__ __volatile__ ( - -" movl %3,%%eax\n" /* eax = volume */ - -" movl %2,%%edx\n" /* edx = size */ - -" shrl $4,%%edx\n" /* process 16 bytes per iteration = 8 samples */ - -" jz .endS16\n" - -" pxor %%mm0,%%mm0\n" - -" movd %%eax,%%mm0\n" -" movq %%mm0,%%mm1\n" -" psllq $16,%%mm0\n" -" por %%mm1,%%mm0\n" -" psllq $16,%%mm0\n" -" por %%mm1,%%mm0\n" -" psllq $16,%%mm0\n" -" por %%mm1,%%mm0\n" /* mm0 = vol|vol|vol|vol */ - -".align 8\n" -" .mixloopS16:\n" - -" movq (%1),%%mm1\n" /* mm1 = a|b|c|d */ - -" movq %%mm1,%%mm2\n" /* mm2 = a|b|c|d */ - -" movq 8(%1),%%mm4\n" /* mm4 = e|f|g|h */ - - /* pré charger le buffer dst dans mm7 */ -" movq (%0),%%mm7\n" /* mm7 = dst[0] */ - - /* multiplier par le volume */ -" pmullw %%mm0,%%mm1\n" /* mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */ - -" pmulhw %%mm0,%%mm2\n" /* mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v) */ -" movq %%mm4,%%mm5\n" /* mm5 = e|f|g|h */ - -" pmullw %%mm0,%%mm4\n" /* mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */ - -" pmulhw %%mm0,%%mm5\n" /* mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v) */ -" movq %%mm1,%%mm3\n" /* mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */ - -" punpckhwd %%mm2,%%mm1\n" /* mm1 = a*v|b*v */ - -" movq %%mm4,%%mm6\n" /* mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */ -" punpcklwd %%mm2,%%mm3\n" /* mm3 = c*v|d*v */ - -" punpckhwd %%mm5,%%mm4\n" /* mm4 = e*f|f*v */ - -" punpcklwd %%mm5,%%mm6\n" /* mm6 = g*v|h*v */ - - /* pré charger le buffer dst dans mm5 */ -" movq 8(%0),%%mm5\n" /* mm5 = dst[1] */ - - /* diviser par 128 */ -" psrad $7,%%mm1\n" /* mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME */ -" add $16,%1\n" - -" psrad $7,%%mm3\n" /* mm3 = c*v/128|d*v/128 */ - -" psrad $7,%%mm4\n" /* mm4 = e*v/128|f*v/128 */ - - /* mm1 = le sample avec le volume modifié */ -" packssdw %%mm1,%%mm3\n" /* mm3 = s(a*v|b*v|c*v|d*v) */ - -" psrad $7,%%mm6\n" /* mm6= g*v/128|h*v/128 */ -" paddsw %%mm7,%%mm3\n" /* mm3 = adjust_volume(src)+dst */ - - /* mm4 = le sample avec le volume modifié */ -" packssdw %%mm4,%%mm6\n" /* mm6 = s(e*v|f*v|g*v|h*v) */ -" movq %%mm3,(%0)\n" - -" paddsw %%mm5,%%mm6\n" /* mm6 = adjust_volume(src)+dst */ - -" movq %%mm6,8(%0)\n" - -" add $16,%0\n" - -" dec %%edx\n" - -" jnz .mixloopS16\n" - -" emms\n" - -".endS16:\n" - : - : "r" (dst), "r"(src),"m"(size), - "m"(volume) - : "eax","edx","memory" - ); -} - - - -/*////////////////////////////////////////////// */ -/* Mixing for 8 bit signed buffers */ -/*////////////////////////////////////////////// */ - -void SDL_MixAudio_MMX_S8(char* dst,char* src,unsigned int size,int volume) -{ - __asm__ __volatile__ ( - -" movl %3,%%eax\n" /* eax = volume */ - -" movd %%eax,%%mm0\n" -" movq %%mm0,%%mm1\n" -" psllq $16,%%mm0\n" -" por %%mm1,%%mm0\n" -" psllq $16,%%mm0\n" -" por %%mm1,%%mm0\n" -" psllq $16,%%mm0\n" -" por %%mm1,%%mm0\n" - -" movl %2,%%edx\n" /* edx = size */ -" shr $3,%%edx\n" /* process 8 bytes per iteration = 8 samples */ - -" cmp $0,%%edx\n" -" je .endS8\n" - -".align 8\n" -" .mixloopS8:\n" - -" pxor %%mm2,%%mm2\n" /* mm2 = 0 */ -" movq (%1),%%mm1\n" /* mm1 = a|b|c|d|e|f|g|h */ - -" movq %%mm1,%%mm3\n" /* mm3 = a|b|c|d|e|f|g|h */ - - /* on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0 */ -" pcmpgtb %%mm1,%%mm2\n" /* mm2 = 11111111|00000000|00000000.... */ - -" punpckhbw %%mm2,%%mm1\n" /* mm1 = 0|a|0|b|0|c|0|d */ - -" punpcklbw %%mm2,%%mm3\n" /* mm3 = 0|e|0|f|0|g|0|h */ -" movq (%0),%%mm2\n" /* mm2 = destination */ - -" pmullw %%mm0,%%mm1\n" /* mm1 = v*a|v*b|v*c|v*d */ -" add $8,%1\n" - -" pmullw %%mm0,%%mm3\n" /* mm3 = v*e|v*f|v*g|v*h */ -" psraw $7,%%mm1\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128 */ - -" psraw $7,%%mm3\n" /* mm3 = v*e/128|v*f/128|v*g/128|v*h/128 */ - -" packsswb %%mm1,%%mm3\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128 */ - -" paddsb %%mm2,%%mm3\n" /* add to destination buffer */ - -" movq %%mm3,(%0)\n" /* store back to ram */ -" add $8,%0\n" - -" dec %%edx\n" - -" jnz .mixloopS8\n" - -".endS8:\n" -" emms\n" - : - : "r" (dst), "r"(src),"m"(size), - "m"(volume) - : "eax","edx","memory" - ); -} -#endif -#endif diff --git a/src/audio/SDL_mixer_MMX.h b/src/audio/SDL_mixer_MMX.h deleted file mode 100644 index 836b259592..0000000000 --- a/src/audio/SDL_mixer_MMX.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - headers for MMX assembler version of SDL_MixAudio - Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) - This code is licensed under the LGPL (see COPYING for details) - - Assumes buffer size in bytes is a multiple of 16 - Assumes SDL_MIX_MAXVOLUME = 128 -*/ -#include "SDL_config.h" - -#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */ -#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES) -void SDL_MixAudio_MMX_S16(char* ,char* ,unsigned int ,int ); -void SDL_MixAudio_MMX_S8(char* ,char* ,unsigned int ,int ); -#endif -#endif - diff --git a/src/audio/SDL_mixer_MMX_VC.c b/src/audio/SDL_mixer_MMX_VC.c deleted file mode 100644 index cd0aa4ccd4..0000000000 --- a/src/audio/SDL_mixer_MMX_VC.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include "SDL_mixer_MMX_VC.h" - -#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */ -#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) -// MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples -// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) -// Converted to Intel ASM notation by Cth -// This code is licensed under the LGPL (see COPYING for details) -// -// Assumes buffer size in bytes is a multiple of 16 -// Assumes SDL_MIX_MAXVOLUME = 128 - - -//////////////////////////////////////////////// -// Mixing for 16 bit signed buffers -//////////////////////////////////////////////// - -void SDL_MixAudio_MMX_S16_VC(char* dst,char* src,unsigned int nSize,int volume) -{ - __asm - { - - push edi - push esi - push ebx - - mov edi, dst // edi = dst - mov esi, src // esi = src - mov eax, volume // eax = volume - mov ebx, nSize // ebx = size - shr ebx, 4 // process 16 bytes per iteration = 8 samples - jz endS16 - - pxor mm0, mm0 - movd mm0, eax //%%eax,%%mm0 - movq mm1, mm0 //%%mm0,%%mm1 - psllq mm0, 16 //$16,%%mm0 - por mm0, mm1 //%%mm1,%%mm0 - psllq mm0, 16 //$16,%%mm0 - por mm0, mm1 //%%mm1,%%mm0 - psllq mm0, 16 //$16,%%mm0 - por mm0, mm1 //%%mm1,%%mm0 // mm0 = vol|vol|vol|vol - - #ifndef __WATCOMC__ - align 16 - #endif -mixloopS16: - movq mm1, [esi] //(%%esi),%%mm1\n" // mm1 = a|b|c|d - movq mm2, mm1 //%%mm1,%%mm2\n" // mm2 = a|b|c|d - movq mm4, [esi + 8] //8(%%esi),%%mm4\n" // mm4 = e|f|g|h - // pre charger le buffer dst dans mm7 - movq mm7, [edi] //(%%edi),%%mm7\n" // mm7 = dst[0]" - // multiplier par le volume - pmullw mm1, mm0 //%%mm0,%%mm1\n" // mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v) - pmulhw mm2, mm0 //%%mm0,%%mm2\n" // mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v) - movq mm5, mm4 //%%mm4,%%mm5\n" // mm5 = e|f|g|h - pmullw mm4, mm0 //%%mm0,%%mm4\n" // mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v) - pmulhw mm5, mm0 //%%mm0,%%mm5\n" // mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v) - movq mm3, mm1 //%%mm1,%%mm3\n" // mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v) - punpckhwd mm1, mm2 //%%mm2,%%mm1\n" // mm1 = a*v|b*v - movq mm6, mm4 //%%mm4,%%mm6\n" // mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v) - punpcklwd mm3, mm2 //%%mm2,%%mm3\n" // mm3 = c*v|d*v - punpckhwd mm4, mm5 //%%mm5,%%mm4\n" // mm4 = e*f|f*v - punpcklwd mm6, mm5 //%%mm5,%%mm6\n" // mm6 = g*v|h*v - // pre charger le buffer dst dans mm5 - movq mm5, [edi + 8] //8(%%edi),%%mm5\n" // mm5 = dst[1] - // diviser par 128 - psrad mm1, 7 //$7,%%mm1\n" // mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME - add esi, 16 //$16,%%esi\n" - psrad mm3, 7 //$7,%%mm3\n" // mm3 = c*v/128|d*v/128 - psrad mm4, 7 //$7,%%mm4\n" // mm4 = e*v/128|f*v/128 - // mm1 = le sample avec le volume modifie - packssdw mm3, mm1 //%%mm1,%%mm3\n" // mm3 = s(a*v|b*v|c*v|d*v) - psrad mm6, 7 //$7,%%mm6\n" // mm6= g*v/128|h*v/128 - paddsw mm3, mm7 //%%mm7,%%mm3\n" // mm3 = adjust_volume(src)+dst - // mm4 = le sample avec le volume modifie - packssdw mm6, mm4 //%%mm4,%%mm6\n" // mm6 = s(e*v|f*v|g*v|h*v) - movq [edi], mm3 //%%mm3,(%%edi)\n" - paddsw mm6, mm5 //%%mm5,%%mm6\n" // mm6 = adjust_volume(src)+dst - movq [edi + 8], mm6 //%%mm6,8(%%edi)\n" - add edi, 16 //$16,%%edi\n" - dec ebx //%%ebx\n" - jnz mixloopS16 - -endS16: - emms - - pop ebx - pop esi - pop edi - } - -} - -//////////////////////////////////////////////// -// Mixing for 8 bit signed buffers -//////////////////////////////////////////////// - -void SDL_MixAudio_MMX_S8_VC(char* dst,char* src,unsigned int nSize,int volume) -{ - _asm - { - - push edi - push esi - push ebx - - mov edi, dst //movl %0,%%edi // edi = dst - mov esi, src //%1,%%esi // esi = src - mov eax, volume //%3,%%eax // eax = volume - - movd mm0, eax //%%eax,%%mm0 - movq mm1, mm0 //%%mm0,%%mm1 - psllq mm0, 16 //$16,%%mm0 - por mm0, mm1 //%%mm1,%%mm0 - psllq mm0, 16 //$16,%%mm0 - por mm0, mm1 //%%mm1,%%mm0 - psllq mm0, 16 //$16,%%mm0 - por mm0, mm1 //%%mm1,%%mm0 - - mov ebx, nSize //%2,%%ebx // ebx = size - shr ebx, 3 //$3,%%ebx // process 8 bytes per iteration = 8 samples - cmp ebx, 0 //$0,%%ebx - je endS8 - - #ifndef __WATCOMC__ - align 16 - #endif -mixloopS8: - pxor mm2, mm2 //%%mm2,%%mm2 // mm2 = 0 - movq mm1, [esi] //(%%esi),%%mm1 // mm1 = a|b|c|d|e|f|g|h - movq mm3, mm1 //%%mm1,%%mm3 // mm3 = a|b|c|d|e|f|g|h - // on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0 - pcmpgtb mm2, mm1 //%%mm1,%%mm2 // mm2 = 11111111|00000000|00000000.... - punpckhbw mm1, mm2 //%%mm2,%%mm1 // mm1 = 0|a|0|b|0|c|0|d - punpcklbw mm3, mm2 //%%mm2,%%mm3 // mm3 = 0|e|0|f|0|g|0|h - movq mm2, [edi] //(%%edi),%%mm2 // mm2 = destination - pmullw mm1, mm0 //%%mm0,%%mm1 // mm1 = v*a|v*b|v*c|v*d - add esi, 8 //$8,%%esi - pmullw mm3, mm0 //%%mm0,%%mm3 // mm3 = v*e|v*f|v*g|v*h - psraw mm1, 7 //$7,%%mm1 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128 - psraw mm3, 7 //$7,%%mm3 // mm3 = v*e/128|v*f/128|v*g/128|v*h/128 - packsswb mm3, mm1 //%%mm1,%%mm3 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128 - paddsb mm3, mm2 //%%mm2,%%mm3 // add to destination buffer - movq [edi], mm3 //%%mm3,(%%edi) // store back to ram - add edi, 8 //$8,%%edi - dec ebx //%%ebx - jnz mixloopS8 - -endS8: - emms - - pop ebx - pop esi - pop edi - } -} - -#endif /* SDL_ASSEMBLY_ROUTINES */ -#endif /* SDL_BUGGY_MMX_MIXERS */ diff --git a/src/audio/SDL_mixer_MMX_VC.h b/src/audio/SDL_mixer_MMX_VC.h deleted file mode 100644 index fbd0eb8183..0000000000 --- a/src/audio/SDL_mixer_MMX_VC.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - - -#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */ -#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES) -/* headers for MMX assembler version of SDL_MixAudio - Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr) - Converted to Intel ASM notation by Cth - This code is licensed under the LGPL (see COPYING for details) - - Assumes buffer size in bytes is a multiple of 16 - Assumes SDL_MIX_MAXVOLUME = 128 -*/ -void SDL_MixAudio_MMX_S16_VC(char* ,char* ,unsigned int ,int ); -void SDL_MixAudio_MMX_S8_VC(char* ,char* ,unsigned int ,int ); -#endif -#endif diff --git a/src/audio/SDL_mixer_m68k.c b/src/audio/SDL_mixer_m68k.c deleted file mode 100644 index 22bb1cb81d..0000000000 --- a/src/audio/SDL_mixer_m68k.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - m68k assembly mix routines - - Patrice Mandin -*/ - -#if (defined(__m68k__) && !defined(__mcoldfire__)) && defined(__GNUC__) -void SDL_MixAudio_m68k_U8(char* dst, char* src, long len, long volume, char* mix8) -{ - __asm__ __volatile__ ( - - "tstl %2\n" -" beqs stoploop_u8\n" -"mixloop_u8:\n" - - /* Mix a sample */ - -" moveq #0,%%d0\n" -" moveq #0,%%d1\n" - -" moveb %1@+,%%d0\n" /* d0 = *src++ */ -" sub #128,%%d0\n" /* d0 -= 128 */ -" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ -" moveb %0@,%%d1\n" /* d1 = *dst */ -" asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ -" add #128,%%d0\n" /* d0 += 128 */ - -" add %%d1,%%d0\n" - -" moveb %4@(%%d0:w),%0@+\n" - - /* Loop till done */ - -" subql #1,%2\n" -" bhis mixloop_u8\n" -"stoploop_u8:\n" - - : /* no return value */ - : /* input */ - "a"(dst), "a"(src), "d"(len), "d"(volume), "a"(mix8) - : /* clobbered registers */ - "d0", "d1", "cc", "memory" - ); -} - -void SDL_MixAudio_m68k_S8(char* dst, char* src, long len, long volume) -{ - __asm__ __volatile__ ( - - "tstl %2\n" -" beqs stoploop_s8\n" -" moveq #-128,%%d2\n" -" moveq #127,%%d3\n" -"mixloop_s8:\n" - - /* Mix a sample */ - -" moveq #0,%%d0\n" -" moveq #0,%%d1\n" - -" moveb %1@+,%%d0\n" /* d0 = *src++ */ -" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ -" moveb %0@,%%d1\n" /* d1 = *dst */ -" asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ - -" add %%d1,%%d0\n" - -" cmp %%d2,%%d0\n" -" bges lower_limit_s8\n" -" move %%d2,%%d0\n" -"lower_limit_s8:\n" - -" cmp %%d3,%%d0\n" -" bles upper_limit_s8\n" -" move %%d3,%%d0\n" -"upper_limit_s8:\n" -" moveb %%d0,%0@+\n" - - /* Loop till done */ - -" subql #1,%2\n" -" bhis mixloop_s8\n" -"stoploop_s8:\n" - - : /* no return value */ - : /* input */ - "a"(dst), "a"(src), "d"(len), "d"(volume) - : /* clobbered registers */ - "d0", "d1", "d2", "d3", "cc", "memory" - ); -} - -void SDL_MixAudio_m68k_S16MSB(short* dst, short* src, long len, long volume) -{ - __asm__ __volatile__ ( - - "tstl %2\n" -" beqs stoploop_s16msb\n" -" movel #-32768,%%d2\n" -" movel #32767,%%d3\n" -" lsrl #1,%2\n" -"mixloop_s16msb:\n" - - /* Mix a sample */ - -" move %1@+,%%d0\n" /* d0 = *src++ */ -" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ -" move %0@,%%d1\n" /* d1 = *dst */ -" extl %%d1\n" /* extend d1 to 32 bits */ -" asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ - -" addl %%d1,%%d0\n" - -" cmpl %%d2,%%d0\n" -" bges lower_limit_s16msb\n" -" move %%d2,%%d0\n" -"lower_limit_s16msb:\n" - -" cmpl %%d3,%%d0\n" -" bles upper_limit_s16msb\n" -" move %%d3,%%d0\n" -"upper_limit_s16msb:\n" -" move %%d0,%0@+\n" - - /* Loop till done */ - -" subql #1,%2\n" -" bhis mixloop_s16msb\n" -"stoploop_s16msb:\n" - - : /* no return value */ - : /* input */ - "a"(dst), "a"(src), "d"(len), "d"(volume) - : /* clobbered registers */ - "d0", "d1", "d2", "d3", "cc", "memory" - ); -} - -void SDL_MixAudio_m68k_S16LSB(short* dst, short* src, long len, long volume) -{ - __asm__ __volatile__ ( - - "tstl %2\n" -" beqs stoploop_s16lsb\n" -" movel #-32768,%%d2\n" -" movel #32767,%%d3\n" -" lsrl #1,%2\n" -"mixloop_s16lsb:\n" - - /* Mix a sample */ - -" move %1@+,%%d0\n" /* d0 = *src++ */ -" rorw #8,%%d0\n" -" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */ -" move %0@,%%d1\n" /* d1 = *dst */ -" rorw #8,%%d1\n" -" extl %%d1\n" /* extend d1 to 32 bits */ -" asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */ - -" addl %%d1,%%d0\n" - -" cmpl %%d2,%%d0\n" -" bges lower_limit_s16lsb\n" -" move %%d2,%%d0\n" -"lower_limit_s16lsb:\n" - -" cmpl %%d3,%%d0\n" -" bles upper_limit_s16lsb\n" -" move %%d3,%%d0\n" -"upper_limit_s16lsb:\n" -" rorw #8,%%d0\n" -" move %%d0,%0@+\n" - - /* Loop till done */ - -" subql #1,%2\n" -" bhis mixloop_s16lsb\n" -"stoploop_s16lsb:\n" - - : /* no return value */ - : /* input */ - "a"(dst), "a"(src), "d"(len), "d"(volume) - : /* clobbered registers */ - "d0", "d1", "d2", "d3", "cc", "memory" - ); -} -#endif diff --git a/src/audio/SDL_mixer_m68k.h b/src/audio/SDL_mixer_m68k.h deleted file mode 100644 index 673df00656..0000000000 --- a/src/audio/SDL_mixer_m68k.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - m68k assembly mix routines - - Patrice Mandin -*/ - -#if (defined(__m68k__) && !defined(__mcoldfire__)) && defined(__GNUC__) -void SDL_MixAudio_m68k_U8(char* dst,char* src, long len, long volume, char* mix8); -void SDL_MixAudio_m68k_S8(char* dst,char* src, long len, long volume); - -void SDL_MixAudio_m68k_S16MSB(short* dst,short* src, long len, long volume); -void SDL_MixAudio_m68k_S16LSB(short* dst,short* src, long len, long volume); -#endif diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 74ac21df04..83919c6e4c 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is SDL_free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -29,158 +28,111 @@ /* The SDL audio driver */ typedef struct SDL_AudioDevice SDL_AudioDevice; +#define _THIS SDL_AudioDevice *_this + +/* Used by audio targets during DetectDevices() */ +typedef void (*SDL_AddAudioDevice)(const char *name); + +typedef struct SDL_AudioDriverImpl +{ + void (*DetectDevices) (int iscapture, SDL_AddAudioDevice addfn); + int (*OpenDevice) (_THIS, const char *devname, int iscapture); + void (*ThreadInit) (_THIS); /* Called by audio thread at start */ + void (*WaitDevice) (_THIS); + void (*PlayDevice) (_THIS); + Uint8 *(*GetDeviceBuf) (_THIS); + void (*WaitDone) (_THIS); + void (*CloseDevice) (_THIS); + void (*LockDevice) (_THIS); + void (*UnlockDevice) (_THIS); + void (*Deinitialize) (void); + + /* !!! FIXME: add pause(), so we can optimize instead of mixing silence. */ + + /* Some flags to push duplicate code into the core and reduce #ifdefs. */ + int ProvidesOwnCallbackThread; + int SkipMixerLock; /* !!! FIXME: do we need this anymore? */ + int HasCaptureSupport; + int OnlyHasDefaultOutputDevice; + int OnlyHasDefaultInputDevice; +} SDL_AudioDriverImpl; + + +typedef struct SDL_AudioDriver +{ + /* * * */ + /* The name of this audio driver */ + const char *name; + + /* * * */ + /* The description of this audio driver */ + const char *desc; + + SDL_AudioDriverImpl impl; + + char **outputDevices; + int outputDeviceCount; + + char **inputDevices; + int inputDeviceCount; +} SDL_AudioDriver; + + +/* Streamer */ +typedef struct +{ + Uint8 *buffer; + int max_len; /* the maximum length in bytes */ + int read_pos, write_pos; /* the position of the write and read heads in bytes */ +} SDL_AudioStreamer; + /* Define the SDL audio driver structure */ -#define _THIS SDL_AudioDevice *_this -#ifndef _STATUS -#define _STATUS SDL_status *status -#endif -struct SDL_AudioDevice { - /* * * */ - /* The name of this audio driver */ - const char *name; - - /* * * */ - /* The description of this audio driver */ - const char *desc; - - /* * * */ - /* Public driver functions */ - int (*OpenAudio)(_THIS, SDL_AudioSpec *spec); - void (*ThreadInit)(_THIS); /* Called by audio thread at start */ - void (*WaitAudio)(_THIS); - void (*PlayAudio)(_THIS); - Uint8 *(*GetAudioBuf)(_THIS); - void (*WaitDone)(_THIS); - void (*CloseAudio)(_THIS); - - /* * * */ - /* Lock / Unlock functions added for the Mac port */ - void (*LockAudio)(_THIS); - void (*UnlockAudio)(_THIS); - - void (*SetCaption)(_THIS, const char *caption); - - /* * * */ - /* Data common to all devices */ - - /* The current audio specification (shared with audio thread) */ - SDL_AudioSpec spec; - - /* An audio conversion block for audio format emulation */ - SDL_AudioCVT convert; - - /* Current state flags */ - int enabled; - int paused; - int opened; - - /* Fake audio buffer for when the audio hardware is busy */ - Uint8 *fake_stream; - - /* A semaphore for locking the mixing buffers */ - SDL_mutex *mixer_lock; - - /* A thread to feed the audio device */ - SDL_Thread *thread; - Uint32 threadid; - - /* * * */ - /* Data private to this driver */ - struct SDL_PrivateAudioData *hidden; - - /* * * */ - /* The function used to dispose of this structure */ - void (*free)(_THIS); +struct SDL_AudioDevice +{ + /* * * */ + /* Data common to all devices */ + + /* The current audio specification (shared with audio thread) */ + SDL_AudioSpec spec; + + /* An audio conversion block for audio format emulation */ + SDL_AudioCVT convert; + + /* The streamer, if sample rate conversion necessitates it */ + int use_streamer; + SDL_AudioStreamer streamer; + + /* Current state flags */ + int iscapture; + int enabled; + int paused; + int opened; + + /* Fake audio buffer for when the audio hardware is busy */ + Uint8 *fake_stream; + + /* A semaphore for locking the mixing buffers */ + SDL_mutex *mixer_lock; + + /* A thread to feed the audio device */ + SDL_Thread *thread; + SDL_threadID threadid; + + /* * * */ + /* Data private to this driver */ + struct SDL_PrivateAudioData *hidden; }; #undef _THIS -typedef struct AudioBootStrap { - const char *name; - const char *desc; - int (*available)(void); - SDL_AudioDevice *(*create)(int devindex); +typedef struct AudioBootStrap +{ + const char *name; + const char *desc; + int (*init) (SDL_AudioDriverImpl * impl); + int demand_only; /* 1==request explicitly, or it won't be available. */ } AudioBootStrap; -#if SDL_AUDIO_DRIVER_BSD -extern AudioBootStrap BSD_AUDIO_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_PULSE -extern AudioBootStrap PULSE_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_ALSA -extern AudioBootStrap ALSA_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_OSS -extern AudioBootStrap DSP_bootstrap; -extern AudioBootStrap DMA_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_QNXNTO -extern AudioBootStrap QNXNTOAUDIO_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_SUNAUDIO -extern AudioBootStrap SUNAUDIO_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_DMEDIA -extern AudioBootStrap DMEDIA_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_ARTS -extern AudioBootStrap ARTS_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_ESD -extern AudioBootStrap ESD_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_NAS -extern AudioBootStrap NAS_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_DSOUND -extern AudioBootStrap DSOUND_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_WAVEOUT -extern AudioBootStrap WAVEOUT_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_PAUD -extern AudioBootStrap Paud_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_BAUDIO -extern AudioBootStrap BAUDIO_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_COREAUDIO -extern AudioBootStrap COREAUDIO_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_SNDMGR -extern AudioBootStrap SNDMGR_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_MINT -extern AudioBootStrap MINTAUDIO_GSXB_bootstrap; -extern AudioBootStrap MINTAUDIO_MCSN_bootstrap; -extern AudioBootStrap MINTAUDIO_STFA_bootstrap; -extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap; -extern AudioBootStrap MINTAUDIO_DMA8_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_DISK -extern AudioBootStrap DISKAUD_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_DUMMY -extern AudioBootStrap DUMMYAUD_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_DC -extern AudioBootStrap DCAUD_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_NDS -extern AudioBootStrap NDSAUD_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_MMEAUDIO -extern AudioBootStrap MMEAUDIO_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_DART -extern AudioBootStrap DART_bootstrap; -#endif -#if SDL_AUDIO_DRIVER_EPOCAUDIO -extern AudioBootStrap EPOCAudio_bootstrap; -#endif - -/* This is the current audio device */ -extern SDL_AudioDevice *current_audio; - #endif /* _SDL_sysaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index b4ad6c7876..18fdcacd3c 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -27,570 +26,606 @@ #include "SDL_wave.h" -static int ReadChunk(SDL_RWops *src, Chunk *chunk); +static int ReadChunk(SDL_RWops * src, Chunk * chunk); -struct MS_ADPCM_decodestate { - Uint8 hPredictor; - Uint16 iDelta; - Sint16 iSamp1; - Sint16 iSamp2; +struct MS_ADPCM_decodestate +{ + Uint8 hPredictor; + Uint16 iDelta; + Sint16 iSamp1; + Sint16 iSamp2; }; -static struct MS_ADPCM_decoder { - WaveFMT wavefmt; - Uint16 wSamplesPerBlock; - Uint16 wNumCoef; - Sint16 aCoeff[7][2]; - /* * * */ - struct MS_ADPCM_decodestate state[2]; +static struct MS_ADPCM_decoder +{ + WaveFMT wavefmt; + Uint16 wSamplesPerBlock; + Uint16 wNumCoef; + Sint16 aCoeff[7][2]; + /* * * */ + struct MS_ADPCM_decodestate state[2]; } MS_ADPCM_state; -static int InitMS_ADPCM(WaveFMT *format) +static int +InitMS_ADPCM(WaveFMT * format) { - Uint8 *rogue_feel; - int i; - - /* Set the rogue pointer to the MS_ADPCM specific data */ - MS_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding); - MS_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels); - MS_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency); - MS_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate); - MS_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign); - MS_ADPCM_state.wavefmt.bitspersample = - SDL_SwapLE16(format->bitspersample); - rogue_feel = (Uint8 *)format+sizeof(*format); - if ( sizeof(*format) == 16 ) { - rogue_feel += sizeof(Uint16); - } - MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]); - rogue_feel += sizeof(Uint16); - MS_ADPCM_state.wNumCoef = ((rogue_feel[1]<<8)|rogue_feel[0]); - rogue_feel += sizeof(Uint16); - if ( MS_ADPCM_state.wNumCoef != 7 ) { - SDL_SetError("Unknown set of MS_ADPCM coefficients"); - return(-1); - } - for ( i=0; iencoding); + MS_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels); + MS_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency); + MS_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate); + MS_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign); + MS_ADPCM_state.wavefmt.bitspersample = + SDL_SwapLE16(format->bitspersample); + rogue_feel = (Uint8 *) format + sizeof(*format); + if (sizeof(*format) == 16) { + /*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);*/ + rogue_feel += sizeof(Uint16); + } + MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + MS_ADPCM_state.wNumCoef = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + if (MS_ADPCM_state.wNumCoef != 7) { + SDL_SetError("Unknown set of MS_ADPCM coefficients"); + return (-1); + } + for (i = 0; i < MS_ADPCM_state.wNumCoef; ++i) { + MS_ADPCM_state.aCoeff[i][0] = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + MS_ADPCM_state.aCoeff[i][1] = ((rogue_feel[1] << 8) | rogue_feel[0]); + rogue_feel += sizeof(Uint16); + } + return (0); } -static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state, - Uint8 nybble, Sint16 *coeff) +static Sint32 +MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state, + Uint8 nybble, Sint16 * coeff) { - const Sint32 max_audioval = ((1<<(16-1))-1); - const Sint32 min_audioval = -(1<<(16-1)); - const Sint32 adaptive[] = { - 230, 230, 230, 230, 307, 409, 512, 614, - 768, 614, 512, 409, 307, 230, 230, 230 - }; - Sint32 new_sample, delta; - - new_sample = ((state->iSamp1 * coeff[0]) + - (state->iSamp2 * coeff[1]))/256; - if ( nybble & 0x08 ) { - new_sample += state->iDelta * (nybble-0x10); - } else { - new_sample += state->iDelta * nybble; - } - if ( new_sample < min_audioval ) { - new_sample = min_audioval; - } else - if ( new_sample > max_audioval ) { - new_sample = max_audioval; - } - delta = ((Sint32)state->iDelta * adaptive[nybble])/256; - if ( delta < 16 ) { - delta = 16; - } - state->iDelta = (Uint16)delta; - state->iSamp2 = state->iSamp1; - state->iSamp1 = (Sint16)new_sample; - return(new_sample); + const Sint32 max_audioval = ((1 << (16 - 1)) - 1); + const Sint32 min_audioval = -(1 << (16 - 1)); + const Sint32 adaptive[] = { + 230, 230, 230, 230, 307, 409, 512, 614, + 768, 614, 512, 409, 307, 230, 230, 230 + }; + Sint32 new_sample, delta; + + new_sample = ((state->iSamp1 * coeff[0]) + + (state->iSamp2 * coeff[1])) / 256; + if (nybble & 0x08) { + new_sample += state->iDelta * (nybble - 0x10); + } else { + new_sample += state->iDelta * nybble; + } + if (new_sample < min_audioval) { + new_sample = min_audioval; + } else if (new_sample > max_audioval) { + new_sample = max_audioval; + } + delta = ((Sint32) state->iDelta * adaptive[nybble]) / 256; + if (delta < 16) { + delta = 16; + } + state->iDelta = (Uint16) delta; + state->iSamp2 = state->iSamp1; + state->iSamp1 = (Sint16) new_sample; + return (new_sample); } -static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) +static int +MS_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len) { - struct MS_ADPCM_decodestate *state[2]; - Uint8 *freeable, *encoded, *decoded; - Sint32 encoded_len, samplesleft; - Sint8 nybble, stereo; - Sint16 *coeff[2]; - Sint32 new_sample; - - /* Allocate the proper sized output buffer */ - encoded_len = *audio_len; - encoded = *audio_buf; - freeable = *audio_buf; - *audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) * - MS_ADPCM_state.wSamplesPerBlock* - MS_ADPCM_state.wavefmt.channels*sizeof(Sint16); - *audio_buf = (Uint8 *)SDL_malloc(*audio_len); - if ( *audio_buf == NULL ) { - SDL_Error(SDL_ENOMEM); - return(-1); - } - decoded = *audio_buf; - - /* Get ready... Go! */ - stereo = (MS_ADPCM_state.wavefmt.channels == 2); - state[0] = &MS_ADPCM_state.state[0]; - state[1] = &MS_ADPCM_state.state[stereo]; - while ( encoded_len >= MS_ADPCM_state.wavefmt.blockalign ) { - /* Grab the initial information for this block */ - state[0]->hPredictor = *encoded++; - if ( stereo ) { - state[1]->hPredictor = *encoded++; - } - state[0]->iDelta = ((encoded[1]<<8)|encoded[0]); - encoded += sizeof(Sint16); - if ( stereo ) { - state[1]->iDelta = ((encoded[1]<<8)|encoded[0]); - encoded += sizeof(Sint16); - } - state[0]->iSamp1 = ((encoded[1]<<8)|encoded[0]); - encoded += sizeof(Sint16); - if ( stereo ) { - state[1]->iSamp1 = ((encoded[1]<<8)|encoded[0]); - encoded += sizeof(Sint16); - } - state[0]->iSamp2 = ((encoded[1]<<8)|encoded[0]); - encoded += sizeof(Sint16); - if ( stereo ) { - state[1]->iSamp2 = ((encoded[1]<<8)|encoded[0]); - encoded += sizeof(Sint16); - } - coeff[0] = MS_ADPCM_state.aCoeff[state[0]->hPredictor]; - coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor]; - - /* Store the two initial samples we start with */ - decoded[0] = state[0]->iSamp2&0xFF; - decoded[1] = state[0]->iSamp2>>8; - decoded += 2; - if ( stereo ) { - decoded[0] = state[1]->iSamp2&0xFF; - decoded[1] = state[1]->iSamp2>>8; - decoded += 2; - } - decoded[0] = state[0]->iSamp1&0xFF; - decoded[1] = state[0]->iSamp1>>8; - decoded += 2; - if ( stereo ) { - decoded[0] = state[1]->iSamp1&0xFF; - decoded[1] = state[1]->iSamp1>>8; - decoded += 2; - } - - /* Decode and store the other samples in this block */ - samplesleft = (MS_ADPCM_state.wSamplesPerBlock-2)* - MS_ADPCM_state.wavefmt.channels; - while ( samplesleft > 0 ) { - nybble = (*encoded)>>4; - new_sample = MS_ADPCM_nibble(state[0],nybble,coeff[0]); - decoded[0] = new_sample&0xFF; - new_sample >>= 8; - decoded[1] = new_sample&0xFF; - decoded += 2; - - nybble = (*encoded)&0x0F; - new_sample = MS_ADPCM_nibble(state[1],nybble,coeff[1]); - decoded[0] = new_sample&0xFF; - new_sample >>= 8; - decoded[1] = new_sample&0xFF; - decoded += 2; - - ++encoded; - samplesleft -= 2; - } - encoded_len -= MS_ADPCM_state.wavefmt.blockalign; - } - SDL_free(freeable); - return(0); + struct MS_ADPCM_decodestate *state[2]; + Uint8 *freeable, *encoded, *decoded; + Sint32 encoded_len, samplesleft; + Sint8 nybble, stereo; + Sint16 *coeff[2]; + Sint32 new_sample; + + /* Allocate the proper sized output buffer */ + encoded_len = *audio_len; + encoded = *audio_buf; + freeable = *audio_buf; + *audio_len = (encoded_len / MS_ADPCM_state.wavefmt.blockalign) * + MS_ADPCM_state.wSamplesPerBlock * + MS_ADPCM_state.wavefmt.channels * sizeof(Sint16); + *audio_buf = (Uint8 *) SDL_malloc(*audio_len); + if (*audio_buf == NULL) { + return SDL_OutOfMemory(); + } + decoded = *audio_buf; + + /* Get ready... Go! */ + stereo = (MS_ADPCM_state.wavefmt.channels == 2); + state[0] = &MS_ADPCM_state.state[0]; + state[1] = &MS_ADPCM_state.state[stereo]; + while (encoded_len >= MS_ADPCM_state.wavefmt.blockalign) { + /* Grab the initial information for this block */ + state[0]->hPredictor = *encoded++; + if (stereo) { + state[1]->hPredictor = *encoded++; + } + state[0]->iDelta = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + if (stereo) { + state[1]->iDelta = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + } + state[0]->iSamp1 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + if (stereo) { + state[1]->iSamp1 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + } + state[0]->iSamp2 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + if (stereo) { + state[1]->iSamp2 = ((encoded[1] << 8) | encoded[0]); + encoded += sizeof(Sint16); + } + coeff[0] = MS_ADPCM_state.aCoeff[state[0]->hPredictor]; + coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor]; + + /* Store the two initial samples we start with */ + decoded[0] = state[0]->iSamp2 & 0xFF; + decoded[1] = state[0]->iSamp2 >> 8; + decoded += 2; + if (stereo) { + decoded[0] = state[1]->iSamp2 & 0xFF; + decoded[1] = state[1]->iSamp2 >> 8; + decoded += 2; + } + decoded[0] = state[0]->iSamp1 & 0xFF; + decoded[1] = state[0]->iSamp1 >> 8; + decoded += 2; + if (stereo) { + decoded[0] = state[1]->iSamp1 & 0xFF; + decoded[1] = state[1]->iSamp1 >> 8; + decoded += 2; + } + + /* Decode and store the other samples in this block */ + samplesleft = (MS_ADPCM_state.wSamplesPerBlock - 2) * + MS_ADPCM_state.wavefmt.channels; + while (samplesleft > 0) { + nybble = (*encoded) >> 4; + new_sample = MS_ADPCM_nibble(state[0], nybble, coeff[0]); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2; + + nybble = (*encoded) & 0x0F; + new_sample = MS_ADPCM_nibble(state[1], nybble, coeff[1]); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2; + + ++encoded; + samplesleft -= 2; + } + encoded_len -= MS_ADPCM_state.wavefmt.blockalign; + } + SDL_free(freeable); + return (0); } -struct IMA_ADPCM_decodestate { - Sint32 sample; - Sint8 index; +struct IMA_ADPCM_decodestate +{ + Sint32 sample; + Sint8 index; }; -static struct IMA_ADPCM_decoder { - WaveFMT wavefmt; - Uint16 wSamplesPerBlock; - /* * * */ - struct IMA_ADPCM_decodestate state[2]; +static struct IMA_ADPCM_decoder +{ + WaveFMT wavefmt; + Uint16 wSamplesPerBlock; + /* * * */ + struct IMA_ADPCM_decodestate state[2]; } IMA_ADPCM_state; -static int InitIMA_ADPCM(WaveFMT *format) +static int +InitIMA_ADPCM(WaveFMT * format) { - Uint8 *rogue_feel; - - /* Set the rogue pointer to the IMA_ADPCM specific data */ - IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding); - IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels); - IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency); - IMA_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate); - IMA_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign); - IMA_ADPCM_state.wavefmt.bitspersample = - SDL_SwapLE16(format->bitspersample); - rogue_feel = (Uint8 *)format+sizeof(*format); - if ( sizeof(*format) == 16 ) { - rogue_feel += sizeof(Uint16); - } - IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]); - return(0); + Uint8 *rogue_feel; + + /* Set the rogue pointer to the IMA_ADPCM specific data */ + IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding); + IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels); + IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency); + IMA_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate); + IMA_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign); + IMA_ADPCM_state.wavefmt.bitspersample = + SDL_SwapLE16(format->bitspersample); + rogue_feel = (Uint8 *) format + sizeof(*format); + if (sizeof(*format) == 16) { + /*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]);*/ + rogue_feel += sizeof(Uint16); + } + IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]); + return (0); } -static Sint32 IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state,Uint8 nybble) +static Sint32 +IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state, Uint8 nybble) { - const Sint32 max_audioval = ((1<<(16-1))-1); - const Sint32 min_audioval = -(1<<(16-1)); - const int index_table[16] = { - -1, -1, -1, -1, - 2, 4, 6, 8, - -1, -1, -1, -1, - 2, 4, 6, 8 - }; - const Sint32 step_table[89] = { - 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, - 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, - 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, - 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, - 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, - 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, - 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, - 22385, 24623, 27086, 29794, 32767 - }; - Sint32 delta, step; - - /* Compute difference and new sample value */ - step = step_table[state->index]; - delta = step >> 3; - if ( nybble & 0x04 ) delta += step; - if ( nybble & 0x02 ) delta += (step >> 1); - if ( nybble & 0x01 ) delta += (step >> 2); - if ( nybble & 0x08 ) delta = -delta; - state->sample += delta; - - /* Update index value */ - state->index += index_table[nybble]; - if ( state->index > 88 ) { - state->index = 88; - } else - if ( state->index < 0 ) { - state->index = 0; - } - - /* Clamp output sample */ - if ( state->sample > max_audioval ) { - state->sample = max_audioval; - } else - if ( state->sample < min_audioval ) { - state->sample = min_audioval; - } - return(state->sample); + const Sint32 max_audioval = ((1 << (16 - 1)) - 1); + const Sint32 min_audioval = -(1 << (16 - 1)); + const int index_table[16] = { + -1, -1, -1, -1, + 2, 4, 6, 8, + -1, -1, -1, -1, + 2, 4, 6, 8 + }; + const Sint32 step_table[89] = { + 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, + 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, + 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, + 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, + 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, + 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, + 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, + 22385, 24623, 27086, 29794, 32767 + }; + Sint32 delta, step; + + /* Compute difference and new sample value */ + if (state->index > 88) { + state->index = 88; + } else if (state->index < 0) { + state->index = 0; + } + step = step_table[state->index]; + delta = step >> 3; + if (nybble & 0x04) + delta += step; + if (nybble & 0x02) + delta += (step >> 1); + if (nybble & 0x01) + delta += (step >> 2); + if (nybble & 0x08) + delta = -delta; + state->sample += delta; + + /* Update index value */ + state->index += index_table[nybble]; + + /* Clamp output sample */ + if (state->sample > max_audioval) { + state->sample = max_audioval; + } else if (state->sample < min_audioval) { + state->sample = min_audioval; + } + return (state->sample); } /* Fill the decode buffer with a channel block of data (8 samples) */ -static void Fill_IMA_ADPCM_block(Uint8 *decoded, Uint8 *encoded, - int channel, int numchannels, struct IMA_ADPCM_decodestate *state) +static void +Fill_IMA_ADPCM_block(Uint8 * decoded, Uint8 * encoded, + int channel, int numchannels, + struct IMA_ADPCM_decodestate *state) { - int i; - Sint8 nybble; - Sint32 new_sample; - - decoded += (channel * 2); - for ( i=0; i<4; ++i ) { - nybble = (*encoded)&0x0F; - new_sample = IMA_ADPCM_nibble(state, nybble); - decoded[0] = new_sample&0xFF; - new_sample >>= 8; - decoded[1] = new_sample&0xFF; - decoded += 2 * numchannels; - - nybble = (*encoded)>>4; - new_sample = IMA_ADPCM_nibble(state, nybble); - decoded[0] = new_sample&0xFF; - new_sample >>= 8; - decoded[1] = new_sample&0xFF; - decoded += 2 * numchannels; - - ++encoded; - } + int i; + Sint8 nybble; + Sint32 new_sample; + + decoded += (channel * 2); + for (i = 0; i < 4; ++i) { + nybble = (*encoded) & 0x0F; + new_sample = IMA_ADPCM_nibble(state, nybble); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2 * numchannels; + + nybble = (*encoded) >> 4; + new_sample = IMA_ADPCM_nibble(state, nybble); + decoded[0] = new_sample & 0xFF; + new_sample >>= 8; + decoded[1] = new_sample & 0xFF; + decoded += 2 * numchannels; + + ++encoded; + } } -static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len) +static int +IMA_ADPCM_decode(Uint8 ** audio_buf, Uint32 * audio_len) { - struct IMA_ADPCM_decodestate *state; - Uint8 *freeable, *encoded, *decoded; - Sint32 encoded_len, samplesleft; - unsigned int c, channels; - - /* Check to make sure we have enough variables in the state array */ - channels = IMA_ADPCM_state.wavefmt.channels; - if ( channels > SDL_arraysize(IMA_ADPCM_state.state) ) { - SDL_SetError("IMA ADPCM decoder can only handle %d channels", - SDL_arraysize(IMA_ADPCM_state.state)); - return(-1); - } - state = IMA_ADPCM_state.state; - - /* Allocate the proper sized output buffer */ - encoded_len = *audio_len; - encoded = *audio_buf; - freeable = *audio_buf; - *audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) * - IMA_ADPCM_state.wSamplesPerBlock* - IMA_ADPCM_state.wavefmt.channels*sizeof(Sint16); - *audio_buf = (Uint8 *)SDL_malloc(*audio_len); - if ( *audio_buf == NULL ) { - SDL_Error(SDL_ENOMEM); - return(-1); - } - decoded = *audio_buf; - - /* Get ready... Go! */ - while ( encoded_len >= IMA_ADPCM_state.wavefmt.blockalign ) { - /* Grab the initial information for this block */ - for ( c=0; c>8); - decoded += 2; - } - - /* Decode and store the other samples in this block */ - samplesleft = (IMA_ADPCM_state.wSamplesPerBlock-1)*channels; - while ( samplesleft > 0 ) { - for ( c=0; c SDL_arraysize(IMA_ADPCM_state.state)) { + SDL_SetError("IMA ADPCM decoder can only handle %d channels", + SDL_arraysize(IMA_ADPCM_state.state)); + return (-1); + } + state = IMA_ADPCM_state.state; + + /* Allocate the proper sized output buffer */ + encoded_len = *audio_len; + encoded = *audio_buf; + freeable = *audio_buf; + *audio_len = (encoded_len / IMA_ADPCM_state.wavefmt.blockalign) * + IMA_ADPCM_state.wSamplesPerBlock * + IMA_ADPCM_state.wavefmt.channels * sizeof(Sint16); + *audio_buf = (Uint8 *) SDL_malloc(*audio_len); + if (*audio_buf == NULL) { + return SDL_OutOfMemory(); + } + decoded = *audio_buf; + + /* Get ready... Go! */ + while (encoded_len >= IMA_ADPCM_state.wavefmt.blockalign) { + /* Grab the initial information for this block */ + for (c = 0; c < channels; ++c) { + /* Fill the state information for this block */ + state[c].sample = ((encoded[1] << 8) | encoded[0]); + encoded += 2; + if (state[c].sample & 0x8000) { + state[c].sample -= 0x10000; + } + state[c].index = *encoded++; + /* Reserved byte in buffer header, should be 0 */ + if (*encoded++ != 0) { + /* Uh oh, corrupt data? Buggy code? */ ; + } + + /* Store the initial sample we start with */ + decoded[0] = (Uint8) (state[c].sample & 0xFF); + decoded[1] = (Uint8) (state[c].sample >> 8); + decoded += 2; + } + + /* Decode and store the other samples in this block */ + samplesleft = (IMA_ADPCM_state.wSamplesPerBlock - 1) * channels; + while (samplesleft > 0) { + for (c = 0; c < channels; ++c) { + Fill_IMA_ADPCM_block(decoded, encoded, + c, channels, &state[c]); + encoded += 4; + samplesleft -= 8; + } + decoded += (channels * 8 * 2); + } + encoded_len -= IMA_ADPCM_state.wavefmt.blockalign; + } + SDL_free(freeable); + return (0); } -SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc, - SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) +SDL_AudioSpec * +SDL_LoadWAV_RW(SDL_RWops * src, int freesrc, + SDL_AudioSpec * spec, Uint8 ** audio_buf, Uint32 * audio_len) { - int was_error; - Chunk chunk; - int lenread; - int MS_ADPCM_encoded, IMA_ADPCM_encoded; - int samplesize; - - /* WAV magic header */ - Uint32 RIFFchunk; - Uint32 wavelen = 0; - Uint32 WAVEmagic; - Uint32 headerDiff = 0; - - /* FMT chunk */ - WaveFMT *format = NULL; - - /* Make sure we are passed a valid data source */ - was_error = 0; - if ( src == NULL ) { - was_error = 1; - goto done; - } - - /* Check the magic header */ - RIFFchunk = SDL_ReadLE32(src); - wavelen = SDL_ReadLE32(src); - if ( wavelen == WAVE ) { /* The RIFFchunk has already been read */ - WAVEmagic = wavelen; - wavelen = RIFFchunk; - RIFFchunk = RIFF; - } else { - WAVEmagic = SDL_ReadLE32(src); - } - if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) { - SDL_SetError("Unrecognized file type (not WAVE)"); - was_error = 1; - goto done; - } - headerDiff += sizeof(Uint32); /* for WAVE */ - - /* Read the audio data format chunk */ - chunk.data = NULL; - do { - if ( chunk.data != NULL ) { - SDL_free(chunk.data); - chunk.data = NULL; - } - lenread = ReadChunk(src, &chunk); - if ( lenread < 0 ) { - was_error = 1; - goto done; - } - /* 2 Uint32's for chunk header+len, plus the lenread */ - headerDiff += lenread + 2 * sizeof(Uint32); - } while ( (chunk.magic == FACT) || (chunk.magic == LIST) ); - - /* Decode the audio data format */ - format = (WaveFMT *)chunk.data; - if ( chunk.magic != FMT ) { - SDL_SetError("Complex WAVE files not supported"); - was_error = 1; - goto done; - } - MS_ADPCM_encoded = IMA_ADPCM_encoded = 0; - switch (SDL_SwapLE16(format->encoding)) { - case PCM_CODE: - /* We can understand this */ - break; - case MS_ADPCM_CODE: - /* Try to understand this */ - if ( InitMS_ADPCM(format) < 0 ) { - was_error = 1; - goto done; - } - MS_ADPCM_encoded = 1; - break; - case IMA_ADPCM_CODE: - /* Try to understand this */ - if ( InitIMA_ADPCM(format) < 0 ) { - was_error = 1; - goto done; - } - IMA_ADPCM_encoded = 1; - break; - case MP3_CODE: - SDL_SetError("MPEG Layer 3 data not supported", - SDL_SwapLE16(format->encoding)); - was_error = 1; - goto done; - default: - SDL_SetError("Unknown WAVE data format: 0x%.4x", - SDL_SwapLE16(format->encoding)); - was_error = 1; - goto done; - } - SDL_memset(spec, 0, (sizeof *spec)); - spec->freq = SDL_SwapLE32(format->frequency); - switch (SDL_SwapLE16(format->bitspersample)) { - case 4: - if ( MS_ADPCM_encoded || IMA_ADPCM_encoded ) { - spec->format = AUDIO_S16; - } else { - was_error = 1; - } - break; - case 8: - spec->format = AUDIO_U8; - break; - case 16: - spec->format = AUDIO_S16; - break; - default: - was_error = 1; - break; - } - if ( was_error ) { - SDL_SetError("Unknown %d-bit PCM data format", - SDL_SwapLE16(format->bitspersample)); - goto done; - } - spec->channels = (Uint8)SDL_SwapLE16(format->channels); - spec->samples = 4096; /* Good default buffer size */ - - /* Read the audio data chunk */ - *audio_buf = NULL; - do { - if ( *audio_buf != NULL ) { - SDL_free(*audio_buf); - *audio_buf = NULL; - } - lenread = ReadChunk(src, &chunk); - if ( lenread < 0 ) { - was_error = 1; - goto done; - } - *audio_len = lenread; - *audio_buf = chunk.data; - if(chunk.magic != DATA) headerDiff += lenread + 2 * sizeof(Uint32); - } while ( chunk.magic != DATA ); - headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */ - - if ( MS_ADPCM_encoded ) { - if ( MS_ADPCM_decode(audio_buf, audio_len) < 0 ) { - was_error = 1; - goto done; - } - } - if ( IMA_ADPCM_encoded ) { - if ( IMA_ADPCM_decode(audio_buf, audio_len) < 0 ) { - was_error = 1; - goto done; - } - } - - /* Don't return a buffer that isn't a multiple of samplesize */ - samplesize = ((spec->format & 0xFF)/8)*spec->channels; - *audio_len &= ~(samplesize-1); - -done: - if ( format != NULL ) { - SDL_free(format); - } - if ( src ) { - if ( freesrc ) { - SDL_RWclose(src); - } else { - /* seek to the end of the file (given by the RIFF chunk) */ - SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR); - } - } - if ( was_error ) { - spec = NULL; - } - return(spec); + int was_error; + Chunk chunk; + int lenread; + int IEEE_float_encoded, MS_ADPCM_encoded, IMA_ADPCM_encoded; + int samplesize; + + /* WAV magic header */ + Uint32 RIFFchunk; + Uint32 wavelen = 0; + Uint32 WAVEmagic; + Uint32 headerDiff = 0; + + /* FMT chunk */ + WaveFMT *format = NULL; + + SDL_zero(chunk); + + /* Make sure we are passed a valid data source */ + was_error = 0; + if (src == NULL) { + was_error = 1; + goto done; + } + + /* Check the magic header */ + RIFFchunk = SDL_ReadLE32(src); + wavelen = SDL_ReadLE32(src); + if (wavelen == WAVE) { /* The RIFFchunk has already been read */ + WAVEmagic = wavelen; + wavelen = RIFFchunk; + RIFFchunk = RIFF; + } else { + WAVEmagic = SDL_ReadLE32(src); + } + if ((RIFFchunk != RIFF) || (WAVEmagic != WAVE)) { + SDL_SetError("Unrecognized file type (not WAVE)"); + was_error = 1; + goto done; + } + headerDiff += sizeof(Uint32); /* for WAVE */ + + /* Read the audio data format chunk */ + chunk.data = NULL; + do { + if (chunk.data != NULL) { + SDL_free(chunk.data); + chunk.data = NULL; + } + lenread = ReadChunk(src, &chunk); + if (lenread < 0) { + was_error = 1; + goto done; + } + /* 2 Uint32's for chunk header+len, plus the lenread */ + headerDiff += lenread + 2 * sizeof(Uint32); + } while ((chunk.magic == FACT) || (chunk.magic == LIST)); + + /* Decode the audio data format */ + format = (WaveFMT *) chunk.data; + if (chunk.magic != FMT) { + SDL_SetError("Complex WAVE files not supported"); + was_error = 1; + goto done; + } + IEEE_float_encoded = MS_ADPCM_encoded = IMA_ADPCM_encoded = 0; + switch (SDL_SwapLE16(format->encoding)) { + case PCM_CODE: + /* We can understand this */ + break; + case IEEE_FLOAT_CODE: + IEEE_float_encoded = 1; + /* We can understand this */ + break; + case MS_ADPCM_CODE: + /* Try to understand this */ + if (InitMS_ADPCM(format) < 0) { + was_error = 1; + goto done; + } + MS_ADPCM_encoded = 1; + break; + case IMA_ADPCM_CODE: + /* Try to understand this */ + if (InitIMA_ADPCM(format) < 0) { + was_error = 1; + goto done; + } + IMA_ADPCM_encoded = 1; + break; + case MP3_CODE: + SDL_SetError("MPEG Layer 3 data not supported", + SDL_SwapLE16(format->encoding)); + was_error = 1; + goto done; + default: + SDL_SetError("Unknown WAVE data format: 0x%.4x", + SDL_SwapLE16(format->encoding)); + was_error = 1; + goto done; + } + SDL_memset(spec, 0, (sizeof *spec)); + spec->freq = SDL_SwapLE32(format->frequency); + + if (IEEE_float_encoded) { + if ((SDL_SwapLE16(format->bitspersample)) != 32) { + was_error = 1; + } else { + spec->format = AUDIO_F32; + } + } else { + switch (SDL_SwapLE16(format->bitspersample)) { + case 4: + if (MS_ADPCM_encoded || IMA_ADPCM_encoded) { + spec->format = AUDIO_S16; + } else { + was_error = 1; + } + break; + case 8: + spec->format = AUDIO_U8; + break; + case 16: + spec->format = AUDIO_S16; + break; + case 32: + spec->format = AUDIO_S32; + break; + default: + was_error = 1; + break; + } + } + + if (was_error) { + SDL_SetError("Unknown %d-bit PCM data format", + SDL_SwapLE16(format->bitspersample)); + goto done; + } + spec->channels = (Uint8) SDL_SwapLE16(format->channels); + spec->samples = 4096; /* Good default buffer size */ + + /* Read the audio data chunk */ + *audio_buf = NULL; + do { + if (*audio_buf != NULL) { + SDL_free(*audio_buf); + *audio_buf = NULL; + } + lenread = ReadChunk(src, &chunk); + if (lenread < 0) { + was_error = 1; + goto done; + } + *audio_len = lenread; + *audio_buf = chunk.data; + if (chunk.magic != DATA) + headerDiff += lenread + 2 * sizeof(Uint32); + } while (chunk.magic != DATA); + headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */ + + if (MS_ADPCM_encoded) { + if (MS_ADPCM_decode(audio_buf, audio_len) < 0) { + was_error = 1; + goto done; + } + } + if (IMA_ADPCM_encoded) { + if (IMA_ADPCM_decode(audio_buf, audio_len) < 0) { + was_error = 1; + goto done; + } + } + + /* Don't return a buffer that isn't a multiple of samplesize */ + samplesize = ((SDL_AUDIO_BITSIZE(spec->format)) / 8) * spec->channels; + *audio_len &= ~(samplesize - 1); + + done: + if (format != NULL) { + SDL_free(format); + } + if (src) { + if (freesrc) { + SDL_RWclose(src); + } else { + /* seek to the end of the file (given by the RIFF chunk) */ + SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR); + } + } + if (was_error) { + spec = NULL; + } + return (spec); } /* Since the WAV memory is allocated in the shared library, it must also be freed here. (Necessary under Win32, VC++) */ -void SDL_FreeWAV(Uint8 *audio_buf) +void +SDL_FreeWAV(Uint8 * audio_buf) { - if ( audio_buf != NULL ) { - SDL_free(audio_buf); - } + if (audio_buf != NULL) { + SDL_free(audio_buf); + } } -static int ReadChunk(SDL_RWops *src, Chunk *chunk) +static int +ReadChunk(SDL_RWops * src, Chunk * chunk) { - chunk->magic = SDL_ReadLE32(src); - chunk->length = SDL_ReadLE32(src); - chunk->data = (Uint8 *)SDL_malloc(chunk->length); - if ( chunk->data == NULL ) { - SDL_Error(SDL_ENOMEM); - return(-1); - } - if ( SDL_RWread(src, chunk->data, chunk->length, 1) != 1 ) { - SDL_Error(SDL_EFREAD); - SDL_free(chunk->data); - chunk->data = NULL; - return(-1); - } - return(chunk->length); + chunk->magic = SDL_ReadLE32(src); + chunk->length = SDL_ReadLE32(src); + chunk->data = (Uint8 *) SDL_malloc(chunk->length); + if (chunk->data == NULL) { + return SDL_OutOfMemory(); + } + if (SDL_RWread(src, chunk->data, chunk->length, 1) != 1) { + SDL_free(chunk->data); + chunk->data = NULL; + return SDL_Error(SDL_EFREAD); + } + return (chunk->length); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/SDL_wave.h b/src/audio/SDL_wave.h index 53b12e70d2..d82399cb8a 100644 --- a/src/audio/SDL_wave.h +++ b/src/audio/SDL_wave.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is SDL_free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,37 +25,41 @@ /*******************************************/ /* Define values for Microsoft WAVE format */ /*******************************************/ -#define RIFF 0x46464952 /* "RIFF" */ -#define WAVE 0x45564157 /* "WAVE" */ -#define FACT 0x74636166 /* "fact" */ -#define LIST 0x5453494c /* "LIST" */ -#define FMT 0x20746D66 /* "fmt " */ -#define DATA 0x61746164 /* "data" */ -#define PCM_CODE 0x0001 -#define MS_ADPCM_CODE 0x0002 -#define IMA_ADPCM_CODE 0x0011 -#define MP3_CODE 0x0055 -#define WAVE_MONO 1 -#define WAVE_STEREO 2 +#define RIFF 0x46464952 /* "RIFF" */ +#define WAVE 0x45564157 /* "WAVE" */ +#define FACT 0x74636166 /* "fact" */ +#define LIST 0x5453494c /* "LIST" */ +#define FMT 0x20746D66 /* "fmt " */ +#define DATA 0x61746164 /* "data" */ +#define PCM_CODE 0x0001 +#define MS_ADPCM_CODE 0x0002 +#define IEEE_FLOAT_CODE 0x0003 +#define IMA_ADPCM_CODE 0x0011 +#define MP3_CODE 0x0055 +#define WAVE_MONO 1 +#define WAVE_STEREO 2 /* Normally, these three chunks come consecutively in a WAVE file */ -typedef struct WaveFMT { +typedef struct WaveFMT +{ /* Not saved in the chunk we read: - Uint32 FMTchunk; - Uint32 fmtlen; + Uint32 FMTchunk; + Uint32 fmtlen; */ - Uint16 encoding; - Uint16 channels; /* 1 = mono, 2 = stereo */ - Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */ - Uint32 byterate; /* Average bytes per second */ - Uint16 blockalign; /* Bytes per sample block */ - Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */ + Uint16 encoding; + Uint16 channels; /* 1 = mono, 2 = stereo */ + Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */ + Uint32 byterate; /* Average bytes per second */ + Uint16 blockalign; /* Bytes per sample block */ + Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */ } WaveFMT; /* The general chunk found in the WAVE file */ -typedef struct Chunk { - Uint32 magic; - Uint32 length; - Uint8 *data; +typedef struct Chunk +{ + Uint32 magic; + Uint32 length; + Uint8 *data; } Chunk; +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index f10733e432..13cc77bf69 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -1,30 +1,33 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_ALSA + /* Allow access to a raw mixing buffer */ #include -#include /* For kill() */ +#include /* For kill() */ +#include +#include #include "SDL_timer.h" #include "SDL_audio.h" @@ -33,239 +36,204 @@ #include "SDL_alsa_audio.h" #ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC -#include "SDL_name.h" #include "SDL_loadso.h" -#else -#define SDL_NAME(X) X #endif - -/* The tag name used by ALSA audio */ -#define DRIVER_NAME "alsa" - -/* Audio driver functions */ -static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void ALSA_WaitAudio(_THIS); -static void ALSA_PlayAudio(_THIS); -static Uint8 *ALSA_GetAudioBuf(_THIS); -static void ALSA_CloseAudio(_THIS); +static int (*ALSA_snd_pcm_open) + (snd_pcm_t **, const char *, snd_pcm_stream_t, int); +static int (*ALSA_snd_pcm_close) (snd_pcm_t * pcm); +static snd_pcm_sframes_t(*ALSA_snd_pcm_writei) + (snd_pcm_t *, const void *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_recover) (snd_pcm_t *, int, int); +static int (*ALSA_snd_pcm_prepare) (snd_pcm_t *); +static int (*ALSA_snd_pcm_drain) (snd_pcm_t *); +static const char *(*ALSA_snd_strerror) (int); +static size_t(*ALSA_snd_pcm_hw_params_sizeof) (void); +static size_t(*ALSA_snd_pcm_sw_params_sizeof) (void); +static void (*ALSA_snd_pcm_hw_params_copy) + (snd_pcm_hw_params_t *, const snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_hw_params_any) (snd_pcm_t *, snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_hw_params_set_access) + (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_access_t); +static int (*ALSA_snd_pcm_hw_params_set_format) + (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_format_t); +static int (*ALSA_snd_pcm_hw_params_set_channels) + (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int); +static int (*ALSA_snd_pcm_hw_params_get_channels) + (const snd_pcm_hw_params_t *, unsigned int *); +static int (*ALSA_snd_pcm_hw_params_set_rate_near) + (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_set_period_size_near) + (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *); +static int (*ALSA_snd_pcm_hw_params_get_period_size) + (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *); +static int (*ALSA_snd_pcm_hw_params_set_periods_near) + (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_get_periods) + (const snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_set_buffer_size_near) + (snd_pcm_t *pcm, snd_pcm_hw_params_t *, snd_pcm_uframes_t *); +static int (*ALSA_snd_pcm_hw_params_get_buffer_size) + (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *); +static int (*ALSA_snd_pcm_hw_params) (snd_pcm_t *, snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_sw_params_current) (snd_pcm_t *, + snd_pcm_sw_params_t *); +static int (*ALSA_snd_pcm_sw_params_set_start_threshold) + (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_sw_params) (snd_pcm_t *, snd_pcm_sw_params_t *); +static int (*ALSA_snd_pcm_nonblock) (snd_pcm_t *, int); +static int (*ALSA_snd_pcm_wait)(snd_pcm_t *, int); +static int (*ALSA_snd_pcm_sw_params_set_avail_min) + (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); #ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof +#define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC; static void *alsa_handle = NULL; -static int alsa_loaded = 0; - -static int (*SDL_NAME(snd_pcm_open))(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode); -static int (*SDL_NAME(snd_pcm_close))(snd_pcm_t *pcm); -static snd_pcm_sframes_t (*SDL_NAME(snd_pcm_writei))(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size); -static int (*SDL_NAME(snd_pcm_recover))(snd_pcm_t *pcm, int err, int silent); -static int (*SDL_NAME(snd_pcm_prepare))(snd_pcm_t *pcm); -static int (*SDL_NAME(snd_pcm_drain))(snd_pcm_t *pcm); -static const char *(*SDL_NAME(snd_strerror))(int errnum); -static size_t (*SDL_NAME(snd_pcm_hw_params_sizeof))(void); -static size_t (*SDL_NAME(snd_pcm_sw_params_sizeof))(void); -static void (*SDL_NAME(snd_pcm_hw_params_copy))(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src); -static int (*SDL_NAME(snd_pcm_hw_params_any))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); -static int (*SDL_NAME(snd_pcm_hw_params_set_access))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access); -static int (*SDL_NAME(snd_pcm_hw_params_set_format))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); -static int (*SDL_NAME(snd_pcm_hw_params_set_channels))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); -static int (*SDL_NAME(snd_pcm_hw_params_get_channels))(const snd_pcm_hw_params_t *params, unsigned int *val); -static int (*SDL_NAME(snd_pcm_hw_params_set_rate_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); -static int (*SDL_NAME(snd_pcm_hw_params_set_period_size_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); -static int (*SDL_NAME(snd_pcm_hw_params_get_period_size))(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); -static int (*SDL_NAME(snd_pcm_hw_params_set_periods_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); -static int (*SDL_NAME(snd_pcm_hw_params_get_periods))(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); -static int (*SDL_NAME(snd_pcm_hw_params_set_buffer_size_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); -static int (*SDL_NAME(snd_pcm_hw_params_get_buffer_size))(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); -static int (*SDL_NAME(snd_pcm_hw_params))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); -/* -*/ -static int (*SDL_NAME(snd_pcm_sw_params_set_avail_min))(snd_pcm_t *pcm, snd_pcm_sw_params_t *swparams, snd_pcm_uframes_t val); -static int (*SDL_NAME(snd_pcm_sw_params_current))(snd_pcm_t *pcm, snd_pcm_sw_params_t *swparams); -static int (*SDL_NAME(snd_pcm_sw_params_set_start_threshold))(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); -static int (*SDL_NAME(snd_pcm_sw_params))(snd_pcm_t *pcm, snd_pcm_sw_params_t *params); -static int (*SDL_NAME(snd_pcm_nonblock))(snd_pcm_t *pcm, int nonblock); -static int (*SDL_NAME(snd_pcm_wait))(snd_pcm_t *pcm, int timeout); -#define snd_pcm_hw_params_sizeof SDL_NAME(snd_pcm_hw_params_sizeof) -#define snd_pcm_sw_params_sizeof SDL_NAME(snd_pcm_sw_params_sizeof) -/* cast funcs to char* first, to please GCC's strict aliasing rules. */ -static struct { - const char *name; - void **func; -} alsa_functions[] = { - { "snd_pcm_open", (void**)(char*)&SDL_NAME(snd_pcm_open) }, - { "snd_pcm_close", (void**)(char*)&SDL_NAME(snd_pcm_close) }, - { "snd_pcm_writei", (void**)(char*)&SDL_NAME(snd_pcm_writei) }, - { "snd_pcm_recover", (void**)(char*)&SDL_NAME(snd_pcm_recover) }, - { "snd_pcm_prepare", (void**)(char*)&SDL_NAME(snd_pcm_prepare) }, - { "snd_pcm_drain", (void**)(char*)&SDL_NAME(snd_pcm_drain) }, - { "snd_strerror", (void**)(char*)&SDL_NAME(snd_strerror) }, - { "snd_pcm_hw_params_sizeof", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_sizeof) }, - { "snd_pcm_sw_params_sizeof", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_sizeof) }, - { "snd_pcm_hw_params_copy", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_copy) }, - { "snd_pcm_hw_params_any", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_any) }, - { "snd_pcm_hw_params_set_access", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_access) }, - { "snd_pcm_hw_params_set_format", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_format) }, - { "snd_pcm_hw_params_set_channels", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_channels) }, - { "snd_pcm_hw_params_get_channels", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_channels) }, - { "snd_pcm_hw_params_set_rate_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_rate_near) }, - { "snd_pcm_hw_params_set_period_size_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_period_size_near) }, - { "snd_pcm_hw_params_get_period_size", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_period_size) }, - { "snd_pcm_hw_params_set_periods_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_periods_near) }, - { "snd_pcm_hw_params_get_periods", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_periods) }, - { "snd_pcm_hw_params_set_buffer_size_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_buffer_size_near) }, - { "snd_pcm_hw_params_get_buffer_size", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_buffer_size) }, - { "snd_pcm_hw_params", (void**)(char*)&SDL_NAME(snd_pcm_hw_params) }, - { "snd_pcm_sw_params_set_avail_min", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_set_avail_min) }, - { "snd_pcm_sw_params_current", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_current) }, - { "snd_pcm_sw_params_set_start_threshold", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_set_start_threshold) }, - { "snd_pcm_sw_params", (void**)(char*)&SDL_NAME(snd_pcm_sw_params) }, - { "snd_pcm_nonblock", (void**)(char*)&SDL_NAME(snd_pcm_nonblock) }, - { "snd_pcm_wait", (void**)(char*)&SDL_NAME(snd_pcm_wait) }, -}; - -static void UnloadALSALibrary(void) { - if (alsa_loaded) { - SDL_UnloadObject(alsa_handle); - alsa_handle = NULL; - alsa_loaded = 0; - } -} +static int +load_alsa_sym(const char *fn, void **addr) +{ + *addr = SDL_LoadFunction(alsa_handle, fn); + if (*addr == NULL) { + /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ + return 0; + } -static int LoadALSALibrary(void) { - int i, retval = -1; - - alsa_handle = SDL_LoadObject(alsa_library); - if (alsa_handle) { - alsa_loaded = 1; - retval = 0; - for (i = 0; i < SDL_arraysize(alsa_functions); i++) { - *alsa_functions[i].func = SDL_LoadFunction(alsa_handle,alsa_functions[i].name); - if (!*alsa_functions[i].func) { - retval = -1; - UnloadALSALibrary(); - break; - } - } - } - return retval; + return 1; } +/* cast funcs to char* first, to please GCC's strict aliasing rules. */ +#define SDL_ALSA_SYM(x) \ + if (!load_alsa_sym(#x, (void **) (char *) &ALSA_##x)) return -1 #else +#define SDL_ALSA_SYM(x) ALSA_##x = x +#endif -static void UnloadALSALibrary(void) { - return; +static int +load_alsa_syms(void) +{ + SDL_ALSA_SYM(snd_pcm_open); + SDL_ALSA_SYM(snd_pcm_close); + SDL_ALSA_SYM(snd_pcm_writei); + SDL_ALSA_SYM(snd_pcm_recover); + SDL_ALSA_SYM(snd_pcm_prepare); + SDL_ALSA_SYM(snd_pcm_drain); + SDL_ALSA_SYM(snd_strerror); + SDL_ALSA_SYM(snd_pcm_hw_params_sizeof); + SDL_ALSA_SYM(snd_pcm_sw_params_sizeof); + SDL_ALSA_SYM(snd_pcm_hw_params_copy); + SDL_ALSA_SYM(snd_pcm_hw_params_any); + SDL_ALSA_SYM(snd_pcm_hw_params_set_access); + SDL_ALSA_SYM(snd_pcm_hw_params_set_format); + SDL_ALSA_SYM(snd_pcm_hw_params_set_channels); + SDL_ALSA_SYM(snd_pcm_hw_params_get_channels); + SDL_ALSA_SYM(snd_pcm_hw_params_set_rate_near); + SDL_ALSA_SYM(snd_pcm_hw_params_set_period_size_near); + SDL_ALSA_SYM(snd_pcm_hw_params_get_period_size); + SDL_ALSA_SYM(snd_pcm_hw_params_set_periods_near); + SDL_ALSA_SYM(snd_pcm_hw_params_get_periods); + SDL_ALSA_SYM(snd_pcm_hw_params_set_buffer_size_near); + SDL_ALSA_SYM(snd_pcm_hw_params_get_buffer_size); + SDL_ALSA_SYM(snd_pcm_hw_params); + SDL_ALSA_SYM(snd_pcm_sw_params_current); + SDL_ALSA_SYM(snd_pcm_sw_params_set_start_threshold); + SDL_ALSA_SYM(snd_pcm_sw_params); + SDL_ALSA_SYM(snd_pcm_nonblock); + SDL_ALSA_SYM(snd_pcm_wait); + SDL_ALSA_SYM(snd_pcm_sw_params_set_avail_min); + return 0; } -static int LoadALSALibrary(void) { - return 0; -} +#undef SDL_ALSA_SYM -#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */ +#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC -static const char *get_audio_device(int channels) +static void +UnloadALSALibrary(void) { - const char *device; - - device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */ - if ( device == NULL ) { - switch (channels) { - case 6: - device = "plug:surround51"; - break; - case 4: - device = "plug:surround40"; - break; - default: - device = "default"; - break; - } - } - return device; + if (alsa_handle != NULL) { + SDL_UnloadObject(alsa_handle); + alsa_handle = NULL; + } } -/* Audio driver bootstrap functions */ +static int +LoadALSALibrary(void) +{ + int retval = 0; + if (alsa_handle == NULL) { + alsa_handle = SDL_LoadObject(alsa_library); + if (alsa_handle == NULL) { + retval = -1; + /* Don't call SDL_SetError(): SDL_LoadObject already did. */ + } else { + retval = load_alsa_syms(); + if (retval < 0) { + UnloadALSALibrary(); + } + } + } + return retval; +} -static int Audio_Available(void) +#else + +static void +UnloadALSALibrary(void) { - int available; - int status; - snd_pcm_t *handle; - - available = 0; - if (LoadALSALibrary() < 0) { - return available; - } - status = SDL_NAME(snd_pcm_open)(&handle, get_audio_device(2), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); - if ( status >= 0 ) { - available = 1; - SDL_NAME(snd_pcm_close)(handle); - } - UnloadALSALibrary(); - return(available); } -static void Audio_DeleteDevice(SDL_AudioDevice *device) +static int +LoadALSALibrary(void) { - SDL_free(device->hidden); - SDL_free(device); - UnloadALSALibrary(); + load_alsa_syms(); + return 0; } -static SDL_AudioDevice *Audio_CreateDevice(int devindex) +#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */ + +static const char * +get_audio_device(int channels) { - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - LoadALSALibrary(); - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = ALSA_OpenAudio; - this->WaitAudio = ALSA_WaitAudio; - this->PlayAudio = ALSA_PlayAudio; - this->GetAudioBuf = ALSA_GetAudioBuf; - this->CloseAudio = ALSA_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; + const char *device; + + device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */ + if (device == NULL) { + switch (channels) { + case 6: + device = "plug:surround51"; + break; + case 4: + device = "plug:surround40"; + break; + default: + device = "default"; + break; + } + } + return device; } -AudioBootStrap ALSA_bootstrap = { - DRIVER_NAME, "ALSA PCM audio", - Audio_Available, Audio_CreateDevice -}; /* This function waits until it is possible to write a full sound buffer */ -static void ALSA_WaitAudio(_THIS) +static void +ALSA_WaitDevice(_THIS) { - /* We're in blocking mode, so there's nothing to do here */ + /* We're in blocking mode, so there's nothing to do here */ } +/* !!! FIXME: is there a channel swizzler in alsalib instead? */ /* * http://bugzilla.libsdl.org/show_bug.cgi?id=110 * "For Linux ALSA, this is FL-FR-RL-RR-C-LFE * and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-RL-RR" */ #define SWIZ6(T) \ - T *ptr = (T *) mixbuf; \ + T *ptr = (T *) this->hidden->mixbuf; \ Uint32 i; \ for (i = 0; i < this->spec.samples; i++, ptr += 6) { \ T tmp; \ @@ -273,22 +241,42 @@ static void ALSA_WaitAudio(_THIS) tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \ } -static __inline__ void swizzle_alsa_channels_6_64bit(_THIS) { SWIZ6(Uint64); } -static __inline__ void swizzle_alsa_channels_6_32bit(_THIS) { SWIZ6(Uint32); } -static __inline__ void swizzle_alsa_channels_6_16bit(_THIS) { SWIZ6(Uint16); } -static __inline__ void swizzle_alsa_channels_6_8bit(_THIS) { SWIZ6(Uint8); } +static __inline__ void +swizzle_alsa_channels_6_64bit(_THIS) +{ + SWIZ6(Uint64); +} + +static __inline__ void +swizzle_alsa_channels_6_32bit(_THIS) +{ + SWIZ6(Uint32); +} + +static __inline__ void +swizzle_alsa_channels_6_16bit(_THIS) +{ + SWIZ6(Uint16); +} + +static __inline__ void +swizzle_alsa_channels_6_8bit(_THIS) +{ + SWIZ6(Uint8); +} #undef SWIZ6 /* - * Called right before feeding this->mixbuf to the hardware. Swizzle channels - * from Windows/Mac order to the format alsalib will want. + * Called right before feeding this->hidden->mixbuf to the hardware. Swizzle + * channels from Windows/Mac order to the format alsalib will want. */ -static __inline__ void swizzle_alsa_channels(_THIS) +static __inline__ void +swizzle_alsa_channels(_THIS) { if (this->spec.channels == 6) { - const Uint16 fmtsize = (this->spec.format & 0xFF); /* bits/channel. */ + const Uint16 fmtsize = (this->spec.format & 0xFF); /* bits/channel. */ if (fmtsize == 16) swizzle_alsa_channels_6_16bit(this); else if (fmtsize == 8) @@ -303,317 +291,397 @@ static __inline__ void swizzle_alsa_channels(_THIS) } -static void ALSA_PlayAudio(_THIS) +static void +ALSA_PlayDevice(_THIS) { - int status; - snd_pcm_uframes_t frames_left; - const Uint8 *sample_buf = (const Uint8 *) mixbuf; - const int frame_size = (((int) (this->spec.format & 0xFF)) / 8) * this->spec.channels; - - swizzle_alsa_channels(this); - - frames_left = ((snd_pcm_uframes_t) this->spec.samples); - - while ( frames_left > 0 && this->enabled ) { - /* This works, but needs more testing before going live */ - /*SDL_NAME(snd_pcm_wait)(pcm_handle, -1);*/ - - status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left); - if ( status < 0 ) { - if ( status == -EAGAIN ) { - /* Apparently snd_pcm_recover() doesn't handle this case - does it assume snd_pcm_wait() above? */ - SDL_Delay(1); - continue; - } - status = SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0); - if ( status < 0 ) { - /* Hmm, not much we can do - abort */ - fprintf(stderr, "ALSA write failed (unrecoverable): %s\n", SDL_NAME(snd_strerror)(status)); - this->enabled = 0; - return; - } - continue; - } - sample_buf += status * frame_size; - frames_left -= status; - } + int status; + const Uint8 *sample_buf = (const Uint8 *) this->hidden->mixbuf; + const int frame_size = (((int) (this->spec.format & 0xFF)) / 8) * + this->spec.channels; + snd_pcm_uframes_t frames_left = ((snd_pcm_uframes_t) this->spec.samples); + + swizzle_alsa_channels(this); + + while ( frames_left > 0 && this->enabled ) { + /* !!! FIXME: This works, but needs more testing before going live */ + /*ALSA_snd_pcm_wait(this->hidden->pcm_handle, -1);*/ + status = ALSA_snd_pcm_writei(this->hidden->pcm_handle, + sample_buf, frames_left); + + if (status < 0) { + if (status == -EAGAIN) { + /* Apparently snd_pcm_recover() doesn't handle this case - + does it assume snd_pcm_wait() above? */ + SDL_Delay(1); + continue; + } + status = ALSA_snd_pcm_recover(this->hidden->pcm_handle, status, 0); + if (status < 0) { + /* Hmm, not much we can do - abort */ + fprintf(stderr, "ALSA write failed (unrecoverable): %s\n", + ALSA_snd_strerror(status)); + this->enabled = 0; + return; + } + continue; + } + sample_buf += status * frame_size; + frames_left -= status; + } } -static Uint8 *ALSA_GetAudioBuf(_THIS) +static Uint8 * +ALSA_GetDeviceBuf(_THIS) { - return(mixbuf); + return (this->hidden->mixbuf); } -static void ALSA_CloseAudio(_THIS) +static void +ALSA_CloseDevice(_THIS) { - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( pcm_handle ) { - SDL_NAME(snd_pcm_drain)(pcm_handle); - SDL_NAME(snd_pcm_close)(pcm_handle); - pcm_handle = NULL; - } + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->pcm_handle) { + ALSA_snd_pcm_drain(this->hidden->pcm_handle); + ALSA_snd_pcm_close(this->hidden->pcm_handle); + this->hidden->pcm_handle = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } } -static int ALSA_finalize_hardware(_THIS, SDL_AudioSpec *spec, snd_pcm_hw_params_t *hwparams, int override) +static int +ALSA_finalize_hardware(_THIS, snd_pcm_hw_params_t *hwparams, int override) { - int status; - snd_pcm_uframes_t bufsize; - - /* "set" the hardware with the desired parameters */ - status = SDL_NAME(snd_pcm_hw_params)(pcm_handle, hwparams); - if ( status < 0 ) { - return(-1); - } - - /* Get samples for the actual buffer size */ - status = SDL_NAME(snd_pcm_hw_params_get_buffer_size)(hwparams, &bufsize); - if ( status < 0 ) { - return(-1); - } - if ( !override && bufsize != spec->samples * 2 ) { - return(-1); - } - - /* FIXME: Is this safe to do? */ - spec->samples = bufsize / 2; - - /* This is useful for debugging */ - if ( getenv("SDL_AUDIO_ALSA_DEBUG") ) { - snd_pcm_uframes_t persize = 0; - unsigned int periods = 0; - - SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams, &persize, NULL); - SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams, &periods, NULL); - - fprintf(stderr, "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", persize, periods, bufsize); - } - return(0); + int status; + snd_pcm_uframes_t bufsize; + + /* "set" the hardware with the desired parameters */ + status = ALSA_snd_pcm_hw_params(this->hidden->pcm_handle, hwparams); + if ( status < 0 ) { + return(-1); + } + + /* Get samples for the actual buffer size */ + status = ALSA_snd_pcm_hw_params_get_buffer_size(hwparams, &bufsize); + if ( status < 0 ) { + return(-1); + } + if ( !override && bufsize != this->spec.samples * 2 ) { + return(-1); + } + + /* !!! FIXME: Is this safe to do? */ + this->spec.samples = bufsize / 2; + + /* This is useful for debugging */ + if ( SDL_getenv("SDL_AUDIO_ALSA_DEBUG") ) { + snd_pcm_uframes_t persize = 0; + unsigned int periods = 0; + + ALSA_snd_pcm_hw_params_get_period_size(hwparams, &persize, NULL); + ALSA_snd_pcm_hw_params_get_periods(hwparams, &periods, NULL); + + fprintf(stderr, + "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", + persize, periods, bufsize); + } + + return(0); +} + +static int +ALSA_set_period_size(_THIS, snd_pcm_hw_params_t *params, int override) +{ + const char *env; + int status; + snd_pcm_hw_params_t *hwparams; + snd_pcm_uframes_t frames; + unsigned int periods; + + /* Copy the hardware parameters for this setup */ + snd_pcm_hw_params_alloca(&hwparams); + ALSA_snd_pcm_hw_params_copy(hwparams, params); + + if ( !override ) { + env = SDL_getenv("SDL_AUDIO_ALSA_SET_PERIOD_SIZE"); + if ( env ) { + override = SDL_atoi(env); + if ( override == 0 ) { + return(-1); + } + } + } + + frames = this->spec.samples; + status = ALSA_snd_pcm_hw_params_set_period_size_near( + this->hidden->pcm_handle, hwparams, &frames, NULL); + if ( status < 0 ) { + return(-1); + } + + periods = 2; + status = ALSA_snd_pcm_hw_params_set_periods_near( + this->hidden->pcm_handle, hwparams, &periods, NULL); + if ( status < 0 ) { + return(-1); + } + + return ALSA_finalize_hardware(this, hwparams, override); } -static int ALSA_set_period_size(_THIS, SDL_AudioSpec *spec, snd_pcm_hw_params_t *params, int override) +static int +ALSA_set_buffer_size(_THIS, snd_pcm_hw_params_t *params, int override) { - const char *env; - int status; - snd_pcm_hw_params_t *hwparams; - snd_pcm_uframes_t frames; - unsigned int periods; - - /* Copy the hardware parameters for this setup */ - snd_pcm_hw_params_alloca(&hwparams); - SDL_NAME(snd_pcm_hw_params_copy)(hwparams, params); - - if ( !override ) { - env = getenv("SDL_AUDIO_ALSA_SET_PERIOD_SIZE"); - if ( env ) { - override = SDL_atoi(env); - if ( override == 0 ) { - return(-1); - } - } - } - - frames = spec->samples; - status = SDL_NAME(snd_pcm_hw_params_set_period_size_near)(pcm_handle, hwparams, &frames, NULL); - if ( status < 0 ) { - return(-1); - } - - periods = 2; - status = SDL_NAME(snd_pcm_hw_params_set_periods_near)(pcm_handle, hwparams, &periods, NULL); - if ( status < 0 ) { - return(-1); - } - - return ALSA_finalize_hardware(this, spec, hwparams, override); + const char *env; + int status; + snd_pcm_hw_params_t *hwparams; + snd_pcm_uframes_t frames; + + /* Copy the hardware parameters for this setup */ + snd_pcm_hw_params_alloca(&hwparams); + ALSA_snd_pcm_hw_params_copy(hwparams, params); + + if ( !override ) { + env = SDL_getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE"); + if ( env ) { + override = SDL_atoi(env); + if ( override == 0 ) { + return(-1); + } + } + } + + frames = this->spec.samples * 2; + status = ALSA_snd_pcm_hw_params_set_buffer_size_near( + this->hidden->pcm_handle, hwparams, &frames); + if ( status < 0 ) { + return(-1); + } + + return ALSA_finalize_hardware(this, hwparams, override); +} + +static int +ALSA_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int status = 0; + snd_pcm_t *pcm_handle = NULL; + snd_pcm_hw_params_t *hwparams = NULL; + snd_pcm_sw_params_t *swparams = NULL; + snd_pcm_format_t format = 0; + SDL_AudioFormat test_format = 0; + unsigned int rate = 0; + unsigned int channels = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + /* Name of device should depend on # channels in spec */ + status = ALSA_snd_pcm_open(&pcm_handle, + get_audio_device(this->spec.channels), + SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); + + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't open audio device: %s", + ALSA_snd_strerror(status)); + } + + this->hidden->pcm_handle = pcm_handle; + + /* Figure out what the hardware is capable of */ + snd_pcm_hw_params_alloca(&hwparams); + status = ALSA_snd_pcm_hw_params_any(pcm_handle, hwparams); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't get hardware config: %s", + ALSA_snd_strerror(status)); + } + + /* SDL only uses interleaved sample output */ + status = ALSA_snd_pcm_hw_params_set_access(pcm_handle, hwparams, + SND_PCM_ACCESS_RW_INTERLEAVED); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't set interleaved access: %s", + ALSA_snd_strerror(status)); + } + + /* Try for a closest match on audio format */ + status = -1; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + test_format && (status < 0);) { + status = 0; /* if we can't support a format, it'll become -1. */ + switch (test_format) { + case AUDIO_U8: + format = SND_PCM_FORMAT_U8; + break; + case AUDIO_S8: + format = SND_PCM_FORMAT_S8; + break; + case AUDIO_S16LSB: + format = SND_PCM_FORMAT_S16_LE; + break; + case AUDIO_S16MSB: + format = SND_PCM_FORMAT_S16_BE; + break; + case AUDIO_U16LSB: + format = SND_PCM_FORMAT_U16_LE; + break; + case AUDIO_U16MSB: + format = SND_PCM_FORMAT_U16_BE; + break; + case AUDIO_S32LSB: + format = SND_PCM_FORMAT_S32_LE; + break; + case AUDIO_S32MSB: + format = SND_PCM_FORMAT_S32_BE; + break; + case AUDIO_F32LSB: + format = SND_PCM_FORMAT_FLOAT_LE; + break; + case AUDIO_F32MSB: + format = SND_PCM_FORMAT_FLOAT_BE; + break; + default: + status = -1; + break; + } + if (status >= 0) { + status = ALSA_snd_pcm_hw_params_set_format(pcm_handle, + hwparams, format); + } + if (status < 0) { + test_format = SDL_NextAudioFormat(); + } + } + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't find any hardware audio formats"); + } + this->spec.format = test_format; + + /* Set the number of channels */ + status = ALSA_snd_pcm_hw_params_set_channels(pcm_handle, hwparams, + this->spec.channels); + channels = this->spec.channels; + if (status < 0) { + status = ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't set audio channels"); + } + this->spec.channels = channels; + } + + /* Set the audio rate */ + rate = this->spec.freq; + status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, + &rate, NULL); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't set audio frequency: %s", + ALSA_snd_strerror(status)); + } + this->spec.freq = rate; + + /* Set the buffer size, in samples */ + if ( ALSA_set_period_size(this, hwparams, 0) < 0 && + ALSA_set_buffer_size(this, hwparams, 0) < 0 ) { + /* Failed to set desired buffer size, do the best you can... */ + if ( ALSA_set_period_size(this, hwparams, 1) < 0 ) { + ALSA_CloseDevice(this); + return SDL_SetError("Couldn't set hardware audio parameters: %s", ALSA_snd_strerror(status)); + } + } + /* Set the software parameters */ + snd_pcm_sw_params_alloca(&swparams); + status = ALSA_snd_pcm_sw_params_current(pcm_handle, swparams); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't get software config: %s", + ALSA_snd_strerror(status)); + } + status = ALSA_snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, this->spec.samples); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("Couldn't set minimum available samples: %s", + ALSA_snd_strerror(status)); + } + status = + ALSA_snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, 1); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("ALSA: Couldn't set start threshold: %s", + ALSA_snd_strerror(status)); + } + status = ALSA_snd_pcm_sw_params(pcm_handle, swparams); + if (status < 0) { + ALSA_CloseDevice(this); + return SDL_SetError("Couldn't set software audio parameters: %s", + ALSA_snd_strerror(status)); + } + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + ALSA_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen); + + /* Switch to blocking mode for playback */ + ALSA_snd_pcm_nonblock(pcm_handle, 0); + + /* We're ready to rock and roll. :-) */ + return 0; } -static int ALSA_set_buffer_size(_THIS, SDL_AudioSpec *spec, snd_pcm_hw_params_t *params, int override) +static void +ALSA_Deinitialize(void) { - const char *env; - int status; - snd_pcm_hw_params_t *hwparams; - snd_pcm_uframes_t frames; - - /* Copy the hardware parameters for this setup */ - snd_pcm_hw_params_alloca(&hwparams); - SDL_NAME(snd_pcm_hw_params_copy)(hwparams, params); - - if ( !override ) { - env = getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE"); - if ( env ) { - override = SDL_atoi(env); - if ( override == 0 ) { - return(-1); - } - } - } - - frames = spec->samples * 2; - status = SDL_NAME(snd_pcm_hw_params_set_buffer_size_near)(pcm_handle, hwparams, &frames); - if ( status < 0 ) { - return(-1); - } - - return ALSA_finalize_hardware(this, spec, hwparams, override); + UnloadALSALibrary(); } -static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +ALSA_Init(SDL_AudioDriverImpl * impl) { - int status; - snd_pcm_hw_params_t *hwparams; - snd_pcm_sw_params_t *swparams; - snd_pcm_format_t format; - unsigned int rate; - unsigned int channels; - Uint16 test_format; - - /* Open the audio device */ - /* Name of device should depend on # channels in spec */ - status = SDL_NAME(snd_pcm_open)(&pcm_handle, get_audio_device(spec->channels), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); - - if ( status < 0 ) { - SDL_SetError("Couldn't open audio device: %s", SDL_NAME(snd_strerror)(status)); - return(-1); - } - - /* Figure out what the hardware is capable of */ - snd_pcm_hw_params_alloca(&hwparams); - status = SDL_NAME(snd_pcm_hw_params_any)(pcm_handle, hwparams); - if ( status < 0 ) { - SDL_SetError("Couldn't get hardware config: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - - /* SDL only uses interleaved sample output */ - status = SDL_NAME(snd_pcm_hw_params_set_access)(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED); - if ( status < 0 ) { - SDL_SetError("Couldn't set interleaved access: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - - /* Try for a closest match on audio format */ - status = -1; - for ( test_format = SDL_FirstAudioFormat(spec->format); - test_format && (status < 0); ) { - switch ( test_format ) { - case AUDIO_U8: - format = SND_PCM_FORMAT_U8; - break; - case AUDIO_S8: - format = SND_PCM_FORMAT_S8; - break; - case AUDIO_S16LSB: - format = SND_PCM_FORMAT_S16_LE; - break; - case AUDIO_S16MSB: - format = SND_PCM_FORMAT_S16_BE; - break; - case AUDIO_U16LSB: - format = SND_PCM_FORMAT_U16_LE; - break; - case AUDIO_U16MSB: - format = SND_PCM_FORMAT_U16_BE; - break; - default: - format = 0; - break; - } - if ( format != 0 ) { - status = SDL_NAME(snd_pcm_hw_params_set_format)(pcm_handle, hwparams, format); - } - if ( status < 0 ) { - test_format = SDL_NextAudioFormat(); - } - } - if ( status < 0 ) { - SDL_SetError("Couldn't find any hardware audio formats"); - ALSA_CloseAudio(this); - return(-1); - } - spec->format = test_format; - - /* Set the number of channels */ - status = SDL_NAME(snd_pcm_hw_params_set_channels)(pcm_handle, hwparams, spec->channels); - channels = spec->channels; - if ( status < 0 ) { - status = SDL_NAME(snd_pcm_hw_params_get_channels)(hwparams, &channels); - if ( status < 0 ) { - SDL_SetError("Couldn't set audio channels"); - ALSA_CloseAudio(this); - return(-1); - } - spec->channels = channels; - } - - /* Set the audio rate */ - rate = spec->freq; - - status = SDL_NAME(snd_pcm_hw_params_set_rate_near)(pcm_handle, hwparams, &rate, NULL); - if ( status < 0 ) { - SDL_SetError("Couldn't set audio frequency: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - spec->freq = rate; - - /* Set the buffer size, in samples */ - if ( ALSA_set_period_size(this, spec, hwparams, 0) < 0 && - ALSA_set_buffer_size(this, spec, hwparams, 0) < 0 ) { - /* Failed to set desired buffer size, do the best you can... */ - if ( ALSA_set_period_size(this, spec, hwparams, 1) < 0 ) { - SDL_SetError("Couldn't set hardware audio parameters: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - } - - /* Set the software parameters */ - snd_pcm_sw_params_alloca(&swparams); - status = SDL_NAME(snd_pcm_sw_params_current)(pcm_handle, swparams); - if ( status < 0 ) { - SDL_SetError("Couldn't get software config: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - status = SDL_NAME(snd_pcm_sw_params_set_avail_min)(pcm_handle, swparams, spec->samples); - if ( status < 0 ) { - SDL_SetError("Couldn't set minimum available samples: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - status = SDL_NAME(snd_pcm_sw_params_set_start_threshold)(pcm_handle, swparams, 1); - if ( status < 0 ) { - SDL_SetError("Couldn't set start threshold: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - status = SDL_NAME(snd_pcm_sw_params)(pcm_handle, swparams); - if ( status < 0 ) { - SDL_SetError("Couldn't set software audio parameters: %s", SDL_NAME(snd_strerror)(status)); - ALSA_CloseAudio(this); - return(-1); - } - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - /* Allocate mixing buffer */ - mixlen = spec->size; - mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); - if ( mixbuf == NULL ) { - ALSA_CloseAudio(this); - return(-1); - } - SDL_memset(mixbuf, spec->silence, spec->size); - - /* Switch to blocking mode for playback */ - SDL_NAME(snd_pcm_nonblock)(pcm_handle, 0); - - /* We're ready to rock and roll. :-) */ - return(0); + if (LoadALSALibrary() < 0) { + return 0; + } + + /* Set the function pointers */ + impl->OpenDevice = ALSA_OpenDevice; + impl->WaitDevice = ALSA_WaitDevice; + impl->GetDeviceBuf = ALSA_GetDeviceBuf; + impl->PlayDevice = ALSA_PlayDevice; + impl->CloseDevice = ALSA_CloseDevice; + impl->Deinitialize = ALSA_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: Add device enum! */ + + return 1; /* this audio target is available. */ } + + +AudioBootStrap ALSA_bootstrap = { + "alsa", "ALSA PCM audio", ALSA_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_ALSA */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/alsa/SDL_alsa_audio.h b/src/audio/alsa/SDL_alsa_audio.h index 55ae87b8ac..31c6534038 100644 --- a/src/audio/alsa/SDL_alsa_audio.h +++ b/src/audio/alsa/SDL_alsa_audio.h @@ -1,48 +1,45 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" -#ifndef _ALSA_PCM_audio_h -#define _ALSA_PCM_audio_h +#ifndef _SDL_ALSA_audio_h +#define _SDL_ALSA_audio_h #include #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this -struct SDL_PrivateAudioData { - /* The audio device handle */ - snd_pcm_t *pcm_handle; +struct SDL_PrivateAudioData +{ + /* The audio device handle */ + snd_pcm_t *pcm_handle; - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; }; -/* Old variable names */ -#define pcm_handle (this->hidden->pcm_handle) -#define mixbuf (this->hidden->mixbuf) -#define mixlen (this->hidden->mixlen) +#endif /* _SDL_ALSA_audio_h */ -#endif /* _ALSA_PCM_audio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/android/SDL_androidaudio.c b/src/audio/android/SDL_androidaudio.c new file mode 100644 index 0000000000..94e27f32f9 --- /dev/null +++ b/src/audio/android/SDL_androidaudio.c @@ -0,0 +1,141 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_ANDROID + +/* Output audio to Android */ + +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "SDL_androidaudio.h" + +#include "../../core/android/SDL_android.h" + +#include + +static void * audioDevice; + +static int +AndroidAUD_OpenDevice(_THIS, const char *devname, int iscapture) +{ + SDL_AudioFormat test_format; + + if (iscapture) { + /* TODO: implement capture */ + return SDL_SetError("Capture not supported on Android"); + } + + if (audioDevice != NULL) { + return SDL_SetError("Only one audio device at a time please!"); + } + + audioDevice = this; + + test_format = SDL_FirstAudioFormat(this->spec.format); + while (test_format != 0) { /* no "UNKNOWN" constant */ + if ((test_format == AUDIO_U8) || (test_format == AUDIO_S16LSB)) { + this->spec.format = test_format; + break; + } + test_format = SDL_NextAudioFormat(); + } + + if (test_format == 0) { + /* Didn't find a compatible format :( */ + return SDL_SetError("No compatible audio format!"); + } + + if (this->spec.channels > 1) { + this->spec.channels = 2; + } else { + this->spec.channels = 1; + } + + if (this->spec.freq < 8000) { + this->spec.freq = 8000; + } + if (this->spec.freq > 48000) { + this->spec.freq = 48000; + } + + /* TODO: pass in/return a (Java) device ID, also whether we're opening for input or output */ + this->spec.samples = Android_JNI_OpenAudioDevice(this->spec.freq, this->spec.format == AUDIO_U8 ? 0 : 1, this->spec.channels, this->spec.samples); + SDL_CalculateAudioSpec(&this->spec); + + if (this->spec.samples == 0) { + /* Init failed? */ + return SDL_SetError("Java-side initialization failed!"); + } + + return 0; +} + +static void +AndroidAUD_PlayDevice(_THIS) +{ + Android_JNI_WriteAudioBuffer(); +} + +static Uint8 * +AndroidAUD_GetDeviceBuf(_THIS) +{ + return Android_JNI_GetAudioBuffer(); +} + +static void +AndroidAUD_CloseDevice(_THIS) +{ + /* At this point SDL_CloseAudioDevice via close_audio_device took care of terminating the audio thread + so it's safe to terminate the Java side buffer and AudioTrack + */ + Android_JNI_CloseAudioDevice(); + + if (audioDevice == this) { + audioDevice = NULL; + } +} + +static int +AndroidAUD_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = AndroidAUD_OpenDevice; + impl->PlayDevice = AndroidAUD_PlayDevice; + impl->GetDeviceBuf = AndroidAUD_GetDeviceBuf; + impl->CloseDevice = AndroidAUD_CloseDevice; + + /* and the capabilities */ + impl->HasCaptureSupport = 0; /* TODO */ + impl->OnlyHasDefaultOutputDevice = 1; + impl->OnlyHasDefaultInputDevice = 1; + + return 1; /* this audio target is available. */ +} + +AudioBootStrap ANDROIDAUD_bootstrap = { + "android", "SDL Android audio driver", AndroidAUD_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/src/audio/android/SDL_androidaudio.h b/src/audio/android/SDL_androidaudio.h new file mode 100644 index 0000000000..c02ad1a7a3 --- /dev/null +++ b/src/audio/android/SDL_androidaudio.h @@ -0,0 +1,39 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_androidaudio_h +#define _SDL_androidaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ +}; + +static void AndroidAUD_CloseDevice(_THIS); + +#endif /* _SDL_androidaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c index 373f8c1677..ac0bb9d5d0 100644 --- a/src/audio/arts/SDL_artsaudio.c +++ b/src/audio/arts/SDL_artsaudio.c @@ -1,38 +1,39 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_ARTS + /* Allow access to a raw mixing buffer */ #ifdef HAVE_SIGNAL_H #include #endif #include +#include #include "SDL_timer.h" #include "SDL_audio.h" #include "../SDL_audiomem.h" #include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" #include "SDL_artsaudio.h" #ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC @@ -42,321 +43,344 @@ #define SDL_NAME(X) X #endif -/* The tag name used by artsc audio */ -#define ARTS_DRIVER_NAME "arts" - -/* Audio driver functions */ -static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void ARTS_WaitAudio(_THIS); -static void ARTS_PlayAudio(_THIS); -static Uint8 *ARTS_GetAudioBuf(_THIS); -static void ARTS_CloseAudio(_THIS); - #ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC; static void *arts_handle = NULL; -static int arts_loaded = 0; - -static int (*SDL_NAME(arts_init))(void); -static void (*SDL_NAME(arts_free))(void); -static arts_stream_t (*SDL_NAME(arts_play_stream))(int rate, int bits, int channels, const char *name); -static int (*SDL_NAME(arts_stream_set))(arts_stream_t s, arts_parameter_t param, int value); -static int (*SDL_NAME(arts_stream_get))(arts_stream_t s, arts_parameter_t param); -static int (*SDL_NAME(arts_write))(arts_stream_t s, const void *buffer, int count); -static void (*SDL_NAME(arts_close_stream))(arts_stream_t s); + +/* !!! FIXME: I hate this SDL_NAME clutter...it makes everything so messy! */ +static int (*SDL_NAME(arts_init)) (void); +static void (*SDL_NAME(arts_free)) (void); +static arts_stream_t(*SDL_NAME(arts_play_stream)) (int rate, int bits, + int channels, + const char *name); +static int (*SDL_NAME(arts_stream_set)) (arts_stream_t s, + arts_parameter_t param, int value); +static int (*SDL_NAME(arts_stream_get)) (arts_stream_t s, + arts_parameter_t param); +static int (*SDL_NAME(arts_write)) (arts_stream_t s, const void *buffer, + int count); +static void (*SDL_NAME(arts_close_stream)) (arts_stream_t s); static int (*SDL_NAME(arts_suspend))(void); -static int (*SDL_NAME(arts_suspended))(void); -static const char *(*SDL_NAME(arts_error_text))(int errorcode); +static int (*SDL_NAME(arts_suspended)) (void); +static const char *(*SDL_NAME(arts_error_text)) (int errorcode); -static struct { - const char *name; - void **func; +#define SDL_ARTS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } +static struct +{ + const char *name; + void **func; } arts_functions[] = { - { "arts_init", (void **)&SDL_NAME(arts_init) }, - { "arts_free", (void **)&SDL_NAME(arts_free) }, - { "arts_play_stream", (void **)&SDL_NAME(arts_play_stream) }, - { "arts_stream_set", (void **)&SDL_NAME(arts_stream_set) }, - { "arts_stream_get", (void **)&SDL_NAME(arts_stream_get) }, - { "arts_write", (void **)&SDL_NAME(arts_write) }, - { "arts_close_stream", (void **)&SDL_NAME(arts_close_stream) }, - { "arts_suspend", (void **)&SDL_NAME(arts_suspend) }, - { "arts_suspended", (void **)&SDL_NAME(arts_suspended) }, - { "arts_error_text", (void **)&SDL_NAME(arts_error_text) }, +/* *INDENT-OFF* */ + SDL_ARTS_SYM(arts_init), + SDL_ARTS_SYM(arts_free), + SDL_ARTS_SYM(arts_play_stream), + SDL_ARTS_SYM(arts_stream_set), + SDL_ARTS_SYM(arts_stream_get), + SDL_ARTS_SYM(arts_write), + SDL_ARTS_SYM(arts_close_stream), + SDL_ARTS_SYM(arts_suspend), + SDL_ARTS_SYM(arts_suspended), + SDL_ARTS_SYM(arts_error_text), +/* *INDENT-ON* */ }; -static void UnloadARTSLibrary() +#undef SDL_ARTS_SYM + +static void +UnloadARTSLibrary() { - if ( arts_loaded ) { - SDL_UnloadObject(arts_handle); - arts_handle = NULL; - arts_loaded = 0; - } + if (arts_handle != NULL) { + SDL_UnloadObject(arts_handle); + arts_handle = NULL; + } } -static int LoadARTSLibrary(void) +static int +LoadARTSLibrary(void) { - int i, retval = -1; - - arts_handle = SDL_LoadObject(arts_library); - if ( arts_handle ) { - arts_loaded = 1; - retval = 0; - for ( i=0; ihidden->parent && (((++cnt) % 10) == 0)) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { + this->enabled = 0; + } + } + } + + /* Use timer for general audio synchronization */ + ticks = + ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); + } } -static void Audio_DeleteDevice(SDL_AudioDevice *device) +static void +ARTS_PlayDevice(_THIS) { - SDL_free(device->hidden); - SDL_free(device); - UnloadARTSLibrary(); + /* Write the audio data */ + int written = SDL_NAME(arts_write) (this->hidden->stream, + this->hidden->mixbuf, + this->hidden->mixlen); + + /* If timer synchronization is enabled, set the next write frame */ + if (this->hidden->frame_ticks) { + this->hidden->next_frame += this->hidden->frame_ticks; + } + + /* If we couldn't write, assume fatal error for now */ + if (written < 0) { + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", written); +#endif } -static SDL_AudioDevice *Audio_CreateDevice(int devindex) +static void +ARTS_WaitDone(_THIS) { - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - LoadARTSLibrary(); - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - stream = 0; - - /* Set the function pointers */ - this->OpenAudio = ARTS_OpenAudio; - this->WaitAudio = ARTS_WaitAudio; - this->PlayAudio = ARTS_PlayAudio; - this->GetAudioBuf = ARTS_GetAudioBuf; - this->CloseAudio = ARTS_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; + /* !!! FIXME: camp here until buffer drains... SDL_Delay(???); */ } -AudioBootStrap ARTS_bootstrap = { - ARTS_DRIVER_NAME, "Analog Realtime Synthesizer", - Audio_Available, Audio_CreateDevice -}; -/* This function waits until it is possible to write a full sound buffer */ -static void ARTS_WaitAudio(_THIS) +static Uint8 * +ARTS_GetDeviceBuf(_THIS) { - Sint32 ticks; - - /* Check to see if the thread-parent process is still alive */ - { static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */ - if ( kill(parent, 0) < 0 ) { - this->enabled = 0; - } - } - } - - /* Use timer for general audio synchronization */ - ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS; - if ( ticks > 0 ) { - SDL_Delay(ticks); - } + return (this->hidden->mixbuf); } -static void ARTS_PlayAudio(_THIS) -{ - int written; - - /* Write the audio data */ - written = SDL_NAME(arts_write)(stream, mixbuf, mixlen); - - /* If timer synchronization is enabled, set the next write frame */ - if ( frame_ticks ) { - next_frame += frame_ticks; - } - - /* If we couldn't write, assume fatal error for now */ - if ( written < 0 ) { - this->enabled = 0; - } -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", written); -#endif -} -static Uint8 *ARTS_GetAudioBuf(_THIS) +static void +ARTS_CloseDevice(_THIS) { - return(mixbuf); + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->stream) { + SDL_NAME(arts_close_stream) (this->hidden->stream); + this->hidden->stream = 0; + } + SDL_NAME(arts_free) (); + SDL_free(this->hidden); + this->hidden = NULL; + } } -static void ARTS_CloseAudio(_THIS) +static int +ARTS_Suspend(void) { - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( stream ) { - SDL_NAME(arts_close_stream)(stream); - stream = 0; - } - SDL_NAME(arts_free)(); + const Uint32 abortms = SDL_GetTicks() + 3000; /* give up after 3 secs */ + while ( (!SDL_NAME(arts_suspended)()) && (SDL_GetTicks() < abortms) ) { + if ( SDL_NAME(arts_suspend)() ) { + break; + } + } + return SDL_NAME(arts_suspended)(); } -static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +ARTS_OpenDevice(_THIS, const char *devname, int iscapture) { - int bits, frag_spec; - Uint16 test_format, format; - int error_code; - - /* Reset the timer synchronization flag */ - frame_ticks = 0.0; - - mixbuf = NULL; - - /* Try for a closest match on audio format */ - format = 0; - bits = 0; - for ( test_format = SDL_FirstAudioFormat(spec->format); - ! format && test_format; ) { + int rc = 0; + int bits = 0, frag_spec = 0; + SDL_AudioFormat test_format = 0, format = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { #ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); #endif - switch ( test_format ) { - case AUDIO_U8: - bits = 8; - format = 1; - break; - case AUDIO_S16LSB: - bits = 16; - format = 1; - break; - default: - format = 0; - break; - } - if ( ! format ) { - test_format = SDL_NextAudioFormat(); - } - } - if ( format == 0 ) { - SDL_SetError("Couldn't find any hardware audio formats"); - return(-1); - } - spec->format = test_format; - - error_code = SDL_NAME(arts_init)(); - if ( error_code != 0 ) { - SDL_SetError("Unable to initialize ARTS: %s", SDL_NAME(arts_error_text)(error_code)); - return(-1); - } - if ( ! ARTS_Suspend() ) { - SDL_SetError("ARTS can not open audio device"); - return(-1); - } - stream = SDL_NAME(arts_play_stream)(spec->freq, bits, spec->channels, "SDL"); - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - /* Determine the power of two of the fragment size */ - for ( frag_spec = 0; (0x01<size; ++frag_spec ); - if ( (0x01<size ) { - SDL_SetError("Fragment size must be a power of two"); - return(-1); - } - frag_spec |= 0x00020000; /* two fragments, for low latency */ + switch (test_format) { + case AUDIO_U8: + bits = 8; + format = 1; + break; + case AUDIO_S16LSB: + bits = 16; + format = 1; + break; + default: + format = 0; + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { + ARTS_CloseDevice(this); + return SDL_SetError("Couldn't find any hardware audio formats"); + } + this->spec.format = test_format; + + if ((rc = SDL_NAME(arts_init) ()) != 0) { + ARTS_CloseDevice(this); + return SDL_SetError("Unable to initialize ARTS: %s", + SDL_NAME(arts_error_text) (rc)); + } + + if (!ARTS_Suspend()) { + ARTS_CloseDevice(this); + return SDL_SetError("ARTS can not open audio device"); + } + + this->hidden->stream = SDL_NAME(arts_play_stream) (this->spec.freq, + bits, + this->spec.channels, + "SDL"); + + /* Play nothing so we have at least one write (server bug workaround). */ + SDL_NAME(arts_write) (this->hidden->stream, "", 0); + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Determine the power of two of the fragment size */ + for (frag_spec = 0; (0x01 << frag_spec) < this->spec.size; ++frag_spec); + if ((0x01 << frag_spec) != this->spec.size) { + ARTS_CloseDevice(this); + return SDL_SetError("Fragment size must be a power of two"); + } + frag_spec |= 0x00020000; /* two fragments, for low latency */ #ifdef ARTS_P_PACKET_SETTINGS - SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SETTINGS, frag_spec); + SDL_NAME(arts_stream_set) (this->hidden->stream, + ARTS_P_PACKET_SETTINGS, frag_spec); #else - SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SIZE, frag_spec&0xffff); - SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_COUNT, frag_spec>>16); + SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_SIZE, + frag_spec & 0xffff); + SDL_NAME(arts_stream_set) (this->hidden->stream, ARTS_P_PACKET_COUNT, + frag_spec >> 16); #endif - spec->size = SDL_NAME(arts_stream_get)(stream, ARTS_P_PACKET_SIZE); + this->spec.size = SDL_NAME(arts_stream_get) (this->hidden->stream, + ARTS_P_PACKET_SIZE); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + ARTS_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* Get the parent process id (we're the parent of the audio thread) */ + this->hidden->parent = getpid(); + + /* We're ready to rock and roll. :-) */ + return 0; +} - /* Allocate mixing buffer */ - mixlen = spec->size; - mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); - if ( mixbuf == NULL ) { - return(-1); - } - SDL_memset(mixbuf, spec->silence, spec->size); - /* Get the parent process id (we're the parent of the audio thread) */ - parent = getpid(); +static void +ARTS_Deinitialize(void) +{ + UnloadARTSLibrary(); +} + - /* We're ready to rock and roll. :-) */ - return(0); +static int +ARTS_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadARTSLibrary() < 0) { + return 0; + } else { + if (SDL_NAME(arts_init) () != 0) { + UnloadARTSLibrary(); + SDL_SetError("ARTS: arts_init failed (no audio server?)"); + return 0; + } + + /* Play a stream so aRts doesn't crash */ + if (ARTS_Suspend()) { + arts_stream_t stream; + stream = SDL_NAME(arts_play_stream) (44100, 16, 2, "SDL"); + SDL_NAME(arts_write) (stream, "", 0); + SDL_NAME(arts_close_stream) (stream); + } + + SDL_NAME(arts_free) (); + } + + /* Set the function pointers */ + impl->OpenDevice = ARTS_OpenDevice; + impl->PlayDevice = ARTS_PlayDevice; + impl->WaitDevice = ARTS_WaitDevice; + impl->GetDeviceBuf = ARTS_GetDeviceBuf; + impl->CloseDevice = ARTS_CloseDevice; + impl->WaitDone = ARTS_WaitDone; + impl->Deinitialize = ARTS_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; /* this audio target is available. */ } + + +AudioBootStrap ARTS_bootstrap = { + "arts", "Analog RealTime Synthesizer", ARTS_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_ARTS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/arts/SDL_artsaudio.h b/src/audio/arts/SDL_artsaudio.h index de3b22822c..1387cc5c06 100644 --- a/src/audio/arts/SDL_artsaudio.h +++ b/src/audio/arts/SDL_artsaudio.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -28,33 +27,26 @@ #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this -struct SDL_PrivateAudioData { - /* The stream descriptor for the audio device */ - arts_stream_t stream; +struct SDL_PrivateAudioData +{ + /* The stream descriptor for the audio device */ + arts_stream_t stream; - /* The parent process id, to detect when application quits */ - pid_t parent; + /* The parent process id, to detect when application quits */ + pid_t parent; - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; - /* Support for audio timing using a timer, in addition to select() */ - float frame_ticks; - float next_frame; + /* Support for audio timing using a timer, in addition to select() */ + float frame_ticks; + float next_frame; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -/* Old variable names */ -#define stream (this->hidden->stream) -#define parent (this->hidden->parent) -#define mixbuf (this->hidden->mixbuf) -#define mixlen (this->hidden->mixlen) -#define frame_ticks (this->hidden->frame_ticks) -#define next_frame (this->hidden->next_frame) +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ #endif /* _SDL_artscaudio_h */ - +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc index de635f8bad..e2edf85fba 100644 --- a/src/audio/baudio/SDL_beaudio.cc +++ b/src/audio/baudio/SDL_beaudio.cc @@ -1,33 +1,35 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_BEOSAUDIO + /* Allow access to the audio stream on BeOS */ #include #include "../../main/beos/SDL_BeApp.h" -extern "C" { +extern "C" +{ #include "SDL_audio.h" #include "../SDL_audio_c.h" @@ -35,191 +37,179 @@ extern "C" { #include "../../thread/beos/SDL_systhread_c.h" #include "SDL_beaudio.h" - -/* Audio driver functions */ -static int BE_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void BE_WaitAudio(_THIS); -static void BE_PlayAudio(_THIS); -static Uint8 *BE_GetAudioBuf(_THIS); -static void BE_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - return(1); } -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *device; - - /* Initialize all variables that we clean on shutdown */ - device = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( device ) { - SDL_memset(device, 0, (sizeof *device)); - device->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *device->hidden)); - } - if ( (device == NULL) || (device->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( device ) { - SDL_free(device); - } - return(0); - } - SDL_memset(device->hidden, 0, (sizeof *device->hidden)); - - /* Set the function pointers */ - device->OpenAudio = BE_OpenAudio; - device->WaitAudio = BE_WaitAudio; - device->PlayAudio = BE_PlayAudio; - device->GetAudioBuf = BE_GetAudioBuf; - device->CloseAudio = BE_CloseAudio; - - device->free = Audio_DeleteDevice; - - return device; -} - -AudioBootStrap BAUDIO_bootstrap = { - "baudio", "BeOS BSoundPlayer", - Audio_Available, Audio_CreateDevice -}; +/* !!! FIXME: have the callback call the higher level to avoid code dupe. */ /* The BeOS callback for handling the audio buffer */ -static void FillSound(void *device, void *stream, size_t len, - const media_raw_audio_format &format) +static void +FillSound(void *device, void *stream, size_t len, + const media_raw_audio_format & format) { - SDL_AudioDevice *audio = (SDL_AudioDevice *)device; - - /* Silence the buffer, since it's ours */ - SDL_memset(stream, audio->spec.silence, len); - - /* Only do soemthing if audio is enabled */ - if ( ! audio->enabled ) - return; - - if ( ! audio->paused ) { - if ( audio->convert.needed ) { - SDL_mutexP(audio->mixer_lock); - (*audio->spec.callback)(audio->spec.userdata, - (Uint8 *)audio->convert.buf,audio->convert.len); - SDL_mutexV(audio->mixer_lock); - SDL_ConvertAudio(&audio->convert); - SDL_memcpy(stream,audio->convert.buf,audio->convert.len_cvt); - } else { - SDL_mutexP(audio->mixer_lock); - (*audio->spec.callback)(audio->spec.userdata, - (Uint8 *)stream, len); - SDL_mutexV(audio->mixer_lock); - } - } - return; + SDL_AudioDevice *audio = (SDL_AudioDevice *) device; + + /* Only do soemthing if audio is enabled */ + if (!audio->enabled) + return; + + if (!audio->paused) { + if (audio->convert.needed) { + SDL_LockMutex(audio->mixer_lock); + (*audio->spec.callback) (audio->spec.userdata, + (Uint8 *) audio->convert.buf, + audio->convert.len); + SDL_UnlockMutex(audio->mixer_lock); + SDL_ConvertAudio(&audio->convert); + SDL_memcpy(stream, audio->convert.buf, audio->convert.len_cvt); + } else { + SDL_LockMutex(audio->mixer_lock); + (*audio->spec.callback) (audio->spec.userdata, + (Uint8 *) stream, len); + SDL_UnlockMutex(audio->mixer_lock); + } + } } -/* Dummy functions -- we don't use thread-based audio */ -void BE_WaitAudio(_THIS) -{ - return; -} -void BE_PlayAudio(_THIS) -{ - return; -} -Uint8 *BE_GetAudioBuf(_THIS) +static void +BEOSAUDIO_CloseDevice(_THIS) { - return(NULL); -} + if (_this->hidden != NULL) { + if (_this->hidden->audio_obj) { + _this->hidden->audio_obj->Stop(); + delete _this->hidden->audio_obj; + _this->hidden->audio_obj = NULL; + } -void BE_CloseAudio(_THIS) -{ - if ( audio_obj ) { - audio_obj->Stop(); - delete audio_obj; - audio_obj = NULL; - } - - /* Quit the Be Application, if there's nothing left to do */ - SDL_QuitBeApp(); + delete _this->hidden; + _this->hidden = NULL; + } } -int BE_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +BEOSAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) { int valid_datatype = 0; media_raw_audio_format format; - Uint16 test_format = SDL_FirstAudioFormat(spec->format); + SDL_AudioFormat test_format = SDL_FirstAudioFormat(_this->spec.format); + + /* Initialize all variables that we clean on shutdown */ + _this->hidden = new SDL_PrivateAudioData; + if (_this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(_this->hidden, 0, (sizeof *_this->hidden)); /* Parse the audio format and fill the Be raw audio format */ - memset(&format, '\0', sizeof (media_raw_audio_format)); + SDL_memset(&format, '\0', sizeof(media_raw_audio_format)); format.byte_order = B_MEDIA_LITTLE_ENDIAN; - format.frame_rate = (float) spec->freq; - format.channel_count = spec->channels; /* !!! FIXME: support > 2? */ + format.frame_rate = (float) _this->spec.freq; + format.channel_count = _this->spec.channels; /* !!! FIXME: support > 2? */ while ((!valid_datatype) && (test_format)) { valid_datatype = 1; - spec->format = test_format; + _this->spec.format = test_format; switch (test_format) { - case AUDIO_S8: - format.format = media_raw_audio_format::B_AUDIO_CHAR; - break; - - case AUDIO_U8: - format.format = media_raw_audio_format::B_AUDIO_UCHAR; - break; - - case AUDIO_S16LSB: - format.format = media_raw_audio_format::B_AUDIO_SHORT; - break; - - case AUDIO_S16MSB: - format.format = media_raw_audio_format::B_AUDIO_SHORT; - format.byte_order = B_MEDIA_BIG_ENDIAN; - break; - - default: - valid_datatype = 0; - test_format = SDL_NextAudioFormat(); - break; + case AUDIO_S8: + format.format = media_raw_audio_format::B_AUDIO_CHAR; + break; + + case AUDIO_U8: + format.format = media_raw_audio_format::B_AUDIO_UCHAR; + break; + + case AUDIO_S16LSB: + format.format = media_raw_audio_format::B_AUDIO_SHORT; + break; + + case AUDIO_S16MSB: + format.format = media_raw_audio_format::B_AUDIO_SHORT; + format.byte_order = B_MEDIA_BIG_ENDIAN; + break; + + case AUDIO_S32LSB: + format.format = media_raw_audio_format::B_AUDIO_INT; + break; + + case AUDIO_S32MSB: + format.format = media_raw_audio_format::B_AUDIO_INT; + format.byte_order = B_MEDIA_BIG_ENDIAN; + break; + + case AUDIO_F32LSB: + format.format = media_raw_audio_format::B_AUDIO_FLOAT; + break; + + case AUDIO_F32MSB: + format.format = media_raw_audio_format::B_AUDIO_FLOAT; + format.byte_order = B_MEDIA_BIG_ENDIAN; + break; + + default: + valid_datatype = 0; + test_format = SDL_NextAudioFormat(); + break; } } - if (!valid_datatype) { /* shouldn't happen, but just in case... */ - SDL_SetError("Unsupported audio format"); - return (-1); + if (!valid_datatype) { /* shouldn't happen, but just in case... */ + BEOSAUDIO_CloseDevice(_this); + return SDL_SetError("Unsupported audio format"); } + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&_this->spec); + + format.buffer_size = _this->spec.size; + + /* Subscribe to the audio stream (creates a new thread) */ + sigset_t omask; + SDL_MaskSignals(&omask); + _this->hidden->audio_obj = new BSoundPlayer(&format, "SDL Audio", + FillSound, NULL, _this); + SDL_UnmaskSignals(&omask); + + if (_this->hidden->audio_obj->Start() == B_NO_ERROR) { + _this->hidden->audio_obj->SetHasData(true); + } else { + BEOSAUDIO_CloseDevice(_this); + return SDL_SetError("Unable to start Be audio"); + } + + /* We're running! */ + return 0; +} + +static void +BEOSAUDIO_Deinitialize(void) +{ + SDL_QuitBeApp(); +} + +static int +BEOSAUDIO_Init(SDL_AudioDriverImpl * impl) +{ /* Initialize the Be Application, if it's not already started */ if (SDL_InitBeApp() < 0) { - return (-1); + return 0; } - format.buffer_size = spec->samples; - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - /* Subscribe to the audio stream (creates a new thread) */ - { sigset_t omask; - SDL_MaskSignals(&omask); - audio_obj = new BSoundPlayer(&format, "SDL Audio", FillSound, - NULL, _this); - SDL_UnmaskSignals(&omask); - } - if ( audio_obj->Start() == B_NO_ERROR ) { - audio_obj->SetHasData(true); - } else { - SDL_SetError("Unable to start Be audio"); - return(-1); - } - - /* We're running! */ - return(1); + /* Set the function pointers */ + impl->OpenDevice = BEOSAUDIO_OpenDevice; + impl->CloseDevice = BEOSAUDIO_CloseDevice; + impl->Deinitialize = BEOSAUDIO_Deinitialize; + impl->ProvidesOwnCallbackThread = 1; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; /* this audio target is available. */ } -}; /* Extern C */ +extern "C" +{ + extern AudioBootStrap BEOSAUDIO_bootstrap; +} +AudioBootStrap BEOSAUDIO_bootstrap = { + "baudio", "BeOS BSoundPlayer", BEOSAUDIO_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_BEOSAUDIO */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/baudio/SDL_beaudio.h b/src/audio/baudio/SDL_beaudio.h index adaf1dee5d..61f9dec832 100644 --- a/src/audio/baudio/SDL_beaudio.h +++ b/src/audio/baudio/SDL_beaudio.h @@ -1,39 +1,38 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h +#ifndef _SDL_beaudio_h +#define _SDL_beaudio_h #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *_this +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *_this -struct SDL_PrivateAudioData { - BSoundPlayer *audio_obj; +struct SDL_PrivateAudioData +{ + BSoundPlayer *audio_obj; }; -/* Old variable names */ -#define audio_obj (_this->hidden->audio_obj) +#endif /* _SDL_beaudio_h */ -#endif /* _SDL_lowaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/bsd/SDL_bsdaudio.c b/src/audio/bsd/SDL_bsdaudio.c index e5e0d9480a..b63c838ad3 100644 --- a/src/audio/bsd/SDL_bsdaudio.c +++ b/src/audio/bsd/SDL_bsdaudio.c @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_BSD + /* * Driver for native OpenBSD/NetBSD audio(4). * vedge@vedge.com.ar. @@ -42,363 +43,323 @@ #include "../SDL_audiodev_c.h" #include "SDL_bsdaudio.h" -/* The tag name used by NetBSD/OpenBSD audio */ -#ifdef __NetBSD__ -#define BSD_AUDIO_DRIVER_NAME "netbsd" -#define BSD_AUDIO_DRIVER_DESC "Native NetBSD audio" -#else -#define BSD_AUDIO_DRIVER_NAME "openbsd" -#define BSD_AUDIO_DRIVER_DESC "Native OpenBSD audio" -#endif - -/* Open the audio device for playback, and don't block if busy */ -/* #define USE_BLOCKING_WRITES */ - /* Use timer for synchronization */ /* #define USE_TIMER_SYNC */ /* #define DEBUG_AUDIO */ /* #define DEBUG_AUDIO_STREAM */ -#ifdef USE_BLOCKING_WRITES -#define OPEN_FLAGS O_WRONLY -#else -#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) -#endif - -/* Audio driver functions */ -static void OBSD_WaitAudio(_THIS); -static int OBSD_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void OBSD_PlayAudio(_THIS); -static Uint8 *OBSD_GetAudioBuf(_THIS); -static void OBSD_CloseAudio(_THIS); - -#ifdef DEBUG_AUDIO -static void OBSD_Status(_THIS); -#endif - -/* Audio driver bootstrap functions */ - -static int -Audio_Available(void) -{ - int fd; - int available; - - available = 0; - fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0); - if(fd >= 0) { - available = 1; - close(fd); - } - return(available); -} static void -Audio_DeleteDevice(SDL_AudioDevice *device) +BSDAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) { - SDL_free(device->hidden); - SDL_free(device); + SDL_EnumUnixAudioDevices(iscapture, 0, NULL, addfn); } -static SDL_AudioDevice -*Audio_CreateDevice(int devindex) + +static void +BSDAUDIO_Status(_THIS) { - SDL_AudioDevice *this; +#ifdef DEBUG_AUDIO + /* *INDENT-OFF* */ + audio_info_t info; - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice*)SDL_malloc(sizeof(SDL_AudioDevice)); - if(this) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = - (struct SDL_PrivateAudioData*)SDL_malloc((sizeof *this->hidden)); + if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) { + fprintf(stderr, "AUDIO_GETINFO failed.\n"); + return; } - if((this == NULL) || (this->hidden == NULL)) { - SDL_OutOfMemory(); - if(this) SDL_free(this); - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - audio_fd = -1; - - /* Set the function pointers */ - this->OpenAudio = OBSD_OpenAudio; - this->WaitAudio = OBSD_WaitAudio; - this->PlayAudio = OBSD_PlayAudio; - this->GetAudioBuf = OBSD_GetAudioBuf; - this->CloseAudio = OBSD_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; + fprintf(stderr, "\n" + "[play/record info]\n" + "buffer size : %d bytes\n" + "sample rate : %i Hz\n" + "channels : %i\n" + "precision : %i-bit\n" + "encoding : 0x%x\n" + "seek : %i\n" + "sample count : %i\n" + "EOF count : %i\n" + "paused : %s\n" + "error occured : %s\n" + "waiting : %s\n" + "active : %s\n" + "", + info.play.buffer_size, + info.play.sample_rate, + info.play.channels, + info.play.precision, + info.play.encoding, + info.play.seek, + info.play.samples, + info.play.eof, + info.play.pause ? "yes" : "no", + info.play.error ? "yes" : "no", + info.play.waiting ? "yes" : "no", + info.play.active ? "yes" : "no"); + + fprintf(stderr, "\n" + "[audio info]\n" + "monitor_gain : %i\n" + "hw block size : %d bytes\n" + "hi watermark : %i\n" + "lo watermark : %i\n" + "audio mode : %s\n" + "", + info.monitor_gain, + info.blocksize, + info.hiwat, info.lowat, + (info.mode == AUMODE_PLAY) ? "PLAY" + : (info.mode = AUMODE_RECORD) ? "RECORD" + : (info.mode == AUMODE_PLAY_ALL ? "PLAY_ALL" : "?")); + /* *INDENT-ON* */ +#endif /* DEBUG_AUDIO */ } -AudioBootStrap BSD_AUDIO_bootstrap = { - BSD_AUDIO_DRIVER_NAME, BSD_AUDIO_DRIVER_DESC, - Audio_Available, Audio_CreateDevice -}; /* This function waits until it is possible to write a full sound buffer */ static void -OBSD_WaitAudio(_THIS) +BSDAUDIO_WaitDevice(_THIS) { -#ifndef USE_BLOCKING_WRITES /* Not necessary when using blocking writes */ - /* See if we need to use timed audio synchronization */ - if ( frame_ticks ) { - /* Use timer for general audio synchronization */ - Sint32 ticks; - - ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS; - if ( ticks > 0 ) { - SDL_Delay(ticks); - } - } else { - /* Use select() for audio synchronization */ - fd_set fdset; - struct timeval timeout; - - FD_ZERO(&fdset); - FD_SET(audio_fd, &fdset); - timeout.tv_sec = 10; - timeout.tv_usec = 0; +#ifndef USE_BLOCKING_WRITES /* Not necessary when using blocking writes */ + /* See if we need to use timed audio synchronization */ + if (this->hidden->frame_ticks) { + /* Use timer for general audio synchronization */ + Sint32 ticks; + + ticks = + ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - + FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); + } + } else { + /* Use select() for audio synchronization */ + fd_set fdset; + struct timeval timeout; + + FD_ZERO(&fdset); + FD_SET(this->hidden->audio_fd, &fdset); + timeout.tv_sec = 10; + timeout.tv_usec = 0; #ifdef DEBUG_AUDIO - fprintf(stderr, "Waiting for audio to get ready\n"); + fprintf(stderr, "Waiting for audio to get ready\n"); #endif - if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) { - const char *message = - "Audio timeout - buggy audio driver? (disabled)"; - /* In general we should never print to the screen, - but in this case we have no other way of letting - the user know what happened. - */ - fprintf(stderr, "SDL: %s\n", message); - this->enabled = 0; - /* Don't try to close - may hang */ - audio_fd = -1; + if (select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, &timeout) + <= 0) { + const char *message = + "Audio timeout - buggy audio driver? (disabled)"; + /* In general we should never print to the screen, + but in this case we have no other way of letting + the user know what happened. + */ + fprintf(stderr, "SDL: %s\n", message); + this->enabled = 0; + /* Don't try to close - may hang */ + this->hidden->audio_fd = -1; #ifdef DEBUG_AUDIO - fprintf(stderr, "Done disabling audio\n"); + fprintf(stderr, "Done disabling audio\n"); #endif - } + } #ifdef DEBUG_AUDIO - fprintf(stderr, "Ready!\n"); + fprintf(stderr, "Ready!\n"); #endif - } + } #endif /* !USE_BLOCKING_WRITES */ } static void -OBSD_PlayAudio(_THIS) +BSDAUDIO_PlayDevice(_THIS) { - int written, p=0; - - /* Write the audio data, checking for EAGAIN on broken audio drivers */ - do { - written = write(audio_fd, &mixbuf[p], mixlen-p); - if (written>0) - p += written; - if (written == -1 && errno != 0 && errno != EAGAIN && errno != EINTR) - { - /* Non recoverable error has occurred. It should be reported!!! */ - perror("audio"); - break; - } - - if ( p < written || ((written < 0) && ((errno == 0) || (errno == EAGAIN))) ) { - SDL_Delay(1); /* Let a little CPU time go by */ - } - } while ( p < written ); - - /* If timer synchronization is enabled, set the next write frame */ - if ( frame_ticks ) { - next_frame += frame_ticks; - } - - /* If we couldn't write, assume fatal error for now */ - if ( written < 0 ) { - this->enabled = 0; - } + int written, p = 0; + + /* Write the audio data, checking for EAGAIN on broken audio drivers */ + do { + written = write(this->hidden->audio_fd, + &this->hidden->mixbuf[p], this->hidden->mixlen - p); + + if (written > 0) + p += written; + if (written == -1 && errno != 0 && errno != EAGAIN && errno != EINTR) { + /* Non recoverable error has occurred. It should be reported!!! */ + perror("audio"); + break; + } + + if (p < written + || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) { + SDL_Delay(1); /* Let a little CPU time go by */ + } + } while (p < written); + + /* If timer synchronization is enabled, set the next write frame */ + if (this->hidden->frame_ticks) { + this->hidden->next_frame += this->hidden->frame_ticks; + } + + /* If we couldn't write, assume fatal error for now */ + if (written < 0) { + this->enabled = 0; + } #ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", written); + fprintf(stderr, "Wrote %d bytes of audio data\n", written); #endif } -static Uint8 -*OBSD_GetAudioBuf(_THIS) +static Uint8 * +BSDAUDIO_GetDeviceBuf(_THIS) { - return(mixbuf); + return (this->hidden->mixbuf); } static void -OBSD_CloseAudio(_THIS) +BSDAUDIO_CloseDevice(_THIS) { - if(mixbuf != NULL) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if(audio_fd >= 0) { - close(audio_fd); - audio_fd = -1; + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_fd >= 0) { + close(this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + SDL_free(this->hidden); + this->hidden = NULL; } } -#ifdef DEBUG_AUDIO -void -OBSD_Status(_THIS) +static int +BSDAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) { + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + SDL_AudioFormat format = 0; audio_info_t info; - if(ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) { - fprintf(stderr,"AUDIO_GETINFO failed.\n"); - return; + /* We don't care what the devname is...we'll try to open anything. */ + /* ...but default to first name in the list... */ + if (devname == NULL) { + devname = SDL_GetAudioDeviceName(0, iscapture); + if (devname == NULL) { + return SDL_SetError("No such audio device"); + } } - fprintf(stderr,"\n" -"[play/record info]\n" -"buffer size : %d bytes\n" -"sample rate : %i Hz\n" -"channels : %i\n" -"precision : %i-bit\n" -"encoding : 0x%x\n" -"seek : %i\n" -"sample count : %i\n" -"EOF count : %i\n" -"paused : %s\n" -"error occured : %s\n" -"waiting : %s\n" -"active : %s\n" -"", - info.play.buffer_size, - info.play.sample_rate, - info.play.channels, - info.play.precision, - info.play.encoding, - info.play.seek, - info.play.samples, - info.play.eof, - info.play.pause ? "yes" : "no", - info.play.error ? "yes" : "no", - info.play.waiting ? "yes" : "no", - info.play.active ? "yes": "no"); - - fprintf(stderr,"\n" -"[audio info]\n" -"monitor_gain : %i\n" -"hw block size : %d bytes\n" -"hi watermark : %i\n" -"lo watermark : %i\n" -"audio mode : %s\n" -"", - info.monitor_gain, - info.blocksize, - info.hiwat, info.lowat, - (info.mode == AUMODE_PLAY) ? "PLAY" - : (info.mode = AUMODE_RECORD) ? "RECORD" - : (info.mode == AUMODE_PLAY_ALL ? "PLAY_ALL" - : "?")); -} -#endif /* DEBUG_AUDIO */ + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); -static int -OBSD_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - char audiodev[64]; - Uint16 format; - audio_info_t info; + /* Open the audio device */ + this->hidden->audio_fd = open(devname, flags, 0); + if (this->hidden->audio_fd < 0) { + return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); + } AUDIO_INITINFO(&info); - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); -#ifdef USE_TIMER_SYNC - frame_ticks = 0.0; -#endif + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); - /* Open the audio device */ - audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0); - if(audio_fd < 0) { - SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); - return(-1); - } - /* Set to play mode */ info.mode = AUMODE_PLAY; - if(ioctl(audio_fd, AUDIO_SETINFO, &info) < 0) { - SDL_SetError("Couldn't put device into play mode"); - return(-1); + if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) < 0) { + BSDAUDIO_CloseDevice(this); + return SDL_SetError("Couldn't put device into play mode"); } - - mixbuf = NULL; + AUDIO_INITINFO(&info); - for (format = SDL_FirstAudioFormat(spec->format); - format; format = SDL_NextAudioFormat()) - { - switch(format) { - case AUDIO_U8: - info.play.encoding = AUDIO_ENCODING_ULINEAR; - info.play.precision = 8; - break; - case AUDIO_S8: - info.play.encoding = AUDIO_ENCODING_SLINEAR; - info.play.precision = 8; - break; - case AUDIO_S16LSB: - info.play.encoding = AUDIO_ENCODING_SLINEAR_LE; - info.play.precision = 16; - break; - case AUDIO_S16MSB: - info.play.encoding = AUDIO_ENCODING_SLINEAR_BE; - info.play.precision = 16; - break; - case AUDIO_U16LSB: - info.play.encoding = AUDIO_ENCODING_ULINEAR_LE; - info.play.precision = 16; - break; - case AUDIO_U16MSB: - info.play.encoding = AUDIO_ENCODING_ULINEAR_BE; - info.play.precision = 16; - break; - default: - continue; - } - if (ioctl(audio_fd, AUDIO_SETINFO, &info) == 0) - break; + for (format = SDL_FirstAudioFormat(this->spec.format); + format; format = SDL_NextAudioFormat()) { + switch (format) { + case AUDIO_U8: + info.play.encoding = AUDIO_ENCODING_ULINEAR; + info.play.precision = 8; + break; + case AUDIO_S8: + info.play.encoding = AUDIO_ENCODING_SLINEAR; + info.play.precision = 8; + break; + case AUDIO_S16LSB: + info.play.encoding = AUDIO_ENCODING_SLINEAR_LE; + info.play.precision = 16; + break; + case AUDIO_S16MSB: + info.play.encoding = AUDIO_ENCODING_SLINEAR_BE; + info.play.precision = 16; + break; + case AUDIO_U16LSB: + info.play.encoding = AUDIO_ENCODING_ULINEAR_LE; + info.play.precision = 16; + break; + case AUDIO_U16MSB: + info.play.encoding = AUDIO_ENCODING_ULINEAR_BE; + info.play.precision = 16; + break; + default: + continue; + } + + if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == 0) { + break; + } } - if(!format) { - SDL_SetError("No supported encoding for 0x%x", spec->format); - return(-1); + if (!format) { + BSDAUDIO_CloseDevice(this); + return SDL_SetError("No supported encoding for 0x%x", this->spec.format); } - spec->format = format; + this->spec.format = format; AUDIO_INITINFO(&info); - info.play.channels = spec->channels; - if (ioctl(audio_fd, AUDIO_SETINFO, &info) == -1) - spec->channels = 1; + info.play.channels = this->spec.channels; + if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == -1) { + this->spec.channels = 1; + } AUDIO_INITINFO(&info); - info.play.sample_rate = spec->freq; - info.blocksize = spec->size; + info.play.sample_rate = this->spec.freq; + info.blocksize = this->spec.size; info.hiwat = 5; info.lowat = 3; - (void)ioctl(audio_fd, AUDIO_SETINFO, &info); - (void)ioctl(audio_fd, AUDIO_GETINFO, &info); - spec->freq = info.play.sample_rate; + (void) ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info); + (void) ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info); + this->spec.freq = info.play.sample_rate; /* Allocate mixing buffer */ - mixlen = spec->size; - mixbuf = (Uint8*)SDL_AllocAudioMem(mixlen); - if(mixbuf == NULL) { - return(-1); + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + BSDAUDIO_CloseDevice(this); + return SDL_OutOfMemory(); } - SDL_memset(mixbuf, spec->silence, spec->size); - - /* Get the parent process id (we're the parent of the audio thread) */ - parent = getpid(); + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); -#ifdef DEBUG_AUDIO - OBSD_Status(this); -#endif + BSDAUDIO_Status(this); /* We're ready to rock and roll. :-) */ - return(0); + return 0; } + +static int +BSDAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = BSDAUDIO_DetectDevices; + impl->OpenDevice = BSDAUDIO_OpenDevice; + impl->PlayDevice = BSDAUDIO_PlayDevice; + impl->WaitDevice = BSDAUDIO_WaitDevice; + impl->GetDeviceBuf = BSDAUDIO_GetDeviceBuf; + impl->CloseDevice = BSDAUDIO_CloseDevice; + + return 1; /* this audio target is available. */ +} + + +AudioBootStrap BSD_AUDIO_bootstrap = { + "bsd", "BSD audio", BSDAUDIO_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_BSD */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/bsd/SDL_bsdaudio.h b/src/audio/bsd/SDL_bsdaudio.h index c9f69cf544..b64be31b2a 100644 --- a/src/audio/bsd/SDL_bsdaudio.h +++ b/src/audio/bsd/SDL_bsdaudio.h @@ -1,32 +1,31 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" -#ifndef _SDL_openbsdaudio_h -#define _SDL_openbsdaudio_h +#ifndef _SDL_bsdaudio_h +#define _SDL_bsdaudio_h #include "../SDL_sysaudio.h" -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -38,21 +37,15 @@ struct SDL_PrivateAudioData /* Raw mixing buffer */ Uint8 *mixbuf; - int mixlen; + int mixlen; /* Support for audio timing using a timer, in addition to select() */ float frame_ticks; float next_frame; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ -/* Old variable names */ -#define audio_fd (this->hidden->audio_fd) -#define parent (this->hidden->parent) -#define mixbuf (this->hidden->mixbuf) -#define mixlen (this->hidden->mixlen) -#define frame_ticks (this->hidden->frame_ticks) -#define next_frame (this->hidden->next_frame) +#endif /* _SDL_bsdaudio_h */ -#endif /* _SDL_openbsdaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/coreaudio/SDL_coreaudio.c b/src/audio/coreaudio/SDL_coreaudio.c new file mode 100644 index 0000000000..a35135a2fc --- /dev/null +++ b/src/audio/coreaudio/SDL_coreaudio.c @@ -0,0 +1,559 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" +#include "SDL_coreaudio.h" +#include "SDL_assert.h" + +#define DEBUG_COREAUDIO 0 + +static void COREAUDIO_CloseDevice(_THIS); + +#define CHECK_RESULT(msg) \ + if (result != noErr) { \ + COREAUDIO_CloseDevice(this); \ + SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \ + return 0; \ + } + +#if MACOSX_COREAUDIO +typedef void (*addDevFn)(const char *name, AudioDeviceID devId, void *data); + +static void +addToDevList(const char *name, AudioDeviceID devId, void *data) +{ + SDL_AddAudioDevice addfn = (SDL_AddAudioDevice) data; + addfn(name); +} + +typedef struct +{ + const char *findname; + AudioDeviceID devId; + int found; +} FindDevIdData; + +static void +findDevId(const char *name, AudioDeviceID devId, void *_data) +{ + FindDevIdData *data = (FindDevIdData *) _data; + if (!data->found) { + if (SDL_strcmp(name, data->findname) == 0) { + data->found = 1; + data->devId = devId; + } + } +} + +static void +build_device_list(int iscapture, addDevFn addfn, void *addfndata) +{ + OSStatus result = noErr; + UInt32 size = 0; + AudioDeviceID *devs = NULL; + UInt32 i = 0; + UInt32 max = 0; + + AudioObjectPropertyAddress addr = { + kAudioHardwarePropertyDevices, + kAudioObjectPropertyScopeGlobal, + kAudioObjectPropertyElementMaster + }; + + result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &addr, + 0, NULL, &size); + if (result != kAudioHardwareNoError) + return; + + devs = (AudioDeviceID *) alloca(size); + if (devs == NULL) + return; + + result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, + 0, NULL, &size, devs); + if (result != kAudioHardwareNoError) + return; + + max = size / sizeof (AudioDeviceID); + for (i = 0; i < max; i++) { + CFStringRef cfstr = NULL; + char *ptr = NULL; + AudioDeviceID dev = devs[i]; + AudioBufferList *buflist = NULL; + int usable = 0; + CFIndex len = 0; + + addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : + kAudioDevicePropertyScopeOutput; + addr.mSelector = kAudioDevicePropertyStreamConfiguration; + + result = AudioObjectGetPropertyDataSize(dev, &addr, 0, NULL, &size); + if (result != noErr) + continue; + + buflist = (AudioBufferList *) SDL_malloc(size); + if (buflist == NULL) + continue; + + result = AudioObjectGetPropertyData(dev, &addr, 0, NULL, + &size, buflist); + + if (result == noErr) { + UInt32 j; + for (j = 0; j < buflist->mNumberBuffers; j++) { + if (buflist->mBuffers[j].mNumberChannels > 0) { + usable = 1; + break; + } + } + } + + SDL_free(buflist); + + if (!usable) + continue; + + addr.mSelector = kAudioObjectPropertyName; + size = sizeof (CFStringRef); + result = AudioObjectGetPropertyData(dev, &addr, 0, NULL, &size, &cfstr); + if (result != kAudioHardwareNoError) + continue; + + len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), + kCFStringEncodingUTF8); + + ptr = (char *) SDL_malloc(len + 1); + usable = ((ptr != NULL) && + (CFStringGetCString + (cfstr, ptr, len + 1, kCFStringEncodingUTF8))); + + CFRelease(cfstr); + + if (usable) { + len = strlen(ptr); + /* Some devices have whitespace at the end...trim it. */ + while ((len > 0) && (ptr[len - 1] == ' ')) { + len--; + } + usable = (len > 0); + } + + if (usable) { + ptr[len] = '\0'; + +#if DEBUG_COREAUDIO + printf("COREAUDIO: Found %s device #%d: '%s' (devid %d)\n", + ((iscapture) ? "capture" : "output"), + (int) *devCount, ptr, (int) dev); +#endif + addfn(ptr, dev, addfndata); + } + SDL_free(ptr); /* addfn() would have copied the string. */ + } +} + +static void +COREAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +{ + build_device_list(iscapture, addToDevList, addfn); +} + +static int +find_device_by_name(_THIS, const char *devname, int iscapture) +{ + AudioDeviceID devid = 0; + OSStatus result = noErr; + UInt32 size = 0; + UInt32 alive = 0; + pid_t pid = 0; + + AudioObjectPropertyAddress addr = { + 0, + kAudioObjectPropertyScopeGlobal, + kAudioObjectPropertyElementMaster + }; + + if (devname == NULL) { + size = sizeof (AudioDeviceID); + addr.mSelector = + ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice : + kAudioHardwarePropertyDefaultOutputDevice); + result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, + 0, NULL, &size, &devid); + CHECK_RESULT("AudioHardwareGetProperty (default device)"); + } else { + FindDevIdData data; + SDL_zero(data); + data.findname = devname; + build_device_list(iscapture, findDevId, &data); + if (!data.found) { + SDL_SetError("CoreAudio: No such audio device."); + return 0; + } + devid = data.devId; + } + + addr.mSelector = kAudioDevicePropertyDeviceIsAlive; + addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : + kAudioDevicePropertyScopeOutput; + + size = sizeof (alive); + result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &alive); + CHECK_RESULT + ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"); + + if (!alive) { + SDL_SetError("CoreAudio: requested device exists, but isn't alive."); + return 0; + } + + addr.mSelector = kAudioDevicePropertyHogMode; + size = sizeof (pid); + result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &pid); + + /* some devices don't support this property, so errors are fine here. */ + if ((result == noErr) && (pid != -1)) { + SDL_SetError("CoreAudio: requested device is being hogged."); + return 0; + } + + this->hidden->deviceID = devid; + return 1; +} +#endif + +/* The CoreAudio callback */ +static OSStatus +outputCallback(void *inRefCon, + AudioUnitRenderActionFlags * ioActionFlags, + const AudioTimeStamp * inTimeStamp, + UInt32 inBusNumber, UInt32 inNumberFrames, + AudioBufferList * ioData) +{ + SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon; + AudioBuffer *abuf; + UInt32 remaining, len; + void *ptr; + UInt32 i; + + /* Only do anything if audio is enabled and not paused */ + if (!this->enabled || this->paused) { + for (i = 0; i < ioData->mNumberBuffers; i++) { + abuf = &ioData->mBuffers[i]; + SDL_memset(abuf->mData, this->spec.silence, abuf->mDataByteSize); + } + return 0; + } + + /* No SDL conversion should be needed here, ever, since we accept + any input format in OpenAudio, and leave the conversion to CoreAudio. + */ + /* + SDL_assert(!this->convert.needed); + SDL_assert(this->spec.channels == ioData->mNumberChannels); + */ + + for (i = 0; i < ioData->mNumberBuffers; i++) { + abuf = &ioData->mBuffers[i]; + remaining = abuf->mDataByteSize; + ptr = abuf->mData; + while (remaining > 0) { + if (this->hidden->bufferOffset >= this->hidden->bufferSize) { + /* Generate the data */ + SDL_LockMutex(this->mixer_lock); + (*this->spec.callback)(this->spec.userdata, + this->hidden->buffer, this->hidden->bufferSize); + SDL_UnlockMutex(this->mixer_lock); + this->hidden->bufferOffset = 0; + } + + len = this->hidden->bufferSize - this->hidden->bufferOffset; + if (len > remaining) + len = remaining; + SDL_memcpy(ptr, (char *)this->hidden->buffer + + this->hidden->bufferOffset, len); + ptr = (char *)ptr + len; + remaining -= len; + this->hidden->bufferOffset += len; + } + } + + return 0; +} + +static OSStatus +inputCallback(void *inRefCon, + AudioUnitRenderActionFlags * ioActionFlags, + const AudioTimeStamp * inTimeStamp, + UInt32 inBusNumber, UInt32 inNumberFrames, + AudioBufferList * ioData) +{ + /* err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); */ + /* !!! FIXME: write me! */ + return noErr; +} + + +static void +COREAUDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->audioUnitOpened) { + OSStatus result = noErr; + AURenderCallbackStruct callback; + const AudioUnitElement output_bus = 0; + const AudioUnitElement input_bus = 1; + const int iscapture = this->iscapture; + const AudioUnitElement bus = + ((iscapture) ? input_bus : output_bus); + const AudioUnitScope scope = + ((iscapture) ? kAudioUnitScope_Output : + kAudioUnitScope_Input); + + /* stop processing the audio unit */ + result = AudioOutputUnitStop(this->hidden->audioUnit); + + /* Remove the input callback */ + SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct)); + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_SetRenderCallback, + scope, bus, &callback, + sizeof(callback)); + + #if MACOSX_COREAUDIO + CloseComponent(this->hidden->audioUnit); + #else + AudioComponentInstanceDispose(this->hidden->audioUnit); + #endif + + this->hidden->audioUnitOpened = 0; + } + SDL_free(this->hidden->buffer); + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +static int +prepare_audiounit(_THIS, const char *devname, int iscapture, + const AudioStreamBasicDescription * strdesc) +{ + OSStatus result = noErr; + AURenderCallbackStruct callback; +#if MACOSX_COREAUDIO + ComponentDescription desc; + Component comp = NULL; +#else + AudioComponentDescription desc; + AudioComponent comp = NULL; +#endif + const AudioUnitElement output_bus = 0; + const AudioUnitElement input_bus = 1; + const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus); + const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output : + kAudioUnitScope_Input); + +#if MACOSX_COREAUDIO + if (!find_device_by_name(this, devname, iscapture)) { + SDL_SetError("Couldn't find requested CoreAudio device"); + return 0; + } +#endif + + SDL_zero(desc); + desc.componentType = kAudioUnitType_Output; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; + +#if MACOSX_COREAUDIO + desc.componentSubType = kAudioUnitSubType_DefaultOutput; + comp = FindNextComponent(NULL, &desc); +#else + desc.componentSubType = kAudioUnitSubType_RemoteIO; + comp = AudioComponentFindNext(NULL, &desc); +#endif + + if (comp == NULL) { + SDL_SetError("Couldn't find requested CoreAudio component"); + return 0; + } + + /* Open & initialize the audio unit */ +#if MACOSX_COREAUDIO + result = OpenAComponent(comp, &this->hidden->audioUnit); + CHECK_RESULT("OpenAComponent"); +#else + /* + AudioComponentInstanceNew only available on iPhone OS 2.0 and Mac OS X 10.6 + We can't use OpenAComponent on iPhone because it is not present + */ + result = AudioComponentInstanceNew(comp, &this->hidden->audioUnit); + CHECK_RESULT("AudioComponentInstanceNew"); +#endif + + this->hidden->audioUnitOpened = 1; + +#if MACOSX_COREAUDIO + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, 0, + &this->hidden->deviceID, + sizeof(AudioDeviceID)); + CHECK_RESULT + ("AudioUnitSetProperty (kAudioOutputUnitProperty_CurrentDevice)"); +#endif + + /* Set the data format of the audio unit. */ + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_StreamFormat, + scope, bus, strdesc, sizeof(*strdesc)); + CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)"); + + /* Set the audio callback */ + SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct)); + callback.inputProc = ((iscapture) ? inputCallback : outputCallback); + callback.inputProcRefCon = this; + result = AudioUnitSetProperty(this->hidden->audioUnit, + kAudioUnitProperty_SetRenderCallback, + scope, bus, &callback, sizeof(callback)); + CHECK_RESULT + ("AudioUnitSetProperty (kAudioUnitProperty_SetRenderCallback)"); + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate a sample buffer */ + this->hidden->bufferOffset = this->hidden->bufferSize = this->spec.size; + this->hidden->buffer = SDL_malloc(this->hidden->bufferSize); + + result = AudioUnitInitialize(this->hidden->audioUnit); + CHECK_RESULT("AudioUnitInitialize"); + + /* Finally, start processing of the audio unit */ + result = AudioOutputUnitStart(this->hidden->audioUnit); + CHECK_RESULT("AudioOutputUnitStart"); + + /* We're running! */ + return 1; +} + + +static int +COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + AudioStreamBasicDescription strdesc; + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + int valid_datatype = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Setup a AudioStreamBasicDescription with the requested format */ + SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription)); + strdesc.mFormatID = kAudioFormatLinearPCM; + strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked; + strdesc.mChannelsPerFrame = this->spec.channels; + strdesc.mSampleRate = this->spec.freq; + strdesc.mFramesPerPacket = 1; + + while ((!valid_datatype) && (test_format)) { + this->spec.format = test_format; + /* Just a list of valid SDL formats, so people don't pass junk here. */ + switch (test_format) { + case AUDIO_U8: + case AUDIO_S8: + case AUDIO_U16LSB: + case AUDIO_S16LSB: + case AUDIO_U16MSB: + case AUDIO_S16MSB: + case AUDIO_S32LSB: + case AUDIO_S32MSB: + case AUDIO_F32LSB: + case AUDIO_F32MSB: + valid_datatype = 1; + strdesc.mBitsPerChannel = SDL_AUDIO_BITSIZE(this->spec.format); + if (SDL_AUDIO_ISBIGENDIAN(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; + + if (SDL_AUDIO_ISFLOAT(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsFloat; + else if (SDL_AUDIO_ISSIGNED(this->spec.format)) + strdesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + break; + } + } + + if (!valid_datatype) { /* shouldn't happen, but just in case... */ + COREAUDIO_CloseDevice(this); + return SDL_SetError("Unsupported audio format"); + } + + strdesc.mBytesPerFrame = + strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8; + strdesc.mBytesPerPacket = + strdesc.mBytesPerFrame * strdesc.mFramesPerPacket; + + if (!prepare_audiounit(this, devname, iscapture, &strdesc)) { + COREAUDIO_CloseDevice(this); + return -1; /* prepare_audiounit() will call SDL_SetError()... */ + } + + return 0; /* good to go. */ +} + +static int +COREAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = COREAUDIO_OpenDevice; + impl->CloseDevice = COREAUDIO_CloseDevice; + +#if MACOSX_COREAUDIO + impl->DetectDevices = COREAUDIO_DetectDevices; +#else + impl->OnlyHasDefaultOutputDevice = 1; + + /* Set category to ambient sound so that other music continues playing. + You can change this at runtime in your own code if you need different + behavior. If this is common, we can add an SDL hint for this. + */ + AudioSessionInitialize(NULL, NULL, NULL, nil); + UInt32 category = kAudioSessionCategory_AmbientSound; + AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(UInt32), &category); +#endif + + impl->ProvidesOwnCallbackThread = 1; + + return 1; /* this audio target is available. */ +} + +AudioBootStrap COREAUDIO_bootstrap = { + "coreaudio", "CoreAudio", COREAUDIO_Init, 0 +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/coreaudio/SDL_coreaudio.h b/src/audio/coreaudio/SDL_coreaudio.h new file mode 100644 index 0000000000..2f0db5ba88 --- /dev/null +++ b/src/audio/coreaudio/SDL_coreaudio.h @@ -0,0 +1,57 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_coreaudio_h +#define _SDL_coreaudio_h + +#include "../SDL_sysaudio.h" + +#if !defined(__IPHONEOS__) +#define MACOSX_COREAUDIO 1 +#endif + +#if MACOSX_COREAUDIO +#include +#include +#else +#include +#endif + +#include + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + AudioUnit audioUnit; + int audioUnitOpened; + void *buffer; + UInt32 bufferOffset; + UInt32 bufferSize; +#if MACOSX_COREAUDIO + AudioDeviceID deviceID; +#endif +}; + +#endif /* _SDL_coreaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/dart/SDL_dart.c b/src/audio/dart/SDL_dart.c deleted file mode 100644 index 77e530db51..0000000000 --- a/src/audio/dart/SDL_dart.c +++ /dev/null @@ -1,441 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer */ - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_dart.h" - -// Buffer states: -#define BUFFER_EMPTY 0 -#define BUFFER_USED 1 - -typedef struct _tMixBufferDesc { - int iBufferUsage; // BUFFER_EMPTY or BUFFER_USED - SDL_AudioDevice *pSDLAudioDevice; -} tMixBufferDesc, *pMixBufferDesc; - - -//--------------------------------------------------------------------- -// DARTEventFunc -// -// This function is called by DART, when an event occures, like end of -// playback of a buffer, etc... -//--------------------------------------------------------------------- -LONG APIENTRY DARTEventFunc(ULONG ulStatus, - PMCI_MIX_BUFFER pBuffer, - ULONG ulFlags) -{ - if (ulFlags && MIX_WRITE_COMPLETE) - { // Playback of buffer completed! - - // Get pointer to buffer description - pMixBufferDesc pBufDesc; - - if (pBuffer) - { - pBufDesc = (pMixBufferDesc) (*pBuffer).ulUserParm; - - if (pBufDesc) - { - SDL_AudioDevice *pSDLAudioDevice = pBufDesc->pSDLAudioDevice; - // Set the buffer to be empty - pBufDesc->iBufferUsage = BUFFER_EMPTY; - // And notify DART feeder thread that it will have to work a bit. - if (pSDLAudioDevice) - DosPostEventSem(pSDLAudioDevice->hidden->hevAudioBufferPlayed); - } - } - } - return TRUE; -} - - -int DART_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - Uint16 test_format = SDL_FirstAudioFormat(spec->format); - int valid_datatype = 0; - MCI_AMP_OPEN_PARMS AmpOpenParms; - MCI_GENERIC_PARMS GenericParms; - int iDeviceOrd = 0; // Default device to be used - int bOpenShared = 1; // Try opening it shared - int iBits = 16; // Default is 16 bits signed - int iFreq = 44100; // Default is 44KHz - int iChannels = 2; // Default is 2 channels (Stereo) - int iNumBufs = 2; // Number of audio buffers: 2 - int iBufSize; - int iOpenMode; - int iSilence; - int rc; - - // First thing is to try to open a given DART device! - SDL_memset(&AmpOpenParms, 0, sizeof(MCI_AMP_OPEN_PARMS)); - // pszDeviceType should contain the device type in low word, and device ordinal in high word! - AmpOpenParms.pszDeviceType = (PSZ) (MCI_DEVTYPE_AUDIO_AMPMIX | (iDeviceOrd << 16)); - - iOpenMode = MCI_WAIT | MCI_OPEN_TYPE_ID; - if (bOpenShared) iOpenMode |= MCI_OPEN_SHAREABLE; - - rc = mciSendCommand( 0, MCI_OPEN, - iOpenMode, - (PVOID) &AmpOpenParms, 0); - if (rc!=MCIERR_SUCCESS) // No audio available?? - return (-1); - // Save the device ID we got from DART! - // We will use this in the next calls! - iDeviceOrd = AmpOpenParms.usDeviceID; - - // Determine the audio parameters from the AudioSpec - if (spec->channels > 2) - spec->channels = 2; // !!! FIXME: more than stereo support in OS/2? - - while ((!valid_datatype) && (test_format)) { - spec->format = test_format; - valid_datatype = 1; - switch (test_format) { - case AUDIO_U8: - // Unsigned 8 bit audio data - iSilence = 0x80; - iBits = 8; - break; - - case AUDIO_S16LSB: - // Signed 16 bit audio data - iSilence = 0x00; - iBits = 16; - break; - - default: - valid_datatype = 0; - test_format = SDL_NextAudioFormat(); - break; - } - } - - if (!valid_datatype) { // shouldn't happen, but just in case... - // Close DART, and exit with error code! - mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); - SDL_SetError("Unsupported audio format"); - return (-1); - } - - iFreq = spec->freq; - iChannels = spec->channels; - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); - iBufSize = spec->size; - - // Now query this device if it supports the given freq/bits/channels! - SDL_memset(&(_this->hidden->MixSetupParms), 0, sizeof(MCI_MIXSETUP_PARMS)); - _this->hidden->MixSetupParms.ulBitsPerSample = iBits; - _this->hidden->MixSetupParms.ulFormatTag = MCI_WAVE_FORMAT_PCM; - _this->hidden->MixSetupParms.ulSamplesPerSec = iFreq; - _this->hidden->MixSetupParms.ulChannels = iChannels; - _this->hidden->MixSetupParms.ulFormatMode = MCI_PLAY; - _this->hidden->MixSetupParms.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO; - _this->hidden->MixSetupParms.pmixEvent = DARTEventFunc; - rc = mciSendCommand (iDeviceOrd, MCI_MIXSETUP, - MCI_WAIT | MCI_MIXSETUP_QUERYMODE, - &(_this->hidden->MixSetupParms), 0); - if (rc!=MCIERR_SUCCESS) - { // The device cannot handle this format! - // Close DART, and exit with error code! - mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); - SDL_SetError("Audio device doesn't support requested audio format"); - return(-1); - } - // The device can handle this format, so initialize! - rc = mciSendCommand(iDeviceOrd, MCI_MIXSETUP, - MCI_WAIT | MCI_MIXSETUP_INIT, - &(_this->hidden->MixSetupParms), 0); - if (rc!=MCIERR_SUCCESS) - { // The device could not be opened! - // Close DART, and exit with error code! - mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); - SDL_SetError("Audio device could not be set up"); - return(-1); - } - // Ok, the device is initialized. - // Now we should allocate buffers. For this, we need a place where - // the buffer descriptors will be: - _this->hidden->pMixBuffers = (MCI_MIX_BUFFER *) SDL_malloc(sizeof(MCI_MIX_BUFFER)*iNumBufs); - if (!(_this->hidden->pMixBuffers)) - { // Not enough memory! - // Close DART, and exit with error code! - mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); - SDL_SetError("Not enough memory for audio buffer descriptors"); - return(-1); - } - // Now that we have the place for buffer list, we can ask DART for the - // buffers! - _this->hidden->BufferParms.ulNumBuffers = iNumBufs; // Number of buffers - _this->hidden->BufferParms.ulBufferSize = iBufSize; // each with this size - _this->hidden->BufferParms.pBufList = _this->hidden->pMixBuffers; // getting descriptorts into this list - // Allocate buffers! - rc = mciSendCommand(iDeviceOrd, MCI_BUFFER, - MCI_WAIT | MCI_ALLOCATE_MEMORY, - &(_this->hidden->BufferParms), 0); - if ((rc!=MCIERR_SUCCESS) || (iNumBufs != _this->hidden->BufferParms.ulNumBuffers) || (_this->hidden->BufferParms.ulBufferSize==0)) - { // Could not allocate memory! - // Close DART, and exit with error code! - SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL; - mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); - SDL_SetError("DART could not allocate buffers"); - return(-1); - } - // Ok, we have all the buffers allocated, let's mark them! - { - int i; - for (i=0; ihidden->pMixBuffers[i].pBuffer)) || (!pBufferDesc)) - { // Wrong buffer! - // Close DART, and exit with error code! - // Free buffer descriptions - { int j; - for (j=0; jhidden->pMixBuffers[j].ulUserParm)); - } - // and cleanup - mciSendCommand(iDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0); - SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL; - mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); - SDL_SetError("Error at internal buffer check"); - return(-1); - } - pBufferDesc->iBufferUsage = BUFFER_EMPTY; - pBufferDesc->pSDLAudioDevice = _this; - - _this->hidden->pMixBuffers[i].ulBufferLength = _this->hidden->BufferParms.ulBufferSize; - _this->hidden->pMixBuffers[i].ulUserParm = (ULONG) pBufferDesc; // User parameter: Description of buffer - _this->hidden->pMixBuffers[i].ulFlags = 0; // Some stuff should be flagged here for DART, like end of - // audio data, but as we will continously send - // audio data, there will be no end.:) - SDL_memset(_this->hidden->pMixBuffers[i].pBuffer, iSilence, iBufSize); - } - } - _this->hidden->iNextFreeBuffer = 0; - _this->hidden->iLastPlayedBuf = -1; - // Create event semaphore - if (DosCreateEventSem(NULL, &(_this->hidden->hevAudioBufferPlayed), 0, FALSE)!=NO_ERROR) - { - // Could not create event semaphore! - { - int i; - for (i=0; ihidden->pMixBuffers[i].ulUserParm)); - } - mciSendCommand(iDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0); - SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL; - mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); - SDL_SetError("Could not create event semaphore"); - return(-1); - } - - // Store the new settings in global variables - _this->hidden->iCurrDeviceOrd = iDeviceOrd; - _this->hidden->iCurrFreq = iFreq; - _this->hidden->iCurrBits = iBits; - _this->hidden->iCurrChannels = iChannels; - _this->hidden->iCurrNumBufs = iNumBufs; - _this->hidden->iCurrBufSize = iBufSize; - - return (0); -} - - - -void DART_ThreadInit(_THIS) -{ - return; -} - -/* This function waits until it is possible to write a full sound buffer */ -void DART_WaitAudio(_THIS) -{ - int i; - pMixBufferDesc pBufDesc; - ULONG ulPostCount; - - DosResetEventSem(_this->hidden->hevAudioBufferPlayed, &ulPostCount); - // If there is already an empty buffer, then return now! - for (i=0; i<_this->hidden->iCurrNumBufs; i++) - { - pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[i].ulUserParm; - if (pBufDesc->iBufferUsage == BUFFER_EMPTY) - return; - } - // If there is no empty buffer, wait for one to be empty! - DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000); // Wait max 1 sec!!! Important! - return; -} - -void DART_PlayAudio(_THIS) -{ - int iFreeBuf = _this->hidden->iNextFreeBuffer; - pMixBufferDesc pBufDesc; - - pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm; - pBufDesc->iBufferUsage = BUFFER_USED; - // Send it to DART to be queued - _this->hidden->MixSetupParms.pmixWrite(_this->hidden->MixSetupParms.ulMixHandle, - &(_this->hidden->pMixBuffers[iFreeBuf]), 1); - - _this->hidden->iLastPlayedBuf = iFreeBuf; - iFreeBuf = (iFreeBuf+1) % _this->hidden->iCurrNumBufs; - _this->hidden->iNextFreeBuffer = iFreeBuf; -} - -Uint8 *DART_GetAudioBuf(_THIS) -{ - int iFreeBuf; - Uint8 *pResult; - pMixBufferDesc pBufDesc; - - if (_this) - { - if (_this->hidden) - { - iFreeBuf = _this->hidden->iNextFreeBuffer; - pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm; - - if (pBufDesc) - { - if (pBufDesc->iBufferUsage == BUFFER_EMPTY) - { - pResult = _this->hidden->pMixBuffers[iFreeBuf].pBuffer; - return pResult; - } - } else - printf("[DART_GetAudioBuf] : ERROR! pBufDesc = %p\n", pBufDesc); - } else - printf("[DART_GetAudioBuf] : ERROR! _this->hidden = %p\n", _this->hidden); - } else - printf("[DART_GetAudioBuf] : ERROR! _this = %p\n", _this); - return NULL; -} - -void DART_WaitDone(_THIS) -{ - pMixBufferDesc pBufDesc; - ULONG ulPostCount; - APIRET rc; - - pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[_this->hidden->iLastPlayedBuf].ulUserParm; - rc = NO_ERROR; - while ((pBufDesc->iBufferUsage != BUFFER_EMPTY) && (rc==NO_ERROR)) - { - DosResetEventSem(_this->hidden->hevAudioBufferPlayed, &ulPostCount); - rc = DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000); // 1 sec timeout! Important! - } -} - -void DART_CloseAudio(_THIS) -{ - MCI_GENERIC_PARMS GenericParms; - int rc; - - // Stop DART playback - rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_STOP, MCI_WAIT, &GenericParms, 0); - if (rc!=MCIERR_SUCCESS) - { -#ifdef SFX_DEBUG_BUILD - printf("Could not stop DART playback!\n"); - fflush(stdout); -#endif - } - - // Close event semaphore - DosCloseEventSem(_this->hidden->hevAudioBufferPlayed); - - // Free memory of buffer descriptions - { - int i; - for (i=0; i<_this->hidden->iCurrNumBufs; i++) SDL_free((void *)(_this->hidden->pMixBuffers[i].ulUserParm)); - } - - // Deallocate buffers - rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0); - - // Free bufferlist - SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL; - - // Close dart - rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_CLOSE, MCI_WAIT, &(GenericParms), 0); -} - -/* Audio driver bootstrap functions */ - -int Audio_Available(void) -{ - return(1); -} - -void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) - { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) - { - SDL_OutOfMemory(); - if ( this ) - SDL_free(this); - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = DART_OpenAudio; - this->ThreadInit = DART_ThreadInit; - this->WaitAudio = DART_WaitAudio; - this->PlayAudio = DART_PlayAudio; - this->GetAudioBuf = DART_GetAudioBuf; - this->WaitDone = DART_WaitDone; - this->CloseAudio = DART_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap DART_bootstrap = { - "dart", "OS/2 Direct Audio RouTines (DART)", - Audio_Available, Audio_CreateDevice -}; - diff --git a/src/audio/dart/SDL_dart.h b/src/audio/dart/SDL_dart.h deleted file mode 100644 index 68c27bd9d3..0000000000 --- a/src/audio/dart/SDL_dart.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h - -#define INCL_TYPES -#define INCL_DOSSEMAPHORES -#define INCL_DOSRESOURCES -#define INCL_DOSMISC -#define INCL_DOSERRORS - -#define INCL_OS2MM -#define INCL_MMIOOS2 -#define INCL_MCIOS2 -#include -#include // DART stuff and MMIO stuff - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *_this - -/* The DirectSound objects */ -struct SDL_PrivateAudioData -{ - int iCurrDeviceOrd; - int iCurrFreq; - int iCurrBits; - int iCurrChannels; - int iCurrNumBufs; - int iCurrBufSize; - - int iLastPlayedBuf; - int iNextFreeBuffer; - - MCI_BUFFER_PARMS BufferParms; // Sound buffer parameters - MCI_MIX_BUFFER *pMixBuffers; // Sound buffers - MCI_MIXSETUP_PARMS MixSetupParms; // Mixer setup parameters - HEV hevAudioBufferPlayed; // Event semaphore to indicate that an audio buffer has been played by DART -}; - -#endif /* _SDL_lowaudio_h */ diff --git a/src/audio/dc/SDL_dcaudio.c b/src/audio/dc/SDL_dcaudio.c deleted file mode 100644 index 88daa8723a..0000000000 --- a/src/audio/dc/SDL_dcaudio.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org - -*/ -#include "SDL_config.h" - -/* Output dreamcast aica */ - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" -#include "SDL_dcaudio.h" - -#include "aica.h" -#include - -/* Audio driver functions */ -static int DCAUD_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DCAUD_WaitAudio(_THIS); -static void DCAUD_PlayAudio(_THIS); -static Uint8 *DCAUD_GetAudioBuf(_THIS); -static void DCAUD_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ -static int DCAUD_Available(void) -{ - return 1; -} - -static void DCAUD_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *DCAUD_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = DCAUD_OpenAudio; - this->WaitAudio = DCAUD_WaitAudio; - this->PlayAudio = DCAUD_PlayAudio; - this->GetAudioBuf = DCAUD_GetAudioBuf; - this->CloseAudio = DCAUD_CloseAudio; - - this->free = DCAUD_DeleteDevice; - - spu_init(); - - return this; -} - -AudioBootStrap DCAUD_bootstrap = { - "dcaudio", "Dreamcast AICA audio", - DCAUD_Available, DCAUD_CreateDevice -}; - -/* This function waits until it is possible to write a full sound buffer */ -static void DCAUD_WaitAudio(_THIS) -{ - if (this->hidden->playing) { - /* wait */ - while(aica_get_pos(0)/this->spec.samples == this->hidden->nextbuf) { - thd_pass(); - } - } -} - -#define SPU_RAM_BASE 0xa0800000 - -static void spu_memload_stereo8(int leftpos,int rightpos,void *src0,size_t size) -{ - uint8 *src = src0; - uint32 *left = (uint32*)(leftpos +SPU_RAM_BASE); - uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE); - size = (size+7)/8; - while(size--) { - unsigned lval,rval; - lval = *src++; - rval = *src++; - lval|= (*src++)<<8; - rval|= (*src++)<<8; - lval|= (*src++)<<16; - rval|= (*src++)<<16; - lval|= (*src++)<<24; - rval|= (*src++)<<24; - g2_write_32(left++,lval); - g2_write_32(right++,rval); - g2_fifo_wait(); - } -} - -static void spu_memload_stereo16(int leftpos,int rightpos,void *src0,size_t size) -{ - uint16 *src = src0; - uint32 *left = (uint32*)(leftpos +SPU_RAM_BASE); - uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE); - size = (size+7)/8; - while(size--) { - unsigned lval,rval; - lval = *src++; - rval = *src++; - lval|= (*src++)<<16; - rval|= (*src++)<<16; - g2_write_32(left++,lval); - g2_write_32(right++,rval); - g2_fifo_wait(); - } -} - -static void DCAUD_PlayAudio(_THIS) -{ - SDL_AudioSpec *spec = &this->spec; - unsigned int offset; - - if (this->hidden->playing) { - /* wait */ - while(aica_get_pos(0)/spec->samples == this->hidden->nextbuf) { - thd_pass(); - } - } - - offset = this->hidden->nextbuf*spec->size; - this->hidden->nextbuf^=1; - /* Write the audio data, checking for EAGAIN on broken audio drivers */ - if (spec->channels==1) { - spu_memload(this->hidden->leftpos+offset,this->hidden->mixbuf,this->hidden->mixlen); - } else { - offset/=2; - if ((this->spec.format&255)==8) { - spu_memload_stereo8(this->hidden->leftpos+offset,this->hidden->rightpos+offset,this->hidden->mixbuf,this->hidden->mixlen); - } else { - spu_memload_stereo16(this->hidden->leftpos+offset,this->hidden->rightpos+offset,this->hidden->mixbuf,this->hidden->mixlen); - } - } - - if (!this->hidden->playing) { - int mode; - this->hidden->playing = 1; - mode = (spec->format==AUDIO_S8)?SM_8BIT:SM_16BIT; - if (spec->channels==1) { - aica_play(0,mode,this->hidden->leftpos,0,spec->samples*2,spec->freq,255,128,1); - } else { - aica_play(0,mode,this->hidden->leftpos ,0,spec->samples*2,spec->freq,255,0,1); - aica_play(1,mode,this->hidden->rightpos,0,spec->samples*2,spec->freq,255,255,1); - } - } -} - -static Uint8 *DCAUD_GetAudioBuf(_THIS) -{ - return(this->hidden->mixbuf); -} - -static void DCAUD_CloseAudio(_THIS) -{ - aica_stop(0); - if (this->spec.channels==2) aica_stop(1); - if ( this->hidden->mixbuf != NULL ) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - } -} - -static int DCAUD_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - Uint16 test_format = SDL_FirstAudioFormat(spec->format); - int valid_datatype = 0; - while ((!valid_datatype) && (test_format)) { - spec->format = test_format; - switch (test_format) { - /* only formats Dreamcast accepts... */ - case AUDIO_S8: - case AUDIO_S16LSB: - valid_datatype = 1; - break; - - default: - test_format = SDL_NextAudioFormat(); - break; - } - } - - if (!valid_datatype) { /* shouldn't happen, but just in case... */ - SDL_SetError("Unsupported audio format"); - return (-1); - } - - if (spec->channels > 2) - spec->channels = 2; /* no more than stereo on the Dreamcast. */ - - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); - - /* Allocate mixing buffer */ - this->hidden->mixlen = spec->size; - this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); - if ( this->hidden->mixbuf == NULL ) { - return(-1); - } - SDL_memset(this->hidden->mixbuf, spec->silence, spec->size); - this->hidden->leftpos = 0x11000; - this->hidden->rightpos = 0x11000+spec->size; - this->hidden->playing = 0; - this->hidden->nextbuf = 0; - - /* We're ready to rock and roll. :-) */ - return(0); -} diff --git a/src/audio/dc/SDL_dcaudio.h b/src/audio/dc/SDL_dcaudio.h deleted file mode 100644 index fba95b3eda..0000000000 --- a/src/audio/dc/SDL_dcaudio.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_dcaudio_h -#define _SDL_dcaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - Uint8 *mixbuf; - Uint32 mixlen; - int playing; - int leftpos,rightpos; - int nextbuf; -}; - -#endif /* _SDL_dcaudio_h */ diff --git a/src/audio/dc/aica.c b/src/audio/dc/aica.c deleted file mode 100644 index b6a1c93644..0000000000 --- a/src/audio/dc/aica.c +++ /dev/null @@ -1,271 +0,0 @@ -/* This file is part of the Dreamcast function library. - * Please see libdream.c for further details. - * - * (c)2000 Dan Potter - * modify BERO - */ -#include "aica.h" - -#include -#include - -/* #define dc_snd_base ((volatile unsigned char *)0x00800000) */ /* arm side */ -#define dc_snd_base ((volatile unsigned char *)0xa0700000) /* dc side */ - -/* Some convienence macros */ -#define SNDREGADDR(x) (0xa0700000 + (x)) -#define CHNREGADDR(ch,x) SNDREGADDR(0x80*(ch)+(x)) - - -#define SNDREG32(x) (*(volatile unsigned long *)SNDREGADDR(x)) -#define SNDREG8(x) (*(volatile unsigned char *)SNDREGADDR(x)) -#define CHNREG32(ch, x) (*(volatile unsigned long *)CHNREGADDR(ch,x)) -#define CHNREG8(ch, x) (*(volatile unsigned long *)CHNREGADDR(ch,x)) - -#define G2_LOCK(OLD) \ - do { \ - if (!irq_inside_int()) \ - OLD = irq_disable(); \ - /* suspend any G2 DMA here... */ \ - while((*(volatile unsigned int *)0xa05f688c) & 0x20) \ - ; \ - } while(0) - -#define G2_UNLOCK(OLD) \ - do { \ - /* resume any G2 DMA here... */ \ - if (!irq_inside_int()) \ - irq_restore(OLD); \ - } while(0) - - -void aica_init() { - int i, j, old = 0; - - /* Initialize AICA channels */ - G2_LOCK(old); - SNDREG32(0x2800) = 0x0000; - - for (i=0; i<64; i++) { - for (j=0; j<0x80; j+=4) { - if ((j&31)==0) g2_fifo_wait(); - CHNREG32(i, j) = 0; - } - g2_fifo_wait(); - CHNREG32(i,0) = 0x8000; - CHNREG32(i,20) = 0x1f; - } - - SNDREG32(0x2800) = 0x000f; - g2_fifo_wait(); - G2_UNLOCK(old); -} - -/* Translates a volume from linear form to logarithmic form (required by - the AICA chip */ -/* int logs[] = { - -0, 40, 50, 58, 63, 68, 73, 77, 80, 83, 86, 89, 92, 94, 97, 99, 101, 103, -105, 107, 109, 111, 112, 114, 116, 117, 119, 120, 122, 123, 125, 126, 127, -129, 130, 131, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, -146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, -160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171, -172, 172, 173, 174, 175, 175, 176, 177, 177, 178, 179, 180, 180, 181, 182, -182, 183, 183, 184, 185, 185, 186, 187, 187, 188, 188, 189, 190, 190, 191, -191, 192, 193, 193, 194, 194, 195, 196, 196, 197, 197, 198, 198, 199, 199, -200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207, -208, 208, 209, 209, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, -215, 216, 216, 217, 217, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222, -222, 222, 223, 223, 224, 224, 225, 225, 225, 226, 226, 227, 227, 228, 228, -228, 229, 229, 230, 230, 230, 231, 231, 232, 232, 232, 233, 233, 234, 234, -234, 235, 235, 236, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240, -240, 241, 241, 241, 242, 242, 243, 243, 243, 244, 244, 244, 245, 245, 245, -246, 246, 247, 247, 247, 248, 248, 248, 249, 249, 249, 250, 250, 250, 251, -251, 251, 252, 252, 252, 253, 253, 253, 254, 254, 254, 255 - -}; */ - -const static unsigned char logs[] = { - 0, 15, 22, 27, 31, 35, 39, 42, 45, 47, 50, 52, 55, 57, 59, 61, - 63, 65, 67, 69, 71, 73, 74, 76, 78, 79, 81, 82, 84, 85, 87, 88, - 90, 91, 92, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 106, - 108, 109, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 156, - 157, 158, 159, 160, 160, 161, 162, 163, 164, 164, 165, 166, 167, - 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, - 177, 178, 178, 179, 180, 181, 181, 182, 183, 183, 184, 185, 185, - 186, 187, 187, 188, 189, 189, 190, 191, 191, 192, 193, 193, 194, - 195, 195, 196, 197, 197, 198, 199, 199, 200, 200, 201, 202, 202, - 203, 204, 204, 205, 205, 206, 207, 207, 208, 209, 209, 210, 210, - 211, 212, 212, 213, 213, 214, 215, 215, 216, 216, 217, 217, 218, - 219, 219, 220, 220, 221, 221, 222, 223, 223, 224, 224, 225, 225, - 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 232, 232, 233, - 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 239, 239, 240, - 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, - 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 254, 255 -}; - -/* For the moment this is going to have to suffice, until we really - figure out what these mean. */ -#define AICA_PAN(x) ((x)==0x80?(0):((x)<0x80?(0x1f):(0x0f))) -#define AICA_VOL(x) (0xff - logs[128 + (((x) & 0xff) / 2)]) -//#define AICA_VOL(x) (0xff - logs[x&255]) - -static inline unsigned AICA_FREQ(unsigned freq) { - unsigned long freq_lo, freq_base = 5644800; - int freq_hi = 7; - - /* Need to convert frequency to floating point format - (freq_hi is exponent, freq_lo is mantissa) - Formula is ferq = 44100*2^freq_hi*(1+freq_lo/1024) */ - while (freq < freq_base && freq_hi > -8) { - freq_base >>= 1; - --freq_hi; - } - while (freq < freq_base && freq_hi > -8) { - freq_base >>= 1; - freq_hi--; - } - freq_lo = (freq<<10) / freq_base; - return (freq_hi << 11) | (freq_lo & 1023); -} - -/* Sets up a sound channel completely. This is generally good if you want - a quick and dirty way to play notes. If you want a more comprehensive - set of routines (more like PC wavetable cards) see below. - - ch is the channel to play on (0 - 63) - smpptr is the pointer to the sound data; if you're running off the - SH4, then this ought to be (ptr - 0xa0800000); otherwise it's just - ptr. Basically, it's an offset into sound ram. - mode is one of the mode constants (16 bit, 8 bit, ADPCM) - nsamp is the number of samples to play (not number of bytes!) - freq is the sampling rate of the sound - vol is the volume, 0 to 0xff (0xff is louder) - pan is a panning constant -- 0 is left, 128 is center, 255 is right. - - This routine (and the similar ones) owe a lot to Marcus' sound example -- - I hadn't gotten quite this far into dissecting the individual regs yet. */ -void aica_play(int ch,int mode,unsigned long smpptr,int loopst,int loopend,int freq,int vol,int pan,int loopflag) { -/* int i; -*/ - int val; - int old = 0; - - /* Stop the channel (if it's already playing) */ - aica_stop(ch); - /* doesn't seem to be needed, but it's here just in case */ -/* - for (i=0; i<256; i++) { - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - } -*/ - G2_LOCK(old); - /* Envelope setup. The first of these is the loop point, - e.g., where the sample starts over when it loops. The second - is the loop end. This is the full length of the sample when - you are not looping, or the loop end point when you are (though - storing more than that is a waste of memory if you're not doing - volume enveloping). */ - CHNREG32(ch, 8) = loopst & 0xffff; - CHNREG32(ch, 12) = loopend & 0xffff; - - /* Write resulting values */ - CHNREG32(ch, 24) = AICA_FREQ(freq); - - /* Set volume, pan, and some other things that we don't know what - they do =) */ - CHNREG32(ch, 36) = AICA_PAN(pan) | (0xf<<8); - /* Convert the incoming volume and pan into hardware values */ - /* Vol starts at zero so we can ramp */ - vol = AICA_VOL(vol); - CHNREG32(ch, 40) = 0x24 | (vol<<8); - /* Convert the incoming volume and pan into hardware values */ - /* Vol starts at zero so we can ramp */ - - /* If we supported volume envelopes (which we don't yet) then - this value would set that up. The top 4 bits determine the - envelope speed. f is the fastest, 1 is the slowest, and 0 - seems to be an invalid value and does weird things). The - default (below) sets it into normal mode (play and terminate/loop). - CHNREG32(ch, 16) = 0xf010; - */ - CHNREG32(ch, 16) = 0x1f; /* No volume envelope */ - - - /* Set sample format, buffer address, and looping control. If - 0x0200 mask is set on reg 0, the sample loops infinitely. If - it's not set, the sample plays once and terminates. We'll - also set the bits to start playback here. */ - CHNREG32(ch, 4) = smpptr & 0xffff; - val = 0xc000 | 0x0000 | (mode<<7) | (smpptr >> 16); - if (loopflag) val|=0x200; - - CHNREG32(ch, 0) = val; - - G2_UNLOCK(old); - - /* Enable playback */ - /* CHNREG32(ch, 0) |= 0xc000; */ - g2_fifo_wait(); - -#if 0 - for (i=0xff; i>=vol; i--) { - if ((i&7)==0) g2_fifo_wait(); - CHNREG32(ch, 40) = 0x24 | (i<<8);; - } - - g2_fifo_wait(); -#endif -} - -/* Stop the sound on a given channel */ -void aica_stop(int ch) { - g2_write_32(CHNREGADDR(ch, 0),(g2_read_32(CHNREGADDR(ch, 0)) & ~0x4000) | 0x8000); - g2_fifo_wait(); -} - - -/* The rest of these routines can change the channel in mid-stride so you - can do things like vibrato and panning effects. */ - -/* Set channel volume */ -void aica_vol(int ch,int vol) { -// g2_write_8(CHNREGADDR(ch, 41),AICA_VOL(vol)); - g2_write_32(CHNREGADDR(ch, 40),(g2_read_32(CHNREGADDR(ch, 40))&0xffff00ff)|(AICA_VOL(vol)<<8) ); - g2_fifo_wait(); -} - -/* Set channel pan */ -void aica_pan(int ch,int pan) { -// g2_write_8(CHNREGADDR(ch, 36),AICA_PAN(pan)); - g2_write_32(CHNREGADDR(ch, 36),(g2_read_32(CHNREGADDR(ch, 36))&0xffffff00)|(AICA_PAN(pan)) ); - g2_fifo_wait(); -} - -/* Set channel frequency */ -void aica_freq(int ch,int freq) { - g2_write_32(CHNREGADDR(ch, 24),AICA_FREQ(freq)); - g2_fifo_wait(); -} - -/* Get channel position */ -int aica_get_pos(int ch) { -#if 1 - /* Observe channel ch */ - g2_write_32(SNDREGADDR(0x280c),(g2_read_32(SNDREGADDR(0x280c))&0xffff00ff) | (ch<<8)); - g2_fifo_wait(); - /* Update position counters */ - return g2_read_32(SNDREGADDR(0x2814)) & 0xffff; -#else - /* Observe channel ch */ - g2_write_8(SNDREGADDR(0x280d),ch); - /* Update position counters */ - return g2_read_32(SNDREGADDR(0x2814)) & 0xffff; -#endif -} diff --git a/src/audio/dc/aica.h b/src/audio/dc/aica.h deleted file mode 100644 index 2721e42821..0000000000 --- a/src/audio/dc/aica.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _AICA_H_ -#define _AICA_H_ - -#define AICA_MEM 0xa0800000 - -#define SM_8BIT 1 -#define SM_16BIT 0 -#define SM_ADPCM 2 - -void aica_play(int ch,int mode,unsigned long smpptr,int looptst,int loopend,int freq,int vol,int pan,int loopflag); -void aica_stop(int ch); -void aica_vol(int ch,int vol); -void aica_pan(int ch,int pan); -void aica_freq(int ch,int freq); -int aica_get_pos(int ch); - -#endif diff --git a/src/audio/directsound/SDL_directsound.c b/src/audio/directsound/SDL_directsound.c new file mode 100644 index 0000000000..686d466151 --- /dev/null +++ b/src/audio/directsound/SDL_directsound.c @@ -0,0 +1,558 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_DSOUND + +/* Allow access to a raw mixing buffer */ + +#include "SDL_timer.h" +#include "SDL_loadso.h" +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "SDL_directsound.h" + +#ifndef WAVE_FORMAT_IEEE_FLOAT +#define WAVE_FORMAT_IEEE_FLOAT 0x0003 +#endif + +/* DirectX function pointers for audio */ +static void* DSoundDLL = NULL; +typedef HRESULT(WINAPI*fnDirectSoundCreate8)(LPGUID,LPDIRECTSOUND*,LPUNKNOWN); +typedef HRESULT(WINAPI*fnDirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID); +typedef HRESULT(WINAPI*fnDirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW,LPVOID); +static fnDirectSoundCreate8 pDirectSoundCreate8 = NULL; +static fnDirectSoundEnumerateW pDirectSoundEnumerateW = NULL; +static fnDirectSoundCaptureEnumerateW pDirectSoundCaptureEnumerateW = NULL; + +static void +DSOUND_Unload(void) +{ + pDirectSoundCreate8 = NULL; + pDirectSoundEnumerateW = NULL; + pDirectSoundCaptureEnumerateW = NULL; + + if (DSoundDLL != NULL) { + SDL_UnloadObject(DSoundDLL); + DSoundDLL = NULL; + } +} + + +static int +DSOUND_Load(void) +{ + int loaded = 0; + + DSOUND_Unload(); + + DSoundDLL = SDL_LoadObject("DSOUND.DLL"); + if (DSoundDLL == NULL) { + SDL_SetError("DirectSound: failed to load DSOUND.DLL"); + } else { + /* Now make sure we have DirectX 8 or better... */ + #define DSOUNDLOAD(f) { \ + p##f = (fn##f) SDL_LoadFunction(DSoundDLL, #f); \ + if (!p##f) loaded = 0; \ + } + loaded = 1; /* will reset if necessary. */ + DSOUNDLOAD(DirectSoundCreate8); + DSOUNDLOAD(DirectSoundEnumerateW); + DSOUNDLOAD(DirectSoundCaptureEnumerateW); + #undef DSOUNDLOAD + + if (!loaded) { + SDL_SetError("DirectSound: System doesn't appear to have DX8."); + } + } + + if (!loaded) { + DSOUND_Unload(); + } + + return loaded; +} + +static __inline__ char * +utf16_to_utf8(const WCHAR *S) +{ + /* !!! FIXME: this should be UTF-16, not UCS-2! */ + return SDL_iconv_string("UTF-8", "UCS-2", (char *)(S), + (SDL_wcslen(S)+1)*sizeof(WCHAR)); +} + +static int +SetDSerror(const char *function, int code) +{ + static const char *error; + static char errbuf[1024]; + + errbuf[0] = 0; + switch (code) { + case E_NOINTERFACE: + error = "Unsupported interface -- Is DirectX 8.0 or later installed?"; + break; + case DSERR_ALLOCATED: + error = "Audio device in use"; + break; + case DSERR_BADFORMAT: + error = "Unsupported audio format"; + break; + case DSERR_BUFFERLOST: + error = "Mixing buffer was lost"; + break; + case DSERR_CONTROLUNAVAIL: + error = "Control requested is not available"; + break; + case DSERR_INVALIDCALL: + error = "Invalid call for the current state"; + break; + case DSERR_INVALIDPARAM: + error = "Invalid parameter"; + break; + case DSERR_NODRIVER: + error = "No audio device found"; + break; + case DSERR_OUTOFMEMORY: + error = "Out of memory"; + break; + case DSERR_PRIOLEVELNEEDED: + error = "Caller doesn't have priority"; + break; + case DSERR_UNSUPPORTED: + error = "Function not supported"; + break; + default: + SDL_snprintf(errbuf, SDL_arraysize(errbuf), + "%s: Unknown DirectSound error: 0x%x", function, code); + break; + } + if (!errbuf[0]) { + SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, + error); + } + return SDL_SetError("%s", errbuf); +} + + +static BOOL CALLBACK +FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID data) +{ + SDL_AddAudioDevice addfn = (SDL_AddAudioDevice) data; + if (guid != NULL) { /* skip default device */ + char *str = utf16_to_utf8(desc); + if (str != NULL) { + addfn(str); + SDL_free(str); /* addfn() makes a copy of this string. */ + } + } + return TRUE; /* keep enumerating. */ +} + +static void +DSOUND_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +{ + if (iscapture) { + pDirectSoundCaptureEnumerateW(FindAllDevs, addfn); + } else { + pDirectSoundEnumerateW(FindAllDevs, addfn); + } +} + + +static void +DSOUND_WaitDevice(_THIS) +{ + DWORD status = 0; + DWORD cursor = 0; + DWORD junk = 0; + HRESULT result = DS_OK; + + /* Semi-busy wait, since we have no way of getting play notification + on a primary mixing buffer located in hardware (DirectX 5.0) + */ + result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf, + &junk, &cursor); + if (result != DS_OK) { + if (result == DSERR_BUFFERLOST) { + IDirectSoundBuffer_Restore(this->hidden->mixbuf); + } +#ifdef DEBUG_SOUND + SetDSerror("DirectSound GetCurrentPosition", result); +#endif + return; + } + + while ((cursor / this->hidden->mixlen) == this->hidden->lastchunk) { + /* FIXME: find out how much time is left and sleep that long */ + SDL_Delay(1); + + /* Try to restore a lost sound buffer */ + IDirectSoundBuffer_GetStatus(this->hidden->mixbuf, &status); + if ((status & DSBSTATUS_BUFFERLOST)) { + IDirectSoundBuffer_Restore(this->hidden->mixbuf); + IDirectSoundBuffer_GetStatus(this->hidden->mixbuf, &status); + if ((status & DSBSTATUS_BUFFERLOST)) { + break; + } + } + if (!(status & DSBSTATUS_PLAYING)) { + result = IDirectSoundBuffer_Play(this->hidden->mixbuf, 0, 0, + DSBPLAY_LOOPING); + if (result == DS_OK) { + continue; + } +#ifdef DEBUG_SOUND + SetDSerror("DirectSound Play", result); +#endif + return; + } + + /* Find out where we are playing */ + result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf, + &junk, &cursor); + if (result != DS_OK) { + SetDSerror("DirectSound GetCurrentPosition", result); + return; + } + } +} + +static void +DSOUND_PlayDevice(_THIS) +{ + /* Unlock the buffer, allowing it to play */ + if (this->hidden->locked_buf) { + IDirectSoundBuffer_Unlock(this->hidden->mixbuf, + this->hidden->locked_buf, + this->hidden->mixlen, NULL, 0); + } + +} + +static Uint8 * +DSOUND_GetDeviceBuf(_THIS) +{ + DWORD cursor = 0; + DWORD junk = 0; + HRESULT result = DS_OK; + DWORD rawlen = 0; + + /* Figure out which blocks to fill next */ + this->hidden->locked_buf = NULL; + result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf, + &junk, &cursor); + if (result == DSERR_BUFFERLOST) { + IDirectSoundBuffer_Restore(this->hidden->mixbuf); + result = IDirectSoundBuffer_GetCurrentPosition(this->hidden->mixbuf, + &junk, &cursor); + } + if (result != DS_OK) { + SetDSerror("DirectSound GetCurrentPosition", result); + return (NULL); + } + cursor /= this->hidden->mixlen; +#ifdef DEBUG_SOUND + /* Detect audio dropouts */ + { + DWORD spot = cursor; + if (spot < this->hidden->lastchunk) { + spot += this->hidden->num_buffers; + } + if (spot > this->hidden->lastchunk + 1) { + fprintf(stderr, "Audio dropout, missed %d fragments\n", + (spot - (this->hidden->lastchunk + 1))); + } + } +#endif + this->hidden->lastchunk = cursor; + cursor = (cursor + 1) % this->hidden->num_buffers; + cursor *= this->hidden->mixlen; + + /* Lock the audio buffer */ + result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor, + this->hidden->mixlen, + (LPVOID *) & this->hidden->locked_buf, + &rawlen, NULL, &junk, 0); + if (result == DSERR_BUFFERLOST) { + IDirectSoundBuffer_Restore(this->hidden->mixbuf); + result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor, + this->hidden->mixlen, + (LPVOID *) & this-> + hidden->locked_buf, &rawlen, NULL, + &junk, 0); + } + if (result != DS_OK) { + SetDSerror("DirectSound Lock", result); + return (NULL); + } + return (this->hidden->locked_buf); +} + +static void +DSOUND_WaitDone(_THIS) +{ + Uint8 *stream = DSOUND_GetDeviceBuf(this); + + /* Wait for the playing chunk to finish */ + if (stream != NULL) { + SDL_memset(stream, this->spec.silence, this->hidden->mixlen); + DSOUND_PlayDevice(this); + } + DSOUND_WaitDevice(this); + + /* Stop the looping sound buffer */ + IDirectSoundBuffer_Stop(this->hidden->mixbuf); +} + +static void +DSOUND_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->sound != NULL) { + if (this->hidden->mixbuf != NULL) { + /* Clean up the audio buffer */ + IDirectSoundBuffer_Release(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + IDirectSound_Release(this->hidden->sound); + this->hidden->sound = NULL; + } + + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +/* This function tries to create a secondary audio buffer, and returns the + number of audio chunks available in the created buffer. +*/ +static int +CreateSecondary(_THIS, HWND focus) +{ + LPDIRECTSOUND sndObj = this->hidden->sound; + LPDIRECTSOUNDBUFFER *sndbuf = &this->hidden->mixbuf; + Uint32 chunksize = this->spec.size; + const int numchunks = 8; + HRESULT result = DS_OK; + DSBUFFERDESC format; + LPVOID pvAudioPtr1, pvAudioPtr2; + DWORD dwAudioBytes1, dwAudioBytes2; + WAVEFORMATEX wfmt; + + SDL_zero(wfmt); + + if (SDL_AUDIO_ISFLOAT(this->spec.format)) { + wfmt.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + } else { + wfmt.wFormatTag = WAVE_FORMAT_PCM; + } + + wfmt.wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format); + wfmt.nChannels = this->spec.channels; + wfmt.nSamplesPerSec = this->spec.freq; + wfmt.nBlockAlign = wfmt.nChannels * (wfmt.wBitsPerSample / 8); + wfmt.nAvgBytesPerSec = wfmt.nSamplesPerSec * wfmt.nBlockAlign; + + /* Update the fragment size as size in bytes */ + SDL_CalculateAudioSpec(&this->spec); + + /* Try to set primary mixing privileges */ + if (focus) { + result = IDirectSound_SetCooperativeLevel(sndObj, + focus, DSSCL_PRIORITY); + } else { + result = IDirectSound_SetCooperativeLevel(sndObj, + GetDesktopWindow(), + DSSCL_NORMAL); + } + if (result != DS_OK) { + return SetDSerror("DirectSound SetCooperativeLevel", result); + } + + /* Try to create the secondary buffer */ + SDL_zero(format); + format.dwSize = sizeof(format); + format.dwFlags = DSBCAPS_GETCURRENTPOSITION2; + if (!focus) { + format.dwFlags |= DSBCAPS_GLOBALFOCUS; + } else { + format.dwFlags |= DSBCAPS_STICKYFOCUS; + } + format.dwBufferBytes = numchunks * chunksize; + if ((format.dwBufferBytes < DSBSIZE_MIN) || + (format.dwBufferBytes > DSBSIZE_MAX)) { + return SDL_SetError("Sound buffer size must be between %d and %d", + DSBSIZE_MIN / numchunks, DSBSIZE_MAX / numchunks); + } + format.dwReserved = 0; + format.lpwfxFormat = &wfmt; + result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL); + if (result != DS_OK) { + return SetDSerror("DirectSound CreateSoundBuffer", result); + } + IDirectSoundBuffer_SetFormat(*sndbuf, &wfmt); + + /* Silence the initial audio buffer */ + result = IDirectSoundBuffer_Lock(*sndbuf, 0, format.dwBufferBytes, + (LPVOID *) & pvAudioPtr1, &dwAudioBytes1, + (LPVOID *) & pvAudioPtr2, &dwAudioBytes2, + DSBLOCK_ENTIREBUFFER); + if (result == DS_OK) { + SDL_memset(pvAudioPtr1, this->spec.silence, dwAudioBytes1); + IDirectSoundBuffer_Unlock(*sndbuf, + (LPVOID) pvAudioPtr1, dwAudioBytes1, + (LPVOID) pvAudioPtr2, dwAudioBytes2); + } + + /* We're ready to go */ + return (numchunks); +} + +typedef struct FindDevGUIDData +{ + const char *devname; + GUID guid; + int found; +} FindDevGUIDData; + +static BOOL CALLBACK +FindDevGUID(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID _data) +{ + if (guid != NULL) { /* skip the default device. */ + FindDevGUIDData *data = (FindDevGUIDData *) _data; + char *str = utf16_to_utf8(desc); + const int match = (SDL_strcmp(str, data->devname) == 0); + SDL_free(str); + if (match) { + data->found = 1; + SDL_memcpy(&data->guid, guid, sizeof (data->guid)); + return FALSE; /* found it! stop enumerating. */ + } + } + return TRUE; /* keep enumerating. */ +} + +static int +DSOUND_OpenDevice(_THIS, const char *devname, int iscapture) +{ + HRESULT result; + SDL_bool valid_format = SDL_FALSE; + SDL_bool tried_format = SDL_FALSE; + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + FindDevGUIDData devguid; + LPGUID guid = NULL; + + if (devname != NULL) { + devguid.found = 0; + devguid.devname = devname; + if (iscapture) + pDirectSoundCaptureEnumerateW(FindDevGUID, &devguid); + else + pDirectSoundEnumerateW(FindDevGUID, &devguid); + + if (!devguid.found) { + return SDL_SetError("DirectSound: Requested device not found"); + } + guid = &devguid.guid; + } + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + result = pDirectSoundCreate8(guid, &this->hidden->sound, NULL); + if (result != DS_OK) { + DSOUND_CloseDevice(this); + return SetDSerror("DirectSoundCreate", result); + } + + while ((!valid_format) && (test_format)) { + switch (test_format) { + case AUDIO_U8: + case AUDIO_S16: + case AUDIO_S32: + case AUDIO_F32: + tried_format = SDL_TRUE; + this->spec.format = test_format; + this->hidden->num_buffers = CreateSecondary(this, NULL); + if (this->hidden->num_buffers > 0) { + valid_format = SDL_TRUE; + } + break; + } + test_format = SDL_NextAudioFormat(); + } + + if (!valid_format) { + DSOUND_CloseDevice(this); + if (tried_format) { + return -1; // CreateSecondary() should have called SDL_SetError(). + } + return SDL_SetError("DirectSound: Unsupported audio format"); + } + + /* The buffer will auto-start playing in DSOUND_WaitDevice() */ + this->hidden->mixlen = this->spec.size; + + return 0; /* good to go. */ +} + + +static void +DSOUND_Deinitialize(void) +{ + DSOUND_Unload(); +} + + +static int +DSOUND_Init(SDL_AudioDriverImpl * impl) +{ + if (!DSOUND_Load()) { + return 0; + } + + /* Set the function pointers */ + impl->DetectDevices = DSOUND_DetectDevices; + impl->OpenDevice = DSOUND_OpenDevice; + impl->PlayDevice = DSOUND_PlayDevice; + impl->WaitDevice = DSOUND_WaitDevice; + impl->WaitDone = DSOUND_WaitDone; + impl->GetDeviceBuf = DSOUND_GetDeviceBuf; + impl->CloseDevice = DSOUND_CloseDevice; + impl->Deinitialize = DSOUND_Deinitialize; + + return 1; /* this audio target is available. */ +} + +AudioBootStrap DSOUND_bootstrap = { + "directsound", "DirectSound", DSOUND_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_DSOUND */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/directsound/SDL_directsound.h b/src/audio/directsound/SDL_directsound.h new file mode 100644 index 0000000000..758299f14f --- /dev/null +++ b/src/audio/directsound/SDL_directsound.h @@ -0,0 +1,46 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_directsound_h +#define _SDL_directsound_h + +#include "directx.h" + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +/* The DirectSound objects */ +struct SDL_PrivateAudioData +{ + LPDIRECTSOUND sound; + LPDIRECTSOUNDBUFFER mixbuf; + int num_buffers; + int mixlen; + DWORD lastchunk; + Uint8 *locked_buf; +}; + +#endif /* _SDL_directsound_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/directsound/directx.h b/src/audio/directsound/directx.h new file mode 100644 index 0000000000..963d2b88e1 --- /dev/null +++ b/src/audio/directsound/directx.h @@ -0,0 +1,81 @@ + +#ifndef _directx_h +#define _directx_h + +/* Include all of the DirectX 8.0 headers and adds any necessary tweaks */ + +#include "../../core/windows/SDL_windows.h" +#include +#ifndef WIN32 +#define WIN32 +#endif +#undef WINNT + +/* Far pointers don't exist in 32-bit code */ +#ifndef FAR +#define FAR +#endif + +/* Error codes not yet included in Win32 API header files */ +#ifndef MAKE_HRESULT +#define MAKE_HRESULT(sev,fac,code) \ + ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code)))) +#endif + +#ifndef S_OK +#define S_OK (HRESULT)0x00000000L +#endif + +#ifndef SUCCEEDED +#define SUCCEEDED(x) ((HRESULT)(x) >= 0) +#endif +#ifndef FAILED +#define FAILED(x) ((HRESULT)(x)<0) +#endif + +#ifndef E_FAIL +#define E_FAIL (HRESULT)0x80000008L +#endif +#ifndef E_NOINTERFACE +#define E_NOINTERFACE (HRESULT)0x80004002L +#endif +#ifndef E_OUTOFMEMORY +#define E_OUTOFMEMORY (HRESULT)0x8007000EL +#endif +#ifndef E_INVALIDARG +#define E_INVALIDARG (HRESULT)0x80070057L +#endif +#ifndef E_NOTIMPL +#define E_NOTIMPL (HRESULT)0x80004001L +#endif +#ifndef REGDB_E_CLASSNOTREG +#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L +#endif + +/* Severity codes */ +#ifndef SEVERITY_ERROR +#define SEVERITY_ERROR 1 +#endif + +/* Error facility codes */ +#ifndef FACILITY_WIN32 +#define FACILITY_WIN32 7 +#endif + +#ifndef FIELD_OFFSET +#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field)) +#endif + +/* DirectX headers (if it isn't included, I haven't tested it yet) + */ +/* We need these defines to mark what version of DirectX API we use */ +#define DIRECTDRAW_VERSION 0x0700 +#define DIRECTSOUND_VERSION 0x0800 +#define DIRECTINPUT_VERSION 0x0500 + +#include +#include +#include + +#endif /* _directx_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c index 47c10096a9..2286ba0956 100644 --- a/src/audio/disk/SDL_diskaudio.c +++ b/src/audio/disk/SDL_diskaudio.c @@ -1,28 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org - - This file written by Ryan C. Gordon (icculus@icculus.org) + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_DISK + /* Output raw audio data to a file. */ #if HAVE_STDIO_H @@ -34,153 +33,133 @@ #include "SDL_audio.h" #include "../SDL_audiomem.h" #include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" #include "SDL_diskaudio.h" -/* The tag name used by DISK audio */ -#define DISKAUD_DRIVER_NAME "disk" - /* environment variables and defaults. */ #define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE" #define DISKDEFAULT_OUTFILE "sdlaudio.raw" #define DISKENVR_WRITEDELAY "SDL_DISKAUDIODELAY" #define DISKDEFAULT_WRITEDELAY 150 -/* Audio driver functions */ -static int DISKAUD_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DISKAUD_WaitAudio(_THIS); -static void DISKAUD_PlayAudio(_THIS); -static Uint8 *DISKAUD_GetAudioBuf(_THIS); -static void DISKAUD_CloseAudio(_THIS); - -static const char *DISKAUD_GetOutputFilename(void) -{ - const char *envr = SDL_getenv(DISKENVR_OUTFILE); - return((envr != NULL) ? envr : DISKDEFAULT_OUTFILE); -} - -/* Audio driver bootstrap functions */ -static int DISKAUD_Available(void) -{ - const char *envr = SDL_getenv("SDL_AUDIODRIVER"); - if (envr && (SDL_strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) { - return(1); - } - return(0); -} - -static void DISKAUD_DeleteDevice(SDL_AudioDevice *device) +static const char * +DISKAUD_GetOutputFilename(const char *devname) { - SDL_free(device->hidden); - SDL_free(device); + if (devname == NULL) { + devname = SDL_getenv(DISKENVR_OUTFILE); + if (devname == NULL) { + devname = DISKDEFAULT_OUTFILE; + } + } + return devname; } -static SDL_AudioDevice *DISKAUD_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - const char *envr; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - envr = SDL_getenv(DISKENVR_WRITEDELAY); - this->hidden->write_delay = (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY; - - /* Set the function pointers */ - this->OpenAudio = DISKAUD_OpenAudio; - this->WaitAudio = DISKAUD_WaitAudio; - this->PlayAudio = DISKAUD_PlayAudio; - this->GetAudioBuf = DISKAUD_GetAudioBuf; - this->CloseAudio = DISKAUD_CloseAudio; - - this->free = DISKAUD_DeleteDevice; - - return this; -} - -AudioBootStrap DISKAUD_bootstrap = { - DISKAUD_DRIVER_NAME, "direct-to-disk audio", - DISKAUD_Available, DISKAUD_CreateDevice -}; - /* This function waits until it is possible to write a full sound buffer */ -static void DISKAUD_WaitAudio(_THIS) +static void +DISKAUD_WaitDevice(_THIS) { - SDL_Delay(this->hidden->write_delay); + SDL_Delay(this->hidden->write_delay); } -static void DISKAUD_PlayAudio(_THIS) +static void +DISKAUD_PlayDevice(_THIS) { - int written; + size_t written; - /* Write the audio data */ - written = SDL_RWwrite(this->hidden->output, - this->hidden->mixbuf, 1, - this->hidden->mixlen); + /* Write the audio data */ + written = SDL_RWwrite(this->hidden->output, + this->hidden->mixbuf, 1, this->hidden->mixlen); - /* If we couldn't write, assume fatal error for now */ - if ( (Uint32)written != this->hidden->mixlen ) { - this->enabled = 0; - } + /* If we couldn't write, assume fatal error for now */ + if (written != this->hidden->mixlen) { + this->enabled = 0; + } #ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", written); + fprintf(stderr, "Wrote %d bytes of audio data\n", written); #endif } -static Uint8 *DISKAUD_GetAudioBuf(_THIS) +static Uint8 * +DISKAUD_GetDeviceBuf(_THIS) { - return(this->hidden->mixbuf); + return (this->hidden->mixbuf); } -static void DISKAUD_CloseAudio(_THIS) +static void +DISKAUD_CloseDevice(_THIS) { - if ( this->hidden->mixbuf != NULL ) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - } - if ( this->hidden->output != NULL ) { - SDL_RWclose(this->hidden->output); - this->hidden->output = NULL; - } + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->output != NULL) { + SDL_RWclose(this->hidden->output); + this->hidden->output = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } } -static int DISKAUD_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture) { - const char *fname = DISKAUD_GetOutputFilename(); - - /* Open the audio device */ - this->hidden->output = SDL_RWFromFile(fname, "wb"); - if ( this->hidden->output == NULL ) { - return(-1); - } + const char *envr = SDL_getenv(DISKENVR_WRITEDELAY); + const char *fname = DISKAUD_GetOutputFilename(devname); + + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc(sizeof(*this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, sizeof(*this->hidden)); + + this->hidden->mixlen = this->spec.size; + this->hidden->write_delay = + (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY; + + /* Open the audio device */ + this->hidden->output = SDL_RWFromFile(fname, "wb"); + if (this->hidden->output == NULL) { + DISKAUD_CloseDevice(this); + return -1; + } + + /* Allocate mixing buffer */ + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + DISKAUD_CloseDevice(this); + return -1; + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); #if HAVE_STDIO_H - fprintf(stderr, "WARNING: You are using the SDL disk writer" - " audio driver!\n Writing to file [%s].\n", fname); + fprintf(stderr, + "WARNING: You are using the SDL disk writer audio driver!\n" + " Writing to file [%s].\n", fname); #endif - /* Allocate mixing buffer */ - this->hidden->mixlen = spec->size; - this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); - if ( this->hidden->mixbuf == NULL ) { - return(-1); - } - SDL_memset(this->hidden->mixbuf, spec->silence, spec->size); + /* We're ready to rock and roll. :-) */ + return 0; +} - /* We're ready to rock and roll. :-) */ - return(0); +static int +DISKAUD_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->OpenDevice = DISKAUD_OpenDevice; + impl->WaitDevice = DISKAUD_WaitDevice; + impl->PlayDevice = DISKAUD_PlayDevice; + impl->GetDeviceBuf = DISKAUD_GetDeviceBuf; + impl->CloseDevice = DISKAUD_CloseDevice; + + return 1; /* this audio target is available. */ } +AudioBootStrap DISKAUD_bootstrap = { + "disk", "direct-to-disk audio", DISKAUD_Init, 1 +}; + +#endif /* SDL_AUDIO_DRIVER_DISK */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/disk/SDL_diskaudio.h b/src/audio/disk/SDL_diskaudio.h index 24d7c9e34d..7e5b48406f 100644 --- a/src/audio/disk/SDL_diskaudio.h +++ b/src/audio/disk/SDL_diskaudio.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -27,15 +26,17 @@ #include "SDL_rwops.h" #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - SDL_RWops *output; - Uint8 *mixbuf; - Uint32 mixlen; - Uint32 write_delay; +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + SDL_RWops *output; + Uint8 *mixbuf; + Uint32 mixlen; + Uint32 write_delay; }; #endif /* _SDL_diskaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/dma/SDL_dmaaudio.c b/src/audio/dma/SDL_dmaaudio.c deleted file mode 100644 index 39f81d90ce..0000000000 --- a/src/audio/dma/SDL_dmaaudio.c +++ /dev/null @@ -1,455 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer */ - -#include -#include /* For strerror() */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H -/* This is installed on some systems */ -#include -#else -/* This is recommended by OSS */ -#include -#endif - -#ifndef MAP_FAILED -#define MAP_FAILED ((Uint8 *)-1) -#endif - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" -#include "SDL_dmaaudio.h" - -/* The tag name used by DMA audio */ -#define DMA_DRIVER_NAME "dma" - -/* Open the audio device for playback, and don't block if busy */ -#define OPEN_FLAGS (O_RDWR|O_NONBLOCK) - -/* Audio driver functions */ -static int DMA_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DMA_WaitAudio(_THIS); -static void DMA_PlayAudio(_THIS); -static Uint8 *DMA_GetAudioBuf(_THIS); -static void DMA_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - int available; - int fd; - - available = 0; - - fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0); - if ( fd >= 0 ) { - int caps; - struct audio_buf_info info; - - if ( (ioctl(fd, SNDCTL_DSP_GETCAPS, &caps) == 0) && - (caps & DSP_CAP_TRIGGER) && (caps & DSP_CAP_MMAP) && - (ioctl(fd, SNDCTL_DSP_GETOSPACE, &info) == 0) ) { - available = 1; - } - close(fd); - } - return(available); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - audio_fd = -1; - - /* Set the function pointers */ - this->OpenAudio = DMA_OpenAudio; - this->WaitAudio = DMA_WaitAudio; - this->PlayAudio = DMA_PlayAudio; - this->GetAudioBuf = DMA_GetAudioBuf; - this->CloseAudio = DMA_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap DMA_bootstrap = { - DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio", - Audio_Available, Audio_CreateDevice -}; - -/* This function waits until it is possible to write a full sound buffer */ -static void DMA_WaitAudio(_THIS) -{ - fd_set fdset; - - /* Check to see if the thread-parent process is still alive */ - { static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */ - if ( kill(parent, 0) < 0 ) { - this->enabled = 0; - } - } - } - - /* See if we need to use timed audio synchronization */ - if ( frame_ticks ) { - /* Use timer for general audio synchronization */ - Sint32 ticks; - - ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS; - if ( ticks > 0 ) { - SDL_Delay(ticks); - } - } else { - /* Use select() for audio synchronization */ - struct timeval timeout; - FD_ZERO(&fdset); - FD_SET(audio_fd, &fdset); - timeout.tv_sec = 10; - timeout.tv_usec = 0; -#ifdef DEBUG_AUDIO - fprintf(stderr, "Waiting for audio to get ready\n"); -#endif - if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) { - const char *message = -#ifdef AUDIO_OSPACE_HACK - "Audio timeout - buggy audio driver? (trying ospace)"; -#else - "Audio timeout - buggy audio driver? (disabled)"; -#endif - /* In general we should never print to the screen, - but in this case we have no other way of letting - the user know what happened. - */ - fprintf(stderr, "SDL: %s\n", message); -#ifdef AUDIO_OSPACE_HACK - /* We may be able to use GET_OSPACE trick */ - frame_ticks = (float)(this->spec->samples*1000) / - this->spec->freq; - next_frame = SDL_GetTicks()+frame_ticks; -#else - this->enabled = 0; - /* Don't try to close - may hang */ - audio_fd = -1; -#ifdef DEBUG_AUDIO - fprintf(stderr, "Done disabling audio\n"); -#endif -#endif /* AUDIO_OSPACE_HACK */ - } -#ifdef DEBUG_AUDIO - fprintf(stderr, "Ready!\n"); -#endif - } -} - -static void DMA_PlayAudio(_THIS) -{ - /* If timer synchronization is enabled, set the next write frame */ - if ( frame_ticks ) { - next_frame += frame_ticks; - } - return; -} - -static Uint8 *DMA_GetAudioBuf(_THIS) -{ - count_info info; - int playing; - int filling; - - /* Get number of blocks, looping if we're not using select() */ - do { - if ( ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) < 0 ) { - /* Uh oh... */ - this->enabled = 0; - return(NULL); - } - } while ( frame_ticks && (info.blocks < 1) ); -#ifdef DEBUG_AUDIO - if ( info.blocks > 1 ) { - printf("Warning: audio underflow (%d frags)\n", info.blocks-1); - } -#endif - playing = info.ptr / this->spec.size; - filling = (playing + 1)%num_buffers; - return (dma_buf + (filling * this->spec.size)); -} - -static void DMA_CloseAudio(_THIS) -{ - if ( dma_buf != NULL ) { - munmap(dma_buf, dma_len); - dma_buf = NULL; - } - if ( audio_fd >= 0 ) { - close(audio_fd); - audio_fd = -1; - } -} - -static int DMA_ReopenAudio(_THIS, const char *audiodev, int format, int stereo, - SDL_AudioSpec *spec) -{ - int frag_spec; - int value; - - /* Close and then reopen the audio device */ - close(audio_fd); - audio_fd = open(audiodev, O_RDWR, 0); - if ( audio_fd < 0 ) { - SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); - return(-1); - } - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - /* Determine the power of two of the fragment size */ - for ( frag_spec = 0; (0x01<size; ++frag_spec ); - if ( (0x01<size ) { - SDL_SetError("Fragment size must be a power of two"); - return(-1); - } - - /* Set the audio buffering parameters */ - if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) { - SDL_SetError("Couldn't set audio fragment spec"); - return(-1); - } - - /* Set the audio format */ - value = format; - if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || - (value != format) ) { - SDL_SetError("Couldn't set audio format"); - return(-1); - } - - /* Set mono or stereo audio */ - value = (spec->channels > 1); - if ( (ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) < 0) || - (value != stereo) ) { - SDL_SetError("Couldn't set audio channels"); - return(-1); - } - - /* Set the DSP frequency */ - value = spec->freq; - if ( ioctl(audio_fd, SNDCTL_DSP_SPEED, &value) < 0 ) { - SDL_SetError("Couldn't set audio frequency"); - return(-1); - } - spec->freq = value; - - /* We successfully re-opened the audio */ - return(0); -} - -static int DMA_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - char audiodev[1024]; - int format; - int stereo; - int value; - Uint16 test_format; - struct audio_buf_info info; - - /* Reset the timer synchronization flag */ - frame_ticks = 0.0; - - /* Open the audio device */ - audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0); - if ( audio_fd < 0 ) { - SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); - return(-1); - } - dma_buf = NULL; - ioctl(audio_fd, SNDCTL_DSP_RESET, 0); - - /* Get a list of supported hardware formats */ - if ( ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0 ) { - SDL_SetError("Couldn't get audio format list"); - return(-1); - } - - /* Try for a closest match on audio format */ - format = 0; - for ( test_format = SDL_FirstAudioFormat(spec->format); - ! format && test_format; ) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - switch ( test_format ) { - case AUDIO_U8: - if ( value & AFMT_U8 ) { - format = AFMT_U8; - } - break; - case AUDIO_S8: - if ( value & AFMT_S8 ) { - format = AFMT_S8; - } - break; - case AUDIO_S16LSB: - if ( value & AFMT_S16_LE ) { - format = AFMT_S16_LE; - } - break; - case AUDIO_S16MSB: - if ( value & AFMT_S16_BE ) { - format = AFMT_S16_BE; - } - break; - case AUDIO_U16LSB: - if ( value & AFMT_U16_LE ) { - format = AFMT_U16_LE; - } - break; - case AUDIO_U16MSB: - if ( value & AFMT_U16_BE ) { - format = AFMT_U16_BE; - } - break; - default: - format = 0; - break; - } - if ( ! format ) { - test_format = SDL_NextAudioFormat(); - } - } - if ( format == 0 ) { - SDL_SetError("Couldn't find any hardware audio formats"); - return(-1); - } - spec->format = test_format; - - /* Set the audio format */ - value = format; - if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || - (value != format) ) { - SDL_SetError("Couldn't set audio format"); - return(-1); - } - - /* Set mono or stereo audio (currently only two channels supported) */ - stereo = (spec->channels > 1); - ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo); - if ( stereo ) { - spec->channels = 2; - } else { - spec->channels = 1; - } - - /* Because some drivers don't allow setting the buffer size - after setting the format, we must re-open the audio device - once we know what format and channels are supported - */ - if ( DMA_ReopenAudio(this, audiodev, format, stereo, spec) < 0 ) { - /* Error is set by DMA_ReopenAudio() */ - return(-1); - } - - /* Memory map the audio buffer */ - if ( ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) < 0 ) { - SDL_SetError("Couldn't get OSPACE parameters"); - return(-1); - } - spec->size = info.fragsize; - spec->samples = spec->size / ((spec->format & 0xFF) / 8); - spec->samples /= spec->channels; - num_buffers = info.fragstotal; - dma_len = num_buffers*spec->size; - dma_buf = (Uint8 *)mmap(NULL, dma_len, PROT_WRITE, MAP_SHARED, - audio_fd, 0); - if ( dma_buf == MAP_FAILED ) { - SDL_SetError("DMA memory map failed"); - dma_buf = NULL; - return(-1); - } - SDL_memset(dma_buf, spec->silence, dma_len); - - /* Check to see if we need to use select() workaround */ - { char *workaround; - workaround = SDL_getenv("SDL_DSP_NOSELECT"); - if ( workaround ) { - frame_ticks = (float)(spec->samples*1000)/spec->freq; - next_frame = SDL_GetTicks()+frame_ticks; - } - } - - /* Trigger audio playback */ - value = 0; - ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value); - value = PCM_ENABLE_OUTPUT; - if ( ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value) < 0 ) { - SDL_SetError("Couldn't trigger audio output"); - return(-1); - } - - /* Get the parent process id (we're the parent of the audio thread) */ - parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return(0); -} diff --git a/src/audio/dma/SDL_dmaaudio.h b/src/audio/dma/SDL_dmaaudio.h deleted file mode 100644 index 9a45f732a1..0000000000 --- a/src/audio/dma/SDL_dmaaudio.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_dspaudio_h -#define _SDL_dspaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - int audio_fd; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8 *dma_buf; - int dma_len; - int num_buffers; - - /* Support for audio timing using a timer, in addition to select() */ - float frame_ticks; - float next_frame; -}; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -/* Old variable names */ -#define audio_fd (this->hidden->audio_fd) -#define parent (this->hidden->parent) -#define dma_buf (this->hidden->dma_buf) -#define dma_len (this->hidden->dma_len) -#define num_buffers (this->hidden->num_buffers) -#define frame_ticks (this->hidden->frame_ticks) -#define next_frame (this->hidden->next_frame) - -#endif /* _SDL_dspaudio_h */ diff --git a/src/audio/dmedia/SDL_irixaudio.c b/src/audio/dmedia/SDL_irixaudio.c deleted file mode 100644 index 1dcd2421ec..0000000000 --- a/src/audio/dmedia/SDL_irixaudio.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer (For IRIX 6.5 and higher) */ -/* patch for IRIX 5 by Georg Schwarz 18/07/2004 */ - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "SDL_irixaudio.h" - - -#ifndef AL_RESOURCE /* as a test whether we use the old IRIX audio libraries */ -#define OLD_IRIX_AUDIO -#define alClosePort(x) ALcloseport(x) -#define alFreeConfig(x) ALfreeconfig(x) -#define alGetFillable(x) ALgetfillable(x) -#define alNewConfig() ALnewconfig() -#define alOpenPort(x,y,z) ALopenport(x,y,z) -#define alSetChannels(x,y) ALsetchannels(x,y) -#define alSetQueueSize(x,y) ALsetqueuesize(x,y) -#define alSetSampFmt(x,y) ALsetsampfmt(x,y) -#define alSetWidth(x,y) ALsetwidth(x,y) -#endif - -/* Audio driver functions */ -static int AL_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void AL_WaitAudio(_THIS); -static void AL_PlayAudio(_THIS); -static Uint8 *AL_GetAudioBuf(_THIS); -static void AL_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - return 1; -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = AL_OpenAudio; - this->WaitAudio = AL_WaitAudio; - this->PlayAudio = AL_PlayAudio; - this->GetAudioBuf = AL_GetAudioBuf; - this->CloseAudio = AL_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap DMEDIA_bootstrap = { - "AL", "IRIX DMedia audio", - Audio_Available, Audio_CreateDevice -}; - - -void static AL_WaitAudio(_THIS) -{ - Sint32 timeleft; - - timeleft = this->spec.samples - alGetFillable(audio_port); - if ( timeleft > 0 ) { - timeleft /= (this->spec.freq/1000); - SDL_Delay((Uint32)timeleft); - } -} - -static void AL_PlayAudio(_THIS) -{ - /* Write the audio data out */ - if ( alWriteFrames(audio_port, mixbuf, this->spec.samples) < 0 ) { - /* Assume fatal error, for now */ - this->enabled = 0; - } -} - -static Uint8 *AL_GetAudioBuf(_THIS) -{ - return(mixbuf); -} - -static void AL_CloseAudio(_THIS) -{ - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( audio_port != NULL ) { - alClosePort(audio_port); - audio_port = NULL; - } -} - -static int AL_OpenAudio(_THIS, SDL_AudioSpec * spec) -{ - Uint16 test_format = SDL_FirstAudioFormat(spec->format); - long width = 0; - long fmt = 0; - int valid = 0; - -#ifdef OLD_IRIX_AUDIO - { - long audio_param[2]; - audio_param[0] = AL_OUTPUT_RATE; - audio_param[1] = spec->freq; - valid = (ALsetparams(AL_DEFAULT_DEVICE, audio_param, 2) < 0); - } -#else - { - ALpv audio_param; - audio_param.param = AL_RATE; - audio_param.value.i = spec->freq; - valid = (alSetParams(AL_DEFAULT_OUTPUT, &audio_param, 1) < 0); - } -#endif - - while ((!valid) && (test_format)) { - valid = 1; - spec->format = test_format; - - switch (test_format) { - case AUDIO_S8: - width = AL_SAMPLE_8; - fmt = AL_SAMPFMT_TWOSCOMP; - break; - - case AUDIO_S16SYS: - width = AL_SAMPLE_16; - fmt = AL_SAMPFMT_TWOSCOMP; - break; - - default: - valid = 0; - test_format = SDL_NextAudioFormat(); - break; - } - - if (valid) { - ALconfig audio_config = alNewConfig(); - valid = 0; - if (audio_config) { - if (alSetChannels(audio_config, spec->channels) < 0) { - if (spec->channels > 2) { /* can't handle > stereo? */ - spec->channels = 2; /* try again below. */ - } - } - - if ((alSetSampFmt(audio_config, fmt) >= 0) && - ((!width) || (alSetWidth(audio_config, width) >= 0)) && - (alSetQueueSize(audio_config, spec->samples * 2) >= 0) && - (alSetChannels(audio_config, spec->channels) >= 0)) { - - audio_port = alOpenPort("SDL audio", "w", audio_config); - if (audio_port == NULL) { - /* docs say AL_BAD_CHANNELS happens here, too. */ - int err = oserror(); - if (err == AL_BAD_CHANNELS) { - spec->channels = 2; - alSetChannels(audio_config, spec->channels); - audio_port = alOpenPort("SDL audio", "w", - audio_config); - } - } - - if (audio_port != NULL) { - valid = 1; - } - } - - alFreeConfig(audio_config); - } - } - } - - if (!valid) { - SDL_SetError("Unsupported audio format"); - return (-1); - } - - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); - - /* Allocate mixing buffer */ - mixbuf = (Uint8 *) SDL_AllocAudioMem(spec->size); - if (mixbuf == NULL) { - SDL_OutOfMemory(); - return (-1); - } - SDL_memset(mixbuf, spec->silence, spec->size); - - /* We're ready to rock and roll. :-) */ - return (0); -} - diff --git a/src/audio/dmedia/SDL_irixaudio.h b/src/audio/dmedia/SDL_irixaudio.h deleted file mode 100644 index c04f497cea..0000000000 --- a/src/audio/dmedia/SDL_irixaudio.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* The handle for the audio device */ - ALport audio_port; - - Uint8 *mixbuf; /* The app mixing buffer */ -}; - -/* Old variable names */ -#define audio_port (this->hidden->audio_port) -#define mixbuf (this->hidden->mixbuf) - -#endif /* _SDL_lowaudio_h */ diff --git a/src/audio/dsp/SDL_dspaudio.c b/src/audio/dsp/SDL_dspaudio.c index 256c547f9b..c62a22f8a6 100644 --- a/src/audio/dsp/SDL_dspaudio.c +++ b/src/audio/dsp/SDL_dspaudio.c @@ -1,33 +1,31 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org - - Modified in Oct 2004 by Hannu Savolainen - hannu@opensound.com + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_OSS + /* Allow access to a raw mixing buffer */ -#include /* For perror() */ -#include /* For strerror() */ +#include /* For perror() */ +#include /* For strerror() */ #include #include #include @@ -51,290 +49,260 @@ #include "../SDL_audiodev_c.h" #include "SDL_dspaudio.h" -/* The tag name used by DSP audio */ -#define DSP_DRIVER_NAME "dsp" - -/* Open the audio device for playback, and don't block if busy */ -#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) - -/* Audio driver functions */ -static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DSP_WaitAudio(_THIS); -static void DSP_PlayAudio(_THIS); -static Uint8 *DSP_GetAudioBuf(_THIS); -static void DSP_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - int fd; - int available; - - available = 0; - fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0); - if ( fd >= 0 ) { - available = 1; - close(fd); - } - return(available); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} -static SDL_AudioDevice *Audio_CreateDevice(int devindex) +static void +DSP_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) { - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - audio_fd = -1; - - /* Set the function pointers */ - this->OpenAudio = DSP_OpenAudio; - this->WaitAudio = DSP_WaitAudio; - this->PlayAudio = DSP_PlayAudio; - this->GetAudioBuf = DSP_GetAudioBuf; - this->CloseAudio = DSP_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; + SDL_EnumUnixAudioDevices(iscapture, 0, NULL, addfn); } -AudioBootStrap DSP_bootstrap = { - DSP_DRIVER_NAME, "OSS /dev/dsp standard audio", - Audio_Available, Audio_CreateDevice -}; - -/* This function waits until it is possible to write a full sound buffer */ -static void DSP_WaitAudio(_THIS) -{ - /* Not needed at all since OSS handles waiting automagically */ -} - -static void DSP_PlayAudio(_THIS) -{ - if (write(audio_fd, mixbuf, mixlen)==-1) - { - perror("Audio write"); - this->enabled = 0; - } - -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", mixlen); -#endif -} -static Uint8 *DSP_GetAudioBuf(_THIS) +static void +DSP_CloseDevice(_THIS) { - return(mixbuf); + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_fd >= 0) { + close(this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + SDL_free(this->hidden); + this->hidden = NULL; + } } -static void DSP_CloseAudio(_THIS) -{ - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( audio_fd >= 0 ) { - close(audio_fd); - audio_fd = -1; - } -} -static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +DSP_OpenDevice(_THIS, const char *devname, int iscapture) { - char audiodev[1024]; - int format; - int value; - int frag_spec; - Uint16 test_format; + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + int format; + int value; + int frag_spec; + SDL_AudioFormat test_format; + + /* We don't care what the devname is...we'll try to open anything. */ + /* ...but default to first name in the list... */ + if (devname == NULL) { + devname = SDL_GetAudioDeviceName(0, iscapture); + if (devname == NULL) { + return SDL_SetError("No such audio device"); + } + } /* Make sure fragment size stays a power of 2, or OSS fails. */ /* I don't know which of these are actually legal values, though... */ - if (spec->channels > 8) - spec->channels = 8; - else if (spec->channels > 4) - spec->channels = 4; - else if (spec->channels > 2) - spec->channels = 2; - - /* Open the audio device */ - audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0); - if ( audio_fd < 0 ) { - SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); - return(-1); - } - mixbuf = NULL; - - /* Make the file descriptor use blocking writes with fcntl() */ - { long flags; - flags = fcntl(audio_fd, F_GETFL); - flags &= ~O_NONBLOCK; - if ( fcntl(audio_fd, F_SETFL, flags) < 0 ) { - SDL_SetError("Couldn't set audio blocking mode"); - DSP_CloseAudio(this); - return(-1); - } - } - - /* Get a list of supported hardware formats */ - if ( ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0 ) { - perror("SNDCTL_DSP_GETFMTS"); - SDL_SetError("Couldn't get audio format list"); - DSP_CloseAudio(this); - return(-1); - } - - /* Try for a closest match on audio format */ - format = 0; - for ( test_format = SDL_FirstAudioFormat(spec->format); - ! format && test_format; ) { + if (this->spec.channels > 8) + this->spec.channels = 8; + else if (this->spec.channels > 4) + this->spec.channels = 4; + else if (this->spec.channels > 2) + this->spec.channels = 2; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + this->hidden->audio_fd = open(devname, flags, 0); + if (this->hidden->audio_fd < 0) { + DSP_CloseDevice(this); + return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); + } + this->hidden->mixbuf = NULL; + + /* Make the file descriptor use blocking writes with fcntl() */ + { + long ctlflags; + ctlflags = fcntl(this->hidden->audio_fd, F_GETFL); + ctlflags &= ~O_NONBLOCK; + if (fcntl(this->hidden->audio_fd, F_SETFL, ctlflags) < 0) { + DSP_CloseDevice(this); + return SDL_SetError("Couldn't set audio blocking mode"); + } + } + + /* Get a list of supported hardware formats */ + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0) { + perror("SNDCTL_DSP_GETFMTS"); + DSP_CloseDevice(this); + return SDL_SetError("Couldn't get audio format list"); + } + + /* Try for a closest match on audio format */ + format = 0; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { #ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); #endif - switch ( test_format ) { - case AUDIO_U8: - if ( value & AFMT_U8 ) { - format = AFMT_U8; - } - break; - case AUDIO_S16LSB: - if ( value & AFMT_S16_LE ) { - format = AFMT_S16_LE; - } - break; - case AUDIO_S16MSB: - if ( value & AFMT_S16_BE ) { - format = AFMT_S16_BE; - } - break; + switch (test_format) { + case AUDIO_U8: + if (value & AFMT_U8) { + format = AFMT_U8; + } + break; + case AUDIO_S16LSB: + if (value & AFMT_S16_LE) { + format = AFMT_S16_LE; + } + break; + case AUDIO_S16MSB: + if (value & AFMT_S16_BE) { + format = AFMT_S16_BE; + } + break; #if 0 /* - * These formats are not used by any real life systems so they are not + * These formats are not used by any real life systems so they are not * needed here. */ - case AUDIO_S8: - if ( value & AFMT_S8 ) { - format = AFMT_S8; - } - break; - case AUDIO_U16LSB: - if ( value & AFMT_U16_LE ) { - format = AFMT_U16_LE; - } - break; - case AUDIO_U16MSB: - if ( value & AFMT_U16_BE ) { - format = AFMT_U16_BE; - } - break; + case AUDIO_S8: + if (value & AFMT_S8) { + format = AFMT_S8; + } + break; + case AUDIO_U16LSB: + if (value & AFMT_U16_LE) { + format = AFMT_U16_LE; + } + break; + case AUDIO_U16MSB: + if (value & AFMT_U16_BE) { + format = AFMT_U16_BE; + } + break; #endif - default: - format = 0; - break; - } - if ( ! format ) { - test_format = SDL_NextAudioFormat(); - } - } - if ( format == 0 ) { - SDL_SetError("Couldn't find any hardware audio formats"); - DSP_CloseAudio(this); - return(-1); - } - spec->format = test_format; - - /* Set the audio format */ - value = format; - if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || - (value != format) ) { - perror("SNDCTL_DSP_SETFMT"); - SDL_SetError("Couldn't set audio format"); - DSP_CloseAudio(this); - return(-1); - } - - /* Set the number of channels of output */ - value = spec->channels; - if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &value) < 0 ) { - perror("SNDCTL_DSP_CHANNELS"); - SDL_SetError("Cannot set the number of channels"); - DSP_CloseAudio(this); - return(-1); - } - spec->channels = value; - - /* Set the DSP frequency */ - value = spec->freq; - if ( ioctl(audio_fd, SNDCTL_DSP_SPEED, &value) < 0 ) { - perror("SNDCTL_DSP_SPEED"); - SDL_SetError("Couldn't set audio frequency"); - DSP_CloseAudio(this); - return(-1); - } - spec->freq = value; - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - /* Determine the power of two of the fragment size */ - for ( frag_spec = 0; (0x01U<size; ++frag_spec ); - if ( (0x01U<size ) { - SDL_SetError("Fragment size must be a power of two"); - DSP_CloseAudio(this); - return(-1); - } - frag_spec |= 0x00020000; /* two fragments, for low latency */ - - /* Set the audio buffering parameters */ + default: + format = 0; + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { + DSP_CloseDevice(this); + return SDL_SetError("Couldn't find any hardware audio formats"); + } + this->spec.format = test_format; + + /* Set the audio format */ + value = format; + if ((ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || + (value != format)) { + perror("SNDCTL_DSP_SETFMT"); + DSP_CloseDevice(this); + return SDL_SetError("Couldn't set audio format"); + } + + /* Set the number of channels of output */ + value = this->spec.channels; + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_CHANNELS, &value) < 0) { + perror("SNDCTL_DSP_CHANNELS"); + DSP_CloseDevice(this); + return SDL_SetError("Cannot set the number of channels"); + } + this->spec.channels = value; + + /* Set the DSP frequency */ + value = this->spec.freq; + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SPEED, &value) < 0) { + perror("SNDCTL_DSP_SPEED"); + DSP_CloseDevice(this); + return SDL_SetError("Couldn't set audio frequency"); + } + this->spec.freq = value; + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Determine the power of two of the fragment size */ + for (frag_spec = 0; (0x01U << frag_spec) < this->spec.size; ++frag_spec); + if ((0x01U << frag_spec) != this->spec.size) { + DSP_CloseDevice(this); + return SDL_SetError("Fragment size must be a power of two"); + } + frag_spec |= 0x00020000; /* two fragments, for low latency */ + + /* Set the audio buffering parameters */ #ifdef DEBUG_AUDIO - fprintf(stderr, "Requesting %d fragments of size %d\n", - (frag_spec >> 16), 1<<(frag_spec&0xFFFF)); + fprintf(stderr, "Requesting %d fragments of size %d\n", + (frag_spec >> 16), 1 << (frag_spec & 0xFFFF)); #endif - if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) { - perror("SNDCTL_DSP_SETFRAGMENT"); - } + if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0) { + perror("SNDCTL_DSP_SETFRAGMENT"); + } #ifdef DEBUG_AUDIO - { audio_buf_info info; - ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info); - fprintf(stderr, "fragments = %d\n", info.fragments); - fprintf(stderr, "fragstotal = %d\n", info.fragstotal); - fprintf(stderr, "fragsize = %d\n", info.fragsize); - fprintf(stderr, "bytes = %d\n", info.bytes); - } + { + audio_buf_info info; + ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETOSPACE, &info); + fprintf(stderr, "fragments = %d\n", info.fragments); + fprintf(stderr, "fragstotal = %d\n", info.fragstotal); + fprintf(stderr, "fragsize = %d\n", info.fragsize); + fprintf(stderr, "bytes = %d\n", info.bytes); + } #endif - /* Allocate mixing buffer */ - mixlen = spec->size; - mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); - if ( mixbuf == NULL ) { - DSP_CloseAudio(this); - return(-1); - } - SDL_memset(mixbuf, spec->silence, spec->size); + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + DSP_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* We're ready to rock and roll. :-) */ + return 0; +} + + +static void +DSP_PlayDevice(_THIS) +{ + const Uint8 *mixbuf = this->hidden->mixbuf; + const int mixlen = this->hidden->mixlen; + if (write(this->hidden->audio_fd, mixbuf, mixlen) == -1) { + perror("Audio write"); + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", mixlen); +#endif +} - /* Get the parent process id (we're the parent of the audio thread) */ - parent = getpid(); +static Uint8 * +DSP_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} - /* We're ready to rock and roll. :-) */ - return(0); +static int +DSP_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = DSP_DetectDevices; + impl->OpenDevice = DSP_OpenDevice; + impl->PlayDevice = DSP_PlayDevice; + impl->GetDeviceBuf = DSP_GetDeviceBuf; + impl->CloseDevice = DSP_CloseDevice; + + return 1; /* this audio target is available. */ } + + +AudioBootStrap DSP_bootstrap = { + "dsp", "OSS /dev/dsp standard audio", DSP_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_OSS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/dsp/SDL_dspaudio.h b/src/audio/dsp/SDL_dspaudio.h index 382544f967..62ed45f181 100644 --- a/src/audio/dsp/SDL_dspaudio.h +++ b/src/audio/dsp/SDL_dspaudio.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,28 +25,19 @@ #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - int audio_fd; +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this - /* The parent process id, to detect when application quits */ - pid_t parent; +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -/* Old variable names */ -#define audio_fd (this->hidden->audio_fd) -#define parent (this->hidden->parent) -#define mixbuf (this->hidden->mixbuf) -#define mixlen (this->hidden->mixlen) -#define frame_ticks (this->hidden->frame_ticks) -#define next_frame (this->hidden->next_frame) +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ #endif /* _SDL_dspaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/dummy/SDL_dummyaudio.c b/src/audio/dummy/SDL_dummyaudio.c index 484b50d40c..c3e8ea415d 100644 --- a/src/audio/dummy/SDL_dummyaudio.c +++ b/src/audio/dummy/SDL_dummyaudio.c @@ -1,156 +1,48 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org - - This file written by Ryan C. Gordon (icculus@icculus.org) + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Output audio to nowhere... */ -#include "SDL_rwops.h" -#include "SDL_timer.h" #include "SDL_audio.h" -#include "../SDL_audiomem.h" #include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" #include "SDL_dummyaudio.h" -/* The tag name used by DUMMY audio */ -#define DUMMYAUD_DRIVER_NAME "dummy" - -/* Audio driver functions */ -static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DUMMYAUD_WaitAudio(_THIS); -static void DUMMYAUD_PlayAudio(_THIS); -static Uint8 *DUMMYAUD_GetAudioBuf(_THIS); -static void DUMMYAUD_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ -static int DUMMYAUD_Available(void) +static int +DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture) { - const char *envr = SDL_getenv("SDL_AUDIODRIVER"); - if (envr && (SDL_strcmp(envr, DUMMYAUD_DRIVER_NAME) == 0)) { - return(1); - } - return(0); + return 0; /* always succeeds. */ } -static void DUMMYAUD_DeleteDevice(SDL_AudioDevice *device) +static int +DUMMYAUD_Init(SDL_AudioDriverImpl * impl) { - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *DUMMYAUD_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = DUMMYAUD_OpenAudio; - this->WaitAudio = DUMMYAUD_WaitAudio; - this->PlayAudio = DUMMYAUD_PlayAudio; - this->GetAudioBuf = DUMMYAUD_GetAudioBuf; - this->CloseAudio = DUMMYAUD_CloseAudio; - - this->free = DUMMYAUD_DeleteDevice; - - return this; + /* Set the function pointers */ + impl->OpenDevice = DUMMYAUD_OpenDevice; + impl->OnlyHasDefaultOutputDevice = 1; + return 1; /* this audio target is available. */ } AudioBootStrap DUMMYAUD_bootstrap = { - DUMMYAUD_DRIVER_NAME, "SDL dummy audio driver", - DUMMYAUD_Available, DUMMYAUD_CreateDevice + "dummy", "SDL dummy audio driver", DUMMYAUD_Init, 1 }; -/* This function waits until it is possible to write a full sound buffer */ -static void DUMMYAUD_WaitAudio(_THIS) -{ - /* Don't block on first calls to simulate initial fragment filling. */ - if (this->hidden->initial_calls) - this->hidden->initial_calls--; - else - SDL_Delay(this->hidden->write_delay); -} - -static void DUMMYAUD_PlayAudio(_THIS) -{ - /* no-op...this is a null driver. */ -} - -static Uint8 *DUMMYAUD_GetAudioBuf(_THIS) -{ - return(this->hidden->mixbuf); -} - -static void DUMMYAUD_CloseAudio(_THIS) -{ - if ( this->hidden->mixbuf != NULL ) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - } -} - -static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - float bytes_per_sec = 0.0f; - - /* Allocate mixing buffer */ - this->hidden->mixlen = spec->size; - this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); - if ( this->hidden->mixbuf == NULL ) { - return(-1); - } - SDL_memset(this->hidden->mixbuf, spec->silence, spec->size); - - bytes_per_sec = (float) (((spec->format & 0xFF) / 8) * - spec->channels * spec->freq); - - /* - * We try to make this request more audio at the correct rate for - * a given audio spec, so timing stays fairly faithful. - * Also, we have it not block at all for the first two calls, so - * it seems like we're filling two audio fragments right out of the - * gate, like other SDL drivers tend to do. - */ - this->hidden->initial_calls = 2; - this->hidden->write_delay = - (Uint32) ((((float) spec->size) / bytes_per_sec) * 1000.0f); - - /* We're ready to rock and roll. :-) */ - return(0); -} - +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/dummy/SDL_dummyaudio.h b/src/audio/dummy/SDL_dummyaudio.h index 74a69cab7b..c0015a54dc 100644 --- a/src/audio/dummy/SDL_dummyaudio.h +++ b/src/audio/dummy/SDL_dummyaudio.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,15 +25,17 @@ #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - Uint8 *mixbuf; - Uint32 mixlen; - Uint32 write_delay; - Uint32 initial_calls; +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + Uint8 *mixbuf; + Uint32 mixlen; + Uint32 write_delay; + Uint32 initial_calls; }; #endif /* _SDL_dummyaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index f54b0ea9c5..92716f39b9 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_ESD + /* Allow access to an ESD network stream mixing buffer */ #include @@ -33,291 +34,315 @@ #include "SDL_audio.h" #include "../SDL_audiomem.h" #include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" #include "SDL_esdaudio.h" #ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC #include "SDL_name.h" #include "SDL_loadso.h" #else -#define SDL_NAME(X) X +#define SDL_NAME(X) X #endif -/* The tag name used by ESD audio */ -#define ESD_DRIVER_NAME "esd" - -/* Audio driver functions */ -static int ESD_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void ESD_WaitAudio(_THIS); -static void ESD_PlayAudio(_THIS); -static Uint8 *ESD_GetAudioBuf(_THIS); -static void ESD_CloseAudio(_THIS); - #ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC; static void *esd_handle = NULL; -static int esd_loaded = 0; - -static int (*SDL_NAME(esd_open_sound))( const char *host ); -static int (*SDL_NAME(esd_close))( int esd ); -static int (*SDL_NAME(esd_play_stream))( esd_format_t format, int rate, - const char *host, const char *name ); -static struct { - const char *name; - void **func; -} esd_functions[] = { - { "esd_open_sound", (void **)&SDL_NAME(esd_open_sound) }, - { "esd_close", (void **)&SDL_NAME(esd_close) }, - { "esd_play_stream", (void **)&SDL_NAME(esd_play_stream) }, -}; -static void UnloadESDLibrary() -{ - if ( esd_loaded ) { - SDL_UnloadObject(esd_handle); - esd_handle = NULL; - esd_loaded = 0; - } -} +static int (*SDL_NAME(esd_open_sound)) (const char *host); +static int (*SDL_NAME(esd_close)) (int esd); +static int (*SDL_NAME(esd_play_stream)) (esd_format_t format, int rate, + const char *host, const char *name); -static int LoadESDLibrary(void) +#define SDL_ESD_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } +static struct { - int i, retval = -1; - - esd_handle = SDL_LoadObject(esd_library); - if ( esd_handle ) { - esd_loaded = 1; - retval = 0; - for ( i=0; i= 0 ) { - available = 1; - SDL_NAME(esd_close)(connection); - } - UnloadESDLibrary(); - return(available); + return; } -static void Audio_DeleteDevice(SDL_AudioDevice *device) +static int +LoadESDLibrary(void) { - SDL_free(device->hidden); - SDL_free(device); - UnloadESDLibrary(); + return 0; } -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - LoadESDLibrary(); - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - audio_fd = -1; - - /* Set the function pointers */ - this->OpenAudio = ESD_OpenAudio; - this->WaitAudio = ESD_WaitAudio; - this->PlayAudio = ESD_PlayAudio; - this->GetAudioBuf = ESD_GetAudioBuf; - this->CloseAudio = ESD_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} +#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */ -AudioBootStrap ESD_bootstrap = { - ESD_DRIVER_NAME, "Enlightened Sound Daemon", - Audio_Available, Audio_CreateDevice -}; /* This function waits until it is possible to write a full sound buffer */ -static void ESD_WaitAudio(_THIS) +static void +ESD_WaitDevice(_THIS) { - Sint32 ticks; - - /* Check to see if the thread-parent process is still alive */ - { static int cnt = 0; - /* Note that this only works with thread implementations - that use a different process id for each thread. - */ - if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */ - if ( kill(parent, 0) < 0 ) { - this->enabled = 0; - } - } - } - - /* Use timer for general audio synchronization */ - ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS; - if ( ticks > 0 ) { - SDL_Delay(ticks); - } + Sint32 ticks; + + /* Check to see if the thread-parent process is still alive */ + { + static int cnt = 0; + /* Note that this only works with thread implementations + that use a different process id for each thread. + */ + /* Check every 10 loops */ + if (this->hidden->parent && (((++cnt) % 10) == 0)) { + if (kill(this->hidden->parent, 0) < 0 && errno == ESRCH) { + this->enabled = 0; + } + } + } + + /* Use timer for general audio synchronization */ + ticks = + ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); + } } -static void ESD_PlayAudio(_THIS) +static void +ESD_PlayDevice(_THIS) { - int written; - - /* Write the audio data, checking for EAGAIN on broken audio drivers */ - do { - written = write(audio_fd, mixbuf, mixlen); - if ( (written < 0) && ((errno == 0) || (errno == EAGAIN)) ) { - SDL_Delay(1); /* Let a little CPU time go by */ - } - } while ( (written < 0) && - ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)) ); - - /* Set the next write frame */ - next_frame += frame_ticks; - - /* If we couldn't write, assume fatal error for now */ - if ( written < 0 ) { - this->enabled = 0; - } + int written = 0; + + /* Write the audio data, checking for EAGAIN on broken audio drivers */ + do { + written = write(this->hidden->audio_fd, + this->hidden->mixbuf, this->hidden->mixlen); + if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { + SDL_Delay(1); /* Let a little CPU time go by */ + } + } while ((written < 0) && + ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); + + /* Set the next write frame */ + this->hidden->next_frame += this->hidden->frame_ticks; + + /* If we couldn't write, assume fatal error for now */ + if (written < 0) { + this->enabled = 0; + } } -static Uint8 *ESD_GetAudioBuf(_THIS) +static Uint8 * +ESD_GetDeviceBuf(_THIS) { - return(mixbuf); + return (this->hidden->mixbuf); } -static void ESD_CloseAudio(_THIS) +static void +ESD_CloseDevice(_THIS) { - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( audio_fd >= 0 ) { - SDL_NAME(esd_close)(audio_fd); - audio_fd = -1; - } + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_fd >= 0) { + SDL_NAME(esd_close) (this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + + SDL_free(this->hidden); + this->hidden = NULL; + } } /* Try to get the name of the program */ -static char *get_progname(void) +static char * +get_progname(void) { - char *progname = NULL; + char *progname = NULL; #ifdef __LINUX__ - FILE *fp; - static char temp[BUFSIZ]; - - SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); - fp = fopen(temp, "r"); - if ( fp != NULL ) { - if ( fgets(temp, sizeof(temp)-1, fp) ) { - progname = SDL_strrchr(temp, '/'); - if ( progname == NULL ) { - progname = temp; - } else { - progname = progname+1; - } - } - fclose(fp); - } + FILE *fp; + static char temp[BUFSIZ]; + + SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); + fp = fopen(temp, "r"); + if (fp != NULL) { + if (fgets(temp, sizeof(temp) - 1, fp)) { + progname = SDL_strrchr(temp, '/'); + if (progname == NULL) { + progname = temp; + } else { + progname = progname + 1; + } + } + fclose(fp); + } #endif - return(progname); + return (progname); } -static int ESD_OpenAudio(_THIS, SDL_AudioSpec *spec) + +static int +ESD_OpenDevice(_THIS, const char *devname, int iscapture) { - esd_format_t format; - - /* Convert audio spec to the ESD audio format */ - format = (ESD_STREAM | ESD_PLAY); - switch ( spec->format & 0xFF ) { - case 8: - format |= ESD_BITS8; - break; - case 16: - format |= ESD_BITS16; - break; - default: - SDL_SetError("Unsupported ESD audio format"); - return(-1); - } - if ( spec->channels == 1 ) { - format |= ESD_MONO; - } else { - format |= ESD_STEREO; - } + esd_format_t format = (ESD_STREAM | ESD_PLAY); + SDL_AudioFormat test_format = 0; + int found = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + this->hidden->audio_fd = -1; + + /* Convert audio spec to the ESD audio format */ + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !found && test_format; test_format = SDL_NextAudioFormat()) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + found = 1; + switch (test_format) { + case AUDIO_U8: + format |= ESD_BITS8; + break; + case AUDIO_S16SYS: + format |= ESD_BITS16; + break; + default: + found = 0; + break; + } + } + + if (!found) { + ESD_CloseDevice(this); + return SDL_SetError("Couldn't find any hardware audio formats"); + } + + if (this->spec.channels == 1) { + format |= ESD_MONO; + } else { + format |= ESD_STEREO; + } #if 0 - spec->samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */ + this->spec.samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */ #endif - /* Open a connection to the ESD audio server */ - audio_fd = SDL_NAME(esd_play_stream)(format, spec->freq, NULL, get_progname()); - if ( audio_fd < 0 ) { - SDL_SetError("Couldn't open ESD connection"); - return(-1); - } - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - frame_ticks = (float)(spec->samples*1000)/spec->freq; - next_frame = SDL_GetTicks()+frame_ticks; - - /* Allocate mixing buffer */ - mixlen = spec->size; - mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); - if ( mixbuf == NULL ) { - return(-1); - } - SDL_memset(mixbuf, spec->silence, spec->size); - - /* Get the parent process id (we're the parent of the audio thread) */ - parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return(0); + /* Open a connection to the ESD audio server */ + this->hidden->audio_fd = + SDL_NAME(esd_play_stream) (format, this->spec.freq, NULL, + get_progname()); + + if (this->hidden->audio_fd < 0) { + ESD_CloseDevice(this); + return SDL_SetError("Couldn't open ESD connection"); + } + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + this->hidden->frame_ticks = + (float) (this->spec.samples * 1000) / this->spec.freq; + this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + ESD_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* Get the parent process id (we're the parent of the audio thread) */ + this->hidden->parent = getpid(); + + /* We're ready to rock and roll. :-) */ + return 0; } + +static void +ESD_Deinitialize(void) +{ + UnloadESDLibrary(); +} + +static int +ESD_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadESDLibrary() < 0) { + return 0; + } else { + int connection = 0; + + /* Don't start ESD if it's not running */ + SDL_setenv("ESD_NO_SPAWN", "1", 0); + + connection = SDL_NAME(esd_open_sound) (NULL); + if (connection < 0) { + UnloadESDLibrary(); + SDL_SetError("ESD: esd_open_sound failed (no audio server?)"); + return 0; + } + SDL_NAME(esd_close) (connection); + } + + /* Set the function pointers */ + impl->OpenDevice = ESD_OpenDevice; + impl->PlayDevice = ESD_PlayDevice; + impl->WaitDevice = ESD_WaitDevice; + impl->GetDeviceBuf = ESD_GetDeviceBuf; + impl->CloseDevice = ESD_CloseDevice; + impl->Deinitialize = ESD_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; /* this audio target is available. */ +} + + +AudioBootStrap ESD_bootstrap = { + "esd", "Enlightened Sound Daemon", ESD_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_ESD */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/esd/SDL_esdaudio.h b/src/audio/esd/SDL_esdaudio.h index da4ae6a04b..26bea9cf01 100644 --- a/src/audio/esd/SDL_esdaudio.h +++ b/src/audio/esd/SDL_esdaudio.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,32 +25,26 @@ #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - int audio_fd; +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; - /* The parent process id, to detect when application quits */ - pid_t parent; + /* The parent process id, to detect when application quits */ + pid_t parent; - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; - /* Support for audio timing using a timer */ - float frame_ticks; - float next_frame; + /* Support for audio timing using a timer */ + float frame_ticks; + float next_frame; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -/* Old variable names */ -#define audio_fd (this->hidden->audio_fd) -#define parent (this->hidden->parent) -#define mixbuf (this->hidden->mixbuf) -#define mixlen (this->hidden->mixlen) -#define frame_ticks (this->hidden->frame_ticks) -#define next_frame (this->hidden->next_frame) +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ #endif /* _SDL_esdaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/fusionsound/SDL_fsaudio.c b/src/audio/fusionsound/SDL_fsaudio.c new file mode 100644 index 0000000000..2e468d5c6a --- /dev/null +++ b/src/audio/fusionsound/SDL_fsaudio.c @@ -0,0 +1,347 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_FUSIONSOUND + +/* Allow access to a raw mixing buffer */ + +#ifdef HAVE_SIGNAL_H +#include +#endif +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_fsaudio.h" + +#include + +/* #define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so" */ + +#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC +#include "SDL_name.h" +#include "SDL_loadso.h" +#else +#define SDL_NAME(X) X +#endif + +#if (FUSIONSOUND_MAJOR_VERSION == 1) && (FUSIONSOUND_MINOR_VERSION < 1) +typedef DFBResult DirectResult; +#endif + +/* Buffers to use - more than 2 gives a lot of latency */ +#define FUSION_BUFFERS (2) + +#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC + +static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC; +static void *fs_handle = NULL; + +static DirectResult (*SDL_NAME(FusionSoundInit)) (int *argc, char *(*argv[])); +static DirectResult (*SDL_NAME(FusionSoundCreate)) (IFusionSound ** + ret_interface); + +#define SDL_FS_SYM(x) { #x, (void **) (char *) &SDL_NAME(x) } +static struct +{ + const char *name; + void **func; +} fs_functions[] = { +/* *INDENT-OFF* */ + SDL_FS_SYM(FusionSoundInit), + SDL_FS_SYM(FusionSoundCreate), +/* *INDENT-ON* */ +}; + +#undef SDL_FS_SYM + +static void +UnloadFusionSoundLibrary() +{ + if (fs_handle != NULL) { + SDL_UnloadObject(fs_handle); + fs_handle = NULL; + } +} + +static int +LoadFusionSoundLibrary(void) +{ + int i, retval = -1; + + if (fs_handle == NULL) { + fs_handle = SDL_LoadObject(fs_library); + if (fs_handle != NULL) { + retval = 0; + for (i = 0; i < SDL_arraysize(fs_functions); ++i) { + *fs_functions[i].func = + SDL_LoadFunction(fs_handle, fs_functions[i].name); + if (!*fs_functions[i].func) { + retval = -1; + UnloadFusionSoundLibrary(); + break; + } + } + } + } + + return retval; +} + +#else + +static void +UnloadFusionSoundLibrary() +{ + return; +} + +static int +LoadFusionSoundLibrary(void) +{ + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ + +/* This function waits until it is possible to write a full sound buffer */ +static void +SDL_FS_WaitDevice(_THIS) +{ + this->hidden->stream->Wait(this->hidden->stream, + this->hidden->mixsamples); +} + +static void +SDL_FS_PlayDevice(_THIS) +{ + DirectResult ret; + + ret = this->hidden->stream->Write(this->hidden->stream, + this->hidden->mixbuf, + this->hidden->mixsamples); + /* If we couldn't write, assume fatal error for now */ + if (ret) { + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); +#endif +} + +static void +SDL_FS_WaitDone(_THIS) +{ + this->hidden->stream->Wait(this->hidden->stream, + this->hidden->mixsamples * FUSION_BUFFERS); +} + + +static Uint8 * +SDL_FS_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + + +static void +SDL_FS_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->stream) { + this->hidden->stream->Release(this->hidden->stream); + this->hidden->stream = NULL; + } + if (this->hidden->fs) { + this->hidden->fs->Release(this->hidden->fs); + this->hidden->fs = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +static int +SDL_FS_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int bytes; + SDL_AudioFormat test_format = 0, format = 0; + FSSampleFormat fs_format; + FSStreamDescription desc; + DirectResult ret; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + switch (test_format) { + case AUDIO_U8: + fs_format = FSSF_U8; + bytes = 1; + format = 1; + break; + case AUDIO_S16SYS: + fs_format = FSSF_S16; + bytes = 2; + format = 1; + break; + case AUDIO_S32SYS: + fs_format = FSSF_S32; + bytes = 4; + format = 1; + break; + case AUDIO_F32SYS: + fs_format = FSSF_FLOAT; + bytes = 4; + format = 1; + break; + default: + format = 0; + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + + if (format == 0) { + SDL_FS_CloseDevice(this); + return SDL_SetError("Couldn't find any hardware audio formats"); + } + this->spec.format = test_format; + + /* Retrieve the main sound interface. */ + ret = SDL_NAME(FusionSoundCreate) (&this->hidden->fs); + if (ret) { + SDL_FS_CloseDevice(this); + return SDL_SetError("Unable to initialize FusionSound: %d", ret); + } + + this->hidden->mixsamples = this->spec.size / bytes / this->spec.channels; + + /* Fill stream description. */ + desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | + FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT | FSSDF_PREBUFFER; + desc.samplerate = this->spec.freq; + desc.buffersize = this->spec.size * FUSION_BUFFERS; + desc.channels = this->spec.channels; + desc.prebuffer = 10; + desc.sampleformat = fs_format; + + ret = + this->hidden->fs->CreateStream(this->hidden->fs, &desc, + &this->hidden->stream); + if (ret) { + SDL_FS_CloseDevice(this); + return SDL_SetError("Unable to create FusionSoundStream: %d", ret); + } + + /* See what we got */ + desc.flags = FSSDF_SAMPLERATE | FSSDF_BUFFERSIZE | + FSSDF_CHANNELS | FSSDF_SAMPLEFORMAT; + ret = this->hidden->stream->GetDescription(this->hidden->stream, &desc); + + this->spec.freq = desc.samplerate; + this->spec.size = + desc.buffersize / FUSION_BUFFERS * bytes * desc.channels; + this->spec.channels = desc.channels; + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + SDL_FS_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* We're ready to rock and roll. :-) */ + return 0; +} + + +static void +SDL_FS_Deinitialize(void) +{ + UnloadFusionSoundLibrary(); +} + + +static int +SDL_FS_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadFusionSoundLibrary() < 0) { + return 0; + } else { + DirectResult ret; + + ret = SDL_NAME(FusionSoundInit) (NULL, NULL); + if (ret) { + UnloadFusionSoundLibrary(); + SDL_SetError + ("FusionSound: SDL_FS_init failed (FusionSoundInit: %d)", + ret); + return 0; + } + } + + /* Set the function pointers */ + impl->OpenDevice = SDL_FS_OpenDevice; + impl->PlayDevice = SDL_FS_PlayDevice; + impl->WaitDevice = SDL_FS_WaitDevice; + impl->GetDeviceBuf = SDL_FS_GetDeviceBuf; + impl->CloseDevice = SDL_FS_CloseDevice; + impl->WaitDone = SDL_FS_WaitDone; + impl->Deinitialize = SDL_FS_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; /* this audio target is available. */ +} + + +AudioBootStrap FUSIONSOUND_bootstrap = { + "fusionsound", "FusionSound", SDL_FS_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/fusionsound/SDL_fsaudio.h b/src/audio/fusionsound/SDL_fsaudio.h new file mode 100644 index 0000000000..7f22775014 --- /dev/null +++ b/src/audio/fusionsound/SDL_fsaudio.h @@ -0,0 +1,49 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_fsaudio_h +#define _SDL_fsaudio_h + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* Interface */ + IFusionSound *fs; + + /* The stream interface for the audio device */ + IFusionSoundStream *stream; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; + int mixsamples; + +}; + +#endif /* _SDL_fsaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/macosx/SDL_coreaudio.c b/src/audio/macosx/SDL_coreaudio.c deleted file mode 100644 index 31316d1fd9..0000000000 --- a/src/audio/macosx/SDL_coreaudio.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include -#include -#include -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 -#include -#endif - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" -#include "SDL_coreaudio.h" - - -/* Audio driver functions */ - -static int Core_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Core_WaitAudio(_THIS); -static void Core_PlayAudio(_THIS); -static Uint8 *Core_GetAudioBuf(_THIS); -static void Core_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = Core_OpenAudio; - this->WaitAudio = Core_WaitAudio; - this->PlayAudio = Core_PlayAudio; - this->GetAudioBuf = Core_GetAudioBuf; - this->CloseAudio = Core_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap COREAUDIO_bootstrap = { - "coreaudio", "Mac OS X CoreAudio", - Audio_Available, Audio_CreateDevice -}; - -/* The CoreAudio callback */ -static OSStatus audioCallback (void *inRefCon, - AudioUnitRenderActionFlags *ioActionFlags, - const AudioTimeStamp *inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames, - AudioBufferList *ioData) -{ - SDL_AudioDevice *this = (SDL_AudioDevice *)inRefCon; - UInt32 remaining, len; - AudioBuffer *abuf; - void *ptr; - UInt32 i; - - /* Only do anything if audio is enabled and not paused */ - if ( ! this->enabled || this->paused ) { - for (i = 0; i < ioData->mNumberBuffers; i++) { - abuf = &ioData->mBuffers[i]; - SDL_memset(abuf->mData, this->spec.silence, abuf->mDataByteSize); - } - return 0; - } - - /* No SDL conversion should be needed here, ever, since we accept - any input format in OpenAudio, and leave the conversion to CoreAudio. - */ - /* - assert(!this->convert.needed); - assert(this->spec.channels == ioData->mNumberChannels); - */ - - for (i = 0; i < ioData->mNumberBuffers; i++) { - abuf = &ioData->mBuffers[i]; - remaining = abuf->mDataByteSize; - ptr = abuf->mData; - while (remaining > 0) { - if (bufferOffset >= bufferSize) { - /* Generate the data */ - SDL_memset(buffer, this->spec.silence, bufferSize); - SDL_mutexP(this->mixer_lock); - (*this->spec.callback)(this->spec.userdata, - buffer, bufferSize); - SDL_mutexV(this->mixer_lock); - bufferOffset = 0; - } - - len = bufferSize - bufferOffset; - if (len > remaining) - len = remaining; - SDL_memcpy(ptr, (char *)buffer + bufferOffset, len); - ptr = (char *)ptr + len; - remaining -= len; - bufferOffset += len; - } - } - - return 0; -} - -/* Dummy functions -- we don't use thread-based audio */ -void Core_WaitAudio(_THIS) -{ - return; -} - -void Core_PlayAudio(_THIS) -{ - return; -} - -Uint8 *Core_GetAudioBuf(_THIS) -{ - return(NULL); -} - -void Core_CloseAudio(_THIS) -{ - OSStatus result; - struct AURenderCallbackStruct callback; - - /* stop processing the audio unit */ - result = AudioOutputUnitStop (outputAudioUnit); - if (result != noErr) { - SDL_SetError("Core_CloseAudio: AudioOutputUnitStop"); - return; - } - - /* Remove the input callback */ - callback.inputProc = 0; - callback.inputProcRefCon = 0; - result = AudioUnitSetProperty (outputAudioUnit, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Input, - 0, - &callback, - sizeof(callback)); - if (result != noErr) { - SDL_SetError("Core_CloseAudio: AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)"); - return; - } - - result = CloseComponent(outputAudioUnit); - if (result != noErr) { - SDL_SetError("Core_CloseAudio: CloseComponent"); - return; - } - - SDL_free(buffer); -} - -#define CHECK_RESULT(msg) \ - if (result != noErr) { \ - SDL_SetError("Failed to start CoreAudio: " msg); \ - return -1; \ - } - - -int Core_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - OSStatus result = noErr; - Component comp; - ComponentDescription desc; - struct AURenderCallbackStruct callback; - AudioStreamBasicDescription requestedDesc; - - /* Setup a AudioStreamBasicDescription with the requested format */ - requestedDesc.mFormatID = kAudioFormatLinearPCM; - requestedDesc.mFormatFlags = kLinearPCMFormatFlagIsPacked; - requestedDesc.mChannelsPerFrame = spec->channels; - requestedDesc.mSampleRate = spec->freq; - - requestedDesc.mBitsPerChannel = spec->format & 0xFF; - if (spec->format & 0x8000) - requestedDesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; - if (spec->format & 0x1000) - requestedDesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; - - requestedDesc.mFramesPerPacket = 1; - requestedDesc.mBytesPerFrame = requestedDesc.mBitsPerChannel * requestedDesc.mChannelsPerFrame / 8; - requestedDesc.mBytesPerPacket = requestedDesc.mBytesPerFrame * requestedDesc.mFramesPerPacket; - - - /* Locate the default output audio unit */ - desc.componentType = kAudioUnitType_Output; - desc.componentSubType = kAudioUnitSubType_DefaultOutput; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; - desc.componentFlags = 0; - desc.componentFlagsMask = 0; - - comp = FindNextComponent (NULL, &desc); - if (comp == NULL) { - SDL_SetError ("Failed to start CoreAudio: FindNextComponent returned NULL"); - return -1; - } - - /* Open & initialize the default output audio unit */ - result = OpenAComponent (comp, &outputAudioUnit); - CHECK_RESULT("OpenAComponent") - - result = AudioUnitInitialize (outputAudioUnit); - CHECK_RESULT("AudioUnitInitialize") - - /* Set the input format of the audio unit. */ - result = AudioUnitSetProperty (outputAudioUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &requestedDesc, - sizeof (requestedDesc)); - CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)") - - /* Set the audio callback */ - callback.inputProc = audioCallback; - callback.inputProcRefCon = this; - result = AudioUnitSetProperty (outputAudioUnit, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Input, - 0, - &callback, - sizeof(callback)); - CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)") - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - /* Allocate a sample buffer */ - bufferOffset = bufferSize = this->spec.size; - buffer = SDL_malloc(bufferSize); - - /* Finally, start processing of the audio unit */ - result = AudioOutputUnitStart (outputAudioUnit); - CHECK_RESULT("AudioOutputUnitStart") - - - /* We're running! */ - return(1); -} diff --git a/src/audio/macosx/SDL_coreaudio.h b/src/audio/macosx/SDL_coreaudio.h deleted file mode 100644 index c11bc03a2b..0000000000 --- a/src/audio/macosx/SDL_coreaudio.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_coreaudio_h -#define _SDL_coreaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - AudioUnit outputAudioUnit; - void *buffer; - UInt32 bufferOffset; - UInt32 bufferSize; -}; - -/* Old variable names */ -#define outputAudioUnit (this->hidden->outputAudioUnit) -#define buffer (this->hidden->buffer) -#define bufferOffset (this->hidden->bufferOffset) -#define bufferSize (this->hidden->bufferSize) - -#endif /* _SDL_coreaudio_h */ diff --git a/src/audio/macrom/SDL_romaudio.c b/src/audio/macrom/SDL_romaudio.c deleted file mode 100644 index 1b3d49e198..0000000000 --- a/src/audio/macrom/SDL_romaudio.c +++ /dev/null @@ -1,496 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#if defined(__APPLE__) && defined(__MACH__) -# include -#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335) -# include -#else -# include /* SoundManager interface */ -# include -# include -#endif - -#if !defined(NewSndCallBackUPP) && (UNIVERSAL_INTERFACES_VERSION < 0x0335) -#if !defined(NewSndCallBackProc) /* avoid circular redefinition... */ -#define NewSndCallBackUPP NewSndCallBackProc -#endif -#if !defined(NewSndCallBackUPP) -#define NewSndCallBackUPP NewSndCallBackProc -#endif -#endif - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" -#include "SDL_romaudio.h" - -/* Audio driver functions */ - -static void Mac_CloseAudio(_THIS); -static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Mac_LockAudio(_THIS); -static void Mac_UnlockAudio(_THIS); - -/* Audio driver bootstrap functions */ - - -static int Audio_Available(void) -{ - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = Mac_OpenAudio; - this->CloseAudio = Mac_CloseAudio; - this->LockAudio = Mac_LockAudio; - this->UnlockAudio = Mac_UnlockAudio; - this->free = Audio_DeleteDevice; - -#ifdef __MACOSX__ /* Mac OS X uses threaded audio, so normal thread code is okay */ - this->LockAudio = NULL; - this->UnlockAudio = NULL; -#endif - return this; -} - -AudioBootStrap SNDMGR_bootstrap = { - "sndmgr", "MacOS SoundManager 3.0", - Audio_Available, Audio_CreateDevice -}; - -#if defined(TARGET_API_MAC_CARBON) || defined(USE_RYANS_SOUNDCODE) -/* This works correctly on Mac OS X */ - -#pragma options align=power - -static volatile SInt32 audio_is_locked = 0; -static volatile SInt32 need_to_mix = 0; - -static UInt8 *buffer[2]; -static volatile UInt32 running = 0; -static CmpSoundHeader header; -static volatile Uint32 fill_me = 0; - -static void mix_buffer(SDL_AudioDevice *audio, UInt8 *buffer) -{ - if ( ! audio->paused ) { -#ifdef __MACOSX__ - SDL_mutexP(audio->mixer_lock); -#endif - if ( audio->convert.needed ) { - audio->spec.callback(audio->spec.userdata, - (Uint8 *)audio->convert.buf,audio->convert.len); - SDL_ConvertAudio(&audio->convert); - if ( audio->convert.len_cvt != audio->spec.size ) { - /* Uh oh... probably crashes here */; - } - SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt); - } else { - audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size); - } -#ifdef __MACOSX__ - SDL_mutexV(audio->mixer_lock); -#endif - } - - DecrementAtomic((SInt32 *) &need_to_mix); -} - -static void Mac_LockAudio(_THIS) -{ - IncrementAtomic((SInt32 *) &audio_is_locked); -} - -static void Mac_UnlockAudio(_THIS) -{ - SInt32 oldval; - - oldval = DecrementAtomic((SInt32 *) &audio_is_locked); - if ( oldval != 1 ) /* != 1 means audio is still locked. */ - return; - - /* Did we miss the chance to mix in an interrupt? Do it now. */ - if ( BitAndAtomic (0xFFFFFFFF, (UInt32 *) &need_to_mix) ) { - /* - * Note that this could be a problem if you missed an interrupt - * while the audio was locked, and get preempted by a second - * interrupt here, but that means you locked for way too long anyhow. - */ - mix_buffer (this, buffer[fill_me]); - } -} - -static void callBackProc (SndChannel *chan, SndCommand *cmd_passed ) { - UInt32 play_me; - SndCommand cmd; - SDL_AudioDevice *audio = (SDL_AudioDevice *)chan->userInfo; - - IncrementAtomic((SInt32 *) &need_to_mix); - - fill_me = cmd_passed->param2; /* buffer that has just finished playing, so fill it */ - play_me = ! fill_me; /* filled buffer to play _now_ */ - - if ( ! audio->enabled ) { - return; - } - - /* queue previously mixed buffer for playback. */ - header.samplePtr = (Ptr)buffer[play_me]; - cmd.cmd = bufferCmd; - cmd.param1 = 0; - cmd.param2 = (long)&header; - SndDoCommand (chan, &cmd, 0); - - memset (buffer[fill_me], 0, audio->spec.size); - - /* - * if audio device isn't locked, mix the next buffer to be queued in - * the memory block that just finished playing. - */ - if ( ! BitAndAtomic(0xFFFFFFFF, (UInt32 *) &audio_is_locked) ) { - mix_buffer (audio, buffer[fill_me]); - } - - /* set this callback to run again when current buffer drains. */ - if ( running ) { - cmd.cmd = callBackCmd; - cmd.param1 = 0; - cmd.param2 = play_me; - - SndDoCommand (chan, &cmd, 0); - } -} - -static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec) { - - SndCallBackUPP callback; - int sample_bits; - int i; - long initOptions; - - /* Very few conversions are required, but... */ - switch (spec->format) { - case AUDIO_S8: - spec->format = AUDIO_U8; - break; - case AUDIO_U16LSB: - spec->format = AUDIO_S16LSB; - break; - case AUDIO_U16MSB: - spec->format = AUDIO_S16MSB; - break; - } - SDL_CalculateAudioSpec(spec); - - /* initialize bufferCmd header */ - memset (&header, 0, sizeof(header)); - callback = (SndCallBackUPP) NewSndCallBackUPP (callBackProc); - sample_bits = spec->size / spec->samples / spec->channels * 8; - -#ifdef DEBUG_AUDIO - fprintf(stderr, - "Audio format 0x%x, channels = %d, sample_bits = %d, frequency = %d\n", - spec->format, spec->channels, sample_bits, spec->freq); -#endif /* DEBUG_AUDIO */ - - header.numChannels = spec->channels; - header.sampleSize = sample_bits; - header.sampleRate = spec->freq << 16; - header.numFrames = spec->samples; - header.encode = cmpSH; - - /* Note that we install the 16bitLittleEndian Converter if needed. */ - if ( spec->format == 0x8010 ) { - header.compressionID = fixedCompression; - header.format = k16BitLittleEndianFormat; - } - - /* allocate 2 buffers */ - for (i=0; i<2; i++) { - buffer[i] = (UInt8*)malloc (sizeof(UInt8) * spec->size); - if (buffer[i] == NULL) { - SDL_OutOfMemory(); - return (-1); - } - memset (buffer[i], 0, spec->size); - } - - /* Create the sound manager channel */ - channel = (SndChannelPtr)SDL_malloc(sizeof(*channel)); - if ( channel == NULL ) { - SDL_OutOfMemory(); - return(-1); - } - if ( spec->channels >= 2 ) { - initOptions = initStereo; - } else { - initOptions = initMono; - } - channel->userInfo = (long)this; - channel->qLength = 128; - if ( SndNewChannel(&channel, sampledSynth, initOptions, callback) != noErr ) { - SDL_SetError("Unable to create audio channel"); - SDL_free(channel); - channel = NULL; - return(-1); - } - - /* start playback */ - { - SndCommand cmd; - cmd.cmd = callBackCmd; - cmd.param2 = 0; - running = 1; - SndDoCommand (channel, &cmd, 0); - } - - return 1; -} - -static void Mac_CloseAudio(_THIS) { - - int i; - - running = 0; - - if (channel) { - SndDisposeChannel (channel, true); - channel = NULL; - } - - for ( i=0; i<2; ++i ) { - if ( buffer[i] ) { - SDL_free(buffer[i]); - buffer[i] = NULL; - } - } -} - -#else /* !TARGET_API_MAC_CARBON && !USE_RYANS_SOUNDCODE */ - -static void Mac_LockAudio(_THIS) -{ - /* no-op. */ -} - -static void Mac_UnlockAudio(_THIS) -{ - /* no-op. */ -} - - -/* This function is called by Sound Manager when it has exhausted one of - the buffers, so we'll zero it to silence and fill it with audio if - we're not paused. -*/ -static pascal -void sndDoubleBackProc (SndChannelPtr chan, SndDoubleBufferPtr newbuf) -{ - SDL_AudioDevice *audio = (SDL_AudioDevice *)newbuf->dbUserInfo[0]; - - /* If audio is quitting, don't do anything */ - if ( ! audio->enabled ) { - return; - } - memset (newbuf->dbSoundData, 0, audio->spec.size); - newbuf->dbNumFrames = audio->spec.samples; - if ( ! audio->paused ) { - if ( audio->convert.needed ) { - audio->spec.callback(audio->spec.userdata, - (Uint8 *)audio->convert.buf,audio->convert.len); - SDL_ConvertAudio(&audio->convert); -#if 0 - if ( audio->convert.len_cvt != audio->spec.size ) { - /* Uh oh... probably crashes here */; - } -#endif - SDL_memcpy(newbuf->dbSoundData, audio->convert.buf, - audio->convert.len_cvt); - } else { - audio->spec.callback(audio->spec.userdata, - (Uint8 *)newbuf->dbSoundData, audio->spec.size); - } - } - newbuf->dbFlags |= dbBufferReady; -} - -static int DoubleBufferAudio_Available(void) -{ - int available; - NumVersion sndversion; - long response; - - available = 0; - sndversion = SndSoundManagerVersion(); - if ( sndversion.majorRev >= 3 ) { - if ( Gestalt(gestaltSoundAttr, &response) == noErr ) { - if ( (response & (1 << gestaltSndPlayDoubleBuffer)) ) { - available = 1; - } - } - } else { - if ( Gestalt(gestaltSoundAttr, &response) == noErr ) { - if ( (response & (1 << gestaltHasASC)) ) { - available = 1; - } - } - } - return(available); -} - -static void Mac_CloseAudio(_THIS) -{ - int i; - - if ( channel != NULL ) { - /* Clean up the audio channel */ - SndDisposeChannel(channel, true); - channel = NULL; - } - for ( i=0; i<2; ++i ) { - if ( audio_buf[i] ) { - SDL_free(audio_buf[i]); - audio_buf[i] = NULL; - } - } -} - -static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - SndDoubleBufferHeader2 audio_dbh; - int i; - long initOptions; - int sample_bits; - SndDoubleBackUPP doubleBackProc; - - /* Check to make sure double-buffered audio is available */ - if ( ! DoubleBufferAudio_Available() ) { - SDL_SetError("Sound manager doesn't support double-buffering"); - return(-1); - } - - /* Very few conversions are required, but... */ - switch (spec->format) { - case AUDIO_S8: - spec->format = AUDIO_U8; - break; - case AUDIO_U16LSB: - spec->format = AUDIO_S16LSB; - break; - case AUDIO_U16MSB: - spec->format = AUDIO_S16MSB; - break; - } - SDL_CalculateAudioSpec(spec); - - /* initialize the double-back header */ - SDL_memset(&audio_dbh, 0, sizeof(audio_dbh)); - doubleBackProc = NewSndDoubleBackProc (sndDoubleBackProc); - sample_bits = spec->size / spec->samples / spec->channels * 8; - - audio_dbh.dbhNumChannels = spec->channels; - audio_dbh.dbhSampleSize = sample_bits; - audio_dbh.dbhCompressionID = 0; - audio_dbh.dbhPacketSize = 0; - audio_dbh.dbhSampleRate = spec->freq << 16; - audio_dbh.dbhDoubleBack = doubleBackProc; - audio_dbh.dbhFormat = 0; - - /* Note that we install the 16bitLittleEndian Converter if needed. */ - if ( spec->format == 0x8010 ) { - audio_dbh.dbhCompressionID = fixedCompression; - audio_dbh.dbhFormat = k16BitLittleEndianFormat; - } - - /* allocate the 2 double-back buffers */ - for ( i=0; i<2; ++i ) { - audio_buf[i] = SDL_calloc(1, sizeof(SndDoubleBuffer)+spec->size); - if ( audio_buf[i] == NULL ) { - SDL_OutOfMemory(); - return(-1); - } - audio_buf[i]->dbNumFrames = spec->samples; - audio_buf[i]->dbFlags = dbBufferReady; - audio_buf[i]->dbUserInfo[0] = (long)this; - audio_dbh.dbhBufferPtr[i] = audio_buf[i]; - } - - /* Create the sound manager channel */ - channel = (SndChannelPtr)SDL_malloc(sizeof(*channel)); - if ( channel == NULL ) { - SDL_OutOfMemory(); - return(-1); - } - if ( spec->channels >= 2 ) { - initOptions = initStereo; - } else { - initOptions = initMono; - } - channel->userInfo = 0; - channel->qLength = 128; - if ( SndNewChannel(&channel, sampledSynth, initOptions, 0L) != noErr ) { - SDL_SetError("Unable to create audio channel"); - SDL_free(channel); - channel = NULL; - return(-1); - } - - /* Start playback */ - if ( SndPlayDoubleBuffer(channel, (SndDoubleBufferHeaderPtr)&audio_dbh) - != noErr ) { - SDL_SetError("Unable to play double buffered audio"); - return(-1); - } - - return 1; -} - -#endif /* TARGET_API_MAC_CARBON || USE_RYANS_SOUNDCODE */ - diff --git a/src/audio/macrom/SDL_romaudio.h b/src/audio/macrom/SDL_romaudio.h deleted file mode 100644 index 90e19c0695..0000000000 --- a/src/audio/macrom/SDL_romaudio.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_romaudio_h -#define _SDL_romaudio_h - -#include "../SDL_sysaudio.h" - -/* This is Ryan's improved MacOS sound code, with locking support */ -#define USE_RYANS_SOUNDCODE - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* Sound manager audio channel */ - SndChannelPtr channel; -#if defined(TARGET_API_MAC_CARBON) || defined(USE_RYANS_SOUNDCODE) - /* FIXME: Add Ryan's static data here */ -#else - /* Double buffering variables */ - SndDoubleBufferPtr audio_buf[2]; -#endif -}; - -/* Old variable names */ -#define channel (this->hidden->channel) -#define audio_buf (this->hidden->audio_buf) - -#endif /* _SDL_romaudio_h */ diff --git a/src/audio/mint/SDL_mintaudio.c b/src/audio/mint/SDL_mintaudio.c deleted file mode 100644 index 46ba690c3e..0000000000 --- a/src/audio/mint/SDL_mintaudio.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - Audio interrupt variables and callback function - - Patrice Mandin -*/ - -#include - -#include -#include -#include -#include - -#include "SDL_audio.h" -#include "SDL_mintaudio.h" -#include "SDL_mintaudio_stfa.h" - -/* The audio device */ - -SDL_AudioDevice *SDL_MintAudio_device; -Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ -unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ -volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */ -volatile unsigned short SDL_MintAudio_mutex; -volatile unsigned long SDL_MintAudio_clocktics; -cookie_stfa_t *SDL_MintAudio_stfa; -unsigned short SDL_MintAudio_hasfpu; - -/* MiNT thread variables */ -SDL_bool SDL_MintAudio_mint_present; -SDL_bool SDL_MintAudio_quit_thread; -SDL_bool SDL_MintAudio_thread_finished; -long SDL_MintAudio_thread_pid; - -/* The callback function, called by each driver whenever needed */ - -void SDL_MintAudio_Callback(void) -{ - Uint8 *buffer; - SDL_AudioDevice *audio = SDL_MintAudio_device; - - buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf]; - SDL_memset(buffer, audio->spec.silence, audio->spec.size); - - if (audio->paused) - return; - - if (audio->convert.needed) { - int silence; - - if ( audio->convert.src_format == AUDIO_U8 ) { - silence = 0x80; - } else { - silence = 0; - } - SDL_memset(audio->convert.buf, silence, audio->convert.len); - audio->spec.callback(audio->spec.userdata, - (Uint8 *)audio->convert.buf,audio->convert.len); - SDL_ConvertAudio(&audio->convert); - SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt); - } else { - audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size); - } -} - -/* Add a new frequency/clock/predivisor to the current list */ -void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock, - Uint32 prediv, int gpio_bits) -{ - int i, p; - - if (MINTAUDIO_freqcount==MINTAUDIO_maxfreqs) { - return; - } - - /* Search where to insert the frequency (highest first) */ - for (p=0; p MINTAUDIO_frequencies[p].frequency) { - break; - } - } - - /* Put all following ones farer */ - if (MINTAUDIO_freqcount>0) { - for (i=MINTAUDIO_freqcount; i>p; i--) { - SDL_memcpy(&MINTAUDIO_frequencies[i], &MINTAUDIO_frequencies[i-1], sizeof(mint_frequency_t)); - } - } - - /* And insert new one */ - MINTAUDIO_frequencies[p].frequency = frequency; - MINTAUDIO_frequencies[p].masterclock = clock; - MINTAUDIO_frequencies[p].predivisor = prediv; - MINTAUDIO_frequencies[p].gpio_bits = gpio_bits; - - MINTAUDIO_freqcount++; -} - -/* Search for the nearest frequency */ -int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq) -{ - int i; - - /* Only 1 freq ? */ - if (MINTAUDIO_freqcount==1) { - return 0; - } - - /* Check the array */ - for (i=0; i= ((MINTAUDIO_frequencies[i].frequency+ - MINTAUDIO_frequencies[i+1].frequency)>>1)) { - return i; - } - } - - /* Not in the array, give the latest */ - return MINTAUDIO_freqcount-1; -} - -/* Check if FPU is present */ -void SDL_MintAudio_CheckFpu(void) -{ - long cookie_fpu; - - SDL_MintAudio_hasfpu = 0; - if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) { - return; - } - switch ((cookie_fpu>>16)&0xfffe) { - case 2: - case 4: - case 6: - case 8: - case 16: - SDL_MintAudio_hasfpu = 1; - break; - } -} - -/* The thread function, used under MiNT with xbios */ -int SDL_MintAudio_Thread(long param) -{ - SndBufPtr pointers; - SDL_bool buffers_filled[2] = {SDL_FALSE, SDL_FALSE}; - - SDL_MintAudio_thread_finished = SDL_FALSE; - while (!SDL_MintAudio_quit_thread) { - if (Buffptr(&pointers)!=0) - continue; - - if (( (unsigned long)pointers.play>=(unsigned long)SDL_MintAudio_audiobuf[0]) - && ( (unsigned long)pointers.play<=(unsigned long)SDL_MintAudio_audiobuf[1])) - { - /* DMA is reading buffer #0, setup buffer #1 if not already done */ - if (!buffers_filled[1]) { - SDL_MintAudio_numbuf = 1; - SDL_MintAudio_Callback(); - Setbuffer(0, SDL_MintAudio_audiobuf[1], SDL_MintAudio_audiobuf[1] + SDL_MintAudio_audiosize); - buffers_filled[1]=SDL_TRUE; - buffers_filled[0]=SDL_FALSE; - } - } else { - /* DMA is reading buffer #1, setup buffer #0 if not already done */ - if (!buffers_filled[0]) { - SDL_MintAudio_numbuf = 0; - SDL_MintAudio_Callback(); - Setbuffer(0, SDL_MintAudio_audiobuf[0], SDL_MintAudio_audiobuf[0] + SDL_MintAudio_audiosize); - buffers_filled[0]=SDL_TRUE; - buffers_filled[1]=SDL_FALSE; - } - } - - usleep(100); - } - SDL_MintAudio_thread_finished = SDL_TRUE; - return 0; -} - -void SDL_MintAudio_WaitThread(void) -{ - if (!SDL_MintAudio_mint_present) - return; - - if (SDL_MintAudio_thread_finished) - return; - - SDL_MintAudio_quit_thread = SDL_TRUE; - while (!SDL_MintAudio_thread_finished) { - Syield(); - } -} diff --git a/src/audio/mint/SDL_mintaudio.h b/src/audio/mint/SDL_mintaudio.h deleted file mode 100644 index ba6056ee3a..0000000000 --- a/src/audio/mint/SDL_mintaudio.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MiNT audio driver - - Patrice Mandin -*/ - -#ifndef _SDL_mintaudio_h -#define _SDL_mintaudio_h - -#include "../SDL_sysaudio.h" -#include "SDL_mintaudio_stfa.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -/* 16 predivisors with 3 clocks max. */ -#define MINTAUDIO_maxfreqs (16*3) - -typedef struct { - Uint32 frequency; - Uint32 masterclock; - Uint32 predivisor; - int gpio_bits; /* in case of external clock */ -} mint_frequency_t; - -struct SDL_PrivateAudioData { - mint_frequency_t frequencies[MINTAUDIO_maxfreqs]; - int freq_count; /* Number of frequencies in the array */ - int numfreq; /* Number of selected frequency */ -}; - -/* Old variable names */ - -#define MINTAUDIO_frequencies (this->hidden->frequencies) -#define MINTAUDIO_freqcount (this->hidden->freq_count) -#define MINTAUDIO_numfreq (this->hidden->numfreq) - -/* _MCH cookie (values>>16) */ -enum { - MCH_ST=0, - MCH_STE, - MCH_TT, - MCH_F30, - MCH_CLONE, - MCH_ARANYM -}; - -/* Master clocks for replay frequencies */ -#define MASTERCLOCK_STE 8010666 /* Not sure of this one */ -#define MASTERCLOCK_TT 16107953 /* Not sure of this one */ -#define MASTERCLOCK_FALCON1 25175000 -#define MASTERCLOCK_FALCON2 32000000 /* Only usable for DSP56K */ -#define MASTERCLOCK_FALCONEXT -1 /* Clock on DSP56K port, unknown */ -#define MASTERCLOCK_44K 22579200 /* Standard clock for 44.1 Khz */ -#define MASTERCLOCK_48K 24576000 /* Standard clock for 48 Khz */ - -/* Master clock predivisors */ -#define MASTERPREDIV_STE 160 -#define MASTERPREDIV_TT 320 -#define MASTERPREDIV_FALCON 256 -#define MASTERPREDIV_MILAN 256 - -/* Variables */ -extern SDL_AudioDevice *SDL_MintAudio_device; -extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ -extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ -extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */ -extern volatile unsigned short SDL_MintAudio_mutex; -extern cookie_stfa_t *SDL_MintAudio_stfa; -extern volatile unsigned long SDL_MintAudio_clocktics; -extern unsigned short SDL_MintAudio_hasfpu; /* To preserve fpu registers if needed */ - -/* MiNT thread variables */ -extern SDL_bool SDL_MintAudio_mint_present; -extern SDL_bool SDL_MintAudio_quit_thread; -extern SDL_bool SDL_MintAudio_thread_finished; -extern long SDL_MintAudio_thread_pid; - -/* Functions */ -void SDL_MintAudio_Callback(void); -void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock, - Uint32 prediv, int gpio_bits); -int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq); -void SDL_MintAudio_CheckFpu(void); - -/* MiNT thread functions */ -int SDL_MintAudio_Thread(long param); -void SDL_MintAudio_WaitThread(void); - -/* ASM interrupt functions */ -void SDL_MintAudio_GsxbInterrupt(void); -void SDL_MintAudio_EmptyGsxbInterrupt(void); -void SDL_MintAudio_XbiosInterruptMeasureClock(void); -void SDL_MintAudio_XbiosInterrupt(void); -void SDL_MintAudio_Dma8Interrupt(void); -void SDL_MintAudio_StfaInterrupt(void); - -#endif /* _SDL_mintaudio_h */ diff --git a/src/audio/mint/SDL_mintaudio_dma8.c b/src/audio/mint/SDL_mintaudio_dma8.c deleted file mode 100644 index 61feba3d64..0000000000 --- a/src/audio/mint/SDL_mintaudio_dma8.c +++ /dev/null @@ -1,357 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MiNT audio driver - using DMA 8bits (hardware access) - - Patrice Mandin -*/ - -/* Mint includes */ -#include -#include -#include - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" - -#include "../../video/ataricommon/SDL_atarimxalloc_c.h" - -#include "SDL_mintaudio.h" -#include "SDL_mintaudio_dma8.h" - -/*--- Defines ---*/ - -#define MINT_AUDIO_DRIVER_NAME "mint_dma8" - -/* Debug print info */ -#define DEBUG_NAME "audio:dma8: " -#if 0 -#define DEBUG_PRINT(what) \ - { \ - printf what; \ - } -#else -#define DEBUG_PRINT(what) -#endif - -/*--- Static variables ---*/ - -static long cookie_snd, cookie_mch; - -/*--- Audio driver functions ---*/ - -static void Mint_CloseAudio(_THIS); -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_LockAudio(_THIS); -static void Mint_UnlockAudio(_THIS); - -/* To check/init hardware audio */ -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec); - -/* Functions called in supervisor mode */ -static void Mint_InitDma(void); -static void Mint_StopReplay(void); -static void Mint_StartReplay(void); - -/*--- Audio driver bootstrap functions ---*/ - -static int Audio_Available(void) -{ - const char *envr = SDL_getenv("SDL_AUDIODRIVER"); - - /* Check if user asked a different audio driver */ - if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { - DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); - return 0; - } - - /* Cookie _MCH present ? if not, assume ST machine */ - if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) { - cookie_mch = MCH_ST; - } - - /* Cookie _SND present ? if not, assume ST machine */ - if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) { - cookie_snd = SND_PSG; - } - - /* Check if we have 8 bits audio */ - if ((cookie_snd & SND_8BIT)==0) { - DEBUG_PRINT((DEBUG_NAME "no 8 bits sound\n")); - return(0); - } - - /* Check if audio is lockable */ - if (cookie_snd & SND_16BIT) { - if (Locksnd()!=1) { - DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n")); - return(0); - } - - Unlocksnd(); - } - - DEBUG_PRINT((DEBUG_NAME "8 bits audio available!\n")); - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = Mint_OpenAudio; - this->CloseAudio = Mint_CloseAudio; - this->LockAudio = Mint_LockAudio; - this->UnlockAudio = Mint_UnlockAudio; - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap MINTAUDIO_DMA8_bootstrap = { - MINT_AUDIO_DRIVER_NAME, "MiNT DMA 8 bits audio driver", - Audio_Available, Audio_CreateDevice -}; - -static void Mint_LockAudio(_THIS) -{ - Supexec(Mint_StopReplay); -} - -static void Mint_UnlockAudio(_THIS) -{ - Supexec(Mint_StartReplay); -} - -static void Mint_CloseAudio(_THIS) -{ - Supexec(Mint_StopReplay); - - DEBUG_PRINT((DEBUG_NAME "closeaudio: replay stopped\n")); - - /* Disable interrupt */ - Jdisint(MFP_DMASOUND); - - DEBUG_PRINT((DEBUG_NAME "closeaudio: interrupt disabled\n")); - - /* Wait if currently playing sound */ - while (SDL_MintAudio_mutex != 0) { - } - - DEBUG_PRINT((DEBUG_NAME "closeaudio: no more interrupt running\n")); - - /* Clear buffers */ - if (SDL_MintAudio_audiobuf[0]) { - Mfree(SDL_MintAudio_audiobuf[0]); - SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL; - } - - DEBUG_PRINT((DEBUG_NAME "closeaudio: buffers freed\n")); -} - -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) -{ - int i, masterprediv, sfreq; - unsigned long masterclock; - - DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - if (spec->channels > 2) - spec->channels = 2; - - /* Check formats available */ - spec->format = AUDIO_S8; - - /* Calculate and select the closest frequency */ - sfreq=0; - masterclock=MASTERCLOCK_STE; - masterprediv=MASTERPREDIV_STE; - switch(cookie_mch>>16) { -/* - case MCH_STE: - masterclock=MASTERCLOCK_STE; - masterprediv=MASTERPREDIV_STE; - break; -*/ - case MCH_TT: - masterclock=MASTERCLOCK_TT; - masterprediv=MASTERPREDIV_TT; - break; - case MCH_F30: - case MCH_ARANYM: - masterclock=MASTERCLOCK_FALCON1; - masterprediv=MASTERPREDIV_FALCON; - sfreq=1; - break; - } - - MINTAUDIO_freqcount=0; - for (i=sfreq;i<4;i++) { - SDL_MintAudio_AddFrequency(this, masterclock/(masterprediv*(1<freq); - spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; - - DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - return 0; -} - -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - SDL_MintAudio_device = this; - - /* Check audio capabilities */ - if (Mint_CheckAudio(this, spec)==-1) { - return -1; - } - - SDL_CalculateAudioSpec(spec); - - /* Allocate memory for audio buffers in DMA-able RAM */ - DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); - - SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); - if (SDL_MintAudio_audiobuf[0]==NULL) { - SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); - return (-1); - } - SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; - SDL_MintAudio_numbuf=0; - SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); - SDL_MintAudio_audiosize = spec->size; - SDL_MintAudio_mutex = 0; - - DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); - DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); - - SDL_MintAudio_CheckFpu(); - - /* Set replay tracks */ - if (cookie_snd & SND_16BIT) { - Settracks(0,0); - Setmontracks(0); - } - - Supexec(Mint_InitDma); - - /* Set interrupt */ - Jdisint(MFP_DMASOUND); - Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt); - Jenabint(MFP_DMASOUND); - - if (cookie_snd & SND_16BIT) { - if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) { - DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n")); - } - } - - Supexec(Mint_StartReplay); - - return(1); /* We don't use threaded audio */ -} - -/* Functions called in supervisor mode */ - -static void Mint_InitDma(void) -{ - unsigned long buffer; - unsigned char mode; - SDL_AudioDevice *this = SDL_MintAudio_device; - - Mint_StopReplay(); - - /* Set buffer */ - buffer = (unsigned long) SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf]; - DMAAUDIO_IO.start_high = (buffer>>16) & 255; - DMAAUDIO_IO.start_mid = (buffer>>8) & 255; - DMAAUDIO_IO.start_low = buffer & 255; - - buffer += SDL_MintAudio_audiosize; - DMAAUDIO_IO.end_high = (buffer>>16) & 255; - DMAAUDIO_IO.end_mid = (buffer>>8) & 255; - DMAAUDIO_IO.end_low = buffer & 255; - - mode = 3-MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor; - if (this->spec.channels==1) { - mode |= 1<<7; - } - DMAAUDIO_IO.sound_ctrl = mode; -} - -static void Mint_StopReplay(void) -{ - /* Stop replay */ - DMAAUDIO_IO.control=0; -} - -static void Mint_StartReplay(void) -{ - /* Start replay */ - DMAAUDIO_IO.control=3; -} diff --git a/src/audio/mint/SDL_mintaudio_dma8.h b/src/audio/mint/SDL_mintaudio_dma8.h deleted file mode 100644 index a52e5db7a5..0000000000 --- a/src/audio/mint/SDL_mintaudio_dma8.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - DMA 8bits and Falcon Codec audio definitions - - Patrice Mandin, Didier Méquignon -*/ - -#ifndef _SDL_mintaudio_dma8_h -#define _SDL_mintaudio_dma8_h - -#define DMAAUDIO_IO_BASE (0xffff8900) -struct DMAAUDIO_IO_S { - unsigned char int_ctrl; - unsigned char control; - - unsigned char dummy1; - unsigned char start_high; - unsigned char dummy2; - unsigned char start_mid; - unsigned char dummy3; - unsigned char start_low; - - unsigned char dummy4; - unsigned char cur_high; - unsigned char dummy5; - unsigned char cur_mid; - unsigned char dummy6; - unsigned char cur_low; - - unsigned char dummy7; - unsigned char end_high; - unsigned char dummy8; - unsigned char end_mid; - unsigned char dummy9; - unsigned char end_low; - - unsigned char dummy10[12]; - - unsigned char track_ctrl; /* CODEC only */ - unsigned char sound_ctrl; - unsigned short sound_data; - unsigned short sound_mask; - - unsigned char dummy11[10]; - - unsigned short dev_ctrl; - unsigned short dest_ctrl; - unsigned short sync_div; - unsigned char track_rec; - unsigned char adderin_input; - unsigned char channel_input; - unsigned char channel_amplification; - unsigned char channel_reduction; - - unsigned char dummy12[6]; - - unsigned char data_direction; - unsigned char dummy13; - unsigned char dev_data; -}; -#define DMAAUDIO_IO ((*(volatile struct DMAAUDIO_IO_S *)DMAAUDIO_IO_BASE)) - -#endif /* _SDL_mintaudio_dma8_h */ diff --git a/src/audio/mint/SDL_mintaudio_gsxb.c b/src/audio/mint/SDL_mintaudio_gsxb.c deleted file mode 100644 index 8d7716a137..0000000000 --- a/src/audio/mint/SDL_mintaudio_gsxb.c +++ /dev/null @@ -1,436 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MiNT audio driver - using XBIOS functions (GSXB compatible driver) - - Patrice Mandin -*/ - -/* Mint includes */ -#include -#include -#include - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" - -#include "../../video/ataricommon/SDL_atarimxalloc_c.h" - -#include "SDL_mintaudio.h" -#include "SDL_mintaudio_gsxb.h" - -/*--- Defines ---*/ - -#define MINT_AUDIO_DRIVER_NAME "mint_gsxb" - -/* Debug print info */ -#define DEBUG_NAME "audio:gsxb: " -#if 0 -#define DEBUG_PRINT(what) \ - { \ - printf what; \ - } -#else -#define DEBUG_PRINT(what) -#endif - -/*--- Static variables ---*/ - -static long cookie_snd, cookie_gsxb; - -/*--- Audio driver functions ---*/ - -static void Mint_CloseAudio(_THIS); -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_LockAudio(_THIS); -static void Mint_UnlockAudio(_THIS); - -/* To check/init hardware audio */ -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec); - -/* GSXB callbacks */ -static void Mint_GsxbInterrupt(void); -static void Mint_GsxbNullInterrupt(void); - -/*--- Audio driver bootstrap functions ---*/ - -static int Audio_Available(void) -{ - const char *envr = SDL_getenv("SDL_AUDIODRIVER"); - - /* Check if user asked a different audio driver */ - if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { - DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); - return(0); - } - - /* Cookie _SND present ? if not, assume ST machine */ - if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) { - cookie_snd = SND_PSG; - } - - /* Check if we have 16 bits audio */ - if ((cookie_snd & SND_16BIT)==0) { - DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n")); - return(0); - } - - /* Cookie GSXB present ? */ - cookie_gsxb = (Getcookie(C_GSXB, &cookie_gsxb) == C_FOUND); - - /* Is it GSXB ? */ - if (((cookie_snd & SND_GSXB)==0) || (cookie_gsxb==0)) { - DEBUG_PRINT((DEBUG_NAME "no GSXB audio\n")); - return(0); - } - - /* Check if audio is lockable */ - if (Locksnd()!=1) { - DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n")); - return(0); - } - - Unlocksnd(); - - DEBUG_PRINT((DEBUG_NAME "GSXB audio available!\n")); - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = Mint_OpenAudio; - this->CloseAudio = Mint_CloseAudio; - this->LockAudio = Mint_LockAudio; - this->UnlockAudio = Mint_UnlockAudio; - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap MINTAUDIO_GSXB_bootstrap = { - MINT_AUDIO_DRIVER_NAME, "MiNT GSXB audio driver", - Audio_Available, Audio_CreateDevice -}; - -static void Mint_LockAudio(_THIS) -{ - /* Stop replay */ - Buffoper(0); -} - -static void Mint_UnlockAudio(_THIS) -{ - /* Restart replay */ - Buffoper(SB_PLA_ENA|SB_PLA_RPT); -} - -static void Mint_CloseAudio(_THIS) -{ - /* Stop replay */ - Buffoper(0); - - /* Uninstall interrupt */ - if (NSetinterrupt(2, SI_NONE, Mint_GsxbNullInterrupt)<0) { - DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed in close\n")); - } - - /* Wait if currently playing sound */ - while (SDL_MintAudio_mutex != 0) { - } - - /* Clear buffers */ - if (SDL_MintAudio_audiobuf[0]) { - Mfree(SDL_MintAudio_audiobuf[0]); - SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL; - } - - /* Unlock sound system */ - Unlocksnd(); -} - -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) -{ - long snd_format = 0; - int i, resolution, format_signed, format_bigendian; - Uint16 test_format = SDL_FirstAudioFormat(spec->format); - int valid_datatype = 0; - - resolution = spec->format & 0x00ff; - format_signed = ((spec->format & 0x8000)!=0); - format_bigendian = ((spec->format & 0x1000)!=0); - - DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - if (spec->channels > 2) { - spec->channels = 2; /* no more than stereo! */ - } - - while ((!valid_datatype) && (test_format)) { - /* Check formats available */ - snd_format = Sndstatus(SND_QUERYFORMATS); - spec->format = test_format; - resolution = spec->format & 0xff; - format_signed = (spec->format & (1<<15)); - format_bigendian = (spec->format & (1<<12)); - switch (test_format) { - case AUDIO_U8: - case AUDIO_S8: - if (snd_format & SND_FORMAT8) { - valid_datatype = 1; - snd_format = Sndstatus(SND_QUERY8BIT); - } - break; - - case AUDIO_U16LSB: - case AUDIO_S16LSB: - case AUDIO_U16MSB: - case AUDIO_S16MSB: - if (snd_format & SND_FORMAT16) { - valid_datatype = 1; - snd_format = Sndstatus(SND_QUERY16BIT); - } - break; - - default: - test_format = SDL_NextAudioFormat(); - break; - } - } - - if (!valid_datatype) { - SDL_SetError("Unsupported audio format"); - return (-1); - } - - /* Check signed/unsigned format */ - if (format_signed) { - if (snd_format & SND_FORMATSIGNED) { - /* Ok */ - } else if (snd_format & SND_FORMATUNSIGNED) { - /* Give unsigned format */ - spec->format = spec->format & (~0x8000); - } - } else { - if (snd_format & SND_FORMATUNSIGNED) { - /* Ok */ - } else if (snd_format & SND_FORMATSIGNED) { - /* Give signed format */ - spec->format |= 0x8000; - } - } - - if (format_bigendian) { - if (snd_format & SND_FORMATBIGENDIAN) { - /* Ok */ - } else if (snd_format & SND_FORMATLITTLEENDIAN) { - /* Give little endian format */ - spec->format = spec->format & (~0x1000); - } - } else { - if (snd_format & SND_FORMATLITTLEENDIAN) { - /* Ok */ - } else if (snd_format & SND_FORMATBIGENDIAN) { - /* Give big endian format */ - spec->format |= 0x1000; - } - } - - /* Calculate and select the closest frequency */ - MINTAUDIO_freqcount=0; - for (i=1;i<4;i++) { - SDL_MintAudio_AddFrequency(this, - MASTERCLOCK_44K/(MASTERPREDIV_MILAN*(1<freq); - spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; - - DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - return 0; -} - -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec) -{ - int channels_mode, prediv; - void *buffer; - - /* Stop currently playing sound */ - Buffoper(0); - - /* Set replay tracks */ - Settracks(0,0); - Setmontracks(0); - - /* Select replay format */ - switch (spec->format & 0xff) { - case 8: - if (spec->channels==2) { - channels_mode=STEREO8; - } else { - channels_mode=MONO8; - } - break; - case 16: - if (spec->channels==2) { - channels_mode=STEREO16; - } else { - channels_mode=MONO16; - } - break; - default: - channels_mode=STEREO16; - break; - } - if (Setmode(channels_mode)<0) { - DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n")); - } - - prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor; - Devconnect(DMAPLAY, DAC, CLKEXT, prediv, 1); - - /* Set buffer */ - buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf]; - if (Setbuffer(0, buffer, buffer + spec->size)<0) { - DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n")); - } - - /* Install interrupt */ - if (NSetinterrupt(2, SI_PLAY, Mint_GsxbInterrupt)<0) { - DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed\n")); - } - - /* Go */ - Buffoper(SB_PLA_ENA|SB_PLA_RPT); - DEBUG_PRINT((DEBUG_NAME "hardware initialized\n")); -} - -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - /* Lock sound system */ - if (Locksnd()!=1) { - SDL_SetError("Mint_OpenAudio: Audio system already in use"); - return(-1); - } - - SDL_MintAudio_device = this; - - /* Check audio capabilities */ - if (Mint_CheckAudio(this, spec)==-1) { - return -1; - } - - SDL_CalculateAudioSpec(spec); - - /* Allocate memory for audio buffers in DMA-able RAM */ - DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); - - SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); - if (SDL_MintAudio_audiobuf[0]==NULL) { - SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); - return (-1); - } - SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; - SDL_MintAudio_numbuf=0; - SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); - SDL_MintAudio_audiosize = spec->size; - SDL_MintAudio_mutex = 0; - - DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); - DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); - - SDL_MintAudio_CheckFpu(); - - /* Setup audio hardware */ - Mint_InitAudio(this, spec); - - return(1); /* We don't use threaded audio */ -} - -static void Mint_GsxbInterrupt(void) -{ - Uint8 *newbuf; - - if (SDL_MintAudio_mutex) - return; - - SDL_MintAudio_mutex=1; - - SDL_MintAudio_numbuf ^= 1; - SDL_MintAudio_Callback(); - newbuf = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf]; - Setbuffer(0, newbuf, newbuf + SDL_MintAudio_audiosize); - - SDL_MintAudio_mutex=0; -} - -static void Mint_GsxbNullInterrupt(void) -{ -} diff --git a/src/audio/mint/SDL_mintaudio_gsxb.h b/src/audio/mint/SDL_mintaudio_gsxb.h deleted file mode 100644 index aee26b7ee3..0000000000 --- a/src/audio/mint/SDL_mintaudio_gsxb.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - * GSXB audio definitions - * - * Patrice Mandin - */ - -#ifndef _SDL_mintaudio_gsxb_h -#define _SDL_mintaudio_gsxb_h - -#include /* for trap_14_xxx macros */ - -/* Bit 5 in cookie _SND */ - -#define SND_GSXB (1<<5) - -/* NSoundcmd modes */ - -#define SETRATE 7 /* Set sample rate */ -#define SET8BITFORMAT 8 /* 8 bits format */ -#define SET16BITFORMAT 9 /* 16 bits format */ -#define SET24BITFORMAT 10 /* 24 bits format */ -#define SET32BITFORMAT 11 /* 32 bits format */ -#define LTATTEN_MASTER 12 /* Attenuation */ -#define RTATTEN_MASTER 13 -#define LTATTEN_MICIN 14 -#define RTATTEN_MICIN 15 -#define LTATTEN_FMGEN 16 -#define RTATTEN_FMGEN 17 -#define LTATTEN_LINEIN 18 -#define RTATTEN_LINEIN 19 -#define LTATTEN_CDIN 20 -#define RTATTEN_CDIN 21 -#define LTATTEN_VIDIN 22 -#define RTATTEN_VIDIN 23 -#define LTATTEN_AUXIN 24 -#define RTATTEN_AUXIN 25 - -/* Setmode modes */ - -#define MONO16 3 -#define STEREO24 4 -#define STEREO32 5 -#define MONO24 6 -#define MONO32 7 - -/* Sndstatus modes */ - -#define SND_QUERYFORMATS 2 -#define SND_QUERYMIXERS 3 -#define SND_QUERYSOURCES 4 -#define SND_QUERYDUPLEX 5 -#define SND_QUERY8BIT 8 -#define SND_QUERY16BIT 9 -#define SND_QUERY24BIT 10 -#define SND_QUERY32BIT 11 - -#define SND_FORMAT8 (1<<0) -#define SND_FORMAT16 (1<<1) -#define SND_FORMAT24 (1<<2) -#define SND_FORMAT32 (1<<3) - -#define SND_FORMATSIGNED (1<<0) -#define SND_FORMATUNSIGNED (1<<1) -#define SND_FORMATBIGENDIAN (1<<2) -#define SND_FORMATLITTLEENDIAN (1<<3) - -/* Devconnect prescalers */ - -#define CLK_44K 1 -#define CLK_22K 3 -#define CLK_11K 7 - -/* Extra xbios functions */ - -#define NSoundcmd(mode,data,data2) \ - (long)trap_14_wwl((short)130,(short)(mode),(short)(data),(long)(data2)) -#define NSetinterrupt(src_inter,cause,inth_addr) \ - (long)trap_14_wwwl((short)135,(short)(src_inter),(short)(cause), \ - (long)(inth_addr)) - -#endif /* _SDL_mintaudio_gsxb_h */ diff --git a/src/audio/mint/SDL_mintaudio_it.S b/src/audio/mint/SDL_mintaudio_it.S deleted file mode 100644 index a2ecac4c65..0000000000 --- a/src/audio/mint/SDL_mintaudio_it.S +++ /dev/null @@ -1,386 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* - Audio interrupts - - Patrice Mandin, Didier Méquignon - */ - - .text - - .globl _SDL_MintAudio_Callback - - .globl _SDL_MintAudio_XbiosInterrupt - .globl _SDL_MintAudio_XbiosInterruptMeasureClock - .globl _SDL_MintAudio_Dma8Interrupt - .globl _SDL_MintAudio_StfaInterrupt - - .globl _SDL_MintAudio_mutex - .globl _SDL_MintAudio_audiobuf - .globl _SDL_MintAudio_numbuf - .globl _SDL_MintAudio_audiosize - .globl _SDL_MintAudio_clocktics - .globl _SDL_MintAudio_hasfpu - - .globl _SDL_MintAudio_stfa - -/* - How it works: - - Audio is playing buffer #0 (resp. #1) - - We must calculate a sample in buffer #1 (resp. #0) - so we first call the callback to do it - - Then we swap the buffers -*/ - -#define savptr 0x4a2 -#define savamt 0x46 - -/*--- Save/restore FPU context ---*/ - -#if defined(__mcoldfire__) - -#define SAVE_FPU_CONTEXT \ - lea sp@(-216),sp; \ - fsave sp@; \ - fmovel fpiar,sp@-; \ - lea sp@(-64),sp; \ - fmovemd fp0-fp7,sp@ - -#define RESTORE_FPU_CONTEXT \ - fmovemd sp@,fp0-fp7; \ - lea sp@(64),sp; \ - fmovel sp@+,fpiar; \ - frestore sp@; \ - lea sp@(216),sp - -#else - -#define SAVE_FPU_CONTEXT \ - .chip 68k/68881; \ - fsave sp@-; \ - fmoveml fpcr/fpsr/fpiar,sp@-; \ - fmovemx fp0-fp7,sp@-; \ - .chip 68k - -#define RESTORE_FPU_CONTEXT \ - .chip 68k/68881; \ - fmovemx sp@+,fp0-fp7; \ - fmoveml sp@+,fpcr/fpsr/fpiar; \ - frestore sp@+; \ - .chip 68k - -#endif - -/*--- Xbios interrupt vector to measure Falcon external clock ---*/ - -_SDL_MintAudio_XbiosInterruptMeasureClock: /* 1 mS */ -#if defined(__mcoldfire__) - movel d0,sp@- - - moveql #0,d0 - btst d0,0xFFFF8901:w /* state DMA sound */ -#else - btst #0,0xFFFF8901:w /* state DMA sound */ -#endif - beqs SDL_MintAudio_EndIntMeasure - addql #1,_SDL_MintAudio_clocktics -SDL_MintAudio_EndIntMeasure: -#if defined(__mcoldfire__) - moveql #5,d0 - bclr d0,0xFFFFFA0F:w /* Clear service bit */ - - movel sp@+,d0 -#else - bclr #5,0xFFFFFA0F:w /* Clear service bit */ -#endif - rte - -/*--- Xbios interrupt vector ---*/ - -_SDL_MintAudio_XbiosInterrupt: -#if defined(__mcoldfire__) - lea sp@(-60),sp - moveml d0-d7/a0-a6,sp@ -#else - moveml d0-d7/a0-a6,sp@- -#endif - - /* Reenable interrupts, so other interrupts can work */ - movew #0x2300,sr - - /* Clear service bit, so other MFP interrupts can work */ -#if defined(__mcoldfire__) - moveql #5,d0 - bclr d0,0xfffffa0f:w -#else - bclr #5,0xfffffa0f:w -#endif - - /* Check if we are not already running */ - tstw _SDL_MintAudio_mutex - bne SDL_MintAudio_XbiosEnd - -#if defined(__mcoldfire__) - movew _SDL_MintAudio_mutex,d0 - notl d0 - movew d0,_SDL_MintAudio_mutex - - movew _SDL_MintAudio_numbuf,d1 - eorl #1,d1 - movew d1,_SDL_MintAudio_numbuf -#else - notw _SDL_MintAudio_mutex - - /* Swap buffers */ - eorw #1,_SDL_MintAudio_numbuf -#endif - - /* Save FPU if needed */ - tstw _SDL_MintAudio_hasfpu - beqs SDL_MintAudio_Xbios_nofpu1 - SAVE_FPU_CONTEXT -SDL_MintAudio_Xbios_nofpu1: - - /* Callback */ - jsr _SDL_MintAudio_Callback - - /* Restore FPU if needed */ - tstw _SDL_MintAudio_hasfpu - beqs SDL_MintAudio_Xbios_nofpu2 - RESTORE_FPU_CONTEXT -SDL_MintAudio_Xbios_nofpu2: - - /* Reserve space for registers */ -#if defined(__mcoldfire__) - movel #savamt,d0 - subl d0,savptr -#else - subl #savamt,savptr -#endif - - /* Set new buffer */ - - moveq #0,d0 - movel _SDL_MintAudio_audiosize,d1 - - movew _SDL_MintAudio_numbuf,d0 - lsll #2,d0 - lea _SDL_MintAudio_audiobuf,a0 - movel a0@(d0:l),a1 - - lea a1@(d1:l),a2 - - movel a2,sp@- - movel a1,sp@- - clrw sp@- - movew #131,sp@- - trap #14 - lea sp@(12),sp - - /* Restore registers space */ -#if defined(__mcoldfire__) - movel #savamt,d0 - addl d0,savptr -#else - addl #savamt,savptr -#endif - - clrw _SDL_MintAudio_mutex -SDL_MintAudio_XbiosEnd: -#if defined(__mcoldfire__) - moveml sp@,d0-d7/a0-a6 - lea sp@(60),sp -#else - moveml sp@+,d0-d7/a0-a6 -#endif - rte - -/*--- DMA 8 bits interrupt vector ---*/ - -_SDL_MintAudio_Dma8Interrupt: -#if defined(__mcoldfire__) - lea sp@(-16),sp - moveml d0-d1/a0-a1,sp@ -#else - moveml d0-d1/a0-a1,sp@- -#endif - - /* Reenable interrupts, so other interrupts can work */ - movew #0x2300,sr - - /* Clear service bit, so other MFP interrupts can work */ -#if defined(__mcoldfire__) - moveql #5,d0 - bclr d0,0xfffffa0f:w -#else - bclr #5,0xfffffa0f:w -#endif - /* Check if we are not already running */ - tstw _SDL_MintAudio_mutex - bne SDL_MintAudio_Dma8End - -#if defined(__mcoldfire__) - movew _SDL_MintAudio_mutex,d0 - notl d0 - movew d0,_SDL_MintAudio_mutex - - movew _SDL_MintAudio_numbuf,d1 - eorl #1,d1 - movew d1,_SDL_MintAudio_numbuf -#else - notw _SDL_MintAudio_mutex - - /* Swap buffers */ - eorw #1,_SDL_MintAudio_numbuf -#endif - - /* Save FPU if needed */ - tstw _SDL_MintAudio_hasfpu - beqs SDL_MintAudio_Dma8_nofpu1 - SAVE_FPU_CONTEXT -SDL_MintAudio_Dma8_nofpu1: - - /* Callback */ - jsr _SDL_MintAudio_Callback - - /* Restore FPU if needed */ - tstw _SDL_MintAudio_hasfpu - beqs SDL_MintAudio_Dma8_nofpu2 - RESTORE_FPU_CONTEXT -SDL_MintAudio_Dma8_nofpu2: - - /* Set new buffer */ - - moveq #0,d0 - - movew _SDL_MintAudio_numbuf,d0 - lsll #2,d0 - lea _SDL_MintAudio_audiobuf,a0 - movel a0@(d0:l),d1 - - /* Modify DMA addresses */ - lea 0xffff8900:w,a0 - - movel d1,d0 - - moveb d0,a0@(0x07) /* Start address */ - lsrl #8,d0 - moveb d0,a0@(0x05) - lsrl #8,d0 - moveb d0,a0@(0x03) - - addl _SDL_MintAudio_audiosize,d1 - - movel d1,d0 - - moveb d0,a0@(0x13) /* End address */ - lsrl #8,d0 - moveb d0,a0@(0x11) - lsrl #8,d0 - moveb d0,a0@(0x0f) - - clrw _SDL_MintAudio_mutex -SDL_MintAudio_Dma8End: -#if defined(__mcoldfire__) - moveml sp@,d0-d1/a0-a1 - lea sp@(16),sp -#else - moveml sp@+,d0-d1/a0-a1 -#endif - rte - -/*--- STFA interrupt vector ---*/ - -STFA_SOUND_START = 6 -STFA_SOUND_END = STFA_SOUND_START+8 - -_SDL_MintAudio_StfaInterrupt: - /* Reenable interrupts, so other interrupts can work */ - movew #0x2300,sr - - /* Check if we are not already running */ - tstw _SDL_MintAudio_mutex - -#if defined(__mcoldfire__) - bne SDL_MintAudio_StfaEnd - - lea sp@(-60),sp - moveml d0-d7/a0-a6,sp@ - - movew _SDL_MintAudio_mutex,d0 - notl d0 - movew d0,_SDL_MintAudio_mutex - - movew _SDL_MintAudio_numbuf,d1 - eorl #1,d1 - movew d1,_SDL_MintAudio_numbuf -#else - bnes SDL_MintAudio_StfaEnd - - moveml d0-d7/a0-a6,sp@- - - notw _SDL_MintAudio_mutex - - /* Swap buffers */ - eorw #1,_SDL_MintAudio_numbuf -#endif - - /* Save FPU if needed */ - tstw _SDL_MintAudio_hasfpu - beqs SDL_MintAudio_Stfa_nofpu1 - SAVE_FPU_CONTEXT -SDL_MintAudio_Stfa_nofpu1: - - /* Callback */ - jsr _SDL_MintAudio_Callback - - /* Restore FPU if needed */ - tstw _SDL_MintAudio_hasfpu - beqs SDL_MintAudio_Stfa_nofpu2 - RESTORE_FPU_CONTEXT -SDL_MintAudio_Stfa_nofpu2: - - /* Set new buffer */ - - moveq #0,d0 - movel _SDL_MintAudio_stfa,a1 - - movew _SDL_MintAudio_numbuf,d0 - lsll #2,d0 - lea _SDL_MintAudio_audiobuf,a0 - movel a0@(d0:l),d1 - - /* Modify STFA replay buffers */ - movel d1,a1@(STFA_SOUND_START) - addl _SDL_MintAudio_audiosize,d1 - movel d1,a1@(STFA_SOUND_END) - -#if defined(__mcoldfire__) - moveml sp@,d0-d7/a0-a6 - lea sp@(60),sp -#else - moveml sp@+,d0-d7/a0-a6 -#endif - clrw _SDL_MintAudio_mutex -SDL_MintAudio_StfaEnd: - rte diff --git a/src/audio/mint/SDL_mintaudio_mcsn.c b/src/audio/mint/SDL_mintaudio_mcsn.c deleted file mode 100644 index 387609b168..0000000000 --- a/src/audio/mint/SDL_mintaudio_mcsn.c +++ /dev/null @@ -1,405 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MiNT audio driver - using XBIOS functions (MacSound compatible driver) - - Patrice Mandin -*/ - -#include - -/* Mint includes */ -#include -#include -#include - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" - -#include "../../video/ataricommon/SDL_atarimxalloc_c.h" - -#include "SDL_mintaudio.h" -#include "SDL_mintaudio_mcsn.h" - -/*--- Defines ---*/ - -#define MINT_AUDIO_DRIVER_NAME "mint_mcsn" - -/* Debug print info */ -#define DEBUG_NAME "audio:mcsn: " -#if 0 -#define DEBUG_PRINT(what) \ - { \ - printf what; \ - } -#else -#define DEBUG_PRINT(what) -#endif - -/*--- Static variables ---*/ - -static long cookie_snd, cookie_mch; -static cookie_mcsn_t *cookie_mcsn; - -/*--- Audio driver functions ---*/ - -static void Mint_CloseAudio(_THIS); -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_LockAudio(_THIS); -static void Mint_UnlockAudio(_THIS); - -/* To check/init hardware audio */ -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec); - -/*--- Audio driver bootstrap functions ---*/ - -static int Audio_Available(void) -{ - long dummy; - const char *envr = SDL_getenv("SDL_AUDIODRIVER"); - - SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND); - - /* We can't use XBIOS in interrupt with Magic, don't know about thread */ - if (Getcookie(C_MagX, &dummy) == C_FOUND) { - return(0); - } - - /* Check if user asked a different audio driver */ - if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { - DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); - return(0); - } - - /* Cookie _MCH present ? if not, assume ST machine */ - if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) { - cookie_mch = MCH_ST; - } - - /* Cookie _SND present ? if not, assume ST machine */ - if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) { - cookie_snd = SND_PSG; - } - - /* Check if we have 16 bits audio */ - if ((cookie_snd & SND_16BIT)==0) { - DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n")); - return(0); - } - - /* Cookie MCSN present ? */ - if (Getcookie(C_McSn, &dummy) != C_FOUND) { - DEBUG_PRINT((DEBUG_NAME "no MCSN audio\n")); - return(0); - } - cookie_mcsn = (cookie_mcsn_t *) dummy; - - /* Check if interrupt at end of replay */ - if (cookie_mcsn->pint == 0) { - DEBUG_PRINT((DEBUG_NAME "no interrupt at end of replay\n")); - return(0); - } - - /* Check if audio is lockable */ - if (Locksnd()!=1) { - DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n")); - return(0); - } - - Unlocksnd(); - - DEBUG_PRINT((DEBUG_NAME "MCSN audio available!\n")); - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = Mint_OpenAudio; - this->CloseAudio = Mint_CloseAudio; - this->LockAudio = Mint_LockAudio; - this->UnlockAudio = Mint_UnlockAudio; - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap MINTAUDIO_MCSN_bootstrap = { - MINT_AUDIO_DRIVER_NAME, "MiNT MCSN audio driver", - Audio_Available, Audio_CreateDevice -}; - -static void Mint_LockAudio(_THIS) -{ - /* Stop replay */ - Buffoper(0); -} - -static void Mint_UnlockAudio(_THIS) -{ - /* Restart replay */ - Buffoper(SB_PLA_ENA|SB_PLA_RPT); -} - -static void Mint_CloseAudio(_THIS) -{ - /* Stop replay */ - SDL_MintAudio_WaitThread(); - Buffoper(0); - - if (!SDL_MintAudio_mint_present) { - /* Uninstall interrupt */ - Jdisint(MFP_DMASOUND); - } - - /* Wait if currently playing sound */ - while (SDL_MintAudio_mutex != 0) { - } - - /* Clear buffers */ - if (SDL_MintAudio_audiobuf[0]) { - Mfree(SDL_MintAudio_audiobuf[0]); - SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL; - } - - /* Unlock sound system */ - Unlocksnd(); -} - -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) -{ - int i; - unsigned long masterclock, masterprediv; - - DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - if (spec->channels > 2) { - spec->channels = 2; /* no more than stereo! */ - } - - /* Check formats available */ - MINTAUDIO_freqcount=0; - switch(cookie_mcsn->play) { - case MCSN_ST: - spec->channels=1; - spec->format=8; /* FIXME: is it signed or unsigned ? */ - SDL_MintAudio_AddFrequency(this, 12500, 0, 0, -1); - break; - case MCSN_TT: /* Also STE, Mega STE */ - spec->format=AUDIO_S8; - masterclock=MASTERCLOCK_STE; - masterprediv=MASTERPREDIV_STE; - if ((cookie_mch>>16)==MCH_TT) { - masterclock=MASTERCLOCK_TT; - masterprediv=MASTERPREDIV_TT; - } - for (i=0; i<4; i++) { - SDL_MintAudio_AddFrequency(this, masterclock/(masterprediv*(1<res1 != 0) { - for (i=1; i<4; i++) { - SDL_MintAudio_AddFrequency(this, (cookie_mcsn->res1)/(MASTERPREDIV_FALCON*(1<format |= 0x8000; /* Audio is always signed */ - if ((spec->format & 0x00ff)==16) { - spec->format |= 0x1000; /* Audio is always big endian */ - spec->channels=2; /* 16 bits always stereo */ - } - break; - } - -#if 0 - for (i=0; ifreq); - spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; - - DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - return 0; -} - -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec) -{ - int channels_mode, prediv, dmaclock; - void *buffer; - - /* Stop currently playing sound */ - SDL_MintAudio_quit_thread = SDL_FALSE; - SDL_MintAudio_thread_finished = SDL_TRUE; - SDL_MintAudio_WaitThread(); - Buffoper(0); - - /* Set replay tracks */ - Settracks(0,0); - Setmontracks(0); - - /* Select replay format */ - channels_mode=STEREO16; - switch (spec->format & 0xff) { - case 8: - if (spec->channels==2) { - channels_mode=STEREO8; - } else { - channels_mode=MONO8; - } - break; - } - if (Setmode(channels_mode)<0) { - DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n")); - } - - dmaclock = MINTAUDIO_frequencies[MINTAUDIO_numfreq].masterclock; - prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor; - switch(cookie_mcsn->play) { - case MCSN_TT: - Devconnect(DMAPLAY, DAC, CLK25M, CLKOLD, 1); - Soundcmd(SETPRESCALE, prediv); - DEBUG_PRINT((DEBUG_NAME "STE/TT prescaler selected\n")); - break; - case MCSN_FALCON: - Devconnect(DMAPLAY, DAC, dmaclock, prediv, 1); - DEBUG_PRINT((DEBUG_NAME "Falcon prescaler selected\n")); - break; - } - - /* Set buffer */ - buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf]; - if (Setbuffer(0, buffer, buffer + spec->size)<0) { - DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n")); - } - - if (SDL_MintAudio_mint_present) { - SDL_MintAudio_thread_pid = tfork(SDL_MintAudio_Thread, 0); - } else { - /* Install interrupt */ - Jdisint(MFP_DMASOUND); - Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt); - Jenabint(MFP_DMASOUND); - - if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) { - DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n")); - } - } - - /* Go */ - Buffoper(SB_PLA_ENA|SB_PLA_RPT); - DEBUG_PRINT((DEBUG_NAME "hardware initialized\n")); -} - -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - /* Lock sound system */ - if (Locksnd()!=1) { - SDL_SetError("Mint_OpenAudio: Audio system already in use"); - return(-1); - } - - SDL_MintAudio_device = this; - - /* Check audio capabilities */ - if (Mint_CheckAudio(this, spec)==-1) { - return -1; - } - - SDL_CalculateAudioSpec(spec); - - /* Allocate memory for audio buffers in DMA-able RAM */ - DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); - - SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); - if (SDL_MintAudio_audiobuf[0]==NULL) { - SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); - return (-1); - } - SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; - SDL_MintAudio_numbuf=0; - SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); - SDL_MintAudio_audiosize = spec->size; - SDL_MintAudio_mutex = 0; - - DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); - DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); - - SDL_MintAudio_CheckFpu(); - - /* Setup audio hardware */ - Mint_InitAudio(this, spec); - - return(1); /* We don't use SDL threaded audio */ -} diff --git a/src/audio/mint/SDL_mintaudio_mcsn.h b/src/audio/mint/SDL_mintaudio_mcsn.h deleted file mode 100644 index b772fdab03..0000000000 --- a/src/audio/mint/SDL_mintaudio_mcsn.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MCSN control structure - - Patrice Mandin -*/ - -#ifndef _SDL_mintaudio_mcsh_h -#define _SDL_mintaudio_mcsh_h - -typedef struct { - unsigned short version; /* Version */ - unsigned short size; /* Size of structure */ - - unsigned short play; /* Replay capability */ - unsigned short record; /* Record capability */ - unsigned short dsp; /* DSP56K present */ - unsigned short pint; /* Interrupt at end of replay */ - unsigned short rint; /* Interrupt at end of record */ - - unsigned long res1; /* Frequency of external clock */ - unsigned long res2; - unsigned long res3; - unsigned long res4; -} cookie_mcsn_t; - -enum { - MCSN_ST=0, - MCSN_TT, - MCSN_STE=MCSN_TT, - MCSN_FALCON, - MCSN_MAC=MCSN_FALCON -}; - -#define SETSMPFREQ 7 /* Set sample frequency */ - -#endif /* _SDL_mintaudio_mcsh_h */ diff --git a/src/audio/mint/SDL_mintaudio_stfa.c b/src/audio/mint/SDL_mintaudio_stfa.c deleted file mode 100644 index 4a581e0351..0000000000 --- a/src/audio/mint/SDL_mintaudio_stfa.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MiNT audio driver - using XBIOS functions (STFA driver) - - Patrice Mandin -*/ - -/* Mint includes */ -#include -#include -#include - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" - -#include "../../video/ataricommon/SDL_atarimxalloc_c.h" -#include "../../video/ataricommon/SDL_atarisuper.h" - -#include "SDL_mintaudio.h" -#include "SDL_mintaudio_stfa.h" - -/*--- Defines ---*/ - -#define MINT_AUDIO_DRIVER_NAME "mint_stfa" - -/* Debug print info */ -#define DEBUG_NAME "audio:stfa: " -#if 0 -#define DEBUG_PRINT(what) \ - { \ - printf what; \ - } -#else -#define DEBUG_PRINT(what) -#endif - -/*--- Static variables ---*/ - -static long cookie_snd, cookie_mch; -static cookie_stfa_t *cookie_stfa; - -static const int freqs[16]={ - 4995, 6269, 7493, 8192, - 9830, 10971, 12538, 14985, - 16384, 19819, 21943, 24576, - 30720, 32336, 43885, 49152 -}; - -/*--- Audio driver functions ---*/ - -static void Mint_CloseAudio(_THIS); -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_LockAudio(_THIS); -static void Mint_UnlockAudio(_THIS); - -/* To check/init hardware audio */ -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec); - -/*--- Audio driver bootstrap functions ---*/ - -static int Audio_Available(void) -{ - long dummy; - const char *envr = SDL_getenv("SDL_AUDIODRIVER"); - - /* Check if user asked a different audio driver */ - if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { - DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); - return(0); - } - - /* Cookie _MCH present ? if not, assume ST machine */ - if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) { - cookie_mch = MCH_ST; - } - - /* Cookie _SND present ? if not, assume ST machine */ - if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) { - cookie_snd = SND_PSG; - } - - /* Cookie STFA present ? */ - if (Getcookie(C_STFA, &dummy) != C_FOUND) { - DEBUG_PRINT((DEBUG_NAME "no STFA audio\n")); - return(0); - } - cookie_stfa = (cookie_stfa_t *) dummy; - - SDL_MintAudio_stfa = cookie_stfa; - - DEBUG_PRINT((DEBUG_NAME "STFA audio available!\n")); - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = Mint_OpenAudio; - this->CloseAudio = Mint_CloseAudio; - this->LockAudio = Mint_LockAudio; - this->UnlockAudio = Mint_UnlockAudio; - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap MINTAUDIO_STFA_bootstrap = { - MINT_AUDIO_DRIVER_NAME, "MiNT STFA audio driver", - Audio_Available, Audio_CreateDevice -}; - -static void Mint_LockAudio(_THIS) -{ - void *oldpile; - - /* Stop replay */ - oldpile=(void *)Super(0); - cookie_stfa->sound_enable=STFA_PLAY_DISABLE; - SuperToUser(oldpile); -} - -static void Mint_UnlockAudio(_THIS) -{ - void *oldpile; - - /* Restart replay */ - oldpile=(void *)Super(0); - cookie_stfa->sound_enable=STFA_PLAY_ENABLE|STFA_PLAY_REPEAT; - SuperToUser(oldpile); -} - -static void Mint_CloseAudio(_THIS) -{ - void *oldpile; - - /* Stop replay */ - oldpile=(void *)Super(0); - cookie_stfa->sound_enable=STFA_PLAY_DISABLE; - SuperToUser(oldpile); - - /* Wait if currently playing sound */ - while (SDL_MintAudio_mutex != 0) { - } - - /* Clear buffers */ - if (SDL_MintAudio_audiobuf[0]) { - Mfree(SDL_MintAudio_audiobuf[0]); - SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL; - } -} - -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec) -{ - int i; - - DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - if (spec->channels > 2) { - spec->channels = 2; /* no more than stereo! */ - } - - /* Check formats available */ - MINTAUDIO_freqcount=0; - for (i=0;i<16;i++) { - SDL_MintAudio_AddFrequency(this, freqs[i], 0, i, -1); - } - -#if 1 - for (i=0; ifreq); - spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; - - DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - return 0; -} - -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec) -{ - void *buffer; - void *oldpile; - - buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf]; - - oldpile=(void *)Super(0); - - /* Stop replay */ - cookie_stfa->sound_enable=STFA_PLAY_DISABLE; - - /* Select replay format */ - cookie_stfa->sound_control = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor; - if ((spec->format & 0xff)==8) { - cookie_stfa->sound_control |= STFA_FORMAT_8BIT; - } else { - cookie_stfa->sound_control |= STFA_FORMAT_16BIT; - } - if (spec->channels==2) { - cookie_stfa->sound_control |= STFA_FORMAT_STEREO; - } else { - cookie_stfa->sound_control |= STFA_FORMAT_MONO; - } - if ((spec->format & 0x8000)!=0) { - cookie_stfa->sound_control |= STFA_FORMAT_SIGNED; - } else { - cookie_stfa->sound_control |= STFA_FORMAT_UNSIGNED; - } - if ((spec->format & 0x1000)!=0) { - cookie_stfa->sound_control |= STFA_FORMAT_BIGENDIAN; - } else { - cookie_stfa->sound_control |= STFA_FORMAT_LITENDIAN; - } - - /* Set buffer */ - cookie_stfa->sound_start = (unsigned long) buffer; - cookie_stfa->sound_end = (unsigned long) (buffer + spec->size); - - /* Set interrupt */ - cookie_stfa->stfa_it = SDL_MintAudio_StfaInterrupt; - - /* Restart replay */ - cookie_stfa->sound_enable=STFA_PLAY_ENABLE|STFA_PLAY_REPEAT; - - SuperToUser(oldpile); - - DEBUG_PRINT((DEBUG_NAME "hardware initialized\n")); -} - -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - SDL_MintAudio_device = this; - - /* Check audio capabilities */ - if (Mint_CheckAudio(this, spec)==-1) { - return -1; - } - - SDL_CalculateAudioSpec(spec); - - /* Allocate memory for audio buffers in DMA-able RAM */ - DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); - - SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); - if (SDL_MintAudio_audiobuf[0]==NULL) { - SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); - return (-1); - } - SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; - SDL_MintAudio_numbuf=0; - SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); - SDL_MintAudio_audiosize = spec->size; - SDL_MintAudio_mutex = 0; - - DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); - DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); - - SDL_MintAudio_CheckFpu(); - - /* Setup audio hardware */ - Mint_InitAudio(this, spec); - - return(1); /* We don't use threaded audio */ -} diff --git a/src/audio/mint/SDL_mintaudio_stfa.h b/src/audio/mint/SDL_mintaudio_stfa.h deleted file mode 100644 index 1789b4bb41..0000000000 --- a/src/audio/mint/SDL_mintaudio_stfa.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - STFA control structure - - Patrice Mandin -*/ - -#ifndef _SDL_mintaudio_stfa_h -#define _SDL_mintaudio_stfa_h - -/*--- Defines ---*/ - -#define STFA_PLAY_ENABLE (1<<0) -#define STFA_PLAY_DISABLE (0<<0) -#define STFA_PLAY_REPEAT (1<<1) -#define STFA_PLAY_SINGLE (0<<1) - -#define STFA_FORMAT_SIGNED (1<<15) -#define STFA_FORMAT_UNSIGNED (0<<15) -#define STFA_FORMAT_STEREO (1<<14) -#define STFA_FORMAT_MONO (0<<14) -#define STFA_FORMAT_16BIT (1<<13) -#define STFA_FORMAT_8BIT (0<<13) -#define STFA_FORMAT_LITENDIAN (1<<9) -#define STFA_FORMAT_BIGENDIAN (0<<9) -#define STFA_FORMAT_FREQ_MASK 0x0f -enum { - STFA_FORMAT_F4995=0, - STFA_FORMAT_F6269, - STFA_FORMAT_F7493, - STFA_FORMAT_F8192, - - STFA_FORMAT_F9830, - STFA_FORMAT_F10971, - STFA_FORMAT_F12538, - STFA_FORMAT_F14985, - - STFA_FORMAT_F16384, - STFA_FORMAT_F19819, - STFA_FORMAT_F21943, - STFA_FORMAT_F24576, - - STFA_FORMAT_F30720, - STFA_FORMAT_F32336, - STFA_FORMAT_F43885, - STFA_FORMAT_F49152 -}; - -/*--- Types ---*/ - -typedef struct { - unsigned short sound_enable; - unsigned short sound_control; - unsigned short sound_output; - unsigned long sound_start; - unsigned long sound_current; - unsigned long sound_end; - unsigned short version; - void *old_vbl; - void *old_timera; - unsigned long old_mfp_status; - void *new_vbl; - void *drivers_list; - void *play_stop; - unsigned short frequency; - void *set_frequency; - unsigned short frequency_threshold; - unsigned short *custom_freq_table; - unsigned short stfa_on_off; - void *new_drivers_list; - unsigned long old_bit_2_of_cookie_snd; - void (*stfa_it)(void); -} cookie_stfa_t; - -#endif /* _SDL_mintaudio_stfa_h */ diff --git a/src/audio/mint/SDL_mintaudio_xbios.c b/src/audio/mint/SDL_mintaudio_xbios.c deleted file mode 100644 index 42a0d4a2f9..0000000000 --- a/src/audio/mint/SDL_mintaudio_xbios.c +++ /dev/null @@ -1,490 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MiNT audio driver - using XBIOS functions (Falcon) - - Patrice Mandin, Didier Méquignon -*/ - -#include -#include - -/* Mint includes */ -#include -#include -#include - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_sysaudio.h" - -#include "../../video/ataricommon/SDL_atarimxalloc_c.h" -#include "../../video/ataricommon/SDL_atarisuper.h" - -#include "SDL_mintaudio.h" -#include "SDL_mintaudio_dma8.h" - -/*--- Defines ---*/ - -#define MINT_AUDIO_DRIVER_NAME "mint_xbios" - -/* Debug print info */ -#define DEBUG_NAME "audio:xbios: " -#if 0 -#define DEBUG_PRINT(what) \ - { \ - printf what; \ - } -#else -#define DEBUG_PRINT(what) -#endif - -/*--- Static variables ---*/ - -static long cookie_snd; - -/*--- Audio driver functions ---*/ - -static void Mint_CloseAudio(_THIS); -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_LockAudio(_THIS); -static void Mint_UnlockAudio(_THIS); - -/* To check/init hardware audio */ -static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec); -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec); - -/*--- Audio driver bootstrap functions ---*/ - -static int Audio_Available(void) -{ -/* unsigned long dummy;*/ - const char *envr = SDL_getenv("SDL_AUDIODRIVER"); - - /*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);*/ - SDL_MintAudio_mint_present = SDL_FALSE; - - /* We can't use XBIOS in interrupt with Magic, don't know about thread */ - /*if (Getcookie(C_MagX, &dummy) == C_FOUND) { - return(0); - }*/ - - /* Check if user asked a different audio driver */ - if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { - DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); - return(0); - } - - /* Cookie _SND present ? if not, assume ST machine */ - if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) { - cookie_snd = SND_PSG; - } - - /* Check if we have 16 bits audio */ - if ((cookie_snd & SND_16BIT)==0) { - DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n")); - return(0); - } - - /* Check if audio is lockable */ - if (Locksnd()!=1) { - DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n")); - return(0); - } - - Unlocksnd(); - - DEBUG_PRINT((DEBUG_NAME "XBIOS audio available!\n")); - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = Mint_OpenAudio; - this->CloseAudio = Mint_CloseAudio; - this->LockAudio = Mint_LockAudio; - this->UnlockAudio = Mint_UnlockAudio; - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap MINTAUDIO_XBIOS_bootstrap = { - MINT_AUDIO_DRIVER_NAME, "MiNT XBIOS audio driver", - Audio_Available, Audio_CreateDevice -}; - -static void Mint_LockAudio(_THIS) -{ - /* Stop replay */ - Buffoper(0); -} - -static void Mint_UnlockAudio(_THIS) -{ - /* Restart replay */ - Buffoper(SB_PLA_ENA|SB_PLA_RPT); -} - -static void Mint_CloseAudio(_THIS) -{ - /* Stop replay */ - SDL_MintAudio_WaitThread(); - Buffoper(0); - - if (!SDL_MintAudio_mint_present) { - /* Uninstall interrupt */ - Jdisint(MFP_DMASOUND); - } - - /* Wait if currently playing sound */ - while (SDL_MintAudio_mutex != 0) { - } - - /* Clear buffers */ - if (SDL_MintAudio_audiobuf[0]) { - Mfree(SDL_MintAudio_audiobuf[0]); - SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL; - } - - /* Unlock sound system */ - Unlocksnd(); -} - -/* Falcon XBIOS implementation of Devconnect() is buggy with external clock */ -static void Devconnect2(int src, int dst, int sclk, int pre) -{ - static const unsigned short MASK1[3] = { 0, 0x6000, 0 }; - static const unsigned short MASK2[4] = { 0xFFF0, 0xFF8F, 0xF0FF, 0x0FFF }; - static const unsigned short INDEX1[4] = { 1, 3, 5, 7 }; - static const unsigned short INDEX2[4] = { 0, 2, 4, 6 }; - unsigned short sync_div,dev_ctrl,dest_ctrl; - void *oldstack; - - if (dst==0) { - return; - } - - oldstack=(void *)Super(0); - - dev_ctrl = DMAAUDIO_IO.dev_ctrl; - dest_ctrl = DMAAUDIO_IO.dest_ctrl; - dev_ctrl &= MASK2[src]; - - if (src==ADC) { - dev_ctrl |= MASK1[sclk]; - } else { - dev_ctrl |= (INDEX1[sclk] << (src<<4)); - } - - if (dst & DMAREC) { - dest_ctrl &= 0xFFF0; - dest_ctrl |= INDEX1[src]; - } - - if (dst & DSPRECV) { - dest_ctrl &= 0xFF8F; - dest_ctrl |= (INDEX1[src]<<4); - } - - if (dst & EXTOUT) { - dest_ctrl &= 0xF0FF; - dest_ctrl |= (INDEX1[src]<<8); - } - - if (dst & DAC) { - dev_ctrl &= 0x0FFF; - dev_ctrl |= MASK1[sclk]; - dest_ctrl &= 0x0FFF; - dest_ctrl |= (INDEX2[src]<<12); - } - - sync_div = DMAAUDIO_IO.sync_div; - if (sclk==CLKEXT) { - pre<<=8; - sync_div &= 0xF0FF; - } else { - sync_div &= 0xFFF0; - } - sync_div |= pre; - - DMAAUDIO_IO.dev_ctrl = dev_ctrl; - DMAAUDIO_IO.dest_ctrl = dest_ctrl; - DMAAUDIO_IO.sync_div = sync_div; - - SuperToUser(oldstack); -} - -static void Mint_CheckExternalClock(_THIS) -{ -#define SIZE_BUF_CLOCK_MEASURE (44100/10) - - char *buffer; - int i, j; - - /* DSP present with its GPIO port ? */ - if ((cookie_snd & SND_DSP)==0) { - return; - } - - buffer = Atari_SysMalloc(SIZE_BUF_CLOCK_MEASURE, MX_STRAM); - if (buffer==NULL) { - DEBUG_PRINT((DEBUG_NAME "Not enough memory for the measure\n")); - return; - } - SDL_memset(buffer, 0, SIZE_BUF_CLOCK_MEASURE); - - Buffoper(0); - Settracks(0,0); - Setmontracks(0); - Setmode(MONO8); - Jdisint(MFP_TIMERA); - - for (i=0; i<2; i++) { - Gpio(GPIO_SET,7); /* DSP port gpio outputs */ - Gpio(GPIO_WRITE,2+i); /* 22.5792/24.576 MHz for 44.1/48KHz */ - Devconnect2(DMAPLAY, DAC, CLKEXT, CLK50K); /* Matrix and clock source */ - Setbuffer(0, buffer, buffer + SIZE_BUF_CLOCK_MEASURE); /* Set buffer */ - Xbtimer(XB_TIMERA, 5, 38, SDL_MintAudio_XbiosInterruptMeasureClock); /* delay mode timer A, prediv /64, 1KHz */ - Jenabint(MFP_TIMERA); - SDL_MintAudio_clocktics = 0; - Buffoper(SB_PLA_ENA); - usleep(110000); - - if((Buffoper(-1) & 1)==0) { - if (SDL_MintAudio_clocktics) { - unsigned long khz; - - khz = ((SIZE_BUF_CLOCK_MEASURE/SDL_MintAudio_clocktics) +1) & 0xFFFFFFFE; - DEBUG_PRINT((DEBUG_NAME "measure %d: freq=%lu KHz\n", i+1, khz)); - - if(khz==44) { - for (j=1; j<4; j++) { - SDL_MintAudio_AddFrequency(this, MASTERCLOCK_44K/(MASTERPREDIV_FALCON*(1<format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - if (spec->channels > 2) { - spec->channels = 2; /* no more than stereo! */ - } - - spec->format |= 0x8000; /* Audio is always signed */ - if ((spec->format & 0x00ff)==16) { - spec->format |= 0x1000; /* Audio is always big endian */ - spec->channels=2; /* 16 bits always stereo */ - } - - MINTAUDIO_freqcount=0; - - /* Add external clocks if present */ - Mint_CheckExternalClock(this); - - /* Standard clocks */ - for (i=1;i<12;i++) { - /* Remove unusable Falcon codec predivisors */ - if ((i==6) || (i==8) || (i==10)) { - continue; - } - SDL_MintAudio_AddFrequency(this, MASTERCLOCK_FALCON1/(MASTERPREDIV_FALCON*(i+1)), MASTERCLOCK_FALCON1, i, -1); - } - -#if 1 - for (i=0; ifreq); - spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; - - DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff)); - DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0))); - DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0))); - DEBUG_PRINT(("channels=%d, ", spec->channels)); - DEBUG_PRINT(("freq=%d\n", spec->freq)); - - return 0; -} - -static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec) -{ - int channels_mode, prediv; - void *buffer; - - /* Stop currently playing sound */ - SDL_MintAudio_quit_thread = SDL_FALSE; - SDL_MintAudio_thread_finished = SDL_TRUE; - SDL_MintAudio_WaitThread(); - Buffoper(0); - - /* Set replay tracks */ - Settracks(0,0); - Setmontracks(0); - - /* Select replay format */ - channels_mode=STEREO16; - switch (spec->format & 0xff) { - case 8: - if (spec->channels==2) { - channels_mode=STEREO8; - } else { - channels_mode=MONO8; - } - break; - } - if (Setmode(channels_mode)<0) { - DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n")); - } - - prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor; - if (MINTAUDIO_frequencies[MINTAUDIO_numfreq].gpio_bits != -1) { - Gpio(GPIO_SET,7); /* DSP port gpio outputs */ - Gpio(GPIO_WRITE, MINTAUDIO_frequencies[MINTAUDIO_numfreq].gpio_bits); - Devconnect2(DMAPLAY, DAC|EXTOUT, CLKEXT, prediv); - } else { - Devconnect2(DMAPLAY, DAC, CLK25M, prediv); - } - - /* Set buffer */ - buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf]; - if (Setbuffer(0, buffer, buffer + spec->size)<0) { - DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n")); - } - - if (SDL_MintAudio_mint_present) { - SDL_MintAudio_thread_pid = tfork(SDL_MintAudio_Thread, 0); - } else { - /* Install interrupt */ - Jdisint(MFP_DMASOUND); - /*Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt);*/ - Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt); - Jenabint(MFP_DMASOUND); - - if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) { - DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n")); - } - } - - /* Go */ - Buffoper(SB_PLA_ENA|SB_PLA_RPT); - DEBUG_PRINT((DEBUG_NAME "hardware initialized\n")); -} - -static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - /* Lock sound system */ - if (Locksnd()!=1) { - SDL_SetError("Mint_OpenAudio: Audio system already in use"); - return(-1); - } - - SDL_MintAudio_device = this; - - /* Check audio capabilities */ - if (Mint_CheckAudio(this, spec)==-1) { - return -1; - } - - SDL_CalculateAudioSpec(spec); - - /* Allocate memory for audio buffers in DMA-able RAM */ - DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size)); - - SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM); - if (SDL_MintAudio_audiobuf[0]==NULL) { - SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); - return (-1); - } - SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; - SDL_MintAudio_numbuf=0; - SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); - SDL_MintAudio_audiosize = spec->size; - SDL_MintAudio_mutex = 0; - - DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); - DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); - - SDL_MintAudio_CheckFpu(); - - /* Setup audio hardware */ - Mint_InitAudio(this, spec); - - return(1); /* We don't use SDL threaded audio */ -} diff --git a/src/audio/mme/SDL_mmeaudio.c b/src/audio/mme/SDL_mmeaudio.c deleted file mode 100644 index 64a0ecc36d..0000000000 --- a/src/audio/mme/SDL_mmeaudio.c +++ /dev/null @@ -1,264 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Tru64 UNIX MME support */ -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_mmeaudio.h" - -static BOOL inUse[NUM_BUFFERS]; - -/* Audio driver functions */ -static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void MME_WaitAudio(_THIS); -static Uint8 *MME_GetAudioBuf(_THIS); -static void MME_PlayAudio(_THIS); -static void MME_WaitDone(_THIS); -static void MME_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ -static int Audio_Available(void) -{ - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - if ( device ) { - if ( device->hidden ) { - SDL_free(device->hidden); - device->hidden = NULL; - } - SDL_free(device); - device = NULL; - } -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - -/* Initialize all variables that we clean on shutdown */ - this = SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - /* Set the function pointers */ - this->OpenAudio = MME_OpenAudio; - this->WaitAudio = MME_WaitAudio; - this->PlayAudio = MME_PlayAudio; - this->GetAudioBuf = MME_GetAudioBuf; - this->WaitDone = MME_WaitDone; - this->CloseAudio = MME_CloseAudio; - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap MMEAUDIO_bootstrap = { - "waveout", "Tru64 MME WaveOut", - Audio_Available, Audio_CreateDevice -}; - -static void SetMMerror(char *function, MMRESULT code) -{ - int len; - char errbuf[MAXERRORLENGTH]; - - SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function); - len = SDL_strlen(errbuf); - waveOutGetErrorText(code, errbuf+len, MAXERRORLENGTH-len); - SDL_SetError("%s",errbuf); -} - -static void CALLBACK MME_CALLBACK(HWAVEOUT hwo, - UINT uMsg, - DWORD dwInstance, - LPARAM dwParam1, - LPARAM dwParam2) -{ - WAVEHDR *wp = (WAVEHDR *) dwParam1; - - if ( uMsg == WOM_DONE ) - inUse[wp->dwUser] = FALSE; -} - -static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - MMRESULT result; - int i; - - mixbuf = NULL; - - /* Set basic WAVE format parameters */ - shm = mmeAllocMem(sizeof(*shm)); - if ( shm == NULL ) { - SDL_SetError("Out of memory: shm"); - return(-1); - } - shm->sound = 0; - shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM; - - /* Determine the audio parameters from the AudioSpec */ - switch ( spec->format & 0xFF ) { - case 8: - /* Unsigned 8 bit audio data */ - spec->format = AUDIO_U8; - shm->wFmt.wBitsPerSample = 8; - break; - case 16: - /* Signed 16 bit audio data */ - spec->format = AUDIO_S16; - shm->wFmt.wBitsPerSample = 16; - break; - default: - SDL_SetError("Unsupported audio format"); - return(-1); - } - - shm->wFmt.wf.nChannels = spec->channels; - shm->wFmt.wf.nSamplesPerSec = spec->freq; - shm->wFmt.wf.nBlockAlign = - shm->wFmt.wf.nChannels * shm->wFmt.wBitsPerSample / 8; - shm->wFmt.wf.nAvgBytesPerSec = - shm->wFmt.wf.nSamplesPerSec * shm->wFmt.wf.nBlockAlign; - - /* Check the buffer size -- minimum of 1/4 second (word aligned) */ - if ( spec->samples < (spec->freq/4) ) - spec->samples = ((spec->freq/4)+3)&~3; - - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); - - /* Open the audio device */ - result = waveOutOpen(&(shm->sound), - WAVE_MAPPER, - &(shm->wFmt.wf), - MME_CALLBACK, - NULL, - (CALLBACK_FUNCTION|WAVE_OPEN_SHAREABLE)); - if ( result != MMSYSERR_NOERROR ) { - SetMMerror("waveOutOpen()", result); - return(-1); - } - - /* Create the sound buffers */ - mixbuf = (Uint8 *)mmeAllocBuffer(NUM_BUFFERS * (spec->size)); - if ( mixbuf == NULL ) { - SDL_SetError("Out of memory: mixbuf"); - return(-1); - } - - for (i = 0; i < NUM_BUFFERS; i++) { - shm->wHdr[i].lpData = &mixbuf[i * (spec->size)]; - shm->wHdr[i].dwBufferLength = spec->size; - shm->wHdr[i].dwFlags = 0; - shm->wHdr[i].dwUser = i; - shm->wHdr[i].dwLoops = 0; /* loop control counter */ - shm->wHdr[i].lpNext = NULL; /* reserved for driver */ - shm->wHdr[i].reserved = 0; - inUse[i] = FALSE; - } - next_buffer = 0; - return 0; -} - -static void MME_WaitAudio(_THIS) -{ - while ( inUse[next_buffer] ) { - mmeWaitForCallbacks(); - mmeProcessCallbacks(); - } -} - -static Uint8 *MME_GetAudioBuf(_THIS) -{ - Uint8 *retval; - - inUse[next_buffer] = TRUE; - retval = (Uint8 *)(shm->wHdr[next_buffer].lpData); - return retval; -} - -static void MME_PlayAudio(_THIS) -{ - /* Queue it up */ - waveOutWrite(shm->sound, &(shm->wHdr[next_buffer]), sizeof(WAVEHDR)); - next_buffer = (next_buffer+1)%NUM_BUFFERS; -} - -static void MME_WaitDone(_THIS) -{ - MMRESULT result; - int i; - - if ( shm->sound ) { - for (i = 0; i < NUM_BUFFERS; i++) - while ( inUse[i] ) { - mmeWaitForCallbacks(); - mmeProcessCallbacks(); - } - result = waveOutReset(shm->sound); - if ( result != MMSYSERR_NOERROR ) - SetMMerror("waveOutReset()", result); - mmeProcessCallbacks(); - } -} - -static void MME_CloseAudio(_THIS) -{ - MMRESULT result; - - if ( mixbuf ) { - result = mmeFreeBuffer(mixbuf); - if (result != MMSYSERR_NOERROR ) - SetMMerror("mmeFreeBuffer", result); - mixbuf = NULL; - } - - if ( shm ) { - if ( shm->sound ) { - result = waveOutClose(shm->sound); - if (result != MMSYSERR_NOERROR ) - SetMMerror("waveOutClose()", result); - mmeProcessCallbacks(); - } - result = mmeFreeMem(shm); - if (result != MMSYSERR_NOERROR ) - SetMMerror("mmeFreeMem()", result); - shm = NULL; - } -} - diff --git a/src/audio/mme/SDL_mmeaudio.h b/src/audio/mme/SDL_mmeaudio.h deleted file mode 100644 index 6bfaed32e0..0000000000 --- a/src/audio/mme/SDL_mmeaudio.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer */ - -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this -#define NUM_BUFFERS 2 - -struct SharedMem { - HWAVEOUT sound; - WAVEHDR wHdr[NUM_BUFFERS]; - PCMWAVEFORMAT wFmt; -}; - -struct SDL_PrivateAudioData { - Uint8 *mixbuf; /* The raw allocated mixing buffer */ - struct SharedMem *shm; - int next_buffer; -}; - -#define shm (this->hidden->shm) -#define mixbuf (this->hidden->mixbuf) -#define next_buffer (this->hidden->next_buffer) -/* Old variable names */ -#endif /* _SDL_lowaudio_h */ diff --git a/src/audio/nas/SDL_nasaudio.c b/src/audio/nas/SDL_nasaudio.c index a561e62984..4e3dc0a136 100644 --- a/src/audio/nas/SDL_nasaudio.c +++ b/src/audio/nas/SDL_nasaudio.c @@ -1,30 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org - - This driver was written by: - Erik Inge Bolsø - knan@mo.himolde.no + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_NAS + /* Allow access to a raw mixing buffer */ #include @@ -32,20 +29,14 @@ #include "SDL_timer.h" #include "SDL_audio.h" +#include "SDL_loadso.h" #include "../SDL_audiomem.h" #include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" #include "SDL_nasaudio.h" -#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC -#include "SDL_loadso.h" -#endif - -/* The tag name used by artsc audio */ -#define NAS_DRIVER_NAME "nas" - static struct SDL_PrivateAudioData *this2 = NULL; + static void (*NAS_AuCloseServer) (AuServer *); static void (*NAS_AuNextEvent) (AuServer *, AuBool, AuEvent *); static AuBool(*NAS_AuDispatchEvent) (AuServer *, AuEvent *); @@ -119,8 +110,8 @@ LoadNASLibrary(void) nas_handle = SDL_LoadObject(nas_library); if (nas_handle == NULL) { /* Copy error string so we can use it in a new SDL_SetError(). */ - char *origerr = SDL_GetError(); - size_t len = SDL_strlen(origerr) + 1; + const char *origerr = SDL_GetError(); + const size_t len = SDL_strlen(origerr) + 1; char *err = (char *) alloca(len); SDL_strlcpy(err, origerr, len); retval = -1; @@ -152,272 +143,257 @@ LoadNASLibrary(void) #endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */ - -/* Audio driver functions */ -static int NAS_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void NAS_WaitAudio(_THIS); -static void NAS_PlayAudio(_THIS); -static Uint8 *NAS_GetAudioBuf(_THIS); -static void NAS_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - if (LoadNASLibrary() == 0) { - AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (!aud) { - UnloadNASLibrary(); - return 0; - } - NAS_AuCloseServer(aud); - UnloadNASLibrary(); - return 1; - } - return 0; -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) +/* This function waits until it is possible to write a full sound buffer */ +static void +NAS_WaitDevice(_THIS) { - UnloadNASLibrary(); - SDL_free(device->hidden); - SDL_free(device); + while (this->hidden->buf_free < this->hidden->mixlen) { + AuEvent ev; + NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); + NAS_AuDispatchEvent(this->hidden->aud, &ev); + } } -static SDL_AudioDevice *Audio_CreateDevice(int devindex) +static void +NAS_PlayDevice(_THIS) { - SDL_AudioDevice *this; - - if (LoadNASLibrary() < 0) { - return NULL; - } - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return NULL; - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = NAS_OpenAudio; - this->WaitAudio = NAS_WaitAudio; - this->PlayAudio = NAS_PlayAudio; - this->GetAudioBuf = NAS_GetAudioBuf; - this->CloseAudio = NAS_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} + while (this->hidden->mixlen > this->hidden->buf_free) { + /* + * We think the buffer is full? Yikes! Ask the server for events, + * in the hope that some of them is LowWater events telling us more + * of the buffer is free now than what we think. + */ + AuEvent ev; + NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); + NAS_AuDispatchEvent(this->hidden->aud, &ev); + } + this->hidden->buf_free -= this->hidden->mixlen; -AudioBootStrap NAS_bootstrap = { - NAS_DRIVER_NAME, "Network Audio System", - Audio_Available, Audio_CreateDevice -}; + /* Write the audio data */ + NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, + this->hidden->mixlen, this->hidden->mixbuf, AuFalse, + NULL); -/* This function waits until it is possible to write a full sound buffer */ -static void NAS_WaitAudio(_THIS) -{ - while ( this->hidden->buf_free < this->hidden->mixlen ) { - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } -} + this->hidden->written += this->hidden->mixlen; -static void NAS_PlayAudio(_THIS) -{ - while (this->hidden->mixlen > this->hidden->buf_free) { /* We think the buffer is full? Yikes! Ask the server for events, - in the hope that some of them is LowWater events telling us more - of the buffer is free now than what we think. */ - AuEvent ev; - NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev); - NAS_AuDispatchEvent(this->hidden->aud, &ev); - } - this->hidden->buf_free -= this->hidden->mixlen; - - /* Write the audio data */ - NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, this->hidden->mixlen, this->hidden->mixbuf, AuFalse, NULL); - - this->hidden->written += this->hidden->mixlen; - #ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); + fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen); #endif } -static Uint8 *NAS_GetAudioBuf(_THIS) +static Uint8 * +NAS_GetDeviceBuf(_THIS) { - return(this->hidden->mixbuf); + return (this->hidden->mixbuf); } -static void NAS_CloseAudio(_THIS) +static void +NAS_CloseDevice(_THIS) { - if ( this->hidden->mixbuf != NULL ) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - } - if ( this->hidden->aud ) { - NAS_AuCloseServer(this->hidden->aud); - this->hidden->aud = 0; - } + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->aud) { + NAS_AuCloseServer(this->hidden->aud); + this->hidden->aud = 0; + } + SDL_free(this->hidden); + this2 = this->hidden = NULL; + } } -static unsigned char sdlformat_to_auformat(unsigned int fmt) +static unsigned char +sdlformat_to_auformat(unsigned int fmt) { - switch (fmt) - { + switch (fmt) { case AUDIO_U8: - return AuFormatLinearUnsigned8; + return AuFormatLinearUnsigned8; case AUDIO_S8: - return AuFormatLinearSigned8; + return AuFormatLinearSigned8; case AUDIO_U16LSB: - return AuFormatLinearUnsigned16LSB; + return AuFormatLinearUnsigned16LSB; case AUDIO_U16MSB: - return AuFormatLinearUnsigned16MSB; + return AuFormatLinearUnsigned16MSB; case AUDIO_S16LSB: - return AuFormatLinearSigned16LSB; + return AuFormatLinearSigned16LSB; case AUDIO_S16MSB: - return AuFormatLinearSigned16MSB; + return AuFormatLinearSigned16MSB; } - return AuNone; + return AuNone; } static AuBool -event_handler(AuServer* aud, AuEvent* ev, AuEventHandlerRec* hnd) +event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) { - switch (ev->type) { - case AuEventTypeElementNotify: { - AuElementNotifyEvent* event = (AuElementNotifyEvent *)ev; - - switch (event->kind) { - case AuElementNotifyKindLowWater: - if (this2->buf_free >= 0) { - this2->really += event->num_bytes; - gettimeofday(&this2->last_tv, 0); - this2->buf_free += event->num_bytes; - } else { - this2->buf_free = event->num_bytes; - } - break; - case AuElementNotifyKindState: - switch (event->cur_state) { - case AuStatePause: - if (event->reason != AuReasonUser) { - if (this2->buf_free >= 0) { - this2->really += event->num_bytes; - gettimeofday(&this2->last_tv, 0); - this2->buf_free += event->num_bytes; - } else { - this2->buf_free = event->num_bytes; - } - } - break; - } - } - } - } - return AuTrue; + switch (ev->type) { + case AuEventTypeElementNotify: + { + AuElementNotifyEvent *event = (AuElementNotifyEvent *) ev; + + switch (event->kind) { + case AuElementNotifyKindLowWater: + if (this2->buf_free >= 0) { + this2->really += event->num_bytes; + gettimeofday(&this2->last_tv, 0); + this2->buf_free += event->num_bytes; + } else { + this2->buf_free = event->num_bytes; + } + break; + case AuElementNotifyKindState: + switch (event->cur_state) { + case AuStatePause: + if (event->reason != AuReasonUser) { + if (this2->buf_free >= 0) { + this2->really += event->num_bytes; + gettimeofday(&this2->last_tv, 0); + this2->buf_free += event->num_bytes; + } else { + this2->buf_free = event->num_bytes; + } + } + break; + } + } + } + } + return AuTrue; } static AuDeviceID find_device(_THIS, int nch) { /* These "Au" things are all macros, not functions... */ - int i; - for (i = 0; i < AuServerNumDevices(this->hidden->aud); i++) { - if ((AuDeviceKind(AuServerDevice(this->hidden->aud, i)) == - AuComponentKindPhysicalOutput) && - AuDeviceNumTracks(AuServerDevice(this->hidden->aud, i)) == nch) { - return AuDeviceIdentifier(AuServerDevice(this->hidden->aud, i)); - } - } - return AuNone; + int i; + for (i = 0; i < AuServerNumDevices(this->hidden->aud); i++) { + if ((AuDeviceKind(AuServerDevice(this->hidden->aud, i)) == + AuComponentKindPhysicalOutput) && + AuDeviceNumTracks(AuServerDevice(this->hidden->aud, i)) == nch) { + return AuDeviceIdentifier(AuServerDevice(this->hidden->aud, i)); + } + } + return AuNone; } -static int NAS_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +NAS_OpenDevice(_THIS, const char *devname, int iscapture) { - AuElement elms[3]; - int buffer_size; - Uint16 test_format, format; - - this->hidden->mixbuf = NULL; - - /* Try for a closest match on audio format */ - format = 0; - for ( test_format = SDL_FirstAudioFormat(spec->format); - ! format && test_format; ) { - format = sdlformat_to_auformat(test_format); - - if (format == AuNone) { - test_format = SDL_NextAudioFormat(); - } - } - if ( format == 0 ) { - SDL_SetError("Couldn't find any hardware audio formats"); - return(-1); - } - spec->format = test_format; - - this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (this->hidden->aud == 0) - { - SDL_SetError("Couldn't open connection to NAS server"); - return (-1); - } - - this->hidden->dev = find_device(this, spec->channels); - if ((this->hidden->dev == AuNone) || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, NULL)))) { - NAS_AuCloseServer(this->hidden->aud); - this->hidden->aud = 0; - SDL_SetError("Couldn't find a fitting playback device on NAS server"); - return (-1); - } - - buffer_size = spec->freq; - if (buffer_size < 4096) - buffer_size = 4096; - - if (buffer_size > 32768) - buffer_size = 32768; /* So that the buffer won't get unmanageably big. */ - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - this2 = this->hidden; - - /* These "Au" things without a NAS_ prefix are macros, not functions... */ - AuMakeElementImportClient(elms, spec->freq, format, spec->channels, AuTrue, - buffer_size, buffer_size / 4, 0, NULL); - AuMakeElementExportDevice(elms+1, 0, this->hidden->dev, spec->freq, - AuUnlimitedSamples, 0, NULL); - NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, 2, elms, NULL); - NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, this->hidden->flow, - event_handler, (AuPointer) NULL); - - NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL); - - /* Allocate mixing buffer */ - this->hidden->mixlen = spec->size; - this->hidden->mixbuf = (Uint8 *)SDL_AllocAudioMem(this->hidden->mixlen); - if ( this->hidden->mixbuf == NULL ) { - return(-1); - } - SDL_memset(this->hidden->mixbuf, spec->silence, spec->size); - - /* Get the parent process id (we're the parent of the audio thread) */ - this->hidden->parent = getpid(); - - /* We're ready to rock and roll. :-) */ - return(0); + AuElement elms[3]; + int buffer_size; + SDL_AudioFormat test_format, format; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Try for a closest match on audio format */ + format = 0; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { + format = sdlformat_to_auformat(test_format); + if (format == AuNone) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { + NAS_CloseDevice(this); + return SDL_SetError("NAS: Couldn't find any hardware audio formats"); + } + this->spec.format = test_format; + + this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); + if (this->hidden->aud == 0) { + NAS_CloseDevice(this); + return SDL_SetError("NAS: Couldn't open connection to NAS server"); + } + + this->hidden->dev = find_device(this, this->spec.channels); + if ((this->hidden->dev == AuNone) + || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, 0)))) { + NAS_CloseDevice(this); + return SDL_SetError("NAS: Couldn't find a fitting device on NAS server"); + } + + buffer_size = this->spec.freq; + if (buffer_size < 4096) + buffer_size = 4096; + + if (buffer_size > 32768) + buffer_size = 32768; /* So that the buffer won't get unmanageably big. */ + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + this2 = this->hidden; + + AuMakeElementImportClient(elms, this->spec.freq, format, + this->spec.channels, AuTrue, buffer_size, + buffer_size / 4, 0, NULL); + AuMakeElementExportDevice(elms + 1, 0, this->hidden->dev, this->spec.freq, + AuUnlimitedSamples, 0, NULL); + NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, 2, elms, + NULL); + NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, + this->hidden->flow, event_handler, + (AuPointer) NULL); + + NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + NAS_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* We're ready to rock and roll. :-) */ + return 0; } + +static void +NAS_Deinitialize(void) +{ + UnloadNASLibrary(); +} + +static int +NAS_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadNASLibrary() < 0) { + return 0; + } else { + AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); + if (aud == NULL) { + SDL_SetError("NAS: AuOpenServer() failed (no audio server?)"); + return 0; + } + NAS_AuCloseServer(aud); + } + + /* Set the function pointers */ + impl->OpenDevice = NAS_OpenDevice; + impl->PlayDevice = NAS_PlayDevice; + impl->WaitDevice = NAS_WaitDevice; + impl->GetDeviceBuf = NAS_GetDeviceBuf; + impl->CloseDevice = NAS_CloseDevice; + impl->Deinitialize = NAS_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: is this true? */ + + return 1; /* this audio target is available. */ +} + +AudioBootStrap NAS_bootstrap = { + "nas", "Network Audio System", NAS_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_NAS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/nas/SDL_nasaudio.h b/src/audio/nas/SDL_nasaudio.h index 1c09630880..85bd761dd4 100644 --- a/src/audio/nas/SDL_nasaudio.h +++ b/src/audio/nas/SDL_nasaudio.h @@ -1,27 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org - - This driver was written by: - Erik Inge Bolsø - knan@mo.himolde.no + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -37,26 +32,25 @@ #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - AuServer* aud; - AuFlowID flow; - AuDeviceID dev; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; - - int written; - int really; - int bps; - struct timeval last_tv; - int buf_free; +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + AuServer *aud; + AuFlowID flow; + AuDeviceID dev; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; + + int written; + int really; + int bps; + struct timeval last_tv; + int buf_free; }; #endif /* _SDL_nasaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/nds/SDL_ndsaudio.c b/src/audio/nds/SDL_ndsaudio.c deleted file mode 100644 index afe141a567..0000000000 --- a/src/audio/nds/SDL_ndsaudio.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer */ -#include -#include "SDL.h" -#include "SDL_endian.h" -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "SDL_ndsaudio.h" -#include "soundcommon.h" - - -/* Audio driver functions */ -static int NDS_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void NDS_WaitAudio(_THIS); -static void NDS_PlayAudio(_THIS); -static Uint8 *NDS_GetAudioBuf(_THIS); -static void NDS_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -u32 framecounter = 0,soundoffset = 0; -static SDL_AudioDevice *sdl_nds_audiodevice; - -//void SoundMixCallback(void *stream,u32 size) -//{ -// //printf("SoundMixCallback\n"); -// -// Uint8 *buffer; -// -// buffer = sdl_nds_audiodevice->hidden->mixbuf; -// memset(buffer, sdl_nds_audiodevice->spec.silence, size); -// -// if (!sdl_nds_audiodevice->paused){ -// -// -// //if (sdl_nds_audiodevice->convert.needed) { -// // int silence; -// -// // if (sdl_nds_audiodevice->convert.src_format == AUDIO_U8 ) { -// // silence = 0x80; -// // } else { -// // silence = 0; -// // } -// // memset(sdl_nds_audiodevice->convert.buf, silence, sdl_nds_audiodevice->convert.len); -// // sdl_nds_audiodevice->spec.callback(sdl_nds_audiodevice->spec.userdata, -// // (Uint8 *)sdl_nds_audiodevice->convert.buf,sdl_nds_audiodevice->convert.len); -// // SDL_ConvertAudio(&sdl_nds_audiodevice->convert); -// // memcpy(buffer, sdl_nds_audiodevice->convert.buf, sdl_nds_audiodevice->convert.len_cvt); -// //} else -// { -// sdl_nds_audiodevice->spec.callback(sdl_nds_audiodevice->spec.userdata, buffer, size); -// //memcpy((Sint16 *)stream,buffer, size); -// } -// -// } -// -// if(soundsystem->format == 8) -// { -// int i; -// s32 *buffer32 = (s32 *)buffer; -// s32 *stream32 = (s32 *)stream; -// for(i=0;i buffer 16bit -// //if (buffer[i] &0x80) -// //((Sint16*)stream)[i] = 0xff00 | buffer[i]; -// ((Sint16*)stream)[i] = (buffer[i] - 128) << 8; -// -// //else -// // ((Sint16*)stream)[i] = buffer[i]; -// } -// //register signed char *pSrc =buffer; -// //register short *pDest =stream; -// //int x; -// // for (x=size; x>0; x--) -// // { -// // register short temp = (((short)*pSrc)-128)<<8; -// // pSrc++; -// // *pDest++ = temp; -// // } -// -// //memcpy((Sint16 *)stream,buffer, size); -// } -//} - -void SoundMixCallback(void *stream,u32 len) -{ - SDL_AudioDevice *audio = (SDL_AudioDevice *)sdl_nds_audiodevice; - - /* Silence the buffer, since it's ours */ - SDL_memset(stream, audio->spec.silence, len); - - /* Only do soemthing if audio is enabled */ - if ( ! audio->enabled ) - return; - - if ( ! audio->paused ) { - if ( audio->convert.needed ) { - //fprintf(stderr,"converting audio\n"); - SDL_mutexP(audio->mixer_lock); - (*audio->spec.callback)(audio->spec.userdata, - (Uint8 *)audio->convert.buf,audio->convert.len); - SDL_mutexV(audio->mixer_lock); - SDL_ConvertAudio(&audio->convert); - SDL_memcpy(stream,audio->convert.buf,audio->convert.len_cvt); - } else { - SDL_mutexP(audio->mixer_lock); - (*audio->spec.callback)(audio->spec.userdata, - (Uint8 *)stream, len); - SDL_mutexV(audio->mixer_lock); - } - } - return; -} -void MixSound(void) -{ - int remain; - - if(soundsystem->format == 8) - { - if((soundsystem->soundcursor + soundsystem->numsamples) > soundsystem->buffersize) - { - SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor],soundsystem->buffersize - soundsystem->soundcursor); - remain = soundsystem->numsamples - (soundsystem->buffersize - soundsystem->soundcursor); - SoundMixCallback(soundsystem->mixbuffer,remain); - } - else - { - SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor],soundsystem->numsamples); - } - } - else - { - if((soundsystem->soundcursor + soundsystem->numsamples) > (soundsystem->buffersize >> 1)) - { - SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor << 1],(soundsystem->buffersize >> 1) - soundsystem->soundcursor); - remain = soundsystem->numsamples - ((soundsystem->buffersize >> 1) - soundsystem->soundcursor); - SoundMixCallback(soundsystem->mixbuffer,remain); - } - else - { - SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor << 1],soundsystem->numsamples); - } - } -} - -void InterruptHandler(void) -{ - framecounter++; -} -void FiFoHandler(void) -{ - u32 command; - while ( !(REG_IPC_FIFO_CR & (IPC_FIFO_RECV_EMPTY)) ) - { - command = REG_IPC_FIFO_RX; - - switch(command) - { - case FIFO_NONE: - break; - case UPDATEON_ARM9: - REG_IME = 0; - MixSound(); - REG_IME = 1; - SendCommandToArm7(MIXCOMPLETE_ONARM9); - break; - } - } -} - - - - - -static int Audio_Available(void) -{ - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = NDS_OpenAudio; - this->WaitAudio = NDS_WaitAudio; - this->PlayAudio = NDS_PlayAudio; - this->GetAudioBuf = NDS_GetAudioBuf; - this->CloseAudio = NDS_CloseAudio; - - this->free = Audio_DeleteDevice; -//fprintf(stderr,"Audio_CreateDevice\n"); - return this; -} - -AudioBootStrap NDSAUD_bootstrap = { - "nds", "NDS audio", - Audio_Available, Audio_CreateDevice -}; - - -void static NDS_WaitAudio(_THIS) -{ - //printf("NDS_WaitAudio\n"); -} - -static void NDS_PlayAudio(_THIS) -{ - //printf("playing audio\n"); - if (this->paused) - return; - -} - -static Uint8 *NDS_GetAudioBuf(_THIS) -{ - return NULL;//(this->hidden->mixbuf); -} - -static void NDS_CloseAudio(_THIS) -{ -/* if ( this->hidden->mixbuf != NULL ) { - SDL_FreeAudioMem(this->hidden->mixbuf); - this->hidden->mixbuf = NULL; - }*/ -} - -static int NDS_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - //printf("NDS_OpenAudio\n"); - int format = 0; - //switch(spec->format&0xff) { - //case 8: spec->format = AUDIO_S8;format=8; break; - //case 16: spec->format = AUDIO_S16LSB;format=16; break; - //default: - // SDL_SetError("Unsupported audio format"); - // return(-1); - //} - switch (spec->format&~0x1000) { - case AUDIO_S8: - /* Signed 8-bit audio supported */ - format=8; - break; - case AUDIO_U8: - spec->format ^= 0x80;format=8; - break; - case AUDIO_U16: - /* Unsigned 16-bit audio unsupported, convert to S16 */ - spec->format ^=0x8000;format=16; - case AUDIO_S16: - /* Signed 16-bit audio supported */ - format=16; - break; - } - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); - - /* Allocate mixing buffer */ - //this->hidden->mixlen = spec->size; - //this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); - //if ( this->hidden->mixbuf == NULL ) { - // SDL_SetError("Out of Memory"); - // return(-1); - //} - - SDL_NDSAudio_mutex = 0; - sdl_nds_audiodevice=this; - - irqInit(); - irqSet(IRQ_VBLANK,&InterruptHandler); - irqSet(IRQ_FIFO_NOT_EMPTY,&FiFoHandler); - irqEnable(IRQ_FIFO_NOT_EMPTY); - - REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR | IPC_FIFO_RECV_IRQ; - - - - SoundSystemInit(spec->freq,spec->size,0,format); - SoundStartMixer(); - - - return(1); -} diff --git a/src/audio/nds/SDL_ndsaudio.h b/src/audio/nds/SDL_ndsaudio.h deleted file mode 100644 index cb6d1ea858..0000000000 --- a/src/audio/nds/SDL_ndsaudio.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - //Uint8 *mixbuf; - //Uint32 mixlen; -}; -unsigned short SDL_NDSAudio_mutex=0; - - -#endif /* _SDL_lowaudio_h */ diff --git a/src/audio/nds/sound9.c b/src/audio/nds/sound9.c deleted file mode 100644 index 59c1c219ae..0000000000 --- a/src/audio/nds/sound9.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" -#include "SDL_stdinc.h" - -#include "soundcommon.h" - -void SoundSystemInit(u32 rate,u32 buffersize,u8 channel,u8 format) -{ - soundsystem->rate = rate; - - if(format == 8) - soundsystem->buffersize = buffersize; - else if(format == 16) - soundsystem->buffersize = buffersize * sizeof(short); - - soundsystem->mixbuffer = (s8*)SDL_malloc(soundsystem->buffersize); - //soundsystem->soundbuffer = soundsystem->mixbuffer; - soundsystem->format = format; - soundsystem->channel = channel; - soundsystem->prevtimer = 0; - soundsystem->soundcursor = 0; - soundsystem->numsamples = 0; - soundsystem->period = 0x1000000 / rate; - soundsystem->cmd = INIT; -} - -void SoundStartMixer(void) -{ - soundsystem->cmd |= MIX; -} - -void SendCommandToArm7(u32 command) -{ - while (REG_IPC_FIFO_CR & IPC_FIFO_SEND_FULL); - if (REG_IPC_FIFO_CR & IPC_FIFO_ERROR) - { - REG_IPC_FIFO_CR |= IPC_FIFO_SEND_CLEAR; - } - - REG_IPC_FIFO_TX = command; -} diff --git a/src/audio/nds/soundcommon.h b/src/audio/nds/soundcommon.h deleted file mode 100644 index d38e37cf68..0000000000 --- a/src/audio/nds/soundcommon.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef __SOUNDCOMMON_H -#define __SOUNDCOMMON_H - -#include - -#define CLOCK (1 << 25) - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - NONE = 0, - INIT = 1, - MIX = 2, - MIXING = 4, - STOP = 8 -}CommandType; - -typedef enum -{ - FIFO_NONE = 0, - UPDATEON_ARM9 = 1, - MIXCOMPLETE_ONARM9 = 2, -}FifoType; - -typedef struct -{ - s8 *mixbuffer;//,*soundbuffer; - u32 rate; - u32 buffersize; - u32 cmd; - u8 channel,format; - u32 soundcursor,numsamples; - s32 prevtimer; - s16 period; -}S_SoundSystem; - -#define soundsystem ((S_SoundSystem*)((u32)(IPC)+sizeof(TransferRegion))) - -#ifdef ARM9 -extern void SoundSystemInit(u32 rate,u32 buffersize,u8 channel,u8 format); -extern void SoundStartMixer(void); -extern void SendCommandToArm7(u32 command); -#else -extern void SoundVBlankIrq(void); -extern void SoundSwapAndMix(void); -extern void SoundSetTimer(int period); -extern void SoundFifoHandler(void); -extern void SendCommandToArm9(u32 command); -#endif - -#ifdef __cplusplus -} -#endif -#endif diff --git a/src/audio/nto/SDL_nto_audio.c b/src/audio/nto/SDL_nto_audio.c deleted file mode 100644 index f951825460..0000000000 --- a/src/audio/nto/SDL_nto_audio.c +++ /dev/null @@ -1,507 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "SDL_nto_audio.h" - -/* The tag name used by NTO audio */ -#define DRIVER_NAME "qsa-nto" - -/* default channel communication parameters */ -#define DEFAULT_CPARAMS_RATE 22050 -#define DEFAULT_CPARAMS_VOICES 1 -/* FIXME: need to add in the near future flexible logic with frag_size and frags count */ -#define DEFAULT_CPARAMS_FRAG_SIZE 4096 -#define DEFAULT_CPARAMS_FRAGS_MIN 1 -#define DEFAULT_CPARAMS_FRAGS_MAX 1 - -/* Open the audio device for playback, and don't block if busy */ -#define OPEN_FLAGS SND_PCM_OPEN_PLAYBACK - -#define QSA_NO_WORKAROUNDS 0x00000000 -#define QSA_MMAP_WORKAROUND 0x00000001 - -struct BuggyCards -{ - char* cardname; - unsigned long bugtype; -}; - -#define QSA_WA_CARDS 3 - -struct BuggyCards buggycards[QSA_WA_CARDS]= -{ - {"Sound Blaster Live!", QSA_MMAP_WORKAROUND}, - {"Vortex 8820", QSA_MMAP_WORKAROUND}, - {"Vortex 8830", QSA_MMAP_WORKAROUND}, -}; - -/* Audio driver functions */ -static void NTO_ThreadInit(_THIS); -static int NTO_OpenAudio(_THIS, SDL_AudioSpec* spec); -static void NTO_WaitAudio(_THIS); -static void NTO_PlayAudio(_THIS); -static Uint8* NTO_GetAudioBuf(_THIS); -static void NTO_CloseAudio(_THIS); - -/* card names check to apply the workarounds */ -static int NTO_CheckBuggyCards(_THIS, unsigned long checkfor) -{ - char scardname[33]; - int it; - - if (snd_card_get_name(cardno, scardname, 32)<0) - { - return 0; - } - - for (it=0; itchannel = SND_PCM_CHANNEL_PLAYBACK; - cpars->mode = SND_PCM_MODE_BLOCK; - cpars->start_mode = SND_PCM_START_DATA; - cpars->stop_mode = SND_PCM_STOP_STOP; - cpars->format.format = SND_PCM_SFMT_S16_LE; - cpars->format.interleave = 1; - cpars->format.rate = DEFAULT_CPARAMS_RATE; - cpars->format.voices = DEFAULT_CPARAMS_VOICES; - cpars->buf.block.frag_size = DEFAULT_CPARAMS_FRAG_SIZE; - cpars->buf.block.frags_min = DEFAULT_CPARAMS_FRAGS_MIN; - cpars->buf.block.frags_max = DEFAULT_CPARAMS_FRAGS_MAX; -} - -static int NTO_AudioAvailable(void) -{ - /* See if we can open a nonblocking channel. - Return value '1' means we can. - Return value '0' means we cannot. */ - - int available; - int rval; - snd_pcm_t* handle; - - available = 0; - handle = NULL; - - rval = snd_pcm_open_preferred(&handle, NULL, NULL, OPEN_FLAGS); - - if (rval >= 0) - { - available = 1; - - if ((rval = snd_pcm_close(handle)) < 0) - { - SDL_SetError("NTO_AudioAvailable(): snd_pcm_close failed: %s\n", snd_strerror(rval)); - available = 0; - } - } - else - { - SDL_SetError("NTO_AudioAvailable(): there are no available audio devices.\n"); - } - - return (available); -} - -static void NTO_DeleteAudioDevice(SDL_AudioDevice *device) -{ - if ((device)&&(device->hidden)) - { - SDL_free(device->hidden); - } - if (device) - { - SDL_free(device); - } -} - -static SDL_AudioDevice* NTO_CreateAudioDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if (this) - { - SDL_memset(this, 0, sizeof(SDL_AudioDevice)); - this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(struct SDL_PrivateAudioData)); - } - if ((this == NULL) || (this->hidden == NULL)) - { - SDL_OutOfMemory(); - if (this) - { - SDL_free(this); - } - return (0); - } - SDL_memset(this->hidden, 0, sizeof(struct SDL_PrivateAudioData)); - audio_handle = NULL; - - /* Set the function pointers */ - this->ThreadInit = NTO_ThreadInit; - this->OpenAudio = NTO_OpenAudio; - this->WaitAudio = NTO_WaitAudio; - this->PlayAudio = NTO_PlayAudio; - this->GetAudioBuf = NTO_GetAudioBuf; - this->CloseAudio = NTO_CloseAudio; - - this->free = NTO_DeleteAudioDevice; - - return this; -} - -AudioBootStrap QNXNTOAUDIO_bootstrap = -{ - DRIVER_NAME, "QNX6 QSA-NTO Audio", - NTO_AudioAvailable, - NTO_CreateAudioDevice -}; - -/* This function waits until it is possible to write a full sound buffer */ -static void NTO_WaitAudio(_THIS) -{ - fd_set wfds; - int selectret; - - FD_ZERO(&wfds); - FD_SET(audio_fd, &wfds); - - do { - selectret=select(audio_fd + 1, NULL, &wfds, NULL, NULL); - switch (selectret) - { - case -1: - case 0: SDL_SetError("NTO_WaitAudio(): select() failed: %s\n", strerror(errno)); - return; - default: if (FD_ISSET(audio_fd, &wfds)) - { - return; - } - break; - } - } while(1); -} - -static void NTO_PlayAudio(_THIS) -{ - int written, rval; - int towrite; - void* pcmbuffer; - - if (!this->enabled) - { - return; - } - - towrite = this->spec.size; - pcmbuffer = pcm_buf; - - /* Write the audio data, checking for EAGAIN (buffer full) and underrun */ - do { - written = snd_pcm_plugin_write(audio_handle, pcm_buf, towrite); - if (written != towrite) - { - if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) - { - /* Let a little CPU time go by and try to write again */ - SDL_Delay(1); - /* if we wrote some data */ - towrite -= written; - pcmbuffer += written * this->spec.channels; - continue; - } - else - { - if ((errno == EINVAL) || (errno == EIO)) - { - SDL_memset(&cstatus, 0, sizeof(cstatus)); - cstatus.channel = SND_PCM_CHANNEL_PLAYBACK; - if ((rval = snd_pcm_plugin_status(audio_handle, &cstatus)) < 0) - { - SDL_SetError("NTO_PlayAudio(): snd_pcm_plugin_status failed: %s\n", snd_strerror(rval)); - return; - } - if ((cstatus.status == SND_PCM_STATUS_UNDERRUN) || (cstatus.status == SND_PCM_STATUS_READY)) - { - if ((rval = snd_pcm_plugin_prepare(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0) - { - SDL_SetError("NTO_PlayAudio(): snd_pcm_plugin_prepare failed: %s\n", snd_strerror(rval)); - return; - } - } - continue; - } - else - { - return; - } - } - } - else - { - /* we wrote all remaining data */ - towrite -= written; - pcmbuffer += written * this->spec.channels; - } - } while ((towrite > 0) && (this->enabled)); - - /* If we couldn't write, assume fatal error for now */ - if (towrite != 0) - { - this->enabled = 0; - } - - return; -} - -static Uint8* NTO_GetAudioBuf(_THIS) -{ - return pcm_buf; -} - -static void NTO_CloseAudio(_THIS) -{ - int rval; - - this->enabled = 0; - - if (audio_handle != NULL) - { - if ((rval = snd_pcm_plugin_flush(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0) - { - SDL_SetError("NTO_CloseAudio(): snd_pcm_plugin_flush failed: %s\n", snd_strerror(rval)); - return; - } - if ((rval = snd_pcm_close(audio_handle)) < 0) - { - SDL_SetError("NTO_CloseAudio(): snd_pcm_close failed: %s\n",snd_strerror(rval)); - return; - } - audio_handle = NULL; - } -} - -static int NTO_OpenAudio(_THIS, SDL_AudioSpec* spec) -{ - int rval; - int format; - Uint16 test_format; - int found; - - audio_handle = NULL; - this->enabled = 0; - - if (pcm_buf != NULL) - { - SDL_FreeAudioMem(pcm_buf); - pcm_buf = NULL; - } - - /* initialize channel transfer parameters to default */ - NTO_InitAudioParams(&cparams); - - /* Open the audio device */ - rval = snd_pcm_open_preferred(&audio_handle, &cardno, &deviceno, OPEN_FLAGS); - if (rval < 0) - { - SDL_SetError("NTO_OpenAudio(): snd_pcm_open failed: %s\n", snd_strerror(rval)); - return (-1); - } - - if (!NTO_CheckBuggyCards(this, QSA_MMAP_WORKAROUND)) - { - /* enable count status parameter */ - if ((rval = snd_pcm_plugin_set_disable(audio_handle, PLUGIN_DISABLE_MMAP)) < 0) - { - SDL_SetError("snd_pcm_plugin_set_disable failed: %s\n", snd_strerror(rval)); - return (-1); - } - } - - /* Try for a closest match on audio format */ - format = 0; - /* can't use format as SND_PCM_SFMT_U8 = 0 in nto */ - found = 0; - - for (test_format=SDL_FirstAudioFormat(spec->format); !found ;) - { - /* if match found set format to equivalent ALSA format */ - switch (test_format) - { - case AUDIO_U8: - format = SND_PCM_SFMT_U8; - found = 1; - break; - case AUDIO_S8: - format = SND_PCM_SFMT_S8; - found = 1; - break; - case AUDIO_S16LSB: - format = SND_PCM_SFMT_S16_LE; - found = 1; - break; - case AUDIO_S16MSB: - format = SND_PCM_SFMT_S16_BE; - found = 1; - break; - case AUDIO_U16LSB: - format = SND_PCM_SFMT_U16_LE; - found = 1; - break; - case AUDIO_U16MSB: - format = SND_PCM_SFMT_U16_BE; - found = 1; - break; - default: - break; - } - - if (!found) - { - test_format = SDL_NextAudioFormat(); - } - } - - /* assumes test_format not 0 on success */ - if (test_format == 0) - { - SDL_SetError("NTO_OpenAudio(): Couldn't find any hardware audio formats"); - return (-1); - } - - spec->format = test_format; - - /* Set the audio format */ - cparams.format.format = format; - - /* Set mono or stereo audio (currently only two channels supported) */ - cparams.format.voices = spec->channels; - - /* Set rate */ - cparams.format.rate = spec->freq; - - /* Setup the transfer parameters according to cparams */ - rval = snd_pcm_plugin_params(audio_handle, &cparams); - if (rval < 0) - { - SDL_SetError("NTO_OpenAudio(): snd_pcm_channel_params failed: %s\n", snd_strerror(rval)); - return (-1); - } - - /* Make sure channel is setup right one last time */ - SDL_memset(&csetup, 0x00, sizeof(csetup)); - csetup.channel = SND_PCM_CHANNEL_PLAYBACK; - if (snd_pcm_plugin_setup(audio_handle, &csetup) < 0) - { - SDL_SetError("NTO_OpenAudio(): Unable to setup playback channel\n"); - return -1; - } - - - /* Calculate the final parameters for this audio specification */ - SDL_CalculateAudioSpec(spec); - - pcm_len = spec->size; - - if (pcm_len==0) - { - pcm_len = csetup.buf.block.frag_size * spec->channels * (snd_pcm_format_width(format)/8); - } - - /* Allocate memory to the audio buffer and initialize with silence (Note that - buffer size must be a multiple of fragment size, so find closest multiple) - */ - pcm_buf = (Uint8*)SDL_AllocAudioMem(pcm_len); - if (pcm_buf == NULL) - { - SDL_SetError("NTO_OpenAudio(): pcm buffer allocation failed\n"); - return (-1); - } - SDL_memset(pcm_buf, spec->silence, pcm_len); - - /* get the file descriptor */ - if ((audio_fd = snd_pcm_file_descriptor(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0) - { - SDL_SetError("NTO_OpenAudio(): snd_pcm_file_descriptor failed with error code: %s\n", snd_strerror(rval)); - return (-1); - } - - /* Trigger audio playback */ - rval = snd_pcm_plugin_prepare(audio_handle, SND_PCM_CHANNEL_PLAYBACK); - if (rval < 0) - { - SDL_SetError("snd_pcm_plugin_prepare failed: %s\n", snd_strerror(rval)); - return (-1); - } - - this->enabled = 1; - - /* Get the parent process id (we're the parent of the audio thread) */ - parent = getpid(); - - /* We're really ready to rock and roll. :-) */ - return (0); -} diff --git a/src/audio/nto/SDL_nto_audio.h b/src/audio/nto/SDL_nto_audio.h deleted file mode 100644 index cfd592c96b..0000000000 --- a/src/audio/nto/SDL_nto_audio.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef __SDL_NTO_AUDIO_H__ -#define __SDL_NTO_AUDIO_H__ - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* The audio device handle */ - int cardno; - int deviceno; - snd_pcm_t* audio_handle; - - /* The audio file descriptor */ - int audio_fd; - - /* The parent process id, to detect when application quits */ - pid_t parent; - - /* Raw mixing buffer */ - Uint8* pcm_buf; - Uint32 pcm_len; - - /* QSA parameters */ - snd_pcm_channel_status_t cstatus; - snd_pcm_channel_params_t cparams; - snd_pcm_channel_setup_t csetup; -}; - -#define cardno (this->hidden->cardno) -#define deviceno (this->hidden->deviceno) -#define audio_handle (this->hidden->audio_handle) -#define audio_fd (this->hidden->audio_fd) -#define parent (this->hidden->parent) -#define pcm_buf (this->hidden->pcm_buf) -#define pcm_len (this->hidden->pcm_len) -#define cstatus (this->hidden->cstatus) -#define cparams (this->hidden->cparams) -#define csetup (this->hidden->csetup) - -#endif /* __SDL_NTO_AUDIO_H__ */ diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c index 6270d8c0a8..5a18b45e56 100644 --- a/src/audio/paudio/SDL_paudio.c +++ b/src/audio/paudio/SDL_paudio.c @@ -1,28 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Carsten Griwodz - griff@kom.tu-darmstadt.de - - based on linux/SDL_dspaudio.c by Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_PAUDIO + /* Allow access to a raw mixing buffer */ #include @@ -30,16 +29,17 @@ #include #include #include +#include #include #include "SDL_timer.h" #include "SDL_audio.h" +#include "SDL_stdinc.h" #include "../SDL_audiomem.h" #include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" #include "SDL_paudio.h" -#define DEBUG_AUDIO 1 +#define DEBUG_AUDIO 0 /* A conflict within AIX 4.3.3 headers and probably others as well. * I guess nobody ever uses audio... Shame over AIX header files. */ @@ -47,135 +47,140 @@ #undef BIG_ENDIAN #include -/* The tag name used by paud audio */ -#define Paud_DRIVER_NAME "paud" - /* Open the audio device for playback, and don't block if busy */ -/* #define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) */ -#define OPEN_FLAGS O_WRONLY +/* #define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) */ +#define OPEN_FLAGS O_WRONLY + +/* Get the name of the audio device we use for output */ -/* Audio driver functions */ -static int Paud_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void Paud_WaitAudio(_THIS); -static void Paud_PlayAudio(_THIS); -static Uint8 *Paud_GetAudioBuf(_THIS); -static void Paud_CloseAudio(_THIS); +#ifndef _PATH_DEV_DSP +#define _PATH_DEV_DSP "/dev/%caud%c/%c" +#endif -/* Audio driver bootstrap functions */ +static char devsettings[][3] = { + {'p', '0', '1'}, {'p', '0', '2'}, {'p', '0', '3'}, {'p', '0', '4'}, + {'p', '1', '1'}, {'p', '1', '2'}, {'p', '1', '3'}, {'p', '1', '4'}, + {'p', '2', '1'}, {'p', '2', '2'}, {'p', '2', '3'}, {'p', '2', '4'}, + {'p', '3', '1'}, {'p', '3', '2'}, {'p', '3', '3'}, {'p', '3', '4'}, + {'b', '0', '1'}, {'b', '0', '2'}, {'b', '0', '3'}, {'b', '0', '4'}, + {'b', '1', '1'}, {'b', '1', '2'}, {'b', '1', '3'}, {'b', '1', '4'}, + {'b', '2', '1'}, {'b', '2', '2'}, {'b', '2', '3'}, {'b', '2', '4'}, + {'b', '3', '1'}, {'b', '3', '2'}, {'b', '3', '3'}, {'b', '3', '4'}, + {'\0', '\0', '\0'} +}; -static int Audio_Available(void) +static int +OpenUserDefinedDevice(char *path, int maxlen, int flags) { - int fd; - int available; - - available = 0; - fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0); - if ( fd >= 0 ) { - available = 1; - close(fd); - } - return(available); -} + const char *audiodev; + int fd; -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); + /* Figure out what our audio device is */ + if ((audiodev = SDL_getenv("SDL_PATH_DSP")) == NULL) { + audiodev = SDL_getenv("AUDIODEV"); + } + if (audiodev == NULL) { + return -1; + } + fd = open(audiodev, flags, 0); + if (path != NULL) { + SDL_strlcpy(path, audiodev, maxlen); + path[maxlen - 1] = '\0'; + } + return fd; } -static SDL_AudioDevice *Audio_CreateDevice(int devindex) +static int +OpenAudioPath(char *path, int maxlen, int flags, int classic) { - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - audio_fd = -1; - - /* Set the function pointers */ - this->OpenAudio = Paud_OpenAudio; - this->WaitAudio = Paud_WaitAudio; - this->PlayAudio = Paud_PlayAudio; - this->GetAudioBuf = Paud_GetAudioBuf; - this->CloseAudio = Paud_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} + struct stat sb; + int cycle = 0; + int fd = OpenUserDefinedDevice(path, maxlen, flags); -AudioBootStrap Paud_bootstrap = { - Paud_DRIVER_NAME, "AIX Paudio", - Audio_Available, Audio_CreateDevice -}; + if (fd != -1) { + return fd; + } + + /* !!! FIXME: do we really need a table here? */ + while (devsettings[cycle][0] != '\0') { + char audiopath[1024]; + SDL_snprintf(audiopath, SDL_arraysize(audiopath), + _PATH_DEV_DSP, + devsettings[cycle][0], + devsettings[cycle][1], devsettings[cycle][2]); + + if (stat(audiopath, &sb) == 0) { + fd = open(audiopath, flags, 0); + if (fd > 0) { + if (path != NULL) { + SDL_strlcpy(path, audiopath, maxlen); + } + return fd; + } + } + } + return -1; +} /* This function waits until it is possible to write a full sound buffer */ -static void Paud_WaitAudio(_THIS) +static void +PAUDIO_WaitDevice(_THIS) { fd_set fdset; /* See if we need to use timed audio synchronization */ - if ( frame_ticks ) { + if (this->hidden->frame_ticks) { /* Use timer for general audio synchronization */ Sint32 ticks; - ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS; - if ( ticks > 0 ) { - SDL_Delay(ticks); + ticks = + ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - + FUDGE_TICKS; + if (ticks > 0) { + SDL_Delay(ticks); } } else { - audio_buffer paud_bufinfo; + audio_buffer paud_bufinfo; /* Use select() for audio synchronization */ struct timeval timeout; FD_ZERO(&fdset); - FD_SET(audio_fd, &fdset); + FD_SET(this->hidden->audio_fd, &fdset); - if ( ioctl(audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0 ) { + if (ioctl(this->hidden->audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0) { #ifdef DEBUG_AUDIO fprintf(stderr, "Couldn't get audio buffer information\n"); #endif - timeout.tv_sec = 10; + timeout.tv_sec = 10; timeout.tv_usec = 0; } else { - long ms_in_buf = paud_bufinfo.write_buf_time; - timeout.tv_sec = ms_in_buf/1000; - ms_in_buf = ms_in_buf - timeout.tv_sec*1000; - timeout.tv_usec = ms_in_buf*1000; + long ms_in_buf = paud_bufinfo.write_buf_time; + timeout.tv_sec = ms_in_buf / 1000; + ms_in_buf = ms_in_buf - timeout.tv_sec * 1000; + timeout.tv_usec = ms_in_buf * 1000; #ifdef DEBUG_AUDIO - fprintf( stderr, - "Waiting for write_buf_time=%ld,%ld\n", - timeout.tv_sec, - timeout.tv_usec ); + fprintf(stderr, + "Waiting for write_buf_time=%ld,%ld\n", + timeout.tv_sec, timeout.tv_usec); #endif - } + } #ifdef DEBUG_AUDIO fprintf(stderr, "Waiting for audio to get ready\n"); #endif - if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) { - const char *message = "Audio timeout - buggy audio driver? (disabled)"; + if (select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, &timeout) + <= 0) { + const char *message = + "Audio timeout - buggy audio driver? (disabled)"; /* - * In general we should never print to the screen, + * In general we should never print to the screen, * but in this case we have no other way of letting * the user know what happened. */ fprintf(stderr, "SDL: %s - %s\n", strerror(errno), message); this->enabled = 0; /* Don't try to close - may hang */ - audio_fd = -1; + this->hidden->audio_fd = -1; #ifdef DEBUG_AUDIO fprintf(stderr, "Done disabling audio\n"); #endif @@ -186,326 +191,355 @@ static void Paud_WaitAudio(_THIS) } } -static void Paud_PlayAudio(_THIS) +static void +PAUDIO_PlayDevice(_THIS) { - int written; - - /* Write the audio data, checking for EAGAIN on broken audio drivers */ - do { - written = write(audio_fd, mixbuf, mixlen); - if ( (written < 0) && ((errno == 0) || (errno == EAGAIN)) ) { - SDL_Delay(1); /* Let a little CPU time go by */ - } - } while ( (written < 0) && - ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)) ); - - /* If timer synchronization is enabled, set the next write frame */ - if ( frame_ticks ) { - next_frame += frame_ticks; - } - - /* If we couldn't write, assume fatal error for now */ - if ( written < 0 ) { - this->enabled = 0; - } + int written = 0; + const Uint8 *mixbuf = this->hidden->mixbuf; + const size_t mixlen = this->hidden->mixlen; + + /* Write the audio data, checking for EAGAIN on broken audio drivers */ + do { + written = write(this->hidden->audio_fd, mixbuf, mixlen); + if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) { + SDL_Delay(1); /* Let a little CPU time go by */ + } + } while ((written < 0) && + ((errno == 0) || (errno == EAGAIN) || (errno == EINTR))); + + /* If timer synchronization is enabled, set the next write frame */ + if (this->hidden->frame_ticks) { + this->hidden->next_frame += this->hidden->frame_ticks; + } + + /* If we couldn't write, assume fatal error for now */ + if (written < 0) { + this->enabled = 0; + } #ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote %d bytes of audio data\n", written); + fprintf(stderr, "Wrote %d bytes of audio data\n", written); #endif } -static Uint8 *Paud_GetAudioBuf(_THIS) +static Uint8 * +PAUDIO_GetDeviceBuf(_THIS) { - return mixbuf; + return this->hidden->mixbuf; } -static void Paud_CloseAudio(_THIS) +static void +PAUDIO_CloseDevice(_THIS) { - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( audio_fd >= 0 ) { - close(audio_fd); - audio_fd = -1; - } + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->audio_fd >= 0) { + close(this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + SDL_free(this->hidden); + this->hidden = NULL; + } } -static int Paud_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +PAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) { - char audiodev[1024]; - int format; - int bytes_per_sample; - Uint16 test_format; - audio_init paud_init; - audio_buffer paud_bufinfo; - audio_status paud_status; - audio_control paud_control; - audio_change paud_change; - - /* Reset the timer synchronization flag */ - frame_ticks = 0.0; - - /* Open the audio device */ - audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0); - if ( audio_fd < 0 ) { - SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); - return -1; - } - - /* - * We can't set the buffer size - just ask the device for the maximum - * that we can have. - */ - if ( ioctl(audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0 ) { - SDL_SetError("Couldn't get audio buffer information"); - return -1; - } - - mixbuf = NULL; - - if ( spec->channels > 1 ) - spec->channels = 2; - else - spec->channels = 1; - - /* - * Fields in the audio_init structure: - * - * Ignored by us: - * - * paud.loadpath[LOAD_PATH]; * DSP code to load, MWave chip only? - * paud.slot_number; * slot number of the adapter - * paud.device_id; * adapter identification number - * - * Input: - * - * paud.srate; * the sampling rate in Hz - * paud.bits_per_sample; * 8, 16, 32, ... - * paud.bsize; * block size for this rate - * paud.mode; * ADPCM, PCM, MU_LAW, A_LAW, SOURCE_MIX - * paud.channels; * 1=mono, 2=stereo - * paud.flags; * FIXED - fixed length data - * * LEFT_ALIGNED, RIGHT_ALIGNED (var len only) - * * TWOS_COMPLEMENT - 2's complement data - * * SIGNED - signed? comment seems wrong in sys/audio.h - * * BIG_ENDIAN - * paud.operation; * PLAY, RECORD - * - * Output: - * - * paud.flags; * PITCH - pitch is supported - * * INPUT - input is supported - * * OUTPUT - output is supported - * * MONITOR - monitor is supported - * * VOLUME - volume is supported - * * VOLUME_DELAY - volume delay is supported - * * BALANCE - balance is supported - * * BALANCE_DELAY - balance delay is supported - * * TREBLE - treble control is supported - * * BASS - bass control is supported - * * BESTFIT_PROVIDED - best fit returned - * * LOAD_CODE - DSP load needed - * paud.rc; * NO_PLAY - DSP code can't do play requests - * * NO_RECORD - DSP code can't do record requests - * * INVALID_REQUEST - request was invalid - * * CONFLICT - conflict with open's flags - * * OVERLOADED - out of DSP MIPS or memory - * paud.position_resolution; * smallest increment for position - */ - - paud_init.srate = spec->freq; - paud_init.mode = PCM; - paud_init.operation = PLAY; - paud_init.channels = spec->channels; - - /* Try for a closest match on audio format */ - format = 0; - for ( test_format = SDL_FirstAudioFormat(spec->format); - ! format && test_format; ) { + const char *workaround = SDL_getenv("SDL_DSP_NOSELECT"); + char audiodev[1024]; + const char *err = NULL; + int format; + int bytes_per_sample; + SDL_AudioFormat test_format; + audio_init paud_init; + audio_buffer paud_bufinfo; + audio_status paud_status; + audio_control paud_control; + audio_change paud_change; + int fd = -1; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + fd = OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0); + this->hidden->audio_fd = fd; + if (fd < 0) { + PAUDIO_CloseDevice(this); + return SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); + } + + /* + * We can't set the buffer size - just ask the device for the maximum + * that we can have. + */ + if (ioctl(fd, AUDIO_BUFFER, &paud_bufinfo) < 0) { + PAUDIO_CloseDevice(this); + return SDL_SetError("Couldn't get audio buffer information"); + } + + if (this->spec.channels > 1) + this->spec.channels = 2; + else + this->spec.channels = 1; + + /* + * Fields in the audio_init structure: + * + * Ignored by us: + * + * paud.loadpath[LOAD_PATH]; * DSP code to load, MWave chip only? + * paud.slot_number; * slot number of the adapter + * paud.device_id; * adapter identification number + * + * Input: + * + * paud.srate; * the sampling rate in Hz + * paud.bits_per_sample; * 8, 16, 32, ... + * paud.bsize; * block size for this rate + * paud.mode; * ADPCM, PCM, MU_LAW, A_LAW, SOURCE_MIX + * paud.channels; * 1=mono, 2=stereo + * paud.flags; * FIXED - fixed length data + * * LEFT_ALIGNED, RIGHT_ALIGNED (var len only) + * * TWOS_COMPLEMENT - 2's complement data + * * SIGNED - signed? comment seems wrong in sys/audio.h + * * BIG_ENDIAN + * paud.operation; * PLAY, RECORD + * + * Output: + * + * paud.flags; * PITCH - pitch is supported + * * INPUT - input is supported + * * OUTPUT - output is supported + * * MONITOR - monitor is supported + * * VOLUME - volume is supported + * * VOLUME_DELAY - volume delay is supported + * * BALANCE - balance is supported + * * BALANCE_DELAY - balance delay is supported + * * TREBLE - treble control is supported + * * BASS - bass control is supported + * * BESTFIT_PROVIDED - best fit returned + * * LOAD_CODE - DSP load needed + * paud.rc; * NO_PLAY - DSP code can't do play requests + * * NO_RECORD - DSP code can't do record requests + * * INVALID_REQUEST - request was invalid + * * CONFLICT - conflict with open's flags + * * OVERLOADED - out of DSP MIPS or memory + * paud.position_resolution; * smallest increment for position + */ + + paud_init.srate = this->spec.freq; + paud_init.mode = PCM; + paud_init.operation = PLAY; + paud_init.channels = this->spec.channels; + + /* Try for a closest match on audio format */ + format = 0; + for (test_format = SDL_FirstAudioFormat(this->spec.format); + !format && test_format;) { #ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); #endif - switch ( test_format ) { - case AUDIO_U8: - bytes_per_sample = 1; - paud_init.bits_per_sample = 8; - paud_init.flags = TWOS_COMPLEMENT | FIXED; - format = 1; - break; - case AUDIO_S8: - bytes_per_sample = 1; - paud_init.bits_per_sample = 8; - paud_init.flags = SIGNED | - TWOS_COMPLEMENT | FIXED; - format = 1; - break; - case AUDIO_S16LSB: - bytes_per_sample = 2; - paud_init.bits_per_sample = 16; - paud_init.flags = SIGNED | - TWOS_COMPLEMENT | FIXED; - format = 1; - break; - case AUDIO_S16MSB: - bytes_per_sample = 2; - paud_init.bits_per_sample = 16; - paud_init.flags = BIG_ENDIAN | - SIGNED | - TWOS_COMPLEMENT | FIXED; - format = 1; - break; - case AUDIO_U16LSB: - bytes_per_sample = 2; - paud_init.bits_per_sample = 16; - paud_init.flags = TWOS_COMPLEMENT | FIXED; - format = 1; - break; - case AUDIO_U16MSB: - bytes_per_sample = 2; - paud_init.bits_per_sample = 16; - paud_init.flags = BIG_ENDIAN | - TWOS_COMPLEMENT | FIXED; - format = 1; - break; - default: - break; - } - if ( ! format ) { - test_format = SDL_NextAudioFormat(); - } - } - if ( format == 0 ) { + switch (test_format) { + case AUDIO_U8: + bytes_per_sample = 1; + paud_init.bits_per_sample = 8; + paud_init.flags = TWOS_COMPLEMENT | FIXED; + format = 1; + break; + case AUDIO_S8: + bytes_per_sample = 1; + paud_init.bits_per_sample = 8; + paud_init.flags = SIGNED | TWOS_COMPLEMENT | FIXED; + format = 1; + break; + case AUDIO_S16LSB: + bytes_per_sample = 2; + paud_init.bits_per_sample = 16; + paud_init.flags = SIGNED | TWOS_COMPLEMENT | FIXED; + format = 1; + break; + case AUDIO_S16MSB: + bytes_per_sample = 2; + paud_init.bits_per_sample = 16; + paud_init.flags = BIG_ENDIAN | SIGNED | TWOS_COMPLEMENT | FIXED; + format = 1; + break; + case AUDIO_U16LSB: + bytes_per_sample = 2; + paud_init.bits_per_sample = 16; + paud_init.flags = TWOS_COMPLEMENT | FIXED; + format = 1; + break; + case AUDIO_U16MSB: + bytes_per_sample = 2; + paud_init.bits_per_sample = 16; + paud_init.flags = BIG_ENDIAN | TWOS_COMPLEMENT | FIXED; + format = 1; + break; + default: + break; + } + if (!format) { + test_format = SDL_NextAudioFormat(); + } + } + if (format == 0) { #ifdef DEBUG_AUDIO - fprintf(stderr, "Couldn't find any hardware audio formats\n"); + fprintf(stderr, "Couldn't find any hardware audio formats\n"); #endif - SDL_SetError("Couldn't find any hardware audio formats"); - return -1; - } - spec->format = test_format; - - /* - * We know the buffer size and the max number of subsequent writes - * that can be pending. If more than one can pend, allow the application - * to do something like double buffering between our write buffer and - * the device's own buffer that we are filling with write() anyway. - * - * We calculate spec->samples like this because SDL_CalculateAudioSpec() - * will give put paud_bufinfo.write_buf_cap (or paud_bufinfo.write_buf_cap/2) - * into spec->size in return. - */ - if ( paud_bufinfo.request_buf_cap == 1 ) - { - spec->samples = paud_bufinfo.write_buf_cap - / bytes_per_sample - / spec->channels; - } - else - { - spec->samples = paud_bufinfo.write_buf_cap - / bytes_per_sample - / spec->channels - / 2; - } - paud_init.bsize = bytes_per_sample * spec->channels; - - SDL_CalculateAudioSpec(spec); - - /* - * The AIX paud device init can't modify the values of the audio_init - * structure that we pass to it. So we don't need any recalculation - * of this stuff and no reinit call as in linux dsp and dma code. - * - * /dev/paud supports all of the encoding formats, so we don't need - * to do anything like reopening the device, either. - */ - if ( ioctl(audio_fd, AUDIO_INIT, &paud_init) < 0 ) { - switch ( paud_init.rc ) - { - case 1 : - SDL_SetError("Couldn't set audio format: DSP can't do play requests"); - return -1; - break; - case 2 : - SDL_SetError("Couldn't set audio format: DSP can't do record requests"); - return -1; - break; - case 4 : - SDL_SetError("Couldn't set audio format: request was invalid"); - return -1; - break; - case 5 : - SDL_SetError("Couldn't set audio format: conflict with open's flags"); - return -1; - break; - case 6 : - SDL_SetError("Couldn't set audio format: out of DSP MIPS or memory"); - return -1; - break; - default : - SDL_SetError("Couldn't set audio format: not documented in sys/audio.h"); - return -1; - break; - } - } - - /* Allocate mixing buffer */ - mixlen = spec->size; - mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); - if ( mixbuf == NULL ) { - return -1; - } - SDL_memset(mixbuf, spec->silence, spec->size); - - /* - * Set some paramters: full volume, first speaker that we can find. - * Ignore the other settings for now. - */ - paud_change.input = AUDIO_IGNORE; /* the new input source */ - paud_change.output = OUTPUT_1; /* EXTERNAL_SPEAKER,INTERNAL_SPEAKER,OUTPUT_1 */ - paud_change.monitor = AUDIO_IGNORE; /* the new monitor state */ - paud_change.volume = 0x7fffffff; /* volume level [0-0x7fffffff] */ - paud_change.volume_delay = AUDIO_IGNORE; /* the new volume delay */ - paud_change.balance = 0x3fffffff; /* the new balance */ - paud_change.balance_delay = AUDIO_IGNORE; /* the new balance delay */ - paud_change.treble = AUDIO_IGNORE; /* the new treble state */ - paud_change.bass = AUDIO_IGNORE; /* the new bass state */ - paud_change.pitch = AUDIO_IGNORE; /* the new pitch state */ - - paud_control.ioctl_request = AUDIO_CHANGE; - paud_control.request_info = (char*)&paud_change; - if ( ioctl(audio_fd, AUDIO_CONTROL, &paud_control) < 0 ) { + PAUDIO_CloseDevice(this); + return SDL_SetError("Couldn't find any hardware audio formats"); + } + this->spec.format = test_format; + + /* + * We know the buffer size and the max number of subsequent writes + * that can be pending. If more than one can pend, allow the application + * to do something like double buffering between our write buffer and + * the device's own buffer that we are filling with write() anyway. + * + * We calculate this->spec.samples like this because + * SDL_CalculateAudioSpec() will give put paud_bufinfo.write_buf_cap + * (or paud_bufinfo.write_buf_cap/2) into this->spec.size in return. + */ + if (paud_bufinfo.request_buf_cap == 1) { + this->spec.samples = paud_bufinfo.write_buf_cap + / bytes_per_sample / this->spec.channels; + } else { + this->spec.samples = paud_bufinfo.write_buf_cap + / bytes_per_sample / this->spec.channels / 2; + } + paud_init.bsize = bytes_per_sample * this->spec.channels; + + SDL_CalculateAudioSpec(&this->spec); + + /* + * The AIX paud device init can't modify the values of the audio_init + * structure that we pass to it. So we don't need any recalculation + * of this stuff and no reinit call as in linux dsp code. + * + * /dev/paud supports all of the encoding formats, so we don't need + * to do anything like reopening the device, either. + */ + if (ioctl(fd, AUDIO_INIT, &paud_init) < 0) { + switch (paud_init.rc) { + case 1: + err = "Couldn't set audio format: DSP can't do play requests"; + break; + case 2: + err = "Couldn't set audio format: DSP can't do record requests"; + break; + case 4: + err = "Couldn't set audio format: request was invalid"; + break; + case 5: + err = "Couldn't set audio format: conflict with open's flags"; + break; + case 6: + err = "Couldn't set audio format: out of DSP MIPS or memory"; + break; + default: + err = "Couldn't set audio format: not documented in sys/audio.h"; + break; + } + } + + if (err != NULL) { + PAUDIO_CloseDevice(this); + return SDL_SetError("Paudio: %s", err); + } + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + PAUDIO_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); + + /* + * Set some paramters: full volume, first speaker that we can find. + * Ignore the other settings for now. + */ + paud_change.input = AUDIO_IGNORE; /* the new input source */ + paud_change.output = OUTPUT_1; /* EXTERNAL_SPEAKER,INTERNAL_SPEAKER,OUTPUT_1 */ + paud_change.monitor = AUDIO_IGNORE; /* the new monitor state */ + paud_change.volume = 0x7fffffff; /* volume level [0-0x7fffffff] */ + paud_change.volume_delay = AUDIO_IGNORE; /* the new volume delay */ + paud_change.balance = 0x3fffffff; /* the new balance */ + paud_change.balance_delay = AUDIO_IGNORE; /* the new balance delay */ + paud_change.treble = AUDIO_IGNORE; /* the new treble state */ + paud_change.bass = AUDIO_IGNORE; /* the new bass state */ + paud_change.pitch = AUDIO_IGNORE; /* the new pitch state */ + + paud_control.ioctl_request = AUDIO_CHANGE; + paud_control.request_info = (char *) &paud_change; + if (ioctl(fd, AUDIO_CONTROL, &paud_control) < 0) { #ifdef DEBUG_AUDIO - fprintf(stderr, "Can't change audio display settings\n" ); + fprintf(stderr, "Can't change audio display settings\n"); #endif - } - - /* - * Tell the device to expect data. Actual start will wait for - * the first write() call. - */ - paud_control.ioctl_request = AUDIO_START; - paud_control.position = 0; - if ( ioctl(audio_fd, AUDIO_CONTROL, &paud_control) < 0 ) { + } + + /* + * Tell the device to expect data. Actual start will wait for + * the first write() call. + */ + paud_control.ioctl_request = AUDIO_START; + paud_control.position = 0; + if (ioctl(fd, AUDIO_CONTROL, &paud_control) < 0) { + PAUDIO_CloseDevice(this); #ifdef DEBUG_AUDIO - fprintf(stderr, "Can't start audio play\n" ); + fprintf(stderr, "Can't start audio play\n"); #endif - SDL_SetError("Can't start audio play"); - return -1; - } - - /* Check to see if we need to use select() workaround */ - { char *workaround; - workaround = SDL_getenv("SDL_DSP_NOSELECT"); - if ( workaround ) { - frame_ticks = (float)(spec->samples*1000)/spec->freq; - next_frame = SDL_GetTicks()+frame_ticks; - } - } + return SDL_SetError("Can't start audio play"); + } + + /* Check to see if we need to use select() workaround */ + if (workaround != NULL) { + this->hidden->frame_ticks = (float) (this->spec.samples * 1000) / + this->spec.freq; + this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; + } - /* Get the parent process id (we're the parent of the audio thread) */ - parent = getpid(); + /* We're ready to rock and roll. :-) */ + return 0; +} + +static int +PAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* !!! FIXME: not right for device enum? */ + int fd = OpenAudioPath(NULL, 0, OPEN_FLAGS, 0); + if (fd < 0) { + SDL_SetError("PAUDIO: Couldn't open audio device"); + return 0; + } + close(fd); - /* We're ready to rock and roll. :-) */ - return 0; + /* Set the function pointers */ + impl->OpenDevice = DSP_OpenDevice; + impl->PlayDevice = DSP_PlayDevice; + impl->PlayDevice = DSP_WaitDevice; + impl->GetDeviceBuf = DSP_GetDeviceBuf; + impl->CloseDevice = DSP_CloseDevice; + impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: add device enum! */ + + return 1; /* this audio target is available. */ } +AudioBootStrap PAUDIO_bootstrap = { + "paud", "AIX Paudio", PAUDIO_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_PAUDIO */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/paudio/SDL_paudio.h b/src/audio/paudio/SDL_paudio.h index 72eff1ddef..7be1ed6513 100644 --- a/src/audio/paudio/SDL_paudio.h +++ b/src/audio/paudio/SDL_paudio.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,32 +25,23 @@ #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - int audio_fd; +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this - /* The parent process id, to detect when application quits */ - pid_t parent; +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; - /* Support for audio timing using a timer, in addition to select() */ - float frame_ticks; - float next_frame; + /* Support for audio timing using a timer, in addition to select() */ + float frame_ticks; + float next_frame; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ - -/* Old variable names */ -#define audio_fd (this->hidden->audio_fd) -#define parent (this->hidden->parent) -#define mixbuf (this->hidden->mixbuf) -#define mixlen (this->hidden->mixlen) -#define frame_ticks (this->hidden->frame_ticks) -#define next_frame (this->hidden->next_frame) +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ #endif /* _SDL_paudaudio_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/psp/SDL_pspaudio.c b/src/audio/psp/SDL_pspaudio.c new file mode 100644 index 0000000000..4b5534a3c5 --- /dev/null +++ b/src/audio/psp/SDL_pspaudio.c @@ -0,0 +1,195 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include +#include +#include +#include + +#include "SDL_audio.h" +#include "SDL_error.h" +#include "SDL_timer.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "../SDL_audiodev_c.h" +#include "../SDL_sysaudio.h" +#include "SDL_pspaudio.h" + +#include +#include + +/* The tag name used by PSP audio */ +#define PSPAUD_DRIVER_NAME "psp" + +static int +PSPAUD_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int format, mixlen, i; + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc(sizeof(*this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, sizeof(*this->hidden)); + switch (this->spec.format & 0xff) { + case 8: + case 16: + this->spec.format = AUDIO_S16LSB; + break; + default: + return SDL_SetError("Unsupported audio format"); + } + + /* The sample count must be a multiple of 64. */ + this->spec.samples = PSP_AUDIO_SAMPLE_ALIGN(this->spec.samples); + this->spec.freq = 44100; + + /* Update the fragment size as size in bytes. */ +// SDL_CalculateAudioSpec(this->spec); MOD + switch (this->spec.format) { + case AUDIO_U8: + this->spec.silence = 0x80; + break; + default: + this->spec.silence = 0x00; + break; + } + this->spec.size = SDL_AUDIO_BITSIZE(this->spec.format) / 8; + this->spec.size *= this->spec.channels; + this->spec.size *= this->spec.samples; + +//========================================== + + /* Allocate the mixing buffer. Its size and starting address must + be a multiple of 64 bytes. Our sample count is already a multiple of + 64, so spec->size should be a multiple of 64 as well. */ + mixlen = this->spec.size * NUM_BUFFERS; + this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen); + if (this->hidden->rawbuf == NULL) { + return SDL_SetError("Couldn't allocate mixing buffer"); + } + + /* Setup the hardware channel. */ + if (this->spec.channels == 1) { + format = PSP_AUDIO_FORMAT_MONO; + } else { + format = PSP_AUDIO_FORMAT_STEREO; + } + this->hidden->channel = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, this->spec.samples, format); + if (this->hidden->channel < 0) { + free(this->hidden->rawbuf); + this->hidden->rawbuf = NULL; + return SDL_SetError("Couldn't reserve hardware channel"); + } + + memset(this->hidden->rawbuf, 0, mixlen); + for (i = 0; i < NUM_BUFFERS; i++) { + this->hidden->mixbufs[i] = &this->hidden->rawbuf[i * this->spec.size]; + } + + this->hidden->next_buffer = 0; + return 0; +} + +static void PSPAUD_PlayDevice(_THIS) +{ + Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer]; + + if (this->spec.channels == 1) { + sceAudioOutputBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, mixbuf); + } else { + sceAudioOutputPannedBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, mixbuf); + } + + this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS; +} + +/* This function waits until it is possible to write a full sound buffer */ +static void PSPAUD_WaitDevice(_THIS) +{ + /* Because we block when sending audio, there's no need for this function to do anything. */ +} +static Uint8 *PSPAUD_GetDeviceBuf(_THIS) +{ + return this->hidden->mixbufs[this->hidden->next_buffer]; +} + +static void PSPAUD_CloseDevice(_THIS) +{ + if (this->hidden->channel >= 0) { + sceAudioChRelease(this->hidden->channel); + this->hidden->channel = -1; + } + + if (this->hidden->rawbuf != NULL) { + free(this->hidden->rawbuf); + this->hidden->rawbuf = NULL; + } +} +static void PSPAUD_ThreadInit(_THIS) +{ + /* Increase the priority of this audio thread by 1 to put it + ahead of other SDL threads. */ + SceUID thid; + SceKernelThreadInfo status; + thid = sceKernelGetThreadId(); + status.size = sizeof(SceKernelThreadInfo); + if (sceKernelReferThreadStatus(thid, &status) == 0) { + sceKernelChangeThreadPriority(thid, status.currentPriority - 1); + } +} + + +static int +PSPAUD_Init(SDL_AudioDriverImpl * impl) +{ + + // Set the function pointers + impl->OpenDevice = PSPAUD_OpenDevice; + impl->PlayDevice = PSPAUD_PlayDevice; + impl->WaitDevice = PSPAUD_WaitDevice; + impl->GetDeviceBuf = PSPAUD_GetDeviceBuf; + impl->WaitDone = PSPAUD_WaitDevice; + impl->CloseDevice = PSPAUD_CloseDevice; + impl->ThreadInit = PSPAUD_ThreadInit; + + //PSP audio device + impl->OnlyHasDefaultOutputDevice = 1; +/* + impl->HasCaptureSupport = 1; + + impl->OnlyHasDefaultInputDevice = 1; +*/ + /* + impl->DetectDevices = DSOUND_DetectDevices; + impl->Deinitialize = DSOUND_Deinitialize; + */ + return 1; /* this audio target is available. */ +} + +AudioBootStrap PSPAUD_bootstrap = { + "psp", "PSP audio driver", PSPAUD_Init, 0 +}; + + /* SDL_AUDI*/ + + + diff --git a/src/audio/psp/SDL_pspaudio.h b/src/audio/psp/SDL_pspaudio.h new file mode 100644 index 0000000000..139476c6ba --- /dev/null +++ b/src/audio/psp/SDL_pspaudio.h @@ -0,0 +1,45 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_pspaudio_h +#define _SDL_pspaudio_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the video functions */ +#define _THIS SDL_AudioDevice *this + +#define NUM_BUFFERS 2 + +struct SDL_PrivateAudioData { + /* The hardware output channel. */ + int channel; + /* The raw allocated mixing buffer. */ + Uint8 *rawbuf; + /* Individual mixing buffers. */ + Uint8 *mixbufs[NUM_BUFFERS]; + /* Index of the next available mixing buffer. */ + int next_buffer; +}; + +#endif /* _SDL_pspaudio_h */ +/* vim: ts=4 sw=4 + */ diff --git a/src/audio/pulse/SDL_pulseaudio.c b/src/audio/pulse/SDL_pulseaudio.c deleted file mode 100644 index 29373f37fd..0000000000 --- a/src/audio/pulse/SDL_pulseaudio.c +++ /dev/null @@ -1,570 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Stéphan Kochen - stephan@kochen.nl - - Based on parts of the ALSA and ESounD output drivers. -*/ -#include "SDL_config.h" - -/* Allow access to an PulseAudio network stream mixing buffer */ - -#include -#include -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audiomem.h" -#include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" -#include "../../../include/SDL_video.h" /* for SDL_WM_GetCaption(). */ -#include "SDL_pulseaudio.h" - -#ifdef SDL_AUDIO_DRIVER_PULSE_DYNAMIC -#include "SDL_name.h" -#include "SDL_loadso.h" -#else -#define SDL_NAME(X) X -#endif - -/* The tag name used by the driver */ -#define PULSE_DRIVER_NAME "pulse" - -/* Audio driver functions */ -static int PULSE_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void PULSE_WaitAudio(_THIS); -static void PULSE_PlayAudio(_THIS); -static Uint8 *PULSE_GetAudioBuf(_THIS); -static void PULSE_CloseAudio(_THIS); -static void PULSE_WaitDone(_THIS); -static void PULSE_SetCaption(_THIS, const char *str); - -#ifdef SDL_AUDIO_DRIVER_PULSE_DYNAMIC - -static const char *pulse_library = SDL_AUDIO_DRIVER_PULSE_DYNAMIC; -static void *pulse_handle = NULL; -static int pulse_loaded = 0; - -static pa_simple* (*SDL_NAME(pa_simple_new))( - const char *server, - const char *name, - pa_stream_direction_t dir, - const char *dev, - const char *stream_name, - const pa_sample_spec *ss, - const pa_channel_map *map, - const pa_buffer_attr *attr, - int *error -); -static void (*SDL_NAME(pa_simple_free))(pa_simple *s); - -static pa_channel_map* (*SDL_NAME(pa_channel_map_init_auto))( - pa_channel_map *m, - unsigned channels, - pa_channel_map_def_t def -); - -static pa_mainloop * (*SDL_NAME(pa_mainloop_new))(void); -static pa_mainloop_api * (*SDL_NAME(pa_mainloop_get_api))(pa_mainloop *m); -static int (*SDL_NAME(pa_mainloop_iterate))(pa_mainloop *m, int block, int *retval); -static void (*SDL_NAME(pa_mainloop_free))(pa_mainloop *m); - -static pa_operation_state_t (*SDL_NAME(pa_operation_get_state))(pa_operation *o); -static void (*SDL_NAME(pa_operation_cancel))(pa_operation *o); -static void (*SDL_NAME(pa_operation_unref))(pa_operation *o); - -static pa_context * (*SDL_NAME(pa_context_new))( - pa_mainloop_api *m, const char *name); -static int (*SDL_NAME(pa_context_connect))( - pa_context *c, const char *server, - pa_context_flags_t flags, const pa_spawn_api *api); -static pa_context_state_t (*SDL_NAME(pa_context_get_state))(pa_context *c); -static void (*SDL_NAME(pa_context_disconnect))(pa_context *c); -static void (*SDL_NAME(pa_context_unref))(pa_context *c); - -static pa_stream * (*SDL_NAME(pa_stream_new))(pa_context *c, - const char *name, const pa_sample_spec *ss, const pa_channel_map *map); -static int (*SDL_NAME(pa_stream_connect_playback))(pa_stream *s, const char *dev, - const pa_buffer_attr *attr, pa_stream_flags_t flags, - pa_cvolume *volume, pa_stream *sync_stream); -static pa_stream_state_t (*SDL_NAME(pa_stream_get_state))(pa_stream *s); -static size_t (*SDL_NAME(pa_stream_writable_size))(pa_stream *s); -static int (*SDL_NAME(pa_stream_write))(pa_stream *s, const void *data, size_t nbytes, - pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek); -static pa_operation * (*SDL_NAME(pa_stream_drain))(pa_stream *s, - pa_stream_success_cb_t cb, void *userdata); -static int (*SDL_NAME(pa_stream_disconnect))(pa_stream *s); -static void (*SDL_NAME(pa_stream_unref))(pa_stream *s); -static pa_operation* (*SDL_NAME(pa_context_set_name))(pa_context *c, - const char *name, pa_context_success_cb_t cb, void *userdata); - -static struct { - const char *name; - void **func; -} pulse_functions[] = { - { "pa_simple_new", - (void **)&SDL_NAME(pa_simple_new) }, - { "pa_simple_free", - (void **)&SDL_NAME(pa_simple_free) }, - { "pa_channel_map_init_auto", - (void **)&SDL_NAME(pa_channel_map_init_auto) }, - { "pa_mainloop_new", - (void **)&SDL_NAME(pa_mainloop_new) }, - { "pa_mainloop_get_api", - (void **)&SDL_NAME(pa_mainloop_get_api) }, - { "pa_mainloop_iterate", - (void **)&SDL_NAME(pa_mainloop_iterate) }, - { "pa_mainloop_free", - (void **)&SDL_NAME(pa_mainloop_free) }, - { "pa_operation_get_state", - (void **)&SDL_NAME(pa_operation_get_state) }, - { "pa_operation_cancel", - (void **)&SDL_NAME(pa_operation_cancel) }, - { "pa_operation_unref", - (void **)&SDL_NAME(pa_operation_unref) }, - { "pa_context_new", - (void **)&SDL_NAME(pa_context_new) }, - { "pa_context_connect", - (void **)&SDL_NAME(pa_context_connect) }, - { "pa_context_get_state", - (void **)&SDL_NAME(pa_context_get_state) }, - { "pa_context_disconnect", - (void **)&SDL_NAME(pa_context_disconnect) }, - { "pa_context_unref", - (void **)&SDL_NAME(pa_context_unref) }, - { "pa_stream_new", - (void **)&SDL_NAME(pa_stream_new) }, - { "pa_stream_connect_playback", - (void **)&SDL_NAME(pa_stream_connect_playback) }, - { "pa_stream_get_state", - (void **)&SDL_NAME(pa_stream_get_state) }, - { "pa_stream_writable_size", - (void **)&SDL_NAME(pa_stream_writable_size) }, - { "pa_stream_write", - (void **)&SDL_NAME(pa_stream_write) }, - { "pa_stream_drain", - (void **)&SDL_NAME(pa_stream_drain) }, - { "pa_stream_disconnect", - (void **)&SDL_NAME(pa_stream_disconnect) }, - { "pa_stream_unref", - (void **)&SDL_NAME(pa_stream_unref) }, - { "pa_context_set_name", - (void **)&SDL_NAME(pa_context_set_name) }, -}; - -static void UnloadPulseLibrary() -{ - if ( pulse_loaded ) { - SDL_UnloadObject(pulse_handle); - pulse_handle = NULL; - pulse_loaded = 0; - } -} - -static int LoadPulseLibrary(void) -{ - int i, retval = -1; - - pulse_handle = SDL_LoadObject(pulse_library); - if ( pulse_handle ) { - pulse_loaded = 1; - retval = 0; - for ( i=0; ihidden->caption); - SDL_free(device->hidden); - SDL_free(device); - UnloadPulseLibrary(); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - LoadPulseLibrary(); - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = PULSE_OpenAudio; - this->WaitAudio = PULSE_WaitAudio; - this->PlayAudio = PULSE_PlayAudio; - this->GetAudioBuf = PULSE_GetAudioBuf; - this->CloseAudio = PULSE_CloseAudio; - this->WaitDone = PULSE_WaitDone; - this->SetCaption = PULSE_SetCaption; - - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap PULSE_bootstrap = { - PULSE_DRIVER_NAME, "PulseAudio", - Audio_Available, Audio_CreateDevice -}; - -/* This function waits until it is possible to write a full sound buffer */ -static void PULSE_WaitAudio(_THIS) -{ - int size; - while(1) { - if (SDL_NAME(pa_context_get_state)(context) != PA_CONTEXT_READY || - SDL_NAME(pa_stream_get_state)(stream) != PA_STREAM_READY || - SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) { - this->enabled = 0; - return; - } - size = SDL_NAME(pa_stream_writable_size)(stream); - if (size >= mixlen) - return; - } -} - -static void PULSE_PlayAudio(_THIS) -{ - /* Write the audio data */ - if (SDL_NAME(pa_stream_write)(stream, mixbuf, mixlen, NULL, 0LL, PA_SEEK_RELATIVE) < 0) - this->enabled = 0; -} - -static Uint8 *PULSE_GetAudioBuf(_THIS) -{ - return(mixbuf); -} - -static void PULSE_CloseAudio(_THIS) -{ - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( stream != NULL ) { - SDL_NAME(pa_stream_disconnect)(stream); - SDL_NAME(pa_stream_unref)(stream); - stream = NULL; - } - if (context != NULL) { - SDL_NAME(pa_context_disconnect)(context); - SDL_NAME(pa_context_unref)(context); - context = NULL; - } - if (mainloop != NULL) { - SDL_NAME(pa_mainloop_free)(mainloop); - mainloop = NULL; - } -} - -/* Try to get the name of the program */ -static char *get_progname(void) -{ -#ifdef __LINUX__ - char *progname = NULL; - FILE *fp; - static char temp[BUFSIZ]; - - SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid()); - fp = fopen(temp, "r"); - if ( fp != NULL ) { - if ( fgets(temp, sizeof(temp)-1, fp) ) { - progname = SDL_strrchr(temp, '/'); - if ( progname == NULL ) { - progname = temp; - } else { - progname = progname+1; - } - } - fclose(fp); - } - return(progname); -#elif defined(__NetBSD__) - return getprogname(); -#else - return("unknown"); -#endif -} - -static void caption_set_complete(pa_context *c, int success, void *userdata) -{ - /* no-op. */ -} - -static void PULSE_SetCaption(_THIS, const char *str) -{ - SDL_free(this->hidden->caption); - if ((str == NULL) || (*str == '\0')) { - str = get_progname(); /* set a default so SOMETHING shows up. */ - } - this->hidden->caption = SDL_strdup(str); - if (context != NULL) { - SDL_NAME(pa_context_set_name)(context, this->hidden->caption, - caption_set_complete, 0); - } -} - -static void stream_drain_complete(pa_stream *s, int success, void *userdata) -{ - /* no-op. */ -} - -static void PULSE_WaitDone(_THIS) -{ - pa_operation *o; - - o = SDL_NAME(pa_stream_drain)(stream, stream_drain_complete, NULL); - if (!o) - return; - - while (SDL_NAME(pa_operation_get_state)(o) != PA_OPERATION_DONE) { - if (SDL_NAME(pa_context_get_state)(context) != PA_CONTEXT_READY || - SDL_NAME(pa_stream_get_state)(stream) != PA_STREAM_READY || - SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) { - SDL_NAME(pa_operation_cancel)(o); - break; - } - } - SDL_NAME(pa_operation_unref)(o); -} - -static int PULSE_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - int state; - Uint16 test_format; - pa_sample_spec paspec; - pa_buffer_attr paattr; - pa_channel_map pacmap; - pa_stream_flags_t flags = 0; - - paspec.format = PA_SAMPLE_INVALID; - for ( test_format = SDL_FirstAudioFormat(spec->format); test_format; ) { - switch ( test_format ) { - case AUDIO_U8: - paspec.format = PA_SAMPLE_U8; - break; - case AUDIO_S16LSB: - paspec.format = PA_SAMPLE_S16LE; - break; - case AUDIO_S16MSB: - paspec.format = PA_SAMPLE_S16BE; - break; - } - if ( paspec.format != PA_SAMPLE_INVALID ) - break; - test_format = SDL_NextAudioFormat(); - } - if (paspec.format == PA_SAMPLE_INVALID ) { - SDL_SetError("Couldn't find any suitable audio formats"); - return(-1); - } - spec->format = test_format; - - paspec.channels = spec->channels; - paspec.rate = spec->freq; - - /* Calculate the final parameters for this audio specification */ -#ifdef PA_STREAM_ADJUST_LATENCY - spec->samples /= 2; /* Mix in smaller chunck to avoid underruns */ -#endif - SDL_CalculateAudioSpec(spec); - - /* Allocate mixing buffer */ - mixlen = spec->size; - mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); - if ( mixbuf == NULL ) { - return(-1); - } - SDL_memset(mixbuf, spec->silence, spec->size); - - /* Reduced prebuffering compared to the defaults. */ -#ifdef PA_STREAM_ADJUST_LATENCY - paattr.tlength = mixlen * 4; /* 2x original requested bufsize */ - paattr.prebuf = -1; - paattr.maxlength = -1; - paattr.minreq = mixlen; /* -1 can lead to pa_stream_writable_size() - >= mixlen never becoming true */ - flags = PA_STREAM_ADJUST_LATENCY; -#else - paattr.tlength = mixlen*2; - paattr.prebuf = mixlen*2; - paattr.maxlength = mixlen*2; - paattr.minreq = mixlen; -#endif - - /* The SDL ALSA output hints us that we use Windows' channel mapping */ - /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */ - SDL_NAME(pa_channel_map_init_auto)( - &pacmap, spec->channels, PA_CHANNEL_MAP_WAVEEX); - - /* Set up a new main loop */ - if (!(mainloop = SDL_NAME(pa_mainloop_new)())) { - PULSE_CloseAudio(this); - SDL_SetError("pa_mainloop_new() failed"); - return(-1); - } - - if (this->hidden->caption == NULL) { - char *title = NULL; - SDL_WM_GetCaption(&title, NULL); - PULSE_SetCaption(this, title); - } - - mainloop_api = SDL_NAME(pa_mainloop_get_api)(mainloop); - if (!(context = SDL_NAME(pa_context_new)(mainloop_api, - this->hidden->caption))) { - PULSE_CloseAudio(this); - SDL_SetError("pa_context_new() failed"); - return(-1); - } - - /* Connect to the PulseAudio server */ - if (SDL_NAME(pa_context_connect)(context, NULL, 0, NULL) < 0) { - PULSE_CloseAudio(this); - SDL_SetError("Could not setup connection to PulseAudio"); - return(-1); - } - - do { - if (SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) { - PULSE_CloseAudio(this); - SDL_SetError("pa_mainloop_iterate() failed"); - return(-1); - } - state = SDL_NAME(pa_context_get_state)(context); - if (!PA_CONTEXT_IS_GOOD(state)) { - PULSE_CloseAudio(this); - SDL_SetError("Could not connect to PulseAudio"); - return(-1); - } - } while (state != PA_CONTEXT_READY); - - stream = SDL_NAME(pa_stream_new)( - context, - "Simple DirectMedia Layer", /* stream description */ - &paspec, /* sample format spec */ - &pacmap /* channel map */ - ); - if ( stream == NULL ) { - PULSE_CloseAudio(this); - SDL_SetError("Could not setup PulseAudio stream"); - return(-1); - } - - if (SDL_NAME(pa_stream_connect_playback)(stream, NULL, &paattr, flags, - NULL, NULL) < 0) { - PULSE_CloseAudio(this); - SDL_SetError("Could not connect PulseAudio stream"); - return(-1); - } - - do { - if (SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) { - PULSE_CloseAudio(this); - SDL_SetError("pa_mainloop_iterate() failed"); - return(-1); - } - state = SDL_NAME(pa_stream_get_state)(stream); - if (!PA_STREAM_IS_GOOD(state)) { - PULSE_CloseAudio(this); - SDL_SetError("Could not create to PulseAudio stream"); - return(-1); - } - } while (state != PA_STREAM_READY); - - return(0); -} diff --git a/src/audio/pulse/SDL_pulseaudio.h b/src/audio/pulse/SDL_pulseaudio.h deleted file mode 100644 index 63ee751ef6..0000000000 --- a/src/audio/pulse/SDL_pulseaudio.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Stéphan Kochen - stephan@kochen.nl - - Based on parts of the ALSA and ESounD output drivers. -*/ -#include "SDL_config.h" - -#ifndef _SDL_pulseaudio_h -#define _SDL_pulseaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - pa_mainloop *mainloop; - pa_mainloop_api *mainloop_api; - pa_context *context; - pa_stream *stream; - - char *caption; - - /* Raw mixing buffer */ - Uint8 *mixbuf; - int mixlen; -}; - -#if (PA_API_VERSION < 12) -/** Return non-zero if the passed state is one of the connected states */ -static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) { - return - x == PA_CONTEXT_CONNECTING || - x == PA_CONTEXT_AUTHORIZING || - x == PA_CONTEXT_SETTING_NAME || - x == PA_CONTEXT_READY; -} -/** Return non-zero if the passed state is one of the connected states */ -static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) { - return - x == PA_STREAM_CREATING || - x == PA_STREAM_READY; -} -#endif /* pulseaudio <= 0.9.10 */ - -/* Old variable names */ -#define mainloop (this->hidden->mainloop) -#define mainloop_api (this->hidden->mainloop_api) -#define context (this->hidden->context) -#define stream (this->hidden->stream) -#define mixbuf (this->hidden->mixbuf) -#define mixlen (this->hidden->mixlen) - -#endif /* _SDL_pulseaudio_h */ - diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c new file mode 100644 index 0000000000..46269d1771 --- /dev/null +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -0,0 +1,556 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + The PulseAudio target for SDL 1.3 is based on the 1.3 arts target, with + the appropriate parts replaced with the 1.2 PulseAudio target code. This + was the cleanest way to move it to 1.3. The 1.2 target was written by + Stéphan Kochen: stephan .a.t. kochen.nl +*/ +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_PULSEAUDIO + +/* Allow access to a raw mixing buffer */ + +#ifdef HAVE_SIGNAL_H +#include +#endif +#include +#include +#include +#include +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_pulseaudio.h" +#include "SDL_loadso.h" + +#if (PA_API_VERSION < 12) +/** Return non-zero if the passed state is one of the connected states */ +static __inline__ int PA_CONTEXT_IS_GOOD(pa_context_state_t x) { + return + x == PA_CONTEXT_CONNECTING || + x == PA_CONTEXT_AUTHORIZING || + x == PA_CONTEXT_SETTING_NAME || + x == PA_CONTEXT_READY; +} +/** Return non-zero if the passed state is one of the connected states */ +static __inline__ int PA_STREAM_IS_GOOD(pa_stream_state_t x) { + return + x == PA_STREAM_CREATING || + x == PA_STREAM_READY; +} +#endif /* pulseaudio <= 0.9.10 */ + + +static const char *(*PULSEAUDIO_pa_get_library_version) (void); +static pa_simple *(*PULSEAUDIO_pa_simple_new) (const char *, const char *, + pa_stream_direction_t, const char *, const char *, const pa_sample_spec *, + const pa_channel_map *, const pa_buffer_attr *, int *); +static void (*PULSEAUDIO_pa_simple_free) (pa_simple *); +static pa_channel_map *(*PULSEAUDIO_pa_channel_map_init_auto) ( + pa_channel_map *, unsigned, pa_channel_map_def_t); +static const char * (*PULSEAUDIO_pa_strerror) (int); +static pa_mainloop * (*PULSEAUDIO_pa_mainloop_new) (void); +static pa_mainloop_api * (*PULSEAUDIO_pa_mainloop_get_api) (pa_mainloop *); +static int (*PULSEAUDIO_pa_mainloop_iterate) (pa_mainloop *, int, int *); +static void (*PULSEAUDIO_pa_mainloop_free) (pa_mainloop *); + +static pa_operation_state_t (*PULSEAUDIO_pa_operation_get_state) ( + pa_operation *); +static void (*PULSEAUDIO_pa_operation_cancel) (pa_operation *); +static void (*PULSEAUDIO_pa_operation_unref) (pa_operation *); + +static pa_context * (*PULSEAUDIO_pa_context_new) (pa_mainloop_api *, + const char *); +static int (*PULSEAUDIO_pa_context_connect) (pa_context *, const char *, + pa_context_flags_t, const pa_spawn_api *); +static pa_context_state_t (*PULSEAUDIO_pa_context_get_state) (pa_context *); +static void (*PULSEAUDIO_pa_context_disconnect) (pa_context *); +static void (*PULSEAUDIO_pa_context_unref) (pa_context *); + +static pa_stream * (*PULSEAUDIO_pa_stream_new) (pa_context *, const char *, + const pa_sample_spec *, const pa_channel_map *); +static int (*PULSEAUDIO_pa_stream_connect_playback) (pa_stream *, const char *, + const pa_buffer_attr *, pa_stream_flags_t, pa_cvolume *, pa_stream *); +static pa_stream_state_t (*PULSEAUDIO_pa_stream_get_state) (pa_stream *); +static size_t (*PULSEAUDIO_pa_stream_writable_size) (pa_stream *); +static int (*PULSEAUDIO_pa_stream_write) (pa_stream *, const void *, size_t, + pa_free_cb_t, int64_t, pa_seek_mode_t); +static pa_operation * (*PULSEAUDIO_pa_stream_drain) (pa_stream *, + pa_stream_success_cb_t, void *); +static int (*PULSEAUDIO_pa_stream_disconnect) (pa_stream *); +static void (*PULSEAUDIO_pa_stream_unref) (pa_stream *); + +static int load_pulseaudio_syms(void); + + +#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC + +static const char *pulseaudio_library = SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC; +static void *pulseaudio_handle = NULL; + +static int +load_pulseaudio_sym(const char *fn, void **addr) +{ + *addr = SDL_LoadFunction(pulseaudio_handle, fn); + if (*addr == NULL) { + /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ + return 0; + } + + return 1; +} + +/* cast funcs to char* first, to please GCC's strict aliasing rules. */ +#define SDL_PULSEAUDIO_SYM(x) \ + if (!load_pulseaudio_sym(#x, (void **) (char *) &PULSEAUDIO_##x)) return -1 + +static void +UnloadPulseAudioLibrary(void) +{ + if (pulseaudio_handle != NULL) { + SDL_UnloadObject(pulseaudio_handle); + pulseaudio_handle = NULL; + } +} + +static int +LoadPulseAudioLibrary(void) +{ + int retval = 0; + if (pulseaudio_handle == NULL) { + pulseaudio_handle = SDL_LoadObject(pulseaudio_library); + if (pulseaudio_handle == NULL) { + retval = -1; + /* Don't call SDL_SetError(): SDL_LoadObject already did. */ + } else { + retval = load_pulseaudio_syms(); + if (retval < 0) { + UnloadPulseAudioLibrary(); + } + } + } + return retval; +} + +#else + +#define SDL_PULSEAUDIO_SYM(x) PULSEAUDIO_##x = x + +static void +UnloadPulseAudioLibrary(void) +{ +} + +static int +LoadPulseAudioLibrary(void) +{ + load_pulseaudio_syms(); + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */ + + +static int +load_pulseaudio_syms(void) +{ + SDL_PULSEAUDIO_SYM(pa_get_library_version); + SDL_PULSEAUDIO_SYM(pa_simple_new); + SDL_PULSEAUDIO_SYM(pa_simple_free); + SDL_PULSEAUDIO_SYM(pa_mainloop_new); + SDL_PULSEAUDIO_SYM(pa_mainloop_get_api); + SDL_PULSEAUDIO_SYM(pa_mainloop_iterate); + SDL_PULSEAUDIO_SYM(pa_mainloop_free); + SDL_PULSEAUDIO_SYM(pa_operation_get_state); + SDL_PULSEAUDIO_SYM(pa_operation_cancel); + SDL_PULSEAUDIO_SYM(pa_operation_unref); + SDL_PULSEAUDIO_SYM(pa_context_new); + SDL_PULSEAUDIO_SYM(pa_context_connect); + SDL_PULSEAUDIO_SYM(pa_context_get_state); + SDL_PULSEAUDIO_SYM(pa_context_disconnect); + SDL_PULSEAUDIO_SYM(pa_context_unref); + SDL_PULSEAUDIO_SYM(pa_stream_new); + SDL_PULSEAUDIO_SYM(pa_stream_connect_playback); + SDL_PULSEAUDIO_SYM(pa_stream_get_state); + SDL_PULSEAUDIO_SYM(pa_stream_writable_size); + SDL_PULSEAUDIO_SYM(pa_stream_write); + SDL_PULSEAUDIO_SYM(pa_stream_drain); + SDL_PULSEAUDIO_SYM(pa_stream_disconnect); + SDL_PULSEAUDIO_SYM(pa_stream_unref); + SDL_PULSEAUDIO_SYM(pa_channel_map_init_auto); + SDL_PULSEAUDIO_SYM(pa_strerror); + return 0; +} + + +/* Check to see if we can connect to PulseAudio */ +static SDL_bool +CheckPulseAudioAvailable() +{ + pa_simple *s; + pa_sample_spec ss; + + ss.format = PA_SAMPLE_S16NE; + ss.channels = 1; + ss.rate = 22050; + + s = PULSEAUDIO_pa_simple_new(NULL, "SDL", PA_STREAM_PLAYBACK, NULL, + "Test", &ss, NULL, NULL, NULL); + if (s) { + PULSEAUDIO_pa_simple_free(s); + return SDL_TRUE; + } else { + return SDL_FALSE; + } +} + +/* This function waits until it is possible to write a full sound buffer */ +static void +PULSEAUDIO_WaitDevice(_THIS) +{ + struct SDL_PrivateAudioData *h = this->hidden; + + while(1) { + if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || + PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || + PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { + this->enabled = 0; + return; + } + if (PULSEAUDIO_pa_stream_writable_size(h->stream) >= h->mixlen) { + return; + } + } +} + +static void +PULSEAUDIO_PlayDevice(_THIS) +{ + /* Write the audio data */ + struct SDL_PrivateAudioData *h = this->hidden; + if (PULSEAUDIO_pa_stream_write(h->stream, h->mixbuf, h->mixlen, NULL, 0LL, + PA_SEEK_RELATIVE) < 0) { + this->enabled = 0; + } +} + +static void +stream_drain_complete(pa_stream *s, int success, void *userdata) +{ + /* no-op for pa_stream_drain() to use for callback. */ +} + +static void +PULSEAUDIO_WaitDone(_THIS) +{ + struct SDL_PrivateAudioData *h = this->hidden; + pa_operation *o; + + o = PULSEAUDIO_pa_stream_drain(h->stream, stream_drain_complete, NULL); + if (!o) { + return; + } + + while (PULSEAUDIO_pa_operation_get_state(o) != PA_OPERATION_DONE) { + if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || + PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || + PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { + PULSEAUDIO_pa_operation_cancel(o); + break; + } + } + + PULSEAUDIO_pa_operation_unref(o); +} + + + +static Uint8 * +PULSEAUDIO_GetDeviceBuf(_THIS) +{ + return (this->hidden->mixbuf); +} + + +static void +PULSEAUDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->stream) { + PULSEAUDIO_pa_stream_disconnect(this->hidden->stream); + PULSEAUDIO_pa_stream_unref(this->hidden->stream); + this->hidden->stream = NULL; + } + if (this->hidden->context != NULL) { + PULSEAUDIO_pa_context_disconnect(this->hidden->context); + PULSEAUDIO_pa_context_unref(this->hidden->context); + this->hidden->context = NULL; + } + if (this->hidden->mainloop != NULL) { + PULSEAUDIO_pa_mainloop_free(this->hidden->mainloop); + this->hidden->mainloop = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + + +static __inline__ int +squashVersion(const int major, const int minor, const int patch) +{ + return ((major & 0xFF) << 16) | ((minor & 0xFF) << 8) | (patch & 0xFF); +} + +/* Workaround for older pulse: pa_context_new() must have non-NULL appname */ +static const char * +getAppName(void) +{ + const char *verstr = PULSEAUDIO_pa_get_library_version(); + if (verstr != NULL) { + int maj, min, patch; + if (SDL_sscanf(verstr, "%d.%d.%d", &maj, &min, &patch) == 3) { + if (squashVersion(maj, min, patch) >= squashVersion(0, 9, 15)) { + return NULL; /* 0.9.15+ handles NULL correctly. */ + } + } + } + return "SDL Application"; /* oh well. */ +} + +static int +PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + struct SDL_PrivateAudioData *h = NULL; + Uint16 test_format = 0; + pa_sample_spec paspec; + pa_buffer_attr paattr; + pa_channel_map pacmap; + pa_stream_flags_t flags = 0; + int state = 0; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + h = this->hidden; + + paspec.format = PA_SAMPLE_INVALID; + + /* Try for a closest match on audio format */ + for (test_format = SDL_FirstAudioFormat(this->spec.format); + (paspec.format == PA_SAMPLE_INVALID) && test_format;) { +#ifdef DEBUG_AUDIO + fprintf(stderr, "Trying format 0x%4.4x\n", test_format); +#endif + switch (test_format) { + case AUDIO_U8: + paspec.format = PA_SAMPLE_U8; + break; + case AUDIO_S16LSB: + paspec.format = PA_SAMPLE_S16LE; + break; + case AUDIO_S16MSB: + paspec.format = PA_SAMPLE_S16BE; + break; + case AUDIO_S32LSB: + paspec.format = PA_SAMPLE_S32LE; + break; + case AUDIO_S32MSB: + paspec.format = PA_SAMPLE_S32BE; + break; + case AUDIO_F32LSB: + paspec.format = PA_SAMPLE_FLOAT32LE; + break; + case AUDIO_F32MSB: + paspec.format = PA_SAMPLE_FLOAT32BE; + break; + default: + paspec.format = PA_SAMPLE_INVALID; + break; + } + if (paspec.format == PA_SAMPLE_INVALID) { + test_format = SDL_NextAudioFormat(); + } + } + if (paspec.format == PA_SAMPLE_INVALID) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Couldn't find any hardware audio formats"); + } + this->spec.format = test_format; + + /* Calculate the final parameters for this audio specification */ +#ifdef PA_STREAM_ADJUST_LATENCY + this->spec.samples /= 2; /* Mix in smaller chunck to avoid underruns */ +#endif + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate mixing buffer */ + h->mixlen = this->spec.size; + h->mixbuf = (Uint8 *) SDL_AllocAudioMem(h->mixlen); + if (h->mixbuf == NULL) { + PULSEAUDIO_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(h->mixbuf, this->spec.silence, this->spec.size); + + paspec.channels = this->spec.channels; + paspec.rate = this->spec.freq; + + /* Reduced prebuffering compared to the defaults. */ +#ifdef PA_STREAM_ADJUST_LATENCY + /* 2x original requested bufsize */ + paattr.tlength = h->mixlen * 4; + paattr.prebuf = -1; + paattr.maxlength = -1; + /* -1 can lead to pa_stream_writable_size() >= mixlen never being true */ + paattr.minreq = h->mixlen; + flags = PA_STREAM_ADJUST_LATENCY; +#else + paattr.tlength = h->mixlen*2; + paattr.prebuf = h->mixlen*2; + paattr.maxlength = h->mixlen*2; + paattr.minreq = h->mixlen; +#endif + + /* The SDL ALSA output hints us that we use Windows' channel mapping */ + /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */ + PULSEAUDIO_pa_channel_map_init_auto(&pacmap, this->spec.channels, + PA_CHANNEL_MAP_WAVEEX); + + /* Set up a new main loop */ + if (!(h->mainloop = PULSEAUDIO_pa_mainloop_new())) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("pa_mainloop_new() failed"); + } + + h->mainloop_api = PULSEAUDIO_pa_mainloop_get_api(h->mainloop); + h->context = PULSEAUDIO_pa_context_new(h->mainloop_api, getAppName()); + if (!h->context) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("pa_context_new() failed"); + } + + /* Connect to the PulseAudio server */ + if (PULSEAUDIO_pa_context_connect(h->context, NULL, 0, NULL) < 0) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Could not setup connection to PulseAudio"); + } + + do { + if (PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("pa_mainloop_iterate() failed"); + } + state = PULSEAUDIO_pa_context_get_state(h->context); + if (!PA_CONTEXT_IS_GOOD(state)) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Could not connect to PulseAudio"); + } + } while (state != PA_CONTEXT_READY); + + h->stream = PULSEAUDIO_pa_stream_new( + h->context, + "Simple DirectMedia Layer", /* stream description */ + &paspec, /* sample format spec */ + &pacmap /* channel map */ + ); + + if (h->stream == NULL) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Could not set up PulseAudio stream"); + } + + if (PULSEAUDIO_pa_stream_connect_playback(h->stream, NULL, &paattr, flags, + NULL, NULL) < 0) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Could not connect PulseAudio stream"); + } + + do { + if (PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("pa_mainloop_iterate() failed"); + } + state = PULSEAUDIO_pa_stream_get_state(h->stream); + if (!PA_STREAM_IS_GOOD(state)) { + PULSEAUDIO_CloseDevice(this); + return SDL_SetError("Could not create to PulseAudio stream"); + } + } while (state != PA_STREAM_READY); + + /* We're ready to rock and roll. :-) */ + return 0; +} + + +static void +PULSEAUDIO_Deinitialize(void) +{ + UnloadPulseAudioLibrary(); +} + +static int +PULSEAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadPulseAudioLibrary() < 0) { + return 0; + } + + if (!CheckPulseAudioAvailable()) { + UnloadPulseAudioLibrary(); + return 0; + } + + /* Set the function pointers */ + impl->OpenDevice = PULSEAUDIO_OpenDevice; + impl->PlayDevice = PULSEAUDIO_PlayDevice; + impl->WaitDevice = PULSEAUDIO_WaitDevice; + impl->GetDeviceBuf = PULSEAUDIO_GetDeviceBuf; + impl->CloseDevice = PULSEAUDIO_CloseDevice; + impl->WaitDone = PULSEAUDIO_WaitDone; + impl->Deinitialize = PULSEAUDIO_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; + + return 1; /* this audio target is available. */ +} + + +AudioBootStrap PULSEAUDIO_bootstrap = { + "pulseaudio", "PulseAudio", PULSEAUDIO_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_PULSEAUDIO */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/pulseaudio/SDL_pulseaudio.h b/src/audio/pulseaudio/SDL_pulseaudio.h new file mode 100644 index 0000000000..cb96039918 --- /dev/null +++ b/src/audio/pulseaudio/SDL_pulseaudio.h @@ -0,0 +1,48 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_pulseaudio_h +#define _SDL_pulseaudio_h + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* pulseaudio structures */ + pa_mainloop *mainloop; + pa_mainloop_api *mainloop_api; + pa_context *context; + pa_stream *stream; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; +}; + +#endif /* _SDL_pulseaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c new file mode 100644 index 0000000000..e3877b4634 --- /dev/null +++ b/src/audio/qsa/SDL_qsa_audio.c @@ -0,0 +1,859 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_QSA + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_qsa_audio.h" + +/* default channel communication parameters */ +#define DEFAULT_CPARAMS_RATE 44100 +#define DEFAULT_CPARAMS_VOICES 1 + +#define DEFAULT_CPARAMS_FRAG_SIZE 4096 +#define DEFAULT_CPARAMS_FRAGS_MIN 1 +#define DEFAULT_CPARAMS_FRAGS_MAX 1 + +#define QSA_NO_WORKAROUNDS 0x00000000 +#define QSA_MMAP_WORKAROUND 0x00000001 + +struct BuggyCards +{ + char *cardname; + unsigned long bugtype; +}; + +#define QSA_WA_CARDS 3 +#define QSA_MAX_CARD_NAME_LENGTH 33 + +struct BuggyCards buggycards[QSA_WA_CARDS] = { + {"Sound Blaster Live!", QSA_MMAP_WORKAROUND}, + {"Vortex 8820", QSA_MMAP_WORKAROUND}, + {"Vortex 8830", QSA_MMAP_WORKAROUND}, +}; + +/* List of found devices */ +#define QSA_MAX_DEVICES 32 +#define QSA_MAX_NAME_LENGTH 81+16 /* Hardcoded in QSA, can't be changed */ + +typedef struct _QSA_Device +{ + char name[QSA_MAX_NAME_LENGTH]; /* Long audio device name for SDL */ + int cardno; + int deviceno; +} QSA_Device; + +QSA_Device qsa_playback_device[QSA_MAX_DEVICES]; +uint32_t qsa_playback_devices; + +QSA_Device qsa_capture_device[QSA_MAX_DEVICES]; +uint32_t qsa_capture_devices; + +static inline int +QSA_SetError(const char *fn, int status) +{ + return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status)); +} + +/* card names check to apply the workarounds */ +static int +QSA_CheckBuggyCards(_THIS, unsigned long checkfor) +{ + char scardname[QSA_MAX_CARD_NAME_LENGTH]; + int it; + + if (snd_card_get_name + (this->hidden->cardno, scardname, QSA_MAX_CARD_NAME_LENGTH - 1) < 0) { + return 0; + } + + for (it = 0; it < QSA_WA_CARDS; it++) { + if (SDL_strcmp(buggycards[it].cardname, scardname) == 0) { + if (buggycards[it].bugtype == checkfor) { + return 1; + } + } + } + + return 0; +} + +/* !!! FIXME: does this need to be here? Does the SDL version not work? */ +static void +QSA_ThreadInit(_THIS) +{ + struct sched_param param; + int status; + + /* Increase default 10 priority to 25 to avoid jerky sound */ + status = SchedGet(0, 0, ¶m); + param.sched_priority = param.sched_curpriority + 15; + status = SchedSet(0, 0, SCHED_NOCHANGE, ¶m); +} + +/* PCM channel parameters initialize function */ +static void +QSA_InitAudioParams(snd_pcm_channel_params_t * cpars) +{ + SDL_memset(cpars, 0, sizeof(snd_pcm_channel_params_t)); + + cpars->channel = SND_PCM_CHANNEL_PLAYBACK; + cpars->mode = SND_PCM_MODE_BLOCK; + cpars->start_mode = SND_PCM_START_DATA; + cpars->stop_mode = SND_PCM_STOP_STOP; + cpars->format.format = SND_PCM_SFMT_S16_LE; + cpars->format.interleave = 1; + cpars->format.rate = DEFAULT_CPARAMS_RATE; + cpars->format.voices = DEFAULT_CPARAMS_VOICES; + cpars->buf.block.frag_size = DEFAULT_CPARAMS_FRAG_SIZE; + cpars->buf.block.frags_min = DEFAULT_CPARAMS_FRAGS_MIN; + cpars->buf.block.frags_max = DEFAULT_CPARAMS_FRAGS_MAX; +} + +/* This function waits until it is possible to write a full sound buffer */ +static void +QSA_WaitDevice(_THIS) +{ + fd_set wfds; + fd_set rfds; + int selectret; + struct timeval timeout; + + if (!this->hidden->iscapture) { + FD_ZERO(&wfds); + FD_SET(this->hidden->audio_fd, &wfds); + } else { + FD_ZERO(&rfds); + FD_SET(this->hidden->audio_fd, &rfds); + } + + do { + /* Setup timeout for playing one fragment equal to 2 seconds */ + /* If timeout occured than something wrong with hardware or driver */ + /* For example, Vortex 8820 audio driver stucks on second DAC because */ + /* it doesn't exist ! */ + timeout.tv_sec = 2; + timeout.tv_usec = 0; + this->hidden->timeout_on_wait = 0; + + if (!this->hidden->iscapture) { + selectret = + select(this->hidden->audio_fd + 1, NULL, &wfds, NULL, + &timeout); + } else { + selectret = + select(this->hidden->audio_fd + 1, &rfds, NULL, NULL, + &timeout); + } + + switch (selectret) { + case -1: + { + SDL_SetError("QSA: select() failed: %s", strerror(errno)); + return; + } + break; + case 0: + { + SDL_SetError("QSA: timeout on buffer waiting occured"); + this->hidden->timeout_on_wait = 1; + return; + } + break; + default: + { + if (!this->hidden->iscapture) { + if (FD_ISSET(this->hidden->audio_fd, &wfds)) { + return; + } + } else { + if (FD_ISSET(this->hidden->audio_fd, &rfds)) { + return; + } + } + } + break; + } + } while (1); +} + +static void +QSA_PlayDevice(_THIS) +{ + snd_pcm_channel_status_t cstatus; + int written; + int status; + int towrite; + void *pcmbuffer; + + if ((!this->enabled) || (!this->hidden)) { + return; + } + + towrite = this->spec.size; + pcmbuffer = this->hidden->pcm_buf; + + /* Write the audio data, checking for EAGAIN (buffer full) and underrun */ + do { + written = + snd_pcm_plugin_write(this->hidden->audio_handle, pcmbuffer, + towrite); + if (written != towrite) { + /* Check if samples playback got stuck somewhere in hardware or in */ + /* the audio device driver */ + if ((errno == EAGAIN) && (written == 0)) { + if (this->hidden->timeout_on_wait != 0) { + SDL_SetError("QSA: buffer playback timeout"); + return; + } + } + + /* Check for errors or conditions */ + if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) { + /* Let a little CPU time go by and try to write again */ + SDL_Delay(1); + + /* if we wrote some data */ + towrite -= written; + pcmbuffer += written * this->spec.channels; + continue; + } else { + if ((errno == EINVAL) || (errno == EIO)) { + SDL_memset(&cstatus, 0, sizeof(cstatus)); + if (!this->hidden->iscapture) { + cstatus.channel = SND_PCM_CHANNEL_PLAYBACK; + } else { + cstatus.channel = SND_PCM_CHANNEL_CAPTURE; + } + + status = + snd_pcm_plugin_status(this->hidden->audio_handle, + &cstatus); + if (status < 0) { + QSA_SetError("snd_pcm_plugin_status", status); + return; + } + + if ((cstatus.status == SND_PCM_STATUS_UNDERRUN) || + (cstatus.status == SND_PCM_STATUS_READY)) { + if (!this->hidden->iscapture) { + status = + snd_pcm_plugin_prepare(this->hidden-> + audio_handle, + SND_PCM_CHANNEL_PLAYBACK); + } else { + status = + snd_pcm_plugin_prepare(this->hidden-> + audio_handle, + SND_PCM_CHANNEL_CAPTURE); + } + if (status < 0) { + QSA_SetError("snd_pcm_plugin_prepare", status); + return; + } + } + continue; + } else { + return; + } + } + } else { + /* we wrote all remaining data */ + towrite -= written; + pcmbuffer += written * this->spec.channels; + } + } while ((towrite > 0) && (this->enabled)); + + /* If we couldn't write, assume fatal error for now */ + if (towrite != 0) { + this->enabled = 0; + } +} + +static Uint8 * +QSA_GetDeviceBuf(_THIS) +{ + return this->hidden->pcm_buf; +} + +static void +QSA_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->audio_handle != NULL) { + if (!this->hidden->iscapture) { + /* Finish playing available samples */ + snd_pcm_plugin_flush(this->hidden->audio_handle, + SND_PCM_CHANNEL_PLAYBACK); + } else { + /* Cancel unread samples during capture */ + snd_pcm_plugin_flush(this->hidden->audio_handle, + SND_PCM_CHANNEL_CAPTURE); + } + snd_pcm_close(this->hidden->audio_handle); + this->hidden->audio_handle = NULL; + } + + if (this->hidden->pcm_buf != NULL) { + SDL_FreeAudioMem(this->hidden->pcm_buf); + this->hidden->pcm_buf = NULL; + } + + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +QSA_OpenDevice(_THIS, const char *devname, int iscapture) +{ + int status = 0; + int format = 0; + SDL_AudioFormat test_format = 0; + int found = 0; + snd_pcm_channel_setup_t csetup; + snd_pcm_channel_params_t cparams; + + /* Initialize all variables that we clean on shutdown */ + this->hidden = + (struct SDL_PrivateAudioData *) SDL_calloc(1, + (sizeof + (struct + SDL_PrivateAudioData))); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, sizeof(struct SDL_PrivateAudioData)); + + /* Initialize channel transfer parameters to default */ + QSA_InitAudioParams(&cparams); + + /* Initialize channel direction: capture or playback */ + this->hidden->iscapture = iscapture; + + /* Find deviceid and cardid by device name for playback */ + if ((!this->hidden->iscapture) && (devname != NULL)) { + uint32_t device; + int32_t status; + + /* Search in the playback devices */ + device = 0; + do { + status = SDL_strcmp(qsa_playback_device[device].name, devname); + if (status == 0) { + /* Found requested device */ + this->hidden->deviceno = qsa_playback_device[device].deviceno; + this->hidden->cardno = qsa_playback_device[device].cardno; + break; + } + device++; + if (device >= qsa_playback_devices) { + QSA_CloseDevice(this); + return SDL_SetError("No such playback device"); + } + } while (1); + } + + /* Find deviceid and cardid by device name for capture */ + if ((this->hidden->iscapture) && (devname != NULL)) { + /* Search in the capture devices */ + uint32_t device; + int32_t status; + + /* Searching in the playback devices */ + device = 0; + do { + status = SDL_strcmp(qsa_capture_device[device].name, devname); + if (status == 0) { + /* Found requested device */ + this->hidden->deviceno = qsa_capture_device[device].deviceno; + this->hidden->cardno = qsa_capture_device[device].cardno; + break; + } + device++; + if (device >= qsa_capture_devices) { + QSA_CloseDevice(this); + return SDL_SetError("No such capture device"); + } + } while (1); + } + + /* Check if SDL requested default audio device */ + if (devname == NULL) { + /* Open system default audio device */ + if (!this->hidden->iscapture) { + status = snd_pcm_open_preferred(&this->hidden->audio_handle, + &this->hidden->cardno, + &this->hidden->deviceno, + SND_PCM_OPEN_PLAYBACK); + } else { + status = snd_pcm_open_preferred(&this->hidden->audio_handle, + &this->hidden->cardno, + &this->hidden->deviceno, + SND_PCM_OPEN_CAPTURE); + } + } else { + /* Open requested audio device */ + if (!this->hidden->iscapture) { + status = + snd_pcm_open(&this->hidden->audio_handle, + this->hidden->cardno, this->hidden->deviceno, + SND_PCM_OPEN_PLAYBACK); + } else { + status = + snd_pcm_open(&this->hidden->audio_handle, + this->hidden->cardno, this->hidden->deviceno, + SND_PCM_OPEN_CAPTURE); + } + } + + /* Check if requested device is opened */ + if (status < 0) { + this->hidden->audio_handle = NULL; + QSA_CloseDevice(this); + return QSA_SetError("snd_pcm_open", status); + } + + if (!QSA_CheckBuggyCards(this, QSA_MMAP_WORKAROUND)) { + /* Disable QSA MMAP plugin for buggy audio drivers */ + status = + snd_pcm_plugin_set_disable(this->hidden->audio_handle, + PLUGIN_DISABLE_MMAP); + if (status < 0) { + QSA_CloseDevice(this); + return QSA_SetError("snd_pcm_plugin_set_disable", status); + } + } + + /* Try for a closest match on audio format */ + format = 0; + /* can't use format as SND_PCM_SFMT_U8 = 0 in qsa */ + found = 0; + + for (test_format = SDL_FirstAudioFormat(this->spec.format); !found;) { + /* if match found set format to equivalent QSA format */ + switch (test_format) { + case AUDIO_U8: + { + format = SND_PCM_SFMT_U8; + found = 1; + } + break; + case AUDIO_S8: + { + format = SND_PCM_SFMT_S8; + found = 1; + } + break; + case AUDIO_S16LSB: + { + format = SND_PCM_SFMT_S16_LE; + found = 1; + } + break; + case AUDIO_S16MSB: + { + format = SND_PCM_SFMT_S16_BE; + found = 1; + } + break; + case AUDIO_U16LSB: + { + format = SND_PCM_SFMT_U16_LE; + found = 1; + } + break; + case AUDIO_U16MSB: + { + format = SND_PCM_SFMT_U16_BE; + found = 1; + } + break; + case AUDIO_S32LSB: + { + format = SND_PCM_SFMT_S32_LE; + found = 1; + } + break; + case AUDIO_S32MSB: + { + format = SND_PCM_SFMT_S32_BE; + found = 1; + } + break; + case AUDIO_F32LSB: + { + format = SND_PCM_SFMT_FLOAT_LE; + found = 1; + } + break; + case AUDIO_F32MSB: + { + format = SND_PCM_SFMT_FLOAT_BE; + found = 1; + } + break; + default: + { + break; + } + } + + if (!found) { + test_format = SDL_NextAudioFormat(); + } + } + + /* assumes test_format not 0 on success */ + if (test_format == 0) { + QSA_CloseDevice(this); + return SDL_SetError("QSA: Couldn't find any hardware audio formats"); + } + + this->spec.format = test_format; + + /* Set the audio format */ + cparams.format.format = format; + + /* Set mono/stereo/4ch/6ch/8ch audio */ + cparams.format.voices = this->spec.channels; + + /* Set rate */ + cparams.format.rate = this->spec.freq; + + /* Setup the transfer parameters according to cparams */ + status = snd_pcm_plugin_params(this->hidden->audio_handle, &cparams); + if (status < 0) { + QSA_CloseDevice(this); + return QSA_SetError("snd_pcm_channel_params", status); + } + + /* Make sure channel is setup right one last time */ + SDL_memset(&csetup, 0, sizeof(csetup)); + if (!this->hidden->iscapture) { + csetup.channel = SND_PCM_CHANNEL_PLAYBACK; + } else { + csetup.channel = SND_PCM_CHANNEL_CAPTURE; + } + + /* Setup an audio channel */ + if (snd_pcm_plugin_setup(this->hidden->audio_handle, &csetup) < 0) { + QSA_CloseDevice(this); + return SDL_SetError("QSA: Unable to setup channel"); + } + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + this->hidden->pcm_len = this->spec.size; + + if (this->hidden->pcm_len == 0) { + this->hidden->pcm_len = + csetup.buf.block.frag_size * this->spec.channels * + (snd_pcm_format_width(format) / 8); + } + + /* + * Allocate memory to the audio buffer and initialize with silence + * (Note that buffer size must be a multiple of fragment size, so find + * closest multiple) + */ + this->hidden->pcm_buf = + (Uint8 *) SDL_AllocAudioMem(this->hidden->pcm_len); + if (this->hidden->pcm_buf == NULL) { + QSA_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->pcm_buf, this->spec.silence, + this->hidden->pcm_len); + + /* get the file descriptor */ + if (!this->hidden->iscapture) { + this->hidden->audio_fd = + snd_pcm_file_descriptor(this->hidden->audio_handle, + SND_PCM_CHANNEL_PLAYBACK); + } else { + this->hidden->audio_fd = + snd_pcm_file_descriptor(this->hidden->audio_handle, + SND_PCM_CHANNEL_CAPTURE); + } + + if (this->hidden->audio_fd < 0) { + QSA_CloseDevice(this); + return QSA_SetError("snd_pcm_file_descriptor", status); + } + + /* Prepare an audio channel */ + if (!this->hidden->iscapture) { + /* Prepare audio playback */ + status = + snd_pcm_plugin_prepare(this->hidden->audio_handle, + SND_PCM_CHANNEL_PLAYBACK); + } else { + /* Prepare audio capture */ + status = + snd_pcm_plugin_prepare(this->hidden->audio_handle, + SND_PCM_CHANNEL_CAPTURE); + } + + if (status < 0) { + QSA_CloseDevice(this); + return QSA_SetError("snd_pcm_plugin_prepare", status); + } + + /* We're really ready to rock and roll. :-) */ + return 0; +} + +static void +QSA_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +{ + uint32_t it; + uint32_t cards; + uint32_t devices; + int32_t status; + + /* Detect amount of available devices */ + /* this value can be changed in the runtime */ + cards = snd_cards(); + + /* If io-audio manager is not running we will get 0 as number */ + /* of available audio devices */ + if (cards == 0) { + /* We have no any available audio devices */ + return; + } + + /* Find requested devices by type */ + if (!iscapture) { + /* Playback devices enumeration requested */ + for (it = 0; it < cards; it++) { + devices = 0; + do { + status = + snd_card_get_longname(it, + qsa_playback_device + [qsa_playback_devices].name, + QSA_MAX_NAME_LENGTH); + if (status == EOK) { + snd_pcm_t *handle; + + /* Add device number to device name */ + sprintf(qsa_playback_device[qsa_playback_devices].name + + SDL_strlen(qsa_playback_device + [qsa_playback_devices].name), " d%d", + devices); + + /* Store associated card number id */ + qsa_playback_device[qsa_playback_devices].cardno = it; + + /* Check if this device id could play anything */ + status = + snd_pcm_open(&handle, it, devices, + SND_PCM_OPEN_PLAYBACK); + if (status == EOK) { + qsa_playback_device[qsa_playback_devices].deviceno = + devices; + status = snd_pcm_close(handle); + if (status == EOK) { + addfn(qsa_playback_device[qsa_playback_devices].name); + qsa_playback_devices++; + } + } else { + /* Check if we got end of devices list */ + if (status == -ENOENT) { + break; + } + } + } else { + break; + } + + /* Check if we reached maximum devices count */ + if (qsa_playback_devices >= QSA_MAX_DEVICES) { + break; + } + devices++; + } while (1); + + /* Check if we reached maximum devices count */ + if (qsa_playback_devices >= QSA_MAX_DEVICES) { + break; + } + } + } else { + /* Capture devices enumeration requested */ + for (it = 0; it < cards; it++) { + devices = 0; + do { + status = + snd_card_get_longname(it, + qsa_capture_device + [qsa_capture_devices].name, + QSA_MAX_NAME_LENGTH); + if (status == EOK) { + snd_pcm_t *handle; + + /* Add device number to device name */ + sprintf(qsa_capture_device[qsa_capture_devices].name + + SDL_strlen(qsa_capture_device + [qsa_capture_devices].name), " d%d", + devices); + + /* Store associated card number id */ + qsa_capture_device[qsa_capture_devices].cardno = it; + + /* Check if this device id could play anything */ + status = + snd_pcm_open(&handle, it, devices, + SND_PCM_OPEN_CAPTURE); + if (status == EOK) { + qsa_capture_device[qsa_capture_devices].deviceno = + devices; + status = snd_pcm_close(handle); + if (status == EOK) { + addfn(qsa_capture_device[qsa_capture_devices].name); + qsa_capture_devices++; + } + } else { + /* Check if we got end of devices list */ + if (status == -ENOENT) { + break; + } + } + + /* Check if we reached maximum devices count */ + if (qsa_capture_devices >= QSA_MAX_DEVICES) { + break; + } + } else { + break; + } + devices++; + } while (1); + + /* Check if we reached maximum devices count */ + if (qsa_capture_devices >= QSA_MAX_DEVICES) { + break; + } + } + } +} + +static void +QSA_WaitDone(_THIS) +{ + if (!this->hidden->iscapture) { + if (this->hidden->audio_handle != NULL) { + /* Wait till last fragment is played and stop channel */ + snd_pcm_plugin_flush(this->hidden->audio_handle, + SND_PCM_CHANNEL_PLAYBACK); + } + } else { + if (this->hidden->audio_handle != NULL) { + /* Discard all unread data and stop channel */ + snd_pcm_plugin_flush(this->hidden->audio_handle, + SND_PCM_CHANNEL_CAPTURE); + } + } +} + +static void +QSA_Deinitialize(void) +{ + /* Clear devices array on shutdown */ + SDL_memset(qsa_playback_device, 0x00, + sizeof(QSA_Device) * QSA_MAX_DEVICES); + SDL_memset(qsa_capture_device, 0x00, + sizeof(QSA_Device) * QSA_MAX_DEVICES); + qsa_playback_devices = 0; + qsa_capture_devices = 0; +} + +static int +QSA_Init(SDL_AudioDriverImpl * impl) +{ + snd_pcm_t *handle = NULL; + int32_t status = 0; + + /* Clear devices array */ + SDL_memset(qsa_playback_device, 0x00, + sizeof(QSA_Device) * QSA_MAX_DEVICES); + SDL_memset(qsa_capture_device, 0x00, + sizeof(QSA_Device) * QSA_MAX_DEVICES); + qsa_playback_devices = 0; + qsa_capture_devices = 0; + + /* Set function pointers */ + /* DeviceLock and DeviceUnlock functions are used default, */ + /* provided by SDL, which uses pthread_mutex for lock/unlock */ + impl->DetectDevices = QSA_DetectDevices; + impl->OpenDevice = QSA_OpenDevice; + impl->ThreadInit = QSA_ThreadInit; + impl->WaitDevice = QSA_WaitDevice; + impl->PlayDevice = QSA_PlayDevice; + impl->GetDeviceBuf = QSA_GetDeviceBuf; + impl->CloseDevice = QSA_CloseDevice; + impl->WaitDone = QSA_WaitDone; + impl->Deinitialize = QSA_Deinitialize; + impl->LockDevice = NULL; + impl->UnlockDevice = NULL; + + impl->OnlyHasDefaultOutputDevice = 0; + impl->ProvidesOwnCallbackThread = 0; + impl->SkipMixerLock = 0; + impl->HasCaptureSupport = 1; + impl->OnlyHasDefaultOutputDevice = 0; + impl->OnlyHasDefaultInputDevice = 0; + + /* Check if io-audio manager is running or not */ + status = snd_cards(); + if (status == 0) { + /* if no, return immediately */ + return 1; + } + + return 1; /* this audio target is available. */ +} + +AudioBootStrap QSAAUDIO_bootstrap = { + "qsa", "QNX QSA Audio", QSA_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_QSA */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/qsa/SDL_qsa_audio.h b/src/audio/qsa/SDL_qsa_audio.h new file mode 100644 index 0000000000..1717d08786 --- /dev/null +++ b/src/audio/qsa/SDL_qsa_audio.h @@ -0,0 +1,57 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +#ifndef __SDL_QSA_AUDIO_H__ +#define __SDL_QSA_AUDIO_H__ + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice* this + +struct SDL_PrivateAudioData +{ + /* SDL capture state */ + int iscapture; + + /* The audio device handle */ + int cardno; + int deviceno; + snd_pcm_t *audio_handle; + + /* The audio file descriptor */ + int audio_fd; + + /* Select timeout status */ + uint32_t timeout_on_wait; + + /* Raw mixing buffer */ + Uint8 *pcm_buf; + Uint32 pcm_len; +}; + +#endif /* __SDL_QSA_AUDIO_H__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/sdlgenaudiocvt.pl b/src/audio/sdlgenaudiocvt.pl new file mode 100755 index 0000000000..474ce8112e --- /dev/null +++ b/src/audio/sdlgenaudiocvt.pl @@ -0,0 +1,760 @@ +#!/usr/bin/perl -w + +use warnings; +use strict; + +my @audiotypes = qw( + U8 + S8 + U16LSB + S16LSB + U16MSB + S16MSB + S32LSB + S32MSB + F32LSB + F32MSB +); + +my @channels = ( 1, 2, 4, 6, 8 ); +my %funcs; +my $custom_converters = 0; + + +sub getTypeConvertHashId { + my ($from, $to) = @_; + return "TYPECONVERTER $from/$to"; +} + + +sub getResamplerHashId { + my ($from, $channels, $upsample, $multiple) = @_; + return "RESAMPLER $from/$channels/$upsample/$multiple"; +} + + +sub outputHeader { + print < + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" +#include "SDL_audio.h" +#include "SDL_audio_c.h" + +#ifndef DEBUG_CONVERT +#define DEBUG_CONVERT 0 +#endif + + +/* If you can guarantee your data and need space, you can eliminate code... */ + +/* Just build the arbitrary resamplers if you're saving code space. */ +#ifndef LESS_RESAMPLERS +#define LESS_RESAMPLERS 0 +#endif + +/* Don't build any resamplers if you're REALLY saving code space. */ +#ifndef NO_RESAMPLERS +#define NO_RESAMPLERS 0 +#endif + +/* Don't build any type converters if you're saving code space. */ +#ifndef NO_CONVERTERS +#define NO_CONVERTERS 0 +#endif + + +/* *INDENT-OFF* */ + +EOF + + my @vals = ( 127, 32767, 2147483647 ); + foreach (@vals) { + my $val = $_; + my $fval = 1.0 / $val; + print("#define DIVBY${val} ${fval}f\n"); + } + + print("\n"); +} + +sub outputFooter { + print < 8) { + $code = "SDL_Swap${BEorLE}${size}($val)"; + } else { + $code = $val; + } + + if (($signed) and (!$float)) { + $code = "((Sint${size}) $code)"; + } + } + + return "${code}"; +} + + +sub maxIntVal { + my $size = shift; + if ($size == 8) { + return 0x7F; + } elsif ($size == 16) { + return 0x7FFF; + } elsif ($size == 32) { + return 0x7FFFFFFF; + } + + die("bug in script.\n"); +} + +sub getFloatToIntMult { + my $size = shift; + my $val = maxIntVal($size) . '.0'; + $val .= 'f' if ($size < 32); + return $val; +} + +sub getIntToFloatDivBy { + my $size = shift; + return 'DIVBY' . maxIntVal($size); +} + +sub getSignFlipVal { + my $size = shift; + if ($size == 8) { + return '0x80'; + } elsif ($size == 16) { + return '0x8000'; + } elsif ($size == 32) { + return '0x80000000'; + } + + die("bug in script.\n"); +} + +sub buildCvtFunc { + my ($from, $to) = @_; + my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from); + my ($tsigned, $tfloat, $tsize, $tendian, $tctype) = splittype($to); + my $diffs = 0; + $diffs++ if ($fsize != $tsize); + $diffs++ if ($fsigned != $tsigned); + $diffs++ if ($ffloat != $tfloat); + $diffs++ if ($fendian ne $tendian); + + return if ($diffs == 0); + + my $hashid = getTypeConvertHashId($from, $to); + if (1) { # !!! FIXME: if ($diffs > 1) { + my $sym = "SDL_Convert_${from}_to_${to}"; + $funcs{$hashid} = $sym; + $custom_converters++; + + # Always unsigned for ints, for possible byteswaps. + my $srctype = (($ffloat) ? 'float' : "Uint${fsize}"); + + print <buf + cvt->len_cvt)) - 1; + dst = (($tctype *) (cvt->buf + cvt->len_cvt * $mult)) - 1; + for (i = cvt->len_cvt / sizeof ($srctype); i; --i, --src, --dst) { +EOF + } else { + print <buf; + dst = ($tctype *) cvt->buf; + for (i = cvt->len_cvt / sizeof ($srctype); i; --i, ++src, ++dst) { +EOF + } + + # Have to convert to/from float/int. + # !!! FIXME: cast through double for int32<->float? + my $code = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, '*src'); + if ($ffloat != $tfloat) { + if ($ffloat) { + my $mult = getFloatToIntMult($tsize); + if (!$tsigned) { # bump from -1.0f/1.0f to 0.0f/2.0f + $code = "($code + 1.0f)"; + } + $code = "(($tctype) ($code * $mult))"; + } else { + # $divby will be the reciprocal, to avoid pipeline stalls + # from floating point division...so multiply it. + my $divby = getIntToFloatDivBy($fsize); + $code = "(((float) $code) * $divby)"; + if (!$fsigned) { # bump from 0.0f/2.0f to -1.0f/1.0f. + $code = "($code - 1.0f)"; + } + } + } else { + # All integer conversions here. + if ($fsigned != $tsigned) { + my $signflipval = getSignFlipVal($fsize); + $code = "(($code) ^ $signflipval)"; + } + + my $shiftval = abs($fsize - $tsize); + if ($fsize < $tsize) { + $code = "((($tctype) $code) << $shiftval)"; + } elsif ($fsize > $tsize) { + $code = "(($tctype) ($code >> $shiftval))"; + } + } + + my $swap = getSwapFunc($tsize, $tsigned, $tfloat, $tendian, 'val'); + + print < $tsize) { + my $divby = $fsize / $tsize; + print(" cvt->len_cvt /= $divby;\n"); + } elsif ($fsize < $tsize) { + my $mult = $tsize / $fsize; + print(" cvt->len_cvt *= $mult;\n"); + } + + print <filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, AUDIO_$to); + } +} + +EOF + + } else { + if ($fsigned != $tsigned) { + $funcs{$hashid} = 'SDL_ConvertSigned'; + } elsif ($ffloat != $tfloat) { + $funcs{$hashid} = 'SDL_ConvertFloat'; + } elsif ($fsize != $tsize) { + $funcs{$hashid} = 'SDL_ConvertSize'; + } elsif ($fendian ne $tendian) { + $funcs{$hashid} = 'SDL_ConvertEndian'; + } else { + die("error in script.\n"); + } + } +} + + +sub buildTypeConverters { + print "#if !NO_CONVERTERS\n\n"; + foreach (@audiotypes) { + my $from = $_; + foreach (@audiotypes) { + my $to = $_; + buildCvtFunc($from, $to); + } + } + print "#endif /* !NO_CONVERTERS */\n\n\n"; + + print "const SDL_AudioTypeFilters sdl_audio_type_filters[] =\n{\n"; + print "#if !NO_CONVERTERS\n"; + foreach (@audiotypes) { + my $from = $_; + foreach (@audiotypes) { + my $to = $_; + if ($from ne $to) { + my $hashid = getTypeConvertHashId($from, $to); + my $sym = $funcs{$hashid}; + print(" { AUDIO_$from, AUDIO_$to, $sym },\n"); + } + } + } + print "#endif /* !NO_CONVERTERS */\n"; + + print(" { 0, 0, NULL }\n"); + print "};\n\n\n"; +} + +sub getBiggerCtype { + my ($isfloat, $size) = @_; + + if ($isfloat) { + if ($size == 32) { + return 'double'; + } + die("bug in script.\n"); + } + + if ($size == 8) { + return 'Sint16'; + } elsif ($size == 16) { + return 'Sint32' + } elsif ($size == 32) { + return 'Sint64' + } + + die("bug in script.\n"); +} + + +# These handle arbitrary resamples...44100Hz to 48000Hz, for example. +# Man, this code is skanky. +sub buildArbitraryResampleFunc { + # !!! FIXME: we do a lot of unnecessary and ugly casting in here, due to getSwapFunc(). + my ($from, $channels, $upsample) = @_; + my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from); + + my $bigger = getBiggerCtype($ffloat, $fsize); + my $interp = ($ffloat) ? '* 0.5' : '>> 1'; + + my $resample = ($upsample) ? 'Upsample' : 'Downsample'; + my $hashid = getResamplerHashId($from, $channels, $upsample, 0); + my $sym = "SDL_${resample}_${from}_${channels}c"; + $funcs{$hashid} = $sym; + $custom_converters++; + + my $fudge = $fsize * $channels * 2; # !!! FIXME + my $eps_adjust = ($upsample) ? 'dstsize' : 'srcsize'; + my $incr = ''; + my $incr2 = ''; + + + # !!! FIXME: DEBUG_CONVERT should report frequencies. + print <rate_incr); +#endif + + const int srcsize = cvt->len_cvt - $fudge; + const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr); + register int eps = 0; +EOF + + my $endcomparison = '!='; + + # Upsampling (growing the buffer) needs to work backwards, since we + # overwrite the buffer as we go. + if ($upsample) { + $endcomparison = '>='; # dst > target + print <buf + dstsize)) - $channels; + const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels; + const $fctype *target = ((const $fctype *) cvt->buf); +EOF + } else { + $endcomparison = '<'; # dst < target + print <buf; + const $fctype *src = ($fctype *) cvt->buf; + const $fctype *target = (const $fctype *) (cvt->buf + dstsize); +EOF + } + + for (my $i = 0; $i < $channels; $i++) { + my $idx = ($upsample) ? (($channels - $i) - 1) : $i; + my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]"); + print <= dstsize) { + $incr2; +EOF + } else { # downsample. + $incr = ($channels == 1) ? 'src++' : "src += $channels"; + print <= srcsize) { +EOF + for (my $i = 0; $i < $channels; $i++) { + my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "sample${i}"); + print <len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +EOF + +} + +# These handle clean resamples...doubling and quadrupling the sample rate, etc. +sub buildMultipleResampleFunc { + # !!! FIXME: we do a lot of unnecessary and ugly casting in here, due to getSwapFunc(). + my ($from, $channels, $upsample, $multiple) = @_; + my ($fsigned, $ffloat, $fsize, $fendian, $fctype) = splittype($from); + + my $bigger = getBiggerCtype($ffloat, $fsize); + my $interp = ($ffloat) ? '* 0.5' : '>> 1'; + my $interp2 = ($ffloat) ? '* 0.25' : '>> 2'; + my $mult3 = ($ffloat) ? '3.0' : '3'; + my $lencvtop = ($upsample) ? '*' : '/'; + + my $resample = ($upsample) ? 'Upsample' : 'Downsample'; + my $hashid = getResamplerHashId($from, $channels, $upsample, $multiple); + my $sym = "SDL_${resample}_${from}_${channels}c_x${multiple}"; + $funcs{$hashid} = $sym; + $custom_converters++; + + # !!! FIXME: DEBUG_CONVERT should report frequencies. + print <len_cvt $lencvtop $multiple; +EOF + + my $endcomparison = '!='; + + # Upsampling (growing the buffer) needs to work backwards, since we + # overwrite the buffer as we go. + if ($upsample) { + $endcomparison = '>='; # dst > target + print <buf + dstsize)) - $channels * $multiple; + const $fctype *src = (($fctype *) (cvt->buf + cvt->len_cvt)) - $channels; + const $fctype *target = ((const $fctype *) cvt->buf); +EOF + } else { + $endcomparison = '<'; # dst < target + print <buf; + const $fctype *src = ($fctype *) cvt->buf; + const $fctype *target = (const $fctype *) (cvt->buf + dstsize); +EOF + } + + for (my $i = 0; $i < $channels; $i++) { + my $idx = ($upsample) ? (($channels - $i) - 1) : $i; + my $val = getSwapFunc($fsize, $fsigned, $ffloat, $fendian, "src[$idx]"); + print <= 0; $i--) { + my $dsti = $i + $channels; + print <= 0; $i--) { + my $dsti = $i; + print <= 0; $i--) { + my $dsti = $i + ($channels * 3); + print <= 0; $i--) { + my $dsti = $i + ($channels * 2); + print <= 0; $i--) { + my $dsti = $i + ($channels * 1); + print <= 0; $i--) { + my $dsti = $i + ($channels * 0); + print <len_cvt = dstsize; + if (cvt->filters[++cvt->filter_index]) { + cvt->filters[cvt->filter_index] (cvt, format); + } +} + +EOF + +} + +sub buildResamplers { + print "#if !NO_RESAMPLERS\n\n"; + foreach (@audiotypes) { + my $from = $_; + foreach (@channels) { + my $channel = $_; + buildArbitraryResampleFunc($from, $channel, 1); + buildArbitraryResampleFunc($from, $channel, 0); + } + } + + print "\n#if !LESS_RESAMPLERS\n\n"; + foreach (@audiotypes) { + my $from = $_; + foreach (@channels) { + my $channel = $_; + for (my $multiple = 2; $multiple <= 4; $multiple += 2) { + buildMultipleResampleFunc($from, $channel, 1, $multiple); + buildMultipleResampleFunc($from, $channel, 0, $multiple); + } + } + } + + print "#endif /* !LESS_RESAMPLERS */\n"; + print "#endif /* !NO_RESAMPLERS */\n\n\n"; + + print "const SDL_AudioRateFilters sdl_audio_rate_filters[] =\n{\n"; + print "#if !NO_RESAMPLERS\n"; + foreach (@audiotypes) { + my $from = $_; + foreach (@channels) { + my $channel = $_; + for (my $upsample = 0; $upsample <= 1; $upsample++) { + my $hashid = getResamplerHashId($from, $channel, $upsample, 0); + my $sym = $funcs{$hashid}; + print(" { AUDIO_$from, $channel, $upsample, 0, $sym },\n"); + } + } + } + + print "#if !LESS_RESAMPLERS\n"; + foreach (@audiotypes) { + my $from = $_; + foreach (@channels) { + my $channel = $_; + for (my $multiple = 2; $multiple <= 4; $multiple += 2) { + for (my $upsample = 0; $upsample <= 1; $upsample++) { + my $hashid = getResamplerHashId($from, $channel, $upsample, $multiple); + my $sym = $funcs{$hashid}; + print(" { AUDIO_$from, $channel, $upsample, $multiple, $sym },\n"); + } + } + } + } + + print "#endif /* !LESS_RESAMPLERS */\n"; + print "#endif /* !NO_RESAMPLERS */\n"; + print(" { 0, 0, 0, 0, NULL }\n"); + print "};\n\n"; +} + + +# mainline ... + +outputHeader(); +buildTypeConverters(); +buildResamplers(); +outputFooter(); + +exit 0; + +# end of sdlgenaudiocvt.pl ... + diff --git a/src/audio/sndio/SDL_sndioaudio.c b/src/audio/sndio/SDL_sndioaudio.c new file mode 100644 index 0000000000..16d0ec3560 --- /dev/null +++ b/src/audio/sndio/SDL_sndioaudio.c @@ -0,0 +1,329 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_SNDIO + +/* OpenBSD sndio target */ + +#if HAVE_STDIO_H +#include +#endif + +#ifdef HAVE_SIGNAL_H +#include +#endif + +#include + +#include "SDL_audio.h" +#include "../SDL_audiomem.h" +#include "../SDL_audio_c.h" +#include "SDL_sndioaudio.h" + +#ifdef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC +#include "SDL_loadso.h" +#endif + +static struct sio_hdl * (*SNDIO_sio_open)(const char *, unsigned int, int); +static void (*SNDIO_sio_close)(struct sio_hdl *); +static int (*SNDIO_sio_setpar)(struct sio_hdl *, struct sio_par *); +static int (*SNDIO_sio_getpar)(struct sio_hdl *, struct sio_par *); +static int (*SNDIO_sio_start)(struct sio_hdl *); +static int (*SNDIO_sio_stop)(struct sio_hdl *); +static size_t (*SNDIO_sio_read)(struct sio_hdl *, void *, size_t); +static size_t (*SNDIO_sio_write)(struct sio_hdl *, const void *, size_t); +static void (*SNDIO_sio_initpar)(struct sio_par *); + +#ifdef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC +static const char *sndio_library = SDL_AUDIO_DRIVER_SNDIO_DYNAMIC; +static void *sndio_handle = NULL; + +static int +load_sndio_sym(const char *fn, void **addr) +{ + *addr = SDL_LoadFunction(sndio_handle, fn); + if (*addr == NULL) { + /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ + return 0; + } + + return 1; +} + +/* cast funcs to char* first, to please GCC's strict aliasing rules. */ +#define SDL_SNDIO_SYM(x) \ + if (!load_sndio_sym(#x, (void **) (char *) &SNDIO_##x)) return -1 +#else +#define SDL_SNDIO_SYM(x) SNDIO_##x = x +#endif + +static int +load_sndio_syms(void) +{ + SDL_SNDIO_SYM(sio_open); + SDL_SNDIO_SYM(sio_close); + SDL_SNDIO_SYM(sio_setpar); + SDL_SNDIO_SYM(sio_getpar); + SDL_SNDIO_SYM(sio_start); + SDL_SNDIO_SYM(sio_stop); + SDL_SNDIO_SYM(sio_read); + SDL_SNDIO_SYM(sio_write); + SDL_SNDIO_SYM(sio_initpar); + return 0; +} + +#undef SDL_SNDIO_SYM + +#ifdef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC + +static void +UnloadSNDIOLibrary(void) +{ + if (sndio_handle != NULL) { + SDL_UnloadObject(sndio_handle); + sndio_handle = NULL; + } +} + +static int +LoadSNDIOLibrary(void) +{ + int retval = 0; + if (sndio_handle == NULL) { + sndio_handle = SDL_LoadObject(sndio_library); + if (sndio_handle == NULL) { + retval = -1; + /* Don't call SDL_SetError(): SDL_LoadObject already did. */ + } else { + retval = load_sndio_syms(); + if (retval < 0) { + UnloadSNDIOLibrary(); + } + } + } + return retval; +} + +#else + +static void +UnloadSNDIOLibrary(void) +{ +} + +static int +LoadSNDIOLibrary(void) +{ + load_sndio_syms(); + return 0; +} + +#endif /* SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */ + + + + +static void +SNDIO_WaitDevice(_THIS) +{ + /* no-op; SNDIO_sio_write() blocks if necessary. */ +} + +static void +SNDIO_PlayDevice(_THIS) +{ + const int written = SNDIO_sio_write(this->hidden->dev, + this->hidden->mixbuf, + this->hidden->mixlen); + + /* If we couldn't write, assume fatal error for now */ + if ( written == 0 ) { + this->enabled = 0; + } +#ifdef DEBUG_AUDIO + fprintf(stderr, "Wrote %d bytes of audio data\n", written); +#endif +} + +static Uint8 * +SNDIO_GetDeviceBuf(_THIS) +{ + return this->hidden->mixbuf; +} + +static void +SNDIO_WaitDone(_THIS) +{ + SNDIO_sio_stop(this->hidden->dev); +} + +static void +SNDIO_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if ( this->hidden->dev != NULL ) { + SNDIO_sio_close(this->hidden->dev); + this->hidden->dev = NULL; + } + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +SNDIO_OpenDevice(_THIS, const char *devname, int iscapture) +{ + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + struct sio_par par; + int status; + + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc(sizeof(*this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, sizeof(*this->hidden)); + + this->hidden->mixlen = this->spec.size; + + /* !!! FIXME: SIO_DEVANY can be a specific device... */ + if ((this->hidden->dev = SNDIO_sio_open(NULL, SIO_PLAY, 0)) == NULL) { + SNDIO_CloseDevice(this); + return SDL_SetError("sio_open() failed"); + } + + SNDIO_sio_initpar(&par); + + par.rate = this->spec.freq; + par.pchan = this->spec.channels; + par.round = this->spec.samples; + par.appbufsz = par.round * 2; + + /* Try for a closest match on audio format */ + status = -1; + while (test_format && (status < 0)) { + if (!SDL_AUDIO_ISFLOAT(test_format)) { + par.le = SDL_AUDIO_ISLITTLEENDIAN(test_format) ? 1 : 0; + par.sig = SDL_AUDIO_ISSIGNED(test_format) ? 1 : 0; + par.bits = SDL_AUDIO_BITSIZE(test_format); + + if (SNDIO_sio_setpar(this->hidden->dev, &par) == 1) { + status = 0; + break; + } + } + test_format = SDL_NextAudioFormat(); + } + + if (status < 0) { + SNDIO_CloseDevice(this); + return SDL_SetError("sndio: Couldn't find any hardware audio formats"); + } + + if (SNDIO_sio_getpar(this->hidden->dev, &par) == 0) { + SNDIO_CloseDevice(this); + return SDL_SetError("sio_getpar() failed"); + } + + if ((par.bits == 32) && (par.sig) && (par.le)) + this->spec.format = AUDIO_S32LSB; + else if ((par.bits == 32) && (par.sig) && (!par.le)) + this->spec.format = AUDIO_S32MSB; + else if ((par.bits == 16) && (par.sig) && (par.le)) + this->spec.format = AUDIO_S16LSB; + else if ((par.bits == 16) && (par.sig) && (!par.le)) + this->spec.format = AUDIO_S16MSB; + else if ((par.bits == 16) && (!par.sig) && (par.le)) + this->spec.format = AUDIO_U16LSB; + else if ((par.bits == 16) && (!par.sig) && (!par.le)) + this->spec.format = AUDIO_U16MSB; + else if ((par.bits == 8) && (par.sig)) + this->spec.format = AUDIO_S8; + else if ((par.bits == 8) && (!par.sig)) + this->spec.format = AUDIO_U8; + else { + SNDIO_CloseDevice(this); + return SDL_SetError("sndio: Got unsupported hardware audio format."); + } + + this->spec.freq = par.rate; + this->spec.channels = par.pchan; + this->spec.samples = par.round; + + /* Calculate the final parameters for this audio specification */ + SDL_CalculateAudioSpec(&this->spec); + + /* Allocate mixing buffer */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + SNDIO_CloseDevice(this); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen); + + if (!SNDIO_sio_start(this->hidden->dev)) { + return SDL_SetError("sio_start() failed"); + } + + /* We're ready to rock and roll. :-) */ + return 0; +} + +static void +SNDIO_Deinitialize(void) +{ + UnloadSNDIOLibrary(); +} + +static int +SNDIO_Init(SDL_AudioDriverImpl * impl) +{ + if (LoadSNDIOLibrary() < 0) { + return 0; + } + + /* Set the function pointers */ + impl->OpenDevice = SNDIO_OpenDevice; + impl->WaitDevice = SNDIO_WaitDevice; + impl->PlayDevice = SNDIO_PlayDevice; + impl->GetDeviceBuf = SNDIO_GetDeviceBuf; + impl->WaitDone = SNDIO_WaitDone; + impl->CloseDevice = SNDIO_CloseDevice; + impl->Deinitialize = SNDIO_Deinitialize; + impl->OnlyHasDefaultOutputDevice = 1; /* !!! FIXME: sndio can handle multiple devices. */ + + return 1; /* this audio target is available. */ +} + +AudioBootStrap SNDIO_bootstrap = { + "sndio", "OpenBSD sndio", SNDIO_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_SNDIO */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/sndio/SDL_sndioaudio.h b/src/audio/sndio/SDL_sndioaudio.h new file mode 100644 index 0000000000..94e1542e44 --- /dev/null +++ b/src/audio/sndio/SDL_sndioaudio.h @@ -0,0 +1,45 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_sndioaudio_h +#define _SDL_sndioaudio_h + +#include + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The audio device handle */ + struct sio_hdl *dev; + + /* Raw mixing buffer */ + Uint8 *mixbuf; + int mixlen; +}; + +#endif /* _SDL_sndioaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/sun/SDL_sunaudio.c b/src/audio/sun/SDL_sunaudio.c index 7a39e71d1b..950ba444c3 100644 --- a/src/audio/sun/SDL_sunaudio.c +++ b/src/audio/sun/SDL_sunaudio.c @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if SDL_AUDIO_DRIVER_SUNAUDIO + /* Allow access to a raw mixing buffer */ #include @@ -45,338 +46,312 @@ #include "SDL_sunaudio.h" /* Open the audio device for playback, and don't block if busy */ -#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) -/* Audio driver functions */ -static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DSP_WaitAudio(_THIS); -static void DSP_PlayAudio(_THIS); -static Uint8 *DSP_GetAudioBuf(_THIS); -static void DSP_CloseAudio(_THIS); +#if defined(AUDIO_GETINFO) && !defined(AUDIO_GETBUFINFO) +#define AUDIO_GETBUFINFO AUDIO_GETINFO +#endif +/* Audio driver functions */ static Uint8 snd2au(int sample); /* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - int fd; - int available; - - available = 0; - fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 1); - if ( fd >= 0 ) { - available = 1; - close(fd); - } - return(available); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) +static void +SUNAUDIO_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) { - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - audio_fd = -1; - - /* Set the function pointers */ - this->OpenAudio = DSP_OpenAudio; - this->WaitAudio = DSP_WaitAudio; - this->PlayAudio = DSP_PlayAudio; - this->GetAudioBuf = DSP_GetAudioBuf; - this->CloseAudio = DSP_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; + SDL_EnumUnixAudioDevices(iscapture, 1, (int (*)(int fd)) NULL, addfn); } -AudioBootStrap SUNAUDIO_bootstrap = { - "audio", "UNIX /dev/audio interface", - Audio_Available, Audio_CreateDevice -}; - #ifdef DEBUG_AUDIO -void CheckUnderflow(_THIS) +void +CheckUnderflow(_THIS) { -#ifdef AUDIO_GETINFO - audio_info_t info; - int left; - - ioctl(audio_fd, AUDIO_GETINFO, &info); - left = (written - info.play.samples); - if ( written && (left == 0) ) { - fprintf(stderr, "audio underflow!\n"); - } +#ifdef AUDIO_GETBUFINFO + audio_info_t info; + int left; + + ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info); + left = (this->hidden->written - info.play.samples); + if (this->hidden->written && (left == 0)) { + fprintf(stderr, "audio underflow!\n"); + } #endif } #endif -void DSP_WaitAudio(_THIS) +static void +SUNAUDIO_WaitDevice(_THIS) { -#ifdef AUDIO_GETINFO -#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */ - audio_info_t info; - Sint32 left; - - ioctl(audio_fd, AUDIO_GETINFO, &info); - left = (written - info.play.samples); - if ( left > fragsize ) { - Sint32 sleepy; - - sleepy = ((left - fragsize)/frequency); - sleepy -= SLEEP_FUDGE; - if ( sleepy > 0 ) { - SDL_Delay(sleepy); - } - } +#ifdef AUDIO_GETBUFINFO +#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */ + audio_info_t info; + Sint32 left; + + ioctl(this->hidden->audio_fd, AUDIO_GETBUFINFO, &info); + left = (this->hidden->written - info.play.samples); + if (left > this->hidden->fragsize) { + Sint32 sleepy; + + sleepy = ((left - this->hidden->fragsize) / this->hidden->frequency); + sleepy -= SLEEP_FUDGE; + if (sleepy > 0) { + SDL_Delay(sleepy); + } + } #else - fd_set fdset; + fd_set fdset; - FD_ZERO(&fdset); - FD_SET(audio_fd, &fdset); - select(audio_fd+1, NULL, &fdset, NULL, NULL); + FD_ZERO(&fdset); + FD_SET(this->hidden->audio_fd, &fdset); + select(this->hidden->audio_fd + 1, NULL, &fdset, NULL, NULL); #endif } -void DSP_PlayAudio(_THIS) +static void +SUNAUDIO_PlayDevice(_THIS) { - /* Write the audio data */ - if ( ulaw_only ) { - /* Assuming that this->spec.freq >= 8000 Hz */ - int accum, incr, pos; - Uint8 *aubuf; - - accum = 0; - incr = this->spec.freq/8; - aubuf = ulaw_buf; - switch (audio_fmt & 0xFF) { - case 8: { - Uint8 *sndbuf; - - sndbuf = mixbuf; - for ( pos=0; pos < fragsize; ++pos ) { - *aubuf = snd2au((0x80-*sndbuf)*64); - accum += incr; - while ( accum > 0 ) { - accum -= 1000; - sndbuf += 1; - } - aubuf += 1; - } - } - break; - case 16: { - Sint16 *sndbuf; - - sndbuf = (Sint16 *)mixbuf; - for ( pos=0; pos < fragsize; ++pos ) { - *aubuf = snd2au(*sndbuf/4); - accum += incr; - while ( accum > 0 ) { - accum -= 1000; - sndbuf += 1; - } - aubuf += 1; - } - } - break; - } + /* Write the audio data */ + if (this->hidden->ulaw_only) { + /* Assuming that this->spec.freq >= 8000 Hz */ + int accum, incr, pos; + Uint8 *aubuf; + + accum = 0; + incr = this->spec.freq / 8; + aubuf = this->hidden->ulaw_buf; + switch (this->hidden->audio_fmt & 0xFF) { + case 8: + { + Uint8 *sndbuf; + + sndbuf = this->hidden->mixbuf; + for (pos = 0; pos < this->hidden->fragsize; ++pos) { + *aubuf = snd2au((0x80 - *sndbuf) * 64); + accum += incr; + while (accum > 0) { + accum -= 1000; + sndbuf += 1; + } + aubuf += 1; + } + } + break; + case 16: + { + Sint16 *sndbuf; + + sndbuf = (Sint16 *) this->hidden->mixbuf; + for (pos = 0; pos < this->hidden->fragsize; ++pos) { + *aubuf = snd2au(*sndbuf / 4); + accum += incr; + while (accum > 0) { + accum -= 1000; + sndbuf += 1; + } + aubuf += 1; + } + } + break; + } #ifdef DEBUG_AUDIO - CheckUnderflow(this); + CheckUnderflow(this); #endif - if ( write(audio_fd, ulaw_buf, fragsize) < 0 ) { - /* Assume fatal error, for now */ - this->enabled = 0; - } - written += fragsize; - } else { + if (write(this->hidden->audio_fd, this->hidden->ulaw_buf, + this->hidden->fragsize) < 0) { + /* Assume fatal error, for now */ + this->enabled = 0; + } + this->hidden->written += this->hidden->fragsize; + } else { #ifdef DEBUG_AUDIO - CheckUnderflow(this); + CheckUnderflow(this); #endif - if ( write(audio_fd, mixbuf, this->spec.size) < 0 ) { - /* Assume fatal error, for now */ - this->enabled = 0; - } - written += fragsize; - } + if (write(this->hidden->audio_fd, this->hidden->mixbuf, + this->spec.size) < 0) { + /* Assume fatal error, for now */ + this->enabled = 0; + } + this->hidden->written += this->hidden->fragsize; + } } -Uint8 *DSP_GetAudioBuf(_THIS) +static Uint8 * +SUNAUDIO_GetDeviceBuf(_THIS) { - return(mixbuf); + return (this->hidden->mixbuf); } -void DSP_CloseAudio(_THIS) +static void +SUNAUDIO_CloseDevice(_THIS) { - if ( mixbuf != NULL ) { - SDL_FreeAudioMem(mixbuf); - mixbuf = NULL; - } - if ( ulaw_buf != NULL ) { - SDL_free(ulaw_buf); - ulaw_buf = NULL; - } - close(audio_fd); + if (this->hidden != NULL) { + if (this->hidden->mixbuf != NULL) { + SDL_FreeAudioMem(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + if (this->hidden->ulaw_buf != NULL) { + SDL_free(this->hidden->ulaw_buf); + this->hidden->ulaw_buf = NULL; + } + if (this->hidden->audio_fd >= 0) { + close(this->hidden->audio_fd); + this->hidden->audio_fd = -1; + } + SDL_free(this->hidden); + this->hidden = NULL; + } } -int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec) +static int +SUNAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) { - char audiodev[1024]; + const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); + SDL_AudioFormat format = 0; + audio_info_t info; + + /* We don't care what the devname is...we'll try to open anything. */ + /* ...but default to first name in the list... */ + if (devname == NULL) { + devname = SDL_GetAudioDeviceName(0, iscapture); + if (devname == NULL) { + return SDL_SetError("No such audio device"); + } + } + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Open the audio device */ + this->hidden->audio_fd = open(devname, flags, 0); + if (this->hidden->audio_fd < 0) { + return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno)); + } + #ifdef AUDIO_SETINFO - int enc; + int enc; #endif - int desired_freq = spec->freq; - - /* Initialize our freeable variables, in case we fail*/ - audio_fd = -1; - mixbuf = NULL; - ulaw_buf = NULL; + int desired_freq = this->spec.freq; - /* Determine the audio parameters from the AudioSpec */ - switch ( spec->format & 0xFF ) { + /* Determine the audio parameters from the AudioSpec */ + switch (SDL_AUDIO_BITSIZE(this->spec.format)) { - case 8: { /* Unsigned 8 bit audio data */ - spec->format = AUDIO_U8; + case 8: + { /* Unsigned 8 bit audio data */ + this->spec.format = AUDIO_U8; #ifdef AUDIO_SETINFO - enc = AUDIO_ENCODING_LINEAR8; + enc = AUDIO_ENCODING_LINEAR8; #endif - } - break; + } + break; - case 16: { /* Signed 16 bit audio data */ - spec->format = AUDIO_S16SYS; + case 16: + { /* Signed 16 bit audio data */ + this->spec.format = AUDIO_S16SYS; #ifdef AUDIO_SETINFO - enc = AUDIO_ENCODING_LINEAR; + enc = AUDIO_ENCODING_LINEAR; #endif - } - break; - - default: { - SDL_SetError("Unsupported audio format"); - return(-1); - } - } - audio_fmt = spec->format; - - /* Open the audio device */ - audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 1); - if ( audio_fd < 0 ) { - SDL_SetError("Couldn't open %s: %s", audiodev, - strerror(errno)); - return(-1); - } - - ulaw_only = 0; /* modern Suns do support linear audio */ + } + break; + + default: + { + /* !!! FIXME: fallback to conversion on unsupported types! */ + return SDL_SetError("Unsupported audio format"); + } + } + this->hidden->audio_fmt = this->spec.format; + + this->hidden->ulaw_only = 0; /* modern Suns do support linear audio */ #ifdef AUDIO_SETINFO - for(;;) { - audio_info_t info; - AUDIO_INITINFO(&info); /* init all fields to "no change" */ - - /* Try to set the requested settings */ - info.play.sample_rate = spec->freq; - info.play.channels = spec->channels; - info.play.precision = (enc == AUDIO_ENCODING_ULAW) - ? 8 : spec->format & 0xff; - info.play.encoding = enc; - if( ioctl(audio_fd, AUDIO_SETINFO, &info) == 0 ) { - - /* Check to be sure we got what we wanted */ - if(ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) { - SDL_SetError("Error getting audio parameters: %s", - strerror(errno)); - return -1; - } - if(info.play.encoding == enc - && info.play.precision == (spec->format & 0xff) - && info.play.channels == spec->channels) { - /* Yow! All seems to be well! */ - spec->freq = info.play.sample_rate; - break; - } - } - - switch(enc) { - case AUDIO_ENCODING_LINEAR8: - /* unsigned 8bit apparently not supported here */ - enc = AUDIO_ENCODING_LINEAR; - spec->format = AUDIO_S16SYS; - break; /* try again */ - - case AUDIO_ENCODING_LINEAR: - /* linear 16bit didn't work either, resort to µ-law */ - enc = AUDIO_ENCODING_ULAW; - spec->channels = 1; - spec->freq = 8000; - spec->format = AUDIO_U8; - ulaw_only = 1; - break; - - default: - /* oh well... */ - SDL_SetError("Error setting audio parameters: %s", - strerror(errno)); - return -1; - } - } + for (;;) { + audio_info_t info; + AUDIO_INITINFO(&info); /* init all fields to "no change" */ + + /* Try to set the requested settings */ + info.play.sample_rate = this->spec.freq; + info.play.channels = this->spec.channels; + info.play.precision = (enc == AUDIO_ENCODING_ULAW) + ? 8 : this->spec.format & 0xff; + info.play.encoding = enc; + if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) == 0) { + + /* Check to be sure we got what we wanted */ + if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) { + return SDL_SetError("Error getting audio parameters: %s", + strerror(errno)); + } + if (info.play.encoding == enc + && info.play.precision == (this->spec.format & 0xff) + && info.play.channels == this->spec.channels) { + /* Yow! All seems to be well! */ + this->spec.freq = info.play.sample_rate; + break; + } + } + + switch (enc) { + case AUDIO_ENCODING_LINEAR8: + /* unsigned 8bit apparently not supported here */ + enc = AUDIO_ENCODING_LINEAR; + this->spec.format = AUDIO_S16SYS; + break; /* try again */ + + case AUDIO_ENCODING_LINEAR: + /* linear 16bit didn't work either, resort to µ-law */ + enc = AUDIO_ENCODING_ULAW; + this->spec.channels = 1; + this->spec.freq = 8000; + this->spec.format = AUDIO_U8; + this->hidden->ulaw_only = 1; + break; + + default: + /* oh well... */ + return SDL_SetError("Error setting audio parameters: %s", + strerror(errno)); + } + } #endif /* AUDIO_SETINFO */ - written = 0; - - /* We can actually convert on-the-fly to U-Law */ - if ( ulaw_only ) { - spec->freq = desired_freq; - fragsize = (spec->samples*1000)/(spec->freq/8); - frequency = 8; - ulaw_buf = (Uint8 *)SDL_malloc(fragsize); - if ( ulaw_buf == NULL ) { - SDL_OutOfMemory(); - return(-1); - } - spec->channels = 1; - } else { - fragsize = spec->samples; - frequency = spec->freq/1000; - } + this->hidden->written = 0; + + /* We can actually convert on-the-fly to U-Law */ + if (this->hidden->ulaw_only) { + this->spec.freq = desired_freq; + this->hidden->fragsize = (this->spec.samples * 1000) / + (this->spec.freq / 8); + this->hidden->frequency = 8; + this->hidden->ulaw_buf = (Uint8 *) SDL_malloc(this->hidden->fragsize); + if (this->hidden->ulaw_buf == NULL) { + return SDL_OutOfMemory(); + } + this->spec.channels = 1; + } else { + this->hidden->fragsize = this->spec.samples; + this->hidden->frequency = this->spec.freq / 1000; + } #ifdef DEBUG_AUDIO - fprintf(stderr, "Audio device %s U-Law only\n", - ulaw_only ? "is" : "is not"); - fprintf(stderr, "format=0x%x chan=%d freq=%d\n", - spec->format, spec->channels, spec->freq); + fprintf(stderr, "Audio device %s U-Law only\n", + this->hidden->ulaw_only ? "is" : "is not"); + fprintf(stderr, "format=0x%x chan=%d freq=%d\n", + this->spec.format, this->spec.channels, this->spec.freq); #endif - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); + /* Update the fragment size as size in bytes */ + SDL_CalculateAudioSpec(&this->spec); - /* Allocate mixing buffer */ - mixbuf = (Uint8 *)SDL_AllocAudioMem(spec->size); - if ( mixbuf == NULL ) { - SDL_OutOfMemory(); - return(-1); - } - SDL_memset(mixbuf, spec->silence, spec->size); + /* Allocate mixing buffer */ + this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->spec.size); + if (this->hidden->mixbuf == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - /* We're ready to rock and roll. :-) */ - return(0); + /* We're ready to rock and roll. :-) */ + return 0; } /************************************************************************/ @@ -397,36 +372,59 @@ int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec) /* provided "as is" without express or implied warranty. */ /************************************************************************/ -static Uint8 snd2au(int sample) +static Uint8 +snd2au(int sample) { - int mask; - - if (sample < 0) { - sample = -sample; - mask = 0x7f; - } else { - mask = 0xff; - } - - if (sample < 32) { - sample = 0xF0 | (15 - sample / 2); - } else if (sample < 96) { - sample = 0xE0 | (15 - (sample - 32) / 4); - } else if (sample < 224) { - sample = 0xD0 | (15 - (sample - 96) / 8); - } else if (sample < 480) { - sample = 0xC0 | (15 - (sample - 224) / 16); - } else if (sample < 992) { - sample = 0xB0 | (15 - (sample - 480) / 32); - } else if (sample < 2016) { - sample = 0xA0 | (15 - (sample - 992) / 64); - } else if (sample < 4064) { - sample = 0x90 | (15 - (sample - 2016) / 128); - } else if (sample < 8160) { - sample = 0x80 | (15 - (sample - 4064) / 256); - } else { - sample = 0x80; - } - return (mask & sample); + int mask; + + if (sample < 0) { + sample = -sample; + mask = 0x7f; + } else { + mask = 0xff; + } + + if (sample < 32) { + sample = 0xF0 | (15 - sample / 2); + } else if (sample < 96) { + sample = 0xE0 | (15 - (sample - 32) / 4); + } else if (sample < 224) { + sample = 0xD0 | (15 - (sample - 96) / 8); + } else if (sample < 480) { + sample = 0xC0 | (15 - (sample - 224) / 16); + } else if (sample < 992) { + sample = 0xB0 | (15 - (sample - 480) / 32); + } else if (sample < 2016) { + sample = 0xA0 | (15 - (sample - 992) / 64); + } else if (sample < 4064) { + sample = 0x90 | (15 - (sample - 2016) / 128); + } else if (sample < 8160) { + sample = 0x80 | (15 - (sample - 4064) / 256); + } else { + sample = 0x80; + } + return (mask & sample); +} + +static int +SUNAUDIO_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = SUNAUDIO_DetectDevices; + impl->OpenDevice = SUNAUDIO_OpenDevice; + impl->PlayDevice = SUNAUDIO_PlayDevice; + impl->WaitDevice = SUNAUDIO_WaitDevice; + impl->GetDeviceBuf = SUNAUDIO_GetDeviceBuf; + impl->CloseDevice = SUNAUDIO_CloseDevice; + + return 1; /* this audio target is available. */ } + +AudioBootStrap SUNAUDIO_bootstrap = { + "audio", "UNIX /dev/audio interface", SUNAUDIO_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_SUNAUDIO */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/sun/SDL_sunaudio.h b/src/audio/sun/SDL_sunaudio.h index e6be419376..9b92266fb1 100644 --- a/src/audio/sun/SDL_sunaudio.h +++ b/src/audio/sun/SDL_sunaudio.h @@ -1,55 +1,47 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h +#ifndef _SDL_sunaudio_h +#define _SDL_sunaudio_h #include "../SDL_sysaudio.h" -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData { - /* The file descriptor for the audio device */ - int audio_fd; - - Uint16 audio_fmt; /* The app audio format */ - Uint8 *mixbuf; /* The app mixing buffer */ - int ulaw_only; /* Flag -- does hardware only output U-law? */ - Uint8 *ulaw_buf; /* The U-law mixing buffer */ - Sint32 written; /* The number of samples written */ - int fragsize; /* The audio fragment size in samples */ - int frequency; /* The audio frequency in KHz */ +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + /* The file descriptor for the audio device */ + int audio_fd; + + SDL_AudioFormat audio_fmt; /* The app audio format */ + Uint8 *mixbuf; /* The app mixing buffer */ + int ulaw_only; /* Flag -- does hardware only output U-law? */ + Uint8 *ulaw_buf; /* The U-law mixing buffer */ + Sint32 written; /* The number of samples written */ + int fragsize; /* The audio fragment size in samples */ + int frequency; /* The audio frequency in KHz */ }; -/* Old variable names */ -#define audio_fd (this->hidden->audio_fd) -#define audio_fmt (this->hidden->audio_fmt) -#define mixbuf (this->hidden->mixbuf) -#define ulaw_only (this->hidden->ulaw_only) -#define ulaw_buf (this->hidden->ulaw_buf) -#define written (this->hidden->written) -#define fragsize (this->hidden->fragsize) -#define frequency (this->hidden->frequency) - -#endif /* _SDL_lowaudio_h */ +#endif /* _SDL_sunaudio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/symbian/SDL_epocaudio.cpp b/src/audio/symbian/SDL_epocaudio.cpp deleted file mode 100644 index 72a4eaf4e1..0000000000 --- a/src/audio/symbian/SDL_epocaudio.cpp +++ /dev/null @@ -1,614 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* - SDL_epocaudio.cpp - Epoc based SDL audio driver implementation - - Markus Mertama -*/ - -#ifdef SAVE_RCSID -static char rcsid = - "@(#) $Id: SDL_epocaudio.c,v 0.0.0.0 2001/06/19 17:19:56 hercules Exp $"; -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "epoc_sdl.h" - -#include - - -extern "C" { -#include "SDL_audio.h" -#include "SDL_error.h" -#include "SDL_audiomem.h" -#include "SDL_audio_c.h" -#include "SDL_timer.h" -#include "SDL_audiodev_c.h" -} - -#include "SDL_epocaudio.h" - -#include "streamplayer.h" - - -//#define DEBUG_AUDIO - - -/* Audio driver functions */ - -static int EPOC_OpenAudio(SDL_AudioDevice *thisdevice, SDL_AudioSpec *spec); -static void EPOC_WaitAudio(SDL_AudioDevice *thisdevice); -static void EPOC_PlayAudio(SDL_AudioDevice *thisdevice); -static Uint8 *EPOC_GetAudioBuf(SDL_AudioDevice *thisdevice); -static void EPOC_CloseAudio(SDL_AudioDevice *thisdevice); -static void EPOC_ThreadInit(SDL_AudioDevice *thisdevice); - -static int Audio_Available(void); -static SDL_AudioDevice *Audio_CreateDevice(int devindex); -static void Audio_DeleteDevice(SDL_AudioDevice *device); - - -//void sos_adump(SDL_AudioDevice* thisdevice, void* data, int len); - -#ifdef __WINS__ -#define DODUMP -#endif - -#ifdef DODUMP -NONSHARABLE_CLASS(TDump) - { - public: - TInt Open(); - void Close(); - void Dump(const TDesC8& aDes); - private: - RFile iFile; - RFs iFs; - }; - -TInt TDump::Open() - { - TInt err = iFs.Connect(); - if(err == KErrNone) - { -#ifdef __WINS__ -_LIT(target, "C:\\sdlau.raw"); -#else -_LIT(target, "E:\\sdlau.raw"); -#endif - err = iFile.Replace(iFs, target, EFileWrite); - } - return err; - } -void TDump::Close() - { - iFile.Close(); - iFs.Close(); - } -void TDump::Dump(const TDesC8& aDes) - { - iFile.Write(aDes); - } -#endif - - -NONSHARABLE_CLASS(CSimpleWait) : public CTimer - { - public: - void Wait(TTimeIntervalMicroSeconds32 aWait); - static CSimpleWait* NewL(); - private: - CSimpleWait(); - void RunL(); - }; - - -CSimpleWait* CSimpleWait::NewL() - { - CSimpleWait* wait = new (ELeave) CSimpleWait(); - CleanupStack::PushL(wait); - wait->ConstructL(); - CleanupStack::Pop(); - return wait; - } - -void CSimpleWait::Wait(TTimeIntervalMicroSeconds32 aWait) - { - After(aWait); - CActiveScheduler::Start(); - } - -CSimpleWait::CSimpleWait() : CTimer(CActive::EPriorityStandard) - { - CActiveScheduler::Add(this); - } - -void CSimpleWait::RunL() - { - CActiveScheduler::Stop(); - } - -const TInt KAudioBuffers(2); - - -NONSHARABLE_CLASS(CEpocAudio) : public CBase, public MStreamObs, public MStreamProvider - { - public: - static void* NewL(TInt BufferSize, TInt aFill); - inline static CEpocAudio& Current(SDL_AudioDevice* thisdevice); - - static void Free(SDL_AudioDevice* thisdevice); - - void Wait(); - void Play(); - // void SetBuffer(const TDesC8& aBuffer); - void ThreadInitL(TAny* aDevice); - void Open(TInt iRate, TInt iChannels, TUint32 aType, TInt aBytes); - ~CEpocAudio(); - TUint8* Buffer(); - TBool SetPause(TBool aPause); - #ifdef DODUMP - void Dump(const TDesC8& aBuf) {iDump.Dump(aBuf);} - #endif - private: - CEpocAudio(TInt aBufferSize); - void Complete(TInt aState, TInt aError); - TPtrC8 Data(); - void ConstructL(TInt aFill); - private: - TInt iBufferSize; - CStreamPlayer* iPlayer; - TInt iBufferRate; - TInt iRate; - TInt iChannels; - TUint32 iType; - TInt iPosition; - TThreadId iTid; - TUint8* iAudioPtr; - TUint8* iBuffer; - // TTimeIntervalMicroSeconds iStart; - TTime iStart; - TInt iTune; - CSimpleWait* iWait; - #ifdef DODUMP - TDump iDump; - #endif - }; - -inline CEpocAudio& CEpocAudio::Current(SDL_AudioDevice* thisdevice) - { - return *static_cast((void*)thisdevice->hidden); - } - -/* - -TBool EndSc(TAny*) - { - CActiveScheduler::Stop(); - } - -LOCAL_C void CleanScL() - { - CIdle* d = CIdle::NewLC(CActive:::EPriorityIdle); - d->Start(TCallBack(EndSc)); - CActiveScheduler::Start(); - - } -*/ - -void CEpocAudio::Free(SDL_AudioDevice* thisdevice) - { - CEpocAudio* ea = static_cast((void*)thisdevice->hidden); - if(ea) - { - ASSERT(ea->iTid == RThread().Id()); - delete ea; - thisdevice->hidden = NULL; - - CActiveScheduler* as = CActiveScheduler::Current(); - ASSERT(as->StackDepth() == 0); - delete as; - CActiveScheduler::Install(NULL); - } - ASSERT(thisdevice->hidden == NULL); - } - -CEpocAudio::CEpocAudio(TInt aBufferSize) : iBufferSize(aBufferSize), iPosition(-1) - { - } - -void* CEpocAudio::NewL(TInt aBufferSize, TInt aFill) - { - CEpocAudio* eAudioLib = new (ELeave) CEpocAudio(aBufferSize); - CleanupStack::PushL(eAudioLib); - eAudioLib->ConstructL(aFill); - CleanupStack::Pop(); - return eAudioLib; - } - -void CEpocAudio::ConstructL(TInt aFill) - { - iBuffer = (TUint8*) User::AllocL(KAudioBuffers * iBufferSize); - memset(iBuffer, aFill, KAudioBuffers * iBufferSize); - iAudioPtr = iBuffer; - } - - -TBool CEpocAudio::SetPause(TBool aPause) - { - if(aPause && iPosition >= 0) - { - iPosition = -1; - if(iPlayer != NULL) - iPlayer->Stop(); - } - if(!aPause && iPosition < 0) - { - iPosition = 0; - if(iPlayer != NULL) - iPlayer->Start(); - } - return iPosition < 0; - } - -void CEpocAudio::ThreadInitL(TAny* aDevice) - { - iTid = RThread().Id(); - CActiveScheduler* as = new (ELeave) CActiveScheduler(); - CActiveScheduler::Install(as); - - EpocSdlEnv::AppendCleanupItem(TSdlCleanupItem((TSdlCleanupOperation)EPOC_CloseAudio, aDevice)); - - iWait = CSimpleWait::NewL(); - - iPlayer = new (ELeave) CStreamPlayer(*this, *this); - iPlayer->ConstructL(); - iPlayer->OpenStream(iRate, iChannels, iType); - - #ifdef DODUMP - User::LeaveIfError(iDump.Open()); - #endif - } - - - -TUint8* CEpocAudio::Buffer() - { - iStart.UniversalTime(); -// iStart = iPlayer->Position(); - return iAudioPtr; - - } - -CEpocAudio::~CEpocAudio() - { - if(iWait != NULL) - iWait->Cancel(); - delete iWait; - if(iPlayer != NULL) - iPlayer->Close(); - delete iPlayer; - delete iBuffer; - } - -void CEpocAudio::Complete(TInt aState, TInt aError) - { - if(aState == MStreamObs::EClose) - { - } - if(iPlayer->Closed()) - return; - switch(aError) - { - case KErrUnderflow: - case KErrInUse: - iPlayer->Start(); - break; - case KErrAbort: - iPlayer->Open(); - } - } - - -void sos_adump(SDL_AudioDevice* thisdevice, void* data, int len) - { -#ifdef DODUMP - const TPtrC8 buf((TUint8*)data, len); - CEpocAudio::Current(thisdevice).Dump(buf); -#endif - } - -const TInt KClip(256); - -TPtrC8 CEpocAudio::Data() - { - if(iPosition < 0) - return KNullDesC8(); - - TPtrC8 data(iAudioPtr + iPosition, KClip); - -#ifdef DODUMP - iDump.Dump(data); -#endif - - iPosition += KClip; - if(iPosition >= iBufferSize) - { - -/* if(iAudioPtr == iBuffer) - iAudioPtr = iBuffer + iBufferSize; - else - iAudioPtr = iBuffer; -*/ - iAudioPtr += iBufferSize; - - if((iAudioPtr - iBuffer) >= KAudioBuffers * iBufferSize) - iAudioPtr = iBuffer; - - iPosition = -1; - if(iWait->IsActive()) - { - iWait->Cancel(); - CActiveScheduler::Stop(); - } - } - return data; - } - - - - -void CEpocAudio::Play() - { - iPosition = 0; - } - -void CEpocAudio::Wait() - { - if(iPosition >= 0 /*&& iPlayer->Playing()*/) - { - const TInt64 bufMs = TInt64(iBufferSize - KClip) * TInt64(1000000); - const TInt64 specTime = bufMs / TInt64(iRate * iChannels * 2); - iWait->After(specTime); - - CActiveScheduler::Start(); - TTime end; - end.UniversalTime(); - const TTimeIntervalMicroSeconds delta = end.MicroSecondsFrom(iStart); - - -// const TTimeIntervalMicroSeconds end = iPlayer->Position(); - - - - - const TInt diff = specTime - delta.Int64(); - - if(diff > 0 && diff < 200000) - { - User::After(diff); - } - - } - else - { - User::After(10000); -// iWait->Wait(10000); //just give some time... - } - } - -void CEpocAudio::Open(TInt aRate, TInt aChannels, TUint32 aType, TInt aBytes) - { - iRate = aRate; - iChannels = aChannels; - iType = aType; - iBufferRate = iRate * iChannels * aBytes; //1/x - } - - -/* Audio driver bootstrap functions */ - -AudioBootStrap EPOCAudio_bootstrap = { - "epoc\0\0\0", - "EPOC streaming audio\0\0\0", - Audio_Available, - Audio_CreateDevice -}; - - -static SDL_AudioDevice *Audio_CreateDevice(int /*devindex*/) -{ - SDL_AudioDevice *thisdevice; - - /* Initialize all variables that we clean on shutdown */ - thisdevice = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); - if ( thisdevice ) { - memset(thisdevice, 0, (sizeof *thisdevice)); - thisdevice->hidden = NULL; /*(struct SDL_PrivateAudioData *) - malloc((sizeof thisdevice->hidden)); */ - } - if ( (thisdevice == NULL) /*|| (thisdevice->hidden == NULL) */) { - SDL_OutOfMemory(); - if ( thisdevice ) { - free(thisdevice); - } - return(0); - } -// memset(thisdevice->hidden, 0, (sizeof *thisdevice->hidden)); - - /* Set the function pointers */ - thisdevice->OpenAudio = EPOC_OpenAudio; - thisdevice->WaitAudio = EPOC_WaitAudio; - thisdevice->PlayAudio = EPOC_PlayAudio; - thisdevice->GetAudioBuf = EPOC_GetAudioBuf; - thisdevice->CloseAudio = EPOC_CloseAudio; - thisdevice->ThreadInit = EPOC_ThreadInit; - thisdevice->free = Audio_DeleteDevice; - - return thisdevice; -} - - -static void Audio_DeleteDevice(SDL_AudioDevice *device) - { - //free(device->hidden); - free(device); - } - -static int Audio_Available(void) -{ - return(1); // Audio stream modules should be always there! -} - - -static int EPOC_OpenAudio(SDL_AudioDevice *thisdevice, SDL_AudioSpec *spec) -{ - SDL_TRACE("SDL:EPOC_OpenAudio"); - - - TUint32 type = KMMFFourCCCodePCM16; - TInt bytes = 2; - - switch(spec->format) - { - case AUDIO_U16LSB: - type = KMMFFourCCCodePCMU16; - break; - case AUDIO_S16LSB: - type = KMMFFourCCCodePCM16; - break; - case AUDIO_U16MSB: - type = KMMFFourCCCodePCMU16B; - break; - case AUDIO_S16MSB: - type = KMMFFourCCCodePCM16B; - break; - //8 bit not supported! - case AUDIO_U8: - case AUDIO_S8: - default: - spec->format = AUDIO_S16LSB; - }; - - - - if(spec->channels > 2) - spec->channels = 2; - - spec->freq = CStreamPlayer::ClosestSupportedRate(spec->freq); - - - /* Allocate mixing buffer */ - const TInt buflen = spec->size;// * bytes * spec->channels; -// audiobuf = NULL; - - TRAPD(err, thisdevice->hidden = static_cast(CEpocAudio::NewL(buflen, spec->silence))); - if(err != KErrNone) - return -1; - - CEpocAudio::Current(thisdevice).Open(spec->freq, spec->channels, type, bytes); - - CEpocAudio::Current(thisdevice).SetPause(ETrue); - - // isSDLAudioPaused = 1; - - thisdevice->enabled = 0; /* enable only after audio engine has been initialized!*/ - - /* We're ready to rock and roll. :-) */ - return(0); -} - - -static void EPOC_CloseAudio(SDL_AudioDevice* thisdevice) - { -#ifdef DEBUG_AUDIO - SDL_TRACE("Close audio\n"); -#endif - - CEpocAudio::Free(thisdevice); - } - - -static void EPOC_ThreadInit(SDL_AudioDevice *thisdevice) - { - SDL_TRACE("SDL:EPOC_ThreadInit"); - CEpocAudio::Current(thisdevice).ThreadInitL(thisdevice); - RThread().SetPriority(EPriorityMore); - thisdevice->enabled = 1; - } - -/* This function waits until it is possible to write a full sound buffer */ -static void EPOC_WaitAudio(SDL_AudioDevice* thisdevice) -{ -#ifdef DEBUG_AUDIO - SDL_TRACE1("wait %d audio\n", CEpocAudio::AudioLib().StreamPlayer(KSfxChannel).SyncTime()); - TInt tics = User::TickCount(); -#endif - - CEpocAudio::Current(thisdevice).Wait(); - -#ifdef DEBUG_AUDIO - TInt ntics = User::TickCount() - tics; - SDL_TRACE1("audio waited %d\n", ntics); - SDL_TRACE1("audio at %d\n", tics); -#endif -} - - - -static void EPOC_PlayAudio(SDL_AudioDevice* thisdevice) - { - if(CEpocAudio::Current(thisdevice).SetPause(SDL_GetAudioStatus() == SDL_AUDIO_PAUSED)) - SDL_Delay(500); //hold on the busy loop - else - CEpocAudio::Current(thisdevice).Play(); - -#ifdef DEBUG_AUDIO - SDL_TRACE("buffer has audio data\n"); -#endif - - -#ifdef DEBUG_AUDIO - SDL_TRACE1("Wrote %d bytes of audio data\n", buflen); -#endif -} - -static Uint8 *EPOC_GetAudioBuf(SDL_AudioDevice* thisdevice) - { - return CEpocAudio::Current(thisdevice).Buffer(); - } - - - diff --git a/src/audio/symbian/SDL_epocaudio.h b/src/audio/symbian/SDL_epocaudio.h deleted file mode 100644 index 5c95c86158..0000000000 --- a/src/audio/symbian/SDL_epocaudio.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - - -#ifdef SAVE_RCSID -static char rcsid = - "@(#) $Id: SDL_epocaudio.h,v 1.1.2.2 2001/02/10 07:20:03 hercules Exp $"; -#endif - -#ifndef _SDL_EPOCAUDIO_H -#define _SDL_EPOCAUDIO_H - -extern "C" { -#include "SDL_sysaudio.h" -} - - -#endif /* _SDL_EPOCAUDIO_H */ diff --git a/src/audio/symbian/streamplayer.cpp b/src/audio/symbian/streamplayer.cpp deleted file mode 100644 index dd733a1d17..0000000000 --- a/src/audio/symbian/streamplayer.cpp +++ /dev/null @@ -1,279 +0,0 @@ -#include "streamplayer.h" -#include - - - -const TInt KMaxVolume(256); - -LOCAL_C TInt GetSampleRate(TInt aRate) - { - switch(aRate) - { - case 8000: return TMdaAudioDataSettings::ESampleRate8000Hz; - case 11025: return TMdaAudioDataSettings::ESampleRate11025Hz; - case 12000: return TMdaAudioDataSettings::ESampleRate12000Hz; - case 16000: return TMdaAudioDataSettings::ESampleRate16000Hz; - case 22050: return TMdaAudioDataSettings::ESampleRate22050Hz; - case 24000: return TMdaAudioDataSettings::ESampleRate24000Hz; - case 32000: return TMdaAudioDataSettings::ESampleRate32000Hz; - case 44100: return TMdaAudioDataSettings::ESampleRate44100Hz; - case 48000: return TMdaAudioDataSettings::ESampleRate48000Hz; - case 96000: return TMdaAudioDataSettings::ESampleRate96000Hz; - case 64000: return TMdaAudioDataSettings::ESampleRate64000Hz; - } - return KErrNotFound; - } - -LOCAL_C TInt GetChannels(TInt aChannels) - { - switch(aChannels) - { - case 1: return TMdaAudioDataSettings::EChannelsMono; - case 2: return TMdaAudioDataSettings::EChannelsStereo; - } - return KErrNotFound; - } - -TInt CStreamPlayer::ClosestSupportedRate(TInt aRate) - { - if(aRate > 96000) - return 96000; - TInt rate = aRate; - while(GetSampleRate(rate) == KErrNotFound) - { - ++rate; - } - return rate; - } - -CStreamPlayer::CStreamPlayer(MStreamProvider& aProvider, MStreamObs& aObs) : - iProvider(aProvider), iObs(aObs), iVolume(KMaxVolume) - { - } - -CStreamPlayer::~CStreamPlayer() - { - iState |= EDied; - if(iState & EInited) - Close(); - User::After(100000); //wait buffer to be flushed - ASSERT(iPtr.Length() == 0); - delete iStream; - } - - -void CStreamPlayer::ConstructL() - { - iStream = CMdaAudioOutputStream::NewL(*this, EMdaPriorityMax); - iSilence.SetMax(); - iSilence.FillZ(); - } - - -TInt CStreamPlayer::OpenStream(TInt aRate, TInt aChannels, TUint32 aType) - { - Close(); - - iType = aType; - - iRate = GetSampleRate(aRate); - if(iRate == KErrNotFound) - return KErrNotSupported; - - iChannels = GetChannels(aChannels); - if(iChannels == KErrNotFound) - return KErrNotSupported; - - Open(); - - return KErrNone; - } - - -TInt CStreamPlayer::MaxVolume() const - { - return KMaxVolume; - } - -void CStreamPlayer::SetVolume(TInt aNew) - { - - const TInt maxi = MaxVolume(); - if(aNew > maxi) - return; - if(aNew < 0) - return; - - iVolume = aNew; - - iState |= EVolumeChange; - } - - TInt CStreamPlayer::Volume() const - { - return iVolume; - } - -void CStreamPlayer::Open() - { - TMdaAudioDataSettings audioSettings; - audioSettings.Query(); - audioSettings.iCaps = TMdaAudioDataSettings::ERealTime | - TMdaAudioDataSettings::ESampleRateFixed; - audioSettings.iSampleRate = iRate; - audioSettings.iChannels = iChannels; - audioSettings.iFlags = TMdaAudioDataSettings::ENoNetworkRouting; - audioSettings.iVolume = 0; - - iState &= ~EStopped; - iStream->Open(&audioSettings); - } - -void CStreamPlayer::Stop() - { - if(iState & (EStarted | EInited)) - { - Close(); - iState |= EStopped; - } - } - -void CStreamPlayer::Start() - { - if(iPtr.Length() == 0) - { - iState |= EStarted; - if(iState & EInited) - { - Request(); - } - else if(iState & EStopped) - { - Open(); - } - } - } - -void CStreamPlayer::Close() - { - iState &= ~EInited; - iStream->Stop(); - iState &= ~EStarted; - } - -void CStreamPlayer::Request() - { - if(iState & EInited) - { - iPtr.Set(KNullDesC8); - - if(iState & EVolumeChange) - { - const TReal newVol = iVolume; - const TReal newMax = MaxVolume(); - const TInt maxVol = iStream->MaxVolume(); - const TReal max = static_cast(maxVol); - const TReal newvolume = (newVol * max) / newMax; - const TInt vol = static_cast(newvolume); - iStream->SetVolume(vol); - iState &= ~EVolumeChange; - } - - if(iState & EStarted) - { - iPtr.Set(iProvider.Data()); - } - if(iPtr.Length() == 0) - { - iPtr.Set(iSilence); - } - TRAPD(err, iStream->WriteL(iPtr)); - if(err != KErrNone) - { - iObs.Complete(MStreamObs::EWrite, err); - } - /* else - { - iProvider.Written(iPtr.Length()); - }*/ - } - } - - -void CStreamPlayer::SetCapsL() - { - iStream->SetDataTypeL(iType); - iStream->SetAudioPropertiesL(iRate, iChannels); - } - -void CStreamPlayer::MaoscOpenComplete(TInt aError) - { - if(aError == KErrNone) - { - TRAPD(err, SetCapsL()); - if(err == KErrNone) - { - iStream->SetPriority(EPriorityNormal, EMdaPriorityPreferenceTime); - iState |= EInited; - - - SetVolume(Volume()); - - if(iState & EStarted) - { - Request(); - } - - } - aError = err; - } - if(!(iState & EDied)) - iObs.Complete(MStreamObs::EInit, aError); - } - -void CStreamPlayer::MaoscBufferCopied(TInt aError, const TDesC8& /*aBuffer*/) - { - iPtr.Set(KNullDesC8); - if(aError == KErrNone) - { - if(iState & EInited) - Request(); - else - iStream->Stop(); - } - else if(!(iState & EDied)) - iObs.Complete(MStreamObs::EPlay, aError); - } - -void CStreamPlayer::MaoscPlayComplete(TInt aError) - { - iPtr.Set(KNullDesC8); - iState &= ~EStarted; - if(!(iState & EDied)) - iObs.Complete(MStreamObs::EClose, aError); - } - -TBool CStreamPlayer::Playing() const - { - return (iState & EInited) && (iState & EStarted); - } - -TBool CStreamPlayer::Closed() const - { - return !(iState & EInited) && !(iState & EDied); - } - - /* -void CStreamPlayer::Request() - { - SetActive(); - TRequestStatus* s = &iStatus; - User::RequestComplete(s, KErrNone); - } - // iTimer.After(0); - */ - - - - - diff --git a/src/audio/symbian/streamplayer.h b/src/audio/symbian/streamplayer.h deleted file mode 100644 index 8c6e74f920..0000000000 --- a/src/audio/symbian/streamplayer.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef STREAMPLAYER_H -#define STREAMPLAYER_H - -#include - -const TInt KSilenceBuffer = 256; - -class MStreamObs - { - public: - enum - { - EInit, - EPlay, - EWrite, - EClose, - }; - virtual void Complete(TInt aState, TInt aError) = 0; - }; - -class MStreamProvider - { - public: - virtual TPtrC8 Data() = 0; - }; - -NONSHARABLE_CLASS(CStreamPlayer) : public CBase, public MMdaAudioOutputStreamCallback - { - public: - CStreamPlayer(MStreamProvider& aProvider, MStreamObs& aObs); - ~CStreamPlayer(); - void ConstructL(); - - static TInt ClosestSupportedRate(TInt aRate); - - TInt OpenStream(TInt aRate, TInt aChannels, TUint32 aType = KMMFFourCCCodePCM16); - - void SetVolume(TInt aNew); - TInt Volume() const; - TInt MaxVolume() const; - - void Stop(); - void Start(); - void Open(); - void Close(); - - TBool Playing() const; - TBool Closed() const; - - private: - - void MaoscOpenComplete(TInt aError) ; - void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); - void MaoscPlayComplete(TInt aError); - - private: - void Request(); - void SetCapsL(); - - private: - MStreamProvider& iProvider; - MStreamObs& iObs; - TInt iVolume; - - CMdaAudioOutputStream* iStream; - - TInt iRate; - TInt iChannels; - TUint32 iType; - - enum - { - ENone = 0, - EInited = 0x1, - EStarted = 0x2, - EStopped = 0x4, - EVolumeChange = 0x8, - EDied = 0x10 - }; - - TInt iState; - TBuf8 iSilence; - TPtrC8 iPtr; - - }; - - -#endif - diff --git a/src/audio/ums/SDL_umsaudio.c b/src/audio/ums/SDL_umsaudio.c deleted file mode 100644 index 9488911db6..0000000000 --- a/src/audio/ums/SDL_umsaudio.c +++ /dev/null @@ -1,547 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Carsten Griwodz - griff@kom.tu-darmstadt.de - - based on linux/SDL_dspaudio.c by Sam Lantinga -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "../SDL_audiodev_c.h" -#include "SDL_umsaudio.h" - -/* The tag name used by UMS audio */ -#define UMS_DRIVER_NAME "ums" - -#define DEBUG_AUDIO 1 - -/* Audio driver functions */ -static int UMS_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void UMS_PlayAudio(_THIS); -static Uint8 *UMS_GetAudioBuf(_THIS); -static void UMS_CloseAudio(_THIS); - -static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode, long flags); -static UMSAudioDevice_ReturnCode UADClose(_THIS); -static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long* bits); -static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits); -static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate, long* set_rate); -static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order); -static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt); -static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt); -static UMSAudioDevice_ReturnCode UADInitialize(_THIS); -static UMSAudioDevice_ReturnCode UADStart(_THIS); -static UMSAudioDevice_ReturnCode UADStop(_THIS); -static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt ); -static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long* buff_size ); -static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long* buff_size ); -static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long* buff_size ); -static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes, long* bytes_ret ); -static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume ); -static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance ); -static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels ); -static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block ); -static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output, long* left_gain, long* right_gain); -static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer* buff, long samples, long* samples_written); - -/* Audio driver bootstrap functions */ -static int Audio_Available(void) -{ - return 1; -} - -static void Audio_DeleteDevice(_THIS) -{ - if(this->hidden->playbuf._buffer) SDL_free(this->hidden->playbuf._buffer); - if(this->hidden->fillbuf._buffer) SDL_free(this->hidden->fillbuf._buffer); - _somFree( this->hidden->umsdev ); - SDL_free(this->hidden); - SDL_free(this); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* - * Allocate and initialize management storage and private management - * storage for this SDL-using library. - */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); -#ifdef DEBUG_AUDIO - fprintf(stderr, "Creating UMS Audio device\n"); -#endif - - /* - * Calls for UMS env initialization and audio object construction. - */ - this->hidden->ev = somGetGlobalEnvironment(); - this->hidden->umsdev = UMSAudioDeviceNew(); - - /* - * Set the function pointers. - */ - this->OpenAudio = UMS_OpenAudio; - this->WaitAudio = NULL; /* we do blocking output */ - this->PlayAudio = UMS_PlayAudio; - this->GetAudioBuf = UMS_GetAudioBuf; - this->CloseAudio = UMS_CloseAudio; - this->free = Audio_DeleteDevice; - -#ifdef DEBUG_AUDIO - fprintf(stderr, "done\n"); -#endif - return this; -} - -AudioBootStrap UMS_bootstrap = { - UMS_DRIVER_NAME, "AIX UMS audio", - Audio_Available, Audio_CreateDevice -}; - -static Uint8 *UMS_GetAudioBuf(_THIS) -{ -#ifdef DEBUG_AUDIO - fprintf(stderr, "enter UMS_GetAudioBuf\n"); -#endif - return this->hidden->fillbuf._buffer; -/* - long bufSize; - UMSAudioDevice_ReturnCode rc; - - rc = UADSetTimeFormat(this, UMSAudioTypes_Bytes ); - rc = UADWriteBuffSize(this, bufSize ); -*/ -} - -static void UMS_CloseAudio(_THIS) -{ - UMSAudioDevice_ReturnCode rc; - -#ifdef DEBUG_AUDIO - fprintf(stderr, "enter UMS_CloseAudio\n"); -#endif - rc = UADPlayRemainingData(this, TRUE); - rc = UADStop(this); - rc = UADClose(this); -} - -static void UMS_PlayAudio(_THIS) -{ - UMSAudioDevice_ReturnCode rc; - long samplesToWrite; - long samplesWritten; - UMSAudioTypes_Buffer swpbuf; - -#ifdef DEBUG_AUDIO - fprintf(stderr, "enter UMS_PlayAudio\n"); -#endif - samplesToWrite = this->hidden->playbuf._length/this->hidden->bytesPerSample; - do - { - rc = UADWrite(this, &this->hidden->playbuf, - samplesToWrite, - &samplesWritten ); - samplesToWrite -= samplesWritten; - - /* rc values: UMSAudioDevice_Success - * UMSAudioDevice_Failure - * UMSAudioDevice_Preempted - * UMSAudioDevice_Interrupted - * UMSAudioDevice_DeviceError - */ - if ( rc == UMSAudioDevice_DeviceError ) { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Returning from PlayAudio with devices error\n"); -#endif - return; - } - } - while(samplesToWrite>0); - - SDL_LockAudio(); - SDL_memcpy( &swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer) ); - SDL_memcpy( &this->hidden->playbuf, &this->hidden->fillbuf, sizeof(UMSAudioTypes_Buffer) ); - SDL_memcpy( &this->hidden->fillbuf, &swpbuf, sizeof(UMSAudioTypes_Buffer) ); - SDL_UnlockAudio(); - -#ifdef DEBUG_AUDIO - fprintf(stderr, "Wrote audio data and swapped buffer\n"); -#endif -} - -#if 0 -// /* Set the DSP frequency */ -// value = spec->freq; -// if ( ioctl(this->hidden->audio_fd, SOUND_PCM_WRITE_RATE, &value) < 0 ) { -// SDL_SetError("Couldn't set audio frequency"); -// return(-1); -// } -// spec->freq = value; -#endif - -static int UMS_OpenAudio(_THIS, SDL_AudioSpec *spec) -{ - char* audiodev = "/dev/paud0"; - long lgain; - long rgain; - long outRate; - long outBufSize; - long bitsPerSample; - long samplesPerSec; - long success; - Uint16 test_format; - int frag_spec; - UMSAudioDevice_ReturnCode rc; - -#ifdef DEBUG_AUDIO - fprintf(stderr, "enter UMS_OpenAudio\n"); -#endif - rc = UADOpen(this, audiodev,"PLAY", UMSAudioDevice_BlockingIO); - if ( rc != UMSAudioDevice_Success ) { - SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno)); - return -1; - } - - rc = UADSetAudioFormatType(this, "PCM"); - - success = 0; - test_format = SDL_FirstAudioFormat(spec->format); - do - { -#ifdef DEBUG_AUDIO - fprintf(stderr, "Trying format 0x%4.4x\n", test_format); -#endif - switch ( test_format ) - { - case AUDIO_U8: -/* from the mac code: better ? */ -/* sample_bits = spec->size / spec->samples / spec->channels * 8; */ - success = 1; - bitsPerSample = 8; - rc = UADSetSampleRate(this, spec->freq << 16, &outRate ); - rc = UADSetByteOrder(this, "MSB"); /* irrelevant */ - rc = UADSetNumberFormat(this, "UNSIGNED"); - break; - case AUDIO_S8: - success = 1; - bitsPerSample = 8; - rc = UADSetSampleRate(this, spec->freq << 16, &outRate ); - rc = UADSetByteOrder(this, "MSB"); /* irrelevant */ - rc = UADSetNumberFormat(this, "SIGNED"); - break; - case AUDIO_S16LSB: - success = 1; - bitsPerSample = 16; - rc = UADSetSampleRate(this, spec->freq << 16, &outRate ); - rc = UADSetByteOrder(this, "LSB"); - rc = UADSetNumberFormat(this, "SIGNED"); - break; - case AUDIO_S16MSB: - success = 1; - bitsPerSample = 16; - rc = UADSetSampleRate(this, spec->freq << 16, &outRate ); - rc = UADSetByteOrder(this, "MSB"); - rc = UADSetNumberFormat(this, "SIGNED"); - break; - case AUDIO_U16LSB: - success = 1; - bitsPerSample = 16; - rc = UADSetSampleRate(this, spec->freq << 16, &outRate ); - rc = UADSetByteOrder(this, "LSB"); - rc = UADSetNumberFormat(this, "UNSIGNED"); - break; - case AUDIO_U16MSB: - success = 1; - bitsPerSample = 16; - rc = UADSetSampleRate(this, spec->freq << 16, &outRate ); - rc = UADSetByteOrder(this, "MSB"); - rc = UADSetNumberFormat(this, "UNSIGNED"); - break; - default: - break; - } - if ( ! success ) { - test_format = SDL_NextAudioFormat(); - } - } - while ( ! success && test_format ); - - if ( success == 0 ) { - SDL_SetError("Couldn't find any hardware audio formats"); - return -1; - } - - spec->format = test_format; - - for ( frag_spec = 0; (0x01<size; ++frag_spec ); - if ( (0x01<size ) { - SDL_SetError("Fragment size must be a power of two"); - return -1; - } - if ( frag_spec > 2048 ) frag_spec = 2048; - - this->hidden->bytesPerSample = (bitsPerSample / 8) * spec->channels; - samplesPerSec = this->hidden->bytesPerSample * outRate; - - this->hidden->playbuf._length = 0; - this->hidden->playbuf._maximum = spec->size; - this->hidden->playbuf._buffer = (unsigned char*)SDL_malloc(spec->size); - this->hidden->fillbuf._length = 0; - this->hidden->fillbuf._maximum = spec->size; - this->hidden->fillbuf._buffer = (unsigned char*)SDL_malloc(spec->size); - - rc = UADSetBitsPerSample(this, bitsPerSample ); - rc = UADSetDMABufferSize(this, frag_spec, &outBufSize ); - rc = UADSetChannels(this, spec->channels); /* functions reduces to mono or stereo */ - - lgain = 100; /*maximum left input gain*/ - rgain = 100; /*maimum right input gain*/ - rc = UADEnableOutput(this, "LINE_OUT",&lgain,&rgain); - rc = UADInitialize(this); - rc = UADStart(this); - rc = UADSetVolume(this, 100); - rc = UADSetBalance(this, 0); - - /* We're ready to rock and roll. :-) */ - return 0; -} - - -static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long* bits) -{ - return UMSAudioDevice_get_bits_per_sample( this->hidden->umsdev, - this->hidden->ev, - bits ); -} - -static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits) -{ - return UMSAudioDevice_set_bits_per_sample( this->hidden->umsdev, - this->hidden->ev, - bits ); -} - -static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate, long* set_rate) -{ - /* from the mac code: sample rate = spec->freq << 16; */ - return UMSAudioDevice_set_sample_rate( this->hidden->umsdev, - this->hidden->ev, - rate, - set_rate ); -} - -static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order) -{ - return UMSAudioDevice_set_byte_order( this->hidden->umsdev, - this->hidden->ev, - byte_order ); -} - -static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt) -{ - /* possible PCM, A_LAW or MU_LAW */ - return UMSAudioDevice_set_audio_format_type( this->hidden->umsdev, - this->hidden->ev, - fmt ); -} - -static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt) -{ - /* possible SIGNED, UNSIGNED, or TWOS_COMPLEMENT */ - return UMSAudioDevice_set_number_format( this->hidden->umsdev, - this->hidden->ev, - fmt ); -} - -static UMSAudioDevice_ReturnCode UADInitialize(_THIS) -{ - return UMSAudioDevice_initialize( this->hidden->umsdev, - this->hidden->ev ); -} - -static UMSAudioDevice_ReturnCode UADStart(_THIS) -{ - return UMSAudioDevice_start( this->hidden->umsdev, - this->hidden->ev ); -} - -static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt ) -{ - /* - * Switches the time format to the new format, immediately. - * possible UMSAudioTypes_Msecs, UMSAudioTypes_Bytes or UMSAudioTypes_Samples - */ - return UMSAudioDevice_set_time_format( this->hidden->umsdev, - this->hidden->ev, - fmt ); -} - -static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long* buff_size ) -{ - /* - * returns write buffer size in the current time format - */ - return UMSAudioDevice_write_buff_size( this->hidden->umsdev, - this->hidden->ev, - buff_size ); -} - -static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long* buff_size ) -{ - /* - * returns amount of available space in the write buffer - * in the current time format - */ - return UMSAudioDevice_write_buff_remain( this->hidden->umsdev, - this->hidden->ev, - buff_size ); -} - -static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long* buff_size ) -{ - /* - * returns amount of filled space in the write buffer - * in the current time format - */ - return UMSAudioDevice_write_buff_used( this->hidden->umsdev, - this->hidden->ev, - buff_size ); -} - -static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes, long* bytes_ret ) -{ - /* - * Request a new DMA buffer size, maximum requested size 2048. - * Takes effect with next initialize() call. - * Devices may or may not support DMA. - */ - return UMSAudioDevice_set_DMA_buffer_size( this->hidden->umsdev, - this->hidden->ev, - bytes, - bytes_ret ); -} - -static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume ) -{ - /* - * Set the volume. - * Takes effect immediately. - */ - return UMSAudioDevice_set_volume( this->hidden->umsdev, - this->hidden->ev, - volume ); -} - -static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance ) -{ - /* - * Set the balance. - * Takes effect immediately. - */ - return UMSAudioDevice_set_balance( this->hidden->umsdev, - this->hidden->ev, - balance ); -} - -static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels ) -{ - /* - * Set mono or stereo. - * Takes effect with next initialize() call. - */ - if ( channels != 1 ) channels = 2; - return UMSAudioDevice_set_number_of_channels( this->hidden->umsdev, - this->hidden->ev, - channels ); -} - -static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode, long flags) -{ - return UMSAudioDevice_open( this->hidden->umsdev, - this->hidden->ev, - device, - mode, - flags ); -} - -static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer* buff, - long samples, - long* samples_written) -{ - return UMSAudioDevice_write( this->hidden->umsdev, - this->hidden->ev, - buff, - samples, - samples_written ); -} - -static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block ) -{ - return UMSAudioDevice_play_remaining_data( this->hidden->umsdev, - this->hidden->ev, - block); -} - -static UMSAudioDevice_ReturnCode UADStop(_THIS) -{ - return UMSAudioDevice_stop( this->hidden->umsdev, - this->hidden->ev ); -} - -static UMSAudioDevice_ReturnCode UADClose(_THIS) -{ - return UMSAudioDevice_close( this->hidden->umsdev, - this->hidden->ev ); -} - -static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output, long* left_gain, long* right_gain) -{ - return UMSAudioDevice_enable_output( this->hidden->umsdev, - this->hidden->ev, - output, - left_gain, - right_gain ); -} - diff --git a/src/audio/ums/SDL_umsaudio.h b/src/audio/ums/SDL_umsaudio.h deleted file mode 100644 index 367fe853b6..0000000000 --- a/src/audio/ums/SDL_umsaudio.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Carsten Griwodz - griff@kom.tu-darmstadt.de - - based on linux/SDL_dspaudio.h by Sam Lantinga -*/ -#include "SDL_config.h" - -#ifndef _SDL_UMSaudio_h -#define _SDL_UMSaudio_h - -#include - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -struct SDL_PrivateAudioData -{ - /* Pointer to the (open) UMS audio device */ - Environment* ev; - UMSAudioDevice umsdev; - - /* Raw mixing buffer */ - UMSAudioTypes_Buffer playbuf; - UMSAudioTypes_Buffer fillbuf; - - long bytesPerSample; -}; - -#endif /* _SDL_UMSaudio_h */ - diff --git a/src/audio/windib/SDL_dibaudio.c b/src/audio/windib/SDL_dibaudio.c deleted file mode 100644 index 51a9a4d60a..0000000000 --- a/src/audio/windib/SDL_dibaudio.c +++ /dev/null @@ -1,322 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer */ - -#define WIN32_LEAN_AND_MEAN -#include -#include - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_dibaudio.h" -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) -#include "win_ce_semaphore.h" -#endif - - -/* Audio driver functions */ -static int DIB_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DIB_ThreadInit(_THIS); -static void DIB_WaitAudio(_THIS); -static Uint8 *DIB_GetAudioBuf(_THIS); -static void DIB_PlayAudio(_THIS); -static void DIB_WaitDone(_THIS); -static void DIB_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - return(1); -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = DIB_OpenAudio; - this->ThreadInit = DIB_ThreadInit; - this->WaitAudio = DIB_WaitAudio; - this->PlayAudio = DIB_PlayAudio; - this->GetAudioBuf = DIB_GetAudioBuf; - this->WaitDone = DIB_WaitDone; - this->CloseAudio = DIB_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap WAVEOUT_bootstrap = { - "waveout", "Win95/98/NT/2000 WaveOut", - Audio_Available, Audio_CreateDevice -}; - - -/* The Win32 callback for filling the WAVE device */ -static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, - DWORD dwParam1, DWORD dwParam2) -{ - SDL_AudioDevice *this = (SDL_AudioDevice *)dwInstance; - - /* Only service "buffer done playing" messages */ - if ( uMsg != WOM_DONE ) - return; - - /* Signal that we are done playing a buffer */ -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - ReleaseSemaphoreCE(audio_sem, 1, NULL); -#else - ReleaseSemaphore(audio_sem, 1, NULL); -#endif -} - -static void SetMMerror(char *function, MMRESULT code) -{ - size_t len; - char errbuf[MAXERRORLENGTH]; -#ifdef _WIN32_WCE - wchar_t werrbuf[MAXERRORLENGTH]; -#endif - - SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function); - len = SDL_strlen(errbuf); - -#ifdef _WIN32_WCE - /* UNICODE version */ - waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH-len); - WideCharToMultiByte(CP_ACP,0,werrbuf,-1,errbuf+len,MAXERRORLENGTH-len,NULL,NULL); -#else - waveOutGetErrorText(code, errbuf+len, (UINT)(MAXERRORLENGTH-len)); -#endif - - SDL_SetError("%s",errbuf); -} - -/* Set high priority for the audio thread */ -static void DIB_ThreadInit(_THIS) -{ - SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); -} - -void DIB_WaitAudio(_THIS) -{ - /* Wait for an audio chunk to finish */ -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - WaitForSemaphoreCE(audio_sem, INFINITE); -#else - WaitForSingleObject(audio_sem, INFINITE); -#endif -} - -Uint8 *DIB_GetAudioBuf(_THIS) -{ - Uint8 *retval; - - retval = (Uint8 *)(wavebuf[next_buffer].lpData); - return retval; -} - -void DIB_PlayAudio(_THIS) -{ - /* Queue it up */ - waveOutWrite(sound, &wavebuf[next_buffer], sizeof(wavebuf[0])); - next_buffer = (next_buffer+1)%NUM_BUFFERS; -} - -void DIB_WaitDone(_THIS) -{ - int i, left; - - do { - left = NUM_BUFFERS; - for ( i=0; i 0 ) { - SDL_Delay(100); - } - } while ( left > 0 ); -} - -void DIB_CloseAudio(_THIS) -{ - int i; - - /* Close up audio */ - if ( audio_sem ) { -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - CloseSynchHandle(audio_sem); -#else - CloseHandle(audio_sem); -#endif - } - if ( sound ) { - waveOutClose(sound); - } - - /* Clean up mixing buffers */ - for ( i=0; iformat & 0xFF ) { - case 8: - /* Unsigned 8 bit audio data */ - spec->format = AUDIO_U8; - waveformat.wBitsPerSample = 8; - break; - case 16: - /* Signed 16 bit audio data */ - spec->format = AUDIO_S16; - waveformat.wBitsPerSample = 16; - break; - default: - SDL_SetError("Unsupported audio format"); - return(-1); - } - waveformat.nChannels = spec->channels; - waveformat.nSamplesPerSec = spec->freq; - waveformat.nBlockAlign = - waveformat.nChannels * (waveformat.wBitsPerSample/8); - waveformat.nAvgBytesPerSec = - waveformat.nSamplesPerSec * waveformat.nBlockAlign; - - /* Check the buffer size -- minimum of 1/4 second (word aligned) */ - if ( spec->samples < (spec->freq/4) ) - spec->samples = ((spec->freq/4)+3)&~3; - - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); - - /* Open the audio device */ - result = waveOutOpen(&sound, WAVE_MAPPER, &waveformat, - (DWORD_PTR)FillSound, (DWORD_PTR)this, CALLBACK_FUNCTION); - if ( result != MMSYSERR_NOERROR ) { - SetMMerror("waveOutOpen()", result); - return(-1); - } - -#ifdef SOUND_DEBUG - /* Check the sound device we retrieved */ - { - WAVEOUTCAPS caps; - - result = waveOutGetDevCaps((UINT)sound, &caps, sizeof(caps)); - if ( result != MMSYSERR_NOERROR ) { - SetMMerror("waveOutGetDevCaps()", result); - return(-1); - } - printf("Audio device: %s\n", caps.szPname); - } -#endif - - /* Create the audio buffer semaphore */ -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - audio_sem = CreateSemaphoreCE(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL); -#else - audio_sem = CreateSemaphore(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL); -#endif - if ( audio_sem == NULL ) { - SDL_SetError("Couldn't create semaphore"); - return(-1); - } - - /* Create the sound buffers */ - mixbuf = (Uint8 *)SDL_malloc(NUM_BUFFERS*spec->size); - if ( mixbuf == NULL ) { - SDL_SetError("Out of memory"); - return(-1); - } - for ( i = 0; i < NUM_BUFFERS; ++i ) { - SDL_memset(&wavebuf[i], 0, sizeof(wavebuf[i])); - wavebuf[i].lpData = (LPSTR) &mixbuf[i*spec->size]; - wavebuf[i].dwBufferLength = spec->size; - wavebuf[i].dwFlags = WHDR_DONE; - result = waveOutPrepareHeader(sound, &wavebuf[i], - sizeof(wavebuf[i])); - if ( result != MMSYSERR_NOERROR ) { - SetMMerror("waveOutPrepareHeader()", result); - return(-1); - } - } - - /* Ready to go! */ - next_buffer = 0; - return(0); -} diff --git a/src/audio/windib/SDL_dibaudio.h b/src/audio/windib/SDL_dibaudio.h deleted file mode 100644 index d2c62280b5..0000000000 --- a/src/audio/windib/SDL_dibaudio.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -#define NUM_BUFFERS 2 /* -- Don't lower this! */ - -struct SDL_PrivateAudioData { - HWAVEOUT sound; - HANDLE audio_sem; - Uint8 *mixbuf; /* The raw allocated mixing buffer */ - WAVEHDR wavebuf[NUM_BUFFERS]; /* Wave audio fragments */ - int next_buffer; -}; - -/* Old variable names */ -#define sound (this->hidden->sound) -#define audio_sem (this->hidden->audio_sem) -#define mixbuf (this->hidden->mixbuf) -#define wavebuf (this->hidden->wavebuf) -#define next_buffer (this->hidden->next_buffer) - -#endif /* _SDL_lowaudio_h */ diff --git a/src/audio/windx5/SDL_dx5audio.c b/src/audio/windx5/SDL_dx5audio.c deleted file mode 100644 index c3d42aeda1..0000000000 --- a/src/audio/windx5/SDL_dx5audio.c +++ /dev/null @@ -1,705 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Allow access to a raw mixing buffer */ - -#include "SDL_timer.h" -#include "SDL_audio.h" -#include "../SDL_audio_c.h" -#include "SDL_dx5audio.h" - -/* Define this if you want to use DirectX 6 DirectSoundNotify interface */ -//#define USE_POSITION_NOTIFY - -/* DirectX function pointers for audio */ -HRESULT (WINAPI *DSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); - -/* Audio driver functions */ -static int DX5_OpenAudio(_THIS, SDL_AudioSpec *spec); -static void DX5_ThreadInit(_THIS); -static void DX5_WaitAudio_BusyWait(_THIS); -#ifdef USE_POSITION_NOTIFY -static void DX6_WaitAudio_EventWait(_THIS); -#endif -static void DX5_PlayAudio(_THIS); -static Uint8 *DX5_GetAudioBuf(_THIS); -static void DX5_WaitDone(_THIS); -static void DX5_CloseAudio(_THIS); - -/* Audio driver bootstrap functions */ - -static int Audio_Available(void) -{ - HINSTANCE DSoundDLL; - int dsound_ok; - - /* Version check DSOUND.DLL (Is DirectX okay?) */ - dsound_ok = 0; - DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL")); - if ( DSoundDLL != NULL ) { - /* We just use basic DirectSound, we're okay */ - /* Yay! */ - /* Unfortunately, the sound drivers on NT have - higher latencies than the audio buffers used - by many SDL applications, so there are gaps - in the audio - it sounds terrible. Punt for now. - */ - OSVERSIONINFO ver; - ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - GetVersionEx(&ver); - switch (ver.dwPlatformId) { - case VER_PLATFORM_WIN32_NT: - if ( ver.dwMajorVersion > 4 ) { - /* Win2K */ - dsound_ok = 1; - } else { - /* WinNT */ - dsound_ok = 0; - } - break; - default: - /* Win95 or Win98 */ - dsound_ok = 1; - break; - } - /* Now check for DirectX 5 or better - otherwise - * we will fail later in DX5_OpenAudio without a chance - * to fall back to the DIB driver. */ - if (dsound_ok) { - /* DirectSoundCaptureCreate was added in DX5 */ - if (!GetProcAddress(DSoundDLL, TEXT("DirectSoundCaptureCreate"))) - dsound_ok = 0; - - } - /* Clean up.. */ - FreeLibrary(DSoundDLL); - } - return(dsound_ok); -} - -/* Functions for loading the DirectX functions dynamically */ -static HINSTANCE DSoundDLL = NULL; - -static void DX5_Unload(void) -{ - if ( DSoundDLL != NULL ) { - FreeLibrary(DSoundDLL); - DSoundCreate = NULL; - DSoundDLL = NULL; - } -} -static int DX5_Load(void) -{ - int status; - - DX5_Unload(); - DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL")); - if ( DSoundDLL != NULL ) { - DSoundCreate = (void *)GetProcAddress(DSoundDLL, - TEXT("DirectSoundCreate")); - } - if ( DSoundDLL && DSoundCreate ) { - status = 0; - } else { - DX5_Unload(); - status = -1; - } - return status; -} - -static void Audio_DeleteDevice(SDL_AudioDevice *device) -{ - DX5_Unload(); - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_AudioDevice *Audio_CreateDevice(int devindex) -{ - SDL_AudioDevice *this; - - /* Load DirectX */ - if ( DX5_Load() < 0 ) { - return(NULL); - } - - /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); - if ( this ) { - SDL_memset(this, 0, (sizeof *this)); - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - } - if ( (this == NULL) || (this->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( this ) { - SDL_free(this); - } - return(0); - } - SDL_memset(this->hidden, 0, (sizeof *this->hidden)); - - /* Set the function pointers */ - this->OpenAudio = DX5_OpenAudio; - this->ThreadInit = DX5_ThreadInit; - this->WaitAudio = DX5_WaitAudio_BusyWait; - this->PlayAudio = DX5_PlayAudio; - this->GetAudioBuf = DX5_GetAudioBuf; - this->WaitDone = DX5_WaitDone; - this->CloseAudio = DX5_CloseAudio; - - this->free = Audio_DeleteDevice; - - return this; -} - -AudioBootStrap DSOUND_bootstrap = { - "dsound", "Win95/98/2000 DirectSound", - Audio_Available, Audio_CreateDevice -}; - -static void SetDSerror(const char *function, int code) -{ - static const char *error; - static char errbuf[1024]; - - errbuf[0] = 0; - switch (code) { - case E_NOINTERFACE: - error = - "Unsupported interface\n-- Is DirectX 5.0 or later installed?"; - break; - case DSERR_ALLOCATED: - error = "Audio device in use"; - break; - case DSERR_BADFORMAT: - error = "Unsupported audio format"; - break; - case DSERR_BUFFERLOST: - error = "Mixing buffer was lost"; - break; - case DSERR_CONTROLUNAVAIL: - error = "Control requested is not available"; - break; - case DSERR_INVALIDCALL: - error = "Invalid call for the current state"; - break; - case DSERR_INVALIDPARAM: - error = "Invalid parameter"; - break; - case DSERR_NODRIVER: - error = "No audio device found"; - break; - case DSERR_OUTOFMEMORY: - error = "Out of memory"; - break; - case DSERR_PRIOLEVELNEEDED: - error = "Caller doesn't have priority"; - break; - case DSERR_UNSUPPORTED: - error = "Function not supported"; - break; - default: - SDL_snprintf(errbuf, SDL_arraysize(errbuf), - "%s: Unknown DirectSound error: 0x%x", - function, code); - break; - } - if ( ! errbuf[0] ) { - SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error); - } - SDL_SetError("%s", errbuf); - return; -} - -/* DirectSound needs to be associated with a window */ -static HWND mainwin = NULL; -/* */ -void DX5_SoundFocus(HWND hwnd) -{ - mainwin = hwnd; -} - -static void DX5_ThreadInit(_THIS) -{ - SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); -} - -static void DX5_WaitAudio_BusyWait(_THIS) -{ - DWORD status; - DWORD cursor, junk; - HRESULT result; - - /* Semi-busy wait, since we have no way of getting play notification - on a primary mixing buffer located in hardware (DirectX 5.0) - */ - result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &junk, &cursor); - if ( result != DS_OK ) { - if ( result == DSERR_BUFFERLOST ) { - IDirectSoundBuffer_Restore(mixbuf); - } -#ifdef DEBUG_SOUND - SetDSerror("DirectSound GetCurrentPosition", result); -#endif - return; - } - - while ( (cursor/mixlen) == lastchunk ) { - /* FIXME: find out how much time is left and sleep that long */ - SDL_Delay(1); - - /* Try to restore a lost sound buffer */ - IDirectSoundBuffer_GetStatus(mixbuf, &status); - if ( (status&DSBSTATUS_BUFFERLOST) ) { - IDirectSoundBuffer_Restore(mixbuf); - IDirectSoundBuffer_GetStatus(mixbuf, &status); - if ( (status&DSBSTATUS_BUFFERLOST) ) { - break; - } - } - if ( ! (status&DSBSTATUS_PLAYING) ) { - result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING); - if ( result == DS_OK ) { - continue; - } -#ifdef DEBUG_SOUND - SetDSerror("DirectSound Play", result); -#endif - return; - } - - /* Find out where we are playing */ - result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, - &junk, &cursor); - if ( result != DS_OK ) { - SetDSerror("DirectSound GetCurrentPosition", result); - return; - } - } -} - -#ifdef USE_POSITION_NOTIFY -static void DX6_WaitAudio_EventWait(_THIS) -{ - DWORD status; - HRESULT result; - - /* Try to restore a lost sound buffer */ - IDirectSoundBuffer_GetStatus(mixbuf, &status); - if ( (status&DSBSTATUS_BUFFERLOST) ) { - IDirectSoundBuffer_Restore(mixbuf); - IDirectSoundBuffer_GetStatus(mixbuf, &status); - if ( (status&DSBSTATUS_BUFFERLOST) ) { - return; - } - } - if ( ! (status&DSBSTATUS_PLAYING) ) { - result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING); - if ( result != DS_OK ) { -#ifdef DEBUG_SOUND - SetDSerror("DirectSound Play", result); -#endif - return; - } - } - WaitForSingleObject(audio_event, INFINITE); -} -#endif /* USE_POSITION_NOTIFY */ - -static void DX5_PlayAudio(_THIS) -{ - /* Unlock the buffer, allowing it to play */ - if ( locked_buf ) { - IDirectSoundBuffer_Unlock(mixbuf, locked_buf, mixlen, NULL, 0); - } - -} - -static Uint8 *DX5_GetAudioBuf(_THIS) -{ - DWORD cursor, junk; - HRESULT result; - DWORD rawlen; - - /* Figure out which blocks to fill next */ - locked_buf = NULL; - result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &junk, &cursor); - if ( result == DSERR_BUFFERLOST ) { - IDirectSoundBuffer_Restore(mixbuf); - result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, - &junk, &cursor); - } - if ( result != DS_OK ) { - SetDSerror("DirectSound GetCurrentPosition", result); - return(NULL); - } - cursor /= mixlen; -#ifdef DEBUG_SOUND - /* Detect audio dropouts */ - { DWORD spot = cursor; - if ( spot < lastchunk ) { - spot += NUM_BUFFERS; - } - if ( spot > lastchunk+1 ) { - fprintf(stderr, "Audio dropout, missed %d fragments\n", - (spot - (lastchunk+1))); - } - } -#endif - lastchunk = cursor; - cursor = (cursor+1)%NUM_BUFFERS; - cursor *= mixlen; - - /* Lock the audio buffer */ - result = IDirectSoundBuffer_Lock(mixbuf, cursor, mixlen, - (LPVOID *)&locked_buf, &rawlen, NULL, &junk, 0); - if ( result == DSERR_BUFFERLOST ) { - IDirectSoundBuffer_Restore(mixbuf); - result = IDirectSoundBuffer_Lock(mixbuf, cursor, mixlen, - (LPVOID *)&locked_buf, &rawlen, NULL, &junk, 0); - } - if ( result != DS_OK ) { - SetDSerror("DirectSound Lock", result); - return(NULL); - } - return(locked_buf); -} - -static void DX5_WaitDone(_THIS) -{ - Uint8 *stream; - - /* Wait for the playing chunk to finish */ - stream = this->GetAudioBuf(this); - if ( stream != NULL ) { - SDL_memset(stream, silence, mixlen); - this->PlayAudio(this); - } - this->WaitAudio(this); - - /* Stop the looping sound buffer */ - IDirectSoundBuffer_Stop(mixbuf); -} - -static void DX5_CloseAudio(_THIS) -{ - if ( sound != NULL ) { - if ( mixbuf != NULL ) { - /* Clean up the audio buffer */ - IDirectSoundBuffer_Release(mixbuf); - mixbuf = NULL; - } - if ( audio_event != NULL ) { - CloseHandle(audio_event); - audio_event = NULL; - } - IDirectSound_Release(sound); - sound = NULL; - } -} - -#ifdef USE_PRIMARY_BUFFER -/* This function tries to create a primary audio buffer, and returns the - number of audio chunks available in the created buffer. -*/ -static int CreatePrimary(LPDIRECTSOUND sndObj, HWND focus, - LPDIRECTSOUNDBUFFER *sndbuf, WAVEFORMATEX *wavefmt, Uint32 chunksize) -{ - HRESULT result; - DSBUFFERDESC format; - DSBCAPS caps; - int numchunks; - - /* Try to set primary mixing privileges */ - result = IDirectSound_SetCooperativeLevel(sndObj, focus, - DSSCL_WRITEPRIMARY); - if ( result != DS_OK ) { -#ifdef DEBUG_SOUND - SetDSerror("DirectSound SetCooperativeLevel", result); -#endif - return(-1); - } - - /* Try to create the primary buffer */ - SDL_memset(&format, 0, sizeof(format)); - format.dwSize = sizeof(format); - format.dwFlags=(DSBCAPS_PRIMARYBUFFER|DSBCAPS_GETCURRENTPOSITION2); - format.dwFlags |= DSBCAPS_STICKYFOCUS; -#ifdef USE_POSITION_NOTIFY - format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY; -#endif - result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL); - if ( result != DS_OK ) { -#ifdef DEBUG_SOUND - SetDSerror("DirectSound CreateSoundBuffer", result); -#endif - return(-1); - } - - /* Check the size of the fragment buffer */ - SDL_memset(&caps, 0, sizeof(caps)); - caps.dwSize = sizeof(caps); - result = IDirectSoundBuffer_GetCaps(*sndbuf, &caps); - if ( result != DS_OK ) { -#ifdef DEBUG_SOUND - SetDSerror("DirectSound GetCaps", result); -#endif - IDirectSoundBuffer_Release(*sndbuf); - return(-1); - } - if ( (chunksize > caps.dwBufferBytes) || - ((caps.dwBufferBytes%chunksize) != 0) ) { - /* The primary buffer size is not a multiple of 'chunksize' - -- this hopefully doesn't happen when 'chunksize' is a - power of 2. - */ - IDirectSoundBuffer_Release(*sndbuf); - SDL_SetError( -"Primary buffer size is: %d, cannot break it into chunks of %d bytes\n", - caps.dwBufferBytes, chunksize); - return(-1); - } - numchunks = (caps.dwBufferBytes/chunksize); - - /* Set the primary audio format */ - result = IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt); - if ( result != DS_OK ) { -#ifdef DEBUG_SOUND - SetDSerror("DirectSound SetFormat", result); -#endif - IDirectSoundBuffer_Release(*sndbuf); - return(-1); - } - return(numchunks); -} -#endif /* USE_PRIMARY_BUFFER */ - -/* This function tries to create a secondary audio buffer, and returns the - number of audio chunks available in the created buffer. -*/ -static int CreateSecondary(LPDIRECTSOUND sndObj, HWND focus, - LPDIRECTSOUNDBUFFER *sndbuf, WAVEFORMATEX *wavefmt, Uint32 chunksize) -{ - const int numchunks = 8; - HRESULT result; - DSBUFFERDESC format; - LPVOID pvAudioPtr1, pvAudioPtr2; - DWORD dwAudioBytes1, dwAudioBytes2; - - /* Try to set primary mixing privileges */ - if ( focus ) { - result = IDirectSound_SetCooperativeLevel(sndObj, - focus, DSSCL_PRIORITY); - } else { - result = IDirectSound_SetCooperativeLevel(sndObj, - GetDesktopWindow(), DSSCL_NORMAL); - } - if ( result != DS_OK ) { -#ifdef DEBUG_SOUND - SetDSerror("DirectSound SetCooperativeLevel", result); -#endif - return(-1); - } - - /* Try to create the secondary buffer */ - SDL_memset(&format, 0, sizeof(format)); - format.dwSize = sizeof(format); - format.dwFlags = DSBCAPS_GETCURRENTPOSITION2; -#ifdef USE_POSITION_NOTIFY - format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY; -#endif - if ( ! focus ) { - format.dwFlags |= DSBCAPS_GLOBALFOCUS; - } else { - format.dwFlags |= DSBCAPS_STICKYFOCUS; - } - format.dwBufferBytes = numchunks*chunksize; - if ( (format.dwBufferBytes < DSBSIZE_MIN) || - (format.dwBufferBytes > DSBSIZE_MAX) ) { - SDL_SetError("Sound buffer size must be between %d and %d", - DSBSIZE_MIN/numchunks, DSBSIZE_MAX/numchunks); - return(-1); - } - format.dwReserved = 0; - format.lpwfxFormat = wavefmt; - result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL); - if ( result != DS_OK ) { - SetDSerror("DirectSound CreateSoundBuffer", result); - return(-1); - } - IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt); - - /* Silence the initial audio buffer */ - result = IDirectSoundBuffer_Lock(*sndbuf, 0, format.dwBufferBytes, - (LPVOID *)&pvAudioPtr1, &dwAudioBytes1, - (LPVOID *)&pvAudioPtr2, &dwAudioBytes2, - DSBLOCK_ENTIREBUFFER); - if ( result == DS_OK ) { - if ( wavefmt->wBitsPerSample == 8 ) { - SDL_memset(pvAudioPtr1, 0x80, dwAudioBytes1); - } else { - SDL_memset(pvAudioPtr1, 0x00, dwAudioBytes1); - } - IDirectSoundBuffer_Unlock(*sndbuf, - (LPVOID)pvAudioPtr1, dwAudioBytes1, - (LPVOID)pvAudioPtr2, dwAudioBytes2); - } - - /* We're ready to go */ - return(numchunks); -} - -/* This function tries to set position notify events on the mixing buffer */ -#ifdef USE_POSITION_NOTIFY -static int CreateAudioEvent(_THIS) -{ - LPDIRECTSOUNDNOTIFY notify; - DSBPOSITIONNOTIFY *notify_positions; - int i, retval; - HRESULT result; - - /* Default to fail on exit */ - retval = -1; - notify = NULL; - - /* Query for the interface */ - result = IDirectSoundBuffer_QueryInterface(mixbuf, - &IID_IDirectSoundNotify, (void *)¬ify); - if ( result != DS_OK ) { - goto done; - } - - /* Allocate the notify structures */ - notify_positions = (DSBPOSITIONNOTIFY *)SDL_malloc(NUM_BUFFERS* - sizeof(*notify_positions)); - if ( notify_positions == NULL ) { - goto done; - } - - /* Create the notify event */ - audio_event = CreateEvent(NULL, FALSE, FALSE, NULL); - if ( audio_event == NULL ) { - goto done; - } - - /* Set up the notify structures */ - for ( i=0; iformat & 0xFF ) { - case 8: - /* Unsigned 8 bit audio data */ - spec->format = AUDIO_U8; - silence = 0x80; - waveformat.wBitsPerSample = 8; - break; - case 16: - /* Signed 16 bit audio data */ - spec->format = AUDIO_S16; - silence = 0x00; - waveformat.wBitsPerSample = 16; - break; - default: - SDL_SetError("Unsupported audio format"); - return(-1); - } - waveformat.nChannels = spec->channels; - waveformat.nSamplesPerSec = spec->freq; - waveformat.nBlockAlign = - waveformat.nChannels * (waveformat.wBitsPerSample/8); - waveformat.nAvgBytesPerSec = - waveformat.nSamplesPerSec * waveformat.nBlockAlign; - - /* Update the fragment size as size in bytes */ - SDL_CalculateAudioSpec(spec); - - /* Open the audio device */ - result = DSoundCreate(NULL, &sound, NULL); - if ( result != DS_OK ) { - SetDSerror("DirectSoundCreate", result); - return(-1); - } - - /* Create the audio buffer to which we write */ - NUM_BUFFERS = -1; -#ifdef USE_PRIMARY_BUFFER - if ( mainwin ) { - NUM_BUFFERS = CreatePrimary(sound, mainwin, &mixbuf, - &waveformat, spec->size); - } -#endif /* USE_PRIMARY_BUFFER */ - if ( NUM_BUFFERS < 0 ) { - NUM_BUFFERS = CreateSecondary(sound, mainwin, &mixbuf, - &waveformat, spec->size); - if ( NUM_BUFFERS < 0 ) { - return(-1); - } -#ifdef DEBUG_SOUND - fprintf(stderr, "Using secondary audio buffer\n"); -#endif - } -#ifdef DEBUG_SOUND - else - fprintf(stderr, "Using primary audio buffer\n"); -#endif - - /* The buffer will auto-start playing in DX5_WaitAudio() */ - lastchunk = 0; - mixlen = spec->size; - -#ifdef USE_POSITION_NOTIFY - /* See if we can use DirectX 6 event notification */ - if ( CreateAudioEvent(this) == 0 ) { - this->WaitAudio = DX6_WaitAudio_EventWait; - } else { - this->WaitAudio = DX5_WaitAudio_BusyWait; - } -#endif - return(0); -} - diff --git a/src/audio/windx5/SDL_dx5audio.h b/src/audio/windx5/SDL_dx5audio.h deleted file mode 100644 index bc4022fc9c..0000000000 --- a/src/audio/windx5/SDL_dx5audio.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_lowaudio_h -#define _SDL_lowaudio_h - -#include "directx.h" - -#include "../SDL_sysaudio.h" - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_AudioDevice *this - -/* The DirectSound objects */ -struct SDL_PrivateAudioData { - LPDIRECTSOUND sound; - LPDIRECTSOUNDBUFFER mixbuf; - int NUM_BUFFERS; - int mixlen, silence; - DWORD lastchunk; - Uint8 *locked_buf; - HANDLE audio_event; -}; - -/* Old variable names */ -#define sound (this->hidden->sound) -#define mixbuf (this->hidden->mixbuf) -#define NUM_BUFFERS (this->hidden->NUM_BUFFERS) -#define mixlen (this->hidden->mixlen) -#define silence (this->hidden->silence) -#define lastchunk (this->hidden->lastchunk) -#define locked_buf (this->hidden->locked_buf) -#define audio_event (this->hidden->audio_event) - -#endif /* _SDL_lowaudio_h */ diff --git a/src/audio/windx5/directx.h b/src/audio/windx5/directx.h deleted file mode 100644 index 5f339f2de8..0000000000 --- a/src/audio/windx5/directx.h +++ /dev/null @@ -1,81 +0,0 @@ - -#ifndef _directx_h -#define _directx_h - -/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */ - -#define WIN32_LEAN_AND_MEAN -#include -#include -#ifndef WIN32 -#define WIN32 -#endif -#undef WINNT - -/* Far pointers don't exist in 32-bit code */ -#ifndef FAR -#define FAR -#endif - -/* Error codes not yet included in Win32 API header files */ -#ifndef MAKE_HRESULT -#define MAKE_HRESULT(sev,fac,code) \ - ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code)))) -#endif - -#ifndef S_OK -#define S_OK (HRESULT)0x00000000L -#endif - -#ifndef SUCCEEDED -#define SUCCEEDED(x) ((HRESULT)(x) >= 0) -#endif -#ifndef FAILED -#define FAILED(x) ((HRESULT)(x)<0) -#endif - -#ifndef E_FAIL -#define E_FAIL (HRESULT)0x80000008L -#endif -#ifndef E_NOINTERFACE -#define E_NOINTERFACE (HRESULT)0x80004002L -#endif -#ifndef E_OUTOFMEMORY -#define E_OUTOFMEMORY (HRESULT)0x8007000EL -#endif -#ifndef E_INVALIDARG -#define E_INVALIDARG (HRESULT)0x80070057L -#endif -#ifndef E_NOTIMPL -#define E_NOTIMPL (HRESULT)0x80004001L -#endif -#ifndef REGDB_E_CLASSNOTREG -#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L -#endif - -/* Severity codes */ -#ifndef SEVERITY_ERROR -#define SEVERITY_ERROR 1 -#endif - -/* Error facility codes */ -#ifndef FACILITY_WIN32 -#define FACILITY_WIN32 7 -#endif - -#ifndef FIELD_OFFSET -#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field)) -#endif - -/* DirectX headers (if it isn't included, I haven't tested it yet) - */ -/* We need these defines to mark what version of DirectX API we use */ -#define DIRECTDRAW_VERSION 0x0700 -#define DIRECTSOUND_VERSION 0x0500 -#define DIRECTINPUT_VERSION 0x0500 - -#include -#include -#include - -#endif /* _directx_h */ diff --git a/src/audio/winmm/SDL_winmm.c b/src/audio/winmm/SDL_winmm.c new file mode 100644 index 0000000000..9c8da7ae22 --- /dev/null +++ b/src/audio/winmm/SDL_winmm.c @@ -0,0 +1,402 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_WINMM + +/* Allow access to a raw mixing buffer */ + +#include "../../core/windows/SDL_windows.h" +#include + +#include "SDL_timer.h" +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "SDL_winmm.h" + +#ifndef WAVE_FORMAT_IEEE_FLOAT +#define WAVE_FORMAT_IEEE_FLOAT 0x0003 +#endif + +#define DETECT_DEV_IMPL(typ, capstyp) \ +static void DetectWave##typ##Devs(SDL_AddAudioDevice addfn) { \ + const UINT devcount = wave##typ##GetNumDevs(); \ + capstyp caps; \ + UINT i; \ + for (i = 0; i < devcount; i++) { \ + if (wave##typ##GetDevCaps(i,&caps,sizeof(caps))==MMSYSERR_NOERROR) { \ + char *name = WIN_StringToUTF8(caps.szPname); \ + if (name != NULL) { \ + addfn(name); \ + SDL_free(name); \ + } \ + } \ + } \ +} + +DETECT_DEV_IMPL(Out, WAVEOUTCAPS) +DETECT_DEV_IMPL(In, WAVEINCAPS) + +static void +WINMM_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +{ + if (iscapture) { + DetectWaveInDevs(addfn); + } else { + DetectWaveOutDevs(addfn); + } +} + +static void CALLBACK +CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) +{ + SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance; + + /* Only service "buffer is filled" messages */ + if (uMsg != WIM_DATA) + return; + + /* Signal that we have a new buffer of data */ + ReleaseSemaphore(this->hidden->audio_sem, 1, NULL); +} + + +/* The Win32 callback for filling the WAVE device */ +static void CALLBACK +FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, + DWORD_PTR dwParam1, DWORD_PTR dwParam2) +{ + SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance; + + /* Only service "buffer done playing" messages */ + if (uMsg != WOM_DONE) + return; + + /* Signal that we are done playing a buffer */ + ReleaseSemaphore(this->hidden->audio_sem, 1, NULL); +} + +static int +SetMMerror(char *function, MMRESULT code) +{ + size_t len; + char errbuf[MAXERRORLENGTH]; + wchar_t werrbuf[MAXERRORLENGTH]; + + SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function); + len = SDL_strlen(errbuf); + + waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len); + WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len, + MAXERRORLENGTH - len, NULL, NULL); + + return SDL_SetError("%s", errbuf); +} + +static void +WINMM_WaitDevice(_THIS) +{ + /* Wait for an audio chunk to finish */ + WaitForSingleObject(this->hidden->audio_sem, INFINITE); +} + +static Uint8 * +WINMM_GetDeviceBuf(_THIS) +{ + return (Uint8 *) (this->hidden-> + wavebuf[this->hidden->next_buffer].lpData); +} + +static void +WINMM_PlayDevice(_THIS) +{ + /* Queue it up */ + waveOutWrite(this->hidden->hout, + &this->hidden->wavebuf[this->hidden->next_buffer], + sizeof(this->hidden->wavebuf[0])); + this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS; +} + +static void +WINMM_WaitDone(_THIS) +{ + int i, left; + + do { + left = NUM_BUFFERS; + for (i = 0; i < NUM_BUFFERS; ++i) { + if (this->hidden->wavebuf[i].dwFlags & WHDR_DONE) { + --left; + } + } + if (left > 0) { + SDL_Delay(100); + } + } while (left > 0); +} + +static void +WINMM_CloseDevice(_THIS) +{ + /* Close up audio */ + if (this->hidden != NULL) { + int i; + + if (this->hidden->audio_sem) { + CloseHandle(this->hidden->audio_sem); + this->hidden->audio_sem = 0; + } + + /* Clean up mixing buffers */ + for (i = 0; i < NUM_BUFFERS; ++i) { + if (this->hidden->wavebuf[i].dwUser != 0xFFFF) { + waveOutUnprepareHeader(this->hidden->hout, + &this->hidden->wavebuf[i], + sizeof(this->hidden->wavebuf[i])); + this->hidden->wavebuf[i].dwUser = 0xFFFF; + } + } + + if (this->hidden->mixbuf != NULL) { + /* Free raw mixing buffer */ + SDL_free(this->hidden->mixbuf); + this->hidden->mixbuf = NULL; + } + + if (this->hidden->hin) { + waveInClose(this->hidden->hin); + this->hidden->hin = 0; + } + + if (this->hidden->hout) { + waveOutClose(this->hidden->hout); + this->hidden->hout = 0; + } + + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static SDL_bool +PrepWaveFormat(_THIS, UINT_PTR devId, WAVEFORMATEX *pfmt, const int iscapture) +{ + SDL_zerop(pfmt); + + if (SDL_AUDIO_ISFLOAT(this->spec.format)) { + pfmt->wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + } else { + pfmt->wFormatTag = WAVE_FORMAT_PCM; + } + pfmt->wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format); + + pfmt->nChannels = this->spec.channels; + pfmt->nSamplesPerSec = this->spec.freq; + pfmt->nBlockAlign = pfmt->nChannels * (pfmt->wBitsPerSample / 8); + pfmt->nAvgBytesPerSec = pfmt->nSamplesPerSec * pfmt->nBlockAlign; + + if (iscapture) { + return (waveInOpen(0, devId, pfmt, 0, 0, WAVE_FORMAT_QUERY) == 0); + } else { + return (waveOutOpen(0, devId, pfmt, 0, 0, WAVE_FORMAT_QUERY) == 0); + } +} + +static int +WINMM_OpenDevice(_THIS, const char *devname, int iscapture) +{ + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + int valid_datatype = 0; + MMRESULT result; + WAVEFORMATEX waveformat; + UINT_PTR devId = WAVE_MAPPER; /* WAVE_MAPPER == choose system's default */ + char *utf8 = NULL; + int i; + + if (devname != NULL) { /* specific device requested? */ + if (iscapture) { + const int devcount = (int) waveInGetNumDevs(); + WAVEINCAPS caps; + for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) { + result = waveInGetDevCaps(i, &caps, sizeof (caps)); + if (result != MMSYSERR_NOERROR) + continue; + else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL) + continue; + else if (SDL_strcmp(devname, utf8) == 0) + devId = (UINT_PTR) i; + SDL_free(utf8); + } + } else { + const int devcount = (int) waveOutGetNumDevs(); + WAVEOUTCAPS caps; + for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) { + result = waveOutGetDevCaps(i, &caps, sizeof (caps)); + if (result != MMSYSERR_NOERROR) + continue; + else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL) + continue; + else if (SDL_strcmp(devname, utf8) == 0) + devId = (UINT_PTR) i; + SDL_free(utf8); + } + } + + if (devId == WAVE_MAPPER) { + return SDL_SetError("Requested device not found"); + } + } + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + /* Initialize the wavebuf structures for closing */ + for (i = 0; i < NUM_BUFFERS; ++i) + this->hidden->wavebuf[i].dwUser = 0xFFFF; + + if (this->spec.channels > 2) + this->spec.channels = 2; /* !!! FIXME: is this right? */ + + /* Check the buffer size -- minimum of 1/4 second (word aligned) */ + if (this->spec.samples < (this->spec.freq / 4)) + this->spec.samples = ((this->spec.freq / 4) + 3) & ~3; + + while ((!valid_datatype) && (test_format)) { + switch (test_format) { + case AUDIO_U8: + case AUDIO_S16: + case AUDIO_S32: + case AUDIO_F32: + this->spec.format = test_format; + if (PrepWaveFormat(this, devId, &waveformat, iscapture)) { + valid_datatype = 1; + } else { + test_format = SDL_NextAudioFormat(); + } + break; + + default: + test_format = SDL_NextAudioFormat(); + break; + } + } + + if (!valid_datatype) { + WINMM_CloseDevice(this); + return SDL_SetError("Unsupported audio format"); + } + + /* Update the fragment size as size in bytes */ + SDL_CalculateAudioSpec(&this->spec); + + /* Open the audio device */ + if (iscapture) { + result = waveInOpen(&this->hidden->hin, devId, &waveformat, + (DWORD_PTR) CaptureSound, (DWORD_PTR) this, + CALLBACK_FUNCTION); + } else { + result = waveOutOpen(&this->hidden->hout, devId, &waveformat, + (DWORD_PTR) FillSound, (DWORD_PTR) this, + CALLBACK_FUNCTION); + } + + if (result != MMSYSERR_NOERROR) { + WINMM_CloseDevice(this); + return SetMMerror("waveOutOpen()", result); + } +#ifdef SOUND_DEBUG + /* Check the sound device we retrieved */ + { + WAVEOUTCAPS caps; + + result = waveOutGetDevCaps((UINT) this->hidden->hout, + &caps, sizeof(caps)); + if (result != MMSYSERR_NOERROR) { + WINMM_CloseDevice(this); + return SetMMerror("waveOutGetDevCaps()", result); + } + printf("Audio device: %s\n", caps.szPname); + } +#endif + + /* Create the audio buffer semaphore */ + this->hidden->audio_sem = + CreateSemaphore(NULL, NUM_BUFFERS - 1, NUM_BUFFERS, NULL); + if (this->hidden->audio_sem == NULL) { + WINMM_CloseDevice(this); + return SDL_SetError("Couldn't create semaphore"); + } + + /* Create the sound buffers */ + this->hidden->mixbuf = + (Uint8 *) SDL_malloc(NUM_BUFFERS * this->spec.size); + if (this->hidden->mixbuf == NULL) { + WINMM_CloseDevice(this); + return SDL_OutOfMemory(); + } + for (i = 0; i < NUM_BUFFERS; ++i) { + SDL_memset(&this->hidden->wavebuf[i], 0, + sizeof(this->hidden->wavebuf[i])); + this->hidden->wavebuf[i].dwBufferLength = this->spec.size; + this->hidden->wavebuf[i].dwFlags = WHDR_DONE; + this->hidden->wavebuf[i].lpData = + (LPSTR) & this->hidden->mixbuf[i * this->spec.size]; + result = waveOutPrepareHeader(this->hidden->hout, + &this->hidden->wavebuf[i], + sizeof(this->hidden->wavebuf[i])); + if (result != MMSYSERR_NOERROR) { + WINMM_CloseDevice(this); + return SetMMerror("waveOutPrepareHeader()", result); + } + } + + return 0; /* Ready to go! */ +} + + +static int +WINMM_Init(SDL_AudioDriverImpl * impl) +{ + /* Set the function pointers */ + impl->DetectDevices = WINMM_DetectDevices; + impl->OpenDevice = WINMM_OpenDevice; + impl->PlayDevice = WINMM_PlayDevice; + impl->WaitDevice = WINMM_WaitDevice; + impl->WaitDone = WINMM_WaitDone; + impl->GetDeviceBuf = WINMM_GetDeviceBuf; + impl->CloseDevice = WINMM_CloseDevice; + + return 1; /* this audio target is available. */ +} + +AudioBootStrap WINMM_bootstrap = { + "winmm", "Windows Waveform Audio", WINMM_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_WINMM */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/winmm/SDL_winmm.h b/src/audio/winmm/SDL_winmm.h new file mode 100644 index 0000000000..5a0574d1ec --- /dev/null +++ b/src/audio/winmm/SDL_winmm.h @@ -0,0 +1,45 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_winmm_h +#define _SDL_winmm_h + +#include "../SDL_sysaudio.h" + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +#define NUM_BUFFERS 2 /* -- Don't lower this! */ + +struct SDL_PrivateAudioData +{ + HWAVEOUT hout; + HWAVEIN hin; + HANDLE audio_sem; + Uint8 *mixbuf; /* The raw allocated mixing buffer */ + WAVEHDR wavebuf[NUM_BUFFERS]; /* Wave audio fragments */ + int next_buffer; +}; + +#endif /* _SDL_winmm_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/xaudio2/SDL_xaudio2.c b/src/audio/xaudio2/SDL_xaudio2.c new file mode 100644 index 0000000000..a2c45ba866 --- /dev/null +++ b/src/audio/xaudio2/SDL_xaudio2.c @@ -0,0 +1,437 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_AUDIO_DRIVER_XAUDIO2 + +#include "../../core/windows/SDL_windows.h" +#include "SDL_audio.h" +#include "../SDL_audio_c.h" +#include "../SDL_sysaudio.h" +#include "SDL_assert.h" + +#ifdef __GNUC__ +/* The configure script already did any necessary checking */ +# define SDL_XAUDIO2_HAS_SDK 1 +#else +#include /* XAudio2 exists as of the March 2008 DirectX SDK */ +#if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284)) +# pragma message("Your DirectX SDK is too old. Disabling XAudio2 support.") +#else +# define SDL_XAUDIO2_HAS_SDK 1 +#endif +#endif /* __GNUC__ */ + +#ifdef SDL_XAUDIO2_HAS_SDK + +#define INITGUID 1 +#include + +/* Hidden "this" pointer for the audio functions */ +#define _THIS SDL_AudioDevice *this + +struct SDL_PrivateAudioData +{ + IXAudio2 *ixa2; + IXAudio2SourceVoice *source; + IXAudio2MasteringVoice *mastering; + HANDLE semaphore; + Uint8 *mixbuf; + int mixlen; + Uint8 *nextbuf; +}; + + +static __inline__ char * +utf16_to_utf8(const WCHAR *S) +{ + /* !!! FIXME: this should be UTF-16, not UCS-2! */ + return SDL_iconv_string("UTF-8", "UCS-2", (char *)(S), + (SDL_wcslen(S)+1)*sizeof(WCHAR)); +} + +static void +XAUDIO2_DetectDevices(int iscapture, SDL_AddAudioDevice addfn) +{ + IXAudio2 *ixa2 = NULL; + UINT32 devcount = 0; + UINT32 i = 0; + + if (iscapture) { + SDL_SetError("XAudio2: capture devices unsupported."); + return; + } else if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { + SDL_SetError("XAudio2: XAudio2Create() failed at detection."); + return; + } else if (IXAudio2_GetDeviceCount(ixa2, &devcount) != S_OK) { + SDL_SetError("XAudio2: IXAudio2::GetDeviceCount() failed."); + IXAudio2_Release(ixa2); + return; + } + + for (i = 0; i < devcount; i++) { + XAUDIO2_DEVICE_DETAILS details; + if (IXAudio2_GetDeviceDetails(ixa2, i, &details) == S_OK) { + char *str = utf16_to_utf8(details.DisplayName); + if (str != NULL) { + addfn(str); + SDL_free(str); /* addfn() made a copy of the string. */ + } + } + } + + IXAudio2_Release(ixa2); +} + +static void STDMETHODCALLTYPE +VoiceCBOnBufferEnd(THIS_ void *data) +{ + /* Just signal the SDL audio thread and get out of XAudio2's way. */ + SDL_AudioDevice *this = (SDL_AudioDevice *) data; + ReleaseSemaphore(this->hidden->semaphore, 1, NULL); +} + +static void STDMETHODCALLTYPE +VoiceCBOnVoiceError(THIS_ void *data, HRESULT Error) +{ + /* !!! FIXME: attempt to recover, or mark device disconnected. */ + SDL_assert(0 && "write me!"); +} + +/* no-op callbacks... */ +static void STDMETHODCALLTYPE VoiceCBOnStreamEnd(THIS) {} +static void STDMETHODCALLTYPE VoiceCBOnVoiceProcessPassStart(THIS_ UINT32 b) {} +static void STDMETHODCALLTYPE VoiceCBOnVoiceProcessPassEnd(THIS) {} +static void STDMETHODCALLTYPE VoiceCBOnBufferStart(THIS_ void *data) {} +static void STDMETHODCALLTYPE VoiceCBOnLoopEnd(THIS_ void *data) {} + + +static Uint8 * +XAUDIO2_GetDeviceBuf(_THIS) +{ + return this->hidden->nextbuf; +} + +static void +XAUDIO2_PlayDevice(_THIS) +{ + XAUDIO2_BUFFER buffer; + Uint8 *mixbuf = this->hidden->mixbuf; + Uint8 *nextbuf = this->hidden->nextbuf; + const int mixlen = this->hidden->mixlen; + IXAudio2SourceVoice *source = this->hidden->source; + HRESULT result = S_OK; + + if (!this->enabled) { /* shutting down? */ + return; + } + + /* Submit the next filled buffer */ + SDL_zero(buffer); + buffer.AudioBytes = mixlen; + buffer.pAudioData = nextbuf; + buffer.pContext = this; + + if (nextbuf == mixbuf) { + nextbuf += mixlen; + } else { + nextbuf = mixbuf; + } + this->hidden->nextbuf = nextbuf; + + result = IXAudio2SourceVoice_SubmitSourceBuffer(source, &buffer, NULL); + if (result == XAUDIO2_E_DEVICE_INVALIDATED) { + /* !!! FIXME: possibly disconnected or temporary lost. Recover? */ + } + + if (result != S_OK) { /* uhoh, panic! */ + IXAudio2SourceVoice_FlushSourceBuffers(source); + this->enabled = 0; + } +} + +static void +XAUDIO2_WaitDevice(_THIS) +{ + if (this->enabled) { + WaitForSingleObject(this->hidden->semaphore, INFINITE); + } +} + +static void +XAUDIO2_WaitDone(_THIS) +{ + IXAudio2SourceVoice *source = this->hidden->source; + XAUDIO2_VOICE_STATE state; + SDL_assert(!this->enabled); /* flag that stops playing. */ + IXAudio2SourceVoice_Discontinuity(source); + IXAudio2SourceVoice_GetState(source, &state); + while (state.BuffersQueued > 0) { + WaitForSingleObject(this->hidden->semaphore, INFINITE); + IXAudio2SourceVoice_GetState(source, &state); + } +} + + +static void +XAUDIO2_CloseDevice(_THIS) +{ + if (this->hidden != NULL) { + IXAudio2 *ixa2 = this->hidden->ixa2; + IXAudio2SourceVoice *source = this->hidden->source; + IXAudio2MasteringVoice *mastering = this->hidden->mastering; + + if (source != NULL) { + IXAudio2SourceVoice_Stop(source, 0, XAUDIO2_COMMIT_NOW); + IXAudio2SourceVoice_FlushSourceBuffers(source); + IXAudio2SourceVoice_DestroyVoice(source); + } + if (ixa2 != NULL) { + IXAudio2_StopEngine(ixa2); + } + if (mastering != NULL) { + IXAudio2MasteringVoice_DestroyVoice(mastering); + } + if (ixa2 != NULL) { + IXAudio2_Release(ixa2); + } + if (this->hidden->mixbuf != NULL) { + SDL_free(this->hidden->mixbuf); + } + if (this->hidden->semaphore != NULL) { + CloseHandle(this->hidden->semaphore); + } + + SDL_free(this->hidden); + this->hidden = NULL; + } +} + +static int +XAUDIO2_OpenDevice(_THIS, const char *devname, int iscapture) +{ + HRESULT result = S_OK; + WAVEFORMATEX waveformat; + int valid_format = 0; + SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); + IXAudio2 *ixa2 = NULL; + IXAudio2SourceVoice *source = NULL; + UINT32 devId = 0; /* 0 == system default device. */ + + static IXAudio2VoiceCallbackVtbl callbacks_vtable = { + VoiceCBOnVoiceProcessPassStart, + VoiceCBOnVoiceProcessPassEnd, + VoiceCBOnStreamEnd, + VoiceCBOnBufferStart, + VoiceCBOnBufferEnd, + VoiceCBOnLoopEnd, + VoiceCBOnVoiceError + }; + + static IXAudio2VoiceCallback callbacks = { &callbacks_vtable }; + + if (iscapture) { + return SDL_SetError("XAudio2: capture devices unsupported."); + } else if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { + return SDL_SetError("XAudio2: XAudio2Create() failed at open."); + } + + if (devname != NULL) { + UINT32 devcount = 0; + UINT32 i = 0; + + if (IXAudio2_GetDeviceCount(ixa2, &devcount) != S_OK) { + IXAudio2_Release(ixa2); + return SDL_SetError("XAudio2: IXAudio2_GetDeviceCount() failed."); + } + for (i = 0; i < devcount; i++) { + XAUDIO2_DEVICE_DETAILS details; + if (IXAudio2_GetDeviceDetails(ixa2, i, &details) == S_OK) { + char *str = utf16_to_utf8(details.DisplayName); + if (str != NULL) { + const int match = (SDL_strcmp(str, devname) == 0); + SDL_free(str); + if (match) { + devId = i; + break; + } + } + } + } + + if (i == devcount) { + IXAudio2_Release(ixa2); + return SDL_SetError("XAudio2: Requested device not found."); + } + } + + /* Initialize all variables that we clean on shutdown */ + this->hidden = (struct SDL_PrivateAudioData *) + SDL_malloc((sizeof *this->hidden)); + if (this->hidden == NULL) { + IXAudio2_Release(ixa2); + return SDL_OutOfMemory(); + } + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); + + this->hidden->ixa2 = ixa2; + this->hidden->semaphore = CreateSemaphore(NULL, 1, 2, NULL); + if (this->hidden->semaphore == NULL) { + XAUDIO2_CloseDevice(this); + return SDL_SetError("XAudio2: CreateSemaphore() failed!"); + } + + while ((!valid_format) && (test_format)) { + switch (test_format) { + case AUDIO_U8: + case AUDIO_S16: + case AUDIO_S32: + case AUDIO_F32: + this->spec.format = test_format; + valid_format = 1; + break; + } + test_format = SDL_NextAudioFormat(); + } + + if (!valid_format) { + XAUDIO2_CloseDevice(this); + return SDL_SetError("XAudio2: Unsupported audio format"); + } + + /* Update the fragment size as size in bytes */ + SDL_CalculateAudioSpec(&this->spec); + + /* We feed a Source, it feeds the Mastering, which feeds the device. */ + this->hidden->mixlen = this->spec.size; + this->hidden->mixbuf = (Uint8 *) SDL_malloc(2 * this->hidden->mixlen); + if (this->hidden->mixbuf == NULL) { + XAUDIO2_CloseDevice(this); + return SDL_OutOfMemory(); + } + this->hidden->nextbuf = this->hidden->mixbuf; + SDL_memset(this->hidden->mixbuf, 0, 2 * this->hidden->mixlen); + + /* We use XAUDIO2_DEFAULT_CHANNELS instead of this->spec.channels. On + Xbox360, this means 5.1 output, but on Windows, it means "figure out + what the system has." It might be preferable to let XAudio2 blast + stereo output to appropriate surround sound configurations + instead of clamping to 2 channels, even though we'll configure the + Source Voice for whatever number of channels you supply. */ + result = IXAudio2_CreateMasteringVoice(ixa2, &this->hidden->mastering, + XAUDIO2_DEFAULT_CHANNELS, + this->spec.freq, 0, devId, NULL); + if (result != S_OK) { + XAUDIO2_CloseDevice(this); + return SDL_SetError("XAudio2: Couldn't create mastering voice"); + } + + SDL_zero(waveformat); + if (SDL_AUDIO_ISFLOAT(this->spec.format)) { + waveformat.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + } else { + waveformat.wFormatTag = WAVE_FORMAT_PCM; + } + waveformat.wBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format); + waveformat.nChannels = this->spec.channels; + waveformat.nSamplesPerSec = this->spec.freq; + waveformat.nBlockAlign = + waveformat.nChannels * (waveformat.wBitsPerSample / 8); + waveformat.nAvgBytesPerSec = + waveformat.nSamplesPerSec * waveformat.nBlockAlign; + + result = IXAudio2_CreateSourceVoice(ixa2, &source, &waveformat, + XAUDIO2_VOICE_NOSRC | + XAUDIO2_VOICE_NOPITCH, + 1.0f, &callbacks, NULL, NULL); + if (result != S_OK) { + XAUDIO2_CloseDevice(this); + return SDL_SetError("XAudio2: Couldn't create source voice"); + } + this->hidden->source = source; + + /* Start everything playing! */ + result = IXAudio2_StartEngine(ixa2); + if (result != S_OK) { + XAUDIO2_CloseDevice(this); + return SDL_SetError("XAudio2: Couldn't start engine"); + } + + result = IXAudio2SourceVoice_Start(source, 0, XAUDIO2_COMMIT_NOW); + if (result != S_OK) { + XAUDIO2_CloseDevice(this); + return SDL_SetError("XAudio2: Couldn't start source voice"); + } + + return 0; /* good to go. */ +} + +static void +XAUDIO2_Deinitialize(void) +{ + WIN_CoUninitialize(); +} + +#endif /* SDL_XAUDIO2_HAS_SDK */ + + +static int +XAUDIO2_Init(SDL_AudioDriverImpl * impl) +{ +#ifndef SDL_XAUDIO2_HAS_SDK + SDL_SetError("XAudio2: SDL was built without XAudio2 support (old DirectX SDK)."); + return 0; /* no XAudio2 support, ever. Update your SDK! */ +#else + /* XAudio2Create() is a macro that uses COM; we don't load the .dll */ + IXAudio2 *ixa2 = NULL; + if (FAILED(WIN_CoInitialize())) { + SDL_SetError("XAudio2: CoInitialize() failed"); + return 0; + } + + if (XAudio2Create(&ixa2, 0, XAUDIO2_DEFAULT_PROCESSOR) != S_OK) { + WIN_CoUninitialize(); + SDL_SetError("XAudio2: XAudio2Create() failed at initialization"); + return 0; /* not available. */ + } + IXAudio2_Release(ixa2); + + /* Set the function pointers */ + impl->DetectDevices = XAUDIO2_DetectDevices; + impl->OpenDevice = XAUDIO2_OpenDevice; + impl->PlayDevice = XAUDIO2_PlayDevice; + impl->WaitDevice = XAUDIO2_WaitDevice; + impl->WaitDone = XAUDIO2_WaitDone; + impl->GetDeviceBuf = XAUDIO2_GetDeviceBuf; + impl->CloseDevice = XAUDIO2_CloseDevice; + impl->Deinitialize = XAUDIO2_Deinitialize; + + return 1; /* this audio target is available. */ +#endif +} + +AudioBootStrap XAUDIO2_bootstrap = { + "xaudio2", "XAudio2", XAUDIO2_Init, 0 +}; + +#endif /* SDL_AUDIO_DRIVER_XAUDIO2 */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/cdrom/SDL_cdrom.c b/src/cdrom/SDL_cdrom.c deleted file mode 100644 index 8f91bb1b34..0000000000 --- a/src/cdrom/SDL_cdrom.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the CD-audio control API for Simple DirectMedia Layer */ - -#include "SDL_cdrom.h" -#include "SDL_syscdrom.h" - -#if !defined(__MACOS__) -#define CLIP_FRAMES 10 /* Some CD-ROMs won't go all the way */ -#endif - -static int SDL_cdinitted = 0; -static SDL_CD *default_cdrom; - -/* The system level CD-ROM control functions */ -struct CDcaps SDL_CDcaps = { - NULL, /* Name */ - NULL, /* Open */ - NULL, /* GetTOC */ - NULL, /* Status */ - NULL, /* Play */ - NULL, /* Pause */ - NULL, /* Resume */ - NULL, /* Stop */ - NULL, /* Eject */ - NULL, /* Close */ -}; -int SDL_numcds; - -int SDL_CDROMInit(void) -{ - int retval; - - SDL_numcds = 0; - retval = SDL_SYS_CDInit(); - if ( retval == 0 ) { - SDL_cdinitted = 1; - } - default_cdrom = NULL; - return(retval); -} - -/* Check to see if the CD-ROM subsystem has been initialized */ -static int CheckInit(int check_cdrom, SDL_CD **cdrom) -{ - int okay; - - okay = SDL_cdinitted; - if ( check_cdrom && (*cdrom == NULL) ) { - *cdrom = default_cdrom; - if ( *cdrom == NULL ) { - SDL_SetError("CD-ROM not opened"); - okay = 0; - } - } - if ( ! SDL_cdinitted ) { - SDL_SetError("CD-ROM subsystem not initialized"); - } - return(okay); -} - -int SDL_CDNumDrives(void) -{ - if ( ! CheckInit(0, NULL) ) { - return(-1); - } - return(SDL_numcds); -} - -const char *SDL_CDName(int drive) -{ - if ( ! CheckInit(0, NULL) ) { - return(NULL); - } - if ( drive >= SDL_numcds ) { - SDL_SetError("Invalid CD-ROM drive index"); - return(NULL); - } - if ( SDL_CDcaps.Name ) { - return(SDL_CDcaps.Name(drive)); - } else { - return(""); - } -} - -SDL_CD *SDL_CDOpen(int drive) -{ - struct SDL_CD *cdrom; - - if ( ! CheckInit(0, NULL) ) { - return(NULL); - } - if ( drive >= SDL_numcds ) { - SDL_SetError("Invalid CD-ROM drive index"); - return(NULL); - } - cdrom = (SDL_CD *)SDL_malloc(sizeof(*cdrom)); - if ( cdrom == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - SDL_memset(cdrom, 0, sizeof(*cdrom)); - cdrom->id = SDL_CDcaps.Open(drive); - if ( cdrom->id < 0 ) { - SDL_free(cdrom); - return(NULL); - } - default_cdrom = cdrom; - return(cdrom); -} - -CDstatus SDL_CDStatus(SDL_CD *cdrom) -{ - CDstatus status; - int i; - Uint32 position; - - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return(CD_ERROR); - } - - /* Get the current status of the drive */ - cdrom->numtracks = 0; - cdrom->cur_track = 0; - cdrom->cur_frame = 0; - status = SDL_CDcaps.Status(cdrom, &i); - position = (Uint32)i; - cdrom->status = status; - - /* Get the table of contents, if there's a CD available */ - if ( CD_INDRIVE(status) ) { - if ( SDL_CDcaps.GetTOC(cdrom) < 0 ) { - status = CD_ERROR; - } - /* If the drive is playing, get current play position */ - if ( (status == CD_PLAYING) || (status == CD_PAUSED) ) { - for ( i=1; cdrom->track[i].offset <= position; ++i ) { - /* Keep looking */; - } -#ifdef DEBUG_CDROM - fprintf(stderr, "Current position: %d, track = %d (offset is %d)\n", - position, i-1, cdrom->track[i-1].offset); -#endif - cdrom->cur_track = i-1; - position -= cdrom->track[cdrom->cur_track].offset; - cdrom->cur_frame = position; - } - } - return(status); -} - -int SDL_CDPlayTracks(SDL_CD *cdrom, - int strack, int sframe, int ntracks, int nframes) -{ - int etrack, eframe; - int start, length; - - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return(CD_ERROR); - } - - /* Determine the starting and ending tracks */ - if ( (strack < 0) || (strack >= cdrom->numtracks) ) { - SDL_SetError("Invalid starting track"); - return(CD_ERROR); - } - if ( ! ntracks && ! nframes ) { - etrack = cdrom->numtracks; - eframe = 0; - } else { - etrack = strack+ntracks; - if ( etrack == strack ) { - eframe = sframe + nframes; - } else { - eframe = nframes; - } - } - if ( etrack > cdrom->numtracks ) { - SDL_SetError("Invalid play length"); - return(CD_ERROR); - } - - /* Skip data tracks and verify frame offsets */ - while ( (strack <= etrack) && - (cdrom->track[strack].type == SDL_DATA_TRACK) ) { - ++strack; - } - if ( sframe >= (int)cdrom->track[strack].length ) { - SDL_SetError("Invalid starting frame for track %d", strack); - return(CD_ERROR); - } - while ( (etrack > strack) && - (cdrom->track[etrack-1].type == SDL_DATA_TRACK) ) { - --etrack; - } - if ( eframe > (int)cdrom->track[etrack].length ) { - SDL_SetError("Invalid ending frame for track %d", etrack); - return(CD_ERROR); - } - - /* Determine start frame and play length */ - start = (cdrom->track[strack].offset+sframe); - length = (cdrom->track[etrack].offset+eframe)-start; -#ifdef CLIP_FRAMES - /* I've never seen this necessary, but xmcd does it.. */ - length -= CLIP_FRAMES; /* CLIP_FRAMES == 10 */ -#endif - if ( length < 0 ) { - return(0); - } - - /* Play! */ -#ifdef DEBUG_CDROM - fprintf(stderr, "Playing %d frames at offset %d\n", length, start); -#endif - return(SDL_CDcaps.Play(cdrom, start, length)); -} - -int SDL_CDPlay(SDL_CD *cdrom, int sframe, int length) -{ - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return(CD_ERROR); - } - - return(SDL_CDcaps.Play(cdrom, sframe, length)); -} - -int SDL_CDPause(SDL_CD *cdrom) -{ - CDstatus status; - int retval; - - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return(CD_ERROR); - } - - status = SDL_CDcaps.Status(cdrom, NULL); - switch (status) { - case CD_PLAYING: - retval = SDL_CDcaps.Pause(cdrom); - break; - default: - retval = 0; - break; - } - return(retval); -} - -int SDL_CDResume(SDL_CD *cdrom) -{ - CDstatus status; - int retval; - - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return(CD_ERROR); - } - - status = SDL_CDcaps.Status(cdrom, NULL); - switch (status) { - case CD_PAUSED: - retval = SDL_CDcaps.Resume(cdrom); - default: - retval = 0; - break; - } - return(retval); -} - -int SDL_CDStop(SDL_CD *cdrom) -{ - CDstatus status; - int retval; - - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return(CD_ERROR); - } - - status = SDL_CDcaps.Status(cdrom, NULL); - switch (status) { - case CD_PLAYING: - case CD_PAUSED: - retval = SDL_CDcaps.Stop(cdrom); - default: - retval = 0; - break; - } - return(retval); -} - -int SDL_CDEject(SDL_CD *cdrom) -{ - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return(CD_ERROR); - } - return(SDL_CDcaps.Eject(cdrom)); -} - -void SDL_CDClose(SDL_CD *cdrom) -{ - /* Check if the CD-ROM subsystem has been initialized */ - if ( ! CheckInit(1, &cdrom) ) { - return; - } - SDL_CDcaps.Close(cdrom); - SDL_free(cdrom); - default_cdrom = NULL; -} - -void SDL_CDROMQuit(void) -{ - SDL_SYS_CDQuit(); - SDL_cdinitted = 0; -} diff --git a/src/cdrom/SDL_syscdrom.h b/src/cdrom/SDL_syscdrom.h deleted file mode 100644 index 0feeee5b4d..0000000000 --- a/src/cdrom/SDL_syscdrom.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is SDL_free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the system specific header for the SDL CD-ROM API */ - -/* Structure of CD audio control functions */ -extern struct CDcaps { - /* Get the name of the specified drive */ - const char *(*Name)(int drive); - - /* Open the specified drive, returning a drive id, or -1 on error */ - int (*Open)(int drive); - - /* Get table-of-contents (number of tracks + track info) for disk. - The TOC information should be stored in the cdrom structure. - This function should return 0 on success, or -1 on error. - */ - int (*GetTOC)(SDL_CD *cdrom); - - /* Return the current status and play position, in frames, of the - drive. 'position' may be NULL, and if so, should be ignored. - */ - CDstatus (*Status)(SDL_CD *cdrom, int *position); - - /* Play from frame 'start' to 'start+len' */ - int (*Play)(SDL_CD *cdrom, int start, int len); - - /* Pause play */ - int (*Pause)(SDL_CD *cdrom); - - /* Resume play */ - int (*Resume)(SDL_CD *cdrom); - - /* Stop play */ - int (*Stop)(SDL_CD *cdrom); - - /* Eject the current disk */ - int (*Eject)(SDL_CD *cdrom); - - /* Close the specified drive */ - void (*Close)(SDL_CD *cdrom); -} SDL_CDcaps; - -/* The number of available CD-ROM drives on the system */ -extern int SDL_numcds; - -/* Function to scan the system for CD-ROM drives and fill SDL_CDcaps. - * This function should set SDL_numcds to the number of available CD - * drives. Drive 0 should be the system default CD-ROM. - * It should return 0, or -1 on an unrecoverable fatal error. -*/ -extern int SDL_SYS_CDInit(void); - -/* Function to perform any system-specific CD-ROM related cleanup */ -extern void SDL_SYS_CDQuit(void); - diff --git a/src/cdrom/aix/SDL_syscdrom.c b/src/cdrom/aix/SDL_syscdrom.c deleted file mode 100644 index e7e05585e3..0000000000 --- a/src/cdrom/aix/SDL_syscdrom.c +++ /dev/null @@ -1,660 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Carsten Griwodz - griff@kom.tu-darmstadt.de - - based on linux/SDL_syscdrom.c by Sam Lantinga -*/ -#include "SDL_config.h" - -#ifdef SDL_CDROM_AIX - -/* Functions for system-level CD-ROM audio control */ - -/*#define DEBUG_CDROM 1*/ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static dev_t SDL_cdmode[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); -static int SDL_SYS_CDioctl(int id, int command, void *arg); - -/* Check a drive to see if it is a CD-ROM */ -static int CheckDrive(char *drive, struct stat *stbuf) -{ - int is_cd; - int cdfd; - int ret; - struct devinfo info; - - /* If it doesn't exist, return -1 */ - if ( stat(drive, stbuf) < 0 ) { - return -1; - } - - /* If it does exist, verify that it's an available CD-ROM */ - is_cd = 0; - if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) { - cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0); - if ( cdfd >= 0 ) { - ret = SDL_SYS_CDioctl( cdfd, IOCINFO, &info ); - if ( ret < 0 ) { - /* Some kind of error */ - is_cd = 0; - } else { - if ( info.devtype == DD_CDROM ) { - is_cd = 1; - } else { - is_cd = 0; - } - } - close(cdfd); - } -#ifdef DEBUG_CDROM - else - { - fprintf(stderr, "Could not open drive %s (%s)\n", drive, strerror(errno)); - } -#endif - } - return is_cd; -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive, struct stat *stbuf) -{ - int i; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Check to make sure it's not already in our list. - This can happen when we see a drive via symbolic link. - */ - for ( i=0; ist_rdev == SDL_cdmode[i] ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]); -#endif - return; - } - } - - /* Add this drive to our list */ - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - SDL_cdmode[i] = stbuf->st_rdev; - ++SDL_numcds; -#ifdef DEBUG_CDROM - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -static void CheckMounts() -{ - char* buffer; - int bufsz; - struct vmount* ptr; - int ret; - - buffer = (char*)SDL_malloc(10); - bufsz = 10; - if ( buffer==NULL ) - { - fprintf(stderr, "Could not allocate 10 bytes in aix/SDL_syscdrom.c:CheckMounts\n" ); - exit ( -10 ); - } - - do - { - /* mntctrl() returns an array of all mounted filesystems */ - ret = mntctl ( MCTL_QUERY, bufsz, buffer ); - if ( ret == 0 ) - { - /* Buffer was too small, realloc. */ - bufsz = *(int*)buffer; /* Required size is in first word. */ - /* (whatever a word is in AIX 4.3.3) */ - /* int seems to be OK in 32bit mode. */ - SDL_free(buffer); - buffer = (char*)SDL_malloc(bufsz); - if ( buffer==NULL ) - { - fprintf(stderr, - "Could not allocate %d bytes in aix/SDL_syscdrom.c:CheckMounts\n", - bufsz ); - exit ( -10 ); - } - } - else if ( ret < 0 ) - { -#ifdef DEBUG_CDROM - fprintf(stderr, "Error reading vmount structures\n"); -#endif - return; - } - } - while ( ret == 0 ); - -#ifdef DEBUG_CDROM - fprintf ( stderr, "Read %d vmount structures\n",ret ); -#endif - ptr = (struct vmount*)buffer; - do - { - switch(ptr->vmt_gfstype) - { - case MNT_CDROM : - { - struct stat stbuf; - char* text; - - text = (char*)ptr + ptr->vmt_data[VMT_OBJECT].vmt_off; -#ifdef DEBUG_CDROM - fprintf(stderr, "Checking mount path: %s mounted on %s\n", - text, (char*)ptr + ptr->vmt_data[VMT_STUB].vmt_off ); -#endif - if ( CheckDrive( text, &stbuf) > 0) - { - AddDrive( text, &stbuf); - } - } - break; - default : - break; - } - ptr = (struct vmount*)((char*)ptr + ptr->vmt_length); - ret--; - } - while ( ret > 0 ); - - free ( buffer ); -} - -static int CheckNonmounts() -{ -#ifdef _THREAD_SAFE - AFILE_t fsFile = NULL; - int passNo = 0; - int ret; - struct fstab entry; - struct stat stbuf; - - ret = setfsent_r( &fsFile, &passNo ); - if ( ret != 0 ) return -1; - do - { - ret = getfsent_r ( &entry, &fsFile, &passNo ); - if ( ret == 0 ) { - char* l = SDL_strrchr(entry.fs_spec,'/'); - if ( l != NULL ) { - if ( !SDL_strncmp("cd",++l,2) ) { -#ifdef DEBUG_CDROM - fprintf(stderr, - "Found unmounted CD ROM drive with device name %s\n", - entry.fs_spec); -#endif - if ( CheckDrive( entry.fs_spec, &stbuf) > 0) - { - AddDrive( entry.fs_spec, &stbuf); - } - } - } - } - } - while ( ret == 0 ); - ret = endfsent_r ( &fsFile ); - if ( ret != 0 ) return -1; - return 0; -#else - struct fstab* entry; - struct stat stbuf; - - setfsent(); - do - { - entry = getfsent(); - if ( entry != NULL ) { - char* l = SDL_strrchr(entry->fs_spec,'/'); - if ( l != NULL ) { - if ( !SDL_strncmp("cd",++l,2) ) { -#ifdef DEBUG_CDROM - fprintf(stderr,"Found unmounted CD ROM drive with device name %s", entry->fs_spec); -#endif - if ( CheckDrive( entry->fs_spec, &stbuf) > 0) - { - AddDrive( entry->fs_spec, &stbuf); - } - } - } - } - } - while ( entry != NULL ); - endfsent(); -#endif -} - -int SDL_SYS_CDInit(void) -{ - char *SDLcdrom; - struct stat stbuf; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Look in the environment for our CD-ROM drive list */ - SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ - if ( SDLcdrom != NULL ) { - char *cdpath, *delim; - size_t len = SDL_strlen(SDLcdrom)+1; - cdpath = SDL_stack_alloc(char, len); - if ( cdpath != NULL ) { - SDL_strlcpy(cdpath, SDLcdrom, len); - SDLcdrom = cdpath; - do { - delim = SDL_strchr(SDLcdrom, ':'); - if ( delim ) { - *delim++ = '\0'; - } -#ifdef DEBUG_CDROM - fprintf(stderr, "Checking CD-ROM drive from SDL_CDROM: %s\n", SDLcdrom); -#endif - if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) { - AddDrive(SDLcdrom, &stbuf); - } - if ( delim ) { - SDLcdrom = delim; - } else { - SDLcdrom = NULL; - } - } while ( SDLcdrom ); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } - } - - CheckMounts(); - CheckNonmounts(); - - return 0; -} - -/* General ioctl() CD-ROM command function */ -static int SDL_SYS_CDioctl(int id, int command, void *arg) -{ - int retval; - - retval = ioctl(id, command, arg); - if ( retval < 0 ) { - SDL_SetError("ioctl() error: %s", strerror(errno)); - } - return retval; -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - int fd; - char* lastsl; - char* cdromname; - size_t len; - - /* - * We found /dev/cd? drives and that is in our list. But we can - * open only the /dev/rcd? versions of those devices for Audio CD. - */ - len = SDL_strlen(SDL_cdlist[drive])+2; - cdromname = (char*)SDL_malloc(len); - SDL_strlcpy(cdromname,SDL_cdlist[drive],len); - lastsl = SDL_strrchr(cdromname,'/'); - if (lastsl) { - *lastsl = 0; - SDL_strlcat(cdromname,"/r",len); - lastsl = SDL_strrchr(SDL_cdlist[drive],'/'); - if (lastsl) { - lastsl++; - SDL_strlcat(cdromname,lastsl,len); - } - } - -#ifdef DEBUG_CDROM - fprintf(stderr, "Should open drive %s, opening %s\n", SDL_cdlist[drive], cdromname); -#endif - - /* - * Use exclusive access. Don't use SC_DIAGNOSTICS as xmcd does because they - * require root priviledges, and we don't want that. SC_SINGLE provides - * exclusive access with less trouble. - */ - fd = openx(cdromname, O_RDONLY, NULL, SC_SINGLE); - if ( fd < 0 ) - { -#ifdef DEBUG_CDROM - fprintf(stderr, "Could not open drive %s (%s)\n", cdromname, strerror(errno)); -#endif - } - else - { - struct mode_form_op cdMode; - int ret; -#ifdef DEBUG_CDROM - cdMode.action = CD_GET_MODE; - ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode); - if ( ret < 0 ) { - fprintf(stderr, - "Could not get drive mode for %s (%s)\n", - cdromname, strerror(errno)); - } else { - switch(cdMode.cd_mode_form) { - case CD_MODE1 : - fprintf(stderr, - "Drive mode for %s is %s\n", - cdromname, "CD-ROM Data Mode 1"); - break; - case CD_MODE2_FORM1 : - fprintf(stderr, - "Drive mode for %s is %s\n", - cdromname, "CD-ROM XA Data Mode 2 Form 1"); - break; - case CD_MODE2_FORM2 : - fprintf(stderr, - "Drive mode for %s is %s\n", - cdromname, "CD-ROM XA Data Mode 2 Form 2"); - break; - case CD_DA : - fprintf(stderr, - "Drive mode for %s is %s\n", - cdromname, "CD-DA"); - break; - default : - fprintf(stderr, - "Drive mode for %s is %s\n", - cdromname, "unknown"); - break; - } - } -#endif - - cdMode.action = CD_CHG_MODE; - cdMode.cd_mode_form = CD_DA; - ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode); - if ( ret < 0 ) { -#ifdef DEBUG_CDROM - fprintf(stderr, - "Could not set drive mode for %s (%s)\n", - cdromname, strerror(errno)); -#endif - SDL_SetError("ioctl() error: Could not set CD drive mode, %s", - strerror(errno)); - } else { -#ifdef DEBUG_CDROM - fprintf(stderr, - "Drive mode for %s set to CD_DA\n", - cdromname); -#endif - } - } - SDL_free(cdromname); - return fd; -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - struct cd_audio_cmd cmd; - struct cd_audio_cmd entry; - int i; - int okay; - - cmd.audio_cmds = CD_TRK_INFO_AUDIO; - cmd.msf_flag = FALSE; - if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) { - return -1; - } - - okay = 0; - cdrom->numtracks = cmd.indexing.track_index.last_track - - cmd.indexing.track_index.first_track+1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } - - /* Read all the track TOC entries */ - for ( i=0; i<=cdrom->numtracks; ++i ) { - if ( i == cdrom->numtracks ) { - cdrom->track[i].id = 0xAA;; - } else { - cdrom->track[i].id = cmd.indexing.track_index.first_track+i; - } - entry.audio_cmds = CD_GET_TRK_MSF; - entry.indexing.track_msf.track = cdrom->track[i].id; - if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &entry) < 0 ) { - break; - } else { - cdrom->track[i].type = 0; /* don't know how to detect 0x04 data track */ - cdrom->track[i].offset = MSF_TO_FRAMES( - entry.indexing.track_msf.mins, - entry.indexing.track_msf.secs, - entry.indexing.track_msf.frames); - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i-1].length = cdrom->track[i].offset - - cdrom->track[i-1].offset; - } - } - } - if ( i == (cdrom->numtracks+1) ) { - okay = 1; - } - return(okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - struct cd_audio_cmd cmd; - cmd.audio_cmds = CD_INFO_AUDIO; - - if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "ioctl failed in SDL_SYS_CDStatus (%s)\n", SDL_GetError()); -#endif - status = CD_ERROR; - } else { - switch (cmd.status) { - case CD_NO_AUDIO: - case CD_COMPLETED: - status = CD_STOPPED; - break; - case CD_PLAY_AUDIO: - status = CD_PLAYING; - break; - case CD_PAUSE_AUDIO: - status = CD_PAUSED; - break; - case CD_NOT_VALID: -#ifdef DEBUG_CDROM - fprintf(stderr, "cdStatus failed with CD_NOT_VALID\n"); -#endif - status = CD_ERROR; - break; - case CD_STATUS_ERROR: -#ifdef DEBUG_CDROM - fprintf(stderr, "cdStatus failed with CD_STATUS_ERROR\n"); -#endif - status = CD_ERROR; - break; - default: -#ifdef DEBUG_CDROM - fprintf(stderr, "cdStatus failed with unknown error\n"); -#endif - status = CD_ERROR; - break; - } - } - if ( position ) { - if ( status == CD_PLAYING || (status == CD_PAUSED) ) { - *position = MSF_TO_FRAMES( cmd.indexing.info_audio.current_mins, - cmd.indexing.info_audio.current_secs, - cmd.indexing.info_audio.current_frames); - } else { - *position = 0; - } - } - return status; -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - struct cd_audio_cmd cmd; - - /* - * My CD Rom is muted by default. I think I read that this is new with - * AIX 4.3. SDL does not change the volume, so I need a kludge. Maybe - * its better to do this elsewhere? - */ - cmd.audio_cmds = CD_PLAY_AUDIO | CD_SET_VOLUME; - cmd.msf_flag = TRUE; - FRAMES_TO_MSF(start, - &cmd.indexing.msf.first_mins, - &cmd.indexing.msf.first_secs, - &cmd.indexing.msf.first_frames); - FRAMES_TO_MSF(start+length, - &cmd.indexing.msf.last_mins, - &cmd.indexing.msf.last_secs, - &cmd.indexing.msf.last_frames); - cmd.volume_type = CD_VOLUME_ALL; - cmd.all_channel_vol = 255; /* This is a uchar. What is a good value? No docu! */ - cmd.out_port_0_sel = CD_AUDIO_CHNL_0; - cmd.out_port_1_sel = CD_AUDIO_CHNL_1; - cmd.out_port_2_sel = CD_AUDIO_CHNL_2; - cmd.out_port_3_sel = CD_AUDIO_CHNL_3; - -#ifdef DEBUG_CDROM - fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n", - cmd.indexing.msf.first_mins, - cmd.indexing.msf.first_secs, - cmd.indexing.msf.first_frames, - cmd.indexing.msf.last_mins, - cmd.indexing.msf.last_secs, - cmd.indexing.msf.last_frames); -#endif - return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - struct cd_audio_cmd cmd; - cmd.audio_cmds = CD_PAUSE_AUDIO; - return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - struct cd_audio_cmd cmd; - cmd.audio_cmds = CD_RESUME_AUDIO; - return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - struct cd_audio_cmd cmd; - cmd.audio_cmds = CD_STOP_AUDIO; - return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, DKEJECT, 0)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - close(cdrom->id); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i -#include -#include - -#include -#include -#include -#include - -#include "SDL_cdrom.h" -extern "C" { -#include "../SDL_syscdrom.h" -} - -/* Constants to help us get at the SCSI table-of-contents info */ -#define CD_NUMTRACKS(toc) toc.toc_data[3] -#define CD_TRACK(toc, track) (&toc.toc_data[6+(track)*8]) -#define CD_TRACK_N(toc, track) CD_TRACK(toc, track)[0] -#define CD_TRACK_M(toc, track) CD_TRACK(toc, track)[3] -#define CD_TRACK_S(toc, track) CD_TRACK(toc, track)[4] -#define CD_TRACK_F(toc, track) CD_TRACK(toc, track)[5] - -/* Constants to help us get at the SCSI position info */ -#define POS_TRACK(pos) pos.position[6] -#define POS_ABS_M(pos) pos.position[9] -#define POS_ABS_S(pos) pos.position[10] -#define POS_ABS_F(pos) pos.position[11] -#define POS_REL_M(pos) pos.position[13] -#define POS_REL_S(pos) pos.position[14] -#define POS_REL_F(pos) pos.position[15] - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); -int try_dir(const char *directory); - - -/* Check a drive to see if it is a CD-ROM */ -static int CheckDrive(char *drive) -{ - struct stat stbuf; - int is_cd, cdfd; - device_geometry info; - - /* If it doesn't exist, return -1 */ - if ( stat(drive, &stbuf) < 0 ) { - return(-1); - } - - /* If it does exist, verify that it's an available CD-ROM */ - is_cd = 0; - cdfd = open(drive, 0); - if ( cdfd >= 0 ) { - if ( ioctl(cdfd, B_GET_GEOMETRY, &info) == B_NO_ERROR ) { - if ( info.device_type == B_CD ) { - is_cd = 1; - } - } - close(cdfd); - } else { - /* This can happen when the drive is open .. (?) */; - is_cd = 1; - } - return(is_cd); -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive) -{ - int i; - size_t len; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Add this drive to our list */ - i = SDL_numcds; - len = SDL_strlen(drive)+1; - SDL_cdlist[i] = (char *)SDL_malloc(len); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - SDL_strlcpy(SDL_cdlist[i], drive, len); - ++SDL_numcds; -#ifdef CDROM_DEBUG - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -/* IDE bus scanning magic */ -enum { - IDE_GET_DEVICES_INFO = B_DEVICE_OP_CODES_END + 50, -}; -struct ide_ctrl_info { - bool ide_0_present; - bool ide_0_master_present; - bool ide_0_slave_present; - int ide_0_master_type; - int ide_0_slave_type; - bool ide_1_present; - bool ide_1_master_present; - bool ide_1_slave_present; - int ide_1_master_type; - int ide_1_slave_type; -}; - -int SDL_SYS_CDInit(void) -{ - char *SDLcdrom; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Look in the environment for our CD-ROM drive list */ - SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ - if ( SDLcdrom != NULL ) { - char *cdpath, *delim; - size_t len = SDL_strlen(SDLcdrom)+1; - cdpath = SDL_stack_alloc(char, len); - if ( cdpath != NULL ) { - SDL_strlcpy(cdpath, SDLcdrom, len); - SDLcdrom = cdpath; - do { - delim = SDL_strchr(SDLcdrom, ':'); - if ( delim ) { - *delim++ = '\0'; - } - if ( CheckDrive(SDLcdrom) > 0 ) { - AddDrive(SDLcdrom); - } - if ( delim ) { - SDLcdrom = delim; - } else { - SDLcdrom = NULL; - } - } while ( SDLcdrom ); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } - } - - /* Scan the system for CD-ROM drives */ - try_dir("/dev/disk"); - return 0; -} - - -int try_dir(const char *directory) -{ - BDirectory dir; - dir.SetTo(directory); - if(dir.InitCheck() != B_NO_ERROR) { - return false; - } - dir.Rewind(); - BEntry entry; - while(dir.GetNextEntry(&entry) >= 0) { - BPath path; - const char *name; - entry_ref e; - - if(entry.GetPath(&path) != B_NO_ERROR) - continue; - name = path.Path(); - - if(entry.GetRef(&e) != B_NO_ERROR) - continue; - - if(entry.IsDirectory()) { - if(SDL_strcmp(e.name, "floppy") == 0) - continue; /* ignore floppy (it is not silent) */ - int devfd = try_dir(name); - if(devfd >= 0) - return devfd; - } - else { - int devfd; - device_geometry g; - - if(SDL_strcmp(e.name, "raw") != 0) - continue; /* ignore partitions */ - - devfd = open(name, O_RDONLY); - if(devfd < 0) - continue; - - if(ioctl(devfd, B_GET_GEOMETRY, &g, sizeof(g)) >= 0) { - if(g.device_type == B_CD) - { - AddDrive(strdup(name)); - } - } - close(devfd); - } - } - return B_ERROR; -} - - -/* General ioctl() CD-ROM command function */ -static int SDL_SYS_CDioctl(int index, int command, void *arg) -{ - int okay; - int fd; - - okay = 0; - fd = open(SDL_cdlist[index], 0); - if ( fd >= 0 ) { - if ( ioctl(fd, command, arg) == B_NO_ERROR ) { - okay = 1; - } - close(fd); - } - return(okay ? 0 : -1); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - return(drive); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - int i; - scsi_toc toc; - - if ( SDL_SYS_CDioctl(cdrom->id, B_SCSI_GET_TOC, &toc) == 0 ) { - cdrom->numtracks = CD_NUMTRACKS(toc); - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } - for ( i=0; i<=cdrom->numtracks; ++i ) { - cdrom->track[i].id = CD_TRACK_N(toc, i); - /* FIXME: How do we tell on BeOS? */ - cdrom->track[i].type = SDL_AUDIO_TRACK; - cdrom->track[i].offset = MSF_TO_FRAMES( - CD_TRACK_M(toc, i), - CD_TRACK_S(toc, i), - CD_TRACK_F(toc, i)); - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i-1].length = - cdrom->track[i].offset- - cdrom->track[i-1].offset; - } - } - return(0); - } else { - return(-1); - } -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - int fd; - int cur_frame; - scsi_position pos; - - fd = open(SDL_cdlist[cdrom->id], 0); - cur_frame = 0; - if ( fd >= 0 ) { - if ( ioctl(fd, B_SCSI_GET_POSITION, &pos) == B_NO_ERROR ) { - cur_frame = MSF_TO_FRAMES( - POS_ABS_M(pos), POS_ABS_S(pos), POS_ABS_F(pos)); - } - if ( ! pos.position[1] || (pos.position[1] >= 0x13) || - ((pos.position[1] == 0x12) && (!pos.position[6])) ) { - status = CD_STOPPED; - } else - if ( pos.position[1] == 0x11 ) { - status = CD_PLAYING; - } else { - status = CD_PAUSED; - } - close(fd); - } else { - status = CD_TRAYEMPTY; - } - if ( position ) { - *position = cur_frame; - } - return(status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - int okay; - int fd; - scsi_play_position pos; - - okay = 0; - fd = open(SDL_cdlist[cdrom->id], 0); - if ( fd >= 0 ) { - FRAMES_TO_MSF(start, &pos.start_m, &pos.start_s, &pos.start_f); - FRAMES_TO_MSF(start+length, &pos.end_m, &pos.end_s, &pos.end_f); - if ( ioctl(fd, B_SCSI_PLAY_POSITION, &pos) == B_NO_ERROR ) { - okay = 1; - } - close(fd); - } - return(okay ? 0 : -1); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_PAUSE_AUDIO, 0)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_RESUME_AUDIO, 0)); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_STOP_AUDIO, 0)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_EJECT, 0)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - close(cdrom->id); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* - * The msf_to_frame and frame_to_msf were yanked from libcdrom and inlined - * here so that -lcdrom doesn't have to be dragged in for something so simple. -*/ - -#define FRAMES_PER_SECOND 75 -#define FRAMES_PER_MINUTE (FRAMES_PER_SECOND * 60) - -int -msf_to_frame(int minute, int second, int frame) - { - return(minute * FRAMES_PER_MINUTE + second * FRAMES_PER_SECOND + frame); - } - -void -frame_to_msf(int frame, int *minp, int *secp, int *framep) - { - *minp = frame / FRAMES_PER_MINUTE; - *secp = (frame % FRAMES_PER_MINUTE) / FRAMES_PER_SECOND; - *framep = frame % FRAMES_PER_SECOND; - } - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static dev_t SDL_cdmode[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -typedef struct scsi_cdb cdb_t; - -static int scsi_cmd(int fd, - struct scsi_cdb *cdb, - int cdblen, - int rw, - caddr_t data, - int datalen, - struct scsi_user_cdb *sus) - { - int scsistatus; - unsigned char *cp; - struct scsi_user_cdb suc; - - /* safety checks */ - if (!cdb) return(-1); - if (rw != SUC_READ && rw != SUC_WRITE) return(-1); - - suc.suc_flags = rw; - suc.suc_cdblen = cdblen; - bcopy(cdb, suc.suc_cdb, cdblen); - suc.suc_datalen = datalen; - suc.suc_data = data; - suc.suc_timeout = 10; /* 10 secs max for TUR or SENSE */ - if (ioctl(fd, SCSIRAWCDB, &suc) == -1) - return(-11); - scsistatus = suc.suc_sus.sus_status; - cp = suc.suc_sus.sus_sense; - -/* - * If a place to copy the sense data back to has been provided then the - * caller is responsible for checking the errors and printing any information - * out if the status was not successful. -*/ - if (scsistatus != 0 && !sus) - { - fprintf(stderr,"scsistatus = %x cmd = %x\n", - scsistatus, cdb[0]); - fprintf(stderr, "sense %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n", - cp[0], cp[1], cp[2], cp[3], cp[4], cp[5], - cp[6], cp[7], cp[8], cp[9], cp[10], cp[11], - cp[12], cp[13], cp[14], cp[15]); - return(1); - } - if (sus) - bcopy(&suc, sus, sizeof (struct scsi_user_cdb)); - if (scsistatus) - return(1); /* Return non-zero for unsuccessful status */ - return(0); - } - -/* request vendor brand and model */ -unsigned char *Inquiry(int fd) - { - static struct scsi_cdb6 cdb = - { - 0x12, - 0, 0, 0, - 56, - 0 - }; - static unsigned char Inqbuffer[56]; - - if (scsi_cmd(fd, (cdb_t *)&cdb, 6, SUC_READ, Inqbuffer, - sizeof(Inqbuffer), 0)) - return("\377"); - return(Inqbuffer); - } - -#define ADD_SENSECODE 12 -#define ADD_SC_QUALIFIER 13 - -int TestForMedium(int fd) - { - int sts, asc, ascq; - struct scsi_user_cdb sus; - static struct scsi_cdb6 cdb = - { - CMD_TEST_UNIT_READY, /* command */ - 0, /* reserved */ - 0, /* reserved */ - 0, /* reserved */ - 0, /* reserved */ - 0 /* reserved */ - }; - -again: sts = scsi_cmd(fd, (cdb_t *)&cdb, 6, SUC_READ, 0, 0, &sus); - asc = sus.suc_sus.sus_sense[ADD_SENSECODE]; - ascq = sus.suc_sus.sus_sense[ADD_SC_QUALIFIER]; - if (asc == 0x3a && ascq == 0x0) /* no medium */ - return(0); - if (asc == 0x28 && ascq == 0x0) /* medium changed */ - goto again; - if (asc == 0x4 && ascq == 0x1 ) /* coming ready */ - { - sleep(2); - goto again; - } - return(1); - } - -/* Check a drive to see if it is a CD-ROM */ -static int CheckDrive(char *drive, struct stat *stbuf) -{ - int is_cd = 0, cdfd; - char *p; - - /* If it doesn't exist, return -1 */ - if ( stat(drive, stbuf) < 0 ) { - return(-1); - } - - /* If it does exist, verify that it's an available CD-ROM */ - cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0); - if ( cdfd >= 0 ) { - p = Inquiry(cdfd); - if (*p == TYPE_ROM) - is_cd = 1; - close(cdfd); - } - return(is_cd); -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive, struct stat *stbuf) -{ - int i; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Check to make sure it's not already in our list. - This can happen when we see a drive via symbolic link. - */ - for ( i=0; ist_rdev == SDL_cdmode[i] ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]); -#endif - return; - } - } - - /* Add this drive to our list */ - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - SDL_cdmode[i] = stbuf->st_rdev; - ++SDL_numcds; -#ifdef DEBUG_CDROM - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -int SDL_SYS_CDInit(void) -{ - /* checklist: /dev/rsr?c */ - static char *checklist[] = { - "?0 rsr?", NULL - }; - char *SDLcdrom; - int i, j, exists; - char drive[32]; - struct stat stbuf; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Look in the environment for our CD-ROM drive list */ - SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ - if ( SDLcdrom != NULL ) { - char *cdpath, *delim; - size_t len = SDL_strlen(SDLcdrom)+1; - cdpath = SDL_stack_alloc(char, len); - if ( cdpath != NULL ) { - SDL_strlcpy(cdpath, SDLcdrom, len); - SDLcdrom = cdpath; - do { - delim = SDL_strchr(SDLcdrom, ':'); - if ( delim ) { - *delim++ = '\0'; - } - if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) { - AddDrive(SDLcdrom, &stbuf); - } - if ( delim ) { - SDLcdrom = delim; - } else { - SDLcdrom = NULL; - } - } while ( SDLcdrom ); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } - } - - /* Scan the system for CD-ROM drives */ - for ( i=0; checklist[i]; ++i ) { - if ( checklist[i][0] == '?' ) { - char *insert; - exists = 1; - for ( j=checklist[i][1]; exists; ++j ) { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]); - insert = SDL_strchr(drive, '?'); - if ( insert != NULL ) { - *insert = j; - } - switch (CheckDrive(drive, &stbuf)) { - /* Drive exists and is a CD-ROM */ - case 1: - AddDrive(drive, &stbuf); - break; - /* Drive exists, but isn't a CD-ROM */ - case 0: - break; - /* Drive doesn't exist */ - case -1: - exists = 0; - break; - } - } - } else { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]); - if ( CheckDrive(drive, &stbuf) > 0 ) { - AddDrive(drive, &stbuf); - } - } - } - return(0); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - return(open(SDL_cdlist[drive], O_RDONLY | O_NONBLOCK | O_EXCL, 0)); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) - { - u_char cdb[10], buf[4], *p, *toc; - struct scsi_user_cdb sus; - int i, sts, first_track, last_track, ntracks, toc_size; - - bzero(cdb, sizeof (cdb)); - cdb[0] = 0x43; /* Read TOC */ - cdb[1] = 0x2; /* MSF */ - cdb[8] = 4; /* size TOC header */ - sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, buf, 4, &sus); - if (sts < 0) - return(-1); - first_track = buf[2]; - last_track = buf[3]; - ntracks = last_track - first_track + 1; - cdrom->numtracks = ntracks; - toc_size = 4 + (ntracks + 1) * 8; - toc = (u_char *)SDL_malloc(toc_size); - if (toc == NULL) - return(-1); - bzero(cdb, sizeof (cdb)); - cdb[0] = 0x43; - cdb[1] = 0x2; - cdb[6] = first_track; - cdb[7] = toc_size >> 8; - cdb[8] = toc_size & 0xff; - sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, toc, toc_size, - &sus); - if (sts < 0) - { - SDL_free(toc); - return(-1); - } - - for (i = 0, p = toc+4; i <= ntracks; i++, p+= 8) - { - if (i == ntracks) - cdrom->track[i].id = 0xAA; /* Leadout */ - else - cdrom->track[i].id = first_track + i; - if (p[1] & 0x20) - cdrom->track[i].type = SDL_DATA_TRACK; - else - cdrom->track[i].type = SDL_AUDIO_TRACK; - cdrom->track[i].offset = msf_to_frame(p[5], p[6], p[7]); - cdrom->track[i].length = 0; - if (i > 0) - cdrom->track[i-1].length = cdrom->track[i].offset - - cdrom->track[i-1].offset; - } - SDL_free(toc); - return(0); - } - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) - { - CDstatus status; - u_char cdb[10], buf[16]; - int sts; - struct scsi_user_cdb sus; - - bzero(cdb, sizeof (cdb)); - cdb[0] = 0x42; /* read subq */ - cdb[1] = 0x2; /* MSF */ - cdb[2] = 0x40; /* q channel */ - cdb[3] = 1; /* current pos */ - cdb[7] = sizeof (buf) >> 8; - cdb[8] = sizeof (buf) & 0xff; - sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, buf, sizeof (buf), - &sus); - if (sts < 0) - return(-1); - if (sts) - { - if (TestForMedium(cdrom->id) == 0) - status = CD_TRAYEMPTY; - else - status = CD_ERROR; - } - else - { - switch (buf[1]) - { - case 0x11: - status = CD_PLAYING; - break; - case 0x12: - status = CD_PAUSED; - break; - case 0x13: - case 0x14: - case 0x15: - status = CD_STOPPED; - break; - default: - status = CD_ERROR; - break; - } - } - if (position) - { - if ( status == CD_PLAYING || (status == CD_PAUSED) ) - *position = msf_to_frame(buf[9], buf[10], buf[11]); - else - *position = 0; - } - return(status); - } - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) - { - u_char cdb[10]; - int sts, minute, second, frame, eminute, esecond, eframe; - struct scsi_user_cdb sus; - - bzero(cdb, sizeof(cdb)); - cdb[0] = 0x47; /* Play */ - frame_to_msf(start, &minute, &second, &frame); - frame_to_msf(start + length, &eminute, &esecond, &eframe); - cdb[3] = minute; - cdb[4] = second; - cdb[5] = frame; - cdb[6] = eminute; - cdb[7] = esecond; - cdb[8] = eframe; - sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, 0, 0, &sus); - return(sts); - } - -static int -pauseresume(SDL_CD *cdrom, int flag) - { - u_char cdb[10]; - struct scsi_user_cdb sus; - - bzero(cdb, sizeof (cdb)); - cdb[0] = 0x4b; - cdb[8] = flag & 0x1; - return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, 0, 0, &sus)); - } - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - return(pauseresume(cdrom, 0)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - return(pauseresume(cdrom, 1)); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - u_char cdb[6]; - struct scsi_user_cdb sus; - - bzero(cdb, sizeof (cdb)); - cdb[0] = 0x1b; /* stop */ - cdb[1] = 1; /* immediate */ - return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 6, SUC_READ, 0, 0, &sus)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - u_char cdb[6]; - struct scsi_user_cdb sus; - - bzero(cdb, sizeof (cdb)); - cdb[0] = 0x1b; /* stop */ - cdb[1] = 1; /* immediate */ - cdb[4] = 2; /* eject */ - return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 6, SUC_READ, 0, 0, &sus)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) - { - close(cdrom->id); - } - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - - -int SDL_SYS_CDInit(void) -{ - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - return(0); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return "/cd"; -} - -static int SDL_SYS_CDOpen(int drive) -{ - return(drive); -} - -#define TRACK_CDDA 0 -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - CDROM_TOC toc; - int ret,i; - - ret = cdrom_read_toc(&toc,0); - if (ret!=ERR_OK) { - return -1; - } - - cdrom->numtracks = TOC_TRACK(toc.last)-TOC_TRACK(toc.first)+1; - for(i=0;inumtracks;i++) { - unsigned long entry = toc.entry[i]; - cdrom->track[i].id = i+1; - cdrom->track[i].type = (TOC_CTRL(toc.entry[i])==TRACK_CDDA)?SDL_AUDIO_TRACK:SDL_DATA_TRACK; - cdrom->track[i].offset = TOC_LBA(entry)-150; - cdrom->track[i].length = TOC_LBA((i+1 -#include -#include -#include -#include -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static dev_t SDL_cdmode[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -/* Some ioctl() errno values which occur when the tray is empty */ -#define ERRNO_TRAYEMPTY(errno) \ - ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL)) - -/* Check a drive to see if it is a CD-ROM */ -static int CheckDrive(char *drive, struct stat *stbuf) -{ - int is_cd, cdfd; - struct ioc_read_subchannel info; - - /* If it doesn't exist, return -1 */ - if ( stat(drive, stbuf) < 0 ) { - return(-1); - } - - /* If it does exist, verify that it's an available CD-ROM */ - is_cd = 0; - if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) { - cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0); - if ( cdfd >= 0 ) { - info.address_format = CD_MSF_FORMAT; - info.data_format = CD_CURRENT_POSITION; - info.data_len = 0; - info.data = NULL; - /* Under Linux, EIO occurs when a disk is not present. - This isn't 100% reliable, so we use the USE_MNTENT - code above instead. - */ - if ( (ioctl(cdfd, CDIOCREADSUBCHANNEL, &info) == 0) || - ERRNO_TRAYEMPTY(errno) ) { - is_cd = 1; - } - close(cdfd); - } - } - return(is_cd); -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive, struct stat *stbuf) -{ - int i; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Check to make sure it's not already in our list. - This can happen when we see a drive via symbolic link. - */ - for ( i=0; ist_rdev == SDL_cdmode[i] ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]); -#endif - return; - } - } - - /* Add this drive to our list */ - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - SDL_cdmode[i] = stbuf->st_rdev; - ++SDL_numcds; -#ifdef DEBUG_CDROM - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -int SDL_SYS_CDInit(void) -{ - /* checklist: /dev/cdrom,/dev/cd?c /dev/acd?c - /dev/matcd?c /dev/mcd?c /dev/scd?c */ - static char *checklist[] = { - "cdrom", "?0 cd?", "?0 acd?", "?0 matcd?", "?0 mcd?", "?0 scd?",NULL - }; - char *SDLcdrom; - int i, j, exists; - char drive[32]; - struct stat stbuf; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Look in the environment for our CD-ROM drive list */ - SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ - if ( SDLcdrom != NULL ) { - char *cdpath, *delim; - size_t len = SDL_strlen(SDLcdrom)+1; - cdpath = SDL_stack_alloc(char, len); - if ( cdpath != NULL ) { - SDL_strlcpy(cdpath, SDLcdrom, len); - SDLcdrom = cdpath; - do { - delim = SDL_strchr(SDLcdrom, ':'); - if ( delim ) { - *delim++ = '\0'; - } - if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) { - AddDrive(SDLcdrom, &stbuf); - } - if ( delim ) { - SDLcdrom = delim; - } else { - SDLcdrom = NULL; - } - } while ( SDLcdrom ); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } - } - - /* Scan the system for CD-ROM drives */ - for ( i=0; checklist[i]; ++i ) { - if ( checklist[i][0] == '?' ) { - char *insert; - exists = 1; - for ( j=checklist[i][1]; exists; ++j ) { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]); - insert = SDL_strchr(drive, '?'); - if ( insert != NULL ) { - *insert = j; - } - switch (CheckDrive(drive, &stbuf)) { - /* Drive exists and is a CD-ROM */ - case 1: - AddDrive(drive, &stbuf); - break; - /* Drive exists, but isn't a CD-ROM */ - case 0: - break; - /* Drive doesn't exist */ - case -1: - exists = 0; - break; - } - } - } else { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]); - if ( CheckDrive(drive, &stbuf) > 0 ) { - AddDrive(drive, &stbuf); - } - } - } - return(0); -} - -/* General ioctl() CD-ROM command function */ -static int SDL_SYS_CDioctl(int id, int command, void *arg) -{ - int retval; - - retval = ioctl(id, command, arg); - if ( retval < 0 ) { - SDL_SetError("ioctl() error: %s", strerror(errno)); - } - return(retval); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0)); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - struct ioc_toc_header toc; - int i, okay; - struct ioc_read_toc_entry entry; - struct cd_toc_entry data; - - okay = 0; - if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCHEADER, &toc) == 0 ) { - cdrom->numtracks = toc.ending_track-toc.starting_track+1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } - /* Read all the track TOC entries */ - for ( i=0; i<=cdrom->numtracks; ++i ) { - if ( i == cdrom->numtracks ) { - cdrom->track[i].id = 0xAA; /* CDROM_LEADOUT */ - } else { - cdrom->track[i].id = toc.starting_track+i; - } - entry.starting_track = cdrom->track[i].id; - entry.address_format = CD_MSF_FORMAT; - entry.data_len = sizeof(data); - entry.data = &data; - if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCENTRYS, - &entry) < 0 ) { - break; - } else { - cdrom->track[i].type = data.control; - cdrom->track[i].offset = MSF_TO_FRAMES( - data.addr.msf.minute, - data.addr.msf.second, - data.addr.msf.frame); - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i-1].length = - cdrom->track[i].offset- - cdrom->track[i-1].offset; - } - } - } - if ( i == (cdrom->numtracks+1) ) { - okay = 1; - } - } - return(okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - struct ioc_toc_header toc; - struct ioc_read_subchannel info; - struct cd_sub_channel_info data; - - info.address_format = CD_MSF_FORMAT; - info.data_format = CD_CURRENT_POSITION; - info.track = 0; - info.data_len = sizeof(data); - info.data = &data; - if ( ioctl(cdrom->id, CDIOCREADSUBCHANNEL, &info) < 0 ) { - if ( ERRNO_TRAYEMPTY(errno) ) { - status = CD_TRAYEMPTY; - } else { - status = CD_ERROR; - } - } else { - switch (data.header.audio_status) { - case CD_AS_AUDIO_INVALID: - case CD_AS_NO_STATUS: - /* Try to determine if there's a CD available */ - if (ioctl(cdrom->id,CDIOREADTOCHEADER,&toc)==0) - status = CD_STOPPED; - else - status = CD_TRAYEMPTY; - break; - case CD_AS_PLAY_COMPLETED: - status = CD_STOPPED; - break; - case CD_AS_PLAY_IN_PROGRESS: - status = CD_PLAYING; - break; - case CD_AS_PLAY_PAUSED: - status = CD_PAUSED; - break; - default: - status = CD_ERROR; - break; - } - } - if ( position ) { - if ( status == CD_PLAYING || (status == CD_PAUSED) ) { - *position = MSF_TO_FRAMES( - data.what.position.absaddr.msf.minute, - data.what.position.absaddr.msf.second, - data.what.position.absaddr.msf.frame); - } else { - *position = 0; - } - } - return(status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - struct ioc_play_msf playtime; - - FRAMES_TO_MSF(start, - &playtime.start_m, &playtime.start_s, &playtime.start_f); - FRAMES_TO_MSF(start+length, - &playtime.end_m, &playtime.end_s, &playtime.end_f); -#ifdef DEBUG_CDROM - fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n", - playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0, - playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1); -#endif - ioctl(cdrom->id, CDIOCSTART, 0); - return(SDL_SYS_CDioctl(cdrom->id, CDIOCPLAYMSF, &playtime)); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDIOCPAUSE, 0)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDIOCRESUME, 0)); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDIOCSTOP, 0)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDIOCEJECT, 0)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - close(cdrom->id); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i /* For strerror() */ -#include -#include -#include -#include -#include -#include -#ifdef __LINUX__ -#ifdef HAVE_LINUX_VERSION_H -/* linux 2.6.9 workaround */ -#include -#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,9) -#include -#define __le64 __u64 -#define __le32 __u32 -#define __le16 __u16 -#define __be64 __u64 -#define __be32 __u32 -#define __be16 __u16 -#endif /* linux 2.6.9 workaround */ -#endif /* HAVE_LINUX_VERSION_H */ -#include -#endif -#ifdef __SVR4 -#include -#endif - -/* Define this to use the alternative getmntent() code */ -#ifndef __SVR4 -#define USE_MNTENT -#endif - -#ifdef USE_MNTENT -#if defined(__USLC__) -#include -#else -#include -#endif - -#ifndef _PATH_MNTTAB -#ifdef MNTTAB -#define _PATH_MNTTAB MNTTAB -#else -#define _PATH_MNTTAB "/etc/fstab" -#endif -#endif /* !_PATH_MNTTAB */ - -#ifndef _PATH_MOUNTED -#define _PATH_MOUNTED "/etc/mtab" -#endif /* !_PATH_MOUNTED */ - -#ifndef MNTTYPE_CDROM -#define MNTTYPE_CDROM "iso9660" -#endif -#ifndef MNTTYPE_SUPER -#define MNTTYPE_SUPER "supermount" -#endif -#endif /* USE_MNTENT */ - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static dev_t SDL_cdmode[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -/* Some ioctl() errno values which occur when the tray is empty */ -#ifndef ENOMEDIUM -#define ENOMEDIUM ENOENT -#endif -#define ERRNO_TRAYEMPTY(errno) \ - ((errno == EIO) || (errno == ENOENT) || \ - (errno == EINVAL) || (errno == ENOMEDIUM)) - -/* Check a drive to see if it is a CD-ROM */ -static int CheckDrive(char *drive, char *mnttype, struct stat *stbuf) -{ - int is_cd, cdfd; - struct cdrom_subchnl info; - - /* If it doesn't exist, return -1 */ - if ( stat(drive, stbuf) < 0 ) { - return(-1); - } - - /* If it does exist, verify that it's an available CD-ROM */ - is_cd = 0; - if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) { - cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0); - if ( cdfd >= 0 ) { - info.cdsc_format = CDROM_MSF; - /* Under Linux, EIO occurs when a disk is not present. - */ - if ( (ioctl(cdfd, CDROMSUBCHNL, &info) == 0) || - ERRNO_TRAYEMPTY(errno) ) { - is_cd = 1; - } - close(cdfd); - } -#ifdef USE_MNTENT - /* Even if we can't read it, it might be mounted */ - else if ( mnttype && (SDL_strcmp(mnttype, MNTTYPE_CDROM) == 0) ) { - is_cd = 1; - } -#endif - } - return(is_cd); -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive, struct stat *stbuf) -{ - int i; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Check to make sure it's not already in our list. - This can happen when we see a drive via symbolic link. - */ - for ( i=0; ist_rdev == SDL_cdmode[i] ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]); -#endif - return; - } - } - - /* Add this drive to our list */ - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - SDL_cdmode[i] = stbuf->st_rdev; - ++SDL_numcds; -#ifdef DEBUG_CDROM - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -#ifdef USE_MNTENT -static void CheckMounts(const char *mtab) -{ - FILE *mntfp; - struct mntent *mntent; - struct stat stbuf; - - mntfp = setmntent(mtab, "r"); - if ( mntfp != NULL ) { - char *tmp; - char *mnt_type; - size_t mnt_type_len; - char *mnt_dev; - size_t mnt_dev_len; - - while ( (mntent=getmntent(mntfp)) != NULL ) { - mnt_type_len = SDL_strlen(mntent->mnt_type) + 1; - mnt_type = SDL_stack_alloc(char, mnt_type_len); - if (mnt_type == NULL) - continue; /* maybe you'll get lucky next time. */ - - mnt_dev_len = SDL_strlen(mntent->mnt_fsname) + 1; - mnt_dev = SDL_stack_alloc(char, mnt_dev_len); - if (mnt_dev == NULL) { - SDL_stack_free(mnt_type); - continue; - } - - SDL_strlcpy(mnt_type, mntent->mnt_type, mnt_type_len); - SDL_strlcpy(mnt_dev, mntent->mnt_fsname, mnt_dev_len); - - /* Handle "supermount" filesystem mounts */ - if ( SDL_strcmp(mnt_type, MNTTYPE_SUPER) == 0 ) { - tmp = SDL_strstr(mntent->mnt_opts, "fs="); - if ( tmp ) { - SDL_stack_free(mnt_type); - mnt_type = SDL_strdup(tmp + SDL_strlen("fs=")); - if ( mnt_type ) { - tmp = SDL_strchr(mnt_type, ','); - if ( tmp ) { - *tmp = '\0'; - } - } - } - tmp = SDL_strstr(mntent->mnt_opts, "dev="); - if ( tmp ) { - SDL_stack_free(mnt_dev); - mnt_dev = SDL_strdup(tmp + SDL_strlen("dev=")); - if ( mnt_dev ) { - tmp = SDL_strchr(mnt_dev, ','); - if ( tmp ) { - *tmp = '\0'; - } - } - } - } - if ( SDL_strcmp(mnt_type, MNTTYPE_CDROM) == 0 ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "Checking mount path from %s: %s mounted on %s of %s\n", - mtab, mnt_dev, mntent->mnt_dir, mnt_type); -#endif - if (CheckDrive(mnt_dev, mnt_type, &stbuf) > 0) { - AddDrive(mnt_dev, &stbuf); - } - } - SDL_stack_free(mnt_dev); - SDL_stack_free(mnt_type); - } - endmntent(mntfp); - } -} -#endif /* USE_MNTENT */ - -int SDL_SYS_CDInit(void) -{ - /* checklist: /dev/cdrom, /dev/hd?, /dev/scd? /dev/sr? */ - static char *checklist[] = { - "cdrom", "?a hd?", "?0 scd?", "?0 sr?", NULL - }; - char *SDLcdrom; - int i, j, exists; - char drive[32]; - struct stat stbuf; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Look in the environment for our CD-ROM drive list */ - SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ - if ( SDLcdrom != NULL ) { - char *cdpath, *delim; - size_t len = SDL_strlen(SDLcdrom)+1; - cdpath = SDL_stack_alloc(char, len); - if ( cdpath != NULL ) { - SDL_strlcpy(cdpath, SDLcdrom, len); - SDLcdrom = cdpath; - do { - delim = SDL_strchr(SDLcdrom, ':'); - if ( delim ) { - *delim++ = '\0'; - } -#ifdef DEBUG_CDROM - fprintf(stderr, "Checking CD-ROM drive from SDL_CDROM: %s\n", SDLcdrom); -#endif - if ( CheckDrive(SDLcdrom, NULL, &stbuf) > 0 ) { - AddDrive(SDLcdrom, &stbuf); - } - if ( delim ) { - SDLcdrom = delim; - } else { - SDLcdrom = NULL; - } - } while ( SDLcdrom ); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } - } - -#ifdef USE_MNTENT - /* Check /dev/cdrom first :-) */ - if (CheckDrive("/dev/cdrom", NULL, &stbuf) > 0) { - AddDrive("/dev/cdrom", &stbuf); - } - - /* Now check the currently mounted CD drives */ - CheckMounts(_PATH_MOUNTED); - - /* Finally check possible mountable drives in /etc/fstab */ - CheckMounts(_PATH_MNTTAB); - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } -#endif /* USE_MNTENT */ - - /* Scan the system for CD-ROM drives. - Not always 100% reliable, so use the USE_MNTENT code above first. - */ - for ( i=0; checklist[i]; ++i ) { - if ( checklist[i][0] == '?' ) { - char *insert; - exists = 1; - for ( j=checklist[i][1]; exists; ++j ) { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]); - insert = SDL_strchr(drive, '?'); - if ( insert != NULL ) { - *insert = j; - } -#ifdef DEBUG_CDROM - fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive); -#endif - switch (CheckDrive(drive, NULL, &stbuf)) { - /* Drive exists and is a CD-ROM */ - case 1: - AddDrive(drive, &stbuf); - break; - /* Drive exists, but isn't a CD-ROM */ - case 0: - break; - /* Drive doesn't exist */ - case -1: - exists = 0; - break; - } - } - } else { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]); -#ifdef DEBUG_CDROM - fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive); -#endif - if ( CheckDrive(drive, NULL, &stbuf) > 0 ) { - AddDrive(drive, &stbuf); - } - } - } - return(0); -} - -/* General ioctl() CD-ROM command function */ -static int SDL_SYS_CDioctl(int id, int command, void *arg) -{ - int retval; - - retval = ioctl(id, command, arg); - if ( retval < 0 ) { - SDL_SetError("ioctl() error: %s", strerror(errno)); - } - return(retval); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - return(open(SDL_cdlist[drive], (O_RDONLY|O_NONBLOCK), 0)); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - struct cdrom_tochdr toc; - int i, okay; - struct cdrom_tocentry entry; - - okay = 0; - if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc) == 0 ) { - cdrom->numtracks = toc.cdth_trk1-toc.cdth_trk0+1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } - /* Read all the track TOC entries */ - for ( i=0; i<=cdrom->numtracks; ++i ) { - if ( i == cdrom->numtracks ) { - cdrom->track[i].id = CDROM_LEADOUT; - } else { - cdrom->track[i].id = toc.cdth_trk0+i; - } - entry.cdte_track = cdrom->track[i].id; - entry.cdte_format = CDROM_MSF; - if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCENTRY, - &entry) < 0 ) { - break; - } else { - if ( entry.cdte_ctrl & CDROM_DATA_TRACK ) { - cdrom->track[i].type = SDL_DATA_TRACK; - } else { - cdrom->track[i].type = SDL_AUDIO_TRACK; - } - cdrom->track[i].offset = MSF_TO_FRAMES( - entry.cdte_addr.msf.minute, - entry.cdte_addr.msf.second, - entry.cdte_addr.msf.frame); - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i-1].length = - cdrom->track[i].offset- - cdrom->track[i-1].offset; - } - } - } - if ( i == (cdrom->numtracks+1) ) { - okay = 1; - } - } - return(okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - struct cdrom_tochdr toc; - struct cdrom_subchnl info; - - info.cdsc_format = CDROM_MSF; - if ( ioctl(cdrom->id, CDROMSUBCHNL, &info) < 0 ) { - if ( ERRNO_TRAYEMPTY(errno) ) { - status = CD_TRAYEMPTY; - } else { - status = CD_ERROR; - } - } else { - switch (info.cdsc_audiostatus) { - case CDROM_AUDIO_INVALID: - case CDROM_AUDIO_NO_STATUS: - /* Try to determine if there's a CD available */ - if (ioctl(cdrom->id, CDROMREADTOCHDR, &toc)==0) - status = CD_STOPPED; - else - status = CD_TRAYEMPTY; - break; - case CDROM_AUDIO_COMPLETED: - status = CD_STOPPED; - break; - case CDROM_AUDIO_PLAY: - status = CD_PLAYING; - break; - case CDROM_AUDIO_PAUSED: - /* Workaround buggy CD-ROM drive */ - if ( info.cdsc_trk == CDROM_LEADOUT ) { - status = CD_STOPPED; - } else { - status = CD_PAUSED; - } - break; - default: - status = CD_ERROR; - break; - } - } - if ( position ) { - if ( status == CD_PLAYING || (status == CD_PAUSED) ) { - *position = MSF_TO_FRAMES( - info.cdsc_absaddr.msf.minute, - info.cdsc_absaddr.msf.second, - info.cdsc_absaddr.msf.frame); - } else { - *position = 0; - } - } - return(status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - struct cdrom_msf playtime; - - FRAMES_TO_MSF(start, - &playtime.cdmsf_min0, &playtime.cdmsf_sec0, &playtime.cdmsf_frame0); - FRAMES_TO_MSF(start+length, - &playtime.cdmsf_min1, &playtime.cdmsf_sec1, &playtime.cdmsf_frame1); -#ifdef DEBUG_CDROM - fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n", - playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0, - playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1); -#endif - return(SDL_SYS_CDioctl(cdrom->id, CDROMPLAYMSF, &playtime)); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDROMPAUSE, 0)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDROMRESUME, 0)); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDROMSTOP, 0)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDROMEJECT, 0)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - close(cdrom->id); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i -#include -#include /* Use entry table macros, not functions in InterfaceLib */ - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" -#include "SDL_syscdrom_c.h" - -/* Added by Matt Slot */ -#if !defined(LMGetUnitTableEntryCount) - #define LMGetUnitTableEntryCount() *(short *)0x01D2 -#endif - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 26 - -/* A list of available CD-ROM drives */ -static long SDL_cdversion = 0; -static struct { - short dRefNum; - short driveNum; - long frames; - char name[256]; - Boolean hasAudio; - } SDL_cdlist[MAX_DRIVES]; -static StringPtr gDriverName = "\p.AppleCD"; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -static short SDL_SYS_ShortToBCD(short value) -{ - return((value % 10) + (value / 10) * 0x10); /* Convert value to BCD */ -} - -static short SDL_SYS_BCDToShort(short value) -{ - return((value % 0x10) + (value / 0x10) * 10); /* Convert value from BCD */ -} - -int SDL_SYS_CDInit(void) -{ - SInt16 dRefNum = 0; - SInt16 first, last; - - SDL_numcds = 0; - - /* Check that the software is available */ - if (Gestalt(kGestaltAudioCDSelector, &SDL_cdversion) || - !SDL_cdversion) return(0); - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Walk the list, count each AudioCD driver, and save the refnums */ - first = -1; - last = 0 - LMGetUnitTableEntryCount(); - for(dRefNum = first; dRefNum >= last; dRefNum--) { - Str255 driverName; - StringPtr namePtr; - DCtlHandle deviceEntry; - - deviceEntry = GetDCtlEntry(dRefNum); - if (! deviceEntry) continue; - - /* Is this an .AppleCD ? */ - namePtr = (*deviceEntry)->dCtlFlags & (1L << dRAMBased) ? - ((StringPtr) ((DCtlPtr) deviceEntry)->dCtlDriver + 18) : - ((StringPtr) (*deviceEntry)->dCtlDriver + 18); - BlockMoveData(namePtr, driverName, namePtr[0]+1); - if (driverName[0] > gDriverName[0]) driverName[0] = gDriverName[0]; - if (! EqualString(driverName, gDriverName, false, false)) continue; - - /* Record the basic info for each drive */ - SDL_cdlist[SDL_numcds].dRefNum = dRefNum; - BlockMoveData(namePtr + 1, SDL_cdlist[SDL_numcds].name, namePtr[0]); - SDL_cdlist[SDL_numcds].name[namePtr[0]] = 0; - SDL_cdlist[SDL_numcds].hasAudio = false; - SDL_numcds++; - } - return(0); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive].name); -} - -static int get_drivenum(int drive) -{ - QHdr *driveQ = GetDrvQHdr(); - DrvQEl *driveElem; - - /* Update the drive number */ - SDL_cdlist[drive].driveNum = 0; - if ( driveQ->qTail ) { - driveQ->qTail->qLink = 0; - } - for ( driveElem=(DrvQEl *)driveQ->qHead; driveElem; - driveElem = (DrvQEl *)driveElem->qLink ) { - if ( driveElem->dQRefNum == SDL_cdlist[drive].dRefNum ) { - SDL_cdlist[drive].driveNum = driveElem->dQDrive; - break; - } - } - return(SDL_cdlist[drive].driveNum); -} - -static int SDL_SYS_CDOpen(int drive) -{ - return(drive); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - CDCntrlParam cdpb; - CDTrackData tracks[SDL_MAX_TRACKS]; - long i, leadout; - - /* Get the number of tracks on the CD by examining the TOC */ - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kReadTOC; - cdpb.csParam.words[0] = kGetTrackRange; - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - - cdrom->numtracks = - SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]) - - SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]) + 1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) - cdrom->numtracks = SDL_MAX_TRACKS; - cdrom->status = CD_STOPPED; - cdrom->cur_track = 0; /* Apparently these are set elsewhere */ - cdrom->cur_frame = 0; /* Apparently these are set elsewhere */ - - - /* Get the lead out area of the CD by examining the TOC */ - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kReadTOC; - cdpb.csParam.words[0] = kGetLeadOutArea; - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - - leadout = MSF_TO_FRAMES( - SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]), - SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]), - SDL_SYS_BCDToShort(cdpb.csParam.bytes[2])); - - /* Get an array of track locations by examining the TOC */ - SDL_memset(tracks, 0, sizeof(tracks)); - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kReadTOC; - cdpb.csParam.words[0] = kGetTrackEntries; /* Type of Query */ - * ((long *) (cdpb.csParam.words+1)) = (long) tracks; - cdpb.csParam.words[3] = cdrom->numtracks * sizeof(tracks[0]); - * ((char *) (cdpb.csParam.words+4)) = 1; /* First track */ - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - - /* Read all the track TOC entries */ - SDL_cdlist[cdrom->id].hasAudio = false; - for ( i=0; inumtracks; ++i ) - { - cdrom->track[i].id = i+1; - if (tracks[i].entry.control & kDataTrackMask) - cdrom->track[i].type = SDL_DATA_TRACK; - else - { - cdrom->track[i].type = SDL_AUDIO_TRACK; - SDL_cdlist[SDL_numcds].hasAudio = true; - } - - cdrom->track[i].offset = MSF_TO_FRAMES( - SDL_SYS_BCDToShort(tracks[i].entry.min), - SDL_SYS_BCDToShort(tracks[i].entry.min), - SDL_SYS_BCDToShort(tracks[i].entry.frame)); - cdrom->track[i].length = MSF_TO_FRAMES( - SDL_SYS_BCDToShort(tracks[i+1].entry.min), - SDL_SYS_BCDToShort(tracks[i+1].entry.min), - SDL_SYS_BCDToShort(tracks[i+1].entry.frame)) - - cdrom->track[i].offset; - } - - /* Apparently SDL wants a fake last entry */ - cdrom->track[i].offset = leadout; - cdrom->track[i].length = 0; - - return(0); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDCntrlParam cdpb; - CDstatus status = CD_ERROR; - Boolean spinning = false; - - if (position) *position = 0; - - /* Get the number of tracks on the CD by examining the TOC */ - if ( ! get_drivenum(cdrom->id) ) { - return(CD_TRAYEMPTY); - } - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kReadTOC; - cdpb.csParam.words[0] = kGetTrackRange; - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(CD_ERROR); - } - - cdrom->numtracks = - SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]) - - SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]) + 1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) - cdrom->numtracks = SDL_MAX_TRACKS; - cdrom->cur_track = 0; /* Apparently these are set elsewhere */ - cdrom->cur_frame = 0; /* Apparently these are set elsewhere */ - - - if (1 || SDL_cdlist[cdrom->id].hasAudio) { - /* Get the current playback status */ - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioStatus; - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - - switch(cdpb.csParam.cd.status) { - case kStatusPlaying: - status = CD_PLAYING; - spinning = true; - break; - case kStatusPaused: - status = CD_PAUSED; - spinning = true; - break; - case kStatusMuted: - status = CD_PLAYING; /* What should I do here? */ - spinning = true; - break; - case kStatusDone: - status = CD_STOPPED; - spinning = true; - break; - case kStatusStopped: - status = CD_STOPPED; - spinning = false; - break; - case kStatusError: - default: - status = CD_ERROR; - spinning = false; - break; - } - - if (spinning && position) *position = MSF_TO_FRAMES( - SDL_SYS_BCDToShort(cdpb.csParam.cd.minute), - SDL_SYS_BCDToShort(cdpb.csParam.cd.second), - SDL_SYS_BCDToShort(cdpb.csParam.cd.frame)); - } - else - status = CD_ERROR; /* What should I do here? */ - - return(status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - CDCntrlParam cdpb; - - /* Pause the current audio playback to avoid audible artifacts */ - if ( SDL_SYS_CDPause(cdrom) < 0 ) { - return(-1); - } - - /* Specify the AudioCD playback mode */ - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kSetPlayMode; - cdpb.csParam.bytes[0] = false; /* Repeat? */ - cdpb.csParam.bytes[1] = kPlayModeSequential; /* Play mode */ - /* ¥¥¥ÊTreat as soft error, NEC Drive doesnt support this call ¥¥¥ */ - PBControlSync((ParmBlkPtr) &cdpb); - -#if 1 - /* Specify the end of audio playback */ - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioStop; - cdpb.csParam.words[0] = kBlockPosition; /* Position Mode */ - *(long *) (cdpb.csParam.words + 1) = start+length-1; /* Search Address */ - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - - /* Specify the start of audio playback, and start it */ - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioPlay; - cdpb.csParam.words[0] = kBlockPosition; /* Position Mode */ - *(long *) (cdpb.csParam.words + 1) = start+1; /* Search Address */ - cdpb.csParam.words[3] = false; /* Stop address? */ - cdpb.csParam.words[4] = kStereoPlayMode; /* Audio Play Mode */ - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } -#else - /* Specify the end of audio playback */ - FRAMES_TO_MSF(start+length, &m, &s, &f); - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioStop; - cdpb.csParam.words[0] = kTrackPosition; /* Position Mode */ - cdpb.csParam.words[1] = 0; /* Search Address (hiword)*/ - cdpb.csParam.words[2] = /* Search Address (loword)*/ - SDL_SYS_ShortToBCD(cdrom->numtracks); - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - - /* Specify the start of audio playback, and start it */ - FRAMES_TO_MSF(start, &m, &s, &f); - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioPlay; - cdpb.csParam.words[0] = kTrackPosition; /* Position Mode */ - cdpb.csParam.words[1] = 0; /* Search Address (hiword)*/ - cdpb.csParam.words[2] = SDL_SYS_ShortToBCD(1); /* Search Address (loword)*/ - cdpb.csParam.words[3] = false; /* Stop address? */ - cdpb.csParam.words[4] = kStereoPlayMode; /* Audio Play Mode */ - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } -#endif - - return(0); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - CDCntrlParam cdpb; - - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioPause; - cdpb.csParam.words[0] = 0; /* Pause/Continue Flag (hiword) */ - cdpb.csParam.words[1] = 1; /* Pause/Continue Flag (loword) */ - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - return(0); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - CDCntrlParam cdpb; - - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioPause; - cdpb.csParam.words[0] = 0; /* Pause/Continue Flag (hiword) */ - cdpb.csParam.words[1] = 0; /* Pause/Continue Flag (loword) */ - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - return(0); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - CDCntrlParam cdpb; - - SDL_memset(&cdpb, 0, sizeof(cdpb)); - cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum; - cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cdpb.csCode = kAudioStop; - cdpb.csParam.words[0] = 0; /* Position Mode */ - cdpb.csParam.words[1] = 0; /* Search Address (hiword) */ - cdpb.csParam.words[2] = 0; /* Search Address (loword) */ - if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - return(0); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - Boolean disk = false; - QHdr *driveQ = GetDrvQHdr(); - DrvQEl *driveElem; - HParamBlockRec hpb; - ParamBlockRec cpb; - - for ( driveElem = (DrvQEl *) driveQ->qHead; driveElem; driveElem = - (driveElem) ? ((DrvQEl *) driveElem->qLink) : - ((DrvQEl *) driveQ->qHead) ) { - if ( driveQ->qTail ) { - driveQ->qTail->qLink = 0; - } - if ( driveElem->dQRefNum != SDL_cdlist[cdrom->id].dRefNum ) { - continue; - } - - /* Does drive contain mounted volume? If not, skip */ - SDL_memset(&hpb, 0, sizeof(hpb)); - hpb.volumeParam.ioVRefNum = driveElem->dQDrive; - if ( PBHGetVInfoSync(&hpb) != noErr ) { - continue; - } - if ( (UnmountVol(0, driveElem->dQDrive) == noErr) && - (Eject(0, driveElem->dQDrive) == noErr) ) { - driveElem = 0; /* Clear pointer to reset our loop */ - disk = true; - } - } - - /* If no disk is present, just eject the tray */ - if (! disk) { - SDL_memset(&cpb, 0, sizeof(cpb)); - cpb.cntrlParam.ioVRefNum = 0; /* No Drive */ - cpb.cntrlParam.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum; - cpb.cntrlParam.csCode = kEjectTheDisc; - if ( PBControlSync((ParmBlkPtr)&cpb) != noErr ) { - SDL_SetError("PBControlSync() failed"); - return(-1); - } - } - return(0); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - return; -} - -void SDL_SYS_CDQuit(void) -{ - while(SDL_numcds--) - SDL_memset(SDL_cdlist + SDL_numcds, 0, sizeof(SDL_cdlist[0])); -} - -#endif /* SDL_CDROM_MACOS */ diff --git a/src/cdrom/macos/SDL_syscdrom_c.h b/src/cdrom/macos/SDL_syscdrom_c.h deleted file mode 100644 index e715a256d1..0000000000 --- a/src/cdrom/macos/SDL_syscdrom_c.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the MacOS specific header for the SDL CD-ROM API - Contributed by Matt Slot - */ - -/* AppleCD Control calls */ -#define kVerifyTheDisc 5 /* Returns noErr if there is disc inserted */ -#define kEjectTheDisc 7 /* Eject disc from drive */ -#define kUserEject 80 /* Enable/disable the CD-ROM eject button */ -#define kReadTOC 100 /* Extract various TOC information from the disc */ -#define kReadQ 101 /* Extract Q subcode info for the current track */ -#define kAudioTrackSearch 103 /* Start playback from the indicated position */ -#define kAudioPlay 104 /* Start playback from the indicated position */ -#define kAudioPause 105 /* Pause/continue the playback */ -#define kAudioStop 106 /* Stop playback at the indicated position */ -#define kAudioStatus 107 /* Return audio play status */ -#define kAudioControl 109 /* Set the output volume for the audio channels */ -#define kReadAudioVolume 112 /* Get the output volume for the audio channels */ -#define kSetTrackList 122 /* Set the track program for the audio CD to play */ -#define kGetTrackList 123 /* Get the track program the audio CD is playing */ -#define kGetTrackIndex 124 /* Get the track index the audio CD is playing */ -#define kSetPlayMode 125 /* Set the audio tracks play mode */ -#define kGetPlayMode 126 /* Get the audio tracks play mode */ - -/* AppleCD Status calls */ -#define kGetDriveType 96 /* Get the type of the physical CD-ROM drive */ -#define kWhoIsThere 97 /* Get a bitmap of SCSI IDs the driver controls */ -#define kGetBlockSize 98 /* Get current block size of the CD-ROM drive */ - -/* AppleCD other constants */ -#define kBlockPosition 0 /* Position at the specified logical block number */ -#define kAbsMSFPosition 1 /* Position at the specified Min/Sec/Frame (in BCD) */ -#define kTrackPosition 2 /* Position at the specified track number (in BCD) */ -#define kIndexPosition 3 /* Position at the nth track in program (in BCD) */ - -#define kMutedPlayMode 0 /* Play the audio track with no output */ -#define kStereoPlayMode 9 /* Play the audio track in normal stereo */ - -#define kControlFieldMask 0x0D /* Bits 3,2,0 in the nibble */ -#define kDataTrackMask 0x04 /* Indicates Data Track */ - -#define kGetTrackRange 1 /* Query TOC for track numbers */ -#define kGetLeadOutArea 2 /* Query TOC for "Lead Out" end of audio data */ -#define kGetTrackEntries 3 /* Query TOC for track starts and data types */ - -#define kStatusPlaying 0 /* Audio Play operation in progress */ -#define kStatusPaused 1 /* CD-ROM device in Hold Track ("Pause") state */ -#define kStatusMuted 2 /* MUTING-ON operation in progress */ -#define kStatusDone 3 /* Audio Play completed */ -#define kStatusError 4 /* Error occurred during audio play operation */ -#define kStatusStopped 5 /* Audio play operation not requested */ - -#define kPlayModeSequential 0 /* Play tracks in order */ -#define kPlayModeShuffled 1 /* Play tracks randomly */ -#define kPlayModeProgrammed 2 /* Use custom playlist */ - -/* AppleCD Gestalt selectors */ -#define kGestaltAudioCDSelector 'aucd' -#define kDriverVersion52 0x00000520 -#define kDriverVersion51 0x00000510 -#define kDriverVersion50 0x00000500 - -/* Drive type constants */ -#define kDriveAppleCD_SC 1 -#define kDriveAppleCD_SCPlus_or_150 2 -#define kDriveAppleCD_300_or_300Plus 3 - -/* Misc constants */ -#define kFirstSCSIDevice -33 -#define kLastSCSIDevice -40 - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=mac68k -#endif - -/* AppleCD driver parameter block */ -typedef struct CDCntrlParam { - QElemPtr qLink; - short qType; - short ioTrap; - Ptr ioCmdAddr; - IOCompletionUPP ioCompletion; - OSErr ioResult; - StringPtr ioNamePtr; - short ioVRefNum; - short ioCRefNum; - short csCode; - - union { - long longs[6]; - short words[11]; - unsigned char bytes[22]; - struct { - unsigned char status; - unsigned char play; - unsigned char control; - unsigned char minute; - unsigned char second; - unsigned char frame; - } cd; - } csParam; - - } CDCntrlParam, *CDCntrlParamPtr; - -typedef union CDTrackData { - long value; /* Treat as a longword value */ - struct { - unsigned char reserved : 4; /* Unused by AppleCD driver */ - unsigned char control : 4; /* Track flags (data track?) */ - unsigned char min; /* Start of track (BCD) */ - unsigned char sec; /* Start of track (BCD) */ - unsigned char frame; /* Start of track (BCD) */ - } entry; /* Broken into fields */ - } CDTrackData, *CDTrackPtr; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#endif diff --git a/src/cdrom/macosx/AudioFilePlayer.c b/src/cdrom/macosx/AudioFilePlayer.c deleted file mode 100644 index 97cb9b2874..0000000000 --- a/src/cdrom/macosx/AudioFilePlayer.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org - - This file based on Apple sample code. We haven't changed the file name, - so if you want to see the original search for it on apple.com/developer -*/ -#include "SDL_config.h" -#include "SDL_endian.h" - -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - AudioFilePlayer.cpp -*/ -#include "AudioFilePlayer.h" - -/* -void ThrowResult (OSStatus result, const char* str) -{ - SDL_SetError ("Error: %s %d", str, result); - throw result; -} -*/ - -#if DEBUG -static void PrintStreamDesc (AudioStreamBasicDescription *inDesc) -{ - if (!inDesc) { - printf ("Can't print a NULL desc!\n"); - return; - } - - printf ("- - - - - - - - - - - - - - - - - - - -\n"); - printf (" Sample Rate:%f\n", inDesc->mSampleRate); - printf (" Format ID:%s\n", (char*)&inDesc->mFormatID); - printf (" Format Flags:%lX\n", inDesc->mFormatFlags); - printf (" Bytes per Packet:%ld\n", inDesc->mBytesPerPacket); - printf (" Frames per Packet:%ld\n", inDesc->mFramesPerPacket); - printf (" Bytes per Frame:%ld\n", inDesc->mBytesPerFrame); - printf (" Channels per Frame:%ld\n", inDesc->mChannelsPerFrame); - printf (" Bits per Channel:%ld\n", inDesc->mBitsPerChannel); - printf ("- - - - - - - - - - - - - - - - - - - -\n"); -} -#endif - - -static int AudioFilePlayer_SetDestination (AudioFilePlayer *afp, AudioUnit *inDestUnit) -{ - /*if (afp->mConnected) throw static_cast(-1);*/ /* can't set dest if already engaged */ - if (afp->mConnected) - return 0 ; - - SDL_memcpy(&afp->mPlayUnit, inDestUnit, sizeof (afp->mPlayUnit)); - - OSStatus result = noErr; - - - /* we can "down" cast a component instance to a component */ - ComponentDescription desc; - result = GetComponentInfo ((Component)*inDestUnit, &desc, 0, 0, 0); - if (result) return 0; /*THROW_RESULT("GetComponentInfo")*/ - - /* we're going to use this to know which convert routine to call - a v1 audio unit will have a type of 'aunt' - a v2 audio unit will have one of several different types. */ - if (desc.componentType != kAudioUnitType_Output) { - result = badComponentInstance; - /*THROW_RESULT("BAD COMPONENT")*/ - if (result) return 0; - } - - /* Set the input format of the audio unit. */ - result = AudioUnitSetProperty (*inDestUnit, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &afp->mFileDescription, - sizeof (afp->mFileDescription)); - /*THROW_RESULT("AudioUnitSetProperty")*/ - if (result) return 0; - return 1; -} - -static void AudioFilePlayer_SetNotifier(AudioFilePlayer *afp, AudioFilePlayNotifier inNotifier, void *inRefCon) -{ - afp->mNotifier = inNotifier; - afp->mRefCon = inRefCon; -} - -static int AudioFilePlayer_IsConnected(AudioFilePlayer *afp) -{ - return afp->mConnected; -} - -static AudioUnit AudioFilePlayer_GetDestUnit(AudioFilePlayer *afp) -{ - return afp->mPlayUnit; -} - -static void AudioFilePlayer_Print(AudioFilePlayer *afp) -{ -#if DEBUG - printf ("Is Connected:%s\n", (IsConnected() ? "true" : "false")); - printf ("- - - - - - - - - - - - - - \n"); -#endif -} - -static void AudioFilePlayer_SetStartFrame (AudioFilePlayer *afp, int frame) -{ - SInt64 position = frame * 2352; - - afp->mStartFrame = frame; - afp->mAudioFileManager->SetPosition (afp->mAudioFileManager, position); -} - - -static int AudioFilePlayer_GetCurrentFrame (AudioFilePlayer *afp) -{ - return afp->mStartFrame + (afp->mAudioFileManager->GetByteCounter(afp->mAudioFileManager) / 2352); -} - -static void AudioFilePlayer_SetStopFrame (AudioFilePlayer *afp, int frame) -{ - SInt64 position = frame * 2352; - - afp->mAudioFileManager->SetEndOfFile (afp->mAudioFileManager, position); -} - -void delete_AudioFilePlayer(AudioFilePlayer *afp) -{ - if (afp != NULL) - { - afp->Disconnect(afp); - - if (afp->mAudioFileManager) { - delete_AudioFileManager(afp->mAudioFileManager); - afp->mAudioFileManager = 0; - } - - if (afp->mForkRefNum) { - FSCloseFork (afp->mForkRefNum); - afp->mForkRefNum = 0; - } - SDL_free(afp); - } -} - -static int AudioFilePlayer_Connect(AudioFilePlayer *afp) -{ -#if DEBUG - printf ("Connect:%x, engaged=%d\n", (int)afp->mPlayUnit, (afp->mConnected ? 1 : 0)); -#endif - if (!afp->mConnected) - { - if (!afp->mAudioFileManager->DoConnect(afp->mAudioFileManager)) - return 0; - - /* set the render callback for the file data to be supplied to the sound converter AU */ - afp->mInputCallback.inputProc = afp->mAudioFileManager->FileInputProc; - afp->mInputCallback.inputProcRefCon = afp->mAudioFileManager; - - OSStatus result = AudioUnitSetProperty (afp->mPlayUnit, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Input, - 0, - &afp->mInputCallback, - sizeof(afp->mInputCallback)); - if (result) return 0; /*THROW_RESULT("AudioUnitSetProperty")*/ - afp->mConnected = 1; - } - - return 1; -} - -/* warning noted, now please go away ;-) */ -/* #warning This should redirect the calling of notification code to some other thread */ -static void AudioFilePlayer_DoNotification (AudioFilePlayer *afp, OSStatus inStatus) -{ - if (afp->mNotifier) { - (*afp->mNotifier) (afp->mRefCon, inStatus); - } else { - SDL_SetError ("Notification posted with no notifier in place"); - - if (inStatus == kAudioFilePlay_FileIsFinished) - afp->Disconnect(afp); - else if (inStatus != kAudioFilePlayErr_FilePlayUnderrun) - afp->Disconnect(afp); - } -} - -static void AudioFilePlayer_Disconnect (AudioFilePlayer *afp) -{ -#if DEBUG - printf ("Disconnect:%x,%ld, engaged=%d\n", (int)afp->mPlayUnit, 0, (afp->mConnected ? 1 : 0)); -#endif - if (afp->mConnected) - { - afp->mConnected = 0; - - afp->mInputCallback.inputProc = 0; - afp->mInputCallback.inputProcRefCon = 0; - OSStatus result = AudioUnitSetProperty (afp->mPlayUnit, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Input, - 0, - &afp->mInputCallback, - sizeof(afp->mInputCallback)); - if (result) - SDL_SetError ("AudioUnitSetProperty:RemoveInputCallback:%ld", result); - - afp->mAudioFileManager->Disconnect(afp->mAudioFileManager); - } -} - -typedef struct { - UInt32 offset; - UInt32 blockSize; -} SSNDData; - -static int AudioFilePlayer_OpenFile (AudioFilePlayer *afp, const FSRef *inRef, SInt64 *outFileDataSize) -{ - ContainerChunk chunkHeader; - ChunkHeader chunk; - SSNDData ssndData; - - OSErr result; - HFSUniStr255 dfName; - ByteCount actual; - SInt64 offset; - - /* Open the data fork of the input file */ - result = FSGetDataForkName(&dfName); - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSGetDataForkName")*/ - - result = FSOpenFork(inRef, dfName.length, dfName.unicode, fsRdPerm, &afp->mForkRefNum); - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSOpenFork")*/ - - /* Read the file header, and check if it's indeed an AIFC file */ - result = FSReadFork(afp->mForkRefNum, fsAtMark, 0, sizeof(chunkHeader), &chunkHeader, &actual); - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/ - - if (SDL_SwapBE32(chunkHeader.ckID) != 'FORM') { - result = -1; - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): chunk id is not 'FORM'");*/ - } - - if (SDL_SwapBE32(chunkHeader.formType) != 'AIFC') { - result = -1; - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): file format is not 'AIFC'");*/ - } - - /* Search for the SSND chunk. We ignore all compression etc. information - in other chunks. Of course that is kind of evil, but for now we are lazy - and rely on the cdfs to always give us the same fixed format. - TODO: Parse the COMM chunk we currently skip to fill in mFileDescription. - */ - offset = 0; - do { - result = FSReadFork(afp->mForkRefNum, fsFromMark, offset, sizeof(chunk), &chunk, &actual); - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/ - - chunk.ckID = SDL_SwapBE32(chunk.ckID); - chunk.ckSize = SDL_SwapBE32(chunk.ckSize); - - /* Skip the chunk data */ - offset = chunk.ckSize; - } while (chunk.ckID != 'SSND'); - - /* Read the header of the SSND chunk. After this, we are positioned right - at the start of the audio data. */ - result = FSReadFork(afp->mForkRefNum, fsAtMark, 0, sizeof(ssndData), &ssndData, &actual); - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/ - - ssndData.offset = SDL_SwapBE32(ssndData.offset); - - result = FSSetForkPosition(afp->mForkRefNum, fsFromMark, ssndData.offset); - if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSSetForkPosition")*/ - - /* Data size */ - *outFileDataSize = chunk.ckSize - ssndData.offset - 8; - - /* File format */ - afp->mFileDescription.mSampleRate = 44100; - afp->mFileDescription.mFormatID = kAudioFormatLinearPCM; - afp->mFileDescription.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger; - afp->mFileDescription.mBytesPerPacket = 4; - afp->mFileDescription.mFramesPerPacket = 1; - afp->mFileDescription.mBytesPerFrame = 4; - afp->mFileDescription.mChannelsPerFrame = 2; - afp->mFileDescription.mBitsPerChannel = 16; - - return 1; -} - -AudioFilePlayer *new_AudioFilePlayer (const FSRef *inFileRef) -{ - SInt64 fileDataSize = 0; - - AudioFilePlayer *afp = (AudioFilePlayer *) SDL_malloc(sizeof (AudioFilePlayer)); - if (afp == NULL) - return NULL; - SDL_memset(afp, '\0', sizeof (*afp)); - - #define SET_AUDIOFILEPLAYER_METHOD(m) afp->m = AudioFilePlayer_##m - SET_AUDIOFILEPLAYER_METHOD(SetDestination); - SET_AUDIOFILEPLAYER_METHOD(SetNotifier); - SET_AUDIOFILEPLAYER_METHOD(SetStartFrame); - SET_AUDIOFILEPLAYER_METHOD(GetCurrentFrame); - SET_AUDIOFILEPLAYER_METHOD(SetStopFrame); - SET_AUDIOFILEPLAYER_METHOD(Connect); - SET_AUDIOFILEPLAYER_METHOD(Disconnect); - SET_AUDIOFILEPLAYER_METHOD(DoNotification); - SET_AUDIOFILEPLAYER_METHOD(IsConnected); - SET_AUDIOFILEPLAYER_METHOD(GetDestUnit); - SET_AUDIOFILEPLAYER_METHOD(Print); - SET_AUDIOFILEPLAYER_METHOD(OpenFile); - #undef SET_AUDIOFILEPLAYER_METHOD - - if (!afp->OpenFile (afp, inFileRef, &fileDataSize)) - { - SDL_free(afp); - return NULL; - } - - /* we want about 4 seconds worth of data for the buffer */ - int bytesPerSecond = (UInt32) (4 * afp->mFileDescription.mSampleRate * afp->mFileDescription.mBytesPerFrame); - -#if DEBUG - printf("File format:\n"); - PrintStreamDesc (&afp->mFileDescription); -#endif - - afp->mAudioFileManager = new_AudioFileManager(afp, afp->mForkRefNum, - fileDataSize, - bytesPerSecond); - if (afp->mAudioFileManager == NULL) - { - delete_AudioFilePlayer(afp); - return NULL; - } - - return afp; -} - diff --git a/src/cdrom/macosx/AudioFilePlayer.h b/src/cdrom/macosx/AudioFilePlayer.h deleted file mode 100644 index 886d017a59..0000000000 --- a/src/cdrom/macosx/AudioFilePlayer.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org - - This file based on Apple sample code. We haven't changed the file name, - so if you want to see the original search for it on apple.com/developer -*/ -#include "SDL_config.h" - -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - AudioFilePlayer.h -*/ -#ifndef __AudioFilePlayer_H__ -#define __AudioFilePlayer_H__ - -#include - -#include -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050 -#include -#endif - -#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1050) -typedef SInt16 FSIORefNum; -#endif - -#include "SDL_error.h" - -const char* AudioFilePlayerErrorStr (OSStatus error); - -/* -void ThrowResult (OSStatus result, const char *str); - -#define THROW_RESULT(str) \ - if (result) { \ - ThrowResult (result, str); \ - } -*/ - -typedef void (*AudioFilePlayNotifier)(void *inRefCon, - OSStatus inStatus); - -enum { - kAudioFilePlayErr_FilePlayUnderrun = -10000, - kAudioFilePlay_FileIsFinished = -10001, - kAudioFilePlay_PlayerIsUninitialized = -10002 -}; - - -struct S_AudioFileManager; - -#pragma mark __________ AudioFilePlayer -typedef struct S_AudioFilePlayer -{ -/*public:*/ - int (*SetDestination)(struct S_AudioFilePlayer *afp, AudioUnit *inDestUnit); - void (*SetNotifier)(struct S_AudioFilePlayer *afp, AudioFilePlayNotifier inNotifier, void *inRefCon); - void (*SetStartFrame)(struct S_AudioFilePlayer *afp, int frame); /* seek in the file */ - int (*GetCurrentFrame)(struct S_AudioFilePlayer *afp); /* get the current frame position */ - void (*SetStopFrame)(struct S_AudioFilePlayer *afp, int frame); /* set limit in the file */ - int (*Connect)(struct S_AudioFilePlayer *afp); - void (*Disconnect)(struct S_AudioFilePlayer *afp); - void (*DoNotification)(struct S_AudioFilePlayer *afp, OSStatus inError); - int (*IsConnected)(struct S_AudioFilePlayer *afp); - AudioUnit (*GetDestUnit)(struct S_AudioFilePlayer *afp); - void (*Print)(struct S_AudioFilePlayer *afp); - -/*private:*/ - AudioUnit mPlayUnit; - FSIORefNum mForkRefNum; - - AURenderCallbackStruct mInputCallback; - - AudioStreamBasicDescription mFileDescription; - - int mConnected; - - struct S_AudioFileManager* mAudioFileManager; - - AudioFilePlayNotifier mNotifier; - void* mRefCon; - - int mStartFrame; - -#pragma mark __________ Private_Methods - - int (*OpenFile)(struct S_AudioFilePlayer *afp, const FSRef *inRef, SInt64 *outFileSize); -} AudioFilePlayer; - - -AudioFilePlayer *new_AudioFilePlayer(const FSRef *inFileRef); -void delete_AudioFilePlayer(AudioFilePlayer *afp); - - - -#pragma mark __________ AudioFileManager -typedef struct S_AudioFileManager -{ -/*public:*/ - /* this method should NOT be called by an object of this class - as it is called by the parent's Disconnect() method */ - void (*Disconnect)(struct S_AudioFileManager *afm); - int (*DoConnect)(struct S_AudioFileManager *afm); - OSStatus (*Read)(struct S_AudioFileManager *afm, char *buffer, ByteCount *len); - const char* (*GetFileBuffer)(struct S_AudioFileManager *afm); - const AudioFilePlayer *(*GetParent)(struct S_AudioFileManager *afm); - void (*SetPosition)(struct S_AudioFileManager *afm, SInt64 pos); /* seek/rewind in the file */ - int (*GetByteCounter)(struct S_AudioFileManager *afm); /* return actual bytes streamed to audio hardware */ - void (*SetEndOfFile)(struct S_AudioFileManager *afm, SInt64 pos); /* set the "EOF" (will behave just like it reached eof) */ - -/*protected:*/ - AudioFilePlayer* mParent; - SInt16 mForkRefNum; - SInt64 mAudioDataOffset; - - char* mFileBuffer; - - int mByteCounter; - - int mReadFromFirstBuffer; - int mLockUnsuccessful; - int mIsEngaged; - - int mNumTimesAskedSinceFinished; - - - void* mTmpBuffer; - UInt32 mBufferSize; - UInt32 mBufferOffset; -/*public:*/ - UInt32 mChunkSize; - SInt64 mFileLength; - SInt64 mReadFilePosition; - int mWriteToFirstBuffer; - int mFinishedReadingData; - -/*protected:*/ - OSStatus (*Render)(struct S_AudioFileManager *afm, AudioBufferList *ioData); - OSStatus (*GetFileData)(struct S_AudioFileManager *afm, void** inOutData, UInt32 *inOutDataSize); - void (*AfterRender)(struct S_AudioFileManager *afm); - -/*public:*/ - /*static*/ - OSStatus (*FileInputProc)(void *inRefCon, - AudioUnitRenderActionFlags *ioActionFlags, - const AudioTimeStamp *inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames, - AudioBufferList *ioData); -} AudioFileManager; - - -AudioFileManager *new_AudioFileManager (AudioFilePlayer *inParent, - SInt16 inForkRefNum, - SInt64 inFileLength, - UInt32 inChunkSize); - -void delete_AudioFileManager(AudioFileManager *afm); - -#endif - diff --git a/src/cdrom/macosx/AudioFileReaderThread.c b/src/cdrom/macosx/AudioFileReaderThread.c deleted file mode 100644 index 0007c07f61..0000000000 --- a/src/cdrom/macosx/AudioFileReaderThread.c +++ /dev/null @@ -1,610 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org - - This file based on Apple sample code. We haven't changed the file name, - so if you want to see the original search for it on apple.com/developer -*/ -#include "SDL_config.h" - -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - AudioFileManager.cpp -*/ -#include "AudioFilePlayer.h" -#include /* used for setting policy of thread */ -#include "SDLOSXCAGuard.h" -#include - -/*#include */ - -/*typedef void *FileData;*/ -typedef struct S_FileData -{ - AudioFileManager *obj; - struct S_FileData *next; -} FileData; - - -typedef struct S_FileReaderThread { -/*public:*/ - SDLOSXCAGuard* (*GetGuard)(struct S_FileReaderThread *frt); - void (*AddReader)(struct S_FileReaderThread *frt); - void (*RemoveReader)(struct S_FileReaderThread *frt, AudioFileManager* inItem); - int (*TryNextRead)(struct S_FileReaderThread *frt, AudioFileManager* inItem); - - int mThreadShouldDie; - -/*private:*/ - /*typedef std::list FileData;*/ - - SDLOSXCAGuard *mGuard; - UInt32 mThreadPriority; - - int mNumReaders; - FileData *mFileData; - - - void (*ReadNextChunk)(struct S_FileReaderThread *frt); - int (*StartFixedPriorityThread)(struct S_FileReaderThread *frt); - /*static*/ - UInt32 (*GetThreadBasePriority)(pthread_t inThread); - /*static*/ - void* (*DiskReaderEntry)(void *inRefCon); -} FileReaderThread; - - -static SDLOSXCAGuard* FileReaderThread_GetGuard(FileReaderThread *frt) -{ - return frt->mGuard; -} - -/* returns 1 if succeeded */ -static int FileReaderThread_TryNextRead (FileReaderThread *frt, AudioFileManager* inItem) -{ - int didLock = 0; - int succeeded = 0; - if (frt->mGuard->Try(frt->mGuard, &didLock)) - { - /*frt->mFileData.push_back (inItem);*/ - /* !!! FIXME: this could be faster with a "tail" member. --ryan. */ - FileData *i = frt->mFileData; - FileData *prev = NULL; - - FileData *newfd = (FileData *) SDL_malloc(sizeof (FileData)); - newfd->obj = inItem; - newfd->next = NULL; - - while (i != NULL) { prev = i; i = i->next; } - if (prev == NULL) - frt->mFileData = newfd; - else - prev->next = newfd; - - frt->mGuard->Notify(frt->mGuard); - succeeded = 1; - - if (didLock) - frt->mGuard->Unlock(frt->mGuard); - } - - return succeeded; -} - -static void FileReaderThread_AddReader(FileReaderThread *frt) -{ - if (frt->mNumReaders == 0) - { - frt->mThreadShouldDie = 0; - frt->StartFixedPriorityThread (frt); - } - frt->mNumReaders++; -} - -static void FileReaderThread_RemoveReader (FileReaderThread *frt, AudioFileManager* inItem) -{ - if (frt->mNumReaders > 0) - { - int bNeedsRelease = frt->mGuard->Lock(frt->mGuard); - - /*frt->mFileData.remove (inItem);*/ - FileData *i = frt->mFileData; - FileData *prev = NULL; - while (i != NULL) - { - FileData *next = i->next; - if (i->obj != inItem) - prev = i; - else - { - if (prev == NULL) - frt->mFileData = next; - else - prev->next = next; - SDL_free(i); - } - i = next; - } - - if (--frt->mNumReaders == 0) { - frt->mThreadShouldDie = 1; - frt->mGuard->Notify(frt->mGuard); /* wake up thread so it will quit */ - frt->mGuard->Wait(frt->mGuard); /* wait for thread to die */ - } - - if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard); - } -} - -static int FileReaderThread_StartFixedPriorityThread (FileReaderThread *frt) -{ - pthread_attr_t theThreadAttrs; - pthread_t pThread; - - OSStatus result = pthread_attr_init(&theThreadAttrs); - if (result) return 0; /*THROW_RESULT("pthread_attr_init - Thread attributes could not be created.")*/ - - result = pthread_attr_setdetachstate(&theThreadAttrs, PTHREAD_CREATE_DETACHED); - if (result) return 0; /*THROW_RESULT("pthread_attr_setdetachstate - Thread attributes could not be detached.")*/ - - result = pthread_create (&pThread, &theThreadAttrs, frt->DiskReaderEntry, frt); - if (result) return 0; /*THROW_RESULT("pthread_create - Create and start the thread.")*/ - - pthread_attr_destroy(&theThreadAttrs); - - /* we've now created the thread and started it - we'll now set the priority of the thread to the nominated priority - and we'll also make the thread fixed */ - thread_extended_policy_data_t theFixedPolicy; - thread_precedence_policy_data_t thePrecedencePolicy; - SInt32 relativePriority; - - /* make thread fixed */ - theFixedPolicy.timeshare = 0; /* set to 1 for a non-fixed thread */ - result = thread_policy_set (pthread_mach_thread_np(pThread), THREAD_EXTENDED_POLICY, (thread_policy_t)&theFixedPolicy, THREAD_EXTENDED_POLICY_COUNT); - if (result) return 0; /*THROW_RESULT("thread_policy - Couldn't set thread as fixed priority.")*/ - /* set priority */ - /* precedency policy's "importance" value is relative to spawning thread's priority */ - relativePriority = frt->mThreadPriority - frt->GetThreadBasePriority(pthread_self()); - - thePrecedencePolicy.importance = relativePriority; - result = thread_policy_set (pthread_mach_thread_np(pThread), THREAD_PRECEDENCE_POLICY, (thread_policy_t)&thePrecedencePolicy, THREAD_PRECEDENCE_POLICY_COUNT); - if (result) return 0; /*THROW_RESULT("thread_policy - Couldn't set thread priority.")*/ - - return 1; -} - -static UInt32 FileReaderThread_GetThreadBasePriority (pthread_t inThread) -{ - thread_basic_info_data_t threadInfo; - policy_info_data_t thePolicyInfo; - unsigned int count; - - /* get basic info */ - count = THREAD_BASIC_INFO_COUNT; - thread_info (pthread_mach_thread_np (inThread), THREAD_BASIC_INFO, (integer_t*)&threadInfo, &count); - - switch (threadInfo.policy) { - case POLICY_TIMESHARE: - count = POLICY_TIMESHARE_INFO_COUNT; - thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_TIMESHARE_INFO, (integer_t*)&(thePolicyInfo.ts), &count); - return thePolicyInfo.ts.base_priority; - break; - - case POLICY_FIFO: - count = POLICY_FIFO_INFO_COUNT; - thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_FIFO_INFO, (integer_t*)&(thePolicyInfo.fifo), &count); - if (thePolicyInfo.fifo.depressed) { - return thePolicyInfo.fifo.depress_priority; - } else { - return thePolicyInfo.fifo.base_priority; - } - break; - - case POLICY_RR: - count = POLICY_RR_INFO_COUNT; - thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_RR_INFO, (integer_t*)&(thePolicyInfo.rr), &count); - if (thePolicyInfo.rr.depressed) { - return thePolicyInfo.rr.depress_priority; - } else { - return thePolicyInfo.rr.base_priority; - } - break; - } - - return 0; -} - -static void *FileReaderThread_DiskReaderEntry (void *inRefCon) -{ - FileReaderThread *frt = (FileReaderThread *)inRefCon; - frt->ReadNextChunk(frt); - #if DEBUG - printf ("finished with reading file\n"); - #endif - - return 0; -} - -static void FileReaderThread_ReadNextChunk (FileReaderThread *frt) -{ - OSStatus result; - ByteCount dataChunkSize; - AudioFileManager* theItem = 0; - - for (;;) - { - { /* this is a scoped based lock */ - int bNeedsRelease = frt->mGuard->Lock(frt->mGuard); - - if (frt->mThreadShouldDie) { - frt->mGuard->Notify(frt->mGuard); - if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard); - return; - } - - /*if (frt->mFileData.empty())*/ - if (frt->mFileData == NULL) - { - frt->mGuard->Wait(frt->mGuard); - } - - /* kill thread */ - if (frt->mThreadShouldDie) { - - frt->mGuard->Notify(frt->mGuard); - if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard); - return; - } - - /*theItem = frt->mFileData.front();*/ - /*frt->mFileData.pop_front();*/ - theItem = NULL; - if (frt->mFileData != NULL) - { - FileData *next = frt->mFileData->next; - theItem = frt->mFileData->obj; - SDL_free(frt->mFileData); - frt->mFileData = next; - } - - if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard); - } - - if ((theItem->mFileLength - theItem->mReadFilePosition) < theItem->mChunkSize) - dataChunkSize = theItem->mFileLength - theItem->mReadFilePosition; - else - dataChunkSize = theItem->mChunkSize; - - /* this is the exit condition for the thread */ - if (dataChunkSize <= 0) { - theItem->mFinishedReadingData = 1; - continue; - } - /* construct pointer */ - char* writePtr = (char *) (theItem->GetFileBuffer(theItem) + - (theItem->mWriteToFirstBuffer ? 0 : theItem->mChunkSize)); - - /* read data */ - result = theItem->Read(theItem, writePtr, &dataChunkSize); - if (result != noErr && result != eofErr) { - AudioFilePlayer *afp = (AudioFilePlayer *) theItem->GetParent(theItem); - afp->DoNotification(afp, result); - continue; - } - - if (dataChunkSize != theItem->mChunkSize) - { - writePtr += dataChunkSize; - - /* can't exit yet.. we still have to pass the partial buffer back */ - SDL_memset(writePtr, 0, (theItem->mChunkSize - dataChunkSize)); - } - - theItem->mWriteToFirstBuffer = !theItem->mWriteToFirstBuffer; /* switch buffers */ - - if (result == eofErr) - theItem->mReadFilePosition = theItem->mFileLength; - else - theItem->mReadFilePosition += dataChunkSize; /* increment count */ - } -} - -void delete_FileReaderThread(FileReaderThread *frt) -{ - if (frt != NULL) - { - delete_SDLOSXCAGuard(frt->mGuard); - SDL_free(frt); - } -} - -FileReaderThread *new_FileReaderThread () -{ - FileReaderThread *frt = (FileReaderThread *) SDL_malloc(sizeof (FileReaderThread)); - if (frt == NULL) - return NULL; - SDL_memset(frt, '\0', sizeof (*frt)); - - frt->mGuard = new_SDLOSXCAGuard(); - if (frt->mGuard == NULL) - { - SDL_free(frt); - return NULL; - } - - #define SET_FILEREADERTHREAD_METHOD(m) frt->m = FileReaderThread_##m - SET_FILEREADERTHREAD_METHOD(GetGuard); - SET_FILEREADERTHREAD_METHOD(AddReader); - SET_FILEREADERTHREAD_METHOD(RemoveReader); - SET_FILEREADERTHREAD_METHOD(TryNextRead); - SET_FILEREADERTHREAD_METHOD(ReadNextChunk); - SET_FILEREADERTHREAD_METHOD(StartFixedPriorityThread); - SET_FILEREADERTHREAD_METHOD(GetThreadBasePriority); - SET_FILEREADERTHREAD_METHOD(DiskReaderEntry); - #undef SET_FILEREADERTHREAD_METHOD - - frt->mThreadPriority = 62; - return frt; -} - - -static FileReaderThread *sReaderThread; - - -static int AudioFileManager_DoConnect (AudioFileManager *afm) -{ - if (!afm->mIsEngaged) - { - OSStatus result; - - /*afm->mReadFilePosition = 0;*/ - afm->mFinishedReadingData = 0; - - afm->mNumTimesAskedSinceFinished = 0; - afm->mLockUnsuccessful = 0; - - ByteCount dataChunkSize; - - if ((afm->mFileLength - afm->mReadFilePosition) < afm->mChunkSize) - dataChunkSize = afm->mFileLength - afm->mReadFilePosition; - else - dataChunkSize = afm->mChunkSize; - - result = afm->Read(afm, afm->mFileBuffer, &dataChunkSize); - if (result) return 0; /*THROW_RESULT("AudioFileManager::DoConnect(): Read")*/ - - afm->mReadFilePosition += dataChunkSize; - - afm->mWriteToFirstBuffer = 0; - afm->mReadFromFirstBuffer = 1; - - sReaderThread->AddReader(sReaderThread); - - afm->mIsEngaged = 1; - } - /* - else - throw static_cast(-1); */ /* thread has already been started */ - - return 1; -} - -static void AudioFileManager_Disconnect (AudioFileManager *afm) -{ - if (afm->mIsEngaged) - { - sReaderThread->RemoveReader (sReaderThread, afm); - afm->mIsEngaged = 0; - } -} - -static OSStatus AudioFileManager_Read(AudioFileManager *afm, char *buffer, ByteCount *len) -{ - return FSReadFork (afm->mForkRefNum, - fsFromStart, - afm->mReadFilePosition + afm->mAudioDataOffset, - *len, - buffer, - len); -} - -static OSStatus AudioFileManager_GetFileData (AudioFileManager *afm, void** inOutData, UInt32 *inOutDataSize) -{ - if (afm->mFinishedReadingData) - { - ++afm->mNumTimesAskedSinceFinished; - *inOutDataSize = 0; - *inOutData = 0; - return noErr; - } - - if (afm->mReadFromFirstBuffer == afm->mWriteToFirstBuffer) { - #if DEBUG - printf ("* * * * * * * Can't keep up with reading file\n"); - #endif - - afm->mParent->DoNotification (afm->mParent, kAudioFilePlayErr_FilePlayUnderrun); - *inOutDataSize = 0; - *inOutData = 0; - } else { - *inOutDataSize = afm->mChunkSize; - *inOutData = afm->mReadFromFirstBuffer ? afm->mFileBuffer : (afm->mFileBuffer + afm->mChunkSize); - } - - afm->mLockUnsuccessful = !sReaderThread->TryNextRead (sReaderThread, afm); - - afm->mReadFromFirstBuffer = !afm->mReadFromFirstBuffer; - - return noErr; -} - -static void AudioFileManager_AfterRender (AudioFileManager *afm) -{ - if (afm->mNumTimesAskedSinceFinished > 0) - { - int didLock = 0; - SDLOSXCAGuard *guard = sReaderThread->GetGuard(sReaderThread); - if (guard->Try(guard, &didLock)) { - afm->mParent->DoNotification (afm->mParent, kAudioFilePlay_FileIsFinished); - if (didLock) - guard->Unlock(guard); - } - } - - if (afm->mLockUnsuccessful) - afm->mLockUnsuccessful = !sReaderThread->TryNextRead (sReaderThread, afm); -} - -static void AudioFileManager_SetPosition (AudioFileManager *afm, SInt64 pos) -{ - if (pos < 0 || pos >= afm->mFileLength) { - SDL_SetError ("AudioFileManager::SetPosition - position invalid: %d filelen=%d\n", - (unsigned int)pos, (unsigned int)afm->mFileLength); - pos = 0; - } - - afm->mReadFilePosition = pos; -} - -static void AudioFileManager_SetEndOfFile (AudioFileManager *afm, SInt64 pos) -{ - if (pos <= 0 || pos > afm->mFileLength) { - SDL_SetError ("AudioFileManager::SetEndOfFile - position beyond actual eof\n"); - pos = afm->mFileLength; - } - - afm->mFileLength = pos; -} - -static const char *AudioFileManager_GetFileBuffer(AudioFileManager *afm) -{ - return afm->mFileBuffer; -} - -const AudioFilePlayer *AudioFileManager_GetParent(AudioFileManager *afm) -{ - return afm->mParent; -} - -static int AudioFileManager_GetByteCounter(AudioFileManager *afm) -{ - return afm->mByteCounter; -} - -static OSStatus AudioFileManager_FileInputProc (void *inRefCon, - AudioUnitRenderActionFlags *ioActionFlags, - const AudioTimeStamp *inTimeStamp, - UInt32 inBusNumber, - UInt32 inNumberFrames, - AudioBufferList *ioData) -{ - AudioFileManager* afm = (AudioFileManager*)inRefCon; - return afm->Render(afm, ioData); -} - -static OSStatus AudioFileManager_Render (AudioFileManager *afm, AudioBufferList *ioData) -{ - OSStatus result = noErr; - AudioBuffer *abuf; - UInt32 i; - - for (i = 0; i < ioData->mNumberBuffers; i++) { - abuf = &ioData->mBuffers[i]; - if (afm->mBufferOffset >= afm->mBufferSize) { - result = afm->GetFileData(afm, &afm->mTmpBuffer, &afm->mBufferSize); - if (result) { - SDL_SetError ("AudioConverterFillBuffer:%ld\n", result); - afm->mParent->DoNotification(afm->mParent, result); - return result; - } - - afm->mBufferOffset = 0; - } - - if (abuf->mDataByteSize > afm->mBufferSize - afm->mBufferOffset) - abuf->mDataByteSize = afm->mBufferSize - afm->mBufferOffset; - abuf->mData = (char *)afm->mTmpBuffer + afm->mBufferOffset; - afm->mBufferOffset += abuf->mDataByteSize; - - afm->mByteCounter += abuf->mDataByteSize; - afm->AfterRender(afm); - } - return result; -} - - -void delete_AudioFileManager (AudioFileManager *afm) -{ - if (afm != NULL) { - if (afm->mFileBuffer) { - free(afm->mFileBuffer); - } - - SDL_free(afm); - } -} - - -AudioFileManager *new_AudioFileManager(AudioFilePlayer *inParent, - SInt16 inForkRefNum, - SInt64 inFileLength, - UInt32 inChunkSize) -{ - AudioFileManager *afm; - - if (sReaderThread == NULL) - { - sReaderThread = new_FileReaderThread(); - if (sReaderThread == NULL) - return NULL; - } - - afm = (AudioFileManager *) SDL_malloc(sizeof (AudioFileManager)); - if (afm == NULL) - return NULL; - SDL_memset(afm, '\0', sizeof (*afm)); - - #define SET_AUDIOFILEMANAGER_METHOD(m) afm->m = AudioFileManager_##m - SET_AUDIOFILEMANAGER_METHOD(Disconnect); - SET_AUDIOFILEMANAGER_METHOD(DoConnect); - SET_AUDIOFILEMANAGER_METHOD(Read); - SET_AUDIOFILEMANAGER_METHOD(GetFileBuffer); - SET_AUDIOFILEMANAGER_METHOD(GetParent); - SET_AUDIOFILEMANAGER_METHOD(SetPosition); - SET_AUDIOFILEMANAGER_METHOD(GetByteCounter); - SET_AUDIOFILEMANAGER_METHOD(SetEndOfFile); - SET_AUDIOFILEMANAGER_METHOD(Render); - SET_AUDIOFILEMANAGER_METHOD(GetFileData); - SET_AUDIOFILEMANAGER_METHOD(AfterRender); - SET_AUDIOFILEMANAGER_METHOD(FileInputProc); - #undef SET_AUDIOFILEMANAGER_METHOD - - afm->mParent = inParent; - afm->mForkRefNum = inForkRefNum; - afm->mBufferSize = inChunkSize; - afm->mBufferOffset = inChunkSize; - afm->mChunkSize = inChunkSize; - afm->mFileLength = inFileLength; - afm->mFileBuffer = (char*) SDL_malloc(afm->mChunkSize * 2); - FSGetForkPosition(afm->mForkRefNum, &afm->mAudioDataOffset); - assert (afm->mFileBuffer != NULL); - return afm; -} - diff --git a/src/cdrom/macosx/CDPlayer.c b/src/cdrom/macosx/CDPlayer.c deleted file mode 100644 index beb87cd85b..0000000000 --- a/src/cdrom/macosx/CDPlayer.c +++ /dev/null @@ -1,636 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include "CDPlayer.h" -#include "AudioFilePlayer.h" -#include "SDLOSXCAGuard.h" - -/* we're exporting these functions into C land for SDL_syscdrom.c */ -/*extern "C" {*/ - -/*/////////////////////////////////////////////////////////////////////////// - Constants - //////////////////////////////////////////////////////////////////////////*/ - -#define kAudioCDFilesystemID (UInt16)(('J' << 8) | 'H') /* 'JH'; this avoids compiler warning */ - -/* XML PList keys */ -#define kRawTOCDataString "Format 0x02 TOC Data" -#define kSessionsString "Sessions" -#define kSessionTypeString "Session Type" -#define kTrackArrayString "Track Array" -#define kFirstTrackInSessionString "First Track" -#define kLastTrackInSessionString "Last Track" -#define kLeadoutBlockString "Leadout Block" -#define kDataKeyString "Data" -#define kPointKeyString "Point" -#define kSessionNumberKeyString "Session Number" -#define kStartBlockKeyString "Start Block" - -/*/////////////////////////////////////////////////////////////////////////// - Globals - //////////////////////////////////////////////////////////////////////////*/ - -#pragma mark -- Globals -- - -static int playBackWasInit = 0; -static AudioUnit theUnit; -static AudioFilePlayer* thePlayer = NULL; -static CDPlayerCompletionProc completionProc = NULL; -static SDL_mutex *apiMutex = NULL; -static SDL_sem *callbackSem; -static SDL_CD* theCDROM; - -/*/////////////////////////////////////////////////////////////////////////// - Prototypes - //////////////////////////////////////////////////////////////////////////*/ - -#pragma mark -- Prototypes -- - -static OSStatus CheckInit (); - -static void FilePlayNotificationHandler (void* inRefCon, OSStatus inStatus); - -static int RunCallBackThread (void* inRefCon); - - -#pragma mark -- Public Functions -- - -void Lock () -{ - if (!apiMutex) { - apiMutex = SDL_CreateMutex(); - } - SDL_mutexP(apiMutex); -} - -void Unlock () -{ - SDL_mutexV(apiMutex); -} - -int DetectAudioCDVolumes(FSVolumeRefNum *volumes, int numVolumes) -{ - int volumeIndex; - int cdVolumeCount = 0; - OSStatus result = noErr; - - for (volumeIndex = 1; result == noErr || result != nsvErr; volumeIndex++) - { - FSVolumeRefNum actualVolume; - FSVolumeInfo volumeInfo; - - memset (&volumeInfo, 0, sizeof(volumeInfo)); - - result = FSGetVolumeInfo (kFSInvalidVolumeRefNum, - volumeIndex, - &actualVolume, - kFSVolInfoFSInfo, - &volumeInfo, - NULL, - NULL); - - if (result == noErr) - { - if (volumeInfo.filesystemID == kAudioCDFilesystemID) /* It's an audio CD */ - { - if (volumes != NULL && cdVolumeCount < numVolumes) - volumes[cdVolumeCount] = actualVolume; - - cdVolumeCount++; - } - } - else - { - /* I'm commenting this out because it seems to be harmless */ - /*SDL_SetError ("DetectAudioCDVolumes: FSGetVolumeInfo returned %d", result);*/ - } - } - - return cdVolumeCount; -} - -int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD) -{ - HFSUniStr255 dataForkName; - OSStatus theErr; - FSIORefNum forkRefNum; - SInt64 forkSize; - Ptr forkData = 0; - ByteCount actualRead; - CFDataRef dataRef = 0; - CFPropertyListRef propertyListRef = 0; - FSRefParam fsRefPB; - FSRef tocPlistFSRef; - FSRef rootRef; - const char* error = "Unspecified Error"; - const UniChar uniName[] = { '.','T','O','C','.','p','l','i','s','t' }; - - theErr = FSGetVolumeInfo(theVolume, 0, 0, kFSVolInfoNone, 0, 0, &rootRef); - if(theErr != noErr) { - error = "FSGetVolumeInfo"; - goto bail; - } - - SDL_memset(&fsRefPB, '\0', sizeof (fsRefPB)); - - /* get stuff from .TOC.plist */ - fsRefPB.ref = &rootRef; - fsRefPB.newRef = &tocPlistFSRef; - fsRefPB.nameLength = sizeof (uniName) / sizeof (uniName[0]); - fsRefPB.name = uniName; - fsRefPB.textEncodingHint = kTextEncodingUnknown; - - theErr = PBMakeFSRefUnicodeSync (&fsRefPB); - if(theErr != noErr) { - error = "PBMakeFSRefUnicodeSync"; - goto bail; - } - - /* Load and parse the TOC XML data */ - - theErr = FSGetDataForkName (&dataForkName); - if (theErr != noErr) { - error = "FSGetDataForkName"; - goto bail; - } - - theErr = FSOpenFork (&tocPlistFSRef, dataForkName.length, dataForkName.unicode, fsRdPerm, &forkRefNum); - if (theErr != noErr) { - error = "FSOpenFork"; - goto bail; - } - - theErr = FSGetForkSize (forkRefNum, &forkSize); - if (theErr != noErr) { - error = "FSGetForkSize"; - goto bail; - } - - /* Allocate some memory for the XML data */ - forkData = NewPtr (forkSize); - if(forkData == NULL) { - error = "NewPtr"; - goto bail; - } - - theErr = FSReadFork (forkRefNum, fsFromStart, 0 /* offset location */, forkSize, forkData, &actualRead); - if(theErr != noErr) { - error = "FSReadFork"; - goto bail; - } - - dataRef = CFDataCreate (kCFAllocatorDefault, (UInt8 *)forkData, forkSize); - if(dataRef == 0) { - error = "CFDataCreate"; - goto bail; - } - - propertyListRef = CFPropertyListCreateFromXMLData (kCFAllocatorDefault, - dataRef, - kCFPropertyListImmutable, - NULL); - if (propertyListRef == NULL) { - error = "CFPropertyListCreateFromXMLData"; - goto bail; - } - - /* Now we got the Property List in memory. Parse it. */ - - /* First, make sure the root item is a CFDictionary. If not, release and bail. */ - if(CFGetTypeID(propertyListRef)== CFDictionaryGetTypeID()) - { - CFDictionaryRef dictRef = (CFDictionaryRef)propertyListRef; - - CFDataRef theRawTOCDataRef; - CFArrayRef theSessionArrayRef; - CFIndex numSessions; - CFIndex index; - - /* This is how we get the Raw TOC Data */ - theRawTOCDataRef = (CFDataRef)CFDictionaryGetValue (dictRef, CFSTR(kRawTOCDataString)); - - /* Get the session array info. */ - theSessionArrayRef = (CFArrayRef)CFDictionaryGetValue (dictRef, CFSTR(kSessionsString)); - - /* Find out how many sessions there are. */ - numSessions = CFArrayGetCount (theSessionArrayRef); - - /* Initialize the total number of tracks to 0 */ - theCD->numtracks = 0; - - /* Iterate over all sessions, collecting the track data */ - for(index = 0; index < numSessions; index++) - { - CFDictionaryRef theSessionDict; - CFNumberRef leadoutBlock; - CFArrayRef trackArray; - CFIndex numTracks; - CFIndex trackIndex; - UInt32 value = 0; - - theSessionDict = (CFDictionaryRef) CFArrayGetValueAtIndex (theSessionArrayRef, index); - leadoutBlock = (CFNumberRef) CFDictionaryGetValue (theSessionDict, CFSTR(kLeadoutBlockString)); - - trackArray = (CFArrayRef)CFDictionaryGetValue (theSessionDict, CFSTR(kTrackArrayString)); - - numTracks = CFArrayGetCount (trackArray); - - for(trackIndex = 0; trackIndex < numTracks; trackIndex++) { - - CFDictionaryRef theTrackDict; - CFNumberRef trackNumber; - CFNumberRef sessionNumber; - CFNumberRef startBlock; - CFBooleanRef isDataTrack; - UInt32 value; - - theTrackDict = (CFDictionaryRef) CFArrayGetValueAtIndex (trackArray, trackIndex); - - trackNumber = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kPointKeyString)); - sessionNumber = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kSessionNumberKeyString)); - startBlock = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kStartBlockKeyString)); - isDataTrack = (CFBooleanRef) CFDictionaryGetValue (theTrackDict, CFSTR(kDataKeyString)); - - /* Fill in the SDL_CD struct */ - int idx = theCD->numtracks++; - - CFNumberGetValue (trackNumber, kCFNumberSInt32Type, &value); - theCD->track[idx].id = value; - - CFNumberGetValue (startBlock, kCFNumberSInt32Type, &value); - theCD->track[idx].offset = value; - - theCD->track[idx].type = (isDataTrack == kCFBooleanTrue) ? SDL_DATA_TRACK : SDL_AUDIO_TRACK; - - /* Since the track lengths are not stored in .TOC.plist we compute them. */ - if (trackIndex > 0) { - theCD->track[idx-1].length = theCD->track[idx].offset - theCD->track[idx-1].offset; - } - } - - /* Compute the length of the last track */ - CFNumberGetValue (leadoutBlock, kCFNumberSInt32Type, &value); - - theCD->track[theCD->numtracks-1].length = - value - theCD->track[theCD->numtracks-1].offset; - - /* Set offset to leadout track */ - theCD->track[theCD->numtracks].offset = value; - } - - } - - theErr = 0; - goto cleanup; -bail: - SDL_SetError ("ReadTOCData: %s returned %d", error, theErr); - theErr = -1; -cleanup: - - if (propertyListRef != NULL) - CFRelease(propertyListRef); - if (dataRef != NULL) - CFRelease(dataRef); - if (forkData != NULL) - DisposePtr(forkData); - - FSCloseFork (forkRefNum); - - return theErr; -} - -int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks) -{ - OSStatus result = -1; - FSIterator iterator; - ItemCount actualObjects; - FSRef rootDirectory; - FSRef ref; - HFSUniStr255 nameStr; - - result = FSGetVolumeInfo (theVolume, - 0, - NULL, - kFSVolInfoFSInfo, - NULL, - NULL, - &rootDirectory); - - if (result != noErr) { - SDL_SetError ("ListTrackFiles: FSGetVolumeInfo returned %d", result); - return result; - } - - result = FSOpenIterator (&rootDirectory, kFSIterateFlat, &iterator); - if (result == noErr) { - do - { - result = FSGetCatalogInfoBulk (iterator, 1, &actualObjects, - NULL, kFSCatInfoNone, NULL, &ref, NULL, &nameStr); - if (result == noErr) { - - CFStringRef name; - name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length); - - /* Look for .aiff extension */ - if (CFStringHasSuffix (name, CFSTR(".aiff")) || - CFStringHasSuffix (name, CFSTR(".cdda"))) { - - /* Extract the track id from the filename */ - int trackID = 0, i = 0; - while (i < nameStr.length && !isdigit(nameStr.unicode[i])) { - ++i; - } - while (i < nameStr.length && isdigit(nameStr.unicode[i])) { - trackID = 10 * trackID +(nameStr.unicode[i] - '0'); - ++i; - } - - #if DEBUG_CDROM - printf("Found AIFF for track %d: '%s'\n", trackID, - CFStringGetCStringPtr (name, CFStringGetSystemEncoding())); - #endif - - /* Track ID's start at 1, but we want to start at 0 */ - trackID--; - - assert(0 <= trackID && trackID <= SDL_MAX_TRACKS); - - if (trackID < numTracks) - memcpy (&trackFiles[trackID], &ref, sizeof(FSRef)); - } - CFRelease (name); - } - } while(noErr == result); - FSCloseIterator (iterator); - } - - return 0; -} - -int LoadFile (const FSRef *ref, int startFrame, int stopFrame) -{ - int error = -1; - - if (CheckInit () < 0) - goto bail; - - /* release any currently playing file */ - if (ReleaseFile () < 0) - goto bail; - - #if DEBUG_CDROM - printf ("LoadFile: %d %d\n", startFrame, stopFrame); - #endif - - /*try {*/ - - /* create a new player, and attach to the audio unit */ - - thePlayer = new_AudioFilePlayer(ref); - if (thePlayer == NULL) { - SDL_SetError ("LoadFile: Could not create player"); - return -3; /*throw (-3);*/ - } - - if (!thePlayer->SetDestination(thePlayer, &theUnit)) - goto bail; - - if (startFrame >= 0) - thePlayer->SetStartFrame (thePlayer, startFrame); - - if (stopFrame >= 0 && stopFrame > startFrame) - thePlayer->SetStopFrame (thePlayer, stopFrame); - - /* we set the notifier later */ - /*thePlayer->SetNotifier(thePlayer, FilePlayNotificationHandler, NULL);*/ - - if (!thePlayer->Connect(thePlayer)) - goto bail; - - #if DEBUG_CDROM - thePlayer->Print(thePlayer); - fflush (stdout); - #endif - /*} - catch (...) - { - goto bail; - }*/ - - error = 0; - - bail: - return error; -} - -int ReleaseFile () -{ - int error = -1; - - /* (Don't see any way that the original C++ code could throw here.) --ryan. */ - /*try {*/ - if (thePlayer != NULL) { - - thePlayer->Disconnect(thePlayer); - - delete_AudioFilePlayer(thePlayer); - - thePlayer = NULL; - } - /*} - catch (...) - { - goto bail; - }*/ - - error = 0; - -/* bail: */ - return error; -} - -int PlayFile () -{ - OSStatus result = -1; - - if (CheckInit () < 0) - goto bail; - - /*try {*/ - - // start processing of the audio unit - result = AudioOutputUnitStart (theUnit); - if (result) goto bail; //THROW_RESULT("PlayFile: AudioOutputUnitStart") - - /*} - catch (...) - { - goto bail; - }*/ - - result = 0; - -bail: - return result; -} - -int PauseFile () -{ - OSStatus result = -1; - - if (CheckInit () < 0) - goto bail; - - /*try {*/ - - /* stop processing the audio unit */ - result = AudioOutputUnitStop (theUnit); - if (result) goto bail; /*THROW_RESULT("PauseFile: AudioOutputUnitStop")*/ - /*} - catch (...) - { - goto bail; - }*/ - - result = 0; -bail: - return result; -} - -void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom) -{ - assert(thePlayer != NULL); - - theCDROM = cdrom; - completionProc = proc; - thePlayer->SetNotifier (thePlayer, FilePlayNotificationHandler, cdrom); -} - -int GetCurrentFrame () -{ - int frame; - - if (thePlayer == NULL) - frame = 0; - else - frame = thePlayer->GetCurrentFrame (thePlayer); - - return frame; -} - - -#pragma mark -- Private Functions -- - -static OSStatus CheckInit () -{ - if (playBackWasInit) - return 0; - - OSStatus result = noErr; - - /* Create the callback semaphore */ - callbackSem = SDL_CreateSemaphore(0); - - /* Start callback thread */ - SDL_CreateThread(RunCallBackThread, NULL); - - { /*try {*/ - ComponentDescription desc; - - desc.componentType = kAudioUnitType_Output; - desc.componentSubType = kAudioUnitSubType_DefaultOutput; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; - desc.componentFlags = 0; - desc.componentFlagsMask = 0; - - Component comp = FindNextComponent (NULL, &desc); - if (comp == NULL) { - SDL_SetError ("CheckInit: FindNextComponent returned NULL"); - if (result) return -1; //throw(internalComponentErr); - } - - result = OpenAComponent (comp, &theUnit); - if (result) return -1; //THROW_RESULT("CheckInit: OpenAComponent") - - // you need to initialize the output unit before you set it as a destination - result = AudioUnitInitialize (theUnit); - if (result) return -1; //THROW_RESULT("CheckInit: AudioUnitInitialize") - - - playBackWasInit = true; - } - /*catch (...) - { - return -1; - }*/ - - return 0; -} - -static void FilePlayNotificationHandler(void * inRefCon, OSStatus inStatus) -{ - if (inStatus == kAudioFilePlay_FileIsFinished) { - - /* notify non-CA thread to perform the callback */ - SDL_SemPost(callbackSem); - - } else if (inStatus == kAudioFilePlayErr_FilePlayUnderrun) { - - SDL_SetError ("CDPlayer Notification: buffer underrun"); - } else if (inStatus == kAudioFilePlay_PlayerIsUninitialized) { - - SDL_SetError ("CDPlayer Notification: player is uninitialized"); - } else { - - SDL_SetError ("CDPlayer Notification: unknown error %ld", inStatus); - } -} - -static int RunCallBackThread (void *param) -{ - for (;;) { - - SDL_SemWait(callbackSem); - - if (completionProc && theCDROM) { - #if DEBUG_CDROM - printf ("callback!\n"); - #endif - (*completionProc)(theCDROM); - } else { - #if DEBUG_CDROM - printf ("callback?\n"); - #endif - } - } - - #if DEBUG_CDROM - printf ("thread dying now...\n"); - #endif - - return 0; -} - -/*}; // extern "C" */ diff --git a/src/cdrom/macosx/CDPlayer.h b/src/cdrom/macosx/CDPlayer.h deleted file mode 100644 index be1ac1826a..0000000000 --- a/src/cdrom/macosx/CDPlayer.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef __CDPlayer__H__ -#define __CDPlayer__H__ 1 - -#include - -#include -#include -#include - -#include "SDL.h" -#include "SDL_thread.h" -#include "SDL_mutex.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*CDPlayerCompletionProc)(SDL_CD *cdrom) ; - -void Lock (); - -void Unlock(); - -int LoadFile (const FSRef *ref, int startFrame, int endFrame); /* pass -1 to do nothing */ - -int ReleaseFile (); - -int PlayFile (); - -int PauseFile (); - -void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom); - -int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD); - -int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks); - -int DetectAudioCDVolumes (FSVolumeRefNum *volumes, int numVolumes); - -int GetCurrentFrame (); - -#ifdef __cplusplus -}; -#endif - -#endif /* __CD_Player__H__ */ diff --git a/src/cdrom/macosx/SDLOSXCAGuard.c b/src/cdrom/macosx/SDLOSXCAGuard.c deleted file mode 100644 index e8caf1bf10..0000000000 --- a/src/cdrom/macosx/SDLOSXCAGuard.c +++ /dev/null @@ -1,199 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - Note: This file hasn't been modified so technically we have to keep the disclaimer :-( - - Copyright: © Copyright 2002 Apple Computer, Inc. All rights reserved. - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs - copyrights in this original Apple software (the "Apple Software"), to use, - reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions of - the Apple Software. Neither the name, trademarks, service marks or logos of - Apple Computer, Inc. may be used to endorse or promote products derived from the - Apple Software without specific prior written permission from Apple. Except as - expressly stated in this notice, no other rights or licenses, express or implied, - are granted by Apple herein, including but not limited to any patent rights that - may be infringed by your derivative works or by other works in which the Apple - Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION - OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT - (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*============================================================================= - CAGuard.cp - -=============================================================================*/ - -/*============================================================================= - Includes - =============================================================================*/ - -/* -#include -#include -#include -*/ -#include "SDL_stdinc.h" - -/*#define NDEBUG 1*/ -/* -#include -*/ -#define assert(X) - - -#include "SDLOSXCAGuard.h" - -/*#warning Need a try-based Locker too*/ -/*============================================================================= - SDLOSXCAGuard - =============================================================================*/ - -static int SDLOSXCAGuard_Lock(SDLOSXCAGuard *cag) -{ - int theAnswer = 0; - - if(pthread_self() != cag->mOwner) - { - OSStatus theError = pthread_mutex_lock(&cag->mMutex); - (void)theError; - assert(theError == 0); - cag->mOwner = pthread_self(); - theAnswer = 1; - } - - return theAnswer; -} - -static void SDLOSXCAGuard_Unlock(SDLOSXCAGuard *cag) -{ - OSStatus theError; - assert(pthread_self() == cag->mOwner); - - cag->mOwner = 0; - theError = pthread_mutex_unlock(&cag->mMutex); - (void)theError; - assert(theError == 0); -} - -static int SDLOSXCAGuard_Try (SDLOSXCAGuard *cag, int *outWasLocked) -{ - int theAnswer = 0; - *outWasLocked = 0; - - if (pthread_self() == cag->mOwner) { - theAnswer = 1; - *outWasLocked = 0; - } else { - OSStatus theError = pthread_mutex_trylock(&cag->mMutex); - if (theError == 0) { - cag->mOwner = pthread_self(); - theAnswer = 1; - *outWasLocked = 1; - } - } - - return theAnswer; -} - -static void SDLOSXCAGuard_Wait(SDLOSXCAGuard *cag) -{ - OSStatus theError; - assert(pthread_self() == cag->mOwner); - - cag->mOwner = 0; - - theError = pthread_cond_wait(&cag->mCondVar, &cag->mMutex); - (void)theError; - assert(theError == 0); - cag->mOwner = pthread_self(); -} - -static void SDLOSXCAGuard_Notify(SDLOSXCAGuard *cag) -{ - OSStatus theError = pthread_cond_signal(&cag->mCondVar); - (void)theError; - assert(theError == 0); -} - - -SDLOSXCAGuard *new_SDLOSXCAGuard(void) -{ - OSStatus theError; - SDLOSXCAGuard *cag = (SDLOSXCAGuard *) SDL_malloc(sizeof (SDLOSXCAGuard)); - if (cag == NULL) - return NULL; - SDL_memset(cag, '\0', sizeof (*cag)); - - #define SET_SDLOSXCAGUARD_METHOD(m) cag->m = SDLOSXCAGuard_##m - SET_SDLOSXCAGUARD_METHOD(Lock); - SET_SDLOSXCAGUARD_METHOD(Unlock); - SET_SDLOSXCAGUARD_METHOD(Try); - SET_SDLOSXCAGUARD_METHOD(Wait); - SET_SDLOSXCAGUARD_METHOD(Notify); - #undef SET_SDLOSXCAGUARD_METHOD - - theError = pthread_mutex_init(&cag->mMutex, NULL); - (void)theError; - assert(theError == 0); - - theError = pthread_cond_init(&cag->mCondVar, NULL); - (void)theError; - assert(theError == 0); - - cag->mOwner = 0; - return cag; -} - -void delete_SDLOSXCAGuard(SDLOSXCAGuard *cag) -{ - if (cag != NULL) - { - pthread_mutex_destroy(&cag->mMutex); - pthread_cond_destroy(&cag->mCondVar); - SDL_free(cag); - } -} - diff --git a/src/cdrom/macosx/SDLOSXCAGuard.h b/src/cdrom/macosx/SDLOSXCAGuard.h deleted file mode 100644 index f22c6956fe..0000000000 --- a/src/cdrom/macosx/SDLOSXCAGuard.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - Note: This file hasn't been modified so technically we have to keep the disclaimer :-( - - - Copyright: © Copyright 2002 Apple Computer, Inc. All rights reserved. - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs - copyrights in this original Apple software (the "Apple Software"), to use, - reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions of - the Apple Software. Neither the name, trademarks, service marks or logos of - Apple Computer, Inc. may be used to endorse or promote products derived from the - Apple Software without specific prior written permission from Apple. Except as - expressly stated in this notice, no other rights or licenses, express or implied, - are granted by Apple herein, including but not limited to any patent rights that - may be infringed by your derivative works or by other works in which the Apple - Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION - OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT - (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*============================================================================= - CAGuard.h - -=============================================================================*/ -#if !defined(__CAGuard_h__) -#define __CAGuard_h__ - -/*============================================================================= - Includes - =============================================================================*/ - -#include -#include - - -/*============================================================================= - CAGuard - - This is your typical mutex with signalling implemented via pthreads. - Lock() will return true if and only if the guard is locked on that call. - A thread that already has the guard will receive 'false' if it locks it - again. Use of the stack-based CAGuard::Locker class is highly recommended - to properly manage the recursive nesting. The Wait calls with timeouts - will return true if and only if the timeout period expired. They will - return false if they receive notification any other way. - =============================================================================*/ - -typedef struct S_SDLOSXCAGuard -{ - -/* Construction/Destruction */ -/*public:*/ -/* Actions */ -/*public:*/ - int (*Lock)(struct S_SDLOSXCAGuard *cag); - void (*Unlock)(struct S_SDLOSXCAGuard *cag); - int (*Try)(struct S_SDLOSXCAGuard *cag, int *outWasLocked); /* returns true if lock is free, false if not */ - void (*Wait)(struct S_SDLOSXCAGuard *cag); - void (*Notify)(struct S_SDLOSXCAGuard *cag); - -/* Implementation */ -/*protected:*/ - pthread_mutex_t mMutex; - pthread_cond_t mCondVar; - pthread_t mOwner; -} SDLOSXCAGuard; - -SDLOSXCAGuard *new_SDLOSXCAGuard(void); -void delete_SDLOSXCAGuard(SDLOSXCAGuard *cag); - -#endif - diff --git a/src/cdrom/macosx/SDL_syscdrom.c b/src/cdrom/macosx/SDL_syscdrom.c deleted file mode 100644 index 5018750222..0000000000 --- a/src/cdrom/macosx/SDL_syscdrom.c +++ /dev/null @@ -1,514 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_CDROM_MACOSX - -#include "SDL_syscdrom_c.h" - -#pragma mark -- Globals -- - -static FSRef** tracks; -static FSVolumeRefNum* volumes; -static CDstatus status; -static int nextTrackFrame; -static int nextTrackFramesRemaining; -static int fakeCD; -static int currentTrack; -static int didReadTOC; -static int cacheTOCNumTracks; -static int currentDrive; /* Only allow 1 drive in use at a time */ - -#pragma mark -- Prototypes -- - -static const char *SDL_SYS_CDName (int drive); -static int SDL_SYS_CDOpen (int drive); -static int SDL_SYS_CDGetTOC (SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus (SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay (SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause (SDL_CD *cdrom); -static int SDL_SYS_CDResume (SDL_CD *cdrom); -static int SDL_SYS_CDStop (SDL_CD *cdrom); -static int SDL_SYS_CDEject (SDL_CD *cdrom); -static void SDL_SYS_CDClose (SDL_CD *cdrom); - -#pragma mark -- Helper Functions -- - -/* Read a list of tracks from the volume */ -static int LoadTracks (SDL_CD *cdrom) -{ - /* Check if tracks are already loaded */ - if ( tracks[cdrom->id] != NULL ) - return 0; - - /* Allocate memory for tracks */ - tracks[cdrom->id] = (FSRef*) SDL_calloc (1, sizeof(**tracks) * cdrom->numtracks); - if (tracks[cdrom->id] == NULL) { - SDL_OutOfMemory (); - return -1; - } - - /* Load tracks */ - if (ListTrackFiles (volumes[cdrom->id], tracks[cdrom->id], cdrom->numtracks) < 0) - return -1; - - return 0; -} - -/* Find a file for a given start frame and length */ -static FSRef* GetFileForOffset (SDL_CD *cdrom, int start, int length, int *outStartFrame, int *outStopFrame) -{ - int i; - - for (i = 0; i < cdrom->numtracks; i++) { - - if (cdrom->track[i].offset <= start && - start < (cdrom->track[i].offset + cdrom->track[i].length)) - break; - } - - if (i == cdrom->numtracks) - return NULL; - - currentTrack = i; - - *outStartFrame = start - cdrom->track[i].offset; - - if ((*outStartFrame + length) < cdrom->track[i].length) { - *outStopFrame = *outStartFrame + length; - length = 0; - nextTrackFrame = -1; - nextTrackFramesRemaining = -1; - } - else { - *outStopFrame = -1; - length -= cdrom->track[i].length - *outStartFrame; - nextTrackFrame = cdrom->track[i+1].offset; - nextTrackFramesRemaining = length; - } - - return &tracks[cdrom->id][i]; -} - -/* Setup another file for playback, or stop playback (called from another thread) */ -static void CompletionProc (SDL_CD *cdrom) -{ - - Lock (); - - if (nextTrackFrame > 0 && nextTrackFramesRemaining > 0) { - - /* Load the next file to play */ - int startFrame, stopFrame; - FSRef *file; - - PauseFile (); - ReleaseFile (); - - file = GetFileForOffset (cdrom, nextTrackFrame, - nextTrackFramesRemaining, &startFrame, &stopFrame); - - if (file == NULL) { - status = CD_STOPPED; - Unlock (); - return; - } - - LoadFile (file, startFrame, stopFrame); - - SetCompletionProc (CompletionProc, cdrom); - - PlayFile (); - } - else { - - /* Release the current file */ - PauseFile (); - ReleaseFile (); - status = CD_STOPPED; - } - - Unlock (); -} - - -#pragma mark -- Driver Functions -- - -/* Initialize */ -int SDL_SYS_CDInit (void) -{ - /* Initialize globals */ - volumes = NULL; - tracks = NULL; - status = CD_STOPPED; - nextTrackFrame = -1; - nextTrackFramesRemaining = -1; - fakeCD = SDL_FALSE; - currentTrack = -1; - didReadTOC = SDL_FALSE; - cacheTOCNumTracks = -1; - currentDrive = -1; - - /* Fill in function pointers */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* - Read the list of "drives" - - This is currently a hack that infers drives from - mounted audio CD volumes, rather than - actual CD-ROM devices - which means it may not - act as expected sometimes. - */ - - /* Find out how many cd volumes are mounted */ - SDL_numcds = DetectAudioCDVolumes (NULL, 0); - - /* - If there are no volumes, fake a cd device - so tray empty can be reported. - */ - if (SDL_numcds == 0) { - - fakeCD = SDL_TRUE; - SDL_numcds = 1; - status = CD_TRAYEMPTY; - - return 0; - } - - /* Allocate space for volumes */ - volumes = (FSVolumeRefNum*) SDL_calloc (1, sizeof(*volumes) * SDL_numcds); - if (volumes == NULL) { - SDL_OutOfMemory (); - return -1; - } - - /* Allocate space for tracks */ - tracks = (FSRef**) SDL_calloc (1, sizeof(*tracks) * (SDL_numcds + 1)); - if (tracks == NULL) { - SDL_OutOfMemory (); - return -1; - } - - /* Mark the end of the tracks array */ - tracks[ SDL_numcds ] = (FSRef*)-1; - - /* - Redetect, now save all volumes for later - Update SDL_numcds just in case it changed - */ - { - int numVolumes = SDL_numcds; - - SDL_numcds = DetectAudioCDVolumes (volumes, numVolumes); - - /* If more cds suddenly show up, ignore them */ - if (SDL_numcds > numVolumes) { - SDL_SetError ("Some CD's were added but they will be ignored"); - SDL_numcds = numVolumes; - } - } - - return 0; -} - -/* Shutdown and cleanup */ -void SDL_SYS_CDQuit(void) -{ - ReleaseFile(); - - if (volumes != NULL) - free (volumes); - - if (tracks != NULL) { - - FSRef **ptr; - for (ptr = tracks; *ptr != (FSRef*)-1; ptr++) - if (*ptr != NULL) - free (*ptr); - - free (tracks); - } -} - -/* Get the Unix disk name of the volume */ -static const char *SDL_SYS_CDName (int drive) -{ - /* - * !!! FIXME: PBHGetVolParmsSync() is gone in 10.6, - * !!! FIXME: replaced with FSGetVolumeParms(), which - * !!! FIXME: isn't available before 10.5. :/ - */ - return "Mac OS X CD-ROM Device"; - -#if 0 - OSStatus err = noErr; - HParamBlockRec pb; - GetVolParmsInfoBuffer volParmsInfo; - - if (fakeCD) - return "Fake CD-ROM Device"; - - pb.ioParam.ioNamePtr = NULL; - pb.ioParam.ioVRefNum = volumes[drive]; - pb.ioParam.ioBuffer = (Ptr)&volParmsInfo; - pb.ioParam.ioReqCount = (SInt32)sizeof(volParmsInfo); - err = PBHGetVolParmsSync(&pb); - - if (err != noErr) { - SDL_SetError ("PBHGetVolParmsSync returned %d", err); - return NULL; - } - - return volParmsInfo.vMDeviceID; -#endif -} - -/* Open the "device" */ -static int SDL_SYS_CDOpen (int drive) -{ - /* Only allow 1 device to be open */ - if (currentDrive >= 0) { - SDL_SetError ("Only one cdrom is supported"); - return -1; - } - else - currentDrive = drive; - - return drive; -} - -/* Get the table of contents */ -static int SDL_SYS_CDGetTOC (SDL_CD *cdrom) -{ - if (fakeCD) { - SDL_SetError (kErrorFakeDevice); - return -1; - } - - if (didReadTOC) { - cdrom->numtracks = cacheTOCNumTracks; - return 0; - } - - - ReadTOCData (volumes[cdrom->id], cdrom); - didReadTOC = SDL_TRUE; - cacheTOCNumTracks = cdrom->numtracks; - - return 0; -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus (SDL_CD *cdrom, int *position) -{ - if (position) { - int trackFrame; - - Lock (); - trackFrame = GetCurrentFrame (); - Unlock (); - - *position = cdrom->track[currentTrack].offset + trackFrame; - } - - return status; -} - -/* Start playback */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - int startFrame, stopFrame; - FSRef *ref; - - if (fakeCD) { - SDL_SetError (kErrorFakeDevice); - return -1; - } - - Lock(); - - if (LoadTracks (cdrom) < 0) - return -2; - - if (PauseFile () < 0) - return -3; - - if (ReleaseFile () < 0) - return -4; - - ref = GetFileForOffset (cdrom, start, length, &startFrame, &stopFrame); - if (ref == NULL) { - SDL_SetError ("SDL_SYS_CDPlay: No file for start=%d, length=%d", start, length); - return -5; - } - - if (LoadFile (ref, startFrame, stopFrame) < 0) - return -6; - - SetCompletionProc (CompletionProc, cdrom); - - if (PlayFile () < 0) - return -7; - - status = CD_PLAYING; - - Unlock(); - - return 0; -} - -/* Pause playback */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - if (fakeCD) { - SDL_SetError (kErrorFakeDevice); - return -1; - } - - Lock (); - - if (PauseFile () < 0) { - Unlock (); - return -2; - } - - status = CD_PAUSED; - - Unlock (); - - return 0; -} - -/* Resume playback */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - if (fakeCD) { - SDL_SetError (kErrorFakeDevice); - return -1; - } - - Lock (); - - if (PlayFile () < 0) { - Unlock (); - return -2; - } - - status = CD_PLAYING; - - Unlock (); - - return 0; -} - -/* Stop playback */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - if (fakeCD) { - SDL_SetError (kErrorFakeDevice); - return -1; - } - - Lock (); - - if (PauseFile () < 0) { - Unlock (); - return -2; - } - - if (ReleaseFile () < 0) { - Unlock (); - return -3; - } - - status = CD_STOPPED; - - Unlock (); - - return 0; -} - -/* Eject the CD-ROM (Unmount the volume) */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - OSStatus err; - pid_t dissenter; - - if (fakeCD) { - SDL_SetError (kErrorFakeDevice); - return -1; - } - - Lock (); - - if (PauseFile () < 0) { - Unlock (); - return -2; - } - - if (ReleaseFile () < 0) { - Unlock (); - return -3; - } - - status = CD_STOPPED; - - /* Eject the volume */ - err = FSEjectVolumeSync(volumes[cdrom->id], kNilOptions, &dissenter); - - if (err != noErr) { - Unlock (); - SDL_SetError ("PBUnmountVol returned %d", err); - return -4; - } - - status = CD_TRAYEMPTY; - - /* Invalidate volume and track info */ - volumes[cdrom->id] = 0; - free (tracks[cdrom->id]); - tracks[cdrom->id] = NULL; - - Unlock (); - - return 0; -} - -/* Close the CD-ROM */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - currentDrive = -1; - return; -} - -#endif /* SDL_CDROM_MACOSX */ diff --git a/src/cdrom/macosx/SDL_syscdrom_c.h b/src/cdrom/macosx/SDL_syscdrom_c.h deleted file mode 100644 index 589c5897e6..0000000000 --- a/src/cdrom/macosx/SDL_syscdrom_c.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the Mac OS X / CoreAudio specific header for the SDL CD-ROM API - Contributed by Darrell Walisser and Max Horn - */ - -/*********************************************************************************** - Implementation Notes - ********************* - - This code has several limitations currently (all of which are proabaly fixable): - - 1. A CD-ROM device is inferred from a mounted cdfs volume, so device 0 is - not necessarily the first CD-ROM device on the system. (Somewhat easy to fix - by useing the device name from the volume id's to reorder the volumes) - - 2. You can only open and control 1 CD-ROM device at a time. (Challenging to fix, - due to extensive code restructuring) - - 3. The status reported by SDL_CDStatus only changes to from CD_PLAYING to CD_STOPPED in - 1-second intervals (because the audio is buffered in 1-second chunks) If - the audio data is less than 1 second, the remainder is filled with silence. - - If you need to play sequences back-to-back that are less that 1 second long, - use the frame position to determine when to play the next sequence, instead - of SDL_CDStatus. - - This may be possible to fix with a clever usage of the AudioUnit API. - - 4. When new volumes are inserted, our volume information is not updated. The only way - to refresh this information is to reinit the CD-ROM subsystem of SDL. To fix this, - one would probably have to fix point 1 above first, then figure out how to register - for a notification when new media is mounted in order to perform an automatic - rescan for cdfs volumes. - - - - So, here comes a description of how this all works. - - < Initializing > - - To get things rolling, we have to locate mounted volumes that contain - audio (since nearly all Macs don't have analog audio-in on the sound card). - That's easy, since these volumes have a flag that indicates this special - filesystem. See DetectAudioCDVolumes() in CDPlayer.cpp for this code. - - Next, we parse the invisible .TOC.plist in the root of the volume, which gets us - the track information (number, offset, length, leadout, etc). See ReadTOCData() in - CDPlayer.cpp for the skinny on this. - - - < The Playback Loop > - - Now come the tricky parts. Let's start with basic audio playback. When a frame - range to play is requested, we must first find the .aiff files on the volume, - hopefully in the right order. Since these files all begin with a number "1 Audio Track", - etc, this is used to determine the correct track order. - - Once all files are determined, we have to find what file corresponds to the start - and length parameter to SDL_SYS_CDPlay(). Again, this is quite simple by walking the - cdrom's track list. At this point, we also save the offset to the next track and frames - remaining, if we're going to have to play another file after the first one. See - GetFileForOffset() for this code. - - At this point we have all info needed to start playback, so we hand off to the LoadFile() - function, which proceeds to do its magic and plays back the file. - - When the file is finished playing, CompletionProc() is invoked, at which time we can - play the next file if the previously saved next track and frames remaining - indicates that we should. - - - < Magic > - - OK, so it's not really magic, but since I don't fully understand all the hidden details it - seems like it to me ;-) The API's involved are the AudioUnit and AudioFile API's. These - appear to be an extension of CoreAudio for creating modular playback and f/x entities. - The important thing is that CPU usage is very low and reliability is very high. You'd - be hard-pressed to find a way to stutter the playback with other CPU-intensive tasks. - - One part of this magic is that it uses multiple threads, which carries the usual potential - for disaster if not handled carefully. Playback currently requires 4 additional threads: - 1. The coreaudio runloop thread - 2. The coreaudio device i/o thread - 3. The file streaming thread - 4. The notification/callback thread - - The first 2 threads are necessary evil - CoreAudio creates this no matter what the situation - is (even the SDL sound implementation creates theses suckers). The last two are are created - by us. - - The file is streamed from disk using a threaded double-buffer approach. - This way, the high latency operation of reading from disk can be performed without interrupting - the real-time device thread (which amounts to avoiding dropouts). The device thread grabs the - buffer that isn't being read and sends it to the CoreAudio mixer where it eventually gets - to the sound card. - - The device thread posts a notification when the file streaming thread is out of data. This - notification must be handled in a separate thread to avoid potential deadlock in the - device thread. That's where the notification thread comes in. This thread is signaled - whenever a notification needs to be processed, so another file can be played back if need be. - - The API in CDPlayer.cpp contains synchronization because otherwise both the notification thread - and main thread (or another other thread using the SDL CD api) can potentially call it at the same time. - -************************************************************************************/ - - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -#include "CDPlayer.h" - -#define kErrorFakeDevice "Error: Cannot proceed since we're faking a CD-ROM device. Reinit the CD-ROM subsystem to scan for new volumes." - diff --git a/src/cdrom/mint/SDL_syscdrom.c b/src/cdrom/mint/SDL_syscdrom.c deleted file mode 100644 index 0bc10edb72..0000000000 --- a/src/cdrom/mint/SDL_syscdrom.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_CDROM_MINT - -/* - Atari MetaDOS CD-ROM functions - - Patrice Mandin -*/ - -#include - -#include -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* Some ioctl() errno values which occur when the tray is empty */ -#ifndef ENOMEDIUM -#define ENOMEDIUM ENOENT -#endif -#define ERRNO_TRAYEMPTY(errno) \ - ((errno == EIO) || (errno == ENOENT) || \ - (errno == EINVAL) || (errno == ENOMEDIUM)) - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 32 - -typedef struct { - char device[3]; /* Physical device letter + ':' + '\0' */ - metaopen_t metaopen; /* Infos on opened drive */ -} metados_drive_t; - -static metados_drive_t metados_drives[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static void SDL_SYS_CDClose(SDL_CD *cdrom); -static int SDL_SYS_CDioctl(int id, int command, void *arg); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); - -int SDL_SYS_CDInit(void) -{ - metainit_t metainit={0,0,0,0}; - metaopen_t metaopen; - int i, handle; - struct cdrom_subchnl info; - - Metainit(&metainit); - if (metainit.version == NULL) { -#ifdef DEBUG_CDROM - fprintf(stderr, "MetaDOS not installed\n"); -#endif - return -1; - } - - if (metainit.drives_map == 0) { -#ifdef DEBUG_CDROM - fprintf(stderr, "No MetaDOS devices present\n"); -#endif - return -1; - } - - SDL_numcds = 0; - - for (i='A'; i<='Z'; i++) { - metados_drives[SDL_numcds].device[0] = 0; - metados_drives[SDL_numcds].device[1] = ':'; - metados_drives[SDL_numcds].device[2] = 0; - - if (metainit.drives_map & (1<<(i-'A'))) { - handle = Metaopen(i, &metaopen); - if (handle == 0) { - - info.cdsc_format = CDROM_MSF; - if ( (Metaioctl(i, METADOS_IOCTL_MAGIC, CDROMSUBCHNL, &info) == 0) || ERRNO_TRAYEMPTY(errno) ) { - metados_drives[SDL_numcds].device[0] = i; - ++SDL_numcds; - } - - Metaclose(i); - } - } - } - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - - return 0; -} - -void SDL_SYS_CDQuit(void) -{ - SDL_numcds = 0; -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(metados_drives[drive].device); -} - -static int SDL_SYS_CDOpen(int drive) -{ - int handle; - - handle = Metaopen(metados_drives[drive].device[0], &(metados_drives[drive].metaopen)); - if (handle == 0) { - return drive; - } - - return -1; -} - -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - Metaclose(metados_drives[cdrom->id].device[0]); -} - -static int SDL_SYS_CDioctl(int id, int command, void *arg) -{ - int retval; - - retval = Metaioctl(metados_drives[id].device[0], METADOS_IOCTL_MAGIC, command, arg); - if ( retval < 0 ) { - SDL_SetError("ioctl() error: %s", strerror(errno)); - } - return(retval); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - int i,okay; - struct cdrom_tochdr toc; - struct cdrom_tocentry entry; - - /* Use standard ioctl() */ - if (SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc)<0) { - return -1; - } - - cdrom->numtracks = toc.cdth_trk1-toc.cdth_trk0+1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } - - /* Read all the track TOC entries */ - okay=1; - for ( i=0; i<=cdrom->numtracks; ++i ) { - if ( i == cdrom->numtracks ) { - cdrom->track[i].id = CDROM_LEADOUT; - } else { - cdrom->track[i].id = toc.cdth_trk0+i; - } - entry.cdte_track = cdrom->track[i].id; - entry.cdte_format = CDROM_MSF; - if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCENTRY, &entry) < 0 ) { - okay=0; - break; - } else { - if ( entry.cdte_ctrl & CDROM_DATA_TRACK ) { - cdrom->track[i].type = SDL_DATA_TRACK; - } else { - cdrom->track[i].type = SDL_AUDIO_TRACK; - } - cdrom->track[i].offset = MSF_TO_FRAMES( - entry.cdte_addr.msf.minute, - entry.cdte_addr.msf.second, - entry.cdte_addr.msf.frame); - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i-1].length = cdrom->track[i].offset-cdrom->track[i-1].offset; - } - } - } - - return(okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - struct cdrom_tochdr toc; - struct cdrom_subchnl info; - - info.cdsc_format = CDROM_MSF; - if ( SDL_SYS_CDioctl(cdrom->id, CDROMSUBCHNL, &info) < 0 ) { - if ( ERRNO_TRAYEMPTY(errno) ) { - status = CD_TRAYEMPTY; - } else { - status = CD_ERROR; - } - } else { - switch (info.cdsc_audiostatus) { - case CDROM_AUDIO_INVALID: - case CDROM_AUDIO_NO_STATUS: - /* Try to determine if there's a CD available */ - if (SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc)==0) { - status = CD_STOPPED; - } else { - status = CD_TRAYEMPTY; - } - break; - case CDROM_AUDIO_COMPLETED: - status = CD_STOPPED; - break; - case CDROM_AUDIO_PLAY: - status = CD_PLAYING; - break; - case CDROM_AUDIO_PAUSED: - /* Workaround buggy CD-ROM drive */ - if ( info.cdsc_trk == CDROM_LEADOUT ) { - status = CD_STOPPED; - } else { - status = CD_PAUSED; - } - break; - default: - status = CD_ERROR; - break; - } - } - if ( position ) { - if ( status == CD_PLAYING || (status == CD_PAUSED) ) { - *position = MSF_TO_FRAMES( - info.cdsc_absaddr.msf.minute, - info.cdsc_absaddr.msf.second, - info.cdsc_absaddr.msf.frame); - } else { - *position = 0; - } - } - return(status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - struct cdrom_msf playtime; - - FRAMES_TO_MSF(start, - &playtime.cdmsf_min0, &playtime.cdmsf_sec0, &playtime.cdmsf_frame0); - FRAMES_TO_MSF(start+length, - &playtime.cdmsf_min1, &playtime.cdmsf_sec1, &playtime.cdmsf_frame1); -#ifdef DEBUG_CDROM - fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n", - playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0, - playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1); -#endif - - return SDL_SYS_CDioctl(cdrom->id, CDROMPLAYMSF, &playtime); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - return SDL_SYS_CDioctl(cdrom->id, CDROMPAUSE, 0); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - return SDL_SYS_CDioctl(cdrom->id, CDROMRESUME, 0); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - return SDL_SYS_CDioctl(cdrom->id, CDROMSTOP, 0); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - return SDL_SYS_CDioctl(cdrom->id, CDROMEJECT, 0); -} - -#endif /* SDL_CDROM_MINT */ diff --git a/src/cdrom/openbsd/SDL_syscdrom.c b/src/cdrom/openbsd/SDL_syscdrom.c deleted file mode 100644 index e4d03a6a37..0000000000 --- a/src/cdrom/openbsd/SDL_syscdrom.c +++ /dev/null @@ -1,416 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_CDROM_OPENBSD - -/* Functions for system-level CD-ROM audio control */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static dev_t SDL_cdmode[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -/* Some ioctl() errno values which occur when the tray is empty */ -#define ERRNO_TRAYEMPTY(errno) \ - ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL) || \ - (errno == ENODEV)) - -/* Check a drive to see if it is a CD-ROM */ -static int CheckDrive(char *drive, struct stat *stbuf) -{ - int is_cd, cdfd; - struct ioc_read_subchannel info; - - /* If it doesn't exist, return -1 */ - if ( stat(drive, stbuf) < 0 ) { - return(-1); - } - - /* If it does exist, verify that it's an available CD-ROM */ - is_cd = 0; - if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) { - cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0); - if ( cdfd >= 0 ) { - info.address_format = CD_MSF_FORMAT; - info.data_format = CD_CURRENT_POSITION; - info.data_len = 0; - info.data = NULL; - /* Under Linux, EIO occurs when a disk is not present. - This isn't 100% reliable, so we use the USE_MNTENT - code above instead. - */ - if ( (ioctl(cdfd, CDIOCREADSUBCHANNEL, &info) == 0) || - ERRNO_TRAYEMPTY(errno) ) { - is_cd = 1; - } - close(cdfd); - } - else if (ERRNO_TRAYEMPTY(errno)) - is_cd = 1; - } - return(is_cd); -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive, struct stat *stbuf) -{ - int i; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Check to make sure it's not already in our list. - This can happen when we see a drive via symbolic link. - */ - for ( i=0; ist_rdev == SDL_cdmode[i] ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]); -#endif - return; - } - } - - /* Add this drive to our list */ - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - SDL_cdmode[i] = stbuf->st_rdev; - ++SDL_numcds; -#ifdef DEBUG_CDROM - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -int SDL_SYS_CDInit(void) -{ - static char *checklist[] = { -#if defined(__OPENBSD__) - "?0 cd?c", "cdrom", NULL -#elif defined(__NETBSD__) - "?0 cd?d", "?0 cd?c", "cdrom", NULL -#else - "?0 cd?c", "?0 acd?c", "cdrom", NULL -#endif - }; - char *SDLcdrom; - int i, j, exists; - char drive[32]; - struct stat stbuf; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Look in the environment for our CD-ROM drive list */ - SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ - if ( SDLcdrom != NULL ) { - char *cdpath, *delim; - size_t len = SDL_strlen(SDLcdrom)+1; - cdpath = SDL_stack_alloc(char, len); - if ( cdpath != NULL ) { - SDL_strlcpy(cdpath, SDLcdrom, len); - SDLcdrom = cdpath; - do { - delim = SDL_strchr(SDLcdrom, ':'); - if ( delim ) { - *delim++ = '\0'; - } - if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) { - AddDrive(SDLcdrom, &stbuf); - } - if ( delim ) { - SDLcdrom = delim; - } else { - SDLcdrom = NULL; - } - } while ( SDLcdrom ); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } - } - - /* Scan the system for CD-ROM drives */ - for ( i=0; checklist[i]; ++i ) { - if ( checklist[i][0] == '?' ) { - char *insert; - exists = 1; - for ( j=checklist[i][1]; exists; ++j ) { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]); - insert = SDL_strchr(drive, '?'); - if ( insert != NULL ) { - *insert = j; - } - switch (CheckDrive(drive, &stbuf)) { - /* Drive exists and is a CD-ROM */ - case 1: - AddDrive(drive, &stbuf); - break; - /* Drive exists, but isn't a CD-ROM */ - case 0: - break; - /* Drive doesn't exist */ - case -1: - exists = 0; - break; - } - } - } else { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]); - if ( CheckDrive(drive, &stbuf) > 0 ) { - AddDrive(drive, &stbuf); - } - } - } - return(0); -} - -/* General ioctl() CD-ROM command function */ -static int SDL_SYS_CDioctl(int id, int command, void *arg) -{ - int retval; - - retval = ioctl(id, command, arg); - if ( retval < 0 ) { - SDL_SetError("ioctl() error: %s", strerror(errno)); - } - return(retval); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0)); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - struct ioc_toc_header toc; - int i, okay; - struct ioc_read_toc_entry entry; - struct cd_toc_entry data; - - okay = 0; - if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCHEADER, &toc) == 0 ) { - cdrom->numtracks = toc.ending_track-toc.starting_track+1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } - /* Read all the track TOC entries */ - for ( i=0; i<=cdrom->numtracks; ++i ) { - if ( i == cdrom->numtracks ) { - cdrom->track[i].id = 0xAA; /* CDROM_LEADOUT */ - } else { - cdrom->track[i].id = toc.starting_track+i; - } - entry.starting_track = cdrom->track[i].id; - entry.address_format = CD_MSF_FORMAT; - entry.data_len = sizeof(data); - entry.data = &data; - if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCENTRYS, - &entry) < 0 ) { - break; - } else { - cdrom->track[i].type = data.control; - cdrom->track[i].offset = MSF_TO_FRAMES( - data.addr.msf.minute, - data.addr.msf.second, - data.addr.msf.frame); - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i-1].length = - cdrom->track[i].offset- - cdrom->track[i-1].offset; - } - } - } - if ( i == (cdrom->numtracks+1) ) { - okay = 1; - } - } - return(okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - struct ioc_toc_header toc; - struct ioc_read_subchannel info; - struct cd_sub_channel_info data; - - info.address_format = CD_MSF_FORMAT; - info.data_format = CD_CURRENT_POSITION; - info.track = 0; - info.data_len = sizeof(data); - info.data = &data; - if ( ioctl(cdrom->id, CDIOCREADSUBCHANNEL, &info) < 0 ) { - if ( ERRNO_TRAYEMPTY(errno) ) { - status = CD_TRAYEMPTY; - } else { - status = CD_ERROR; - } - } else { - switch (data.header.audio_status) { - case CD_AS_AUDIO_INVALID: - case CD_AS_NO_STATUS: - /* Try to determine if there's a CD available */ - if (ioctl(cdrom->id,CDIOREADTOCHEADER,&toc)==0) - status = CD_STOPPED; - else - status = CD_TRAYEMPTY; - break; - case CD_AS_PLAY_COMPLETED: - status = CD_STOPPED; - break; - case CD_AS_PLAY_IN_PROGRESS: - status = CD_PLAYING; - break; - case CD_AS_PLAY_PAUSED: - status = CD_PAUSED; - break; - default: - status = CD_ERROR; - break; - } - } - if ( position ) { - if ( status == CD_PLAYING || (status == CD_PAUSED) ) { - *position = MSF_TO_FRAMES( - data.what.position.absaddr.msf.minute, - data.what.position.absaddr.msf.second, - data.what.position.absaddr.msf.frame); - } else { - *position = 0; - } - } - return(status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - struct ioc_play_msf playtime; - - FRAMES_TO_MSF(start, - &playtime.start_m, &playtime.start_s, &playtime.start_f); - FRAMES_TO_MSF(start+length, - &playtime.end_m, &playtime.end_s, &playtime.end_f); -#ifdef DEBUG_CDROM - fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n", - playtime.start_m, playtime.start_s, playtime.start_f, - playtime.end_m, playtime.end_s, playtime.end_f); -#endif - ioctl(cdrom->id, CDIOCSTART, 0); - return(SDL_SYS_CDioctl(cdrom->id, CDIOCPLAYMSF, &playtime)); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDIOCPAUSE, 0)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDIOCRESUME, 0)); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, CDIOCSTOP, 0)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - SDL_SYS_CDioctl(cdrom->id, CDIOCALLOW, 0); - return(SDL_SYS_CDioctl(cdrom->id, CDIOCEJECT, 0)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - close(cdrom->id); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* Size of MCI result buffer (in bytes) */ -#define MCI_CMDRETBUFSIZE 128 - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -//static dev_t SDL_cdmode[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -/* MCI Timing Functions */ -#define MCI_MMTIMEPERSECOND 3000 -#define FRAMESFROMMM(mmtime) (((mmtime)*CD_FPS)/MCI_MMTIMEPERSECOND) - - -/* Ready for MCI CDAudio Devices */ -int SDL_SYS_CDInit(void) -{ -int i; /* generig counter */ -MCI_SYSINFO_PARMS msp; /* Structure to MCI SysInfo parameters */ -CHAR SysInfoRet[MCI_CMDRETBUFSIZE]; /* Buffer for MCI Command result */ - -/* Fill in our driver capabilities */ -SDL_CDcaps.Name = SDL_SYS_CDName; -SDL_CDcaps.Open = SDL_SYS_CDOpen; -SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; -SDL_CDcaps.Status = SDL_SYS_CDStatus; -SDL_CDcaps.Play = SDL_SYS_CDPlay; -SDL_CDcaps.Pause = SDL_SYS_CDPause; -SDL_CDcaps.Resume = SDL_SYS_CDResume; -SDL_CDcaps.Stop = SDL_SYS_CDStop; -SDL_CDcaps.Eject = SDL_SYS_CDEject; -SDL_CDcaps.Close = SDL_SYS_CDClose; - -/* Get the number of CD ROMs in the System */ -/* Clean SysInfo structure */ -SDL_memset(&msp, 0x00, sizeof(MCI_SYSINFO_PARMS)); -/* Prepare structure to Ask Numer of Audio CDs */ -msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */ -msp.pszReturn = (PSZ)&SysInfoRet; /* Return Structure */ -msp.ulRetSize = MCI_CMDRETBUFSIZE; /* Size of ret struct */ -if (LOUSHORT(mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_QUANTITY | MCI_WAIT, (PVOID)&msp, 0)) != MCIERR_SUCCESS) return(CD_ERROR); -SDL_numcds = atoi(SysInfoRet); -if (SDL_numcds > MAX_DRIVES) SDL_numcds = MAX_DRIVES; /* Limit maximum CD number */ - -/* Get and Add their system name to the SDL_cdlist */ -msp.pszReturn = (PSZ)&SysInfoRet; /* Return Structure */ -msp.ulRetSize = MCI_CMDRETBUFSIZE; /* Size of ret struct */ -msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */ -for (i=0; istatus == CD_PLAYING || cdrom->status == CD_PAUSED) return 0; - -/* Get Number of Tracks */ -msp.hwndCallback = (HWND)NULL; /* None */ -msp.ulReturn = (ULONG)NULL; /* We want this information */ -msp.ulItem = MCI_STATUS_NUMBER_OF_TRACKS; -msp.ulValue = (ULONG)NULL; /* No additional information */ -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) return(CD_ERROR); -cdrom->numtracks = msp.ulReturn; -if ( cdrom->numtracks > SDL_MAX_TRACKS ) - { - cdrom->numtracks = SDL_MAX_TRACKS; - } -/* Alocate space for TOC data */ -mtr = (MCI_TOC_REC *)SDL_malloc(cdrom->numtracks*sizeof(MCI_TOC_REC)); -if ( mtr == NULL ) - { - SDL_OutOfMemory(); - return(-1); - } -/* Get TOC from CD */ -mtp.pBuf = mtr; -mtp.ulBufSize = cdrom->numtracks*sizeof(MCI_TOC_REC); -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_GETTOC,MCI_WAIT,&mtp, 0)) != MCIERR_SUCCESS) - { - SDL_OutOfMemory(); - SDL_free(mtr); - return(CD_ERROR); - } -/* Fill SDL Tracks Structure */ -for (i=0; inumtracks; i++) - { - /* Set Track ID */ - cdrom->track[i].id = (mtr+i)->TrackNum; - /* Set Track Type */ - msp.hwndCallback = (HWND)NULL; /* None */ - msp.ulReturn = (ULONG)NULL; /* We want this information */ - msp.ulItem = MCI_CD_STATUS_TRACK_TYPE; - msp.ulValue = (ULONG)((mtr+i)->TrackNum); /* Track Number? */ - if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_TRACK | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) - { - SDL_free(mtr); - return (CD_ERROR); - } - if (msp.ulReturn==MCI_CD_TRACK_AUDIO) cdrom->track[i].type = SDL_AUDIO_TRACK; - else cdrom->track[i].type = SDL_DATA_TRACK; - /* Set Track Length - values from MCI are in MMTIMEs - 3000 MMTIME = 1 second */ - cdrom->track[i].length = FRAMESFROMMM((mtr+i)->ulEndAddr - (mtr+i)->ulStartAddr); - /* Set Track Offset */ - cdrom->track[i].offset = FRAMESFROMMM((mtr+i)->ulStartAddr); - } -SDL_free(mtr); -return(0); -} - - -/* Get CD-ROM status - Ready for MCI */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ -CDstatus status; -MCI_STATUS_PARMS msp; - -/* Get Status from MCI */ -msp.hwndCallback = (HWND)NULL; /* None */ -msp.ulReturn = (ULONG)NULL; /* We want this information */ -msp.ulItem = MCI_STATUS_MODE; -msp.ulValue = (ULONG)NULL; /* No additional information */ -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) status = CD_ERROR; -else - { - switch(msp.ulReturn) - { - case MCI_MODE_NOT_READY: - status = CD_TRAYEMPTY; - break; - case MCI_MODE_PAUSE: - status = CD_PAUSED; - break; - case MCI_MODE_PLAY: - status = CD_PLAYING; - break; - case MCI_MODE_STOP: - status = CD_STOPPED; - break; - /* These cases should not occour */ - case MCI_MODE_RECORD: - case MCI_MODE_SEEK: - default: - status = CD_ERROR; - break; - } - } - -/* Determine position */ -if (position != NULL) /* The SDL $&$&%# CDROM call sends NULL pointer here! */ - { - if ((status == CD_PLAYING) || (status == CD_PAUSED)) - { - /* Get Position */ - msp.hwndCallback = (HWND)NULL; /* None */ - msp.ulReturn = (ULONG)NULL; /* We want this information */ - msp.ulItem = MCI_STATUS_POSITION; - msp.ulValue = (ULONG)NULL; /* No additiona info */ - if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) return (CD_ERROR); - /* Convert from MSF (format selected in the Open process) to Frames (format that will be returned) */ - *position = MSF_TO_FRAMES(MSF_MINUTE(msp.ulReturn),MSF_SECOND(msp.ulReturn),MSF_FRAME(msp.ulReturn)); - } - else *position = 0; - } -return(status); -} - -/* Start play - Ready for MCI */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ -MCI_GENERIC_PARMS mgp; -MCI_STATUS_PARMS msp; -MCI_PLAY_PARMS mpp; -ULONG min,sec,frm; - -/* Start MSF */ -FRAMES_TO_MSF(start, &min, &sec, &frm); -MSF_MINUTE(mpp.ulFrom) = min; -MSF_SECOND(mpp.ulFrom) = sec; -MSF_FRAME(mpp.ulFrom) = frm; -/* End MSF */ -FRAMES_TO_MSF(start+length, &min, &sec, &frm); -MSF_MINUTE(mpp.ulTo) = min; -MSF_SECOND(mpp.ulTo) = sec; -MSF_FRAME(mpp.ulTo) = frm; -#ifdef DEBUG_CDROM - fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n", - playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0, - playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1); -#endif -/* Verifies if it is paused first... and if it is, unpause before stopping it. */ -msp.hwndCallback = (HWND)NULL; /* None */ -msp.ulReturn = (ULONG)NULL; /* We want this information */ -msp.ulItem = MCI_STATUS_MODE; -msp.ulValue = (ULONG)NULL; /* No additional information */ -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) == MCIERR_SUCCESS) - { - if (msp.ulReturn == MCI_MODE_PAUSE) - { - mgp.hwndCallback = (HWND)NULL; // None - mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0); - } - } -/* Now play it. */ -mpp.hwndCallback = (HWND)NULL; // We do not want the info. temp -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_PLAY,MCI_FROM | MCI_TO,&mpp, 0)) == MCIERR_SUCCESS) return 0; -return (CD_ERROR); -} - -/* Pause play - Ready for MCI */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ -MCI_GENERIC_PARMS mgp; - -mgp.hwndCallback = (HWND)NULL; // None -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_PAUSE,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0; -return(CD_ERROR); -} - -/* Resume play - Ready for MCI */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ -MCI_GENERIC_PARMS mgp; - -mgp.hwndCallback = (HWND)NULL; // None -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_RESUME,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0; -return(CD_ERROR); -} - -/* Stop play - Ready for MCI */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ -MCI_GENERIC_PARMS mgp; -MCI_STATUS_PARMS msp; - -/* Verifies if it is paused first... and if it is, unpause before stopping it. */ -msp.hwndCallback = (HWND)NULL; /* None */ -msp.ulReturn = (ULONG)NULL; /* We want this information */ -msp.ulItem = MCI_STATUS_MODE; -msp.ulValue = (ULONG)NULL; /* No additional information */ -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) == MCIERR_SUCCESS) - { - if (msp.ulReturn == MCI_MODE_PAUSE) - { - mgp.hwndCallback = (HWND)NULL; // None - mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0); - } - } -/* Now stops the media */ -mgp.hwndCallback = (HWND)NULL; // None -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STOP,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0; -return(CD_ERROR); -} - -/* Eject the CD-ROM - Ready for MCI */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ -MCI_SET_PARMS msp; - -msp.hwndCallback = (HWND)NULL; // None -msp.ulTimeFormat = (ULONG)NULL; // No change -msp.ulSpeedFormat = (ULONG)NULL; // No change -msp.ulAudio = (ULONG)NULL; // No Channel -msp.ulLevel = (ULONG)NULL; // No Volume -msp.ulOver = (ULONG)NULL; // No Delay -msp.ulItem = (ULONG)NULL; // No item -msp.ulValue = (ULONG)NULL; // No value for item flag -if (LOUSHORT(mciSendCommand(cdrom->id,MCI_SET,MCI_WAIT | MCI_SET_DOOR_OPEN,&msp, 0)) == MCIERR_SUCCESS) return 0; -return(CD_ERROR); -} - -/* Close the CD-ROM handle - Ready for MCI */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ -MCI_GENERIC_PARMS mgp; - -mgp.hwndCallback = (HWND)NULL; // None -mciSendCommand(cdrom->id,MCI_CLOSE,MCI_WAIT,&mgp, 0); -} - -/* Finalize CDROM Subsystem - Ready for MCI */ -void SDL_SYS_CDQuit(void) -{ -int i; - -if ( SDL_numcds > 0 ) - { - for ( i=0; i -#include -#include -#include -#include -#include -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static dev_t SDL_cdmode[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -/* Check a drive to see if it is a CD-ROM */ -/* Caution!! Not tested. */ -static int CheckDrive(char *drive, struct stat *stbuf) -{ - int cdfd, is_cd = 0; - struct mode_sel_sns_params msp; - struct inquiry_info inq; - -#ifdef DEBUG_CDROM - char *devtype[] = {"Disk", "Tape", "Printer", "Processor", "WORM", - "CD-ROM", "Scanner", "Optical", "Changer", "Comm", "Unknown"}; -#endif - - bzero(&msp, sizeof(msp)); - bzero(&inq, sizeof(inq)); - - /* If it doesn't exist, return -1 */ - if ( stat(drive, stbuf) < 0 ) { - return(-1); - } - - if ( (cdfd = open(drive, (O_RDWR|O_NDELAY), 0)) >= 0 ) { - msp.msp_addr = (caddr_t) &inq; - msp.msp_pgcode = 0; - msp.msp_pgctrl = 0; - msp.msp_length = sizeof(inq); - msp.msp_setps = 0; - - if ( ioctl(cdfd, SCSI_GET_INQUIRY_DATA, &msp) ) - return (0); - -#ifdef DEBUG_CDROM - fprintf(stderr, "Device Type: %s\n", devtype[inq.perfdt]); - fprintf(stderr, "Vendor: %.8s\n", inq.vndrid); - fprintf(stderr, "Product: %.8s\n", inq.prodid); - fprintf(stderr, "Revision: %.8s\n", inq.revlvl); -#endif - if ( inq.perfdt == DTYPE_RODIRECT ) - is_cd = 1; - } - - return(is_cd); -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive, struct stat *stbuf) -{ - int i; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Check to make sure it's not already in our list. - * This can happen when we see a drive via symbolic link. - * - */ - for ( i=0; ist_rdev == SDL_cdmode[i] ) { -#ifdef DEBUG_CDROM - fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]); -#endif - return; - } - } - - /* Add this drive to our list */ - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - SDL_cdmode[i] = stbuf->st_rdev; - ++SDL_numcds; -#ifdef DEBUG_CDROM - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -int SDL_SYS_CDInit(void) -{ - /* checklist: - * - * Tru64 5.X (/dev/rdisk/cdrom?c) - * dir: /dev/rdisk, name: cdrom - * - * Digital UNIX 4.0X (/dev/rrz?c) - * dir: /dev, name: rrz - * - */ - struct { - char *dir; - char *name; - } checklist[] = { - {"/dev/rdisk", "cdrom"}, - {"/dev", "rrz"}, - {NULL, NULL}}; - char drive[32]; - char *SDLcdrom; - int i, j, exists; - struct stat stbuf; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - - /* Look in the environment for our CD-ROM drive list */ - SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ - if ( SDLcdrom != NULL ) { - char *cdpath, *delim; - size_t len = SDL_strlen(SDLcdrom)+1; - cdpath = SDL_stack_alloc(char, len); - if ( cdpath != NULL ) { - SDL_strlcpy(cdpath, SDLcdrom, len); - SDLcdrom = cdpath; - do { - delim = SDL_strchr(SDLcdrom, ':'); - if ( delim ) { - *delim++ = '\0'; - } - if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) { - AddDrive(SDLcdrom, &stbuf); - } - if ( delim ) { - SDLcdrom = delim; - } else { - SDLcdrom = NULL; - } - } while ( SDLcdrom ); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if ( SDL_numcds > 0 ) { - return(0); - } - } - /* Scan the system for CD-ROM drives */ - for ( i = 0; checklist[i].dir; ++i) { - DIR *devdir; - struct dirent *devent; - int name_len; - - devdir = opendir(checklist[i].dir); - if (devdir) { - name_len = SDL_strlen(checklist[i].name); - while (devent = readdir(devdir)) - if (SDL_memcmp(checklist[i].name, devent->d_name, name_len) == 0) - if (devent->d_name[devent->d_namlen-1] == 'c') { - SDL_snprintf(drive, SDL_arraysize(drive), "%s/%s", checklist[i].dir, devent->d_name); -#ifdef DEBUG_CDROM - fprintf(stderr, "Try to add drive: %s\n", drive); -#endif - if ( CheckDrive(drive, &stbuf) > 0 ) - AddDrive(drive, &stbuf); - } - closedir(devdir); - } else { -#ifdef DEBUG_CDROM - fprintf(stderr, "cannot open dir: %s\n", checklist[i].dir); -#endif - } - } - return (0); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - /* O_RDWR: To use ioctl(fd, SCSI_STOP_UNIT) */ - return(open(SDL_cdlist[drive], (O_RDWR|O_NDELAY), 0)); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - struct cd_toc toc; - struct cd_toc_header hdr; - struct cd_toc_entry *cdte; - int i; - int okay = 0; - if ( ioctl(cdrom->id, CDROM_TOC_HEADER, &hdr) ) { - fprintf(stderr,"ioctl error CDROM_TOC_HEADER\n"); - return -1; - } - cdrom->numtracks = hdr.th_ending_track - hdr.th_starting_track + 1; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } -#ifdef DEBUG_CDROM - fprintf(stderr,"hdr.th_data_len1 = %d\n", hdr.th_data_len1); - fprintf(stderr,"hdr.th_data_len0 = %d\n", hdr.th_data_len0); - fprintf(stderr,"hdr.th_starting_track = %d\n", hdr.th_starting_track); - fprintf(stderr,"hdr.th_ending_track = %d\n", hdr.th_ending_track); - fprintf(stderr,"cdrom->numtracks = %d\n", cdrom->numtracks); -#endif - toc.toc_address_format = CDROM_LBA_FORMAT; - toc.toc_starting_track = 0; - toc.toc_alloc_length = (hdr.th_data_len1 << 8) + - hdr.th_data_len0 + sizeof(hdr); - if ( (toc.toc_buffer = alloca(toc.toc_alloc_length)) == NULL) { - fprintf(stderr,"cannot allocate toc.toc_buffer\n"); - return -1; - } - - bzero (toc.toc_buffer, toc.toc_alloc_length); - if (ioctl(cdrom->id, CDROM_TOC_ENTRYS, &toc)) { - fprintf(stderr,"ioctl error CDROM_TOC_ENTRYS\n"); - return -1; - } - - cdte =(struct cd_toc_entry *) ((char *) toc.toc_buffer + sizeof(hdr)); - for (i=0; i <= cdrom->numtracks; ++i) { - if (i == cdrom->numtracks ) { - cdrom->track[i].id = 0xAA;; - } else { - cdrom->track[i].id = hdr.th_starting_track + i; - } - - cdrom->track[i].type = - cdte[i].te_control & CDROM_DATA_TRACK; - cdrom->track[i].offset = - cdte[i].te_absaddr.lba.addr3 << 24 | - cdte[i].te_absaddr.lba.addr2 << 16 | - cdte[i].te_absaddr.lba.addr1 << 8 | - cdte[i].te_absaddr.lba.addr0; - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i - 1].length = - cdrom->track[i].offset - - cdrom->track[i - 1].offset; - } - } -#ifdef DEBUG_CDROM - for (i = 0; i <= cdrom->numtracks; i++) { - fprintf(stderr,"toc_entry[%d].te_track_number = %d\n", - i,cdte[i].te_track_number); - fprintf(stderr,"cdrom->track[%d].id = %d\n", i,cdrom->track[i].id); - fprintf(stderr,"cdrom->track[%d].type = %x\n", i,cdrom->track[i].type); - fprintf(stderr,"cdrom->track[%d].offset = %d\n", i,cdrom->track[i].offset); - fprintf(stderr,"cdrom->track[%d].length = %d\n", i,cdrom->track[i].length); - } -#endif - if ( i == (cdrom->numtracks+1) ) { - okay = 1; - } - - return(okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - struct cd_sub_channel sc; - struct cd_subc_channel_data scd; - - sc.sch_address_format = CDROM_LBA_FORMAT; - sc.sch_data_format = CDROM_CURRENT_POSITION; - sc.sch_track_number = 0; - sc.sch_alloc_length = sizeof(scd); - sc.sch_buffer = (caddr_t)&scd; - if ( ioctl(cdrom->id, CDROM_READ_SUBCHANNEL, &sc) ) { - status = CD_ERROR; - fprintf(stderr,"ioctl error CDROM_READ_SUBCHANNEL \n"); - } else { - switch (scd.scd_header.sh_audio_status) { - case AS_AUDIO_INVALID: - status = CD_STOPPED; - break; - case AS_PLAY_IN_PROGRESS: - status = CD_PLAYING; - break; - case AS_PLAY_PAUSED: - status = CD_PAUSED; - break; - case AS_PLAY_COMPLETED: - status = CD_STOPPED; - break; - case AS_PLAY_ERROR: - status = CD_ERROR; - break; - case AS_NO_STATUS: - status = CD_STOPPED; - break; - default: - status = CD_ERROR; - break; - } -#ifdef DEBUG_CDROM - fprintf(stderr,"scd.scd_header.sh_audio_status = %x\n", - scd.scd_header.sh_audio_status); -#endif - } - if (position) { - if (status == CD_PLAYING || (status == CD_PAUSED) ) { - *position = - scd.scd_position_data.scp_absaddr.lba.addr3 << 24 | - scd.scd_position_data.scp_absaddr.lba.addr2 << 16 | - scd.scd_position_data.scp_absaddr.lba.addr1 << 8 | - scd.scd_position_data.scp_absaddr.lba.addr0; - } else { - *position = 0; - } - } - - return status; -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ -/* - * Play MSF - */ - struct cd_play_audio_msf msf; - int end; - - bzero(&msf, sizeof(msf)); - end = start +length; - FRAMES_TO_MSF(start + 150, /* LBA = 4500*M + 75*S + F - 150 */ - &msf.msf_starting_M_unit, - &msf.msf_starting_S_unit, - &msf.msf_starting_F_unit); - FRAMES_TO_MSF(end + 150, /* LBA = 4500*M + 75*S + F - 150 */ - &msf.msf_ending_M_unit, - &msf.msf_ending_S_unit, - &msf.msf_ending_F_unit); - - return(ioctl(cdrom->id, CDROM_PLAY_AUDIO_MSF, &msf)); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - return(ioctl(cdrom->id, CDROM_PAUSE_PLAY)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - return(ioctl(cdrom->id, CDROM_RESUME_PLAY)); -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - return(ioctl(cdrom->id, SCSI_STOP_UNIT)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - return(ioctl(cdrom->id, CDROM_EJECT_CADDY)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - close(cdrom->id); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* The maximum number of CD-ROM drives we'll detect */ -#define MAX_DRIVES 16 - -#define QNX_CD_OPENMODE O_RDONLY | O_EXCL - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static dev_t SDL_cdmode[MAX_DRIVES]; -static int SDL_cdopen[MAX_DRIVES]; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - -/* Check a drive to see if it is a CD-ROM */ -static int CheckDrive(char *drive, struct stat *stbuf) -{ - int is_cd, cdfd; - cam_devinfo_t dinfo; - int devctlret=0; - - int atapi; - int removable; - int cdb10; - - /* If it doesn't exist, return -1 */ - if (stat(drive, stbuf) < 0) - { - return(-1); - } - - /* If it does exist, verify that it's an available CD-ROM */ - is_cd = 0; - - if (S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode)) - { - cdfd = open(drive, QNX_CD_OPENMODE); - if ( cdfd >= 0 ) - { - devctlret=devctl(cdfd, DCMD_CAM_DEVINFO, &dinfo, sizeof(cam_devinfo_t), NULL); - - if (devctlret==EOK) - { - atapi=dinfo.flags & DEV_ATAPI; - removable=dinfo.flags & DEV_REMOVABLE; - cdb10=dinfo.flags & DEV_CDB_10; /* I'm not sure about that flag */ - - /* in the near future need to add more checks for splitting cdroms from other devices */ - if ((atapi)&&(removable)) - { - is_cd = 1; - } - } - - close(cdfd); - } - } - return(is_cd); -} - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive, struct stat *stbuf) -{ - int i; - - if (SDL_numcds < MAX_DRIVES) - { - /* Check to make sure it's not already in our list. - This can happen when we see a drive via symbolic link. */ - - for (i=0; ist_rdev == SDL_cdmode[i]) - { - return; - } - } - - /* Add this drive to our list */ - - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if (SDL_cdlist[i] == NULL) - { - SDL_OutOfMemory(); - return; - } - SDL_cdmode[i] = stbuf->st_rdev; - ++SDL_numcds; - } -} - -int SDL_SYS_CDInit(void) -{ - /* checklist: /dev/cdrom, /dev/cd?, /dev/scd? */ - static char *checklist[]={"cdrom", "?0 cd?", "?1 cd?", "?0 scd?", NULL}; - - char *SDLcdrom; - int i, j, exists; - char drive[32]; - struct stat stbuf; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* clearing device open status */ - for (i=0; i 0) - { - AddDrive(SDLcdrom, &stbuf); - } - if (delim) - { - SDLcdrom = delim; - } - else - { - SDLcdrom = NULL; - } - } while (SDLcdrom); - SDL_stack_free(cdpath); - } - - /* If we found our drives, there's nothing left to do */ - if (SDL_numcds > 0) - { - return(0); - } - } - - /* Scan the system for CD-ROM drives */ - for ( i=0; checklist[i]; ++i ) - { - if (checklist[i][0] == '?') - { - char* insert; - exists = 1; - - for ( j=checklist[i][1]; exists; ++j ) - { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]); - insert = SDL_strchr(drive, '?'); - if (insert != NULL) - { - *insert = j; - } - switch (CheckDrive(drive, &stbuf)) - { - /* Drive exists and is a CD-ROM */ - case 1: - AddDrive(drive, &stbuf); - break; - /* Drive exists, but isn't a CD-ROM */ - case 0: - break; - /* Drive doesn't exist */ - case -1: - exists = 0; - break; - } - } - } - else - { - SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]); - if (CheckDrive(drive, &stbuf) > 0) - { - AddDrive(drive, &stbuf); - } - } - } - return(0); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - int handle; - - handle=open(SDL_cdlist[drive], QNX_CD_OPENMODE); - - if (handle>0) - { - SDL_cdopen[drive]=handle; - } - - return (handle); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - cdrom_read_toc_t toc; - int i, okay; - - okay = 0; - if (devctl(cdrom->id, DCMD_CAM_CDROMREADTOC, &toc, sizeof(toc), NULL) == 0) - { - cdrom->numtracks = toc.last_track - toc.first_track + 1; - if (cdrom->numtracks > SDL_MAX_TRACKS) - { - cdrom->numtracks = SDL_MAX_TRACKS; - } - /* Read all the track TOC entries */ - for (i=0; i<=cdrom->numtracks; ++i) - { - if (i == cdrom->numtracks) - { - cdrom->track[i].id = CDROM_LEADOUT; - } - else - { - cdrom->track[i].id = toc.first_track+i; - } - - cdrom->track[i].type = toc.toc_entry[i].control_adr & 0x0F; - cdrom->track[i].offset = toc.toc_entry[i].addr.lba; - cdrom->track[i].length = 0; - - if (i > 0) - { - cdrom->track[i-1].length = cdrom->track[i].offset-cdrom->track[i-1].offset; - } - } - if (i == (cdrom->numtracks+1)) - { - okay = 1; - } - } - return (okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - - cdrom_read_toc_t toc; - cdrom_subch_data_t info; - cam_devinfo_t dinfo; - - int devctlret=0; - int drive=-1; - int i; - int eagaincnt=0; - - /* check media presence before read subchannel call, some cdroms can lockups */ - /* if no media, while calling read subchannel functions. */ - devctlret=devctl(cdrom->id, DCMD_CAM_DEVINFO, &dinfo, sizeof(cam_devinfo_t), NULL); - - if (devctlret==EOK) - { - if ((dinfo.flags & DEV_NO_MEDIA)!=0) - { - status = CD_TRAYEMPTY; - if (position) - { - *position = 0; - } - return (status); - } - } - - /* if media exists, then do other stuff */ - - SDL_memset(&info, 0x00, sizeof(info)); - info.subch_command.data_format = CDROM_SUBCH_CURRENT_POSITION; - - do { - devctlret=devctl(cdrom->id, DCMD_CAM_CDROMSUBCHNL, &info, sizeof(info), NULL); - if (devctlret==EIO) - { - /* big workaround for media change, handle is unusable after that, - that bug was found in QNX 6.2, 6.2.1 is not released yet. */ - - for (i=0; iid) - { - drive=i; - break; - } - } - if (drive==-1) - { - /* that cannot happen, but ... */ - break; - } - close(cdrom->id); - cdrom->id=open(SDL_cdlist[drive], QNX_CD_OPENMODE); - devctlret=EAGAIN; - } - if (devctlret==EAGAIN) - { - eagaincnt++; - } - if (eagaincnt==2) - { - /* workaround for broken cdroms, which can return always EAGAIN when its not ready, */ - /* that mean errornous media or just no media avail */ - devctlret=ENXIO; - break; - } - } while ((devctlret==EAGAIN)||(devctlret==ESTALE)); - - if (devctlret != 0) - { - if (devctlret==ENXIO) - { - status = CD_TRAYEMPTY; - } - else - { - status = CD_ERROR; - } - } - else - { - switch (info.current_position.header.audio_status) - { - case CDROM_AUDIO_INVALID: - case CDROM_AUDIO_NO_STATUS: - /* Try to determine if there's a CD available */ - if (devctl(cdrom->id, DCMD_CAM_CDROMREADTOC, &toc, sizeof(toc), NULL)==0) - status = CD_STOPPED; - else - status = CD_TRAYEMPTY; - break; - case CDROM_AUDIO_COMPLETED: - status = CD_STOPPED; - break; - case CDROM_AUDIO_PLAY: - status = CD_PLAYING; - break; - case CDROM_AUDIO_PAUSED: - /* Workaround buggy CD-ROM drive */ - if (info.current_position.data_format == CDROM_LEADOUT) - { - status = CD_STOPPED; - } - else - { - status = CD_PAUSED; - } - break; - default: - status = CD_ERROR; - break; - } - } - - if (position) - { - if (status==CD_PLAYING || (status==CD_PAUSED)) - { - *position = MSF_TO_FRAMES(info.current_position.addr.msf.minute, - info.current_position.addr.msf.second, - info.current_position.addr.msf.frame); - } - else - { - *position = 0; - } - } - - return (status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - cdrom_playmsf_t playtime; - - FRAMES_TO_MSF(start, &playtime.start_minute, &playtime.start_second, &playtime.start_frame); - FRAMES_TO_MSF(start+length, &playtime.end_minute, &playtime.end_second, &playtime.end_frame); - - if (devctl(cdrom->id, DCMD_CAM_CDROMPLAYMSF, &playtime, sizeof(playtime), NULL) != 0) - { - return -1; - } - else - { - return 0; - } -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ - if (devctl(cdrom->id, DCMD_CAM_CDROMPAUSE, NULL, 0, NULL)!=0) - { - return -1; - } - else - { - return 0; - } -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ - if (devctl(cdrom->id, DCMD_CAM_CDROMRESUME, NULL, 0, NULL)!=0) - { - return -1; - } - else - { - return 0; - } -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - if (devctl(cdrom->id, DCMD_CAM_CDROMSTOP, NULL, 0, NULL)!=0) - { - return -1; - } - else - { - return 0; - } -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - if (devctl(cdrom->id, DCMD_CAM_EJECT_MEDIA, NULL, 0, NULL)!=0) - { - return -1; - } - else - { - return 0; - } -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - int i; - - for (i=0; iid) - { - SDL_cdopen[i]=0; - break; - } - } - - close(cdrom->id); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if (SDL_numcds > 0) - { - for (i=0; i -#include - -#include "SDL_cdrom.h" -#include "../SDL_syscdrom.h" - -/* This really broken?? */ -#define BROKEN_MCI_PAUSE /* Pausing actually stops play -- Doh! */ - -/* The maximum number of CD-ROM drives we'll detect (Don't change!) */ -#define MAX_DRIVES 26 - -/* A list of available CD-ROM drives */ -static char *SDL_cdlist[MAX_DRIVES]; -static MCIDEVICEID SDL_mciID[MAX_DRIVES]; -#ifdef BROKEN_MCI_PAUSE -static int SDL_paused[MAX_DRIVES]; -#endif -static int SDL_CD_end_position; - -/* The system-dependent CD control functions */ -static const char *SDL_SYS_CDName(int drive); -static int SDL_SYS_CDOpen(int drive); -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); -static int SDL_SYS_CDPause(SDL_CD *cdrom); -static int SDL_SYS_CDResume(SDL_CD *cdrom); -static int SDL_SYS_CDStop(SDL_CD *cdrom); -static int SDL_SYS_CDEject(SDL_CD *cdrom); -static void SDL_SYS_CDClose(SDL_CD *cdrom); - - -/* Add a CD-ROM drive to our list of valid drives */ -static void AddDrive(char *drive) -{ - int i; - - if ( SDL_numcds < MAX_DRIVES ) { - /* Add this drive to our list */ - i = SDL_numcds; - SDL_cdlist[i] = SDL_strdup(drive); - if ( SDL_cdlist[i] == NULL ) { - SDL_OutOfMemory(); - return; - } - ++SDL_numcds; -#ifdef CDROM_DEBUG - fprintf(stderr, "Added CD-ROM drive: %s\n", drive); -#endif - } -} - -int SDL_SYS_CDInit(void) -{ - /* checklist: Drive 'A' - 'Z' */ - int i; - char drive[4]; - - /* Fill in our driver capabilities */ - SDL_CDcaps.Name = SDL_SYS_CDName; - SDL_CDcaps.Open = SDL_SYS_CDOpen; - SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; - SDL_CDcaps.Status = SDL_SYS_CDStatus; - SDL_CDcaps.Play = SDL_SYS_CDPlay; - SDL_CDcaps.Pause = SDL_SYS_CDPause; - SDL_CDcaps.Resume = SDL_SYS_CDResume; - SDL_CDcaps.Stop = SDL_SYS_CDStop; - SDL_CDcaps.Eject = SDL_SYS_CDEject; - SDL_CDcaps.Close = SDL_SYS_CDClose; - - /* Scan the system for CD-ROM drives */ - for ( i='A'; i<='Z'; ++i ) { - SDL_snprintf(drive, SDL_arraysize(drive), "%c:\\", i); - if ( GetDriveType(drive) == DRIVE_CDROM ) { - AddDrive(drive); - } - } - SDL_memset(SDL_mciID, 0, sizeof(SDL_mciID)); - return(0); -} - -/* General ioctl() CD-ROM command function */ -static int SDL_SYS_CDioctl(int id, UINT msg, DWORD flags, void *arg) -{ - MCIERROR mci_error; - - mci_error = mciSendCommand(SDL_mciID[id], msg, flags, (DWORD_PTR)arg); - if ( mci_error ) { - char error[256]; - - mciGetErrorString(mci_error, error, 256); - SDL_SetError("mciSendCommand() error: %s", error); - } - return(!mci_error ? 0 : -1); -} - -static const char *SDL_SYS_CDName(int drive) -{ - return(SDL_cdlist[drive]); -} - -static int SDL_SYS_CDOpen(int drive) -{ - MCI_OPEN_PARMS mci_open; - MCI_SET_PARMS mci_set; - char device[3]; - DWORD flags; - - /* Open the requested device */ - mci_open.lpstrDeviceType = (LPCSTR) MCI_DEVTYPE_CD_AUDIO; - device[0] = *SDL_cdlist[drive]; - device[1] = ':'; - device[2] = '\0'; - mci_open.lpstrElementName = device; - flags = - (MCI_OPEN_TYPE|MCI_OPEN_SHAREABLE|MCI_OPEN_TYPE_ID|MCI_OPEN_ELEMENT); - if ( SDL_SYS_CDioctl(0, MCI_OPEN, flags, &mci_open) < 0 ) { - flags &= ~MCI_OPEN_SHAREABLE; - if ( SDL_SYS_CDioctl(0, MCI_OPEN, flags, &mci_open) < 0 ) { - return(-1); - } - } - SDL_mciID[drive] = mci_open.wDeviceID; - - /* Set the minute-second-frame time format */ - mci_set.dwTimeFormat = MCI_FORMAT_MSF; - SDL_SYS_CDioctl(drive, MCI_SET, MCI_SET_TIME_FORMAT, &mci_set); - -#ifdef BROKEN_MCI_PAUSE - SDL_paused[drive] = 0; -#endif - return(drive); -} - -static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) -{ - MCI_STATUS_PARMS mci_status; - int i, okay; - DWORD flags; - - okay = 0; - mci_status.dwItem = MCI_STATUS_NUMBER_OF_TRACKS; - flags = MCI_STATUS_ITEM | MCI_WAIT; - if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) { - cdrom->numtracks = mci_status.dwReturn; - if ( cdrom->numtracks > SDL_MAX_TRACKS ) { - cdrom->numtracks = SDL_MAX_TRACKS; - } - /* Read all the track TOC entries */ - flags = MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT; - for ( i=0; inumtracks; ++i ) { - cdrom->track[i].id = i+1; - mci_status.dwTrack = cdrom->track[i].id; -#ifdef MCI_CDA_STATUS_TYPE_TRACK - mci_status.dwItem = MCI_CDA_STATUS_TYPE_TRACK; - if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, - &mci_status) < 0 ) { - break; - } - if ( mci_status.dwReturn == MCI_CDA_TRACK_AUDIO ) { - cdrom->track[i].type = SDL_AUDIO_TRACK; - } else { - cdrom->track[i].type = SDL_DATA_TRACK; - } -#else - cdrom->track[i].type = SDL_AUDIO_TRACK; -#endif - mci_status.dwItem = MCI_STATUS_POSITION; - if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, - &mci_status) < 0 ) { - break; - } - cdrom->track[i].offset = MSF_TO_FRAMES( - MCI_MSF_MINUTE(mci_status.dwReturn), - MCI_MSF_SECOND(mci_status.dwReturn), - MCI_MSF_FRAME(mci_status.dwReturn)); - cdrom->track[i].length = 0; - if ( i > 0 ) { - cdrom->track[i-1].length = - cdrom->track[i].offset- - cdrom->track[i-1].offset; - } - } - if ( i == cdrom->numtracks ) { - mci_status.dwTrack = cdrom->track[i - 1].id; - mci_status.dwItem = MCI_STATUS_LENGTH; - if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, - &mci_status) == 0 ) { - cdrom->track[i - 1].length = MSF_TO_FRAMES( - MCI_MSF_MINUTE(mci_status.dwReturn), - MCI_MSF_SECOND(mci_status.dwReturn), - MCI_MSF_FRAME(mci_status.dwReturn)); - /* compute lead-out offset */ - cdrom->track[i].offset = cdrom->track[i - 1].offset + - cdrom->track[i - 1].length; - cdrom->track[i].length = 0; - okay = 1; - } - } - } - return(okay ? 0 : -1); -} - -/* Get CD-ROM status */ -static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) -{ - CDstatus status; - MCI_STATUS_PARMS mci_status; - DWORD flags; - - flags = MCI_STATUS_ITEM | MCI_WAIT; - mci_status.dwItem = MCI_STATUS_MODE; - if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) < 0 ) { - status = CD_ERROR; - } else { - switch (mci_status.dwReturn) { - case MCI_MODE_NOT_READY: - case MCI_MODE_OPEN: - status = CD_TRAYEMPTY; - break; - case MCI_MODE_STOP: -#ifdef BROKEN_MCI_PAUSE - if ( SDL_paused[cdrom->id] ) { - status = CD_PAUSED; - } else { - status = CD_STOPPED; - } -#else - status = CD_STOPPED; -#endif /* BROKEN_MCI_PAUSE */ - break; - case MCI_MODE_PLAY: -#ifdef BROKEN_MCI_PAUSE - if ( SDL_paused[cdrom->id] ) { - status = CD_PAUSED; - } else { - status = CD_PLAYING; - } -#else - status = CD_PLAYING; -#endif /* BROKEN_MCI_PAUSE */ - break; - case MCI_MODE_PAUSE: - status = CD_PAUSED; - break; - default: - status = CD_ERROR; - break; - } - } - if ( position ) { - if ( status == CD_PLAYING || (status == CD_PAUSED) ) { - mci_status.dwItem = MCI_STATUS_POSITION; - if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, - &mci_status) == 0 ) { - *position = MSF_TO_FRAMES( - MCI_MSF_MINUTE(mci_status.dwReturn), - MCI_MSF_SECOND(mci_status.dwReturn), - MCI_MSF_FRAME(mci_status.dwReturn)); - } else { - *position = 0; - } - } else { - *position = 0; - } - } - return(status); -} - -/* Start play */ -static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) -{ - MCI_PLAY_PARMS mci_play; - int m, s, f; - DWORD flags; - - flags = MCI_FROM | MCI_TO | MCI_NOTIFY; - mci_play.dwCallback = 0; - FRAMES_TO_MSF(start, &m, &s, &f); - mci_play.dwFrom = MCI_MAKE_MSF(m, s, f); - FRAMES_TO_MSF(start+length, &m, &s, &f); - mci_play.dwTo = MCI_MAKE_MSF(m, s, f); - SDL_CD_end_position = mci_play.dwTo; - return(SDL_SYS_CDioctl(cdrom->id, MCI_PLAY, flags, &mci_play)); -} - -/* Pause play */ -static int SDL_SYS_CDPause(SDL_CD *cdrom) -{ -#ifdef BROKEN_MCI_PAUSE - SDL_paused[cdrom->id] = 1; -#endif - return(SDL_SYS_CDioctl(cdrom->id, MCI_PAUSE, MCI_WAIT, NULL)); -} - -/* Resume play */ -static int SDL_SYS_CDResume(SDL_CD *cdrom) -{ -#ifdef BROKEN_MCI_PAUSE - MCI_STATUS_PARMS mci_status; - int okay; - int flags; - - okay = 0; - /* Play from the current play position to the end position set earlier */ - flags = MCI_STATUS_ITEM | MCI_WAIT; - mci_status.dwItem = MCI_STATUS_POSITION; - if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) { - MCI_PLAY_PARMS mci_play; - - flags = MCI_FROM | MCI_TO | MCI_NOTIFY; - mci_play.dwCallback = 0; - mci_play.dwFrom = mci_status.dwReturn; - mci_play.dwTo = SDL_CD_end_position; - if (SDL_SYS_CDioctl(cdrom->id,MCI_PLAY,flags,&mci_play) == 0) { - okay = 1; - SDL_paused[cdrom->id] = 0; - } - } - return(okay ? 0 : -1); -#else - return(SDL_SYS_CDioctl(cdrom->id, MCI_RESUME, MCI_WAIT, NULL)); -#endif /* BROKEN_MCI_PAUSE */ -} - -/* Stop play */ -static int SDL_SYS_CDStop(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, MCI_STOP, MCI_WAIT, NULL)); -} - -/* Eject the CD-ROM */ -static int SDL_SYS_CDEject(SDL_CD *cdrom) -{ - return(SDL_SYS_CDioctl(cdrom->id, MCI_SET, MCI_SET_DOOR_OPEN, NULL)); -} - -/* Close the CD-ROM handle */ -static void SDL_SYS_CDClose(SDL_CD *cdrom) -{ - SDL_SYS_CDioctl(cdrom->id, MCI_CLOSE, MCI_WAIT, NULL); -} - -void SDL_SYS_CDQuit(void) -{ - int i; - - if ( SDL_numcds > 0 ) { - for ( i=0; i + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" +#include "SDL_stdinc.h" +#include "SDL_assert.h" +#include "SDL_log.h" + +#ifdef __ANDROID__ + +#include "SDL_system.h" +#include "SDL_android.h" +#include + +#include "../../events/SDL_events_c.h" +#include "../../video/android/SDL_androidkeyboard.h" +#include "../../video/android/SDL_androidtouch.h" +#include "../../video/android/SDL_androidvideo.h" + +#include +#include +#include +#include +#define LOG_TAG "SDL_android" +//#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +//#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#define LOGI(...) do {} while (false) +#define LOGE(...) do {} while (false) + +/* Uncomment this to log messages entering and exiting methods in this file */ +//#define DEBUG_JNI + +static void Android_JNI_ThreadDestroyed(void*); + +/******************************************************************************* + This file links the Java side of Android with libsdl +*******************************************************************************/ +#include +#include +#include + + +/******************************************************************************* + Globals +*******************************************************************************/ +static pthread_key_t mThreadKey; +static JavaVM* mJavaVM; + +// Main activity +static jclass mActivityClass; + +// method signatures +static jmethodID midCreateGLContext; +static jmethodID midDeleteGLContext; +static jmethodID midFlipBuffers; +static jmethodID midAudioInit; +static jmethodID midAudioWriteShortBuffer; +static jmethodID midAudioWriteByteBuffer; +static jmethodID midAudioQuit; + +// Accelerometer data storage +static float fLastAccelerometer[3]; +static bool bHasNewData; + +/******************************************************************************* + Functions called by JNI +*******************************************************************************/ + +// Library init +jint JNI_OnLoad(JavaVM* vm, void* reserved) +{ + JNIEnv *env; + mJavaVM = vm; + LOGI("JNI_OnLoad called"); + if ((*mJavaVM)->GetEnv(mJavaVM, (void**) &env, JNI_VERSION_1_4) != JNI_OK) { + LOGE("Failed to get the environment using GetEnv()"); + return -1; + } + /* + * Create mThreadKey so we can keep track of the JNIEnv assigned to each thread + * Refer to http://developer.android.com/guide/practices/design/jni.html for the rationale behind this + */ + if (pthread_key_create(&mThreadKey, Android_JNI_ThreadDestroyed)) { + __android_log_print(ANDROID_LOG_ERROR, "SDL", "Error initializing pthread key"); + } + else { + Android_JNI_SetupThread(); + } + + return JNI_VERSION_1_4; +} + +// Called before SDL_main() to initialize JNI bindings +void SDL_Android_Init(JNIEnv* mEnv, jclass cls) +{ + __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()"); + + Android_JNI_SetupThread(); + + mActivityClass = (jclass)((*mEnv)->NewGlobalRef(mEnv, cls)); + + midCreateGLContext = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "createGLContext","(II[I)Z"); + midDeleteGLContext = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "deleteGLContext","()V"); + midFlipBuffers = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "flipBuffers","()V"); + midAudioInit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "audioInit", "(IZZI)I"); + midAudioWriteShortBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "audioWriteShortBuffer", "([S)V"); + midAudioWriteByteBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "audioWriteByteBuffer", "([B)V"); + midAudioQuit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "audioQuit", "()V"); + + bHasNewData = false; + + if(!midCreateGLContext || !midFlipBuffers || !midAudioInit || + !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) { + __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly"); + } + __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init() finished!"); +} + +// Resize +void Java_org_libsdl_app_SDLActivity_onNativeResize( + JNIEnv* env, jclass jcls, + jint width, jint height, jint format) +{ + Android_SetScreenResolution(width, height, format); +} + +// Keydown +void Java_org_libsdl_app_SDLActivity_onNativeKeyDown( + JNIEnv* env, jclass jcls, jint keycode) +{ + Android_OnKeyDown(keycode); +} + +// Keyup +void Java_org_libsdl_app_SDLActivity_onNativeKeyUp( + JNIEnv* env, jclass jcls, jint keycode) +{ + Android_OnKeyUp(keycode); +} + +// Keyboard Focus Lost +void Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost( + JNIEnv* env, jclass jcls) +{ + /* Calling SDL_StopTextInput will take care of hiding the keyboard and cleaning up the DummyText widget */ + SDL_StopTextInput(); +} + + +// Touch +void Java_org_libsdl_app_SDLActivity_onNativeTouch( + JNIEnv* env, jclass jcls, + jint touch_device_id_in, jint pointer_finger_id_in, + jint action, jfloat x, jfloat y, jfloat p) +{ + Android_OnTouch(touch_device_id_in, pointer_finger_id_in, action, x, y, p); +} + +// Accelerometer +void Java_org_libsdl_app_SDLActivity_onNativeAccel( + JNIEnv* env, jclass jcls, + jfloat x, jfloat y, jfloat z) +{ + fLastAccelerometer[0] = x; + fLastAccelerometer[1] = y; + fLastAccelerometer[2] = z; + bHasNewData = true; +} + +// Low memory +void Java_org_libsdl_app_SDLActivity_nativeLowMemory( + JNIEnv* env, jclass cls) +{ + SDL_SendAppEvent(SDL_APP_LOWMEMORY); +} + +// Quit +void Java_org_libsdl_app_SDLActivity_nativeQuit( + JNIEnv* env, jclass cls) +{ + // Inject a SDL_QUIT event + SDL_SendQuit(); + SDL_SendAppEvent(SDL_APP_TERMINATING); +} + +// Pause +void Java_org_libsdl_app_SDLActivity_nativePause( + JNIEnv* env, jclass cls) +{ + if (Android_Window) { + /* Signal the pause semaphore so the event loop knows to pause and (optionally) block itself */ + if (!SDL_SemValue(Android_PauseSem)) SDL_SemPost(Android_PauseSem); + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_MINIMIZED, 0, 0); + } + + __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativePause()"); + SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND); + SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND); +} + +// Resume +void Java_org_libsdl_app_SDLActivity_nativeResume( + JNIEnv* env, jclass cls) +{ + __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()"); + SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND); + SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND); + + if (Android_Window) { + /* Signal the resume semaphore so the event loop knows to resume and restore the GL Context + * We can't restore the GL Context here because it needs to be done on the SDL main thread + * and this function will be called from the Java thread instead. + */ + if (!SDL_SemValue(Android_ResumeSem)) SDL_SemPost(Android_ResumeSem); + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESTORED, 0, 0); + } +} + +void Java_org_libsdl_app_SDLInputConnection_nativeCommitText( + JNIEnv* env, jclass cls, + jstring text, jint newCursorPosition) +{ + const char *utftext = (*env)->GetStringUTFChars(env, text, NULL); + + SDL_SendKeyboardText(utftext); + + (*env)->ReleaseStringUTFChars(env, text, utftext); +} + +void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText( + JNIEnv* env, jclass cls, + jstring text, jint newCursorPosition) +{ + const char *utftext = (*env)->GetStringUTFChars(env, text, NULL); + + SDL_SendEditingText(utftext, 0, 0); + + (*env)->ReleaseStringUTFChars(env, text, utftext); +} + + + +/******************************************************************************* + Functions called by SDL into Java +*******************************************************************************/ + +static int s_active = 0; +struct LocalReferenceHolder +{ + JNIEnv *m_env; + const char *m_func; +}; + +static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func) +{ + struct LocalReferenceHolder refholder; + refholder.m_env = NULL; + refholder.m_func = func; +#ifdef DEBUG_JNI + SDL_Log("Entering function %s", func); +#endif + return refholder; +} + +static SDL_bool LocalReferenceHolder_Init(struct LocalReferenceHolder *refholder, JNIEnv *env) +{ + const int capacity = 16; + if ((*env)->PushLocalFrame(env, capacity) < 0) { + SDL_SetError("Failed to allocate enough JVM local references"); + return SDL_FALSE; + } + ++s_active; + refholder->m_env = env; + return SDL_TRUE; +} + +static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder) +{ +#ifdef DEBUG_JNI + SDL_Log("Leaving function %s", refholder->m_func); +#endif + if (refholder->m_env) { + JNIEnv* env = refholder->m_env; + (*env)->PopLocalFrame(env, NULL); + --s_active; + } +} + +static SDL_bool LocalReferenceHolder_IsActive() +{ + return s_active > 0; +} + + +SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, + int red, int green, int blue, int alpha, + int buffer, int depth, int stencil, + int buffers, int samples) +{ + JNIEnv *env = Android_JNI_GetEnv(); + + jint attribs[] = { + EGL_RED_SIZE, red, + EGL_GREEN_SIZE, green, + EGL_BLUE_SIZE, blue, + EGL_ALPHA_SIZE, alpha, + EGL_BUFFER_SIZE, buffer, + EGL_DEPTH_SIZE, depth, + EGL_STENCIL_SIZE, stencil, + EGL_SAMPLE_BUFFERS, buffers, + EGL_SAMPLES, samples, + EGL_RENDERABLE_TYPE, (majorVersion == 1 ? EGL_OPENGL_ES_BIT : EGL_OPENGL_ES2_BIT), + EGL_NONE + }; + int len = SDL_arraysize(attribs); + + jintArray array; + + array = (*env)->NewIntArray(env, len); + (*env)->SetIntArrayRegion(env, array, 0, len, attribs); + + jboolean success = (*env)->CallStaticBooleanMethod(env, mActivityClass, midCreateGLContext, majorVersion, minorVersion, array); + + (*env)->DeleteLocalRef(env, array); + + return success ? SDL_TRUE : SDL_FALSE; +} + +SDL_bool Android_JNI_DeleteContext(void) +{ + /* There's only one context, so no parameter for now */ + JNIEnv *env = Android_JNI_GetEnv(); + (*env)->CallStaticVoidMethod(env, mActivityClass, midDeleteGLContext); + return SDL_TRUE; +} + +void Android_JNI_SwapWindow() +{ + JNIEnv *mEnv = Android_JNI_GetEnv(); + (*mEnv)->CallStaticVoidMethod(mEnv, mActivityClass, midFlipBuffers); +} + +void Android_JNI_SetActivityTitle(const char *title) +{ + jmethodID mid; + JNIEnv *mEnv = Android_JNI_GetEnv(); + mid = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,"setActivityTitle","(Ljava/lang/String;)Z"); + if (mid) { + jstring jtitle = (jstring)((*mEnv)->NewStringUTF(mEnv, title)); + (*mEnv)->CallStaticBooleanMethod(mEnv, mActivityClass, mid, jtitle); + (*mEnv)->DeleteLocalRef(mEnv, jtitle); + } +} + +SDL_bool Android_JNI_GetAccelerometerValues(float values[3]) +{ + int i; + SDL_bool retval = SDL_FALSE; + + if (bHasNewData) { + for (i = 0; i < 3; ++i) { + values[i] = fLastAccelerometer[i]; + } + bHasNewData = false; + retval = SDL_TRUE; + } + + return retval; +} + +static void Android_JNI_ThreadDestroyed(void* value) { + /* The thread is being destroyed, detach it from the Java VM and set the mThreadKey value to NULL as required */ + JNIEnv *env = (JNIEnv*) value; + if (env != NULL) { + (*mJavaVM)->DetachCurrentThread(mJavaVM); + pthread_setspecific(mThreadKey, NULL); + } +} + +JNIEnv* Android_JNI_GetEnv(void) { + /* From http://developer.android.com/guide/practices/jni.html + * All threads are Linux threads, scheduled by the kernel. + * They're usually started from managed code (using Thread.start), but they can also be created elsewhere and then + * attached to the JavaVM. For example, a thread started with pthread_create can be attached with the + * JNI AttachCurrentThread or AttachCurrentThreadAsDaemon functions. Until a thread is attached, it has no JNIEnv, + * and cannot make JNI calls. + * Attaching a natively-created thread causes a java.lang.Thread object to be constructed and added to the "main" + * ThreadGroup, making it visible to the debugger. Calling AttachCurrentThread on an already-attached thread + * is a no-op. + * Note: You can call this function any number of times for the same thread, there's no harm in it + */ + + JNIEnv *env; + int status = (*mJavaVM)->AttachCurrentThread(mJavaVM, &env, NULL); + if(status < 0) { + LOGE("failed to attach current thread"); + return 0; + } + + return env; +} + +int Android_JNI_SetupThread(void) { + /* From http://developer.android.com/guide/practices/jni.html + * Threads attached through JNI must call DetachCurrentThread before they exit. If coding this directly is awkward, + * in Android 2.0 (Eclair) and higher you can use pthread_key_create to define a destructor function that will be + * called before the thread exits, and call DetachCurrentThread from there. (Use that key with pthread_setspecific + * to store the JNIEnv in thread-local-storage; that way it'll be passed into your destructor as the argument.) + * Note: The destructor is not called unless the stored value is != NULL + * Note: You can call this function any number of times for the same thread, there's no harm in it + * (except for some lost CPU cycles) + */ + JNIEnv *env = Android_JNI_GetEnv(); + pthread_setspecific(mThreadKey, (void*) env); + return 1; +} + +// +// Audio support +// +static jboolean audioBuffer16Bit = JNI_FALSE; +static jboolean audioBufferStereo = JNI_FALSE; +static jobject audioBuffer = NULL; +static void* audioBufferPinned = NULL; + +int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames) +{ + int audioBufferFrames; + + JNIEnv *env = Android_JNI_GetEnv(); + + if (!env) { + LOGE("callback_handler: failed to attach current thread"); + } + Android_JNI_SetupThread(); + + __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device"); + audioBuffer16Bit = is16Bit; + audioBufferStereo = channelCount > 1; + + if ((*env)->CallStaticIntMethod(env, mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames) != 0) { + /* Error during audio initialization */ + __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: error on AudioTrack initialization!"); + return 0; + } + + /* Allocating the audio buffer from the Java side and passing it as the return value for audioInit no longer works on + * Android >= 4.2 due to a "stale global reference" error. So now we allocate this buffer directly from this side. */ + + if (is16Bit) { + jshortArray audioBufferLocal = (*env)->NewShortArray(env, desiredBufferFrames * (audioBufferStereo ? 2 : 1)); + if (audioBufferLocal) { + audioBuffer = (*env)->NewGlobalRef(env, audioBufferLocal); + (*env)->DeleteLocalRef(env, audioBufferLocal); + } + } + else { + jbyteArray audioBufferLocal = (*env)->NewByteArray(env, desiredBufferFrames * (audioBufferStereo ? 2 : 1)); + if (audioBufferLocal) { + audioBuffer = (*env)->NewGlobalRef(env, audioBufferLocal); + (*env)->DeleteLocalRef(env, audioBufferLocal); + } + } + + if (audioBuffer == NULL) { + __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: could not allocate an audio buffer!"); + return 0; + } + + jboolean isCopy = JNI_FALSE; + if (audioBuffer16Bit) { + audioBufferPinned = (*env)->GetShortArrayElements(env, (jshortArray)audioBuffer, &isCopy); + audioBufferFrames = (*env)->GetArrayLength(env, (jshortArray)audioBuffer); + } else { + audioBufferPinned = (*env)->GetByteArrayElements(env, (jbyteArray)audioBuffer, &isCopy); + audioBufferFrames = (*env)->GetArrayLength(env, (jbyteArray)audioBuffer); + } + if (audioBufferStereo) { + audioBufferFrames /= 2; + } + + return audioBufferFrames; +} + +void * Android_JNI_GetAudioBuffer() +{ + return audioBufferPinned; +} + +void Android_JNI_WriteAudioBuffer() +{ + JNIEnv *mAudioEnv = Android_JNI_GetEnv(); + + if (audioBuffer16Bit) { + (*mAudioEnv)->ReleaseShortArrayElements(mAudioEnv, (jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT); + (*mAudioEnv)->CallStaticVoidMethod(mAudioEnv, mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer); + } else { + (*mAudioEnv)->ReleaseByteArrayElements(mAudioEnv, (jbyteArray)audioBuffer, (jbyte *)audioBufferPinned, JNI_COMMIT); + (*mAudioEnv)->CallStaticVoidMethod(mAudioEnv, mActivityClass, midAudioWriteByteBuffer, (jbyteArray)audioBuffer); + } + + /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */ +} + +void Android_JNI_CloseAudioDevice() +{ + JNIEnv *env = Android_JNI_GetEnv(); + + (*env)->CallStaticVoidMethod(env, mActivityClass, midAudioQuit); + + if (audioBuffer) { + (*env)->DeleteGlobalRef(env, audioBuffer); + audioBuffer = NULL; + audioBufferPinned = NULL; + } +} + +// Test for an exception and call SDL_SetError with its detail if one occurs +// If the parameter silent is truthy then SDL_SetError() will not be called. +static bool Android_JNI_ExceptionOccurred(bool silent) +{ + SDL_assert(LocalReferenceHolder_IsActive()); + JNIEnv *mEnv = Android_JNI_GetEnv(); + + jthrowable exception = (*mEnv)->ExceptionOccurred(mEnv); + if (exception != NULL) { + jmethodID mid; + + // Until this happens most JNI operations have undefined behaviour + (*mEnv)->ExceptionClear(mEnv); + + if (!silent) { + jclass exceptionClass = (*mEnv)->GetObjectClass(mEnv, exception); + jclass classClass = (*mEnv)->FindClass(mEnv, "java/lang/Class"); + + mid = (*mEnv)->GetMethodID(mEnv, classClass, "getName", "()Ljava/lang/String;"); + jstring exceptionName = (jstring)(*mEnv)->CallObjectMethod(mEnv, exceptionClass, mid); + const char* exceptionNameUTF8 = (*mEnv)->GetStringUTFChars(mEnv, exceptionName, 0); + + mid = (*mEnv)->GetMethodID(mEnv, exceptionClass, "getMessage", "()Ljava/lang/String;"); + jstring exceptionMessage = (jstring)(*mEnv)->CallObjectMethod(mEnv, exception, mid); + + if (exceptionMessage != NULL) { + const char* exceptionMessageUTF8 = (*mEnv)->GetStringUTFChars(mEnv, exceptionMessage, 0); + SDL_SetError("%s: %s", exceptionNameUTF8, exceptionMessageUTF8); + (*mEnv)->ReleaseStringUTFChars(mEnv, exceptionMessage, exceptionMessageUTF8); + } else { + SDL_SetError("%s", exceptionNameUTF8); + } + + (*mEnv)->ReleaseStringUTFChars(mEnv, exceptionName, exceptionNameUTF8); + } + + return true; + } + + return false; +} + +static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx) +{ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + + int result = 0; + + jmethodID mid; + jobject context; + jobject assetManager; + jobject inputStream; + jclass channels; + jobject readableByteChannel; + jstring fileNameJString; + jobject fd; + jclass fdCls; + jfieldID descriptor; + + JNIEnv *mEnv = Android_JNI_GetEnv(); + if (!LocalReferenceHolder_Init(&refs, mEnv)) { + goto failure; + } + + fileNameJString = (jstring)ctx->hidden.androidio.fileNameRef; + ctx->hidden.androidio.position = 0; + + // context = SDLActivity.getContext(); + mid = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass, + "getContext","()Landroid/content/Context;"); + context = (*mEnv)->CallStaticObjectMethod(mEnv, mActivityClass, mid); + + + // assetManager = context.getAssets(); + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, context), + "getAssets", "()Landroid/content/res/AssetManager;"); + assetManager = (*mEnv)->CallObjectMethod(mEnv, context, mid); + + /* First let's try opening the file to obtain an AssetFileDescriptor. + * This method reads the files directly from the APKs using standard *nix calls + */ + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager), "openFd", "(Ljava/lang/String;)Landroid/content/res/AssetFileDescriptor;"); + inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString); + if (Android_JNI_ExceptionOccurred(true)) { + goto fallback; + } + + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getStartOffset", "()J"); + ctx->hidden.androidio.offset = (*mEnv)->CallLongMethod(mEnv, inputStream, mid); + if (Android_JNI_ExceptionOccurred(true)) { + goto fallback; + } + + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getDeclaredLength", "()J"); + ctx->hidden.androidio.size = (*mEnv)->CallLongMethod(mEnv, inputStream, mid); + if (Android_JNI_ExceptionOccurred(true)) { + goto fallback; + } + + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getFileDescriptor", "()Ljava/io/FileDescriptor;"); + fd = (*mEnv)->CallObjectMethod(mEnv, inputStream, mid); + fdCls = (*mEnv)->GetObjectClass(mEnv, fd); + descriptor = (*mEnv)->GetFieldID(mEnv, fdCls, "descriptor", "I"); + ctx->hidden.androidio.fd = (*mEnv)->GetIntField(mEnv, fd, descriptor); + ctx->hidden.androidio.assetFileDescriptorRef = (*mEnv)->NewGlobalRef(mEnv, inputStream); + + // Seek to the correct offset in the file. + lseek(ctx->hidden.androidio.fd, (off_t)ctx->hidden.androidio.offset, SEEK_SET); + + if (false) { +fallback: + // Disabled log message because of spam on the Nexus 7 + //__android_log_print(ANDROID_LOG_DEBUG, "SDL", "Falling back to legacy InputStream method for opening file"); + + /* Try the old method using InputStream */ + ctx->hidden.androidio.assetFileDescriptorRef = NULL; + + // inputStream = assetManager.open(); + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager), + "open", "(Ljava/lang/String;I)Ljava/io/InputStream;"); + inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /*ACCESS_RANDOM*/); + if (Android_JNI_ExceptionOccurred(false)) { + goto failure; + } + + ctx->hidden.androidio.inputStreamRef = (*mEnv)->NewGlobalRef(mEnv, inputStream); + + // Despite all the visible documentation on [Asset]InputStream claiming + // that the .available() method is not guaranteed to return the entire file + // size, comments in /samples//ApiDemos/src/com/example/ ... + // android/apis/content/ReadAsset.java imply that Android's + // AssetInputStream.available() /will/ always return the total file size + + // size = inputStream.available(); + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), + "available", "()I"); + ctx->hidden.androidio.size = (long)(*mEnv)->CallIntMethod(mEnv, inputStream, mid); + if (Android_JNI_ExceptionOccurred(false)) { + goto failure; + } + + // readableByteChannel = Channels.newChannel(inputStream); + channels = (*mEnv)->FindClass(mEnv, "java/nio/channels/Channels"); + mid = (*mEnv)->GetStaticMethodID(mEnv, channels, + "newChannel", + "(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;"); + readableByteChannel = (*mEnv)->CallStaticObjectMethod( + mEnv, channels, mid, inputStream); + if (Android_JNI_ExceptionOccurred(false)) { + goto failure; + } + + ctx->hidden.androidio.readableByteChannelRef = + (*mEnv)->NewGlobalRef(mEnv, readableByteChannel); + + // Store .read id for reading purposes + mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, readableByteChannel), + "read", "(Ljava/nio/ByteBuffer;)I"); + ctx->hidden.androidio.readMethod = mid; + } + + if (false) { +failure: + result = -1; + + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.fileNameRef); + + if(ctx->hidden.androidio.inputStreamRef != NULL) { + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.inputStreamRef); + } + + if(ctx->hidden.androidio.readableByteChannelRef != NULL) { + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.readableByteChannelRef); + } + + if(ctx->hidden.androidio.assetFileDescriptorRef != NULL) { + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.assetFileDescriptorRef); + } + + } + + LocalReferenceHolder_Cleanup(&refs); + return result; +} + +int Android_JNI_FileOpen(SDL_RWops* ctx, + const char* fileName, const char* mode) +{ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + JNIEnv *mEnv = Android_JNI_GetEnv(); + int retval; + + if (!LocalReferenceHolder_Init(&refs, mEnv)) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + + if (!ctx) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + + jstring fileNameJString = (*mEnv)->NewStringUTF(mEnv, fileName); + ctx->hidden.androidio.fileNameRef = (*mEnv)->NewGlobalRef(mEnv, fileNameJString); + ctx->hidden.androidio.inputStreamRef = NULL; + ctx->hidden.androidio.readableByteChannelRef = NULL; + ctx->hidden.androidio.readMethod = NULL; + ctx->hidden.androidio.assetFileDescriptorRef = NULL; + + retval = Internal_Android_JNI_FileOpen(ctx); + LocalReferenceHolder_Cleanup(&refs); + return retval; +} + +size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, + size_t size, size_t maxnum) +{ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + + if (ctx->hidden.androidio.assetFileDescriptorRef) { + size_t bytesMax = size * maxnum; + if (ctx->hidden.androidio.size != -1 /*UNKNOWN_LENGTH*/ && ctx->hidden.androidio.position + bytesMax > ctx->hidden.androidio.size) { + bytesMax = ctx->hidden.androidio.size - ctx->hidden.androidio.position; + } + size_t result = read(ctx->hidden.androidio.fd, buffer, bytesMax ); + if (result > 0) { + ctx->hidden.androidio.position += result; + LocalReferenceHolder_Cleanup(&refs); + return result / size; + } + LocalReferenceHolder_Cleanup(&refs); + return 0; + } else { + jlong bytesRemaining = (jlong) (size * maxnum); + jlong bytesMax = (jlong) (ctx->hidden.androidio.size - ctx->hidden.androidio.position); + int bytesRead = 0; + + /* Don't read more bytes than those that remain in the file, otherwise we get an exception */ + if (bytesRemaining > bytesMax) bytesRemaining = bytesMax; + + JNIEnv *mEnv = Android_JNI_GetEnv(); + if (!LocalReferenceHolder_Init(&refs, mEnv)) { + LocalReferenceHolder_Cleanup(&refs); + return 0; + } + + jobject readableByteChannel = (jobject)ctx->hidden.androidio.readableByteChannelRef; + jmethodID readMethod = (jmethodID)ctx->hidden.androidio.readMethod; + jobject byteBuffer = (*mEnv)->NewDirectByteBuffer(mEnv, buffer, bytesRemaining); + + while (bytesRemaining > 0) { + // result = readableByteChannel.read(...); + int result = (*mEnv)->CallIntMethod(mEnv, readableByteChannel, readMethod, byteBuffer); + + if (Android_JNI_ExceptionOccurred(false)) { + LocalReferenceHolder_Cleanup(&refs); + return 0; + } + + if (result < 0) { + break; + } + + bytesRemaining -= result; + bytesRead += result; + ctx->hidden.androidio.position += result; + } + LocalReferenceHolder_Cleanup(&refs); + return bytesRead / size; + } +} + +size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer, + size_t size, size_t num) +{ + SDL_SetError("Cannot write to Android package filesystem"); + return 0; +} + +static int Internal_Android_JNI_FileClose(SDL_RWops* ctx, bool release) +{ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + + int result = 0; + JNIEnv *mEnv = Android_JNI_GetEnv(); + + if (!LocalReferenceHolder_Init(&refs, mEnv)) { + LocalReferenceHolder_Cleanup(&refs); + return SDL_SetError("Failed to allocate enough JVM local references"); + } + + if (ctx) { + if (release) { + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.fileNameRef); + } + + if (ctx->hidden.androidio.assetFileDescriptorRef) { + jobject inputStream = (jobject)ctx->hidden.androidio.assetFileDescriptorRef; + jmethodID mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), + "close", "()V"); + (*mEnv)->CallVoidMethod(mEnv, inputStream, mid); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.assetFileDescriptorRef); + if (Android_JNI_ExceptionOccurred(false)) { + result = -1; + } + } + else { + jobject inputStream = (jobject)ctx->hidden.androidio.inputStreamRef; + + // inputStream.close(); + jmethodID mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), + "close", "()V"); + (*mEnv)->CallVoidMethod(mEnv, inputStream, mid); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.inputStreamRef); + (*mEnv)->DeleteGlobalRef(mEnv, (jobject)ctx->hidden.androidio.readableByteChannelRef); + if (Android_JNI_ExceptionOccurred(false)) { + result = -1; + } + } + + if (release) { + SDL_FreeRW(ctx); + } + } + + LocalReferenceHolder_Cleanup(&refs); + return result; +} + + +Sint64 Android_JNI_FileSize(SDL_RWops* ctx) +{ + return ctx->hidden.androidio.size; +} + +Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence) +{ + if (ctx->hidden.androidio.assetFileDescriptorRef) { + switch (whence) { + case RW_SEEK_SET: + if (ctx->hidden.androidio.size != -1 /*UNKNOWN_LENGTH*/ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size; + offset += ctx->hidden.androidio.offset; + break; + case RW_SEEK_CUR: + offset += ctx->hidden.androidio.position; + if (ctx->hidden.androidio.size != -1 /*UNKNOWN_LENGTH*/ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size; + offset += ctx->hidden.androidio.offset; + break; + case RW_SEEK_END: + offset = ctx->hidden.androidio.offset + ctx->hidden.androidio.size + offset; + break; + default: + return SDL_SetError("Unknown value for 'whence'"); + } + whence = SEEK_SET; + + off_t ret = lseek(ctx->hidden.androidio.fd, (off_t)offset, SEEK_SET); + if (ret == -1) return -1; + ctx->hidden.androidio.position = ret - ctx->hidden.androidio.offset; + } else { + Sint64 newPosition; + + switch (whence) { + case RW_SEEK_SET: + newPosition = offset; + break; + case RW_SEEK_CUR: + newPosition = ctx->hidden.androidio.position + offset; + break; + case RW_SEEK_END: + newPosition = ctx->hidden.androidio.size + offset; + break; + default: + return SDL_SetError("Unknown value for 'whence'"); + } + + /* Validate the new position */ + if (newPosition < 0) { + return SDL_Error(SDL_EFSEEK); + } + if (newPosition > ctx->hidden.androidio.size) { + newPosition = ctx->hidden.androidio.size; + } + + Sint64 movement = newPosition - ctx->hidden.androidio.position; + if (movement > 0) { + unsigned char buffer[4096]; + + // The easy case where we're seeking forwards + while (movement > 0) { + Sint64 amount = sizeof (buffer); + if (amount > movement) { + amount = movement; + } + size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount); + if (result <= 0) { + // Failed to read/skip the required amount, so fail + return -1; + } + + movement -= result; + } + + } else if (movement < 0) { + // We can't seek backwards so we have to reopen the file and seek + // forwards which obviously isn't very efficient + Internal_Android_JNI_FileClose(ctx, false); + Internal_Android_JNI_FileOpen(ctx); + Android_JNI_FileSeek(ctx, newPosition, RW_SEEK_SET); + } + } + + return ctx->hidden.androidio.position; + +} + +int Android_JNI_FileClose(SDL_RWops* ctx) +{ + return Internal_Android_JNI_FileClose(ctx, true); +} + +// returns a new global reference which needs to be released later +static jobject Android_JNI_GetSystemServiceObject(const char* name) +{ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + JNIEnv* env = Android_JNI_GetEnv(); + jobject retval = NULL; + + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } + + jstring service = (*env)->NewStringUTF(env, name); + + jmethodID mid; + + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;"); + jobject context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); + + mid = (*env)->GetMethodID(env, mActivityClass, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;"); + jobject manager = (*env)->CallObjectMethod(env, context, mid, service); + + (*env)->DeleteLocalRef(env, service); + + retval = manager ? (*env)->NewGlobalRef(env, manager) : NULL; + LocalReferenceHolder_Cleanup(&refs); + return retval; +} + +#define SETUP_CLIPBOARD(error) \ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); \ + JNIEnv* env = Android_JNI_GetEnv(); \ + if (!LocalReferenceHolder_Init(&refs, env)) { \ + LocalReferenceHolder_Cleanup(&refs); \ + return error; \ + } \ + jobject clipboard = Android_JNI_GetSystemServiceObject("clipboard"); \ + if (!clipboard) { \ + LocalReferenceHolder_Cleanup(&refs); \ + return error; \ + } + +#define CLEANUP_CLIPBOARD() \ + LocalReferenceHolder_Cleanup(&refs); + +int Android_JNI_SetClipboardText(const char* text) +{ + SETUP_CLIPBOARD(-1) + + jmethodID mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, clipboard), "setText", "(Ljava/lang/CharSequence;)V"); + jstring string = (*env)->NewStringUTF(env, text); + (*env)->CallVoidMethod(env, clipboard, mid, string); + (*env)->DeleteGlobalRef(env, clipboard); + (*env)->DeleteLocalRef(env, string); + + CLEANUP_CLIPBOARD(); + + return 0; +} + +char* Android_JNI_GetClipboardText() +{ + SETUP_CLIPBOARD(SDL_strdup("")) + + jmethodID mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, clipboard), "getText", "()Ljava/lang/CharSequence;"); + jobject sequence = (*env)->CallObjectMethod(env, clipboard, mid); + (*env)->DeleteGlobalRef(env, clipboard); + if (sequence) { + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, sequence), "toString", "()Ljava/lang/String;"); + jstring string = (jstring)((*env)->CallObjectMethod(env, sequence, mid)); + const char* utf = (*env)->GetStringUTFChars(env, string, 0); + if (utf) { + char* text = SDL_strdup(utf); + (*env)->ReleaseStringUTFChars(env, string, utf); + + CLEANUP_CLIPBOARD(); + + return text; + } + } + + CLEANUP_CLIPBOARD(); + + return SDL_strdup(""); +} + +SDL_bool Android_JNI_HasClipboardText() +{ + SETUP_CLIPBOARD(SDL_FALSE) + + jmethodID mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, clipboard), "hasText", "()Z"); + jboolean has = (*env)->CallBooleanMethod(env, clipboard, mid); + (*env)->DeleteGlobalRef(env, clipboard); + + CLEANUP_CLIPBOARD(); + + return has ? SDL_TRUE : SDL_FALSE; +} + + +// returns 0 on success or -1 on error (others undefined then) +// returns truthy or falsy value in plugged, charged and battery +// returns the value in seconds and percent or -1 if not available +int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent) +{ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + JNIEnv* env = Android_JNI_GetEnv(); + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + + jmethodID mid; + + mid = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;"); + jobject context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); + + jstring action = (*env)->NewStringUTF(env, "android.intent.action.BATTERY_CHANGED"); + + jclass cls = (*env)->FindClass(env, "android/content/IntentFilter"); + + mid = (*env)->GetMethodID(env, cls, "", "(Ljava/lang/String;)V"); + jobject filter = (*env)->NewObject(env, cls, mid, action); + + (*env)->DeleteLocalRef(env, action); + + mid = (*env)->GetMethodID(env, mActivityClass, "registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;"); + jobject intent = (*env)->CallObjectMethod(env, context, mid, NULL, filter); + + (*env)->DeleteLocalRef(env, filter); + + cls = (*env)->GetObjectClass(env, intent); + + jstring iname; + jmethodID imid = (*env)->GetMethodID(env, cls, "getIntExtra", "(Ljava/lang/String;I)I"); + +#define GET_INT_EXTRA(var, key) \ + iname = (*env)->NewStringUTF(env, key); \ + int var = (*env)->CallIntMethod(env, intent, imid, iname, -1); \ + (*env)->DeleteLocalRef(env, iname); + + jstring bname; + jmethodID bmid = (*env)->GetMethodID(env, cls, "getBooleanExtra", "(Ljava/lang/String;Z)Z"); + +#define GET_BOOL_EXTRA(var, key) \ + bname = (*env)->NewStringUTF(env, key); \ + int var = (*env)->CallBooleanMethod(env, intent, bmid, bname, JNI_FALSE); \ + (*env)->DeleteLocalRef(env, bname); + + if (plugged) { + GET_INT_EXTRA(plug, "plugged") // == BatteryManager.EXTRA_PLUGGED (API 5) + if (plug == -1) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + // 1 == BatteryManager.BATTERY_PLUGGED_AC + // 2 == BatteryManager.BATTERY_PLUGGED_USB + *plugged = (0 < plug) ? 1 : 0; + } + + if (charged) { + GET_INT_EXTRA(status, "status") // == BatteryManager.EXTRA_STATUS (API 5) + if (status == -1) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + // 5 == BatteryManager.BATTERY_STATUS_FULL + *charged = (status == 5) ? 1 : 0; + } + + if (battery) { + GET_BOOL_EXTRA(present, "present") // == BatteryManager.EXTRA_PRESENT (API 5) + *battery = present ? 1 : 0; + } + + if (seconds) { + *seconds = -1; // not possible + } + + if (percent) { + GET_INT_EXTRA(level, "level") // == BatteryManager.EXTRA_LEVEL (API 5) + GET_INT_EXTRA(scale, "scale") // == BatteryManager.EXTRA_SCALE (API 5) + if ((level == -1) || (scale == -1)) { + LocalReferenceHolder_Cleanup(&refs); + return -1; + } + *percent = level * 100 / scale; + } + + (*env)->DeleteLocalRef(env, intent); + + LocalReferenceHolder_Cleanup(&refs); + return 0; +} + +// sends message to be handled on the UI event dispatch thread +int Android_JNI_SendMessage(int command, int param) +{ + JNIEnv *env = Android_JNI_GetEnv(); + if (!env) { + return -1; + } + jmethodID mid = (*env)->GetStaticMethodID(env, mActivityClass, "sendMessage", "(II)Z"); + if (!mid) { + return -1; + } + jboolean success = (*env)->CallStaticBooleanMethod(env, mActivityClass, mid, command, param); + return success ? 0 : -1; +} + +void Android_JNI_ShowTextInput(SDL_Rect *inputRect) +{ + JNIEnv *env = Android_JNI_GetEnv(); + if (!env) { + return; + } + + jmethodID mid = (*env)->GetStaticMethodID(env, mActivityClass, "showTextInput", "(IIII)Z"); + if (!mid) { + return; + } + (*env)->CallStaticBooleanMethod(env, mActivityClass, mid, + inputRect->x, + inputRect->y, + inputRect->w, + inputRect->h ); +} + +void Android_JNI_HideTextInput() +{ + // has to match Activity constant + const int COMMAND_TEXTEDIT_HIDE = 3; + Android_JNI_SendMessage(COMMAND_TEXTEDIT_HIDE, 0); +} + +////////////////////////////////////////////////////////////////////////////// +// +// Functions exposed to SDL applications in SDL_system.h +// + +void *SDL_AndroidGetJNIEnv() +{ + return Android_JNI_GetEnv(); +} + + + +void *SDL_AndroidGetActivity() +{ + /* See SDL_system.h for caveats on using this function. */ + + jmethodID mid; + + JNIEnv *env = Android_JNI_GetEnv(); + if (!env) { + return NULL; + } + + // return SDLActivity.getContext(); + mid = (*env)->GetStaticMethodID(env, mActivityClass, + "getContext","()Landroid/content/Context;"); + return (*env)->CallStaticObjectMethod(env, mActivityClass, mid); +} + +const char * SDL_AndroidGetInternalStoragePath() +{ + static char *s_AndroidInternalFilesPath = NULL; + + if (!s_AndroidInternalFilesPath) { + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + jmethodID mid; + jobject context; + jobject fileObject; + jstring pathString; + const char *path; + + JNIEnv *env = Android_JNI_GetEnv(); + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } + + // context = SDLActivity.getContext(); + mid = (*env)->GetStaticMethodID(env, mActivityClass, + "getContext","()Landroid/content/Context;"); + context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); + + // fileObj = context.getFilesDir(); + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), + "getFilesDir", "()Ljava/io/File;"); + fileObject = (*env)->CallObjectMethod(env, context, mid); + if (!fileObject) { + SDL_SetError("Couldn't get internal directory"); + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } + + // path = fileObject.getAbsolutePath(); + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), + "getAbsolutePath", "()Ljava/lang/String;"); + pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); + + path = (*env)->GetStringUTFChars(env, pathString, NULL); + s_AndroidInternalFilesPath = SDL_strdup(path); + (*env)->ReleaseStringUTFChars(env, pathString, path); + + LocalReferenceHolder_Cleanup(&refs); + } + return s_AndroidInternalFilesPath; +} + +int SDL_AndroidGetExternalStorageState() +{ + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + jmethodID mid; + jclass cls; + jstring stateString; + const char *state; + int stateFlags; + + JNIEnv *env = Android_JNI_GetEnv(); + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); + return 0; + } + + cls = (*env)->FindClass(env, "android/os/Environment"); + mid = (*env)->GetStaticMethodID(env, cls, + "getExternalStorageState", "()Ljava/lang/String;"); + stateString = (jstring)(*env)->CallStaticObjectMethod(env, cls, mid); + + state = (*env)->GetStringUTFChars(env, stateString, NULL); + + // Print an info message so people debugging know the storage state + __android_log_print(ANDROID_LOG_INFO, "SDL", "external storage state: %s", state); + + if (SDL_strcmp(state, "mounted") == 0) { + stateFlags = SDL_ANDROID_EXTERNAL_STORAGE_READ | + SDL_ANDROID_EXTERNAL_STORAGE_WRITE; + } else if (SDL_strcmp(state, "mounted_ro") == 0) { + stateFlags = SDL_ANDROID_EXTERNAL_STORAGE_READ; + } else { + stateFlags = 0; + } + (*env)->ReleaseStringUTFChars(env, stateString, state); + + LocalReferenceHolder_Cleanup(&refs); + return stateFlags; +} + +const char * SDL_AndroidGetExternalStoragePath() +{ + static char *s_AndroidExternalFilesPath = NULL; + + if (!s_AndroidExternalFilesPath) { + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + jmethodID mid; + jobject context; + jobject fileObject; + jstring pathString; + const char *path; + + JNIEnv *env = Android_JNI_GetEnv(); + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } + + // context = SDLActivity.getContext(); + mid = (*env)->GetStaticMethodID(env, mActivityClass, + "getContext","()Landroid/content/Context;"); + context = (*env)->CallStaticObjectMethod(env, mActivityClass, mid); + + // fileObj = context.getExternalFilesDir(); + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), + "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;"); + fileObject = (*env)->CallObjectMethod(env, context, mid, NULL); + if (!fileObject) { + SDL_SetError("Couldn't get external directory"); + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } + + // path = fileObject.getAbsolutePath(); + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), + "getAbsolutePath", "()Ljava/lang/String;"); + pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); + + path = (*env)->GetStringUTFChars(env, pathString, NULL); + s_AndroidExternalFilesPath = SDL_strdup(path); + (*env)->ReleaseStringUTFChars(env, pathString, path); + + LocalReferenceHolder_Cleanup(&refs); + } + return s_AndroidExternalFilesPath; +} + +#endif /* __ANDROID__ */ + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/src/core/android/SDL_android.h b/src/core/android/SDL_android.h new file mode 100644 index 0000000000..973f5881fa --- /dev/null +++ b/src/core/android/SDL_android.h @@ -0,0 +1,79 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +#include "SDL_rect.h" + +/* Interface from the SDL library into the Android Java activity */ +extern SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, int red, int green, int blue, int alpha, int buffer, int depth, int stencil, int buffers, int samples); +extern SDL_bool Android_JNI_DeleteContext(void); +extern void Android_JNI_SwapWindow(); +extern void Android_JNI_SetActivityTitle(const char *title); +extern SDL_bool Android_JNI_GetAccelerometerValues(float values[3]); +extern void Android_JNI_ShowTextInput(SDL_Rect *inputRect); +extern void Android_JNI_HideTextInput(); + +/* Audio support */ +extern int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames); +extern void* Android_JNI_GetAudioBuffer(); +extern void Android_JNI_WriteAudioBuffer(); +extern void Android_JNI_CloseAudioDevice(); + +#include "SDL_rwops.h" + +int Android_JNI_FileOpen(SDL_RWops* ctx, const char* fileName, const char* mode); +Sint64 Android_JNI_FileSize(SDL_RWops* ctx); +Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence); +size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, size_t size, size_t maxnum); +size_t Android_JNI_FileWrite(SDL_RWops* ctx, const void* buffer, size_t size, size_t num); +int Android_JNI_FileClose(SDL_RWops* ctx); + +/* Clipboard support */ +int Android_JNI_SetClipboardText(const char* text); +char* Android_JNI_GetClipboardText(); +SDL_bool Android_JNI_HasClipboardText(); + +/* Power support */ +int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent); + +/* Threads */ +#include +JNIEnv *Android_JNI_GetEnv(void); +int Android_JNI_SetupThread(void); + +/* Generic messages */ +int Android_JNI_SendMessage(int command, int param); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/windows/SDL_windows.c b/src/core/windows/SDL_windows.c new file mode 100644 index 0000000000..e69d257939 --- /dev/null +++ b/src/core/windows/SDL_windows.c @@ -0,0 +1,67 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef __WIN32__ + +#include "SDL_error.h" +#include "SDL_windows.h" +#include "SDL_assert.h" + +#include /* for CoInitialize/CoUninitialize */ + +/* Sets an error message based on GetLastError() */ +int +WIN_SetError(const char *prefix) +{ + TCHAR buffer[1024]; + char *message; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, + buffer, SDL_arraysize(buffer), NULL); + message = WIN_StringToUTF8(buffer); + SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message); + SDL_free(message); + return -1; +} + +HRESULT +WIN_CoInitialize(void) +{ + const HRESULT hr = CoInitialize(NULL); + + /* S_FALSE means success, but someone else already initialized. */ + /* You still need to call CoUninitialize in this case! */ + if (hr == S_FALSE) { + return S_OK; + } + + return hr; +} + +void +WIN_CoUninitialize(void) +{ + CoUninitialize(); +} + +#endif /* __WIN32__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/windows/SDL_windows.h b/src/core/windows/SDL_windows.h new file mode 100644 index 0000000000..440c387d31 --- /dev/null +++ b/src/core/windows/SDL_windows.h @@ -0,0 +1,55 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* This is an include file for windows.h with the SDL build settings */ + +#ifndef _INCLUDED_WINDOWS_H +#define _INCLUDED_WINDOWS_H + +#define WIN32_LEAN_AND_MEAN +#define STRICT +#ifndef UNICODE +#define UNICODE 1 +#endif +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */ + +#include + +/* Routines to convert from UTF8 to native Windows text */ +#if UNICODE +#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR)) +#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", (char *)(S), SDL_strlen(S)+1) +#else +#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1)) +#define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1) +#endif + +/* Sets an error message based on GetLastError(). Always return -1. */ +extern int WIN_SetError(const char *prefix); + +/* Wrap up the oddities of CoInitialize() into a common function. */ +extern HRESULT WIN_CoInitialize(void); +extern void WIN_CoUninitialize(void); + +#endif /* _INCLUDED_WINDOWS_H */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 0cd083896c..30549852d5 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -1,63 +1,79 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* CPU feature detection for SDL */ -#include "SDL.h" #include "SDL_cpuinfo.h" +#ifdef HAVE_SYSCONF +#include +#endif +#ifdef HAVE_SYSCTLBYNAME +#include +#include +#endif #if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__)) +#include /* For AltiVec check */ +#elif defined(__OpenBSD__) && defined(__powerpc__) +#include #include /* For AltiVec check */ +#include #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP #include #include #endif +#ifdef __WIN32__ +#include "../core/windows/SDL_windows.h" +#endif -#define CPU_HAS_RDTSC 0x00000001 -#define CPU_HAS_MMX 0x00000002 -#define CPU_HAS_MMXEXT 0x00000004 -#define CPU_HAS_3DNOW 0x00000010 -#define CPU_HAS_3DNOWEXT 0x00000020 -#define CPU_HAS_SSE 0x00000040 -#define CPU_HAS_SSE2 0x00000080 -#define CPU_HAS_ALTIVEC 0x00000100 - -#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ +#define CPU_HAS_RDTSC 0x00000001 +#define CPU_HAS_ALTIVEC 0x00000002 +#define CPU_HAS_MMX 0x00000004 +#define CPU_HAS_3DNOW 0x00000008 +#define CPU_HAS_SSE 0x00000010 +#define CPU_HAS_SSE2 0x00000020 +#define CPU_HAS_SSE3 0x00000040 +#define CPU_HAS_SSE41 0x00000100 +#define CPU_HAS_SSE42 0x00000200 + +#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__ /* This is the brute force way of detecting instruction sets... the idea is borrowed from the libmpeg2 library - thanks! */ static jmp_buf jmpbuf; -static void illegal_instruction(int sig) +static void +illegal_instruction(int sig) { - longjmp(jmpbuf, 1); + longjmp(jmpbuf, 1); } #endif /* HAVE_SETJMP */ -static __inline__ int CPU_haveCPUID(void) +static __inline__ int +CPU_haveCPUID(void) { - int has_CPUID = 0; + int has_CPUID = 0; +/* *INDENT-OFF* */ #if defined(__GNUC__) && defined(i386) - __asm__ ( + __asm__ ( " pushfl # Get original EFLAGS \n" " popl %%eax \n" " movl %%eax,%%ecx \n" @@ -70,14 +86,14 @@ static __inline__ int CPU_haveCPUID(void) " jz 1f # Processor=80486 \n" " movl $1,%0 # We have CPUID support \n" "1: \n" - : "=m" (has_CPUID) - : - : "%eax", "%ecx" - ); + : "=m" (has_CPUID) + : + : "%eax", "%ecx" + ); #elif defined(__GNUC__) && defined(__x86_64__) /* Technically, if this is being compiled under __x86_64__ then it has CPUid by definition. But it's nice to be able to prove it. :) */ - __asm__ ( + __asm__ ( " pushfq # Get original EFLAGS \n" " popq %%rax \n" " movq %%rax,%%rcx \n" @@ -90,12 +106,12 @@ CPUid by definition. But it's nice to be able to prove it. :) */ " jz 1f # Processor=80486 \n" " movl $1,%0 # We have CPUID support \n" "1: \n" - : "=m" (has_CPUID) - : - : "%rax", "%rcx" - ); + : "=m" (has_CPUID) + : + : "%rax", "%rcx" + ); #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) - __asm { + __asm { pushfd ; Get original EFLAGS pop eax mov ecx, eax @@ -108,24 +124,24 @@ CPUid by definition. But it's nice to be able to prove it. :) */ jz done ; Processor=80486 mov has_CPUID,1 ; We have CPUID support done: - } + } #elif defined(__sun) && defined(__i386) - __asm ( + __asm ( +" pushfl \n" +" popl %eax \n" +" movl %eax,%ecx \n" +" xorl $0x200000,%eax \n" +" pushl %eax \n" +" popfl \n" " pushfl \n" -" popl %eax \n" -" movl %eax,%ecx \n" -" xorl $0x200000,%eax \n" -" pushl %eax \n" -" popfl \n" -" pushfl \n" -" popl %eax \n" -" xorl %ecx,%eax \n" -" jz 1f \n" -" movl $1,-8(%ebp) \n" +" popl %eax \n" +" xorl %ecx,%eax \n" +" jz 1f \n" +" movl $1,-8(%ebp) \n" "1: \n" - ); + ); #elif defined(__sun) && defined(__amd64) - __asm ( + __asm ( " pushfq \n" " popq %rax \n" " movq %rax,%rcx \n" @@ -138,362 +154,482 @@ CPUid by definition. But it's nice to be able to prove it. :) */ " jz 1f \n" " movl $1,-8(%rbp) \n" "1: \n" - ); + ); #endif - return has_CPUID; +/* *INDENT-ON* */ + return has_CPUID; } -static __inline__ int CPU_getCPUIDFeatures(void) -{ - int features = 0; #if defined(__GNUC__) && defined(i386) - __asm__ ( -" xorl %%eax,%%eax # Set up for CPUID instruction \n" -" pushl %%ebx \n" -" cpuid # Get and save vendor ID \n" -" popl %%ebx \n" -" cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n" -" jl 1f # We dont have the CPUID instruction\n" -" xorl %%eax,%%eax \n" -" incl %%eax \n" -" pushl %%ebx \n" -" cpuid # Get family/model/stepping/features\n" -" popl %%ebx \n" -" movl %%edx,%0 \n" -"1: \n" - : "=m" (features) - : - : "%eax", "%ecx", "%edx" - ); +#define cpuid(func, a, b, c, d) \ + __asm__ __volatile__ ( \ +" pushl %%ebx \n" \ +" cpuid \n" \ +" movl %%ebx, %%esi \n" \ +" popl %%ebx \n" : \ + "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func)) #elif defined(__GNUC__) && defined(__x86_64__) - __asm__ ( -" xorl %%eax,%%eax # Set up for CPUID instruction \n" -" pushq %%rbx \n" -" cpuid # Get and save vendor ID \n" -" popq %%rbx \n" -" cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n" -" jl 1f # We dont have the CPUID instruction\n" -" xorl %%eax,%%eax \n" -" incl %%eax \n" -" pushq %%rbx \n" -" cpuid # Get family/model/stepping/features\n" -" popq %%rbx \n" -" movl %%edx,%0 \n" -"1: \n" - : "=m" (features) - : - : "%rax", "%rcx", "%rdx" - ); +#define cpuid(func, a, b, c, d) \ + __asm__ __volatile__ ( \ +" pushq %%rbx \n" \ +" cpuid \n" \ +" movq %%rbx, %%rsi \n" \ +" popq %%rbx \n" : \ + "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func)) #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) - __asm { - xor eax, eax ; Set up for CPUID instruction - push ebx - cpuid ; Get and save vendor ID - pop ebx - cmp eax, 1 ; Make sure 1 is valid input for CPUID - jl done ; We dont have the CPUID instruction - xor eax, eax - inc eax - push ebx - cpuid ; Get family/model/stepping/features - pop ebx - mov features, edx -done: - } -#elif defined(__sun) && (defined(__i386) || defined(__amd64)) - __asm( -" xorl %eax,%eax \n" -" pushl %ebx \n" -" cpuid \n" -" popl %ebx \n" -" cmpl $1,%eax \n" -" jl 1f \n" -" xorl %eax,%eax \n" -" incl %eax \n" -" pushl %ebx \n" -" cpuid \n" -" popl %ebx \n" -#ifdef __i386 -" movl %edx,-8(%ebp) \n" +#define cpuid(func, a, b, c, d) \ + __asm { \ + __asm mov eax, func \ + __asm cpuid \ + __asm mov a, eax \ + __asm mov b, ebx \ + __asm mov c, ecx \ + __asm mov d, edx \ + } #else -" movl %edx,-8(%rbp) \n" -#endif -"1: \n" +#define cpuid(func, a, b, c, d) \ + a = b = c = d = 0 #endif - return features; + +static __inline__ int +CPU_getCPUIDFeatures(void) +{ + int features = 0; + int a, b, c, d; + + cpuid(0, a, b, c, d); + if (a >= 1) { + cpuid(1, a, b, c, d); + features = d; + } + return features; } -static __inline__ int CPU_getCPUIDFeaturesExt(void) +static __inline__ int +CPU_haveRDTSC(void) { - int features = 0; -#if defined(__GNUC__) && defined(i386) - __asm__ ( -" movl $0x80000000,%%eax # Query for extended functions \n" -" pushl %%ebx \n" -" cpuid # Get extended function limit \n" -" popl %%ebx \n" -" cmpl $0x80000001,%%eax \n" -" jl 1f # Nope, we dont have function 800000001h\n" -" movl $0x80000001,%%eax # Setup extended function 800000001h\n" -" pushl %%ebx \n" -" cpuid # and get the information \n" -" popl %%ebx \n" -" movl %%edx,%0 \n" -"1: \n" - : "=m" (features) - : - : "%eax", "%ecx", "%edx" - ); -#elif defined(__GNUC__) && defined (__x86_64__) - __asm__ ( -" movl $0x80000000,%%eax # Query for extended functions \n" -" pushq %%rbx \n" -" cpuid # Get extended function limit \n" -" popq %%rbx \n" -" cmpl $0x80000001,%%eax \n" -" jl 1f # Nope, we dont have function 800000001h\n" -" movl $0x80000001,%%eax # Setup extended function 800000001h\n" -" pushq %%rbx \n" -" cpuid # and get the information \n" -" popq %%rbx \n" -" movl %%edx,%0 \n" -"1: \n" - : "=m" (features) - : - : "%rax", "%rcx", "%rdx" - ); -#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) - __asm { - mov eax,80000000h ; Query for extended functions - push ebx - cpuid ; Get extended function limit - pop ebx - cmp eax,80000001h - jl done ; Nope, we dont have function 800000001h - mov eax,80000001h ; Setup extended function 800000001h - push ebx - cpuid ; and get the information - pop ebx - mov features,edx -done: - } -#elif defined(__sun) && ( defined(__i386) || defined(__amd64) ) - __asm ( -" movl $0x80000000,%eax \n" -" pushl %ebx \n" -" cpuid \n" -" popl %ebx \n" -" cmpl $0x80000001,%eax \n" -" jl 1f \n" -" movl $0x80000001,%eax \n" -" pushl %ebx \n" -" cpuid \n" -" popl %ebx \n" -#ifdef __i386 -" movl %edx,-8(%ebp) \n" + if (CPU_haveCPUID()) { + return (CPU_getCPUIDFeatures() & 0x00000010); + } + return 0; +} + +static __inline__ int +CPU_haveAltiVec(void) +{ + volatile int altivec = 0; +#if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) +#ifdef __OpenBSD__ + int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC }; #else -" movl %edx,-8(%rbp) \n" + int selectors[2] = { CTL_HW, HW_VECTORUNIT }; #endif -"1: \n" - ); + int hasVectorUnit = 0; + size_t length = sizeof(hasVectorUnit); + int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); + if (0 == error) + altivec = (hasVectorUnit != 0); +#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP + void (*handler) (int sig); + handler = signal(SIGILL, illegal_instruction); + if (setjmp(jmpbuf) == 0) { + asm volatile ("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0"::"r" (-1)); + altivec = 1; + } + signal(SIGILL, handler); #endif - return features; + return altivec; } -static __inline__ int CPU_haveRDTSC(void) +static __inline__ int +CPU_haveMMX(void) { - if ( CPU_haveCPUID() ) { - return (CPU_getCPUIDFeatures() & 0x00000010); - } - return 0; + if (CPU_haveCPUID()) { + return (CPU_getCPUIDFeatures() & 0x00800000); + } + return 0; } -static __inline__ int CPU_haveMMX(void) +static __inline__ int +CPU_have3DNow(void) { - if ( CPU_haveCPUID() ) { - return (CPU_getCPUIDFeatures() & 0x00800000); - } - return 0; + if (CPU_haveCPUID()) { + int a, b, c, d; + + cpuid(0x80000000, a, b, c, d); + if (a >= 0x80000001) { + cpuid(0x80000001, a, b, c, d); + return (d & 0x80000000); + } + } + return 0; } -static __inline__ int CPU_haveMMXExt(void) +static __inline__ int +CPU_haveSSE(void) { - if ( CPU_haveCPUID() ) { - return (CPU_getCPUIDFeaturesExt() & 0x00400000); - } - return 0; + if (CPU_haveCPUID()) { + return (CPU_getCPUIDFeatures() & 0x02000000); + } + return 0; } -static __inline__ int CPU_have3DNow(void) +static __inline__ int +CPU_haveSSE2(void) { - if ( CPU_haveCPUID() ) { - return (CPU_getCPUIDFeaturesExt() & 0x80000000); - } - return 0; + if (CPU_haveCPUID()) { + return (CPU_getCPUIDFeatures() & 0x04000000); + } + return 0; } -static __inline__ int CPU_have3DNowExt(void) +static __inline__ int +CPU_haveSSE3(void) { - if ( CPU_haveCPUID() ) { - return (CPU_getCPUIDFeaturesExt() & 0x40000000); - } - return 0; + if (CPU_haveCPUID()) { + int a, b, c, d; + + cpuid(0, a, b, c, d); + if (a >= 1) { + cpuid(1, a, b, c, d); + return (c & 0x00000001); + } + } + return 0; } -static __inline__ int CPU_haveSSE(void) +static __inline__ int +CPU_haveSSE41(void) { - if ( CPU_haveCPUID() ) { - return (CPU_getCPUIDFeatures() & 0x02000000); - } - return 0; + if (CPU_haveCPUID()) { + int a, b, c, d; + + cpuid(1, a, b, c, d); + if (a >= 1) { + cpuid(1, a, b, c, d); + return (c & 0x00080000); + } + } + return 0; } -static __inline__ int CPU_haveSSE2(void) +static __inline__ int +CPU_haveSSE42(void) { - if ( CPU_haveCPUID() ) { - return (CPU_getCPUIDFeatures() & 0x04000000); - } - return 0; + if (CPU_haveCPUID()) { + int a, b, c, d; + + cpuid(1, a, b, c, d); + if (a >= 1) { + cpuid(1, a, b, c, d); + return (c & 0x00100000); + } + } + return 0; } -static __inline__ int CPU_haveAltiVec(void) +static int SDL_CPUCount = 0; + +int +SDL_GetCPUCount(void) { - volatile int altivec = 0; -#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__)) - int selectors[2] = { CTL_HW, HW_VECTORUNIT }; - int hasVectorUnit = 0; - size_t length = sizeof(hasVectorUnit); - int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); - if( 0 == error ) - altivec = (hasVectorUnit != 0); -#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP - void (*handler)(int sig); - handler = signal(SIGILL, illegal_instruction); - if ( setjmp(jmpbuf) == 0 ) { - asm volatile ("mtspr 256, %0\n\t" - "vand %%v0, %%v0, %%v0" - : - : "r" (-1)); - altivec = 1; - } - signal(SIGILL, handler); + if (!SDL_CPUCount) { +#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) + if (SDL_CPUCount <= 0) { + SDL_CPUCount = (int)sysconf(_SC_NPROCESSORS_ONLN); + } +#endif +#ifdef HAVE_SYSCTLBYNAME + if (SDL_CPUCount <= 0) { + size_t size = sizeof(SDL_CPUCount); + sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0); + } +#endif +#ifdef __WIN32__ + if (SDL_CPUCount <= 0) { + SYSTEM_INFO info; + GetSystemInfo(&info); + SDL_CPUCount = info.dwNumberOfProcessors; + } +#endif + /* There has to be at least 1, right? :) */ + if (SDL_CPUCount <= 0) { + SDL_CPUCount = 1; + } + } + return SDL_CPUCount; +} + +/* Oh, such a sweet sweet trick, just not very useful. :) */ +static const char * +SDL_GetCPUType(void) +{ + static char SDL_CPUType[13]; + + if (!SDL_CPUType[0]) { + int i = 0; + int a, b, c, d; + + if (CPU_haveCPUID()) { + cpuid(0x00000000, a, b, c, d); + SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8; + } + if (!SDL_CPUType[0]) { + SDL_strlcpy(SDL_CPUType, "Unknown", sizeof(SDL_CPUType)); + } + } + return SDL_CPUType; +} + + +#ifdef TEST_MAIN /* !!! FIXME: only used for test at the moment. */ +static const char * +SDL_GetCPUName(void) +{ + static char SDL_CPUName[48]; + + if (!SDL_CPUName[0]) { + int i = 0; + int a, b, c, d; + + if (CPU_haveCPUID()) { + cpuid(0x80000000, a, b, c, d); + if (a >= 0x80000004) { + cpuid(0x80000002, a, b, c, d); + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + cpuid(0x80000003, a, b, c, d); + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + cpuid(0x80000004, a, b, c, d); + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + } + } + if (!SDL_CPUName[0]) { + SDL_strlcpy(SDL_CPUName, "Unknown", sizeof(SDL_CPUName)); + } + } + return SDL_CPUName; +} #endif - return altivec; + +int +SDL_GetCPUCacheLineSize(void) +{ + const char *cpuType = SDL_GetCPUType(); + + if (SDL_strcmp(cpuType, "GenuineIntel") == 0) { + int a, b, c, d; + + cpuid(0x00000001, a, b, c, d); + return (((b >> 8) & 0xff) * 8); + } else if (SDL_strcmp(cpuType, "AuthenticAMD") == 0) { + int a, b, c, d; + + cpuid(0x80000005, a, b, c, d); + return (c & 0xff); + } else { + /* Just make a guess here... */ + return SDL_CACHELINE_SIZE; + } } static Uint32 SDL_CPUFeatures = 0xFFFFFFFF; -static Uint32 SDL_GetCPUFeatures(void) +static Uint32 +SDL_GetCPUFeatures(void) +{ + if (SDL_CPUFeatures == 0xFFFFFFFF) { + SDL_CPUFeatures = 0; + if (CPU_haveRDTSC()) { + SDL_CPUFeatures |= CPU_HAS_RDTSC; + } + if (CPU_haveAltiVec()) { + SDL_CPUFeatures |= CPU_HAS_ALTIVEC; + } + if (CPU_haveMMX()) { + SDL_CPUFeatures |= CPU_HAS_MMX; + } + if (CPU_have3DNow()) { + SDL_CPUFeatures |= CPU_HAS_3DNOW; + } + if (CPU_haveSSE()) { + SDL_CPUFeatures |= CPU_HAS_SSE; + } + if (CPU_haveSSE2()) { + SDL_CPUFeatures |= CPU_HAS_SSE2; + } + if (CPU_haveSSE3()) { + SDL_CPUFeatures |= CPU_HAS_SSE3; + } + if (CPU_haveSSE41()) { + SDL_CPUFeatures |= CPU_HAS_SSE41; + } + if (CPU_haveSSE42()) { + SDL_CPUFeatures |= CPU_HAS_SSE42; + } + } + return SDL_CPUFeatures; +} + +SDL_bool +SDL_HasRDTSC(void) { - if ( SDL_CPUFeatures == 0xFFFFFFFF ) { - SDL_CPUFeatures = 0; - if ( CPU_haveRDTSC() ) { - SDL_CPUFeatures |= CPU_HAS_RDTSC; - } - if ( CPU_haveMMX() ) { - SDL_CPUFeatures |= CPU_HAS_MMX; - } - if ( CPU_haveMMXExt() ) { - SDL_CPUFeatures |= CPU_HAS_MMXEXT; - } - if ( CPU_have3DNow() ) { - SDL_CPUFeatures |= CPU_HAS_3DNOW; - } - if ( CPU_have3DNowExt() ) { - SDL_CPUFeatures |= CPU_HAS_3DNOWEXT; - } - if ( CPU_haveSSE() ) { - SDL_CPUFeatures |= CPU_HAS_SSE; - } - if ( CPU_haveSSE2() ) { - SDL_CPUFeatures |= CPU_HAS_SSE2; - } - if ( CPU_haveAltiVec() ) { - SDL_CPUFeatures |= CPU_HAS_ALTIVEC; - } - } - return SDL_CPUFeatures; + if (SDL_GetCPUFeatures() & CPU_HAS_RDTSC) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_HasRDTSC(void) +SDL_bool +SDL_HasAltiVec(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_RDTSC ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_ALTIVEC) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_HasMMX(void) +SDL_bool +SDL_HasMMX(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_MMX ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_MMX) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_HasMMXExt(void) +SDL_bool +SDL_Has3DNow(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_MMXEXT ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_3DNOW) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_Has3DNow(void) +SDL_bool +SDL_HasSSE(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOW ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_SSE) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_Has3DNowExt(void) +SDL_bool +SDL_HasSSE2(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOWEXT ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_SSE2) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_HasSSE(void) +SDL_bool +SDL_HasSSE3(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_SSE ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_SSE3) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_HasSSE2(void) +SDL_bool +SDL_HasSSE41(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_SSE2 ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_SSE41) { + return SDL_TRUE; + } + return SDL_FALSE; } -SDL_bool SDL_HasAltiVec(void) +SDL_bool +SDL_HasSSE42(void) { - if ( SDL_GetCPUFeatures() & CPU_HAS_ALTIVEC ) { - return SDL_TRUE; - } - return SDL_FALSE; + if (SDL_GetCPUFeatures() & CPU_HAS_SSE42) { + return SDL_TRUE; + } + return SDL_FALSE; } #ifdef TEST_MAIN #include -int main() +int +main() { - printf("RDTSC: %d\n", SDL_HasRDTSC()); - printf("MMX: %d\n", SDL_HasMMX()); - printf("MMXExt: %d\n", SDL_HasMMXExt()); - printf("3DNow: %d\n", SDL_Has3DNow()); - printf("3DNowExt: %d\n", SDL_Has3DNowExt()); - printf("SSE: %d\n", SDL_HasSSE()); - printf("SSE2: %d\n", SDL_HasSSE2()); - printf("AltiVec: %d\n", SDL_HasAltiVec()); - return 0; + printf("CPU count: %d\n", SDL_GetCPUCount()); + printf("CPU type: %s\n", SDL_GetCPUType()); + printf("CPU name: %s\n", SDL_GetCPUName()); + printf("CacheLine size: %d\n", SDL_GetCPUCacheLineSize()); + printf("RDTSC: %d\n", SDL_HasRDTSC()); + printf("Altivec: %d\n", SDL_HasAltiVec()); + printf("MMX: %d\n", SDL_HasMMX()); + printf("3DNow: %d\n", SDL_Has3DNow()); + printf("SSE: %d\n", SDL_HasSSE()); + printf("SSE2: %d\n", SDL_HasSSE2()); + printf("SSE3: %d\n", SDL_HasSSE3()); + printf("SSE4.1: %d\n", SDL_HasSSE41()); + printf("SSE4.2: %d\n", SDL_HasSSE42()); + return 0; } #endif /* TEST_MAIN */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_active.c b/src/events/SDL_active.c deleted file mode 100644 index 201fb8054f..0000000000 --- a/src/events/SDL_active.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Application focus/iconification handling code for SDL */ - -#include "SDL_events.h" -#include "SDL_events_c.h" - - -/* These are static for our active event handling code */ -static Uint8 SDL_appstate = 0; - -/* Public functions */ -int SDL_AppActiveInit(void) -{ - /* Start completely active */ - SDL_appstate = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS); - - /* That's it! */ - return(0); -} -void SDL_AppActiveQuit(void) -{ -} - -Uint8 SDL_GetAppState(void) -{ - return(SDL_appstate); -} - -/* This is global for SDL_eventloop.c */ -int SDL_PrivateAppActive(Uint8 gain, Uint8 state) -{ - int posted; - Uint8 new_state; - - /* Modify the current state with the given mask */ - if ( gain ) { - new_state = (SDL_appstate | state); - } else { - new_state = (SDL_appstate & ~state); - } - - /* Drop events that don't change state */ - if ( new_state == SDL_appstate ) { - return(0); - } - - /* Update internal active state */ - SDL_appstate = new_state; - - /* Post the event, if desired */ - posted = 0; - if ( SDL_ProcessEvents[SDL_ACTIVEEVENT] == SDL_ENABLE ) { - SDL_Event event; - SDL_memset(&event, 0, sizeof(event)); - event.type = SDL_ACTIVEEVENT; - event.active.gain = gain; - event.active.state = state; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - - /* If we lost keyboard focus, post key-up events */ - if ( (state & SDL_APPINPUTFOCUS) && !gain ) { - SDL_ResetKeyboard(); - } - /* If we were minimized, post button-up events */ - if ( (state & SDL_APPACTIVE) && !gain ) { - SDL_ResetMouse(); - } - return(posted); -} diff --git a/src/events/SDL_clipboardevents.c b/src/events/SDL_clipboardevents.c new file mode 100644 index 0000000000..99ead8f507 --- /dev/null +++ b/src/events/SDL_clipboardevents.c @@ -0,0 +1,46 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* Clipboard event handling code for SDL */ + +#include "SDL_events.h" +#include "SDL_events_c.h" +#include "SDL_clipboardevents_c.h" + + +int +SDL_SendClipboardUpdate(void) +{ + int posted; + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_CLIPBOARDUPDATE) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_CLIPBOARDUPDATE; + + posted = (SDL_PushEvent(&event) > 0); + } + return (posted); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_clipboardevents_c.h b/src/events/SDL_clipboardevents_c.h new file mode 100644 index 0000000000..4f320f041a --- /dev/null +++ b/src/events/SDL_clipboardevents_c.h @@ -0,0 +1,30 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_clipboardevents_c_h +#define _SDL_clipboardevents_c_h + +extern int SDL_SendClipboardUpdate(void); + +#endif /* _SDL_clipboardevents_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_dropevents.c b/src/events/SDL_dropevents.c new file mode 100644 index 0000000000..1ce2f1c1ba --- /dev/null +++ b/src/events/SDL_dropevents.c @@ -0,0 +1,46 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* Drag and drop event handling code for SDL */ + +#include "SDL_events.h" +#include "SDL_events_c.h" +#include "SDL_dropevents_c.h" + + +int +SDL_SendDropFile(const char *file) +{ + int posted; + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_DROPFILE; + event.drop.file = SDL_strdup(file); + posted = (SDL_PushEvent(&event) > 0); + } + return (posted); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_dropevents_c.h b/src/events/SDL_dropevents_c.h new file mode 100644 index 0000000000..d658e447c1 --- /dev/null +++ b/src/events/SDL_dropevents_c.h @@ -0,0 +1,30 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_dropevents_c_h +#define _SDL_dropevents_c_h + +extern int SDL_SendDropFile(const char *file); + +#endif /* _SDL_dropevents_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 8f23c01af9..06cb0f2e7d 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -1,502 +1,642 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* General event handling code for SDL */ #include "SDL.h" +#include "SDL_events.h" #include "SDL_syswm.h" -#include "SDL_sysevents.h" +#include "SDL_thread.h" #include "SDL_events_c.h" #include "../timer/SDL_timer_c.h" #if !SDL_JOYSTICK_DISABLED #include "../joystick/SDL_joystick_c.h" #endif +#include "../video/SDL_sysvideo.h" + +/* An arbitrary limit so we don't have unbounded growth */ +#define SDL_MAX_QUEUED_EVENTS 65535 /* Public data -- the event filter */ SDL_EventFilter SDL_EventOK = NULL; -Uint8 SDL_ProcessEvents[SDL_NUMEVENTS]; -static Uint32 SDL_eventstate = 0; +void *SDL_EventOKParam; + +typedef struct SDL_EventWatcher { + SDL_EventFilter callback; + void *userdata; + struct SDL_EventWatcher *next; +} SDL_EventWatcher; + +static SDL_EventWatcher *SDL_event_watchers = NULL; + +typedef struct { + Uint32 bits[8]; +} SDL_DisabledEventBlock; + +static SDL_DisabledEventBlock *SDL_disabled_events[256]; +static Uint32 SDL_userevents = SDL_USEREVENT; /* Private data -- event queue */ -#define MAXEVENTS 128 -static struct { - SDL_mutex *lock; - int active; - int head; - int tail; - SDL_Event event[MAXEVENTS]; - int wmmsg_next; - struct SDL_SysWMmsg wmmsg[MAXEVENTS]; -} SDL_EventQ; - -/* Private data -- event locking structure */ -static struct { - SDL_mutex *lock; - int safe; -} SDL_EventLock; - -/* Thread functions */ -static SDL_Thread *SDL_EventThread = NULL; /* Thread handle */ -static Uint32 event_thread; /* The event thread id */ - -void SDL_Lock_EventThread(void) +typedef struct _SDL_EventEntry { - if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) { - /* Grab lock and spin until we're sure event thread stopped */ - SDL_mutexP(SDL_EventLock.lock); - while ( ! SDL_EventLock.safe ) { - SDL_Delay(1); - } - } -} -void SDL_Unlock_EventThread(void) + SDL_Event event; + SDL_SysWMmsg msg; + struct _SDL_EventEntry *prev; + struct _SDL_EventEntry *next; +} SDL_EventEntry; + +typedef struct _SDL_SysWMEntry { - if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) { - SDL_mutexV(SDL_EventLock.lock); - } -} + SDL_SysWMmsg msg; + struct _SDL_SysWMEntry *next; +} SDL_SysWMEntry; -#ifdef __OS2__ -/* - * We'll increase the priority of GobbleEvents thread, so it will process - * events in time for sure! For this, we need the DosSetPriority() API - * from the os2.h include file. - */ -#define INCL_DOSPROCESS -#include -#include +static struct +{ + SDL_mutex *lock; + volatile SDL_bool active; + volatile int count; + SDL_EventEntry *head; + SDL_EventEntry *tail; + SDL_EventEntry *free; + SDL_SysWMEntry *wmmsg_used; + SDL_SysWMEntry *wmmsg_free; +} SDL_EventQ = { NULL, SDL_TRUE }; + + +static __inline__ SDL_bool +SDL_ShouldPollJoystick() +{ +#if !SDL_JOYSTICK_DISABLED + if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || + SDL_JoystickEventState(SDL_QUERY)) && + SDL_PrivateJoystickNeedsPolling()) { + return SDL_TRUE; + } #endif + return SDL_FALSE; +} -static int SDLCALL SDL_GobbleEvents(void *unused) +/* Public functions */ + +void +SDL_StopEventLoop(void) { - event_thread = SDL_ThreadID(); + int i; + SDL_EventEntry *entry; + SDL_SysWMEntry *wmmsg; + + if (SDL_EventQ.lock) { + SDL_LockMutex(SDL_EventQ.lock); + } + + SDL_EventQ.active = SDL_FALSE; + + /* Clean out EventQ */ + for (entry = SDL_EventQ.head; entry; ) { + SDL_EventEntry *next = entry->next; + SDL_free(entry); + entry = next; + } + for (entry = SDL_EventQ.free; entry; ) { + SDL_EventEntry *next = entry->next; + SDL_free(entry); + entry = next; + } + for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; ) { + SDL_SysWMEntry *next = wmmsg->next; + SDL_free(wmmsg); + wmmsg = next; + } + for (wmmsg = SDL_EventQ.wmmsg_free; wmmsg; ) { + SDL_SysWMEntry *next = wmmsg->next; + SDL_free(wmmsg); + wmmsg = next; + } + SDL_EventQ.count = 0; + SDL_EventQ.head = NULL; + SDL_EventQ.tail = NULL; + SDL_EventQ.free = NULL; + SDL_EventQ.wmmsg_used = NULL; + SDL_EventQ.wmmsg_free = NULL; + + /* Clear disabled event state */ + for (i = 0; i < SDL_arraysize(SDL_disabled_events); ++i) { + if (SDL_disabled_events[i]) { + SDL_free(SDL_disabled_events[i]); + SDL_disabled_events[i] = NULL; + } + } + + while (SDL_event_watchers) { + SDL_EventWatcher *tmp = SDL_event_watchers; + SDL_event_watchers = tmp->next; + SDL_free(tmp); + } + SDL_EventOK = NULL; + + if (SDL_EventQ.lock) { + SDL_UnlockMutex(SDL_EventQ.lock); + SDL_DestroyMutex(SDL_EventQ.lock); + SDL_EventQ.lock = NULL; + } +} -#ifdef __OS2__ -#ifdef USE_DOSSETPRIORITY - /* Increase thread priority, so it will process events in time for sure! */ - DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, +16, 0); -#endif -#endif +/* This function (and associated calls) may be called more than once */ +int +SDL_StartEventLoop(void) +{ + /* We'll leave the event queue alone, since we might have gotten + some important events at launch (like SDL_DROPFILE) - while ( SDL_EventQ.active ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; + FIXME: Does this introduce any other bugs with events at startup? + */ - /* Get events from the video subsystem */ - if ( video ) { - video->PumpEvents(this); - } + /* Create the lock and set ourselves active */ +#if !SDL_THREADS_DISABLED + if (!SDL_EventQ.lock) { + SDL_EventQ.lock = SDL_CreateMutex(); + } + if (SDL_EventQ.lock == NULL) { + return (-1); + } +#endif /* !SDL_THREADS_DISABLED */ - /* Queue pending key-repeat events */ - SDL_CheckKeyRepeat(); + /* Process most event types */ + SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); + SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); + SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE); -#if !SDL_JOYSTICK_DISABLED - /* Check for joystick state change */ - if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) { - SDL_JoystickUpdate(); - } -#endif + SDL_EventQ.active = SDL_TRUE; - /* Give up the CPU for the rest of our timeslice */ - SDL_EventLock.safe = 1; - if ( SDL_timer_running ) { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(1); - - /* Check for event locking. - On the P of the lock mutex, if the lock is held, this thread - will wait until the lock is released before continuing. The - safe flag will be set, meaning that the other thread can go - about it's business. The safe flag is reset before the V, - so as soon as the mutex is free, other threads can see that - it's not safe to interfere with the event thread. - */ - SDL_mutexP(SDL_EventLock.lock); - SDL_EventLock.safe = 0; - SDL_mutexV(SDL_EventLock.lock); - } - SDL_SetTimerThreaded(0); - event_thread = 0; - return(0); + return (0); } -static int SDL_StartEventThread(Uint32 flags) + +/* Add an event to the event queue -- called with the queue locked */ +static int +SDL_AddEvent(SDL_Event * event) { - /* Reset everything to zero */ - SDL_EventThread = NULL; - SDL_memset(&SDL_EventLock, 0, sizeof(SDL_EventLock)); + SDL_EventEntry *entry; + + if (SDL_EventQ.count >= SDL_MAX_QUEUED_EVENTS) { + SDL_SetError("Event queue is full (%d events)", SDL_EventQ.count); + return 0; + } + + if (SDL_EventQ.free == NULL) { + entry = (SDL_EventEntry *)SDL_malloc(sizeof(*entry)); + if (!entry) { + return 0; + } + } else { + entry = SDL_EventQ.free; + SDL_EventQ.free = entry->next; + } + + entry->event = *event; + if (event->type == SDL_SYSWMEVENT) { + entry->msg = *event->syswm.msg; + entry->event.syswm.msg = &entry->msg; + } + + if (SDL_EventQ.tail) { + SDL_EventQ.tail->next = entry; + entry->prev = SDL_EventQ.tail; + SDL_EventQ.tail = entry; + entry->next = NULL; + } else { + SDL_assert(!SDL_EventQ.head); + SDL_EventQ.head = entry; + SDL_EventQ.tail = entry; + entry->prev = NULL; + entry->next = NULL; + } + ++SDL_EventQ.count; + + return 1; +} - /* Create the lock and set ourselves active */ -#if !SDL_THREADS_DISABLED - SDL_EventQ.lock = SDL_CreateMutex(); - if ( SDL_EventQ.lock == NULL ) { -#ifdef __MACOS__ /* MacOS classic you can't multithread, so no lock needed */ - ; -#else - return(-1); -#endif - } -#endif /* !SDL_THREADS_DISABLED */ - SDL_EventQ.active = 1; - - if ( (flags&SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) { - SDL_EventLock.lock = SDL_CreateMutex(); - if ( SDL_EventLock.lock == NULL ) { - return(-1); - } - SDL_EventLock.safe = 0; - - /* The event thread will handle timers too */ - SDL_SetTimerThreaded(2); -#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) && !defined(__SYMBIAN32__) -#undef SDL_CreateThread - SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL, NULL, NULL); -#else - SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL); -#endif - if ( SDL_EventThread == NULL ) { - return(-1); - } - } else { - event_thread = 0; - } - return(0); +/* Remove an event from the queue -- called with the queue locked */ +static void +SDL_CutEvent(SDL_EventEntry *entry) +{ + if (entry->prev) { + entry->prev->next = entry->next; + } + if (entry->next) { + entry->next->prev = entry->prev; + } + + if (entry == SDL_EventQ.head) { + SDL_assert(entry->prev == NULL); + SDL_EventQ.head = entry->next; + } + if (entry == SDL_EventQ.tail) { + SDL_assert(entry->next == NULL); + SDL_EventQ.tail = entry->prev; + } + + entry->next = SDL_EventQ.free; + SDL_EventQ.free = entry; + SDL_assert(SDL_EventQ.count > 0); + --SDL_EventQ.count; } -static void SDL_StopEventThread(void) +/* Lock the event queue, take a peep at it, and unlock it */ +int +SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action, + Uint32 minType, Uint32 maxType) { - SDL_EventQ.active = 0; - if ( SDL_EventThread ) { - SDL_WaitThread(SDL_EventThread, NULL); - SDL_EventThread = NULL; - SDL_DestroyMutex(SDL_EventLock.lock); - SDL_EventLock.lock = NULL; - } -#ifndef IPOD - SDL_DestroyMutex(SDL_EventQ.lock); - SDL_EventQ.lock = NULL; -#endif + int i, used; + + /* Don't look after we've quit */ + if (!SDL_EventQ.active) { + /* We get a few spurious events at shutdown, so don't warn then */ + if (action != SDL_ADDEVENT) { + SDL_SetError("The event system has been shut down"); + } + return (-1); + } + /* Lock the event queue */ + used = 0; + if (!SDL_EventQ.lock || SDL_LockMutex(SDL_EventQ.lock) == 0) { + if (action == SDL_ADDEVENT) { + for (i = 0; i < numevents; ++i) { + used += SDL_AddEvent(&events[i]); + } + } else { + SDL_EventEntry *entry, *next; + SDL_SysWMEntry *wmmsg, *wmmsg_next; + SDL_Event tmpevent; + Uint32 type; + + /* If 'events' is NULL, just see if they exist */ + if (events == NULL) { + action = SDL_PEEKEVENT; + numevents = 1; + events = &tmpevent; + } + + /* Clean out any used wmmsg data + FIXME: Do we want to retain the data for some period of time? + */ + for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; wmmsg = wmmsg_next) { + wmmsg_next = wmmsg->next; + wmmsg->next = SDL_EventQ.wmmsg_free; + SDL_EventQ.wmmsg_free = wmmsg; + } + SDL_EventQ.wmmsg_used = NULL; + + for (entry = SDL_EventQ.head; entry && used < numevents; entry = next) { + next = entry->next; + type = entry->event.type; + if (minType <= type && type <= maxType) { + events[used] = entry->event; + if (entry->event.type == SDL_SYSWMEVENT) { + /* We need to copy the wmmsg somewhere safe. + For now we'll guarantee it's valid at least until + the next call to SDL_PeepEvents() + */ + SDL_SysWMEntry *wmmsg; + if (SDL_EventQ.wmmsg_free) { + wmmsg = SDL_EventQ.wmmsg_free; + SDL_EventQ.wmmsg_free = wmmsg->next; + } else { + wmmsg = (SDL_SysWMEntry *)SDL_malloc(sizeof(*wmmsg)); + } + wmmsg->msg = *entry->event.syswm.msg; + wmmsg->next = SDL_EventQ.wmmsg_used; + SDL_EventQ.wmmsg_used = wmmsg; + events[used].syswm.msg = &wmmsg->msg; + } + ++used; + + if (action == SDL_GETEVENT) { + SDL_CutEvent(entry); + } + } + } + } + SDL_UnlockMutex(SDL_EventQ.lock); + } else { + return SDL_SetError("Couldn't lock event queue"); + } + return (used); } -Uint32 SDL_EventThreadID(void) +SDL_bool +SDL_HasEvent(Uint32 type) { - return(event_thread); + return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0); } -/* Public functions */ +SDL_bool +SDL_HasEvents(Uint32 minType, Uint32 maxType) +{ + return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0); +} -void SDL_StopEventLoop(void) +void +SDL_FlushEvent(Uint32 type) { - /* Halt the event thread, if running */ - SDL_StopEventThread(); - - /* Shutdown event handlers */ - SDL_AppActiveQuit(); - SDL_KeyboardQuit(); - SDL_MouseQuit(); - SDL_QuitQuit(); - - /* Clean out EventQ */ - SDL_EventQ.head = 0; - SDL_EventQ.tail = 0; - SDL_EventQ.wmmsg_next = 0; + SDL_FlushEvents(type, type); } -/* This function (and associated calls) may be called more than once */ -int SDL_StartEventLoop(Uint32 flags) +void +SDL_FlushEvents(Uint32 minType, Uint32 maxType) { - int retcode; - - /* Clean out the event queue */ - SDL_EventThread = NULL; - SDL_EventQ.lock = NULL; - SDL_StopEventLoop(); - - /* No filter to start with, process most event types */ - SDL_EventOK = NULL; - SDL_memset(SDL_ProcessEvents,SDL_ENABLE,sizeof(SDL_ProcessEvents)); - SDL_eventstate = ~0; - /* It's not save to call SDL_EventState() yet */ - SDL_eventstate &= ~(0x00000001 << SDL_SYSWMEVENT); - SDL_ProcessEvents[SDL_SYSWMEVENT] = SDL_IGNORE; - - /* Initialize event handlers */ - retcode = 0; - retcode += SDL_AppActiveInit(); - retcode += SDL_KeyboardInit(); - retcode += SDL_MouseInit(); - retcode += SDL_QuitInit(); - if ( retcode < 0 ) { - /* We don't expect them to fail, but... */ - return(-1); - } - - /* Create the lock and event thread */ - if ( SDL_StartEventThread(flags) < 0 ) { - SDL_StopEventLoop(); - return(-1); - } - return(0); + /* Don't look after we've quit */ + if (!SDL_EventQ.active) { + return; + } + + /* Make sure the events are current */ +#if 0 + /* Actually, we can't do this since we might be flushing while processing + a resize event, and calling this might trigger further resize events. + */ + SDL_PumpEvents(); +#endif + + /* Lock the event queue */ + if (SDL_LockMutex(SDL_EventQ.lock) == 0) { + SDL_EventEntry *entry, *next; + Uint32 type; + for (entry = SDL_EventQ.head; entry; entry = next) { + next = entry->next; + type = entry->event.type; + if (minType <= type && type <= maxType) { + SDL_CutEvent(entry); + } + } + SDL_UnlockMutex(SDL_EventQ.lock); + } } +/* Run the system dependent event loops */ +void +SDL_PumpEvents(void) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); -/* Add an event to the event queue -- called with the queue locked */ -static int SDL_AddEvent(SDL_Event *event) + /* Get events from the video subsystem */ + if (_this) { + _this->PumpEvents(_this); + } +#if !SDL_JOYSTICK_DISABLED + /* Check for joystick state change */ + if (SDL_ShouldPollJoystick()) { + SDL_JoystickUpdate(); + } +#endif +} + +/* Public functions */ + +int +SDL_PollEvent(SDL_Event * event) { - int tail, added; - - tail = (SDL_EventQ.tail+1)%MAXEVENTS; - if ( tail == SDL_EventQ.head ) { - /* Overflow, drop event */ - added = 0; - } else { - SDL_EventQ.event[SDL_EventQ.tail] = *event; - if (event->type == SDL_SYSWMEVENT) { - /* Note that it's possible to lose an event */ - int next = SDL_EventQ.wmmsg_next; - SDL_EventQ.wmmsg[next] = *event->syswm.msg; - SDL_EventQ.event[SDL_EventQ.tail].syswm.msg = - &SDL_EventQ.wmmsg[next]; - SDL_EventQ.wmmsg_next = (next+1)%MAXEVENTS; - } - SDL_EventQ.tail = tail; - added = 1; - } - return(added); + return SDL_WaitEventTimeout(event, 0); } -/* Cut an event, and return the next valid spot, or the tail */ -/* -- called with the queue locked */ -static int SDL_CutEvent(int spot) +int +SDL_WaitEvent(SDL_Event * event) { - if ( spot == SDL_EventQ.head ) { - SDL_EventQ.head = (SDL_EventQ.head+1)%MAXEVENTS; - return(SDL_EventQ.head); - } else - if ( (spot+1)%MAXEVENTS == SDL_EventQ.tail ) { - SDL_EventQ.tail = spot; - return(SDL_EventQ.tail); - } else - /* We cut the middle -- shift everything over */ - { - int here, next; - - /* This can probably be optimized with SDL_memcpy() -- careful! */ - if ( --SDL_EventQ.tail < 0 ) { - SDL_EventQ.tail = MAXEVENTS-1; - } - for ( here=spot; here != SDL_EventQ.tail; here = next ) { - next = (here+1)%MAXEVENTS; - SDL_EventQ.event[here] = SDL_EventQ.event[next]; - } - return(spot); - } - /* NOTREACHED */ + return SDL_WaitEventTimeout(event, -1); } -/* Lock the event queue, take a peep at it, and unlock it */ -int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, - Uint32 mask) +int +SDL_WaitEventTimeout(SDL_Event * event, int timeout) { - int i, used; - - /* Don't look after we've quit */ - if ( ! SDL_EventQ.active ) { - return(-1); - } - /* Lock the event queue */ - used = 0; - if ( SDL_mutexP(SDL_EventQ.lock) == 0 ) { - if ( action == SDL_ADDEVENT ) { - for ( i=0; i 0) + expiration = SDL_GetTicks() + timeout; + + for (;;) { + SDL_PumpEvents(); + switch (SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) { + case -1: + return 0; + case 1: + return 1; + case 0: + if (timeout == 0) { + /* Polling and no events, just return */ + return 0; + } + if (timeout > 0 && ((int) (SDL_GetTicks() - expiration) >= 0)) { + /* Timeout expired and no events */ + return 0; + } + SDL_Delay(10); + break; + } + } } -/* Run the system dependent event loops */ -void SDL_PumpEvents(void) +int +SDL_PushEvent(SDL_Event * event) { - if ( !SDL_EventThread ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; + SDL_EventWatcher *curr; - /* Get events from the video subsystem */ - if ( video ) { - video->PumpEvents(this); - } + event->common.timestamp = SDL_GetTicks(); - /* Queue pending key-repeat events */ - SDL_CheckKeyRepeat(); + if (SDL_EventOK && !SDL_EventOK(SDL_EventOKParam, event)) { + return 0; + } -#if !SDL_JOYSTICK_DISABLED - /* Check for joystick state change */ - if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) { - SDL_JoystickUpdate(); - } -#endif - } -} + for (curr = SDL_event_watchers; curr; curr = curr->next) { + curr->callback(curr->userdata, event); + } -/* Public functions */ + if (SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0, 0) <= 0) { + return -1; + } -int SDL_PollEvent (SDL_Event *event) + SDL_GestureProcessEvent(event); + + return 1; +} + +void +SDL_SetEventFilter(SDL_EventFilter filter, void *userdata) { - SDL_PumpEvents(); + /* Set filter and discard pending events */ + SDL_EventOK = NULL; + SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT); + SDL_EventOKParam = userdata; + SDL_EventOK = filter; +} - /* We can't return -1, just return 0 (no event) on error */ - if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 ) - return 0; - return 1; +SDL_bool +SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata) +{ + if (filter) { + *filter = SDL_EventOK; + } + if (userdata) { + *userdata = SDL_EventOKParam; + } + return SDL_EventOK ? SDL_TRUE : SDL_FALSE; } -int SDL_WaitEvent (SDL_Event *event) +/* FIXME: This is not thread-safe yet */ +void +SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) { - while ( 1 ) { - SDL_PumpEvents(); - switch(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)) { - case -1: return 0; - case 1: return 1; - case 0: SDL_Delay(10); - } - } + SDL_EventWatcher *watcher; + + watcher = (SDL_EventWatcher *)SDL_malloc(sizeof(*watcher)); + if (!watcher) { + /* Uh oh... */ + return; + } + watcher->callback = filter; + watcher->userdata = userdata; + watcher->next = SDL_event_watchers; + SDL_event_watchers = watcher; } -int SDL_PushEvent(SDL_Event *event) +/* FIXME: This is not thread-safe yet */ +void +SDL_DelEventWatch(SDL_EventFilter filter, void *userdata) { - if ( SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0) <= 0 ) - return -1; - return 0; + SDL_EventWatcher *prev = NULL; + SDL_EventWatcher *curr; + + for (curr = SDL_event_watchers; curr; prev = curr, curr = curr->next) { + if (curr->callback == filter && curr->userdata == userdata) { + if (prev) { + prev->next = curr->next; + } else { + SDL_event_watchers = curr->next; + } + SDL_free(curr); + break; + } + } } -void SDL_SetEventFilter (SDL_EventFilter filter) +void +SDL_FilterEvents(SDL_EventFilter filter, void *userdata) { - SDL_Event bitbucket; + if (SDL_LockMutex(SDL_EventQ.lock) == 0) { + SDL_EventEntry *entry, *next; + for (entry = SDL_EventQ.head; entry; entry = next) { + next = entry->next; + if (!filter(userdata, &entry->event)) { + SDL_CutEvent(entry); + } + } + SDL_UnlockMutex(SDL_EventQ.lock); + } +} - /* Set filter and discard pending events */ - SDL_EventOK = filter; - while ( SDL_PollEvent(&bitbucket) > 0 ) - ; +Uint8 +SDL_EventState(Uint32 type, int state) +{ + Uint8 current_state; + Uint8 hi = ((type >> 8) & 0xff); + Uint8 lo = (type & 0xff); + + if (SDL_disabled_events[hi] && + (SDL_disabled_events[hi]->bits[lo/32] & (1 << (lo&31)))) { + current_state = SDL_DISABLE; + } else { + current_state = SDL_ENABLE; + } + + if (state != current_state) + { + switch (state) { + case SDL_DISABLE: + /* Disable this event type and discard pending events */ + if (!SDL_disabled_events[hi]) { + SDL_disabled_events[hi] = (SDL_DisabledEventBlock*) SDL_calloc(1, sizeof(SDL_DisabledEventBlock)); + if (!SDL_disabled_events[hi]) { + /* Out of memory, nothing we can do... */ + break; + } + } + SDL_disabled_events[hi]->bits[lo/32] |= (1 << (lo&31)); + SDL_FlushEvent(type); + break; + case SDL_ENABLE: + SDL_disabled_events[hi]->bits[lo/32] &= ~(1 << (lo&31)); + break; + default: + /* Querying state... */ + break; + } + } + + return current_state; } -SDL_EventFilter SDL_GetEventFilter(void) +Uint32 +SDL_RegisterEvents(int numevents) { - return(SDL_EventOK); + Uint32 event_base; + + if ((numevents > 0) && (SDL_userevents+numevents <= SDL_LASTEVENT)) { + event_base = SDL_userevents; + SDL_userevents += numevents; + } else { + event_base = (Uint32)-1; + } + return event_base; } -Uint8 SDL_EventState (Uint8 type, int state) +int +SDL_SendAppEvent(SDL_EventType eventType) { - SDL_Event bitbucket; - Uint8 current_state; - - /* If SDL_ALLEVENTS was specified... */ - if ( type == 0xFF ) { - current_state = SDL_IGNORE; - for ( type=0; type 0 ) - ; - return(current_state); - } - - /* Just set the state for one event type */ - current_state = SDL_ProcessEvents[type]; - switch (state) { - case SDL_IGNORE: - case SDL_ENABLE: - /* Set state and discard pending events */ - SDL_ProcessEvents[type] = state; - if ( state == SDL_ENABLE ) { - SDL_eventstate |= (0x00000001 << (type)); - } else { - SDL_eventstate &= ~(0x00000001 << (type)); - } - while ( SDL_PollEvent(&bitbucket) > 0 ) - ; - break; - default: - /* Querying state? */ - break; - } - return(current_state); + int posted; + + posted = 0; + if (SDL_GetEventState(eventType) == SDL_ENABLE) { + SDL_Event event; + event.type = eventType; + posted = (SDL_PushEvent(&event) > 0); + } + return (posted); } -/* This is a generic event handler. - */ -int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message) +int +SDL_SendSysWMEvent(SDL_SysWMmsg * message) { - int posted; - - posted = 0; - if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) { - SDL_Event event; - SDL_memset(&event, 0, sizeof(event)); - event.type = SDL_SYSWMEVENT; - event.syswm.msg = message; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - /* Update internal event state */ - return(posted); + int posted; + + posted = 0; + if (SDL_GetEventState(SDL_SYSWMEVENT) == SDL_ENABLE) { + SDL_Event event; + SDL_memset(&event, 0, sizeof(event)); + event.type = SDL_SYSWMEVENT; + event.syswm.msg = message; + posted = (SDL_PushEvent(&event) > 0); + } + /* Update internal event state */ + return (posted); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_events_c.h b/src/events/SDL_events_c.h index 4378451507..f365ee3edd 100644 --- a/src/events/SDL_events_c.h +++ b/src/events/SDL_events_c.h @@ -1,83 +1,50 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Useful functions and variables from SDL_events.c */ #include "SDL_events.h" +#include "SDL_thread.h" +#include "SDL_clipboardevents_c.h" +#include "SDL_dropevents_c.h" +#include "SDL_gesture_c.h" +#include "SDL_keyboard_c.h" +#include "SDL_mouse_c.h" +#include "SDL_touch_c.h" +#include "SDL_windowevents_c.h" /* Start and stop the event processing loop */ -extern int SDL_StartEventLoop(Uint32 flags); +extern int SDL_StartEventLoop(void); extern void SDL_StopEventLoop(void); extern void SDL_QuitInterrupt(void); -extern void SDL_Lock_EventThread(void); -extern void SDL_Unlock_EventThread(void); -extern Uint32 SDL_EventThreadID(void); - -/* Event handler init routines */ -extern int SDL_AppActiveInit(void); -extern int SDL_KeyboardInit(void); -extern int SDL_MouseInit(void); -extern int SDL_QuitInit(void); +extern int SDL_SendAppEvent(SDL_EventType eventType); +extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message); -/* Event handler quit routines */ -extern void SDL_AppActiveQuit(void); -extern void SDL_KeyboardQuit(void); -extern void SDL_MouseQuit(void); +extern int SDL_QuitInit(void); +extern int SDL_SendQuit(void); extern void SDL_QuitQuit(void); /* The event filter function */ extern SDL_EventFilter SDL_EventOK; +extern void *SDL_EventOKParam; -/* The array of event processing states */ -extern Uint8 SDL_ProcessEvents[SDL_NUMEVENTS]; - -/* Internal event queueing functions - (from SDL_active.c, SDL_mouse.c, SDL_keyboard.c, SDL_quit.c, SDL_events.c) - */ -extern int SDL_PrivateAppActive(Uint8 gain, Uint8 state); -extern int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, - Sint16 x, Sint16 y); -extern int SDL_PrivateMouseButton(Uint8 state, Uint8 button,Sint16 x,Sint16 y); -extern int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *key); -extern int SDL_PrivateResize(int w, int h); -extern int SDL_PrivateExpose(void); -extern int SDL_PrivateQuit(void); -extern int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message); - -/* Used to clamp the mouse coordinates separately from the video surface */ -extern void SDL_SetMouseRange(int maxX, int maxY); - -/* Used by the activity event handler to remove mouse focus */ -extern void SDL_ResetMouse(void); - -/* Used by the activity event handler to remove keyboard focus */ -extern void SDL_ResetKeyboard(void); - -/* Used by the event loop to queue pending keyboard repeat events */ -extern void SDL_CheckKeyRepeat(void); - -/* Used by the OS keyboard code to detect whether or not to do UNICODE */ -#ifndef DEFAULT_UNICODE_TRANSLATION -#define DEFAULT_UNICODE_TRANSLATION 0 /* Default off because of overhead */ -#endif -extern int SDL_TranslateUNICODE; +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_expose.c b/src/events/SDL_expose.c deleted file mode 100644 index d5b01436d9..0000000000 --- a/src/events/SDL_expose.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Refresh event handling code for SDL */ - -#include "SDL_events.h" -#include "SDL_events_c.h" - - -/* This is global for SDL_eventloop.c */ -int SDL_PrivateExpose(void) -{ - int posted; - SDL_Event events[32]; - - /* Pull out all old refresh events */ - SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]), - SDL_GETEVENT, SDL_VIDEOEXPOSEMASK); - - /* Post the event, if desired */ - posted = 0; - if ( SDL_ProcessEvents[SDL_VIDEOEXPOSE] == SDL_ENABLE ) { - SDL_Event event; - event.type = SDL_VIDEOEXPOSE; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - return(posted); -} diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c new file mode 100644 index 0000000000..e987fcfbfe --- /dev/null +++ b/src/events/SDL_gesture.c @@ -0,0 +1,646 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +/* General mouse handling code for SDL */ + +#include "SDL_events.h" +#include "SDL_events_c.h" +#include "SDL_gesture_c.h" + +#if !defined(__PSP__) +#include +#endif + +#include +#include +#include + +/* TODO: Replace with malloc */ + +#define MAXPATHSIZE 1024 + +#define DOLLARNPOINTS 64 +#define DOLLARSIZE 256 + +#define ENABLE_DOLLAR + +#define PHI 0.618033989 + +typedef struct { + float x,y; +} SDL_FloatPoint; + +typedef struct { + float length; + + int numPoints; + SDL_FloatPoint p[MAXPATHSIZE]; +} SDL_DollarPath; + +typedef struct { + SDL_FloatPoint path[DOLLARNPOINTS]; + unsigned long hash; +} SDL_DollarTemplate; + +typedef struct { + SDL_TouchID id; + SDL_FloatPoint centroid; + SDL_DollarPath dollarPath; + Uint16 numDownFingers; + + int numDollarTemplates; + SDL_DollarTemplate *dollarTemplate; + + SDL_bool recording; +} SDL_GestureTouch; + +SDL_GestureTouch *SDL_gestureTouch; +int SDL_numGestureTouches = 0; +SDL_bool recordAll; + +#if 0 +static void PrintPath(SDL_FloatPoint *path) +{ + int i; + printf("Path:"); + for (i=0; i= 0) + return 1; + } + } + return (touchId < 0); +} + +static unsigned long SDL_HashDollar(SDL_FloatPoint* points) +{ + unsigned long hash = 5381; + int i; + for (i = 0; i < DOLLARNPOINTS; i++) { + hash = ((hash<<5) + hash) + (unsigned long)points[i].x; + hash = ((hash<<5) + hash) + (unsigned long)points[i].y; + } + return hash; +} + + +static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops * src) +{ + if (src == NULL) return 0; + + + //No Longer storing the Hash, rehash on load + //if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0; + + if (SDL_RWwrite(src,templ->path, + sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) + return 0; + + return 1; +} + + +int SDL_SaveAllDollarTemplates(SDL_RWops *src) +{ + int i,j,rtrn = 0; + for (i = 0; i < SDL_numGestureTouches; i++) { + SDL_GestureTouch* touch = &SDL_gestureTouch[i]; + for (j = 0; j < touch->numDollarTemplates; j++) { + rtrn += SaveTemplate(&touch->dollarTemplate[i],src); + } + } + return rtrn; +} + +int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *src) +{ + int i,j; + for (i = 0; i < SDL_numGestureTouches; i++) { + SDL_GestureTouch* touch = &SDL_gestureTouch[i]; + for (j = 0; j < touch->numDollarTemplates; j++) { + if (touch->dollarTemplate[i].hash == gestureId) { + return SaveTemplate(&touch->dollarTemplate[i],src); + } + } + } + return SDL_SetError("Unknown gestureId"); +} + +//path is an already sampled set of points +//Returns the index of the gesture on success, or -1 +static int SDL_AddDollarGesture_one(SDL_GestureTouch* inTouch, SDL_FloatPoint* path) +{ + SDL_DollarTemplate* dollarTemplate; + SDL_DollarTemplate *templ; + int index; + + index = inTouch->numDollarTemplates; + dollarTemplate = + (SDL_DollarTemplate *)SDL_realloc(inTouch->dollarTemplate, + (index + 1) * + sizeof(SDL_DollarTemplate)); + if (!dollarTemplate) { + return SDL_OutOfMemory(); + } + inTouch->dollarTemplate = dollarTemplate; + + templ = &inTouch->dollarTemplate[index]; + SDL_memcpy(templ->path, path, DOLLARNPOINTS*sizeof(SDL_FloatPoint)); + templ->hash = SDL_HashDollar(templ->path); + inTouch->numDollarTemplates++; + + return index; +} + +static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path) +{ + int index = -1; + int i = 0; + if (inTouch == NULL) { + if (SDL_numGestureTouches == 0) return -1; + for (i = 0; i < SDL_numGestureTouches; i++) { + inTouch = &SDL_gestureTouch[i]; + index = SDL_AddDollarGesture_one(inTouch, path); + if (index < 0) + return -1; + } + // Use the index of the last one added. + return index; + } else { + return SDL_AddDollarGesture_one(inTouch, path); + } + return -1; +} + +int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) +{ + int i,loaded = 0; + SDL_GestureTouch *touch = NULL; + if (src == NULL) return 0; + if (touchId >= 0) { + for (i = 0; i < SDL_numGestureTouches; i++) + if (SDL_gestureTouch[i].id == touchId) + touch = &SDL_gestureTouch[i]; + if (touch == NULL) return -1; + } + + while (1) { + SDL_DollarTemplate templ; + + if (SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) < + DOLLARNPOINTS) break; + + if (touchId >= 0) { + //printf("Adding loaded gesture to 1 touch\n"); + if (SDL_AddDollarGesture(touch, templ.path) >= 0) + loaded++; + } + else { + //printf("Adding to: %i touches\n",SDL_numGestureTouches); + for (i = 0; i < SDL_numGestureTouches; i++) { + touch = &SDL_gestureTouch[i]; + //printf("Adding loaded gesture to + touches\n"); + //TODO: What if this fails? + SDL_AddDollarGesture(touch,templ.path); + } + loaded++; + } + } + + return loaded; +} + + +static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) +{ + // SDL_FloatPoint p[DOLLARNPOINTS]; + float dist = 0; + SDL_FloatPoint p; + int i; + for (i = 0; i < DOLLARNPOINTS; i++) { + p.x = (float)(points[i].x * SDL_cos(ang) - points[i].y * SDL_sin(ang)); + p.y = (float)(points[i].x * SDL_sin(ang) + points[i].y * SDL_cos(ang)); + dist += (float)(SDL_sqrt((p.x-templ[i].x)*(p.x-templ[i].x)+ + (p.y-templ[i].y)*(p.y-templ[i].y))); + } + return dist/DOLLARNPOINTS; + +} + +static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) +{ + //------------BEGIN DOLLAR BLACKBOX----------------// + //-TRANSLATED DIRECTLY FROM PSUDEO-CODE AVAILABLE AT-// + //-"http://depts.washington.edu/aimgroup/proj/dollar/"-// + double ta = -M_PI/4; + double tb = M_PI/4; + double dt = M_PI/90; + float x1 = (float)(PHI*ta + (1-PHI)*tb); + float f1 = dollarDifference(points,templ,x1); + float x2 = (float)((1-PHI)*ta + PHI*tb); + float f2 = dollarDifference(points,templ,x2); + while (SDL_fabs(ta-tb) > dt) { + if (f1 < f2) { + tb = x2; + x2 = x1; + f2 = f1; + x1 = (float)(PHI*ta + (1-PHI)*tb); + f1 = dollarDifference(points,templ,x1); + } + else { + ta = x1; + x1 = x2; + f1 = f2; + x2 = (float)((1-PHI)*ta + PHI*tb); + f2 = dollarDifference(points,templ,x2); + } + } + /* + if (f1 <= f2) + printf("Min angle (x1): %f\n",x1); + else if (f1 > f2) + printf("Min angle (x2): %f\n",x2); + */ + return SDL_min(f1,f2); +} + +//DollarPath contains raw points, plus (possibly) the calculated length +static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) +{ + int i; + float interval; + float dist; + int numPoints = 0; + SDL_FloatPoint centroid; + float xmin,xmax,ymin,ymax; + float ang; + float w,h; + float length = path->length; + + //Calculate length if it hasn't already been done + if (length <= 0) { + for (i=1;i < path->numPoints; i++) { + float dx = path->p[i ].x - path->p[i-1].x; + float dy = path->p[i ].y - path->p[i-1].y; + length += (float)(SDL_sqrt(dx*dx+dy*dy)); + } + } + + //Resample + interval = length/(DOLLARNPOINTS - 1); + dist = interval; + + centroid.x = 0;centroid.y = 0; + + //printf("(%f,%f)\n",path->p[path->numPoints-1].x,path->p[path->numPoints-1].y); + for (i = 1; i < path->numPoints; i++) { + float d = (float)(SDL_sqrt((path->p[i-1].x-path->p[i].x)*(path->p[i-1].x-path->p[i].x)+ + (path->p[i-1].y-path->p[i].y)*(path->p[i-1].y-path->p[i].y))); + //printf("d = %f dist = %f/%f\n",d,dist,interval); + while (dist + d > interval) { + points[numPoints].x = path->p[i-1].x + + ((interval-dist)/d)*(path->p[i].x-path->p[i-1].x); + points[numPoints].y = path->p[i-1].y + + ((interval-dist)/d)*(path->p[i].y-path->p[i-1].y); + centroid.x += points[numPoints].x; + centroid.y += points[numPoints].y; + numPoints++; + + dist -= interval; + } + dist += d; + } + if (numPoints < DOLLARNPOINTS-1) { + SDL_SetError("ERROR: NumPoints = %i\n",numPoints); + return 0; + } + //copy the last point + points[DOLLARNPOINTS-1] = path->p[path->numPoints-1]; + numPoints = DOLLARNPOINTS; + + centroid.x /= numPoints; + centroid.y /= numPoints; + + //printf("Centroid (%f,%f)",centroid.x,centroid.y); + //Rotate Points so point 0 is left of centroid and solve for the bounding box + xmin = centroid.x; + xmax = centroid.x; + ymin = centroid.y; + ymax = centroid.y; + + ang = (float)(SDL_atan2(centroid.y - points[0].y, + centroid.x - points[0].x)); + + for (i = 0; i xmax) xmax = points[i].x; + if (points[i].y < ymin) ymin = points[i].y; + if (points[i].y > ymax) ymax = points[i].y; + } + + //Scale points to DOLLARSIZE, and translate to the origin + w = xmax-xmin; + h = ymax-ymin; + + for (i=0; inumDollarTemplates; i++) { + float diff = bestDollarDifference(points,touch->dollarTemplate[i].path); + if (diff < bestDiff) {bestDiff = diff; *bestTempl = i;} + } + return bestDiff; +} + +int SDL_GestureAddTouch(SDL_TouchID touchId) +{ + SDL_GestureTouch *gestureTouch = (SDL_GestureTouch *)SDL_realloc(SDL_gestureTouch, + (SDL_numGestureTouches + 1) * + sizeof(SDL_GestureTouch)); + + if (!gestureTouch) { + return SDL_OutOfMemory(); + } + + SDL_gestureTouch = gestureTouch; + + SDL_gestureTouch[SDL_numGestureTouches].numDownFingers = 0; + SDL_gestureTouch[SDL_numGestureTouches].id = touchId; + + SDL_gestureTouch[SDL_numGestureTouches].numDollarTemplates = 0; + + SDL_gestureTouch[SDL_numGestureTouches].recording = SDL_FALSE; + + SDL_numGestureTouches++; + return 0; +} + +static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) +{ + int i; + for (i = 0; i < SDL_numGestureTouches; i++) { + //printf("%i ?= %i\n",SDL_gestureTouch[i].id,id); + if (SDL_gestureTouch[i].id == id) + return &SDL_gestureTouch[i]; + } + return NULL; +} + +int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) +{ + SDL_Event event; + event.mgesture.type = SDL_MULTIGESTURE; + event.mgesture.touchId = touch->id; + event.mgesture.x = touch->centroid.x; + event.mgesture.y = touch->centroid.y; + event.mgesture.dTheta = dTheta; + event.mgesture.dDist = dDist; + event.mgesture.numFingers = touch->numDownFingers; + return SDL_PushEvent(&event) > 0; +} + +static int SDL_SendGestureDollar(SDL_GestureTouch* touch, + SDL_GestureID gestureId,float error) +{ + SDL_Event event; + event.dgesture.type = SDL_DOLLARGESTURE; + event.dgesture.touchId = touch->id; + event.mgesture.x = touch->centroid.x; + event.mgesture.y = touch->centroid.y; + event.dgesture.gestureId = gestureId; + event.dgesture.error = error; + //A finger came up to trigger this event. + event.dgesture.numFingers = touch->numDownFingers + 1; + return SDL_PushEvent(&event) > 0; +} + + +static int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId) +{ + SDL_Event event; + event.dgesture.type = SDL_DOLLARRECORD; + event.dgesture.touchId = touch->id; + event.dgesture.gestureId = gestureId; + return SDL_PushEvent(&event) > 0; +} + + +void SDL_GestureProcessEvent(SDL_Event* event) +{ + float x,y; + SDL_FloatPoint path[DOLLARNPOINTS]; + int index; + int i; + float pathDx, pathDy; + SDL_FloatPoint lastP; + SDL_FloatPoint lastCentroid; + float lDist; + float Dist; + float dtheta; + float dDist; + + if (event->type == SDL_FINGERMOTION || + event->type == SDL_FINGERDOWN || + event->type == SDL_FINGERUP) { + SDL_GestureTouch* inTouch = SDL_GetGestureTouch(event->tfinger.touchId); + + //Shouldn't be possible + if (inTouch == NULL) return; + + x = event->tfinger.x; + y = event->tfinger.y; + + //Finger Up + if (event->type == SDL_FINGERUP) { + inTouch->numDownFingers--; + +#ifdef ENABLE_DOLLAR + if (inTouch->recording) { + inTouch->recording = SDL_FALSE; + dollarNormalize(&inTouch->dollarPath,path); + //PrintPath(path); + if (recordAll) { + index = SDL_AddDollarGesture(NULL,path); + for (i = 0; i < SDL_numGestureTouches; i++) + SDL_gestureTouch[i].recording = SDL_FALSE; + } + else { + index = SDL_AddDollarGesture(inTouch,path); + } + + if (index >= 0) { + SDL_SendDollarRecord(inTouch,inTouch->dollarTemplate[index].hash); + } + else { + SDL_SendDollarRecord(inTouch,-1); + } + } + else { + int bestTempl; + float error; + error = dollarRecognize(&inTouch->dollarPath, + &bestTempl,inTouch); + if (bestTempl >= 0){ + //Send Event + unsigned long gestureId = inTouch->dollarTemplate[bestTempl].hash; + SDL_SendGestureDollar(inTouch,gestureId,error); + //printf ("%s\n",);("Dollar error: %f\n",error); + } + } +#endif + //inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers]; + if (inTouch->numDownFingers > 0) { + inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers+1)- + x)/inTouch->numDownFingers; + inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers+1)- + y)/inTouch->numDownFingers; + } + } + else if (event->type == SDL_FINGERMOTION) { + float dx = event->tfinger.dx; + float dy = event->tfinger.dy; +#ifdef ENABLE_DOLLAR + SDL_DollarPath* path = &inTouch->dollarPath; + if (path->numPoints < MAXPATHSIZE) { + path->p[path->numPoints].x = inTouch->centroid.x; + path->p[path->numPoints].y = inTouch->centroid.y; + pathDx = + (path->p[path->numPoints].x-path->p[path->numPoints-1].x); + pathDy = + (path->p[path->numPoints].y-path->p[path->numPoints-1].y); + path->length += (float)SDL_sqrt(pathDx*pathDx + pathDy*pathDy); + path->numPoints++; + } +#endif + lastP.x = x - dx; + lastP.y = y - dy; + lastCentroid = inTouch->centroid; + + inTouch->centroid.x += dx/inTouch->numDownFingers; + inTouch->centroid.y += dy/inTouch->numDownFingers; + //printf("Centrid : (%f,%f)\n",inTouch->centroid.x,inTouch->centroid.y); + if (inTouch->numDownFingers > 1) { + SDL_FloatPoint lv; //Vector from centroid to last x,y position + SDL_FloatPoint v; //Vector from centroid to current x,y position + //lv = inTouch->gestureLast[j].cv; + lv.x = lastP.x - lastCentroid.x; + lv.y = lastP.y - lastCentroid.y; + lDist = (float)SDL_sqrt(lv.x*lv.x + lv.y*lv.y); + //printf("lDist = %f\n",lDist); + v.x = x - inTouch->centroid.x; + v.y = y - inTouch->centroid.y; + //inTouch->gestureLast[j].cv = v; + Dist = (float)SDL_sqrt(v.x*v.x+v.y*v.y); + // SDL_cos(dTheta) = (v . lv)/(|v| * |lv|) + + //Normalize Vectors to simplify angle calculation + lv.x/=lDist; + lv.y/=lDist; + v.x/=Dist; + v.y/=Dist; + dtheta = (float)SDL_atan2(lv.x*v.y - lv.y*v.x,lv.x*v.x + lv.y*v.y); + + dDist = (Dist - lDist); + if (lDist == 0) {dDist = 0;dtheta = 0;} //To avoid impossible values + + //inTouch->gestureLast[j].dDist = dDist; + //inTouch->gestureLast[j].dtheta = dtheta; + + //printf("dDist = %f, dTheta = %f\n",dDist,dtheta); + //gdtheta = gdtheta*.9 + dtheta*.1; + //gdDist = gdDist*.9 + dDist*.1 + //knob.r += dDist/numDownFingers; + //knob.ang += dtheta; + //printf("thetaSum = %f, distSum = %f\n",gdtheta,gdDist); + //printf("id: %i dTheta = %f, dDist = %f\n",j,dtheta,dDist); + SDL_SendGestureMulti(inTouch,dtheta,dDist); + } + else { + //inTouch->gestureLast[j].dDist = 0; + //inTouch->gestureLast[j].dtheta = 0; + //inTouch->gestureLast[j].cv.x = 0; + //inTouch->gestureLast[j].cv.y = 0; + } + //inTouch->gestureLast[j].f.p.x = x; + //inTouch->gestureLast[j].f.p.y = y; + //break; + //pressure? + } + + if (event->type == SDL_FINGERDOWN) { + + inTouch->numDownFingers++; + inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers - 1)+ + x)/inTouch->numDownFingers; + inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers - 1)+ + y)/inTouch->numDownFingers; + //printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y, + // inTouch->centroid.x,inTouch->centroid.y); + +#ifdef ENABLE_DOLLAR + inTouch->dollarPath.length = 0; + inTouch->dollarPath.p[0].x = x; + inTouch->dollarPath.p[0].y = y; + inTouch->dollarPath.numPoints = 1; +#endif + } + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_gesture_c.h b/src/events/SDL_gesture_c.h new file mode 100644 index 0000000000..08ba2e80c5 --- /dev/null +++ b/src/events/SDL_gesture_c.h @@ -0,0 +1,34 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_gesture_c_h +#define _SDL_gesture_c_h + +extern int SDL_GestureAddTouch(SDL_TouchID touchId); + +extern void SDL_GestureProcessEvent(SDL_Event* event); + +extern int SDL_RecordGesture(SDL_TouchID touchId); + +#endif /* _SDL_gesture_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 5753927e28..a3ed168696 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,589 +25,989 @@ #include "SDL_timer.h" #include "SDL_events.h" #include "SDL_events_c.h" -#include "SDL_sysevents.h" +#include "../video/SDL_sysvideo.h" -/* Global keystate information */ -static Uint8 SDL_KeyState[SDLK_LAST]; -static SDLMod SDL_ModState; -int SDL_TranslateUNICODE = 0; +/*#define DEBUG_KEYBOARD*/ -static const char *keynames[SDLK_LAST]; /* Array of keycode names */ +/* Global keyboard information */ -/* - * jk 991215 - added - */ -struct { - int firsttime; /* if we check against the delay or repeat value */ - int delay; /* the delay before we start repeating */ - int interval; /* the delay between key repeat events */ - Uint32 timestamp; /* the time the first keydown event occurred */ +typedef struct SDL_Keyboard SDL_Keyboard; - SDL_Event evt; /* the event we are supposed to repeat */ -} SDL_KeyRepeat; +struct SDL_Keyboard +{ + /* Data common to all keyboards */ + SDL_Window *focus; + Uint16 modstate; + Uint8 keystate[SDL_NUM_SCANCODES]; + SDL_Keycode keymap[SDL_NUM_SCANCODES]; +}; + +static SDL_Keyboard SDL_keyboard; + +static const SDL_Keycode SDL_default_keymap[SDL_NUM_SCANCODES] = { + 0, 0, 0, 0, + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '0', + SDLK_RETURN, + SDLK_ESCAPE, + SDLK_BACKSPACE, + SDLK_TAB, + SDLK_SPACE, + '-', + '=', + '[', + ']', + '\\', + '#', + ';', + '\'', + '`', + ',', + '.', + '/', + SDLK_CAPSLOCK, + SDLK_F1, + SDLK_F2, + SDLK_F3, + SDLK_F4, + SDLK_F5, + SDLK_F6, + SDLK_F7, + SDLK_F8, + SDLK_F9, + SDLK_F10, + SDLK_F11, + SDLK_F12, + SDLK_PRINTSCREEN, + SDLK_SCROLLLOCK, + SDLK_PAUSE, + SDLK_INSERT, + SDLK_HOME, + SDLK_PAGEUP, + SDLK_DELETE, + SDLK_END, + SDLK_PAGEDOWN, + SDLK_RIGHT, + SDLK_LEFT, + SDLK_DOWN, + SDLK_UP, + SDLK_NUMLOCKCLEAR, + SDLK_KP_DIVIDE, + SDLK_KP_MULTIPLY, + SDLK_KP_MINUS, + SDLK_KP_PLUS, + SDLK_KP_ENTER, + SDLK_KP_1, + SDLK_KP_2, + SDLK_KP_3, + SDLK_KP_4, + SDLK_KP_5, + SDLK_KP_6, + SDLK_KP_7, + SDLK_KP_8, + SDLK_KP_9, + SDLK_KP_0, + SDLK_KP_PERIOD, + 0, + SDLK_APPLICATION, + SDLK_POWER, + SDLK_KP_EQUALS, + SDLK_F13, + SDLK_F14, + SDLK_F15, + SDLK_F16, + SDLK_F17, + SDLK_F18, + SDLK_F19, + SDLK_F20, + SDLK_F21, + SDLK_F22, + SDLK_F23, + SDLK_F24, + SDLK_EXECUTE, + SDLK_HELP, + SDLK_MENU, + SDLK_SELECT, + SDLK_STOP, + SDLK_AGAIN, + SDLK_UNDO, + SDLK_CUT, + SDLK_COPY, + SDLK_PASTE, + SDLK_FIND, + SDLK_MUTE, + SDLK_VOLUMEUP, + SDLK_VOLUMEDOWN, + 0, 0, 0, + SDLK_KP_COMMA, + SDLK_KP_EQUALSAS400, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + SDLK_ALTERASE, + SDLK_SYSREQ, + SDLK_CANCEL, + SDLK_CLEAR, + SDLK_PRIOR, + SDLK_RETURN2, + SDLK_SEPARATOR, + SDLK_OUT, + SDLK_OPER, + SDLK_CLEARAGAIN, + SDLK_CRSEL, + SDLK_EXSEL, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + SDLK_KP_00, + SDLK_KP_000, + SDLK_THOUSANDSSEPARATOR, + SDLK_DECIMALSEPARATOR, + SDLK_CURRENCYUNIT, + SDLK_CURRENCYSUBUNIT, + SDLK_KP_LEFTPAREN, + SDLK_KP_RIGHTPAREN, + SDLK_KP_LEFTBRACE, + SDLK_KP_RIGHTBRACE, + SDLK_KP_TAB, + SDLK_KP_BACKSPACE, + SDLK_KP_A, + SDLK_KP_B, + SDLK_KP_C, + SDLK_KP_D, + SDLK_KP_E, + SDLK_KP_F, + SDLK_KP_XOR, + SDLK_KP_POWER, + SDLK_KP_PERCENT, + SDLK_KP_LESS, + SDLK_KP_GREATER, + SDLK_KP_AMPERSAND, + SDLK_KP_DBLAMPERSAND, + SDLK_KP_VERTICALBAR, + SDLK_KP_DBLVERTICALBAR, + SDLK_KP_COLON, + SDLK_KP_HASH, + SDLK_KP_SPACE, + SDLK_KP_AT, + SDLK_KP_EXCLAM, + SDLK_KP_MEMSTORE, + SDLK_KP_MEMRECALL, + SDLK_KP_MEMCLEAR, + SDLK_KP_MEMADD, + SDLK_KP_MEMSUBTRACT, + SDLK_KP_MEMMULTIPLY, + SDLK_KP_MEMDIVIDE, + SDLK_KP_PLUSMINUS, + SDLK_KP_CLEAR, + SDLK_KP_CLEARENTRY, + SDLK_KP_BINARY, + SDLK_KP_OCTAL, + SDLK_KP_DECIMAL, + SDLK_KP_HEXADECIMAL, + 0, 0, + SDLK_LCTRL, + SDLK_LSHIFT, + SDLK_LALT, + SDLK_LGUI, + SDLK_RCTRL, + SDLK_RSHIFT, + SDLK_RALT, + SDLK_RGUI, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + SDLK_MODE, + SDLK_AUDIONEXT, + SDLK_AUDIOPREV, + SDLK_AUDIOSTOP, + SDLK_AUDIOPLAY, + SDLK_AUDIOMUTE, + SDLK_MEDIASELECT, + SDLK_WWW, + SDLK_MAIL, + SDLK_CALCULATOR, + SDLK_COMPUTER, + SDLK_AC_SEARCH, + SDLK_AC_HOME, + SDLK_AC_BACK, + SDLK_AC_FORWARD, + SDLK_AC_STOP, + SDLK_AC_REFRESH, + SDLK_AC_BOOKMARKS, + SDLK_BRIGHTNESSDOWN, + SDLK_BRIGHTNESSUP, + SDLK_DISPLAYSWITCH, + SDLK_KBDILLUMTOGGLE, + SDLK_KBDILLUMDOWN, + SDLK_KBDILLUMUP, + SDLK_EJECT, + SDLK_SLEEP, +}; + +static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = { + NULL, NULL, NULL, NULL, + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "0", + "Return", + "Escape", + "Backspace", + "Tab", + "Space", + "-", + "=", + "[", + "]", + "\\", + "#", + ";", + "'", + "`", + ",", + ".", + "/", + "CapsLock", + "F1", + "F2", + "F3", + "F4", + "F5", + "F6", + "F7", + "F8", + "F9", + "F10", + "F11", + "F12", + "PrintScreen", + "ScrollLock", + "Pause", + "Insert", + "Home", + "PageUp", + "Delete", + "End", + "PageDown", + "Right", + "Left", + "Down", + "Up", + "Numlock", + "Keypad /", + "Keypad *", + "Keypad -", + "Keypad +", + "Keypad Enter", + "Keypad 1", + "Keypad 2", + "Keypad 3", + "Keypad 4", + "Keypad 5", + "Keypad 6", + "Keypad 7", + "Keypad 8", + "Keypad 9", + "Keypad 0", + "Keypad .", + NULL, + "Application", + "Power", + "Keypad =", + "F13", + "F14", + "F15", + "F16", + "F17", + "F18", + "F19", + "F20", + "F21", + "F22", + "F23", + "F24", + "Execute", + "Help", + "Menu", + "Select", + "Stop", + "Again", + "Undo", + "Cut", + "Copy", + "Paste", + "Find", + "Mute", + "VolumeUp", + "VolumeDown", + NULL, NULL, NULL, + "Keypad ,", + "Keypad = (AS400)", + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, + "AltErase", + "SysReq", + "Cancel", + "Clear", + "Prior", + "Return", + "Separator", + "Out", + "Oper", + "Clear / Again", + "CrSel", + "ExSel", + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "Keypad 00", + "Keypad 000", + "ThousandsSeparator", + "DecimalSeparator", + "CurrencyUnit", + "CurrencySubUnit", + "Keypad (", + "Keypad )", + "Keypad {", + "Keypad }", + "Keypad Tab", + "Keypad Backspace", + "Keypad A", + "Keypad B", + "Keypad C", + "Keypad D", + "Keypad E", + "Keypad F", + "Keypad XOR", + "Keypad ^", + "Keypad %", + "Keypad <", + "Keypad >", + "Keypad &", + "Keypad &&", + "Keypad |", + "Keypad ||", + "Keypad :", + "Keypad #", + "Keypad Space", + "Keypad @", + "Keypad !", + "Keypad MemStore", + "Keypad MemRecall", + "Keypad MemClear", + "Keypad MemAdd", + "Keypad MemSubtract", + "Keypad MemMultiply", + "Keypad MemDivide", + "Keypad +/-", + "Keypad Clear", + "Keypad ClearEntry", + "Keypad Binary", + "Keypad Octal", + "Keypad Decimal", + "Keypad Hexadecimal", + NULL, NULL, + "Left Ctrl", + "Left Shift", + "Left Alt", + "Left GUI", + "Right Ctrl", + "Right Shift", + "Right Alt", + "Right GUI", + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, + "ModeSwitch", + "AudioNext", + "AudioPrev", + "AudioStop", + "AudioPlay", + "AudioMute", + "MediaSelect", + "WWW", + "Mail", + "Calculator", + "Computer", + "AC Search", + "AC Home", + "AC Back", + "AC Forward", + "AC Stop", + "AC Refresh", + "AC Bookmarks", + "BrightnessDown", + "BrightnessUp", + "DisplaySwitch", + "KBDIllumToggle", + "KBDIllumDown", + "KBDIllumUp", + "Eject", + "Sleep", +}; + +/* Taken from SDL_iconv() */ +static char * +SDL_UCS4ToUTF8(Uint32 ch, char *dst) +{ + Uint8 *p = (Uint8 *) dst; + if (ch <= 0x7F) { + *p = (Uint8) ch; + ++dst; + } else if (ch <= 0x7FF) { + p[0] = 0xC0 | (Uint8) ((ch >> 6) & 0x1F); + p[1] = 0x80 | (Uint8) (ch & 0x3F); + dst += 2; + } else if (ch <= 0xFFFF) { + p[0] = 0xE0 | (Uint8) ((ch >> 12) & 0x0F); + p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[2] = 0x80 | (Uint8) (ch & 0x3F); + dst += 3; + } else if (ch <= 0x1FFFFF) { + p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07); + p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); + p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[3] = 0x80 | (Uint8) (ch & 0x3F); + dst += 4; + } else if (ch <= 0x3FFFFFF) { + p[0] = 0xF8 | (Uint8) ((ch >> 24) & 0x03); + p[1] = 0x80 | (Uint8) ((ch >> 18) & 0x3F); + p[2] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); + p[3] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[4] = 0x80 | (Uint8) (ch & 0x3F); + dst += 5; + } else { + p[0] = 0xFC | (Uint8) ((ch >> 30) & 0x01); + p[1] = 0x80 | (Uint8) ((ch >> 24) & 0x3F); + p[2] = 0x80 | (Uint8) ((ch >> 18) & 0x3F); + p[3] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); + p[4] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[5] = 0x80 | (Uint8) (ch & 0x3F); + dst += 6; + } + return dst; +} -/* Global no-lock-keys support */ -static Uint8 SDL_NoLockKeys; +/* Public functions */ +int +SDL_KeyboardInit(void) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; -#define SDL_NLK_CAPS 0x01 -#define SDL_NLK_NUM 0x02 + /* Set the default keymap */ + SDL_memcpy(keyboard->keymap, SDL_default_keymap, sizeof(SDL_default_keymap)); + return (0); +} -/* Public functions */ -int SDL_KeyboardInit(void) +void +SDL_ResetKeyboard(void) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + SDL_Scancode scancode; + +#ifdef DEBUG_KEYBOARD + printf("Resetting keyboard\n"); +#endif + for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) { + if (keyboard->keystate[scancode] == SDL_PRESSED) { + SDL_SendKeyboardKey(SDL_RELEASED, scancode); + } + } +} + +void +SDL_GetDefaultKeymap(SDL_Keycode * keymap) { - const char* env; - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - /* Set default mode of UNICODE translation */ - SDL_EnableUNICODE(DEFAULT_UNICODE_TRANSLATION); - - /* Initialize the tables */ - SDL_ModState = KMOD_NONE; - SDL_memset((void*)keynames, 0, sizeof(keynames)); - SDL_memset(SDL_KeyState, 0, sizeof(SDL_KeyState)); - video->InitOSKeymap(this); - - SDL_EnableKeyRepeat(0, 0); - - /* Allow environment override to disable special lock-key behavior */ - SDL_NoLockKeys = 0; - env = SDL_getenv("SDL_DISABLE_LOCK_KEYS"); - if (env) { - switch (SDL_atoi(env)) { - case 1: - SDL_NoLockKeys = SDL_NLK_CAPS | SDL_NLK_NUM; - break; - case 2: - SDL_NoLockKeys = SDL_NLK_CAPS; - break; - case 3: - SDL_NoLockKeys = SDL_NLK_NUM; - break; - default: - break; - } - } - - /* Fill in the blanks in keynames */ - keynames[SDLK_BACKSPACE] = "backspace"; - keynames[SDLK_TAB] = "tab"; - keynames[SDLK_CLEAR] = "clear"; - keynames[SDLK_RETURN] = "return"; - keynames[SDLK_PAUSE] = "pause"; - keynames[SDLK_ESCAPE] = "escape"; - keynames[SDLK_SPACE] = "space"; - keynames[SDLK_EXCLAIM] = "!"; - keynames[SDLK_QUOTEDBL] = "\""; - keynames[SDLK_HASH] = "#"; - keynames[SDLK_DOLLAR] = "$"; - keynames[SDLK_AMPERSAND] = "&"; - keynames[SDLK_QUOTE] = "'"; - keynames[SDLK_LEFTPAREN] = "("; - keynames[SDLK_RIGHTPAREN] = ")"; - keynames[SDLK_ASTERISK] = "*"; - keynames[SDLK_PLUS] = "+"; - keynames[SDLK_COMMA] = ","; - keynames[SDLK_MINUS] = "-"; - keynames[SDLK_PERIOD] = "."; - keynames[SDLK_SLASH] = "/"; - keynames[SDLK_0] = "0"; - keynames[SDLK_1] = "1"; - keynames[SDLK_2] = "2"; - keynames[SDLK_3] = "3"; - keynames[SDLK_4] = "4"; - keynames[SDLK_5] = "5"; - keynames[SDLK_6] = "6"; - keynames[SDLK_7] = "7"; - keynames[SDLK_8] = "8"; - keynames[SDLK_9] = "9"; - keynames[SDLK_COLON] = ":"; - keynames[SDLK_SEMICOLON] = ";"; - keynames[SDLK_LESS] = "<"; - keynames[SDLK_EQUALS] = "="; - keynames[SDLK_GREATER] = ">"; - keynames[SDLK_QUESTION] = "?"; - keynames[SDLK_AT] = "@"; - keynames[SDLK_LEFTBRACKET] = "["; - keynames[SDLK_BACKSLASH] = "\\"; - keynames[SDLK_RIGHTBRACKET] = "]"; - keynames[SDLK_CARET] = "^"; - keynames[SDLK_UNDERSCORE] = "_"; - keynames[SDLK_BACKQUOTE] = "`"; - keynames[SDLK_a] = "a"; - keynames[SDLK_b] = "b"; - keynames[SDLK_c] = "c"; - keynames[SDLK_d] = "d"; - keynames[SDLK_e] = "e"; - keynames[SDLK_f] = "f"; - keynames[SDLK_g] = "g"; - keynames[SDLK_h] = "h"; - keynames[SDLK_i] = "i"; - keynames[SDLK_j] = "j"; - keynames[SDLK_k] = "k"; - keynames[SDLK_l] = "l"; - keynames[SDLK_m] = "m"; - keynames[SDLK_n] = "n"; - keynames[SDLK_o] = "o"; - keynames[SDLK_p] = "p"; - keynames[SDLK_q] = "q"; - keynames[SDLK_r] = "r"; - keynames[SDLK_s] = "s"; - keynames[SDLK_t] = "t"; - keynames[SDLK_u] = "u"; - keynames[SDLK_v] = "v"; - keynames[SDLK_w] = "w"; - keynames[SDLK_x] = "x"; - keynames[SDLK_y] = "y"; - keynames[SDLK_z] = "z"; - keynames[SDLK_DELETE] = "delete"; - - keynames[SDLK_WORLD_0] = "world 0"; - keynames[SDLK_WORLD_1] = "world 1"; - keynames[SDLK_WORLD_2] = "world 2"; - keynames[SDLK_WORLD_3] = "world 3"; - keynames[SDLK_WORLD_4] = "world 4"; - keynames[SDLK_WORLD_5] = "world 5"; - keynames[SDLK_WORLD_6] = "world 6"; - keynames[SDLK_WORLD_7] = "world 7"; - keynames[SDLK_WORLD_8] = "world 8"; - keynames[SDLK_WORLD_9] = "world 9"; - keynames[SDLK_WORLD_10] = "world 10"; - keynames[SDLK_WORLD_11] = "world 11"; - keynames[SDLK_WORLD_12] = "world 12"; - keynames[SDLK_WORLD_13] = "world 13"; - keynames[SDLK_WORLD_14] = "world 14"; - keynames[SDLK_WORLD_15] = "world 15"; - keynames[SDLK_WORLD_16] = "world 16"; - keynames[SDLK_WORLD_17] = "world 17"; - keynames[SDLK_WORLD_18] = "world 18"; - keynames[SDLK_WORLD_19] = "world 19"; - keynames[SDLK_WORLD_20] = "world 20"; - keynames[SDLK_WORLD_21] = "world 21"; - keynames[SDLK_WORLD_22] = "world 22"; - keynames[SDLK_WORLD_23] = "world 23"; - keynames[SDLK_WORLD_24] = "world 24"; - keynames[SDLK_WORLD_25] = "world 25"; - keynames[SDLK_WORLD_26] = "world 26"; - keynames[SDLK_WORLD_27] = "world 27"; - keynames[SDLK_WORLD_28] = "world 28"; - keynames[SDLK_WORLD_29] = "world 29"; - keynames[SDLK_WORLD_30] = "world 30"; - keynames[SDLK_WORLD_31] = "world 31"; - keynames[SDLK_WORLD_32] = "world 32"; - keynames[SDLK_WORLD_33] = "world 33"; - keynames[SDLK_WORLD_34] = "world 34"; - keynames[SDLK_WORLD_35] = "world 35"; - keynames[SDLK_WORLD_36] = "world 36"; - keynames[SDLK_WORLD_37] = "world 37"; - keynames[SDLK_WORLD_38] = "world 38"; - keynames[SDLK_WORLD_39] = "world 39"; - keynames[SDLK_WORLD_40] = "world 40"; - keynames[SDLK_WORLD_41] = "world 41"; - keynames[SDLK_WORLD_42] = "world 42"; - keynames[SDLK_WORLD_43] = "world 43"; - keynames[SDLK_WORLD_44] = "world 44"; - keynames[SDLK_WORLD_45] = "world 45"; - keynames[SDLK_WORLD_46] = "world 46"; - keynames[SDLK_WORLD_47] = "world 47"; - keynames[SDLK_WORLD_48] = "world 48"; - keynames[SDLK_WORLD_49] = "world 49"; - keynames[SDLK_WORLD_50] = "world 50"; - keynames[SDLK_WORLD_51] = "world 51"; - keynames[SDLK_WORLD_52] = "world 52"; - keynames[SDLK_WORLD_53] = "world 53"; - keynames[SDLK_WORLD_54] = "world 54"; - keynames[SDLK_WORLD_55] = "world 55"; - keynames[SDLK_WORLD_56] = "world 56"; - keynames[SDLK_WORLD_57] = "world 57"; - keynames[SDLK_WORLD_58] = "world 58"; - keynames[SDLK_WORLD_59] = "world 59"; - keynames[SDLK_WORLD_60] = "world 60"; - keynames[SDLK_WORLD_61] = "world 61"; - keynames[SDLK_WORLD_62] = "world 62"; - keynames[SDLK_WORLD_63] = "world 63"; - keynames[SDLK_WORLD_64] = "world 64"; - keynames[SDLK_WORLD_65] = "world 65"; - keynames[SDLK_WORLD_66] = "world 66"; - keynames[SDLK_WORLD_67] = "world 67"; - keynames[SDLK_WORLD_68] = "world 68"; - keynames[SDLK_WORLD_69] = "world 69"; - keynames[SDLK_WORLD_70] = "world 70"; - keynames[SDLK_WORLD_71] = "world 71"; - keynames[SDLK_WORLD_72] = "world 72"; - keynames[SDLK_WORLD_73] = "world 73"; - keynames[SDLK_WORLD_74] = "world 74"; - keynames[SDLK_WORLD_75] = "world 75"; - keynames[SDLK_WORLD_76] = "world 76"; - keynames[SDLK_WORLD_77] = "world 77"; - keynames[SDLK_WORLD_78] = "world 78"; - keynames[SDLK_WORLD_79] = "world 79"; - keynames[SDLK_WORLD_80] = "world 80"; - keynames[SDLK_WORLD_81] = "world 81"; - keynames[SDLK_WORLD_82] = "world 82"; - keynames[SDLK_WORLD_83] = "world 83"; - keynames[SDLK_WORLD_84] = "world 84"; - keynames[SDLK_WORLD_85] = "world 85"; - keynames[SDLK_WORLD_86] = "world 86"; - keynames[SDLK_WORLD_87] = "world 87"; - keynames[SDLK_WORLD_88] = "world 88"; - keynames[SDLK_WORLD_89] = "world 89"; - keynames[SDLK_WORLD_90] = "world 90"; - keynames[SDLK_WORLD_91] = "world 91"; - keynames[SDLK_WORLD_92] = "world 92"; - keynames[SDLK_WORLD_93] = "world 93"; - keynames[SDLK_WORLD_94] = "world 94"; - keynames[SDLK_WORLD_95] = "world 95"; - - keynames[SDLK_KP0] = "[0]"; - keynames[SDLK_KP1] = "[1]"; - keynames[SDLK_KP2] = "[2]"; - keynames[SDLK_KP3] = "[3]"; - keynames[SDLK_KP4] = "[4]"; - keynames[SDLK_KP5] = "[5]"; - keynames[SDLK_KP6] = "[6]"; - keynames[SDLK_KP7] = "[7]"; - keynames[SDLK_KP8] = "[8]"; - keynames[SDLK_KP9] = "[9]"; - keynames[SDLK_KP_PERIOD] = "[.]"; - keynames[SDLK_KP_DIVIDE] = "[/]"; - keynames[SDLK_KP_MULTIPLY] = "[*]"; - keynames[SDLK_KP_MINUS] = "[-]"; - keynames[SDLK_KP_PLUS] = "[+]"; - keynames[SDLK_KP_ENTER] = "enter"; - keynames[SDLK_KP_EQUALS] = "equals"; - - keynames[SDLK_UP] = "up"; - keynames[SDLK_DOWN] = "down"; - keynames[SDLK_RIGHT] = "right"; - keynames[SDLK_LEFT] = "left"; - keynames[SDLK_DOWN] = "down"; - keynames[SDLK_INSERT] = "insert"; - keynames[SDLK_HOME] = "home"; - keynames[SDLK_END] = "end"; - keynames[SDLK_PAGEUP] = "page up"; - keynames[SDLK_PAGEDOWN] = "page down"; - - keynames[SDLK_F1] = "f1"; - keynames[SDLK_F2] = "f2"; - keynames[SDLK_F3] = "f3"; - keynames[SDLK_F4] = "f4"; - keynames[SDLK_F5] = "f5"; - keynames[SDLK_F6] = "f6"; - keynames[SDLK_F7] = "f7"; - keynames[SDLK_F8] = "f8"; - keynames[SDLK_F9] = "f9"; - keynames[SDLK_F10] = "f10"; - keynames[SDLK_F11] = "f11"; - keynames[SDLK_F12] = "f12"; - keynames[SDLK_F13] = "f13"; - keynames[SDLK_F14] = "f14"; - keynames[SDLK_F15] = "f15"; - - keynames[SDLK_NUMLOCK] = "numlock"; - keynames[SDLK_CAPSLOCK] = "caps lock"; - keynames[SDLK_SCROLLOCK] = "scroll lock"; - keynames[SDLK_RSHIFT] = "right shift"; - keynames[SDLK_LSHIFT] = "left shift"; - keynames[SDLK_RCTRL] = "right ctrl"; - keynames[SDLK_LCTRL] = "left ctrl"; - keynames[SDLK_RALT] = "right alt"; - keynames[SDLK_LALT] = "left alt"; - keynames[SDLK_RMETA] = "right meta"; - keynames[SDLK_LMETA] = "left meta"; - keynames[SDLK_LSUPER] = "left super"; /* "Windows" keys */ - keynames[SDLK_RSUPER] = "right super"; - keynames[SDLK_MODE] = "alt gr"; - keynames[SDLK_COMPOSE] = "compose"; - - keynames[SDLK_HELP] = "help"; - keynames[SDLK_PRINT] = "print screen"; - keynames[SDLK_SYSREQ] = "sys req"; - keynames[SDLK_BREAK] = "break"; - keynames[SDLK_MENU] = "menu"; - keynames[SDLK_POWER] = "power"; - keynames[SDLK_EURO] = "euro"; - keynames[SDLK_UNDO] = "undo"; - - /* Done. Whew. */ - return(0); + SDL_memcpy(keymap, SDL_default_keymap, sizeof(SDL_default_keymap)); } -void SDL_KeyboardQuit(void) + +void +SDL_SetKeymap(int start, SDL_Keycode * keys, int length) { + SDL_Keyboard *keyboard = &SDL_keyboard; + + if (start < 0 || start + length > SDL_NUM_SCANCODES) { + return; + } + + SDL_memcpy(&keyboard->keymap[start], keys, sizeof(*keys) * length); } -/* We lost the keyboard, so post key up messages for all pressed keys */ -void SDL_ResetKeyboard(void) +void +SDL_SetScancodeName(SDL_Scancode scancode, const char *name) { - SDL_keysym keysym; - SDLKey key; - - SDL_memset(&keysym, 0, (sizeof keysym)); - for ( key=SDLK_FIRST; key= 0 ) { - SDL_TranslateUNICODE = enable; - } - return(old_mode); + return keyboard->focus; } -Uint8 * SDL_GetKeyState (int *numkeys) +void +SDL_SetKeyboardFocus(SDL_Window * window) { - if ( numkeys != (int *)0 ) - *numkeys = SDLK_LAST; - return(SDL_KeyState); + SDL_Keyboard *keyboard = &SDL_keyboard; + + if (keyboard->focus && !window) { + /* We won't get anymore keyboard messages, so reset keyboard state */ + SDL_ResetKeyboard(); + } + + /* See if the current window has lost focus */ + if (keyboard->focus && keyboard->focus != window) { + SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_LOST, + 0, 0); + + /* Ensures IME compositions are committed */ + if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { + SDL_VideoDevice *video = SDL_GetVideoDevice(); + if (video && video->StopTextInput) { + video->StopTextInput(video); + } + } + } + + keyboard->focus = window; + + if (keyboard->focus) { + SDL_SendWindowEvent(keyboard->focus, SDL_WINDOWEVENT_FOCUS_GAINED, + 0, 0); + + if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { + SDL_VideoDevice *video = SDL_GetVideoDevice(); + if (video && video->StartTextInput) { + video->StartTextInput(video); + } + } + } } -SDLMod SDL_GetModState (void) + +int +SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) { - return(SDL_ModState); + SDL_Keyboard *keyboard = &SDL_keyboard; + int posted; + Uint16 modstate; + Uint32 type; + Uint8 repeat; + + if (!scancode) { + return 0; + } +#ifdef DEBUG_KEYBOARD + printf("The '%s' key has been %s\n", SDL_GetScancodeName(scancode), + state == SDL_PRESSED ? "pressed" : "released"); +#endif + if (state == SDL_PRESSED) { + modstate = keyboard->modstate; + switch (scancode) { + case SDL_SCANCODE_NUMLOCKCLEAR: + keyboard->modstate ^= KMOD_NUM; + break; + case SDL_SCANCODE_CAPSLOCK: + keyboard->modstate ^= KMOD_CAPS; + break; + case SDL_SCANCODE_LCTRL: + keyboard->modstate |= KMOD_LCTRL; + break; + case SDL_SCANCODE_RCTRL: + keyboard->modstate |= KMOD_RCTRL; + break; + case SDL_SCANCODE_LSHIFT: + keyboard->modstate |= KMOD_LSHIFT; + break; + case SDL_SCANCODE_RSHIFT: + keyboard->modstate |= KMOD_RSHIFT; + break; + case SDL_SCANCODE_LALT: + keyboard->modstate |= KMOD_LALT; + break; + case SDL_SCANCODE_RALT: + keyboard->modstate |= KMOD_RALT; + break; + case SDL_SCANCODE_LGUI: + keyboard->modstate |= KMOD_LGUI; + break; + case SDL_SCANCODE_RGUI: + keyboard->modstate |= KMOD_RGUI; + break; + case SDL_SCANCODE_MODE: + keyboard->modstate |= KMOD_MODE; + break; + default: + break; + } + } else { + switch (scancode) { + case SDL_SCANCODE_NUMLOCKCLEAR: + case SDL_SCANCODE_CAPSLOCK: + break; + case SDL_SCANCODE_LCTRL: + keyboard->modstate &= ~KMOD_LCTRL; + break; + case SDL_SCANCODE_RCTRL: + keyboard->modstate &= ~KMOD_RCTRL; + break; + case SDL_SCANCODE_LSHIFT: + keyboard->modstate &= ~KMOD_LSHIFT; + break; + case SDL_SCANCODE_RSHIFT: + keyboard->modstate &= ~KMOD_RSHIFT; + break; + case SDL_SCANCODE_LALT: + keyboard->modstate &= ~KMOD_LALT; + break; + case SDL_SCANCODE_RALT: + keyboard->modstate &= ~KMOD_RALT; + break; + case SDL_SCANCODE_LGUI: + keyboard->modstate &= ~KMOD_LGUI; + break; + case SDL_SCANCODE_RGUI: + keyboard->modstate &= ~KMOD_RGUI; + break; + case SDL_SCANCODE_MODE: + keyboard->modstate &= ~KMOD_MODE; + break; + default: + break; + } + modstate = keyboard->modstate; + } + + /* Figure out what type of event this is */ + switch (state) { + case SDL_PRESSED: + type = SDL_KEYDOWN; + break; + case SDL_RELEASED: + type = SDL_KEYUP; + break; + default: + /* Invalid state -- bail */ + return 0; + } + + /* Drop events that don't change state */ + repeat = (state && keyboard->keystate[scancode]); + if (keyboard->keystate[scancode] == state && !repeat) { +#if 0 + printf("Keyboard event didn't change state - dropped!\n"); +#endif + return 0; + } + + /* Update internal keyboard state */ + keyboard->keystate[scancode] = state; + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(type) == SDL_ENABLE) { + SDL_Event event; + event.key.type = type; + event.key.state = state; + event.key.repeat = repeat; + event.key.keysym.scancode = scancode; + event.key.keysym.sym = keyboard->keymap[scancode]; + event.key.keysym.mod = modstate; + event.key.windowID = keyboard->focus ? keyboard->focus->id : 0; + posted = (SDL_PushEvent(&event) > 0); + } + return (posted); } -void SDL_SetModState (SDLMod modstate) + +int +SDL_SendKeyboardText(const char *text) { - SDL_ModState = modstate; + SDL_Keyboard *keyboard = &SDL_keyboard; + int posted; + + /* Don't post text events for unprintable characters */ + if ((unsigned char)*text < ' ' || *text == 127) { + return 0; + } + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { + SDL_Event event; + event.text.type = SDL_TEXTINPUT; + event.text.windowID = keyboard->focus ? keyboard->focus->id : 0; + SDL_utf8strlcpy(event.text.text, text, SDL_arraysize(event.text.text)); + posted = (SDL_PushEvent(&event) > 0); + } + return (posted); } -char *SDL_GetKeyName(SDLKey key) +int +SDL_SendEditingText(const char *text, int start, int length) { - const char *keyname; - - keyname = NULL; - if ( key < SDLK_LAST ) { - keyname = keynames[key]; - } - if ( keyname == NULL ) { - keyname = "unknown key"; - } - /* FIXME: make this function const in 1.3 */ - return (char *)(keyname); + SDL_Keyboard *keyboard = &SDL_keyboard; + int posted; + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_TEXTEDITING) == SDL_ENABLE) { + SDL_Event event; + event.edit.type = SDL_TEXTEDITING; + event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; + event.edit.start = start; + event.edit.length = length; + SDL_utf8strlcpy(event.edit.text, text, SDL_arraysize(event.edit.text)); + posted = (SDL_PushEvent(&event) > 0); + } + return (posted); } -/* These are global for SDL_eventloop.c */ -int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *keysym) +void +SDL_KeyboardQuit(void) { - SDL_Event event; - int posted, repeatable; - Uint16 modstate; +} - SDL_memset(&event, 0, sizeof(event)); +const Uint8 * +SDL_GetKeyboardState(int *numkeys) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; -#if 0 -printf("The '%s' key has been %s\n", SDL_GetKeyName(keysym->sym), - state == SDL_PRESSED ? "pressed" : "released"); -#endif - /* Set up the keysym */ - modstate = (Uint16)SDL_ModState; - - repeatable = 0; - - if ( state == SDL_PRESSED ) { - keysym->mod = (SDLMod)modstate; - switch (keysym->sym) { - case SDLK_UNKNOWN: - break; - case SDLK_NUMLOCK: - modstate ^= KMOD_NUM; - if ( SDL_NoLockKeys & SDL_NLK_NUM ) - break; - if ( ! (modstate&KMOD_NUM) ) - state = SDL_RELEASED; - keysym->mod = (SDLMod)modstate; - break; - case SDLK_CAPSLOCK: - modstate ^= KMOD_CAPS; - if ( SDL_NoLockKeys & SDL_NLK_CAPS ) - break; - if ( ! (modstate&KMOD_CAPS) ) - state = SDL_RELEASED; - keysym->mod = (SDLMod)modstate; - break; - case SDLK_LCTRL: - modstate |= KMOD_LCTRL; - break; - case SDLK_RCTRL: - modstate |= KMOD_RCTRL; - break; - case SDLK_LSHIFT: - modstate |= KMOD_LSHIFT; - break; - case SDLK_RSHIFT: - modstate |= KMOD_RSHIFT; - break; - case SDLK_LALT: - modstate |= KMOD_LALT; - break; - case SDLK_RALT: - modstate |= KMOD_RALT; - break; - case SDLK_LMETA: - modstate |= KMOD_LMETA; - break; - case SDLK_RMETA: - modstate |= KMOD_RMETA; - break; - case SDLK_MODE: - modstate |= KMOD_MODE; - break; - default: - repeatable = 1; - break; - } - } else { - switch (keysym->sym) { - case SDLK_UNKNOWN: - break; - case SDLK_NUMLOCK: - if ( SDL_NoLockKeys & SDL_NLK_NUM ) - break; - /* Only send keydown events */ - return(0); - case SDLK_CAPSLOCK: - if ( SDL_NoLockKeys & SDL_NLK_CAPS ) - break; - /* Only send keydown events */ - return(0); - case SDLK_LCTRL: - modstate &= ~KMOD_LCTRL; - break; - case SDLK_RCTRL: - modstate &= ~KMOD_RCTRL; - break; - case SDLK_LSHIFT: - modstate &= ~KMOD_LSHIFT; - break; - case SDLK_RSHIFT: - modstate &= ~KMOD_RSHIFT; - break; - case SDLK_LALT: - modstate &= ~KMOD_LALT; - break; - case SDLK_RALT: - modstate &= ~KMOD_RALT; - break; - case SDLK_LMETA: - modstate &= ~KMOD_LMETA; - break; - case SDLK_RMETA: - modstate &= ~KMOD_RMETA; - break; - case SDLK_MODE: - modstate &= ~KMOD_MODE; - break; - default: - break; - } - keysym->mod = (SDLMod)modstate; - } - - /* Figure out what type of event this is */ - switch (state) { - case SDL_PRESSED: - event.type = SDL_KEYDOWN; - break; - case SDL_RELEASED: - event.type = SDL_KEYUP; - /* - * jk 991215 - Added - */ - if ( SDL_KeyRepeat.timestamp && - SDL_KeyRepeat.evt.key.keysym.sym == keysym->sym ) { - SDL_KeyRepeat.timestamp = 0; - } - break; - default: - /* Invalid state -- bail */ - return(0); - } - - if ( keysym->sym != SDLK_UNKNOWN ) { - /* Drop events that don't change state */ - if ( SDL_KeyState[keysym->sym] == state ) { -#if 0 -printf("Keyboard event didn't change state - dropped!\n"); -#endif - return(0); - } - - /* Update internal keyboard state */ - SDL_ModState = (SDLMod)modstate; - SDL_KeyState[keysym->sym] = state; - } - - /* Post the event, if desired */ - posted = 0; - if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) { - event.key.state = state; - event.key.keysym = *keysym; - /* - * jk 991215 - Added - */ - if (repeatable && (SDL_KeyRepeat.delay != 0)) { - SDL_KeyRepeat.evt = event; - SDL_KeyRepeat.firsttime = 1; - SDL_KeyRepeat.timestamp=SDL_GetTicks(); - } - if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - return(posted); + if (numkeys != (int *) 0) { + *numkeys = SDL_NUM_SCANCODES; + } + return keyboard->keystate; } -/* - * jk 991215 - Added - */ -void SDL_CheckKeyRepeat(void) +SDL_Keymod +SDL_GetModState(void) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + + return keyboard->modstate; +} + +void +SDL_SetModState(SDL_Keymod modstate) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + + keyboard->modstate = modstate; +} + +SDL_Keycode +SDL_GetKeyFromScancode(SDL_Scancode scancode) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + + if (scancode < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { + SDL_InvalidParamError("scancode"); + return 0; + } + + return keyboard->keymap[scancode]; +} + +SDL_Scancode +SDL_GetScancodeFromKey(SDL_Keycode key) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + SDL_Scancode scancode; + + for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; + ++scancode) { + if (keyboard->keymap[scancode] == key) { + return scancode; + } + } + return SDL_SCANCODE_UNKNOWN; +} + +const char * +SDL_GetScancodeName(SDL_Scancode scancode) +{ + const char *name; + if (scancode < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { + SDL_InvalidParamError("scancode"); + return ""; + } + + name = SDL_scancode_names[scancode]; + if (name) + return name; + else + return ""; +} + +SDL_Scancode SDL_GetScancodeFromName(const char *name) { - if ( SDL_KeyRepeat.timestamp ) { - Uint32 now, interval; - - now = SDL_GetTicks(); - interval = (now - SDL_KeyRepeat.timestamp); - if ( SDL_KeyRepeat.firsttime ) { - if ( interval > (Uint32)SDL_KeyRepeat.delay ) { - SDL_KeyRepeat.timestamp = now; - SDL_KeyRepeat.firsttime = 0; - } - } else { - if ( interval > (Uint32)SDL_KeyRepeat.interval ) { - SDL_KeyRepeat.timestamp = now; - if ( (SDL_EventOK == NULL) || SDL_EventOK(&SDL_KeyRepeat.evt) ) { - SDL_PushEvent(&SDL_KeyRepeat.evt); - } - } - } - } + int i; + + if (!name || !*name) { + SDL_InvalidParamError("name"); + return SDL_SCANCODE_UNKNOWN; + } + + for (i = 0; i < SDL_arraysize(SDL_scancode_names); ++i) { + if (!SDL_scancode_names[i]) { + continue; + } + if (SDL_strcasecmp(name, SDL_scancode_names[i]) == 0) { + return (SDL_Scancode)i; + } + } + + SDL_InvalidParamError("name"); + return SDL_SCANCODE_UNKNOWN; } -int SDL_EnableKeyRepeat(int delay, int interval) +const char * +SDL_GetKeyName(SDL_Keycode key) { - if ( (delay < 0) || (interval < 0) ) { - SDL_SetError("keyboard repeat value less than zero"); - return(-1); - } - SDL_KeyRepeat.firsttime = 0; - SDL_KeyRepeat.delay = delay; - SDL_KeyRepeat.interval = interval; - SDL_KeyRepeat.timestamp = 0; - return(0); + static char name[8]; + char *end; + + if (key & SDLK_SCANCODE_MASK) { + return + SDL_GetScancodeName((SDL_Scancode) (key & ~SDLK_SCANCODE_MASK)); + } + + switch (key) { + case SDLK_RETURN: + return SDL_GetScancodeName(SDL_SCANCODE_RETURN); + case SDLK_ESCAPE: + return SDL_GetScancodeName(SDL_SCANCODE_ESCAPE); + case SDLK_BACKSPACE: + return SDL_GetScancodeName(SDL_SCANCODE_BACKSPACE); + case SDLK_TAB: + return SDL_GetScancodeName(SDL_SCANCODE_TAB); + case SDLK_SPACE: + return SDL_GetScancodeName(SDL_SCANCODE_SPACE); + case SDLK_DELETE: + return SDL_GetScancodeName(SDL_SCANCODE_DELETE); + default: + /* Unaccented letter keys on latin keyboards are normally + labeled in upper case (and probably on others like Greek or + Cyrillic too, so if you happen to know for sure, please + adapt this). */ + if (key >= 'a' && key <= 'z') { + key -= 32; + } + + end = SDL_UCS4ToUTF8((Uint32) key, name); + *end = '\0'; + return name; + } } -void SDL_GetKeyRepeat(int *delay, int *interval) +SDL_Keycode +SDL_GetKeyFromName(const char *name) { - *delay = SDL_KeyRepeat.delay; - *interval = SDL_KeyRepeat.interval; + SDL_Keycode key; + + /* Check input */ + if (name == NULL) return SDLK_UNKNOWN; + + /* If it's a single UTF-8 character, then that's the keycode itself */ + key = *(const unsigned char *)name; + if (key >= 0xF0) { + if (SDL_strlen(name) == 4) { + int i = 0; + key = (Uint16)(name[i]&0x07) << 18; + key |= (Uint16)(name[++i]&0x3F) << 12; + key |= (Uint16)(name[++i]&0x3F) << 6; + key |= (Uint16)(name[++i]&0x3F); + return key; + } + return SDLK_UNKNOWN; + } else if (key >= 0xE0) { + if (SDL_strlen(name) == 3) { + int i = 0; + key = (Uint16)(name[i]&0x0F) << 12; + key |= (Uint16)(name[++i]&0x3F) << 6; + key |= (Uint16)(name[++i]&0x3F); + return key; + } + return SDLK_UNKNOWN; + } else if (key >= 0xC0) { + if (SDL_strlen(name) == 2) { + int i = 0; + key = (Uint16)(name[i]&0x1F) << 6; + key |= (Uint16)(name[++i]&0x3F); + return key; + } + return SDLK_UNKNOWN; + } else { + if (SDL_strlen(name) == 1) { + if (key >= 'A' && key <= 'Z') { + key += 32; + } + return key; + } + + /* Get the scancode for this name, and the associated keycode */ + return SDL_default_keymap[SDL_GetScancodeFromName(name)]; + } } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h new file mode 100644 index 0000000000..17203998b1 --- /dev/null +++ b/src/events/SDL_keyboard_c.h @@ -0,0 +1,64 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_keyboard_c_h +#define _SDL_keyboard_c_h + +#include "SDL_keycode.h" +#include "SDL_events.h" + +/* Initialize the keyboard subsystem */ +extern int SDL_KeyboardInit(void); + +/* Clear the state of the keyboard */ +extern void SDL_ResetKeyboard(void); + +/* Get the default keymap */ +extern void SDL_GetDefaultKeymap(SDL_Keycode * keymap); + +/* Set the mapping of scancode to key codes */ +extern void SDL_SetKeymap(int start, SDL_Keycode * keys, int length); + +/* Set a platform-dependent key name, overriding the default platform-agnostic + name. Encoded as UTF-8. The string is not copied, thus the pointer given to + this function must stay valid forever (or at least until the call to + VideoQuit()). */ +extern void SDL_SetScancodeName(SDL_Scancode scancode, const char *name); + +/* Set the keyboard focus window */ +extern void SDL_SetKeyboardFocus(SDL_Window * window); + +/* Send a keyboard key event */ +extern int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode); + +/* Send keyboard text input */ +extern int SDL_SendKeyboardText(const char *text); + +/* Send editing text for selected range from start to end */ +extern int SDL_SendEditingText(const char *text, int start, int end); + +/* Shutdown the keyboard subsystem */ +extern void SDL_KeyboardQuit(void); + +#endif /* _SDL_keyboard_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index e37a4c6af3..e9404f0577 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -1,268 +1,725 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* General mouse handling code for SDL */ +#include "SDL_assert.h" #include "SDL_events.h" #include "SDL_events_c.h" -#include "../video/SDL_cursor_c.h" +#include "default_cursor.h" #include "../video/SDL_sysvideo.h" +/*#define DEBUG_MOUSE*/ -/* These are static for our mouse handling code */ -static Sint16 SDL_MouseX = 0; -static Sint16 SDL_MouseY = 0; -static Sint16 SDL_DeltaX = 0; -static Sint16 SDL_DeltaY = 0; -static Sint16 SDL_MouseMaxX = 0; -static Sint16 SDL_MouseMaxY = 0; -static Uint8 SDL_ButtonState = 0; +/* The mouse state */ +static SDL_Mouse SDL_mouse; +static int +SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y); /* Public functions */ -int SDL_MouseInit(void) +int +SDL_MouseInit(void) { - /* The mouse is at (0,0) */ - SDL_MouseX = 0; - SDL_MouseY = 0; - SDL_DeltaX = 0; - SDL_DeltaY = 0; - SDL_MouseMaxX = 0; - SDL_MouseMaxY = 0; - SDL_ButtonState = 0; - - /* That's it! */ - return(0); + SDL_Mouse *mouse = SDL_GetMouse(); + + mouse->cursor_shown = SDL_TRUE; + + return (0); } -void SDL_MouseQuit(void) + +void +SDL_SetDefaultCursor(SDL_Cursor * cursor) { + SDL_Mouse *mouse = SDL_GetMouse(); + + mouse->def_cursor = cursor; + if (!mouse->cur_cursor) { + SDL_SetCursor(cursor); + } } -/* We lost the mouse, so post button up messages for all pressed buttons */ -void SDL_ResetMouse(void) +SDL_Mouse * +SDL_GetMouse(void) { - Uint8 i; - for ( i = 0; i < sizeof(SDL_ButtonState)*8; ++i ) { - if ( SDL_ButtonState & SDL_BUTTON(i) ) { - SDL_PrivateMouseButton(SDL_RELEASED, i, 0, 0); - } - } + return &SDL_mouse; } -Uint8 SDL_GetMouseState (int *x, int *y) +SDL_Window * +SDL_GetMouseFocus(void) { - if ( x ) { - *x = SDL_MouseX; - } - if ( y ) { - *y = SDL_MouseY; - } - return(SDL_ButtonState); + SDL_Mouse *mouse = SDL_GetMouse(); + + return mouse->focus; } -Uint8 SDL_GetRelativeMouseState (int *x, int *y) +void +SDL_ResetMouse(void) { - if ( x ) - *x = SDL_DeltaX; - if ( y ) - *y = SDL_DeltaY; - SDL_DeltaX = 0; - SDL_DeltaY = 0; - return(SDL_ButtonState); + SDL_Mouse *mouse = SDL_GetMouse(); + Uint8 i; + +#ifdef DEBUG_MOUSE + printf("Resetting mouse\n"); +#endif + for (i = 1; i <= sizeof(mouse->buttonstate)*8; ++i) { + if (mouse->buttonstate & SDL_BUTTON(i)) { + SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, i); + } + } + SDL_assert(mouse->buttonstate == 0); } -static void ClipOffset(Sint16 *x, Sint16 *y) +void +SDL_SetMouseFocus(SDL_Window * window) { - /* This clips absolute mouse coordinates when the apparent - display surface is smaller than the real display surface. - */ - if ( SDL_VideoSurface && SDL_VideoSurface->offset ) { - *y -= SDL_VideoSurface->offset/SDL_VideoSurface->pitch; - *x -= (SDL_VideoSurface->offset%SDL_VideoSurface->pitch)/ - SDL_VideoSurface->format->BytesPerPixel; - } + SDL_Mouse *mouse = SDL_GetMouse(); + + if (mouse->focus == window) { + return; + } + + /* Actually, this ends up being a bad idea, because most operating + systems have an implicit grab when you press the mouse button down + so you can drag things out of the window and then get the mouse up + when it happens. So, #if 0... + */ +#if 0 + if (mouse->focus && !window) { + /* We won't get anymore mouse messages, so reset mouse state */ + SDL_ResetMouse(); + } +#endif + + /* See if the current window has lost focus */ + if (mouse->focus) { + SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_LEAVE, 0, 0); + } + + mouse->focus = window; + + if (mouse->focus) { + SDL_SendWindowEvent(mouse->focus, SDL_WINDOWEVENT_ENTER, 0, 0); + } + + /* Update cursor visibility */ + SDL_SetCursor(NULL); +} + +/* Check to see if we need to synthesize focus events */ +static SDL_bool +SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + int w, h; + SDL_bool inWindow; + + SDL_GetWindowSize(window, &w, &h); + if (x < 0 || y < 0 || x >= w || y >= h) { + inWindow = SDL_FALSE; + } else { + inWindow = SDL_TRUE; + } + +/* Linux doesn't give you mouse events outside your window unless you grab + the pointer. + + Windows doesn't give you mouse events outside your window unless you call + SetCapture(). + + Both of these are slightly scary changes, so for now we'll punt and if the + mouse leaves the window you'll lose mouse focus and reset button state. +*/ +#ifdef SUPPORT_DRAG_OUTSIDE_WINDOW + if (!inWindow && !buttonstate) { +#else + if (!inWindow) { +#endif + if (window == mouse->focus) { +#ifdef DEBUG_MOUSE + printf("Mouse left window, synthesizing move & focus lost event\n"); +#endif + SDL_PrivateSendMouseMotion(window, mouse->mouseID, 0, x, y); + SDL_SetMouseFocus(NULL); + } + return SDL_FALSE; + } + + if (window != mouse->focus) { +#ifdef DEBUG_MOUSE + printf("Mouse entered window, synthesizing focus gain & move event\n"); +#endif + SDL_SetMouseFocus(window); + SDL_PrivateSendMouseMotion(window, mouse->mouseID, 0, x, y); + } + return SDL_TRUE; } -void SDL_SetMouseRange(int maxX, int maxY) +int +SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y) { - SDL_MouseMaxX = (Sint16)maxX; - SDL_MouseMaxY = (Sint16)maxY; + if (window && !relative) { + SDL_Mouse *mouse = SDL_GetMouse(); + if (!SDL_UpdateMouseFocus(window, x, y, mouse->buttonstate)) { + return 0; + } + } + + return SDL_PrivateSendMouseMotion(window, mouseID, relative, x, y); } -/* These are global for SDL_eventloop.c */ -int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y) +static int +SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y) { - int posted; - Uint16 X, Y; - Sint16 Xrel; - Sint16 Yrel; - - /* Default buttonstate is the current one */ - if ( ! buttonstate ) { - buttonstate = SDL_ButtonState; - } - - Xrel = x; - Yrel = y; - if ( relative ) { - /* Push the cursor around */ - x = (SDL_MouseX+x); - y = (SDL_MouseY+y); - } else { - /* Do we need to clip {x,y} ? */ - ClipOffset(&x, &y); - } - - /* Mouse coordinates range from 0 - width-1 and 0 - height-1 */ - if ( x < 0 ) - X = 0; - else - if ( x >= SDL_MouseMaxX ) - X = SDL_MouseMaxX-1; - else - X = (Uint16)x; - - if ( y < 0 ) - Y = 0; - else - if ( y >= SDL_MouseMaxY ) - Y = SDL_MouseMaxY-1; - else - Y = (Uint16)y; - - /* If not relative mode, generate relative motion from clamped X/Y. - This prevents lots of extraneous large delta relative motion when - the screen is windowed mode and the mouse is outside the window. - */ - if ( ! relative ) { - Xrel = X-SDL_MouseX; - Yrel = Y-SDL_MouseY; - } - - /* Drop events that don't change state */ - if ( ! Xrel && ! Yrel ) { -#if 0 -printf("Mouse event didn't change state - dropped!\n"); + SDL_Mouse *mouse = SDL_GetMouse(); + int posted; + int xrel; + int yrel; + int x_max = 0, y_max = 0; + + /* relative motion is calculated regarding the system cursor last position */ + if (relative) { + xrel = x; + yrel = y; + x = (mouse->last_x + x); + y = (mouse->last_y + y); + } else { + xrel = x - mouse->last_x; + yrel = y - mouse->last_y; + } + + /* Drop events that don't change state */ + if (!xrel && !yrel) { +#ifdef DEBUG_MOUSE + printf("Mouse event didn't change state - dropped!\n"); +#endif + return 0; + } + + /* Update internal mouse coordinates */ + if (mouse->relative_mode == SDL_FALSE) { + mouse->x = x; + mouse->y = y; + } else { + mouse->x += xrel; + mouse->y += yrel; + } + + SDL_GetWindowSize(mouse->focus, &x_max, &y_max); + --x_max; + --y_max; + + /* make sure that the pointers find themselves inside the windows */ + if (mouse->x > x_max) { + mouse->x = x_max; + } + if (mouse->x < 0) { + mouse->x = 0; + } + + if (mouse->y > y_max) { + mouse->y = y_max; + } + if (mouse->y < 0) { + mouse->y = 0; + } + + mouse->xdelta += xrel; + mouse->ydelta += yrel; + +#if 0 /* FIXME */ + /* Move the mouse cursor, if needed */ + if (mouse->cursor_shown && !mouse->relative_mode && + mouse->MoveCursor && mouse->cur_cursor) { + mouse->MoveCursor(mouse->cur_cursor); + } #endif - return(0); - } - - /* Update internal mouse state */ - SDL_ButtonState = buttonstate; - SDL_MouseX = X; - SDL_MouseY = Y; - SDL_DeltaX += Xrel; - SDL_DeltaY += Yrel; - SDL_MoveCursor(SDL_MouseX, SDL_MouseY); - - /* Post the event, if desired */ - posted = 0; - if ( SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE ) { - SDL_Event event; - SDL_memset(&event, 0, sizeof(event)); - event.type = SDL_MOUSEMOTION; - event.motion.state = buttonstate; - event.motion.x = X; - event.motion.y = Y; - event.motion.xrel = Xrel; - event.motion.yrel = Yrel; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - return(posted); + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_MOUSEMOTION) == SDL_ENABLE) { + SDL_Event event; + event.motion.type = SDL_MOUSEMOTION; + event.motion.windowID = mouse->focus ? mouse->focus->id : 0; + event.motion.which = mouseID; + event.motion.state = mouse->buttonstate; + event.motion.x = mouse->x; + event.motion.y = mouse->y; + event.motion.xrel = xrel; + event.motion.yrel = yrel; + posted = (SDL_PushEvent(&event) > 0); + } + /* Use unclamped values if we're getting events outside the window */ + mouse->last_x = x; + mouse->last_y = y; + return posted; +} + +int +SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + int posted; + Uint32 type; + Uint32 buttonstate = mouse->buttonstate; + + /* Figure out which event to perform */ + switch (state) { + case SDL_PRESSED: + type = SDL_MOUSEBUTTONDOWN; + buttonstate |= SDL_BUTTON(button); + break; + case SDL_RELEASED: + type = SDL_MOUSEBUTTONUP; + buttonstate &= ~SDL_BUTTON(button); + break; + default: + /* Invalid state -- bail */ + return 0; + } + + /* We do this after calculating buttonstate so button presses gain focus */ + if (window && state == SDL_PRESSED) { + SDL_UpdateMouseFocus(window, mouse->x, mouse->y, buttonstate); + } + + if (buttonstate == mouse->buttonstate) { + /* Ignore this event, no state change */ + return 0; + } + mouse->buttonstate = buttonstate; + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(type) == SDL_ENABLE) { + SDL_Event event; + event.type = type; + event.button.windowID = mouse->focus ? mouse->focus->id : 0; + event.button.which = mouseID; + event.button.state = state; + event.button.button = button; + event.button.x = mouse->x; + event.button.y = mouse->y; + posted = (SDL_PushEvent(&event) > 0); + } + + /* We do this after dispatching event so button releases can lose focus */ + if (window && state == SDL_RELEASED) { + SDL_UpdateMouseFocus(window, mouse->x, mouse->y, buttonstate); + } + + return posted; +} + +int +SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + int posted; + + if (window) { + SDL_SetMouseFocus(window); + } + + if (!x && !y) { + return 0; + } + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_MOUSEWHEEL) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_MOUSEWHEEL; + event.wheel.windowID = mouse->focus ? mouse->focus->id : 0; + event.wheel.which = mouseID; + event.wheel.x = x; + event.wheel.y = y; + posted = (SDL_PushEvent(&event) > 0); + } + return posted; +} + +void +SDL_MouseQuit(void) +{ + SDL_Cursor *cursor, *next; + SDL_Mouse *mouse = SDL_GetMouse(); + + SDL_ShowCursor(1); + + cursor = mouse->cursors; + while (cursor) { + next = cursor->next; + SDL_FreeCursor(cursor); + cursor = next; + } + + if (mouse->def_cursor && mouse->FreeCursor) { + mouse->FreeCursor(mouse->def_cursor); + } + + SDL_zerop(mouse); +} + +Uint32 +SDL_GetMouseState(int *x, int *y) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (x) { + *x = mouse->x; + } + if (y) { + *y = mouse->y; + } + return mouse->buttonstate; +} + +Uint32 +SDL_GetRelativeMouseState(int *x, int *y) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (x) { + *x = mouse->xdelta; + } + if (y) { + *y = mouse->ydelta; + } + mouse->xdelta = 0; + mouse->ydelta = 0; + return mouse->buttonstate; +} + +void +SDL_WarpMouseInWindow(SDL_Window * window, int x, int y) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if ( window == NULL ) + window = mouse->focus; + + if ( window == NULL ) + return; + + if (mouse->WarpMouse) { + mouse->WarpMouse(window, x, y); + } else { + SDL_SendMouseMotion(window, mouse->mouseID, 0, x, y); + } +} + +int +SDL_SetRelativeMouseMode(SDL_bool enabled) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + SDL_Window *focusWindow = SDL_GetKeyboardFocus(); + int original_x = mouse->x, original_y = mouse->y; + + if (enabled == mouse->relative_mode) { + return 0; + } + + if (!mouse->SetRelativeMouseMode) { + return SDL_Unsupported(); + } + + if (enabled && focusWindow) { + /* Center it in the focused window to prevent clicks from going through + * to background windows. + */ + SDL_SetMouseFocus(focusWindow); + SDL_WarpMouseInWindow(focusWindow, focusWindow->w/2, focusWindow->h/2); + } + + if (mouse->SetRelativeMouseMode(enabled) < 0) { + return -1; + } + + /* Set the relative mode */ + mouse->relative_mode = enabled; + + if (enabled) { + /* Save the expected mouse position */ + mouse->original_x = original_x; + mouse->original_y = original_y; + } else if (mouse->focus) { + /* Restore the expected mouse position */ + SDL_WarpMouseInWindow(mouse->focus, mouse->original_x, mouse->original_y); + } + + /* Flush pending mouse motion */ + SDL_FlushEvent(SDL_MOUSEMOTION); + + /* Update cursor visibility */ + SDL_SetCursor(NULL); + + return 0; +} + +SDL_bool +SDL_GetRelativeMouseMode() +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + return mouse->relative_mode; +} + +SDL_Cursor * +SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, + int w, int h, int hot_x, int hot_y) +{ + SDL_Surface *surface; + SDL_Cursor *cursor; + int x, y; + Uint32 *pixel; + Uint8 datab = 0, maskb = 0; + const Uint32 black = 0xFF000000; + const Uint32 white = 0xFFFFFFFF; + const Uint32 transparent = 0x00000000; + + /* Make sure the width is a multiple of 8 */ + w = ((w + 7) & ~7); + + /* Create the surface from a bitmap */ + surface = SDL_CreateRGBSurface(0, w, h, 32, + 0x00FF0000, + 0x0000FF00, + 0x000000FF, + 0xFF000000); + if (!surface) { + return NULL; + } + for (y = 0; y < h; ++y) { + pixel = (Uint32 *) ((Uint8 *) surface->pixels + y * surface->pitch); + for (x = 0; x < w; ++x) { + if ((x % 8) == 0) { + datab = *data++; + maskb = *mask++; + } + if (maskb & 0x80) { + *pixel++ = (datab & 0x80) ? black : white; + } else { + *pixel++ = (datab & 0x80) ? black : transparent; + } + datab <<= 1; + maskb <<= 1; + } + } + + cursor = SDL_CreateColorCursor(surface, hot_x, hot_y); + + SDL_FreeSurface(surface); + + return cursor; +} + +SDL_Cursor * +SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + SDL_Surface *temp = NULL; + SDL_Cursor *cursor; + + if (!surface) { + SDL_SetError("Passed NULL cursor surface"); + return NULL; + } + + if (!mouse->CreateCursor) { + SDL_SetError("Cursors are not currently supported"); + return NULL; + } + + /* Sanity check the hot spot */ + if ((hot_x < 0) || (hot_y < 0) || + (hot_x >= surface->w) || (hot_y >= surface->h)) { + SDL_SetError("Cursor hot spot doesn't lie within cursor"); + return NULL; + } + + if (surface->format->format != SDL_PIXELFORMAT_ARGB8888) { + temp = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ARGB8888, 0); + if (!temp) { + return NULL; + } + surface = temp; + } + + cursor = mouse->CreateCursor(surface, hot_x, hot_y); + if (cursor) { + cursor->next = mouse->cursors; + mouse->cursors = cursor; + } + + if (temp) { + SDL_FreeSurface(temp); + } + + return cursor; +} + +SDL_Cursor * +SDL_CreateSystemCursor(SDL_SystemCursor id) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + SDL_Cursor *cursor; + + if (!mouse->CreateSystemCursor) { + SDL_SetError("CreateSystemCursor is not currently supported"); + return NULL; + } + + cursor = mouse->CreateSystemCursor(id); + if (cursor) { + cursor->next = mouse->cursors; + mouse->cursors = cursor; + } + + return cursor; +} + +/* SDL_SetCursor(NULL) can be used to force the cursor redraw, + if this is desired for any reason. This is used when setting + the video mode and when the SDL window gains the mouse focus. + */ +void +SDL_SetCursor(SDL_Cursor * cursor) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + /* Set the new cursor */ + if (cursor) { + /* Make sure the cursor is still valid for this mouse */ + if (cursor != mouse->def_cursor) { + SDL_Cursor *found; + for (found = mouse->cursors; found; found = found->next) { + if (found == cursor) { + break; + } + } + if (!found) { + SDL_SetError("Cursor not associated with the current mouse"); + return; + } + } + mouse->cur_cursor = cursor; + } else { + if (mouse->focus) { + cursor = mouse->cur_cursor; + } else { + cursor = mouse->def_cursor; + } + } + + if (cursor && mouse->cursor_shown && !mouse->relative_mode) { + if (mouse->ShowCursor) { + mouse->ShowCursor(cursor); + } + } else { + if (mouse->ShowCursor) { + mouse->ShowCursor(NULL); + } + } +} + +SDL_Cursor * +SDL_GetCursor(void) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (!mouse) { + return NULL; + } + return mouse->cur_cursor; +} + +SDL_Cursor * +SDL_GetDefaultCursor(void) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (!mouse) { + return NULL; + } + return mouse->def_cursor; +} + +void +SDL_FreeCursor(SDL_Cursor * cursor) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + SDL_Cursor *curr, *prev; + + if (!cursor) { + return; + } + + if (cursor == mouse->def_cursor) { + return; + } + if (cursor == mouse->cur_cursor) { + SDL_SetCursor(mouse->def_cursor); + } + + for (prev = NULL, curr = mouse->cursors; curr; + prev = curr, curr = curr->next) { + if (curr == cursor) { + if (prev) { + prev->next = curr->next; + } else { + mouse->cursors = curr->next; + } + + if (mouse->FreeCursor) { + mouse->FreeCursor(curr); + } + return; + } + } } -int SDL_PrivateMouseButton(Uint8 state, Uint8 button, Sint16 x, Sint16 y) +int +SDL_ShowCursor(int toggle) { - SDL_Event event; - int posted; - int move_mouse; - Uint8 buttonstate; - - SDL_memset(&event, 0, sizeof(event)); - - /* Check parameters */ - if ( x || y ) { - ClipOffset(&x, &y); - move_mouse = 1; - /* Mouse coordinates range from 0 - width-1 and 0 - height-1 */ - if ( x < 0 ) - x = 0; - else - if ( x >= SDL_MouseMaxX ) - x = SDL_MouseMaxX-1; - - if ( y < 0 ) - y = 0; - else - if ( y >= SDL_MouseMaxY ) - y = SDL_MouseMaxY-1; - } else { - move_mouse = 0; - } - if ( ! x ) - x = SDL_MouseX; - if ( ! y ) - y = SDL_MouseY; - - /* Figure out which event to perform */ - buttonstate = SDL_ButtonState; - switch ( state ) { - case SDL_PRESSED: - event.type = SDL_MOUSEBUTTONDOWN; - buttonstate |= SDL_BUTTON(button); - break; - case SDL_RELEASED: - event.type = SDL_MOUSEBUTTONUP; - buttonstate &= ~SDL_BUTTON(button); - break; - default: - /* Invalid state -- bail */ - return(0); - } - - /* Update internal mouse state */ - SDL_ButtonState = buttonstate; - if ( move_mouse ) { - SDL_MouseX = x; - SDL_MouseY = y; - SDL_MoveCursor(SDL_MouseX, SDL_MouseY); - } - - /* Post the event, if desired */ - posted = 0; - if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) { - event.button.state = state; - event.button.button = button; - event.button.x = x; - event.button.y = y; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - return(posted); + SDL_Mouse *mouse = SDL_GetMouse(); + SDL_bool shown; + + if (!mouse) { + return 0; + } + + shown = mouse->cursor_shown; + if (toggle >= 0) { + if (toggle) { + mouse->cursor_shown = SDL_TRUE; + } else { + mouse->cursor_shown = SDL_FALSE; + } + if (mouse->cursor_shown != shown) { + SDL_SetCursor(NULL); + } + } + return shown; } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h new file mode 100644 index 0000000000..a8faa2e17f --- /dev/null +++ b/src/events/SDL_mouse_c.h @@ -0,0 +1,108 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_mouse_c_h +#define _SDL_mouse_c_h + +#include "SDL_mouse.h" + +typedef Uint32 SDL_MouseID; + +struct SDL_Cursor +{ + struct SDL_Cursor *next; + void *driverdata; +}; + +typedef struct +{ + /* Create a cursor from a surface */ + SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y); + + /* Create a system cursor */ + SDL_Cursor *(*CreateSystemCursor) (SDL_SystemCursor id); + + /* Show the specified cursor, or hide if cursor is NULL */ + int (*ShowCursor) (SDL_Cursor * cursor); + + /* This is called when a mouse motion event occurs */ + void (*MoveCursor) (SDL_Cursor * cursor); + + /* Free a window manager cursor */ + void (*FreeCursor) (SDL_Cursor * cursor); + + /* Warp the mouse to (x,y) */ + void (*WarpMouse) (SDL_Window * window, int x, int y); + + /* Set relative mode */ + int (*SetRelativeMouseMode) (SDL_bool enabled); + + /* Data common to all mice */ + SDL_MouseID mouseID; + SDL_Window *focus; + int x; + int y; + int xdelta; + int ydelta; + int last_x, last_y; /* the last reported x and y coordinates */ + Uint32 buttonstate; + SDL_bool relative_mode; + /* the x and y coordinates when relative mode was activated */ + int original_x, original_y; + + SDL_Cursor *cursors; + SDL_Cursor *def_cursor; + SDL_Cursor *cur_cursor; + SDL_bool cursor_shown; + + /* Driver-dependent data. */ + void *driverdata; +} SDL_Mouse; + + +/* Initialize the mouse subsystem */ +extern int SDL_MouseInit(void); + +/* Get the mouse state structure */ +SDL_Mouse *SDL_GetMouse(void); + +/* Set the default mouse cursor */ +extern void SDL_SetDefaultCursor(SDL_Cursor * cursor); + +/* Set the mouse focus window */ +extern void SDL_SetMouseFocus(SDL_Window * window); + +/* Send a mouse motion event */ +extern int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y); + +/* Send a mouse button event */ +extern int SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button); + +/* Send a mouse wheel event */ +extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, int x, int y); + +/* Shutdown the mouse subsystem */ +extern void SDL_MouseQuit(void); + +#endif /* _SDL_mouse_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c index 2e6c56e796..5e9f8ad851 100644 --- a/src/events/SDL_quit.c +++ b/src/events/SDL_quit.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -32,93 +31,90 @@ #ifdef HAVE_SIGNAL_H -static void SDL_HandleSIG(int sig) +static void +SDL_HandleSIG(int sig) { - /* Reset the signal handler */ - signal(sig, SDL_HandleSIG); + /* Reset the signal handler */ + signal(sig, SDL_HandleSIG); - /* Signal a quit interrupt */ - SDL_PrivateQuit(); + /* Signal a quit interrupt */ + SDL_SendQuit(); } #endif /* HAVE_SIGNAL_H */ /* Public functions */ -int SDL_QuitInit(void) +int +SDL_QuitInit(void) { #ifdef HAVE_SIGACTION - struct sigaction action; - sigaction(SIGINT, NULL, &action); -# ifdef HAVE_SA_SIGACTION - if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) { -# else - if ( action.sa_handler == SIG_DFL ) { -# endif - action.sa_handler = SDL_HandleSIG; - sigaction(SIGINT, &action, NULL); - } - sigaction(SIGTERM, NULL, &action); -# ifdef HAVE_SA_SIGACTION - if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) { -# else - if ( action.sa_handler == SIG_DFL ) { -# endif - action.sa_handler = SDL_HandleSIG; - sigaction(SIGTERM, &action, NULL); - } + struct sigaction action; + sigaction(SIGINT, NULL, &action); +#ifdef HAVE_SA_SIGACTION + if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) { +#else + if ( action.sa_handler == SIG_DFL ) { +#endif + action.sa_handler = SDL_HandleSIG; + sigaction(SIGINT, &action, NULL); + } + sigaction(SIGTERM, NULL, &action); + +#ifdef HAVE_SA_SIGACTION + if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) { +#else + if ( action.sa_handler == SIG_DFL ) { +#endif + action.sa_handler = SDL_HandleSIG; + sigaction(SIGTERM, &action, NULL); + } #elif HAVE_SIGNAL_H - void (*ohandler)(int); - - /* Both SIGINT and SIGTERM are translated into quit interrupts */ - ohandler = signal(SIGINT, SDL_HandleSIG); - if ( ohandler != SIG_DFL ) - signal(SIGINT, ohandler); - ohandler = signal(SIGTERM, SDL_HandleSIG); - if ( ohandler != SIG_DFL ) - signal(SIGTERM, ohandler); + void (*ohandler) (int); + + /* Both SIGINT and SIGTERM are translated into quit interrupts */ + ohandler = signal(SIGINT, SDL_HandleSIG); + if (ohandler != SIG_DFL) + signal(SIGINT, ohandler); + ohandler = signal(SIGTERM, SDL_HandleSIG); + if (ohandler != SIG_DFL) + signal(SIGTERM, ohandler); #endif /* HAVE_SIGNAL_H */ - /* That's it! */ - return(0); + /* That's it! */ + return (0); } -void SDL_QuitQuit(void) + +void +SDL_QuitQuit(void) { #ifdef HAVE_SIGACTION - struct sigaction action; - sigaction(SIGINT, NULL, &action); - if ( action.sa_handler == SDL_HandleSIG ) { - action.sa_handler = SIG_DFL; - sigaction(SIGINT, &action, NULL); - } - sigaction(SIGTERM, NULL, &action); - if ( action.sa_handler == SDL_HandleSIG ) { - action.sa_handler = SIG_DFL; - sigaction(SIGTERM, &action, NULL); - } + struct sigaction action; + sigaction(SIGINT, NULL, &action); + if ( action.sa_handler == SDL_HandleSIG ) { + action.sa_handler = SIG_DFL; + sigaction(SIGINT, &action, NULL); + } + sigaction(SIGTERM, NULL, &action); + if ( action.sa_handler == SDL_HandleSIG ) { + action.sa_handler = SIG_DFL; + sigaction(SIGTERM, &action, NULL); + } #elif HAVE_SIGNAL_H - void (*ohandler)(int); - - ohandler = signal(SIGINT, SIG_DFL); - if ( ohandler != SDL_HandleSIG ) - signal(SIGINT, ohandler); - ohandler = signal(SIGTERM, SIG_DFL); - if ( ohandler != SDL_HandleSIG ) - signal(SIGTERM, ohandler); + void (*ohandler) (int); + + ohandler = signal(SIGINT, SIG_DFL); + if (ohandler != SDL_HandleSIG) + signal(SIGINT, ohandler); + ohandler = signal(SIGTERM, SIG_DFL); + if (ohandler != SDL_HandleSIG) + signal(SIGTERM, ohandler); #endif /* HAVE_SIGNAL_H */ } /* This function returns 1 if it's okay to close the application window */ -int SDL_PrivateQuit(void) +int +SDL_SendQuit(void) { - int posted; - - posted = 0; - if ( SDL_ProcessEvents[SDL_QUIT] == SDL_ENABLE ) { - SDL_Event event; - event.type = SDL_QUIT; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - return(posted); + return SDL_SendAppEvent(SDL_QUIT); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_resize.c b/src/events/SDL_resize.c deleted file mode 100644 index e754a07d3f..0000000000 --- a/src/events/SDL_resize.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Resize event handling code for SDL */ - -#include "SDL_events.h" -#include "SDL_events_c.h" -#include "../video/SDL_sysvideo.h" - - -/* Keep the last resize event so we don't post duplicates */ -static struct { - int w; - int h; -} last_resize; - -/* This is global for SDL_eventloop.c */ -int SDL_PrivateResize(int w, int h) -{ - int posted; - SDL_Event events[32]; - - /* See if this event would change the video surface */ - if ( !w || !h || - (( last_resize.w == w ) && ( last_resize.h == h )) || - !SDL_VideoSurface ) { - return(0); - } - last_resize.w = w; - last_resize.h = h; - - SDL_SetMouseRange(w, h); - - /* Pull out all old resize events */ - SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]), - SDL_GETEVENT, SDL_VIDEORESIZEMASK); - - /* Post the event, if desired */ - posted = 0; - if ( SDL_ProcessEvents[SDL_VIDEORESIZE] == SDL_ENABLE ) { - SDL_Event event; - event.type = SDL_VIDEORESIZE; - event.resize.w = w; - event.resize.h = h; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } - return(posted); -} diff --git a/src/events/SDL_sysevents.h b/src/events/SDL_sysevents.h index 480bfe15f9..c2f1e097bd 100644 --- a/src/events/SDL_sysevents.h +++ b/src/events/SDL_sysevents.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is SDL_free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -25,22 +24,13 @@ /* Useful functions and variables from SDL_sysevents.c */ -#ifdef __BEOS__ /* The Be event loop runs in a separate thread */ +#if defined(__BEOS__) || defined(__HAIKU__) +/* The Be and Haiku event loops run in a separate thread */ #define MUST_THREAD_EVENTS #endif -#ifdef __WIN32__ /* Win32 doesn't allow a separate event thread */ -#define CANT_THREAD_EVENTS -#endif - -#ifdef IPOD /* iPod doesn't support threading at all */ -#define CANT_THREAD_EVENTS -#endif - -#ifdef __MACOS__ /* MacOS 7/8 don't support preemptive multi-tasking */ +#ifdef __WIN32__ /* Windows doesn't allow a separate event thread */ #define CANT_THREAD_EVENTS #endif -#ifdef __OS2__ /* The OS/2 event loop runs in a separate thread */ -#define MUST_THREAD_EVENTS -#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c new file mode 100644 index 0000000000..3429b57d77 --- /dev/null +++ b/src/events/SDL_touch.c @@ -0,0 +1,364 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* General touch handling code for SDL */ + +#include "SDL_assert.h" +#include "SDL_events.h" +#include "SDL_events_c.h" + + +static int SDL_num_touch = 0; +static SDL_Touch **SDL_touchDevices = NULL; + + +/* Public functions */ +int +SDL_TouchInit(void) +{ + return (0); +} + +int +SDL_GetNumTouchDevices(void) +{ + return SDL_num_touch; +} + +SDL_TouchID +SDL_GetTouchDevice(int index) +{ + if (index < 0 || index >= SDL_num_touch) { + SDL_SetError("Unknown touch device"); + return 0; + } + return SDL_touchDevices[index]->id; +} + +static int +SDL_GetTouchIndex(SDL_TouchID id) +{ + int index; + SDL_Touch *touch; + + for (index = 0; index < SDL_num_touch; ++index) { + touch = SDL_touchDevices[index]; + if (touch->id == id) { + return index; + } + } + return -1; +} + +SDL_Touch * +SDL_GetTouch(SDL_TouchID id) +{ + int index = SDL_GetTouchIndex(id); + if (index < 0 || index >= SDL_num_touch) { + SDL_SetError("Unknown touch device"); + return NULL; + } + return SDL_touchDevices[index]; +} + +static int +SDL_GetFingerIndex(const SDL_Touch * touch, SDL_FingerID fingerid) +{ + int index; + for (index = 0; index < touch->num_fingers; ++index) { + if (touch->fingers[index]->id == fingerid) { + return index; + } + } + return -1; +} + +SDL_Finger * +SDL_GetFinger(const SDL_Touch * touch, SDL_FingerID id) +{ + int index = SDL_GetFingerIndex(touch, id); + if (index < 0 || index >= touch->num_fingers) { + return NULL; + } + return touch->fingers[index]; +} + +int +SDL_GetNumTouchFingers(SDL_TouchID touchID) +{ + SDL_Touch *touch = SDL_GetTouch(touchID); + if (touch) { + return touch->num_fingers; + } + return 0; +} + +SDL_Finger * +SDL_GetTouchFinger(SDL_TouchID touchID, int index) +{ + SDL_Touch *touch = SDL_GetTouch(touchID); + if (!touch) { + return NULL; + } + if (index < 0 || index >= touch->num_fingers) { + SDL_SetError("Unknown touch finger"); + return NULL; + } + return touch->fingers[index]; +} + +int +SDL_AddTouch(SDL_TouchID touchID, const char *name) +{ + SDL_Touch **touchDevices; + int index; + + index = SDL_GetTouchIndex(touchID); + if (index >= 0) { + return index; + } + + /* Add the touch to the list of touch */ + touchDevices = (SDL_Touch **) SDL_realloc(SDL_touchDevices, + (SDL_num_touch + 1) * sizeof(*touchDevices)); + if (!touchDevices) { + return SDL_OutOfMemory(); + } + + SDL_touchDevices = touchDevices; + index = SDL_num_touch++; + + SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index])); + if (!SDL_touchDevices[index]) { + return SDL_OutOfMemory(); + } + + /* we're setting the touch properties */ + SDL_touchDevices[index]->id = touchID; + SDL_touchDevices[index]->num_fingers = 0; + SDL_touchDevices[index]->max_fingers = 0; + SDL_touchDevices[index]->fingers = NULL; + + /* Record this touch device for gestures */ + /* We could do this on the fly in the gesture code if we wanted */ + SDL_GestureAddTouch(touchID); + + return index; +} + +static int +SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure) +{ + SDL_Finger *finger; + + if (touch->num_fingers == touch->max_fingers) { + SDL_Finger **new_fingers; + new_fingers = (SDL_Finger **)SDL_realloc(touch->fingers, (touch->max_fingers+1)*sizeof(*touch->fingers)); + if (!new_fingers) { + return SDL_OutOfMemory(); + } + touch->fingers = new_fingers; + touch->fingers[touch->max_fingers] = (SDL_Finger *)SDL_malloc(sizeof(*finger)); + if (!touch->fingers[touch->max_fingers]) { + return SDL_OutOfMemory(); + } + touch->max_fingers++; + } + + finger = touch->fingers[touch->num_fingers++]; + finger->id = fingerid; + finger->x = x; + finger->y = y; + finger->pressure = pressure; + return 0; +} + +static int +SDL_DelFinger(SDL_Touch* touch, SDL_FingerID fingerid) +{ + SDL_Finger *temp; + + int index = SDL_GetFingerIndex(touch, fingerid); + if (index < 0) { + return -1; + } + + touch->num_fingers--; + temp = touch->fingers[index]; + touch->fingers[index] = touch->fingers[touch->num_fingers]; + touch->fingers[touch->num_fingers] = temp; + return 0; +} + +int +SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, + SDL_bool down, float x, float y, float pressure) +{ + int posted; + SDL_Finger *finger; + + SDL_Touch* touch = SDL_GetTouch(id); + if (!touch) { + return -1; + } + + finger = SDL_GetFinger(touch, fingerid); + if (down) { + if (finger) { + /* This finger is already down */ + return 0; + } + + if (SDL_AddFinger(touch, fingerid, x, y, pressure) < 0) { + return 0; + } + + posted = 0; + if (SDL_GetEventState(SDL_FINGERDOWN) == SDL_ENABLE) { + SDL_Event event; + event.tfinger.type = SDL_FINGERDOWN; + event.tfinger.touchId = id; + event.tfinger.fingerId = fingerid; + event.tfinger.x = x; + event.tfinger.y = y; + event.tfinger.dx = 0; + event.tfinger.dy = 0; + event.tfinger.pressure = pressure; + posted = (SDL_PushEvent(&event) > 0); + } + } else { + if (!finger) { + /* This finger is already up */ + return 0; + } + + posted = 0; + if (SDL_GetEventState(SDL_FINGERUP) == SDL_ENABLE) { + SDL_Event event; + event.tfinger.type = SDL_FINGERUP; + event.tfinger.touchId = id; + event.tfinger.fingerId = fingerid; + /* I don't trust the coordinates passed on fingerUp */ + event.tfinger.x = finger->x; + event.tfinger.y = finger->y; + event.tfinger.dx = 0; + event.tfinger.dy = 0; + event.tfinger.pressure = pressure; + posted = (SDL_PushEvent(&event) > 0); + } + + SDL_DelFinger(touch, fingerid); + } + return posted; +} + +int +SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, + float x, float y, float pressure) +{ + SDL_Touch *touch; + SDL_Finger *finger; + int posted; + float xrel, yrel, prel; + + touch = SDL_GetTouch(id); + if (!touch) { + return -1; + } + + finger = SDL_GetFinger(touch,fingerid); + if (!finger) { + return SDL_SendTouch(id, fingerid, SDL_TRUE, x, y, pressure); + } + + xrel = x - finger->x; + yrel = y - finger->y; + prel = pressure - finger->pressure; + + /* Drop events that don't change state */ + if (!xrel && !yrel && !prel) { +#if 0 + printf("Touch event didn't change state - dropped!\n"); +#endif + return 0; + } + + /* Update internal touch coordinates */ + finger->x = x; + finger->y = y; + finger->pressure = pressure; + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_FINGERMOTION) == SDL_ENABLE) { + SDL_Event event; + event.tfinger.type = SDL_FINGERMOTION; + event.tfinger.touchId = id; + event.tfinger.fingerId = fingerid; + event.tfinger.x = x; + event.tfinger.y = y; + event.tfinger.dx = xrel; + event.tfinger.dy = yrel; + event.tfinger.pressure = pressure; + posted = (SDL_PushEvent(&event) > 0); + } + return posted; +} + +void +SDL_DelTouch(SDL_TouchID id) +{ + int i; + int index = SDL_GetTouchIndex(id); + SDL_Touch *touch = SDL_GetTouch(id); + + if (!touch) { + return; + } + + for (i = 0; i < touch->max_fingers; ++i) { + SDL_free(touch->fingers[i]); + } + SDL_free(touch->fingers); + SDL_free(touch); + + SDL_num_touch--; + SDL_touchDevices[index] = SDL_touchDevices[SDL_num_touch]; +} + +void +SDL_TouchQuit(void) +{ + int i; + + for (i = SDL_num_touch; i--; ) { + SDL_DelTouch(SDL_touchDevices[i]->id); + } + SDL_assert(SDL_num_touch == 0); + + if (SDL_touchDevices) { + SDL_free(SDL_touchDevices); + SDL_touchDevices = NULL; + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_touch_c.h b/src/events/SDL_touch_c.h new file mode 100644 index 0000000000..d0a2cf2f78 --- /dev/null +++ b/src/events/SDL_touch_c.h @@ -0,0 +1,61 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" +#include "../../include/SDL_touch.h" + +#ifndef _SDL_touch_c_h +#define _SDL_touch_c_h + +typedef struct SDL_Touch +{ + SDL_TouchID id; + int num_fingers; + int max_fingers; + SDL_Finger** fingers; +} SDL_Touch; + + +/* Initialize the touch subsystem */ +extern int SDL_TouchInit(void); + +/* Add a touch, returning the index of the touch, or -1 if there was an error. */ +extern int SDL_AddTouch(SDL_TouchID id, const char *name); + +/* Get the touch with a given id */ +extern SDL_Touch *SDL_GetTouch(SDL_TouchID id); + +/* Send a touch down/up event for a touch */ +extern int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, + SDL_bool down, float x, float y, float pressure); + +/* Send a touch motion event for a touch */ +extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, + float x, float y, float pressure); + +/* Remove a touch */ +extern void SDL_DelTouch(SDL_TouchID id); + +/* Shutdown the touch subsystem */ +extern void SDL_TouchQuit(void); + +#endif /* _SDL_touch_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c new file mode 100644 index 0000000000..9011f68e14 --- /dev/null +++ b/src/events/SDL_windowevents.c @@ -0,0 +1,210 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* Window event handling code for SDL */ + +#include "SDL_events.h" +#include "SDL_events_c.h" +#include "SDL_mouse_c.h" +#include "../video/SDL_sysvideo.h" + + +static int +RemovePendingResizedEvents(void * userdata, SDL_Event *event) +{ + SDL_Event *new_event = (SDL_Event *)userdata; + + if (event->type == SDL_WINDOWEVENT && + event->window.event == SDL_WINDOWEVENT_RESIZED && + event->window.windowID == new_event->window.windowID) { + /* We're about to post a new size event, drop the old one */ + return 0; + } + return 1; +} + +static int +RemovePendingSizeChangedEvents(void * userdata, SDL_Event *event) +{ + SDL_Event *new_event = (SDL_Event *)userdata; + + if (event->type == SDL_WINDOWEVENT && + event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED && + event->window.windowID == new_event->window.windowID) { + /* We're about to post a new size event, drop the old one */ + return 0; + } + return 1; +} + +static int +RemovePendingMoveEvents(void * userdata, SDL_Event *event) +{ + SDL_Event *new_event = (SDL_Event *)userdata; + + if (event->type == SDL_WINDOWEVENT && + event->window.event == SDL_WINDOWEVENT_MOVED && + event->window.windowID == new_event->window.windowID) { + /* We're about to post a new move event, drop the old one */ + return 0; + } + return 1; +} + +int +SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, + int data2) +{ + int posted; + + if (!window) { + return 0; + } + switch (windowevent) { + case SDL_WINDOWEVENT_SHOWN: + if (window->flags & SDL_WINDOW_SHOWN) { + return 0; + } + window->flags &= ~SDL_WINDOW_HIDDEN; + window->flags |= SDL_WINDOW_SHOWN; + SDL_OnWindowShown(window); + break; + case SDL_WINDOWEVENT_HIDDEN: + if (!(window->flags & SDL_WINDOW_SHOWN)) { + return 0; + } + window->flags &= ~SDL_WINDOW_SHOWN; + window->flags |= SDL_WINDOW_HIDDEN; + SDL_OnWindowHidden(window); + break; + case SDL_WINDOWEVENT_MOVED: + if (SDL_WINDOWPOS_ISUNDEFINED(data1) || + SDL_WINDOWPOS_ISUNDEFINED(data2)) { + return 0; + } + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + window->windowed.x = data1; + window->windowed.y = data2; + } + if (data1 == window->x && data2 == window->y) { + return 0; + } + window->x = data1; + window->y = data2; + break; + case SDL_WINDOWEVENT_RESIZED: + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + window->windowed.w = data1; + window->windowed.h = data2; + } + if (data1 == window->w && data2 == window->h) { + return 0; + } + window->w = data1; + window->h = data2; + SDL_OnWindowResized(window); + break; + case SDL_WINDOWEVENT_MINIMIZED: + if (window->flags & SDL_WINDOW_MINIMIZED) { + return 0; + } + window->flags |= SDL_WINDOW_MINIMIZED; + SDL_OnWindowMinimized(window); + break; + case SDL_WINDOWEVENT_MAXIMIZED: + if (window->flags & SDL_WINDOW_MAXIMIZED) { + return 0; + } + window->flags |= SDL_WINDOW_MAXIMIZED; + break; + case SDL_WINDOWEVENT_RESTORED: + if (!(window->flags & (SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED))) { + return 0; + } + window->flags &= ~(SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED); + SDL_OnWindowRestored(window); + break; + case SDL_WINDOWEVENT_ENTER: + if (window->flags & SDL_WINDOW_MOUSE_FOCUS) { + return 0; + } + window->flags |= SDL_WINDOW_MOUSE_FOCUS; + SDL_OnWindowEnter(window); + break; + case SDL_WINDOWEVENT_LEAVE: + if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS)) { + return 0; + } + window->flags &= ~SDL_WINDOW_MOUSE_FOCUS; + SDL_OnWindowLeave(window); + break; + case SDL_WINDOWEVENT_FOCUS_GAINED: + if (window->flags & SDL_WINDOW_INPUT_FOCUS) { + return 0; + } + window->flags |= SDL_WINDOW_INPUT_FOCUS; + SDL_OnWindowFocusGained(window); + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + if (!(window->flags & SDL_WINDOW_INPUT_FOCUS)) { + return 0; + } + window->flags &= ~SDL_WINDOW_INPUT_FOCUS; + SDL_OnWindowFocusLost(window); + break; + } + + /* Post the event, if desired */ + posted = 0; + if (SDL_GetEventState(SDL_WINDOWEVENT) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_WINDOWEVENT; + event.window.event = windowevent; + event.window.data1 = data1; + event.window.data2 = data2; + event.window.windowID = window->id; + + /* Fixes queue overflow with resize events that aren't processed */ + if (windowevent == SDL_WINDOWEVENT_RESIZED) { + SDL_FilterEvents(RemovePendingResizedEvents, &event); + } + if (windowevent == SDL_WINDOWEVENT_SIZE_CHANGED) { + SDL_FilterEvents(RemovePendingSizeChangedEvents, &event); + } + if (windowevent == SDL_WINDOWEVENT_MOVED) { + SDL_FilterEvents(RemovePendingMoveEvents, &event); + } + + posted = (SDL_PushEvent(&event) > 0); + } + + if (windowevent == SDL_WINDOWEVENT_CLOSE) { + if ( !window->prev && !window->next ) { + /* This is the last window in the list so send the SDL_QUIT event */ + SDL_SendQuit(); + } + } + + return (posted); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_windowevents_c.h b/src/events/SDL_windowevents_c.h new file mode 100644 index 0000000000..0d14a03497 --- /dev/null +++ b/src/events/SDL_windowevents_c.h @@ -0,0 +1,31 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_windowevents_c_h +#define _SDL_windowevents_c_h + +extern int SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, + int data1, int data2); + +#endif /* _SDL_windowevents_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/blank_cursor.h b/src/events/blank_cursor.h new file mode 100644 index 0000000000..6efb4741e1 --- /dev/null +++ b/src/events/blank_cursor.h @@ -0,0 +1,33 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * A default blank 8x8 cursor */ + +#define BLANK_CWIDTH 8 +#define BLANK_CHEIGHT 8 +#define BLANK_CHOTX 0 +#define BLANK_CHOTY 0 + +static const unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +static const unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/default_cursor.h b/src/events/default_cursor.h new file mode 100644 index 0000000000..8c2dcfcff2 --- /dev/null +++ b/src/events/default_cursor.h @@ -0,0 +1,114 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Default cursor - it happens to be the Mac cursor, but could be anything */ + +#define DEFAULT_CWIDTH 16 +#define DEFAULT_CHEIGHT 16 +#define DEFAULT_CHOTX 0 +#define DEFAULT_CHOTY 0 + +/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrière */ +#define USE_MACOS_CURSOR + +#ifdef USE_MACOS_CURSOR + +static const unsigned char default_cdata[] = { + 0x00, 0x00, + 0x40, 0x00, + 0x60, 0x00, + 0x70, 0x00, + 0x78, 0x00, + 0x7C, 0x00, + 0x7E, 0x00, + 0x7F, 0x00, + 0x7F, 0x80, + 0x7C, 0x00, + 0x6C, 0x00, + 0x46, 0x00, + 0x06, 0x00, + 0x03, 0x00, + 0x03, 0x00, + 0x00, 0x00 +}; + +static const unsigned char default_cmask[] = { + 0xC0, 0x00, + 0xE0, 0x00, + 0xF0, 0x00, + 0xF8, 0x00, + 0xFC, 0x00, + 0xFE, 0x00, + 0xFF, 0x00, + 0xFF, 0x80, + 0xFF, 0xC0, + 0xFF, 0xE0, + 0xFE, 0x00, + 0xEF, 0x00, + 0xCF, 0x00, + 0x87, 0x80, + 0x07, 0x80, + 0x03, 0x00 +}; + +#else + +static const unsigned char default_cdata[] = { + 0x00, 0x00, + 0x40, 0x00, + 0x60, 0x00, + 0x70, 0x00, + 0x78, 0x00, + 0x7C, 0x00, + 0x7E, 0x00, + 0x7F, 0x00, + 0x7F, 0x80, + 0x7C, 0x00, + 0x6C, 0x00, + 0x46, 0x00, + 0x06, 0x00, + 0x03, 0x00, + 0x03, 0x00, + 0x00, 0x00 +}; + +static const unsigned char default_cmask[] = { + 0x40, 0x00, + 0xE0, 0x00, + 0xF0, 0x00, + 0xF8, 0x00, + 0xFC, 0x00, + 0xFE, 0x00, + 0xFF, 0x00, + 0xFF, 0x80, + 0xFF, 0xC0, + 0xFF, 0x80, + 0xFE, 0x00, + 0xEF, 0x00, + 0x4F, 0x00, + 0x07, 0x80, + 0x07, 0x80, + 0x03, 0x00 +}; + +#endif /* TRUE_MACINTOSH_CURSOR */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/scancodes_darwin.h b/src/events/scancodes_darwin.h new file mode 100644 index 0000000000..77c728bc73 --- /dev/null +++ b/src/events/scancodes_darwin.h @@ -0,0 +1,159 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* Mac virtual key code to SDL scancode mapping table + Sources: + - Inside Macintosh: Text + - Apple USB keyboard driver source + - experimentation on various ADB and USB ISO keyboards and one ADB ANSI keyboard +*/ +/* *INDENT-OFF* */ +static const SDL_Scancode darwin_scancode_table[] = { + /* 0 */ SDL_SCANCODE_A, + /* 1 */ SDL_SCANCODE_S, + /* 2 */ SDL_SCANCODE_D, + /* 3 */ SDL_SCANCODE_F, + /* 4 */ SDL_SCANCODE_H, + /* 5 */ SDL_SCANCODE_G, + /* 6 */ SDL_SCANCODE_Z, + /* 7 */ SDL_SCANCODE_X, + /* 8 */ SDL_SCANCODE_C, + /* 9 */ SDL_SCANCODE_V, + /* 10 */ SDL_SCANCODE_NONUSBACKSLASH, /* SDL_SCANCODE_NONUSBACKSLASH on ANSI and JIS keyboards (if this key would exist there), SDL_SCANCODE_GRAVE on ISO. (The USB keyboard driver actually translates these usage codes to different virtual key codes depending on whether the keyboard is ISO/ANSI/JIS. That's why you have to help it identify the keyboard type when you plug in a PC USB keyboard. It's a historical thing - ADB keyboards are wired this way.) */ + /* 11 */ SDL_SCANCODE_B, + /* 12 */ SDL_SCANCODE_Q, + /* 13 */ SDL_SCANCODE_W, + /* 14 */ SDL_SCANCODE_E, + /* 15 */ SDL_SCANCODE_R, + /* 16 */ SDL_SCANCODE_Y, + /* 17 */ SDL_SCANCODE_T, + /* 18 */ SDL_SCANCODE_1, + /* 19 */ SDL_SCANCODE_2, + /* 20 */ SDL_SCANCODE_3, + /* 21 */ SDL_SCANCODE_4, + /* 22 */ SDL_SCANCODE_6, + /* 23 */ SDL_SCANCODE_5, + /* 24 */ SDL_SCANCODE_EQUALS, + /* 25 */ SDL_SCANCODE_9, + /* 26 */ SDL_SCANCODE_7, + /* 27 */ SDL_SCANCODE_MINUS, + /* 28 */ SDL_SCANCODE_8, + /* 29 */ SDL_SCANCODE_0, + /* 30 */ SDL_SCANCODE_RIGHTBRACKET, + /* 31 */ SDL_SCANCODE_O, + /* 32 */ SDL_SCANCODE_U, + /* 33 */ SDL_SCANCODE_LEFTBRACKET, + /* 34 */ SDL_SCANCODE_I, + /* 35 */ SDL_SCANCODE_P, + /* 36 */ SDL_SCANCODE_RETURN, + /* 37 */ SDL_SCANCODE_L, + /* 38 */ SDL_SCANCODE_J, + /* 39 */ SDL_SCANCODE_APOSTROPHE, + /* 40 */ SDL_SCANCODE_K, + /* 41 */ SDL_SCANCODE_SEMICOLON, + /* 42 */ SDL_SCANCODE_BACKSLASH, + /* 43 */ SDL_SCANCODE_COMMA, + /* 44 */ SDL_SCANCODE_SLASH, + /* 45 */ SDL_SCANCODE_N, + /* 46 */ SDL_SCANCODE_M, + /* 47 */ SDL_SCANCODE_PERIOD, + /* 48 */ SDL_SCANCODE_TAB, + /* 49 */ SDL_SCANCODE_SPACE, + /* 50 */ SDL_SCANCODE_GRAVE, /* SDL_SCANCODE_GRAVE on ANSI and JIS keyboards, SDL_SCANCODE_NONUSBACKSLASH on ISO (see comment about virtual key code 10 above) */ + /* 51 */ SDL_SCANCODE_BACKSPACE, + /* 52 */ SDL_SCANCODE_KP_ENTER, /* keyboard enter on portables */ + /* 53 */ SDL_SCANCODE_ESCAPE, + /* 54 */ SDL_SCANCODE_RGUI, + /* 55 */ SDL_SCANCODE_LGUI, + /* 56 */ SDL_SCANCODE_LSHIFT, + /* 57 */ SDL_SCANCODE_CAPSLOCK, + /* 58 */ SDL_SCANCODE_LALT, + /* 59 */ SDL_SCANCODE_LCTRL, + /* 60 */ SDL_SCANCODE_RSHIFT, + /* 61 */ SDL_SCANCODE_RALT, + /* 62 */ SDL_SCANCODE_RCTRL, + /* 63 */ SDL_SCANCODE_RGUI, /* fn on portables, acts as a hardware-level modifier already, so we don't generate events for it, also XK_Meta_R */ + /* 64 */ SDL_SCANCODE_F17, + /* 65 */ SDL_SCANCODE_KP_PERIOD, + /* 66 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 67 */ SDL_SCANCODE_KP_MULTIPLY, + /* 68 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 69 */ SDL_SCANCODE_KP_PLUS, + /* 70 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 71 */ SDL_SCANCODE_NUMLOCKCLEAR, + /* 72 */ SDL_SCANCODE_VOLUMEUP, + /* 73 */ SDL_SCANCODE_VOLUMEDOWN, + /* 74 */ SDL_SCANCODE_MUTE, + /* 75 */ SDL_SCANCODE_KP_DIVIDE, + /* 76 */ SDL_SCANCODE_KP_ENTER, /* keypad enter on external keyboards, fn-return on portables */ + /* 77 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 78 */ SDL_SCANCODE_KP_MINUS, + /* 79 */ SDL_SCANCODE_F18, + /* 80 */ SDL_SCANCODE_F19, + /* 81 */ SDL_SCANCODE_KP_EQUALS, + /* 82 */ SDL_SCANCODE_KP_0, + /* 83 */ SDL_SCANCODE_KP_1, + /* 84 */ SDL_SCANCODE_KP_2, + /* 85 */ SDL_SCANCODE_KP_3, + /* 86 */ SDL_SCANCODE_KP_4, + /* 87 */ SDL_SCANCODE_KP_5, + /* 88 */ SDL_SCANCODE_KP_6, + /* 89 */ SDL_SCANCODE_KP_7, + /* 90 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 91 */ SDL_SCANCODE_KP_8, + /* 92 */ SDL_SCANCODE_KP_9, + /* 93 */ SDL_SCANCODE_INTERNATIONAL3, /* Cosmo_USB2ADB.c says "Yen (JIS)" */ + /* 94 */ SDL_SCANCODE_INTERNATIONAL1, /* Cosmo_USB2ADB.c says "Ro (JIS)" */ + /* 95 */ SDL_SCANCODE_KP_COMMA, /* Cosmo_USB2ADB.c says ", JIS only" */ + /* 96 */ SDL_SCANCODE_F5, + /* 97 */ SDL_SCANCODE_F6, + /* 98 */ SDL_SCANCODE_F7, + /* 99 */ SDL_SCANCODE_F3, + /* 100 */ SDL_SCANCODE_F8, + /* 101 */ SDL_SCANCODE_F9, + /* 102 */ SDL_SCANCODE_LANG2, /* Cosmo_USB2ADB.c says "Eisu" */ + /* 103 */ SDL_SCANCODE_F11, + /* 104 */ SDL_SCANCODE_LANG1, /* Cosmo_USB2ADB.c says "Kana" */ + /* 105 */ SDL_SCANCODE_PRINTSCREEN, /* On ADB keyboards, this key is labeled "F13/print screen". Problem: USB has different usage codes for these two functions. On Apple USB keyboards, the key is labeled "F13" and sends the F13 usage code (SDL_SCANCODE_F13). I decided to use SDL_SCANCODE_PRINTSCREEN here nevertheless since SDL applications are more likely to assume the presence of a print screen key than an F13 key. */ + /* 106 */ SDL_SCANCODE_F16, + /* 107 */ SDL_SCANCODE_SCROLLLOCK, /* F14/scroll lock, see comment about F13/print screen above */ + /* 108 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 109 */ SDL_SCANCODE_F10, + /* 110 */ SDL_SCANCODE_APPLICATION, /* windows contextual menu key, fn-enter on portables */ + /* 111 */ SDL_SCANCODE_F12, + /* 112 */ SDL_SCANCODE_UNKNOWN, /* unknown (unused?) */ + /* 113 */ SDL_SCANCODE_PAUSE, /* F15/pause, see comment about F13/print screen above */ + /* 114 */ SDL_SCANCODE_INSERT, /* the key is actually labeled "help" on Apple keyboards, and works as such in Mac OS, but it sends the "insert" usage code even on Apple USB keyboards */ + /* 115 */ SDL_SCANCODE_HOME, + /* 116 */ SDL_SCANCODE_PAGEUP, + /* 117 */ SDL_SCANCODE_DELETE, + /* 118 */ SDL_SCANCODE_F4, + /* 119 */ SDL_SCANCODE_END, + /* 120 */ SDL_SCANCODE_F2, + /* 121 */ SDL_SCANCODE_PAGEDOWN, + /* 122 */ SDL_SCANCODE_F1, + /* 123 */ SDL_SCANCODE_LEFT, + /* 124 */ SDL_SCANCODE_RIGHT, + /* 125 */ SDL_SCANCODE_DOWN, + /* 126 */ SDL_SCANCODE_UP, + /* 127 */ SDL_SCANCODE_POWER +}; +/* *INDENT-ON* */ diff --git a/src/events/scancodes_linux.h b/src/events/scancodes_linux.h new file mode 100644 index 0000000000..4d819da1b7 --- /dev/null +++ b/src/events/scancodes_linux.h @@ -0,0 +1,263 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../include/SDL_scancode.h" + +/* Linux virtual key code to SDL_Keycode mapping table + Sources: + - Linux kernel source input.h +*/ +/* *INDENT-OFF* */ +static SDL_Scancode const linux_scancode_table[] = { + /* 0 */ SDL_SCANCODE_UNKNOWN, + /* 1 */ SDL_SCANCODE_ESCAPE, + /* 2 */ SDL_SCANCODE_1, + /* 3 */ SDL_SCANCODE_2, + /* 4 */ SDL_SCANCODE_3, + /* 5 */ SDL_SCANCODE_4, + /* 6 */ SDL_SCANCODE_5, + /* 7 */ SDL_SCANCODE_6, + /* 8 */ SDL_SCANCODE_7, + /* 9 */ SDL_SCANCODE_8, + /* 10 */ SDL_SCANCODE_9, + /* 11 */ SDL_SCANCODE_0, + /* 12 */ SDL_SCANCODE_MINUS, + /* 13 */ SDL_SCANCODE_EQUALS, + /* 14 */ SDL_SCANCODE_BACKSPACE, + /* 15 */ SDL_SCANCODE_TAB, + /* 16 */ SDL_SCANCODE_Q, + /* 17 */ SDL_SCANCODE_W, + /* 18 */ SDL_SCANCODE_E, + /* 19 */ SDL_SCANCODE_R, + /* 20 */ SDL_SCANCODE_T, + /* 21 */ SDL_SCANCODE_Y, + /* 22 */ SDL_SCANCODE_U, + /* 23 */ SDL_SCANCODE_I, + /* 24 */ SDL_SCANCODE_O, + /* 25 */ SDL_SCANCODE_P, + /* 26 */ SDL_SCANCODE_LEFTBRACKET, + /* 27 */ SDL_SCANCODE_RIGHTBRACKET, + /* 28 */ SDL_SCANCODE_RETURN, + /* 29 */ SDL_SCANCODE_LCTRL, + /* 30 */ SDL_SCANCODE_A, + /* 31 */ SDL_SCANCODE_S, + /* 32 */ SDL_SCANCODE_D, + /* 33 */ SDL_SCANCODE_F, + /* 34 */ SDL_SCANCODE_G, + /* 35 */ SDL_SCANCODE_H, + /* 36 */ SDL_SCANCODE_J, + /* 37 */ SDL_SCANCODE_K, + /* 38 */ SDL_SCANCODE_L, + /* 39 */ SDL_SCANCODE_SEMICOLON, + /* 40 */ SDL_SCANCODE_APOSTROPHE, + /* 41 */ SDL_SCANCODE_GRAVE, + /* 42 */ SDL_SCANCODE_LSHIFT, + /* 43 */ SDL_SCANCODE_BACKSLASH, + /* 44 */ SDL_SCANCODE_Z, + /* 45 */ SDL_SCANCODE_X, + /* 46 */ SDL_SCANCODE_C, + /* 47 */ SDL_SCANCODE_V, + /* 48 */ SDL_SCANCODE_B, + /* 49 */ SDL_SCANCODE_N, + /* 50 */ SDL_SCANCODE_M, + /* 51 */ SDL_SCANCODE_COMMA, + /* 52 */ SDL_SCANCODE_PERIOD, + /* 53 */ SDL_SCANCODE_SLASH, + /* 54 */ SDL_SCANCODE_RSHIFT, + /* 55 */ SDL_SCANCODE_KP_MULTIPLY, + /* 56 */ SDL_SCANCODE_LALT, + /* 57 */ SDL_SCANCODE_SPACE, + /* 58 */ SDL_SCANCODE_CAPSLOCK, + /* 59 */ SDL_SCANCODE_F1, + /* 60 */ SDL_SCANCODE_F2, + /* 61 */ SDL_SCANCODE_F3, + /* 62 */ SDL_SCANCODE_F4, + /* 63 */ SDL_SCANCODE_F5, + /* 64 */ SDL_SCANCODE_F6, + /* 65 */ SDL_SCANCODE_F7, + /* 66 */ SDL_SCANCODE_F8, + /* 67 */ SDL_SCANCODE_F9, + /* 68 */ SDL_SCANCODE_F10, + /* 69 */ SDL_SCANCODE_NUMLOCKCLEAR, + /* 70 */ SDL_SCANCODE_SCROLLLOCK, + /* 71 */ SDL_SCANCODE_KP_7, + /* 72 */ SDL_SCANCODE_KP_8, + /* 73 */ SDL_SCANCODE_KP_9, + /* 74 */ SDL_SCANCODE_KP_MINUS, + /* 75 */ SDL_SCANCODE_KP_4, + /* 76 */ SDL_SCANCODE_KP_5, + /* 77 */ SDL_SCANCODE_KP_6, + /* 78 */ SDL_SCANCODE_KP_PLUS, + /* 79 */ SDL_SCANCODE_KP_1, + /* 80 */ SDL_SCANCODE_KP_2, + /* 81 */ SDL_SCANCODE_KP_3, + /* 82 */ SDL_SCANCODE_KP_0, + /* 83 */ SDL_SCANCODE_KP_PERIOD, + 0, + /* 85 */ SDL_SCANCODE_UNKNOWN, /* KEY_ZENKAKUHANKAKU */ + /* 86 */ SDL_SCANCODE_NONUSBACKSLASH, /* KEY_102ND */ + /* 87 */ SDL_SCANCODE_F11, + /* 88 */ SDL_SCANCODE_F12, + /* 89 */ SDL_SCANCODE_INTERNATIONAL1, /* KEY_RO */ + /* 90 */ SDL_SCANCODE_LANG3, /* KEY_KATAKANA */ + /* 91 */ SDL_SCANCODE_LANG4, /* KEY_HIRAGANA */ + /* 92 */ SDL_SCANCODE_INTERNATIONAL4, /* KEY_HENKAN */ + /* 93 */ SDL_SCANCODE_INTERNATIONAL2, /* KEY_KATAKANAHIRAGANA */ + /* 94 */ SDL_SCANCODE_INTERNATIONAL5, /* KEY_MUHENKAN */ + /* 95 */ SDL_SCANCODE_INTERNATIONAL5, /* KEY_KPJPCOMMA */ + /* 96 */ SDL_SCANCODE_KP_ENTER, + /* 97 */ SDL_SCANCODE_RCTRL, + /* 98 */ SDL_SCANCODE_KP_DIVIDE, + /* 99 */ SDL_SCANCODE_SYSREQ, + /* 100 */ SDL_SCANCODE_RALT, + /* 101 */ SDL_SCANCODE_UNKNOWN, /* KEY_LINEFEED */ + /* 102 */ SDL_SCANCODE_HOME, + /* 103 */ SDL_SCANCODE_UP, + /* 104 */ SDL_SCANCODE_PAGEUP, + /* 105 */ SDL_SCANCODE_LEFT, + /* 106 */ SDL_SCANCODE_RIGHT, + /* 107 */ SDL_SCANCODE_END, + /* 108 */ SDL_SCANCODE_DOWN, + /* 109 */ SDL_SCANCODE_PAGEDOWN, + /* 110 */ SDL_SCANCODE_INSERT, + /* 111 */ SDL_SCANCODE_DELETE, + /* 112 */ SDL_SCANCODE_UNKNOWN, /* KEY_MACRO */ + /* 113 */ SDL_SCANCODE_MUTE, + /* 114 */ SDL_SCANCODE_VOLUMEDOWN, + /* 115 */ SDL_SCANCODE_VOLUMEUP, + /* 116 */ SDL_SCANCODE_POWER, + /* 117 */ SDL_SCANCODE_KP_EQUALS, + /* 118 */ SDL_SCANCODE_KP_PLUSMINUS, + /* 119 */ SDL_SCANCODE_PAUSE, + 0, + /* 121 */ SDL_SCANCODE_KP_COMMA, + /* 122 */ SDL_SCANCODE_LANG1, /* KEY_HANGUEL */ + /* 123 */ SDL_SCANCODE_LANG2, /* KEY_HANJA */ + /* 124 */ SDL_SCANCODE_INTERNATIONAL3, /* KEY_YEN */ + /* 125 */ SDL_SCANCODE_LGUI, + /* 126 */ SDL_SCANCODE_RGUI, + /* 127 */ SDL_SCANCODE_UNKNOWN, /* KEY_COMPOSE */ + /* 128 */ SDL_SCANCODE_STOP, + /* 129 */ SDL_SCANCODE_AGAIN, + /* 130 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROPS */ + /* 131 */ SDL_SCANCODE_UNDO, + /* 132 */ SDL_SCANCODE_UNKNOWN, /* KEY_FRONT */ + /* 133 */ SDL_SCANCODE_COPY, + /* 134 */ SDL_SCANCODE_UNKNOWN, /* KEY_OPEN */ + /* 135 */ SDL_SCANCODE_PASTE, + /* 136 */ SDL_SCANCODE_FIND, + /* 137 */ SDL_SCANCODE_CUT, + /* 138 */ SDL_SCANCODE_HELP, + /* 139 */ SDL_SCANCODE_MENU, + /* 140 */ SDL_SCANCODE_CALCULATOR, + /* 141 */ SDL_SCANCODE_UNKNOWN, /* KEY_SETUP */ + /* 142 */ SDL_SCANCODE_SLEEP, + /* 143 */ SDL_SCANCODE_UNKNOWN, /* KEY_WAKEUP */ + /* 144 */ SDL_SCANCODE_UNKNOWN, /* KEY_FILE */ + /* 145 */ SDL_SCANCODE_UNKNOWN, /* KEY_SENDFILE */ + /* 146 */ SDL_SCANCODE_UNKNOWN, /* KEY_DELETEFILE */ + /* 147 */ SDL_SCANCODE_UNKNOWN, /* KEY_XFER */ + /* 148 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG1 */ + /* 149 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG2 */ + /* 150 */ SDL_SCANCODE_UNKNOWN, /* KEY_WWW */ + /* 151 */ SDL_SCANCODE_UNKNOWN, /* KEY_MSDOS */ + /* 152 */ SDL_SCANCODE_UNKNOWN, /* KEY_COFFEE */ + /* 153 */ SDL_SCANCODE_UNKNOWN, /* KEY_DIRECTION */ + /* 154 */ SDL_SCANCODE_UNKNOWN, /* KEY_CYCLEWINDOWS */ + /* 155 */ SDL_SCANCODE_MAIL, + /* 156 */ SDL_SCANCODE_AC_BOOKMARKS, + /* 157 */ SDL_SCANCODE_COMPUTER, + /* 158 */ SDL_SCANCODE_AC_BACK, + /* 159 */ SDL_SCANCODE_AC_FORWARD, + /* 160 */ SDL_SCANCODE_UNKNOWN, /* KEY_CLOSECD */ + /* 161 */ SDL_SCANCODE_EJECT, /* KEY_EJECTCD */ + /* 162 */ SDL_SCANCODE_UNKNOWN, /* KEY_EJECTCLOSECD */ + /* 163 */ SDL_SCANCODE_AUDIONEXT, /* KEY_NEXTSONG */ + /* 164 */ SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYPAUSE */ + /* 165 */ SDL_SCANCODE_AUDIOPREV, /* KEY_PREVIOUSSONG */ + /* 166 */ SDL_SCANCODE_UNKNOWN, /* KEY_STOPCD */ + /* 167 */ SDL_SCANCODE_UNKNOWN, /* KEY_RECORD */ + /* 168 */ SDL_SCANCODE_UNKNOWN, /* KEY_REWIND */ + /* 169 */ SDL_SCANCODE_UNKNOWN, /* KEY_PHONE */ + /* 170 */ SDL_SCANCODE_UNKNOWN, /* KEY_ISO */ + /* 171 */ SDL_SCANCODE_UNKNOWN, /* KEY_CONFIG */ + /* 172 */ SDL_SCANCODE_AC_HOME, + /* 173 */ SDL_SCANCODE_AC_REFRESH, + /* 174 */ SDL_SCANCODE_UNKNOWN, /* KEY_EXIT */ + /* 175 */ SDL_SCANCODE_UNKNOWN, /* KEY_MOVE */ + /* 176 */ SDL_SCANCODE_UNKNOWN, /* KEY_EDIT */ + /* 177 */ SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLUP */ + /* 178 */ SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLDOWN */ + /* 179 */ SDL_SCANCODE_KP_LEFTPAREN, + /* 180 */ SDL_SCANCODE_KP_RIGHTPAREN, + /* 181 */ SDL_SCANCODE_UNKNOWN, /* KEY_NEW */ + /* 182 */ SDL_SCANCODE_UNKNOWN, /* KEY_REDO */ + /* 183 */ SDL_SCANCODE_F13, + /* 184 */ SDL_SCANCODE_F14, + /* 185 */ SDL_SCANCODE_F15, + /* 186 */ SDL_SCANCODE_F16, + /* 187 */ SDL_SCANCODE_F17, + /* 188 */ SDL_SCANCODE_F18, + /* 189 */ SDL_SCANCODE_F19, + /* 190 */ SDL_SCANCODE_F20, + /* 191 */ SDL_SCANCODE_F21, + /* 192 */ SDL_SCANCODE_F22, + /* 193 */ SDL_SCANCODE_F23, + /* 194 */ SDL_SCANCODE_F24, + 0, 0, 0, 0, + /* 200 */ SDL_SCANCODE_UNKNOWN, /* KEY_PLAYCD */ + /* 201 */ SDL_SCANCODE_UNKNOWN, /* KEY_PAUSECD */ + /* 202 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG3 */ + /* 203 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG4 */ + 0, + /* 205 */ SDL_SCANCODE_UNKNOWN, /* KEY_SUSPEND */ + /* 206 */ SDL_SCANCODE_UNKNOWN, /* KEY_CLOSE */ + /* 207 */ SDL_SCANCODE_UNKNOWN, /* KEY_PLAY */ + /* 208 */ SDL_SCANCODE_UNKNOWN, /* KEY_FASTFORWARD */ + /* 209 */ SDL_SCANCODE_UNKNOWN, /* KEY_BASSBOOST */ + /* 210 */ SDL_SCANCODE_UNKNOWN, /* KEY_PRINT */ + /* 211 */ SDL_SCANCODE_UNKNOWN, /* KEY_HP */ + /* 212 */ SDL_SCANCODE_UNKNOWN, /* KEY_CAMERA */ + /* 213 */ SDL_SCANCODE_UNKNOWN, /* KEY_SOUND */ + /* 214 */ SDL_SCANCODE_UNKNOWN, /* KEY_QUESTION */ + /* 215 */ SDL_SCANCODE_UNKNOWN, /* KEY_EMAIL */ + /* 216 */ SDL_SCANCODE_UNKNOWN, /* KEY_CHAT */ + /* 217 */ SDL_SCANCODE_AC_SEARCH, + /* 218 */ SDL_SCANCODE_UNKNOWN, /* KEY_CONNECT */ + /* 219 */ SDL_SCANCODE_UNKNOWN, /* KEY_FINANCE */ + /* 220 */ SDL_SCANCODE_UNKNOWN, /* KEY_SPORT */ + /* 221 */ SDL_SCANCODE_UNKNOWN, /* KEY_SHOP */ + /* 222 */ SDL_SCANCODE_ALTERASE, + /* 223 */ SDL_SCANCODE_CANCEL, + /* 224 */ SDL_SCANCODE_BRIGHTNESSDOWN, + /* 225 */ SDL_SCANCODE_BRIGHTNESSUP, + /* 226 */ SDL_SCANCODE_UNKNOWN, /* KEY_MEDIA */ + /* 227 */ SDL_SCANCODE_DISPLAYSWITCH, /* KEY_SWITCHVIDEOMODE */ + /* 228 */ SDL_SCANCODE_KBDILLUMTOGGLE, + /* 229 */ SDL_SCANCODE_KBDILLUMDOWN, + /* 230 */ SDL_SCANCODE_KBDILLUMUP, + /* 231 */ SDL_SCANCODE_UNKNOWN, /* KEY_SEND */ + /* 232 */ SDL_SCANCODE_UNKNOWN, /* KEY_REPLY */ + /* 233 */ SDL_SCANCODE_UNKNOWN, /* KEY_FORWARDMAIL */ + /* 234 */ SDL_SCANCODE_UNKNOWN, /* KEY_SAVE */ + /* 235 */ SDL_SCANCODE_UNKNOWN, /* KEY_DOCUMENTS */ + /* 236 */ SDL_SCANCODE_UNKNOWN, /* KEY_BATTERY */ +}; +/* *INDENT-ON* */ diff --git a/src/events/scancodes_windows.h b/src/events/scancodes_windows.h new file mode 100644 index 0000000000..1034b1b570 --- /dev/null +++ b/src/events/scancodes_windows.h @@ -0,0 +1,55 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../include/SDL_scancode.h" + +/* Windows scancode to SDL scancode mapping table */ +/* derived from Microsoft scan code document, http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc */ + +/* *INDENT-OFF* */ +static const SDL_Scancode windows_scancode_table[] = +{ + // 0 1 2 3 4 5 6 7 + // 8 9 A B C D E F + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, // 0 + SDL_SCANCODE_7, SDL_SCANCODE_8, SDL_SCANCODE_9, SDL_SCANCODE_0, SDL_SCANCODE_MINUS, SDL_SCANCODE_EQUALS, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_TAB, // 0 + + SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_E, SDL_SCANCODE_R, SDL_SCANCODE_T, SDL_SCANCODE_Y, SDL_SCANCODE_U, SDL_SCANCODE_I, // 1 + SDL_SCANCODE_O, SDL_SCANCODE_P, SDL_SCANCODE_LEFTBRACKET, SDL_SCANCODE_RIGHTBRACKET, SDL_SCANCODE_RETURN, SDL_SCANCODE_LCTRL, SDL_SCANCODE_A, SDL_SCANCODE_S, // 1 + + SDL_SCANCODE_D, SDL_SCANCODE_F, SDL_SCANCODE_G, SDL_SCANCODE_H, SDL_SCANCODE_J, SDL_SCANCODE_K, SDL_SCANCODE_L, SDL_SCANCODE_SEMICOLON, // 2 + SDL_SCANCODE_APOSTROPHE, SDL_SCANCODE_GRAVE, SDL_SCANCODE_LSHIFT, SDL_SCANCODE_BACKSLASH, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_C, SDL_SCANCODE_V, // 2 + + SDL_SCANCODE_B, SDL_SCANCODE_N, SDL_SCANCODE_M, SDL_SCANCODE_COMMA, SDL_SCANCODE_PERIOD, SDL_SCANCODE_SLASH, SDL_SCANCODE_RSHIFT, SDL_SCANCODE_PRINTSCREEN,// 3 + SDL_SCANCODE_LALT, SDL_SCANCODE_SPACE, SDL_SCANCODE_CAPSLOCK, SDL_SCANCODE_F1, SDL_SCANCODE_F2, SDL_SCANCODE_F3, SDL_SCANCODE_F4, SDL_SCANCODE_F5, // 3 + + SDL_SCANCODE_F6, SDL_SCANCODE_F7, SDL_SCANCODE_F8, SDL_SCANCODE_F9, SDL_SCANCODE_F10, SDL_SCANCODE_NUMLOCKCLEAR, SDL_SCANCODE_SCROLLLOCK, SDL_SCANCODE_HOME, // 4 + SDL_SCANCODE_UP, SDL_SCANCODE_PAGEUP, SDL_SCANCODE_KP_MINUS, SDL_SCANCODE_LEFT, SDL_SCANCODE_KP_5, SDL_SCANCODE_RIGHT, SDL_SCANCODE_KP_PLUS, SDL_SCANCODE_END, // 4 + + SDL_SCANCODE_DOWN, SDL_SCANCODE_PAGEDOWN, SDL_SCANCODE_INSERT, SDL_SCANCODE_DELETE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_NONUSBACKSLASH,SDL_SCANCODE_F11, // 5 + SDL_SCANCODE_F12, SDL_SCANCODE_PAUSE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_LGUI, SDL_SCANCODE_RGUI, SDL_SCANCODE_APPLICATION, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, // 5 + + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, // 6 + SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, // 6 + + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, // 7 + SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN // 7 +}; +/* *INDENT-ON* */ diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h new file mode 100644 index 0000000000..fadcfbfd90 --- /dev/null +++ b/src/events/scancodes_xfree86.h @@ -0,0 +1,421 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../include/SDL_scancode.h" + +/* XFree86 key code to SDL scancode mapping table + Sources: + - atKeyNames.h from XFree86 source code +*/ +/* *INDENT-OFF* */ +static const SDL_Scancode xfree86_scancode_table[] = { + /* 0 */ SDL_SCANCODE_UNKNOWN, + /* 1 */ SDL_SCANCODE_ESCAPE, + /* 2 */ SDL_SCANCODE_1, + /* 3 */ SDL_SCANCODE_2, + /* 4 */ SDL_SCANCODE_3, + /* 5 */ SDL_SCANCODE_4, + /* 6 */ SDL_SCANCODE_5, + /* 7 */ SDL_SCANCODE_6, + /* 8 */ SDL_SCANCODE_7, + /* 9 */ SDL_SCANCODE_8, + /* 10 */ SDL_SCANCODE_9, + /* 11 */ SDL_SCANCODE_0, + /* 12 */ SDL_SCANCODE_MINUS, + /* 13 */ SDL_SCANCODE_EQUALS, + /* 14 */ SDL_SCANCODE_BACKSPACE, + /* 15 */ SDL_SCANCODE_TAB, + /* 16 */ SDL_SCANCODE_Q, + /* 17 */ SDL_SCANCODE_W, + /* 18 */ SDL_SCANCODE_E, + /* 19 */ SDL_SCANCODE_R, + /* 20 */ SDL_SCANCODE_T, + /* 21 */ SDL_SCANCODE_Y, + /* 22 */ SDL_SCANCODE_U, + /* 23 */ SDL_SCANCODE_I, + /* 24 */ SDL_SCANCODE_O, + /* 25 */ SDL_SCANCODE_P, + /* 26 */ SDL_SCANCODE_LEFTBRACKET, + /* 27 */ SDL_SCANCODE_RIGHTBRACKET, + /* 28 */ SDL_SCANCODE_RETURN, + /* 29 */ SDL_SCANCODE_LCTRL, + /* 30 */ SDL_SCANCODE_A, + /* 31 */ SDL_SCANCODE_S, + /* 32 */ SDL_SCANCODE_D, + /* 33 */ SDL_SCANCODE_F, + /* 34 */ SDL_SCANCODE_G, + /* 35 */ SDL_SCANCODE_H, + /* 36 */ SDL_SCANCODE_J, + /* 37 */ SDL_SCANCODE_K, + /* 38 */ SDL_SCANCODE_L, + /* 39 */ SDL_SCANCODE_SEMICOLON, + /* 40 */ SDL_SCANCODE_APOSTROPHE, + /* 41 */ SDL_SCANCODE_GRAVE, + /* 42 */ SDL_SCANCODE_LSHIFT, + /* 43 */ SDL_SCANCODE_BACKSLASH, + /* 44 */ SDL_SCANCODE_Z, + /* 45 */ SDL_SCANCODE_X, + /* 46 */ SDL_SCANCODE_C, + /* 47 */ SDL_SCANCODE_V, + /* 48 */ SDL_SCANCODE_B, + /* 49 */ SDL_SCANCODE_N, + /* 50 */ SDL_SCANCODE_M, + /* 51 */ SDL_SCANCODE_COMMA, + /* 52 */ SDL_SCANCODE_PERIOD, + /* 53 */ SDL_SCANCODE_SLASH, + /* 54 */ SDL_SCANCODE_RSHIFT, + /* 55 */ SDL_SCANCODE_KP_MULTIPLY, + /* 56 */ SDL_SCANCODE_LALT, + /* 57 */ SDL_SCANCODE_SPACE, + /* 58 */ SDL_SCANCODE_CAPSLOCK, + /* 59 */ SDL_SCANCODE_F1, + /* 60 */ SDL_SCANCODE_F2, + /* 61 */ SDL_SCANCODE_F3, + /* 62 */ SDL_SCANCODE_F4, + /* 63 */ SDL_SCANCODE_F5, + /* 64 */ SDL_SCANCODE_F6, + /* 65 */ SDL_SCANCODE_F7, + /* 66 */ SDL_SCANCODE_F8, + /* 67 */ SDL_SCANCODE_F9, + /* 68 */ SDL_SCANCODE_F10, + /* 69 */ SDL_SCANCODE_NUMLOCKCLEAR, + /* 70 */ SDL_SCANCODE_SCROLLLOCK, + /* 71 */ SDL_SCANCODE_KP_7, + /* 72 */ SDL_SCANCODE_KP_8, + /* 73 */ SDL_SCANCODE_KP_9, + /* 74 */ SDL_SCANCODE_KP_MINUS, + /* 75 */ SDL_SCANCODE_KP_4, + /* 76 */ SDL_SCANCODE_KP_5, + /* 77 */ SDL_SCANCODE_KP_6, + /* 78 */ SDL_SCANCODE_KP_PLUS, + /* 79 */ SDL_SCANCODE_KP_1, + /* 80 */ SDL_SCANCODE_KP_2, + /* 81 */ SDL_SCANCODE_KP_3, + /* 82 */ SDL_SCANCODE_KP_0, + /* 83 */ SDL_SCANCODE_KP_PERIOD, + /* 84 */ SDL_SCANCODE_SYSREQ, + /* 85 */ SDL_SCANCODE_MODE, + /* 86 */ SDL_SCANCODE_NONUSBACKSLASH, + /* 87 */ SDL_SCANCODE_F11, + /* 88 */ SDL_SCANCODE_F12, + /* 89 */ SDL_SCANCODE_HOME, + /* 90 */ SDL_SCANCODE_UP, + /* 91 */ SDL_SCANCODE_PAGEUP, + /* 92 */ SDL_SCANCODE_LEFT, + /* 93 */ SDL_SCANCODE_BRIGHTNESSDOWN, /* on PowerBook G4 / KEY_Begin */ + /* 94 */ SDL_SCANCODE_RIGHT, + /* 95 */ SDL_SCANCODE_END, + /* 96 */ SDL_SCANCODE_DOWN, + /* 97 */ SDL_SCANCODE_PAGEDOWN, + /* 98 */ SDL_SCANCODE_INSERT, + /* 99 */ SDL_SCANCODE_DELETE, + /* 100 */ SDL_SCANCODE_KP_ENTER, + /* 101 */ SDL_SCANCODE_RCTRL, + /* 102 */ SDL_SCANCODE_PAUSE, + /* 103 */ SDL_SCANCODE_PRINTSCREEN, + /* 104 */ SDL_SCANCODE_KP_DIVIDE, + /* 105 */ SDL_SCANCODE_RALT, + /* 106 */ SDL_SCANCODE_UNKNOWN, /* BREAK */ + /* 107 */ SDL_SCANCODE_LGUI, + /* 108 */ SDL_SCANCODE_RGUI, + /* 109 */ SDL_SCANCODE_APPLICATION, + /* 110 */ SDL_SCANCODE_F13, + /* 111 */ SDL_SCANCODE_F14, + /* 112 */ SDL_SCANCODE_F15, + /* 113 */ SDL_SCANCODE_F16, + /* 114 */ SDL_SCANCODE_F17, + /* 115 */ SDL_SCANCODE_UNKNOWN, + /* 116 */ SDL_SCANCODE_UNKNOWN, /* is translated to XK_ISO_Level3_Shift by my X server, but I have no keyboard that generates this code, so I don't know what the correct SDL_SCANCODE_* for it is */ + /* 117 */ SDL_SCANCODE_UNKNOWN, + /* 118 */ SDL_SCANCODE_KP_EQUALS, + /* 119 */ SDL_SCANCODE_UNKNOWN, + /* 120 */ SDL_SCANCODE_UNKNOWN, + /* 121 */ SDL_SCANCODE_UNKNOWN, + /* 122 */ SDL_SCANCODE_UNKNOWN, + /* 123 */ SDL_SCANCODE_UNKNOWN, + /* 124 */ SDL_SCANCODE_UNKNOWN, + /* 125 */ SDL_SCANCODE_INTERNATIONAL3, /* Yen */ + /* 126 */ SDL_SCANCODE_UNKNOWN, + /* 127 */ SDL_SCANCODE_UNKNOWN, + /* 128 */ SDL_SCANCODE_UNKNOWN, + /* 129 */ SDL_SCANCODE_UNKNOWN, + /* 130 */ SDL_SCANCODE_UNKNOWN, + /* 131 */ SDL_SCANCODE_UNKNOWN, + /* 132 */ SDL_SCANCODE_POWER, + /* 133 */ SDL_SCANCODE_MUTE, + /* 134 */ SDL_SCANCODE_VOLUMEDOWN, + /* 135 */ SDL_SCANCODE_VOLUMEUP, + /* 136 */ SDL_SCANCODE_HELP, + /* 137 */ SDL_SCANCODE_STOP, + /* 138 */ SDL_SCANCODE_AGAIN, + /* 139 */ SDL_SCANCODE_UNKNOWN, /* PROPS */ + /* 140 */ SDL_SCANCODE_UNDO, + /* 141 */ SDL_SCANCODE_UNKNOWN, /* FRONT */ + /* 142 */ SDL_SCANCODE_COPY, + /* 143 */ SDL_SCANCODE_UNKNOWN, /* OPEN */ + /* 144 */ SDL_SCANCODE_PASTE, + /* 145 */ SDL_SCANCODE_FIND, + /* 146 */ SDL_SCANCODE_CUT, +}; + +/* for wireless usb keyboard (manufacturer TRUST) without numpad. */ +static const SDL_Scancode xfree86_scancode_table2[] = { + /* 0 */ SDL_SCANCODE_UNKNOWN, + /* 1 */ SDL_SCANCODE_ESCAPE, + /* 2 */ SDL_SCANCODE_1, + /* 3 */ SDL_SCANCODE_2, + /* 4 */ SDL_SCANCODE_3, + /* 5 */ SDL_SCANCODE_4, + /* 6 */ SDL_SCANCODE_5, + /* 7 */ SDL_SCANCODE_6, + /* 8 */ SDL_SCANCODE_7, + /* 9 */ SDL_SCANCODE_8, + /* 10 */ SDL_SCANCODE_9, + /* 11 */ SDL_SCANCODE_0, + /* 12 */ SDL_SCANCODE_MINUS, + /* 13 */ SDL_SCANCODE_EQUALS, + /* 14 */ SDL_SCANCODE_BACKSPACE, + /* 15 */ SDL_SCANCODE_TAB, + /* 16 */ SDL_SCANCODE_Q, + /* 17 */ SDL_SCANCODE_W, + /* 18 */ SDL_SCANCODE_E, + /* 19 */ SDL_SCANCODE_R, + /* 20 */ SDL_SCANCODE_T, + /* 21 */ SDL_SCANCODE_Y, + /* 22 */ SDL_SCANCODE_U, + /* 23 */ SDL_SCANCODE_I, + /* 24 */ SDL_SCANCODE_O, + /* 25 */ SDL_SCANCODE_P, + /* 26 */ SDL_SCANCODE_LEFTBRACKET, + /* 27 */ SDL_SCANCODE_RIGHTBRACKET, + /* 28 */ SDL_SCANCODE_RETURN, + /* 29 */ SDL_SCANCODE_LCTRL, + /* 30 */ SDL_SCANCODE_A, + /* 31 */ SDL_SCANCODE_S, + /* 32 */ SDL_SCANCODE_D, + /* 33 */ SDL_SCANCODE_F, + /* 34 */ SDL_SCANCODE_G, + /* 35 */ SDL_SCANCODE_H, + /* 36 */ SDL_SCANCODE_J, + /* 37 */ SDL_SCANCODE_K, + /* 38 */ SDL_SCANCODE_L, + /* 39 */ SDL_SCANCODE_SEMICOLON, + /* 40 */ SDL_SCANCODE_APOSTROPHE, + /* 41 */ SDL_SCANCODE_GRAVE, + /* 42 */ SDL_SCANCODE_LSHIFT, + /* 43 */ SDL_SCANCODE_BACKSLASH, + /* 44 */ SDL_SCANCODE_Z, + /* 45 */ SDL_SCANCODE_X, + /* 46 */ SDL_SCANCODE_C, + /* 47 */ SDL_SCANCODE_V, + /* 48 */ SDL_SCANCODE_B, + /* 49 */ SDL_SCANCODE_N, + /* 50 */ SDL_SCANCODE_M, + /* 51 */ SDL_SCANCODE_COMMA, + /* 52 */ SDL_SCANCODE_PERIOD, + /* 53 */ SDL_SCANCODE_SLASH, + /* 54 */ SDL_SCANCODE_RSHIFT, + /* 55 */ SDL_SCANCODE_KP_MULTIPLY, + /* 56 */ SDL_SCANCODE_LALT, + /* 57 */ SDL_SCANCODE_SPACE, + /* 58 */ SDL_SCANCODE_CAPSLOCK, + /* 59 */ SDL_SCANCODE_F1, + /* 60 */ SDL_SCANCODE_F2, + /* 61 */ SDL_SCANCODE_F3, + /* 62 */ SDL_SCANCODE_F4, + /* 63 */ SDL_SCANCODE_F5, + /* 64 */ SDL_SCANCODE_F6, + /* 65 */ SDL_SCANCODE_F7, + /* 66 */ SDL_SCANCODE_F8, + /* 67 */ SDL_SCANCODE_F9, + /* 68 */ SDL_SCANCODE_F10, + /* 69 */ SDL_SCANCODE_NUMLOCKCLEAR, + /* 70 */ SDL_SCANCODE_SCROLLLOCK, + /* 71 */ SDL_SCANCODE_KP_7, + /* 72 */ SDL_SCANCODE_KP_8, + /* 73 */ SDL_SCANCODE_KP_9, + /* 74 */ SDL_SCANCODE_KP_MINUS, + /* 75 */ SDL_SCANCODE_KP_4, + /* 76 */ SDL_SCANCODE_KP_5, + /* 77 */ SDL_SCANCODE_KP_6, + /* 78 */ SDL_SCANCODE_KP_PLUS, + /* 79 */ SDL_SCANCODE_KP_1, + /* 80 */ SDL_SCANCODE_KP_2, + /* 81 */ SDL_SCANCODE_KP_3, + /* 82 */ SDL_SCANCODE_KP_0, + /* 83 */ SDL_SCANCODE_KP_PERIOD, + /* 84 */ SDL_SCANCODE_SYSREQ, /* ???? */ + /* 85 */ SDL_SCANCODE_MODE, /* ???? */ + /* 86 */ SDL_SCANCODE_NONUSBACKSLASH, + /* 87 */ SDL_SCANCODE_F11, + /* 88 */ SDL_SCANCODE_F12, + /* 89 */ SDL_SCANCODE_UNKNOWN, + /* 90 */ SDL_SCANCODE_UNKNOWN, /* Katakana */ + /* 91 */ SDL_SCANCODE_UNKNOWN, /* Hiragana */ + /* 92 */ SDL_SCANCODE_UNKNOWN, /* Henkan_Mode */ + /* 93 */ SDL_SCANCODE_UNKNOWN, /* Hiragana_Katakana */ + /* 94 */ SDL_SCANCODE_UNKNOWN, /* Muhenkan */ + /* 95 */ SDL_SCANCODE_UNKNOWN, + /* 96 */ SDL_SCANCODE_KP_ENTER, + /* 97 */ SDL_SCANCODE_RCTRL, + /* 98 */ SDL_SCANCODE_KP_DIVIDE, + /* 99 */ SDL_SCANCODE_PRINTSCREEN, + /* 100 */ SDL_SCANCODE_RALT, /* ISO_Level3_Shift, ALTGR, RALT */ + /* 101 */ SDL_SCANCODE_UNKNOWN, /* Linefeed */ + /* 102 */ SDL_SCANCODE_HOME, + /* 103 */ SDL_SCANCODE_UP, + /* 104 */ SDL_SCANCODE_PAGEUP, + /* 105 */ SDL_SCANCODE_LEFT, + /* 106 */ SDL_SCANCODE_RIGHT, + /* 107 */ SDL_SCANCODE_END, + /* 108 */ SDL_SCANCODE_DOWN, + /* 109 */ SDL_SCANCODE_PAGEDOWN, + /* 110 */ SDL_SCANCODE_INSERT, + /* 111 */ SDL_SCANCODE_DELETE, + /* 112 */ SDL_SCANCODE_UNKNOWN, + /* 113 */ SDL_SCANCODE_MUTE, + /* 114 */ SDL_SCANCODE_VOLUMEDOWN, + /* 115 */ SDL_SCANCODE_VOLUMEUP, + /* 116 */ SDL_SCANCODE_POWER, + /* 117 */ SDL_SCANCODE_KP_EQUALS, + /* 118 */ SDL_SCANCODE_UNKNOWN, /* plusminus */ + /* 119 */ SDL_SCANCODE_PAUSE, + /* 120 */ SDL_SCANCODE_UNKNOWN, /* XF86LaunchA */ + /* 121 */ SDL_SCANCODE_UNKNOWN, /* KP_Decimal */ + /* 122 */ SDL_SCANCODE_UNKNOWN, /* Hangul */ + /* 123 */ SDL_SCANCODE_UNKNOWN, /* Hangul_Hanja */ + /* 124 */ SDL_SCANCODE_UNKNOWN, + /* 125 */ SDL_SCANCODE_LGUI, + /* 126 */ SDL_SCANCODE_RGUI, + /* 127 */ SDL_SCANCODE_APPLICATION, + /* 128 */ SDL_SCANCODE_CANCEL, + /* 129 */ SDL_SCANCODE_AGAIN, + /* 130 */ SDL_SCANCODE_UNKNOWN, /* SunProps */ + /* 131 */ SDL_SCANCODE_UNDO, + /* 132 */ SDL_SCANCODE_UNKNOWN, /* SunFront */ + /* 133 */ SDL_SCANCODE_COPY, + /* 134 */ SDL_SCANCODE_UNKNOWN, /* SunOpen */ + /* 135 */ SDL_SCANCODE_PASTE, + /* 136 */ SDL_SCANCODE_FIND, + /* 137 */ SDL_SCANCODE_CUT, + /* 138 */ SDL_SCANCODE_HELP, + /* 139 */ SDL_SCANCODE_UNKNOWN, /* XF86MenuKB */ + /* 140 */ SDL_SCANCODE_CALCULATOR, + /* 141 */ SDL_SCANCODE_UNKNOWN, + /* 142 */ SDL_SCANCODE_SLEEP, + /* 143 */ SDL_SCANCODE_UNKNOWN, /* XF86WakeUp */ + /* 144 */ SDL_SCANCODE_UNKNOWN, /* XF86Explorer */ + /* 145 */ SDL_SCANCODE_UNKNOWN, /* XF86Send */ + /* 146 */ SDL_SCANCODE_UNKNOWN, + /* 147 */ SDL_SCANCODE_UNKNOWN, /* XF86Xfer */ + /* 148 */ SDL_SCANCODE_APP1, /* XF86Launch1 */ + /* 149 */ SDL_SCANCODE_APP2, /* XF86Launch2 */ + /* 150 */ SDL_SCANCODE_WWW, + /* 151 */ SDL_SCANCODE_UNKNOWN, /* XF86DOS */ + /* 152 */ SDL_SCANCODE_UNKNOWN, /* XF86ScreenSaver */ + /* 153 */ SDL_SCANCODE_UNKNOWN, + /* 154 */ SDL_SCANCODE_UNKNOWN, /* XF86RotateWindows */ + /* 155 */ SDL_SCANCODE_MAIL, + /* 156 */ SDL_SCANCODE_AC_BOOKMARKS, /* XF86Favorites */ + /* 157 */ SDL_SCANCODE_COMPUTER, + /* 158 */ SDL_SCANCODE_AC_BACK, + /* 159 */ SDL_SCANCODE_AC_FORWARD, + /* 160 */ SDL_SCANCODE_UNKNOWN, + /* 161 */ SDL_SCANCODE_EJECT, + /* 162 */ SDL_SCANCODE_EJECT, + /* 163 */ SDL_SCANCODE_AUDIONEXT, + /* 164 */ SDL_SCANCODE_AUDIOPLAY, + /* 165 */ SDL_SCANCODE_AUDIOPREV, + /* 166 */ SDL_SCANCODE_AUDIOSTOP, + /* 167 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioRecord */ + /* 168 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioRewind */ + /* 169 */ SDL_SCANCODE_UNKNOWN, /* XF86Phone */ + /* 170 */ SDL_SCANCODE_UNKNOWN, + /* 171 */ SDL_SCANCODE_F13, /* XF86Tools */ + /* 172 */ SDL_SCANCODE_AC_HOME, + /* 173 */ SDL_SCANCODE_AC_REFRESH, + /* 174 */ SDL_SCANCODE_UNKNOWN, /* XF86Close */ + /* 175 */ SDL_SCANCODE_UNKNOWN, + /* 176 */ SDL_SCANCODE_UNKNOWN, + /* 177 */ SDL_SCANCODE_UNKNOWN, /* XF86ScrollUp */ + /* 178 */ SDL_SCANCODE_UNKNOWN, /* XF86ScrollDown */ + /* 179 */ SDL_SCANCODE_UNKNOWN, /* parenleft */ + /* 180 */ SDL_SCANCODE_UNKNOWN, /* parenright */ + /* 181 */ SDL_SCANCODE_UNKNOWN, /* XF86New */ + /* 182 */ SDL_SCANCODE_AGAIN, + /* 183 */ SDL_SCANCODE_F13, /* XF86Tools */ + /* 184 */ SDL_SCANCODE_F14, /* XF86Launch5 */ + /* 185 */ SDL_SCANCODE_F15, /* XF86Launch6 */ + /* 186 */ SDL_SCANCODE_F16, /* XF86Launch7 */ + /* 187 */ SDL_SCANCODE_F17, /* XF86Launch8 */ + /* 188 */ SDL_SCANCODE_F18, /* XF86Launch9 */ + /* 189 */ SDL_SCANCODE_F19, /* null keysym */ + /* 190 */ SDL_SCANCODE_UNKNOWN, + /* 191 */ SDL_SCANCODE_UNKNOWN, + /* 192 */ SDL_SCANCODE_UNKNOWN, /* XF86TouchpadToggle */ + /* 193 */ SDL_SCANCODE_UNKNOWN, + /* 194 */ SDL_SCANCODE_UNKNOWN, + /* 195 */ SDL_SCANCODE_MODE, + /* 196 */ SDL_SCANCODE_UNKNOWN, + /* 197 */ SDL_SCANCODE_UNKNOWN, + /* 198 */ SDL_SCANCODE_UNKNOWN, + /* 199 */ SDL_SCANCODE_UNKNOWN, + /* 200 */ SDL_SCANCODE_AUDIOPLAY, + /* 201 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioPause */ + /* 202 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch3 */ + /* 203 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch4 */ + /* 204 */ SDL_SCANCODE_UNKNOWN, /* XF86LaunchB */ + /* 205 */ SDL_SCANCODE_UNKNOWN, /* XF86Suspend */ + /* 206 */ SDL_SCANCODE_UNKNOWN, /* XF86Close */ + /* 207 */ SDL_SCANCODE_AUDIOPLAY, + /* 208 */ SDL_SCANCODE_AUDIONEXT, + /* 209 */ SDL_SCANCODE_UNKNOWN, + /* 210 */ SDL_SCANCODE_PRINTSCREEN, + /* 211 */ SDL_SCANCODE_UNKNOWN, + /* 212 */ SDL_SCANCODE_UNKNOWN, /* XF86WebCam */ + /* 213 */ SDL_SCANCODE_UNKNOWN, + /* 214 */ SDL_SCANCODE_UNKNOWN, + /* 215 */ SDL_SCANCODE_MAIL, + /* 216 */ SDL_SCANCODE_UNKNOWN, + /* 217 */ SDL_SCANCODE_AC_SEARCH, + /* 218 */ SDL_SCANCODE_UNKNOWN, + /* 219 */ SDL_SCANCODE_UNKNOWN, /* XF86Finance */ + /* 220 */ SDL_SCANCODE_UNKNOWN, + /* 221 */ SDL_SCANCODE_UNKNOWN, /* XF86Shop */ + /* 222 */ SDL_SCANCODE_UNKNOWN, + /* 223 */ SDL_SCANCODE_STOP, + /* 224 */ SDL_SCANCODE_BRIGHTNESSDOWN, + /* 225 */ SDL_SCANCODE_BRIGHTNESSUP, + /* 226 */ SDL_SCANCODE_MEDIASELECT, + /* 227 */ SDL_SCANCODE_DISPLAYSWITCH, + /* 228 */ SDL_SCANCODE_KBDILLUMTOGGLE, + /* 229 */ SDL_SCANCODE_KBDILLUMDOWN, + /* 230 */ SDL_SCANCODE_KBDILLUMUP, + /* 231 */ SDL_SCANCODE_UNKNOWN, /* XF86Send */ + /* 232 */ SDL_SCANCODE_UNKNOWN, /* XF86Reply */ + /* 233 */ SDL_SCANCODE_UNKNOWN, /* XF86MailForward */ + /* 234 */ SDL_SCANCODE_UNKNOWN, /* XF86Save */ + /* 235 */ SDL_SCANCODE_UNKNOWN, /* XF86Documents */ + /* 236 */ SDL_SCANCODE_UNKNOWN, /* XF86Battery */ + /* 237 */ SDL_SCANCODE_UNKNOWN, /* XF86Bluetooth */ + /* 238 */ SDL_SCANCODE_UNKNOWN, /* XF86WLAN */ +}; + +/* *INDENT-ON* */ diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index 1593e97722..afbc39aa00 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -1,24 +1,25 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ +/* Need this so Linux systems define fseek64o, ftell64o and off64_t */ +#define _LARGEFILE64_SOURCE #include "SDL_config.h" /* This file provides a general interface for SDL to read and write @@ -28,291 +29,259 @@ #include "SDL_endian.h" #include "SDL_rwops.h" +#ifdef __APPLE__ +#include "cocoa/SDL_rwopsbundlesupport.h" +#endif /* __APPLE__ */ -#if defined(__WIN32__) && !defined(__SYMBIAN32__) +#ifdef ANDROID +#include "../core/android/SDL_android.h" +#include "SDL_system.h" +#endif + +#ifdef __WIN32__ /* Functions to read/write Win32 API file pointers */ -/* Will not use it on WinCE because stdio is buffered, it means - faster, and all stdio functions anyway are embedded in coredll.dll - - the main wince dll*/ -#define WINDOWS_LEAN_AND_MEAN -#include +#include "../core/windows/SDL_windows.h" #ifndef INVALID_SET_FILE_POINTER #define INVALID_SET_FILE_POINTER 0xFFFFFFFF #endif -#define READAHEAD_BUFFER_SIZE 1024 +#define READAHEAD_BUFFER_SIZE 1024 + +static int SDLCALL +windows_file_open(SDL_RWops * context, const char *filename, const char *mode) +{ + UINT old_error_mode; + HANDLE h; + DWORD r_right, w_right; + DWORD must_exist, truncate; + int a_mode; + + if (!context) + return -1; /* failed (invalid call) */ + + context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* mark this as unusable */ + context->hidden.windowsio.buffer.data = NULL; + context->hidden.windowsio.buffer.size = 0; + context->hidden.windowsio.buffer.left = 0; + + /* "r" = reading, file must exist */ + /* "w" = writing, truncate existing, file may not exist */ + /* "r+"= reading or writing, file must exist */ + /* "a" = writing, append file may not exist */ + /* "a+"= append + read, file may not exist */ + /* "w+" = read, write, truncate. file may not exist */ + + must_exist = (SDL_strchr(mode, 'r') != NULL) ? OPEN_EXISTING : 0; + truncate = (SDL_strchr(mode, 'w') != NULL) ? CREATE_ALWAYS : 0; + r_right = (SDL_strchr(mode, '+') != NULL + || must_exist) ? GENERIC_READ : 0; + a_mode = (SDL_strchr(mode, 'a') != NULL) ? OPEN_ALWAYS : 0; + w_right = (a_mode || SDL_strchr(mode, '+') + || truncate) ? GENERIC_WRITE : 0; + + if (!r_right && !w_right) /* inconsistent mode */ + return -1; /* failed (invalid call) */ + + context->hidden.windowsio.buffer.data = + (char *) SDL_malloc(READAHEAD_BUFFER_SIZE); + if (!context->hidden.windowsio.buffer.data) { + return SDL_OutOfMemory(); + } + /* Do not open a dialog box if failure */ + old_error_mode = + SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS); + + { + LPTSTR tstr = WIN_UTF8ToString(filename); + h = CreateFile(tstr, (w_right | r_right), + (w_right) ? 0 : FILE_SHARE_READ, NULL, + (must_exist | truncate | a_mode), + FILE_ATTRIBUTE_NORMAL, NULL); + SDL_free(tstr); + } + + /* restore old behavior */ + SetErrorMode(old_error_mode); -static int SDLCALL win32_file_open(SDL_RWops *context, const char *filename, const char *mode) + if (h == INVALID_HANDLE_VALUE) { + SDL_free(context->hidden.windowsio.buffer.data); + context->hidden.windowsio.buffer.data = NULL; + SDL_SetError("Couldn't open %s", filename); + return -2; /* failed (CreateFile) */ + } + context->hidden.windowsio.h = h; + context->hidden.windowsio.append = a_mode ? SDL_TRUE : SDL_FALSE; + + return 0; /* ok */ +} + +static Sint64 SDLCALL +windows_file_size(SDL_RWops * context) { -#ifndef _WIN32_WCE - UINT old_error_mode; -#endif - HANDLE h; - DWORD r_right, w_right; - DWORD must_exist, truncate; - int a_mode; - - if (!context) - return -1; /* failed (invalid call) */ - - context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* mark this as unusable */ - context->hidden.win32io.buffer.data = NULL; - context->hidden.win32io.buffer.size = 0; - context->hidden.win32io.buffer.left = 0; - - /* "r" = reading, file must exist */ - /* "w" = writing, truncate existing, file may not exist */ - /* "r+"= reading or writing, file must exist */ - /* "a" = writing, append file may not exist */ - /* "a+"= append + read, file may not exist */ - /* "w+" = read, write, truncate. file may not exist */ - - must_exist = ( SDL_strchr(mode,'r') != NULL ) ? OPEN_EXISTING : 0; - truncate = ( SDL_strchr(mode,'w') != NULL ) ? CREATE_ALWAYS : 0; - r_right = ( SDL_strchr(mode,'+') != NULL || must_exist ) ? GENERIC_READ : 0; - a_mode = ( SDL_strchr(mode,'a') != NULL ) ? OPEN_ALWAYS : 0; - w_right = ( a_mode || SDL_strchr(mode,'+') || truncate ) ? GENERIC_WRITE : 0; - - if (!r_right && !w_right) /* inconsistent mode */ - return -1; /* failed (invalid call) */ - - context->hidden.win32io.buffer.data = (char *)SDL_malloc(READAHEAD_BUFFER_SIZE); - if (!context->hidden.win32io.buffer.data) { - SDL_OutOfMemory(); - return -1; - } - -#ifdef _WIN32_WCE - { - size_t size = SDL_strlen(filename)+1; - wchar_t *filenameW = SDL_stack_alloc(wchar_t, size); - - if ( MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) == 0 ) { - SDL_stack_free(filenameW); - SDL_free(context->hidden.win32io.buffer.data); - context->hidden.win32io.buffer.data = NULL; - SDL_SetError("Unable to convert filename to Unicode"); - return -1; - } - h = CreateFile(filenameW, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ, - NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL); - SDL_stack_free(filenameW); - } -#else - { - - /* handle Unicode filenames. We do some tapdancing here to make sure this - works on Win9x, which doesn't support anything but 1-byte codepages. */ - const size_t size = SDL_strlen(filename)+1; - static int unicode_support = -1; - - if (unicode_support == -1) { - OSVERSIONINFO osVerInfo; /* Information about the OS */ - osVerInfo.dwOSVersionInfoSize = sizeof(osVerInfo); - if (!GetVersionEx(&osVerInfo)) { - unicode_support = 0; - } else if (osVerInfo.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) { - unicode_support = 1; /* Not Win95/98/ME. */ - } else { - unicode_support = 0; - } - } - - if (unicode_support) { /* everything but Win95/98/ME. */ - wchar_t *filenameW = SDL_stack_alloc(wchar_t, size); - if ( MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) == 0 ) { - SDL_stack_free(filenameW); - SDL_free(context->hidden.win32io.buffer.data); - context->hidden.win32io.buffer.data = NULL; - SDL_SetError("Unable to convert filename to Unicode"); - return -1; - } - - /* Do not open a dialog box if failure */ - old_error_mode = SetErrorMode(SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS); - h = CreateFileW(filenameW, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ, - NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL); - /* restore old behaviour */ - SetErrorMode(old_error_mode); - - SDL_stack_free(filenameW); - } else { - /* CP_UTF8 might not be supported (Win95), so use SDL_iconv to get wchars. */ - /* Use UCS2: no UTF-16 support here. Try again in SDL 1.3. :) */ - char *utf16 = SDL_iconv_string("UCS2", "UTF8", filename, SDL_strlen(filename) + 1); - char *filenameA = SDL_stack_alloc(char, size * 6); /* 6, just in case. */ - BOOL bDefCharUsed = FALSE; - - /* Dither down to a codepage and hope for the best. */ - if (!utf16 || - !WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)utf16, -1, filenameA, size*6, 0, &bDefCharUsed) || - bDefCharUsed) { - SDL_stack_free(filenameA); - SDL_free(utf16); - SDL_free(context->hidden.win32io.buffer.data); - context->hidden.win32io.buffer.data = NULL; - SDL_SetError("Unable to convert filename to Unicode"); - return -1; - } - - /* Do not open a dialog box if failure */ - old_error_mode = SetErrorMode(SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS); - h = CreateFile(filenameA, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ, - NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL); - /* restore old behaviour */ - SetErrorMode(old_error_mode); - - SDL_stack_free(filenameA); - SDL_free(utf16); - } - - } -#endif /* _WIN32_WCE */ - - if (h==INVALID_HANDLE_VALUE) { - SDL_free(context->hidden.win32io.buffer.data); - context->hidden.win32io.buffer.data = NULL; - SDL_SetError("Couldn't open %s",filename); - return -2; /* failed (CreateFile) */ - } - context->hidden.win32io.h = h; - context->hidden.win32io.append = a_mode; - - return 0; /* ok */ -} -static int SDLCALL win32_file_seek(SDL_RWops *context, int offset, int whence) -{ - DWORD win32whence; - int file_pos; - - if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE) { - SDL_SetError("win32_file_seek: invalid context/file not opened"); - return -1; - } - - /* FIXME: We may be able to satisfy the seek within buffered data */ - if (whence == RW_SEEK_CUR && context->hidden.win32io.buffer.left) { - offset -= context->hidden.win32io.buffer.left; - } - context->hidden.win32io.buffer.left = 0; - - switch (whence) { - case RW_SEEK_SET: - win32whence = FILE_BEGIN; break; - case RW_SEEK_CUR: - win32whence = FILE_CURRENT; break; - case RW_SEEK_END: - win32whence = FILE_END; break; - default: - SDL_SetError("win32_file_seek: Unknown value for 'whence'"); - return -1; - } - - file_pos = SetFilePointer(context->hidden.win32io.h,offset,NULL,win32whence); - - if ( file_pos != INVALID_SET_FILE_POINTER ) - return file_pos; /* success */ - - SDL_Error(SDL_EFSEEK); - return -1; /* error */ -} -static int SDLCALL win32_file_read(SDL_RWops *context, void *ptr, int size, int maxnum) -{ - int total_need; - int total_read = 0; - int read_ahead; - DWORD byte_read; - - total_need = size*maxnum; - - if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE || total_need<=0 || !size) - return 0; - - if (context->hidden.win32io.buffer.left > 0) { - void *data = (char *)context->hidden.win32io.buffer.data + - context->hidden.win32io.buffer.size - - context->hidden.win32io.buffer.left; - read_ahead = SDL_min(total_need, context->hidden.win32io.buffer.left); + LARGE_INTEGER size; + + if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) { + return SDL_SetError("windows_file_size: invalid context/file not opened"); + } + + if (!GetFileSizeEx(context->hidden.windowsio.h, &size)) { + return WIN_SetError("windows_file_size"); + } + + return size.QuadPart; +} + +static Sint64 SDLCALL +windows_file_seek(SDL_RWops * context, Sint64 offset, int whence) +{ + DWORD windowswhence; + LARGE_INTEGER windowsoffset; + + if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) { + return SDL_SetError("windows_file_seek: invalid context/file not opened"); + } + + /* FIXME: We may be able to satisfy the seek within buffered data */ + if (whence == RW_SEEK_CUR && context->hidden.windowsio.buffer.left) { + offset -= (long)context->hidden.windowsio.buffer.left; + } + context->hidden.windowsio.buffer.left = 0; + + switch (whence) { + case RW_SEEK_SET: + windowswhence = FILE_BEGIN; + break; + case RW_SEEK_CUR: + windowswhence = FILE_CURRENT; + break; + case RW_SEEK_END: + windowswhence = FILE_END; + break; + default: + return SDL_SetError("windows_file_seek: Unknown value for 'whence'"); + } + + windowsoffset.QuadPart = offset; + if (!SetFilePointerEx(context->hidden.windowsio.h, windowsoffset, &windowsoffset, windowswhence)) { + return WIN_SetError("windows_file_seek"); + } + return windowsoffset.QuadPart; +} + +static size_t SDLCALL +windows_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) +{ + size_t total_need; + size_t total_read = 0; + size_t read_ahead; + DWORD byte_read; + + total_need = size * maxnum; + + if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE + || !total_need) + return 0; + + if (context->hidden.windowsio.buffer.left > 0) { + void *data = (char *) context->hidden.windowsio.buffer.data + + context->hidden.windowsio.buffer.size - + context->hidden.windowsio.buffer.left; + read_ahead = + SDL_min(total_need, context->hidden.windowsio.buffer.left); SDL_memcpy(ptr, data, read_ahead); - context->hidden.win32io.buffer.left -= read_ahead; + context->hidden.windowsio.buffer.left -= read_ahead; if (read_ahead == total_need) { return maxnum; } - ptr = (char *)ptr + read_ahead; - total_need -= read_ahead; - total_read += read_ahead; + ptr = (char *) ptr + read_ahead; + total_need -= read_ahead; + total_read += read_ahead; } if (total_need < READAHEAD_BUFFER_SIZE) { - if (!ReadFile(context->hidden.win32io.h,context->hidden.win32io.buffer.data,READAHEAD_BUFFER_SIZE,&byte_read,NULL)) { + if (!ReadFile + (context->hidden.windowsio.h, context->hidden.windowsio.buffer.data, + READAHEAD_BUFFER_SIZE, &byte_read, NULL)) { SDL_Error(SDL_EFREAD); return 0; } - read_ahead = SDL_min(total_need, (int)byte_read); - SDL_memcpy(ptr, context->hidden.win32io.buffer.data, read_ahead); - context->hidden.win32io.buffer.size = byte_read; - context->hidden.win32io.buffer.left = byte_read-read_ahead; + read_ahead = SDL_min(total_need, (int) byte_read); + SDL_memcpy(ptr, context->hidden.windowsio.buffer.data, read_ahead); + context->hidden.windowsio.buffer.size = byte_read; + context->hidden.windowsio.buffer.left = byte_read - read_ahead; total_read += read_ahead; } else { - if (!ReadFile(context->hidden.win32io.h,ptr,total_need,&byte_read,NULL)) { + if (!ReadFile + (context->hidden.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) { SDL_Error(SDL_EFREAD); return 0; } total_read += byte_read; } - return (total_read/size); -} -static int SDLCALL win32_file_write(SDL_RWops *context, const void *ptr, int size, int num) -{ - - int total_bytes; - DWORD byte_written,nwritten; - - total_bytes = size*num; - - if (!context || context->hidden.win32io.h==INVALID_HANDLE_VALUE || total_bytes<=0 || !size) - return 0; - - if (context->hidden.win32io.buffer.left) { - SetFilePointer(context->hidden.win32io.h,-context->hidden.win32io.buffer.left,NULL,FILE_CURRENT); - context->hidden.win32io.buffer.left = 0; - } - - /* if in append mode, we must go to the EOF before write */ - if (context->hidden.win32io.append) { - if ( SetFilePointer(context->hidden.win32io.h,0L,NULL,FILE_END) == INVALID_SET_FILE_POINTER ) { - SDL_Error(SDL_EFWRITE); - return 0; - } - } - - if (!WriteFile(context->hidden.win32io.h,ptr,total_bytes,&byte_written,NULL)) { - SDL_Error(SDL_EFWRITE); - return 0; - } - - nwritten = byte_written/size; - return nwritten; -} -static int SDLCALL win32_file_close(SDL_RWops *context) -{ - - if ( context ) { - if (context->hidden.win32io.h != INVALID_HANDLE_VALUE) { - CloseHandle(context->hidden.win32io.h); - context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* to be sure */ - } - if (context->hidden.win32io.buffer.data) { - SDL_free(context->hidden.win32io.buffer.data); - context->hidden.win32io.buffer.data = NULL; - } - SDL_FreeRW(context); - } - return(0); + return (total_read / size); +} + +static size_t SDLCALL +windows_file_write(SDL_RWops * context, const void *ptr, size_t size, + size_t num) +{ + + size_t total_bytes; + DWORD byte_written; + size_t nwritten; + + total_bytes = size * num; + + if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE + || total_bytes <= 0 || !size) + return 0; + + if (context->hidden.windowsio.buffer.left) { + SetFilePointer(context->hidden.windowsio.h, + -(LONG)context->hidden.windowsio.buffer.left, NULL, + FILE_CURRENT); + context->hidden.windowsio.buffer.left = 0; + } + + /* if in append mode, we must go to the EOF before write */ + if (context->hidden.windowsio.append) { + if (SetFilePointer(context->hidden.windowsio.h, 0L, NULL, FILE_END) == + INVALID_SET_FILE_POINTER) { + SDL_Error(SDL_EFWRITE); + return 0; + } + } + + if (!WriteFile + (context->hidden.windowsio.h, ptr, (DWORD)total_bytes, &byte_written, NULL)) { + SDL_Error(SDL_EFWRITE); + return 0; + } + + nwritten = byte_written / size; + return nwritten; +} + +static int SDLCALL +windows_file_close(SDL_RWops * context) +{ + + if (context) { + if (context->hidden.windowsio.h != INVALID_HANDLE_VALUE) { + CloseHandle(context->hidden.windowsio.h); + context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* to be sure */ + } + if (context->hidden.windowsio.buffer.data) { + SDL_free(context->hidden.windowsio.buffer.data); + context->hidden.windowsio.buffer.data = NULL; + } + SDL_FreeRW(context); + } + return (0); } #endif /* __WIN32__ */ @@ -320,354 +289,469 @@ static int SDLCALL win32_file_close(SDL_RWops *context) /* Functions to read/write stdio file pointers */ -static int SDLCALL stdio_seek(SDL_RWops *context, int offset, int whence) +static Sint64 SDLCALL +stdio_size(SDL_RWops * context) { - if ( fseek(context->hidden.stdio.fp, offset, whence) == 0 ) { - return(ftell(context->hidden.stdio.fp)); - } else { - SDL_Error(SDL_EFSEEK); - return(-1); - } + Sint64 pos, size; + + pos = SDL_RWseek(context, 0, RW_SEEK_CUR); + if (pos < 0) { + return -1; + } + size = SDL_RWseek(context, 0, RW_SEEK_END); + + SDL_RWseek(context, pos, RW_SEEK_SET); + return size; +} + +static Sint64 SDLCALL +stdio_seek(SDL_RWops * context, Sint64 offset, int whence) +{ +#ifdef HAVE_FSEEKO64 + if (fseeko64(context->hidden.stdio.fp, (off64_t)offset, whence) == 0) { + return ftello64(context->hidden.stdio.fp); + } +#elif defined(HAVE_FSEEKO) + if (fseeko(context->hidden.stdio.fp, (off_t)offset, whence) == 0) { + return ftello(context->hidden.stdio.fp); + } +#else + if (fseek(context->hidden.stdio.fp, offset, whence) == 0) { + return (ftell(context->hidden.stdio.fp)); + } +#endif + return SDL_Error(SDL_EFSEEK); } -static int SDLCALL stdio_read(SDL_RWops *context, void *ptr, int size, int maxnum) + +static size_t SDLCALL +stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) { - size_t nread; + size_t nread; - nread = fread(ptr, size, maxnum, context->hidden.stdio.fp); - if ( nread == 0 && ferror(context->hidden.stdio.fp) ) { - SDL_Error(SDL_EFREAD); - } - return(nread); + nread = fread(ptr, size, maxnum, context->hidden.stdio.fp); + if (nread == 0 && ferror(context->hidden.stdio.fp)) { + SDL_Error(SDL_EFREAD); + } + return (nread); } -static int SDLCALL stdio_write(SDL_RWops *context, const void *ptr, int size, int num) + +static size_t SDLCALL +stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) { - size_t nwrote; + size_t nwrote; - nwrote = fwrite(ptr, size, num, context->hidden.stdio.fp); - if ( nwrote == 0 && ferror(context->hidden.stdio.fp) ) { - SDL_Error(SDL_EFWRITE); - } - return(nwrote); + nwrote = fwrite(ptr, size, num, context->hidden.stdio.fp); + if (nwrote == 0 && ferror(context->hidden.stdio.fp)) { + SDL_Error(SDL_EFWRITE); + } + return (nwrote); } -static int SDLCALL stdio_close(SDL_RWops *context) + +static int SDLCALL +stdio_close(SDL_RWops * context) { - if ( context ) { - if ( context->hidden.stdio.autoclose ) { - /* WARNING: Check the return value here! */ - fclose(context->hidden.stdio.fp); - } - SDL_FreeRW(context); - } - return(0); + int status = 0; + if (context) { + if (context->hidden.stdio.autoclose) { + /* WARNING: Check the return value here! */ + if (fclose(context->hidden.stdio.fp) != 0) { + status = SDL_Error(SDL_EFWRITE); + } + } + SDL_FreeRW(context); + } + return status; } #endif /* !HAVE_STDIO_H */ /* Functions to read/write memory pointers */ -static int SDLCALL mem_seek(SDL_RWops *context, int offset, int whence) +static Sint64 SDLCALL +mem_size(SDL_RWops * context) +{ + return (Sint64)(context->hidden.mem.stop - context->hidden.mem.base); +} + +static Sint64 SDLCALL +mem_seek(SDL_RWops * context, Sint64 offset, int whence) { - Uint8 *newpos; + Uint8 *newpos; - switch (whence) { - case RW_SEEK_SET: - newpos = context->hidden.mem.base+offset; - break; - case RW_SEEK_CUR: - newpos = context->hidden.mem.here+offset; - break; - case RW_SEEK_END: - newpos = context->hidden.mem.stop+offset; - break; - default: - SDL_SetError("Unknown value for 'whence'"); - return(-1); - } - if ( newpos < context->hidden.mem.base ) { - newpos = context->hidden.mem.base; - } - if ( newpos > context->hidden.mem.stop ) { - newpos = context->hidden.mem.stop; - } - context->hidden.mem.here = newpos; - return(context->hidden.mem.here-context->hidden.mem.base); + switch (whence) { + case RW_SEEK_SET: + newpos = context->hidden.mem.base + offset; + break; + case RW_SEEK_CUR: + newpos = context->hidden.mem.here + offset; + break; + case RW_SEEK_END: + newpos = context->hidden.mem.stop + offset; + break; + default: + return SDL_SetError("Unknown value for 'whence'"); + } + if (newpos < context->hidden.mem.base) { + newpos = context->hidden.mem.base; + } + if (newpos > context->hidden.mem.stop) { + newpos = context->hidden.mem.stop; + } + context->hidden.mem.here = newpos; + return (Sint64)(context->hidden.mem.here - context->hidden.mem.base); } -static int SDLCALL mem_read(SDL_RWops *context, void *ptr, int size, int maxnum) + +static size_t SDLCALL +mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) { - size_t total_bytes; - size_t mem_available; + size_t total_bytes; + size_t mem_available; - total_bytes = (maxnum * size); - if ( (maxnum <= 0) || (size <= 0) || ((total_bytes / maxnum) != (size_t) size) ) { - return 0; - } + total_bytes = (maxnum * size); + if ((maxnum <= 0) || (size <= 0) + || ((total_bytes / maxnum) != (size_t) size)) { + return 0; + } - mem_available = (context->hidden.mem.stop - context->hidden.mem.here); - if (total_bytes > mem_available) { - total_bytes = mem_available; - } + mem_available = (context->hidden.mem.stop - context->hidden.mem.here); + if (total_bytes > mem_available) { + total_bytes = mem_available; + } - SDL_memcpy(ptr, context->hidden.mem.here, total_bytes); - context->hidden.mem.here += total_bytes; + SDL_memcpy(ptr, context->hidden.mem.here, total_bytes); + context->hidden.mem.here += total_bytes; - return (total_bytes / size); + return (total_bytes / size); } -static int SDLCALL mem_write(SDL_RWops *context, const void *ptr, int size, int num) + +static size_t SDLCALL +mem_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) { - if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) { - num = (context->hidden.mem.stop-context->hidden.mem.here)/size; - } - SDL_memcpy(context->hidden.mem.here, ptr, num*size); - context->hidden.mem.here += num*size; - return(num); + if ((context->hidden.mem.here + (num * size)) > context->hidden.mem.stop) { + num = (context->hidden.mem.stop - context->hidden.mem.here) / size; + } + SDL_memcpy(context->hidden.mem.here, ptr, num * size); + context->hidden.mem.here += num * size; + return (num); } -static int SDLCALL mem_writeconst(SDL_RWops *context, const void *ptr, int size, int num) + +static size_t SDLCALL +mem_writeconst(SDL_RWops * context, const void *ptr, size_t size, size_t num) { - SDL_SetError("Can't write to read-only memory"); - return(-1); + SDL_SetError("Can't write to read-only memory"); + return (0); } -static int SDLCALL mem_close(SDL_RWops *context) + +static int SDLCALL +mem_close(SDL_RWops * context) { - if ( context ) { - SDL_FreeRW(context); - } - return(0); + if (context) { + SDL_FreeRW(context); + } + return (0); } /* Functions to create SDL_RWops structures from various data sources */ -#ifdef __MACOS__ -/* - * translate unix-style slash-separated filename to mac-style colon-separated - * name; return malloced string - */ -static char *unix_to_mac(const char *file) -{ - int flen = SDL_strlen(file); - char *path = SDL_malloc(flen + 2); - const char *src = file; - char *dst = path; - if(*src == '/') { - /* really depends on filesystem layout, hope for the best */ - src++; - } else { - /* Check if this is a MacOS path to begin with */ - if(*src != ':') - *dst++ = ':'; /* relative paths begin with ':' */ - } - while(src < file + flen) { - const char *end = SDL_strchr(src, '/'); - int len; - if(!end) - end = file + flen; /* last component */ - len = end - src; - if(len == 0 || (len == 1 && src[0] == '.')) { - /* remove repeated slashes and . */ - } else { - if(len == 2 && src[0] == '.' && src[1] == '.') { - /* replace .. with the empty string */ - } else { - SDL_memcpy(dst, src, len); - dst += len; - } - if(end < file + flen) - *dst++ = ':'; - } - src = end + 1; - } - *dst++ = '\0'; - return path; -} -#endif /* __MACOS__ */ - -SDL_RWops *SDL_RWFromFile(const char *file, const char *mode) -{ - SDL_RWops *rwops = NULL; +SDL_RWops * +SDL_RWFromFile(const char *file, const char *mode) +{ + SDL_RWops *rwops = NULL; + if (!file || !*file || !mode || !*mode) { + SDL_SetError("SDL_RWFromFile(): No file or no mode specified"); + return NULL; + } +#if defined(ANDROID) #ifdef HAVE_STDIO_H - FILE *fp = NULL; - (void) fp; -#endif - if ( !file || !*file || !mode || !*mode ) { - SDL_SetError("SDL_RWFromFile(): No file or no mode specified"); - return NULL; - } - -#if defined(__WIN32__) && !defined(__SYMBIAN32__) - rwops = SDL_AllocRW(); - if (!rwops) - return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ - if (win32_file_open(rwops,file,mode) < 0) { - SDL_FreeRW(rwops); - return NULL; - } - rwops->seek = win32_file_seek; - rwops->read = win32_file_read; - rwops->write = win32_file_write; - rwops->close = win32_file_close; + /* Try to open the file on the filesystem first */ + if (*file == '/') { + FILE *fp = fopen(file, mode); + if (fp) { + return SDL_RWFromFP(fp, 1); + } + } else { + /* Try opening it from internal storage if it's a relative path */ + char *path; + FILE *fp; + + path = SDL_stack_alloc(char, PATH_MAX); + if (path) { + SDL_snprintf(path, PATH_MAX, "%s/%s", + SDL_AndroidGetInternalStoragePath(), file); + fp = fopen(path, mode); + SDL_stack_free(path); + if (fp) { + return SDL_RWFromFP(fp, 1); + } + } + } +#endif /* HAVE_STDIO_H */ -#elif HAVE_STDIO_H + /* Try to open the file from the asset system */ + rwops = SDL_AllocRW(); + if (!rwops) + return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ + if (Android_JNI_FileOpen(rwops, file, mode) < 0) { + SDL_FreeRW(rwops); + return NULL; + } + rwops->size = Android_JNI_FileSize; + rwops->seek = Android_JNI_FileSeek; + rwops->read = Android_JNI_FileRead; + rwops->write = Android_JNI_FileWrite; + rwops->close = Android_JNI_FileClose; + rwops->type = SDL_RWOPS_JNIFILE; + +#elif defined(__WIN32__) + rwops = SDL_AllocRW(); + if (!rwops) + return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ + if (windows_file_open(rwops, file, mode) < 0) { + SDL_FreeRW(rwops); + return NULL; + } + rwops->size = windows_file_size; + rwops->seek = windows_file_seek; + rwops->read = windows_file_read; + rwops->write = windows_file_write; + rwops->close = windows_file_close; + rwops->type = SDL_RWOPS_WINFILE; -#ifdef __MACOS__ - { - char *mpath = unix_to_mac(file); - fp = fopen(mpath, mode); - SDL_free(mpath); - } -#else - fp = fopen(file, mode); -#endif - if ( fp == NULL ) { - SDL_SetError("Couldn't open %s", file); - } else { - rwops = SDL_RWFromFP(fp, 1); - } +#elif HAVE_STDIO_H + { + #ifdef __APPLE__ + FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode); + #else + FILE *fp = fopen(file, mode); + #endif + if (fp == NULL) { + SDL_SetError("Couldn't open %s", file); + } else { + rwops = SDL_RWFromFP(fp, 1); + } + } #else - SDL_SetError("SDL not compiled with stdio support"); + SDL_SetError("SDL not compiled with stdio support"); #endif /* !HAVE_STDIO_H */ - return(rwops); + return (rwops); } #ifdef HAVE_STDIO_H -SDL_RWops *SDL_RWFromFP(FILE *fp, int autoclose) +SDL_RWops * +SDL_RWFromFP(FILE * fp, SDL_bool autoclose) +{ + SDL_RWops *rwops = NULL; + + rwops = SDL_AllocRW(); + if (rwops != NULL) { + rwops->size = stdio_size; + rwops->seek = stdio_seek; + rwops->read = stdio_read; + rwops->write = stdio_write; + rwops->close = stdio_close; + rwops->hidden.stdio.fp = fp; + rwops->hidden.stdio.autoclose = autoclose; + rwops->type = SDL_RWOPS_STDFILE; + } + return (rwops); +} +#else +SDL_RWops * +SDL_RWFromFP(void * fp, SDL_bool autoclose) { - SDL_RWops *rwops = NULL; - - rwops = SDL_AllocRW(); - if ( rwops != NULL ) { - rwops->seek = stdio_seek; - rwops->read = stdio_read; - rwops->write = stdio_write; - rwops->close = stdio_close; - rwops->hidden.stdio.fp = fp; - rwops->hidden.stdio.autoclose = autoclose; - } - return(rwops); + SDL_SetError("SDL not compiled with stdio support"); + return NULL; } #endif /* HAVE_STDIO_H */ -SDL_RWops *SDL_RWFromMem(void *mem, int size) +SDL_RWops * +SDL_RWFromMem(void *mem, int size) { - SDL_RWops *rwops; + SDL_RWops *rwops = NULL; + if (!mem) { + SDL_InvalidParamError("mem"); + return (rwops); + } + if (!size) { + SDL_InvalidParamError("size"); + return (rwops); + } - rwops = SDL_AllocRW(); - if ( rwops != NULL ) { - rwops->seek = mem_seek; - rwops->read = mem_read; - rwops->write = mem_write; - rwops->close = mem_close; - rwops->hidden.mem.base = (Uint8 *)mem; - rwops->hidden.mem.here = rwops->hidden.mem.base; - rwops->hidden.mem.stop = rwops->hidden.mem.base+size; - } - return(rwops); + rwops = SDL_AllocRW(); + if (rwops != NULL) { + rwops->size = mem_size; + rwops->seek = mem_seek; + rwops->read = mem_read; + rwops->write = mem_write; + rwops->close = mem_close; + rwops->hidden.mem.base = (Uint8 *) mem; + rwops->hidden.mem.here = rwops->hidden.mem.base; + rwops->hidden.mem.stop = rwops->hidden.mem.base + size; + rwops->type = SDL_RWOPS_MEMORY; + } + return (rwops); } -SDL_RWops *SDL_RWFromConstMem(const void *mem, int size) +SDL_RWops * +SDL_RWFromConstMem(const void *mem, int size) { - SDL_RWops *rwops; + SDL_RWops *rwops = NULL; + if (!mem) { + SDL_InvalidParamError("mem"); + return (rwops); + } + if (!size) { + SDL_InvalidParamError("size"); + return (rwops); + } - rwops = SDL_AllocRW(); - if ( rwops != NULL ) { - rwops->seek = mem_seek; - rwops->read = mem_read; - rwops->write = mem_writeconst; - rwops->close = mem_close; - rwops->hidden.mem.base = (Uint8 *)mem; - rwops->hidden.mem.here = rwops->hidden.mem.base; - rwops->hidden.mem.stop = rwops->hidden.mem.base+size; - } - return(rwops); + rwops = SDL_AllocRW(); + if (rwops != NULL) { + rwops->size = mem_size; + rwops->seek = mem_seek; + rwops->read = mem_read; + rwops->write = mem_writeconst; + rwops->close = mem_close; + rwops->hidden.mem.base = (Uint8 *) mem; + rwops->hidden.mem.here = rwops->hidden.mem.base; + rwops->hidden.mem.stop = rwops->hidden.mem.base + size; + rwops->type = SDL_RWOPS_MEMORY_RO; + } + return (rwops); } -SDL_RWops *SDL_AllocRW(void) +SDL_RWops * +SDL_AllocRW(void) { - SDL_RWops *area; + SDL_RWops *area; - area = (SDL_RWops *)SDL_malloc(sizeof *area); - if ( area == NULL ) { - SDL_OutOfMemory(); - } - return(area); + area = (SDL_RWops *) SDL_malloc(sizeof *area); + if (area == NULL) { + SDL_OutOfMemory(); + } else { + area->type = SDL_RWOPS_UNKNOWN; + } + return (area); } -void SDL_FreeRW(SDL_RWops *area) +void +SDL_FreeRW(SDL_RWops * area) { - SDL_free(area); + SDL_free(area); } /* Functions for dynamically reading and writing endian-specific values */ -Uint16 SDL_ReadLE16 (SDL_RWops *src) +Uint8 +SDL_ReadU8(SDL_RWops * src) +{ + Uint8 value = 0; + + SDL_RWread(src, &value, (sizeof value), 1); + return value; +} + +Uint16 +SDL_ReadLE16(SDL_RWops * src) { - Uint16 value; + Uint16 value = 0; - SDL_RWread(src, &value, (sizeof value), 1); - return(SDL_SwapLE16(value)); + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapLE16(value)); } -Uint16 SDL_ReadBE16 (SDL_RWops *src) + +Uint16 +SDL_ReadBE16(SDL_RWops * src) { - Uint16 value; + Uint16 value = 0; - SDL_RWread(src, &value, (sizeof value), 1); - return(SDL_SwapBE16(value)); + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapBE16(value)); } -Uint32 SDL_ReadLE32 (SDL_RWops *src) + +Uint32 +SDL_ReadLE32(SDL_RWops * src) { - Uint32 value; + Uint32 value = 0; - SDL_RWread(src, &value, (sizeof value), 1); - return(SDL_SwapLE32(value)); + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapLE32(value)); } -Uint32 SDL_ReadBE32 (SDL_RWops *src) + +Uint32 +SDL_ReadBE32(SDL_RWops * src) { - Uint32 value; + Uint32 value = 0; - SDL_RWread(src, &value, (sizeof value), 1); - return(SDL_SwapBE32(value)); + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapBE32(value)); } -Uint64 SDL_ReadLE64 (SDL_RWops *src) + +Uint64 +SDL_ReadLE64(SDL_RWops * src) { - Uint64 value; + Uint64 value = 0; - SDL_RWread(src, &value, (sizeof value), 1); - return(SDL_SwapLE64(value)); + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapLE64(value)); } -Uint64 SDL_ReadBE64 (SDL_RWops *src) + +Uint64 +SDL_ReadBE64(SDL_RWops * src) { - Uint64 value; + Uint64 value = 0; - SDL_RWread(src, &value, (sizeof value), 1); - return(SDL_SwapBE64(value)); + SDL_RWread(src, &value, (sizeof value), 1); + return (SDL_SwapBE64(value)); } -int SDL_WriteLE16 (SDL_RWops *dst, Uint16 value) +size_t +SDL_WriteU8(SDL_RWops * dst, Uint8 value) { - value = SDL_SwapLE16(value); - return(SDL_RWwrite(dst, &value, (sizeof value), 1)); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); } -int SDL_WriteBE16 (SDL_RWops *dst, Uint16 value) + +size_t +SDL_WriteLE16(SDL_RWops * dst, Uint16 value) { - value = SDL_SwapBE16(value); - return(SDL_RWwrite(dst, &value, (sizeof value), 1)); + value = SDL_SwapLE16(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); } -int SDL_WriteLE32 (SDL_RWops *dst, Uint32 value) + +size_t +SDL_WriteBE16(SDL_RWops * dst, Uint16 value) +{ + value = SDL_SwapBE16(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); +} + +size_t +SDL_WriteLE32(SDL_RWops * dst, Uint32 value) { - value = SDL_SwapLE32(value); - return(SDL_RWwrite(dst, &value, (sizeof value), 1)); + value = SDL_SwapLE32(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); } -int SDL_WriteBE32 (SDL_RWops *dst, Uint32 value) + +size_t +SDL_WriteBE32(SDL_RWops * dst, Uint32 value) { - value = SDL_SwapBE32(value); - return(SDL_RWwrite(dst, &value, (sizeof value), 1)); + value = SDL_SwapBE32(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); } -int SDL_WriteLE64 (SDL_RWops *dst, Uint64 value) + +size_t +SDL_WriteLE64(SDL_RWops * dst, Uint64 value) { - value = SDL_SwapLE64(value); - return(SDL_RWwrite(dst, &value, (sizeof value), 1)); + value = SDL_SwapLE64(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); } -int SDL_WriteBE64 (SDL_RWops *dst, Uint64 value) + +size_t +SDL_WriteBE64(SDL_RWops * dst, Uint64 value) { - value = SDL_SwapBE64(value); - return(SDL_RWwrite(dst, &value, (sizeof value), 1)); + value = SDL_SwapBE64(value); + return (SDL_RWwrite(dst, &value, (sizeof value), 1)); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/file/cocoa/SDL_rwopsbundlesupport.h b/src/file/cocoa/SDL_rwopsbundlesupport.h new file mode 100644 index 0000000000..6929904c21 --- /dev/null +++ b/src/file/cocoa/SDL_rwopsbundlesupport.h @@ -0,0 +1,9 @@ +#ifdef __APPLE__ + +#include + +#ifndef SDL_rwopsbundlesupport_h +#define SDL_rwopsbundlesupport_h +FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode); +#endif +#endif diff --git a/src/file/cocoa/SDL_rwopsbundlesupport.m b/src/file/cocoa/SDL_rwopsbundlesupport.m new file mode 100644 index 0000000000..8ec0220ec3 --- /dev/null +++ b/src/file/cocoa/SDL_rwopsbundlesupport.m @@ -0,0 +1,45 @@ +#ifdef __APPLE__ +#import + +#include "SDL_rwopsbundlesupport.h" + +/* For proper OS X applications, the resources are contained inside the application bundle. + So the strategy is to first check the application bundle for the file, then fallback to the current working directory. + Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app. + We might want to use bundle identifiers, e.g. org.libsdl.sdl to get the bundle for the framework, + but we would somehow need to know what the bundle identifiers we need to search are. + Also, note the bundle layouts are different for iPhone and Mac. +*/ +FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode) +{ + FILE* fp = NULL; + + /* If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only. */ + if(strcmp("r", mode) && strcmp("rb", mode)) + { + return fopen(file, mode); + } + + NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init]; + + + NSFileManager* file_manager = [NSFileManager defaultManager]; + NSString* resource_path = [[NSBundle mainBundle] resourcePath]; + + NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; + + NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component]; + if([file_manager fileExistsAtPath:full_path_with_file_to_try]) + { + fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); + } + else + { + fp = fopen(file, mode); + } + + [autorelease_pool drain]; + + return fp; +} +#endif diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c new file mode 100644 index 0000000000..d7e1c50629 --- /dev/null +++ b/src/haptic/SDL_haptic.c @@ -0,0 +1,840 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_syshaptic.h" +#include "SDL_haptic_c.h" +#include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */ +#include "SDL_assert.h" + +Uint8 SDL_numhaptics = 0; +SDL_Haptic **SDL_haptics = NULL; + + +/* + * Initializes the Haptic devices. + */ +int +SDL_HapticInit(void) +{ + int arraylen; + int status; + + SDL_numhaptics = 0; + status = SDL_SYS_HapticInit(); + if (status >= 0) { + arraylen = (status + 1) * sizeof(*SDL_haptics); + SDL_haptics = (SDL_Haptic **) SDL_malloc(arraylen); + if (SDL_haptics == NULL) { /* Out of memory. */ + SDL_numhaptics = 0; + } else { + SDL_memset(SDL_haptics, 0, arraylen); + SDL_numhaptics = status; + } + status = 0; + } + + return status; +} + + +/* + * Checks to see if the haptic device is valid + */ +static int +ValidHaptic(SDL_Haptic * haptic) +{ + int i; + int valid; + + valid = 0; + if (haptic != NULL) { + for (i = 0; i < SDL_numhaptics; i++) { + if (SDL_haptics[i] == haptic) { + valid = 1; + break; + } + } + } + + /* Create the error here. */ + if (valid == 0) { + SDL_SetError("Haptic: Invalid haptic device identifier"); + } + + return valid; +} + + +/* + * Returns the number of available devices. + */ +int +SDL_NumHaptics(void) +{ + return SDL_numhaptics; +} + + +/* + * Gets the name of a Haptic device by index. + */ +const char * +SDL_HapticName(int device_index) +{ + if ((device_index < 0) || (device_index >= SDL_numhaptics)) { + SDL_SetError("Haptic: There are %d haptic devices available", + SDL_numhaptics); + return NULL; + } + return SDL_SYS_HapticName(device_index); +} + + +/* + * Opens a Haptic device. + */ +SDL_Haptic * +SDL_HapticOpen(int device_index) +{ + int i; + SDL_Haptic *haptic; + + if ((device_index < 0) || (device_index >= SDL_numhaptics)) { + SDL_SetError("Haptic: There are %d haptic devices available", + SDL_numhaptics); + return NULL; + } + + /* If the haptic is already open, return it */ + for (i = 0; SDL_haptics[i]; i++) { + if (device_index == SDL_haptics[i]->index) { + haptic = SDL_haptics[i]; + ++haptic->ref_count; + return haptic; + } + } + + /* Create the haptic device */ + haptic = (SDL_Haptic *) SDL_malloc((sizeof *haptic)); + if (haptic == NULL) { + SDL_OutOfMemory(); + return NULL; + } + + /* Initialize the haptic device */ + SDL_memset(haptic, 0, (sizeof *haptic)); + haptic->rumble_id = -1; + haptic->index = device_index; + if (SDL_SYS_HapticOpen(haptic) < 0) { + SDL_free(haptic); + return NULL; + } + + /* Add haptic to list */ + for (i = 0; SDL_haptics[i]; i++) + /* Skip to next haptic */ ; + if (i >= SDL_numhaptics) { + SDL_free(haptic); + SDL_SetError("Haptic: Trying to add device past the number originally detected"); + return NULL; + } + SDL_haptics[i] = haptic; + ++haptic->ref_count; + + /* Disable autocenter and set gain to max. */ + if (haptic->supported & SDL_HAPTIC_GAIN) + SDL_HapticSetGain(haptic, 100); + if (haptic->supported & SDL_HAPTIC_AUTOCENTER) + SDL_HapticSetAutocenter(haptic, 0); + + return haptic; +} + + +/* + * Returns 1 if the device has been opened. + */ +int +SDL_HapticOpened(int device_index) +{ + int i, opened; + + /* Make sure it's valid. */ + if ((device_index < 0) || (device_index >= SDL_numhaptics)) { + SDL_SetError("Haptic: There are %d haptic devices available", + SDL_numhaptics); + return 0; + } + + opened = 0; + for (i = 0; SDL_haptics[i]; i++) { + if (SDL_haptics[i]->index == (Uint8) device_index) { + opened = 1; + break; + } + } + return opened; +} + + +/* + * Returns the index to a haptic device. + */ +int +SDL_HapticIndex(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + return haptic->index; +} + + +/* + * Returns SDL_TRUE if mouse is haptic, SDL_FALSE if it isn't. + */ +int +SDL_MouseIsHaptic(void) +{ + if (SDL_SYS_HapticMouse() < 0) + return SDL_FALSE; + return SDL_TRUE; +} + + +/* + * Returns the haptic device if mouse is haptic or NULL elsewise. + */ +SDL_Haptic * +SDL_HapticOpenFromMouse(void) +{ + int device_index; + + device_index = SDL_SYS_HapticMouse(); + + if (device_index < 0) { + SDL_SetError("Haptic: Mouse isn't a haptic device."); + return NULL; + } + + return SDL_HapticOpen(device_index); +} + + +/* + * Returns SDL_TRUE if joystick has haptic features. + */ +int +SDL_JoystickIsHaptic(SDL_Joystick * joystick) +{ + int ret; + + /* Must be a valid joystick */ + if (!SDL_PrivateJoystickValid(joystick)) { + return -1; + } + + ret = SDL_SYS_JoystickIsHaptic(joystick); + + if (ret > 0) + return SDL_TRUE; + else if (ret == 0) + return SDL_FALSE; + else + return -1; +} + + +/* + * Opens a haptic device from a joystick. + */ +SDL_Haptic * +SDL_HapticOpenFromJoystick(SDL_Joystick * joystick) +{ + int i; + SDL_Haptic *haptic; + + /* Make sure there is room. */ + if (SDL_numhaptics <= 0) { + SDL_SetError("Haptic: There are %d haptic devices available", + SDL_numhaptics); + return NULL; + } + + /* Must be a valid joystick */ + if (!SDL_PrivateJoystickValid(joystick)) { + SDL_SetError("Haptic: Joystick isn't valid."); + return NULL; + } + + /* Joystick must be haptic */ + if (SDL_SYS_JoystickIsHaptic(joystick) <= 0) { + SDL_SetError("Haptic: Joystick isn't a haptic device."); + return NULL; + } + + /* Check to see if joystick's haptic is already open */ + for (i = 0; SDL_haptics[i]; i++) { + if (SDL_SYS_JoystickSameHaptic(SDL_haptics[i], joystick)) { + haptic = SDL_haptics[i]; + ++haptic->ref_count; + return haptic; + } + } + + /* Create the haptic device */ + haptic = (SDL_Haptic *) SDL_malloc((sizeof *haptic)); + if (haptic == NULL) { + SDL_OutOfMemory(); + return NULL; + } + + /* Initialize the haptic device */ + SDL_memset(haptic, 0, sizeof(SDL_Haptic)); + haptic->rumble_id = -1; + if (SDL_SYS_HapticOpenFromJoystick(haptic, joystick) < 0) { + SDL_free(haptic); + return NULL; + } + + /* Add haptic to list */ + for (i = 0; SDL_haptics[i]; i++) + /* Skip to next haptic */ ; + if (i >= SDL_numhaptics) { + SDL_free(haptic); + SDL_SetError("Haptic: Trying to add device past the number originally detected"); + return NULL; + } + SDL_haptics[i] = haptic; + ++haptic->ref_count; + + return haptic; +} + + +/* + * Closes a SDL_Haptic device. + */ +void +SDL_HapticClose(SDL_Haptic * haptic) +{ + int i; + + /* Must be valid */ + if (!ValidHaptic(haptic)) { + return; + } + + /* Check if it's still in use */ + if (--haptic->ref_count < 0) { + return; + } + + /* Close it, properly removing effects if needed */ + for (i = 0; i < haptic->neffects; i++) { + if (haptic->effects[i].hweffect != NULL) { + SDL_HapticDestroyEffect(haptic, i); + } + } + SDL_SYS_HapticClose(haptic); + + /* Remove from the list */ + for (i = 0; SDL_haptics[i]; ++i) { + if (haptic == SDL_haptics[i]) { + SDL_haptics[i] = NULL; + SDL_memcpy(&SDL_haptics[i], &SDL_haptics[i + 1], + (SDL_numhaptics - i) * sizeof(haptic)); + break; + } + } + + /* Free */ + SDL_free(haptic); +} + +/* + * Cleans up after the subsystem. + */ +void +SDL_HapticQuit(void) +{ + SDL_SYS_HapticQuit(); + if (SDL_haptics != NULL) { + SDL_free(SDL_haptics); + SDL_haptics = NULL; + } + SDL_numhaptics = 0; +} + +/* + * Returns the number of effects a haptic device has. + */ +int +SDL_HapticNumEffects(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + return haptic->neffects; +} + + +/* + * Returns the number of effects a haptic device can play. + */ +int +SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + return haptic->nplaying; +} + + +/* + * Returns supported effects by the device. + */ +unsigned int +SDL_HapticQuery(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return 0; /* same as if no effects were supported */ + } + + return haptic->supported; +} + + +/* + * Returns the number of axis on the device. + */ +int +SDL_HapticNumAxes(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + return haptic->naxes; +} + +/* + * Checks to see if the device can support the effect. + */ +int +SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + if ((haptic->supported & effect->type) != 0) + return SDL_TRUE; + return SDL_FALSE; +} + +/* + * Creates a new haptic effect. + */ +int +SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect) +{ + int i; + + /* Check for device validity. */ + if (!ValidHaptic(haptic)) { + return -1; + } + + /* Check to see if effect is supported */ + if (SDL_HapticEffectSupported(haptic, effect) == SDL_FALSE) { + return SDL_SetError("Haptic: Effect not supported by haptic device."); + } + + /* See if there's a free slot */ + for (i = 0; i < haptic->neffects; i++) { + if (haptic->effects[i].hweffect == NULL) { + + /* Now let the backend create the real effect */ + if (SDL_SYS_HapticNewEffect(haptic, &haptic->effects[i], effect) + != 0) { + return -1; /* Backend failed to create effect */ + } + + SDL_memcpy(&haptic->effects[i].effect, effect, + sizeof(SDL_HapticEffect)); + return i; + } + } + + return SDL_SetError("Haptic: Device has no free space left."); +} + +/* + * Checks to see if an effect is valid. + */ +static int +ValidEffect(SDL_Haptic * haptic, int effect) +{ + if ((effect < 0) || (effect >= haptic->neffects)) { + SDL_SetError("Haptic: Invalid effect identifier."); + return 0; + } + return 1; +} + +/* + * Updates an effect. + */ +int +SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, + SDL_HapticEffect * data) +{ + if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { + return -1; + } + + /* Can't change type dynamically. */ + if (data->type != haptic->effects[effect].effect.type) { + return SDL_SetError("Haptic: Updating effect type is illegal."); + } + + /* Updates the effect */ + if (SDL_SYS_HapticUpdateEffect(haptic, &haptic->effects[effect], data) < + 0) { + return -1; + } + + SDL_memcpy(&haptic->effects[effect].effect, data, + sizeof(SDL_HapticEffect)); + return 0; +} + + +/* + * Runs the haptic effect on the device. + */ +int +SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations) +{ + if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { + return -1; + } + + /* Run the effect */ + if (SDL_SYS_HapticRunEffect(haptic, &haptic->effects[effect], iterations) + < 0) { + return -1; + } + + return 0; +} + +/* + * Stops the haptic effect on the device. + */ +int +SDL_HapticStopEffect(SDL_Haptic * haptic, int effect) +{ + if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { + return -1; + } + + /* Stop the effect */ + if (SDL_SYS_HapticStopEffect(haptic, &haptic->effects[effect]) < 0) { + return -1; + } + + return 0; +} + +/* + * Gets rid of a haptic effect. + */ +void +SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect) +{ + if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { + return; + } + + /* Not allocated */ + if (haptic->effects[effect].hweffect == NULL) { + return; + } + + SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]); +} + +/* + * Gets the status of a haptic effect. + */ +int +SDL_HapticGetEffectStatus(SDL_Haptic * haptic, int effect) +{ + if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { + return -1; + } + + if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) { + return SDL_SetError("Haptic: Device does not support status queries."); + } + + return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]); +} + +/* + * Sets the global gain of the device. + */ +int +SDL_HapticSetGain(SDL_Haptic * haptic, int gain) +{ + const char *env; + int real_gain, max_gain; + + if (!ValidHaptic(haptic)) { + return -1; + } + + if ((haptic->supported & SDL_HAPTIC_GAIN) == 0) { + return SDL_SetError("Haptic: Device does not support setting gain."); + } + + if ((gain < 0) || (gain > 100)) { + return SDL_SetError("Haptic: Gain must be between 0 and 100."); + } + + /* We use the envvar to get the maximum gain. */ + env = SDL_getenv("SDL_HAPTIC_GAIN_MAX"); + if (env != NULL) { + max_gain = SDL_atoi(env); + + /* Check for sanity. */ + if (max_gain < 0) + max_gain = 0; + else if (max_gain > 100) + max_gain = 100; + + /* We'll scale it linearly with SDL_HAPTIC_GAIN_MAX */ + real_gain = (gain * max_gain) / 100; + } else { + real_gain = gain; + } + + if (SDL_SYS_HapticSetGain(haptic, real_gain) < 0) { + return -1; + } + + return 0; +} + +/* + * Makes the device autocenter, 0 disables. + */ +int +SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + if ((haptic->supported & SDL_HAPTIC_AUTOCENTER) == 0) { + return SDL_SetError("Haptic: Device does not support setting autocenter."); + } + + if ((autocenter < 0) || (autocenter > 100)) { + return SDL_SetError("Haptic: Autocenter must be between 0 and 100."); + } + + if (SDL_SYS_HapticSetAutocenter(haptic, autocenter) < 0) { + return -1; + } + + return 0; +} + +/* + * Pauses the haptic device. + */ +int +SDL_HapticPause(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) { + return SDL_SetError("Haptic: Device does not support setting pausing."); + } + + return SDL_SYS_HapticPause(haptic); +} + +/* + * Unpauses the haptic device. + */ +int +SDL_HapticUnpause(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) { + return 0; /* Not going to be paused, so we pretend it's unpaused. */ + } + + return SDL_SYS_HapticUnpause(haptic); +} + +/* + * Stops all the currently playing effects. + */ +int +SDL_HapticStopAll(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + return SDL_SYS_HapticStopAll(haptic); +} + +/* + * Checks to see if rumble is supported. + */ +int +SDL_HapticRumbleSupported(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + /* Most things can use SINE, but XInput only has LEFTRIGHT. */ + return ((haptic->supported & (SDL_HAPTIC_SINE|SDL_HAPTIC_LEFTRIGHT)) != 0); +} + +/* + * Initializes the haptic device for simple rumble playback. + */ +int +SDL_HapticRumbleInit(SDL_Haptic * haptic) +{ + SDL_HapticEffect *efx = &haptic->rumble_effect; + + if (!ValidHaptic(haptic)) { + return -1; + } + + /* Already allocated. */ + if (haptic->rumble_id >= 0) { + return 0; + } + + SDL_zerop(efx); + if (haptic->supported & SDL_HAPTIC_SINE) { + efx->type = SDL_HAPTIC_SINE; + efx->periodic.period = 1000; + efx->periodic.magnitude = 0x4000; + efx->periodic.length = 5000; + efx->periodic.attack_length = 0; + efx->periodic.fade_length = 0; + } else if (haptic->supported & SDL_HAPTIC_LEFTRIGHT) { /* XInput? */ + efx->type = SDL_HAPTIC_LEFTRIGHT; + efx->leftright.length = 5000; + efx->leftright.large_magnitude = 0x4000; + efx->leftright.small_magnitude = 0x4000; + } else { + return SDL_SetError("Device doesn't support rumble"); + } + + haptic->rumble_id = SDL_HapticNewEffect(haptic, &haptic->rumble_effect); + if (haptic->rumble_id >= 0) { + return 0; + } + return -1; +} + +/* + * Runs simple rumble on a haptic device + */ +int +SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) +{ + SDL_HapticEffect *efx; + Sint16 magnitude; + + if (!ValidHaptic(haptic)) { + return -1; + } + + if (haptic->rumble_id < 0) { + return SDL_SetError("Haptic: Rumble effect not initialized on haptic device"); + } + + /* Clamp strength. */ + if (strength > 1.0f) { + strength = 1.0f; + } else if (strength < 0.0f) { + strength = 0.0f; + } + magnitude = (Sint16)(32767.0f*strength); + + efx = &haptic->rumble_effect; + if (efx->type == SDL_HAPTIC_SINE) { + efx->periodic.magnitude = magnitude; + efx->periodic.length = length; + } else if (efx->type == SDL_HAPTIC_LEFTRIGHT) { + efx->leftright.small_magnitude = efx->leftright.large_magnitude = magnitude; + efx->leftright.length = length; + } else { + SDL_assert(0 && "This should have been caught elsewhere"); + } + + if (SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect) < 0) { + return -1; + } + + return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1); +} + +/* + * Stops the simple rumble on a haptic device. + */ +int +SDL_HapticRumbleStop(SDL_Haptic * haptic) +{ + if (!ValidHaptic(haptic)) { + return -1; + } + + if (haptic->rumble_id < 0) { + return SDL_SetError("Haptic: Rumble effect not initialized on haptic device"); + } + + return SDL_HapticStopEffect(haptic, haptic->rumble_id); +} + diff --git a/src/haptic/SDL_haptic_c.h b/src/haptic/SDL_haptic_c.h new file mode 100644 index 0000000000..678a08f0a6 --- /dev/null +++ b/src/haptic/SDL_haptic_c.h @@ -0,0 +1,25 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +extern int SDL_HapticInit(void); +extern void SDL_HapticQuit(void); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/haptic/SDL_syshaptic.h b/src/haptic/SDL_syshaptic.h new file mode 100644 index 0000000000..ac5198ffd8 --- /dev/null +++ b/src/haptic/SDL_syshaptic.h @@ -0,0 +1,203 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +#include "SDL_haptic.h" + + +/* + * Number of haptic devices on the system. + */ +extern Uint8 SDL_numhaptics; + + +struct haptic_effect +{ + SDL_HapticEffect effect; /* The current event */ + struct haptic_hweffect *hweffect; /* The hardware behind the event */ +}; + +/* + * The real SDL_Haptic struct. + */ +struct _SDL_Haptic +{ + Uint8 index; /* Stores index it is attached to */ + + struct haptic_effect *effects; /* Allocated effects */ + int neffects; /* Maximum amount of effects */ + int nplaying; /* Maximum amount of effects to play at the same time */ + unsigned int supported; /* Supported effects */ + int naxes; /* Number of axes on the device. */ + + struct haptic_hwdata *hwdata; /* Driver dependent */ + int ref_count; /* Count for multiple opens */ + + int rumble_id; /* ID of rumble effect for simple rumble API. */ + SDL_HapticEffect rumble_effect; /* Rumble effect. */ +}; + +/* + * Scans the system for haptic devices. + * + * Returns number of devices on success, -1 on error. + */ +extern int SDL_SYS_HapticInit(void); + +/* + * Gets the device dependent name of the haptic device + */ +extern const char *SDL_SYS_HapticName(int index); + +/* + * Opens the haptic device for usage. The haptic device should have + * the index value set previously. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticOpen(SDL_Haptic * haptic); + +/* + * Returns the index of the haptic core pointer or -1 if none is found. + */ +int SDL_SYS_HapticMouse(void); + +/* + * Checks to see if the joystick has haptic capabilities. + * + * Returns >0 if haptic capabilities are detected, 0 if haptic + * capabilities aren't detected and -1 on error. + */ +extern int SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick); + +/* + * Opens the haptic device for usage using the same device as + * the joystick. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, + SDL_Joystick * joystick); +/* + * Checks to see if haptic device and joystick device are the same. + * + * Returns 1 if they are the same, 0 if they aren't. + */ +extern int SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, + SDL_Joystick * joystick); + +/* + * Closes a haptic device after usage. + */ +extern void SDL_SYS_HapticClose(SDL_Haptic * haptic); + +/* + * Performs a cleanup on the haptic subsystem. + */ +extern void SDL_SYS_HapticQuit(void); + +/* + * Creates a new haptic effect on the haptic device using base + * as a template for the effect. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, + SDL_HapticEffect * base); + +/* + * Updates the haptic effect on the haptic device using data + * as a template. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, + SDL_HapticEffect * data); + +/* + * Runs the effect on the haptic device. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, + Uint32 iterations); + +/* + * Stops the effect on the haptic device. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, + struct haptic_effect *effect); + +/* + * Cleanups up the effect on the haptic device. + */ +extern void SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, + struct haptic_effect *effect); + +/* + * Queries the device for the status of effect. + * + * Returns 0 if device is stopped, >0 if device is playing and + * -1 on error. + */ +extern int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, + struct haptic_effect *effect); + +/* + * Sets the global gain of the haptic device. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain); + +/* + * Sets the autocenter feature of the haptic device. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter); + +/* + * Pauses the haptic device. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticPause(SDL_Haptic * haptic); + +/* + * Unpauses the haptic device. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticUnpause(SDL_Haptic * haptic); + +/* + * Stops all the currently playing haptic effects on the device. + * + * Returns 0 on success, -1 on error. + */ +extern int SDL_SYS_HapticStopAll(SDL_Haptic * haptic); diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c new file mode 100644 index 0000000000..ec889041cd --- /dev/null +++ b/src/haptic/darwin/SDL_syshaptic.c @@ -0,0 +1,1308 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef SDL_HAPTIC_IOKIT + +#include "SDL_haptic.h" +#include "../SDL_syshaptic.h" +#include "SDL_joystick.h" +#include "../../joystick/SDL_sysjoystick.h" /* For the real SDL_Joystick */ +#include "../../joystick/darwin/SDL_sysjoystick_c.h" /* For joystick hwdata */ + +#include +#include +#include +#include +#include + +#ifndef IO_OBJECT_NULL +#define IO_OBJECT_NULL ((io_service_t)0) +#endif + +#define MAX_HAPTICS 32 + + +/* + * List of available haptic devices. + */ +static struct +{ + char name[256]; /* Name of the device. */ + + io_service_t dev; /* Node we use to create the device. */ + SDL_Haptic *haptic; /* Haptic currently associated with it. */ + + /* Usage pages for determining if it's a mouse or not. */ + long usage; + long usagePage; +} SDL_hapticlist[MAX_HAPTICS]; + + +/* + * Haptic system hardware data. + */ +struct haptic_hwdata +{ + FFDeviceObjectReference device; /* Hardware device. */ + UInt8 axes[3]; +}; + + +/* + * Haptic system effect data. + */ +struct haptic_hweffect +{ + FFEffectObjectReference ref; /* Reference. */ + struct FFEFFECT effect; /* Hardware effect. */ +}; + +/* + * Prototypes. + */ +static void SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type); +static int HIDGetDeviceProduct(io_service_t dev, char *name); + + +/* + * Like strerror but for force feedback errors. + */ +static const char * +FFStrError(HRESULT err) +{ + switch (err) { + case FFERR_DEVICEFULL: + return "device full"; + /* This should be valid, but for some reason isn't defined... */ + /*case FFERR_DEVICENOTREG: + return "device not registered"; */ + case FFERR_DEVICEPAUSED: + return "device paused"; + case FFERR_DEVICERELEASED: + return "device released"; + case FFERR_EFFECTPLAYING: + return "effect playing"; + case FFERR_EFFECTTYPEMISMATCH: + return "effect type mismatch"; + case FFERR_EFFECTTYPENOTSUPPORTED: + return "effect type not supported"; + case FFERR_GENERIC: + return "undetermined error"; + case FFERR_HASEFFECTS: + return "device has effects"; + case FFERR_INCOMPLETEEFFECT: + return "incomplete effect"; + case FFERR_INTERNAL: + return "internal fault"; + case FFERR_INVALIDDOWNLOADID: + return "invalid download id"; + case FFERR_INVALIDPARAM: + return "invalid parameter"; + case FFERR_MOREDATA: + return "more data"; + case FFERR_NOINTERFACE: + return "interface not supported"; + case FFERR_NOTDOWNLOADED: + return "effect is not downloaded"; + case FFERR_NOTINITIALIZED: + return "object has not been initialized"; + case FFERR_OUTOFMEMORY: + return "out of memory"; + case FFERR_UNPLUGGED: + return "device is unplugged"; + case FFERR_UNSUPPORTED: + return "function call unsupported"; + case FFERR_UNSUPPORTEDAXIS: + return "axis unsupported"; + + default: + return "unknown error"; + } +} + + +/* + * Initializes the haptic subsystem. + */ +int +SDL_SYS_HapticInit(void) +{ + int numhaptics; + IOReturn result; + io_iterator_t iter; + CFDictionaryRef match; + io_service_t device; + CFMutableDictionaryRef hidProperties; + CFTypeRef refCF; + + /* Clear all the memory. */ + SDL_memset(SDL_hapticlist, 0, sizeof(SDL_hapticlist)); + + /* Get HID devices. */ + match = IOServiceMatching(kIOHIDDeviceKey); + if (match == NULL) { + return SDL_SetError("Haptic: Failed to get IOServiceMatching."); + } + + /* Now search I/O Registry for matching devices. */ + result = IOServiceGetMatchingServices(kIOMasterPortDefault, match, &iter); + if (result != kIOReturnSuccess) { + return SDL_SetError("Haptic: Couldn't create a HID object iterator."); + } + /* IOServiceGetMatchingServices consumes dictionary. */ + + if (!IOIteratorIsValid(iter)) { /* No iterator. */ + return 0; + } + + numhaptics = 0; + while ((device = IOIteratorNext(iter)) != IO_OBJECT_NULL) { + + /* Check for force feedback. */ + if (FFIsForceFeedback(device) == FF_OK) { + + /* Set basic device data. */ + HIDGetDeviceProduct(device, SDL_hapticlist[numhaptics].name); + SDL_hapticlist[numhaptics].dev = device; + SDL_hapticlist[numhaptics].haptic = NULL; + + /* Set usage pages. */ + hidProperties = 0; + refCF = 0; + result = IORegistryEntryCreateCFProperties(device, + &hidProperties, + kCFAllocatorDefault, + kNilOptions); + if ((result == KERN_SUCCESS) && hidProperties) { + refCF = + CFDictionaryGetValue(hidProperties, + CFSTR(kIOHIDPrimaryUsagePageKey)); + if (refCF) { + if (!CFNumberGetValue(refCF, kCFNumberLongType, + &SDL_hapticlist[numhaptics]. + usagePage)) + SDL_SetError + ("Haptic: Recieving device's usage page."); + refCF = + CFDictionaryGetValue(hidProperties, + CFSTR(kIOHIDPrimaryUsageKey)); + if (refCF) { + if (!CFNumberGetValue(refCF, kCFNumberLongType, + &SDL_hapticlist[numhaptics]. + usage)) + SDL_SetError("Haptic: Recieving device's usage."); + } + } + CFRelease(hidProperties); + } + + /* Device has been added. */ + numhaptics++; + } else { /* Free the unused device. */ + IOObjectRelease(device); + } + + /* Reached haptic limit. */ + if (numhaptics >= MAX_HAPTICS) + break; + } + IOObjectRelease(iter); + + return numhaptics; +} + + +/* + * Return the name of a haptic device, does not need to be opened. + */ +const char * +SDL_SYS_HapticName(int index) +{ + return SDL_hapticlist[index].name; +} + +/* + * Gets the device's product name. + */ +static int +HIDGetDeviceProduct(io_service_t dev, char *name) +{ + CFMutableDictionaryRef hidProperties, usbProperties; + io_registry_entry_t parent1, parent2; + kern_return_t ret; + + hidProperties = usbProperties = 0; + + ret = IORegistryEntryCreateCFProperties(dev, &hidProperties, + kCFAllocatorDefault, kNilOptions); + if ((ret != KERN_SUCCESS) || !hidProperties) { + return SDL_SetError("Haptic: Unable to create CFProperties."); + } + + /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also + * get dictionary for USB properties: step up two levels and get CF dictionary for USB properties + */ + if ((KERN_SUCCESS == + IORegistryEntryGetParentEntry(dev, kIOServicePlane, &parent1)) + && (KERN_SUCCESS == + IORegistryEntryGetParentEntry(parent1, kIOServicePlane, &parent2)) + && (KERN_SUCCESS == + IORegistryEntryCreateCFProperties(parent2, &usbProperties, + kCFAllocatorDefault, + kNilOptions))) { + if (usbProperties) { + CFTypeRef refCF = 0; + /* get device info + * try hid dictionary first, if fail then go to USB dictionary + */ + + + /* Get product name */ + refCF = + CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductKey)); + if (!refCF) + refCF = + CFDictionaryGetValue(usbProperties, + CFSTR("USB Product Name")); + if (refCF) { + if (!CFStringGetCString(refCF, name, 256, + CFStringGetSystemEncoding())) { + return SDL_SetError + ("Haptic: CFStringGetCString error retrieving pDevice->product."); + } + } + + CFRelease(usbProperties); + } else { + return SDL_SetError + ("Haptic: IORegistryEntryCreateCFProperties failed to create usbProperties."); + } + + /* Release stuff. */ + if (kIOReturnSuccess != IOObjectRelease(parent2)) { + SDL_SetError("Haptic: IOObjectRelease error with parent2."); + } + if (kIOReturnSuccess != IOObjectRelease(parent1)) { + SDL_SetError("Haptic: IOObjectRelease error with parent1."); + } + } else { + return SDL_SetError("Haptic: Error getting registry entries."); + } + + return 0; +} + + +#define FF_TEST(ff, s) \ +if (features.supportedEffects & (ff)) supported |= (s) +/* + * Gets supported features. + */ +static unsigned int +GetSupportedFeatures(SDL_Haptic * haptic) +{ + HRESULT ret; + FFDeviceObjectReference device; + FFCAPABILITIES features; + unsigned int supported; + Uint32 val; + + device = haptic->hwdata->device; + + ret = FFDeviceGetForceFeedbackCapabilities(device, &features); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Unable to get device's supported features."); + } + + supported = 0; + + /* Get maximum effects. */ + haptic->neffects = features.storageCapacity; + haptic->nplaying = features.playbackCapacity; + + /* Test for effects. */ + FF_TEST(FFCAP_ET_CONSTANTFORCE, SDL_HAPTIC_CONSTANT); + FF_TEST(FFCAP_ET_RAMPFORCE, SDL_HAPTIC_RAMP); + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*FF_TEST(FFCAP_ET_SQUARE, SDL_HAPTIC_SQUARE);*/ + FF_TEST(FFCAP_ET_SINE, SDL_HAPTIC_SINE); + FF_TEST(FFCAP_ET_TRIANGLE, SDL_HAPTIC_TRIANGLE); + FF_TEST(FFCAP_ET_SAWTOOTHUP, SDL_HAPTIC_SAWTOOTHUP); + FF_TEST(FFCAP_ET_SAWTOOTHDOWN, SDL_HAPTIC_SAWTOOTHDOWN); + FF_TEST(FFCAP_ET_SPRING, SDL_HAPTIC_SPRING); + FF_TEST(FFCAP_ET_DAMPER, SDL_HAPTIC_DAMPER); + FF_TEST(FFCAP_ET_INERTIA, SDL_HAPTIC_INERTIA); + FF_TEST(FFCAP_ET_FRICTION, SDL_HAPTIC_FRICTION); + FF_TEST(FFCAP_ET_CUSTOMFORCE, SDL_HAPTIC_CUSTOM); + + /* Check if supports gain. */ + ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_FFGAIN, + &val, sizeof(val)); + if (ret == FF_OK) + supported |= SDL_HAPTIC_GAIN; + else if (ret != FFERR_UNSUPPORTED) { + return SDL_SetError("Haptic: Unable to get if device supports gain: %s.", + FFStrError(ret)); + } + + /* Checks if supports autocenter. */ + ret = FFDeviceGetForceFeedbackProperty(device, FFPROP_AUTOCENTER, + &val, sizeof(val)); + if (ret == FF_OK) + supported |= SDL_HAPTIC_AUTOCENTER; + else if (ret != FFERR_UNSUPPORTED) { + return SDL_SetError + ("Haptic: Unable to get if device supports autocenter: %s.", + FFStrError(ret)); + } + + /* Check for axes, we have an artificial limit on axes */ + haptic->naxes = ((features.numFfAxes) > 3) ? 3 : features.numFfAxes; + /* Actually store the axes we want to use */ + SDL_memcpy(haptic->hwdata->axes, features.ffAxes, + haptic->naxes * sizeof(Uint8)); + + /* Always supported features. */ + supported |= SDL_HAPTIC_STATUS | SDL_HAPTIC_PAUSE; + + haptic->supported = supported; + return 0;; +} + + +/* + * Opens the haptic device from the file descriptor. + */ +static int +SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service) +{ + HRESULT ret; + int ret2; + + /* Allocate the hwdata */ + haptic->hwdata = (struct haptic_hwdata *) + SDL_malloc(sizeof(*haptic->hwdata)); + if (haptic->hwdata == NULL) { + SDL_OutOfMemory(); + goto creat_err; + } + SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata)); + + /* Open the device */ + ret = FFCreateDevice(service, &haptic->hwdata->device); + if (ret != FF_OK) { + SDL_SetError("Haptic: Unable to create device from service: %s.", + FFStrError(ret)); + goto creat_err; + } + + /* Get supported features. */ + ret2 = GetSupportedFeatures(haptic); + if (ret2 < 0) { + goto open_err; + } + + + /* Reset and then enable actuators. */ + ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device, + FFSFFC_RESET); + if (ret != FF_OK) { + SDL_SetError("Haptic: Unable to reset device: %s.", FFStrError(ret)); + goto open_err; + } + ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device, + FFSFFC_SETACTUATORSON); + if (ret != FF_OK) { + SDL_SetError("Haptic: Unable to enable actuators: %s.", + FFStrError(ret)); + goto open_err; + } + + + /* Allocate effects memory. */ + haptic->effects = (struct haptic_effect *) + SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); + if (haptic->effects == NULL) { + SDL_OutOfMemory(); + goto open_err; + } + /* Clear the memory */ + SDL_memset(haptic->effects, 0, + sizeof(struct haptic_effect) * haptic->neffects); + + return 0; + + /* Error handling */ + open_err: + FFReleaseDevice(haptic->hwdata->device); + creat_err: + if (haptic->hwdata != NULL) { + free(haptic->hwdata); + haptic->hwdata = NULL; + } + return -1; + +} + + +/* + * Opens a haptic device for usage. + */ +int +SDL_SYS_HapticOpen(SDL_Haptic * haptic) +{ + return SDL_SYS_HapticOpenFromService(haptic, + SDL_hapticlist[haptic->index].dev); +} + + +/* + * Opens a haptic device from first mouse it finds for usage. + */ +int +SDL_SYS_HapticMouse(void) +{ + int i; + + for (i = 0; i < SDL_numhaptics; i++) { + if ((SDL_hapticlist[i].usagePage == kHIDPage_GenericDesktop) && + (SDL_hapticlist[i].usage == kHIDUsage_GD_Mouse)) + return i; + } + + return -1; +} + + +/* + * Checks to see if a joystick has haptic features. + */ +int +SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +{ + if (joystick->hwdata->ffservice != 0) + return SDL_TRUE; + return SDL_FALSE; +} + + +/* + * Checks to see if the haptic device and joystick and in reality the same. + */ +int +SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + if (IOObjectIsEqualTo((io_object_t) ((size_t)haptic->hwdata->device), + joystick->hwdata->ffservice)) + return 1; + return 0; +} + + +/* + * Opens a SDL_Haptic from a SDL_Joystick. + */ +int +SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + int i; + for (i=0; ihwdata->ffservice)) { + haptic->index = i; + break; + } + } + if (i >= SDL_numhaptics) { + return -1; + } + + return SDL_SYS_HapticOpenFromService(haptic, joystick->hwdata->ffservice); +} + + +/* + * Closes the haptic device. + */ +void +SDL_SYS_HapticClose(SDL_Haptic * haptic) +{ + if (haptic->hwdata) { + + /* Free Effects. */ + SDL_free(haptic->effects); + haptic->effects = NULL; + haptic->neffects = 0; + + /* Clean up */ + FFReleaseDevice(haptic->hwdata->device); + + /* Free */ + SDL_free(haptic->hwdata); + haptic->hwdata = NULL; + } +} + + +/* + * Clean up after system specific haptic stuff + */ +void +SDL_SYS_HapticQuit(void) +{ + int i; + + for (i = 0; i < SDL_numhaptics; i++) { + /* Opened and not closed haptics are leaked, this is on purpose. + * Close your haptic devices after usage. */ + + /* Free the io_service_t */ + IOObjectRelease(SDL_hapticlist[i].dev); + } +} + + +/* + * Converts an SDL trigger button to an FFEFFECT trigger button. + */ +static DWORD +FFGetTriggerButton(Uint16 button) +{ + DWORD dwTriggerButton; + + dwTriggerButton = FFEB_NOTRIGGER; + + if (button != 0) { + dwTriggerButton = FFJOFS_BUTTON(button - 1); + } + + return dwTriggerButton; +} + + +/* + * Sets the direction. + */ +static int +SDL_SYS_SetDirection(FFEFFECT * effect, SDL_HapticDirection * dir, int naxes) +{ + LONG *rglDir; + + /* Handle no axes a part. */ + if (naxes == 0) { + effect->dwFlags |= FFEFF_SPHERICAL; /* Set as default. */ + effect->rglDirection = NULL; + return 0; + } + + /* Has axes. */ + rglDir = SDL_malloc(sizeof(LONG) * naxes); + if (rglDir == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(rglDir, 0, sizeof(LONG) * naxes); + effect->rglDirection = rglDir; + + switch (dir->type) { + case SDL_HAPTIC_POLAR: + effect->dwFlags |= FFEFF_POLAR; + rglDir[0] = dir->dir[0]; + return 0; + case SDL_HAPTIC_CARTESIAN: + effect->dwFlags |= FFEFF_CARTESIAN; + rglDir[0] = dir->dir[0]; + if (naxes > 1) + rglDir[1] = dir->dir[1]; + if (naxes > 2) + rglDir[2] = dir->dir[2]; + return 0; + case SDL_HAPTIC_SPHERICAL: + effect->dwFlags |= FFEFF_SPHERICAL; + rglDir[0] = dir->dir[0]; + if (naxes > 1) + rglDir[1] = dir->dir[1]; + if (naxes > 2) + rglDir[2] = dir->dir[2]; + return 0; + + default: + return SDL_SetError("Haptic: Unknown direction type."); + } +} + + +/* Clamps and converts. */ +#define CCONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF) +/* Just converts. */ +#define CONVERT(x) (((x)*10000) / 0x7FFF) +/* + * Creates the FFEFFECT from a SDL_HapticEffect. + */ +static int +SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, + SDL_HapticEffect * src) +{ + int i; + FFCONSTANTFORCE *constant; + FFPERIODIC *periodic; + FFCONDITION *condition; /* Actually an array of conditions - one per axis. */ + FFRAMPFORCE *ramp; + FFCUSTOMFORCE *custom; + FFENVELOPE *envelope; + SDL_HapticConstant *hap_constant; + SDL_HapticPeriodic *hap_periodic; + SDL_HapticCondition *hap_condition; + SDL_HapticRamp *hap_ramp; + SDL_HapticCustom *hap_custom; + DWORD *axes; + + /* Set global stuff. */ + SDL_memset(dest, 0, sizeof(FFEFFECT)); + dest->dwSize = sizeof(FFEFFECT); /* Set the structure size. */ + dest->dwSamplePeriod = 0; /* Not used by us. */ + dest->dwGain = 10000; /* Gain is set globally, not locally. */ + dest->dwFlags = FFEFF_OBJECTOFFSETS; /* Seems obligatory. */ + + /* Envelope. */ + envelope = SDL_malloc(sizeof(FFENVELOPE)); + if (envelope == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(envelope, 0, sizeof(FFENVELOPE)); + dest->lpEnvelope = envelope; + envelope->dwSize = sizeof(FFENVELOPE); /* Always should be this. */ + + /* Axes. */ + dest->cAxes = haptic->naxes; + if (dest->cAxes > 0) { + axes = SDL_malloc(sizeof(DWORD) * dest->cAxes); + if (axes == NULL) { + return SDL_OutOfMemory(); + } + axes[0] = haptic->hwdata->axes[0]; /* Always at least one axis. */ + if (dest->cAxes > 1) { + axes[1] = haptic->hwdata->axes[1]; + } + if (dest->cAxes > 2) { + axes[2] = haptic->hwdata->axes[2]; + } + dest->rgdwAxes = axes; + } + + + /* The big type handling switch, even bigger then Linux's version. */ + switch (src->type) { + case SDL_HAPTIC_CONSTANT: + hap_constant = &src->constant; + constant = SDL_malloc(sizeof(FFCONSTANTFORCE)); + if (constant == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(constant, 0, sizeof(FFCONSTANTFORCE)); + + /* Specifics */ + constant->lMagnitude = CONVERT(hap_constant->level); + dest->cbTypeSpecificParams = sizeof(FFCONSTANTFORCE); + dest->lpvTypeSpecificParams = constant; + + /* Generics */ + dest->dwDuration = hap_constant->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = FFGetTriggerButton(hap_constant->button); + dest->dwTriggerRepeatInterval = hap_constant->interval; + dest->dwStartDelay = hap_constant->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_constant->direction, dest->cAxes) + < 0) { + return -1; + } + + /* Envelope */ + if ((hap_constant->attack_length == 0) + && (hap_constant->fade_length == 0)) { + SDL_free(envelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CCONVERT(hap_constant->attack_level); + envelope->dwAttackTime = hap_constant->attack_length * 1000; + envelope->dwFadeLevel = CCONVERT(hap_constant->fade_level); + envelope->dwFadeTime = hap_constant->fade_length * 1000; + } + + break; + + case SDL_HAPTIC_SINE: + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*case SDL_HAPTIC_SQUARE:*/ + case SDL_HAPTIC_TRIANGLE: + case SDL_HAPTIC_SAWTOOTHUP: + case SDL_HAPTIC_SAWTOOTHDOWN: + hap_periodic = &src->periodic; + periodic = SDL_malloc(sizeof(FFPERIODIC)); + if (periodic == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(periodic, 0, sizeof(FFPERIODIC)); + + /* Specifics */ + periodic->dwMagnitude = CONVERT(hap_periodic->magnitude); + periodic->lOffset = CONVERT(hap_periodic->offset); + periodic->dwPhase = hap_periodic->phase; + periodic->dwPeriod = hap_periodic->period * 1000; + dest->cbTypeSpecificParams = sizeof(FFPERIODIC); + dest->lpvTypeSpecificParams = periodic; + + /* Generics */ + dest->dwDuration = hap_periodic->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = FFGetTriggerButton(hap_periodic->button); + dest->dwTriggerRepeatInterval = hap_periodic->interval; + dest->dwStartDelay = hap_periodic->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes) + < 0) { + return -1; + } + + /* Envelope */ + if ((hap_periodic->attack_length == 0) + && (hap_periodic->fade_length == 0)) { + SDL_free(envelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CCONVERT(hap_periodic->attack_level); + envelope->dwAttackTime = hap_periodic->attack_length * 1000; + envelope->dwFadeLevel = CCONVERT(hap_periodic->fade_level); + envelope->dwFadeTime = hap_periodic->fade_length * 1000; + } + + break; + + case SDL_HAPTIC_SPRING: + case SDL_HAPTIC_DAMPER: + case SDL_HAPTIC_INERTIA: + case SDL_HAPTIC_FRICTION: + hap_condition = &src->condition; + condition = SDL_malloc(sizeof(FFCONDITION) * dest->cAxes); + if (condition == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(condition, 0, sizeof(FFCONDITION)); + + /* Specifics */ + for (i = 0; i < dest->cAxes; i++) { + condition[i].lOffset = CONVERT(hap_condition->center[i]); + condition[i].lPositiveCoefficient = + CONVERT(hap_condition->right_coeff[i]); + condition[i].lNegativeCoefficient = + CONVERT(hap_condition->left_coeff[i]); + condition[i].dwPositiveSaturation = + CCONVERT(hap_condition->right_sat[i]); + condition[i].dwNegativeSaturation = + CCONVERT(hap_condition->left_sat[i]); + condition[i].lDeadBand = CCONVERT(hap_condition->deadband[i]); + } + dest->cbTypeSpecificParams = sizeof(FFCONDITION) * dest->cAxes; + dest->lpvTypeSpecificParams = condition; + + /* Generics */ + dest->dwDuration = hap_condition->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = FFGetTriggerButton(hap_condition->button); + dest->dwTriggerRepeatInterval = hap_condition->interval; + dest->dwStartDelay = hap_condition->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes) + < 0) { + return -1; + } + + /* Envelope - Not actually supported by most CONDITION implementations. */ + SDL_free(dest->lpEnvelope); + dest->lpEnvelope = NULL; + + break; + + case SDL_HAPTIC_RAMP: + hap_ramp = &src->ramp; + ramp = SDL_malloc(sizeof(FFRAMPFORCE)); + if (ramp == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(ramp, 0, sizeof(FFRAMPFORCE)); + + /* Specifics */ + ramp->lStart = CONVERT(hap_ramp->start); + ramp->lEnd = CONVERT(hap_ramp->end); + dest->cbTypeSpecificParams = sizeof(FFRAMPFORCE); + dest->lpvTypeSpecificParams = ramp; + + /* Generics */ + dest->dwDuration = hap_ramp->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = FFGetTriggerButton(hap_ramp->button); + dest->dwTriggerRepeatInterval = hap_ramp->interval; + dest->dwStartDelay = hap_ramp->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_ramp->direction, dest->cAxes) < 0) { + return -1; + } + + /* Envelope */ + if ((hap_ramp->attack_length == 0) && (hap_ramp->fade_length == 0)) { + SDL_free(envelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CCONVERT(hap_ramp->attack_level); + envelope->dwAttackTime = hap_ramp->attack_length * 1000; + envelope->dwFadeLevel = CCONVERT(hap_ramp->fade_level); + envelope->dwFadeTime = hap_ramp->fade_length * 1000; + } + + break; + + case SDL_HAPTIC_CUSTOM: + hap_custom = &src->custom; + custom = SDL_malloc(sizeof(FFCUSTOMFORCE)); + if (custom == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(custom, 0, sizeof(FFCUSTOMFORCE)); + + /* Specifics */ + custom->cChannels = hap_custom->channels; + custom->dwSamplePeriod = hap_custom->period * 1000; + custom->cSamples = hap_custom->samples; + custom->rglForceData = + SDL_malloc(sizeof(LONG) * custom->cSamples * custom->cChannels); + for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) { /* Copy data. */ + custom->rglForceData[i] = CCONVERT(hap_custom->data[i]); + } + dest->cbTypeSpecificParams = sizeof(FFCUSTOMFORCE); + dest->lpvTypeSpecificParams = custom; + + /* Generics */ + dest->dwDuration = hap_custom->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = FFGetTriggerButton(hap_custom->button); + dest->dwTriggerRepeatInterval = hap_custom->interval; + dest->dwStartDelay = hap_custom->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_custom->direction, dest->cAxes) < + 0) { + return -1; + } + + /* Envelope */ + if ((hap_custom->attack_length == 0) + && (hap_custom->fade_length == 0)) { + SDL_free(envelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CCONVERT(hap_custom->attack_level); + envelope->dwAttackTime = hap_custom->attack_length * 1000; + envelope->dwFadeLevel = CCONVERT(hap_custom->fade_level); + envelope->dwFadeTime = hap_custom->fade_length * 1000; + } + + break; + + + default: + return SDL_SetError("Haptic: Unknown effect type."); + } + + return 0; +} + + +/* + * Frees an FFEFFECT allocated by SDL_SYS_ToFFEFFECT. + */ +static void +SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type) +{ + FFCUSTOMFORCE *custom; + + if (effect->lpEnvelope != NULL) { + SDL_free(effect->lpEnvelope); + effect->lpEnvelope = NULL; + } + if (effect->rgdwAxes != NULL) { + SDL_free(effect->rgdwAxes); + effect->rgdwAxes = NULL; + } + if (effect->lpvTypeSpecificParams != NULL) { + if (type == SDL_HAPTIC_CUSTOM) { /* Must free the custom data. */ + custom = (FFCUSTOMFORCE *) effect->lpvTypeSpecificParams; + SDL_free(custom->rglForceData); + custom->rglForceData = NULL; + } + SDL_free(effect->lpvTypeSpecificParams); + effect->lpvTypeSpecificParams = NULL; + } + if (effect->rglDirection != NULL) { + SDL_free(effect->rglDirection); + effect->rglDirection = NULL; + } +} + + +/* + * Gets the effect type from the generic SDL haptic effect wrapper. + */ +CFUUIDRef +SDL_SYS_HapticEffectType(Uint16 type) +{ + switch (type) { + case SDL_HAPTIC_CONSTANT: + return kFFEffectType_ConstantForce_ID; + + case SDL_HAPTIC_RAMP: + return kFFEffectType_RampForce_ID; + + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*case SDL_HAPTIC_SQUARE: + return kFFEffectType_Square_ID;*/ + + case SDL_HAPTIC_SINE: + return kFFEffectType_Sine_ID; + + case SDL_HAPTIC_TRIANGLE: + return kFFEffectType_Triangle_ID; + + case SDL_HAPTIC_SAWTOOTHUP: + return kFFEffectType_SawtoothUp_ID; + + case SDL_HAPTIC_SAWTOOTHDOWN: + return kFFEffectType_SawtoothDown_ID; + + case SDL_HAPTIC_SPRING: + return kFFEffectType_Spring_ID; + + case SDL_HAPTIC_DAMPER: + return kFFEffectType_Damper_ID; + + case SDL_HAPTIC_INERTIA: + return kFFEffectType_Inertia_ID; + + case SDL_HAPTIC_FRICTION: + return kFFEffectType_Friction_ID; + + case SDL_HAPTIC_CUSTOM: + return kFFEffectType_CustomForce_ID; + + default: + SDL_SetError("Haptic: Unknown effect type."); + return NULL; + } +} + + +/* + * Creates a new haptic effect. + */ +int +SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, + SDL_HapticEffect * base) +{ + HRESULT ret; + CFUUIDRef type; + + /* Alloc the effect. */ + effect->hweffect = (struct haptic_hweffect *) + SDL_malloc(sizeof(struct haptic_hweffect)); + if (effect->hweffect == NULL) { + SDL_OutOfMemory(); + goto err_hweffect; + } + + /* Get the type. */ + type = SDL_SYS_HapticEffectType(base->type); + if (type == NULL) { + goto err_hweffect; + } + + /* Get the effect. */ + if (SDL_SYS_ToFFEFFECT(haptic, &effect->hweffect->effect, base) < 0) { + goto err_effectdone; + } + + /* Create the actual effect. */ + ret = FFDeviceCreateEffect(haptic->hwdata->device, type, + &effect->hweffect->effect, + &effect->hweffect->ref); + if (ret != FF_OK) { + SDL_SetError("Haptic: Unable to create effect: %s.", FFStrError(ret)); + goto err_effectdone; + } + + return 0; + + err_effectdone: + SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, base->type); + err_hweffect: + if (effect->hweffect != NULL) { + SDL_free(effect->hweffect); + effect->hweffect = NULL; + } + return -1; +} + + +/* + * Updates an effect. + */ +int +SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, + SDL_HapticEffect * data) +{ + HRESULT ret; + FFEffectParameterFlag flags; + FFEFFECT temp; + + /* Get the effect. */ + SDL_memset(&temp, 0, sizeof(FFEFFECT)); + if (SDL_SYS_ToFFEFFECT(haptic, &temp, data) < 0) { + goto err_update; + } + + /* Set the flags. Might be worthwhile to diff temp with loaded effect and + * only change those parameters. */ + flags = FFEP_DIRECTION | + FFEP_DURATION | + FFEP_ENVELOPE | + FFEP_STARTDELAY | + FFEP_TRIGGERBUTTON | + FFEP_TRIGGERREPEATINTERVAL | FFEP_TYPESPECIFICPARAMS; + + /* Create the actual effect. */ + ret = FFEffectSetParameters(effect->hweffect->ref, &temp, flags); + if (ret != FF_OK) { + SDL_SetError("Haptic: Unable to update effect: %s.", FFStrError(ret)); + goto err_update; + } + + /* Copy it over. */ + SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, data->type); + SDL_memcpy(&effect->hweffect->effect, &temp, sizeof(FFEFFECT)); + + return 0; + + err_update: + SDL_SYS_HapticFreeFFEFFECT(&temp, data->type); + return -1; +} + + +/* + * Runs an effect. + */ +int +SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, + Uint32 iterations) +{ + HRESULT ret; + Uint32 iter; + + /* Check if it's infinite. */ + if (iterations == SDL_HAPTIC_INFINITY) { + iter = FF_INFINITE; + } else + iter = iterations; + + /* Run the effect. */ + ret = FFEffectStart(effect->hweffect->ref, iter, 0); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Unable to run the effect: %s.", + FFStrError(ret)); + } + + return 0; +} + + +/* + * Stops an effect. + */ +int +SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + HRESULT ret; + + ret = FFEffectStop(effect->hweffect->ref); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Unable to stop the effect: %s.", + FFStrError(ret)); + } + + return 0; +} + + +/* + * Frees the effect. + */ +void +SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + HRESULT ret; + + ret = + FFDeviceReleaseEffect(haptic->hwdata->device, effect->hweffect->ref); + if (ret != FF_OK) { + SDL_SetError("Haptic: Error removing the effect from the device: %s.", + FFStrError(ret)); + } + SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, + effect->effect.type); + SDL_free(effect->hweffect); + effect->hweffect = NULL; +} + + +/* + * Gets the status of a haptic effect. + */ +int +SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, + struct haptic_effect *effect) +{ + HRESULT ret; + FFEffectStatusFlag status; + + ret = FFEffectGetEffectStatus(effect->hweffect->ref, &status); + if (ret != FF_OK) { + SDL_SetError("Haptic: Unable to get effect status: %s.", + FFStrError(ret)); + return -1; + } + + if (status == 0) + return SDL_FALSE; + return SDL_TRUE; /* Assume it's playing or emulated. */ +} + + +/* + * Sets the gain. + */ +int +SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +{ + HRESULT ret; + Uint32 val; + + val = gain * 100; /* Mac OS X uses 0 to 10,000 */ + ret = + FFDeviceSetForceFeedbackProperty(haptic->hwdata->device, + FFPROP_FFGAIN, &val); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Error setting gain: %s.", FFStrError(ret)); + } + + return 0; +} + + +/* + * Sets the autocentering. + */ +int +SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +{ + HRESULT ret; + Uint32 val; + + /* Mac OS X only has 0 (off) and 1 (on) */ + if (autocenter == 0) + val = 0; + else + val = 1; + + ret = FFDeviceSetForceFeedbackProperty(haptic->hwdata->device, + FFPROP_AUTOCENTER, &val); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Error setting autocenter: %s.", + FFStrError(ret)); + } + + return 0; +} + + +/* + * Pauses the device. + */ +int +SDL_SYS_HapticPause(SDL_Haptic * haptic) +{ + HRESULT ret; + + ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device, + FFSFFC_PAUSE); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret)); + } + + return 0; +} + + +/* + * Unpauses the device. + */ +int +SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +{ + HRESULT ret; + + ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device, + FFSFFC_CONTINUE); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret)); + } + + return 0; +} + + +/* + * Stops all currently playing effects. + */ +int +SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +{ + HRESULT ret; + + ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device, + FFSFFC_STOPALL); + if (ret != FF_OK) { + return SDL_SetError("Haptic: Error stopping device: %s.", FFStrError(ret)); + } + + return 0; +} + + +#endif /* SDL_HAPTIC_IOKIT */ diff --git a/src/haptic/dummy/SDL_syshaptic.c b/src/haptic/dummy/SDL_syshaptic.c new file mode 100644 index 0000000000..29084eb179 --- /dev/null +++ b/src/haptic/dummy/SDL_syshaptic.c @@ -0,0 +1,179 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if defined(SDL_HAPTIC_DUMMY) || defined(SDL_HAPTIC_DISABLED) + +#include "SDL_haptic.h" +#include "../SDL_syshaptic.h" + + +static int +SDL_SYS_LogicError(void) +{ + return SDL_SetError("Logic error: No haptic devices available."); +} + + +int +SDL_SYS_HapticInit(void) +{ + return 0; +} + + +const char * +SDL_SYS_HapticName(int index) +{ + SDL_SYS_LogicError(); + return NULL; +} + + +int +SDL_SYS_HapticOpen(SDL_Haptic * haptic) +{ + return SDL_SYS_LogicError(); +} + + +int +SDL_SYS_HapticMouse(void) +{ + return -1; +} + + +int +SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +{ + return 0; +} + + +int +SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + return SDL_SYS_LogicError(); +} + + +int +SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + return 0; +} + + +void +SDL_SYS_HapticClose(SDL_Haptic * haptic) +{ + return; +} + + +void +SDL_SYS_HapticQuit(void) +{ + return; +} + + +int +SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, SDL_HapticEffect * base) +{ + return SDL_SYS_LogicError(); +} + + +int +SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, + SDL_HapticEffect * data) +{ + return SDL_SYS_LogicError(); +} + + +int +SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, + Uint32 iterations) +{ + return SDL_SYS_LogicError(); +} + + +int +SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + return SDL_SYS_LogicError(); +} + + +void +SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + SDL_SYS_LogicError(); + return; +} + + +int +SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, + struct haptic_effect *effect) +{ + return SDL_SYS_LogicError(); +} + + +int +SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +{ + return SDL_SYS_LogicError(); +} + + +int +SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +{ + return SDL_SYS_LogicError(); +} + +int +SDL_SYS_HapticPause(SDL_Haptic * haptic) +{ + return SDL_SYS_LogicError(); +} + +int +SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +{ + return SDL_SYS_LogicError(); +} + +int +SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +{ + return SDL_SYS_LogicError(); +} + +#endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */ diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c new file mode 100644 index 0000000000..ad34fc27f5 --- /dev/null +++ b/src/haptic/linux/SDL_syshaptic.c @@ -0,0 +1,1001 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef SDL_HAPTIC_LINUX + +#include "SDL_haptic.h" +#include "../SDL_syshaptic.h" +#include "SDL_joystick.h" +#include "../../joystick/SDL_sysjoystick.h" /* For the real SDL_Joystick */ +#include "../../joystick/linux/SDL_sysjoystick_c.h" /* For joystick hwdata */ + +#include /* close */ +#include /* Force feedback linux stuff. */ +#include /* O_RDWR */ +#include /* INT_MAX */ +#include /* errno, strerror */ +#include /* atan2 */ +#include /* stat */ + +/* Just in case. */ +#ifndef M_PI +# define M_PI 3.14159265358979323846 +#endif + + +#define MAX_HAPTICS 32 /* It's doubtful someone has more then 32 evdev */ + + +/* + * List of available haptic devices. + */ +static struct +{ + char *fname; /* Dev path name (like /dev/input/event1) */ + SDL_Haptic *haptic; /* Assosciated haptic. */ +} SDL_hapticlist[MAX_HAPTICS]; + + +/* + * Haptic system hardware data. + */ +struct haptic_hwdata +{ + int fd; /* File descriptor of the device. */ + char *fname; /* Points to the name in SDL_hapticlist. */ +}; + + +/* + * Haptic system effect data. + */ +struct haptic_hweffect +{ + struct ff_effect effect; /* The linux kernel effect structure. */ +}; + + + +#define test_bit(nr, addr) \ + (((1UL << ((nr) & 31)) & (((const unsigned int *) addr)[(nr) >> 5])) != 0) +#define EV_TEST(ev,f) \ + if (test_bit((ev), features)) ret |= (f); +/* + * Test whether a device has haptic properties. + * Returns available properties or 0 if there are none. + */ +static int +EV_IsHaptic(int fd) +{ + unsigned int ret; + unsigned long features[1 + FF_MAX / sizeof(unsigned long)]; + + /* Ask device for what it has. */ + ret = 0; + if (ioctl(fd, EVIOCGBIT(EV_FF, sizeof(features)), features) < 0) { + return SDL_SetError("Haptic: Unable to get device's features: %s", + strerror(errno)); + } + + /* Convert supported features to SDL_HAPTIC platform-neutral features. */ + EV_TEST(FF_CONSTANT, SDL_HAPTIC_CONSTANT); + EV_TEST(FF_SINE, SDL_HAPTIC_SINE); + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*EV_TEST(FF_SQUARE, SDL_HAPTIC_SQUARE);*/ + EV_TEST(FF_TRIANGLE, SDL_HAPTIC_TRIANGLE); + EV_TEST(FF_SAW_UP, SDL_HAPTIC_SAWTOOTHUP); + EV_TEST(FF_SAW_DOWN, SDL_HAPTIC_SAWTOOTHDOWN); + EV_TEST(FF_RAMP, SDL_HAPTIC_RAMP); + EV_TEST(FF_SPRING, SDL_HAPTIC_SPRING); + EV_TEST(FF_FRICTION, SDL_HAPTIC_FRICTION); + EV_TEST(FF_DAMPER, SDL_HAPTIC_DAMPER); + EV_TEST(FF_INERTIA, SDL_HAPTIC_INERTIA); + EV_TEST(FF_CUSTOM, SDL_HAPTIC_CUSTOM); + EV_TEST(FF_GAIN, SDL_HAPTIC_GAIN); + EV_TEST(FF_AUTOCENTER, SDL_HAPTIC_AUTOCENTER); + EV_TEST(FF_RUMBLE, SDL_HAPTIC_LEFTRIGHT); + + /* Return what it supports. */ + return ret; +} + + +/* + * Tests whether a device is a mouse or not. + */ +static int +EV_IsMouse(int fd) +{ + unsigned long argp[40]; + + /* Ask for supported features. */ + if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(argp)), argp) < 0) { + return -1; + } + + /* Currently we only test for BTN_MOUSE which can give fake positives. */ + if (test_bit(BTN_MOUSE, argp) != 0) { + return 1; + } + + return 0; +} + +/* + * Initializes the haptic subsystem by finding available devices. + */ +int +SDL_SYS_HapticInit(void) +{ + const char joydev_pattern[] = "/dev/input/event%d"; + dev_t dev_nums[MAX_HAPTICS]; + char path[PATH_MAX]; + struct stat sb; + int fd; + int i, j, k; + int duplicate; + int numhaptics; + + numhaptics = 0; + + /* + * Limit amount of checks to MAX_HAPTICS since we may or may not have + * permission to some or all devices. + */ + i = 0; + for (j = 0; j < MAX_HAPTICS; ++j) { + + snprintf(path, PATH_MAX, joydev_pattern, i++); + + /* check to see if file exists */ + if (stat(path, &sb) != 0) + break; + + /* check for duplicates */ + duplicate = 0; + for (k = 0; (k < numhaptics) && !duplicate; ++k) { + if (sb.st_rdev == dev_nums[k]) { + duplicate = 1; + } + } + if (duplicate) { + continue; + } + + /* try to open */ + fd = open(path, O_RDWR, 0); + if (fd < 0) + continue; + +#ifdef DEBUG_INPUT_EVENTS + printf("Checking %s\n", path); +#endif + + /* see if it works */ + if (EV_IsHaptic(fd) > 0) { + SDL_hapticlist[numhaptics].fname = SDL_strdup(path); + SDL_hapticlist[numhaptics].haptic = NULL; + dev_nums[numhaptics] = sb.st_rdev; + ++numhaptics; + } + close(fd); + } + + return numhaptics; +} + + +/* + * Gets the name from a file descriptor. + */ +static const char * +SDL_SYS_HapticNameFromFD(int fd) +{ + static char namebuf[128]; + + /* We use the evdev name ioctl. */ + if (ioctl(fd, EVIOCGNAME(sizeof(namebuf)), namebuf) <= 0) { + return NULL; + } + + return namebuf; +} + + +/* + * Return the name of a haptic device, does not need to be opened. + */ +const char * +SDL_SYS_HapticName(int index) +{ + int fd; + const char *name; + + /* Open the haptic device. */ + name = NULL; + fd = open(SDL_hapticlist[index].fname, O_RDONLY, 0); + + if (fd >= 0) { + + name = SDL_SYS_HapticNameFromFD(fd); + if (name == NULL) { + /* No name found, return device character device */ + name = SDL_hapticlist[index].fname; + } + } + close(fd); + + return name; +} + + +/* + * Opens the haptic device from the file descriptor. + */ +static int +SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd) +{ + /* Allocate the hwdata */ + haptic->hwdata = (struct haptic_hwdata *) + SDL_malloc(sizeof(*haptic->hwdata)); + if (haptic->hwdata == NULL) { + SDL_OutOfMemory(); + goto open_err; + } + SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata)); + + /* Set the data. */ + haptic->hwdata->fd = fd; + haptic->supported = EV_IsHaptic(fd); + haptic->naxes = 2; /* Hardcoded for now, not sure if it's possible to find out. */ + + /* Set the effects */ + if (ioctl(fd, EVIOCGEFFECTS, &haptic->neffects) < 0) { + SDL_SetError("Haptic: Unable to query device memory: %s", + strerror(errno)); + goto open_err; + } + haptic->nplaying = haptic->neffects; /* Linux makes no distinction. */ + haptic->effects = (struct haptic_effect *) + SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); + if (haptic->effects == NULL) { + SDL_OutOfMemory(); + goto open_err; + } + /* Clear the memory */ + SDL_memset(haptic->effects, 0, + sizeof(struct haptic_effect) * haptic->neffects); + + return 0; + + /* Error handling */ + open_err: + close(fd); + if (haptic->hwdata != NULL) { + free(haptic->hwdata); + haptic->hwdata = NULL; + } + return -1; +} + + +/* + * Opens a haptic device for usage. + */ +int +SDL_SYS_HapticOpen(SDL_Haptic * haptic) +{ + int fd; + int ret; + + /* Open the character device */ + fd = open(SDL_hapticlist[haptic->index].fname, O_RDWR, 0); + if (fd < 0) { + return SDL_SetError("Haptic: Unable to open %s: %s", + SDL_hapticlist[haptic->index], strerror(errno)); + } + + /* Try to create the haptic. */ + ret = SDL_SYS_HapticOpenFromFD(haptic, fd); /* Already closes on error. */ + if (ret < 0) { + return -1; + } + + /* Set the fname. */ + haptic->hwdata->fname = SDL_hapticlist[haptic->index].fname; + return 0; +} + + +/* + * Opens a haptic device from first mouse it finds for usage. + */ +int +SDL_SYS_HapticMouse(void) +{ + int fd; + int i; + + for (i = 0; i < SDL_numhaptics; i++) { + + /* Open the device. */ + fd = open(SDL_hapticlist[i].fname, O_RDWR, 0); + if (fd < 0) { + return SDL_SetError("Haptic: Unable to open %s: %s", + SDL_hapticlist[i], strerror(errno)); + } + + /* Is it a mouse? */ + if (EV_IsMouse(fd)) { + close(fd); + return i; + } + + close(fd); + } + + return -1; +} + + +/* + * Checks to see if a joystick has haptic features. + */ +int +SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +{ + return EV_IsHaptic(joystick->hwdata->fd); +} + + +/* + * Checks to see if the haptic device and joystick and in reality the same. + */ +int +SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + /* We are assuming Linux is using evdev which should trump the old + * joystick methods. */ + if (SDL_strcmp(joystick->hwdata->fname, haptic->hwdata->fname) == 0) { + return 1; + } + return 0; +} + + +/* + * Opens a SDL_Haptic from a SDL_Joystick. + */ +int +SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + int i; + int fd; + int ret; + + + /* Find the joystick in the haptic list. */ + for (i = 0; i < MAX_HAPTICS; i++) { + if (SDL_hapticlist[i].fname != NULL) { + if (SDL_strcmp(SDL_hapticlist[i].fname, joystick->hwdata->fname) + == 0) { + haptic->index = i; + break; + } + } + } + if (i >= MAX_HAPTICS) { + return SDL_SetError("Haptic: Joystick doesn't have Haptic capabilities"); + } + + fd = open(joystick->hwdata->fname, O_RDWR, 0); + if (fd < 0) { + return SDL_SetError("Haptic: Unable to open %s: %s", + joystick->hwdata->fname, strerror(errno)); + } + ret = SDL_SYS_HapticOpenFromFD(haptic, fd); /* Already closes on error. */ + if (ret < 0) { + return -1; + } + + haptic->hwdata->fname = SDL_hapticlist[haptic->index].fname; + return 0; +} + + +/* + * Closes the haptic device. + */ +void +SDL_SYS_HapticClose(SDL_Haptic * haptic) +{ + if (haptic->hwdata) { + + /* Free effects. */ + SDL_free(haptic->effects); + haptic->effects = NULL; + haptic->neffects = 0; + + /* Clean up */ + close(haptic->hwdata->fd); + + /* Free */ + SDL_free(haptic->hwdata); + haptic->hwdata = NULL; + } + + /* Clear the rest. */ + SDL_memset(haptic, 0, sizeof(SDL_Haptic)); +} + + +/* + * Clean up after system specific haptic stuff + */ +void +SDL_SYS_HapticQuit(void) +{ + int i; + + for (i = 0; SDL_hapticlist[i].fname != NULL; i++) { + /* Opened and not closed haptics are leaked, this is on purpose. + * Close your haptic devices after usage. */ + + SDL_free(SDL_hapticlist[i].fname); + } + SDL_hapticlist[0].fname = NULL; +} + + +/* + * Converts an SDL button to a ff_trigger button. + */ +static Uint16 +SDL_SYS_ToButton(Uint16 button) +{ + Uint16 ff_button; + + ff_button = 0; + + /* + * Not sure what the proper syntax is because this actually isn't implemented + * in the current kernel from what I've seen (2.6.26). + */ + if (button != 0) { + ff_button = BTN_GAMEPAD + button - 1; + } + + return ff_button; +} + + +/* + * Returns the ff_effect usable direction from a SDL_HapticDirection. + */ +static Uint16 +SDL_SYS_ToDirection(SDL_HapticDirection * dir) +{ + Uint32 tmp; + float f; /* Ideally we'd use fixed point math instead of floats... */ + + switch (dir->type) { + case SDL_HAPTIC_POLAR: + /* Linux directions start from south. + (and range from 0 to 0xFFFF) + Quoting include/linux/input.h, line 926: + Direction of the effect is encoded as follows: + 0 deg -> 0x0000 (down) + 90 deg -> 0x4000 (left) + 180 deg -> 0x8000 (up) + 270 deg -> 0xC000 (right) + */ + tmp = (((18000 + dir->dir[0]) % 36000) * 0xFFFF) / 36000; /* convert to range [0,0xFFFF] */ + return (Uint16) tmp; + + case SDL_HAPTIC_SPHERICAL: + /* + We convert to polar, because that's the only supported direction on Linux. + The first value of a spherical direction is practically the same as a + Polar direction, except that we have to add 90 degrees. It is the angle + from EAST {1,0} towards SOUTH {0,1}. + --> add 9000 + --> finally add 18000 and convert to [0,0xFFFF] as in case SDL_HAPTIC_POLAR. + */ + tmp = ((dir->dir[0]) + 9000) % 36000; /* Convert to polars */ + tmp = (((18000 + tmp) % 36000) * 0xFFFF) / 36000; /* convert to range [0,0xFFFF] */ + return (Uint16) tmp; + + case SDL_HAPTIC_CARTESIAN: + f = atan2(dir->dir[1], dir->dir[0]); + /* + atan2 takes the parameters: Y-axis-value and X-axis-value (in that order) + - Y-axis-value is the second coordinate (from center to SOUTH) + - X-axis-value is the first coordinate (from center to EAST) + We add 36000, because atan2 also returns negative values. Then we practically + have the first spherical value. Therefore we proceed as in case + SDL_HAPTIC_SPHERICAL and add another 9000 to get the polar value. + --> add 45000 in total + --> finally add 18000 and convert to [0,0xFFFF] as in case SDL_HAPTIC_POLAR. + */ + tmp = (((int) (f * 18000. / M_PI)) + 45000) % 36000; + tmp = (((18000 + tmp) % 36000) * 0xFFFF) / 36000; /* convert to range [0,0xFFFF] */ + return (Uint16) tmp; + + default: + return (Uint16) SDL_SetError("Haptic: Unsupported direction type."); + } + + return 0; +} + + +#define CLAMP(x) (((x) > 32767) ? 32767 : x) +/* + * Initializes the Linux effect struct from a haptic_effect. + * Values above 32767 (for unsigned) are unspecified so we must clamp. + */ +static int +SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) +{ + Uint32 tmp; + SDL_HapticConstant *constant; + SDL_HapticPeriodic *periodic; + SDL_HapticCondition *condition; + SDL_HapticRamp *ramp; + SDL_HapticLeftRight *leftright; + + /* Clear up */ + SDL_memset(dest, 0, sizeof(struct ff_effect)); + + switch (src->type) { + case SDL_HAPTIC_CONSTANT: + constant = &src->constant; + + /* Header */ + dest->type = FF_CONSTANT; + dest->direction = SDL_SYS_ToDirection(&constant->direction); + if (dest->direction == (Uint16) - 1) + return -1; + + /* Replay */ + dest->replay.length = (constant->length == SDL_HAPTIC_INFINITY) ? + 0 : CLAMP(constant->length); + dest->replay.delay = CLAMP(constant->delay); + + /* Trigger */ + dest->trigger.button = SDL_SYS_ToButton(constant->button); + dest->trigger.interval = CLAMP(constant->interval); + + /* Constant */ + dest->u.constant.level = constant->level; + + /* Envelope */ + dest->u.constant.envelope.attack_length = + CLAMP(constant->attack_length); + dest->u.constant.envelope.attack_level = + CLAMP(constant->attack_level); + dest->u.constant.envelope.fade_length = CLAMP(constant->fade_length); + dest->u.constant.envelope.fade_level = CLAMP(constant->fade_level); + + break; + + case SDL_HAPTIC_SINE: + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*case SDL_HAPTIC_SQUARE:*/ + case SDL_HAPTIC_TRIANGLE: + case SDL_HAPTIC_SAWTOOTHUP: + case SDL_HAPTIC_SAWTOOTHDOWN: + periodic = &src->periodic; + + /* Header */ + dest->type = FF_PERIODIC; + dest->direction = SDL_SYS_ToDirection(&periodic->direction); + if (dest->direction == (Uint16) - 1) + return -1; + + /* Replay */ + dest->replay.length = (periodic->length == SDL_HAPTIC_INFINITY) ? + 0 : CLAMP(periodic->length); + dest->replay.delay = CLAMP(periodic->delay); + + /* Trigger */ + dest->trigger.button = SDL_SYS_ToButton(periodic->button); + dest->trigger.interval = CLAMP(periodic->interval); + + /* Periodic */ + if (periodic->type == SDL_HAPTIC_SINE) + dest->u.periodic.waveform = FF_SINE; + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*else if (periodic->type == SDL_HAPTIC_SQUARE) + dest->u.periodic.waveform = FF_SQUARE;*/ + else if (periodic->type == SDL_HAPTIC_TRIANGLE) + dest->u.periodic.waveform = FF_TRIANGLE; + else if (periodic->type == SDL_HAPTIC_SAWTOOTHUP) + dest->u.periodic.waveform = FF_SAW_UP; + else if (periodic->type == SDL_HAPTIC_SAWTOOTHDOWN) + dest->u.periodic.waveform = FF_SAW_DOWN; + dest->u.periodic.period = CLAMP(periodic->period); + dest->u.periodic.magnitude = periodic->magnitude; + dest->u.periodic.offset = periodic->offset; + /* Phase is calculated based of offset from period and then clamped. */ + tmp = ((periodic->phase % 36000) * dest->u.periodic.period) / 36000; + dest->u.periodic.phase = CLAMP(tmp); + + /* Envelope */ + dest->u.periodic.envelope.attack_length = + CLAMP(periodic->attack_length); + dest->u.periodic.envelope.attack_level = + CLAMP(periodic->attack_level); + dest->u.periodic.envelope.fade_length = CLAMP(periodic->fade_length); + dest->u.periodic.envelope.fade_level = CLAMP(periodic->fade_level); + + break; + + case SDL_HAPTIC_SPRING: + case SDL_HAPTIC_DAMPER: + case SDL_HAPTIC_INERTIA: + case SDL_HAPTIC_FRICTION: + condition = &src->condition; + + /* Header */ + if (condition->type == SDL_HAPTIC_SPRING) + dest->type = FF_SPRING; + else if (condition->type == SDL_HAPTIC_DAMPER) + dest->type = FF_DAMPER; + else if (condition->type == SDL_HAPTIC_INERTIA) + dest->type = FF_INERTIA; + else if (condition->type == SDL_HAPTIC_FRICTION) + dest->type = FF_FRICTION; + dest->direction = 0; /* Handled by the condition-specifics. */ + + /* Replay */ + dest->replay.length = (condition->length == SDL_HAPTIC_INFINITY) ? + 0 : CLAMP(condition->length); + dest->replay.delay = CLAMP(condition->delay); + + /* Trigger */ + dest->trigger.button = SDL_SYS_ToButton(condition->button); + dest->trigger.interval = CLAMP(condition->interval); + + /* Condition */ + /* X axis */ + dest->u.condition[0].right_saturation = + CLAMP(condition->right_sat[0]); + dest->u.condition[0].left_saturation = CLAMP(condition->left_sat[0]); + dest->u.condition[0].right_coeff = condition->right_coeff[0]; + dest->u.condition[0].left_coeff = condition->left_coeff[0]; + dest->u.condition[0].deadband = CLAMP(condition->deadband[0]); + dest->u.condition[0].center = condition->center[0]; + /* Y axis */ + dest->u.condition[1].right_saturation = + CLAMP(condition->right_sat[1]); + dest->u.condition[1].left_saturation = CLAMP(condition->left_sat[1]); + dest->u.condition[1].right_coeff = condition->right_coeff[1]; + dest->u.condition[1].left_coeff = condition->left_coeff[1]; + dest->u.condition[1].deadband = CLAMP(condition->deadband[1]); + dest->u.condition[1].center = condition->center[1]; + + /* + * There is no envelope in the linux force feedback api for conditions. + */ + + break; + + case SDL_HAPTIC_RAMP: + ramp = &src->ramp; + + /* Header */ + dest->type = FF_RAMP; + dest->direction = SDL_SYS_ToDirection(&ramp->direction); + if (dest->direction == (Uint16) - 1) + return -1; + + /* Replay */ + dest->replay.length = (ramp->length == SDL_HAPTIC_INFINITY) ? + 0 : CLAMP(ramp->length); + dest->replay.delay = CLAMP(ramp->delay); + + /* Trigger */ + dest->trigger.button = SDL_SYS_ToButton(ramp->button); + dest->trigger.interval = CLAMP(ramp->interval); + + /* Ramp */ + dest->u.ramp.start_level = ramp->start; + dest->u.ramp.end_level = ramp->end; + + /* Envelope */ + dest->u.ramp.envelope.attack_length = CLAMP(ramp->attack_length); + dest->u.ramp.envelope.attack_level = CLAMP(ramp->attack_level); + dest->u.ramp.envelope.fade_length = CLAMP(ramp->fade_length); + dest->u.ramp.envelope.fade_level = CLAMP(ramp->fade_level); + + break; + + case SDL_HAPTIC_LEFTRIGHT: + leftright = &src->leftright; + + /* Header */ + dest->type = FF_RUMBLE; + dest->direction = 0; + + /* Replay */ + dest->replay.length = (leftright->length == SDL_HAPTIC_INFINITY) ? + 0 : CLAMP(leftright->length); + + /* Trigger */ + dest->trigger.button = 0; + dest->trigger.interval = 0; + + /* Rumble */ + dest->u.rumble.strong_magnitude = leftright->large_magnitude; + dest->u.rumble.weak_magnitude = leftright->small_magnitude; + + break; + + + default: + return SDL_SetError("Haptic: Unknown effect type."); + } + + return 0; +} + + +/* + * Creates a new haptic effect. + */ +int +SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, + SDL_HapticEffect * base) +{ + struct ff_effect *linux_effect; + + /* Allocate the hardware effect */ + effect->hweffect = (struct haptic_hweffect *) + SDL_malloc(sizeof(struct haptic_hweffect)); + if (effect->hweffect == NULL) { + return SDL_OutOfMemory(); + } + + /* Prepare the ff_effect */ + linux_effect = &effect->hweffect->effect; + if (SDL_SYS_ToFFEffect(linux_effect, base) != 0) { + goto new_effect_err; + } + linux_effect->id = -1; /* Have the kernel give it an id */ + + /* Upload the effect */ + if (ioctl(haptic->hwdata->fd, EVIOCSFF, linux_effect) < 0) { + SDL_SetError("Haptic: Error uploading effect to the device: %s", + strerror(errno)); + goto new_effect_err; + } + + return 0; + + new_effect_err: + free(effect->hweffect); + effect->hweffect = NULL; + return -1; +} + + +/* + * Updates an effect. + * + * Note: Dynamically updating the direction can in some cases force + * the effect to restart and run once. + */ +int +SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, + SDL_HapticEffect * data) +{ + struct ff_effect linux_effect; + + /* Create the new effect */ + if (SDL_SYS_ToFFEffect(&linux_effect, data) != 0) { + return -1; + } + linux_effect.id = effect->hweffect->effect.id; + + /* See if it can be uploaded. */ + if (ioctl(haptic->hwdata->fd, EVIOCSFF, &linux_effect) < 0) { + return SDL_SetError("Haptic: Error updating the effect: %s", + strerror(errno)); + } + + /* Copy the new effect into memory. */ + SDL_memcpy(&effect->hweffect->effect, &linux_effect, + sizeof(struct ff_effect)); + + return effect->hweffect->effect.id; +} + + +/* + * Runs an effect. + */ +int +SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, + Uint32 iterations) +{ + struct input_event run; + + /* Prepare to run the effect */ + run.type = EV_FF; + run.code = effect->hweffect->effect.id; + /* We don't actually have infinity here, so we just do INT_MAX which is pretty damn close. */ + run.value = (iterations > INT_MAX) ? INT_MAX : iterations; + + if (write(haptic->hwdata->fd, (const void *) &run, sizeof(run)) < 0) { + return SDL_SetError("Haptic: Unable to run the effect: %s", strerror(errno)); + } + + return 0; +} + + +/* + * Stops an effect. + */ +int +SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + struct input_event stop; + + stop.type = EV_FF; + stop.code = effect->hweffect->effect.id; + stop.value = 0; + + if (write(haptic->hwdata->fd, (const void *) &stop, sizeof(stop)) < 0) { + return SDL_SetError("Haptic: Unable to stop the effect: %s", + strerror(errno)); + } + + return 0; +} + + +/* + * Frees the effect. + */ +void +SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + if (ioctl(haptic->hwdata->fd, EVIOCRMFF, effect->hweffect->effect.id) < 0) { + SDL_SetError("Haptic: Error removing the effect from the device: %s", + strerror(errno)); + } + SDL_free(effect->hweffect); + effect->hweffect = NULL; +} + + +/* + * Gets the status of a haptic effect. + */ +int +SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, + struct haptic_effect *effect) +{ +#if 0 /* Not supported atm. */ + struct input_event ie; + + ie.type = EV_FF; + ie.type = EV_FF_STATUS; + ie.code = effect->hweffect->effect.id; + + if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) { + return SDL_SetError("Haptic: Error getting device status."); + } + + return 0; +#endif + + return -1; +} + + +/* + * Sets the gain. + */ +int +SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +{ + struct input_event ie; + + ie.type = EV_FF; + ie.code = FF_GAIN; + ie.value = (0xFFFFUL * gain) / 100; + + if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) { + return SDL_SetError("Haptic: Error setting gain: %s", strerror(errno)); + } + + return 0; +} + + +/* + * Sets the autocentering. + */ +int +SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +{ + struct input_event ie; + + ie.type = EV_FF; + ie.code = FF_AUTOCENTER; + ie.value = (0xFFFFUL * autocenter) / 100; + + if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) { + return SDL_SetError("Haptic: Error setting autocenter: %s", strerror(errno)); + } + + return 0; +} + + +/* + * Pausing is not supported atm by linux. + */ +int +SDL_SYS_HapticPause(SDL_Haptic * haptic) +{ + return -1; +} + + +/* + * Unpausing is not supported atm by linux. + */ +int +SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +{ + return -1; +} + + +/* + * Stops all the currently playing effects. + */ +int +SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +{ + int i, ret; + + /* Linux does not support this natively so we have to loop. */ + for (i = 0; i < haptic->neffects; i++) { + if (haptic->effects[i].hweffect != NULL) { + ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]); + if (ret < 0) { + return SDL_SetError + ("Haptic: Error while trying to stop all playing effects."); + } + } + } + return 0; +} + + +#endif /* SDL_HAPTIC_LINUX */ diff --git a/src/haptic/windows/SDL_syshaptic.c b/src/haptic/windows/SDL_syshaptic.c new file mode 100644 index 0000000000..9b13496442 --- /dev/null +++ b/src/haptic/windows/SDL_syshaptic.c @@ -0,0 +1,1581 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef SDL_HAPTIC_DINPUT + +#include "SDL_assert.h" +#include "SDL_thread.h" +#include "SDL_mutex.h" +#include "SDL_timer.h" +#include "SDL_hints.h" +#include "SDL_haptic.h" +#include "../SDL_syshaptic.h" +#include "SDL_joystick.h" +#include "../../joystick/SDL_sysjoystick.h" /* For the real SDL_Joystick */ +#include "../../joystick/windows/SDL_dxjoystick_c.h" /* For joystick hwdata */ + +#define MAX_HAPTICS 32 + +/* + * List of available haptic devices. + */ +static struct +{ + DIDEVICEINSTANCE instance; + char *name; + SDL_Haptic *haptic; + DIDEVCAPS capabilities; + Uint8 bXInputHaptic; /* Supports force feedback via XInput. */ + Uint8 userid; /* XInput userid index for this joystick */ +} SDL_hapticlist[MAX_HAPTICS]; + + +/* + * Haptic system hardware data. + */ +struct haptic_hwdata +{ + LPDIRECTINPUTDEVICE8 device; + DWORD axes[3]; /* Axes to use. */ + SDL_bool is_joystick; /* Device is loaded as joystick. */ + Uint8 bXInputHaptic; /* Supports force feedback via XInput. */ + Uint8 userid; /* XInput userid index for this joystick */ + SDL_Thread *thread; + SDL_mutex *mutex; + volatile Uint32 stopTicks; + volatile int stopThread; +}; + + +/* + * Haptic system effect data. + */ +struct haptic_hweffect +{ + DIEFFECT effect; + LPDIRECTINPUTEFFECT ref; + XINPUT_VIBRATION vibration; +}; + + +/* + * Internal stuff. + */ +static SDL_bool coinitialized = SDL_FALSE; +static LPDIRECTINPUT8 dinput = NULL; +static SDL_bool loaded_xinput = SDL_FALSE; + + +/* + * External stuff. + */ +extern HWND SDL_HelperWindow; + + +/* + * Prototypes. + */ +static int DI_SetError(const char *str, HRESULT err); +static int DI_GUIDIsSame(const GUID * a, const GUID * b); +static int SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, + DIDEVICEINSTANCE instance); +static int SDL_SYS_HapticOpenFromDevice8(SDL_Haptic * haptic, + LPDIRECTINPUTDEVICE8 device8, + SDL_bool is_joystick); +static int SDL_SYS_HapticOpenFromXInput(SDL_Haptic * haptic, Uint8 userid); +static DWORD DIGetTriggerButton(Uint16 button); +static int SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, + int naxes); +static int SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, + SDL_HapticEffect * src); +static void SDL_SYS_HapticFreeDIEFFECT(DIEFFECT * effect, int type); +static REFGUID SDL_SYS_HapticEffectType(SDL_HapticEffect * effect); +static int SDLCALL SDL_RunXInputHaptic(void *arg); + +/* Callbacks. */ +static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE * + pdidInstance, VOID * pContext); +static BOOL CALLBACK DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv); + + +/* + * Like SDL_SetError but for DX error codes. + */ +static int +DI_SetError(const char *str, HRESULT err) +{ + /* + SDL_SetError("Haptic: %s - %s: %s", str, + DXGetErrorString8A(err), DXGetErrorDescription8A(err)); + */ + return SDL_SetError("Haptic error %s", str); +} + + +/* + * Checks to see if two GUID are the same. + */ +static int +DI_GUIDIsSame(const GUID * a, const GUID * b) +{ + return (SDL_memcmp(a, b, sizeof (GUID)) == 0); +} + + +/* + * Initializes the haptic subsystem. + */ +int +SDL_SYS_HapticInit(void) +{ + const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED); + HRESULT ret; + HINSTANCE instance; + + if (dinput != NULL) { /* Already open. */ + return SDL_SetError("Haptic: SubSystem already open."); + } + + /* Clear all the memory. */ + SDL_memset(SDL_hapticlist, 0, sizeof(SDL_hapticlist)); + + SDL_numhaptics = 0; + + ret = WIN_CoInitialize(); + if (FAILED(ret)) { + return DI_SetError("Coinitialize", ret); + } + + coinitialized = SDL_TRUE; + + ret = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectInput8, (LPVOID) & dinput); + if (FAILED(ret)) { + SDL_SYS_HapticQuit(); + return DI_SetError("CoCreateInstance", ret); + } + + /* Because we used CoCreateInstance, we need to Initialize it, first. */ + instance = GetModuleHandle(NULL); + if (instance == NULL) { + SDL_SYS_HapticQuit(); + return SDL_SetError("GetModuleHandle() failed with error code %d.", + GetLastError()); + } + ret = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION); + if (FAILED(ret)) { + SDL_SYS_HapticQuit(); + return DI_SetError("Initializing DirectInput device", ret); + } + + /* Look for haptic devices. */ + ret = IDirectInput8_EnumDevices(dinput, + 0, + EnumHapticsCallback, + NULL, + DIEDFL_FORCEFEEDBACK | + DIEDFL_ATTACHEDONLY); + if (FAILED(ret)) { + SDL_SYS_HapticQuit(); + return DI_SetError("Enumerating DirectInput devices", ret); + } + + if (!env || SDL_atoi(env)) { + loaded_xinput = (WIN_LoadXInputDLL() == 0); + } + + if (loaded_xinput) { + DWORD i; + const SDL_bool bIs14OrLater = (SDL_XInputVersion >= ((1<<16)|4)); + + for (i = 0; (i < SDL_XINPUT_MAX_DEVICES) && (SDL_numhaptics < MAX_HAPTICS); i++) { + XINPUT_CAPABILITIES caps; + if (XINPUTGETCAPABILITIES(i, XINPUT_FLAG_GAMEPAD, &caps) == ERROR_SUCCESS) { + if ((!bIs14OrLater) || (caps.Flags & XINPUT_CAPS_FFB_SUPPORTED)) { + /* !!! FIXME: I'm not bothering to query for a real name right now. */ + char buf[64]; + SDL_snprintf(buf, sizeof (buf), "XInput Controller #%u", i+1); + SDL_hapticlist[SDL_numhaptics].name = SDL_strdup(buf); + SDL_hapticlist[SDL_numhaptics].bXInputHaptic = 1; + SDL_hapticlist[SDL_numhaptics].userid = (Uint8) i; + SDL_numhaptics++; + } + } + } + } + + return SDL_numhaptics; +} + +/* + * Callback to find the haptic devices. + */ +static BOOL CALLBACK +EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) +{ + HRESULT ret; + LPDIRECTINPUTDEVICE8 device; + + /* Copy the instance over, useful for creating devices. */ + SDL_memcpy(&SDL_hapticlist[SDL_numhaptics].instance, pdidInstance, + sizeof(DIDEVICEINSTANCE)); + + /* Open the device */ + ret = IDirectInput8_CreateDevice(dinput, &pdidInstance->guidInstance, + &device, NULL); + if (FAILED(ret)) { + /* DI_SetError("Creating DirectInput device",ret); */ + return DIENUM_CONTINUE; + } + + /* Get capabilities. */ + SDL_hapticlist[SDL_numhaptics].capabilities.dwSize = sizeof(DIDEVCAPS); + ret = IDirectInputDevice8_GetCapabilities(device, + &SDL_hapticlist[SDL_numhaptics]. + capabilities); + if (FAILED(ret)) { + /* DI_SetError("Getting device capabilities",ret); */ + IDirectInputDevice8_Release(device); + return DIENUM_CONTINUE; + } + + /* Copy the name */ + SDL_hapticlist[SDL_numhaptics].name = WIN_StringToUTF8(SDL_hapticlist[SDL_numhaptics].instance.tszProductName); + + /* Close up device and count it. */ + IDirectInputDevice8_Release(device); + SDL_numhaptics++; + + /* Watch out for hard limit. */ + if (SDL_numhaptics >= MAX_HAPTICS) + return DIENUM_STOP; + + return DIENUM_CONTINUE; +} + + +/* + * Return the name of a haptic device, does not need to be opened. + */ +const char * +SDL_SYS_HapticName(int index) +{ + return SDL_hapticlist[index].name; +} + + +/* + * Callback to get all supported effects. + */ +#define EFFECT_TEST(e,s) \ +if (DI_GUIDIsSame(&pei->guid, &(e))) \ + haptic->supported |= (s) +static BOOL CALLBACK +DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv) +{ + /* Prepare the haptic device. */ + SDL_Haptic *haptic = (SDL_Haptic *) pv; + + /* Get supported. */ + EFFECT_TEST(GUID_Spring, SDL_HAPTIC_SPRING); + EFFECT_TEST(GUID_Damper, SDL_HAPTIC_DAMPER); + EFFECT_TEST(GUID_Inertia, SDL_HAPTIC_INERTIA); + EFFECT_TEST(GUID_Friction, SDL_HAPTIC_FRICTION); + EFFECT_TEST(GUID_ConstantForce, SDL_HAPTIC_CONSTANT); + EFFECT_TEST(GUID_CustomForce, SDL_HAPTIC_CUSTOM); + EFFECT_TEST(GUID_Sine, SDL_HAPTIC_SINE); + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*EFFECT_TEST(GUID_Square, SDL_HAPTIC_SQUARE);*/ + EFFECT_TEST(GUID_Triangle, SDL_HAPTIC_TRIANGLE); + EFFECT_TEST(GUID_SawtoothUp, SDL_HAPTIC_SAWTOOTHUP); + EFFECT_TEST(GUID_SawtoothDown, SDL_HAPTIC_SAWTOOTHDOWN); + EFFECT_TEST(GUID_RampForce, SDL_HAPTIC_RAMP); + + /* Check for more. */ + return DIENUM_CONTINUE; +} + + +/* + * Callback to get supported axes. + */ +static BOOL CALLBACK +DI_DeviceObjectCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) +{ + SDL_Haptic *haptic = (SDL_Haptic *) pvRef; + + if ((dev->dwType & DIDFT_AXIS) && (dev->dwFlags & DIDOI_FFACTUATOR)) { + + haptic->hwdata->axes[haptic->naxes] = dev->dwOfs; + haptic->naxes++; + + /* Currently using the artificial limit of 3 axes. */ + if (haptic->naxes >= 3) { + return DIENUM_STOP; + } + } + + return DIENUM_CONTINUE; +} + + +/* + * Opens the haptic device from the file descriptor. + * + * Steps: + * - Open temporary DirectInputDevice interface. + * - Create DirectInputDevice8 interface. + * - Release DirectInputDevice interface. + * - Call SDL_SYS_HapticOpenFromDevice8 + */ +static int +SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic, DIDEVICEINSTANCE instance) +{ + HRESULT ret; + int ret2; + LPDIRECTINPUTDEVICE8 device; + LPDIRECTINPUTDEVICE8 device8; + + /* Open the device */ + ret = IDirectInput8_CreateDevice(dinput, &instance.guidInstance, + &device, NULL); + if (FAILED(ret)) { + DI_SetError("Creating DirectInput device", ret); + return -1; + } + + /* Now get the IDirectInputDevice8 interface, instead. */ + ret = IDirectInputDevice8_QueryInterface(device, + &IID_IDirectInputDevice8, + (LPVOID *) &device8); + /* Done with the temporary one now. */ + IDirectInputDevice8_Release(device); + if (FAILED(ret)) { + DI_SetError("Querying DirectInput interface", ret); + return -1; + } + + ret2 = SDL_SYS_HapticOpenFromDevice8(haptic, device8, SDL_FALSE); + if (ret2 < 0) { + IDirectInputDevice8_Release(device8); + return -1; + } + + return 0; +} + +static int +SDL_SYS_HapticOpenFromXInput(SDL_Haptic * haptic, Uint8 userid) +{ + char threadName[32]; + XINPUT_VIBRATION vibration = { 0, 0 }; /* stop any current vibration */ + XINPUTSETSTATE(userid, &vibration); + + haptic->supported = SDL_HAPTIC_LEFTRIGHT; + + haptic->neffects = 1; + haptic->nplaying = 1; + + /* Prepare effects memory. */ + haptic->effects = (struct haptic_effect *) + SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); + if (haptic->effects == NULL) { + return SDL_OutOfMemory(); + } + /* Clear the memory */ + SDL_memset(haptic->effects, 0, + sizeof(struct haptic_effect) * haptic->neffects); + + haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata)); + if (haptic->hwdata == NULL) { + SDL_free(haptic->effects); + haptic->effects = NULL; + return SDL_OutOfMemory(); + } + SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata)); + + haptic->hwdata->bXInputHaptic = 1; + haptic->hwdata->userid = userid; + + haptic->hwdata->mutex = SDL_CreateMutex(); + if (haptic->hwdata->mutex == NULL) { + SDL_free(haptic->effects); + SDL_free(haptic->hwdata); + haptic->effects = NULL; + return SDL_SetError("Couldn't create XInput haptic mutex"); + } + + SDL_snprintf(threadName, sizeof (threadName), "SDLXInputDev%d", (int) userid); + +#if defined(__WIN32__) && !defined(HAVE_LIBC) /* !!! FIXME: this is nasty. */ + #undef SDL_CreateThread + haptic->hwdata->thread = SDL_CreateThread(SDL_RunXInputHaptic, threadName, haptic->hwdata, NULL, NULL); +#else + haptic->hwdata->thread = SDL_CreateThread(SDL_RunXInputHaptic, threadName, haptic->hwdata); +#endif + if (haptic->hwdata->thread == NULL) { + SDL_DestroyMutex(haptic->hwdata->mutex); + SDL_free(haptic->effects); + SDL_free(haptic->hwdata); + haptic->effects = NULL; + return SDL_SetError("Couldn't create XInput haptic thread"); + } + + return 0; + } + +/* + * Opens the haptic device from the file descriptor. + * + * Steps: + * - Set cooperative level. + * - Set data format. + * - Acquire exclusiveness. + * - Reset actuators. + * - Get supported features. + */ +static int +SDL_SYS_HapticOpenFromDevice8(SDL_Haptic * haptic, + LPDIRECTINPUTDEVICE8 device8, SDL_bool is_joystick) +{ + HRESULT ret; + DIPROPDWORD dipdw; + + /* Allocate the hwdata */ + haptic->hwdata = (struct haptic_hwdata *)SDL_malloc(sizeof(*haptic->hwdata)); + if (haptic->hwdata == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata)); + + /* We'll use the device8 from now on. */ + haptic->hwdata->device = device8; + haptic->hwdata->is_joystick = is_joystick; + + /* Grab it exclusively to use force feedback stuff. */ + ret = IDirectInputDevice8_SetCooperativeLevel(haptic->hwdata->device, + SDL_HelperWindow, + DISCL_EXCLUSIVE | + DISCL_BACKGROUND); + if (FAILED(ret)) { + DI_SetError("Setting cooperative level to exclusive", ret); + goto acquire_err; + } + + /* Set data format. */ + ret = IDirectInputDevice8_SetDataFormat(haptic->hwdata->device, + &c_dfDIJoystick2); + if (FAILED(ret)) { + DI_SetError("Setting data format", ret); + goto acquire_err; + } + + /* Get number of axes. */ + ret = IDirectInputDevice8_EnumObjects(haptic->hwdata->device, + DI_DeviceObjectCallback, + haptic, DIDFT_AXIS); + if (FAILED(ret)) { + DI_SetError("Getting device axes", ret); + goto acquire_err; + } + + /* Acquire the device. */ + ret = IDirectInputDevice8_Acquire(haptic->hwdata->device); + if (FAILED(ret)) { + DI_SetError("Acquiring DirectInput device", ret); + goto acquire_err; + } + + /* Reset all actuators - just in case. */ + ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, + DISFFC_RESET); + if (FAILED(ret)) { + DI_SetError("Resetting device", ret); + goto acquire_err; + } + + /* Enabling actuators. */ + ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, + DISFFC_SETACTUATORSON); + if (FAILED(ret)) { + DI_SetError("Enabling actuators", ret); + goto acquire_err; + } + + /* Get supported effects. */ + ret = IDirectInputDevice8_EnumEffects(haptic->hwdata->device, + DI_EffectCallback, haptic, + DIEFT_ALL); + if (FAILED(ret)) { + DI_SetError("Enumerating supported effects", ret); + goto acquire_err; + } + if (haptic->supported == 0) { /* Error since device supports nothing. */ + SDL_SetError("Haptic: Internal error on finding supported effects."); + goto acquire_err; + } + + /* Check autogain and autocenter. */ + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = 10000; + ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, + DIPROP_FFGAIN, &dipdw.diph); + if (!FAILED(ret)) { /* Gain is supported. */ + haptic->supported |= SDL_HAPTIC_GAIN; + } + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = DIPROPAUTOCENTER_OFF; + ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, + DIPROP_AUTOCENTER, &dipdw.diph); + if (!FAILED(ret)) { /* Autocenter is supported. */ + haptic->supported |= SDL_HAPTIC_AUTOCENTER; + } + + /* Status is always supported. */ + haptic->supported |= SDL_HAPTIC_STATUS | SDL_HAPTIC_PAUSE; + + /* Check maximum effects. */ + haptic->neffects = 128; /* This is not actually supported as thus under windows, + there is no way to tell the number of EFFECTS that a + device can hold, so we'll just use a "random" number + instead and put warnings in SDL_haptic.h */ + haptic->nplaying = 128; /* Even more impossible to get this then neffects. */ + + /* Prepare effects memory. */ + haptic->effects = (struct haptic_effect *) + SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); + if (haptic->effects == NULL) { + SDL_OutOfMemory(); + goto acquire_err; + } + /* Clear the memory */ + SDL_memset(haptic->effects, 0, + sizeof(struct haptic_effect) * haptic->neffects); + + return 0; + + /* Error handling */ + acquire_err: + IDirectInputDevice8_Unacquire(haptic->hwdata->device); + return -1; + +} + + +/* + * Opens a haptic device for usage. + */ +int +SDL_SYS_HapticOpen(SDL_Haptic * haptic) +{ + if (SDL_hapticlist[haptic->index].bXInputHaptic) { + return SDL_SYS_HapticOpenFromXInput(haptic, SDL_hapticlist[haptic->index].userid); + } + + return SDL_SYS_HapticOpenFromInstance(haptic, SDL_hapticlist[haptic->index].instance); +} + + +/* + * Opens a haptic device from first mouse it finds for usage. + */ +int +SDL_SYS_HapticMouse(void) +{ + int i; + + /* Grab the first mouse haptic device we find. */ + for (i = 0; i < SDL_numhaptics; i++) { + if (SDL_hapticlist[i].capabilities.dwDevType == DI8DEVCLASS_POINTER ) { + return i; + } + } + + return -1; +} + + +/* + * Checks to see if a joystick has haptic features. + */ +int +SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +{ + const struct joystick_hwdata *hwdata = joystick->hwdata; + return ( (hwdata->bXInputHaptic) || + ((hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) != 0) ); +} + + +/* + * Checks to see if the haptic device and joystick and in reality the same. + */ +int +SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + if ((joystick->hwdata->bXInputHaptic == haptic->hwdata->bXInputHaptic) && (haptic->hwdata->userid == joystick->hwdata->userid)) { + return 1; + } else { + HRESULT ret; + DIDEVICEINSTANCE hap_instance, joy_instance; + + hap_instance.dwSize = sizeof(DIDEVICEINSTANCE); + joy_instance.dwSize = sizeof(DIDEVICEINSTANCE); + + /* Get the device instances. */ + ret = IDirectInputDevice8_GetDeviceInfo(haptic->hwdata->device, + &hap_instance); + if (FAILED(ret)) { + return 0; + } + ret = IDirectInputDevice8_GetDeviceInfo(joystick->hwdata->InputDevice, + &joy_instance); + if (FAILED(ret)) { + return 0; + } + + if (DI_GUIDIsSame(&hap_instance.guidInstance, &joy_instance.guidInstance)) + return 1; + } + + return 0; +} + + +/* + * Opens a SDL_Haptic from a SDL_Joystick. + */ +int +SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +{ + int i; + HRESULT idret; + DIDEVICEINSTANCE joy_instance; + joy_instance.dwSize = sizeof(DIDEVICEINSTANCE); + + /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */ + if (joystick->hwdata->bXInputDevice) { + const Uint8 userid = joystick->hwdata->userid; + for (i=0; ihwdata->bXInputHaptic); + haptic->index = i; + return SDL_SYS_HapticOpenFromXInput(haptic, SDL_hapticlist[haptic->index].userid); + } + } + } else { + for (i=0; ihwdata->InputDevice, &joy_instance); + if (FAILED(idret)) { + return -1; + } + if (DI_GUIDIsSame(&SDL_hapticlist[i].instance.guidInstance, + &joy_instance.guidInstance)) { + haptic->index = i; + return SDL_SYS_HapticOpenFromDevice8(haptic, joystick->hwdata->InputDevice, SDL_TRUE); + } + } + } + /* No match to our haptic list */ + return -1; +} + + +/* + * Closes the haptic device. + */ +void +SDL_SYS_HapticClose(SDL_Haptic * haptic) +{ + if (haptic->hwdata) { + + /* Free effects. */ + SDL_free(haptic->effects); + haptic->effects = NULL; + haptic->neffects = 0; + + /* Clean up */ + if (haptic->hwdata->bXInputHaptic) { + haptic->hwdata->stopThread = 1; + SDL_WaitThread(haptic->hwdata->thread, NULL); + SDL_DestroyMutex(haptic->hwdata->mutex); + } else { + IDirectInputDevice8_Unacquire(haptic->hwdata->device); + /* Only release if isn't grabbed by a joystick. */ + if (haptic->hwdata->is_joystick == 0) { + IDirectInputDevice8_Release(haptic->hwdata->device); + } + } + + /* Free */ + SDL_free(haptic->hwdata); + haptic->hwdata = NULL; + } +} + + +/* + * Clean up after system specific haptic stuff + */ +void +SDL_SYS_HapticQuit(void) +{ + int i; + + if (loaded_xinput) { + WIN_UnloadXInputDLL(); + loaded_xinput = SDL_FALSE; + } + + for (i = 0; i < SDL_arraysize(SDL_hapticlist); ++i) { + if (SDL_hapticlist[i].name) { + SDL_free(SDL_hapticlist[i].name); + SDL_hapticlist[i].name = NULL; + } + } + + if (dinput != NULL) { + IDirectInput8_Release(dinput); + dinput = NULL; + } + + if (coinitialized) { + WIN_CoUninitialize(); + coinitialized = SDL_FALSE; + } +} + + +/* + * Converts an SDL trigger button to an DIEFFECT trigger button. + */ +static DWORD +DIGetTriggerButton(Uint16 button) +{ + DWORD dwTriggerButton; + + dwTriggerButton = DIEB_NOTRIGGER; + + if (button != 0) { + dwTriggerButton = DIJOFS_BUTTON(button - 1); + } + + return dwTriggerButton; +} + + +/* + * Sets the direction. + */ +static int +SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, int naxes) +{ + LONG *rglDir; + + /* Handle no axes a part. */ + if (naxes == 0) { + effect->dwFlags |= DIEFF_SPHERICAL; /* Set as default. */ + effect->rglDirection = NULL; + return 0; + } + + /* Has axes. */ + rglDir = SDL_malloc(sizeof(LONG) * naxes); + if (rglDir == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(rglDir, 0, sizeof(LONG) * naxes); + effect->rglDirection = rglDir; + + switch (dir->type) { + case SDL_HAPTIC_POLAR: + effect->dwFlags |= DIEFF_POLAR; + rglDir[0] = dir->dir[0]; + return 0; + case SDL_HAPTIC_CARTESIAN: + effect->dwFlags |= DIEFF_CARTESIAN; + rglDir[0] = dir->dir[0]; + if (naxes > 1) + rglDir[1] = dir->dir[1]; + if (naxes > 2) + rglDir[2] = dir->dir[2]; + return 0; + case SDL_HAPTIC_SPHERICAL: + effect->dwFlags |= DIEFF_SPHERICAL; + rglDir[0] = dir->dir[0]; + if (naxes > 1) + rglDir[1] = dir->dir[1]; + if (naxes > 2) + rglDir[2] = dir->dir[2]; + return 0; + + default: + return SDL_SetError("Haptic: Unknown direction type."); + } +} + +#define CONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF) +/* + * Creates the DIEFFECT from a SDL_HapticEffect. + */ +static int +SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, + SDL_HapticEffect * src) +{ + int i; + DICONSTANTFORCE *constant; + DIPERIODIC *periodic; + DICONDITION *condition; /* Actually an array of conditions - one per axis. */ + DIRAMPFORCE *ramp; + DICUSTOMFORCE *custom; + DIENVELOPE *envelope; + SDL_HapticConstant *hap_constant; + SDL_HapticPeriodic *hap_periodic; + SDL_HapticCondition *hap_condition; + SDL_HapticRamp *hap_ramp; + SDL_HapticCustom *hap_custom; + DWORD *axes; + + /* Set global stuff. */ + SDL_memset(dest, 0, sizeof(DIEFFECT)); + dest->dwSize = sizeof(DIEFFECT); /* Set the structure size. */ + dest->dwSamplePeriod = 0; /* Not used by us. */ + dest->dwGain = 10000; /* Gain is set globally, not locally. */ + dest->dwFlags = DIEFF_OBJECTOFFSETS; /* Seems obligatory. */ + + /* Envelope. */ + envelope = SDL_malloc(sizeof(DIENVELOPE)); + if (envelope == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(envelope, 0, sizeof(DIENVELOPE)); + dest->lpEnvelope = envelope; + envelope->dwSize = sizeof(DIENVELOPE); /* Always should be this. */ + + /* Axes. */ + dest->cAxes = haptic->naxes; + if (dest->cAxes > 0) { + axes = SDL_malloc(sizeof(DWORD) * dest->cAxes); + if (axes == NULL) { + return SDL_OutOfMemory(); + } + axes[0] = haptic->hwdata->axes[0]; /* Always at least one axis. */ + if (dest->cAxes > 1) { + axes[1] = haptic->hwdata->axes[1]; + } + if (dest->cAxes > 2) { + axes[2] = haptic->hwdata->axes[2]; + } + dest->rgdwAxes = axes; + } + + + /* The big type handling switch, even bigger then Linux's version. */ + switch (src->type) { + case SDL_HAPTIC_CONSTANT: + hap_constant = &src->constant; + constant = SDL_malloc(sizeof(DICONSTANTFORCE)); + if (constant == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(constant, 0, sizeof(DICONSTANTFORCE)); + + /* Specifics */ + constant->lMagnitude = CONVERT(hap_constant->level); + dest->cbTypeSpecificParams = sizeof(DICONSTANTFORCE); + dest->lpvTypeSpecificParams = constant; + + /* Generics */ + dest->dwDuration = hap_constant->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = DIGetTriggerButton(hap_constant->button); + dest->dwTriggerRepeatInterval = hap_constant->interval; + dest->dwStartDelay = hap_constant->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_constant->direction, dest->cAxes) + < 0) { + return -1; + } + + /* Envelope */ + if ((hap_constant->attack_length == 0) + && (hap_constant->fade_length == 0)) { + SDL_free(dest->lpEnvelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CONVERT(hap_constant->attack_level); + envelope->dwAttackTime = hap_constant->attack_length * 1000; + envelope->dwFadeLevel = CONVERT(hap_constant->fade_level); + envelope->dwFadeTime = hap_constant->fade_length * 1000; + } + + break; + + case SDL_HAPTIC_SINE: + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*case SDL_HAPTIC_SQUARE:*/ + case SDL_HAPTIC_TRIANGLE: + case SDL_HAPTIC_SAWTOOTHUP: + case SDL_HAPTIC_SAWTOOTHDOWN: + hap_periodic = &src->periodic; + periodic = SDL_malloc(sizeof(DIPERIODIC)); + if (periodic == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(periodic, 0, sizeof(DIPERIODIC)); + + /* Specifics */ + periodic->dwMagnitude = CONVERT(hap_periodic->magnitude); + periodic->lOffset = CONVERT(hap_periodic->offset); + periodic->dwPhase = hap_periodic->phase; + periodic->dwPeriod = hap_periodic->period * 1000; + dest->cbTypeSpecificParams = sizeof(DIPERIODIC); + dest->lpvTypeSpecificParams = periodic; + + /* Generics */ + dest->dwDuration = hap_periodic->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = DIGetTriggerButton(hap_periodic->button); + dest->dwTriggerRepeatInterval = hap_periodic->interval; + dest->dwStartDelay = hap_periodic->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes) + < 0) { + return -1; + } + + /* Envelope */ + if ((hap_periodic->attack_length == 0) + && (hap_periodic->fade_length == 0)) { + SDL_free(dest->lpEnvelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CONVERT(hap_periodic->attack_level); + envelope->dwAttackTime = hap_periodic->attack_length * 1000; + envelope->dwFadeLevel = CONVERT(hap_periodic->fade_level); + envelope->dwFadeTime = hap_periodic->fade_length * 1000; + } + + break; + + case SDL_HAPTIC_SPRING: + case SDL_HAPTIC_DAMPER: + case SDL_HAPTIC_INERTIA: + case SDL_HAPTIC_FRICTION: + hap_condition = &src->condition; + condition = SDL_malloc(sizeof(DICONDITION) * dest->cAxes); + if (condition == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(condition, 0, sizeof(DICONDITION)); + + /* Specifics */ + for (i = 0; i < (int) dest->cAxes; i++) { + condition[i].lOffset = CONVERT(hap_condition->center[i]); + condition[i].lPositiveCoefficient = + CONVERT(hap_condition->right_coeff[i]); + condition[i].lNegativeCoefficient = + CONVERT(hap_condition->left_coeff[i]); + condition[i].dwPositiveSaturation = + CONVERT(hap_condition->right_sat[i]); + condition[i].dwNegativeSaturation = + CONVERT(hap_condition->left_sat[i]); + condition[i].lDeadBand = CONVERT(hap_condition->deadband[i]); + } + dest->cbTypeSpecificParams = sizeof(DICONDITION) * dest->cAxes; + dest->lpvTypeSpecificParams = condition; + + /* Generics */ + dest->dwDuration = hap_condition->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = DIGetTriggerButton(hap_condition->button); + dest->dwTriggerRepeatInterval = hap_condition->interval; + dest->dwStartDelay = hap_condition->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes) + < 0) { + return -1; + } + + /* Envelope - Not actually supported by most CONDITION implementations. */ + SDL_free(dest->lpEnvelope); + dest->lpEnvelope = NULL; + + break; + + case SDL_HAPTIC_RAMP: + hap_ramp = &src->ramp; + ramp = SDL_malloc(sizeof(DIRAMPFORCE)); + if (ramp == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(ramp, 0, sizeof(DIRAMPFORCE)); + + /* Specifics */ + ramp->lStart = CONVERT(hap_ramp->start); + ramp->lEnd = CONVERT(hap_ramp->end); + dest->cbTypeSpecificParams = sizeof(DIRAMPFORCE); + dest->lpvTypeSpecificParams = ramp; + + /* Generics */ + dest->dwDuration = hap_ramp->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = DIGetTriggerButton(hap_ramp->button); + dest->dwTriggerRepeatInterval = hap_ramp->interval; + dest->dwStartDelay = hap_ramp->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_ramp->direction, dest->cAxes) < 0) { + return -1; + } + + /* Envelope */ + if ((hap_ramp->attack_length == 0) && (hap_ramp->fade_length == 0)) { + SDL_free(dest->lpEnvelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CONVERT(hap_ramp->attack_level); + envelope->dwAttackTime = hap_ramp->attack_length * 1000; + envelope->dwFadeLevel = CONVERT(hap_ramp->fade_level); + envelope->dwFadeTime = hap_ramp->fade_length * 1000; + } + + break; + + case SDL_HAPTIC_CUSTOM: + hap_custom = &src->custom; + custom = SDL_malloc(sizeof(DICUSTOMFORCE)); + if (custom == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(custom, 0, sizeof(DICUSTOMFORCE)); + + /* Specifics */ + custom->cChannels = hap_custom->channels; + custom->dwSamplePeriod = hap_custom->period * 1000; + custom->cSamples = hap_custom->samples; + custom->rglForceData = + SDL_malloc(sizeof(LONG) * custom->cSamples * custom->cChannels); + for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) { /* Copy data. */ + custom->rglForceData[i] = CONVERT(hap_custom->data[i]); + } + dest->cbTypeSpecificParams = sizeof(DICUSTOMFORCE); + dest->lpvTypeSpecificParams = custom; + + /* Generics */ + dest->dwDuration = hap_custom->length * 1000; /* In microseconds. */ + dest->dwTriggerButton = DIGetTriggerButton(hap_custom->button); + dest->dwTriggerRepeatInterval = hap_custom->interval; + dest->dwStartDelay = hap_custom->delay * 1000; /* In microseconds. */ + + /* Direction. */ + if (SDL_SYS_SetDirection(dest, &hap_custom->direction, dest->cAxes) < + 0) { + return -1; + } + + /* Envelope */ + if ((hap_custom->attack_length == 0) + && (hap_custom->fade_length == 0)) { + SDL_free(dest->lpEnvelope); + dest->lpEnvelope = NULL; + } else { + envelope->dwAttackLevel = CONVERT(hap_custom->attack_level); + envelope->dwAttackTime = hap_custom->attack_length * 1000; + envelope->dwFadeLevel = CONVERT(hap_custom->fade_level); + envelope->dwFadeTime = hap_custom->fade_length * 1000; + } + + break; + + + default: + return SDL_SetError("Haptic: Unknown effect type."); + } + + return 0; +} + + +/* + * Frees an DIEFFECT allocated by SDL_SYS_ToDIEFFECT. + */ +static void +SDL_SYS_HapticFreeDIEFFECT(DIEFFECT * effect, int type) +{ + DICUSTOMFORCE *custom; + + if (effect->lpEnvelope != NULL) { + SDL_free(effect->lpEnvelope); + effect->lpEnvelope = NULL; + } + if (effect->rgdwAxes != NULL) { + SDL_free(effect->rgdwAxes); + effect->rgdwAxes = NULL; + } + if (effect->lpvTypeSpecificParams != NULL) { + if (type == SDL_HAPTIC_CUSTOM) { /* Must free the custom data. */ + custom = (DICUSTOMFORCE *) effect->lpvTypeSpecificParams; + SDL_free(custom->rglForceData); + custom->rglForceData = NULL; + } + SDL_free(effect->lpvTypeSpecificParams); + effect->lpvTypeSpecificParams = NULL; + } + if (effect->rglDirection != NULL) { + SDL_free(effect->rglDirection); + effect->rglDirection = NULL; + } +} + + +/* + * Gets the effect type from the generic SDL haptic effect wrapper. + */ +static REFGUID +SDL_SYS_HapticEffectType(SDL_HapticEffect * effect) +{ + switch (effect->type) { + case SDL_HAPTIC_CONSTANT: + return &GUID_ConstantForce; + + case SDL_HAPTIC_RAMP: + return &GUID_RampForce; + + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /*case SDL_HAPTIC_SQUARE: + return &GUID_Square;*/ + + case SDL_HAPTIC_SINE: + return &GUID_Sine; + + case SDL_HAPTIC_TRIANGLE: + return &GUID_Triangle; + + case SDL_HAPTIC_SAWTOOTHUP: + return &GUID_SawtoothUp; + + case SDL_HAPTIC_SAWTOOTHDOWN: + return &GUID_SawtoothDown; + + case SDL_HAPTIC_SPRING: + return &GUID_Spring; + + case SDL_HAPTIC_DAMPER: + return &GUID_Damper; + + case SDL_HAPTIC_INERTIA: + return &GUID_Inertia; + + case SDL_HAPTIC_FRICTION: + return &GUID_Friction; + + case SDL_HAPTIC_CUSTOM: + return &GUID_CustomForce; + + default: + SDL_SetError("Haptic: Unknown effect type."); + return NULL; + } +} + + +/* + * Creates a new haptic effect. + */ +int +SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, + SDL_HapticEffect * base) +{ + HRESULT ret; + REFGUID type = SDL_SYS_HapticEffectType(base); + + if ((type == NULL) && (!haptic->hwdata->bXInputHaptic)) { + goto err_hweffect; + } + + /* Alloc the effect. */ + effect->hweffect = (struct haptic_hweffect *) + SDL_malloc(sizeof(struct haptic_hweffect)); + if (effect->hweffect == NULL) { + SDL_OutOfMemory(); + goto err_hweffect; + } + + SDL_zerop(effect->hweffect); + + if (haptic->hwdata->bXInputHaptic) { + SDL_assert(base->type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */ + return SDL_SYS_HapticUpdateEffect(haptic, effect, base); + } + + /* Get the effect. */ + if (SDL_SYS_ToDIEFFECT(haptic, &effect->hweffect->effect, base) < 0) { + goto err_effectdone; + } + + /* Create the actual effect. */ + ret = IDirectInputDevice8_CreateEffect(haptic->hwdata->device, type, + &effect->hweffect->effect, + &effect->hweffect->ref, NULL); + if (FAILED(ret)) { + DI_SetError("Unable to create effect", ret); + goto err_effectdone; + } + + return 0; + + err_effectdone: + SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, base->type); + err_hweffect: + if (effect->hweffect != NULL) { + SDL_free(effect->hweffect); + effect->hweffect = NULL; + } + return -1; +} + + +/* + * Updates an effect. + */ +int +SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, + struct haptic_effect *effect, + SDL_HapticEffect * data) +{ + HRESULT ret; + DWORD flags; + DIEFFECT temp; + + if (haptic->hwdata->bXInputHaptic) { + XINPUT_VIBRATION *vib = &effect->hweffect->vibration; + SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT); + vib->wLeftMotorSpeed = data->leftright.large_magnitude; + vib->wRightMotorSpeed = data->leftright.small_magnitude; + SDL_LockMutex(haptic->hwdata->mutex); + if (haptic->hwdata->stopTicks) { /* running right now? Update it. */ + XINPUTSETSTATE(haptic->hwdata->userid, vib); + } + SDL_UnlockMutex(haptic->hwdata->mutex); + return 0; + } + + /* Get the effect. */ + SDL_memset(&temp, 0, sizeof(DIEFFECT)); + if (SDL_SYS_ToDIEFFECT(haptic, &temp, data) < 0) { + goto err_update; + } + + /* Set the flags. Might be worthwhile to diff temp with loaded effect and + * only change those parameters. */ + flags = DIEP_DIRECTION | + DIEP_DURATION | + DIEP_ENVELOPE | + DIEP_STARTDELAY | + DIEP_TRIGGERBUTTON | + DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS; + + /* Create the actual effect. */ + ret = + IDirectInputEffect_SetParameters(effect->hweffect->ref, &temp, flags); + if (FAILED(ret)) { + DI_SetError("Unable to update effect", ret); + goto err_update; + } + + /* Copy it over. */ + SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, data->type); + SDL_memcpy(&effect->hweffect->effect, &temp, sizeof(DIEFFECT)); + + return 0; + + err_update: + SDL_SYS_HapticFreeDIEFFECT(&temp, data->type); + return -1; +} + + +/* + * Runs an effect. + */ +int +SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, + Uint32 iterations) +{ + HRESULT ret; + DWORD iter; + + if (haptic->hwdata->bXInputHaptic) { + XINPUT_VIBRATION *vib = &effect->hweffect->vibration; + SDL_assert(effect->effect.type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */ + SDL_LockMutex(haptic->hwdata->mutex); + haptic->hwdata->stopTicks = SDL_GetTicks() + (effect->effect.leftright.length * iterations); + SDL_UnlockMutex(haptic->hwdata->mutex); + return (XINPUTSETSTATE(haptic->hwdata->userid, vib) == ERROR_SUCCESS) ? 0 : -1; + } + + /* Check if it's infinite. */ + if (iterations == SDL_HAPTIC_INFINITY) { + iter = INFINITE; + } else + iter = iterations; + + /* Run the effect. */ + ret = IDirectInputEffect_Start(effect->hweffect->ref, iter, 0); + if (FAILED(ret)) { + return DI_SetError("Running the effect", ret); + } + + return 0; +} + + +/* + * Stops an effect. + */ +int +SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + HRESULT ret; + + if (haptic->hwdata->bXInputHaptic) { + XINPUT_VIBRATION vibration = { 0, 0 }; + SDL_LockMutex(haptic->hwdata->mutex); + haptic->hwdata->stopTicks = 0; + SDL_UnlockMutex(haptic->hwdata->mutex); + return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1; + } + + ret = IDirectInputEffect_Stop(effect->hweffect->ref); + if (FAILED(ret)) { + return DI_SetError("Unable to stop effect", ret); + } + + return 0; +} + + +/* + * Frees the effect. + */ +void +SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +{ + HRESULT ret; + + if (haptic->hwdata->bXInputHaptic) { + SDL_SYS_HapticStopEffect(haptic, effect); + } else { + ret = IDirectInputEffect_Unload(effect->hweffect->ref); + if (FAILED(ret)) { + DI_SetError("Removing effect from the device", ret); + } + SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, + effect->effect.type); + } + SDL_free(effect->hweffect); + effect->hweffect = NULL; +} + + +/* + * Gets the status of a haptic effect. + */ +int +SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, + struct haptic_effect *effect) +{ + HRESULT ret; + DWORD status; + + ret = IDirectInputEffect_GetEffectStatus(effect->hweffect->ref, &status); + if (FAILED(ret)) { + return DI_SetError("Getting effect status", ret); + } + + if (status == 0) + return SDL_FALSE; + return SDL_TRUE; +} + + +/* + * Sets the gain. + */ +int +SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +{ + HRESULT ret; + DIPROPDWORD dipdw; + + /* Create the weird structure thingy. */ + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = gain * 100; /* 0 to 10,000 */ + + /* Try to set the autocenter. */ + ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, + DIPROP_FFGAIN, &dipdw.diph); + if (FAILED(ret)) { + return DI_SetError("Setting gain", ret); + } + + return 0; +} + + +/* + * Sets the autocentering. + */ +int +SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +{ + HRESULT ret; + DIPROPDWORD dipdw; + + /* Create the weird structure thingy. */ + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = (autocenter == 0) ? DIPROPAUTOCENTER_OFF : + DIPROPAUTOCENTER_ON; + + /* Try to set the autocenter. */ + ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, + DIPROP_AUTOCENTER, &dipdw.diph); + if (FAILED(ret)) { + return DI_SetError("Setting autocenter", ret); + } + + return 0; +} + + +/* + * Pauses the device. + */ +int +SDL_SYS_HapticPause(SDL_Haptic * haptic) +{ + HRESULT ret; + + /* Pause the device. */ + ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, + DISFFC_PAUSE); + if (FAILED(ret)) { + return DI_SetError("Pausing the device", ret); + } + + return 0; +} + + +/* + * Pauses the device. + */ +int +SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +{ + HRESULT ret; + + /* Unpause the device. */ + ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, + DISFFC_CONTINUE); + if (FAILED(ret)) { + return DI_SetError("Pausing the device", ret); + } + + return 0; +} + + +/* + * Stops all the playing effects on the device. + */ +int +SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +{ + HRESULT ret; + + if (haptic->hwdata->bXInputHaptic) { + XINPUT_VIBRATION vibration = { 0, 0 }; + SDL_LockMutex(haptic->hwdata->mutex); + haptic->hwdata->stopTicks = 0; + SDL_UnlockMutex(haptic->hwdata->mutex); + return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1; + } + + /* Try to stop the effects. */ + ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, + DISFFC_STOPALL); + if (FAILED(ret)) { + return DI_SetError("Stopping the device", ret); + } + + return 0; +} + + +/* !!! FIXME: this is a hack, remove this later. */ +/* Since XInput doesn't offer a way to vibrate for X time, we hook into + * SDL_PumpEvents() to check if it's time to stop vibrating with some + * frequency. + * In practice, this works for 99% of use cases. But in an ideal world, + * we do this in a separate thread so that: + * - we aren't bound to when the app chooses to pump the event queue. + * - we aren't adding more polling to the event queue + * - we can emulate all the haptic effects correctly (start on a delay, + * mix multiple effects, etc). + * + * Mostly, this is here to get rumbling to work, and all the other features + * are absent in the XInput path for now. :( + */ +static int SDLCALL +SDL_RunXInputHaptic(void *arg) +{ + struct haptic_hwdata *hwdata = (struct haptic_hwdata *) arg; + + while (!hwdata->stopThread) { + SDL_Delay(50); + SDL_LockMutex(hwdata->mutex); + /* If we're currently running and need to stop... */ + if ((hwdata->stopTicks) && (hwdata->stopTicks < SDL_GetTicks())) { + XINPUT_VIBRATION vibration = { 0, 0 }; + hwdata->stopTicks = 0; + XINPUTSETSTATE(hwdata->userid, &vibration); + } + SDL_UnlockMutex(hwdata->mutex); + } + + return 0; +} + +#endif /* SDL_HAPTIC_DINPUT */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/hermes/COPYING.LIB b/src/hermes/COPYING.LIB deleted file mode 100644 index 69679a5636..0000000000 --- a/src/hermes/COPYING.LIB +++ /dev/null @@ -1,438 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - diff --git a/src/hermes/HeadMMX.h b/src/hermes/HeadMMX.h deleted file mode 100644 index 5d9850cca9..0000000000 --- a/src/hermes/HeadMMX.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Header definitions for the MMX routines for the HERMES library - Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) - This source code is licensed under the GNU LGPL - - Please refer to the file COPYING.LIB contained in the distribution for - licensing conditions -*/ -#include "SDL_config.h" - -#ifndef __HERMES_HEAD_MMX__ -#define __HERMES_HEAD_MMX__ - - -/* If you cannot stand ifdefs, then please do not look into this file, it's - going to end your life :) */ - -#ifdef X86_ASSEMBLER - - -#ifdef __cplusplus -extern "C" { -#endif - -void STACKCALL ConvertMMX(HermesConverterInterface *); - -void STACKCALL ClearMMX_32(HermesClearInterface *); -void STACKCALL ClearMMX_24(HermesClearInterface *); -void STACKCALL ClearMMX_16(HermesClearInterface *); -void STACKCALL ClearMMX_8(HermesClearInterface *); - -void ConvertMMXpII32_24RGB888(); -void ConvertMMXpII32_16RGB565(); -void ConvertMMXpII32_16BGR565(); -void ConvertMMXpII32_16RGB555(); -void ConvertMMXpII32_16BGR565(); -void ConvertMMXpII32_16BGR555(); - -void ConvertMMXp32_16RGB555(); - -#ifdef __cplusplus -} -#endif - - - -/* Fix the underscore business with ELF compilers */ - -#if (defined(__ELF__) && defined(__GNUC__)) || defined(__SUNPRO_C) - #ifdef __cplusplus - extern "C" { - #endif - - extern void _ConvertMMX(HermesConverterInterface *); - extern void _ConvertMMXpII32_24RGB888(); - extern void _ConvertMMXpII32_16RGB565(); - extern void _ConvertMMXpII32_16BGR565(); - extern void _ConvertMMXpII32_16RGB555(); - extern void _ConvertMMXpII32_16BGR555(); - - #define ConvertMMX _ConvertMMX - #define ConvertMMXpII32_24RGB888 _ConvertMMXpII32_24RGB888 - #define ConvertMMXpII32_16RGB565 _ConvertMMXpII32_16RGB565 - #define ConvertMMXpII32_16BGR565 _ConvertMMXpII32_16BGR565 - #define ConvertMMXpII32_16RGB555 _ConvertMMXpII32_16RGB555 - #define ConvertMMXpII32_16BGR555 _ConvertMMXpII32_16BGR555 - - #ifdef __cplusplus - } - #endif - -#endif /* ELF and GNUC */ - - - - -/* Make it work with Watcom */ -#ifdef __WATCOMC__ -#pragma warning 601 9 - -#pragma aux ConvertMMX "_*" modify [EAX EBX ECX EDX ESI EDI] - -#pragma aux ClearMMX_32 "_*" modify [EAX EBX ECX EDX ESI EDI] -#pragma aux ClearMMX_24 "_*" modify [EAX EBX ECX EDX ESI EDI] -#pragma aux ClearMMX_16 "_*" modify [EAX EBX ECX EDX ESI EDI] -#pragma aux ClearMMX_8 "_*" modify [EAX EBX ECX EDX ESI EDI] - -#pragma aux ConvertMMXpII32_24RGB888 "_*" -#pragma aux ConvertMMXpII32_16RGB565 "_*" -#pragma aux ConvertMMXpII32_16BGR565 "_*" -#pragma aux ConvertMMXpII32_16RGB555 "_*" -#pragma aux ConvertMMXpII32_16BGR555 "_*" -#pragma aux ConvertMMXp32_16RGB555 "_*" - -#endif /* WATCOM */ - -#endif /* X86_ASSEMBLER */ - - -#endif diff --git a/src/hermes/HeadX86.h b/src/hermes/HeadX86.h deleted file mode 100644 index fc6b6ddddf..0000000000 --- a/src/hermes/HeadX86.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - Header definitions for the x86 routines for the HERMES library - Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) - This source code is licensed under the GNU LGPL - - Please refer to the file COPYING.LIB contained in the distribution for - licensing conditions -*/ - -#ifndef __HERMES_HEAD_X86__ -#define __HERMES_HEAD_X86__ - - -#ifdef X86_ASSEMBLER - -/* If you can't stand IFDEFS, then close your eyes now, please :) */ - -/* Ok, we start with normal function definitions */ -#ifdef __cplusplus -extern "C" { -#endif - - -void STACKCALL ConvertX86(HermesConverterInterface *); -void STACKCALL ClearX86_32(HermesClearInterface *); -void STACKCALL ClearX86_24(HermesClearInterface *); -void STACKCALL ClearX86_16(HermesClearInterface *); -void STACKCALL ClearX86_8(HermesClearInterface *); - -int STACKCALL Hermes_X86_CPU(); - -void ConvertX86p32_32BGR888(); -void ConvertX86p32_32RGBA888(); -void ConvertX86p32_32BGRA888(); -void ConvertX86p32_24RGB888(); -void ConvertX86p32_24BGR888(); -void ConvertX86p32_16RGB565(); -void ConvertX86p32_16BGR565(); -void ConvertX86p32_16RGB555(); -void ConvertX86p32_16BGR555(); -void ConvertX86p32_8RGB332(); - -void ConvertX86p16_32RGB888(); -void ConvertX86p16_32BGR888(); -void ConvertX86p16_32RGBA888(); -void ConvertX86p16_32BGRA888(); -void ConvertX86p16_24RGB888(); -void ConvertX86p16_24BGR888(); -void ConvertX86p16_16BGR565(); -void ConvertX86p16_16RGB555(); -void ConvertX86p16_16BGR555(); -void ConvertX86p16_8RGB332(); - -void CopyX86p_4byte(); -void CopyX86p_3byte(); -void CopyX86p_2byte(); -void CopyX86p_1byte(); - -void ConvertX86pI8_32(); -void ConvertX86pI8_24(); -void ConvertX86pI8_16(); - -extern int ConvertX86p16_32RGB888_LUT_X86[512]; -extern int ConvertX86p16_32BGR888_LUT_X86[512]; -extern int ConvertX86p16_32RGBA888_LUT_X86[512]; -extern int ConvertX86p16_32BGRA888_LUT_X86[512]; - -#ifdef __cplusplus -} -#endif - - - - -/* Now fix up the ELF underscore problem */ - -#if (defined(__ELF__) && defined(__GNUC__)) || defined(__SUNPRO_C) - #ifdef __cplusplus - extern "C" { - #endif - - extern int _Hermes_X86_CPU(); - - extern void _ConvertX86(HermesConverterInterface *); - - extern void _ConvertX86p32_32BGR888(); - extern void _ConvertX86p32_32RGBA888(); - extern void _ConvertX86p32_32BGRA888(); - extern void _ConvertX86p32_24RGB888(); - extern void _ConvertX86p32_24BGR888(); - extern void _ConvertX86p32_16RGB565(); - extern void _ConvertX86p32_16BGR565(); - extern void _ConvertX86p32_16RGB555(); - extern void _ConvertX86p32_16BGR555(); - extern void _ConvertX86p32_8RGB332(); - - extern void _ConvertX86p16_16BGR565(); - extern void _ConvertX86p16_16RGB555(); - extern void _ConvertX86p16_16BGR555(); - extern void _ConvertX86p16_8RGB332(); - - - #define Hermes_X86_CPU _Hermes_X86_CPU - - #define ConvertX86 _ConvertX86 - - #define ConvertX86p32_32BGR888 _ConvertX86p32_32BGR888 - #define ConvertX86p32_32RGBA888 _ConvertX86p32_32RGBA888 - #define ConvertX86p32_32BGRA888 _ConvertX86p32_32BGRA888 - #define ConvertX86p32_24RGB888 _ConvertX86p32_24RGB888 - #define ConvertX86p32_24BGR888 _ConvertX86p32_24BGR888 - #define ConvertX86p32_16RGB565 _ConvertX86p32_16RGB565 - #define ConvertX86p32_16BGR565 _ConvertX86p32_16BGR565 - #define ConvertX86p32_16RGB555 _ConvertX86p32_16RGB555 - #define ConvertX86p32_16BGR555 _ConvertX86p32_16BGR555 - #define ConvertX86p32_8RGB332 _ConvertX86p32_8RGB332 - - #define ConvertX86p16_16BGR565 _ConvertX86p16_16BGR565 - #define ConvertX86p16_16RGB555 _ConvertX86p16_16RGB555 - #define ConvertX86p16_16BGR555 _ConvertX86p16_16BGR555 - #define ConvertX86p16_8RGB332 _ConvertX86p16_8RGB332 - - - #ifdef __cplusplus - } - #endif - -#endif /* ELF & GNU */ - - - -/* Make it run with WATCOM C */ -#ifdef __WATCOMC__ -#pragma warning 601 9 - -#pragma aux Hermes_X86_CPU "_*" - -#pragma aux ConvertX86 "_*" modify [EAX EBX ECX EDX ESI EDI] -#pragma aux ClearX86_32 "_*" modify [EAX EBX ECX EDX ESI EDI] -#pragma aux ClearX86_24 "_*" modify [EAX EBX ECX EDX ESI EDI] -#pragma aux ClearX86_16 "_*" modify [EAX EBX ECX EDX ESI EDI] -#pragma aux ClearX86_8 "_*" modify [EAX EBX ECX EDX ESI EDI] - -#pragma aux ConvertX86p32_32BGR888 "_*" -#pragma aux ConvertX86p32_32RGBA888 "_*" -#pragma aux ConvertX86p32_32BGRA888 "_*" -#pragma aux ConvertX86p32_24RGB888 "_*" -#pragma aux ConvertX86p32_24BGR888 "_*" -#pragma aux ConvertX86p32_16RGB565 "_*" -#pragma aux ConvertX86p32_16BGR565 "_*" -#pragma aux ConvertX86p32_16RGB555 "_*" -#pragma aux ConvertX86p32_16BGR555 "_*" -#pragma aux ConvertX86p32_8RGB332 "_*" - -#pragma aux ConvertX86p16_32RGB888 "_*" -#pragma aux ConvertX86p16_32BGR888 "_*" -#pragma aux ConvertX86p16_32RGBA888 "_*" -#pragma aux ConvertX86p16_32BGRA888 "_*" -#pragma aux ConvertX86p16_24RGB888 "_*" -#pragma aux ConvertX86p16_24BGR888 "_*" -#pragma aux ConvertX86p16_16BGR565 "_*" -#pragma aux ConvertX86p16_16RGB555 "_*" -#pragma aux ConvertX86p16_16BGR555 "_*" -#pragma aux ConvertX86p16_8RGB332 "_*" - -#pragma aux CopyX86p_4byte "_*" -#pragma aux CopyX86p_3byte "_*" -#pragma aux CopyX86p_2byte "_*" -#pragma aux CopyX86p_1byte "_*" - -#pragma aux ConvertX86pI8_32 "_*" -#pragma aux ConvertX86pI8_24 "_*" -#pragma aux ConvertX86pI8_16 "_*" - -#pragma aux ConvertX86p16_32RGB888_LUT_X86 "_*" -#pragma aux ConvertX86p16_32BGR888_LUT_X86 "_*" -#pragma aux ConvertX86p16_32RGBA888_LUT_X86 "_*" -#pragma aux ConvertX86p16_32BGRA888_LUT_X86 "_*" - -#endif /* __WATCOMC__ */ - - -#endif /* X86_ASSEMBLER */ - - -#endif diff --git a/src/hermes/README b/src/hermes/README deleted file mode 100644 index a03b6cfda4..0000000000 --- a/src/hermes/README +++ /dev/null @@ -1,13 +0,0 @@ -HERMES 1.2.4 (c)1998 Christian Nentwich (brn) (c.nentwich@cs.ucl.ac.uk) -and quite a few assembler routines (c) Glenn Fielder (gaffer@gaffer.org) - -This library and all the files enclosed in this package are free software -under the terms of the GNU Library General Public License (LGPL). Please -refer to the included file COPYING.LIB for the exact terms. ----------------------------------------------------------------------------- - -This is a stripped down version of HERMES, including only the x86 assembler -converters, for use with Simple DirectMedia Layer. - -The full HERMES library is available at: http://hermes.terminal.at/ - diff --git a/src/hermes/common.inc b/src/hermes/common.inc deleted file mode 100644 index 9587e6ffbd..0000000000 --- a/src/hermes/common.inc +++ /dev/null @@ -1,9 +0,0 @@ -; Some common macros for hermes nasm code - -%macro SDL_FUNC 1 -%ifdef HIDDEN_VISIBILITY -GLOBAL %1:function hidden -%else -GLOBAL %1 -%endif -%endmacro diff --git a/src/hermes/mmx_main.asm b/src/hermes/mmx_main.asm deleted file mode 100644 index 00032b95c6..0000000000 --- a/src/hermes/mmx_main.asm +++ /dev/null @@ -1,74 +0,0 @@ -; -; mmx format converter main loops for HERMES -; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) -; This source code is licensed under the GNU LGPL -; -; Please refer to the file COPYING.LIB contained in the distribution for -; licensing conditions -; - -BITS 32 - -%include "common.inc" - -SDL_FUNC _ConvertMMX - -SECTION .text - -;; _ConvertMMX: -;; [ESP+8] ConverterInfo* -;; -------------------------------------------------------------------------- -;; ConverterInfo (ebp+..) -;; 0: void *s_pixels -;; 4: int s_width -;; 8: int s_height -;; 12: int s_add -;; 16: void *d_pixels -;; 20: int d_width -;; 24: int d_height -;; 28: int d_add -;; 32: void (*converter_function)() -;; 36: int32 *lookup - -_ConvertMMX: - push ebp - mov ebp,esp - -; Save the registers used by the blitters, necessary for optimized code - pusha - - mov eax,[ebp+8] - - cmp dword [eax+4],BYTE 0 - je endconvert - - mov ebp,eax - - mov esi,[ebp+0] - mov edi,[ebp+16] - -y_loop: - mov ecx,[ebp+4] - - call [ebp+32] - - add esi,[ebp+12] - add edi,[ebp+28] - - dec dword [ebp+8] - jnz y_loop - - -; Restore the registers used by the blitters, necessary for optimized code - popa - - pop ebp - -endconvert: - emms - - ret - -%ifidn __OUTPUT_FORMAT__,elf32 -section .note.GNU-stack noalloc noexec nowrite progbits -%endif diff --git a/src/hermes/mmxp2_32.asm b/src/hermes/mmxp2_32.asm deleted file mode 100644 index 20c3277a26..0000000000 --- a/src/hermes/mmxp2_32.asm +++ /dev/null @@ -1,405 +0,0 @@ -; -; pII-optimised MMX format converters for HERMES -; Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk) -; and (c) 1999 Jonathan Matthew (jmatthew@uq.net.au) -; This source code is licensed under the GNU LGPL -; -; Please refer to the file COPYING.LIB contained in the distribution for -; licensing conditions -; -; COPYRIGHT NOTICE -; -; This file partly contains code that is (c) Intel Corporation, specifically -; the mode detection routine, and the converter to 15 bit (8 pixel -; conversion routine from the mmx programming tutorial pages). -; -; -; These routines aren't exactly pII optimised - it's just that as they -; are, they're terrible on p5 MMXs, but less so on pIIs. Someone needs to -; optimise them for p5 MMXs.. - -BITS 32 - -%include "common.inc" - -SDL_FUNC _ConvertMMXpII32_24RGB888 -SDL_FUNC _ConvertMMXpII32_16RGB565 -SDL_FUNC _ConvertMMXpII32_16BGR565 -SDL_FUNC _ConvertMMXpII32_16RGB555 -SDL_FUNC _ConvertMMXpII32_16BGR555 - -;; Macros for conversion routines - -%macro _push_immq_mask 1 - push dword %1 - push dword %1 -%endmacro - -%macro load_immq 2 - _push_immq_mask %2 - movq %1, [esp] -%endmacro - -%macro pand_immq 2 - _push_immq_mask %2 - pand %1, [esp] -%endmacro - -%define CLEANUP_IMMQ_LOADS(num) \ - add esp, byte 8 * num - -%define mmx32_rgb888_mask 00ffffffh -%define mmx32_rgb565_b 000000f8h -%define mmx32_rgb565_g 0000fc00h -%define mmx32_rgb565_r 00f80000h - -%define mmx32_rgb555_rb 00f800f8h -%define mmx32_rgb555_g 0000f800h -%define mmx32_rgb555_mul 20000008h -%define mmx32_bgr555_mul 00082000h - -SECTION .text - -_ConvertMMXpII32_24RGB888: - - ; set up mm6 as the mask, mm7 as zero - load_immq mm6, mmx32_rgb888_mask - CLEANUP_IMMQ_LOADS(1) - pxor mm7, mm7 - - mov edx, ecx ; save ecx - and ecx, 0fffffffch ; clear lower two bits - jnz .L1 - jmp .L2 - -.L1: - - movq mm0, [esi] ; A R G B a r g b - pand mm0, mm6 ; 0 R G B 0 r g b - movq mm1, [esi+8] ; A R G B a r g b - pand mm1, mm6 ; 0 R G B 0 r g b - - movq mm2, mm0 ; 0 R G B 0 r g b - punpckhdq mm2, mm7 ; 0 0 0 0 0 R G B - punpckldq mm0, mm7 ; 0 0 0 0 0 r g b - psllq mm2, 24 ; 0 0 R G B 0 0 0 - por mm0, mm2 ; 0 0 R G B r g b - - movq mm3, mm1 ; 0 R G B 0 r g b - psllq mm3, 48 ; g b 0 0 0 0 0 0 - por mm0, mm3 ; g b R G B r g b - - movq mm4, mm1 ; 0 R G B 0 r g b - punpckhdq mm4, mm7 ; 0 0 0 0 0 R G B - punpckldq mm1, mm7 ; 0 0 0 0 0 r g b - psrlq mm1, 16 ; 0 0 0 R G B 0 r - psllq mm4, 8 ; 0 0 0 0 R G B 0 - por mm1, mm4 ; 0 0 0 0 R G B r - - movq [edi], mm0 - add esi, BYTE 16 - movd [edi+8], mm1 - add edi, BYTE 12 - sub ecx, BYTE 4 - jnz .L1 - -.L2: - mov ecx, edx - and ecx, BYTE 3 - jz .L4 -.L3: - mov al, [esi] - mov bl, [esi+1] - mov dl, [esi+2] - mov [edi], al - mov [edi+1], bl - mov [edi+2], dl - add esi, BYTE 4 - add edi, BYTE 3 - dec ecx - jnz .L3 -.L4: - retn - - - -_ConvertMMXpII32_16RGB565: - - ; set up masks - load_immq mm5, mmx32_rgb565_b - load_immq mm6, mmx32_rgb565_g - load_immq mm7, mmx32_rgb565_r - CLEANUP_IMMQ_LOADS(3) - - mov edx, ecx - shr ecx, 2 - jnz .L1 - jmp .L2 ; not necessary at the moment, but doesn't hurt (much) - -.L1: - movq mm0, [esi] ; argb - movq mm1, mm0 ; argb - pand mm0, mm6 ; 00g0 - movq mm3, mm1 ; argb - pand mm1, mm5 ; 000b - pand mm3, mm7 ; 0r00 - pslld mm1, 2 ; 0 0 000000bb bbb00000 - por mm0, mm1 ; 0 0 ggggggbb bbb00000 - psrld mm0, 5 ; 0 0 00000ggg gggbbbbb - - movq mm4, [esi+8] ; argb - movq mm2, mm4 ; argb - pand mm4, mm6 ; 00g0 - movq mm1, mm2 ; argb - pand mm2, mm5 ; 000b - pand mm1, mm7 ; 0r00 - pslld mm2, 2 ; 0 0 000000bb bbb00000 - por mm4, mm2 ; 0 0 ggggggbb bbb00000 - psrld mm4, 5 ; 0 0 00000ggg gggbbbbb - - packuswb mm3, mm1 ; R 0 r 0 - packssdw mm0, mm4 ; as above.. ish - por mm0, mm3 ; done. - movq [edi], mm0 - - add esi, 16 - add edi, 8 - dec ecx - jnz .L1 - -.L2: - mov ecx, edx - and ecx, BYTE 3 - jz .L4 -.L3: - mov al, [esi] - mov bh, [esi+1] - mov ah, [esi+2] - shr al, 3 - and eax, 0F81Fh ; BYTE? - shr ebx, 5 - and ebx, 07E0h ; BYTE? - add eax, ebx - mov [edi], al - mov [edi+1], ah - add esi, BYTE 4 - add edi, BYTE 2 - dec ecx - jnz .L3 - -.L4: - retn - - -_ConvertMMXpII32_16BGR565: - - load_immq mm5, mmx32_rgb565_r - load_immq mm6, mmx32_rgb565_g - load_immq mm7, mmx32_rgb565_b - CLEANUP_IMMQ_LOADS(3) - - mov edx, ecx - shr ecx, 2 - jnz .L1 - jmp .L2 - -.L1: - movq mm0, [esi] ; a r g b - movq mm1, mm0 ; a r g b - pand mm0, mm6 ; 0 0 g 0 - movq mm3, mm1 ; a r g b - pand mm1, mm5 ; 0 r 0 0 - pand mm3, mm7 ; 0 0 0 b - - psllq mm3, 16 ; 0 b 0 0 - psrld mm1, 14 ; 0 0 000000rr rrr00000 - por mm0, mm1 ; 0 0 ggggggrr rrr00000 - psrld mm0, 5 ; 0 0 00000ggg gggrrrrr - - movq mm4, [esi+8] ; a r g b - movq mm2, mm4 ; a r g b - pand mm4, mm6 ; 0 0 g 0 - movq mm1, mm2 ; a r g b - pand mm2, mm5 ; 0 r 0 0 - pand mm1, mm7 ; 0 0 0 b - - psllq mm1, 16 ; 0 b 0 0 - psrld mm2, 14 ; 0 0 000000rr rrr00000 - por mm4, mm2 ; 0 0 ggggggrr rrr00000 - psrld mm4, 5 ; 0 0 00000ggg gggrrrrr - - packuswb mm3, mm1 ; BBBBB000 00000000 bbbbb000 00000000 - packssdw mm0, mm4 ; 00000GGG GGGRRRRR 00000GGG GGGRRRRR - por mm0, mm3 ; BBBBBGGG GGGRRRRR bbbbbggg gggrrrrr - movq [edi], mm0 - - add esi, BYTE 16 - add edi, BYTE 8 - dec ecx - jnz .L1 - -.L2: - and edx, BYTE 3 - jz .L4 -.L3: - mov al, [esi+2] - mov bh, [esi+1] - mov ah, [esi] - shr al, 3 - and eax, 0F81Fh ; BYTE ? - shr ebx, 5 - and ebx, 07E0h ; BYTE ? - add eax, ebx - mov [edi], al - mov [edi+1], ah - add esi, BYTE 4 - add edi, BYTE 2 - dec edx - jnz .L3 - -.L4: - retn - -_ConvertMMXpII32_16BGR555: - - ; the 16BGR555 converter is identical to the RGB555 one, - ; except it uses a different multiplier for the pmaddwd - ; instruction. cool huh. - - load_immq mm7, mmx32_bgr555_mul - jmp _convert_bgr555_cheat - -; This is the same as the Intel version.. they obviously went to -; much more trouble to expand/coil the loop than I did, so theirs -; would almost certainly be faster, even if only a little. -; I did rename 'mmx32_rgb555_add' to 'mmx32_rgb555_mul', which is -; (I think) a more accurate name.. -_ConvertMMXpII32_16RGB555: - - load_immq mm7, mmx32_rgb555_mul -_convert_bgr555_cheat: - load_immq mm6, mmx32_rgb555_g - CLEANUP_IMMQ_LOADS(2) - - mov edx,ecx ; Save ecx - - and ecx,DWORD 0fffffff8h ; clear lower three bits - jnz .L_OK - jmp near .L2 - -.L_OK: - - movq mm2,[esi+8] - - movq mm0,[esi] - movq mm3,mm2 - - pand_immq mm3, mmx32_rgb555_rb - movq mm1,mm0 - - pand_immq mm1, mmx32_rgb555_rb - pmaddwd mm3,mm7 - - CLEANUP_IMMQ_LOADS(2) - - pmaddwd mm1,mm7 - pand mm2,mm6 - -.L1: - movq mm4,[esi+24] - pand mm0,mm6 - - movq mm5,[esi+16] - por mm3,mm2 - - psrld mm3,6 - por mm1,mm0 - - movq mm0,mm4 - psrld mm1,6 - - pand_immq mm0, mmx32_rgb555_rb - packssdw mm1,mm3 - - movq mm3,mm5 - pmaddwd mm0,mm7 - - pand_immq mm3, mmx32_rgb555_rb - pand mm4,mm6 - - movq [edi],mm1 - pmaddwd mm3,mm7 - - add esi,BYTE 32 - por mm4,mm0 - - pand mm5,mm6 - psrld mm4,6 - - movq mm2,[esi+8] - por mm5,mm3 - - movq mm0,[esi] - psrld mm5,6 - - movq mm3,mm2 - movq mm1,mm0 - - pand_immq mm3, mmx32_rgb555_rb - packssdw mm5,mm4 - - pand_immq mm1, mmx32_rgb555_rb - pand mm2,mm6 - - CLEANUP_IMMQ_LOADS(4) - - movq [edi+8],mm5 - pmaddwd mm3,mm7 - - pmaddwd mm1,mm7 - add edi,BYTE 16 - - sub ecx,BYTE 8 - jz .L2 - jmp .L1 - - -.L2: - mov ecx,edx - - and ecx,BYTE 7 - jz .L4 - -.L3: - mov ebx,[esi] - add esi,BYTE 4 - - mov eax,ebx - mov edx,ebx - - shr eax,3 - shr edx,6 - - and eax,BYTE 0000000000011111b - and edx, 0000001111100000b - - shr ebx,9 - - or eax,edx - - and ebx, 0111110000000000b - - or eax,ebx - - mov [edi],ax - add edi,BYTE 2 - - dec ecx - jnz .L3 - -.L4: - retn - -%ifidn __OUTPUT_FORMAT__,elf32 -section .note.GNU-stack noalloc noexec nowrite progbits -%endif diff --git a/src/hermes/x86_main.asm b/src/hermes/x86_main.asm deleted file mode 100644 index f7dd3db70c..0000000000 --- a/src/hermes/x86_main.asm +++ /dev/null @@ -1,75 +0,0 @@ -; -; x86 format converters for HERMES -; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) -; This source code is licensed under the GNU LGPL -; -; Please refer to the file COPYING.LIB contained in the distribution for -; licensing conditions -; -; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission -; - -BITS 32 - -%include "common.inc" - -SDL_FUNC _ConvertX86 - -SECTION .text - -;; _ConvertX86: -;; [ESP+8] ConverterInfo* -;; -------------------------------------------------------------------------- -;; ConverterInfo (ebp+..) -;; 0: void *s_pixels -;; 4: int s_width -;; 8: int s_height -;; 12: int s_add -;; 16: void *d_pixels -;; 20: int d_width -;; 24: int d_height -;; 28: int d_add -;; 32: void (*converter_function)() -;; 36: int32 *lookup - -_ConvertX86: - push ebp - mov ebp,esp - -; Save the registers used by the blitters, necessary for optimized code - pusha - - mov eax,[ebp+8] - - cmp dword [eax+4],BYTE 0 - je endconvert - - mov ebp,eax - - mov esi,[ebp+0] - mov edi,[ebp+16] - -y_loop: - mov ecx,[ebp+4] - - call [ebp+32] - - add esi,[ebp+12] - add edi,[ebp+28] - - dec dword [ebp+8] - jnz y_loop - -; Restore the registers used by the blitters, necessary for optimized code - popa - - pop ebp - -endconvert: - ret - - - -%ifidn __OUTPUT_FORMAT__,elf32 -section .note.GNU-stack noalloc noexec nowrite progbits -%endif diff --git a/src/hermes/x86p_16.asm b/src/hermes/x86p_16.asm deleted file mode 100644 index 1801bcd153..0000000000 --- a/src/hermes/x86p_16.asm +++ /dev/null @@ -1,490 +0,0 @@ -; -; x86 format converters for HERMES -; Copyright (c) 1998 Glenn Fielder (gaffer@gaffer.org) -; This source code is licensed under the GNU LGPL -; -; Please refer to the file COPYING.LIB contained in the distribution for -; licensing conditions -; -; Routines adjusted for Hermes by Christian Nentwich (brn@eleet.mcb.at) -; Used with permission. -; - -BITS 32 - -%include "common.inc" - -SDL_FUNC _ConvertX86p16_16BGR565 -SDL_FUNC _ConvertX86p16_16RGB555 -SDL_FUNC _ConvertX86p16_16BGR555 -SDL_FUNC _ConvertX86p16_8RGB332 - -EXTERN _ConvertX86 - -SECTION .text - -_ConvertX86p16_16BGR565: - - ; check short - cmp ecx,BYTE 16 - ja .L3 - - -.L1: ; short loop - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - shr eax,11 - and eax,BYTE 11111b - and ebx,11111100000b - shl edx,11 - add eax,ebx - add eax,edx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov eax,edi - and eax,BYTE 11b - jz .L4 - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - shr eax,11 - and eax,BYTE 11111b - and ebx,11111100000b - shl edx,11 - add eax,ebx - add eax,edx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - dec ecx - -.L4: ; save count - push ecx - - ; unroll twice - shr ecx,1 - - ; point arrays to end - lea esi,[esi+ecx*4] - lea edi,[edi+ecx*4] - - ; negative counter - neg ecx - jmp SHORT .L6 - -.L5: mov [edi+ecx*4-4],eax -.L6: mov eax,[esi+ecx*4] - - mov ebx,[esi+ecx*4] - and eax,07E007E0h - - mov edx,[esi+ecx*4] - and ebx,0F800F800h - - shr ebx,11 - and edx,001F001Fh - - shl edx,11 - add eax,ebx - - add eax,edx - inc ecx - - jnz .L5 - - mov [edi+ecx*4-4],eax - - ; tail - pop ecx - and ecx,BYTE 1 - jz .L7 - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - shr eax,11 - and eax,BYTE 11111b - and ebx,11111100000b - shl edx,11 - add eax,ebx - add eax,edx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - -.L7: - retn - - - - - - -_ConvertX86p16_16RGB555: - - ; check short - cmp ecx,BYTE 32 - ja .L3 - - -.L1: ; short loop - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - shr ebx,1 - and ebx, 0111111111100000b - and eax,BYTE 0000000000011111b - add eax,ebx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov eax,edi - and eax,BYTE 11b - jz .L4 - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - shr ebx,1 - and ebx, 0111111111100000b - and eax,BYTE 0000000000011111b - add eax,ebx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - dec ecx - -.L4: ; save ebp - push ebp - - ; save count - push ecx - - ; unroll four times - shr ecx,2 - - ; point arrays to end - lea esi,[esi+ecx*8] - lea edi,[edi+ecx*8] - - ; negative counter - xor ebp,ebp - sub ebp,ecx - -.L5: mov eax,[esi+ebp*8] ; agi? - mov ecx,[esi+ebp*8+4] - - mov ebx,eax - mov edx,ecx - - and eax,0FFC0FFC0h - and ecx,0FFC0FFC0h - - shr eax,1 - and ebx,001F001Fh - - shr ecx,1 - and edx,001F001Fh - - add eax,ebx - add ecx,edx - - mov [edi+ebp*8],eax - mov [edi+ebp*8+4],ecx - - inc ebp - jnz .L5 - - ; tail - pop ecx -.L6: and ecx,BYTE 11b - jz .L7 - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - shr ebx,1 - and ebx, 0111111111100000b - and eax,BYTE 0000000000011111b - add eax,ebx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - dec ecx - jmp SHORT .L6 - -.L7: pop ebp - retn - - - - - - -_ConvertX86p16_16BGR555: - - ; check short - cmp ecx,BYTE 16 - ja .L3 - - -.L1: ; short loop - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - shr eax,11 - and eax,BYTE 11111b - shr ebx,1 - and ebx,1111100000b - shl edx,10 - and edx,0111110000000000b - add eax,ebx - add eax,edx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov eax,edi - and eax,BYTE 11b - jz .L4 - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - shr eax,11 - and eax,BYTE 11111b - shr ebx,1 - and ebx,1111100000b - shl edx,10 - and edx,0111110000000000b - add eax,ebx - add eax,edx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - dec ecx - -.L4: ; save count - push ecx - - ; unroll twice - shr ecx,1 - - ; point arrays to end - lea esi,[esi+ecx*4] - lea edi,[edi+ecx*4] - - ; negative counter - neg ecx - jmp SHORT .L6 - -.L5: mov [edi+ecx*4-4],eax -.L6: mov eax,[esi+ecx*4] - - shr eax,1 - mov ebx,[esi+ecx*4] - - and eax,03E003E0h - mov edx,[esi+ecx*4] - - and ebx,0F800F800h - - shr ebx,11 - and edx,001F001Fh - - shl edx,10 - add eax,ebx - - add eax,edx - inc ecx - - jnz .L5 - - mov [edi+ecx*4-4],eax - - ; tail - pop ecx - and ecx,BYTE 1 - jz .L7 - mov al,[esi] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - shr eax,11 - and eax,BYTE 11111b - shr ebx,1 - and ebx,1111100000b - shl edx,10 - and edx,0111110000000000b - add eax,ebx - add eax,edx - mov [edi],al - mov [edi+1],ah - add esi,BYTE 2 - add edi,BYTE 2 - -.L7: - retn - - - - - - -_ConvertX86p16_8RGB332: - - ; check short - cmp ecx,BYTE 16 - ja .L3 - - -.L1: ; short loop - mov al,[esi+0] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - and eax,BYTE 11000b ; blue - shr eax,3 - and ebx,11100000000b ; green - shr ebx,6 - and edx,1110000000000000b ; red - shr edx,8 - add eax,ebx - add eax,edx - mov [edi],al - add esi,BYTE 2 - inc edi - dec ecx - jnz .L1 -.L2: - retn - -.L3: mov eax,edi - and eax,BYTE 11b - jz .L4 - mov al,[esi+0] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - and eax,BYTE 11000b ; blue - shr eax,3 - and ebx,11100000000b ; green - shr ebx,6 - and edx,1110000000000000b ; red - shr edx,8 - add eax,ebx - add eax,edx - mov [edi],al - add esi,BYTE 2 - inc edi - dec ecx - jmp SHORT .L3 - -.L4: ; save ebp - push ebp - - ; save count - push ecx - - ; unroll 4 times - shr ecx,2 - - ; prestep - mov dl,[esi+0] - mov bl,[esi+1] - mov dh,[esi+2] - -.L5: shl edx,16 - mov bh,[esi+3] - - shl ebx,16 - mov dl,[esi+4] - - mov dh,[esi+6] - mov bl,[esi+5] - - and edx,00011000000110000001100000011000b - mov bh,[esi+7] - - ror edx,16+3 - mov eax,ebx ; setup eax for reds - - and ebx,00000111000001110000011100000111b - and eax,11100000111000001110000011100000b ; reds - - ror ebx,16-2 - add esi,BYTE 8 - - ror eax,16 - add edi,BYTE 4 - - add eax,ebx - mov bl,[esi+1] ; greens - - add eax,edx - mov dl,[esi+0] ; blues - - mov [edi-4],eax - mov dh,[esi+2] - - dec ecx - jnz .L5 - - ; check tail - pop ecx - and ecx,BYTE 11b - jz .L7 - -.L6: ; tail - mov al,[esi+0] - mov ah,[esi+1] - mov ebx,eax - mov edx,eax - and eax,BYTE 11000b ; blue - shr eax,3 - and ebx,11100000000b ; green - shr ebx,6 - and edx,1110000000000000b ; red - shr edx,8 - add eax,ebx - add eax,edx - mov [edi],al - add esi,BYTE 2 - inc edi - dec ecx - jnz .L6 - -.L7: pop ebp - retn - -%ifidn __OUTPUT_FORMAT__,elf32 -section .note.GNU-stack noalloc noexec nowrite progbits -%endif diff --git a/src/hermes/x86p_32.asm b/src/hermes/x86p_32.asm deleted file mode 100644 index 2b478802d1..0000000000 --- a/src/hermes/x86p_32.asm +++ /dev/null @@ -1,1044 +0,0 @@ -; -; x86 format converters for HERMES -; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at) -; This source code is licensed under the GNU LGPL -; -; Please refer to the file COPYING.LIB contained in the distribution for -; licensing conditions -; -; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission -; - -BITS 32 - -%include "common.inc" - -SDL_FUNC _ConvertX86p32_32BGR888 -SDL_FUNC _ConvertX86p32_32RGBA888 -SDL_FUNC _ConvertX86p32_32BGRA888 -SDL_FUNC _ConvertX86p32_24RGB888 -SDL_FUNC _ConvertX86p32_24BGR888 -SDL_FUNC _ConvertX86p32_16RGB565 -SDL_FUNC _ConvertX86p32_16BGR565 -SDL_FUNC _ConvertX86p32_16RGB555 -SDL_FUNC _ConvertX86p32_16BGR555 -SDL_FUNC _ConvertX86p32_8RGB332 - -SECTION .text - -;; _Convert_* -;; Paramters: -;; ESI = source -;; EDI = dest -;; ECX = amount (NOT 0!!! (the _ConvertX86 routine checks for that though)) -;; Destroys: -;; EAX, EBX, EDX - - -_ConvertX86p32_32BGR888: - - ; check short - cmp ecx,BYTE 32 - ja .L3 - -.L1: ; short loop - mov edx,[esi] - bswap edx - ror edx,8 - mov [edi],edx - add esi,BYTE 4 - add edi,BYTE 4 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; save ebp - push ebp - - ; unroll four times - mov ebp,ecx - shr ebp,2 - - ; save count - push ecx - -.L4: mov eax,[esi] - mov ebx,[esi+4] - - bswap eax - - bswap ebx - - ror eax,8 - mov ecx,[esi+8] - - ror ebx,8 - mov edx,[esi+12] - - bswap ecx - - bswap edx - - ror ecx,8 - mov [edi+0],eax - - ror edx,8 - mov [edi+4],ebx - - mov [edi+8],ecx - mov [edi+12],edx - - add esi,BYTE 16 - add edi,BYTE 16 - - dec ebp - jnz .L4 - - ; check tail - pop ecx - and ecx,BYTE 11b - jz .L6 - -.L5: ; tail loop - mov edx,[esi] - bswap edx - ror edx,8 - mov [edi],edx - add esi,BYTE 4 - add edi,BYTE 4 - dec ecx - jnz .L5 - -.L6: pop ebp - retn - - - - -_ConvertX86p32_32RGBA888: - - ; check short - cmp ecx,BYTE 32 - ja .L3 - -.L1: ; short loop - mov edx,[esi] - rol edx,8 - mov [edi],edx - add esi,BYTE 4 - add edi,BYTE 4 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; save ebp - push ebp - - ; unroll four times - mov ebp,ecx - shr ebp,2 - - ; save count - push ecx - -.L4: mov eax,[esi] - mov ebx,[esi+4] - - rol eax,8 - mov ecx,[esi+8] - - rol ebx,8 - mov edx,[esi+12] - - rol ecx,8 - mov [edi+0],eax - - rol edx,8 - mov [edi+4],ebx - - mov [edi+8],ecx - mov [edi+12],edx - - add esi,BYTE 16 - add edi,BYTE 16 - - dec ebp - jnz .L4 - - ; check tail - pop ecx - and ecx,BYTE 11b - jz .L6 - -.L5: ; tail loop - mov edx,[esi] - rol edx,8 - mov [edi],edx - add esi,BYTE 4 - add edi,BYTE 4 - dec ecx - jnz .L5 - -.L6: pop ebp - retn - - - - -_ConvertX86p32_32BGRA888: - - ; check short - cmp ecx,BYTE 32 - ja .L3 - -.L1: ; short loop - mov edx,[esi] - bswap edx - mov [edi],edx - add esi,BYTE 4 - add edi,BYTE 4 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; save ebp - push ebp - - ; unroll four times - mov ebp,ecx - shr ebp,2 - - ; save count - push ecx - -.L4: mov eax,[esi] - mov ebx,[esi+4] - - mov ecx,[esi+8] - mov edx,[esi+12] - - bswap eax - - bswap ebx - - bswap ecx - - bswap edx - - mov [edi+0],eax - mov [edi+4],ebx - - mov [edi+8],ecx - mov [edi+12],edx - - add esi,BYTE 16 - add edi,BYTE 16 - - dec ebp - jnz .L4 - - ; check tail - pop ecx - and ecx,BYTE 11b - jz .L6 - -.L5: ; tail loop - mov edx,[esi] - bswap edx - mov [edi],edx - add esi,BYTE 4 - add edi,BYTE 4 - dec ecx - jnz .L5 - -.L6: pop ebp - retn - - - - -;; 32 bit RGB 888 to 24 BIT RGB 888 - -_ConvertX86p32_24RGB888: - - ; check short - cmp ecx,BYTE 32 - ja .L3 - -.L1: ; short loop - mov al,[esi] - mov bl,[esi+1] - mov dl,[esi+2] - mov [edi],al - mov [edi+1],bl - mov [edi+2],dl - add esi,BYTE 4 - add edi,BYTE 3 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov edx,edi - and edx,BYTE 11b - jz .L4 - mov al,[esi] - mov bl,[esi+1] - mov dl,[esi+2] - mov [edi],al - mov [edi+1],bl - mov [edi+2],dl - add esi,BYTE 4 - add edi,BYTE 3 - dec ecx - jmp SHORT .L3 - -.L4: ; unroll 4 times - push ebp - mov ebp,ecx - shr ebp,2 - - ; save count - push ecx - -.L5: mov eax,[esi] ; first dword eax = [A][R][G][B] - mov ebx,[esi+4] ; second dword ebx = [a][r][g][b] - - shl eax,8 ; eax = [R][G][B][.] - mov ecx,[esi+12] ; third dword ecx = [a][r][g][b] - - shl ebx,8 ; ebx = [r][g][b][.] - mov al,[esi+4] ; eax = [R][G][B][b] - - ror eax,8 ; eax = [b][R][G][B] (done) - mov bh,[esi+8+1] ; ebx = [r][g][G][.] - - mov [edi],eax - add edi,BYTE 3*4 - - shl ecx,8 ; ecx = [r][g][b][.] - mov bl,[esi+8+0] ; ebx = [r][g][G][B] - - rol ebx,16 ; ebx = [G][B][r][g] (done) - mov cl,[esi+8+2] ; ecx = [r][g][b][R] (done) - - mov [edi+4-3*4],ebx - add esi,BYTE 4*4 - - mov [edi+8-3*4],ecx - dec ebp - - jnz .L5 - - ; check tail - pop ecx - and ecx,BYTE 11b - jz .L7 - -.L6: ; tail loop - mov al,[esi] - mov bl,[esi+1] - mov dl,[esi+2] - mov [edi],al - mov [edi+1],bl - mov [edi+2],dl - add esi,BYTE 4 - add edi,BYTE 3 - dec ecx - jnz .L6 - -.L7: pop ebp - retn - - - - -;; 32 bit RGB 888 to 24 bit BGR 888 - -_ConvertX86p32_24BGR888: - - ; check short - cmp ecx,BYTE 32 - ja .L3 - -.L1: ; short loop - mov dl,[esi] - mov bl,[esi+1] - mov al,[esi+2] - mov [edi],al - mov [edi+1],bl - mov [edi+2],dl - add esi,BYTE 4 - add edi,BYTE 3 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov edx,edi - and edx,BYTE 11b - jz .L4 - mov dl,[esi] - mov bl,[esi+1] - mov al,[esi+2] - mov [edi],al - mov [edi+1],bl - mov [edi+2],dl - add esi,BYTE 4 - add edi,BYTE 3 - dec ecx - jmp SHORT .L3 - -.L4: ; unroll 4 times - push ebp - mov ebp,ecx - shr ebp,2 - - ; save count - push ecx - -.L5: - mov eax,[esi] ; first dword eax = [A][R][G][B] - mov ebx,[esi+4] ; second dword ebx = [a][r][g][b] - - bswap eax ; eax = [B][G][R][A] - - bswap ebx ; ebx = [b][g][r][a] - - mov al,[esi+4+2] ; eax = [B][G][R][r] - mov bh,[esi+4+4+1] ; ebx = [b][g][G][a] - - ror eax,8 ; eax = [r][B][G][R] (done) - mov bl,[esi+4+4+2] ; ebx = [b][g][G][R] - - ror ebx,16 ; ebx = [G][R][b][g] (done) - mov [edi],eax - - mov [edi+4],ebx - mov ecx,[esi+12] ; third dword ecx = [a][r][g][b] - - bswap ecx ; ecx = [b][g][r][a] - - mov cl,[esi+8] ; ecx = [b][g][r][B] (done) - add esi,BYTE 4*4 - - mov [edi+8],ecx - add edi,BYTE 3*4 - - dec ebp - jnz .L5 - - ; check tail - pop ecx - and ecx,BYTE 11b - jz .L7 - -.L6: ; tail loop - mov dl,[esi] - mov bl,[esi+1] - mov al,[esi+2] - mov [edi],al - mov [edi+1],bl - mov [edi+2],dl - add esi,BYTE 4 - add edi,BYTE 3 - dec ecx - jnz .L6 - -.L7: - pop ebp - retn - - - - -;; 32 bit RGB 888 to 16 BIT RGB 565 - -_ConvertX86p32_16RGB565: - ; check short - cmp ecx,BYTE 16 - ja .L3 - -.L1: ; short loop - mov bl,[esi+0] ; blue - mov al,[esi+1] ; green - mov ah,[esi+2] ; red - shr ah,3 - and al,11111100b - shl eax,3 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - jnz .L1 - -.L2: ; End of short loop - retn - - -.L3: ; head - mov ebx,edi - and ebx,BYTE 11b - jz .L4 - - mov bl,[esi+0] ; blue - mov al,[esi+1] ; green - mov ah,[esi+2] ; red - shr ah,3 - and al,11111100b - shl eax,3 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - -.L4: - ; save count - push ecx - - ; unroll twice - shr ecx,1 - - ; point arrays to end - lea esi,[esi+ecx*8] - lea edi,[edi+ecx*4] - - ; negative counter - neg ecx - jmp SHORT .L6 - -.L5: - mov [edi+ecx*4-4],eax -.L6: - mov eax,[esi+ecx*8] - - shr ah,2 - mov ebx,[esi+ecx*8+4] - - shr eax,3 - mov edx,[esi+ecx*8+4] - - shr bh,2 - mov dl,[esi+ecx*8+2] - - shl ebx,13 - and eax,000007FFh - - shl edx,8 - and ebx,07FF0000h - - and edx,0F800F800h - add eax,ebx - - add eax,edx - inc ecx - - jnz .L5 - - mov [edi+ecx*4-4],eax - - ; tail - pop ecx - test cl,1 - jz .L7 - - mov bl,[esi+0] ; blue - mov al,[esi+1] ; green - mov ah,[esi+2] ; red - shr ah,3 - and al,11111100b - shl eax,3 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - -.L7: - retn - - - - -;; 32 bit RGB 888 to 16 BIT BGR 565 - -_ConvertX86p32_16BGR565: - - ; check short - cmp ecx,BYTE 16 - ja .L3 - -.L1: ; short loop - mov ah,[esi+0] ; blue - mov al,[esi+1] ; green - mov bl,[esi+2] ; red - shr ah,3 - and al,11111100b - shl eax,3 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov ebx,edi - and ebx,BYTE 11b - jz .L4 - mov ah,[esi+0] ; blue - mov al,[esi+1] ; green - mov bl,[esi+2] ; red - shr ah,3 - and al,11111100b - shl eax,3 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - -.L4: ; save count - push ecx - - ; unroll twice - shr ecx,1 - - ; point arrays to end - lea esi,[esi+ecx*8] - lea edi,[edi+ecx*4] - - ; negative count - neg ecx - jmp SHORT .L6 - -.L5: - mov [edi+ecx*4-4],eax -.L6: - mov edx,[esi+ecx*8+4] - - mov bh,[esi+ecx*8+4] - mov ah,[esi+ecx*8] - - shr bh,3 - mov al,[esi+ecx*8+1] - - shr ah,3 - mov bl,[esi+ecx*8+5] - - shl eax,3 - mov dl,[esi+ecx*8+2] - - shl ebx,19 - and eax,0000FFE0h - - shr edx,3 - and ebx,0FFE00000h - - and edx,001F001Fh - add eax,ebx - - add eax,edx - inc ecx - - jnz .L5 - - mov [edi+ecx*4-4],eax - - ; tail - pop ecx - and ecx,BYTE 1 - jz .L7 - mov ah,[esi+0] ; blue - mov al,[esi+1] ; green - mov bl,[esi+2] ; red - shr ah,3 - and al,11111100b - shl eax,3 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - -.L7: - retn - - - - -;; 32 BIT RGB TO 16 BIT RGB 555 - -_ConvertX86p32_16RGB555: - - ; check short - cmp ecx,BYTE 16 - ja .L3 - -.L1: ; short loop - mov bl,[esi+0] ; blue - mov al,[esi+1] ; green - mov ah,[esi+2] ; red - shr ah,3 - and al,11111000b - shl eax,2 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov ebx,edi - and ebx,BYTE 11b - jz .L4 - mov bl,[esi+0] ; blue - mov al,[esi+1] ; green - mov ah,[esi+2] ; red - shr ah,3 - and al,11111000b - shl eax,2 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - -.L4: ; save count - push ecx - - ; unroll twice - shr ecx,1 - - ; point arrays to end - lea esi,[esi+ecx*8] - lea edi,[edi+ecx*4] - - ; negative counter - neg ecx - jmp SHORT .L6 - -.L5: - mov [edi+ecx*4-4],eax -.L6: - mov eax,[esi+ecx*8] - - shr ah,3 - mov ebx,[esi+ecx*8+4] - - shr eax,3 - mov edx,[esi+ecx*8+4] - - shr bh,3 - mov dl,[esi+ecx*8+2] - - shl ebx,13 - and eax,000007FFh - - shl edx,7 - and ebx,07FF0000h - - and edx,07C007C00h - add eax,ebx - - add eax,edx - inc ecx - - jnz .L5 - - mov [edi+ecx*4-4],eax - - ; tail - pop ecx - and ecx,BYTE 1 - jz .L7 - mov bl,[esi+0] ; blue - mov al,[esi+1] ; green - mov ah,[esi+2] ; red - shr ah,3 - and al,11111000b - shl eax,2 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - -.L7: - retn - - - - -;; 32 BIT RGB TO 16 BIT BGR 555 - -_ConvertX86p32_16BGR555: - - ; check short - cmp ecx,BYTE 16 - ja .L3 - - -.L1: ; short loop - mov ah,[esi+0] ; blue - mov al,[esi+1] ; green - mov bl,[esi+2] ; red - shr ah,3 - and al,11111000b - shl eax,2 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - jnz .L1 -.L2: - retn - -.L3: ; head - mov ebx,edi - and ebx,BYTE 11b - jz .L4 - mov ah,[esi+0] ; blue - mov al,[esi+1] ; green - mov bl,[esi+2] ; red - shr ah,3 - and al,11111000b - shl eax,2 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - dec ecx - -.L4: ; save count - push ecx - - ; unroll twice - shr ecx,1 - - ; point arrays to end - lea esi,[esi+ecx*8] - lea edi,[edi+ecx*4] - - ; negative counter - neg ecx - jmp SHORT .L6 - -.L5: - mov [edi+ecx*4-4],eax -.L6: - mov edx,[esi+ecx*8+4] - - mov bh,[esi+ecx*8+4] - mov ah,[esi+ecx*8] - - shr bh,3 - mov al,[esi+ecx*8+1] - - shr ah,3 - mov bl,[esi+ecx*8+5] - - shl eax,2 - mov dl,[esi+ecx*8+2] - - shl ebx,18 - and eax,00007FE0h - - shr edx,3 - and ebx,07FE00000h - - and edx,001F001Fh - add eax,ebx - - add eax,edx - inc ecx - - jnz .L5 - - mov [edi+ecx*4-4],eax - - ; tail - pop ecx - and ecx,BYTE 1 - jz .L7 - mov ah,[esi+0] ; blue - mov al,[esi+1] ; green - mov bl,[esi+2] ; red - shr ah,3 - and al,11111000b - shl eax,2 - shr bl,3 - add al,bl - mov [edi+0],al - mov [edi+1],ah - add esi,BYTE 4 - add edi,BYTE 2 - -.L7: - retn - - - - - -;; FROM 32 BIT RGB to 8 BIT RGB (rrrgggbbb) -;; This routine writes FOUR pixels at once (dword) and then, if they exist -;; the trailing three pixels -_ConvertX86p32_8RGB332: - - -.L_ALIGNED: - push ecx - - shr ecx,2 ; We will draw 4 pixels at once - jnz .L1 - - jmp .L2 ; short jump out of range :( - -.L1: - mov eax,[esi] ; first pair of pixels - mov edx,[esi+4] - - shr dl,6 - mov ebx,eax - - shr al,6 - and ah,0e0h - - shr ebx,16 - and dh,0e0h - - shr ah,3 - and bl,0e0h - - shr dh,3 - - or al,bl - - mov ebx,edx - or al,ah - - shr ebx,16 - or dl,dh - - and bl,0e0h - - or dl,bl - - mov ah,dl - - - - mov ebx,[esi+8] ; second pair of pixels - - mov edx,ebx - and bh,0e0h - - shr bl,6 - and edx,0e00000h - - shr edx,16 - - shr bh,3 - - ror eax,16 - or bl,dl - - mov edx,[esi+12] - or bl,bh - - mov al,bl - - mov ebx,edx - and dh,0e0h - - shr dl,6 - and ebx,0e00000h - - shr dh,3 - mov ah,dl - - shr ebx,16 - or ah,dh - - or ah,bl - - rol eax,16 - add esi,BYTE 16 - - mov [edi],eax - add edi,BYTE 4 - - dec ecx - jz .L2 ; L1 out of range for short jump :( - - jmp .L1 -.L2: - - pop ecx - and ecx,BYTE 3 ; mask out number of pixels to draw - - jz .L4 ; Nothing to do anymore - -.L3: - mov eax,[esi] ; single pixel conversion for trailing pixels - - mov ebx,eax - - shr al,6 - and ah,0e0h - - shr ebx,16 - - shr ah,3 - and bl,0e0h - - or al,ah - or al,bl - - mov [edi],al - - inc edi - add esi,BYTE 4 - - dec ecx - jnz .L3 - -.L4: - retn - -%ifidn __OUTPUT_FORMAT__,elf32 -section .note.GNU-stack noalloc noexec nowrite progbits -%endif diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c new file mode 100644 index 0000000000..912be05248 --- /dev/null +++ b/src/joystick/SDL_gamecontroller.c @@ -0,0 +1,1249 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* This is the game controller API for Simple DirectMedia Layer */ + +#include "SDL_events.h" +#include "SDL_assert.h" +#include "SDL_sysjoystick.h" +#include "SDL_hints.h" +#include "SDL_gamecontrollerdb.h" + +#if !SDL_EVENTS_DISABLED +#include "../events/SDL_events_c.h" +#endif +#define ABS(_x) ((_x) < 0 ? -(_x) : (_x)) + + +/* a list of currently opened game controllers */ +static SDL_GameController *SDL_gamecontrollers = NULL; + +/* keep track of the hat and mask value that transforms this hat movement into a button/axis press */ +struct _SDL_HatMapping +{ + int hat; + Uint8 mask; +}; + +#define k_nMaxReverseEntries 20 + +/** + * We are encoding the "HAT" as 0xhm. where h == hat ID and m == mask + * MAX 4 hats supported + */ +#define k_nMaxHatEntries 0x3f + 1 + +/* our in memory mapping db between joystick objects and controller mappings*/ +struct _SDL_ControllerMapping +{ + SDL_JoystickGUID guid; + const char *name; + + /* mapping of axis/button id to controller version */ + int axes[SDL_CONTROLLER_AXIS_MAX]; + int buttonasaxis[SDL_CONTROLLER_AXIS_MAX]; + + int buttons[SDL_CONTROLLER_BUTTON_MAX]; + int axesasbutton[SDL_CONTROLLER_BUTTON_MAX]; + struct _SDL_HatMapping hatasbutton[SDL_CONTROLLER_BUTTON_MAX]; + + /* reverse mapping, joystick indices to buttons */ + SDL_GameControllerAxis raxes[k_nMaxReverseEntries]; + SDL_GameControllerAxis rbuttonasaxis[k_nMaxReverseEntries]; + + SDL_GameControllerButton rbuttons[k_nMaxReverseEntries]; + SDL_GameControllerButton raxesasbutton[k_nMaxReverseEntries]; + SDL_GameControllerButton rhatasbutton[k_nMaxHatEntries]; + +}; + + +/* our hard coded list of mapping support */ +typedef struct _ControllerMapping_t +{ + SDL_JoystickGUID guid; + char *name; + char *mapping; + struct _ControllerMapping_t *next; +} ControllerMapping_t; + +static ControllerMapping_t *s_pSupportedControllers = NULL; +#ifdef SDL_JOYSTICK_DINPUT +static ControllerMapping_t *s_pXInputMapping = NULL; +#endif + +/* The SDL game controller structure */ +struct _SDL_GameController +{ + SDL_Joystick *joystick; /* underlying joystick device */ + int ref_count; + Uint8 hatState[4]; /* the current hat state for this controller */ + struct _SDL_ControllerMapping mapping; /* the mapping object for this controller */ + struct _SDL_GameController *next; /* pointer to next game controller we have allocated */ +}; + + +int SDL_PrivateGameControllerAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis, Sint16 value); +int SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button, Uint8 state); + +/* + * Event filter to fire controller events from joystick ones + */ +int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event) +{ + switch( event->type ) + { + case SDL_JOYAXISMOTION: + { + SDL_GameController *controllerlist; + + if ( event->jaxis.axis >= k_nMaxReverseEntries ) break; + + controllerlist = SDL_gamecontrollers; + while ( controllerlist ) + { + if ( controllerlist->joystick->instance_id == event->jaxis.which ) + { + if ( controllerlist->mapping.raxes[event->jaxis.axis] >= 0 ) /* simple axis to axis, send it through */ + { + SDL_GameControllerAxis axis = controllerlist->mapping.raxes[event->jaxis.axis]; + Sint16 value = event->jaxis.value; + switch (axis) + { + case SDL_CONTROLLER_AXIS_TRIGGERLEFT: + case SDL_CONTROLLER_AXIS_TRIGGERRIGHT: + /* Shift it to be 0 - 32767. */ + value = value / 2 + 16384; + default: + break; + } + SDL_PrivateGameControllerAxis( controllerlist, axis, value ); + } + else if ( controllerlist->mapping.raxesasbutton[event->jaxis.axis] >= 0 ) /* simulate an axis as a button */ + { + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.raxesasbutton[event->jaxis.axis], ABS(event->jaxis.value) > 32768/2 ? SDL_PRESSED : SDL_RELEASED ); + } + break; + } + controllerlist = controllerlist->next; + } + } + break; + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + { + SDL_GameController *controllerlist; + + if ( event->jbutton.button >= k_nMaxReverseEntries ) break; + + controllerlist = SDL_gamecontrollers; + while ( controllerlist ) + { + if ( controllerlist->joystick->instance_id == event->jbutton.which ) + { + if ( controllerlist->mapping.rbuttons[event->jbutton.button] >= 0 ) /* simple button as button */ + { + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rbuttons[event->jbutton.button], event->jbutton.state ); + } + else if ( controllerlist->mapping.rbuttonasaxis[event->jbutton.button] >= 0 ) /* an button pretending to be an axis */ + { + SDL_PrivateGameControllerAxis( controllerlist, controllerlist->mapping.rbuttonasaxis[event->jbutton.button], event->jbutton.state > 0 ? 32767 : 0 ); + } + break; + } + controllerlist = controllerlist->next; + } + } + break; + case SDL_JOYHATMOTION: + { + SDL_GameController *controllerlist; + + if ( event->jhat.hat >= 4 ) break; + + controllerlist = SDL_gamecontrollers; + while ( controllerlist ) + { + if ( controllerlist->joystick->instance_id == event->jhat.which ) + { + Uint8 bSame = controllerlist->hatState[event->jhat.hat] & event->jhat.value; + /* Get list of removed bits (button release) */ + Uint8 bChanged = controllerlist->hatState[event->jhat.hat] ^ bSame; + /* the hat idx in the high nibble */ + int bHighHat = event->jhat.hat << 4; + + if ( bChanged & SDL_HAT_DOWN ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_DOWN], SDL_RELEASED ); + if ( bChanged & SDL_HAT_UP ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_UP], SDL_RELEASED ); + if ( bChanged & SDL_HAT_LEFT ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_LEFT], SDL_RELEASED ); + if ( bChanged & SDL_HAT_RIGHT ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_RIGHT], SDL_RELEASED ); + + /* Get list of added bits (button press) */ + bChanged = event->jhat.value ^ bSame; + + if ( bChanged & SDL_HAT_DOWN ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_DOWN], SDL_PRESSED ); + if ( bChanged & SDL_HAT_UP ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_UP], SDL_PRESSED ); + if ( bChanged & SDL_HAT_LEFT ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_LEFT], SDL_PRESSED ); + if ( bChanged & SDL_HAT_RIGHT ) + SDL_PrivateGameControllerButton( controllerlist, controllerlist->mapping.rhatasbutton[bHighHat | SDL_HAT_RIGHT], SDL_PRESSED ); + + /* update our state cache */ + controllerlist->hatState[event->jhat.hat] = event->jhat.value; + + break; + } + controllerlist = controllerlist->next; + } + } + break; + case SDL_JOYDEVICEADDED: + { + if ( SDL_IsGameController(event->jdevice.which ) ) + { + SDL_Event deviceevent; + deviceevent.type = SDL_CONTROLLERDEVICEADDED; + deviceevent.cdevice.which = event->jdevice.which; + SDL_PushEvent(&deviceevent); + } + } + break; + case SDL_JOYDEVICEREMOVED: + { + SDL_GameController *controllerlist = SDL_gamecontrollers; + while ( controllerlist ) + { + if ( controllerlist->joystick->instance_id == event->jdevice.which ) + { + SDL_Event deviceevent; + deviceevent.type = SDL_CONTROLLERDEVICEREMOVED; + deviceevent.cdevice.which = event->jdevice.which; + SDL_PushEvent(&deviceevent); + break; + } + controllerlist = controllerlist->next; + } + } + break; + default: + break; + } + + return 1; +} + +/* + * Helper function to scan the mappings database for a controller with the specified GUID + */ +ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID *guid) +{ + ControllerMapping_t *pSupportedController = s_pSupportedControllers; + while ( pSupportedController ) + { + if ( !SDL_memcmp( guid, &pSupportedController->guid, sizeof(*guid) ) ) + { + return pSupportedController; + } + pSupportedController = pSupportedController->next; + } + return NULL; +} + +/* + * Helper function to determine pre-calculated offset to certain joystick mappings + */ +ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index) +{ +#ifdef SDL_JOYSTICK_DINPUT + if ( SDL_SYS_IsXInputDeviceIndex(device_index) && s_pXInputMapping ) + { + return s_pXInputMapping; + } + else +#endif + { + SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID( device_index ); + return SDL_PrivateGetControllerMappingForGUID(&jGUID); + } + + return NULL; +} + +static const char* map_StringForControllerAxis[] = { + "leftx", + "lefty", + "rightx", + "righty", + "lefttrigger", + "righttrigger", + NULL +}; + +/* + * convert a string to its enum equivalent + */ +SDL_GameControllerAxis SDL_GameControllerGetAxisFromString( const char *pchString ) +{ + int entry; + if ( !pchString || !pchString[0] ) + return SDL_CONTROLLER_AXIS_INVALID; + + for ( entry = 0; map_StringForControllerAxis[entry]; ++entry) + { + if ( !SDL_strcasecmp( pchString, map_StringForControllerAxis[entry] ) ) + return entry; + } + return SDL_CONTROLLER_AXIS_INVALID; +} + +/* + * convert an enum to its string equivalent + */ +const char* SDL_GameControllerGetStringForAxis( SDL_GameControllerAxis axis ) +{ + if (axis > SDL_CONTROLLER_AXIS_INVALID && axis < SDL_CONTROLLER_AXIS_MAX) + { + return map_StringForControllerAxis[axis]; + } + return NULL; +} + +static const char* map_StringForControllerButton[] = { + "a", + "b", + "x", + "y", + "back", + "guide", + "start", + "leftstick", + "rightstick", + "leftshoulder", + "rightshoulder", + "dpup", + "dpdown", + "dpleft", + "dpright", + NULL +}; + +/* + * convert a string to its enum equivalent + */ +SDL_GameControllerButton SDL_GameControllerGetButtonFromString( const char *pchString ) +{ + int entry; + if ( !pchString || !pchString[0] ) + return SDL_CONTROLLER_BUTTON_INVALID; + + for ( entry = 0; map_StringForControllerButton[entry]; ++entry) + { + if ( !SDL_strcasecmp( pchString, map_StringForControllerButton[entry] ) ) + return entry; + } + return SDL_CONTROLLER_BUTTON_INVALID; +} + +/* + * convert an enum to its string equivalent + */ +const char* SDL_GameControllerGetStringForButton( SDL_GameControllerButton axis ) +{ + if (axis > SDL_CONTROLLER_BUTTON_INVALID && axis < SDL_CONTROLLER_BUTTON_MAX) + { + return map_StringForControllerButton[axis]; + } + return NULL; +} + +/* + * given a controller button name and a joystick name update our mapping structure with it + */ +void SDL_PrivateGameControllerParseButton( const char *szGameButton, const char *szJoystickButton, struct _SDL_ControllerMapping *pMapping ) +{ + int iSDLButton = 0; + SDL_GameControllerButton button; + SDL_GameControllerAxis axis; + button = SDL_GameControllerGetButtonFromString( szGameButton ); + axis = SDL_GameControllerGetAxisFromString( szGameButton ); + iSDLButton = SDL_atoi( &szJoystickButton[1] ); + + if ( szJoystickButton[0] == 'a' ) + { + if ( iSDLButton >= k_nMaxReverseEntries ) + { + SDL_SetError("Axis index too large: %d", iSDLButton ); + return; + } + if ( axis != SDL_CONTROLLER_AXIS_INVALID ) + { + pMapping->axes[ axis ] = iSDLButton; + pMapping->raxes[ iSDLButton ] = axis; + } + else if ( button != SDL_CONTROLLER_BUTTON_INVALID ) + { + pMapping->axesasbutton[ button ] = iSDLButton; + pMapping->raxesasbutton[ iSDLButton ] = button; + } + else + { + SDL_assert( !"How did we get here?" ); + } + + } + else if ( szJoystickButton[0] == 'b' ) + { + if ( iSDLButton >= k_nMaxReverseEntries ) + { + SDL_SetError("Button index too large: %d", iSDLButton ); + return; + } + if ( button != SDL_CONTROLLER_BUTTON_INVALID ) + { + pMapping->buttons[ button ] = iSDLButton; + pMapping->rbuttons[ iSDLButton ] = button; + } + else if ( axis != SDL_CONTROLLER_AXIS_INVALID ) + { + pMapping->buttonasaxis[ axis ] = iSDLButton; + pMapping->rbuttonasaxis[ iSDLButton ] = axis; + } + else + { + SDL_assert( !"How did we get here?" ); + } + } + else if ( szJoystickButton[0] == 'h' ) + { + int hat = SDL_atoi( &szJoystickButton[1] ); + int mask = SDL_atoi( &szJoystickButton[3] ); + if (hat >= 4) { + SDL_SetError("Hat index too large: %d", iSDLButton ); + } + + if ( button != SDL_CONTROLLER_BUTTON_INVALID ) + { + int ridx; + pMapping->hatasbutton[ button ].hat = hat; + pMapping->hatasbutton[ button ].mask = mask; + ridx = (hat << 4) | mask; + pMapping->rhatasbutton[ ridx ] = button; + } + else if ( axis != SDL_CONTROLLER_AXIS_INVALID ) + { + SDL_assert( !"Support hat as axis" ); + } + else + { + SDL_assert( !"How did we get here?" ); + } + } +} + + +/* + * given a controller mapping string update our mapping object + */ +static void +SDL_PrivateGameControllerParseControllerConfigString( struct _SDL_ControllerMapping *pMapping, const char *pchString ) +{ + char szGameButton[20]; + char szJoystickButton[20]; + SDL_bool bGameButton = SDL_TRUE; + int i = 0; + const char *pchPos = pchString; + + SDL_memset( szGameButton, 0x0, sizeof(szGameButton) ); + SDL_memset( szJoystickButton, 0x0, sizeof(szJoystickButton) ); + + while ( pchPos && *pchPos ) + { + if ( *pchPos == ':' ) + { + i = 0; + bGameButton = SDL_FALSE; + } + else if ( *pchPos == ' ' ) + { + + } + else if ( *pchPos == ',' ) + { + i = 0; + bGameButton = SDL_TRUE; + SDL_PrivateGameControllerParseButton( szGameButton, szJoystickButton, pMapping ); + SDL_memset( szGameButton, 0x0, sizeof(szGameButton) ); + SDL_memset( szJoystickButton, 0x0, sizeof(szJoystickButton) ); + + } + else if ( bGameButton ) + { + if ( i >= sizeof(szGameButton)) + { + SDL_SetError( "Button name too large: %s", szGameButton ); + return; + } + szGameButton[i] = *pchPos; + i++; + } + else + { + if ( i >= sizeof(szJoystickButton)) + { + SDL_SetError( "Joystick button name too large: %s", szJoystickButton ); + return; + } + szJoystickButton[i] = *pchPos; + i++; + } + pchPos++; + } + + SDL_PrivateGameControllerParseButton( szGameButton, szJoystickButton, pMapping ); + +} + +/* + * Make a new button mapping struct + */ +void SDL_PrivateLoadButtonMapping( struct _SDL_ControllerMapping *pMapping, SDL_JoystickGUID guid, const char *pchName, const char *pchMapping ) +{ + int j; + + pMapping->guid = guid; + pMapping->name = pchName; + + /* set all the button mappings to non defaults */ + for ( j = 0; j < SDL_CONTROLLER_AXIS_MAX; j++ ) + { + pMapping->axes[j] = -1; + pMapping->buttonasaxis[j] = -1; + } + for ( j = 0; j < SDL_CONTROLLER_BUTTON_MAX; j++ ) + { + pMapping->buttons[j] = -1; + pMapping->axesasbutton[j] = -1; + pMapping->hatasbutton[j].hat = -1; + } + + for ( j = 0; j < k_nMaxReverseEntries; j++ ) + { + pMapping->raxes[j] = SDL_CONTROLLER_AXIS_INVALID; + pMapping->rbuttonasaxis[j] = SDL_CONTROLLER_AXIS_INVALID; + pMapping->rbuttons[j] = SDL_CONTROLLER_BUTTON_INVALID; + pMapping->raxesasbutton[j] = SDL_CONTROLLER_BUTTON_INVALID; + } + + for (j = 0; j < k_nMaxHatEntries; j++) + { + pMapping->rhatasbutton[j] = SDL_CONTROLLER_BUTTON_INVALID; + } + + SDL_PrivateGameControllerParseControllerConfigString( pMapping, pchMapping ); +} + + +/* + * grab the guid string from a mapping string + */ +char *SDL_PrivateGetControllerGUIDFromMappingString( const char *pMapping ) +{ + const char *pFirstComma = SDL_strchr( pMapping, ',' ); + if ( pFirstComma ) + { + char *pchGUID = SDL_malloc( pFirstComma - pMapping + 1 ); + if ( !pchGUID ) + { + SDL_OutOfMemory(); + return NULL; + } + SDL_memcpy( pchGUID, pMapping, pFirstComma - pMapping ); + pchGUID[ pFirstComma - pMapping ] = 0; + return pchGUID; + } + return NULL; +} + + +/* + * grab the name string from a mapping string + */ +char *SDL_PrivateGetControllerNameFromMappingString( const char *pMapping ) +{ + const char *pFirstComma, *pSecondComma; + char *pchName; + + pFirstComma = SDL_strchr( pMapping, ',' ); + if ( !pFirstComma ) + return NULL; + + pSecondComma = SDL_strchr( pFirstComma + 1, ',' ); + if ( !pSecondComma ) + return NULL; + + pchName = SDL_malloc( pSecondComma - pFirstComma ); + if ( !pchName ) + { + SDL_OutOfMemory(); + return NULL; + } + SDL_memcpy( pchName, pFirstComma + 1, pSecondComma - pFirstComma ); + pchName[ pSecondComma - pFirstComma - 1 ] = 0; + return pchName; +} + + +/* + * grab the button mapping string from a mapping string + */ +char *SDL_PrivateGetControllerMappingFromMappingString( const char *pMapping ) +{ + const char *pFirstComma, *pSecondComma; + + pFirstComma = SDL_strchr( pMapping, ',' ); + if ( !pFirstComma ) + return NULL; + + pSecondComma = SDL_strchr( pFirstComma + 1, ',' ); + if ( !pSecondComma ) + return NULL; + + return SDL_strdup(pSecondComma + 1); /* mapping is everything after the 3rd comma */ +} + +void SDL_PrivateGameControllerRefreshMapping( ControllerMapping_t *pControllerMapping ) +{ + SDL_GameController *gamecontrollerlist = SDL_gamecontrollers; + while ( gamecontrollerlist ) + { + if ( !SDL_memcmp( &gamecontrollerlist->mapping.guid, &pControllerMapping->guid, sizeof(pControllerMapping->guid) ) ) + { + SDL_Event event; + event.type = SDL_CONTROLLERDEVICEREMAPPED; + event.cdevice.which = gamecontrollerlist->joystick->instance_id; + SDL_PushEvent(&event); + + /* Not really threadsafe. Should this lock access within SDL_GameControllerEventWatcher? */ + SDL_PrivateLoadButtonMapping(&gamecontrollerlist->mapping, pControllerMapping->guid, pControllerMapping->name, pControllerMapping->mapping); + } + + gamecontrollerlist = gamecontrollerlist->next; + } +} + +/* + * Add or update an entry into the Mappings Database + */ +int +SDL_GameControllerAddMapping( const char *mappingString ) +{ + char *pchGUID; + char *pchName; + char *pchMapping; + SDL_JoystickGUID jGUID; + ControllerMapping_t *pControllerMapping; +#ifdef SDL_JOYSTICK_DINPUT + SDL_bool is_xinput_mapping = SDL_FALSE; +#endif + + pchGUID = SDL_PrivateGetControllerGUIDFromMappingString( mappingString ); + if (!pchGUID) { + return -1; + } +#ifdef SDL_JOYSTICK_DINPUT + if ( !SDL_strcasecmp( pchGUID, "xinput" ) ) { + is_xinput_mapping = SDL_TRUE; + } +#endif + jGUID = SDL_JoystickGetGUIDFromString(pchGUID); + SDL_free(pchGUID); + + pControllerMapping = SDL_PrivateGetControllerMappingForGUID(&jGUID); + + pchName = SDL_PrivateGetControllerNameFromMappingString( mappingString ); + if (!pchName) return -1; + + pchMapping = SDL_PrivateGetControllerMappingFromMappingString( mappingString ); + if (!pchMapping) { + SDL_free( pchName ); + return -1; + } + + if (pControllerMapping) { + /* Update existing mapping */ + SDL_free( pControllerMapping->name ); + pControllerMapping->name = pchName; + SDL_free( pControllerMapping->mapping ); + pControllerMapping->mapping = pchMapping; + /* refresh open controllers */ + SDL_PrivateGameControllerRefreshMapping( pControllerMapping ); + return 0; + } else { + pControllerMapping = SDL_malloc( sizeof(*pControllerMapping) ); + if (!pControllerMapping) { + SDL_free( pchName ); + SDL_free( pchMapping ); + return SDL_OutOfMemory(); + } +#ifdef SDL_JOYSTICK_DINPUT + if ( is_xinput_mapping ) + { + s_pXInputMapping = pControllerMapping; + } +#endif + pControllerMapping->guid = jGUID; + pControllerMapping->name = pchName; + pControllerMapping->mapping = pchMapping; + pControllerMapping->next = s_pSupportedControllers; + s_pSupportedControllers = pControllerMapping; + return 1; + } +} + +/* + * Get the mapping string for this GUID + */ +char * +SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid ) +{ + char *pMappingString = NULL; + ControllerMapping_t *mapping = SDL_PrivateGetControllerMappingForGUID(&guid); + if (mapping) { + char pchGUID[33]; + size_t needed; + SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID)); + /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ + needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1; + pMappingString = SDL_malloc( needed ); + SDL_snprintf( pMappingString, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping ); + } + return pMappingString; +} + +/* + * Get the mapping string for this device + */ +char * +SDL_GameControllerMapping( SDL_GameController * gamecontroller ) +{ + return SDL_GameControllerMappingForGUID( gamecontroller->mapping.guid ); +} + +static void +SDL_GameControllerLoadHints() +{ + const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG); + if ( hint && hint[0] ) { + int nchHints = SDL_strlen( hint ); + char *pUserMappings = SDL_malloc( nchHints + 1 ); + char *pTempMappings = pUserMappings; + SDL_memcpy( pUserMappings, hint, nchHints ); + while ( pUserMappings ) { + char *pchNewLine = NULL; + + pchNewLine = SDL_strchr( pUserMappings, '\n' ); + if ( pchNewLine ) + *pchNewLine = '\0'; + + SDL_GameControllerAddMapping( pUserMappings ); + + if ( pchNewLine ) + pUserMappings = pchNewLine + 1; + else + pUserMappings = NULL; + } + SDL_free(pTempMappings); + } +} + +/* + * Initialize the game controller system, mostly load our DB of controller config mappings + */ +int +SDL_GameControllerInit(void) +{ + int i = 0; + const char *pMappingString = NULL; + s_pSupportedControllers = NULL; + pMappingString = s_ControllerMappings[i]; + while ( pMappingString ) + { + SDL_GameControllerAddMapping( pMappingString ); + + i++; + pMappingString = s_ControllerMappings[i]; + } + + /* load in any user supplied config */ + SDL_GameControllerLoadHints(); + + /* watch for joy events and fire controller ones if needed */ + SDL_AddEventWatch( SDL_GameControllerEventWatcher, NULL ); + + return (0); +} + + +/* + * Get the implementation dependent name of a controller + */ +const char * +SDL_GameControllerNameForIndex(int device_index) +{ + ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index); + if ( pSupportedController ) + { + return pSupportedController->name; + } + return NULL; +} + + +/* + * Return 1 if the joystick at this device index is a supported controller + */ +SDL_bool +SDL_IsGameController(int device_index) +{ + ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index); + if ( pSupportedController ) + { + return SDL_TRUE; + } + + return SDL_FALSE; +} + +/* + * Open a controller for use - the index passed as an argument refers to + * the N'th controller on the system. This index is the value which will + * identify this controller in future controller events. + * + * This function returns a controller identifier, or NULL if an error occurred. + */ +SDL_GameController * +SDL_GameControllerOpen(int device_index) +{ + SDL_GameController *gamecontroller; + SDL_GameController *gamecontrollerlist; + ControllerMapping_t *pSupportedController = NULL; + + if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) { + SDL_SetError("There are %d joysticks available", SDL_NumJoysticks()); + return (NULL); + } + + gamecontrollerlist = SDL_gamecontrollers; + /* If the controller is already open, return it */ + while ( gamecontrollerlist ) + { + if ( SDL_SYS_GetInstanceIdOfDeviceIndex(device_index) == gamecontrollerlist->joystick->instance_id ) { + gamecontroller = gamecontrollerlist; + ++gamecontroller->ref_count; + return (gamecontroller); + } + gamecontrollerlist = gamecontrollerlist->next; + } + + /* Find a controller mapping */ + pSupportedController = SDL_PrivateGetControllerMapping(device_index); + if ( !pSupportedController ) { + SDL_SetError("Couldn't find mapping for device (%d)", device_index ); + return (NULL); + } + + /* Create and initialize the joystick */ + gamecontroller = (SDL_GameController *) SDL_malloc((sizeof *gamecontroller)); + if (gamecontroller == NULL) { + SDL_OutOfMemory(); + return NULL; + } + + SDL_memset(gamecontroller, 0, (sizeof *gamecontroller)); + gamecontroller->joystick = SDL_JoystickOpen(device_index); + if ( !gamecontroller->joystick ) { + SDL_free(gamecontroller); + return NULL; + } + + SDL_PrivateLoadButtonMapping( &gamecontroller->mapping, pSupportedController->guid, pSupportedController->name, pSupportedController->mapping ); + + /* Add joystick to list */ + ++gamecontroller->ref_count; + /* Link the joystick in the list */ + gamecontroller->next = SDL_gamecontrollers; + SDL_gamecontrollers = gamecontroller; + + SDL_SYS_JoystickUpdate( gamecontroller->joystick ); + + return (gamecontroller); +} + +/* + * Manually pump for controller updates. + */ +void +SDL_GameControllerUpdate(void) +{ + /* Just for API completeness; the joystick API does all the work. */ + SDL_JoystickUpdate(); +} + + +/* + * Get the current state of an axis control on a controller + */ +Sint16 +SDL_GameControllerGetAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis) +{ + if ( !gamecontroller ) + return 0; + + if (gamecontroller->mapping.axes[axis] >= 0 ) + { + Sint16 value = ( SDL_JoystickGetAxis( gamecontroller->joystick, gamecontroller->mapping.axes[axis]) ); + switch (axis) + { + case SDL_CONTROLLER_AXIS_TRIGGERLEFT: + case SDL_CONTROLLER_AXIS_TRIGGERRIGHT: + /* Shift it to be 0 - 32767. */ + value = value / 2 + 16384; + default: + break; + } + return value; + } + else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 ) + { + Uint8 value; + value = SDL_JoystickGetButton( gamecontroller->joystick, gamecontroller->mapping.buttonasaxis[axis] ); + if ( value > 0 ) + return 32767; + return 0; + } + return 0; +} + + +/* + * Get the current state of a button on a controller + */ +Uint8 +SDL_GameControllerGetButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button) +{ + if ( !gamecontroller ) + return 0; + + if ( gamecontroller->mapping.buttons[button] >= 0 ) + { + return ( SDL_JoystickGetButton( gamecontroller->joystick, gamecontroller->mapping.buttons[button] ) ); + } + else if ( gamecontroller->mapping.axesasbutton[button] >= 0 ) + { + Sint16 value; + value = SDL_JoystickGetAxis( gamecontroller->joystick, gamecontroller->mapping.axesasbutton[button] ); + if ( ABS(value) > 32768/2 ) + return 1; + return 0; + } + else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 ) + { + Uint8 value; + value = SDL_JoystickGetHat( gamecontroller->joystick, gamecontroller->mapping.hatasbutton[button].hat ); + + if ( value & gamecontroller->mapping.hatasbutton[button].mask ) + return 1; + return 0; + } + + return 0; +} + +/* + * Return if the joystick in question is currently attached to the system, + * \return 0 if not plugged in, 1 if still present. + */ +SDL_bool +SDL_GameControllerGetAttached( SDL_GameController * gamecontroller ) +{ + if ( !gamecontroller ) + return SDL_FALSE; + + return SDL_JoystickGetAttached(gamecontroller->joystick); +} + + +/* + * Get the number of multi-dimensional axis controls on a joystick + */ +const char * +SDL_GameControllerName(SDL_GameController * gamecontroller) +{ + if ( !gamecontroller ) + return NULL; + + return (gamecontroller->mapping.name); +} + + +/* + * Get the joystick for this controller + */ +SDL_Joystick *SDL_GameControllerGetJoystick(SDL_GameController * gamecontroller) +{ + if ( !gamecontroller ) + return NULL; + + return gamecontroller->joystick; +} + +/** + * Get the SDL joystick layer binding for this controller axis mapping + */ +SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis) +{ + SDL_GameControllerButtonBind bind; + SDL_memset( &bind, 0x0, sizeof(bind) ); + + if ( !gamecontroller || axis == SDL_CONTROLLER_AXIS_INVALID ) + return bind; + + if (gamecontroller->mapping.axes[axis] >= 0 ) + { + bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS; + bind.value.button = gamecontroller->mapping.axes[axis]; + } + else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 ) + { + bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON; + bind.value.button = gamecontroller->mapping.buttonasaxis[axis]; + } + + return bind; +} + + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button) +{ + SDL_GameControllerButtonBind bind; + SDL_memset( &bind, 0x0, sizeof(bind) ); + + if ( !gamecontroller || button == SDL_CONTROLLER_BUTTON_INVALID ) + return bind; + + if ( gamecontroller->mapping.buttons[button] >= 0 ) + { + bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON; + bind.value.button = gamecontroller->mapping.buttons[button]; + } + else if ( gamecontroller->mapping.axesasbutton[button] >= 0 ) + { + bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS; + bind.value.axis = gamecontroller->mapping.axesasbutton[button]; + } + else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 ) + { + bind.bindType = SDL_CONTROLLER_BINDTYPE_HAT; + bind.value.hat.hat = gamecontroller->mapping.hatasbutton[button].hat; + bind.value.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask; + } + + return bind; +} + + +/* + * Close a joystick previously opened with SDL_JoystickOpen() + */ +void +SDL_GameControllerClose(SDL_GameController * gamecontroller) +{ + SDL_GameController *gamecontrollerlist, *gamecontrollerlistprev; + + if ( !gamecontroller ) + return; + + /* First decrement ref count */ + if (--gamecontroller->ref_count > 0) { + return; + } + + SDL_JoystickClose( gamecontroller->joystick ); + + gamecontrollerlist = SDL_gamecontrollers; + gamecontrollerlistprev = NULL; + while ( gamecontrollerlist ) + { + if (gamecontroller == gamecontrollerlist) + { + if ( gamecontrollerlistprev ) + { + /* unlink this entry */ + gamecontrollerlistprev->next = gamecontrollerlist->next; + } + else + { + SDL_gamecontrollers = gamecontroller->next; + } + + break; + } + gamecontrollerlistprev = gamecontrollerlist; + gamecontrollerlist = gamecontrollerlist->next; + } + + SDL_free(gamecontroller); +} + + +/* + * Quit the controller subsystem + */ +void +SDL_GameControllerQuit(void) +{ + ControllerMapping_t *pControllerMap; + while ( SDL_gamecontrollers ) + { + SDL_gamecontrollers->ref_count = 1; + SDL_GameControllerClose(SDL_gamecontrollers); + } + + while ( s_pSupportedControllers ) + { + pControllerMap = s_pSupportedControllers; + s_pSupportedControllers = s_pSupportedControllers->next; + SDL_free( pControllerMap->name ); + SDL_free( pControllerMap ); + } + + SDL_DelEventWatch( SDL_GameControllerEventWatcher, NULL ); + +} + +/* + * Event filter to transform joystick events into appropriate game controller ones + */ +int +SDL_PrivateGameControllerAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis, Sint16 value) +{ + int posted; + + /* translate the event, if desired */ + posted = 0; +#if !SDL_EVENTS_DISABLED + if (SDL_GetEventState(SDL_CONTROLLERAXISMOTION) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_CONTROLLERAXISMOTION; + event.caxis.which = gamecontroller->joystick->instance_id; + event.caxis.axis = axis; + event.caxis.value = value; + posted = SDL_PushEvent(&event) == 1; + } +#endif /* !SDL_EVENTS_DISABLED */ + return (posted); +} + + +/* + * Event filter to transform joystick events into appropriate game controller ones + */ +int +SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button, Uint8 state) +{ + int posted; +#if !SDL_EVENTS_DISABLED + SDL_Event event; + + if ( button == SDL_CONTROLLER_BUTTON_INVALID ) + return (0); + + switch (state) { + case SDL_PRESSED: + event.type = SDL_CONTROLLERBUTTONDOWN; + break; + case SDL_RELEASED: + event.type = SDL_CONTROLLERBUTTONUP; + break; + default: + /* Invalid state -- bail */ + return (0); + } +#endif /* !SDL_EVENTS_DISABLED */ + + /* translate the event, if desired */ + posted = 0; +#if !SDL_EVENTS_DISABLED + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.cbutton.which = gamecontroller->joystick->instance_id; + event.cbutton.button = button; + event.cbutton.state = state; + posted = SDL_PushEvent(&event) == 1; + } +#endif /* !SDL_EVENTS_DISABLED */ + return (posted); +} + +/* + * Turn off controller events + */ +int +SDL_GameControllerEventState(int state) +{ +#if SDL_EVENTS_DISABLED + return SDL_IGNORE; +#else + const Uint32 event_list[] = { + SDL_CONTROLLERAXISMOTION, SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP, + SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED, + }; + unsigned int i; + + switch (state) { + case SDL_QUERY: + state = SDL_IGNORE; + for (i = 0; i < SDL_arraysize(event_list); ++i) { + state = SDL_EventState(event_list[i], SDL_QUERY); + if (state == SDL_ENABLE) { + break; + } + } + break; + default: + for (i = 0; i < SDL_arraysize(event_list); ++i) { + SDL_EventState(event_list[i], state); + } + break; + } + return (state); +#endif /* SDL_EVENTS_DISABLED */ +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/SDL_gamecontrollerdb.h b/src/joystick/SDL_gamecontrollerdb.h new file mode 100644 index 0000000000..7f6c7b29f3 --- /dev/null +++ b/src/joystick/SDL_gamecontrollerdb.h @@ -0,0 +1,65 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + + +/* Default mappings we support + + The easiest way to generate a new mapping is to start Steam in Big Picture + mode, configure your joystick and then look in config/config.vdf in your + Steam installation directory for the "SDL_GamepadBind" entry. + */ +static const char *s_ControllerMappings [] = +{ +#ifdef SDL_JOYSTICK_DINPUT + "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", + "ffff0000000000000000504944564944,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", + "6d0416c2000000000000504944564944,Generic DirectInput Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", + "6d0419c2000000000000504944564944,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */ + "88880803000000000000504944564944,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,", + "4c056802000000000000504944564944,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,", + "25090500000000000000504944564944,PS3 DualShock,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,", + "xinput,X360 Controller,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,", +#elif defined(__MACOSX__) + "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", + "6d0400000000000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */ + "6d0400000000000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", + "6d040000000000001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,", + "6d0400000000000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* This includes F710 in DInput mode and the "Logitech Cordless RumblePad 2", at the very least. */ + "4c050000000000006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,", + "5e040000000000008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,", +#elif defined(__LINUX__) + "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", + "03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,", + "030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", + "030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */ + "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,", + "030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", +#endif + NULL +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 083b01701d..bb8652f4d4 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1,87 +1,93 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* This is the joystick API for Simple DirectMedia Layer */ +#include "SDL.h" #include "SDL_events.h" #include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" +#include "SDL_assert.h" +#include "SDL_hints.h" + #if !SDL_EVENTS_DISABLED #include "../events/SDL_events_c.h" #endif -/* This is used for Quake III Arena */ -#if SDL_EVENTS_DISABLED -#define SDL_Lock_EventThread() -#define SDL_Unlock_EventThread() -#endif +static SDL_bool SDL_joystick_allows_background_events = SDL_FALSE; +static SDL_Joystick *SDL_joysticks = NULL; +static SDL_Joystick *SDL_updating_joystick = NULL; + +static void +SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +{ + if (hint && *hint == '1') { + SDL_joystick_allows_background_events = SDL_TRUE; + } else { + SDL_joystick_allows_background_events = SDL_FALSE; + } +} + +int +SDL_JoystickInit(void) +{ + int status; -Uint8 SDL_numjoysticks = 0; -int SDL_allocatedjoysticks = 0; -SDL_Joystick **SDL_joysticks = NULL; - -int SDL_JoystickInit(void) -{ - int arraylen; - int status; - - SDL_numjoysticks = 0; - status = SDL_SYS_JoystickInit(); - if ( status >= 0 ) { - SDL_allocatedjoysticks = status; - arraylen = (SDL_allocatedjoysticks+1)*sizeof(*SDL_joysticks); - SDL_joysticks = (SDL_Joystick **)SDL_malloc(arraylen); - if ( SDL_joysticks == NULL ) { - SDL_numjoysticks = 0; - SDL_allocatedjoysticks = 0; - } else { - SDL_memset(SDL_joysticks, 0, arraylen); - SDL_numjoysticks = status; - } - status = 0; - } - return(status); + /* See if we should allow joystick events while in the background */ + SDL_AddHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, + SDL_JoystickAllowBackgroundEventsChanged, NULL); + +#if !SDL_EVENTS_DISABLED + if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) { + return -1; + } +#endif /* !SDL_EVENTS_DISABLED */ + + status = SDL_SYS_JoystickInit(); + if (status >= 0) { + status = 0; + } + return (status); } /* * Count the number of joysticks attached to the system */ -int SDL_NumJoysticks(void) +int +SDL_NumJoysticks(void) { - return SDL_numjoysticks; + return SDL_SYS_NumJoysticks(); } /* * Get the implementation dependent name of a joystick */ -const char *SDL_JoystickName(int device_index) +const char * +SDL_JoystickNameForIndex(int device_index) { - if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) { - SDL_SetError("There are %d joysticks available", - SDL_numjoysticks); - return(NULL); - } - return(SDL_SYS_JoystickName(device_index)); + if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) { + SDL_SetError("There are %d joysticks available", SDL_NumJoysticks()); + return (NULL); + } + return (SDL_SYS_JoystickNameForDeviceIndex(device_index)); } /* @@ -91,516 +97,762 @@ const char *SDL_JoystickName(int device_index) * * This function returns a joystick identifier, or NULL if an error occurred. */ -SDL_Joystick *SDL_JoystickOpen(int device_index) -{ - int i; - SDL_Joystick *joystick; - - if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) { - SDL_SetError("There are %d joysticks available", - SDL_numjoysticks); - return(NULL); - } - - /* If the joystick is already open, return it */ - for ( i=0; SDL_joysticks[i]; ++i ) { - if ( device_index == SDL_joysticks[i]->index ) { - joystick = SDL_joysticks[i]; - ++joystick->ref_count; - return(joystick); - } - } - - /* Create and initialize the joystick */ - joystick = (SDL_Joystick *)SDL_malloc((sizeof *joystick)); - if ( !joystick ) { - SDL_OutOfMemory(); - return(NULL); - } - - SDL_memset(joystick, 0, (sizeof *joystick)); - joystick->index = device_index; - if ( SDL_SYS_JoystickOpen(joystick) < 0 ) { - SDL_free(joystick); - return(NULL); - } - - if ( joystick->naxes > 0 ) { - joystick->axes = (Sint16 *)SDL_malloc - (joystick->naxes*sizeof(Sint16)); - } - if ( joystick->nhats > 0 ) { - joystick->hats = (Uint8 *)SDL_malloc - (joystick->nhats*sizeof(Uint8)); - } - if ( joystick->nballs > 0 ) { - joystick->balls = (struct balldelta *)SDL_malloc - (joystick->nballs*sizeof(*joystick->balls)); - } - if ( joystick->nbuttons > 0 ) { - joystick->buttons = (Uint8 *)SDL_malloc - (joystick->nbuttons*sizeof(Uint8)); - } - if ( ((joystick->naxes > 0) && !joystick->axes) - || ((joystick->nhats > 0) && !joystick->hats) - || ((joystick->nballs > 0) && !joystick->balls) - || ((joystick->nbuttons > 0) && !joystick->buttons)) { - SDL_OutOfMemory(); - SDL_JoystickClose(joystick); - return(NULL); - } - - if ( joystick->axes ) { - SDL_memset(joystick->axes, 0, - joystick->naxes*sizeof(Sint16)); - } - if ( joystick->hats ) { - SDL_memset(joystick->hats, 0, - joystick->nhats*sizeof(Uint8)); - } - if ( joystick->balls ) { - SDL_memset(joystick->balls, 0, - joystick->nballs*sizeof(*joystick->balls)); - } - if ( joystick->buttons ) { - SDL_memset(joystick->buttons, 0, - joystick->nbuttons*sizeof(Uint8)); - } - - /* Add joystick to list */ - ++joystick->ref_count; - SDL_Lock_EventThread(); - for ( i=0; SDL_joysticks[i]; ++i ) - /* Skip to next joystick */ ; - SDL_joysticks[i] = joystick; - SDL_Unlock_EventThread(); - - return(joystick); +SDL_Joystick * +SDL_JoystickOpen(int device_index) +{ + SDL_Joystick *joystick; + SDL_Joystick *joysticklist; + const char *joystickname = NULL; + + if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) { + SDL_SetError("There are %d joysticks available", SDL_NumJoysticks()); + return (NULL); + } + + joysticklist = SDL_joysticks; + /* If the joystick is already open, return it + * it is important that we have a single joystick * for each instance id + */ + while ( joysticklist ) + { + if ( SDL_SYS_GetInstanceIdOfDeviceIndex(device_index) == joysticklist->instance_id ) { + joystick = joysticklist; + ++joystick->ref_count; + return (joystick); + } + joysticklist = joysticklist->next; + } + + /* Create and initialize the joystick */ + joystick = (SDL_Joystick *) SDL_malloc((sizeof *joystick)); + if (joystick == NULL) { + SDL_OutOfMemory(); + return NULL; + } + + SDL_memset(joystick, 0, (sizeof *joystick)); + if (SDL_SYS_JoystickOpen(joystick, device_index) < 0) { + SDL_free(joystick); + return NULL; + } + + joystickname = SDL_SYS_JoystickNameForDeviceIndex( device_index ); + if ( joystickname ) + joystick->name = SDL_strdup( joystickname ); + else + joystick->name = NULL; + + if (joystick->naxes > 0) { + joystick->axes = (Sint16 *) SDL_malloc + (joystick->naxes * sizeof(Sint16)); + } + if (joystick->nhats > 0) { + joystick->hats = (Uint8 *) SDL_malloc + (joystick->nhats * sizeof(Uint8)); + } + if (joystick->nballs > 0) { + joystick->balls = (struct balldelta *) SDL_malloc + (joystick->nballs * sizeof(*joystick->balls)); + } + if (joystick->nbuttons > 0) { + joystick->buttons = (Uint8 *) SDL_malloc + (joystick->nbuttons * sizeof(Uint8)); + } + if (((joystick->naxes > 0) && !joystick->axes) + || ((joystick->nhats > 0) && !joystick->hats) + || ((joystick->nballs > 0) && !joystick->balls) + || ((joystick->nbuttons > 0) && !joystick->buttons)) { + SDL_OutOfMemory(); + SDL_JoystickClose(joystick); + return NULL; + } + if (joystick->axes) { + SDL_memset(joystick->axes, 0, joystick->naxes * sizeof(Sint16)); + } + if (joystick->hats) { + SDL_memset(joystick->hats, 0, joystick->nhats * sizeof(Uint8)); + } + if (joystick->balls) { + SDL_memset(joystick->balls, 0, + joystick->nballs * sizeof(*joystick->balls)); + } + if (joystick->buttons) { + SDL_memset(joystick->buttons, 0, joystick->nbuttons * sizeof(Uint8)); + } + + /* Add joystick to list */ + ++joystick->ref_count; + /* Link the joystick in the list */ + joystick->next = SDL_joysticks; + SDL_joysticks = joystick; + + SDL_SYS_JoystickUpdate( joystick ); + + return (joystick); } + /* - * Returns 1 if the joystick has been opened, or 0 if it has not. + * Checks to make sure the joystick is valid. */ -int SDL_JoystickOpened(int device_index) +int +SDL_PrivateJoystickValid(SDL_Joystick * joystick) { - int i, opened; + int valid; - opened = 0; - for ( i=0; SDL_joysticks[i]; ++i ) { - if ( SDL_joysticks[i]->index == (Uint8)device_index ) { - opened = 1; - break; - } - } - return(opened); -} - -static int ValidJoystick(SDL_Joystick **joystick) -{ - int valid; + if ( joystick == NULL ) { + SDL_SetError("Joystick hasn't been opened yet"); + valid = 0; + } else { + valid = 1; + } - if ( *joystick == NULL ) { - SDL_SetError("Joystick hasn't been opened yet"); - valid = 0; - } else { - valid = 1; - } - return valid; -} + if ( joystick && joystick->closed ) + { + valid = 0; + } -/* - * Get the device index of an opened joystick. - */ -int SDL_JoystickIndex(SDL_Joystick *joystick) -{ - if ( ! ValidJoystick(&joystick) ) { - return(-1); - } - return(joystick->index); + return valid; } /* * Get the number of multi-dimensional axis controls on a joystick */ -int SDL_JoystickNumAxes(SDL_Joystick *joystick) +int +SDL_JoystickNumAxes(SDL_Joystick * joystick) { - if ( ! ValidJoystick(&joystick) ) { - return(-1); - } - return(joystick->naxes); + if (!SDL_PrivateJoystickValid(joystick)) { + return (-1); + } + return (joystick->naxes); } /* * Get the number of hats on a joystick */ -int SDL_JoystickNumHats(SDL_Joystick *joystick) +int +SDL_JoystickNumHats(SDL_Joystick * joystick) { - if ( ! ValidJoystick(&joystick) ) { - return(-1); - } - return(joystick->nhats); + if (!SDL_PrivateJoystickValid(joystick)) { + return (-1); + } + return (joystick->nhats); } /* * Get the number of trackballs on a joystick */ -int SDL_JoystickNumBalls(SDL_Joystick *joystick) +int +SDL_JoystickNumBalls(SDL_Joystick * joystick) { - if ( ! ValidJoystick(&joystick) ) { - return(-1); - } - return(joystick->nballs); + if (!SDL_PrivateJoystickValid(joystick)) { + return (-1); + } + return (joystick->nballs); } /* * Get the number of buttons on a joystick */ -int SDL_JoystickNumButtons(SDL_Joystick *joystick) +int +SDL_JoystickNumButtons(SDL_Joystick * joystick) { - if ( ! ValidJoystick(&joystick) ) { - return(-1); - } - return(joystick->nbuttons); + if (!SDL_PrivateJoystickValid(joystick)) { + return (-1); + } + return (joystick->nbuttons); } /* * Get the current state of an axis control on a joystick */ -Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis) +Sint16 +SDL_JoystickGetAxis(SDL_Joystick * joystick, int axis) { - Sint16 state; - - if ( ! ValidJoystick(&joystick) ) { - return(0); - } - if ( axis < joystick->naxes ) { - state = joystick->axes[axis]; - } else { - SDL_SetError("Joystick only has %d axes", joystick->naxes); - state = 0; - } - return(state); + Sint16 state; + + if (!SDL_PrivateJoystickValid(joystick)) { + return (0); + } + if (axis < joystick->naxes) { + state = joystick->axes[axis]; + } else { + SDL_SetError("Joystick only has %d axes", joystick->naxes); + state = 0; + } + return (state); } /* * Get the current state of a hat on a joystick */ -Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) +Uint8 +SDL_JoystickGetHat(SDL_Joystick * joystick, int hat) { - Uint8 state; - - if ( ! ValidJoystick(&joystick) ) { - return(0); - } - if ( hat < joystick->nhats ) { - state = joystick->hats[hat]; - } else { - SDL_SetError("Joystick only has %d hats", joystick->nhats); - state = 0; - } - return(state); + Uint8 state; + + if (!SDL_PrivateJoystickValid(joystick)) { + return (0); + } + if (hat < joystick->nhats) { + state = joystick->hats[hat]; + } else { + SDL_SetError("Joystick only has %d hats", joystick->nhats); + state = 0; + } + return (state); } /* * Get the ball axis change since the last poll */ -int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) -{ - int retval; - - if ( ! ValidJoystick(&joystick) ) { - return(-1); - } - - retval = 0; - if ( ball < joystick->nballs ) { - if ( dx ) { - *dx = joystick->balls[ball].dx; - } - if ( dy ) { - *dy = joystick->balls[ball].dy; - } - joystick->balls[ball].dx = 0; - joystick->balls[ball].dy = 0; - } else { - SDL_SetError("Joystick only has %d balls", joystick->nballs); - retval = -1; - } - return(retval); +int +SDL_JoystickGetBall(SDL_Joystick * joystick, int ball, int *dx, int *dy) +{ + int retval; + + if (!SDL_PrivateJoystickValid(joystick)) { + return (-1); + } + + retval = 0; + if (ball < joystick->nballs) { + if (dx) { + *dx = joystick->balls[ball].dx; + } + if (dy) { + *dy = joystick->balls[ball].dy; + } + joystick->balls[ball].dx = 0; + joystick->balls[ball].dy = 0; + } else { + return SDL_SetError("Joystick only has %d balls", joystick->nballs); + } + return (retval); } /* * Get the current state of a button on a joystick */ -Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button) +Uint8 +SDL_JoystickGetButton(SDL_Joystick * joystick, int button) +{ + Uint8 state; + + if (!SDL_PrivateJoystickValid(joystick)) { + return (0); + } + if (button < joystick->nbuttons) { + state = joystick->buttons[button]; + } else { + SDL_SetError("Joystick only has %d buttons", joystick->nbuttons); + state = 0; + } + return (state); +} + +/* + * Return if the joystick in question is currently attached to the system, + * \return SDL_FALSE if not plugged in, SDL_TRUE if still present. + */ +SDL_bool +SDL_JoystickGetAttached(SDL_Joystick * joystick) { - Uint8 state; + if (!SDL_PrivateJoystickValid(joystick)) { + return SDL_FALSE; + } - if ( ! ValidJoystick(&joystick) ) { - return(0); - } - if ( button < joystick->nbuttons ) { - state = joystick->buttons[button]; - } else { - SDL_SetError("Joystick only has %d buttons",joystick->nbuttons); - state = 0; - } - return(state); + return SDL_SYS_JoystickAttached(joystick); } /* - * Close a joystick previously opened with SDL_JoystickOpen() + * Get the instance id for this opened joystick */ -void SDL_JoystickClose(SDL_Joystick *joystick) -{ - int i; - - if ( ! ValidJoystick(&joystick) ) { - return; - } - - /* First decrement ref count */ - if ( --joystick->ref_count > 0 ) { - return; - } - - /* Lock the event queue - prevent joystick polling */ - SDL_Lock_EventThread(); - - SDL_SYS_JoystickClose(joystick); - - /* Remove joystick from list */ - for ( i=0; SDL_joysticks[i]; ++i ) { - if ( joystick == SDL_joysticks[i] ) { - SDL_memmove(&SDL_joysticks[i], &SDL_joysticks[i+1], - (SDL_allocatedjoysticks-i)*sizeof(joystick)); - break; - } - } - - /* Let the event thread keep running */ - SDL_Unlock_EventThread(); - - /* Free the data associated with this joystick */ - if ( joystick->axes ) { - SDL_free(joystick->axes); - } - if ( joystick->hats ) { - SDL_free(joystick->hats); - } - if ( joystick->balls ) { - SDL_free(joystick->balls); - } - if ( joystick->buttons ) { - SDL_free(joystick->buttons); - } - SDL_free(joystick); -} - -void SDL_JoystickQuit(void) -{ - const int numsticks = SDL_numjoysticks; - int i; - - /* Stop the event polling */ - SDL_Lock_EventThread(); - SDL_numjoysticks = 0; - SDL_Unlock_EventThread(); - - if (SDL_joysticks != NULL) { - for (i = 0; i < numsticks; i++) { - SDL_Joystick *stick = SDL_joysticks[i]; - if (stick && (stick->ref_count >= 1)) { - stick->ref_count = 1; - SDL_JoystickClose(stick); - } - } - } - - /* Quit the joystick setup */ - SDL_SYS_JoystickQuit(); - if ( SDL_joysticks ) { - SDL_free(SDL_joysticks); - SDL_joysticks = NULL; - SDL_allocatedjoysticks = 0; - } +SDL_JoystickID +SDL_JoystickInstanceID(SDL_Joystick * joystick) +{ + if (!SDL_PrivateJoystickValid(joystick)) { + return (-1); + } + + return (joystick->instance_id); } +/* + * Get the friendly name of this joystick + */ +const char * +SDL_JoystickName(SDL_Joystick * joystick) +{ + if (!SDL_PrivateJoystickValid(joystick)) { + return (NULL); + } -/* These are global for SDL_sysjoystick.c and SDL_events.c */ + return (joystick->name); +} + +/* + * Close a joystick previously opened with SDL_JoystickOpen() + */ +void +SDL_JoystickClose(SDL_Joystick * joystick) +{ + SDL_Joystick *joysticklist; + SDL_Joystick *joysticklistprev; + + if (!joystick) { + return; + } + + /* First decrement ref count */ + if (--joystick->ref_count > 0) { + return; + } + + if (joystick == SDL_updating_joystick) { + return; + } + + SDL_SYS_JoystickClose(joystick); + + joysticklist = SDL_joysticks; + joysticklistprev = NULL; + while ( joysticklist ) + { + if (joystick == joysticklist) + { + if ( joysticklistprev ) + { + /* unlink this entry */ + joysticklistprev->next = joysticklist->next; + } + else + { + SDL_joysticks = joystick->next; + } + + break; + } + joysticklistprev = joysticklist; + joysticklist = joysticklist->next; + } + + if (joystick->name) + SDL_free(joystick->name); + + /* Free the data associated with this joystick */ + if (joystick->axes) { + SDL_free(joystick->axes); + } + if (joystick->hats) { + SDL_free(joystick->hats); + } + if (joystick->balls) { + SDL_free(joystick->balls); + } + if (joystick->buttons) { + SDL_free(joystick->buttons); + } + SDL_free(joystick); +} -int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) +void +SDL_JoystickQuit(void) { - int posted; + /* Make sure we're not getting called in the middle of updating joysticks */ + SDL_assert(!SDL_updating_joystick); + + /* Stop the event polling */ + while ( SDL_joysticks ) + { + SDL_joysticks->ref_count = 1; + SDL_JoystickClose(SDL_joysticks); + } - /* Make sure we're not getting garbage events */ - if (axis >= joystick->naxes) { - return 0; - } + /* Quit the joystick setup */ + SDL_SYS_JoystickQuit(); - /* Update internal joystick state */ - joystick->axes[axis] = value; +#if !SDL_EVENTS_DISABLED + SDL_QuitSubSystem(SDL_INIT_EVENTS); +#endif +} + + +static SDL_bool +SDL_PrivateJoystickShouldIgnoreEvent() +{ + if (SDL_joystick_allows_background_events) + { + return SDL_FALSE; + } + + if (SDL_WasInit(SDL_INIT_VIDEO)) { + if (SDL_GetKeyboardFocus() == NULL) { + // Video is initialized and we don't have focus, ignore the event. + return SDL_TRUE; + } else { + return SDL_FALSE; + } + } + + // Video subsystem wasn't initialized, always allow the event + return SDL_FALSE; +} + +/* These are global for SDL_sysjoystick.c and SDL_events.c */ - /* Post the event, if desired */ - posted = 0; +int +SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value) +{ + int posted; + + /* Make sure we're not getting garbage events */ + if (axis >= joystick->naxes) { + return 0; + } + + /* Update internal joystick state */ + if (value == joystick->axes[axis]) { + return 0; + } + joystick->axes[axis] = value; + + /* We ignore events if we don't have keyboard focus, except for centering + * events. + */ + if (SDL_PrivateJoystickShouldIgnoreEvent()) { + if (!(joystick->closed && joystick->uncentered)) { + return 0; + } + } + + /* Post the event, if desired */ + posted = 0; #if !SDL_EVENTS_DISABLED - if ( SDL_ProcessEvents[SDL_JOYAXISMOTION] == SDL_ENABLE ) { - SDL_Event event; - event.type = SDL_JOYAXISMOTION; - event.jaxis.which = joystick->index; - event.jaxis.axis = axis; - event.jaxis.value = value; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } + if (SDL_GetEventState(SDL_JOYAXISMOTION) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_JOYAXISMOTION; + event.jaxis.which = joystick->instance_id; + event.jaxis.axis = axis; + event.jaxis.value = value; + posted = SDL_PushEvent(&event) == 1; + } #endif /* !SDL_EVENTS_DISABLED */ - return(posted); + return (posted); } -int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value) +int +SDL_PrivateJoystickHat(SDL_Joystick * joystick, Uint8 hat, Uint8 value) { - int posted; + int posted; + + /* Make sure we're not getting garbage events */ + if (hat >= joystick->nhats) { + return 0; + } + + /* Update internal joystick state */ + joystick->hats[hat] = value; - /* Make sure we're not getting garbage events */ - if (hat >= joystick->nhats) { - return 0; - } + /* We ignore events if we don't have keyboard focus, except for centering + * events. + */ + if (SDL_PrivateJoystickShouldIgnoreEvent()) { + if (!(joystick->closed && joystick->uncentered)) { + return 0; + } + } - /* Update internal joystick state */ - joystick->hats[hat] = value; - /* Post the event, if desired */ - posted = 0; + /* Post the event, if desired */ + posted = 0; #if !SDL_EVENTS_DISABLED - if ( SDL_ProcessEvents[SDL_JOYHATMOTION] == SDL_ENABLE ) { - SDL_Event event; - event.jhat.type = SDL_JOYHATMOTION; - event.jhat.which = joystick->index; - event.jhat.hat = hat; - event.jhat.value = value; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } + if (SDL_GetEventState(SDL_JOYHATMOTION) == SDL_ENABLE) { + SDL_Event event; + event.jhat.type = SDL_JOYHATMOTION; + event.jhat.which = joystick->instance_id; + event.jhat.hat = hat; + event.jhat.value = value; + posted = SDL_PushEvent(&event) == 1; + } #endif /* !SDL_EVENTS_DISABLED */ - return(posted); + return (posted); } -int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, - Sint16 xrel, Sint16 yrel) +int +SDL_PrivateJoystickBall(SDL_Joystick * joystick, Uint8 ball, + Sint16 xrel, Sint16 yrel) { - int posted; + int posted; - /* Make sure we're not getting garbage events */ - if (ball >= joystick->nballs) { - return 0; - } + /* Make sure we're not getting garbage events */ + if (ball >= joystick->nballs) { + return 0; + } - /* Update internal mouse state */ - joystick->balls[ball].dx += xrel; - joystick->balls[ball].dy += yrel; + /* We ignore events if we don't have keyboard focus. */ + if (SDL_PrivateJoystickShouldIgnoreEvent()) { + return 0; + } - /* Post the event, if desired */ - posted = 0; + /* Update internal mouse state */ + joystick->balls[ball].dx += xrel; + joystick->balls[ball].dy += yrel; + + /* Post the event, if desired */ + posted = 0; #if !SDL_EVENTS_DISABLED - if ( SDL_ProcessEvents[SDL_JOYBALLMOTION] == SDL_ENABLE ) { - SDL_Event event; - event.jball.type = SDL_JOYBALLMOTION; - event.jball.which = joystick->index; - event.jball.ball = ball; - event.jball.xrel = xrel; - event.jball.yrel = yrel; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } + if (SDL_GetEventState(SDL_JOYBALLMOTION) == SDL_ENABLE) { + SDL_Event event; + event.jball.type = SDL_JOYBALLMOTION; + event.jball.which = joystick->instance_id; + event.jball.ball = ball; + event.jball.xrel = xrel; + event.jball.yrel = yrel; + posted = SDL_PushEvent(&event) == 1; + } #endif /* !SDL_EVENTS_DISABLED */ - return(posted); + return (posted); } -int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) +int +SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state) { - int posted; + int posted; #if !SDL_EVENTS_DISABLED - SDL_Event event; - - switch ( state ) { - case SDL_PRESSED: - event.type = SDL_JOYBUTTONDOWN; - break; - case SDL_RELEASED: - event.type = SDL_JOYBUTTONUP; - break; - default: - /* Invalid state -- bail */ - return(0); - } + SDL_Event event; + + switch (state) { + case SDL_PRESSED: + event.type = SDL_JOYBUTTONDOWN; + break; + case SDL_RELEASED: + event.type = SDL_JOYBUTTONUP; + break; + default: + /* Invalid state -- bail */ + return (0); + } #endif /* !SDL_EVENTS_DISABLED */ - /* Make sure we're not getting garbage events */ - if (button >= joystick->nbuttons) { - return 0; - } + /* Make sure we're not getting garbage events */ + if (button >= joystick->nbuttons) { + return 0; + } + + /* We ignore events if we don't have keyboard focus, except for button + * release. */ + if (state == SDL_PRESSED && SDL_PrivateJoystickShouldIgnoreEvent()) { + return 0; + } - /* Update internal joystick state */ - joystick->buttons[button] = state; + /* Update internal joystick state */ + joystick->buttons[button] = state; - /* Post the event, if desired */ - posted = 0; + /* Post the event, if desired */ + posted = 0; #if !SDL_EVENTS_DISABLED - if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) { - event.jbutton.which = joystick->index; - event.jbutton.button = button; - event.jbutton.state = state; - if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) { - posted = 1; - SDL_PushEvent(&event); - } - } + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jbutton.which = joystick->instance_id; + event.jbutton.button = button; + event.jbutton.state = state; + posted = SDL_PushEvent(&event) == 1; + } #endif /* !SDL_EVENTS_DISABLED */ - return(posted); + return (posted); } -void SDL_JoystickUpdate(void) +void +SDL_JoystickUpdate(void) { - int i; + SDL_Joystick *joystick; + + joystick = SDL_joysticks; + while ( joystick ) + { + SDL_Joystick *joysticknext; + /* save off the next pointer, the Update call may cause a joystick removed event + * and cause our joystick pointer to be freed + */ + joysticknext = joystick->next; + + SDL_updating_joystick = joystick; + + SDL_SYS_JoystickUpdate( joystick ); + + if ( joystick->closed && joystick->uncentered ) + { + int i; + + /* Tell the app that everything is centered/unpressed... */ + for (i = 0; i < joystick->naxes; i++) + SDL_PrivateJoystickAxis(joystick, i, 0); + + for (i = 0; i < joystick->nbuttons; i++) + SDL_PrivateJoystickButton(joystick, i, 0); + + for (i = 0; i < joystick->nhats; i++) + SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED); + + joystick->uncentered = 0; + } + + SDL_updating_joystick = NULL; + + /* If the joystick was closed while updating, free it here */ + if ( joystick->ref_count <= 0 ) { + SDL_JoystickClose(joystick); + } - for ( i=0; SDL_joysticks[i]; ++i ) { - SDL_SYS_JoystickUpdate(SDL_joysticks[i]); - } + joystick = joysticknext; + } + + /* this needs to happen AFTER walking the joystick list above, so that any + dangling hardware data from removed devices can be free'd + */ + SDL_SYS_JoystickDetect(); } -int SDL_JoystickEventState(int state) +int +SDL_JoystickEventState(int state) { #if SDL_EVENTS_DISABLED - return SDL_IGNORE; + return SDL_DISABLE; #else - const Uint8 event_list[] = { - SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION, - SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP, - }; - unsigned int i; - - switch (state) { - case SDL_QUERY: - state = SDL_IGNORE; - for ( i=0; i= SDL_NumJoysticks())) { + SDL_JoystickGUID emptyGUID; + SDL_SetError("There are %d joysticks available", SDL_NumJoysticks()); + SDL_zero( emptyGUID ); + return emptyGUID; + } + return SDL_SYS_JoystickGetDeviceGUID( device_index ); +} + +/* return the guid for this opened device */ +SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick * joystick) +{ + return SDL_SYS_JoystickGetGUID( joystick ); +} + +/* convert the guid to a printable string */ +void SDL_JoystickGetGUIDString( SDL_JoystickGUID guid, char *pszGUID, int cbGUID ) +{ + static const char k_rgchHexToASCII[] = "0123456789abcdef"; + int i; + + if ((pszGUID == NULL) || (cbGUID <= 0)) { + return; + } + + for ( i = 0; i < sizeof(guid.data) && i < (cbGUID-1); i++ ) + { + /* each input byte writes 2 ascii chars, and might write a null byte. */ + /* If we don't have room for next input byte, stop */ + unsigned char c = guid.data[i]; + + *pszGUID++ = k_rgchHexToASCII[ c >> 4 ]; + *pszGUID++ = k_rgchHexToASCII[ c & 0x0F ]; + } + *pszGUID = '\0'; +} + + +/*----------------------------------------------------------------------------- + * Purpose: Returns the 4 bit nibble for a hex character + * Input : c - + * Output : unsigned char + *-----------------------------------------------------------------------------*/ +static unsigned char nibble( char c ) +{ + if ( ( c >= '0' ) && + ( c <= '9' ) ) + { + return (unsigned char)(c - '0'); + } + + if ( ( c >= 'A' ) && + ( c <= 'F' ) ) + { + return (unsigned char)(c - 'A' + 0x0a); + } + + if ( ( c >= 'a' ) && + ( c <= 'f' ) ) + { + return (unsigned char)(c - 'a' + 0x0a); + } + + /* received an invalid character, and no real way to return an error */ + /* AssertMsg1( false, "Q_nibble invalid hex character '%c' ", c ); */ + return 0; +} + + +/* convert the string version of a joystick guid to the struct */ +SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID) +{ + SDL_JoystickGUID guid; + int maxoutputbytes= sizeof(guid); + int len = SDL_strlen( pchGUID ); + Uint8 *p; + int i; + + /* Make sure it's even */ + len = ( len ) & ~0x1; + + SDL_memset( &guid, 0x00, sizeof(guid) ); + + p = (Uint8 *)&guid; + for ( i = 0; + ( i < len ) && ( ( p - (Uint8 *)&guid ) < maxoutputbytes ); + i+=2, p++ ) + { + *p = ( nibble( pchGUID[i] ) << 4 ) | nibble( pchGUID[i+1] ); + } + + return guid; +} + + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h index 9a9d130862..38bc78553c 100644 --- a/src/joystick/SDL_joystick_c.h +++ b/src/joystick/SDL_joystick_c.h @@ -1,38 +1,51 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Useful functions and variables from SDL_joystick.c */ #include "SDL_joystick.h" -/* The number of available joysticks on the system */ -extern Uint8 SDL_numjoysticks; +/* Initialization and shutdown functions */ +extern int SDL_JoystickInit(void); +extern void SDL_JoystickQuit(void); + +/* Initialization and shutdown functions */ +extern int SDL_GameControllerInit(void); +extern void SDL_GameControllerQuit(void); + /* Internal event queueing functions */ -extern int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, +extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value); -extern int SDL_PrivateJoystickBall(SDL_Joystick *joystick, +extern int SDL_PrivateJoystickBall(SDL_Joystick * joystick, Uint8 ball, Sint16 xrel, Sint16 yrel); -extern int SDL_PrivateJoystickHat(SDL_Joystick *joystick, - Uint8 hat, Uint8 value); -extern int SDL_PrivateJoystickButton(SDL_Joystick *joystick, +extern int SDL_PrivateJoystickHat(SDL_Joystick * joystick, + Uint8 hat, Uint8 value); +extern int SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state); + +/* Helper function to let lower sys layer tell the event system if the joystick code needs to think */ +extern SDL_bool SDL_PrivateJoystickNeedsPolling(); + +/* Internal sanity checking functions */ +extern int SDL_PrivateJoystickValid(SDL_Joystick * joystick); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h index 6a1b76a62f..4a5019e739 100644 --- a/src/joystick/SDL_sysjoystick.h +++ b/src/joystick/SDL_sysjoystick.h @@ -1,53 +1,58 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is SDL_free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* This is the system specific header for the SDL joystick API */ #include "SDL_joystick.h" +#include "SDL_joystick_c.h" /* The SDL joystick structure */ -struct _SDL_Joystick { - Uint8 index; /* Device index */ - const char *name; /* Joystick name - system dependent */ - - int naxes; /* Number of axis controls on the joystick */ - Sint16 *axes; /* Current axis states */ - - int nhats; /* Number of hats on the joystick */ - Uint8 *hats; /* Current hat states */ - - int nballs; /* Number of trackballs on the joystick */ - struct balldelta { - int dx; - int dy; - } *balls; /* Current ball motion deltas */ - - int nbuttons; /* Number of buttons on the joystick */ - Uint8 *buttons; /* Current button states */ - - struct joystick_hwdata *hwdata; /* Driver dependent information */ - - int ref_count; /* Reference count for multiple opens */ +struct _SDL_Joystick +{ + SDL_JoystickID instance_id; /* Device instance, monotonically increasing from 0 */ + char *name; /* Joystick name - system dependent */ + + int naxes; /* Number of axis controls on the joystick */ + Sint16 *axes; /* Current axis states */ + + int nhats; /* Number of hats on the joystick */ + Uint8 *hats; /* Current hat states */ + + int nballs; /* Number of trackballs on the joystick */ + struct balldelta { + int dx; + int dy; + } *balls; /* Current ball motion deltas */ + + int nbuttons; /* Number of buttons on the joystick */ + Uint8 *buttons; /* Current button states */ + + struct joystick_hwdata *hwdata; /* Driver dependent information */ + + int ref_count; /* Reference count for multiple opens */ + + Uint8 closed; /* 1 if this device is no longer valid */ + Uint8 uncentered; /* 1 if this device needs to have its state reset to 0 */ + struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */ }; /* Function to scan the system for joysticks. @@ -57,26 +62,55 @@ struct _SDL_Joystick { */ extern int SDL_SYS_JoystickInit(void); +/* Function to return the number of joystick devices plugged in right now */ +extern int SDL_SYS_NumJoysticks(); + +/* Function to cause any queued joystick insertions to be processed */ +extern void SDL_SYS_JoystickDetect(); + +/* Function to determine if the joystick loop needs to run right now */ +extern SDL_bool SDL_SYS_JoystickNeedsPolling(); + /* Function to get the device-dependent name of a joystick */ -extern const char *SDL_SYS_JoystickName(int index); +extern const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index); + +/* Function to get the current instance id of the joystick located at device_index */ +extern SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index); /* Function to open a joystick for use. The joystick to open is specified by the index field of the joystick. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ -extern int SDL_SYS_JoystickOpen(SDL_Joystick *joystick); +extern int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index); + +/* Function to query if the joystick is currently attached + * It returns 1 if attached, 0 otherwise. + */ +extern SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick * joystick); /* Function to update the state of a joystick - called as a device poll. * This function shouldn't update the joystick structure directly, * but instead should call SDL_PrivateJoystick*() to deliver events * and update joystick device state. */ -extern void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick); +extern void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick); /* Function to close a joystick after use */ -extern void SDL_SYS_JoystickClose(SDL_Joystick *joystick); +extern void SDL_SYS_JoystickClose(SDL_Joystick * joystick); /* Function to perform any system-specific joystick related cleanup */ extern void SDL_SYS_JoystickQuit(void); +/* Function to return the stable GUID for a plugged in device */ +extern SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID(int device_index); + +/* Function to return the stable GUID for a opened joystick */ +extern SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick); + +#ifdef SDL_JOYSTICK_DINPUT +/* Function to get the current instance id of the joystick located at device_index */ +extern SDL_bool SDL_SYS_IsXInputDeviceIndex( int device_index ); +#endif + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c new file mode 100644 index 0000000000..adaca528e9 --- /dev/null +++ b/src/joystick/android/SDL_sysjoystick.c @@ -0,0 +1,156 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +#ifdef SDL_JOYSTICK_ANDROID + +/* This is the system specific header for the SDL joystick API */ +#include /* For the definition of NULL */ + +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_joystick.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" +#include "../../core/android/SDL_android.h" + +static const char *accelerometerName = "Android accelerometer"; + +/* Function to scan the system for joysticks. + * This function should set SDL_numjoysticks to the number of available + * joysticks. Joystick 0 should be the system default joystick. + * It should return 0, or -1 on an unrecoverable fatal error. + */ +int +SDL_SYS_JoystickInit(void) +{ + return (1); +} + +int SDL_SYS_NumJoysticks() +{ + return 1; +} + +void SDL_SYS_JoystickDetect() +{ +} + +SDL_bool SDL_SYS_JoystickNeedsPolling() +{ + return SDL_FALSE; +} + +/* Function to get the device-dependent name of a joystick */ +const char * +SDL_SYS_JoystickNameForDeviceIndex(int device_index) +{ + return accelerometerName; +} + +/* Function to perform the mapping from device index to the instance id for this index */ +SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) +{ + return device_index; +} + +/* Function to open a joystick for use. + The joystick to open is specified by the index field of the joystick. + This should fill the nbuttons and naxes fields of the joystick structure. + It returns 0, or -1 if there is an error. + */ +int +SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) +{ + if (device_index == 0) { + joystick->nbuttons = 0; + joystick->nhats = 0; + joystick->nballs = 0; + joystick->naxes = 3; + return 0; + } else { + SDL_SetError("No joystick available with that index"); + return (-1); + } +} + +/* Function to determine is this joystick is attached to the system right now */ +SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) +{ + return SDL_TRUE; +} + +/* Function to update the state of a joystick - called as a device poll. + * This function shouldn't update the joystick structure directly, + * but instead should call SDL_PrivateJoystick*() to deliver events + * and update joystick device state. + */ +void +SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) +{ + int i; + Sint16 value; + float values[3]; + + if (Android_JNI_GetAccelerometerValues(values)) { + for ( i = 0; i < 3; i++ ) { + value = (Sint16)(values[i] * 32767.0f); + SDL_PrivateJoystickAxis(joystick, i, value); + } + } +} + +/* Function to close a joystick after use */ +void +SDL_SYS_JoystickClose(SDL_Joystick * joystick) +{ +} + +/* Function to perform any system-specific joystick related cleanup */ +void +SDL_SYS_JoystickQuit(void) +{ +} + +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index ); + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = joystick->name; + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + +#endif /* SDL_JOYSTICK_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/beos/SDL_bejoystick.cc b/src/joystick/beos/SDL_bejoystick.cc index af8a34164b..4e342ed416 100644 --- a/src/joystick/beos/SDL_bejoystick.cc +++ b/src/joystick/beos/SDL_bejoystick.cc @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -28,7 +27,8 @@ #include #include -extern "C" { +extern "C" +{ #include "SDL_joystick.h" #include "../SDL_sysjoystick.h" @@ -36,202 +36,249 @@ extern "C" { /* The maximum number of joysticks we'll detect */ -#define MAX_JOYSTICKS 16 +#define MAX_JOYSTICKS 16 /* A list of available joysticks */ -static char *SDL_joyport[MAX_JOYSTICKS]; -static char *SDL_joyname[MAX_JOYSTICKS]; + static char *SDL_joyport[MAX_JOYSTICKS]; + static char *SDL_joyname[MAX_JOYSTICKS]; /* The private structure used to keep track of a joystick */ -struct joystick_hwdata { - BJoystick *stick; - uint8 *new_hats; - int16 *new_axes; -}; + struct joystick_hwdata + { + BJoystick *stick; + uint8 *new_hats; + int16 *new_axes; + }; + + static int SDL_SYS_numjoysticks = 0; /* Function to scan the system for joysticks. * This function should set SDL_numjoysticks to the number of available * joysticks. Joystick 0 should be the system default joystick. * It should return 0, or -1 on an unrecoverable fatal error. */ -int SDL_SYS_JoystickInit(void) -{ - BJoystick joystick; - int numjoysticks; - int i; - int32 nports; - char name[B_OS_NAME_LENGTH]; - - /* Search for attached joysticks */ - nports = joystick.CountDevices(); - numjoysticks = 0; - SDL_memset(SDL_joyport, 0, (sizeof SDL_joyport)); - SDL_memset(SDL_joyname, 0, (sizeof SDL_joyname)); - for ( i=0; (SDL_numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i ) { - if ( joystick.GetDeviceName(i, name) == B_OK ) { - if ( joystick.Open(name) != B_ERROR ) { - BString stick_name; - joystick.GetControllerName(&stick_name); - SDL_joyport[numjoysticks] = strdup(name); - SDL_joyname[numjoysticks] = - strdup(stick_name.String()); - numjoysticks++; - joystick.Close(); - } - } - } - return(numjoysticks); -} + int SDL_SYS_JoystickInit(void) + { + BJoystick joystick; + int i; + int32 nports; + char name[B_OS_NAME_LENGTH]; + + /* Search for attached joysticks */ + nports = joystick.CountDevices(); + SDL_SYS_numjoysticks = 0; + SDL_memset(SDL_joyport, 0, (sizeof SDL_joyport)); + SDL_memset(SDL_joyname, 0, (sizeof SDL_joyname)); + for (i = 0; (SDL_SYS_numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i) + { + if (joystick.GetDeviceName(i, name) == B_OK) { + if (joystick.Open(name) != B_ERROR) { + BString stick_name; + joystick.GetControllerName(&stick_name); + SDL_joyport[SDL_SYS_numjoysticks] = strdup(name); + SDL_joyname[SDL_SYS_numjoysticks] = strdup(stick_name.String()); + SDL_SYS_numjoysticks++; + joystick.Close(); + } + } + } + return (SDL_SYS_numjoysticks); + } + + int SDL_SYS_NumJoysticks() + { + return SDL_SYS_numjoysticks; + } + + void SDL_SYS_JoystickDetect() + { + } + + SDL_bool SDL_SYS_JoystickNeedsPolling() + { + return SDL_FALSE; + } /* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) -{ - return SDL_joyname[index]; -} + const char *SDL_SYS_JoystickNameForDeviceIndex(int device_index) + { + return SDL_joyname[device_index]; + } + +/* Function to perform the mapping from device index to the instance id for this index */ + SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) + { + return device_index; + } /* Function to open a joystick for use. The joystick to open is specified by the index field of the joystick. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) -{ - BJoystick *stick; - - /* Create the joystick data structure */ - joystick->hwdata = (struct joystick_hwdata *) - SDL_malloc(sizeof(*joystick->hwdata)); - if ( joystick->hwdata == NULL ) { - SDL_OutOfMemory(); - return(-1); - } - SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); - stick = new BJoystick; - joystick->hwdata->stick = stick; - - /* Open the requested joystick for use */ - if ( stick->Open(SDL_joyport[joystick->index]) == B_ERROR ) { - SDL_SetError("Unable to open joystick"); - SDL_SYS_JoystickClose(joystick); - return(-1); - } - - /* Set the joystick to calibrated mode */ - stick->EnableCalibration(); - - /* Get the number of buttons, hats, and axes on the joystick */ - joystick->nbuttons = stick->CountButtons(); - joystick->naxes = stick->CountAxes(); - joystick->nhats = stick->CountHats(); - - joystick->hwdata->new_axes = (int16 *) - SDL_malloc(joystick->naxes*sizeof(int16)); - joystick->hwdata->new_hats = (uint8 *) - SDL_malloc(joystick->nhats*sizeof(uint8)); - if ( ! joystick->hwdata->new_hats || ! joystick->hwdata->new_axes ) { - SDL_OutOfMemory(); - SDL_SYS_JoystickClose(joystick); - return(-1); - } - - /* We're done! */ - return(0); -} + int SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) + { + BJoystick *stick; + + /* Create the joystick data structure */ + joystick->instance_id = device_index; + joystick->hwdata = (struct joystick_hwdata *) + SDL_malloc(sizeof(*joystick->hwdata)); + if (joystick->hwdata == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); + stick = new BJoystick; + joystick->hwdata->stick = stick; + + /* Open the requested joystick for use */ + if (stick->Open(SDL_joyport[device_index]) == B_ERROR) { + SDL_SYS_JoystickClose(joystick); + return SDL_SetError("Unable to open joystick"); + } + + /* Set the joystick to calibrated mode */ + stick->EnableCalibration(); + + /* Get the number of buttons, hats, and axes on the joystick */ + joystick->nbuttons = stick->CountButtons(); + joystick->naxes = stick->CountAxes(); + joystick->nhats = stick->CountHats(); + + joystick->hwdata->new_axes = (int16 *) + SDL_malloc(joystick->naxes * sizeof(int16)); + joystick->hwdata->new_hats = (uint8 *) + SDL_malloc(joystick->nhats * sizeof(uint8)); + if (!joystick->hwdata->new_hats || !joystick->hwdata->new_axes) { + SDL_SYS_JoystickClose(joystick); + return SDL_OutOfMemory(); + } + + /* We're done! */ + return (0); + } + +/* Function to determine is this joystick is attached to the system right now */ + SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) + { + return SDL_TRUE; + } /* Function to update the state of a joystick - called as a device poll. * This function shouldn't update the joystick structure directly, * but instead should call SDL_PrivateJoystick*() to deliver events * and update joystick device state. */ -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - static const Uint8 hat_map[9] = { - SDL_HAT_CENTERED, - SDL_HAT_UP, - SDL_HAT_RIGHTUP, - SDL_HAT_RIGHT, - SDL_HAT_RIGHTDOWN, - SDL_HAT_DOWN, - SDL_HAT_LEFTDOWN, - SDL_HAT_LEFT, - SDL_HAT_LEFTUP - }; - const int JITTER = (32768/10); /* 10% jitter threshold (ok?) */ - - BJoystick *stick; - int i, change; - int16 *axes; - uint8 *hats; - uint32 buttons; - - /* Set up data pointers */ - stick = joystick->hwdata->stick; - axes = joystick->hwdata->new_axes; - hats = joystick->hwdata->new_hats; - - /* Get the new joystick state */ - stick->Update(); - stick->GetAxisValues(axes); - stick->GetHatValues(hats); - buttons = stick->ButtonValues(); - - /* Generate axis motion events */ - for ( i=0; inaxes; ++i ) { - change = ((int32)axes[i] - joystick->axes[i]); - if ( (change > JITTER) || (change < -JITTER) ) { - SDL_PrivateJoystickAxis(joystick, i, axes[i]); - } - } - - /* Generate hat change events */ - for ( i=0; inhats; ++i ) { - if ( hats[i] != joystick->hats[i] ) { - SDL_PrivateJoystickHat(joystick, i, hat_map[hats[i]]); - } - } - - /* Generate button events */ - for ( i=0; inbuttons; ++i ) { - if ( (buttons&0x01) != joystick->buttons[i] ) { - SDL_PrivateJoystickButton(joystick, i, (buttons&0x01)); - } - buttons >>= 1; - } -} + void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) + { + static const Uint8 hat_map[9] = { + SDL_HAT_CENTERED, + SDL_HAT_UP, + SDL_HAT_RIGHTUP, + SDL_HAT_RIGHT, + SDL_HAT_RIGHTDOWN, + SDL_HAT_DOWN, + SDL_HAT_LEFTDOWN, + SDL_HAT_LEFT, + SDL_HAT_LEFTUP + }; + const int JITTER = (32768 / 10); /* 10% jitter threshold (ok?) */ + + BJoystick *stick; + int i, change; + int16 *axes; + uint8 *hats; + uint32 buttons; + + /* Set up data pointers */ + stick = joystick->hwdata->stick; + axes = joystick->hwdata->new_axes; + hats = joystick->hwdata->new_hats; + + /* Get the new joystick state */ + stick->Update(); + stick->GetAxisValues(axes); + stick->GetHatValues(hats); + buttons = stick->ButtonValues(); + + /* Generate axis motion events */ + for (i = 0; i < joystick->naxes; ++i) { + change = ((int32) axes[i] - joystick->axes[i]); + if ((change > JITTER) || (change < -JITTER)) { + SDL_PrivateJoystickAxis(joystick, i, axes[i]); + } + } + + /* Generate hat change events */ + for (i = 0; i < joystick->nhats; ++i) { + if (hats[i] != joystick->hats[i]) { + SDL_PrivateJoystickHat(joystick, i, hat_map[hats[i]]); + } + } + + /* Generate button events */ + for (i = 0; i < joystick->nbuttons; ++i) { + if ((buttons & 0x01) != joystick->buttons[i]) { + SDL_PrivateJoystickButton(joystick, i, (buttons & 0x01)); + } + buttons >>= 1; + } + } /* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) -{ - if ( joystick->hwdata ) { - joystick->hwdata->stick->Close(); - delete joystick->hwdata->stick; - if ( joystick->hwdata->new_hats ) { - SDL_free(joystick->hwdata->new_hats); - } - if ( joystick->hwdata->new_axes ) { - SDL_free(joystick->hwdata->new_axes); - } - SDL_free(joystick->hwdata); - joystick->hwdata = NULL; - } -} + void SDL_SYS_JoystickClose(SDL_Joystick * joystick) + { + if (joystick->hwdata) { + joystick->hwdata->stick->Close(); + delete joystick->hwdata->stick; + if (joystick->hwdata->new_hats) { + SDL_free(joystick->hwdata->new_hats); + } + if (joystick->hwdata->new_axes) { + SDL_free(joystick->hwdata->new_axes); + } + SDL_free(joystick->hwdata); + joystick->hwdata = NULL; + } + } /* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) -{ - int i; - - for ( i=0; SDL_joyport[i]; ++i ) { - SDL_free(SDL_joyport[i]); - } - SDL_joyport[0] = NULL; - - for ( i=0; SDL_joyname[i]; ++i ) { - SDL_free(SDL_joyname[i]); - } - SDL_joyname[0] = NULL; -} - -}; // extern "C" + void SDL_SYS_JoystickQuit(void) + { + int i; + + for (i = 0; SDL_joyport[i]; ++i) { + SDL_free(SDL_joyport[i]); + } + SDL_joyport[0] = NULL; + + for (i = 0; SDL_joyname[i]; ++i) { + SDL_free(SDL_joyname[i]); + } + SDL_joyname[0] = NULL; + } + + SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) + { + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index ); + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; + } + + SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) + { + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = joystick->name; + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; + } + +}; // extern "C" #endif /* SDL_JOYSTICK_BEOS */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/bsd/SDL_sysjoystick.c b/src/joystick/bsd/SDL_sysjoystick.c index 500fc62951..6d35d91b5c 100644 --- a/src/joystick/bsd/SDL_sysjoystick.c +++ b/src/joystick/bsd/SDL_sysjoystick.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -77,134 +76,161 @@ #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" -#define MAX_UHID_JOYS 4 -#define MAX_JOY_JOYS 2 -#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) +#define MAX_UHID_JOYS 16 +#define MAX_JOY_JOYS 2 +#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) + -struct report { -#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) - struct usb_gen_descriptor *buf; /* Buffer */ +struct report +{ +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000) + void *buf; /* Buffer */ +#elif defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) + struct usb_gen_descriptor *buf; /* Buffer */ #else - struct usb_ctl_report *buf; /* Buffer */ + struct usb_ctl_report *buf; /* Buffer */ #endif - size_t size; /* Buffer size */ - int rid; /* Report ID */ - enum { - SREPORT_UNINIT, - SREPORT_CLEAN, - SREPORT_DIRTY - } status; + size_t size; /* Buffer size */ + int rid; /* Report ID */ + enum + { + SREPORT_UNINIT, + SREPORT_CLEAN, + SREPORT_DIRTY + } status; }; -static struct { - int uhid_report; - hid_kind_t kind; - const char *name; +static struct +{ + int uhid_report; + hid_kind_t kind; + const char *name; } const repinfo[] = { - { UHID_INPUT_REPORT, hid_input, "input" }, - { UHID_OUTPUT_REPORT, hid_output, "output" }, - { UHID_FEATURE_REPORT, hid_feature, "feature" } + {UHID_INPUT_REPORT, hid_input, "input"}, + {UHID_OUTPUT_REPORT, hid_output, "output"}, + {UHID_FEATURE_REPORT, hid_feature, "feature"} }; -enum { - REPORT_INPUT = 0, - REPORT_OUTPUT = 1, - REPORT_FEATURE = 2 +enum +{ + REPORT_INPUT = 0, + REPORT_OUTPUT = 1, + REPORT_FEATURE = 2 }; -enum { - JOYAXE_X, - JOYAXE_Y, - JOYAXE_Z, - JOYAXE_SLIDER, - JOYAXE_WHEEL, - JOYAXE_RX, - JOYAXE_RY, - JOYAXE_RZ, - JOYAXE_count +enum +{ + JOYAXE_X, + JOYAXE_Y, + JOYAXE_Z, + JOYAXE_SLIDER, + JOYAXE_WHEEL, + JOYAXE_RX, + JOYAXE_RY, + JOYAXE_RZ, + JOYAXE_count }; -struct joystick_hwdata { - int fd; - char *path; - enum { - BSDJOY_UHID, /* uhid(4) */ - BSDJOY_JOY /* joy(4) */ - } type; - struct report_desc *repdesc; - struct report inreport; - int axis_map[JOYAXE_count]; /* map present JOYAXE_* to 0,1,..*/ - int x; - int y; - int xmin; - int ymin; - int xmax; - int ymax; +struct joystick_hwdata +{ + int fd; + char *path; + enum + { + BSDJOY_UHID, /* uhid(4) */ + BSDJOY_JOY /* joy(4) */ + } type; + struct report_desc *repdesc; + struct report inreport; + int axis_map[JOYAXE_count]; /* map present JOYAXE_* to 0,1,.. */ }; static char *joynames[MAX_JOYS]; static char *joydevnames[MAX_JOYS]; -static int report_alloc(struct report *, struct report_desc *, int); -static void report_free(struct report *); +static int report_alloc(struct report *, struct report_desc *, int); +static void report_free(struct report *); -#if defined(USBHID_UCR_DATA) || defined(__FreeBSD_kernel__) +#if defined(USBHID_UCR_DATA) || (defined(__FreeBSD_kernel__) && __FreeBSD_kernel_version <= 800063) #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data) +#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000)) +#define REP_BUF_DATA(rep) ((rep)->buf) #elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)) #define REP_BUF_DATA(rep) ((rep)->buf->ugd_data) #else #define REP_BUF_DATA(rep) ((rep)->buf->data) #endif +static int SDL_SYS_numjoysticks = 0; + int SDL_SYS_JoystickInit(void) { - char s[16]; - int i, fd; - - SDL_numjoysticks = 0; - - SDL_memset(joynames, 0, sizeof(joynames)); - SDL_memset(joydevnames, 0, sizeof(joydevnames)); - - for (i = 0; i < MAX_UHID_JOYS; i++) { - SDL_Joystick nj; - - SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid%d", i); - - nj.index = SDL_numjoysticks; - joynames[nj.index] = strdup(s); - - if (SDL_SYS_JoystickOpen(&nj) == 0) { - SDL_SYS_JoystickClose(&nj); - SDL_numjoysticks++; - } else { - SDL_free(joynames[nj.index]); - joynames[nj.index] = NULL; - } - } - for (i = 0; i < MAX_JOY_JOYS; i++) { - SDL_snprintf(s, SDL_arraysize(s), "/dev/joy%d", i); - fd = open(s, O_RDONLY); - if (fd != -1) { - joynames[SDL_numjoysticks++] = strdup(s); - close(fd); - } - } - - /* Read the default USB HID usage table. */ - hid_init(NULL); - - return (SDL_numjoysticks); + char s[16]; + int i, fd; + + SDL_SYS_numjoysticks = 0; + + SDL_memset(joynames, 0, sizeof(joynames)); + SDL_memset(joydevnames, 0, sizeof(joydevnames)); + + for (i = 0; i < MAX_UHID_JOYS; i++) { + SDL_Joystick nj; + + SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid%d", i); + + joynames[SDL_SYS_numjoysticks] = strdup(s); + + if (SDL_SYS_JoystickOpen(&nj, SDL_SYS_numjoysticks) == 0) { + SDL_SYS_JoystickClose(&nj); + SDL_SYS_numjoysticks++; + } else { + SDL_free(joynames[SDL_SYS_numjoysticks]); + joynames[SDL_SYS_numjoysticks] = NULL; + } + } + for (i = 0; i < MAX_JOY_JOYS; i++) { + SDL_snprintf(s, SDL_arraysize(s), "/dev/joy%d", i); + fd = open(s, O_RDONLY); + if (fd != -1) { + joynames[SDL_SYS_numjoysticks++] = strdup(s); + close(fd); + } + } + + /* Read the default USB HID usage table. */ + hid_init(NULL); + + return (SDL_SYS_numjoysticks); +} + +int SDL_SYS_NumJoysticks() +{ + return SDL_SYS_numjoysticks; +} + +void SDL_SYS_JoystickDetect() +{ +} + +SDL_bool SDL_SYS_JoystickNeedsPolling() +{ + return SDL_FALSE; } const char * -SDL_SYS_JoystickName(int index) +SDL_SYS_JoystickNameForDeviceIndex(int device_index) { - if (joydevnames[index] != NULL) { - return (joydevnames[index]); - } - return (joynames[index]); + if (joydevnames[device_index] != NULL) { + return (joydevnames[device_index]); + } + return (joynames[device_index]); +} + +/* Function to perform the mapping from device index to the instance id for this index */ +SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) +{ + return device_index; } static int @@ -213,396 +239,430 @@ usage_to_joyaxe(unsigned usage) int joyaxe; switch (usage) { case HUG_X: - joyaxe = JOYAXE_X; break; + joyaxe = JOYAXE_X; + break; case HUG_Y: - joyaxe = JOYAXE_Y; break; + joyaxe = JOYAXE_Y; + break; case HUG_Z: - joyaxe = JOYAXE_Z; break; + joyaxe = JOYAXE_Z; + break; case HUG_SLIDER: - joyaxe = JOYAXE_SLIDER; break; + joyaxe = JOYAXE_SLIDER; + break; case HUG_WHEEL: - joyaxe = JOYAXE_WHEEL; break; + joyaxe = JOYAXE_WHEEL; + break; case HUG_RX: - joyaxe = JOYAXE_RX; break; + joyaxe = JOYAXE_RX; + break; case HUG_RY: - joyaxe = JOYAXE_RY; break; + joyaxe = JOYAXE_RY; + break; case HUG_RZ: - joyaxe = JOYAXE_RZ; break; + joyaxe = JOYAXE_RZ; + break; default: - joyaxe = -1; + joyaxe = -1; } - return joyaxe; + return joyaxe; } static unsigned hatval_to_sdl(Sint32 hatval) { static const unsigned hat_dir_map[8] = { - SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_RIGHT, SDL_HAT_RIGHTDOWN, - SDL_HAT_DOWN, SDL_HAT_LEFTDOWN, SDL_HAT_LEFT, SDL_HAT_LEFTUP + SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_RIGHT, SDL_HAT_RIGHTDOWN, + SDL_HAT_DOWN, SDL_HAT_LEFTDOWN, SDL_HAT_LEFT, SDL_HAT_LEFTUP }; unsigned result; - if ((hatval & 7) == hatval) - result = hat_dir_map[hatval]; - else - result = SDL_HAT_CENTERED; + if ((hatval & 7) == hatval) + result = hat_dir_map[hatval]; + else + result = SDL_HAT_CENTERED; return result; } int -SDL_SYS_JoystickOpen(SDL_Joystick *joy) +SDL_SYS_JoystickOpen(SDL_Joystick * joy, int device_index) { - char *path = joynames[joy->index]; - struct joystick_hwdata *hw; - struct hid_item hitem; - struct hid_data *hdata; - struct report *rep; - int fd; - int i; - - fd = open(path, O_RDONLY); - if (fd == -1) { - SDL_SetError("%s: %s", path, strerror(errno)); - return (-1); - } - - hw = (struct joystick_hwdata *)SDL_malloc(sizeof(struct joystick_hwdata)); - if (hw == NULL) { - SDL_OutOfMemory(); - close(fd); - return (-1); - } - joy->hwdata = hw; - hw->fd = fd; - hw->path = strdup(path); - hw->x = 0; - hw->y = 0; - hw->xmin = 0xffff; - hw->ymin = 0xffff; - hw->xmax = 0; - hw->ymax = 0; - if (! SDL_strncmp(path, "/dev/joy", 8)) { - hw->type = BSDJOY_JOY; - joy->naxes = 2; - joy->nbuttons = 2; - joy->nhats = 0; - joy->nballs = 0; - joydevnames[joy->index] = strdup("Gameport joystick"); - goto usbend; - } else { - hw->type = BSDJOY_UHID; - } - - { - int ax; - for (ax = 0; ax < JOYAXE_count; ax++) - hw->axis_map[ax] = -1; - } - hw->repdesc = hid_get_report_desc(fd); - if (hw->repdesc == NULL) { - SDL_SetError("%s: USB_GET_REPORT_DESC: %s", hw->path, - strerror(errno)); - goto usberr; - } - rep = &hw->inreport; + char *path = joynames[device_index]; + struct joystick_hwdata *hw; + struct hid_item hitem; + struct hid_data *hdata; + struct report *rep; + int fd; + int i; + + fd = open(path, O_RDONLY); + if (fd == -1) { + return SDL_SetError("%s: %s", path, strerror(errno)); + } + + joy->instance_id = device_index; + hw = (struct joystick_hwdata *) + SDL_malloc(sizeof(struct joystick_hwdata)); + if (hw == NULL) { + close(fd); + return SDL_OutOfMemory(); + } + joy->hwdata = hw; + hw->fd = fd; + hw->path = strdup(path); + if (!SDL_strncmp(path, "/dev/joy", 8)) { + hw->type = BSDJOY_JOY; + joy->naxes = 2; + joy->nbuttons = 2; + joy->nhats = 0; + joy->nballs = 0; + joydevnames[device_index] = strdup("Gameport joystick"); + goto usbend; + } else { + hw->type = BSDJOY_UHID; + } + + { + int ax; + for (ax = 0; ax < JOYAXE_count; ax++) + hw->axis_map[ax] = -1; + } + hw->repdesc = hid_get_report_desc(fd); + if (hw->repdesc == NULL) { + SDL_SetError("%s: USB_GET_REPORT_DESC: %s", hw->path, + strerror(errno)); + goto usberr; + } + rep = &hw->inreport; #if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) || defined(__FreeBSD_kernel__) - rep->rid = hid_get_report_id(fd); - if (rep->rid < 0) { + rep->rid = hid_get_report_id(fd); + if (rep->rid < 0) { #else - if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) { + if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) { #endif - rep->rid = -1; /* XXX */ - } - if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) { - goto usberr; - } - if (rep->size <= 0) { - SDL_SetError("%s: Input report descriptor has invalid length", - hw->path); - goto usberr; - } - + rep->rid = -1; /* XXX */ + } + if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) { + goto usberr; + } + if (rep->size <= 0) { + SDL_SetError("%s: Input report descriptor has invalid length", + hw->path); + goto usberr; + } #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__) - hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid); + hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid); #else - hdata = hid_start_parse(hw->repdesc, 1 << hid_input); + hdata = hid_start_parse(hw->repdesc, 1 << hid_input); #endif - if (hdata == NULL) { - SDL_SetError("%s: Cannot start HID parser", hw->path); - goto usberr; - } - joy->naxes = 0; - joy->nbuttons = 0; - joy->nhats = 0; - joy->nballs = 0; - for (i=0; iaxis_map[i] = -1; - - while (hid_get_item(hdata, &hitem) > 0) { - char *sp; - const char *s; - - switch (hitem.kind) { - case hid_collection: - switch (HID_PAGE(hitem.usage)) { - case HUP_GENERIC_DESKTOP: - switch (HID_USAGE(hitem.usage)) { - case HUG_JOYSTICK: - case HUG_GAME_PAD: - s = hid_usage_in_page(hitem.usage); - sp = SDL_malloc(SDL_strlen(s) + 5); - SDL_snprintf(sp, SDL_strlen(s) + 5, "%s (%d)", s, - joy->index); - joydevnames[joy->index] = sp; - } - } - break; - case hid_input: - switch (HID_PAGE(hitem.usage)) { - case HUP_GENERIC_DESKTOP: { - unsigned usage = HID_USAGE(hitem.usage); - int joyaxe = usage_to_joyaxe(usage); - if (joyaxe >= 0) { - hw->axis_map[joyaxe] = 1; - } else if (usage == HUG_HAT_SWITCH) { - joy->nhats++; - } - break; - } - case HUP_BUTTON: - joy->nbuttons++; - break; - default: - break; - } - break; - default: - break; - } - } - hid_end_parse(hdata); - for (i=0; iaxis_map[i] > 0) - hw->axis_map[i] = joy->naxes++; - -usbend: - /* The poll blocks the event thread. */ - fcntl(fd, F_SETFL, O_NONBLOCK); - - return (0); -usberr: - close(hw->fd); - SDL_free(hw->path); - SDL_free(hw); - return (-1); + if (hdata == NULL) { + SDL_SetError("%s: Cannot start HID parser", hw->path); + goto usberr; + } + joy->naxes = 0; + joy->nbuttons = 0; + joy->nhats = 0; + joy->nballs = 0; + for (i = 0; i < JOYAXE_count; i++) + hw->axis_map[i] = -1; + + while (hid_get_item(hdata, &hitem) > 0) { + char *sp; + const char *s; + + switch (hitem.kind) { + case hid_collection: + switch (HID_PAGE(hitem.usage)) { + case HUP_GENERIC_DESKTOP: + switch (HID_USAGE(hitem.usage)) { + case HUG_JOYSTICK: + case HUG_GAME_PAD: + s = hid_usage_in_page(hitem.usage); + sp = SDL_malloc(SDL_strlen(s) + 5); + SDL_snprintf(sp, SDL_strlen(s) + 5, "%s (%d)", + s, device_index); + joydevnames[device_index] = sp; + } + } + break; + case hid_input: + switch (HID_PAGE(hitem.usage)) { + case HUP_GENERIC_DESKTOP: + { + unsigned usage = HID_USAGE(hitem.usage); + int joyaxe = usage_to_joyaxe(usage); + if (joyaxe >= 0) { + hw->axis_map[joyaxe] = 1; + } else if (usage == HUG_HAT_SWITCH) { + joy->nhats++; + } + break; + } + case HUP_BUTTON: + joy->nbuttons++; + break; + default: + break; + } + break; + default: + break; + } + } + hid_end_parse(hdata); + for (i = 0; i < JOYAXE_count; i++) + if (hw->axis_map[i] > 0) + hw->axis_map[i] = joy->naxes++; + + usbend: + /* The poll blocks the event thread. */ + fcntl(fd, F_SETFL, O_NONBLOCK); + + return (0); + usberr: + close(hw->fd); + SDL_free(hw->path); + SDL_free(hw); + return (-1); +} + +/* Function to determine is this joystick is attached to the system right now */ +SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) +{ + return SDL_TRUE; } void -SDL_SYS_JoystickUpdate(SDL_Joystick *joy) +SDL_SYS_JoystickUpdate(SDL_Joystick * joy) { - struct hid_item hitem; - struct hid_data *hdata; - struct report *rep; - int nbutton, naxe = -1; - Sint32 v; + struct hid_item hitem; + struct hid_data *hdata; + struct report *rep; + int nbutton, naxe = -1; + Sint32 v; #if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__) - struct joystick gameport; - - if (joy->hwdata->type == BSDJOY_JOY) { - if (read(joy->hwdata->fd, &gameport, sizeof gameport) != sizeof gameport) - return; - if (abs(joy->hwdata->x - gameport.x) > 8) { - joy->hwdata->x = gameport.x; - if (joy->hwdata->x < joy->hwdata->xmin) { - joy->hwdata->xmin = joy->hwdata->x; - } - if (joy->hwdata->x > joy->hwdata->xmax) { - joy->hwdata->xmax = joy->hwdata->x; - } - if (joy->hwdata->xmin == joy->hwdata->xmax) { - joy->hwdata->xmin--; - joy->hwdata->xmax++; - } - v = (Sint32)joy->hwdata->x; - v -= (joy->hwdata->xmax + joy->hwdata->xmin + 1)/2; - v *= 32768/((joy->hwdata->xmax - joy->hwdata->xmin + 1)/2); - SDL_PrivateJoystickAxis(joy, 0, v); - } - if (abs(joy->hwdata->y - gameport.y) > 8) { - joy->hwdata->y = gameport.y; - if (joy->hwdata->y < joy->hwdata->ymin) { - joy->hwdata->ymin = joy->hwdata->y; - } - if (joy->hwdata->y > joy->hwdata->ymax) { - joy->hwdata->ymax = joy->hwdata->y; - } - if (joy->hwdata->ymin == joy->hwdata->ymax) { - joy->hwdata->ymin--; - joy->hwdata->ymax++; - } - v = (Sint32)joy->hwdata->y; - v -= (joy->hwdata->ymax + joy->hwdata->ymin + 1)/2; - v *= 32768/((joy->hwdata->ymax - joy->hwdata->ymin + 1)/2); - SDL_PrivateJoystickAxis(joy, 1, v); - } - if (gameport.b1 != joy->buttons[0]) { - SDL_PrivateJoystickButton(joy, 0, gameport.b1); - } - if (gameport.b2 != joy->buttons[1]) { - SDL_PrivateJoystickButton(joy, 1, gameport.b2); - } - return; - } + struct joystick gameport; + static int x, y, xmin = 0xffff, ymin = 0xffff, xmax = 0, ymax = 0; + + if (joy->hwdata->type == BSDJOY_JOY) { + if (read(joy->hwdata->fd, &gameport, sizeof gameport) != + sizeof gameport) + return; + if (abs(x - gameport.x) > 8) { + x = gameport.x; + if (x < xmin) { + xmin = x; + } + if (x > xmax) { + xmax = x; + } + if (xmin == xmax) { + xmin--; + xmax++; + } + v = (Sint32) x; + v -= (xmax + xmin + 1) / 2; + v *= 32768 / ((xmax - xmin + 1) / 2); + SDL_PrivateJoystickAxis(joy, 0, v); + } + if (abs(y - gameport.y) > 8) { + y = gameport.y; + if (y < ymin) { + ymin = y; + } + if (y > ymax) { + ymax = y; + } + if (ymin == ymax) { + ymin--; + ymax++; + } + v = (Sint32) y; + v -= (ymax + ymin + 1) / 2; + v *= 32768 / ((ymax - ymin + 1) / 2); + SDL_PrivateJoystickAxis(joy, 1, v); + } + if (gameport.b1 != joy->buttons[0]) { + SDL_PrivateJoystickButton(joy, 0, gameport.b1); + } + if (gameport.b2 != joy->buttons[1]) { + SDL_PrivateJoystickButton(joy, 1, gameport.b2); + } + return; + } #endif /* defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */ - - rep = &joy->hwdata->inreport; - if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) { - return; - } + rep = &joy->hwdata->inreport; + + if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) { + return; + } #if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__) - hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid); + hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid); #else - hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input); + hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input); #endif - if (hdata == NULL) { - fprintf(stderr, "%s: Cannot start HID parser\n", - joy->hwdata->path); - return; - } - - for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) { - switch (hitem.kind) { - case hid_input: - switch (HID_PAGE(hitem.usage)) { - case HUP_GENERIC_DESKTOP: { - unsigned usage = HID_USAGE(hitem.usage); - int joyaxe = usage_to_joyaxe(usage); - if (joyaxe >= 0) { - naxe = joy->hwdata->axis_map[joyaxe]; - /* scaleaxe */ - v = (Sint32)hid_get_data(REP_BUF_DATA(rep), - &hitem); - v -= (hitem.logical_maximum + hitem.logical_minimum + 1)/2; - v *= 32768/((hitem.logical_maximum - hitem.logical_minimum + 1)/2); - if (v != joy->axes[naxe]) { - SDL_PrivateJoystickAxis(joy, naxe, v); - } - } else if (usage == HUG_HAT_SWITCH) { - v = (Sint32)hid_get_data(REP_BUF_DATA(rep), - &hitem); - SDL_PrivateJoystickHat(joy, 0, - hatval_to_sdl(v)-hitem.logical_minimum); - } - break; - } - case HUP_BUTTON: - v = (Sint32)hid_get_data(REP_BUF_DATA(rep), - &hitem); - if (joy->buttons[nbutton] != v) { - SDL_PrivateJoystickButton(joy, - nbutton, v); - } - nbutton++; - break; - default: - continue; - } - break; - default: - break; - } - } - hid_end_parse(hdata); - - return; + if (hdata == NULL) { + fprintf(stderr, "%s: Cannot start HID parser\n", joy->hwdata->path); + return; + } + + for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) { + switch (hitem.kind) { + case hid_input: + switch (HID_PAGE(hitem.usage)) { + case HUP_GENERIC_DESKTOP: + { + unsigned usage = HID_USAGE(hitem.usage); + int joyaxe = usage_to_joyaxe(usage); + if (joyaxe >= 0) { + naxe = joy->hwdata->axis_map[joyaxe]; + /* scaleaxe */ + v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); + v -= (hitem.logical_maximum + + hitem.logical_minimum + 1) / 2; + v *= 32768 / + ((hitem.logical_maximum - + hitem.logical_minimum + 1) / 2); + if (v != joy->axes[naxe]) { + SDL_PrivateJoystickAxis(joy, naxe, v); + } + } else if (usage == HUG_HAT_SWITCH) { + v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); + SDL_PrivateJoystickHat(joy, 0, + hatval_to_sdl(v) - + hitem.logical_minimum); + } + break; + } + case HUP_BUTTON: + v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); + if (joy->buttons[nbutton] != v) { + SDL_PrivateJoystickButton(joy, nbutton, v); + } + nbutton++; + break; + default: + continue; + } + break; + default: + break; + } + } + hid_end_parse(hdata); + + return; } /* Function to close a joystick after use */ void -SDL_SYS_JoystickClose(SDL_Joystick *joy) +SDL_SYS_JoystickClose(SDL_Joystick * joy) { - if (SDL_strncmp(joy->hwdata->path, "/dev/joy", 8)) { - report_free(&joy->hwdata->inreport); - hid_dispose_report_desc(joy->hwdata->repdesc); - } - close(joy->hwdata->fd); - SDL_free(joy->hwdata->path); - SDL_free(joy->hwdata); - - return; + if (SDL_strncmp(joy->hwdata->path, "/dev/joy", 8)) { + report_free(&joy->hwdata->inreport); + hid_dispose_report_desc(joy->hwdata->repdesc); + } + close(joy->hwdata->fd); + SDL_free(joy->hwdata->path); + SDL_free(joy->hwdata); + + return; } void SDL_SYS_JoystickQuit(void) { - int i; + int i; + + for (i = 0; i < MAX_JOYS; i++) { + if (joynames[i] != NULL) + SDL_free(joynames[i]); + if (joydevnames[i] != NULL) + SDL_free(joydevnames[i]); + } - for (i = 0; i < MAX_JOYS; i++) { - if (joynames[i] != NULL) - SDL_free(joynames[i]); - if (joydevnames[i] != NULL) - SDL_free(joydevnames[i]); - } + return; +} + +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index ); + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} - return; +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = joystick->name; + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; } static int report_alloc(struct report *r, struct report_desc *rd, int repind) { - int len; + int len; #ifdef __DragonFly__ - len = hid_report_size(rd, r->rid, repinfo[repind].kind); + len = hid_report_size(rd, r->rid, repinfo[repind].kind); #elif __FREEBSD__ # if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__) # if (__FreeBSD_kernel_version <= 500111) - len = hid_report_size(rd, r->rid, repinfo[repind].kind); + len = hid_report_size(rd, r->rid, repinfo[repind].kind); # else - len = hid_report_size(rd, repinfo[repind].kind, r->rid); + len = hid_report_size(rd, repinfo[repind].kind, r->rid); # endif # else - len = hid_report_size(rd, repinfo[repind].kind, &r->rid); + len = hid_report_size(rd, repinfo[repind].kind, &r->rid); # endif #else # ifdef USBHID_NEW - len = hid_report_size(rd, repinfo[repind].kind, r->rid); + len = hid_report_size(rd, repinfo[repind].kind, r->rid); # else - len = hid_report_size(rd, repinfo[repind].kind, &r->rid); + len = hid_report_size(rd, repinfo[repind].kind, &r->rid); # endif #endif - if (len < 0) { - SDL_SetError("Negative HID report size"); - return (-1); - } - r->size = len; - - if (r->size > 0) { - r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) + - r->size); - if (r->buf == NULL) { - SDL_OutOfMemory(); - return (-1); - } - } else { - r->buf = NULL; - } - - r->status = SREPORT_CLEAN; - return (0); + if (len < 0) { + return SDL_SetError("Negative HID report size"); + } + r->size = len; + + if (r->size > 0) { +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 900000) + r->buf = SDL_malloc(r->size); +#else + r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) + + r->size); +#endif + if (r->buf == NULL) { + return SDL_OutOfMemory(); + } + } else { + r->buf = NULL; + } + + r->status = SREPORT_CLEAN; + return 0; } static void report_free(struct report *r) { - if (r->buf != NULL) { - SDL_free(r->buf); - } - r->status = SREPORT_UNINIT; + if (r->buf != NULL) { + SDL_free(r->buf); + } + r->status = SREPORT_UNINIT; } #endif /* SDL_JOYSTICK_USBHID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c index a9ccb35fad..4e50e4dd68 100644 --- a/src/joystick/darwin/SDL_sysjoystick.c +++ b/src/joystick/darwin/SDL_sysjoystick.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -42,523 +41,689 @@ #include #include #include -#include /* for NewPtrClear, DisposePtr */ +#include /* for NewPtrClear, DisposePtr */ +#include + +/* For force feedback testing. */ +#include +#include #include "SDL_joystick.h" #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" - -struct recElement -{ - IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */ - long min; /* reported min value possible */ - long max; /* reported max value possible */ -#if 0 - /* TODO: maybe should handle the following stuff somehow? */ - - long scaledMin; /* reported scaled min value possible */ - long scaledMax; /* reported scaled max value possible */ - long size; /* size in bits of data return from element */ - Boolean relative; /* are reports relative to last report (deltas) */ - Boolean wrapping; /* does element wrap around (one value higher than max is min) */ - Boolean nonLinear; /* are the values reported non-linear relative to element movement */ - Boolean preferredState; /* does element have a preferred state (such as a button) */ - Boolean nullState; /* does element have null state */ -#endif /* 0 */ - - /* runtime variables used for auto-calibration */ - long minReport; /* min returned value */ - long maxReport; /* max returned value */ - - struct recElement * pNext; /* next element in list */ -}; -typedef struct recElement recElement; - -struct joystick_hwdata -{ - IOHIDDeviceInterface ** interface; /* interface to device, NULL = no interface */ - - char product[256]; /* name of product */ - long usage; /* usage page from IOUSBHID Parser.h which defines general usage */ - long usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */ - - long axes; /* number of axis (calculated, not reported by device) */ - long buttons; /* number of buttons (calculated, not reported by device) */ - long hats; /* number of hat switches (calculated, not reported by device) */ - long elements; /* number of total elements (shouldbe total of above) (calculated, not reported by device) */ - - recElement* firstAxis; - recElement* firstButton; - recElement* firstHat; - - int removed; - int uncentered; - - struct joystick_hwdata* pNext; /* next device */ -}; -typedef struct joystick_hwdata recDevice; +#include "SDL_sysjoystick_c.h" +#include "SDL_events.h" +#if !SDL_EVENTS_DISABLED +#include "../../events/SDL_events_c.h" +#endif /* Linked list of all available devices */ static recDevice *gpDeviceList = NULL; +/* OSX reference to the notification object that tells us about device insertion/removal */ +IONotificationPortRef notificationPort = 0; +/* if 1 then a device was added since the last update call */ +static SDL_bool s_bDeviceAdded = SDL_FALSE; +static SDL_bool s_bDeviceRemoved = SDL_FALSE; +/* static incrementing counter for new joystick devices seen on the system. Devices should start with index 0 */ +static int s_joystick_instance_id = -1; -static void HIDReportErrorNum (char * strError, long numError) +static void +HIDReportErrorNum(char *strError, long numError) { - SDL_SetError(strError); + SDL_SetError(strError); } -static void HIDGetCollectionElements (CFMutableDictionaryRef deviceProperties, recDevice *pDevice); +static void HIDGetCollectionElements(CFMutableDictionaryRef deviceProperties, + recDevice * pDevice); /* returns current value for element, polling element * will return 0 on error conditions which should be accounted for by application */ -static SInt32 HIDGetElementValue (recDevice *pDevice, recElement *pElement) +static SInt32 +HIDGetElementValue(recDevice * pDevice, recElement * pElement) { - IOReturn result = kIOReturnSuccess; - IOHIDEventStruct hidEvent; - hidEvent.value = 0; - - if (NULL != pDevice && NULL != pElement && NULL != pDevice->interface) - { - result = (*(pDevice->interface))->getElementValue(pDevice->interface, pElement->cookie, &hidEvent); - if (kIOReturnSuccess == result) - { - /* record min and max for auto calibration */ - if (hidEvent.value < pElement->minReport) - pElement->minReport = hidEvent.value; - if (hidEvent.value > pElement->maxReport) - pElement->maxReport = hidEvent.value; - } - } - - /* auto user scale */ - return hidEvent.value; + IOReturn result = kIOReturnSuccess; + IOHIDEventStruct hidEvent; + hidEvent.value = 0; + + if (NULL != pDevice && NULL != pElement && NULL != pDevice->interface) { + result = + (*(pDevice->interface))->getElementValue(pDevice->interface, + pElement->cookie, + &hidEvent); + if (kIOReturnSuccess == result) { + /* record min and max for auto calibration */ + if (hidEvent.value < pElement->minReport) + pElement->minReport = hidEvent.value; + if (hidEvent.value > pElement->maxReport) + pElement->maxReport = hidEvent.value; + } + } + + /* auto user scale */ + return hidEvent.value; } -static SInt32 HIDScaledCalibratedValue (recDevice *pDevice, recElement *pElement, long min, long max) +static SInt32 +HIDScaledCalibratedValue(recDevice * pDevice, recElement * pElement, + long min, long max) { - float deviceScale = max - min; - float readScale = pElement->maxReport - pElement->minReport; - SInt32 value = HIDGetElementValue(pDevice, pElement); - if (readScale == 0) - return value; /* no scaling at all */ - else - return ((value - pElement->minReport) * deviceScale / readScale) + min; + float deviceScale = max - min; + float readScale = pElement->maxReport - pElement->minReport; + SInt32 value = HIDGetElementValue(pDevice, pElement); + if (readScale == 0) + return value; /* no scaling at all */ + else + return ((value - pElement->minReport) * deviceScale / readScale) + + min; } -static void HIDRemovalCallback(void * target, - IOReturn result, - void * refcon, - void * sender) +static void +HIDRemovalCallback(void *target, IOReturn result, void *refcon, void *sender) { - recDevice *device = (recDevice *) refcon; - device->removed = 1; - device->uncentered = 1; + recDevice *device = (recDevice *) refcon; + device->removed = 1; + s_bDeviceRemoved = SDL_TRUE; } +/* Called by the io port notifier on removal of this device + */ +void JoystickDeviceWasRemovedCallback( void * refcon, io_service_t service, natural_t messageType, void * messageArgument ) +{ + if( messageType == kIOMessageServiceIsTerminated && refcon ) + { + recDevice *device = (recDevice *) refcon; + device->removed = 1; + s_bDeviceRemoved = SDL_TRUE; + } +} + /* Create and open an interface to device, required prior to extracting values or building queues. - * Note: appliction now owns the device and must close and release it prior to exiting + * Note: application now owns the device and must close and release it prior to exiting */ -static IOReturn HIDCreateOpenDeviceInterface (io_object_t hidDevice, recDevice *pDevice) -{ - IOReturn result = kIOReturnSuccess; - HRESULT plugInResult = S_OK; - SInt32 score = 0; - IOCFPlugInInterface ** ppPlugInInterface = NULL; - - if (NULL == pDevice->interface) - { - result = IOCreatePlugInInterfaceForService (hidDevice, kIOHIDDeviceUserClientTypeID, - kIOCFPlugInInterfaceID, &ppPlugInInterface, &score); - if (kIOReturnSuccess == result) - { - /* Call a method of the intermediate plug-in to create the device interface */ - plugInResult = (*ppPlugInInterface)->QueryInterface (ppPlugInInterface, - CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), (void *) &(pDevice->interface)); - if (S_OK != plugInResult) - HIDReportErrorNum ("CouldnÕt query HID class device interface from plugInInterface", plugInResult); - (*ppPlugInInterface)->Release (ppPlugInInterface); - } - else - HIDReportErrorNum ("Failed to create **plugInInterface via IOCreatePlugInInterfaceForService.", result); - } - if (NULL != pDevice->interface) - { - result = (*(pDevice->interface))->open (pDevice->interface, 0); - if (kIOReturnSuccess != result) - HIDReportErrorNum ("Failed to open pDevice->interface via open.", result); - else - (*(pDevice->interface))->setRemovalCallback (pDevice->interface, HIDRemovalCallback, pDevice, pDevice); - - } - return result; -} - -/* Closes and releases interface to device, should be done prior to exting application +static IOReturn +HIDCreateOpenDeviceInterface(io_object_t hidDevice, recDevice * pDevice) +{ + IOReturn result = kIOReturnSuccess; + HRESULT plugInResult = S_OK; + SInt32 score = 0; + IOCFPlugInInterface **ppPlugInInterface = NULL; + + if (NULL == pDevice->interface) { + result = + IOCreatePlugInInterfaceForService(hidDevice, + kIOHIDDeviceUserClientTypeID, + kIOCFPlugInInterfaceID, + &ppPlugInInterface, &score); + if (kIOReturnSuccess == result) { + /* Call a method of the intermediate plug-in to create the device interface */ + plugInResult = + (*ppPlugInInterface)->QueryInterface(ppPlugInInterface, + CFUUIDGetUUIDBytes + (kIOHIDDeviceInterfaceID), + (void *) + &(pDevice->interface)); + if (S_OK != plugInResult) + HIDReportErrorNum + ("Couldn't query HID class device interface from plugInInterface", + plugInResult); + (*ppPlugInInterface)->Release(ppPlugInInterface); + } else + HIDReportErrorNum + ("Failed to create **plugInInterface via IOCreatePlugInInterfaceForService.", + result); + } + if (NULL != pDevice->interface) { + result = (*(pDevice->interface))->open(pDevice->interface, 0); + if (kIOReturnSuccess != result) + HIDReportErrorNum + ("Failed to open pDevice->interface via open.", result); + else + { + pDevice->portIterator = 0; + + /* It's okay if this fails, we have another detection method below */ + (*(pDevice->interface))->setRemovalCallback(pDevice->interface, + HIDRemovalCallback, + pDevice, pDevice); + + /* now connect notification for new devices */ + pDevice->notificationPort = IONotificationPortCreate(kIOMasterPortDefault); + + CFRunLoopAddSource(CFRunLoopGetCurrent(), + IONotificationPortGetRunLoopSource(pDevice->notificationPort), + kCFRunLoopDefaultMode); + + /* Register for notifications when a serial port is added to the system */ + result = IOServiceAddInterestNotification(pDevice->notificationPort, + hidDevice, + kIOGeneralInterest, + JoystickDeviceWasRemovedCallback, + pDevice, + &pDevice->portIterator); + if (kIOReturnSuccess != result) { + HIDReportErrorNum + ("Failed to register for removal callback.", result); + } + } + + } + return result; +} + +/* Closes and releases interface to device, should be done prior to exiting application * Note: will have no affect if device or interface do not exist * application will "own" the device if interface is not closed * (device may have to be plug and re-plugged in different location to get it working again without a restart) */ -static IOReturn HIDCloseReleaseInterface (recDevice *pDevice) -{ - IOReturn result = kIOReturnSuccess; - - if ((NULL != pDevice) && (NULL != pDevice->interface)) - { - /* close the interface */ - result = (*(pDevice->interface))->close (pDevice->interface); - if (kIOReturnNotOpen == result) - { - /* do nothing as device was not opened, thus can't be closed */ - } - else if (kIOReturnSuccess != result) - HIDReportErrorNum ("Failed to close IOHIDDeviceInterface.", result); - /* release the interface */ - result = (*(pDevice->interface))->Release (pDevice->interface); - if (kIOReturnSuccess != result) - HIDReportErrorNum ("Failed to release IOHIDDeviceInterface.", result); - pDevice->interface = NULL; - } - return result; +static IOReturn +HIDCloseReleaseInterface(recDevice * pDevice) +{ + IOReturn result = kIOReturnSuccess; + + if ((NULL != pDevice) && (NULL != pDevice->interface)) { + /* close the interface */ + result = (*(pDevice->interface))->close(pDevice->interface); + if (kIOReturnNotOpen == result) { + /* do nothing as device was not opened, thus can't be closed */ + } else if (kIOReturnSuccess != result) + HIDReportErrorNum("Failed to close IOHIDDeviceInterface.", + result); + /* release the interface */ + result = (*(pDevice->interface))->Release(pDevice->interface); + if (kIOReturnSuccess != result) + HIDReportErrorNum("Failed to release IOHIDDeviceInterface.", + result); + pDevice->interface = NULL; + + if ( pDevice->portIterator ) + { + IOObjectRelease( pDevice->portIterator ); + pDevice->portIterator = 0; + } + } + return result; } /* extracts actual specific element information from each element CF dictionary entry */ -static void HIDGetElementInfo (CFTypeRef refElement, recElement *pElement) +static void +HIDGetElementInfo(CFTypeRef refElement, recElement * pElement) { - long number; - CFTypeRef refType; - - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementCookieKey)); - if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) - pElement->cookie = (IOHIDElementCookie) number; - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementMinKey)); - if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) - pElement->minReport = pElement->min = number; - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementMaxKey)); - if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) - pElement->maxReport = pElement->max = number; + long number; + CFTypeRef refType; + + refType = CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementCookieKey)); + if (refType && CFNumberGetValue(refType, kCFNumberLongType, &number)) + pElement->cookie = (IOHIDElementCookie) number; + refType = CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementMinKey)); + if (refType && CFNumberGetValue(refType, kCFNumberLongType, &number)) + pElement->minReport = pElement->min = number; + pElement->maxReport = pElement->min; + refType = CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementMaxKey)); + if (refType && CFNumberGetValue(refType, kCFNumberLongType, &number)) + pElement->maxReport = pElement->max = number; /* - TODO: maybe should handle the following stuff somehow? - - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMinKey)); - if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) - pElement->scaledMin = number; - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMaxKey)); - if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) - pElement->scaledMax = number; - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementSizeKey)); - if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) - pElement->size = number; - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsRelativeKey)); - if (refType) - pElement->relative = CFBooleanGetValue (refType); - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsWrappingKey)); - if (refType) - pElement->wrapping = CFBooleanGetValue (refType); - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsNonLinearKey)); - if (refType) - pElement->nonLinear = CFBooleanGetValue (refType); - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasPreferedStateKey)); - if (refType) - pElement->preferredState = CFBooleanGetValue (refType); - refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasNullStateKey)); - if (refType) - pElement->nullState = CFBooleanGetValue (refType); + TODO: maybe should handle the following stuff somehow? + + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMinKey)); + if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) + pElement->scaledMin = number; + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMaxKey)); + if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) + pElement->scaledMax = number; + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementSizeKey)); + if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number)) + pElement->size = number; + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsRelativeKey)); + if (refType) + pElement->relative = CFBooleanGetValue (refType); + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsWrappingKey)); + if (refType) + pElement->wrapping = CFBooleanGetValue (refType); + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsNonLinearKey)); + if (refType) + pElement->nonLinear = CFBooleanGetValue (refType); + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasPreferedStateKey)); + if (refType) + pElement->preferredState = CFBooleanGetValue (refType); + refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasNullStateKey)); + if (refType) + pElement->nullState = CFBooleanGetValue (refType); */ -} +} -/* examines CF dictionary vlaue in device element hierarchy to determine if it is element of interest or a collection of more elements +/* examines CF dictionary value in device element hierarchy to determine if it is element of interest or a collection of more elements * if element of interest allocate storage, add to list and retrieve element specific info * if collection then pass on to deconstruction collection into additional individual elements */ -static void HIDAddElement (CFTypeRef refElement, recDevice* pDevice) -{ - recElement* element = NULL; - recElement** headElement = NULL; - long elementType, usagePage, usage; - CFTypeRef refElementType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementTypeKey)); - CFTypeRef refUsagePage = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementUsagePageKey)); - CFTypeRef refUsage = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementUsageKey)); - - - if ((refElementType) && (CFNumberGetValue (refElementType, kCFNumberLongType, &elementType))) - { - /* look at types of interest */ - if ((elementType == kIOHIDElementTypeInput_Misc) || (elementType == kIOHIDElementTypeInput_Button) || - (elementType == kIOHIDElementTypeInput_Axis)) - { - if (refUsagePage && CFNumberGetValue (refUsagePage, kCFNumberLongType, &usagePage) && - refUsage && CFNumberGetValue (refUsage, kCFNumberLongType, &usage)) - { - switch (usagePage) /* only interested in kHIDPage_GenericDesktop and kHIDPage_Button */ - { - case kHIDPage_GenericDesktop: - { - switch (usage) /* look at usage to determine function */ - { - case kHIDUsage_GD_X: - case kHIDUsage_GD_Y: - case kHIDUsage_GD_Z: - case kHIDUsage_GD_Rx: - case kHIDUsage_GD_Ry: - case kHIDUsage_GD_Rz: - case kHIDUsage_GD_Slider: - case kHIDUsage_GD_Dial: - case kHIDUsage_GD_Wheel: - element = (recElement *) NewPtrClear (sizeof (recElement)); - if (element) - { - pDevice->axes++; - headElement = &(pDevice->firstAxis); - } - break; - case kHIDUsage_GD_Hatswitch: - element = (recElement *) NewPtrClear (sizeof (recElement)); - if (element) - { - pDevice->hats++; - headElement = &(pDevice->firstHat); - } - break; - } - } - break; - case kHIDPage_Button: - element = (recElement *) NewPtrClear (sizeof (recElement)); - if (element) - { - pDevice->buttons++; - headElement = &(pDevice->firstButton); - } - break; - default: - break; - } - } - } - else if (kIOHIDElementTypeCollection == elementType) - HIDGetCollectionElements ((CFMutableDictionaryRef) refElement, pDevice); - } - - if (element && headElement) /* add to list */ - { - pDevice->elements++; - if (NULL == *headElement) - *headElement = element; - else - { - recElement *elementPrevious, *elementCurrent; - elementCurrent = *headElement; - while (elementCurrent) - { - elementPrevious = elementCurrent; - elementCurrent = elementPrevious->pNext; - } - elementPrevious->pNext = element; - } - element->pNext = NULL; - HIDGetElementInfo (refElement, element); - } -} - -/* collects information from each array member in device element list (each array memeber = element) */ - -static void HIDGetElementsCFArrayHandler (const void * value, void * parameter) -{ - if (CFGetTypeID (value) == CFDictionaryGetTypeID ()) - HIDAddElement ((CFTypeRef) value, (recDevice *) parameter); +static void +HIDAddElement(CFTypeRef refElement, recDevice * pDevice) +{ + recElement *element = NULL; + recElement **headElement = NULL; + long elementType, usagePage, usage; + CFTypeRef refElementType = + CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementTypeKey)); + CFTypeRef refUsagePage = + CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementUsagePageKey)); + CFTypeRef refUsage = + CFDictionaryGetValue(refElement, CFSTR(kIOHIDElementUsageKey)); + + + if ((refElementType) + && + (CFNumberGetValue(refElementType, kCFNumberLongType, &elementType))) { + /* look at types of interest */ + if ((elementType == kIOHIDElementTypeInput_Misc) + || (elementType == kIOHIDElementTypeInput_Button) + || (elementType == kIOHIDElementTypeInput_Axis)) { + if (refUsagePage + && CFNumberGetValue(refUsagePage, kCFNumberLongType, + &usagePage) && refUsage + && CFNumberGetValue(refUsage, kCFNumberLongType, &usage)) { + switch (usagePage) { /* only interested in kHIDPage_GenericDesktop and kHIDPage_Button */ + case kHIDPage_GenericDesktop: + { + switch (usage) { /* look at usage to determine function */ + case kHIDUsage_GD_X: + case kHIDUsage_GD_Y: + case kHIDUsage_GD_Z: + case kHIDUsage_GD_Rx: + case kHIDUsage_GD_Ry: + case kHIDUsage_GD_Rz: + case kHIDUsage_GD_Slider: + case kHIDUsage_GD_Dial: + case kHIDUsage_GD_Wheel: + element = (recElement *) + NewPtrClear(sizeof(recElement)); + if (element) { + pDevice->axes++; + headElement = &(pDevice->firstAxis); + } + break; + case kHIDUsage_GD_Hatswitch: + element = (recElement *) + NewPtrClear(sizeof(recElement)); + if (element) { + pDevice->hats++; + headElement = &(pDevice->firstHat); + } + break; + } + } + break; + case kHIDPage_Simulation: + switch (usage) { + case kHIDUsage_Sim_Rudder: + case kHIDUsage_Sim_Throttle: + element = (recElement *) + NewPtrClear(sizeof(recElement)); + if (element) { + pDevice->axes++; + headElement = &(pDevice->firstAxis); + } + break; + + default: + break; + } + break; + case kHIDPage_Button: + element = (recElement *) + NewPtrClear(sizeof(recElement)); + if (element) { + pDevice->buttons++; + headElement = &(pDevice->firstButton); + } + break; + default: + break; + } + } + } else if (kIOHIDElementTypeCollection == elementType) + HIDGetCollectionElements((CFMutableDictionaryRef) refElement, + pDevice); + } + + if (element && headElement) { /* add to list */ + recElement *elementPrevious = NULL; + recElement *elementCurrent = *headElement; + while (elementCurrent && usage >= elementCurrent->usage) { + elementPrevious = elementCurrent; + elementCurrent = elementCurrent->pNext; + } + if (elementPrevious) { + elementPrevious->pNext = element; + } else { + *headElement = element; + } + element->usagePage = usagePage; + element->usage = usage; + element->pNext = elementCurrent; + HIDGetElementInfo(refElement, element); + pDevice->elements++; + } +} + +/* collects information from each array member in device element list (each array member = element) */ + +static void +HIDGetElementsCFArrayHandler(const void *value, void *parameter) +{ + if (CFGetTypeID(value) == CFDictionaryGetTypeID()) + HIDAddElement((CFTypeRef) value, (recDevice *) parameter); } /* handles retrieval of element information from arrays of elements in device IO registry information */ -static void HIDGetElements (CFTypeRef refElementCurrent, recDevice *pDevice) +static void +HIDGetElements(CFTypeRef refElementCurrent, recDevice * pDevice) { - CFTypeID type = CFGetTypeID (refElementCurrent); - if (type == CFArrayGetTypeID()) /* if element is an array */ - { - CFRange range = {0, CFArrayGetCount (refElementCurrent)}; - /* CountElementsCFArrayHandler called for each array member */ - CFArrayApplyFunction (refElementCurrent, range, HIDGetElementsCFArrayHandler, pDevice); - } -} + CFTypeID type = CFGetTypeID(refElementCurrent); + if (type == CFArrayGetTypeID()) { /* if element is an array */ + CFRange range = { 0, CFArrayGetCount(refElementCurrent) }; + /* CountElementsCFArrayHandler called for each array member */ + CFArrayApplyFunction(refElementCurrent, range, + HIDGetElementsCFArrayHandler, pDevice); + } +} /* handles extracting element information from element collection CF types * used from top level element decoding and hierarchy deconstruction to flatten device element list */ -static void HIDGetCollectionElements (CFMutableDictionaryRef deviceProperties, recDevice *pDevice) +static void +HIDGetCollectionElements(CFMutableDictionaryRef deviceProperties, + recDevice * pDevice) { - CFTypeRef refElementTop = CFDictionaryGetValue (deviceProperties, CFSTR(kIOHIDElementKey)); - if (refElementTop) - HIDGetElements (refElementTop, pDevice); + CFTypeRef refElementTop = + CFDictionaryGetValue(deviceProperties, CFSTR(kIOHIDElementKey)); + if (refElementTop) + HIDGetElements(refElementTop, pDevice); } /* use top level element usage page and usage to discern device usage page and usage setting appropriate vlaues in device record */ -static void HIDTopLevelElementHandler (const void * value, void * parameter) +static void +HIDTopLevelElementHandler(const void *value, void *parameter) { - CFTypeRef refCF = 0; - if (CFGetTypeID (value) != CFDictionaryGetTypeID ()) - return; - refCF = CFDictionaryGetValue (value, CFSTR(kIOHIDElementUsagePageKey)); - if (!CFNumberGetValue (refCF, kCFNumberLongType, &((recDevice *) parameter)->usagePage)) - SDL_SetError ("CFNumberGetValue error retrieving pDevice->usagePage."); - refCF = CFDictionaryGetValue (value, CFSTR(kIOHIDElementUsageKey)); - if (!CFNumberGetValue (refCF, kCFNumberLongType, &((recDevice *) parameter)->usage)) - SDL_SetError ("CFNumberGetValue error retrieving pDevice->usage."); + CFTypeRef refCF = 0; + if (CFGetTypeID(value) != CFDictionaryGetTypeID()) + return; + refCF = CFDictionaryGetValue(value, CFSTR(kIOHIDElementUsagePageKey)); + if (!CFNumberGetValue + (refCF, kCFNumberLongType, &((recDevice *) parameter)->usagePage)) + SDL_SetError("CFNumberGetValue error retrieving pDevice->usagePage."); + refCF = CFDictionaryGetValue(value, CFSTR(kIOHIDElementUsageKey)); + if (!CFNumberGetValue + (refCF, kCFNumberLongType, &((recDevice *) parameter)->usage)) + SDL_SetError("CFNumberGetValue error retrieving pDevice->usage."); } /* extracts device info from CF dictionary records in IO registry */ -static void HIDGetDeviceInfo (io_object_t hidDevice, CFMutableDictionaryRef hidProperties, recDevice *pDevice) -{ - CFMutableDictionaryRef usbProperties = 0; - io_registry_entry_t parent1, parent2; - - /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also - * get dictionary for usb properties: step up two levels and get CF dictionary for USB properties - */ - if ((KERN_SUCCESS == IORegistryEntryGetParentEntry (hidDevice, kIOServicePlane, &parent1)) && - (KERN_SUCCESS == IORegistryEntryGetParentEntry (parent1, kIOServicePlane, &parent2)) && - (KERN_SUCCESS == IORegistryEntryCreateCFProperties (parent2, &usbProperties, kCFAllocatorDefault, kNilOptions))) - { - if (usbProperties) - { - CFTypeRef refCF = 0; - /* get device info - * try hid dictionary first, if fail then go to usb dictionary - */ - - - /* get product name */ - refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDProductKey)); - if (!refCF) - refCF = CFDictionaryGetValue (usbProperties, CFSTR("USB Product Name")); - if (refCF) - { - if (!CFStringGetCString (refCF, pDevice->product, 256, CFStringGetSystemEncoding ())) - SDL_SetError ("CFStringGetCString error retrieving pDevice->product."); - } - - /* get usage page and usage */ - refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey)); - if (refCF) - { - if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usagePage)) - SDL_SetError ("CFNumberGetValue error retrieving pDevice->usagePage."); - refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDPrimaryUsageKey)); - if (refCF) - if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usage)) - SDL_SetError ("CFNumberGetValue error retrieving pDevice->usage."); - } - - if (NULL == refCF) /* get top level element HID usage page or usage */ - { - /* use top level element instead */ - CFTypeRef refCFTopElement = 0; - refCFTopElement = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDElementKey)); - { - /* refCFTopElement points to an array of element dictionaries */ - CFRange range = {0, CFArrayGetCount (refCFTopElement)}; - CFArrayApplyFunction (refCFTopElement, range, HIDTopLevelElementHandler, pDevice); - } - } - - CFRelease (usbProperties); - } - else - SDL_SetError ("IORegistryEntryCreateCFProperties failed to create usbProperties."); - - if (kIOReturnSuccess != IOObjectRelease (parent2)) - SDL_SetError ("IOObjectRelease error with parent2."); - if (kIOReturnSuccess != IOObjectRelease (parent1)) - SDL_SetError ("IOObjectRelease error with parent1."); - } -} - - -static recDevice *HIDBuildDevice (io_object_t hidDevice) -{ - recDevice *pDevice = (recDevice *) NewPtrClear (sizeof (recDevice)); - if (pDevice) - { - /* get dictionary for HID properties */ - CFMutableDictionaryRef hidProperties = 0; - kern_return_t result = IORegistryEntryCreateCFProperties (hidDevice, &hidProperties, kCFAllocatorDefault, kNilOptions); - if ((result == KERN_SUCCESS) && hidProperties) - { - /* create device interface */ - result = HIDCreateOpenDeviceInterface (hidDevice, pDevice); - if (kIOReturnSuccess == result) - { - HIDGetDeviceInfo (hidDevice, hidProperties, pDevice); /* hidDevice used to find parents in registry tree */ - HIDGetCollectionElements (hidProperties, pDevice); - } - else - { - DisposePtr((Ptr)pDevice); - pDevice = NULL; - } - CFRelease (hidProperties); - } - else - { - DisposePtr((Ptr)pDevice); - pDevice = NULL; - } - } - return pDevice; +static void +HIDGetDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef hidProperties, + recDevice * pDevice) +{ + CFMutableDictionaryRef usbProperties = 0; + io_registry_entry_t parent1, parent2; + + /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also + * get dictionary for USB properties: step up two levels and get CF dictionary for USB properties + */ + if ((KERN_SUCCESS == IORegistryEntryGetParentEntry(hidDevice, kIOServicePlane, &parent1)) + && (KERN_SUCCESS == IORegistryEntryGetParentEntry(parent1, kIOServicePlane, &parent2)) + && (KERN_SUCCESS == IORegistryEntryCreateCFProperties(parent2, &usbProperties, kCFAllocatorDefault, kNilOptions))) { + if (usbProperties) { + CFTypeRef refCF = 0; + /* get device info + * try hid dictionary first, if fail then go to usb dictionary + */ + + /* get product name */ + refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductKey)); + if (!refCF) { + refCF = CFDictionaryGetValue(usbProperties, CFSTR("USB Product Name")); + } + if (refCF) { + if (!CFStringGetCString(refCF, pDevice->product, 256, CFStringGetSystemEncoding())) { + SDL_SetError("CFStringGetCString error retrieving pDevice->product."); + } + } + + /* get usage page and usage */ + refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey)); + if (refCF) { + if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usagePage)) { + SDL_SetError("CFNumberGetValue error retrieving pDevice->usagePage."); + } + + refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsageKey)); + if (refCF) { + if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usage)) { + SDL_SetError("CFNumberGetValue error retrieving pDevice->usage."); + } + } + } + + refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDVendorIDKey)); + if (refCF) { + if (!CFNumberGetValue(refCF, kCFNumberLongType, &pDevice->guid.data[0])) { + SDL_SetError("CFNumberGetValue error retrieving pDevice->guid[0]"); + } + } + + refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductIDKey)); + if (refCF) { + if (!CFNumberGetValue(refCF, kCFNumberLongType, &pDevice->guid.data[8])) { + SDL_SetError("CFNumberGetValue error retrieving pDevice->guid[8]"); + } + } + + /* Check to make sure we have a vendor and product ID + If we don't, use the same algorithm as the Linux code for Bluetooth devices */ + { + Uint32 *guid32 = (Uint32*)pDevice->guid.data; + if (!guid32[0] && !guid32[1]) { + const Uint16 BUS_BLUETOOTH = 0x05; + Uint16 *guid16 = (Uint16 *)guid32; + *guid16++ = BUS_BLUETOOTH; + *guid16++ = 0; + SDL_strlcpy((char*)guid16, pDevice->product, sizeof(pDevice->guid.data) - 4); + } + } + + /* If we don't have a vendor and product ID this is probably a Bluetooth device */ + + if (NULL == refCF) { /* get top level element HID usage page or usage */ + /* use top level element instead */ + CFTypeRef refCFTopElement = 0; + refCFTopElement = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDElementKey)); + { + /* refCFTopElement points to an array of element dictionaries */ + CFRange range = { 0, CFArrayGetCount(refCFTopElement) }; + CFArrayApplyFunction(refCFTopElement, range, HIDTopLevelElementHandler, pDevice); + } + } + + CFRelease(usbProperties); + } else { + SDL_SetError("IORegistryEntryCreateCFProperties failed to create usbProperties."); + } + + if (kIOReturnSuccess != IOObjectRelease(parent2)) { + SDL_SetError("IOObjectRelease error with parent2"); + } + if (kIOReturnSuccess != IOObjectRelease(parent1)) { + SDL_SetError("IOObjectRelease error with parent1"); + } + } +} + + +static recDevice * +HIDBuildDevice(io_object_t hidDevice) +{ + recDevice *pDevice = (recDevice *) NewPtrClear(sizeof(recDevice)); + if (pDevice) { + /* get dictionary for HID properties */ + CFMutableDictionaryRef hidProperties = 0; + kern_return_t result = + IORegistryEntryCreateCFProperties(hidDevice, &hidProperties, + kCFAllocatorDefault, + kNilOptions); + if ((result == KERN_SUCCESS) && hidProperties) { + /* create device interface */ + result = HIDCreateOpenDeviceInterface(hidDevice, pDevice); + if (kIOReturnSuccess == result) { + HIDGetDeviceInfo(hidDevice, hidProperties, pDevice); /* hidDevice used to find parents in registry tree */ + HIDGetCollectionElements(hidProperties, pDevice); + pDevice->instance_id = ++s_joystick_instance_id; + } else { + DisposePtr((Ptr) pDevice); + pDevice = NULL; + } + CFRelease(hidProperties); + } else { + DisposePtr((Ptr) pDevice); + pDevice = NULL; + } + } + return pDevice; } /* disposes of the element list associated with a device and the memory associated with the list */ -static void HIDDisposeElementList (recElement **elementList) +static void +HIDDisposeElementList(recElement ** elementList) { - recElement *pElement = *elementList; - while (pElement) - { - recElement *pElementNext = pElement->pNext; - DisposePtr ((Ptr) pElement); - pElement = pElementNext; - } - *elementList = NULL; + recElement *pElement = *elementList; + while (pElement) { + recElement *pElementNext = pElement->pNext; + DisposePtr((Ptr) pElement); + pElement = pElementNext; + } + *elementList = NULL; } /* disposes of a single device, closing and releaseing interface, freeing memory fro device and elements, setting device pointer to NULL * all your device no longer belong to us... (i.e., you do not 'own' the device anymore) */ -static recDevice *HIDDisposeDevice (recDevice **ppDevice) -{ - kern_return_t result = KERN_SUCCESS; - recDevice *pDeviceNext = NULL; - if (*ppDevice) - { - /* save next device prior to disposing of this device */ - pDeviceNext = (*ppDevice)->pNext; - - /* free element lists */ - HIDDisposeElementList (&(*ppDevice)->firstAxis); - HIDDisposeElementList (&(*ppDevice)->firstButton); - HIDDisposeElementList (&(*ppDevice)->firstHat); - - result = HIDCloseReleaseInterface (*ppDevice); /* function sanity checks interface value (now application does not own device) */ - if (kIOReturnSuccess != result) - HIDReportErrorNum ("HIDCloseReleaseInterface failed when trying to dipose device.", result); - DisposePtr ((Ptr)*ppDevice); - *ppDevice = NULL; - } - return pDeviceNext; +static recDevice * +HIDDisposeDevice(recDevice ** ppDevice) +{ + kern_return_t result = KERN_SUCCESS; + recDevice *pDeviceNext = NULL; + if (*ppDevice) { + /* save next device prior to disposing of this device */ + pDeviceNext = (*ppDevice)->pNext; + + /* free posible io_service_t */ + if ((*ppDevice)->ffservice) { + IOObjectRelease((*ppDevice)->ffservice); + (*ppDevice)->ffservice = 0; + } + + /* free element lists */ + HIDDisposeElementList(&(*ppDevice)->firstAxis); + HIDDisposeElementList(&(*ppDevice)->firstButton); + HIDDisposeElementList(&(*ppDevice)->firstHat); + + result = HIDCloseReleaseInterface(*ppDevice); /* function sanity checks interface value (now application does not own device) */ + if (kIOReturnSuccess != result) + HIDReportErrorNum + ("HIDCloseReleaseInterface failed when trying to dipose device.", + result); + DisposePtr((Ptr) * ppDevice); + *ppDevice = NULL; + } + return pDeviceNext; +} + + +/* Given an io_object_t from OSX adds a joystick device to our list if appropriate + */ +int +AddDeviceHelper( io_object_t ioHIDDeviceObject ) +{ + recDevice *device; + + /* build a device record */ + device = HIDBuildDevice(ioHIDDeviceObject); + if (!device) + return 0; + + /* Filter device list to non-keyboard/mouse stuff */ + if ((device->usagePage != kHIDPage_GenericDesktop) || + ((device->usage != kHIDUsage_GD_Joystick && + device->usage != kHIDUsage_GD_GamePad && + device->usage != kHIDUsage_GD_MultiAxisController))) { + + /* release memory for the device */ + HIDDisposeDevice(&device); + DisposePtr((Ptr) device); + return 0; + } + + /* We have to do some storage of the io_service_t for + * SDL_HapticOpenFromJoystick */ + if (FFIsForceFeedback(ioHIDDeviceObject) == FF_OK) { + device->ffservice = ioHIDDeviceObject; + } else { + device->ffservice = 0; + } + + device->send_open_event = 1; + s_bDeviceAdded = SDL_TRUE; + + /* Add device to the end of the list */ + if ( !gpDeviceList ) + { + gpDeviceList = device; + } + else + { + recDevice *curdevice; + + curdevice = gpDeviceList; + while ( curdevice->pNext ) + { + curdevice = curdevice->pNext; + } + curdevice->pNext = device; + } + + return 1; +} + + +/* Called by our IO port notifier on the master port when a HID device is inserted, we iterate + * and check for new joysticks + */ +void JoystickDeviceWasAddedCallback( void *refcon, io_iterator_t iterator ) +{ + io_object_t ioHIDDeviceObject = 0; + + while ( ( ioHIDDeviceObject = IOIteratorNext(iterator) ) ) + { + if ( ioHIDDeviceObject ) + { + AddDeviceHelper( ioHIDDeviceObject ); + } + } } @@ -567,127 +732,211 @@ static recDevice *HIDDisposeDevice (recDevice **ppDevice) * This function should return the number of available joysticks, or -1 * on an unrecoverable fatal error. */ -int SDL_SYS_JoystickInit(void) -{ - IOReturn result = kIOReturnSuccess; - mach_port_t masterPort = 0; - io_iterator_t hidObjectIterator = 0; - CFMutableDictionaryRef hidMatchDictionary = NULL; - recDevice *device, *lastDevice; - io_object_t ioHIDDeviceObject = 0; - - SDL_numjoysticks = 0; - - if (gpDeviceList) - { - SDL_SetError("Joystick: Device list already inited."); - return -1; - } - - result = IOMasterPort (bootstrap_port, &masterPort); - if (kIOReturnSuccess != result) - { - SDL_SetError("Joystick: IOMasterPort error with bootstrap_port."); - return -1; - } - - /* Set up a matching dictionary to search I/O Registry by class name for all HID class devices. */ - hidMatchDictionary = IOServiceMatching (kIOHIDDeviceKey); - if (hidMatchDictionary) - { - /* Add key for device type (joystick, in this case) to refine the matching dictionary. */ - - /* NOTE: we now perform this filtering later - UInt32 usagePage = kHIDPage_GenericDesktop; - UInt32 usage = kHIDUsage_GD_Joystick; - CFNumberRef refUsage = NULL, refUsagePage = NULL; - - refUsage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usage); - CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsageKey), refUsage); - refUsagePage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usagePage); - CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsagePageKey), refUsagePage); - */ - } - else - { - SDL_SetError("Joystick: Failed to get HID CFMutableDictionaryRef via IOServiceMatching."); - return -1; - } - - /*/ Now search I/O Registry for matching devices. */ - result = IOServiceGetMatchingServices (masterPort, hidMatchDictionary, &hidObjectIterator); - /* Check for errors */ - if (kIOReturnSuccess != result) - { - SDL_SetError("Joystick: Couldn't create a HID object iterator."); - return -1; - } - if (!hidObjectIterator) /* there are no joysticks */ - { - gpDeviceList = NULL; - SDL_numjoysticks = 0; - return 0; - } - /* IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref. */ - - /* build flat linked list of devices from device iterator */ - - gpDeviceList = lastDevice = NULL; - - while ((ioHIDDeviceObject = IOIteratorNext (hidObjectIterator))) - { - /* build a device record */ - device = HIDBuildDevice (ioHIDDeviceObject); - if (!device) - continue; - - /* dump device object, it is no longer needed */ - result = IOObjectRelease (ioHIDDeviceObject); -/* if (KERN_SUCCESS != result) - HIDReportErrorNum ("IOObjectRelease error with ioHIDDeviceObject.", result); -*/ +int +SDL_SYS_JoystickInit(void) +{ + IOReturn result = kIOReturnSuccess; + mach_port_t masterPort = 0; + io_iterator_t hidObjectIterator = 0; + CFMutableDictionaryRef hidMatchDictionary = NULL; + io_object_t ioHIDDeviceObject = 0; + io_iterator_t portIterator = 0; + + if (gpDeviceList) { + return SDL_SetError("Joystick: Device list already inited."); + } + + result = IOMasterPort(bootstrap_port, &masterPort); + if (kIOReturnSuccess != result) { + return SDL_SetError("Joystick: IOMasterPort error with bootstrap_port."); + } + + /* Set up a matching dictionary to search I/O Registry by class name for all HID class devices. */ + hidMatchDictionary = IOServiceMatching(kIOHIDDeviceKey); + if (hidMatchDictionary) { + /* Add key for device type (joystick, in this case) to refine the matching dictionary. */ + + /* NOTE: we now perform this filtering later + UInt32 usagePage = kHIDPage_GenericDesktop; + UInt32 usage = kHIDUsage_GD_Joystick; + CFNumberRef refUsage = NULL, refUsagePage = NULL; + + refUsage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usage); + CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsageKey), refUsage); + refUsagePage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usagePage); + CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsagePageKey), refUsagePage); + */ + } else { + return SDL_SetError + ("Joystick: Failed to get HID CFMutableDictionaryRef via IOServiceMatching."); + } + + /*/ Now search I/O Registry for matching devices. */ + result = + IOServiceGetMatchingServices(masterPort, hidMatchDictionary, + &hidObjectIterator); + /* Check for errors */ + if (kIOReturnSuccess != result) { + return SDL_SetError("Joystick: Couldn't create a HID object iterator."); + } + if (!hidObjectIterator) { /* there are no joysticks */ + gpDeviceList = NULL; + return 0; + } + /* IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref. */ + + /* build flat linked list of devices from device iterator */ + + gpDeviceList = NULL; + + while ((ioHIDDeviceObject = IOIteratorNext(hidObjectIterator))) { + AddDeviceHelper( ioHIDDeviceObject ); + } + result = IOObjectRelease(hidObjectIterator); /* release the iterator */ + + /* now connect notification for new devices */ + notificationPort = IONotificationPortCreate(masterPort); + hidMatchDictionary = IOServiceMatching(kIOHIDDeviceKey); + + CFRunLoopAddSource(CFRunLoopGetCurrent(), + IONotificationPortGetRunLoopSource(notificationPort), + kCFRunLoopDefaultMode); + + /* Register for notifications when a serial port is added to the system */ + result = IOServiceAddMatchingNotification(notificationPort, + kIOFirstMatchNotification, + hidMatchDictionary, + JoystickDeviceWasAddedCallback, + NULL, + &portIterator); + while (IOIteratorNext(portIterator)) {}; /* Run out the iterator or notifications won't start (you can also use it to iterate the available devices). */ + + return SDL_SYS_NumJoysticks(); +} + +/* Function to return the number of joystick devices plugged in right now */ +int +SDL_SYS_NumJoysticks() +{ + recDevice *device = gpDeviceList; + int nJoySticks = 0; - /* Filter device list to non-keyboard/mouse stuff */ - if ( (device->usagePage != kHIDPage_GenericDesktop) || - ((device->usage != kHIDUsage_GD_Joystick && - device->usage != kHIDUsage_GD_GamePad && - device->usage != kHIDUsage_GD_MultiAxisController)) ) { - - /* release memory for the device */ - HIDDisposeDevice (&device); - DisposePtr((Ptr)device); - continue; - } - - /* Add device to the end of the list */ - if (lastDevice) - lastDevice->pNext = device; - else - gpDeviceList = device; - lastDevice = device; - } - result = IOObjectRelease (hidObjectIterator); /* release the iterator */ - - /* Count the total number of devices we found */ - device = gpDeviceList; - while (device) - { - SDL_numjoysticks++; - device = device->pNext; - } - - return SDL_numjoysticks; + while ( device ) + { + if ( !device->removed ) + nJoySticks++; + device = device->pNext; + } + + return nJoySticks; +} + +/* Function to cause any queued joystick insertions to be processed + */ +void +SDL_SYS_JoystickDetect() +{ + if ( s_bDeviceAdded || s_bDeviceRemoved ) + { + recDevice *device = gpDeviceList; + s_bDeviceAdded = SDL_FALSE; + s_bDeviceRemoved = SDL_FALSE; + int device_index = 0; + /* send notifications */ + while ( device ) + { + if ( device->send_open_event ) + { + device->send_open_event = 0; +#if !SDL_EVENTS_DISABLED + SDL_Event event; + event.type = SDL_JOYDEVICEADDED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = device_index; + if ((SDL_EventOK == NULL) + || (*SDL_EventOK) (SDL_EventOKParam, &event)) { + SDL_PushEvent(&event); + } + } +#endif /* !SDL_EVENTS_DISABLED */ + + } + + if ( device->removed ) + { + recDevice *removeDevice = device; + if ( gpDeviceList == removeDevice ) + { + device = device->pNext; + gpDeviceList = device; + } + else + { + device = gpDeviceList; + while ( device->pNext != removeDevice ) + { + device = device->pNext; + } + + device->pNext = removeDevice->pNext; + } + +#if !SDL_EVENTS_DISABLED + SDL_Event event; + event.type = SDL_JOYDEVICEREMOVED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = removeDevice->instance_id; + if ((SDL_EventOK == NULL) + || (*SDL_EventOK) (SDL_EventOKParam, &event)) { + SDL_PushEvent(&event); + } + } + + DisposePtr((Ptr) removeDevice); +#endif /* !SDL_EVENTS_DISABLED */ + + } + else + { + device = device->pNext; + device_index++; + } + } + } +} + +SDL_bool +SDL_SYS_JoystickNeedsPolling() +{ + return s_bDeviceAdded || s_bDeviceRemoved; } /* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) +const char * +SDL_SYS_JoystickNameForDeviceIndex(int device_index) +{ + recDevice *device = gpDeviceList; + + for (; device_index > 0; device_index--) + device = device->pNext; + + return device->product; +} + +/* Function to return the instance id of the joystick at device_index + */ +SDL_JoystickID +SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) { - recDevice *device = gpDeviceList; - - for (; index > 0; index--) - device = device->pNext; + recDevice *device = gpDeviceList; + int index; - return device->product; + for (index = device_index; index > 0; index--) + device = device->pNext; + + return device->instance_id; } /* Function to open a joystick for use. @@ -695,23 +944,43 @@ const char *SDL_SYS_JoystickName(int index) * This should fill the nbuttons and naxes fields of the joystick structure. * It returns 0, or -1 if there is an error. */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) +int +SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) +{ + recDevice *device = gpDeviceList; + int index; + + for (index = device_index; index > 0; index--) + device = device->pNext; + + joystick->instance_id = device->instance_id; + joystick->hwdata = device; + joystick->name = device->product; + + joystick->naxes = device->axes; + joystick->nhats = device->hats; + joystick->nballs = 0; + joystick->nbuttons = device->buttons; + return 0; +} + +/* Function to query if the joystick is currently attached + * It returns 1 if attached, 0 otherwise. + */ +SDL_bool +SDL_SYS_JoystickAttached(SDL_Joystick * joystick) { - recDevice *device = gpDeviceList; - int index; - - for (index = joystick->index; index > 0; index--) - device = device->pNext; + recDevice *device = gpDeviceList; - joystick->hwdata = device; - joystick->name = device->product; + while ( device ) + { + if ( joystick->instance_id == device->instance_id ) + return SDL_TRUE; - joystick->naxes = device->axes; - joystick->nhats = device->hats; - joystick->nballs = 0; - joystick->nbuttons = device->buttons; + device = device->pNext; + } - return 0; + return SDL_FALSE; } /* Function to update the state of a joystick - called as a device poll. @@ -719,124 +988,168 @@ int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) * but instead should call SDL_PrivateJoystick*() to deliver events * and update joystick device state. */ -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - recDevice *device = joystick->hwdata; - recElement *element; - SInt32 value, range; - int i; - - if (device->removed) /* device was unplugged; ignore it. */ - { - if (device->uncentered) - { - device->uncentered = 0; - - /* Tell the app that everything is centered/unpressed... */ - for (i = 0; i < device->axes; i++) - SDL_PrivateJoystickAxis(joystick, i, 0); - - for (i = 0; i < device->buttons; i++) - SDL_PrivateJoystickButton(joystick, i, 0); - - for (i = 0; i < device->hats; i++) - SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED); - } - - return; - } - - element = device->firstAxis; - i = 0; - while (element) - { - value = HIDScaledCalibratedValue(device, element, -32768, 32767); - if ( value != joystick->axes[i] ) - SDL_PrivateJoystickAxis(joystick, i, value); - element = element->pNext; - ++i; - } - - element = device->firstButton; - i = 0; - while (element) - { - value = HIDGetElementValue(device, element); - if (value > 1) /* handle pressure-sensitive buttons */ +void +SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) +{ + recDevice *device = joystick->hwdata; + recElement *element; + SInt32 value, range; + int i; + + if ( !device ) + return; + + if (device->removed) { /* device was unplugged; ignore it. */ + recDevice *devicelist = gpDeviceList; + joystick->closed = 1; + joystick->uncentered = 1; + + if ( devicelist == device ) + { + gpDeviceList = device->pNext; + } + else + { + while ( devicelist->pNext != device ) + { + devicelist = devicelist->pNext; + } + + devicelist->pNext = device->pNext; + } + + DisposePtr((Ptr) device); + joystick->hwdata = NULL; + +#if !SDL_EVENTS_DISABLED + SDL_Event event; + event.type = SDL_JOYDEVICEREMOVED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = joystick->instance_id; + if ((SDL_EventOK == NULL) + || (*SDL_EventOK) (SDL_EventOKParam, &event)) { + SDL_PushEvent(&event); + } + } +#endif /* !SDL_EVENTS_DISABLED */ + + return; + } + + element = device->firstAxis; + i = 0; + while (element) { + value = HIDScaledCalibratedValue(device, element, -32768, 32767); + if (value != joystick->axes[i]) + SDL_PrivateJoystickAxis(joystick, i, value); + element = element->pNext; + ++i; + } + + element = device->firstButton; + i = 0; + while (element) { + value = HIDGetElementValue(device, element); + if (value > 1) /* handle pressure-sensitive buttons */ value = 1; - if ( value != joystick->buttons[i] ) - SDL_PrivateJoystickButton(joystick, i, value); - element = element->pNext; - ++i; - } - - element = device->firstHat; - i = 0; - while (element) - { - Uint8 pos = 0; - - range = (element->max - element->min + 1); - value = HIDGetElementValue(device, element) - element->min; - if (range == 4) /* 4 position hatswitch - scale up value */ - value *= 2; - else if (range != 8) /* Neither a 4 nor 8 positions - fall back to default position (centered) */ - value = -1; - switch(value) - { - case 0: - pos = SDL_HAT_UP; - break; - case 1: - pos = SDL_HAT_RIGHTUP; - break; - case 2: - pos = SDL_HAT_RIGHT; - break; - case 3: - pos = SDL_HAT_RIGHTDOWN; - break; - case 4: - pos = SDL_HAT_DOWN; - break; - case 5: - pos = SDL_HAT_LEFTDOWN; - break; - case 6: - pos = SDL_HAT_LEFT; - break; - case 7: - pos = SDL_HAT_LEFTUP; - break; - default: - /* Every other value is mapped to center. We do that because some - * joysticks use 8 and some 15 for this value, and apparently - * there are even more variants out there - so we try to be generous. - */ - pos = SDL_HAT_CENTERED; - break; - } - if ( pos != joystick->hats[i] ) - SDL_PrivateJoystickHat(joystick, i, pos); - element = element->pNext; - ++i; - } - - return; + if (value != joystick->buttons[i]) + SDL_PrivateJoystickButton(joystick, i, value); + element = element->pNext; + ++i; + } + + element = device->firstHat; + i = 0; + while (element) { + Uint8 pos = 0; + + range = (element->max - element->min + 1); + value = HIDGetElementValue(device, element) - element->min; + if (range == 4) /* 4 position hatswitch - scale up value */ + value *= 2; + else if (range != 8) /* Neither a 4 nor 8 positions - fall back to default position (centered) */ + value = -1; + switch (value) { + case 0: + pos = SDL_HAT_UP; + break; + case 1: + pos = SDL_HAT_RIGHTUP; + break; + case 2: + pos = SDL_HAT_RIGHT; + break; + case 3: + pos = SDL_HAT_RIGHTDOWN; + break; + case 4: + pos = SDL_HAT_DOWN; + break; + case 5: + pos = SDL_HAT_LEFTDOWN; + break; + case 6: + pos = SDL_HAT_LEFT; + break; + case 7: + pos = SDL_HAT_LEFTUP; + break; + default: + /* Every other value is mapped to center. We do that because some + * joysticks use 8 and some 15 for this value, and apparently + * there are even more variants out there - so we try to be generous. + */ + pos = SDL_HAT_CENTERED; + break; + } + if (pos != joystick->hats[i]) + SDL_PrivateJoystickHat(joystick, i, pos); + element = element->pNext; + ++i; + } + + return; } /* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) +void +SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - /* Should we do anything here? */ - return; + joystick->closed = 1; } /* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) +void +SDL_SYS_JoystickQuit(void) { - while (NULL != gpDeviceList) - gpDeviceList = HIDDisposeDevice (&gpDeviceList); + while (NULL != gpDeviceList) + gpDeviceList = HIDDisposeDevice(&gpDeviceList); + + if ( notificationPort ) + { + IONotificationPortDestroy( notificationPort ); + notificationPort = 0; + } +} + + +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) +{ + recDevice *device = gpDeviceList; + int index; + + for (index = device_index; index > 0; index--) + device = device->pNext; + + return device->guid; +} + +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick *joystick) +{ + return joystick->hwdata->guid; } #endif /* SDL_JOYSTICK_IOKIT */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/darwin/SDL_sysjoystick_c.h b/src/joystick/darwin/SDL_sysjoystick_c.h new file mode 100644 index 0000000000..f99dbd8af8 --- /dev/null +++ b/src/joystick/darwin/SDL_sysjoystick_c.h @@ -0,0 +1,90 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_JOYSTICK_IOKIT_H + + +#include +#include +#include + + +struct recElement +{ + IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */ + long usagePage, usage; /* HID usage */ + long min; /* reported min value possible */ + long max; /* reported max value possible */ +#if 0 + /* TODO: maybe should handle the following stuff somehow? */ + + long scaledMin; /* reported scaled min value possible */ + long scaledMax; /* reported scaled max value possible */ + long size; /* size in bits of data return from element */ + Boolean relative; /* are reports relative to last report (deltas) */ + Boolean wrapping; /* does element wrap around (one value higher than max is min) */ + Boolean nonLinear; /* are the values reported non-linear relative to element movement */ + Boolean preferredState; /* does element have a preferred state (such as a button) */ + Boolean nullState; /* does element have null state */ +#endif /* 0 */ + + /* runtime variables used for auto-calibration */ + long minReport; /* min returned value */ + long maxReport; /* max returned value */ + + struct recElement *pNext; /* next element in list */ +}; +typedef struct recElement recElement; + +struct joystick_hwdata +{ + io_service_t ffservice; /* Interface for force feedback, 0 = no ff */ + IOHIDDeviceInterface **interface; /* interface to device, NULL = no interface */ + IONotificationPortRef notificationPort; /* port to be notified on joystick removal */ + io_iterator_t portIterator; /* iterator for removal callback */ + + char product[256]; /* name of product */ + long usage; /* usage page from IOUSBHID Parser.h which defines general usage */ + long usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */ + + long axes; /* number of axis (calculated, not reported by device) */ + long buttons; /* number of buttons (calculated, not reported by device) */ + long hats; /* number of hat switches (calculated, not reported by device) */ + long elements; /* number of total elements (should be total of above) (calculated, not reported by device) */ + + recElement *firstAxis; + recElement *firstButton; + recElement *firstHat; + + int removed; + int uncentered; + + int instance_id; + SDL_JoystickGUID guid; + Uint8 send_open_event; /* 1 if we need to send an Added event for this device */ + + struct joystick_hwdata *pNext; /* next device */ +}; +typedef struct joystick_hwdata recDevice; + + +#endif /* SDL_JOYSTICK_IOKIT_H */ diff --git a/src/joystick/dc/SDL_sysjoystick.c b/src/joystick/dc/SDL_sysjoystick.c deleted file mode 100644 index dc089e7bf0..0000000000 --- a/src/joystick/dc/SDL_sysjoystick.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_JOYSTICK_DC - -#include "SDL_events.h" -#include "SDL_joystick.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - -#include -#include - -#define MAX_JOYSTICKS 8 /* only 2 are supported in the multimedia API */ -#define MAX_AXES 6 /* each joystick can have up to 6 axes */ -#define MAX_BUTTONS 8 /* and 8 buttons */ -#define MAX_HATS 2 - -#define JOYNAMELEN 8 - -/* array to hold joystick ID values */ -static uint8 SYS_Joystick_addr[MAX_JOYSTICKS]; - -/* The private structure used to keep track of a joystick */ -struct joystick_hwdata -{ - cont_cond_t prev_cond; - int prev_buttons; -}; - -/* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. - * It should return 0, or -1 on an unrecoverable fatal error. - */ -int SDL_SYS_JoystickInit(void) -{ - int numdevs; - - int p,u; - - numdevs = 0; - for(p=0;pinfo.product_name; -} - -/* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. - This should fill the nbuttons and naxes fields of the joystick structure. - It returns 0, or -1 if there is an error. - */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) -{ - /* allocate memory for system specific hardware data */ - joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata)); - if (joystick->hwdata == NULL) - { - SDL_OutOfMemory(); - return(-1); - } - SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); - - /* fill nbuttons, naxes, and nhats fields */ - joystick->nbuttons = MAX_BUTTONS; - joystick->naxes = MAX_AXES; - joystick->nhats = MAX_HATS; - return(0); -} - - -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ - -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ -const int sdl_buttons[] = { - CONT_C, - CONT_B, - CONT_A, - CONT_START, - CONT_Z, - CONT_Y, - CONT_X, - CONT_D -}; - - uint8 addr; - cont_cond_t cond,*prev_cond; - int buttons,prev_buttons,i,changed; - - addr = SYS_Joystick_addr[joystick->index]; - if (cont_get_cond(addr,&cond)<0) return; - - buttons = cond.buttons; - prev_buttons = joystick->hwdata->prev_buttons; - changed = buttons^prev_buttons; - - if ((changed)&(CONT_DPAD_UP|CONT_DPAD_DOWN|CONT_DPAD_LEFT|CONT_DPAD_RIGHT)) { - int hat = SDL_HAT_CENTERED; - if (buttons&CONT_DPAD_UP) hat|=SDL_HAT_UP; - if (buttons&CONT_DPAD_DOWN) hat|=SDL_HAT_DOWN; - if (buttons&CONT_DPAD_LEFT) hat|=SDL_HAT_LEFT; - if (buttons&CONT_DPAD_RIGHT) hat|=SDL_HAT_RIGHT; - SDL_PrivateJoystickHat(joystick, 0, hat); - } - if ((changed)&(CONT_DPAD2_UP|CONT_DPAD2_DOWN|CONT_DPAD2_LEFT|CONT_DPAD2_RIGHT)) { - int hat = SDL_HAT_CENTERED; - if (buttons&CONT_DPAD2_UP) hat|=SDL_HAT_UP; - if (buttons&CONT_DPAD2_DOWN) hat|=SDL_HAT_DOWN; - if (buttons&CONT_DPAD2_LEFT) hat|=SDL_HAT_LEFT; - if (buttons&CONT_DPAD2_RIGHT) hat|=SDL_HAT_RIGHT; - SDL_PrivateJoystickHat(joystick, 1, hat); - } - - for(i=0;ihwdata->prev_cond; - if (cond.joyx!=prev_cond->joyx) - SDL_PrivateJoystickAxis(joystick, 0, cond.joyx-128); - if (cond.joyy!=prev_cond->joyy) - SDL_PrivateJoystickAxis(joystick, 1, cond.joyy-128); - if (cond.rtrig!=prev_cond->rtrig) - SDL_PrivateJoystickAxis(joystick, 2, cond.rtrig); - if (cond.ltrig!=prev_cond->ltrig) - SDL_PrivateJoystickAxis(joystick, 3, cond.ltrig); - if (cond.joy2x!=prev_cond->joy2x) - SDL_PrivateJoystickAxis(joystick, 4, cond.joy2x-128); - if (cond.joy2y!=prev_cond->joy2y) - SDL_PrivateJoystickAxis(joystick, 5, cond.joy2y-128); - - joystick->hwdata->prev_buttons = buttons; - joystick->hwdata->prev_cond = cond; -} - -/* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) -{ - if (joystick->hwdata != NULL) { - /* free system specific hardware data */ - SDL_free(joystick->hwdata); - } -} - -/* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) -{ - return; -} - -#endif /* SDL_JOYSTICK_DC */ diff --git a/src/joystick/dummy/SDL_sysjoystick.c b/src/joystick/dummy/SDL_sysjoystick.c index 3a1aae7c46..7dd9153b25 100644 --- a/src/joystick/dummy/SDL_sysjoystick.c +++ b/src/joystick/dummy/SDL_sysjoystick.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -30,21 +29,40 @@ #include "../SDL_joystick_c.h" /* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. * It should return 0, or -1 on an unrecoverable fatal error. */ -int SDL_SYS_JoystickInit(void) +int +SDL_SYS_JoystickInit(void) +{ + return (0); +} + +int SDL_SYS_NumJoysticks() +{ + return 0; +} + +void SDL_SYS_JoystickDetect() +{ +} + +SDL_bool SDL_SYS_JoystickNeedsPolling() { - SDL_numjoysticks = 0; - return(0); + return SDL_FALSE; } /* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) +const char * +SDL_SYS_JoystickNameForDeviceIndex(int device_index) +{ + SDL_SetError("Logic error: No joysticks available"); + return (NULL); +} + +/* Function to perform the mapping from device index to the instance id for this index */ +SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) { - SDL_SetError("Logic error: No joysticks available"); - return(NULL); + return device_index; } /* Function to open a joystick for use. @@ -52,10 +70,16 @@ const char *SDL_SYS_JoystickName(int index) This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) +int +SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) +{ + return SDL_SetError("Logic error: No joysticks available"); +} + +/* Function to determine is this joystick is attached to the system right now */ +SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { - SDL_SetError("Logic error: No joysticks available"); - return(-1); + return SDL_TRUE; } /* Function to update the state of a joystick - called as a device poll. @@ -63,21 +87,47 @@ int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) * but instead should call SDL_PrivateJoystick*() to deliver events * and update joystick device state. */ -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) +void +SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) { - return; + return; } /* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) +void +SDL_SYS_JoystickClose(SDL_Joystick * joystick) { - return; + return; } /* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) +void +SDL_SYS_JoystickQuit(void) +{ + return; +} + +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index ); + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + + +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) { - return; + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = joystick->name; + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; } #endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/iphoneos/SDLUIAccelerationDelegate.h b/src/joystick/iphoneos/SDLUIAccelerationDelegate.h new file mode 100644 index 0000000000..733357b497 --- /dev/null +++ b/src/joystick/iphoneos/SDLUIAccelerationDelegate.h @@ -0,0 +1,44 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#import +#import + +/* *INDENT-OFF* */ +@interface SDLUIAccelerationDelegate: NSObject { + + UIAccelerationValue x, y, z; + BOOL isRunning; + BOOL hasNewData; + +} + ++(SDLUIAccelerationDelegate *)sharedDelegate; +-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration; +-(void)getLastOrientation:(Sint16 *)data; +-(void)startup; +-(void)shutdown; +-(BOOL)isRunning; +-(BOOL)hasNewData; +-(void)setHasNewData:(BOOL)value; + +@end +/* *INDENT-ON* */ diff --git a/src/joystick/iphoneos/SDLUIAccelerationDelegate.m b/src/joystick/iphoneos/SDLUIAccelerationDelegate.m new file mode 100644 index 0000000000..0037c585b0 --- /dev/null +++ b/src/joystick/iphoneos/SDLUIAccelerationDelegate.m @@ -0,0 +1,141 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#import "SDLUIAccelerationDelegate.h" +/* needed for SDL_IPHONE_MAX_GFORCE macro */ +#import "../../../include/SDL_config_iphoneos.h" + +static SDLUIAccelerationDelegate *sharedDelegate=nil; + +@implementation SDLUIAccelerationDelegate + +/* + Returns a shared instance of the SDLUIAccelerationDelegate, creating the shared delegate if it doesn't exist yet. +*/ ++(SDLUIAccelerationDelegate *)sharedDelegate { + if (sharedDelegate == nil) { + sharedDelegate = [[SDLUIAccelerationDelegate alloc] init]; + } + return sharedDelegate; +} +/* + UIAccelerometerDelegate delegate method. Invoked by the UIAccelerometer instance when it has new data for us. + We just take the data and mark that we have new data available so that the joystick system will pump it to the + events system when SDL_SYS_JoystickUpdate is called. +*/ +-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { + + x = acceleration.x; + y = acceleration.y; + z = acceleration.z; + + hasNewData = YES; +} +/* + getLastOrientation -- put last obtained accelerometer data into Sint16 array + + Called from the joystick system when it needs the accelerometer data. + Function grabs the last data sent to the accelerometer and converts it + from floating point to Sint16, which is what the joystick system expects. + + To do the conversion, the data is first clamped onto the interval + [-SDL_IPHONE_MAX_G_FORCE, SDL_IPHONE_MAX_G_FORCE], then the data is multiplied + by MAX_SINT16 so that it is mapped to the full range of an Sint16. + + You can customize the clamped range of this function by modifying the + SDL_IPHONE_MAX_GFORCE macro in SDL_config_iphoneos.h. + + Once converted to Sint16, the accelerometer data no longer has coherent units. + You can convert the data back to units of g-force by multiplying it + in your application's code by SDL_IPHONE_MAX_GFORCE / 0x7FFF. + */ +-(void)getLastOrientation:(Sint16 *)data { + + #define MAX_SINT16 0x7FFF + + /* clamp the data */ + if (x > SDL_IPHONE_MAX_GFORCE) x = SDL_IPHONE_MAX_GFORCE; + else if (x < -SDL_IPHONE_MAX_GFORCE) x = -SDL_IPHONE_MAX_GFORCE; + if (y > SDL_IPHONE_MAX_GFORCE) y = SDL_IPHONE_MAX_GFORCE; + else if (y < -SDL_IPHONE_MAX_GFORCE) y = -SDL_IPHONE_MAX_GFORCE; + if (z > SDL_IPHONE_MAX_GFORCE) z = SDL_IPHONE_MAX_GFORCE; + else if (z < -SDL_IPHONE_MAX_GFORCE) z = -SDL_IPHONE_MAX_GFORCE; + + /* pass in data mapped to range of SInt16 */ + data[0] = (x / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16; + data[1] = (y / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16; + data[2] = (z / SDL_IPHONE_MAX_GFORCE) * MAX_SINT16; + +} + +/* + Initialize SDLUIAccelerationDelegate. Since we don't have any data yet, + just set our last received data to zero, and indicate we don't have any; +*/ +-(id)init { + self = [super init]; + x = y = z = 0.0; + hasNewData = NO; + return self; +} + +-(void)dealloc { + sharedDelegate = nil; + [self shutdown]; + [super dealloc]; +} + +/* + Lets our delegate start receiving accelerometer updates. +*/ +-(void)startup { + [UIAccelerometer sharedAccelerometer].delegate = self; + isRunning = YES; +} +/* + Stops our delegate from receiving accelerometer updates. +*/ +-(void)shutdown { + if ([UIAccelerometer sharedAccelerometer].delegate == self) { + [UIAccelerometer sharedAccelerometer].delegate = nil; + } + isRunning = NO; +} +/* + Our we currently receiving accelerometer updates? +*/ +-(BOOL)isRunning { + return isRunning; +} +/* + Do we have any data that hasn't been pumped into SDL's event system? +*/ +-(BOOL)hasNewData { + return hasNewData; +} +/* + When the joystick system grabs the new data, it sets this to NO. +*/ +-(void)setHasNewData:(BOOL)value { + hasNewData = value; +} + +@end diff --git a/src/joystick/iphoneos/SDL_sysjoystick.m b/src/joystick/iphoneos/SDL_sysjoystick.m new file mode 100644 index 0000000000..231c851cf7 --- /dev/null +++ b/src/joystick/iphoneos/SDL_sysjoystick.m @@ -0,0 +1,153 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* This is the system specific header for the SDL joystick API */ + +#include "SDL_joystick.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" +#import "SDLUIAccelerationDelegate.h" + +const char *accelerometerName = "iPhone accelerometer"; + +/* Function to scan the system for joysticks. + * This function should set SDL_numjoysticks to the number of available + * joysticks. Joystick 0 should be the system default joystick. + * It should return 0, or -1 on an unrecoverable fatal error. + */ +int +SDL_SYS_JoystickInit(void) +{ + return (1); +} + +int SDL_SYS_NumJoysticks() +{ + return 1; +} + +void SDL_SYS_JoystickDetect() +{ +} + +SDL_bool SDL_SYS_JoystickNeedsPolling() +{ + return SDL_FALSE; +} + +/* Function to get the device-dependent name of a joystick */ +const char * +SDL_SYS_JoystickNameForDeviceIndex(int device_index) +{ + return accelerometerName; +} + +/* Function to perform the mapping from device index to the instance id for this index */ +SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) +{ + return device_index; +} + +/* Function to open a joystick for use. + The joystick to open is specified by the index field of the joystick. + This should fill the nbuttons and naxes fields of the joystick structure. + It returns 0, or -1 if there is an error. + */ +int +SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) +{ + joystick->naxes = 3; + joystick->nhats = 0; + joystick->nballs = 0; + joystick->nbuttons = 0; + [[SDLUIAccelerationDelegate sharedDelegate] startup]; + return 0; +} + +/* Function to determine is this joystick is attached to the system right now */ +SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) +{ + return SDL_TRUE; +} + +/* Function to update the state of a joystick - called as a device poll. + * This function shouldn't update the joystick structure directly, + * but instead should call SDL_PrivateJoystick*() to deliver events + * and update joystick device state. + */ +void +SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) +{ + + Sint16 orientation[3]; + + if ([[SDLUIAccelerationDelegate sharedDelegate] hasNewData]) { + + [[SDLUIAccelerationDelegate sharedDelegate] getLastOrientation: orientation]; + [[SDLUIAccelerationDelegate sharedDelegate] setHasNewData: NO]; + + SDL_PrivateJoystickAxis(joystick, 0, orientation[0]); + SDL_PrivateJoystickAxis(joystick, 1, orientation[1]); + SDL_PrivateJoystickAxis(joystick, 2, orientation[2]); + + } + + return; +} + +/* Function to close a joystick after use */ +void +SDL_SYS_JoystickClose(SDL_Joystick * joystick) +{ + if ([[SDLUIAccelerationDelegate sharedDelegate] isRunning]) { + [[SDLUIAccelerationDelegate sharedDelegate] shutdown]; + } + SDL_SetError("No joystick open with that index"); +} + +/* Function to perform any system-specific joystick related cleanup */ +void +SDL_SYS_JoystickQuit(void) +{ +} + +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index ); + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = joystick->name; + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index ee43974789..8582838a77 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -1,786 +1,713 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #ifdef SDL_JOYSTICK_LINUX +#ifndef SDL_INPUT_LINUXEV +#error SDL now requires a Linux 2.4+ kernel with /dev/input/event support. +#endif + /* This is the system specific header for the SDL joystick API */ #include #include #include #include -#include /* For the definition of PATH_MAX */ +#include /* For the definition of PATH_MAX */ #include -#if SDL_INPUT_LINUXEV -#include -#endif +#include "SDL_assert.h" #include "SDL_joystick.h" +#include "SDL_endian.h" #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" +#include "SDL_sysjoystick_c.h" -/* Special joystick configurations */ -static struct { - const char *name; - int naxes; - int nhats; - int nballs; -} special_joysticks[] = { - { "MadCatz Panther XL", 3, 2, 1 }, /* We don't handle rudder (axis 8) */ - { "SideWinder Precision Pro", 4, 1, 0 }, - { "SideWinder 3D Pro", 4, 1, 0 }, - { "Microsoft SideWinder 3D Pro", 4, 1, 0 }, - { "Microsoft SideWinder Precision Pro", 4, 1, 0 }, - { "Microsoft SideWinder Dual Strike USB version 1.0", 2, 1, 0 }, - { "WingMan Interceptor", 3, 3, 0 }, - { "WingMan Extreme Digital 3D", 4, 1, 0 }, - { "Microsoft SideWinder Precision 2 Joystick", 4, 1, 0 }, - { "Logitech Inc. WingMan Extreme Digital 3D", 4, 1, 0 }, - { "Saitek Saitek X45", 6, 1, 0 } -}; - -/* It looks like newer kernels have the logical mapping at the driver level */ -#define NO_LOGICAL_JOYSTICKS - -#ifndef NO_LOGICAL_JOYSTICKS - -/* - Some USB HIDs show up as a single joystick even though they actually - control 2 or more joysticks. -*/ -/* - This code handles the MP-8800 (Quad) and MP-8866 (Dual), which can - be identified by their transparent blue design. It's quite trivial - to add other joysticks with similar quirky behavior. - -id -*/ +/* !!! FIXME: move this somewhere else. */ +#if !SDL_EVENTS_DISABLED +#include "../../events/SDL_events_c.h" +#endif -struct joystick_logical_mapping { - int njoy; - int nthing; -}; +/* This isn't defined in older Linux kernel headers */ +#ifndef SYN_DROPPED +#define SYN_DROPPED 3 +#endif /* - {logical joy, logical axis}, - {logical joy, logical hat}, - {logical joy, logical ball}, - {logical joy, logical button} -*/ + * !!! FIXME: move all the udev stuff to src/core/linux, so I can reuse it + * !!! FIXME: for audio hardware disconnects. + */ +#ifdef HAVE_LIBUDEV_H +#define SDL_USE_LIBUDEV 1 +#include "SDL_loadso.h" +#include +#include +#include + +/* we never link directly to libudev. */ +/* !!! FIXME: can we generalize this? ALSA, etc, do the same things. */ +static const char *udev_library = "libudev.so.0"; +static void *udev_handle = NULL; + +/* !!! FIXME: this is kinda ugly. */ +static SDL_bool +load_udev_sym(const char *fn, void **addr) +{ + *addr = SDL_LoadFunction(udev_handle, fn); + if (*addr == NULL) { + /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ + return SDL_FALSE; + } -static struct joystick_logical_mapping mp88xx_1_logical_axismap[] = { - {0,0},{0,1},{0,2},{0,3},{0,4},{0,5} -}; -static struct joystick_logical_mapping mp88xx_1_logical_buttonmap[] = { - {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11} -}; - -static struct joystick_logical_mapping mp88xx_2_logical_axismap[] = { - {0,0},{0,1},{0,2},{1,0},{1,1},{0,3}, - {1,2},{1,3},{0,4},{0,5},{1,4},{1,5} -}; -static struct joystick_logical_mapping mp88xx_2_logical_buttonmap[] = { - {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11}, - {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11} -}; - -static struct joystick_logical_mapping mp88xx_3_logical_axismap[] = { - {0,0},{0,1},{0,2},{1,0},{1,1},{0,3}, - {1,2},{1,3},{2,0},{2,1},{2,2},{2,3}, - {0,4},{0,5},{1,4},{1,5},{2,4},{2,5} -}; -static struct joystick_logical_mapping mp88xx_3_logical_buttonmap[] = { - {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11}, - {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11}, - {2,0},{2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9},{2,10},{2,11} -}; - -static struct joystick_logical_mapping mp88xx_4_logical_axismap[] = { - {0,0},{0,1},{0,2},{1,0},{1,1},{0,3}, - {1,2},{1,3},{2,0},{2,1},{2,2},{2,3}, - {3,0},{3,1},{3,2},{3,3},{0,4},{0,5}, - {1,4},{1,5},{2,4},{2,5},{3,4},{3,5} -}; -static struct joystick_logical_mapping mp88xx_4_logical_buttonmap[] = { - {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11}, - {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11}, - {2,0},{2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9},{2,10},{2,11}, - {3,0},{3,1},{3,2},{3,3},{3,4},{3,5},{3,6},{3,7},{3,8},{3,9},{3,10},{3,11} -}; - -struct joystick_logical_layout { - int naxes; - int nhats; - int nballs; - int nbuttons; -}; - -static struct joystick_logical_layout mp88xx_1_logical_layout[] = { - {6, 0, 0, 12} -}; -static struct joystick_logical_layout mp88xx_2_logical_layout[] = { - {6, 0, 0, 12}, - {6, 0, 0, 12} -}; -static struct joystick_logical_layout mp88xx_3_logical_layout[] = { - {6, 0, 0, 12}, - {6, 0, 0, 12}, - {6, 0, 0, 12} -}; -static struct joystick_logical_layout mp88xx_4_logical_layout[] = { - {6, 0, 0, 12}, - {6, 0, 0, 12}, - {6, 0, 0, 12}, - {6, 0, 0, 12} -}; + return SDL_TRUE; +} -/* - This array sets up a means of mapping a single physical joystick to - multiple logical joysticks. (djm) - - njoys - the number of logical joysticks - - layouts - an array of layout structures, one to describe each logical joystick - - axes, hats, balls, buttons - arrays that map a physical thingy to a logical thingy - */ -struct joystick_logicalmap { - const char *name; - int nbuttons; - int njoys; - struct joystick_logical_layout *layout; - struct joystick_logical_mapping *axismap; - struct joystick_logical_mapping *hatmap; - struct joystick_logical_mapping *ballmap; - struct joystick_logical_mapping *buttonmap; -}; - -static struct joystick_logicalmap joystick_logicalmap[] = { - { - "WiseGroup.,Ltd MP-8866 Dual USB Joypad", - 12, - 1, - mp88xx_1_logical_layout, - mp88xx_1_logical_axismap, - NULL, - NULL, - mp88xx_1_logical_buttonmap - }, - { - "WiseGroup.,Ltd MP-8866 Dual USB Joypad", - 24, - 2, - mp88xx_2_logical_layout, - mp88xx_2_logical_axismap, - NULL, - NULL, - mp88xx_2_logical_buttonmap - }, - { - "WiseGroup.,Ltd MP-8800 Quad USB Joypad", - 12, - 1, - mp88xx_1_logical_layout, - mp88xx_1_logical_axismap, - NULL, - NULL, - mp88xx_1_logical_buttonmap - }, - { - "WiseGroup.,Ltd MP-8800 Quad USB Joypad", - 24, - 2, - mp88xx_2_logical_layout, - mp88xx_2_logical_axismap, - NULL, - NULL, - mp88xx_2_logical_buttonmap - }, - { - "WiseGroup.,Ltd MP-8800 Quad USB Joypad", - 36, - 3, - mp88xx_3_logical_layout, - mp88xx_3_logical_axismap, - NULL, - NULL, - mp88xx_3_logical_buttonmap - }, - { - "WiseGroup.,Ltd MP-8800 Quad USB Joypad", - 48, - 4, - mp88xx_4_logical_layout, - mp88xx_4_logical_axismap, - NULL, - NULL, - mp88xx_4_logical_buttonmap - } -}; - -/* find the head of a linked list, given a point in it - */ -#define SDL_joylist_head(i, start)\ - for(i = start; SDL_joylist[i].fname == NULL;) i = SDL_joylist[i].prev; +/* libudev entry points... */ +static const char *(*UDEV_udev_device_get_action)(struct udev_device *) = NULL; +static const char *(*UDEV_udev_device_get_devnode)(struct udev_device *) = NULL; +static const char *(*UDEV_udev_device_get_property_value)(struct udev_device *, const char *) = NULL; +static struct udev_device *(*UDEV_udev_device_new_from_syspath)(struct udev *, const char *) = NULL; +static void (*UDEV_udev_device_unref)(struct udev_device *) = NULL; +static int (*UDEV_udev_enumerate_add_match_property)(struct udev_enumerate *, const char *, const char *) = NULL; +static int (*UDEV_udev_enumerate_add_match_subsystem)(struct udev_enumerate *, const char *) = NULL; +static struct udev_list_entry *(*UDEV_udev_enumerate_get_list_entry)(struct udev_enumerate *) = NULL; +static struct udev_enumerate *(*UDEV_udev_enumerate_new)(struct udev *) = NULL; +static int (*UDEV_udev_enumerate_scan_devices)(struct udev_enumerate *) = NULL; +static void (*UDEV_udev_enumerate_unref)(struct udev_enumerate *) = NULL; +static const char *(*UDEV_udev_list_entry_get_name)(struct udev_list_entry *) = NULL; +static struct udev_list_entry *(*UDEV_udev_list_entry_get_next)(struct udev_list_entry *) = NULL; +static int (*UDEV_udev_monitor_enable_receiving)(struct udev_monitor *) = NULL; +static int (*UDEV_udev_monitor_filter_add_match_subsystem_devtype)(struct udev_monitor *, const char *, const char *) = NULL; +static int (*UDEV_udev_monitor_get_fd)(struct udev_monitor *) = NULL; +static struct udev_monitor *(*UDEV_udev_monitor_new_from_netlink)(struct udev *, const char *) = NULL; +static struct udev_device *(*UDEV_udev_monitor_receive_device)(struct udev_monitor *) = NULL; +static void (*UDEV_udev_monitor_unref)(struct udev_monitor *) = NULL; +static struct udev *(*UDEV_udev_new)(void) = NULL; +static void (*UDEV_udev_unref)(struct udev *) = NULL; + +static int +load_udev_syms(void) +{ + /* cast funcs to char* first, to please GCC's strict aliasing rules. */ + #define SDL_UDEV_SYM(x) \ + if (!load_udev_sym(#x, (void **) (char *) &UDEV_##x)) return -1 + + SDL_UDEV_SYM(udev_device_get_action); + SDL_UDEV_SYM(udev_device_get_devnode); + SDL_UDEV_SYM(udev_device_get_property_value); + SDL_UDEV_SYM(udev_device_new_from_syspath); + SDL_UDEV_SYM(udev_device_unref); + SDL_UDEV_SYM(udev_enumerate_add_match_property); + SDL_UDEV_SYM(udev_enumerate_add_match_subsystem); + SDL_UDEV_SYM(udev_enumerate_get_list_entry); + SDL_UDEV_SYM(udev_enumerate_new); + SDL_UDEV_SYM(udev_enumerate_scan_devices); + SDL_UDEV_SYM(udev_enumerate_unref); + SDL_UDEV_SYM(udev_list_entry_get_name); + SDL_UDEV_SYM(udev_list_entry_get_next); + SDL_UDEV_SYM(udev_monitor_enable_receiving); + SDL_UDEV_SYM(udev_monitor_filter_add_match_subsystem_devtype); + SDL_UDEV_SYM(udev_monitor_get_fd); + SDL_UDEV_SYM(udev_monitor_new_from_netlink); + SDL_UDEV_SYM(udev_monitor_receive_device); + SDL_UDEV_SYM(udev_monitor_unref); + SDL_UDEV_SYM(udev_new); + SDL_UDEV_SYM(udev_unref); + + #undef SDL_UDEV_SYM + + return 0; +} + +static void +UnloadUDEVLibrary(void) +{ + if (udev_handle != NULL) { + SDL_UnloadObject(udev_handle); + udev_handle = NULL; + } +} -#define SDL_logical_joydecl(d) d +static int +LoadUDEVLibrary(void) +{ + int retval = 0; + if (udev_handle == NULL) { + udev_handle = SDL_LoadObject(udev_library); + if (udev_handle == NULL) { + retval = -1; + /* Don't call SDL_SetError(): SDL_LoadObject already did. */ + } else { + retval = load_udev_syms(); + if (retval < 0) { + UnloadUDEVLibrary(); + } + } + } + return retval; +} -#else +static struct udev *udev = NULL; +static struct udev_monitor *udev_mon = NULL; +#endif -#define SDL_logical_joydecl(d) -#endif /* USE_LOGICAL_JOYSTICKS */ +/* A linked list of available joysticks */ +typedef struct SDL_joylist_item +{ + int device_instance; + char *path; /* "/dev/input/event2" or whatever */ + char *name; /* "SideWinder 3D Pro" or whatever */ + SDL_JoystickGUID guid; + dev_t devnum; + struct joystick_hwdata *hwdata; + struct SDL_joylist_item *next; +} SDL_joylist_item; + +static SDL_joylist_item *SDL_joylist = NULL; +static SDL_joylist_item *SDL_joylist_tail = NULL; +static int numjoysticks = 0; +static int instance_counter = 0; -/* The maximum number of joysticks we'll detect */ -#define MAX_JOYSTICKS 32 +#define test_bit(nr, addr) \ + (((1UL << ((nr) % (sizeof(long) * 8))) & ((addr)[(nr) / (sizeof(long) * 8)])) != 0) +#define NBITS(x) ((((x)-1)/(sizeof(long) * 8))+1) -/* A list of available joysticks */ -static struct +static int +IsJoystick(int fd, char *namebuf, const size_t namebuflen, SDL_JoystickGUID *guid) { - char* fname; -#ifndef NO_LOGICAL_JOYSTICKS - SDL_Joystick* joy; - struct joystick_logicalmap* map; - int prev; - int next; - int logicalno; -#endif /* USE_LOGICAL_JOYSTICKS */ -} SDL_joylist[MAX_JOYSTICKS]; - - -/* The private structure used to keep track of a joystick */ -struct joystick_hwdata { - int fd; - /* The current linux joystick driver maps hats to two axes */ - struct hwdata_hat { - int axis[2]; - } *hats; - /* The current linux joystick driver maps balls to two axes */ - struct hwdata_ball { - int axis[2]; - } *balls; - - /* Support for the Linux 2.4 unified input interface */ -#if SDL_INPUT_LINUXEV - SDL_bool is_hid; - Uint8 key_map[KEY_MAX-BTN_MISC]; - Uint8 abs_map[ABS_MAX]; - struct axis_correct { - int used; - int coef[3]; - } abs_correct[ABS_MAX]; + unsigned long evbit[NBITS(EV_MAX)] = { 0 }; + unsigned long keybit[NBITS(KEY_MAX)] = { 0 }; + unsigned long absbit[NBITS(ABS_MAX)] = { 0 }; + struct input_id inpid; + Uint16 *guid16 = (Uint16 *) ((char *) &guid->data); + + if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || + (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || + (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) { + return (0); + } + + if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) && + test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit))) { + return 0; + } + + if (ioctl(fd, EVIOCGNAME(namebuflen), namebuf) < 0) { + return 0; + } + + if (ioctl(fd, EVIOCGID, &inpid) < 0) { + return 0; + } + +#ifdef DEBUG_JOYSTICK + printf("Joystick: %s, bustype = %d, vendor = 0x%x, product = 0x%x, version = %d\n", namebuf, inpid.bustype, inpid.vendor, inpid.product, inpid.version); #endif -}; + SDL_memset(guid->data, 0, sizeof(guid->data)); + + /* We only need 16 bits for each of these; space them out to fill 128. */ + /* Byteswap so devices get same GUID on little/big endian platforms. */ + *(guid16++) = SDL_SwapLE16(inpid.bustype); + *(guid16++) = 0; + + if (inpid.vendor && inpid.product && inpid.version) { + *(guid16++) = SDL_SwapLE16(inpid.vendor); + *(guid16++) = 0; + *(guid16++) = SDL_SwapLE16(inpid.product); + *(guid16++) = 0; + *(guid16++) = SDL_SwapLE16(inpid.version); + *(guid16++) = 0; + } else { + SDL_strlcpy((char*)guid16, namebuf, sizeof(guid->data) - 4); + } + + return 1; +} -#ifndef NO_LOGICAL_JOYSTICKS -static int CountLogicalJoysticks(int max) +/* !!! FIXME: I would love to dump this code and use libudev instead. */ +static int +MaybeAddDevice(const char *path) { - register int i, j, k, ret, prev; - const char* name; - int nbuttons, fd; - unsigned char n; - - ret = 0; - - for(i = 0; i < max; i++) { - name = SDL_SYS_JoystickName(i); - - fd = open(SDL_joylist[i].fname, O_RDONLY, 0); - if ( fd >= 0 ) { - if ( ioctl(fd, JSIOCGBUTTONS, &n) < 0 ) { - nbuttons = -1; - } else { - nbuttons = n; - } - close(fd); - } - else { - nbuttons=-1; - } - - if (name) { - for(j = 0; j < SDL_arraysize(joystick_logicalmap); j++) { - if (!SDL_strcmp(name, joystick_logicalmap[j].name) && (nbuttons==-1 || nbuttons==joystick_logicalmap[j].nbuttons)) { - prev = i; - SDL_joylist[prev].map = &(joystick_logicalmap[j]); - - for(k = 1; k < joystick_logicalmap[j].njoys; k++) { - SDL_joylist[prev].next = max + ret; - SDL_joylist[max+ret].prev = prev; - - prev = max + ret; - SDL_joylist[prev].logicalno = k; - SDL_joylist[prev].map = &(joystick_logicalmap[j]); - ret++; - } - - break; + struct stat sb; + int fd = -1; + int isstick = 0; + char namebuf[128]; + SDL_JoystickGUID guid; + SDL_joylist_item *item; + + if (path == NULL) { + return -1; + } + + if (stat(path, &sb) == -1) { + return -1; + } + + /* Check to make sure it's not already in list. */ + for (item = SDL_joylist; item != NULL; item = item->next) { + if (sb.st_rdev == item->devnum) { + return -1; /* already have this one */ + } + } + + fd = open(path, O_RDONLY, 0); + if (fd < 0) { + return -1; + } + +#ifdef DEBUG_INPUT_EVENTS + printf("Checking %s\n", path); +#endif + + isstick = IsJoystick(fd, namebuf, sizeof (namebuf), &guid); + close(fd); + if (!isstick) { + return -1; + } + + item = (SDL_joylist_item *) SDL_malloc(sizeof (SDL_joylist_item)); + if (item == NULL) { + return -1; + } + + SDL_zerop(item); + item->devnum = sb.st_rdev; + item->path = SDL_strdup(path); + item->name = SDL_strdup(namebuf); + item->guid = guid; + + if ( (item->path == NULL) || (item->name == NULL) ) { + SDL_free(item->path); + SDL_free(item->name); + SDL_free(item); + return -1; + } + + item->device_instance = instance_counter++; + if (SDL_joylist_tail == NULL) { + SDL_joylist = SDL_joylist_tail = item; + } else { + SDL_joylist_tail->next = item; + SDL_joylist_tail = item; + } + + return numjoysticks++; +} + +#if SDL_USE_LIBUDEV +/* !!! FIXME: I would love to dump this code and use libudev instead. */ +static int +MaybeRemoveDevice(const char *path) +{ + SDL_joylist_item *item; + SDL_joylist_item *prev = NULL; + + if (path == NULL) { + return -1; + } + + for (item = SDL_joylist; item != NULL; item = item->next) { + /* found it, remove it. */ + if (SDL_strcmp(path, item->path) == 0) { + const int retval = item->device_instance; + if (item->hwdata) { + item->hwdata->item = NULL; + } + if (prev != NULL) { + prev->next = item->next; + } else { + SDL_assert(SDL_joylist == item); + SDL_joylist = item->next; + } + if (item == SDL_joylist_tail) { + SDL_joylist_tail = prev; } - } - } - } + SDL_free(item->path); + SDL_free(item->name); + SDL_free(item); + numjoysticks--; + return retval; + } + prev = item; + } - return ret; + return -1; } +#endif -static void LogicalSuffix(int logicalno, char* namebuf, int len) +static int +JoystickInitWithoutUdev(void) { - register int slen; - const static char suffixs[] = - "01020304050607080910111213141516171819" - "20212223242526272829303132"; - const char* suffix; - slen = SDL_strlen(namebuf); - suffix = NULL; - - if (logicalno*2= 0 ) { - /* Assume the user knows what they're doing. */ - SDL_joylist[numjoysticks].fname = SDL_strdup(envpath); - if ( SDL_joylist[numjoysticks].fname ) { - dev_nums[numjoysticks] = sb.st_rdev; - ++numjoysticks; - } - close(fd); - } - } - envpath = delim; - } - SDL_free(envcopy); - } - - for ( i=0; i 0) ) - break; -#endif - } -#ifndef NO_LOGICAL_JOYSTICKS - numjoysticks += CountLogicalJoysticks(numjoysticks); +#if SDL_USE_LIBUDEV + if (udev_mon != NULL) { + const int fd = UDEV_udev_monitor_get_fd(udev_mon); + fd_set fds; + struct timeval tv; + + FD_ZERO(&fds); + FD_SET(fd, &fds); + tv.tv_sec = 0; + tv.tv_usec = 0; + if ((select(fd+1, &fds, NULL, NULL, &tv) > 0) && (FD_ISSET(fd, &fds))) { + return SDL_TRUE; + } + } #endif - return(numjoysticks); + return SDL_FALSE; } -/* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) +void SDL_SYS_JoystickDetect() { - int fd; - static char namebuf[128]; - char *name; - SDL_logical_joydecl(int oindex = index); +#if SDL_USE_LIBUDEV + struct udev_device *dev = NULL; + const char *devnode = NULL; + const char *action = NULL; + const char *val = NULL; + + while (HotplugUpdateAvailable()) { + dev = UDEV_udev_monitor_receive_device(udev_mon); + if (dev == NULL) { + break; + } + val = UDEV_udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK"); + if ((!val) || (SDL_strcmp(val, "1") != 0)) { + continue; + } -#ifndef NO_LOGICAL_JOYSTICKS - SDL_joylist_head(index, index); -#endif - name = NULL; - fd = open(SDL_joylist[index].fname, O_RDONLY, 0); - if ( fd >= 0 ) { - if ( -#if SDL_INPUT_LINUXEV - (ioctl(fd, EVIOCGNAME(sizeof(namebuf)), namebuf) <= 0) && -#endif - (ioctl(fd, JSIOCGNAME(sizeof(namebuf)), namebuf) <= 0) ) { - name = SDL_joylist[index].fname; - } else { - name = namebuf; - } - close(fd); - - -#ifndef NO_LOGICAL_JOYSTICKS - if (SDL_joylist[oindex].prev || SDL_joylist[oindex].next || index!=oindex) - { - LogicalSuffix(SDL_joylist[oindex].logicalno, namebuf, 128); - } + action = UDEV_udev_device_get_action(dev); + devnode = UDEV_udev_device_get_devnode(dev); + + if (SDL_strcmp(action, "add") == 0) { + const int device_index = MaybeAddDevice(devnode); + if (device_index != -1) { + /* !!! FIXME: Move this to an SDL_PrivateJoyDeviceAdded() function? */ + #if !SDL_EVENTS_DISABLED + SDL_Event event; + event.type = SDL_JOYDEVICEADDED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = device_index; + if ( (SDL_EventOK == NULL) || + (*SDL_EventOK) (SDL_EventOKParam, &event) ) { + SDL_PushEvent(&event); + } + } + #endif /* !SDL_EVENTS_DISABLED */ + } + } else if (SDL_strcmp(action, "remove") == 0) { + const int inst = MaybeRemoveDevice(devnode); + if (inst != -1) { + /* !!! FIXME: Move this to an SDL_PrivateJoyDeviceRemoved() function? */ + #if !SDL_EVENTS_DISABLED + SDL_Event event; + event.type = SDL_JOYDEVICEREMOVED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = inst; + if ( (SDL_EventOK == NULL) || + (*SDL_EventOK) (SDL_EventOKParam, &event) ) { + SDL_PushEvent(&event); + } + } + #endif /* !SDL_EVENTS_DISABLED */ + } + } + UDEV_udev_device_unref(dev); + } #endif - } - return name; } -static int allocate_hatdata(SDL_Joystick *joystick) +SDL_bool SDL_SYS_JoystickNeedsPolling() +{ + /* + * This results in a select() call, so technically we're polling to + * decide if we should poll, but I think this function is here because + * Windows has to do an enormous amount of work to detect new sticks, + * whereas libudev just needs to see if there's more data available on + * a socket...so this should be acceptable, I hope. + */ + return HotplugUpdateAvailable(); +} + +static SDL_joylist_item * +JoystickByDevIndex(int device_index) +{ + SDL_joylist_item *item = SDL_joylist; + + if ((device_index < 0) || (device_index >= numjoysticks)) { + return NULL; + } + + while (device_index > 0) { + SDL_assert(item != NULL); + device_index--; + item = item->next; + } + + return item; +} + +/* Function to get the device-dependent name of a joystick */ +const char * +SDL_SYS_JoystickNameForDeviceIndex(int device_index) { - int i; - - joystick->hwdata->hats = (struct hwdata_hat *)SDL_malloc( - joystick->nhats * sizeof(struct hwdata_hat)); - if ( joystick->hwdata->hats == NULL ) { - return(-1); - } - for ( i=0; inhats; ++i ) { - joystick->hwdata->hats[i].axis[0] = 1; - joystick->hwdata->hats[i].axis[1] = 1; - } - return(0); + return JoystickByDevIndex(device_index)->name; } -static int allocate_balldata(SDL_Joystick *joystick) +/* Function to perform the mapping from device index to the instance id for this index */ +SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) { - int i; - - joystick->hwdata->balls = (struct hwdata_ball *)SDL_malloc( - joystick->nballs * sizeof(struct hwdata_ball)); - if ( joystick->hwdata->balls == NULL ) { - return(-1); - } - for ( i=0; inballs; ++i ) { - joystick->hwdata->balls[i].axis[0] = 0; - joystick->hwdata->balls[i].axis[1] = 0; - } - return(0); + return JoystickByDevIndex(device_index)->device_instance; } -static SDL_bool JS_ConfigJoystick(SDL_Joystick *joystick, int fd) +static int +allocate_hatdata(SDL_Joystick * joystick) { - SDL_bool handled; - unsigned char n; - int tmp_naxes, tmp_nhats, tmp_nballs; - const char *name; - char *env, env_name[128]; - int i; - - handled = SDL_FALSE; - - /* Default joystick device settings */ - if ( ioctl(fd, JSIOCGAXES, &n) < 0 ) { - joystick->naxes = 2; - } else { - joystick->naxes = n; - } - if ( ioctl(fd, JSIOCGBUTTONS, &n) < 0 ) { - joystick->nbuttons = 2; - } else { - joystick->nbuttons = n; - } - - name = SDL_SYS_JoystickName(joystick->index); - - /* Generic analog joystick support */ - if ( SDL_strstr(name, "Analog") == name && SDL_strstr(name, "-hat") ) { - if ( SDL_sscanf(name,"Analog %d-axis %*d-button %d-hat", - &tmp_naxes, &tmp_nhats) == 2 ) { - - joystick->naxes = tmp_naxes; - joystick->nhats = tmp_nhats; - - handled = SDL_TRUE; - } - } - - /* Special joystick support */ - for ( i=0; i < SDL_arraysize(special_joysticks); ++i ) { - if ( SDL_strcmp(name, special_joysticks[i].name) == 0 ) { - - joystick->naxes = special_joysticks[i].naxes; - joystick->nhats = special_joysticks[i].nhats; - joystick->nballs = special_joysticks[i].nballs; - - handled = SDL_TRUE; - break; - } - } - - /* User environment joystick support */ - if ( (env = SDL_getenv("SDL_LINUX_JOYSTICK")) ) { - *env_name = '\0'; - if ( *env == '\'' && SDL_sscanf(env, "'%[^']s'", env_name) == 1 ) - env += SDL_strlen(env_name)+2; - else if ( SDL_sscanf(env, "%s", env_name) == 1 ) - env += SDL_strlen(env_name); - - if ( SDL_strcmp(name, env_name) == 0 ) { - - if ( SDL_sscanf(env, "%d %d %d", &tmp_naxes, &tmp_nhats, - &tmp_nballs) == 3 ) { - - joystick->naxes = tmp_naxes; - joystick->nhats = tmp_nhats; - joystick->nballs = tmp_nballs; - - handled = SDL_TRUE; - } - } - } - - /* Remap hats and balls */ - if (handled) { - if ( joystick->nhats > 0 ) { - if ( allocate_hatdata(joystick) < 0 ) { - joystick->nhats = 0; - } - } - if ( joystick->nballs > 0 ) { - if ( allocate_balldata(joystick) < 0 ) { - joystick->nballs = 0; - } - } - } - - return(handled); + int i; + + joystick->hwdata->hats = + (struct hwdata_hat *) SDL_malloc(joystick->nhats * + sizeof(struct hwdata_hat)); + if (joystick->hwdata->hats == NULL) { + return (-1); + } + for (i = 0; i < joystick->nhats; ++i) { + joystick->hwdata->hats[i].axis[0] = 1; + joystick->hwdata->hats[i].axis[1] = 1; + } + return (0); } -#if SDL_INPUT_LINUXEV +static int +allocate_balldata(SDL_Joystick * joystick) +{ + int i; + + joystick->hwdata->balls = + (struct hwdata_ball *) SDL_malloc(joystick->nballs * + sizeof(struct hwdata_ball)); + if (joystick->hwdata->balls == NULL) { + return (-1); + } + for (i = 0; i < joystick->nballs; ++i) { + joystick->hwdata->balls[i].axis[0] = 0; + joystick->hwdata->balls[i].axis[1] = 0; + } + return (0); +} -static SDL_bool EV_ConfigJoystick(SDL_Joystick *joystick, int fd) +static void +ConfigJoystick(SDL_Joystick * joystick, int fd) { - int i, t; - unsigned long keybit[NBITS(KEY_MAX)] = { 0 }; - unsigned long absbit[NBITS(ABS_MAX)] = { 0 }; - unsigned long relbit[NBITS(REL_MAX)] = { 0 }; - - /* See if this device uses the new unified event API */ - if ( (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) && - (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) && - (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0) ) { - joystick->hwdata->is_hid = SDL_TRUE; - - /* Get the number of buttons, axes, and other thingamajigs */ - for ( i=BTN_JOYSTICK; i < KEY_MAX; ++i ) { - if ( test_bit(i, keybit) ) { + int i, t; + unsigned long keybit[NBITS(KEY_MAX)] = { 0 }; + unsigned long absbit[NBITS(ABS_MAX)] = { 0 }; + unsigned long relbit[NBITS(REL_MAX)] = { 0 }; + + /* See if this device uses the new unified event API */ + if ((ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) && + (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) && + (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0)) { + + /* Get the number of buttons, axes, and other thingamajigs */ + for (i = BTN_JOYSTICK; i < KEY_MAX; ++i) { + if (test_bit(i, keybit)) { #ifdef DEBUG_INPUT_EVENTS - printf("Joystick has button: 0x%x\n", i); + printf("Joystick has button: 0x%x\n", i); #endif - joystick->hwdata->key_map[i-BTN_MISC] = - joystick->nbuttons; - ++joystick->nbuttons; - } - } - for ( i=BTN_MISC; i < BTN_JOYSTICK; ++i ) { - if ( test_bit(i, keybit) ) { + joystick->hwdata->key_map[i - BTN_MISC] = joystick->nbuttons; + ++joystick->nbuttons; + } + } + for (i = BTN_MISC; i < BTN_JOYSTICK; ++i) { + if (test_bit(i, keybit)) { #ifdef DEBUG_INPUT_EVENTS - printf("Joystick has button: 0x%x\n", i); + printf("Joystick has button: 0x%x\n", i); #endif - joystick->hwdata->key_map[i-BTN_MISC] = - joystick->nbuttons; - ++joystick->nbuttons; - } - } - for ( i=0; ihwdata->key_map[i - BTN_MISC] = joystick->nbuttons; + ++joystick->nbuttons; + } + } + for (i = 0; i < ABS_MISC; ++i) { + /* Skip hats */ + if (i == ABS_HAT0X) { + i = ABS_HAT3Y; + continue; + } + if (test_bit(i, absbit)) { + struct input_absinfo absinfo; + + if (ioctl(fd, EVIOCGABS(i), &absinfo) < 0) + continue; #ifdef DEBUG_INPUT_EVENTS - printf("Joystick has absolute axis: %x\n", i); - printf("Values = { %d, %d, %d, %d, %d }\n", - absinfo.value, absinfo.minimum, - absinfo.maximum, absinfo.fuzz, absinfo.flat); + printf("Joystick has absolute axis: %x\n", i); + printf("Values = { %d, %d, %d, %d, %d }\n", + absinfo.value, absinfo.minimum, absinfo.maximum, + absinfo.fuzz, absinfo.flat); #endif /* DEBUG_INPUT_EVENTS */ - joystick->hwdata->abs_map[i] = joystick->naxes; - if ( absinfo.minimum == absinfo.maximum ) { - joystick->hwdata->abs_correct[i].used = 0; - } else { - joystick->hwdata->abs_correct[i].used = 1; - joystick->hwdata->abs_correct[i].coef[0] = - (absinfo.maximum + absinfo.minimum) / 2 - absinfo.flat; - joystick->hwdata->abs_correct[i].coef[1] = - (absinfo.maximum + absinfo.minimum) / 2 + absinfo.flat; - t = ((absinfo.maximum - absinfo.minimum) / 2 - 2 * absinfo.flat); - if ( t != 0 ) { - joystick->hwdata->abs_correct[i].coef[2] = (1 << 29) / t; - } else { - joystick->hwdata->abs_correct[i].coef[2] = 0; - } - } - ++joystick->naxes; - } - } - for ( i=ABS_HAT0X; i <= ABS_HAT3Y; i += 2 ) { - if ( test_bit(i, absbit) || test_bit(i+1, absbit) ) { + joystick->hwdata->abs_map[i] = joystick->naxes; + if (absinfo.minimum == absinfo.maximum) { + joystick->hwdata->abs_correct[i].used = 0; + } else { + joystick->hwdata->abs_correct[i].used = 1; + joystick->hwdata->abs_correct[i].coef[0] = + (absinfo.maximum + absinfo.minimum) - 2 * absinfo.flat; + joystick->hwdata->abs_correct[i].coef[1] = + (absinfo.maximum + absinfo.minimum) + 2 * absinfo.flat; + t = ((absinfo.maximum - absinfo.minimum) - 4 * absinfo.flat); + if (t != 0) { + joystick->hwdata->abs_correct[i].coef[2] = + (1 << 28) / t; + } else { + joystick->hwdata->abs_correct[i].coef[2] = 0; + } + } + ++joystick->naxes; + } + } + for (i = ABS_HAT0X; i <= ABS_HAT3Y; i += 2) { + if (test_bit(i, absbit) || test_bit(i + 1, absbit)) { #ifdef DEBUG_INPUT_EVENTS - printf("Joystick has hat %d\n",(i-ABS_HAT0X)/2); + printf("Joystick has hat %d\n", (i - ABS_HAT0X) / 2); #endif - ++joystick->nhats; - } - } - if ( test_bit(REL_X, relbit) || test_bit(REL_Y, relbit) ) { - ++joystick->nballs; - } - - /* Allocate data to keep track of these thingamajigs */ - if ( joystick->nhats > 0 ) { - if ( allocate_hatdata(joystick) < 0 ) { - joystick->nhats = 0; - } - } - if ( joystick->nballs > 0 ) { - if ( allocate_balldata(joystick) < 0 ) { - joystick->nballs = 0; - } - } - } - return(joystick->hwdata->is_hid); -} - -#endif /* SDL_INPUT_LINUXEV */ + ++joystick->nhats; + } + } + if (test_bit(REL_X, relbit) || test_bit(REL_Y, relbit)) { + ++joystick->nballs; + } -#ifndef NO_LOGICAL_JOYSTICKS -static void ConfigLogicalJoystick(SDL_Joystick *joystick) -{ - struct joystick_logical_layout* layout; - - layout = SDL_joylist[joystick->index].map->layout + - SDL_joylist[joystick->index].logicalno; - - joystick->nbuttons = layout->nbuttons; - joystick->nhats = layout->nhats; - joystick->naxes = layout->naxes; - joystick->nballs = layout->nballs; + /* Allocate data to keep track of these thingamajigs */ + if (joystick->nhats > 0) { + if (allocate_hatdata(joystick) < 0) { + joystick->nhats = 0; + } + } + if (joystick->nballs > 0) { + if (allocate_balldata(joystick) < 0) { + joystick->nballs = 0; + } + } + } } -#endif /* Function to open a joystick for use. @@ -788,431 +715,324 @@ static void ConfigLogicalJoystick(SDL_Joystick *joystick) This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) +int +SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) { - int fd; - SDL_logical_joydecl(int realindex); - SDL_logical_joydecl(SDL_Joystick *realjoy = NULL); - - /* Open the joystick and set the joystick file descriptor */ -#ifndef NO_LOGICAL_JOYSTICKS - if (SDL_joylist[joystick->index].fname == NULL) { - SDL_joylist_head(realindex, joystick->index); - realjoy = SDL_JoystickOpen(realindex); - - if (realjoy == NULL) - return(-1); - - fd = realjoy->hwdata->fd; - - } else { - fd = open(SDL_joylist[joystick->index].fname, O_RDONLY, 0); - } - SDL_joylist[joystick->index].joy = joystick; -#else - fd = open(SDL_joylist[joystick->index].fname, O_RDONLY, 0); -#endif - - if ( fd < 0 ) { - SDL_SetError("Unable to open %s\n", - SDL_joylist[joystick->index]); - return(-1); - } - joystick->hwdata = (struct joystick_hwdata *) - SDL_malloc(sizeof(*joystick->hwdata)); - if ( joystick->hwdata == NULL ) { - SDL_OutOfMemory(); - close(fd); - return(-1); - } - SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); - joystick->hwdata->fd = fd; - - /* Set the joystick to non-blocking read mode */ - fcntl(fd, F_SETFL, O_NONBLOCK); - - /* Get the number of buttons and axes on the joystick */ -#ifndef NO_LOGICAL_JOYSTICKS - if (realjoy) - ConfigLogicalJoystick(joystick); - else -#endif -#if SDL_INPUT_LINUXEV - if ( ! EV_ConfigJoystick(joystick, fd) ) -#endif - JS_ConfigJoystick(joystick, fd); - - return(0); + SDL_joylist_item *item = JoystickByDevIndex(device_index); + char *fname = NULL; + int fd = -1; + + if (item == NULL) { + return SDL_SetError("No such device"); + } + + fname = item->path; + fd = open(fname, O_RDONLY, 0); + if (fd < 0) { + return SDL_SetError("Unable to open %s", fname); + } + + joystick->instance_id = item->device_instance; + joystick->hwdata = (struct joystick_hwdata *) + SDL_malloc(sizeof(*joystick->hwdata)); + if (joystick->hwdata == NULL) { + close(fd); + return SDL_OutOfMemory(); + } + SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); + joystick->hwdata->item = item; + joystick->hwdata->guid = item->guid; + joystick->hwdata->fd = fd; + joystick->hwdata->fname = SDL_strdup(item->path); + if (joystick->hwdata->fname == NULL) { + SDL_free(joystick->hwdata); + joystick->hwdata = NULL; + close(fd); + return SDL_OutOfMemory(); + } + + SDL_assert(item->hwdata == NULL); + item->hwdata = joystick->hwdata; + + /* Set the joystick to non-blocking read mode */ + fcntl(fd, F_SETFL, O_NONBLOCK); + + /* Get the number of buttons and axes on the joystick */ + ConfigJoystick(joystick, fd); + + /* mark joystick as fresh and ready */ + joystick->hwdata->fresh = 1; + + return (0); } -#ifndef NO_LOGICAL_JOYSTICKS - -static SDL_Joystick* FindLogicalJoystick( - SDL_Joystick *joystick, struct joystick_logical_mapping* v) +/* Function to determine is this joystick is attached to the system right now */ +SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) { - SDL_Joystick *logicaljoy; - register int i; - - i = joystick->index; - logicaljoy = NULL; - - /* get the fake joystick that will receive the event - */ - for(;;) { - - if (SDL_joylist[i].logicalno == v->njoy) { - logicaljoy = SDL_joylist[i].joy; - break; - } - - if (SDL_joylist[i].next == 0) - break; - - i = SDL_joylist[i].next; - - } - - return logicaljoy; + return !joystick->closed && (joystick->hwdata->item != NULL); } -static int LogicalJoystickButton( - SDL_Joystick *joystick, Uint8 button, Uint8 state){ - struct joystick_logical_mapping* buttons; - SDL_Joystick *logicaljoy = NULL; - - /* if there's no map then this is just a regular joystick - */ - if (SDL_joylist[joystick->index].map == NULL) - return 0; - - /* get the logical joystick that will receive the event - */ - buttons = SDL_joylist[joystick->index].map->buttonmap+button; - logicaljoy = FindLogicalJoystick(joystick, buttons); - - if (logicaljoy == NULL) - return 1; - - SDL_PrivateJoystickButton(logicaljoy, buttons->nthing, state); - - return 1; +static __inline__ void +HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value) +{ + struct hwdata_hat *the_hat; + const Uint8 position_map[3][3] = { + {SDL_HAT_LEFTUP, SDL_HAT_UP, SDL_HAT_RIGHTUP}, + {SDL_HAT_LEFT, SDL_HAT_CENTERED, SDL_HAT_RIGHT}, + {SDL_HAT_LEFTDOWN, SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN} + }; + + the_hat = &stick->hwdata->hats[hat]; + if (value < 0) { + value = 0; + } else if (value == 0) { + value = 1; + } else if (value > 0) { + value = 2; + } + if (value != the_hat->axis[axis]) { + the_hat->axis[axis] = value; + SDL_PrivateJoystickHat(stick, hat, + position_map[the_hat-> + axis[1]][the_hat->axis[0]]); + } } -static int LogicalJoystickAxis( - SDL_Joystick *joystick, Uint8 axis, Sint16 value) +static __inline__ void +HandleBall(SDL_Joystick * stick, Uint8 ball, int axis, int value) { - struct joystick_logical_mapping* axes; - SDL_Joystick *logicaljoy = NULL; - - /* if there's no map then this is just a regular joystick - */ - if (SDL_joylist[joystick->index].map == NULL) - return 0; + stick->hwdata->balls[ball].axis[axis] += value; +} - /* get the logical joystick that will receive the event - */ - axes = SDL_joylist[joystick->index].map->axismap+axis; - logicaljoy = FindLogicalJoystick(joystick, axes); - if (logicaljoy == NULL) - return 1; +static __inline__ int +AxisCorrect(SDL_Joystick * joystick, int which, int value) +{ + struct axis_correct *correct; + + correct = &joystick->hwdata->abs_correct[which]; + if (correct->used) { + value *= 2; + if (value > correct->coef[0]) { + if (value < correct->coef[1]) { + return 0; + } + value -= correct->coef[1]; + } else { + value -= correct->coef[0]; + } + value *= correct->coef[2]; + value >>= 13; + } - SDL_PrivateJoystickAxis(logicaljoy, axes->nthing, value); + /* Clamp and return */ + if (value < -32768) + return -32768; + if (value > 32767) + return 32767; - return 1; + return value; } -#endif /* USE_LOGICAL_JOYSTICKS */ -static __inline__ -void HandleHat(SDL_Joystick *stick, Uint8 hat, int axis, int value) +static __inline__ void +PollAllValues(SDL_Joystick * joystick) { - struct hwdata_hat *the_hat; - const Uint8 position_map[3][3] = { - { SDL_HAT_LEFTUP, SDL_HAT_UP, SDL_HAT_RIGHTUP }, - { SDL_HAT_LEFT, SDL_HAT_CENTERED, SDL_HAT_RIGHT }, - { SDL_HAT_LEFTDOWN, SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN } - }; - SDL_logical_joydecl(SDL_Joystick *logicaljoy = NULL); - SDL_logical_joydecl(struct joystick_logical_mapping* hats = NULL); - - if (stick->nhats <= hat) { - return; /* whoops, that shouldn't happen! */ - } - - the_hat = &stick->hwdata->hats[hat]; - if ( value < 0 ) { - value = 0; - } else - if ( value == 0 ) { - value = 1; - } else - if ( value > 0 ) { - value = 2; - } - if ( value != the_hat->axis[axis] ) { - the_hat->axis[axis] = value; - -#ifndef NO_LOGICAL_JOYSTICKS - /* if there's no map then this is just a regular joystick - */ - if (SDL_joylist[stick->index].map != NULL) { - - /* get the fake joystick that will receive the event - */ - hats = SDL_joylist[stick->index].map->hatmap+hat; - logicaljoy = FindLogicalJoystick(stick, hats); - } - - if (logicaljoy) { - stick = logicaljoy; - hat = hats->nthing; - } -#endif /* USE_LOGICAL_JOYSTICKS */ - - SDL_PrivateJoystickHat(stick, hat, - position_map[the_hat->axis[1]][the_hat->axis[0]]); - } -} + struct input_absinfo absinfo; + int a, b = 0; + + /* Poll all axis */ + for (a = ABS_X; b < ABS_MAX; a++) { + switch (a) { + case ABS_HAT0X: + case ABS_HAT0Y: + case ABS_HAT1X: + case ABS_HAT1Y: + case ABS_HAT2X: + case ABS_HAT2Y: + case ABS_HAT3X: + case ABS_HAT3Y: + /* ingore hats */ + break; + default: + if (joystick->hwdata->abs_correct[b].used) { + if (ioctl(joystick->hwdata->fd, EVIOCGABS(a), &absinfo) >= 0) { + absinfo.value = AxisCorrect(joystick, b, absinfo.value); -static __inline__ -void HandleBall(SDL_Joystick *stick, Uint8 ball, int axis, int value) -{ - if ((stick->nballs <= ball) || (axis >= 2)) { - return; /* whoops, that shouldn't happen! */ - } - stick->hwdata->balls[ball].axis[axis] += value; +#ifdef DEBUG_INPUT_EVENTS + printf("Joystick : Re-read Axis %d (%d) val= %d\n", + joystick->hwdata->abs_map[b], a, absinfo.value); +#endif + SDL_PrivateJoystickAxis(joystick, + joystick->hwdata->abs_map[b], + absinfo.value); + } + } + b++; + } + } } -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ -static __inline__ void JS_HandleEvents(SDL_Joystick *joystick) +static __inline__ void +HandleInputEvents(SDL_Joystick * joystick) { - struct js_event events[32]; - int i, len; - Uint8 other_axis; - -#ifndef NO_LOGICAL_JOYSTICKS - if (SDL_joylist[joystick->index].fname == NULL) { - SDL_joylist_head(i, joystick->index); - JS_HandleEvents(SDL_joylist[i].joy); - return; - } -#endif - - while ((len=read(joystick->hwdata->fd, events, (sizeof events))) > 0) { - len /= sizeof(events[0]); - for ( i=0; inaxes ) { -#ifndef NO_LOGICAL_JOYSTICKS - if (!LogicalJoystickAxis(joystick, - events[i].number, events[i].value)) -#endif - SDL_PrivateJoystickAxis(joystick, - events[i].number, events[i].value); - break; - } - events[i].number -= joystick->naxes; - other_axis = (events[i].number / 2); - if ( other_axis < joystick->nhats ) { - HandleHat(joystick, other_axis, - events[i].number%2, - events[i].value); - break; - } - events[i].number -= joystick->nhats*2; - other_axis = (events[i].number / 2); - if ( other_axis < joystick->nballs ) { - HandleBall(joystick, other_axis, - events[i].number%2, - events[i].value); - break; - } - break; - case JS_EVENT_BUTTON: -#ifndef NO_LOGICAL_JOYSTICKS - if (!LogicalJoystickButton(joystick, - events[i].number, events[i].value)) + struct input_event events[32]; + int i, len; + int code; + + if (joystick->hwdata->fresh) { + PollAllValues(joystick); + joystick->hwdata->fresh = 0; + } + + while ((len = read(joystick->hwdata->fd, events, (sizeof events))) > 0) { + len /= sizeof(events[0]); + for (i = 0; i < len; ++i) { + code = events[i].code; + switch (events[i].type) { + case EV_KEY: + if (code >= BTN_MISC) { + code -= BTN_MISC; + SDL_PrivateJoystickButton(joystick, + joystick->hwdata->key_map[code], + events[i].value); + } + break; + case EV_ABS: + if (code >= ABS_MISC) { + break; + } + + switch (code) { + case ABS_HAT0X: + case ABS_HAT0Y: + case ABS_HAT1X: + case ABS_HAT1Y: + case ABS_HAT2X: + case ABS_HAT2Y: + case ABS_HAT3X: + case ABS_HAT3Y: + code -= ABS_HAT0X; + HandleHat(joystick, code / 2, code % 2, events[i].value); + break; + default: + events[i].value = + AxisCorrect(joystick, code, events[i].value); + SDL_PrivateJoystickAxis(joystick, + joystick->hwdata->abs_map[code], + events[i].value); + break; + } + break; + case EV_REL: + switch (code) { + case REL_X: + case REL_Y: + code -= REL_X; + HandleBall(joystick, code / 2, code % 2, events[i].value); + break; + default: + break; + } + break; + case EV_SYN: + switch (code) { + case SYN_DROPPED : +#ifdef DEBUG_INPUT_EVENTS + printf("Event SYN_DROPPED detected\n"); #endif - SDL_PrivateJoystickButton(joystick, - events[i].number, events[i].value); - break; - default: - /* ?? */ - break; - } - } - } -} -#if SDL_INPUT_LINUXEV -static __inline__ int EV_AxisCorrect(SDL_Joystick *joystick, int which, int value) -{ - struct axis_correct *correct; - - correct = &joystick->hwdata->abs_correct[which]; - if ( correct->used ) { - if ( value > correct->coef[0] ) { - if ( value < correct->coef[1] ) { - return 0; - } - value -= correct->coef[1]; - } else { - value -= correct->coef[0]; - } - value *= correct->coef[2]; - value >>= 14; - } - - /* Clamp and return */ - if ( value < -32768 ) return -32768; - if ( value > 32767 ) return 32767; - - return value; + PollAllValues(joystick); + break; + default: + break; + } + default: + break; + } + } + } } -static __inline__ void EV_HandleEvents(SDL_Joystick *joystick) +void +SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) { - struct input_event events[32]; - int i, len; - int code; - -#ifndef NO_LOGICAL_JOYSTICKS - if (SDL_joylist[joystick->index].fname == NULL) { - SDL_joylist_head(i, joystick->index); - return EV_HandleEvents(SDL_joylist[i].joy); - } -#endif + int i; - while ((len=read(joystick->hwdata->fd, events, (sizeof events))) > 0) { - len /= sizeof(events[0]); - for ( i=0; i= BTN_MISC ) { - code -= BTN_MISC; -#ifndef NO_LOGICAL_JOYSTICKS - if (!LogicalJoystickButton(joystick, - joystick->hwdata->key_map[code], - events[i].value)) -#endif - SDL_PrivateJoystickButton(joystick, - joystick->hwdata->key_map[code], - events[i].value); - } - break; - case EV_ABS: - switch (code) { - case ABS_HAT0X: - case ABS_HAT0Y: - case ABS_HAT1X: - case ABS_HAT1Y: - case ABS_HAT2X: - case ABS_HAT2Y: - case ABS_HAT3X: - case ABS_HAT3Y: - code -= ABS_HAT0X; - HandleHat(joystick, code/2, code%2, - events[i].value); - break; - default: - events[i].value = EV_AxisCorrect(joystick, code, events[i].value); -#ifndef NO_LOGICAL_JOYSTICKS - if (!LogicalJoystickAxis(joystick, - joystick->hwdata->abs_map[code], - events[i].value)) -#endif - SDL_PrivateJoystickAxis(joystick, - joystick->hwdata->abs_map[code], - events[i].value); - break; - } - break; - case EV_REL: - switch (code) { - case REL_X: - case REL_Y: - code -= REL_X; - HandleBall(joystick, code/2, code%2, - events[i].value); - break; - default: - break; - } - break; - default: - break; - } - } - } -} -#endif /* SDL_INPUT_LINUXEV */ + HandleInputEvents(joystick); -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - int i; - -#if SDL_INPUT_LINUXEV - if ( joystick->hwdata->is_hid ) - EV_HandleEvents(joystick); - else -#endif - JS_HandleEvents(joystick); - - /* Deliver ball motion updates */ - for ( i=0; inballs; ++i ) { - int xrel, yrel; - - xrel = joystick->hwdata->balls[i].axis[0]; - yrel = joystick->hwdata->balls[i].axis[1]; - if ( xrel || yrel ) { - joystick->hwdata->balls[i].axis[0] = 0; - joystick->hwdata->balls[i].axis[1] = 0; - SDL_PrivateJoystickBall(joystick, (Uint8)i, xrel, yrel); - } - } + /* Deliver ball motion updates */ + for (i = 0; i < joystick->nballs; ++i) { + int xrel, yrel; + + xrel = joystick->hwdata->balls[i].axis[0]; + yrel = joystick->hwdata->balls[i].axis[1]; + if (xrel || yrel) { + joystick->hwdata->balls[i].axis[0] = 0; + joystick->hwdata->balls[i].axis[1] = 0; + SDL_PrivateJoystickBall(joystick, (Uint8) i, xrel, yrel); + } + } } /* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) +void +SDL_SYS_JoystickClose(SDL_Joystick * joystick) { -#ifndef NO_LOGICAL_JOYSTICKS - register int i; - if (SDL_joylist[joystick->index].fname == NULL) { - SDL_joylist_head(i, joystick->index); - SDL_JoystickClose(SDL_joylist[i].joy); - } -#endif + if (joystick->hwdata) { + close(joystick->hwdata->fd); + if (joystick->hwdata->item) { + joystick->hwdata->item->hwdata = NULL; + } + SDL_free(joystick->hwdata->hats); + SDL_free(joystick->hwdata->balls); + SDL_free(joystick->hwdata->fname); + SDL_free(joystick->hwdata); + joystick->hwdata = NULL; + } + joystick->closed = 1; +} - if ( joystick->hwdata ) { -#ifndef NO_LOGICAL_JOYSTICKS - if (SDL_joylist[joystick->index].fname != NULL) +/* Function to perform any system-specific joystick related cleanup */ +void +SDL_SYS_JoystickQuit(void) +{ + SDL_joylist_item *item = NULL; + SDL_joylist_item *next = NULL; + + for (item = SDL_joylist; item; item = next) { + next = item->next; + SDL_free(item->path); + SDL_free(item->name); + SDL_free(item); + } + + SDL_joylist = SDL_joylist_tail = NULL; + + numjoysticks = 0; + instance_counter = 0; + +#if SDL_USE_LIBUDEV + if (udev_mon != NULL) { + UDEV_udev_monitor_unref(udev_mon); + udev_mon = NULL; + } + if (udev != NULL) { + UDEV_udev_unref(udev); + udev = NULL; + } + UnloadUDEVLibrary(); #endif - close(joystick->hwdata->fd); - if ( joystick->hwdata->hats ) { - SDL_free(joystick->hwdata->hats); - } - if ( joystick->hwdata->balls ) { - SDL_free(joystick->hwdata->balls); - } - SDL_free(joystick->hwdata); - joystick->hwdata = NULL; - } } -/* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) { - int i; + return JoystickByDevIndex(device_index)->guid; +} - for ( i=0; SDL_joylist[i].fname; ++i ) { - SDL_free(SDL_joylist[i].fname); - SDL_joylist[i].fname = NULL; - } +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) +{ + return joystick->hwdata->guid; } #endif /* SDL_JOYSTICK_LINUX */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/linux/SDL_sysjoystick_c.h b/src/joystick/linux/SDL_sysjoystick_c.h new file mode 100644 index 0000000000..4e942b54ce --- /dev/null +++ b/src/joystick/linux/SDL_sysjoystick_c.h @@ -0,0 +1,57 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +struct SDL_joylist_item; + +/* The private structure used to keep track of a joystick */ +struct joystick_hwdata +{ + int fd; + struct SDL_joylist_item *item; + SDL_JoystickGUID guid; + char *fname; /* Used in haptic subsystem */ + + /* The current Linux joystick driver maps hats to two axes */ + struct hwdata_hat + { + int axis[2]; + } *hats; + /* The current Linux joystick driver maps balls to two axes */ + struct hwdata_ball + { + int axis[2]; + } *balls; + + /* Support for the Linux 2.4 unified input interface */ + Uint8 key_map[KEY_MAX - BTN_MISC]; + Uint8 abs_map[ABS_MAX]; + struct axis_correct + { + int used; + int coef[3]; + } abs_correct[ABS_MAX]; + + int fresh; +}; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/macos/SDL_sysjoystick.c b/src/joystick/macos/SDL_sysjoystick.c deleted file mode 100644 index 3645dbd014..0000000000 --- a/src/joystick/macos/SDL_sysjoystick.c +++ /dev/null @@ -1,320 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_JOYSTICK_MACOS - -/* SDL stuff -- "SDL_sysjoystick.c" - MacOS joystick functions by Frederick Reitberger - - The code that follows is meant for SDL. Use at your own risk. -*/ - -#include - -#include "SDL_joystick.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - - -/* The max number of joysticks we will detect */ -#define MAX_JOYSTICKS 16 -/* Limit ourselves to 32 elements per device */ -#define kMaxReferences 32 - -#define ISpSymmetricAxisToFloat(axis) ((((float) axis) - kISpAxisMiddle) / (kISpAxisMaximum-kISpAxisMiddle)) -#define ISpAsymmetricAxisToFloat(axis) (((float) axis) / (kISpAxisMaximum)) - - -static ISpDeviceReference SYS_Joysticks[MAX_JOYSTICKS]; -static ISpElementListReference SYS_Elements[MAX_JOYSTICKS]; -static ISpDeviceDefinition SYS_DevDef[MAX_JOYSTICKS]; - -struct joystick_hwdata -{ - char name[64]; -/* Uint8 id;*/ - ISpElementReference refs[kMaxReferences]; - /* gonna need some sort of mapping info */ -}; - - -/* Function to scan the system for joysticks. - * Joystick 0 should be the system default joystick. - * This function should return the number of available joysticks, or -1 - * on an unrecoverable fatal error. - */ -int SDL_SYS_JoystickInit(void) -{ - static ISpDeviceClass classes[4] = { - kISpDeviceClass_Joystick, - #if kISpDeviceClass_Gamepad - kISpDeviceClass_Gamepad, - #endif - kISpDeviceClass_Wheel, - 0 - }; - OSErr err; - int i; - UInt32 count, numJoysticks; - - if ( (Ptr)0 == (Ptr)ISpStartup ) { - SDL_SetError("InputSprocket not installed"); - return -1; // InputSprocket not installed - } - - if( (Ptr)0 == (Ptr)ISpGetVersion ) { - SDL_SetError("InputSprocket not version 1.1 or newer"); - return -1; // old version of ISp (not at least 1.1) - } - - ISpStartup(); - - /* Get all the joysticks */ - numJoysticks = 0; - for ( i=0; classes[i]; ++i ) { - count = 0; - err = ISpDevices_ExtractByClass( - classes[i], - MAX_JOYSTICKS-numJoysticks, - &count, - &SYS_Joysticks[numJoysticks]); - numJoysticks += count; - } - - for(i = 0; i < numJoysticks; i++) - { - ISpDevice_GetDefinition( - SYS_Joysticks[i], sizeof(ISpDeviceDefinition), - &SYS_DevDef[i]); - - err = ISpElementList_New( - 0, NULL, - &SYS_Elements[i], 0); - - if (err) { - SDL_OutOfMemory(); - return -1; - } - - ISpDevice_GetElementList( - SYS_Joysticks[i], - &SYS_Elements[i]); - } - - ISpDevices_Deactivate(numJoysticks, SYS_Joysticks); - - return numJoysticks; -} - -/* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) -{ - static char name[64]; - int len; - - /* convert pascal string to c-string */ - len = SYS_DevDef[index].deviceName[0]; - if ( len >= sizeof(name) ) { - len = (sizeof(name) - 1); - } - SDL_memcpy(name, &SYS_DevDef[index].deviceName[1], len); - name[len] = '\0'; - - return name; -} - -/* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. - This should fill the nbuttons and naxes fields of the joystick structure. - It returns 0, or -1 if there is an error. - */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) -{ - int index; - UInt32 count, gotCount, count2; - long numAxis, numButtons, numHats, numBalls; - - count = kMaxReferences; - count2 = 0; - numAxis = numButtons = numHats = numBalls = 0; - - index = joystick->index; - - /* allocate memory for system specific hardware data */ - joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata)); - if (joystick->hwdata == NULL) - { - SDL_OutOfMemory(); - return(-1); - } - SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); - SDL_strlcpy(joystick->hwdata->name, SDL_SYS_JoystickName(index), SDL_arraysize(joystick->hwdata->name)); - joystick->name = joystick->hwdata->name; - - ISpElementList_ExtractByKind( - SYS_Elements[index], - kISpElementKind_Axis, - count, - &gotCount, - joystick->hwdata->refs); - - numAxis = gotCount; - count -= gotCount; - count2 += gotCount; - - ISpElementList_ExtractByKind( - SYS_Elements[index], - kISpElementKind_DPad, - count, - &gotCount, - &(joystick->hwdata->refs[count2])); - - numHats = gotCount; - count -= gotCount; - count2 += gotCount; - - ISpElementList_ExtractByKind( - SYS_Elements[index], - kISpElementKind_Button, - count, - &gotCount, - &(joystick->hwdata->refs[count2])); - - numButtons = gotCount; - count -= gotCount; - count2 += gotCount; - - joystick->naxes = numAxis; - joystick->nhats = numHats; - joystick->nballs = numBalls; - joystick->nbuttons = numButtons; - - ISpDevices_Activate( - 1, - &SYS_Joysticks[index]); - - return 0; -} - -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - int i, j; - ISpAxisData a; - ISpDPadData b; - //ISpDeltaData c; - ISpButtonData d; - - for(i = 0, j = 0; i < joystick->naxes; i++, j++) - { - Sint16 value; - - ISpElement_GetSimpleState( - joystick->hwdata->refs[j], - &a); - value = (ISpSymmetricAxisToFloat(a)* 32767.0); - if ( value != joystick->axes[i] ) { - SDL_PrivateJoystickAxis(joystick, i, value); - } - } - - for(i = 0; i < joystick->nhats; i++, j++) - { - Uint8 pos; - - ISpElement_GetSimpleState( - joystick->hwdata->refs[j], - &b); - switch(b) { - case kISpPadIdle: - pos = SDL_HAT_CENTERED; - break; - case kISpPadLeft: - pos = SDL_HAT_LEFT; - break; - case kISpPadUpLeft: - pos = SDL_HAT_LEFTUP; - break; - case kISpPadUp: - pos = SDL_HAT_UP; - break; - case kISpPadUpRight: - pos = SDL_HAT_RIGHTUP; - break; - case kISpPadRight: - pos = SDL_HAT_RIGHT; - break; - case kISpPadDownRight: - pos = SDL_HAT_RIGHTDOWN; - break; - case kISpPadDown: - pos = SDL_HAT_DOWN; - break; - case kISpPadDownLeft: - pos = SDL_HAT_LEFTDOWN; - break; - } - if ( pos != joystick->hats[i] ) { - SDL_PrivateJoystickHat(joystick, i, pos); - } - } - - for(i = 0; i < joystick->nballs; i++, j++) - { - /* ignore balls right now */ - } - - for(i = 0; i < joystick->nbuttons; i++, j++) - { - ISpElement_GetSimpleState( - joystick->hwdata->refs[j], - &d); - if ( d != joystick->buttons[i] ) { - SDL_PrivateJoystickButton(joystick, i, d); - } - } -} - -/* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) -{ - int index; - - index = joystick->index; - - ISpDevices_Deactivate( - 1, - &SYS_Joysticks[index]); -} - -/* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) -{ - ISpShutdown(); -} - -#endif /* SDL_JOYSTICK_MACOS */ diff --git a/src/joystick/mint/SDL_sysjoystick.c b/src/joystick/mint/SDL_sysjoystick.c deleted file mode 100644 index 9a36152927..0000000000 --- a/src/joystick/mint/SDL_sysjoystick.c +++ /dev/null @@ -1,826 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_JOYSTICK_MINT - -/* - * Atari Joystick/Joypad drivers - * - * Patrice Mandin - */ - -#include -#include - -#include "SDL_events.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - -#include "../../video/ataricommon/SDL_ikbdinterrupt_s.h" -#include "../../video/ataricommon/SDL_xbiosevents_c.h" -#include "../../video/ataricommon/SDL_xbiosinterrupt_s.h" - -/*--- Const ---*/ - -/* We can have: - 1 joystick on IKBD port 1, read via hardware I/O - or same joystick on IKBD port 1, read via xbios - 1 joypad on port A (up to 4 with teamtap) - or 2 joysticks on joypad port A - or 1 analog paddle on joypad port A - or 1 lightpen on joypad port A - 1 joypad on port B (up to 4 with teamtap) - or 2 joysticks on joypad port B - or 1 analog paddle on joypad port B - 2 joysticks on parallel port -*/ - -enum { - IKBD_JOY1=0, - XBIOS_JOY1, - PORTA_PAD0, - PORTA_PAD1, - PORTA_PAD2, - PORTA_PAD3, - PORTB_PAD0, - PORTB_PAD1, - PORTB_PAD2, - PORTB_PAD3, - PORTA_JOY0, - PORTA_JOY1, - PORTB_JOY0, - PORTB_JOY1, - PORTA_LP, - PORTA_ANPAD, - PORTB_ANPAD, -#if 0 - PARA_JOY0, - PARA_JOY1, -#endif - MAX_JOYSTICKS -}; - -enum { - MCH_ST=0, - MCH_STE, - MCH_TT, - MCH_F30, - MCH_CLONE, - MCH_ARANYM -}; - -/* Joypad buttons - * Procontroller note: - * L,R are connected to 4,6 - * X,Y,Z are connected to 7,8,9 - */ - -enum { - JP_UP=0, JP_DOWN, JP_LEFT, JP_RIGHT, - JP_KPMULT, JP_KP7, JP_KP4, JP_KP1, - JP_KP0, JP_KP8, JP_KP5, JP_KP2, - JP_KPNUM, JP_KP9, JP_KP6, JP_KP3, - JP_PAUSE, JP_FIRE0, JP_UNDEF0, JP_FIRE1, - JP_UNDEF1, JP_FIRE2, JP_UNDEF2, JP_OPTION -}; - -#define JP_NUM_BUTTONS 17 - -#define PORT_JS_RIGHT (1<<0) -#define PORT_JS_LEFT (1<<1) -#define PORT_JS_DOWN (1<<2) -#define PORT_JS_UP (1<<3) -#define PORT_JS_FIRE (1<<4) - -enum { - TEAMTAP_MAYBE=0, - TEAMTAP_YES, - TEAMTAP_NO -}; - -/* Teamtap detection values */ -static const Uint32 teamtap_ghosts[20][4]={ - {1<>16) == MCH_STE) || - (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16) || - (cookie_mch == MCH_ARANYM<<16)) - { - atarijoysticks[IKBD_JOY1].enabled=(SDL_AtariIkbd_enabled!=0); - } - if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16) || - (cookie_mch == MCH_ARANYM<<16)) - { - atarijoysticks[PORTA_PAD0].enabled = - atarijoysticks[PORTA_PAD1].enabled = - atarijoysticks[PORTA_PAD2].enabled = - atarijoysticks[PORTA_PAD3].enabled = - atarijoysticks[PORTB_PAD0].enabled = - atarijoysticks[PORTB_PAD1].enabled = - atarijoysticks[PORTB_PAD2].enabled = - atarijoysticks[PORTB_PAD3].enabled = SDL_TRUE; - } - if (!atarijoysticks[IKBD_JOY1].enabled) { - atarijoysticks[XBIOS_JOY1].enabled=(SDL_AtariXbios_enabled!=0); - } - - /* Read environment for joysticks to enable */ - if (envr) { - /* IKBD on any Atari, maybe clones */ - if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) || - (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16) || - (cookie_mch == MCH_ARANYM<<16)) { - if (SDL_AtariIkbd_enabled!=0) { - TEST_JOY_ENABLED(envr, "ikbd-joy1", IKBD_JOY1); - } - } - /* Joypads ports on STE, Falcon and maybe others */ - if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16) || - (cookie_mch == MCH_ARANYM<<16)) { - TEST_JOY_ENABLED(envr, "porta-pad", PORTA_PAD0); - if (!atarijoysticks[PORTA_PAD0].enabled) { - TEST_JOY_ENABLED(envr, "porta-joy0", PORTA_JOY0); - TEST_JOY_ENABLED(envr, "porta-joy1", PORTA_JOY1); - if (!(atarijoysticks[PORTA_JOY0].enabled) && !(atarijoysticks[PORTA_JOY1].enabled)) { - TEST_JOY_ENABLED(envr, "porta-lp", PORTA_LP); - if (!atarijoysticks[PORTA_LP].enabled) { - TEST_JOY_ENABLED(envr, "porta-anpad", PORTA_ANPAD); - } - } - } - - TEST_JOY_ENABLED(envr, "portb-pad", PORTB_PAD0); - if (!atarijoysticks[PORTB_PAD0].enabled) { - TEST_JOY_ENABLED(envr, "portb-joy0", PORTB_JOY0); - TEST_JOY_ENABLED(envr, "portb-joy1", PORTB_JOY1); - if (!(atarijoysticks[PORTB_JOY0].enabled) && !(atarijoysticks[PORTB_JOY1].enabled)) { - TEST_JOY_ENABLED(envr, "portb-anpad", PORTB_ANPAD); - } - } - } - - if (!atarijoysticks[IKBD_JOY1].enabled) { - if (SDL_AtariXbios_enabled!=0) { - TEST_JOY_ENABLED(envr, "xbios-joy1", XBIOS_JOY1); - } - } -#if 0 - /* Parallel port on any Atari, maybe clones */ - if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) || - (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16)) { - TEST_JOY_ENABLED(envr, "para-joy0", PARA_JOY0); - TEST_JOY_ENABLED(envr, "para-joy1", PARA_JOY1); - } -#endif - } - - /* Need to update joypad ports ? */ - joypad_ports_enabled=SDL_FALSE; - for (i=PORTA_PAD0;i<=PORTB_ANPAD;i++) { - if (atarijoysticks[i].enabled) { - joypad_ports_enabled=SDL_TRUE; - break; - } - } - - SDL_numjoysticks = 0; - for (i=0;iindex); - if (numjoystick==-1) - return -1; - - joystick->naxes=0; - joystick->nhats=0; - joystick->nballs=0; - - switch(numjoystick) { - case PORTA_PAD0: - case PORTA_PAD1: - case PORTA_PAD2: - case PORTA_PAD3: - case PORTB_PAD0: - case PORTB_PAD1: - case PORTB_PAD2: - case PORTB_PAD3: - joystick->nhats=1; - joystick->nbuttons=JP_NUM_BUTTONS; - break; - case PORTA_LP: - case PORTA_ANPAD: - case PORTB_ANPAD: - joystick->naxes=2; - joystick->nbuttons=2; - break; - default: - joystick->nhats=1; - joystick->nbuttons=1; - break; - } - - return(0); -} - -/* Detect Teamtap using ghost events */ -static void detect_teamtap(int num_port) -{ - int i,j; - - /* Check if joypad 1,2,3 triggered but not 0 */ - for (i=1; i<4; i++) { - if (jp_joypads[num_port*4+i] && (jp_joypads[num_port*4]==0)) { - has_teamtap[num_port] = TEAMTAP_YES; - return; - } - } - - /* Check if joypad 0 on a given port triggered ghost events for - * other joypads - */ - for (i=0; i<20; i++) { - int with_teamtap=1; - - if (jp_joypads[num_port*4]!=teamtap_ghosts[i][0]) - continue; - - /* If any button on first joypad pressed, check other pads */ - for (j=1; j<4; j++) { - if ((jp_joypads[num_port*4+j] & teamtap_ghosts[i][j]) - ==teamtap_ghosts[i][j]) - { - with_teamtap = 0; - } - } - - has_teamtap[num_port] = (with_teamtap ? TEAMTAP_YES : TEAMTAP_NO); - break; - } -} - -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - int numjoystick; - Uint8 hatstate; - Uint32 curstate,prevstate; - - numjoystick=GetEnabledAtariJoystick(joystick->index); - if (numjoystick==-1) - return; - - prevstate = atarijoysticks[numjoystick].prevstate; - - if (joypad_ports_enabled) { - Supexec(UpdateJoypads); - } - - switch (numjoystick) { - case IKBD_JOY1: - case XBIOS_JOY1: - { - curstate = 0; - - if (numjoystick==IKBD_JOY1) { - curstate = SDL_AtariIkbd_joystick & 0xff; - } - if (numjoystick==XBIOS_JOY1) { - curstate = SDL_AtariXbios_joystick & 0xff; - } - - if (curstate != prevstate) { - hatstate = SDL_HAT_CENTERED; - if (curstate & IKBD_JOY_LEFT) { - hatstate |= SDL_HAT_LEFT; - } - if (curstate & IKBD_JOY_RIGHT) { - hatstate |= SDL_HAT_RIGHT; - } - if (curstate & IKBD_JOY_UP) { - hatstate |= SDL_HAT_UP; - } - if (curstate & IKBD_JOY_DOWN) { - hatstate |= SDL_HAT_DOWN; - } - SDL_PrivateJoystickHat(joystick, 0, hatstate); - - /* Button */ - if ((curstate & IKBD_JOY_FIRE) && !(prevstate & IKBD_JOY_FIRE)) { - SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED); - } - if (!(curstate & IKBD_JOY_FIRE) && (prevstate & IKBD_JOY_FIRE)) { - SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED); - } - } - atarijoysticks[numjoystick].prevstate = curstate; - } - break; - case PORTA_PAD0: - case PORTA_PAD1: - case PORTA_PAD2: - case PORTA_PAD3: - case PORTB_PAD0: - case PORTB_PAD1: - case PORTB_PAD2: - case PORTB_PAD3: - { - int numjoypad,i,numport; - - numjoypad = numport = 0; - switch(numjoystick) { - case PORTA_PAD0: - numjoypad = 0; break; - case PORTA_PAD1: - numjoypad = 1; break; - case PORTA_PAD2: - numjoypad = 2; break; - case PORTA_PAD3: - numjoypad = 3; break; - case PORTB_PAD0: - numjoypad = 4; numport = 1; break; - case PORTB_PAD1: - numjoypad = 5; numport = 1; break; - case PORTB_PAD2: - numjoypad = 6; numport = 1; break; - case PORTB_PAD3: - numjoypad = 7; numport = 1; break; - } - - jp_joypads[numjoypad] &= 0xabffff; - - if (has_teamtap[numport]==TEAMTAP_MAYBE) { - detect_teamtap(numport); - } - /* No events for PORTX_PAD[1,2,3] if no teamtap detected */ - if (has_teamtap[numport] == TEAMTAP_NO) { - if ((numjoypad & 3)!=0) { - return; - } - } - - curstate=jp_joypads[numjoypad]; - if (curstate!=prevstate) { - hatstate = SDL_HAT_CENTERED; - if (curstate & (1<>dir_shift) & 15; - curstate |= ((jp_fires>>fire_shift) & 1)<<4; - - if (curstate != prevstate) { - hatstate = SDL_HAT_CENTERED; - if (curstate & PORT_JS_LEFT) { - hatstate |= SDL_HAT_LEFT; - } - if (curstate & PORT_JS_RIGHT) { - hatstate |= SDL_HAT_RIGHT; - } - if (curstate & PORT_JS_UP) { - hatstate |= SDL_HAT_UP; - } - if (curstate & PORT_JS_DOWN) { - hatstate |= SDL_HAT_DOWN; - } - SDL_PrivateJoystickHat(joystick, 0, hatstate); - - /* Button */ - if ((curstate & PORT_JS_FIRE) && !(prevstate & PORT_JS_FIRE)) { - SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED); - } - if (!(curstate & PORT_JS_FIRE) && (prevstate & PORT_JS_FIRE)) { - SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED); - } - } - atarijoysticks[numjoystick].prevstate = curstate; - } - break; - case PORTA_LP: - { - int i; - - curstate = jp_lightpens[0]>>1; - curstate |= (jp_lightpens[1]>>1)<<15; - curstate |= (jp_fires & 3)<<30; - - if (curstate != prevstate) { - /* X axis */ - SDL_PrivateJoystickAxis(joystick,0,jp_lightpens[0] ^ 0x8000); - /* Y axis */ - SDL_PrivateJoystickAxis(joystick,1,jp_lightpens[1] ^ 0x8000); - /* Buttons */ - for (i=0;i<2;i++) { - int button; - - button=1<<(30+i); - - if ((curstate & button) && !(prevstate & button)) { - SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED); - } - if (!(curstate & button) && (prevstate & button)) { - SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED); - } - } - } - atarijoysticks[numjoystick].prevstate = curstate; - } - break; - case PORTA_ANPAD: - case PORTB_ANPAD: - { - int numpaddle, i; - - numpaddle=0<<1; - if (numjoystick==PORTB_ANPAD) numpaddle=1<<1; - - curstate = jp_paddles[numpaddle]>>1; - curstate |= (jp_paddles[numpaddle+1]>>1)<<15; - curstate |= ((jp_fires>>numpaddle) & 3)<<30; - - if (curstate != prevstate) { - /* X axis */ - SDL_PrivateJoystickAxis(joystick,0,jp_paddles[numpaddle] ^ 0x8000); - /* Y axis */ - SDL_PrivateJoystickAxis(joystick,1,jp_paddles[numpaddle+1] ^ 0x8000); - /* Buttons */ - for (i=0;i<2;i++) { - int button; - - button=1<<(30+i); - - if ((curstate & button) && !(prevstate & button)) { - SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED); - } - if (!(curstate & button) && (prevstate & button)) { - SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED); - } - } - } - atarijoysticks[numjoystick].prevstate = curstate; - } - break; -#if 0 - case PARA_JOY0: - case PARA_JOY1: - break; -#endif - }; - - return; -} - -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) -{ - return; -} - -void SDL_SYS_JoystickQuit(void) -{ - SDL_numjoysticks=0; - return; -} - -/*--- Joypad I/O read/write interface ---*/ - -#define JOYPAD_IO_BASE (0xffff9200) -struct JOYPAD_IO_S { - Uint16 fires; - Uint16 directions; - Uint16 dummy1[6]; - Uint16 paddles[4]; - Uint16 dummy2[4]; - Uint16 lightpens[2]; -}; -#define JOYPAD_IO ((*(volatile struct JOYPAD_IO_S *)JOYPAD_IO_BASE)) - -static const Uint16 joypad_masks[8*4]={ - 0xfffe, 0xfffd, 0xfffb, 0xfff7, - 0xfff0, 0xfff1, 0xfff2, 0xfff3, - 0xfff4, 0xfff5, 0xfff6, 0xfff8, - 0xfff9, 0xfffa, 0xfffc, 0xffff, - 0xffef, 0xffdf, 0xffbf, 0xff7f, - 0xff0f, 0xff1f, 0xff2f, 0xff3f, - 0xff4f, 0xff5f, 0xff6f, 0xff8f, - 0xff9f, 0xffaf, 0xffcf, 0xffff -}; - -static void UpdateJoypads(void) -{ - Uint16 tmp, i, j; - Uint32 cur_fire, cur_dir; - - /*--- This function is called in supervisor mode ---*/ - - /* Update joysticks */ - jp_fires = (~(JOYPAD_IO.fires)) & 15; - jp_directions = (~(JOYPAD_IO.directions)); - - /* Update lightpen */ - tmp = JOYPAD_IO.lightpens[0] & 1023; - jp_lightpens[0] = (tmp<<6) | (tmp>>4); - tmp = JOYPAD_IO.lightpens[1] & 1023; - jp_lightpens[1] = (tmp<<6) | (tmp>>4); - - /* Update paddles */ - tmp = (JOYPAD_IO.paddles[0] & 255); - jp_paddles[0] = (tmp<<8) | tmp; - tmp = (JOYPAD_IO.paddles[1] & 255); - jp_paddles[1] = (tmp<<8) | tmp; - tmp = (JOYPAD_IO.paddles[2] & 255); - jp_paddles[2] = (tmp<<8) | tmp; - tmp = (JOYPAD_IO.paddles[3] & 255); - jp_paddles[3] = (tmp<<8) | tmp; - - /* Update joypads on teamtap port A */ - for (i=0; i<4; i++) { - jp_joypads[i] = 0; - for (j=0; j<4; j++) { - JOYPAD_IO.directions = joypad_masks[(i*4)+j]; - - cur_fire = (~(JOYPAD_IO.fires) & 3)<<16; - cur_dir = (~(JOYPAD_IO.directions)>>8) & 15; - - jp_joypads[i] |= cur_fire<<(j*2); - jp_joypads[i] |= cur_dir<<(j*4); - } - } - - /* Update joypads on teamtap port B */ - for (i=4; i<8; i++) { - jp_joypads[i] = 0; - for (j=0; j<4; j++) { - JOYPAD_IO.directions = joypad_masks[(i*4)+j]; - - cur_fire = (~(JOYPAD_IO.fires) & 0xc)<<14; - cur_dir = (~(JOYPAD_IO.directions)>>12) & 15; - - jp_joypads[i] |= cur_fire<<(j*2); - jp_joypads[i] |= cur_dir<<(j*4); - } - } - - JOYPAD_IO.directions=0xffff; -} - -#endif /* SDL_JOYSTICK_MINT */ diff --git a/src/joystick/nds/SDL_sysjoystick.c b/src/joystick/nds/SDL_sysjoystick.c deleted file mode 100644 index 122f48d863..0000000000 --- a/src/joystick/nds/SDL_sysjoystick.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the system specific header for the SDL joystick API */ -#include -//#include - -#include "SDL_error.h" -#include "SDL_events.h" -#include "SDL_joystick.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - -#include "../../video/nds/SDL_ndsevents_c.h" - -/* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. - * It should return 0, or -1 on an unrecoverable fatal error. - */ -int SDL_SYS_JoystickInit(void) -{ - SDL_numjoysticks = 1; - //keysInit(); - - return(1); -} - -/* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) -{ - if(!index) - return "NDS builtin joypad"; - SDL_SetError("No joystick available with that index"); - return (NULL); -} - -/* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. - This should fill the nbuttons and naxes fields of the joystick structure. - It returns 0, or -1 if there is an error. - */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) -{ - joystick->nbuttons=8; - joystick->nhats=0; - joystick->nballs=0; - joystick->naxes=2; - return 0; -} - - -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ - -int prevbutton=0; -int prevkey=0; - -int dc=0;int ldc=0; -u32 keysd,keysu=0; -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - //dc=keysd; - //if (dc) - //{ - //fprintf(stderr,"heartbeat= %d\n",REG_VCOUNT); - //swiWaitForVBlank(); - //scanKeys(); - //keysd = keysDown(); - //keysu = keysUp(); - //ldc=keysd; - - //} - /*if (prevkey && prevbutton) - { - scanKeys(); - } - */ - - //scanKeys(); - keysd = keysDown(); - keysu = keysUp(); - - - short ax=0,v=0,h=0; - if((keysd&KEY_UP)) {ax=1;v=-10;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=KEY_UP;}//fprintf(stderr,"KEY_UP\n");} - if((keysd&KEY_DOWN)) {ax=1;v=10;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=KEY_DOWN;}//fprintf(stderr,"KEY_DOWN\n");} - if((keysd&KEY_LEFT)) {ax=0;h=-10;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=KEY_LEFT;}//fprintf(stderr,"KEY_LEFT\n");} - if((keysd&KEY_RIGHT)) {ax=0;h=10;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=KEY_RIGHT;}//fprintf(stderr,"KEY_RIGHT\n");} - - if((keysu&KEY_UP)) {ax=1;v=0;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=0;}//fprintf(stderr,"KEY_UP\n");} - if((keysu&KEY_DOWN)) {ax=1;v=0;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=0;}//fprintf(stderr,"KEY_DOWN\n");} - if((keysu&KEY_LEFT)) {ax=0;h=0;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=0;}//fprintf(stderr,"KEY_LEFT\n");} - if((keysu&KEY_RIGHT)) {ax=0;h=0;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=0;}//fprintf(stderr,"KEY_RIGHT\n");} - - if((keysd&KEY_A)) {SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED);prevbutton=KEY_A;} - if((keysd&KEY_B)) {SDL_PrivateJoystickButton(joystick,1,SDL_PRESSED);prevbutton=KEY_B;} - if((keysd&KEY_X)) {SDL_PrivateJoystickButton(joystick,2,SDL_PRESSED);prevbutton=KEY_X;} - if((keysd&KEY_Y)) {SDL_PrivateJoystickButton(joystick,3,SDL_PRESSED);prevbutton=KEY_Y;} - if((keysd&KEY_SELECT)) {SDL_PrivateJoystickButton(joystick,6,SDL_PRESSED);prevbutton=KEY_SELECT;} - if((keysd&KEY_START)) {SDL_PrivateJoystickButton(joystick,7,SDL_PRESSED);prevbutton=KEY_START;} - if((keysd&KEY_L)) {SDL_PrivateJoystickButton(joystick,4,SDL_PRESSED);prevbutton=KEY_L;} - if((keysd&KEY_R)) {SDL_PrivateJoystickButton(joystick,5,SDL_PRESSED);prevbutton=KEY_R;} - - if((keysu&KEY_A)) {SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED);prevbutton=0;} - if((keysu&KEY_B)) {SDL_PrivateJoystickButton(joystick,1,SDL_RELEASED);prevbutton=0;} - if((keysu&KEY_X)) {SDL_PrivateJoystickButton(joystick,2,SDL_RELEASED);prevbutton=0;} - if((keysu&KEY_Y)) {SDL_PrivateJoystickButton(joystick,3,SDL_RELEASED);prevbutton=0;} - if((keysu&KEY_SELECT)) {SDL_PrivateJoystickButton(joystick,6,SDL_RELEASED);prevbutton=0;} - if((keysu&KEY_START)) {SDL_PrivateJoystickButton(joystick,7,SDL_RELEASED);prevbutton=0;} - if((keysu&KEY_L)) {SDL_PrivateJoystickButton(joystick,4,SDL_RELEASED);prevbutton=0;} - if((keysu&KEY_R)) {SDL_PrivateJoystickButton(joystick,5,SDL_RELEASED);prevbutton=0;} - - - -} - -/* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) -{ -} - -/* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) -{ -} - diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c new file mode 100644 index 0000000000..d6ca6989eb --- /dev/null +++ b/src/joystick/psp/SDL_sysjoystick.c @@ -0,0 +1,274 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* This is the system specific header for the SDL joystick API */ +#include +#include + +#include /* For the definition of NULL */ +#include + +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" + +#include "SDL_events.h" +#include "SDL_error.h" +#include "SDL_thread.h" +#include "SDL_mutex.h" +#include "SDL_timer.h" + +/* Current pad state */ +static SceCtrlData pad = { .Lx = 0, .Ly = 0, .Buttons = 0 }; +static SDL_sem *pad_sem = NULL; +static SDL_Thread *thread = NULL; +static int running = 0; +static const enum PspCtrlButtons button_map[] = { + PSP_CTRL_TRIANGLE, PSP_CTRL_CIRCLE, PSP_CTRL_CROSS, PSP_CTRL_SQUARE, + PSP_CTRL_LTRIGGER, PSP_CTRL_RTRIGGER, + PSP_CTRL_DOWN, PSP_CTRL_LEFT, PSP_CTRL_UP, PSP_CTRL_RIGHT, + PSP_CTRL_SELECT, PSP_CTRL_START, PSP_CTRL_HOME, PSP_CTRL_HOLD }; +static int analog_map[256]; /* Map analog inputs to -32768 -> 32767 */ + +typedef struct +{ + int x; + int y; +} point; + +/* 4 points define the bezier-curve. */ +static point a = { 0, 0 }; +static point b = { 50, 0 }; +static point c = { 78, 32767 }; +static point d = { 128, 32767 }; + +/* simple linear interpolation between two points */ +static __inline__ void lerp (point *dest, point *a, point *b, float t) +{ + dest->x = a->x + (b->x - a->x)*t; + dest->y = a->y + (b->y - a->y)*t; +} + +/* evaluate a point on a bezier-curve. t goes from 0 to 1.0 */ +static int calc_bezier_y(float t) +{ + point ab, bc, cd, abbc, bccd, dest; + lerp (&ab, &a, &b, t); /* point between a and b */ + lerp (&bc, &b, &c, t); /* point between b and c */ + lerp (&cd, &c, &d, t); /* point between c and d */ + lerp (&abbc, &ab, &bc, t); /* point between ab and bc */ + lerp (&bccd, &bc, &cd, t); /* point between bc and cd */ + lerp (&dest, &abbc, &bccd, t); /* point on the bezier-curve */ + return dest.y; +} + +/* + * Collect pad data about once per frame + */ +int JoystickUpdate(void *data) +{ + while (running) { + SDL_SemWait(pad_sem); + sceCtrlPeekBufferPositive(&pad, 1); + SDL_SemPost(pad_sem); + /* Delay 1/60th of a second */ + sceKernelDelayThread(1000000 / 60); + } + return 0; +} + + + +/* Function to scan the system for joysticks. + * This function should set SDL_numjoysticks to the number of available + * joysticks. Joystick 0 should be the system default joystick. + * It should return number of joysticks, or -1 on an unrecoverable fatal error. + */ +int SDL_SYS_JoystickInit(void) +{ + int i; + +/* SDL_numjoysticks = 1; */ + + /* Setup input */ + sceCtrlSetSamplingCycle(0); + sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); + + /* Start thread to read data */ + if((pad_sem = SDL_CreateSemaphore(1)) == NULL) { + return SDL_SetError("Can't create input semaphore"); + } + running = 1; + if((thread = SDL_CreateThread(JoystickUpdate, "JoySitckThread",NULL)) == NULL) { + return SDL_SetError("Can't create input thread"); + } + + /* Create an accurate map from analog inputs (0 to 255) + to SDL joystick positions (-32768 to 32767) */ + for (i = 0; i < 128; i++) + { + float t = (float)i/127.0f; + analog_map[i+128] = calc_bezier_y(t); + analog_map[127-i] = -1 * analog_map[i+128]; + } + + return 1; +} + +int SDL_SYS_NumJoysticks() +{ + return 1; +} + +void SDL_SYS_JoystickDetect() +{ +} + +SDL_bool SDL_SYS_JoystickNeedsPolling() +{ + return SDL_FALSE; +} + +/* Function to get the device-dependent name of a joystick */ +const char * SDL_SYS_JoystickNameForDeviceIndex(int device_index) +{ + return "PSP builtin joypad"; +} + +/* Function to perform the mapping from device index to the instance id for this index */ +SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) +{ + return device_index; +} + +/* Function to get the device-dependent name of a joystick */ +const char *SDL_SYS_JoystickName(int index) +{ + if (index == 0) + return "PSP controller"; + + SDL_SetError("No joystick available with that index"); + return(NULL); +} + +/* Function to open a joystick for use. + The joystick to open is specified by the index field of the joystick. + This should fill the nbuttons and naxes fields of the joystick structure. + It returns 0, or -1 if there is an error. + */ +int SDL_SYS_JoystickOpen(SDL_Joystick *joystick, int device_index) +{ + joystick->nbuttons = 14; + joystick->naxes = 2; + joystick->nhats = 0; + + return 0; +} + +/* Function to determine is this joystick is attached to the system right now */ +SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) +{ + return SDL_TRUE; +} +/* Function to update the state of a joystick - called as a device poll. + * This function shouldn't update the joystick structure directly, + * but instead should call SDL_PrivateJoystick*() to deliver events + * and update joystick device state. + */ + +void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) +{ + int i; + enum PspCtrlButtons buttons; + enum PspCtrlButtons changed; + unsigned char x, y; + static enum PspCtrlButtons old_buttons = 0; + static unsigned char old_x = 0, old_y = 0; + + SDL_SemWait(pad_sem); + buttons = pad.Buttons; + x = pad.Lx; + y = pad.Ly; + SDL_SemPost(pad_sem); + + /* Axes */ + if(old_x != x) { + SDL_PrivateJoystickAxis(joystick, 0, analog_map[x]); + old_x = x; + } + if(old_y != y) { + SDL_PrivateJoystickAxis(joystick, 1, analog_map[y]); + old_y = y; + } + + /* Buttons */ + changed = old_buttons ^ buttons; + old_buttons = buttons; + if(changed) { + for(i=0; iname; + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + +/* vim: ts=4 sw=4 + */ diff --git a/src/joystick/riscos/SDL_sysjoystick.c b/src/joystick/riscos/SDL_sysjoystick.c deleted file mode 100644 index 214d4c7474..0000000000 --- a/src/joystick/riscos/SDL_sysjoystick.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_JOYSTICK_RISCOS - -/* - RISC OS - Joystick support by Alan Buckley (alan_baa@hotmail.com) - 10 April 2003 - - Note: Currently assumes joystick is present if joystick module is loaded - and that there is one joystick with four buttons. -*/ - -/* This is the system specific header for the SDL joystick API */ - -#include "SDL_events.h" -#include "SDL_joystick.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - -#include "kernel.h" - -#define JOYSTICK_READ 0x43F40 - -struct joystick_hwdata -{ - int joystate; -}; - - -/* Function to scan the system for joysticks. - * This function should set SDL_numjoysticks to the number of available - * joysticks. Joystick 0 should be the system default joystick. - * It should return number of joysticks, or -1 on an unrecoverable fatal error. - */ -int SDL_SYS_JoystickInit(void) -{ - _kernel_swi_regs regs; - - /* Try to read joystick 0 */ - regs.r[0] = 0; - if (_kernel_swi(JOYSTICK_READ, ®s, ®s) == NULL) - { - /* Switch works so assume we've got a joystick */ - return 1; - } - /* Switch fails so it looks like there's no joystick here */ - - return(0); -} - -/* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) -{ - if (index == 0) - { - return "RISC OS Joystick 0"; - } - - SDL_SetError("No joystick available with that index"); - return(NULL); -} - -/* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. - This should fill the nbuttons and naxes fields of the joystick structure. - It returns 0, or -1 if there is an error. - */ -int SDL_SYS_JoystickOpen(SDL_Joystick *joystick) -{ - _kernel_swi_regs regs; - - if(!(joystick->hwdata=SDL_malloc(sizeof(struct joystick_hwdata)))) - return -1; - - regs.r[0] = joystick->index; - - /* Don't know how to get exact count of buttons so assume max of 4 for now */ - joystick->nbuttons=4; - - joystick->nhats=0; - joystick->nballs=0; - joystick->naxes=2; - joystick->hwdata->joystate=0; - - return 0; - -} - -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - _kernel_swi_regs regs; - regs.r[0] = joystick->index; - - if (_kernel_swi(JOYSTICK_READ, ®s, ®s) == NULL) - { - int newstate = regs.r[0]; - int oldstate = joystick->hwdata->joystate; - if (newstate != oldstate) - { - if ((newstate & 0xFF) != (oldstate & 0xFF)) - { - int y = regs.r[0] & 0xFF; - /* Convert to signed values */ - if (y >= 128) y -= 256; - SDL_PrivateJoystickAxis(joystick,1,-y * 256); /* Up and down opposite to result in SDL */ - } - if ((newstate & 0xFF00) != (oldstate & 0xFF00)) - { - int x = (regs.r[0] & 0xFF00) >> 8; - if (x >= 128) x -= 256; - SDL_PrivateJoystickAxis(joystick,0,x * 256); - } - - if ((newstate & 0xFF0000) != (oldstate & 0xFF0000)) - { - int buttons = (regs.r[0] & 0xFF0000) >> 16; - int oldbuttons = (oldstate & 0xFF0000) >> 16; - int i; - for (i = 0; i < joystick->nbuttons; i++) - { - if ((buttons & (1<hwdata->joystate = newstate; - } - } - - return; -} - -/* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) -{ - if(joystick->hwdata) - SDL_free(joystick->hwdata); - return; -} - -/* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) -{ - SDL_numjoysticks=0; - - return; -} - -#endif /* SDL_JOYSTICK_RISCOS */ diff --git a/src/joystick/sort_controllers.py b/src/joystick/sort_controllers.py new file mode 100755 index 0000000000..344a423281 --- /dev/null +++ b/src/joystick/sort_controllers.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Script to sort the game controller database entries in SDL_gamecontroller.c + +import re + + +filename = "SDL_gamecontrollerdb.h" +input = open(filename) +output = open(filename + ".new", "w") +parsing_controllers = False +controllers = [] +controller_guids = {} +split_pattern = re.compile(r'([^"]*")([^,]*,)([^,]*,)([^"]*)(".*)') + +def save_controller(line): + global controllers + match = split_pattern.match(line) + entry = [ match.group(1), match.group(2), match.group(3) ] + bindings = sorted(match.group(4).split(",")) + if (bindings[0] == ""): + bindings.pop(0) + entry.extend(",".join(bindings) + ",") + entry.append(match.group(5)) + controllers.append(entry) + +def write_controllers(): + global controllers + global controller_guids + for entry in sorted(controllers, key=lambda entry: entry[2]): + line = "".join(entry) + "\n" + if (entry[1] in controller_guids): + print "Warning: entry '%s' is duplicate of entry '%s'" % (entry[2], controller_guids[entry[1]][2]) + controller_guids[entry[1]] = entry + + output.write(line) + controllers = [] + controller_guids = {} + +for line in input: + if ( parsing_controllers ): + if (line.startswith("{")): + output.write(line) + elif (line.startswith("#endif")): + parsing_controllers = False + write_controllers() + output.write(line) + elif (line.startswith("#")): + print "Parsing " + line.strip() + write_controllers() + output.write(line) + else: + save_controller(line) + else: + if (line.startswith("static const char *s_ControllerMappings")): + parsing_controllers = True + + output.write(line) + +output.close() +print "Finished writing %s.new" % filename diff --git a/src/joystick/win32/SDL_mmjoystick.c b/src/joystick/win32/SDL_mmjoystick.c deleted file mode 100644 index 8c53f9e3dd..0000000000 --- a/src/joystick/win32/SDL_mmjoystick.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_JOYSTICK_WINMM - -/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */ - -#define WIN32_LEAN_AND_MEAN -#include -#include -#include - -#include "SDL_events.h" -#include "SDL_joystick.h" -#include "../SDL_sysjoystick.h" -#include "../SDL_joystick_c.h" - -#define MAX_JOYSTICKS 16 -#define MAX_AXES 6 /* each joystick can have up to 6 axes */ -#define MAX_BUTTONS 32 /* and 32 buttons */ -#define AXIS_MIN -32768 /* minimum value for axis coordinate */ -#define AXIS_MAX 32767 /* maximum value for axis coordinate */ -/* limit axis to 256 possible positions to filter out noise */ -#define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/256) -#define JOY_BUTTON_FLAG(n) (1<index; - axis_min[0] = SYS_Joystick[index].wXmin; - axis_max[0] = SYS_Joystick[index].wXmax; - axis_min[1] = SYS_Joystick[index].wYmin; - axis_max[1] = SYS_Joystick[index].wYmax; - axis_min[2] = SYS_Joystick[index].wZmin; - axis_max[2] = SYS_Joystick[index].wZmax; - axis_min[3] = SYS_Joystick[index].wRmin; - axis_max[3] = SYS_Joystick[index].wRmax; - axis_min[4] = SYS_Joystick[index].wUmin; - axis_max[4] = SYS_Joystick[index].wUmax; - axis_min[5] = SYS_Joystick[index].wVmin; - axis_max[5] = SYS_Joystick[index].wVmax; - - /* allocate memory for system specific hardware data */ - joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata)); - if (joystick->hwdata == NULL) - { - SDL_OutOfMemory(); - return(-1); - } - SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); - - /* set hardware data */ - joystick->hwdata->id = SYS_JoystickID[index]; - for ( i = 0; i < MAX_AXES; ++i ) { - if ( (i<2) || (SYS_Joystick[index].wCaps & caps_flags[i-2]) ) { - joystick->hwdata->transaxis[i].offset = - AXIS_MIN - axis_min[i]; - joystick->hwdata->transaxis[i].scale = - (float)(AXIS_MAX - AXIS_MIN) / (axis_max[i] - axis_min[i]); - } else { - joystick->hwdata->transaxis[i].offset = 0; - joystick->hwdata->transaxis[i].scale = 1.0; /* Just in case */ - } - } - - /* fill nbuttons, naxes, and nhats fields */ - joystick->nbuttons = SYS_Joystick[index].wNumButtons; - joystick->naxes = SYS_Joystick[index].wNumAxes; - if ( SYS_Joystick[index].wCaps & JOYCAPS_HASPOV ) { - joystick->nhats = 1; - } else { - joystick->nhats = 0; - } - return(0); -} - -static Uint8 TranslatePOV(DWORD value) -{ - Uint8 pos; - - pos = SDL_HAT_CENTERED; - if ( value != JOY_POVCENTERED ) { - if ( (value > JOY_POVLEFT) || (value < JOY_POVRIGHT) ) { - pos |= SDL_HAT_UP; - } - if ( (value > JOY_POVFORWARD) && (value < JOY_POVBACKWARD) ) { - pos |= SDL_HAT_RIGHT; - } - if ( (value > JOY_POVRIGHT) && (value < JOY_POVLEFT) ) { - pos |= SDL_HAT_DOWN; - } - if ( value > JOY_POVBACKWARD ) { - pos |= SDL_HAT_LEFT; - } - } - return(pos); -} - -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ -void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) -{ - MMRESULT result; - int i; - DWORD flags[MAX_AXES] = { JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ, - JOY_RETURNR, JOY_RETURNU, JOY_RETURNV }; - DWORD pos[MAX_AXES]; - struct _transaxis *transaxis; - int value, change; - JOYINFOEX joyinfo; - - joyinfo.dwSize = sizeof(joyinfo); - joyinfo.dwFlags = JOY_RETURNALL|JOY_RETURNPOVCTS; - if ( ! joystick->hats ) { - joyinfo.dwFlags &= ~(JOY_RETURNPOV|JOY_RETURNPOVCTS); - } - result = joyGetPosEx(joystick->hwdata->id, &joyinfo); - if ( result != JOYERR_NOERROR ) { - SetMMerror("joyGetPosEx", result); - return; - } - - /* joystick motion events */ - pos[0] = joyinfo.dwXpos; - pos[1] = joyinfo.dwYpos; - pos[2] = joyinfo.dwZpos; - pos[3] = joyinfo.dwRpos; - pos[4] = joyinfo.dwUpos; - pos[5] = joyinfo.dwVpos; - - transaxis = joystick->hwdata->transaxis; - for (i = 0; i < joystick->naxes; i++) { - if (joyinfo.dwFlags & flags[i]) { - value = (int)(((float)pos[i] + transaxis[i].offset) * transaxis[i].scale); - change = (value - joystick->axes[i]); - if ( (change < -JOY_AXIS_THRESHOLD) || (change > JOY_AXIS_THRESHOLD) ) { - SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value); - } - } - } - - /* joystick button events */ - if ( joyinfo.dwFlags & JOY_RETURNBUTTONS ) { - for ( i = 0; i < joystick->nbuttons; ++i ) { - if ( joyinfo.dwButtons & JOY_BUTTON_FLAG(i) ) { - if ( ! joystick->buttons[i] ) { - SDL_PrivateJoystickButton(joystick, (Uint8)i, SDL_PRESSED); - } - } else { - if ( joystick->buttons[i] ) { - SDL_PrivateJoystickButton(joystick, (Uint8)i, SDL_RELEASED); - } - } - } - } - - /* joystick hat events */ - if ( joyinfo.dwFlags & JOY_RETURNPOV ) { - Uint8 pos; - - pos = TranslatePOV(joyinfo.dwPOV); - if ( pos != joystick->hats[0] ) { - SDL_PrivateJoystickHat(joystick, 0, pos); - } - } -} - -/* Function to close a joystick after use */ -void SDL_SYS_JoystickClose(SDL_Joystick *joystick) -{ - if (joystick->hwdata != NULL) { - /* free system specific hardware data */ - SDL_free(joystick->hwdata); - joystick->hwdata = NULL; - } -} - -/* Function to perform any system-specific joystick related cleanup */ -void SDL_SYS_JoystickQuit(void) -{ - int i; - for (i = 0; i < MAX_JOYSTICKS; i++) { - if ( SYS_JoystickName[i] != NULL ) { - SDL_free(SYS_JoystickName[i]); - SYS_JoystickName[i] = NULL; - } - } -} - - -/* implementation functions */ -void SetMMerror(char *function, int code) -{ - static char *error; - static char errbuf[1024]; - - errbuf[0] = 0; - switch (code) - { - case MMSYSERR_NODRIVER: - error = "Joystick driver not present"; - break; - - case MMSYSERR_INVALPARAM: - case JOYERR_PARMS: - error = "Invalid parameter(s)"; - break; - - case MMSYSERR_BADDEVICEID: - error = "Bad device ID"; - break; - - case JOYERR_UNPLUGGED: - error = "Joystick not attached"; - break; - - case JOYERR_NOCANDO: - error = "Can't capture joystick input"; - break; - - default: - SDL_snprintf(errbuf, SDL_arraysize(errbuf), - "%s: Unknown Multimedia system error: 0x%x", - function, code); - break; - } - - if ( ! errbuf[0] ) { - SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error); - } - SDL_SetError("%s", errbuf); -} - -#endif /* SDL_JOYSTICK_WINMM */ diff --git a/src/joystick/windows/SDL_dxjoystick.c b/src/joystick/windows/SDL_dxjoystick.c new file mode 100644 index 0000000000..5a832abd86 --- /dev/null +++ b/src/joystick/windows/SDL_dxjoystick.c @@ -0,0 +1,1755 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef SDL_JOYSTICK_DINPUT + +/* DirectInput joystick driver; written by Glenn Maynard, based on Andrei de + * A. Formiga's WINMM driver. + * + * Hats and sliders are completely untested; the app I'm writing this for mostly + * doesn't use them and I don't own any joysticks with them. + * + * We don't bother to use event notification here. It doesn't seem to work + * with polled devices, and it's fine to call IDirectInputDevice8_GetDeviceData and + * let it return 0 events. */ + +#include "SDL_error.h" +#include "SDL_assert.h" +#include "SDL_events.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_mutex.h" +#include "SDL_events.h" +#include "SDL_hints.h" +#include "SDL_joystick.h" +#include "../SDL_sysjoystick.h" +#if !SDL_EVENTS_DISABLED +#include "../../events/SDL_events_c.h" +#endif + +/* The latest version of mingw-w64 defines IID_IWbemLocator in wbemcli.h + instead of declaring it like Visual Studio and other mingw32 compilers. + So, we need to take care of this here before we define INITGUID. +*/ +#ifdef __MINGW32__ +#define __IWbemLocator_INTERFACE_DEFINED__ +#endif /* __MINGW32__ */ + +#define INITGUID /* Only set here, if set twice will cause mingw32 to break. */ +#include "SDL_dxjoystick_c.h" + +#ifdef __MINGW32__ +/* And now that we've included wbemcli.h we need to declare these interfaces */ +typedef struct IWbemLocatorVtbl { + BEGIN_INTERFACE + HRESULT (WINAPI *QueryInterface)(IWbemLocator *This,REFIID riid,void **ppvObject); + ULONG (WINAPI *AddRef)(IWbemLocator *This); + ULONG (WINAPI *Release)(IWbemLocator *This); + HRESULT (WINAPI *ConnectServer)(IWbemLocator *This,const BSTR strNetworkResource,const BSTR strUser,const BSTR strPassword,const BSTR strLocale,LONG lSecurityFlags,const BSTR strAuthority,IWbemContext *pCtx,IWbemServices **ppNamespace); + END_INTERFACE +} IWbemLocatorVtbl; +struct IWbemLocator { + CONST_VTBL struct IWbemLocatorVtbl *lpVtbl; +}; +#define IWbemLocator_ConnectServer(This,strNetworkResource,strUser,strPassword,strLocale,lSecurityFlags,strAuthority,pCtx,ppNamespace) (This)->lpVtbl->ConnectServer(This,strNetworkResource,strUser,strPassword,strLocale,lSecurityFlags,strAuthority,pCtx,ppNamespace) +#endif /* __MINGW32__ */ + +#ifndef DIDFT_OPTIONAL +#define DIDFT_OPTIONAL 0x80000000 +#endif + + +#define INPUT_QSIZE 32 /* Buffer up to 32 input messages */ +#define MAX_JOYSTICKS 8 +#define AXIS_MIN -32768 /* minimum value for axis coordinate */ +#define AXIS_MAX 32767 /* maximum value for axis coordinate */ +#define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/100) /* 1% motion */ + +/* external variables referenced. */ +extern HWND SDL_HelperWindow; + + +/* local variables */ +static SDL_bool coinitialized = SDL_FALSE; +static LPDIRECTINPUT8 dinput = NULL; +static SDL_bool s_bDeviceAdded = SDL_FALSE; +static SDL_bool s_bDeviceRemoved = SDL_FALSE; +static SDL_JoystickID s_nInstanceID = -1; +static GUID *s_pKnownJoystickGUIDs = NULL; +static SDL_cond *s_condJoystickThread = NULL; +static SDL_mutex *s_mutexJoyStickEnum = NULL; +static SDL_Thread *s_threadJoystick = NULL; +static SDL_bool s_bJoystickThreadQuit = SDL_FALSE; +static SDL_bool s_bXInputEnabled = SDL_TRUE; + +XInputGetState_t SDL_XInputGetState = NULL; +XInputSetState_t SDL_XInputSetState = NULL; +XInputGetCapabilities_t SDL_XInputGetCapabilities = NULL; +DWORD SDL_XInputVersion = 0; + +static HANDLE s_pXInputDLL = 0; +static int s_XInputDLLRefCount = 0; + +int +WIN_LoadXInputDLL(void) +{ + DWORD version = 0; + + if (s_pXInputDLL) { + SDL_assert(s_XInputDLLRefCount > 0); + s_XInputDLLRefCount++; + return 0; /* already loaded */ + } + + version = (1 << 16) | 4; + s_pXInputDLL = LoadLibrary( L"XInput1_4.dll" ); /* 1.4 Ships with Windows 8. */ + if (!s_pXInputDLL) { + version = (1 << 16) | 3; + s_pXInputDLL = LoadLibrary( L"XInput1_3.dll" ); /* 1.3 Ships with Vista and Win7, can be installed as a redistributable component. */ + } + if (!s_pXInputDLL) { + s_pXInputDLL = LoadLibrary( L"bin\\XInput1_3.dll" ); + } + if (!s_pXInputDLL) { + return -1; + } + + SDL_assert(s_XInputDLLRefCount == 0); + SDL_XInputVersion = version; + s_XInputDLLRefCount = 1; + + /* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */ + SDL_XInputGetState = (XInputGetState_t)GetProcAddress( (HMODULE)s_pXInputDLL, (LPCSTR)100 ); + SDL_XInputSetState = (XInputSetState_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputSetState" ); + SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetCapabilities" ); + if ( !SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities ) { + WIN_UnloadXInputDLL(); + return -1; + } + + return 0; +} + +void +WIN_UnloadXInputDLL(void) +{ + if ( s_pXInputDLL ) { + SDL_assert(s_XInputDLLRefCount > 0); + if (--s_XInputDLLRefCount == 0) { + FreeLibrary( s_pXInputDLL ); + s_pXInputDLL = NULL; + } + } else { + SDL_assert(s_XInputDLLRefCount == 0); + } +} + + +extern HRESULT(WINAPI * DInputCreate) (HINSTANCE hinst, DWORD dwVersion, + LPDIRECTINPUT * ppDI, + LPUNKNOWN punkOuter); +struct JoyStick_DeviceData_ +{ + SDL_JoystickGUID guid; + DIDEVICEINSTANCE dxdevice; + char *joystickname; + Uint8 send_add_event; + SDL_JoystickID nInstanceID; + SDL_bool bXInputDevice; + Uint8 XInputUserId; + struct JoyStick_DeviceData_ *pNext; +}; + +typedef struct JoyStick_DeviceData_ JoyStick_DeviceData; + +static JoyStick_DeviceData *SYS_Joystick; /* array to hold joystick ID values */ + +/* local prototypes */ +static int SetDIerror(const char *function, HRESULT code); +static BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE * + pdidInstance, VOID * pContext); +static BOOL CALLBACK EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev, + LPVOID pvRef); +static void SortDevObjects(SDL_Joystick *joystick); +static Uint8 TranslatePOV(DWORD value); +static int SDL_PrivateJoystickAxis_Int(SDL_Joystick * joystick, Uint8 axis, + Sint16 value); +static int SDL_PrivateJoystickHat_Int(SDL_Joystick * joystick, Uint8 hat, + Uint8 value); +static int SDL_PrivateJoystickButton_Int(SDL_Joystick * joystick, + Uint8 button, Uint8 state); + +/* Taken from Wine - Thanks! */ +DIOBJECTDATAFORMAT dfDIJoystick2[] = { + { &GUID_XAxis,DIJOFS_X,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_YAxis,DIJOFS_Y,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_ZAxis,DIJOFS_Z,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RxAxis,DIJOFS_RX,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RyAxis,DIJOFS_RY,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RzAxis,DIJOFS_RZ,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,DIJOFS_SLIDER(0),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,DIJOFS_SLIDER(1),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_POV,DIJOFS_POV(0),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, + { &GUID_POV,DIJOFS_POV(1),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, + { &GUID_POV,DIJOFS_POV(2),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, + { &GUID_POV,DIJOFS_POV(3),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(0),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(1),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(2),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(3),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(4),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(5),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(6),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(7),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(8),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(9),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(10),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(11),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(12),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(13),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(14),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(15),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(16),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(17),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(18),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(19),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(20),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(21),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(22),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(23),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(24),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(25),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(26),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(27),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(28),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(29),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(30),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(31),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(32),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(33),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(34),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(35),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(36),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(37),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(38),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(39),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(40),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(41),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(42),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(43),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(44),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(45),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(46),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(47),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(48),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(49),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(50),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(51),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(52),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(53),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(54),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(55),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(56),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(57),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(58),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(59),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(60),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(61),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(62),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(63),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(64),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(65),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(66),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(67),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(68),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(69),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(70),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(71),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(72),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(73),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(74),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(75),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(76),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(77),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(78),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(79),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(80),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(81),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(82),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(83),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(84),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(85),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(86),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(87),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(88),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(89),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(90),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(91),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(92),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(93),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(94),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(95),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(96),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(97),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(98),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(99),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(100),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(101),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(102),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(103),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(104),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(105),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(106),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(107),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(108),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(109),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(110),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(111),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(112),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(113),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(114),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(115),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(116),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(117),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(118),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(119),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(120),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(121),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(122),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(123),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(124),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(125),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(126),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { NULL,DIJOFS_BUTTON(127),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0}, + { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lVX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lVY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lVZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lVRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lVRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lVRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lAX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lAY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lAZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lARx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lARy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lARz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lFX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lFY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lFZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lFRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lFRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lFRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, + { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0}, +}; + +const DIDATAFORMAT c_dfDIJoystick2 = { + sizeof(DIDATAFORMAT), + sizeof(DIOBJECTDATAFORMAT), + DIDF_ABSAXIS, + sizeof(DIJOYSTATE2), + SDL_arraysize(dfDIJoystick2), + dfDIJoystick2 +}; + + +/* Convert a DirectInput return code to a text message */ +static int +SetDIerror(const char *function, HRESULT code) +{ + /* + return SDL_SetError("%s() [%s]: %s", function, + DXGetErrorString9A(code), DXGetErrorDescription9A(code)); + */ + return SDL_SetError("%s() DirectX error %d", function, code); +} + + +#define SAFE_RELEASE(p) \ +{ \ + if (p) { \ + (p)->lpVtbl->Release((p)); \ + (p) = 0; \ + } \ +} + +DEFINE_GUID(CLSID_WbemLocator, 0x4590f811,0x1d3a,0x11d0,0x89,0x1F,0x00,0xaa,0x00,0x4b,0x2e,0x24); +DEFINE_GUID(IID_IWbemLocator, 0xdc12a687,0x737f,0x11cf,0x88,0x4d,0x00,0xaa,0x00,0x4b,0x2e,0x24); + +DEFINE_GUID(IID_ValveStreamingGamepad, MAKELONG( 0x28DE, 0x11FF ),0x0000,0x0000,0x00,0x00,0x50,0x49,0x44,0x56,0x49,0x44); + +/*----------------------------------------------------------------------------- + * + * code from MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx + * + * Enum each PNP device using WMI and check each device ID to see if it contains + * "IG_" (ex. "VID_045E&PID_028E&IG_00"). If it does, then it's an XInput device + * Unfortunately this information can not be found by just using DirectInput + *-----------------------------------------------------------------------------*/ +BOOL IsXInputDevice( const GUID* pGuidProductFromDirectInput ) +{ + static const GUID *s_XInputProductGUID[] = { + &IID_ValveStreamingGamepad + }; + IWbemLocator* pIWbemLocator = NULL; + IEnumWbemClassObject* pEnumDevices = NULL; + IWbemClassObject* pDevices[20]; + IWbemServices* pIWbemServices = NULL; + DWORD uReturned = 0; + BSTR bstrNamespace = NULL; + BSTR bstrDeviceID = NULL; + BSTR bstrClassName = NULL; + SDL_bool bIsXinputDevice= SDL_FALSE; + UINT iDevice = 0; + VARIANT var; + HRESULT hr; + DWORD bCleanupCOM; + + if (!s_bXInputEnabled) + { + return SDL_FALSE; + } + + // Check for well known XInput device GUIDs + // We need to do this for the Valve Streaming Gamepad because it's virtualized and doesn't show up in the device list. + for ( iDevice = 0; iDevice < SDL_arraysize(s_XInputProductGUID); ++iDevice ) { + if (SDL_memcmp(pGuidProductFromDirectInput, s_XInputProductGUID[iDevice], sizeof(GUID)) == 0) { + return SDL_TRUE; + } + } + + SDL_memset( pDevices, 0x0, sizeof(pDevices) ); + + /* CoInit if needed */ + hr = CoInitialize(NULL); + bCleanupCOM = SUCCEEDED(hr); + + /* Create WMI */ + hr = CoCreateInstance( &CLSID_WbemLocator, + NULL, + CLSCTX_INPROC_SERVER, + &IID_IWbemLocator, + (LPVOID*) &pIWbemLocator); + if( FAILED(hr) || pIWbemLocator == NULL ) + goto LCleanup; + + bstrNamespace = SysAllocString( L"\\\\.\\root\\cimv2" );if( bstrNamespace == NULL ) goto LCleanup; + bstrClassName = SysAllocString( L"Win32_PNPEntity" ); if( bstrClassName == NULL ) goto LCleanup; + bstrDeviceID = SysAllocString( L"DeviceID" ); if( bstrDeviceID == NULL ) goto LCleanup; + + /* Connect to WMI */ + hr = IWbemLocator_ConnectServer( pIWbemLocator, bstrNamespace, NULL, NULL, 0L, + 0L, NULL, NULL, &pIWbemServices ); + if( FAILED(hr) || pIWbemServices == NULL ) + goto LCleanup; + + /* Switch security level to IMPERSONATE. */ + CoSetProxyBlanket( (IUnknown *)pIWbemServices, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, + RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE ); + + hr = IWbemServices_CreateInstanceEnum( pIWbemServices, bstrClassName, 0, NULL, &pEnumDevices ); + if( FAILED(hr) || pEnumDevices == NULL ) + goto LCleanup; + + /* Loop over all devices */ + for( ;; ) + { + /* Get 20 at a time */ + hr = IEnumWbemClassObject_Next( pEnumDevices, 10000, 20, pDevices, &uReturned ); + if( FAILED(hr) ) + goto LCleanup; + if( uReturned == 0 ) + break; + + for( iDevice=0; iDeviceData1 ) + { + bIsXinputDevice = SDL_TRUE; + } + } + if ( pDeviceString ) + SDL_free( pDeviceString ); + + if ( bIsXinputDevice ) + break; + } + SAFE_RELEASE( pDevices[iDevice] ); + } + } + +LCleanup: + + for( iDevice=0; iDevice<20; iDevice++ ) + SAFE_RELEASE( pDevices[iDevice] ); + SAFE_RELEASE( pEnumDevices ); + SAFE_RELEASE( pIWbemLocator ); + SAFE_RELEASE( pIWbemServices ); + + if ( bstrNamespace ) + SysFreeString( bstrNamespace ); + if ( bstrClassName ) + SysFreeString( bstrClassName ); + if ( bstrDeviceID ) + SysFreeString( bstrDeviceID ); + + if( bCleanupCOM ) + CoUninitialize(); + + return bIsXinputDevice; +} + + +static SDL_bool s_bWindowsDeviceChanged = SDL_FALSE; + +/* windowproc for our joystick detect thread message only window, to detect any USB device addition/removal + */ +LRESULT CALLBACK SDL_PrivateJoystickDetectProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { + switch (message) { + case WM_DEVICECHANGE: + switch (wParam) { + case DBT_DEVICEARRIVAL: + if (((DEV_BROADCAST_HDR*)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { + s_bWindowsDeviceChanged = SDL_TRUE; + } + break; + case DBT_DEVICEREMOVECOMPLETE: + if (((DEV_BROADCAST_HDR*)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { + s_bWindowsDeviceChanged = SDL_TRUE; + } + break; + } + return 0; + } + + return DefWindowProc (hwnd, message, wParam, lParam); +} + + +DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, \ + 0xC0, 0x4F, 0xB9, 0x51, 0xED); + +/* Function/thread to scan the system for joysticks. + */ +static int +SDL_JoystickThread(void *_data) +{ + HWND messageWindow = 0; + HDEVNOTIFY hNotify = 0; + DEV_BROADCAST_DEVICEINTERFACE dbh; + SDL_bool bOpenedXInputDevices[4]; + WNDCLASSEX wincl; + + SDL_memset( bOpenedXInputDevices, 0x0, sizeof(bOpenedXInputDevices) ); + + WIN_CoInitialize(); + + SDL_memset( &wincl, 0x0, sizeof(wincl) ); + wincl.hInstance = GetModuleHandle( NULL ); + wincl.lpszClassName = L"Message"; + wincl.lpfnWndProc = SDL_PrivateJoystickDetectProc; /* This function is called by windows */ + wincl.cbSize = sizeof (WNDCLASSEX); + + if (!RegisterClassEx (&wincl)) + { + return SDL_SetError("Failed to create register class for joystick autodetect.", GetLastError()); + } + + messageWindow = (HWND)CreateWindowEx( 0, L"Message", NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL ); + if ( !messageWindow ) + { + return SDL_SetError("Failed to create message window for joystick autodetect.", GetLastError()); + } + + SDL_memset(&dbh, 0x0, sizeof(dbh)); + + dbh.dbcc_size = sizeof(dbh); + dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + dbh.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; + + hNotify = RegisterDeviceNotification( messageWindow, &dbh, DEVICE_NOTIFY_WINDOW_HANDLE ); + if ( !hNotify ) + { + return SDL_SetError("Failed to create notify device for joystick autodetect.", GetLastError()); + } + + SDL_LockMutex( s_mutexJoyStickEnum ); + while ( s_bJoystickThreadQuit == SDL_FALSE ) + { + MSG messages; + Uint8 userId; + int nCurrentOpenedXInputDevices = 0; + int nNewOpenedXInputDevices = 0; + SDL_CondWaitTimeout( s_condJoystickThread, s_mutexJoyStickEnum, 300 ); + + while ( s_bJoystickThreadQuit == SDL_FALSE && PeekMessage(&messages, messageWindow, 0, 0, PM_NOREMOVE) ) + { + if ( GetMessage(&messages, messageWindow, 0, 0) != 0 ) { + TranslateMessage(&messages); + DispatchMessage(&messages); + } + } + + if ( s_bXInputEnabled && XINPUTGETCAPABILITIES ) + { + /* scan for any change in XInput devices */ + for ( userId = 0; userId < 4; userId++ ) + { + XINPUT_CAPABILITIES capabilities; + DWORD result; + + if ( bOpenedXInputDevices[userId] == SDL_TRUE ) + nCurrentOpenedXInputDevices++; + + result = XINPUTGETCAPABILITIES( userId, XINPUT_FLAG_GAMEPAD, &capabilities ); + if ( result == ERROR_SUCCESS ) + { + bOpenedXInputDevices[userId] = SDL_TRUE; + nNewOpenedXInputDevices++; + } + else + { + bOpenedXInputDevices[userId] = SDL_FALSE; + } + } + } + + if ( s_pKnownJoystickGUIDs && ( s_bWindowsDeviceChanged || nNewOpenedXInputDevices != nCurrentOpenedXInputDevices ) ) + { + SDL_Delay( 300 ); /* wait for direct input to find out about this device */ + + s_bDeviceRemoved = SDL_TRUE; + s_bDeviceAdded = SDL_TRUE; + s_bWindowsDeviceChanged = SDL_FALSE; + } + } + SDL_UnlockMutex( s_mutexJoyStickEnum ); + + if ( hNotify ) + UnregisterDeviceNotification( hNotify ); + + if ( messageWindow ) + DestroyWindow( messageWindow ); + + UnregisterClass( wincl.lpszClassName, wincl.hInstance ); + messageWindow = 0; + WIN_CoUninitialize(); + return 1; +} + + +/* Function to scan the system for joysticks. + * This function should set SDL_numjoysticks to the number of available + * joysticks. Joystick 0 should be the system default joystick. + * It should return 0, or -1 on an unrecoverable fatal error. + */ +int +SDL_SYS_JoystickInit(void) +{ + HRESULT result; + HINSTANCE instance; + const char *env = SDL_GetHint(SDL_HINT_XINPUT_ENABLED); + if (env && !SDL_atoi(env)) { + s_bXInputEnabled = SDL_FALSE; + } + + result = WIN_CoInitialize(); + if (FAILED(result)) { + return SetDIerror("CoInitialize", result); + } + + coinitialized = SDL_TRUE; + + result = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectInput8, (LPVOID)&dinput); + + if (FAILED(result)) { + SDL_SYS_JoystickQuit(); + return SetDIerror("CoCreateInstance", result); + } + + /* Because we used CoCreateInstance, we need to Initialize it, first. */ + instance = GetModuleHandle(NULL); + if (instance == NULL) { + SDL_SYS_JoystickQuit(); + return SDL_SetError("GetModuleHandle() failed with error code %d.", GetLastError()); + } + result = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION); + + if (FAILED(result)) { + SDL_SYS_JoystickQuit(); + return SetDIerror("IDirectInput::Initialize", result); + } + + s_mutexJoyStickEnum = SDL_CreateMutex(); + s_condJoystickThread = SDL_CreateCond(); + s_bDeviceAdded = SDL_TRUE; /* force a scan of the system for joysticks this first time */ + SDL_SYS_JoystickDetect(); + + if ((s_bXInputEnabled) && (WIN_LoadXInputDLL() == -1)) { + s_bXInputEnabled = SDL_FALSE; /* oh well. */ + } + + if ( !s_threadJoystick ) + { + s_bJoystickThreadQuit = SDL_FALSE; + /* spin up the thread to detect hotplug of devices */ +#if defined(__WIN32__) && !defined(HAVE_LIBC) +#undef SDL_CreateThread + s_threadJoystick= SDL_CreateThread( SDL_JoystickThread, "SDL_joystick", NULL, NULL, NULL ); +#else + s_threadJoystick = SDL_CreateThread( SDL_JoystickThread, "SDL_joystick", NULL ); +#endif + } + return SDL_SYS_NumJoysticks(); +} + +/* return the number of joysticks that are connected right now */ +int SDL_SYS_NumJoysticks() +{ + int nJoysticks = 0; + JoyStick_DeviceData *device = SYS_Joystick; + while ( device ) + { + nJoysticks++; + device = device->pNext; + } + + return nJoysticks; +} + +static int s_iNewGUID = 0; + +/* helper function for direct input, gets called for each connected joystick */ +static BOOL CALLBACK + EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) +{ + JoyStick_DeviceData *pNewJoystick; + JoyStick_DeviceData *pPrevJoystick = NULL; + SDL_bool bXInputDevice; + pNewJoystick = *(JoyStick_DeviceData **)pContext; + while ( pNewJoystick ) + { + if ( !SDL_memcmp( &pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance) ) ) + { + /* if we are replacing the front of the list then update it */ + if ( pNewJoystick == *(JoyStick_DeviceData **)pContext ) + { + *(JoyStick_DeviceData **)pContext = pNewJoystick->pNext; + } + else if ( pPrevJoystick ) + { + pPrevJoystick->pNext = pNewJoystick->pNext; + } + + pNewJoystick->pNext = SYS_Joystick; + SYS_Joystick = pNewJoystick; + + s_pKnownJoystickGUIDs[ s_iNewGUID ] = pdidInstance->guidInstance; + s_iNewGUID++; + if ( s_iNewGUID < MAX_JOYSTICKS ) + return DIENUM_CONTINUE; /* already have this joystick loaded, just keep going */ + else + return DIENUM_STOP; + } + + pPrevJoystick = pNewJoystick; + pNewJoystick = pNewJoystick->pNext; + } + + s_bDeviceAdded = SDL_TRUE; + + bXInputDevice = IsXInputDevice( &pdidInstance->guidProduct ); + + pNewJoystick = (JoyStick_DeviceData *)SDL_malloc( sizeof(JoyStick_DeviceData) ); + + if ( bXInputDevice ) + { + pNewJoystick->bXInputDevice = SDL_TRUE; + pNewJoystick->XInputUserId = INVALID_XINPUT_USERID; + } + else + { + pNewJoystick->bXInputDevice = SDL_FALSE; + } + + SDL_memcpy(&(pNewJoystick->dxdevice), pdidInstance, + sizeof(DIDEVICEINSTANCE)); + + pNewJoystick->joystickname = WIN_StringToUTF8(pdidInstance->tszProductName); + pNewJoystick->send_add_event = 1; + pNewJoystick->nInstanceID = ++s_nInstanceID; + SDL_memcpy( &pNewJoystick->guid, &pdidInstance->guidProduct, sizeof(pNewJoystick->guid) ); + pNewJoystick->pNext = NULL; + + if ( SYS_Joystick ) + { + pNewJoystick->pNext = SYS_Joystick; + } + SYS_Joystick = pNewJoystick; + + s_pKnownJoystickGUIDs[ s_iNewGUID ] = pdidInstance->guidInstance; + s_iNewGUID++; + + if ( s_iNewGUID < MAX_JOYSTICKS ) + return DIENUM_CONTINUE; /* already have this joystick loaded, just keep going */ + else + return DIENUM_STOP; +} + +/* detect any new joysticks being inserted into the system */ +void SDL_SYS_JoystickDetect() +{ + JoyStick_DeviceData *pCurList = NULL; + /* only enum the devices if the joystick thread told us something changed */ + if ( s_bDeviceAdded || s_bDeviceRemoved ) + { + s_bDeviceAdded = SDL_FALSE; + s_bDeviceRemoved = SDL_FALSE; + + pCurList = SYS_Joystick; + SYS_Joystick = NULL; + s_iNewGUID = 0; + SDL_LockMutex( s_mutexJoyStickEnum ); + + if ( !s_pKnownJoystickGUIDs ) + s_pKnownJoystickGUIDs = SDL_malloc( sizeof(GUID)*MAX_JOYSTICKS ); + + SDL_memset( s_pKnownJoystickGUIDs, 0x0, sizeof(GUID)*MAX_JOYSTICKS ); + + /* Look for joysticks, wheels, head trackers, gamepads, etc.. */ + IDirectInput8_EnumDevices(dinput, + DI8DEVCLASS_GAMECTRL, + EnumJoysticksCallback, + &pCurList, DIEDFL_ATTACHEDONLY); + + SDL_UnlockMutex( s_mutexJoyStickEnum ); + } + + if ( pCurList ) + { + while ( pCurList ) + { + JoyStick_DeviceData *pListNext = NULL; +#if !SDL_EVENTS_DISABLED + SDL_Event event; + event.type = SDL_JOYDEVICEREMOVED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = pCurList->nInstanceID; + if ((SDL_EventOK == NULL) + || (*SDL_EventOK) (SDL_EventOKParam, &event)) { + SDL_PushEvent(&event); + } + } +#endif /* !SDL_EVENTS_DISABLED */ + + pListNext = pCurList->pNext; + SDL_free(pCurList->joystickname); + SDL_free( pCurList ); + pCurList = pListNext; + } + + } + + if ( s_bDeviceAdded ) + { + JoyStick_DeviceData *pNewJoystick; + int device_index = 0; + s_bDeviceAdded = SDL_FALSE; + pNewJoystick = SYS_Joystick; + while ( pNewJoystick ) + { + if ( pNewJoystick->send_add_event ) + { +#if !SDL_EVENTS_DISABLED + SDL_Event event; + event.type = SDL_JOYDEVICEADDED; + + if (SDL_GetEventState(event.type) == SDL_ENABLE) { + event.jdevice.which = device_index; + if ((SDL_EventOK == NULL) + || (*SDL_EventOK) (SDL_EventOKParam, &event)) { + SDL_PushEvent(&event); + } + } +#endif /* !SDL_EVENTS_DISABLED */ + pNewJoystick->send_add_event = 0; + } + device_index++; + pNewJoystick = pNewJoystick->pNext; + } + } +} + +/* we need to poll if we have pending hotplug device changes or connected devices */ +SDL_bool SDL_SYS_JoystickNeedsPolling() +{ + /* we have a new device or one was pulled, we need to think this frame please */ + if ( s_bDeviceAdded || s_bDeviceRemoved ) + return SDL_TRUE; + + return SDL_FALSE; +} + +/* Function to get the device-dependent name of a joystick */ +const char * +SDL_SYS_JoystickNameForDeviceIndex(int device_index) +{ + JoyStick_DeviceData *device = SYS_Joystick; + + for (; device_index > 0; device_index--) + device = device->pNext; + + return device->joystickname; +} + +/* Function to perform the mapping between current device instance and this joysticks instance id */ +SDL_JoystickID SDL_SYS_GetInstanceIdOfDeviceIndex(int device_index) +{ + JoyStick_DeviceData *device = SYS_Joystick; + int index; + + for (index = device_index; index > 0; index--) + device = device->pNext; + + return device->nInstanceID; +} + +/* Function to open a joystick for use. + The joystick to open is specified by the index field of the joystick. + This should fill the nbuttons and naxes fields of the joystick structure. + It returns 0, or -1 if there is an error. + */ +int +SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index) +{ + HRESULT result; + LPDIRECTINPUTDEVICE8 device; + DIPROPDWORD dipdw; + JoyStick_DeviceData *joystickdevice = SYS_Joystick; + + for (; device_index > 0; device_index--) + joystickdevice = joystickdevice->pNext; + + SDL_memset(&dipdw, 0, sizeof(DIPROPDWORD)); + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + + /* allocate memory for system specific hardware data */ + joystick->instance_id = joystickdevice->nInstanceID; + joystick->closed = 0; + joystick->hwdata = + (struct joystick_hwdata *) SDL_malloc(sizeof(struct joystick_hwdata)); + if (joystick->hwdata == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(joystick->hwdata, 0, sizeof(struct joystick_hwdata)); + joystick->hwdata->buffered = 1; + joystick->hwdata->removed = 0; + joystick->hwdata->Capabilities.dwSize = sizeof(DIDEVCAPS); + joystick->hwdata->guid = joystickdevice->guid; + + if ( joystickdevice->bXInputDevice ) + { + XINPUT_CAPABILITIES capabilities; + Uint8 userId = 0; + DWORD result; + JoyStick_DeviceData *joysticklist = SYS_Joystick; + /* scan the opened joysticks and pick the next free xinput userid for this one */ + for( ; joysticklist; joysticklist = joysticklist->pNext) + { + if ( joysticklist->bXInputDevice && joysticklist->XInputUserId == userId ) + userId++; + } + + if ( s_bXInputEnabled && XINPUTGETCAPABILITIES ) + { + result = XINPUTGETCAPABILITIES( userId, XINPUT_FLAG_GAMEPAD, &capabilities ); + if ( result == ERROR_SUCCESS ) + { + const SDL_bool bIs14OrLater = (SDL_XInputVersion >= ((1<<16)|4)); + SDL_bool bIsSupported = SDL_FALSE; + /* Current version of XInput mistakenly returns 0 as the Type. Ignore it and ensure the subtype is a gamepad. */ + bIsSupported = ( capabilities.SubType == XINPUT_DEVSUBTYPE_GAMEPAD ); + + if ( !bIsSupported ) + { + joystickdevice->bXInputDevice = SDL_FALSE; + } + else + { + /* valid */ + joystick->hwdata->bXInputDevice = SDL_TRUE; + if ((!bIs14OrLater) || (capabilities.Flags & XINPUT_CAPS_FFB_SUPPORTED)) { + joystick->hwdata->bXInputHaptic = SDL_TRUE; + } + SDL_memset( joystick->hwdata->XInputState, 0x0, sizeof(joystick->hwdata->XInputState) ); + joystickdevice->XInputUserId = userId; + joystick->hwdata->userid = userId; + joystick->hwdata->currentXInputSlot = 0; + /* The XInput API has a hard coded button/axis mapping, so we just match it */ + joystick->naxes = 6; + joystick->nbuttons = 15; + joystick->nballs = 0; + joystick->nhats = 0; + } + } + else + { + joystickdevice->bXInputDevice = SDL_FALSE; + } + } + else + { + joystickdevice->bXInputDevice = SDL_FALSE; + } + } + + if ( joystickdevice->bXInputDevice == SDL_FALSE ) + { + joystick->hwdata->bXInputDevice = SDL_FALSE; + + result = + IDirectInput8_CreateDevice(dinput, + &(joystickdevice->dxdevice.guidInstance), &device, NULL); + if (FAILED(result)) { + return SetDIerror("IDirectInput::CreateDevice", result); + } + + /* Now get the IDirectInputDevice8 interface, instead. */ + result = IDirectInputDevice8_QueryInterface(device, + &IID_IDirectInputDevice8, + (LPVOID *) & joystick-> + hwdata->InputDevice); + /* We are done with this object. Use the stored one from now on. */ + IDirectInputDevice8_Release(device); + + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::QueryInterface", result); + } + + /* Acquire shared access. Exclusive access is required for forces, + * though. */ + result = + IDirectInputDevice8_SetCooperativeLevel(joystick->hwdata-> + InputDevice, SDL_HelperWindow, + DISCL_NONEXCLUSIVE | + DISCL_BACKGROUND); + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result); + } + + /* Use the extended data structure: DIJOYSTATE2. */ + result = + IDirectInputDevice8_SetDataFormat(joystick->hwdata->InputDevice, + &c_dfDIJoystick2); + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::SetDataFormat", result); + } + + /* Get device capabilities */ + result = + IDirectInputDevice8_GetCapabilities(joystick->hwdata->InputDevice, + &joystick->hwdata->Capabilities); + + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::GetCapabilities", result); + } + + /* Force capable? */ + if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) { + + result = IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); + + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::Acquire", result); + } + + /* reset all accuators. */ + result = + IDirectInputDevice8_SendForceFeedbackCommand(joystick->hwdata-> + InputDevice, + DISFFC_RESET); + + /* Not necessarily supported, ignore if not supported. + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::SendForceFeedbackCommand", result); + } + */ + + result = IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice); + + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::Unacquire", result); + } + + /* Turn on auto-centering for a ForceFeedback device (until told + * otherwise). */ + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = DIPROPAUTOCENTER_ON; + + result = + IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, + DIPROP_AUTOCENTER, &dipdw.diph); + + /* Not necessarily supported, ignore if not supported. + if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::SetProperty", result); + } + */ + } + + /* What buttons and axes does it have? */ + IDirectInputDevice8_EnumObjects(joystick->hwdata->InputDevice, + EnumDevObjectsCallback, joystick, + DIDFT_BUTTON | DIDFT_AXIS | DIDFT_POV); + + /* Reorder the input objects. Some devices do not report the X axis as + * the first axis, for example. */ + SortDevObjects(joystick); + + dipdw.diph.dwObj = 0; + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.dwData = INPUT_QSIZE; + + /* Set the buffer size */ + result = + IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, + DIPROP_BUFFERSIZE, &dipdw.diph); + + if (result == DI_POLLEDDEVICE) { + /* This device doesn't support buffering, so we're forced + * to use less reliable polling. */ + joystick->hwdata->buffered = 0; + } else if (FAILED(result)) { + return SetDIerror("IDirectInputDevice8::SetProperty", result); + } + } + return (0); +} + +/* return true if this joystick is plugged in right now */ +SDL_bool SDL_SYS_JoystickAttached( SDL_Joystick * joystick ) +{ + return joystick->closed == 0 && joystick->hwdata->removed == 0; +} + + +/* Sort using the data offset into the DInput struct. + * This gives a reasonable ordering for the inputs. */ +static int +SortDevFunc(const void *a, const void *b) +{ + const input_t *inputA = (const input_t*)a; + const input_t *inputB = (const input_t*)b; + + if (inputA->ofs < inputB->ofs) + return -1; + if (inputA->ofs > inputB->ofs) + return 1; + return 0; +} + +/* Sort the input objects and recalculate the indices for each input. */ +static void +SortDevObjects(SDL_Joystick *joystick) +{ + input_t *inputs = joystick->hwdata->Inputs; + int nButtons = 0; + int nHats = 0; + int nAxis = 0; + int n; + + SDL_qsort(inputs, joystick->hwdata->NumInputs, sizeof(input_t), SortDevFunc); + + for (n = 0; n < joystick->hwdata->NumInputs; n++) + { + switch (inputs[n].type) + { + case BUTTON: + inputs[n].num = nButtons; + nButtons++; + break; + + case HAT: + inputs[n].num = nHats; + nHats++; + break; + + case AXIS: + inputs[n].num = nAxis; + nAxis++; + break; + } + } +} + +static BOOL CALLBACK +EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) +{ + SDL_Joystick *joystick = (SDL_Joystick *) pvRef; + HRESULT result; + input_t *in = &joystick->hwdata->Inputs[joystick->hwdata->NumInputs]; + + if (dev->dwType & DIDFT_BUTTON) { + in->type = BUTTON; + in->num = joystick->nbuttons; + in->ofs = DIJOFS_BUTTON( in->num ); + joystick->nbuttons++; + } else if (dev->dwType & DIDFT_POV) { + in->type = HAT; + in->num = joystick->nhats; + in->ofs = DIJOFS_POV( in->num ); + joystick->nhats++; + } else if (dev->dwType & DIDFT_AXIS) { + DIPROPRANGE diprg; + DIPROPDWORD dilong; + + in->type = AXIS; + in->num = joystick->naxes; + /* work our the axis this guy maps too, thanks for the code icculus! */ + if ( !SDL_memcmp( &dev->guidType, &GUID_XAxis, sizeof(dev->guidType) ) ) + in->ofs = DIJOFS_X; + else if ( !SDL_memcmp( &dev->guidType, &GUID_YAxis, sizeof(dev->guidType) ) ) + in->ofs = DIJOFS_Y; + else if ( !SDL_memcmp( &dev->guidType, &GUID_ZAxis, sizeof(dev->guidType) ) ) + in->ofs = DIJOFS_Z; + else if ( !SDL_memcmp( &dev->guidType, &GUID_RxAxis, sizeof(dev->guidType) ) ) + in->ofs = DIJOFS_RX; + else if ( !SDL_memcmp( &dev->guidType, &GUID_RyAxis, sizeof(dev->guidType) ) ) + in->ofs = DIJOFS_RY; + else if ( !SDL_memcmp( &dev->guidType, &GUID_RzAxis, sizeof(dev->guidType) ) ) + in->ofs = DIJOFS_RZ; + else if ( !SDL_memcmp( &dev->guidType, &GUID_Slider, sizeof(dev->guidType) ) ) + { + in->ofs = DIJOFS_SLIDER( joystick->hwdata->NumSliders ); + ++joystick->hwdata->NumSliders; + } + else + { + return DIENUM_CONTINUE; /* not an axis we can grok */ + } + + diprg.diph.dwSize = sizeof(diprg); + diprg.diph.dwHeaderSize = sizeof(diprg.diph); + diprg.diph.dwObj = dev->dwType; + diprg.diph.dwHow = DIPH_BYID; + diprg.lMin = AXIS_MIN; + diprg.lMax = AXIS_MAX; + + result = + IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, + DIPROP_RANGE, &diprg.diph); + if (FAILED(result)) { + return DIENUM_CONTINUE; /* don't use this axis */ + } + + /* Set dead zone to 0. */ + dilong.diph.dwSize = sizeof(dilong); + dilong.diph.dwHeaderSize = sizeof(dilong.diph); + dilong.diph.dwObj = dev->dwType; + dilong.diph.dwHow = DIPH_BYID; + dilong.dwData = 0; + result = + IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, + DIPROP_DEADZONE, &dilong.diph); + if (FAILED(result)) { + return DIENUM_CONTINUE; /* don't use this axis */ + } + + joystick->naxes++; + } else { + /* not supported at this time */ + return DIENUM_CONTINUE; + } + + joystick->hwdata->NumInputs++; + + if (joystick->hwdata->NumInputs == MAX_INPUTS) { + return DIENUM_STOP; /* too many */ + } + + return DIENUM_CONTINUE; +} + +/* Function to update the state of a joystick - called as a device poll. + * This function shouldn't update the joystick structure directly, + * but instead should call SDL_PrivateJoystick*() to deliver events + * and update joystick device state. + */ +void +SDL_SYS_JoystickUpdate_Polled(SDL_Joystick * joystick) +{ + DIJOYSTATE2 state; + HRESULT result; + int i; + + result = + IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice, + sizeof(DIJOYSTATE2), &state); + if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) { + IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); + result = + IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice, + sizeof(DIJOYSTATE2), &state); + } + + if ( result != DI_OK ) + { + joystick->hwdata->send_remove_event = 1; + joystick->hwdata->removed = 1; + return; + } + + /* Set each known axis, button and POV. */ + for (i = 0; i < joystick->hwdata->NumInputs; ++i) { + const input_t *in = &joystick->hwdata->Inputs[i]; + + switch (in->type) { + case AXIS: + switch (in->ofs) { + case DIJOFS_X: + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.lX); + break; + case DIJOFS_Y: + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.lY); + break; + case DIJOFS_Z: + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.lZ); + break; + case DIJOFS_RX: + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.lRx); + break; + case DIJOFS_RY: + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.lRy); + break; + case DIJOFS_RZ: + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.lRz); + break; + case DIJOFS_SLIDER(0): + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.rglSlider[0]); + break; + case DIJOFS_SLIDER(1): + SDL_PrivateJoystickAxis_Int(joystick, in->num, + (Sint16) state.rglSlider[1]); + break; + } + + break; + + case BUTTON: + SDL_PrivateJoystickButton_Int(joystick, in->num, + (Uint8) (state. + rgbButtons[in->ofs - + DIJOFS_BUTTON0] + ? SDL_PRESSED : + SDL_RELEASED)); + break; + case HAT: + { + Uint8 pos = TranslatePOV(state.rgdwPOV[in->ofs - + DIJOFS_POV(0)]); + SDL_PrivateJoystickHat_Int(joystick, in->num, pos); + break; + } + } + } +} + +void +SDL_SYS_JoystickUpdate_Buffered(SDL_Joystick * joystick) +{ + int i; + HRESULT result; + DWORD numevents; + DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE]; + + numevents = INPUT_QSIZE; + result = + IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice, + sizeof(DIDEVICEOBJECTDATA), evtbuf, + &numevents, 0); + if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) { + IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); + result = + IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice, + sizeof(DIDEVICEOBJECTDATA), + evtbuf, &numevents, 0); + } + + /* Handle the events or punt */ + if (FAILED(result)) + { + joystick->hwdata->send_remove_event = 1; + joystick->hwdata->removed = 1; + return; + } + + for (i = 0; i < (int) numevents; ++i) { + int j; + + for (j = 0; j < joystick->hwdata->NumInputs; ++j) { + const input_t *in = &joystick->hwdata->Inputs[j]; + + if (evtbuf[i].dwOfs != in->ofs) + continue; + + switch (in->type) { + case AXIS: + SDL_PrivateJoystickAxis(joystick, in->num, + (Sint16) evtbuf[i].dwData); + break; + case BUTTON: + SDL_PrivateJoystickButton(joystick, in->num, + (Uint8) (evtbuf[i]. + dwData ? SDL_PRESSED : + SDL_RELEASED)); + break; + case HAT: + { + Uint8 pos = TranslatePOV(evtbuf[i].dwData); + SDL_PrivateJoystickHat(joystick, in->num, pos); + } + } + } + } +} + + +/* Function to return > 0 if a bit array of buttons differs after applying a mask +*/ +int ButtonChanged( int ButtonsNow, int ButtonsPrev, int ButtonMask ) +{ + return ( ButtonsNow & ButtonMask ) != ( ButtonsPrev & ButtonMask ); +} + +/* Function to update the state of a XInput style joystick. +*/ +void +SDL_SYS_JoystickUpdate_XInput(SDL_Joystick * joystick) +{ + HRESULT result; + + if ( !XINPUTGETSTATE ) + return; + + result = XINPUTGETSTATE( joystick->hwdata->userid, &joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot] ); + if ( result == ERROR_DEVICE_NOT_CONNECTED ) + { + joystick->hwdata->send_remove_event = 1; + joystick->hwdata->removed = 1; + return; + } + + /* only fire events if the data changed from last time */ + if ( joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot].dwPacketNumber != 0 + && joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot].dwPacketNumber != joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot^1].dwPacketNumber ) + { + XINPUT_STATE_EX *pXInputState = &joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot]; + XINPUT_STATE_EX *pXInputStatePrev = &joystick->hwdata->XInputState[joystick->hwdata->currentXInputSlot ^ 1]; + + SDL_PrivateJoystickAxis( joystick, 0, (Sint16)pXInputState->Gamepad.sThumbLX ); + SDL_PrivateJoystickAxis( joystick, 1, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbLY)) ); + SDL_PrivateJoystickAxis( joystick, 2, (Sint16)pXInputState->Gamepad.sThumbRX ); + SDL_PrivateJoystickAxis( joystick, 3, (Sint16)(-SDL_max(-32767, pXInputState->Gamepad.sThumbRY)) ); + SDL_PrivateJoystickAxis( joystick, 4, (Sint16)(((int)pXInputState->Gamepad.bLeftTrigger*65535/255) - 32768)); + SDL_PrivateJoystickAxis( joystick, 5, (Sint16)(((int)pXInputState->Gamepad.bRightTrigger*65535/255) - 32768)); + + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_UP ) ) + SDL_PrivateJoystickButton(joystick, 0, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_DOWN ) ) + SDL_PrivateJoystickButton(joystick, 1, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_LEFT ) ) + SDL_PrivateJoystickButton(joystick, 2, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_RIGHT ) ) + SDL_PrivateJoystickButton(joystick, 3, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_START ) ) + SDL_PrivateJoystickButton(joystick, 4, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_START ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_BACK ) ) + SDL_PrivateJoystickButton(joystick, 5, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_BACK ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_LEFT_THUMB ) ) + SDL_PrivateJoystickButton(joystick, 6, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_RIGHT_THUMB ) ) + SDL_PrivateJoystickButton(joystick, 7, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_LEFT_SHOULDER ) ) + SDL_PrivateJoystickButton(joystick, 8, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_RIGHT_SHOULDER ) ) + SDL_PrivateJoystickButton(joystick, 9, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_A ) ) + SDL_PrivateJoystickButton(joystick, 10, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_A ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_B ) ) + SDL_PrivateJoystickButton(joystick, 11, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_B ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_X ) ) + SDL_PrivateJoystickButton(joystick, 12, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_X ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_Y ) ) + SDL_PrivateJoystickButton(joystick, 13, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_Y ? SDL_PRESSED : SDL_RELEASED ); + if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, 0x400 ) ) + SDL_PrivateJoystickButton(joystick, 14, pXInputState->Gamepad.wButtons & 0x400 ? SDL_PRESSED : SDL_RELEASED ); /* 0x400 is the undocumented code for the guide button */ + + joystick->hwdata->currentXInputSlot ^= 1; + + } +} + + +static Uint8 +TranslatePOV(DWORD value) +{ + const int HAT_VALS[] = { + SDL_HAT_UP, + SDL_HAT_UP | SDL_HAT_RIGHT, + SDL_HAT_RIGHT, + SDL_HAT_DOWN | SDL_HAT_RIGHT, + SDL_HAT_DOWN, + SDL_HAT_DOWN | SDL_HAT_LEFT, + SDL_HAT_LEFT, + SDL_HAT_UP | SDL_HAT_LEFT + }; + + if (LOWORD(value) == 0xFFFF) + return SDL_HAT_CENTERED; + + /* Round the value up: */ + value += 4500 / 2; + value %= 36000; + value /= 4500; + + if (value >= 8) + return SDL_HAT_CENTERED; /* shouldn't happen */ + + return HAT_VALS[value]; +} + +/* SDL_PrivateJoystick* doesn't discard duplicate events, so we need to + * do it. */ +static int +SDL_PrivateJoystickAxis_Int(SDL_Joystick * joystick, Uint8 axis, Sint16 value) +{ + if (joystick->axes[axis] != value) + return SDL_PrivateJoystickAxis(joystick, axis, value); + return 0; +} + +static int +SDL_PrivateJoystickHat_Int(SDL_Joystick * joystick, Uint8 hat, Uint8 value) +{ + if (joystick->hats[hat] != value) + return SDL_PrivateJoystickHat(joystick, hat, value); + return 0; +} + +static int +SDL_PrivateJoystickButton_Int(SDL_Joystick * joystick, Uint8 button, + Uint8 state) +{ + if (joystick->buttons[button] != state) + return SDL_PrivateJoystickButton(joystick, button, state); + return 0; +} + +void +SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) +{ + HRESULT result; + + if ( joystick->closed || !joystick->hwdata ) + return; + + if (joystick->hwdata->bXInputDevice) + { + SDL_SYS_JoystickUpdate_XInput(joystick); + } + else + { + result = IDirectInputDevice8_Poll(joystick->hwdata->InputDevice); + if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) { + IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); + IDirectInputDevice8_Poll(joystick->hwdata->InputDevice); + } + + if (joystick->hwdata->buffered) + SDL_SYS_JoystickUpdate_Buffered(joystick); + else + SDL_SYS_JoystickUpdate_Polled(joystick); + } + + if ( joystick->hwdata->removed ) + { + joystick->closed = 1; + joystick->uncentered = 1; + } +} + +/* Function to close a joystick after use */ +void +SDL_SYS_JoystickClose(SDL_Joystick * joystick) +{ + if ( joystick->hwdata->bXInputDevice ) + { + JoyStick_DeviceData *joysticklist = SYS_Joystick; + /* scan the opened joysticks and clear the userid for this instance */ + for( ; joysticklist; joysticklist = joysticklist->pNext) + { + if ( joysticklist->bXInputDevice && joysticklist->nInstanceID == joystick->instance_id ) + { + joysticklist->XInputUserId = INVALID_XINPUT_USERID; + } + } + + } + else + { + IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice); + IDirectInputDevice8_Release(joystick->hwdata->InputDevice); + } + + if (joystick->hwdata != NULL) { + /* free system specific hardware data */ + SDL_free(joystick->hwdata); + } + + joystick->closed = 1; +} + +/* Function to perform any system-specific joystick related cleanup */ +void +SDL_SYS_JoystickQuit(void) +{ + JoyStick_DeviceData *device = SYS_Joystick; + + while ( device ) + { + JoyStick_DeviceData *device_next = device->pNext; + SDL_free(device->joystickname); + SDL_free(device); + device = device_next; + } + SYS_Joystick = NULL; + + if ( s_threadJoystick ) + { + SDL_LockMutex( s_mutexJoyStickEnum ); + s_bJoystickThreadQuit = SDL_TRUE; + SDL_CondBroadcast( s_condJoystickThread ); /* signal the joystick thread to quit */ + SDL_UnlockMutex( s_mutexJoyStickEnum ); + SDL_WaitThread( s_threadJoystick, NULL ); /* wait for it to bugger off */ + + SDL_DestroyMutex( s_mutexJoyStickEnum ); + SDL_DestroyCond( s_condJoystickThread ); + s_condJoystickThread= NULL; + s_mutexJoyStickEnum = NULL; + s_threadJoystick = NULL; + } + + if (dinput != NULL) { + IDirectInput8_Release(dinput); + dinput = NULL; + } + + if (coinitialized) { + WIN_CoUninitialize(); + coinitialized = SDL_FALSE; + } + + if ( s_pKnownJoystickGUIDs ) + { + SDL_free( s_pKnownJoystickGUIDs ); + s_pKnownJoystickGUIDs = NULL; + } + + if (s_bXInputEnabled) { + WIN_UnloadXInputDLL(); + } +} + + +/* return the stable device guid for this device index */ +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) +{ + JoyStick_DeviceData *device = SYS_Joystick; + int index; + + for (index = device_index; index > 0; index--) + device = device->pNext; + + return device->guid; +} + +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) +{ + return joystick->hwdata->guid; +} + +/* return SDL_TRUE if this device is using XInput */ +SDL_bool SDL_SYS_IsXInputDeviceIndex(int device_index) +{ + JoyStick_DeviceData *device = SYS_Joystick; + int index; + + for (index = device_index; index > 0; index--) + device = device->pNext; + + return device->bXInputDevice; +} + +#endif /* SDL_JOYSTICK_DINPUT */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/windows/SDL_dxjoystick_c.h b/src/joystick/windows/SDL_dxjoystick_c.h new file mode 100644 index 0000000000..01cfca9705 --- /dev/null +++ b/src/joystick/windows/SDL_dxjoystick_c.h @@ -0,0 +1,144 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_JOYSTICK_DINPUT_H + +/* DirectInput joystick driver; written by Glenn Maynard, based on Andrei de + * A. Formiga's WINMM driver. + * + * Hats and sliders are completely untested; the app I'm writing this for mostly + * doesn't use them and I don't own any joysticks with them. + * + * We don't bother to use event notification here. It doesn't seem to work + * with polled devices, and it's fine to call IDirectInputDevice2_GetDeviceData and + * let it return 0 events. */ + +#include "../../core/windows/SDL_windows.h" + +#define DIRECTINPUT_VERSION 0x0800 /* Need version 7 for force feedback. Need version 8 so IDirectInput8_EnumDevices doesn't leak like a sieve... */ +#include +#define COBJMACROS +#include +#include +#include +#include +#include +#include + +/* typedef's for XInput structs we use */ +typedef struct +{ + WORD wButtons; + BYTE bLeftTrigger; + BYTE bRightTrigger; + SHORT sThumbLX; + SHORT sThumbLY; + SHORT sThumbRX; + SHORT sThumbRY; + DWORD dwPaddingReserved; +} XINPUT_GAMEPAD_EX; + +typedef struct +{ + DWORD dwPacketNumber; + XINPUT_GAMEPAD_EX Gamepad; +} XINPUT_STATE_EX; + +/* Forward decl's for XInput API's we load dynamically and use if available */ +typedef DWORD (WINAPI *XInputGetState_t) + ( + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + XINPUT_STATE_EX* pState /* [out] Receives the current state */ + ); + +typedef DWORD (WINAPI *XInputSetState_t) + ( + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + XINPUT_VIBRATION* pVibration /* [in, out] The vibration information to send to the controller */ + ); + +typedef DWORD (WINAPI *XInputGetCapabilities_t) + ( + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + DWORD dwFlags, /* [in] Input flags that identify the device type */ + XINPUT_CAPABILITIES* pCapabilities /* [out] Receives the capabilities */ + ); + +extern int WIN_LoadXInputDLL(void); +extern void WIN_UnloadXInputDLL(void); + +extern XInputGetState_t SDL_XInputGetState; +extern XInputSetState_t SDL_XInputSetState; +extern XInputGetCapabilities_t SDL_XInputGetCapabilities; +extern DWORD SDL_XInputVersion; /* ((major << 16) & 0xFF00) | (minor & 0xFF) */ + +#define XINPUTGETSTATE SDL_XInputGetState +#define XINPUTSETSTATE SDL_XInputSetState +#define XINPUTGETCAPABILITIES SDL_XInputGetCapabilities +#define INVALID_XINPUT_USERID 255 +#define SDL_XINPUT_MAX_DEVICES 4 + +#ifndef XINPUT_CAPS_FFB_SUPPORTED +#define XINPUT_CAPS_FFB_SUPPORTED 0x0001 +#endif + + +#define MAX_INPUTS 256 /* each joystick can have up to 256 inputs */ + + +/* local types */ +typedef enum Type +{ BUTTON, AXIS, HAT } Type; + +typedef struct input_t +{ + /* DirectInput offset for this input type: */ + DWORD ofs; + + /* Button, axis or hat: */ + Type type; + + /* SDL input offset: */ + Uint8 num; +} input_t; + +/* The private structure used to keep track of a joystick */ +struct joystick_hwdata +{ + LPDIRECTINPUTDEVICE8 InputDevice; + DIDEVCAPS Capabilities; + int buffered; + SDL_JoystickGUID guid; + + input_t Inputs[MAX_INPUTS]; + int NumInputs; + int NumSliders; + Uint8 removed; + Uint8 send_remove_event; + Uint8 bXInputDevice; /* 1 if this device supports using the xinput API rather than DirectInput */ + Uint8 bXInputHaptic; /* Supports force feedback via XInput. */ + Uint8 userid; /* XInput userid index for this joystick */ + Uint8 currentXInputSlot; /* the current position to write to in XInputState below, used so we can compare old and new values */ + XINPUT_STATE_EX XInputState[2]; +}; + +#endif /* SDL_JOYSTICK_DINPUT_H */ diff --git a/src/joystick/windows/SDL_mmjoystick.c b/src/joystick/windows/SDL_mmjoystick.c new file mode 100644 index 0000000000..413053f14d --- /dev/null +++ b/src/joystick/windows/SDL_mmjoystick.c @@ -0,0 +1,474 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef SDL_JOYSTICK_WINMM + +/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */ + +#include "../../core/windows/SDL_windows.h" +#include +#include + +#include "SDL_events.h" +#include "SDL_joystick.h" +#include "../SDL_sysjoystick.h" +#include "../SDL_joystick_c.h" + +#define MAX_JOYSTICKS 16 +#define MAX_AXES 6 /* each joystick can have up to 6 axes */ +#define MAX_BUTTONS 32 /* and 32 buttons */ +#define AXIS_MIN -32768 /* minimum value for axis coordinate */ +#define AXIS_MAX 32767 /* maximum value for axis coordinate */ +/* limit axis to 256 possible positions to filter out noise */ +#define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/256) +#define JOY_BUTTON_FLAG(n) (1<instance_id = device_index; + joystick->hwdata = + (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata)); + if (joystick->hwdata == NULL) { + return SDL_OutOfMemory(); + } + SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata)); + + /* set hardware data */ + joystick->hwdata->id = SYS_JoystickID[index]; + for (i = 0; i < MAX_AXES; ++i) { + if ((i < 2) || (SYS_Joystick[index].wCaps & caps_flags[i - 2])) { + joystick->hwdata->transaxis[i].offset = AXIS_MIN - axis_min[i]; + joystick->hwdata->transaxis[i].scale = + (float) (AXIS_MAX - AXIS_MIN) / (axis_max[i] - axis_min[i]); + } else { + joystick->hwdata->transaxis[i].offset = 0; + joystick->hwdata->transaxis[i].scale = 1.0; /* Just in case */ + } + } + + /* fill nbuttons, naxes, and nhats fields */ + joystick->nbuttons = SYS_Joystick[index].wNumButtons; + joystick->naxes = SYS_Joystick[index].wNumAxes; + if (SYS_Joystick[index].wCaps & JOYCAPS_HASPOV) { + joystick->nhats = 1; + } else { + joystick->nhats = 0; + } + return (0); +} + +/* Function to determine is this joystick is attached to the system right now */ +SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick) +{ + return SDL_TRUE; +} + +static Uint8 +TranslatePOV(DWORD value) +{ + Uint8 pos; + + pos = SDL_HAT_CENTERED; + if (value != JOY_POVCENTERED) { + if ((value > JOY_POVLEFT) || (value < JOY_POVRIGHT)) { + pos |= SDL_HAT_UP; + } + if ((value > JOY_POVFORWARD) && (value < JOY_POVBACKWARD)) { + pos |= SDL_HAT_RIGHT; + } + if ((value > JOY_POVRIGHT) && (value < JOY_POVLEFT)) { + pos |= SDL_HAT_DOWN; + } + if (value > JOY_POVBACKWARD) { + pos |= SDL_HAT_LEFT; + } + } + return (pos); +} + +/* Function to update the state of a joystick - called as a device poll. + * This function shouldn't update the joystick structure directly, + * but instead should call SDL_PrivateJoystick*() to deliver events + * and update joystick device state. + */ +void +SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) +{ + MMRESULT result; + int i; + DWORD flags[MAX_AXES] = { JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ, + JOY_RETURNR, JOY_RETURNU, JOY_RETURNV + }; + DWORD pos[MAX_AXES]; + struct _transaxis *transaxis; + int value, change; + JOYINFOEX joyinfo; + + joyinfo.dwSize = sizeof(joyinfo); + joyinfo.dwFlags = JOY_RETURNALL | JOY_RETURNPOVCTS; + if (!joystick->hats) { + joyinfo.dwFlags &= ~(JOY_RETURNPOV | JOY_RETURNPOVCTS); + } + result = joyGetPosEx(joystick->hwdata->id, &joyinfo); + if (result != JOYERR_NOERROR) { + SetMMerror("joyGetPosEx", result); + return; + } + + /* joystick motion events */ + pos[0] = joyinfo.dwXpos; + pos[1] = joyinfo.dwYpos; + pos[2] = joyinfo.dwZpos; + pos[3] = joyinfo.dwRpos; + pos[4] = joyinfo.dwUpos; + pos[5] = joyinfo.dwVpos; + + transaxis = joystick->hwdata->transaxis; + for (i = 0; i < joystick->naxes; i++) { + if (joyinfo.dwFlags & flags[i]) { + value = + (int) (((float) pos[i] + + transaxis[i].offset) * transaxis[i].scale); + change = (value - joystick->axes[i]); + if ((change < -JOY_AXIS_THRESHOLD) + || (change > JOY_AXIS_THRESHOLD)) { + SDL_PrivateJoystickAxis(joystick, (Uint8) i, (Sint16) value); + } + } + } + + /* joystick button events */ + if (joyinfo.dwFlags & JOY_RETURNBUTTONS) { + for (i = 0; i < joystick->nbuttons; ++i) { + if (joyinfo.dwButtons & JOY_BUTTON_FLAG(i)) { + if (!joystick->buttons[i]) { + SDL_PrivateJoystickButton(joystick, (Uint8) i, + SDL_PRESSED); + } + } else { + if (joystick->buttons[i]) { + SDL_PrivateJoystickButton(joystick, (Uint8) i, + SDL_RELEASED); + } + } + } + } + + /* joystick hat events */ + if (joyinfo.dwFlags & JOY_RETURNPOV) { + Uint8 pos; + + pos = TranslatePOV(joyinfo.dwPOV); + if (pos != joystick->hats[0]) { + SDL_PrivateJoystickHat(joystick, 0, pos); + } + } +} + +/* Function to close a joystick after use */ +void +SDL_SYS_JoystickClose(SDL_Joystick * joystick) +{ + if (joystick->hwdata != NULL) { + /* free system specific hardware data */ + SDL_free(joystick->hwdata); + joystick->hwdata = NULL; + } +} + +/* Function to perform any system-specific joystick related cleanup */ +void +SDL_SYS_JoystickQuit(void) +{ + int i; + for (i = 0; i < MAX_JOYSTICKS; i++) { + if (SYS_JoystickName[i] != NULL) { + SDL_free(SYS_JoystickName[i]); + SYS_JoystickName[i] = NULL; + } + } +} + +SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index ) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index ); + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + +SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) +{ + SDL_JoystickGUID guid; + /* the GUID is just the first 16 chars of the name for now */ + const char *name = joystick->name; + SDL_zero( guid ); + SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) ); + return guid; +} + + +/* implementation functions */ +void +SetMMerror(char *function, int code) +{ + static char *error; + static char errbuf[1024]; + + errbuf[0] = 0; + switch (code) { + case MMSYSERR_NODRIVER: + error = "Joystick driver not present"; + break; + + case MMSYSERR_INVALPARAM: + case JOYERR_PARMS: + error = "Invalid parameter(s)"; + break; + + case MMSYSERR_BADDEVICEID: + error = "Bad device ID"; + break; + + case JOYERR_UNPLUGGED: + error = "Joystick not attached"; + break; + + case JOYERR_NOCANDO: + error = "Can't capture joystick input"; + break; + + default: + SDL_snprintf(errbuf, SDL_arraysize(errbuf), + "%s: Unknown Multimedia system error: 0x%x", + function, code); + break; + } + + if (!errbuf[0]) { + SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, + error); + } + SDL_SetError("%s", errbuf); +} + +#endif /* SDL_JOYSTICK_WINMM */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/libm/e_atan2.c b/src/libm/e_atan2.c new file mode 100644 index 0000000000..3f1ee57714 --- /dev/null +++ b/src/libm/e_atan2.c @@ -0,0 +1,116 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* __ieee754_atan2(y,x) + * Method : + * 1. Reduce y to positive by atan2(y,x)=-atan2(-y,x). + * 2. Reduce x to positive by (if x and y are unexceptional): + * ARG (x+iy) = arctan(y/x) ... if x > 0, + * ARG (x+iy) = pi - arctan[y/(-x)] ... if x < 0, + * + * Special cases: + * + * ATAN2((anything), NaN ) is NaN; + * ATAN2(NAN , (anything) ) is NaN; + * ATAN2(+-0, +(anything but NaN)) is +-0 ; + * ATAN2(+-0, -(anything but NaN)) is +-pi ; + * ATAN2(+-(anything but 0 and NaN), 0) is +-pi/2; + * ATAN2(+-(anything but INF and NaN), +INF) is +-0 ; + * ATAN2(+-(anything but INF and NaN), -INF) is +-pi; + * ATAN2(+-INF,+INF ) is +-pi/4 ; + * ATAN2(+-INF,-INF ) is +-3pi/4; + * ATAN2(+-INF, (anything but,0,NaN, and INF)) is +-pi/2; + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "math_libm.h" +#include "math_private.h" + +static const double +tiny = 1.0e-300, +zero = 0.0, +pi_o_4 = 7.8539816339744827900E-01, /* 0x3FE921FB, 0x54442D18 */ +pi_o_2 = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */ +pi = 3.1415926535897931160E+00, /* 0x400921FB, 0x54442D18 */ +pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ + +double attribute_hidden __ieee754_atan2(double y, double x) +{ + double z; + int32_t k,m,hx,hy,ix,iy; + u_int32_t lx,ly; + + EXTRACT_WORDS(hx,lx,x); + ix = hx&0x7fffffff; + EXTRACT_WORDS(hy,ly,y); + iy = hy&0x7fffffff; + if(((ix|((lx|-(int32_t)lx)>>31))>0x7ff00000)|| + ((iy|((ly|-(int32_t)ly)>>31))>0x7ff00000)) /* x or y is NaN */ + return x+y; + if(((hx-0x3ff00000)|lx)==0) return atan(y); /* x=1.0 */ + m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ + + /* when y = 0 */ + if((iy|ly)==0) { + switch(m) { + case 0: + case 1: return y; /* atan(+-0,+anything)=+-0 */ + case 2: return pi+tiny;/* atan(+0,-anything) = pi */ + case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ + } + } + /* when x = 0 */ + if((ix|lx)==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* when x is INF */ + if(ix==0x7ff00000) { + if(iy==0x7ff00000) { + switch(m) { + case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ + case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ + case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/ + case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ + } + } else { + switch(m) { + case 0: return zero ; /* atan(+...,+INF) */ + case 1: return -zero ; /* atan(-...,+INF) */ + case 2: return pi+tiny ; /* atan(+...,-INF) */ + case 3: return -pi-tiny ; /* atan(-...,-INF) */ + } + } + } + /* when y is INF */ + if(iy==0x7ff00000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + + /* compute y/x */ + k = (iy-ix)>>20; + if(k > 60) z=pi_o_2+0.5*pi_lo; /* |y/x| > 2**60 */ + else if(hx<0&&k<-60) z=0.0; /* |y|/x < -2**60 */ + else z=atan(fabs(y/x)); /* safe to do y/x */ + switch (m) { + case 0: return z ; /* atan(+,+) */ + case 1: { + u_int32_t zh; + GET_HIGH_WORD(zh,z); + SET_HIGH_WORD(z,zh ^ 0x80000000); + } + return z ; /* atan(-,+) */ + case 2: return pi-(z-pi_lo);/* atan(+,-) */ + default: /* case 3 */ + return (z-pi_lo)-pi;/* atan(-,-) */ + } +} diff --git a/src/libm/e_log.c b/src/libm/e_log.c new file mode 100644 index 0000000000..da64138cd1 --- /dev/null +++ b/src/libm/e_log.c @@ -0,0 +1,167 @@ +/* @(#)e_log.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: e_log.c,v 1.8 1995/05/10 20:45:49 jtc Exp $"; +#endif + +/* __ieee754_log(x) + * Return the logrithm of x + * + * Method : + * 1. Argument Reduction: find k and f such that + * x = 2^k * (1+f), + * where sqrt(2)/2 < 1+f < sqrt(2) . + * + * 2. Approximation of log(1+f). + * Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) + * = 2s + 2/3 s**3 + 2/5 s**5 + ....., + * = 2s + s*R + * We use a special Reme algorithm on [0,0.1716] to generate + * a polynomial of degree 14 to approximate R The maximum error + * of this polynomial approximation is bounded by 2**-58.45. In + * other words, + * 2 4 6 8 10 12 14 + * R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s +Lg6*s +Lg7*s + * (the values of Lg1 to Lg7 are listed in the program) + * and + * | 2 14 | -58.45 + * | Lg1*s +...+Lg7*s - R(z) | <= 2 + * | | + * Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2. + * In order to guarantee error in log below 1ulp, we compute log + * by + * log(1+f) = f - s*(f - R) (if f is not too large) + * log(1+f) = f - (hfsq - s*(hfsq+R)). (better accuracy) + * + * 3. Finally, log(x) = k*ln2 + log(1+f). + * = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo))) + * Here ln2 is split into two floating point number: + * ln2_hi + ln2_lo, + * where n*ln2_hi is always exact for |n| < 2000. + * + * Special cases: + * log(x) is NaN with signal if x < 0 (including -INF) ; + * log(+INF) is +INF; log(0) is -INF with signal; + * log(NaN) is that NaN with no signal. + * + * Accuracy: + * according to an error analysis, the error is always less than + * 1 ulp (unit in the last place). + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "math_libm.h" +#include "math_private.h" + +#ifdef __STDC__ +static const double +#else +static double +#endif + ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */ + ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */ + two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */ + Lg1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */ + Lg2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */ + Lg3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */ + Lg4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */ + Lg5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */ + Lg6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */ + Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ + +#ifdef __STDC__ +static const double zero = 0.0; +#else +static double zero = 0.0; +#endif + +#ifdef __STDC__ +double attribute_hidden +__ieee754_log(double x) +#else +double attribute_hidden +__ieee754_log(x) + double x; +#endif +{ + double hfsq, f, s, z, R, w, t1, t2, dk; + int32_t k, hx, i, j; + u_int32_t lx; + + EXTRACT_WORDS(hx, lx, x); + + k = 0; + if (hx < 0x00100000) { /* x < 2**-1022 */ + if (((hx & 0x7fffffff) | lx) == 0) + return -two54 / zero; /* log(+-0)=-inf */ + if (hx < 0) + return (x - x) / zero; /* log(-#) = NaN */ + k -= 54; + x *= two54; /* subnormal number, scale up x */ + GET_HIGH_WORD(hx, x); + } + if (hx >= 0x7ff00000) + return x + x; + k += (hx >> 20) - 1023; + hx &= 0x000fffff; + i = (hx + 0x95f64) & 0x100000; + SET_HIGH_WORD(x, hx | (i ^ 0x3ff00000)); /* normalize x or x/2 */ + k += (i >> 20); + f = x - 1.0; + if ((0x000fffff & (2 + hx)) < 3) { /* |f| < 2**-20 */ + if (f == zero) { + if (k == 0) + return zero; + else { + dk = (double) k; + return dk * ln2_hi + dk * ln2_lo; + } + } + R = f * f * (0.5 - 0.33333333333333333 * f); + if (k == 0) + return f - R; + else { + dk = (double) k; + return dk * ln2_hi - ((R - dk * ln2_lo) - f); + } + } + s = f / (2.0 + f); + dk = (double) k; + z = s * s; + i = hx - 0x6147a; + w = z * z; + j = 0x6b851 - hx; + t1 = w * (Lg2 + w * (Lg4 + w * Lg6)); + t2 = z * (Lg1 + w * (Lg3 + w * (Lg5 + w * Lg7))); + i |= j; + R = t2 + t1; + if (i > 0) { + hfsq = 0.5 * f * f; + if (k == 0) + return f - (hfsq - s * (hfsq + R)); + else + return dk * ln2_hi - ((hfsq - (s * (hfsq + R) + dk * ln2_lo)) - + f); + } else { + if (k == 0) + return f - s * (f - R); + else + return dk * ln2_hi - ((s * (f - R) - dk * ln2_lo) - f); + } +} diff --git a/src/libm/e_pow.c b/src/libm/e_pow.c new file mode 100644 index 0000000000..9145c4b576 --- /dev/null +++ b/src/libm/e_pow.c @@ -0,0 +1,342 @@ +/* @(#)e_pow.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: e_pow.c,v 1.9 1995/05/12 04:57:32 jtc Exp $"; +#endif + +/* __ieee754_pow(x,y) return x**y + * + * n + * Method: Let x = 2 * (1+f) + * 1. Compute and return log2(x) in two pieces: + * log2(x) = w1 + w2, + * where w1 has 53-24 = 29 bit trailing zeros. + * 2. Perform y*log2(x) = n+y' by simulating muti-precision + * arithmetic, where |y'|<=0.5. + * 3. Return x**y = 2**n*exp(y'*log2) + * + * Special cases: + * 1. (anything) ** 0 is 1 + * 2. (anything) ** 1 is itself + * 3. (anything) ** NAN is NAN + * 4. NAN ** (anything except 0) is NAN + * 5. +-(|x| > 1) ** +INF is +INF + * 6. +-(|x| > 1) ** -INF is +0 + * 7. +-(|x| < 1) ** +INF is +0 + * 8. +-(|x| < 1) ** -INF is +INF + * 9. +-1 ** +-INF is NAN + * 10. +0 ** (+anything except 0, NAN) is +0 + * 11. -0 ** (+anything except 0, NAN, odd integer) is +0 + * 12. +0 ** (-anything except 0, NAN) is +INF + * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF + * 14. -0 ** (odd integer) = -( +0 ** (odd integer) ) + * 15. +INF ** (+anything except 0,NAN) is +INF + * 16. +INF ** (-anything except 0,NAN) is +0 + * 17. -INF ** (anything) = -0 ** (-anything) + * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer) + * 19. (-anything except 0 and inf) ** (non-integer) is NAN + * + * Accuracy: + * pow(x,y) returns x**y nearly rounded. In particular + * pow(integer,integer) + * always returns the correct integer provided it is + * representable. + * + * Constants : + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(scalbn) + libm_hidden_proto(fabs) +#ifdef __STDC__ + static const double +#else + static double +#endif + bp[] = { 1.0, 1.5, }, dp_h[] = { + 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */ + + dp_l[] = { + 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */ + + zero = 0.0, one = 1.0, two = 2.0, two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */ + huge_val = 1.0e300, tiny = 1.0e-300, + /* poly coefs for (3/2)*(log(x)-2s-2/3*s**3 */ + L1 = 5.99999999999994648725e-01, /* 0x3FE33333, 0x33333303 */ + L2 = 4.28571428578550184252e-01, /* 0x3FDB6DB6, 0xDB6FABFF */ + L3 = 3.33333329818377432918e-01, /* 0x3FD55555, 0x518F264D */ + L4 = 2.72728123808534006489e-01, /* 0x3FD17460, 0xA91D4101 */ + L5 = 2.30660745775561754067e-01, /* 0x3FCD864A, 0x93C9DB65 */ + L6 = 2.06975017800338417784e-01, /* 0x3FCA7E28, 0x4A454EEF */ + P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */ + P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */ + P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */ + P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */ + P5 = 4.13813679705723846039e-08, /* 0x3E663769, 0x72BEA4D0 */ + lg2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */ + lg2_h = 6.93147182464599609375e-01, /* 0x3FE62E43, 0x00000000 */ + lg2_l = -1.90465429995776804525e-09, /* 0xBE205C61, 0x0CA86C39 */ + ovt = 8.0085662595372944372e-0017, /* -(1024-log2(ovfl+.5ulp)) */ + cp = 9.61796693925975554329e-01, /* 0x3FEEC709, 0xDC3A03FD =2/(3ln2) */ + cp_h = 9.61796700954437255859e-01, /* 0x3FEEC709, 0xE0000000 =(float)cp */ + cp_l = -7.02846165095275826516e-09, /* 0xBE3E2FE0, 0x145B01F5 =tail of cp_h */ + ivln2 = 1.44269504088896338700e+00, /* 0x3FF71547, 0x652B82FE =1/ln2 */ + ivln2_h = 1.44269502162933349609e+00, /* 0x3FF71547, 0x60000000 =24b 1/ln2 */ + ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail */ + +#ifdef __STDC__ + double attribute_hidden __ieee754_pow(double x, double y) +#else + double attribute_hidden __ieee754_pow(x, y) + double x, y; +#endif + { + double z, ax, z_h, z_l, p_h, p_l; + double y1, t1, t2, r, s, t, u, v, w; + int32_t i, j, k, yisint, n; + int32_t hx, hy, ix, iy; + u_int32_t lx, ly; + + EXTRACT_WORDS(hx, lx, x); + EXTRACT_WORDS(hy, ly, y); + ix = hx & 0x7fffffff; + iy = hy & 0x7fffffff; + + /* y==zero: x**0 = 1 */ + if ((iy | ly) == 0) + return one; + + /* +-NaN return x+y */ + if (ix > 0x7ff00000 || ((ix == 0x7ff00000) && (lx != 0)) || + iy > 0x7ff00000 || ((iy == 0x7ff00000) && (ly != 0))) + return x + y; + + /* determine if y is an odd int when x < 0 + * yisint = 0 ... y is not an integer + * yisint = 1 ... y is an odd int + * yisint = 2 ... y is an even int + */ + yisint = 0; + if (hx < 0) { + if (iy >= 0x43400000) + yisint = 2; /* even integer y */ + else if (iy >= 0x3ff00000) { + k = (iy >> 20) - 0x3ff; /* exponent */ + if (k > 20) { + j = ly >> (52 - k); + if ((j << (52 - k)) == ly) + yisint = 2 - (j & 1); + } else if (ly == 0) { + j = iy >> (20 - k); + if ((j << (20 - k)) == iy) + yisint = 2 - (j & 1); + } + } + } + + /* special value of y */ + if (ly == 0) { + if (iy == 0x7ff00000) { /* y is +-inf */ + if (((ix - 0x3ff00000) | lx) == 0) + return y - y; /* inf**+-1 is NaN */ + else if (ix >= 0x3ff00000) /* (|x|>1)**+-inf = inf,0 */ + return (hy >= 0) ? y : zero; + else /* (|x|<1)**-,+inf = inf,0 */ + return (hy < 0) ? -y : zero; + } + if (iy == 0x3ff00000) { /* y is +-1 */ + if (hy < 0) + return one / x; + else + return x; + } + if (hy == 0x40000000) + return x * x; /* y is 2 */ + if (hy == 0x3fe00000) { /* y is 0.5 */ + if (hx >= 0) /* x >= +0 */ + return __ieee754_sqrt(x); + } + } + + ax = fabs(x); + /* special value of x */ + if (lx == 0) { + if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000) { + z = ax; /*x is +-0,+-inf,+-1 */ + if (hy < 0) + z = one / z; /* z = (1/|x|) */ + if (hx < 0) { + if (((ix - 0x3ff00000) | yisint) == 0) { + z = (z - z) / (z - z); /* (-1)**non-int is NaN */ + } else if (yisint == 1) + z = -z; /* (x<0)**odd = -(|x|**odd) */ + } + return z; + } + } + + /* (x<0)**(non-int) is NaN */ + if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0) + return (x - x) / (x - x); + + /* |y| is huge */ + if (iy > 0x41e00000) { /* if |y| > 2**31 */ + if (iy > 0x43f00000) { /* if |y| > 2**64, must o/uflow */ + if (ix <= 0x3fefffff) + return (hy < 0) ? huge_val * huge_val : tiny * tiny; + if (ix >= 0x3ff00000) + return (hy > 0) ? huge_val * huge_val : tiny * tiny; + } + /* over/underflow if x is not close to one */ + if (ix < 0x3fefffff) + return (hy < 0) ? huge_val * huge_val : tiny * tiny; + if (ix > 0x3ff00000) + return (hy > 0) ? huge_val * huge_val : tiny * tiny; + /* now |1-x| is tiny <= 2**-20, suffice to compute + log(x) by x-x^2/2+x^3/3-x^4/4 */ + t = x - 1; /* t has 20 trailing zeros */ + w = (t * t) * (0.5 - t * (0.3333333333333333333333 - t * 0.25)); + u = ivln2_h * t; /* ivln2_h has 21 sig. bits */ + v = t * ivln2_l - w * ivln2; + t1 = u + v; + SET_LOW_WORD(t1, 0); + t2 = v - (t1 - u); + } else { + double s2, s_h, s_l, t_h, t_l; + n = 0; + /* take care subnormal number */ + if (ix < 0x00100000) { + ax *= two53; + n -= 53; + GET_HIGH_WORD(ix, ax); + } + n += ((ix) >> 20) - 0x3ff; + j = ix & 0x000fffff; + /* determine interval */ + ix = j | 0x3ff00000; /* normalize ix */ + if (j <= 0x3988E) + k = 0; /* |x|> 1) | 0x20000000) + 0x00080000 + (k << 18)); + t_l = ax - (t_h - bp[k]); + s_l = v * ((u - s_h * t_h) - s_h * t_l); + /* compute log(ax) */ + s2 = s * s; + r = s2 * s2 * (L1 + + s2 * (L2 + + s2 * (L3 + + s2 * (L4 + s2 * (L5 + s2 * L6))))); + r += s_l * (s_h + s); + s2 = s_h * s_h; + t_h = 3.0 + s2 + r; + SET_LOW_WORD(t_h, 0); + t_l = r - ((t_h - 3.0) - s2); + /* u+v = s*(1+...) */ + u = s_h * t_h; + v = s_l * t_h + t_l * s; + /* 2/(3log2)*(s+...) */ + p_h = u + v; + SET_LOW_WORD(p_h, 0); + p_l = v - (p_h - u); + z_h = cp_h * p_h; /* cp_h+cp_l = 2/(3*log2) */ + z_l = cp_l * p_h + p_l * cp + dp_l[k]; + /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */ + t = (double) n; + t1 = (((z_h + z_l) + dp_h[k]) + t); + SET_LOW_WORD(t1, 0); + t2 = z_l - (((t1 - t) - dp_h[k]) - z_h); + } + + s = one; /* s (sign of result -ve**odd) = -1 else = 1 */ + if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0) + s = -one; /* (-ve)**(odd int) */ + + /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */ + y1 = y; + SET_LOW_WORD(y1, 0); + p_l = (y - y1) * t1 + y * t2; + p_h = y1 * t1; + z = p_l + p_h; + EXTRACT_WORDS(j, i, z); + if (j >= 0x40900000) { /* z >= 1024 */ + if (((j - 0x40900000) | i) != 0) /* if z > 1024 */ + return s * huge_val * huge_val; /* overflow */ + else { + if (p_l + ovt > z - p_h) + return s * huge_val * huge_val; /* overflow */ + } + } else if ((j & 0x7fffffff) >= 0x4090cc00) { /* z <= -1075 */ + if (((j - 0xc090cc00) | i) != 0) /* z < -1075 */ + return s * tiny * tiny; /* underflow */ + else { + if (p_l <= z - p_h) + return s * tiny * tiny; /* underflow */ + } + } + /* + * compute 2**(p_h+p_l) + */ + i = j & 0x7fffffff; + k = (i >> 20) - 0x3ff; + n = 0; + if (i > 0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */ + n = j + (0x00100000 >> (k + 1)); + k = ((n & 0x7fffffff) >> 20) - 0x3ff; /* new k for n */ + t = zero; + SET_HIGH_WORD(t, n & ~(0x000fffff >> k)); + n = ((n & 0x000fffff) | 0x00100000) >> (20 - k); + if (j < 0) + n = -n; + p_h -= t; + } + t = p_l + p_h; + SET_LOW_WORD(t, 0); + u = t * lg2_h; + v = (p_l - (t - p_h)) * lg2 + t * lg2_l; + z = u + v; + w = v - (z - u); + t = z * z; + t1 = z - t * (P1 + t * (P2 + t * (P3 + t * (P4 + t * P5)))); + r = (z * t1) / (t1 - two) - (w + z * w); + z = one - (r - z); + GET_HIGH_WORD(j, z); + j += (n << 20); + if ((j >> 20) <= 0) + z = scalbn(z, n); /* subnormal output */ + else + SET_HIGH_WORD(z, j); + return s * z; + } diff --git a/src/libm/e_rem_pio2.c b/src/libm/e_rem_pio2.c new file mode 100644 index 0000000000..a8ffe31421 --- /dev/null +++ b/src/libm/e_rem_pio2.c @@ -0,0 +1,201 @@ +/* @(#)e_rem_pio2.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: e_rem_pio2.c,v 1.8 1995/05/10 20:46:02 jtc Exp $"; +#endif + +/* __ieee754_rem_pio2(x,y) + * + * return the remainder of x rem pi/2 in y[0]+y[1] + * use __kernel_rem_pio2() + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(fabs) + +/* + * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi + */ +#ifdef __STDC__ + static const int32_t two_over_pi[] = { +#else + static int32_t two_over_pi[] = { +#endif + 0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62, + 0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A, + 0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129, + 0xA73EE8, 0x8235F5, 0x2EBB44, 0x84E99C, 0x7026B4, 0x5F7E41, + 0x3991D6, 0x398353, 0x39F49C, 0x845F8B, 0xBDF928, 0x3B1FF8, + 0x97FFDE, 0x05980F, 0xEF2F11, 0x8B5A0A, 0x6D1F6D, 0x367ECF, + 0x27CB09, 0xB74F46, 0x3F669E, 0x5FEA2D, 0x7527BA, 0xC7EBE5, + 0xF17B3D, 0x0739F7, 0x8A5292, 0xEA6BFB, 0x5FB11F, 0x8D5D08, + 0x560330, 0x46FC7B, 0x6BABF0, 0xCFBC20, 0x9AF436, 0x1DA9E3, + 0x91615E, 0xE61B08, 0x659985, 0x5F14A0, 0x68408D, 0xFFD880, + 0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B, + }; + +#ifdef __STDC__ +static const int32_t npio2_hw[] = { +#else +static int32_t npio2_hw[] = { +#endif + 0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C, + 0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C, + 0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A, + 0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C, + 0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB, + 0x404858EB, 0x404921FB, +}; + +/* + * invpio2: 53 bits of 2/pi + * pio2_1: first 33 bit of pi/2 + * pio2_1t: pi/2 - pio2_1 + * pio2_2: second 33 bit of pi/2 + * pio2_2t: pi/2 - (pio2_1+pio2_2) + * pio2_3: third 33 bit of pi/2 + * pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3) + */ + +#ifdef __STDC__ +static const double +#else +static double +#endif + zero = 0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */ + half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ + two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ + invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */ + pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */ + pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */ + pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */ + pio2_2t = 2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */ + pio2_3 = 2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */ + pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ + +#ifdef __STDC__ +int32_t attribute_hidden +__ieee754_rem_pio2(double x, double *y) +#else +int32_t attribute_hidden +__ieee754_rem_pio2(x, y) + double x, y[]; +#endif +{ + double z = 0.0, w, t, r, fn; + double tx[3]; + int32_t e0, i, j, nx, n, ix, hx; + u_int32_t low; + + GET_HIGH_WORD(hx, x); /* high word of x */ + ix = hx & 0x7fffffff; + if (ix <= 0x3fe921fb) { /* |x| ~<= pi/4 , no need for reduction */ + y[0] = x; + y[1] = 0; + return 0; + } + if (ix < 0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */ + if (hx > 0) { + z = x - pio2_1; + if (ix != 0x3ff921fb) { /* 33+53 bit pi is good enough */ + y[0] = z - pio2_1t; + y[1] = (z - y[0]) - pio2_1t; + } else { /* near pi/2, use 33+33+53 bit pi */ + z -= pio2_2; + y[0] = z - pio2_2t; + y[1] = (z - y[0]) - pio2_2t; + } + return 1; + } else { /* negative x */ + z = x + pio2_1; + if (ix != 0x3ff921fb) { /* 33+53 bit pi is good enough */ + y[0] = z + pio2_1t; + y[1] = (z - y[0]) + pio2_1t; + } else { /* near pi/2, use 33+33+53 bit pi */ + z += pio2_2; + y[0] = z + pio2_2t; + y[1] = (z - y[0]) + pio2_2t; + } + return -1; + } + } + if (ix <= 0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */ + t = fabs(x); + n = (int32_t) (t * invpio2 + half); + fn = (double) n; + r = t - fn * pio2_1; + w = fn * pio2_1t; /* 1st round good to 85 bit */ + if (n < 32 && ix != npio2_hw[n - 1]) { + y[0] = r - w; /* quick check no cancellation */ + } else { + u_int32_t high; + j = ix >> 20; + y[0] = r - w; + GET_HIGH_WORD(high, y[0]); + i = j - ((high >> 20) & 0x7ff); + if (i > 16) { /* 2nd iteration needed, good to 118 */ + t = r; + w = fn * pio2_2; + r = t - w; + w = fn * pio2_2t - ((t - r) - w); + y[0] = r - w; + GET_HIGH_WORD(high, y[0]); + i = j - ((high >> 20) & 0x7ff); + if (i > 49) { /* 3rd iteration need, 151 bits acc */ + t = r; /* will cover all possible cases */ + w = fn * pio2_3; + r = t - w; + w = fn * pio2_3t - ((t - r) - w); + y[0] = r - w; + } + } + } + y[1] = (r - y[0]) - w; + if (hx < 0) { + y[0] = -y[0]; + y[1] = -y[1]; + return -n; + } else + return n; + } + /* + * all other (large) arguments + */ + if (ix >= 0x7ff00000) { /* x is inf or NaN */ + y[0] = y[1] = x - x; + return 0; + } + /* set z = scalbn(|x|,ilogb(x)-23) */ + GET_LOW_WORD(low, x); + SET_LOW_WORD(z, low); + e0 = (ix >> 20) - 1046; /* e0 = ilogb(z)-23; */ + SET_HIGH_WORD(z, ix - ((int32_t) (e0 << 20))); + for (i = 0; i < 2; i++) { + tx[i] = (double) ((int32_t) (z)); + z = (z - tx[i]) * two24; + } + tx[2] = z; + nx = 3; + while (tx[nx - 1] == zero) + nx--; /* skip zero term */ + n = __kernel_rem_pio2(tx, y, e0, nx, 2, two_over_pi); + if (hx < 0) { + y[0] = -y[0]; + y[1] = -y[1]; + return -n; + } + return n; +} diff --git a/src/libm/e_sqrt.c b/src/libm/e_sqrt.c new file mode 100644 index 0000000000..b8b8bec6fa --- /dev/null +++ b/src/libm/e_sqrt.c @@ -0,0 +1,464 @@ +/* @(#)e_sqrt.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: e_sqrt.c,v 1.8 1995/05/10 20:46:17 jtc Exp $"; +#endif + +/* __ieee754_sqrt(x) + * Return correctly rounded sqrt. + * ------------------------------------------ + * | Use the hardware sqrt if you have one | + * ------------------------------------------ + * Method: + * Bit by bit method using integer arithmetic. (Slow, but portable) + * 1. Normalization + * Scale x to y in [1,4) with even powers of 2: + * find an integer k such that 1 <= (y=x*2^(2k)) < 4, then + * sqrt(x) = 2^k * sqrt(y) + * 2. Bit by bit computation + * Let q = sqrt(y) truncated to i bit after binary point (q = 1), + * i 0 + * i+1 2 + * s = 2*q , and y = 2 * ( y - q ). (1) + * i i i i + * + * To compute q from q , one checks whether + * i+1 i + * + * -(i+1) 2 + * (q + 2 ) <= y. (2) + * i + * -(i+1) + * If (2) is false, then q = q ; otherwise q = q + 2 . + * i+1 i i+1 i + * + * With some algebric manipulation, it is not difficult to see + * that (2) is equivalent to + * -(i+1) + * s + 2 <= y (3) + * i i + * + * The advantage of (3) is that s and y can be computed by + * i i + * the following recurrence formula: + * if (3) is false + * + * s = s , y = y ; (4) + * i+1 i i+1 i + * + * otherwise, + * -i -(i+1) + * s = s + 2 , y = y - s - 2 (5) + * i+1 i i+1 i i + * + * One may easily use induction to prove (4) and (5). + * Note. Since the left hand side of (3) contain only i+2 bits, + * it does not necessary to do a full (53-bit) comparison + * in (3). + * 3. Final rounding + * After generating the 53 bits result, we compute one more bit. + * Together with the remainder, we can decide whether the + * result is exact, bigger than 1/2ulp, or less than 1/2ulp + * (it will never equal to 1/2ulp). + * The rounding mode can be detected by checking whether + * huge + tiny is equal to huge, and whether huge - tiny is + * equal to huge for some floating point number "huge" and "tiny". + * + * Special cases: + * sqrt(+-0) = +-0 ... exact + * sqrt(inf) = inf + * sqrt(-ve) = NaN ... with invalid signal + * sqrt(NaN) = NaN ... with invalid signal for signaling NaN + * + * Other methods : see the appended file at the end of the program below. + *--------------- + */ + +#include "math_libm.h" +#include "math_private.h" + +#ifdef __STDC__ +static const double one = 1.0, tiny = 1.0e-300; +#else +static double one = 1.0, tiny = 1.0e-300; +#endif + +#ifdef __STDC__ +double attribute_hidden +__ieee754_sqrt(double x) +#else +double attribute_hidden +__ieee754_sqrt(x) + double x; +#endif +{ + double z; + int32_t sign = (int) 0x80000000; + int32_t ix0, s0, q, m, t, i; + u_int32_t r, t1, s1, ix1, q1; + + EXTRACT_WORDS(ix0, ix1, x); + + /* take care of Inf and NaN */ + if ((ix0 & 0x7ff00000) == 0x7ff00000) { + return x * x + x; /* sqrt(NaN)=NaN, sqrt(+inf)=+inf + sqrt(-inf)=sNaN */ + } + /* take care of zero */ + if (ix0 <= 0) { + if (((ix0 & (~sign)) | ix1) == 0) + return x; /* sqrt(+-0) = +-0 */ + else if (ix0 < 0) + return (x - x) / (x - x); /* sqrt(-ve) = sNaN */ + } + /* normalize x */ + m = (ix0 >> 20); + if (m == 0) { /* subnormal x */ + while (ix0 == 0) { + m -= 21; + ix0 |= (ix1 >> 11); + ix1 <<= 21; + } + for (i = 0; (ix0 & 0x00100000) == 0; i++) + ix0 <<= 1; + m -= i - 1; + ix0 |= (ix1 >> (32 - i)); + ix1 <<= i; + } + m -= 1023; /* unbias exponent */ + ix0 = (ix0 & 0x000fffff) | 0x00100000; + if (m & 1) { /* odd m, double x to make it even */ + ix0 += ix0 + ((ix1 & sign) >> 31); + ix1 += ix1; + } + m >>= 1; /* m = [m/2] */ + + /* generate sqrt(x) bit by bit */ + ix0 += ix0 + ((ix1 & sign) >> 31); + ix1 += ix1; + q = q1 = s0 = s1 = 0; /* [q,q1] = sqrt(x) */ + r = 0x00200000; /* r = moving bit from right to left */ + + while (r != 0) { + t = s0 + r; + if (t <= ix0) { + s0 = t + r; + ix0 -= t; + q += r; + } + ix0 += ix0 + ((ix1 & sign) >> 31); + ix1 += ix1; + r >>= 1; + } + + r = sign; + while (r != 0) { + t1 = s1 + r; + t = s0; + if ((t < ix0) || ((t == ix0) && (t1 <= ix1))) { + s1 = t1 + r; + if (((t1 & sign) == sign) && (s1 & sign) == 0) + s0 += 1; + ix0 -= t; + if (ix1 < t1) + ix0 -= 1; + ix1 -= t1; + q1 += r; + } + ix0 += ix0 + ((ix1 & sign) >> 31); + ix1 += ix1; + r >>= 1; + } + + /* use floating add to find out rounding direction */ + if ((ix0 | ix1) != 0) { + z = one - tiny; /* trigger inexact flag */ + if (z >= one) { + z = one + tiny; + if (q1 == (u_int32_t) 0xffffffff) { + q1 = 0; + q += 1; + } else if (z > one) { + if (q1 == (u_int32_t) 0xfffffffe) + q += 1; + q1 += 2; + } else + q1 += (q1 & 1); + } + } + ix0 = (q >> 1) + 0x3fe00000; + ix1 = q1 >> 1; + if ((q & 1) == 1) + ix1 |= sign; + ix0 += (m << 20); + INSERT_WORDS(z, ix0, ix1); + return z; +} + +/* +Other methods (use floating-point arithmetic) +------------- +(This is a copy of a drafted paper by Prof W. Kahan +and K.C. Ng, written in May, 1986) + + Two algorithms are given here to implement sqrt(x) + (IEEE double precision arithmetic) in software. + Both supply sqrt(x) correctly rounded. The first algorithm (in + Section A) uses newton iterations and involves four divisions. + The second one uses reciproot iterations to avoid division, but + requires more multiplications. Both algorithms need the ability + to chop results of arithmetic operations instead of round them, + and the INEXACT flag to indicate when an arithmetic operation + is executed exactly with no roundoff error, all part of the + standard (IEEE 754-1985). The ability to perform shift, add, + subtract and logical AND operations upon 32-bit words is needed + too, though not part of the standard. + +A. sqrt(x) by Newton Iteration + + (1) Initial approximation + + Let x0 and x1 be the leading and the trailing 32-bit words of + a floating point number x (in IEEE double format) respectively + + 1 11 52 ...widths + ------------------------------------------------------ + x: |s| e | f | + ------------------------------------------------------ + msb lsb msb lsb ...order + + + ------------------------ ------------------------ + x0: |s| e | f1 | x1: | f2 | + ------------------------ ------------------------ + + By performing shifts and subtracts on x0 and x1 (both regarded + as integers), we obtain an 8-bit approximation of sqrt(x) as + follows. + + k := (x0>>1) + 0x1ff80000; + y0 := k - T1[31&(k>>15)]. ... y ~ sqrt(x) to 8 bits + Here k is a 32-bit integer and T1[] is an integer array containing + correction terms. Now magically the floating value of y (y's + leading 32-bit word is y0, the value of its trailing word is 0) + approximates sqrt(x) to almost 8-bit. + + Value of T1: + static int T1[32]= { + 0, 1024, 3062, 5746, 9193, 13348, 18162, 23592, + 29598, 36145, 43202, 50740, 58733, 67158, 75992, 85215, + 83599, 71378, 60428, 50647, 41945, 34246, 27478, 21581, + 16499, 12183, 8588, 5674, 3403, 1742, 661, 130,}; + + (2) Iterative refinement + + Apply Heron's rule three times to y, we have y approximates + sqrt(x) to within 1 ulp (Unit in the Last Place): + + y := (y+x/y)/2 ... almost 17 sig. bits + y := (y+x/y)/2 ... almost 35 sig. bits + y := y-(y-x/y)/2 ... within 1 ulp + + + Remark 1. + Another way to improve y to within 1 ulp is: + + y := (y+x/y) ... almost 17 sig. bits to 2*sqrt(x) + y := y - 0x00100006 ... almost 18 sig. bits to sqrt(x) + + 2 + (x-y )*y + y := y + 2* ---------- ...within 1 ulp + 2 + 3y + x + + + This formula has one division fewer than the one above; however, + it requires more multiplications and additions. Also x must be + scaled in advance to avoid spurious overflow in evaluating the + expression 3y*y+x. Hence it is not recommended uless division + is slow. If division is very slow, then one should use the + reciproot algorithm given in section B. + + (3) Final adjustment + + By twiddling y's last bit it is possible to force y to be + correctly rounded according to the prevailing rounding mode + as follows. Let r and i be copies of the rounding mode and + inexact flag before entering the square root program. Also we + use the expression y+-ulp for the next representable floating + numbers (up and down) of y. Note that y+-ulp = either fixed + point y+-1, or multiply y by nextafter(1,+-inf) in chopped + mode. + + I := FALSE; ... reset INEXACT flag I + R := RZ; ... set rounding mode to round-toward-zero + z := x/y; ... chopped quotient, possibly inexact + If(not I) then { ... if the quotient is exact + if(z=y) { + I := i; ... restore inexact flag + R := r; ... restore rounded mode + return sqrt(x):=y. + } else { + z := z - ulp; ... special rounding + } + } + i := TRUE; ... sqrt(x) is inexact + If (r=RN) then z=z+ulp ... rounded-to-nearest + If (r=RP) then { ... round-toward-+inf + y = y+ulp; z=z+ulp; + } + y := y+z; ... chopped sum + y0:=y0-0x00100000; ... y := y/2 is correctly rounded. + I := i; ... restore inexact flag + R := r; ... restore rounded mode + return sqrt(x):=y. + + (4) Special cases + + Square root of +inf, +-0, or NaN is itself; + Square root of a negative number is NaN with invalid signal. + + +B. sqrt(x) by Reciproot Iteration + + (1) Initial approximation + + Let x0 and x1 be the leading and the trailing 32-bit words of + a floating point number x (in IEEE double format) respectively + (see section A). By performing shifs and subtracts on x0 and y0, + we obtain a 7.8-bit approximation of 1/sqrt(x) as follows. + + k := 0x5fe80000 - (x0>>1); + y0:= k - T2[63&(k>>14)]. ... y ~ 1/sqrt(x) to 7.8 bits + + Here k is a 32-bit integer and T2[] is an integer array + containing correction terms. Now magically the floating + value of y (y's leading 32-bit word is y0, the value of + its trailing word y1 is set to zero) approximates 1/sqrt(x) + to almost 7.8-bit. + + Value of T2: + static int T2[64]= { + 0x1500, 0x2ef8, 0x4d67, 0x6b02, 0x87be, 0xa395, 0xbe7a, 0xd866, + 0xf14a, 0x1091b,0x11fcd,0x13552,0x14999,0x15c98,0x16e34,0x17e5f, + 0x18d03,0x19a01,0x1a545,0x1ae8a,0x1b5c4,0x1bb01,0x1bfde,0x1c28d, + 0x1c2de,0x1c0db,0x1ba73,0x1b11c,0x1a4b5,0x1953d,0x18266,0x16be0, + 0x1683e,0x179d8,0x18a4d,0x19992,0x1a789,0x1b445,0x1bf61,0x1c989, + 0x1d16d,0x1d77b,0x1dddf,0x1e2ad,0x1e5bf,0x1e6e8,0x1e654,0x1e3cd, + 0x1df2a,0x1d635,0x1cb16,0x1be2c,0x1ae4e,0x19bde,0x1868e,0x16e2e, + 0x1527f,0x1334a,0x11051,0xe951, 0xbe01, 0x8e0d, 0x5924, 0x1edd,}; + + (2) Iterative refinement + + Apply Reciproot iteration three times to y and multiply the + result by x to get an approximation z that matches sqrt(x) + to about 1 ulp. To be exact, we will have + -1ulp < sqrt(x)-z<1.0625ulp. + + ... set rounding mode to Round-to-nearest + y := y*(1.5-0.5*x*y*y) ... almost 15 sig. bits to 1/sqrt(x) + y := y*((1.5-2^-30)+0.5*x*y*y)... about 29 sig. bits to 1/sqrt(x) + ... special arrangement for better accuracy + z := x*y ... 29 bits to sqrt(x), with z*y<1 + z := z + 0.5*z*(1-z*y) ... about 1 ulp to sqrt(x) + + Remark 2. The constant 1.5-2^-30 is chosen to bias the error so that + (a) the term z*y in the final iteration is always less than 1; + (b) the error in the final result is biased upward so that + -1 ulp < sqrt(x) - z < 1.0625 ulp + instead of |sqrt(x)-z|<1.03125ulp. + + (3) Final adjustment + + By twiddling y's last bit it is possible to force y to be + correctly rounded according to the prevailing rounding mode + as follows. Let r and i be copies of the rounding mode and + inexact flag before entering the square root program. Also we + use the expression y+-ulp for the next representable floating + numbers (up and down) of y. Note that y+-ulp = either fixed + point y+-1, or multiply y by nextafter(1,+-inf) in chopped + mode. + + R := RZ; ... set rounding mode to round-toward-zero + switch(r) { + case RN: ... round-to-nearest + if(x<= z*(z-ulp)...chopped) z = z - ulp; else + if(x<= z*(z+ulp)...chopped) z = z; else z = z+ulp; + break; + case RZ:case RM: ... round-to-zero or round-to--inf + R:=RP; ... reset rounding mod to round-to-+inf + if(x=(z+ulp)*(z+ulp) ...rounded up) z = z+ulp; + break; + case RP: ... round-to-+inf + if(x>(z+ulp)*(z+ulp)...chopped) z = z+2*ulp; else + if(x>z*z ...chopped) z = z+ulp; + break; + } + + Remark 3. The above comparisons can be done in fixed point. For + example, to compare x and w=z*z chopped, it suffices to compare + x1 and w1 (the trailing parts of x and w), regarding them as + two's complement integers. + + ...Is z an exact square root? + To determine whether z is an exact square root of x, let z1 be the + trailing part of z, and also let x0 and x1 be the leading and + trailing parts of x. + + If ((z1&0x03ffffff)!=0) ... not exact if trailing 26 bits of z!=0 + I := 1; ... Raise Inexact flag: z is not exact + else { + j := 1 - [(x0>>20)&1] ... j = logb(x) mod 2 + k := z1 >> 26; ... get z's 25-th and 26-th + fraction bits + I := i or (k&j) or ((k&(j+j+1))!=(x1&3)); + } + R:= r ... restore rounded mode + return sqrt(x):=z. + + If multiplication is cheaper then the foregoing red tape, the + Inexact flag can be evaluated by + + I := i; + I := (z*z!=x) or I. + + Note that z*z can overwrite I; this value must be sensed if it is + True. + + Remark 4. If z*z = x exactly, then bit 25 to bit 0 of z1 must be + zero. + + -------------------- + z1: | f2 | + -------------------- + bit 31 bit 0 + + Further more, bit 27 and 26 of z1, bit 0 and 1 of x1, and the odd + or even of logb(x) have the following relations: + + ------------------------------------------------- + bit 27,26 of z1 bit 1,0 of x1 logb(x) + ------------------------------------------------- + 00 00 odd and even + 01 01 even + 10 10 odd + 10 00 even + 11 01 even + ------------------------------------------------- + + (4) Special cases (see (4) of Section A). + + */ diff --git a/src/libm/k_cos.c b/src/libm/k_cos.c new file mode 100644 index 0000000000..64c50e3fb9 --- /dev/null +++ b/src/libm/k_cos.c @@ -0,0 +1,100 @@ +/* @(#)k_cos.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: k_cos.c,v 1.8 1995/05/10 20:46:22 jtc Exp $"; +#endif + +/* + * __kernel_cos( x, y ) + * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164 + * Input x is assumed to be bounded by ~pi/4 in magnitude. + * Input y is the tail of x. + * + * Algorithm + * 1. Since cos(-x) = cos(x), we need only to consider positive x. + * 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0. + * 3. cos(x) is approximated by a polynomial of degree 14 on + * [0,pi/4] + * 4 14 + * cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x + * where the remez error is + * + * | 2 4 6 8 10 12 14 | -58 + * |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2 + * | | + * + * 4 6 8 10 12 14 + * 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then + * cos(x) = 1 - x*x/2 + r + * since cos(x+y) ~ cos(x) - sin(x)*y + * ~ cos(x) - x*y, + * a correction term is necessary in cos(x) and hence + * cos(x+y) = 1 - (x*x/2 - (r - x*y)) + * For better accuracy when x > 0.3, let qx = |x|/4 with + * the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125. + * Then + * cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)). + * Note that 1-qx and (x*x/2-qx) is EXACT here, and the + * magnitude of the latter is at least a quarter of x*x/2, + * thus, reducing the rounding error in the subtraction. + */ + +#include "math_libm.h" +#include "math_private.h" + +#ifdef __STDC__ +static const double +#else +static double +#endif + one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ + C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */ + C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */ + C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */ + C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ + C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */ + C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ + +#ifdef __STDC__ +double attribute_hidden +__kernel_cos(double x, double y) +#else +double attribute_hidden +__kernel_cos(x, y) + double x, y; +#endif +{ + double a, hz, z, r, qx; + int32_t ix; + GET_HIGH_WORD(ix, x); + ix &= 0x7fffffff; /* ix = |x|'s high word */ + if (ix < 0x3e400000) { /* if x < 2**27 */ + if (((int) x) == 0) + return one; /* generate inexact */ + } + z = x * x; + r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * C6))))); + if (ix < 0x3FD33333) /* if |x| < 0.3 */ + return one - (0.5 * z - (z * r - x * y)); + else { + if (ix > 0x3fe90000) { /* x > 0.78125 */ + qx = 0.28125; + } else { + INSERT_WORDS(qx, ix - 0x00200000, 0); /* x/4 */ + } + hz = 0.5 * z - qx; + a = one - qx; + return a - (hz - (z * r - x * y)); + } +} diff --git a/src/libm/k_rem_pio2.c b/src/libm/k_rem_pio2.c new file mode 100644 index 0000000000..f881d35d6a --- /dev/null +++ b/src/libm/k_rem_pio2.c @@ -0,0 +1,358 @@ +/* @(#)k_rem_pio2.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $"; +#endif + +/* + * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) + * double x[],y[]; int e0,nx,prec; int ipio2[]; + * + * __kernel_rem_pio2 return the last three digits of N with + * y = x - N*pi/2 + * so that |y| < pi/2. + * + * The method is to compute the integer (mod 8) and fraction parts of + * (2/pi)*x without doing the full multiplication. In general we + * skip the part of the product that are known to be a huge integer ( + * more accurately, = 0 mod 8 ). Thus the number of operations are + * independent of the exponent of the input. + * + * (2/pi) is represented by an array of 24-bit integers in ipio2[]. + * + * Input parameters: + * x[] The input value (must be positive) is broken into nx + * pieces of 24-bit integers in double precision format. + * x[i] will be the i-th 24 bit of x. The scaled exponent + * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 + * match x's up to 24 bits. + * + * Example of breaking a double positive z into x[0]+x[1]+x[2]: + * e0 = ilogb(z)-23 + * z = scalbn(z,-e0) + * for i = 0,1,2 + * x[i] = floor(z) + * z = (z-x[i])*2**24 + * + * + * y[] ouput result in an array of double precision numbers. + * The dimension of y[] is: + * 24-bit precision 1 + * 53-bit precision 2 + * 64-bit precision 2 + * 113-bit precision 3 + * The actual value is the sum of them. Thus for 113-bit + * precison, one may have to do something like: + * + * long double t,w,r_head, r_tail; + * t = (long double)y[2] + (long double)y[1]; + * w = (long double)y[0]; + * r_head = t+w; + * r_tail = w - (r_head - t); + * + * e0 The exponent of x[0] + * + * nx dimension of x[] + * + * prec an integer indicating the precision: + * 0 24 bits (single) + * 1 53 bits (double) + * 2 64 bits (extended) + * 3 113 bits (quad) + * + * ipio2[] + * integer array, contains the (24*i)-th to (24*i+23)-th + * bit of 2/pi after binary point. The corresponding + * floating value is + * + * ipio2[i] * 2^(-24(i+1)). + * + * External function: + * double scalbn(), floor(); + * + * + * Here is the description of some local variables: + * + * jk jk+1 is the initial number of terms of ipio2[] needed + * in the computation. The recommended value is 2,3,4, + * 6 for single, double, extended,and quad. + * + * jz local integer variable indicating the number of + * terms of ipio2[] used. + * + * jx nx - 1 + * + * jv index for pointing to the suitable ipio2[] for the + * computation. In general, we want + * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8 + * is an integer. Thus + * e0-3-24*jv >= 0 or (e0-3)/24 >= jv + * Hence jv = max(0,(e0-3)/24). + * + * jp jp+1 is the number of terms in PIo2[] needed, jp = jk. + * + * q[] double array with integral value, representing the + * 24-bits chunk of the product of x and 2/pi. + * + * q0 the corresponding exponent of q[0]. Note that the + * exponent for q[i] would be q0-24*i. + * + * PIo2[] double precision array, obtained by cutting pi/2 + * into 24 bits chunks. + * + * f[] ipio2[] in floating point + * + * iq[] integer array by breaking up q[] in 24-bits chunk. + * + * fq[] final product of x*(2/pi) in fq[0],..,fq[jk] + * + * ih integer. If >0 it indicates q[] is >= 0.5, hence + * it also indicates the *sign* of the result. + * + */ + + +/* + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(scalbn) + libm_hidden_proto(floor) +#ifdef __STDC__ + static const int init_jk[] = { 2, 3, 4, 6 }; /* initial value for jk */ +#else + static int init_jk[] = { 2, 3, 4, 6 }; +#endif + +#ifdef __STDC__ +static const double PIo2[] = { +#else +static double PIo2[] = { +#endif + 1.57079625129699707031e+00, /* 0x3FF921FB, 0x40000000 */ + 7.54978941586159635335e-08, /* 0x3E74442D, 0x00000000 */ + 5.39030252995776476554e-15, /* 0x3CF84698, 0x80000000 */ + 3.28200341580791294123e-22, /* 0x3B78CC51, 0x60000000 */ + 1.27065575308067607349e-29, /* 0x39F01B83, 0x80000000 */ + 1.22933308981111328932e-36, /* 0x387A2520, 0x40000000 */ + 2.73370053816464559624e-44, /* 0x36E38222, 0x80000000 */ + 2.16741683877804819444e-51, /* 0x3569F31D, 0x00000000 */ +}; + +#ifdef __STDC__ +static const double +#else +static double +#endif + zero = 0.0, one = 1.0, two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ + twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ + +#ifdef __STDC__ +int attribute_hidden +__kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, + const int32_t * ipio2) +#else +int attribute_hidden +__kernel_rem_pio2(x, y, e0, nx, prec, ipio2) + double x[], y[]; + int e0, nx, prec; + int32_t ipio2[]; +#endif +{ + int32_t jz, jx, jv, jp, jk, carry, n, iq[20], i, j, k, m, q0, ih; + double z, fw, f[20], fq[20], q[20]; + + /* initialize jk */ + jk = init_jk[prec]; + jp = jk; + + /* determine jx,jv,q0, note that 3>q0 */ + jx = nx - 1; + jv = (e0 - 3) / 24; + if (jv < 0) + jv = 0; + q0 = e0 - 24 * (jv + 1); + + /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */ + j = jv - jx; + m = jx + jk; + for (i = 0; i <= m; i++, j++) + f[i] = (j < 0) ? zero : (double) ipio2[j]; + + /* compute q[0],q[1],...q[jk] */ + for (i = 0; i <= jk; i++) { + for (j = 0, fw = 0.0; j <= jx; j++) + fw += x[j] * f[jx + i - j]; + q[i] = fw; + } + + jz = jk; + recompute: + /* distill q[] into iq[] reversingly */ + for (i = 0, j = jz, z = q[jz]; j > 0; i++, j--) { + fw = (double) ((int32_t) (twon24 * z)); + iq[i] = (int32_t) (z - two24 * fw); + z = q[j - 1] + fw; + } + + /* compute n */ + z = scalbn(z, q0); /* actual value of z */ + z -= 8.0 * floor(z * 0.125); /* trim off integer >= 8 */ + n = (int32_t) z; + z -= (double) n; + ih = 0; + if (q0 > 0) { /* need iq[jz-1] to determine n */ + i = (iq[jz - 1] >> (24 - q0)); + n += i; + iq[jz - 1] -= i << (24 - q0); + ih = iq[jz - 1] >> (23 - q0); + } else if (q0 == 0) + ih = iq[jz - 1] >> 23; + else if (z >= 0.5) + ih = 2; + + if (ih > 0) { /* q > 0.5 */ + n += 1; + carry = 0; + for (i = 0; i < jz; i++) { /* compute 1-q */ + j = iq[i]; + if (carry == 0) { + if (j != 0) { + carry = 1; + iq[i] = 0x1000000 - j; + } + } else + iq[i] = 0xffffff - j; + } + if (q0 > 0) { /* rare case: chance is 1 in 12 */ + switch (q0) { + case 1: + iq[jz - 1] &= 0x7fffff; + break; + case 2: + iq[jz - 1] &= 0x3fffff; + break; + } + } + if (ih == 2) { + z = one - z; + if (carry != 0) + z -= scalbn(one, q0); + } + } + + /* check if recomputation is needed */ + if (z == zero) { + j = 0; + for (i = jz - 1; i >= jk; i--) + j |= iq[i]; + if (j == 0) { /* need recomputation */ + for (k = 1; iq[jk - k] == 0; k++); /* k = no. of terms needed */ + + for (i = jz + 1; i <= jz + k; i++) { /* add q[jz+1] to q[jz+k] */ + f[jx + i] = (double) ipio2[jv + i]; + for (j = 0, fw = 0.0; j <= jx; j++) + fw += x[j] * f[jx + i - j]; + q[i] = fw; + } + jz += k; + goto recompute; + } + } + + /* chop off zero terms */ + if (z == 0.0) { + jz -= 1; + q0 -= 24; + while (iq[jz] == 0) { + jz--; + q0 -= 24; + } + } else { /* break z into 24-bit if necessary */ + z = scalbn(z, -q0); + if (z >= two24) { + fw = (double) ((int32_t) (twon24 * z)); + iq[jz] = (int32_t) (z - two24 * fw); + jz += 1; + q0 += 24; + iq[jz] = (int32_t) fw; + } else + iq[jz] = (int32_t) z; + } + + /* convert integer "bit" chunk to floating-point value */ + fw = scalbn(one, q0); + for (i = jz; i >= 0; i--) { + q[i] = fw * (double) iq[i]; + fw *= twon24; + } + + /* compute PIo2[0,...,jp]*q[jz,...,0] */ + for (i = jz; i >= 0; i--) { + for (fw = 0.0, k = 0; k <= jp && k <= jz - i; k++) + fw += PIo2[k] * q[i + k]; + fq[jz - i] = fw; + } + + /* compress fq[] into y[] */ + switch (prec) { + case 0: + fw = 0.0; + for (i = jz; i >= 0; i--) + fw += fq[i]; + y[0] = (ih == 0) ? fw : -fw; + break; + case 1: + case 2: + fw = 0.0; + for (i = jz; i >= 0; i--) + fw += fq[i]; + y[0] = (ih == 0) ? fw : -fw; + fw = fq[0] - fw; + for (i = 1; i <= jz; i++) + fw += fq[i]; + y[1] = (ih == 0) ? fw : -fw; + break; + case 3: /* painful */ + for (i = jz; i > 0; i--) { + fw = fq[i - 1] + fq[i]; + fq[i] += fq[i - 1] - fw; + fq[i - 1] = fw; + } + for (i = jz; i > 1; i--) { + fw = fq[i - 1] + fq[i]; + fq[i] += fq[i - 1] - fw; + fq[i - 1] = fw; + } + for (fw = 0.0, i = jz; i >= 2; i--) + fw += fq[i]; + if (ih == 0) { + y[0] = fq[0]; + y[1] = fq[1]; + y[2] = fw; + } else { + y[0] = -fq[0]; + y[1] = -fq[1]; + y[2] = -fw; + } + } + return n & 7; +} diff --git a/src/libm/k_sin.c b/src/libm/k_sin.c new file mode 100644 index 0000000000..60881575a5 --- /dev/null +++ b/src/libm/k_sin.c @@ -0,0 +1,87 @@ +/* @(#)k_sin.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: k_sin.c,v 1.8 1995/05/10 20:46:31 jtc Exp $"; +#endif + +/* __kernel_sin( x, y, iy) + * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854 + * Input x is assumed to be bounded by ~pi/4 in magnitude. + * Input y is the tail of x. + * Input iy indicates whether y is 0. (if iy=0, y assume to be 0). + * + * Algorithm + * 1. Since sin(-x) = -sin(x), we need only to consider positive x. + * 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0. + * 3. sin(x) is approximated by a polynomial of degree 13 on + * [0,pi/4] + * 3 13 + * sin(x) ~ x + S1*x + ... + S6*x + * where + * + * |sin(x) 2 4 6 8 10 12 | -58 + * |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2 + * | x | + * + * 4. sin(x+y) = sin(x) + sin'(x')*y + * ~ sin(x) + (1-x*x/2)*y + * For better accuracy, let + * 3 2 2 2 2 + * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6)))) + * then 3 2 + * sin(x) = x + (S1*x + (x *(r-y/2)+y)) + */ + +#include "math_libm.h" +#include "math_private.h" + +#ifdef __STDC__ +static const double +#else +static double +#endif + half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ + S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ + S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */ + S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */ + S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */ + S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */ + S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */ + +#ifdef __STDC__ +double attribute_hidden +__kernel_sin(double x, double y, int iy) +#else +double attribute_hidden +__kernel_sin(x, y, iy) + double x, y; + int iy; /* iy=0 if y is zero */ +#endif +{ + double z, r, v; + int32_t ix; + GET_HIGH_WORD(ix, x); + ix &= 0x7fffffff; /* high word of x */ + if (ix < 0x3e400000) { /* |x| < 2**-27 */ + if ((int) x == 0) + return x; + } /* generate inexact */ + z = x * x; + v = z * x; + r = S2 + z * (S3 + z * (S4 + z * (S5 + z * S6))); + if (iy == 0) + return x + v * (S1 + z * r); + else + return x - ((z * (half * y - v * r) - y) - v * S1); +} diff --git a/src/libm/math_libm.h b/src/libm/math_libm.h new file mode 100644 index 0000000000..45a34d8ae8 --- /dev/null +++ b/src/libm/math_libm.h @@ -0,0 +1,37 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* Math routines from uClibc: http://www.uclibc.org */ + +double SDL_uclibc_atan(double x); +double SDL_uclibc_atan2(double y, double x); +double SDL_uclibc_copysign(double x, double y); +double SDL_uclibc_cos(double x); +double SDL_uclibc_fabs(double x); +double SDL_uclibc_floor(double x); +double SDL_uclibc_log(double x); +double SDL_uclibc_pow(double x, double y); +double SDL_uclibc_scalbn(double x, int n); +double SDL_uclibc_sin(double x); +double SDL_uclibc_sqrt(double x); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/libm/math_private.h b/src/libm/math_private.h new file mode 100644 index 0000000000..c5ab63d7cf --- /dev/null +++ b/src/libm/math_private.h @@ -0,0 +1,220 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* + * from: @(#)fdlibm.h 5.1 93/09/24 + * $Id: math_private.h,v 1.3 2004/02/09 07:10:38 andersen Exp $ + */ + +#ifndef _MATH_PRIVATE_H_ +#define _MATH_PRIVATE_H_ + +/*#include */ +#include "SDL_endian.h" +/*#include */ + +#define attribute_hidden +#define libm_hidden_proto(x) +#define libm_hidden_def(x) + +#ifndef __HAIKU__ /* already defined in a system header. */ +typedef unsigned int u_int32_t; +#endif + +#define atan SDL_uclibc_atan +#define __ieee754_atan2 SDL_uclibc_atan2 +#define copysign SDL_uclibc_copysign +#define cos SDL_uclibc_cos +#define fabs SDL_uclibc_fabs +#define floor SDL_uclibc_floor +#define __ieee754_log SDL_uclibc_log +#define __ieee754_pow SDL_uclibc_pow +#define scalbn SDL_uclibc_scalbn +#define sin SDL_uclibc_sin +#define __ieee754_sqrt SDL_uclibc_sqrt + +/* The original fdlibm code used statements like: + n0 = ((*(int*)&one)>>29)^1; * index of high word * + ix0 = *(n0+(int*)&x); * high word of x * + ix1 = *((1-n0)+(int*)&x); * low word of x * + to dig two 32 bit words out of the 64 bit IEEE floating point + value. That is non-ANSI, and, moreover, the gcc instruction + scheduler gets it wrong. We instead use the following macros. + Unlike the original code, we determine the endianness at compile + time, not at run time; I don't see much benefit to selecting + endianness at run time. */ + +/* A union which permits us to convert between a double and two 32 bit + ints. */ + +/* + * Math on arm is special: + * For FPA, float words are always big-endian. + * For VFP, floats words follow the memory system mode. + */ + +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + +typedef union +{ + double value; + struct + { + u_int32_t msw; + u_int32_t lsw; + } parts; +} ieee_double_shape_type; + +#else + +typedef union +{ + double value; + struct + { + u_int32_t lsw; + u_int32_t msw; + } parts; +} ieee_double_shape_type; + +#endif + +/* Get two 32 bit ints from a double. */ + +#define EXTRACT_WORDS(ix0,ix1,d) \ +do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ +} while (0) + +/* Get the more significant 32 bit int from a double. */ + +#define GET_HIGH_WORD(i,d) \ +do { \ + ieee_double_shape_type gh_u; \ + gh_u.value = (d); \ + (i) = gh_u.parts.msw; \ +} while (0) + +/* Get the less significant 32 bit int from a double. */ + +#define GET_LOW_WORD(i,d) \ +do { \ + ieee_double_shape_type gl_u; \ + gl_u.value = (d); \ + (i) = gl_u.parts.lsw; \ +} while (0) + +/* Set a double from two 32 bit ints. */ + +#define INSERT_WORDS(d,ix0,ix1) \ +do { \ + ieee_double_shape_type iw_u; \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ +} while (0) + +/* Set the more significant 32 bits of a double from an int. */ + +#define SET_HIGH_WORD(d,v) \ +do { \ + ieee_double_shape_type sh_u; \ + sh_u.value = (d); \ + sh_u.parts.msw = (v); \ + (d) = sh_u.value; \ +} while (0) + +/* Set the less significant 32 bits of a double from an int. */ + +#define SET_LOW_WORD(d,v) \ +do { \ + ieee_double_shape_type sl_u; \ + sl_u.value = (d); \ + sl_u.parts.lsw = (v); \ + (d) = sl_u.value; \ +} while (0) + +/* A union which permits us to convert between a float and a 32 bit + int. */ + +typedef union +{ + float value; + u_int32_t word; +} ieee_float_shape_type; + +/* Get a 32 bit int from a float. */ + +#define GET_FLOAT_WORD(i,d) \ +do { \ + ieee_float_shape_type gf_u; \ + gf_u.value = (d); \ + (i) = gf_u.word; \ +} while (0) + +/* Set a float from a 32 bit int. */ + +#define SET_FLOAT_WORD(d,i) \ +do { \ + ieee_float_shape_type sf_u; \ + sf_u.word = (i); \ + (d) = sf_u.value; \ +} while (0) + +/* ieee style elementary functions */ +extern double +__ieee754_sqrt(double) + attribute_hidden; + extern double __ieee754_acos(double) attribute_hidden; + extern double __ieee754_acosh(double) attribute_hidden; + extern double __ieee754_log(double) attribute_hidden; + extern double __ieee754_atanh(double) attribute_hidden; + extern double __ieee754_asin(double) attribute_hidden; + extern double __ieee754_atan2(double, double) attribute_hidden; + extern double __ieee754_exp(double) attribute_hidden; + extern double __ieee754_cosh(double) attribute_hidden; + extern double __ieee754_fmod(double, double) attribute_hidden; + extern double __ieee754_pow(double, double) attribute_hidden; + extern double __ieee754_lgamma_r(double, int *) attribute_hidden; + extern double __ieee754_gamma_r(double, int *) attribute_hidden; + extern double __ieee754_lgamma(double) attribute_hidden; + extern double __ieee754_gamma(double) attribute_hidden; + extern double __ieee754_log10(double) attribute_hidden; + extern double __ieee754_sinh(double) attribute_hidden; + extern double __ieee754_hypot(double, double) attribute_hidden; + extern double __ieee754_j0(double) attribute_hidden; + extern double __ieee754_j1(double) attribute_hidden; + extern double __ieee754_y0(double) attribute_hidden; + extern double __ieee754_y1(double) attribute_hidden; + extern double __ieee754_jn(int, double) attribute_hidden; + extern double __ieee754_yn(int, double) attribute_hidden; + extern double __ieee754_remainder(double, double) attribute_hidden; + extern int __ieee754_rem_pio2(double, double *) attribute_hidden; +#if defined(_SCALB_INT) + extern double __ieee754_scalb(double, int) attribute_hidden; +#else + extern double __ieee754_scalb(double, double) attribute_hidden; +#endif + +/* fdlibm kernel function */ +#ifndef _IEEE_LIBM + extern double __kernel_standard(double, double, int) attribute_hidden; +#endif + extern double __kernel_sin(double, double, int) attribute_hidden; + extern double __kernel_cos(double, double) attribute_hidden; + extern double __kernel_tan(double, double, int) attribute_hidden; + extern int __kernel_rem_pio2(double *, double *, int, int, int, + const int *) attribute_hidden; + +#endif /* _MATH_PRIVATE_H_ */ diff --git a/src/libm/s_atan.c b/src/libm/s_atan.c new file mode 100644 index 0000000000..f664f0eb3d --- /dev/null +++ b/src/libm/s_atan.c @@ -0,0 +1,114 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* atan(x) + * Method + * 1. Reduce x to positive by atan(x) = -atan(-x). + * 2. According to the integer k=4t+0.25 chopped, t=x, the argument + * is further reduced to one of the following intervals and the + * arctangent of t is evaluated by the corresponding formula: + * + * [0,7/16] atan(x) = t-t^3*(a1+t^2*(a2+...(a10+t^2*a11)...) + * [7/16,11/16] atan(x) = atan(1/2) + atan( (t-0.5)/(1+t/2) ) + * [11/16.19/16] atan(x) = atan( 1 ) + atan( (t-1)/(1+t) ) + * [19/16,39/16] atan(x) = atan(3/2) + atan( (t-1.5)/(1+1.5t) ) + * [39/16,INF] atan(x) = atan(INF) + atan( -1/t ) + * + * Constants: + * The hexadecimal values are the intended ones for the following + * constants. The decimal values may be used, provided that the + * compiler will convert from decimal to binary accurately enough + * to produce the hexadecimal values shown. + */ + +#include "math_libm.h" +#include "math_private.h" + +static const double atanhi[] = { + 4.63647609000806093515e-01, /* atan(0.5)hi 0x3FDDAC67, 0x0561BB4F */ + 7.85398163397448278999e-01, /* atan(1.0)hi 0x3FE921FB, 0x54442D18 */ + 9.82793723247329054082e-01, /* atan(1.5)hi 0x3FEF730B, 0xD281F69B */ + 1.57079632679489655800e+00, /* atan(inf)hi 0x3FF921FB, 0x54442D18 */ +}; + +static const double atanlo[] = { + 2.26987774529616870924e-17, /* atan(0.5)lo 0x3C7A2B7F, 0x222F65E2 */ + 3.06161699786838301793e-17, /* atan(1.0)lo 0x3C81A626, 0x33145C07 */ + 1.39033110312309984516e-17, /* atan(1.5)lo 0x3C700788, 0x7AF0CBBD */ + 6.12323399573676603587e-17, /* atan(inf)lo 0x3C91A626, 0x33145C07 */ +}; + +static const double aT[] = { + 3.33333333333329318027e-01, /* 0x3FD55555, 0x5555550D */ + -1.99999999998764832476e-01, /* 0xBFC99999, 0x9998EBC4 */ + 1.42857142725034663711e-01, /* 0x3FC24924, 0x920083FF */ + -1.11111104054623557880e-01, /* 0xBFBC71C6, 0xFE231671 */ + 9.09088713343650656196e-02, /* 0x3FB745CD, 0xC54C206E */ + -7.69187620504482999495e-02, /* 0xBFB3B0F2, 0xAF749A6D */ + 6.66107313738753120669e-02, /* 0x3FB10D66, 0xA0D03D51 */ + -5.83357013379057348645e-02, /* 0xBFADDE2D, 0x52DEFD9A */ + 4.97687799461593236017e-02, /* 0x3FA97B4B, 0x24760DEB */ + -3.65315727442169155270e-02, /* 0xBFA2B444, 0x2C6A6C2F */ + 1.62858201153657823623e-02, /* 0x3F90AD3A, 0xE322DA11 */ +}; + +static const double +one = 1.0, +huge = 1.0e300; + +double atan(double x) +{ + double w,s1,s2,z; + int32_t ix,hx,id; + + GET_HIGH_WORD(hx,x); + ix = hx&0x7fffffff; + if(ix>=0x44100000) { /* if |x| >= 2^66 */ + u_int32_t low; + GET_LOW_WORD(low,x); + if(ix>0x7ff00000|| + (ix==0x7ff00000&&(low!=0))) + return x+x; /* NaN */ + if(hx>0) return atanhi[3]+atanlo[3]; + else return -atanhi[3]-atanlo[3]; + } if (ix < 0x3fdc0000) { /* |x| < 0.4375 */ + if (ix < 0x3e200000) { /* |x| < 2^-29 */ + if(huge+x>one) return x; /* raise inexact */ + } + id = -1; + } else { + x = fabs(x); + if (ix < 0x3ff30000) { /* |x| < 1.1875 */ + if (ix < 0x3fe60000) { /* 7/16 <=|x|<11/16 */ + id = 0; x = (2.0*x-one)/(2.0+x); + } else { /* 11/16<=|x|< 19/16 */ + id = 1; x = (x-one)/(x+one); + } + } else { + if (ix < 0x40038000) { /* |x| < 2.4375 */ + id = 2; x = (x-1.5)/(one+1.5*x); + } else { /* 2.4375 <= |x| < 2^66 */ + id = 3; x = -1.0/x; + } + }} + /* end of argument reduction */ + z = x*x; + w = z*z; + /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ + s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10]))))); + s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9])))); + if (id<0) return x - x*(s1+s2); + else { + z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x); + return (hx<0)? -z:z; + } +} +libm_hidden_def(atan) diff --git a/src/libm/s_copysign.c b/src/libm/s_copysign.c new file mode 100644 index 0000000000..afd43e9a72 --- /dev/null +++ b/src/libm/s_copysign.c @@ -0,0 +1,42 @@ +/* @(#)s_copysign.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $"; +#endif + +/* + * copysign(double x, double y) + * copysign(x,y) returns a value with the magnitude of x and + * with the sign bit of y. + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(copysign) +#ifdef __STDC__ + double copysign(double x, double y) +#else + double copysign(x, y) + double x, y; +#endif +{ + u_int32_t hx, hy; + GET_HIGH_WORD(hx, x); + GET_HIGH_WORD(hy, y); + SET_HIGH_WORD(x, (hx & 0x7fffffff) | (hy & 0x80000000)); + return x; +} + +libm_hidden_def(copysign) diff --git a/src/libm/s_cos.c b/src/libm/s_cos.c new file mode 100644 index 0000000000..66b156c9f5 --- /dev/null +++ b/src/libm/s_cos.c @@ -0,0 +1,91 @@ +/* @(#)s_cos.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: s_cos.c,v 1.7 1995/05/10 20:47:02 jtc Exp $"; +#endif + +/* cos(x) + * Return cosine function of x. + * + * kernel function: + * __kernel_sin ... sine function on [-pi/4,pi/4] + * __kernel_cos ... cosine function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(cos) +#ifdef __STDC__ + double cos(double x) +#else + double cos(x) + double x; +#endif +{ + double y[2], z = 0.0; + int32_t n, ix; + + /* High word of x. */ + GET_HIGH_WORD(ix, x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if (ix <= 0x3fe921fb) + return __kernel_cos(x, z); + + /* cos(Inf or NaN) is NaN */ + else if (ix >= 0x7ff00000) + return x - x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x, y); + switch (n & 3) { + case 0: + return __kernel_cos(y[0], y[1]); + case 1: + return -__kernel_sin(y[0], y[1], 1); + case 2: + return -__kernel_cos(y[0], y[1]); + default: + return __kernel_sin(y[0], y[1], 1); + } + } +} + +libm_hidden_def(cos) diff --git a/src/libm/s_fabs.c b/src/libm/s_fabs.c new file mode 100644 index 0000000000..5cf0c3977b --- /dev/null +++ b/src/libm/s_fabs.c @@ -0,0 +1,39 @@ +/* @(#)s_fabs.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $"; +#endif + +/* + * fabs(x) returns the absolute value of x. + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(fabs) +#ifdef __STDC__ + double fabs(double x) +#else + double fabs(x) + double x; +#endif +{ + u_int32_t high; + GET_HIGH_WORD(high, x); + SET_HIGH_WORD(x, high & 0x7fffffff); + return x; +} + +libm_hidden_def(fabs) diff --git a/src/libm/s_floor.c b/src/libm/s_floor.c new file mode 100644 index 0000000000..b553d30382 --- /dev/null +++ b/src/libm/s_floor.c @@ -0,0 +1,96 @@ +/* @(#)s_floor.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: s_floor.c,v 1.8 1995/05/10 20:47:20 jtc Exp $"; +#endif + +/* + * floor(x) + * Return x rounded toward -inf to integral value + * Method: + * Bit twiddling. + * Exception: + * Inexact flag raised if x not equal to floor(x). + */ + +#include "math_libm.h" +#include "math_private.h" + +#ifdef __STDC__ +static const double huge_val = 1.0e300; +#else +static double huge_val = 1.0e300; +#endif + +libm_hidden_proto(floor) +#ifdef __STDC__ + double floor(double x) +#else + double floor(x) + double x; +#endif +{ + int32_t i0, i1, j0; + u_int32_t i, j; + EXTRACT_WORDS(i0, i1, x); + j0 = ((i0 >> 20) & 0x7ff) - 0x3ff; + if (j0 < 20) { + if (j0 < 0) { /* raise inexact if x != 0 */ + if (huge_val + x > 0.0) { /* return 0*sign(x) if |x|<1 */ + if (i0 >= 0) { + i0 = i1 = 0; + } else if (((i0 & 0x7fffffff) | i1) != 0) { + i0 = 0xbff00000; + i1 = 0; + } + } + } else { + i = (0x000fffff) >> j0; + if (((i0 & i) | i1) == 0) + return x; /* x is integral */ + if (huge_val + x > 0.0) { /* raise inexact flag */ + if (i0 < 0) + i0 += (0x00100000) >> j0; + i0 &= (~i); + i1 = 0; + } + } + } else if (j0 > 51) { + if (j0 == 0x400) + return x + x; /* inf or NaN */ + else + return x; /* x is integral */ + } else { + i = ((u_int32_t) (0xffffffff)) >> (j0 - 20); + if ((i1 & i) == 0) + return x; /* x is integral */ + if (huge_val + x > 0.0) { /* raise inexact flag */ + if (i0 < 0) { + if (j0 == 20) + i0 += 1; + else { + j = i1 + (1 << (52 - j0)); + if (j < (u_int32_t) i1) + i0 += 1; /* got a carry */ + i1 = j; + } + } + i1 &= (~i); + } + } + INSERT_WORDS(x, i0, i1); + return x; +} + +libm_hidden_def(floor) diff --git a/src/libm/s_scalbn.c b/src/libm/s_scalbn.c new file mode 100644 index 0000000000..74b9794450 --- /dev/null +++ b/src/libm/s_scalbn.c @@ -0,0 +1,79 @@ +/* @(#)s_scalbn.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $"; +#endif + +/* + * scalbn (double x, int n) + * scalbn(x,n) returns x* 2**n computed by exponent + * manipulation rather than by actually performing an + * exponentiation or a multiplication. + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(copysign) +#ifdef __STDC__ + static const double +#else + static double +#endif + two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */ + twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ + huge_val = 1.0e+300, tiny = 1.0e-300; + +libm_hidden_proto(scalbn) +#ifdef __STDC__ + double scalbn(double x, int n) +#else + double scalbn(x, n) + double x; + int n; +#endif +{ + int32_t k, hx, lx; + EXTRACT_WORDS(hx, lx, x); + k = (hx & 0x7ff00000) >> 20; /* extract exponent */ + if (k == 0) { /* 0 or subnormal x */ + if ((lx | (hx & 0x7fffffff)) == 0) + return x; /* +-0 */ + x *= two54; + GET_HIGH_WORD(hx, x); + k = ((hx & 0x7ff00000) >> 20) - 54; + if (n < -50000) + return tiny * x; /*underflow */ + } + if (k == 0x7ff) + return x + x; /* NaN or Inf */ + k = k + n; + if (k > 0x7fe) + return huge_val * copysign(huge_val, x); /* overflow */ + if (k > 0) { /* normal result */ + SET_HIGH_WORD(x, (hx & 0x800fffff) | (k << 20)); + return x; + } + if (k <= -54) { + if (n > 50000) /* in case integer overflow in n+k */ + return huge_val * copysign(huge_val, x); /*overflow */ + else + return tiny * copysign(tiny, x); /*underflow */ + } + k += 54; /* subnormal result */ + SET_HIGH_WORD(x, (hx & 0x800fffff) | (k << 20)); + return x * twom54; +} + +libm_hidden_def(scalbn) diff --git a/src/libm/s_sin.c b/src/libm/s_sin.c new file mode 100644 index 0000000000..771176619f --- /dev/null +++ b/src/libm/s_sin.c @@ -0,0 +1,91 @@ +/* @(#)s_sin.c 5.1 93/09/24 */ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +#if defined(LIBM_SCCS) && !defined(lint) +static const char rcsid[] = + "$NetBSD: s_sin.c,v 1.7 1995/05/10 20:48:15 jtc Exp $"; +#endif + +/* sin(x) + * Return sine function of x. + * + * kernel function: + * __kernel_sin ... sine function on [-pi/4,pi/4] + * __kernel_cos ... cose function on [-pi/4,pi/4] + * __ieee754_rem_pio2 ... argument reduction routine + * + * Method. + * Let S,C and T denote the sin, cos and tan respectively on + * [-PI/4, +PI/4]. Reduce the argument x to y1+y2 = x-k*pi/2 + * in [-pi/4 , +pi/4], and let n = k mod 4. + * We have + * + * n sin(x) cos(x) tan(x) + * ---------------------------------------------------------- + * 0 S C T + * 1 C -S -1/T + * 2 -S -C T + * 3 -C S -1/T + * ---------------------------------------------------------- + * + * Special cases: + * Let trig be any of sin, cos, or tan. + * trig(+-INF) is NaN, with signals; + * trig(NaN) is that NaN; + * + * Accuracy: + * TRIG(x) returns trig(x) nearly rounded + */ + +#include "math_libm.h" +#include "math_private.h" + +libm_hidden_proto(sin) +#ifdef __STDC__ + double sin(double x) +#else + double sin(x) + double x; +#endif +{ + double y[2], z = 0.0; + int32_t n, ix; + + /* High word of x. */ + GET_HIGH_WORD(ix, x); + + /* |x| ~< pi/4 */ + ix &= 0x7fffffff; + if (ix <= 0x3fe921fb) + return __kernel_sin(x, z, 0); + + /* sin(Inf or NaN) is NaN */ + else if (ix >= 0x7ff00000) + return x - x; + + /* argument reduction needed */ + else { + n = __ieee754_rem_pio2(x, y); + switch (n & 3) { + case 0: + return __kernel_sin(y[0], y[1], 1); + case 1: + return __kernel_cos(y[0], y[1]); + case 2: + return -__kernel_sin(y[0], y[1], 1); + default: + return -__kernel_cos(y[0], y[1]); + } + } +} + +libm_hidden_def(sin) diff --git a/src/loadso/beos/SDL_sysloadso.c b/src/loadso/beos/SDL_sysloadso.c index 28267b72b3..524cd715eb 100644 --- a/src/loadso/beos/SDL_sysloadso.c +++ b/src/loadso/beos/SDL_sysloadso.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -49,7 +48,8 @@ SDL_LoadFunction(void *handle, const char *name) { void *sym = NULL; image_id library_id = (image_id) handle; - status_t rc = get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym); + status_t rc = + get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym); if (rc != B_NO_ERROR) { SDL_SetError(strerror(rc)); } @@ -69,4 +69,3 @@ SDL_UnloadObject(void *handle) #endif /* SDL_LOADSO_BEOS */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/loadso/dlopen/SDL_sysloadso.c b/src/loadso/dlopen/SDL_sysloadso.c index 7985ee7f9d..c2cbdd4c0f 100644 --- a/src/loadso/dlopen/SDL_sysloadso.c +++ b/src/loadso/dlopen/SDL_sysloadso.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -31,39 +30,45 @@ #include "SDL_loadso.h" -void *SDL_LoadObject(const char *sofile) +void * +SDL_LoadObject(const char *sofile) { - void *handle = dlopen(sofile, RTLD_NOW); - const char *loaderror = (char *)dlerror(); - if ( handle == NULL ) { - SDL_SetError("Failed loading %s: %s", sofile, loaderror); - } - return(handle); + void *handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL); + const char *loaderror = (char *) dlerror(); + if (handle == NULL) { + SDL_SetError("Failed loading %s: %s", sofile, loaderror); + } + return (handle); } -void *SDL_LoadFunction(void *handle, const char *name) +void * +SDL_LoadFunction(void *handle, const char *name) { - void *symbol = dlsym(handle, name); - if ( symbol == NULL ) { - /* append an underscore for platforms that need that. */ - size_t len = 1+SDL_strlen(name)+1; - char *_name = SDL_stack_alloc(char, len); - _name[0] = '_'; - SDL_strlcpy(&_name[1], name, len); - symbol = dlsym(handle, _name); - SDL_stack_free(_name); - if ( symbol == NULL ) { - SDL_SetError("Failed loading %s: %s", name, (const char *)dlerror()); - } - } - return(symbol); + void *symbol = dlsym(handle, name); + if (symbol == NULL) { + /* append an underscore for platforms that need that. */ + size_t len = 1 + SDL_strlen(name) + 1; + char *_name = SDL_stack_alloc(char, len); + _name[0] = '_'; + SDL_strlcpy(&_name[1], name, len); + symbol = dlsym(handle, _name); + SDL_stack_free(_name); + if (symbol == NULL) { + SDL_SetError("Failed loading %s: %s", name, + (const char *) dlerror()); + } + } + return (symbol); } -void SDL_UnloadObject(void *handle) +void +SDL_UnloadObject(void *handle) { - if ( handle != NULL ) { - dlclose(handle); - } + if (handle != NULL) { + dlclose(handle); + } } #endif /* SDL_LOADSO_DLOPEN */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/loadso/dummy/SDL_sysloadso.c b/src/loadso/dummy/SDL_sysloadso.c index f8c9af9c67..d890a14890 100644 --- a/src/loadso/dummy/SDL_sysloadso.c +++ b/src/loadso/dummy/SDL_sysloadso.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -28,23 +27,28 @@ #include "SDL_loadso.h" -void *SDL_LoadObject(const char *sofile) +void * +SDL_LoadObject(const char *sofile) { - const char *loaderror = "SDL_LoadObject() not implemented"; - SDL_SetError("Failed loading %s: %s", sofile, loaderror); - return(NULL); + const char *loaderror = "SDL_LoadObject() not implemented"; + SDL_SetError("Failed loading %s: %s", sofile, loaderror); + return (NULL); } -void *SDL_LoadFunction(void *handle, const char *name) +void * +SDL_LoadFunction(void *handle, const char *name) { - const char *loaderror = "SDL_LoadFunction() not implemented"; - SDL_SetError("Failed loading %s: %s", name, loaderror); - return(NULL); + const char *loaderror = "SDL_LoadFunction() not implemented"; + SDL_SetError("Failed loading %s: %s", name, loaderror); + return (NULL); } -void SDL_UnloadObject(void *handle) +void +SDL_UnloadObject(void *handle) { /* no-op. */ } #endif /* SDL_LOADSO_DUMMY || SDL_LOADSO_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/loadso/macos/SDL_sysloadso.c b/src/loadso/macos/SDL_sysloadso.c deleted file mode 100644 index c035b1786c..0000000000 --- a/src/loadso/macos/SDL_sysloadso.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_LOADSO_MACOS - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent library loading routines */ - -#include -#include -#define OLDP2C 1 -#include -#include -#include - -#include "SDL_loadso.h" - -void *SDL_LoadObject(const char *sofile) -{ - void *handle = NULL; - const char *loaderror = NULL; - CFragConnectionID library_id; - Ptr mainAddr; - Str255 errName; - OSErr error; - char psofile[512]; - - SDL_strlcpy(psofile, sofile, SDL_arraysize(psofile)); - error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch, - kLoadCFrag, &library_id, &mainAddr, errName); - switch (error) { - case noErr: - loaderror = NULL; - break; - case cfragNoLibraryErr: - loaderror = "Library not found"; - break; - case cfragUnresolvedErr: - loaderror = "Unabled to resolve symbols"; - break; - case cfragNoPrivateMemErr: - case cfragNoClientMemErr: - loaderror = "Out of memory"; - break; - default: - loaderror = "Unknown Code Fragment Manager error"; - break; - } - if ( loaderror == NULL ) { - handle = (void *)(library_id); - } else { - SDL_SetError("Failed loading %s: %s", sofile, loaderror); - } - return(handle); -} - -void *SDL_LoadFunction(void *handle, const char *name) -{ - void *symbol = NULL; - const char *loaderror = NULL; - CFragSymbolClass class; - CFragConnectionID library_id = (CFragConnectionID)handle; - char pname[512]; - - SDL_strlcpy(pname, name, SDL_arraysize(pname)); - if ( FindSymbol(library_id, C2PStr(pname), - (char **)&symbol, &class) != noErr ) { - loaderror = "Symbol not found"; - } - - if ( symbol == NULL ) { - SDL_SetError("Failed loading %s: %s", name, loaderror); - } - return(symbol); -} - -void SDL_UnloadObject(void *handle) -{ - CFragConnectionID library_id; - if ( handle != NULL ) { - library_id = (CFragConnectionID)handle; - CloseConnection(&library_id); - } -} - -#endif /* SDL_LOADSO_MACOS */ diff --git a/src/loadso/macosx/SDL_dlcompat.c b/src/loadso/macosx/SDL_dlcompat.c deleted file mode 100644 index 091947f2dc..0000000000 --- a/src/loadso/macosx/SDL_dlcompat.c +++ /dev/null @@ -1,1407 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_LOADSO_DLCOMPAT - -/* Please note that dlcompat apparently ships in current Mac OS X versions - * as a system library that provides compatibility with the Unix "dlopen" - * interface. In order to allow SDL to work on older OS X releases and also - * not conflict with the system lib on newer versions, we include dlcompat - * in SDL and change the symbols to prevent symbol clash with any existing - * system libraries. --ryan. - */ - -/* here is the dlcompat license: */ - -/* -Copyright (c) 2002 Jorge Acereda & - Peter O'Gorman - -Portions may be copyright others, see the AUTHORS file included with this -distribution. - -Maintained by Peter O'Gorman - -Bug Reports and other queries should go to - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_stdinc.h" - -/* Just playing to see if it would compile with the freebsd headers, it does, - * but because of the different values for RTLD_LOCAL etc, it would break binary - * compat... oh well - */ -#ifndef __BSD_VISIBLE -#define __BSD_VISIBLE 1 -#endif - -/*include "dlfcn.h"*/ -#ifdef __cplusplus -extern "C" { -#endif - -#if defined (__GNUC__) && __GNUC__ > 3 -#define dl_restrict __restrict -#else -#define dl_restrict -#endif - -#if 0 -#ifndef _POSIX_SOURCE -/* - * Structure filled in by dladdr(). - */ -typedef struct SDL_OSX_dl_info { - const char *dli_fname; /* Pathname of shared object */ - void *dli_fbase; /* Base address of shared object */ - const char *dli_sname; /* Name of nearest symbol */ - void *dli_saddr; /* Address of nearest symbol */ -} SDL_OSX_Dl_info; - -static int SDL_OSX_dladdr(const void * dl_restrict, SDL_OSX_Dl_info * dl_restrict); -#endif /* ! _POSIX_SOURCE */ -#endif /* 0 */ - -static int SDL_OSX_dlclose(void * handle); -static const char * SDL_OSX_dlerror(void); -static void * SDL_OSX_dlopen(const char *path, int mode); -static void * SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol); - -#define RTLD_LAZY 0x1 -#define RTLD_NOW 0x2 -#define RTLD_LOCAL 0x4 -#define RTLD_GLOBAL 0x8 - -#ifndef _POSIX_SOURCE -#define RTLD_NOLOAD 0x10 -#define RTLD_NODELETE 0x80 - -/* - * Special handle arguments for SDL_OSX_dlsym(). - */ -#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */ -#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */ -#endif /* ! _POSIX_SOURCE */ - -#ifdef __cplusplus -} -#endif - -#ifndef dl_restrict -#define dl_restrict __restrict -#endif -/* This is not available on 10.1 */ -#ifndef LC_LOAD_WEAK_DYLIB -#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) -#endif - -/* With this stuff here, this thing may actually compile/run on 10.0 systems - * Not that I have a 10.0 system to test it on anylonger - */ -#ifndef LC_REQ_DYLD -#define LC_REQ_DYLD 0x80000000 -#endif -#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED -#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 -#endif -#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR -#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 -#endif -#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND -#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 -#endif -#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR -#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 -#endif -/* These symbols will be looked for in dyld */ -static const struct mach_header *(*dyld_NSAddImage) (const char *, unsigned long) = 0; -static int (*dyld_NSIsSymbolNameDefinedInImage) (const struct mach_header *, const char *) = 0; -static NSSymbol(*dyld_NSLookupSymbolInImage) - (const struct mach_header *, const char *, unsigned long) = 0; - -/* Define this to make dlcompat reuse data block. This way in theory we save - * a little bit of overhead. However we then couldn't correctly catch excess - * calls to SDL_OSX_dlclose(). Hence we don't use this feature - */ -#undef REUSE_STATUS - -/* Size of the internal error message buffer (used by dlerror()) */ -#define ERR_STR_LEN 251 - -/* Maximum number of search paths supported by getSearchPath */ -#define MAX_SEARCH_PATHS 32 - - -#define MAGIC_DYLIB_OFI ((NSObjectFileImage) 'DYOF') -#define MAGIC_DYLIB_MOD ((NSModule) 'DYMO') - -/* internal flags */ -#define DL_IN_LIST 0x01 - -/* our mutex */ -static pthread_mutex_t dlcompat_mutex; -/* Our thread specific storage - */ -static pthread_key_t dlerror_key; - -struct dlthread -{ - int lockcnt; - unsigned char errset; - char errstr[ERR_STR_LEN]; -}; - -/* This is our central data structure. Whenever a module is loaded via - * SDL_OSX_dlopen(), we create such a struct. - */ -struct dlstatus -{ - struct dlstatus *next; /* pointer to next element in the linked list */ - NSModule module; - const struct mach_header *lib; - int refs; /* reference count */ - int mode; /* mode in which this module was loaded */ - dev_t device; - ino_t inode; - int flags; /* Any internal flags we may need */ -}; - -/* Head node of the dlstatus list */ -static struct dlstatus mainStatus = { 0, MAGIC_DYLIB_MOD, NULL, -1, RTLD_GLOBAL, 0, 0, 0 }; -static struct dlstatus *stqueue = &mainStatus; - - -/* Storage for the last error message (used by dlerror()) */ -/* static char err_str[ERR_STR_LEN]; */ -/* static int err_filled = 0; */ - -/* Prototypes to internal functions */ -static void debug(const char *fmt, ...); -static void error(const char *str, ...); -static const char *safegetenv(const char *s); -static const char *searchList(void); -static const char *getSearchPath(int i); -static const char *getFullPath(int i, const char *file); -static const struct stat *findFile(const char *file, const char **fullPath); -static int isValidStatus(struct dlstatus *status); -static inline int isFlagSet(int mode, int flag); -static struct dlstatus *lookupStatus(const struct stat *sbuf); -static void insertStatus(struct dlstatus *dls, const struct stat *sbuf); -static int promoteLocalToGlobal(struct dlstatus *dls); -static void *reference(struct dlstatus *dls, int mode); -static void *dlsymIntern(struct dlstatus *dls, const char *symbol, int canSetError); -static struct dlstatus *allocStatus(void); -static struct dlstatus *loadModule(const char *path, const struct stat *sbuf, int mode); -static NSSymbol search_linked_libs(const struct mach_header *mh, const char *symbol); -static const char *get_lib_name(const struct mach_header *mh); -static const struct mach_header *get_mach_header_from_NSModule(NSModule mod); -static void dlcompat_init_func(void); -static inline void dlcompat_init_check(void); -static inline void dolock(void); -static inline void dounlock(void); -static void dlerrorfree(void *data); -static void resetdlerror(void); -static const struct mach_header *my_find_image(const char *name); -static const struct mach_header *image_for_address(const void *address); -static inline char *dyld_error_str(void); - -#if FINK_BUILD -/* Two Global Functions */ -static void *dlsym_prepend_underscore(void *handle, const char *symbol); -static void *dlsym_auto_underscore(void *handle, const char *symbol); - -/* And their _intern counterparts */ -static void *dlsym_prepend_underscore_intern(void *handle, const char *symbol); -static void *dlsym_auto_underscore_intern(void *handle, const char *symbol); -#endif - -/* Functions */ - -static void debug(const char *fmt, ...) -{ -#if DEBUG > 1 - va_list arg; - va_start(arg, fmt); - fprintf(stderr, "DLDEBUG: "); - vfprintf(stderr, fmt, arg); - fprintf(stderr, "\n"); - fflush(stderr); - va_end(arg); -#endif -} - -static void error(const char *str, ...) -{ - va_list arg; - struct dlthread *tss; - char * err_str; - va_start(arg, str); - tss = pthread_getspecific(dlerror_key); - err_str = tss->errstr; - SDL_strlcpy(err_str, "dlcompat: ", ERR_STR_LEN); - vsnprintf(err_str + 10, ERR_STR_LEN - 10, str, arg); - va_end(arg); - debug("ERROR: %s\n", err_str); - tss->errset = 1; -} - -static void warning(const char *str) -{ -#if DEBUG > 0 - fprintf(stderr, "WARNING: dlcompat: %s\n", str); -#endif -} - -static const char *safegetenv(const char *s) -{ - const char *ss = SDL_getenv(s); - return ss ? ss : ""; -} - -/* because this is only used for debugging and error reporting functions, we - * don't really care about how elegant it is... it could use the load - * commands to find the install name of the library, but... - */ -static const char *get_lib_name(const struct mach_header *mh) -{ - unsigned long count = _dyld_image_count(); - unsigned long i; - const char *val = NULL; - if (mh) - { - for (i = 0; i < count; i++) - { - if (mh == _dyld_get_image_header(i)) - { - val = _dyld_get_image_name(i); - break; - } - } - } - return val; -} - -/* Returns the mach_header for the module bu going through all the loaded images - * and finding the one with the same name as the module. There really ought to be - * an api for doing this, would be faster, but there isn't one right now - */ -static const struct mach_header *get_mach_header_from_NSModule(NSModule mod) -{ - const char *mod_name = NSNameOfModule(mod); - const struct mach_header *mh = NULL; - unsigned long count = _dyld_image_count(); - unsigned long i; - debug("Module name: %s", mod_name); - for (i = 0; i < count; i++) - { - if (!SDL_strcmp(mod_name, _dyld_get_image_name(i))) - { - mh = _dyld_get_image_header(i); - break; - } - } - return mh; -} - - -/* Compute and return a list of all directories that we should search when - * trying to locate a module. We first look at the values of LD_LIBRARY_PATH - * and DYLD_LIBRARY_PATH, and then finally fall back to looking into - * /usr/lib and /lib. Since both of the environments variables can contain a - * list of colon seperated paths, we simply concat them and the two other paths - * into one big string, which we then can easily parse. - * Splitting this string into the actual path list is done by getSearchPath() - */ -static const char *searchList() -{ - size_t buf_size; - static char *buf=NULL; - const char *ldlp = safegetenv("LD_LIBRARY_PATH"); - const char *dyldlp = safegetenv("DYLD_LIBRARY_PATH"); - const char *stdpath = SDL_getenv("DYLD_FALLBACK_LIBRARY_PATH"); - if (!stdpath) - stdpath = "/usr/local/lib:/lib:/usr/lib"; - if (!buf) - { - buf_size = SDL_strlen(ldlp) + SDL_strlen(dyldlp) + SDL_strlen(stdpath) + 4; - buf = SDL_malloc(buf_size); - SDL_snprintf(buf, buf_size, "%s%s%s%s%s%c", dyldlp, (dyldlp[0] ? ":" : ""), ldlp, (ldlp[0] ? ":" : ""), - stdpath, '\0'); - } - return buf; -} - -/* Returns the ith search path from the list as computed by searchList() */ -static const char *getSearchPath(int i) -{ - static const char *list = 0; - static char **path = (char **)0; - static int end = 0; - static int numsize = MAX_SEARCH_PATHS; - static char **tmp; - /* So we can call SDL_free() in the "destructor" we use i=-1 to return the alloc'd array */ - if (i == -1) - { - return (const char*)path; - } - if (!path) - { - path = (char **)SDL_calloc(MAX_SEARCH_PATHS, sizeof(char **)); - } - if (!list && !end) - list = searchList(); - if (i >= (numsize)) - { - debug("Increasing size for long PATH"); - tmp = (char **)SDL_calloc((MAX_SEARCH_PATHS + numsize), sizeof(char **)); - if (tmp) - { - SDL_memcpy(tmp, path, sizeof(char **) * numsize); - SDL_free(path); - path = tmp; - numsize += MAX_SEARCH_PATHS; - } - else - { - return 0; - } - } - - while (!path[i] && !end) - { - path[i] = strsep((char **)&list, ":"); - - if (path[i][0] == 0) - path[i] = 0; - end = (list == 0); - } - return path[i]; -} - -static const char *getFullPath(int i, const char *file) -{ - static char buf[PATH_MAX]; - const char *path = getSearchPath(i); - if (path) - { - SDL_snprintf(buf, PATH_MAX, "%s/%s", path, file); - } - return path ? buf : 0; -} - -/* Given a file name, try to determine the full path for that file. Starts - * its search in the current directory, and then tries all paths in the - * search list in the order they are specified there. - */ -static const struct stat *findFile(const char *file, const char **fullPath) -{ - int i = 0; - static struct stat sbuf; - char *fileName; - debug("finding file %s", file); - *fullPath = file; - if (0 == stat(file, &sbuf)) - return &sbuf; - if (SDL_strchr(file, '/')) - return 0; /* If the path had a / we don't look in env var places */ - fileName = NULL; - if (!fileName) - fileName = (char *)file; - while ((*fullPath = getFullPath(i++, fileName))) - { - if (0 == stat(*fullPath, &sbuf)) - return &sbuf; - } - ; - return 0; -} - -/* Determine whether a given dlstatus is valid or not */ -static int isValidStatus(struct dlstatus *status) -{ - /* Walk the list to verify status is contained in it */ - struct dlstatus *dls = stqueue; - while (dls && status != dls) - dls = dls->next; - if (dls == 0) - error("invalid handle"); - else if ((dls->module == 0) || (dls->refs == 0)) - error("handle to closed library"); - else - return TRUE; - return FALSE; -} - -static inline int isFlagSet(int mode, int flag) -{ - return (mode & flag) == flag; -} - -static struct dlstatus *lookupStatus(const struct stat *sbuf) -{ - struct dlstatus *dls = stqueue; - debug("looking for status"); - while (dls && ( /* isFlagSet(dls->mode, RTLD_UNSHARED) */ 0 - || sbuf->st_dev != dls->device || sbuf->st_ino != dls->inode)) - dls = dls->next; - return dls; -} - -static void insertStatus(struct dlstatus *dls, const struct stat *sbuf) -{ - debug("inserting status"); - dls->inode = sbuf->st_ino; - dls->device = sbuf->st_dev; - dls->refs = 0; - dls->mode = 0; - if ((dls->flags & DL_IN_LIST) == 0) - { - dls->next = stqueue; - stqueue = dls; - dls->flags |= DL_IN_LIST; - } -} - -static struct dlstatus *allocStatus() -{ - struct dlstatus *dls; -#ifdef REUSE_STATUS - dls = stqueue; - while (dls && dls->module) - dls = dls->next; - if (!dls) -#endif - dls = SDL_calloc(sizeof(*dls),1); - return dls; -} - -static int promoteLocalToGlobal(struct dlstatus *dls) -{ - static int (*p) (NSModule module) = 0; - debug("promoting"); - if (!p) - _dyld_func_lookup("__dyld_NSMakePrivateModulePublic", (void **)&p); - return (dls->module == MAGIC_DYLIB_MOD) || (p && p(dls->module)); -} - -static void *reference(struct dlstatus *dls, int mode) -{ - if (dls) - { - if (dls->module == MAGIC_DYLIB_MOD && isFlagSet(mode, RTLD_LOCAL)) - { - warning("trying to open a .dylib with RTLD_LOCAL"); - error("unable to open a .dylib with RTLD_LOCAL"); - return NULL; - } - if (isFlagSet(mode, RTLD_GLOBAL) && - !isFlagSet(dls->mode, RTLD_GLOBAL) && !promoteLocalToGlobal(dls)) - { - error("unable to promote local module to global"); - return NULL; - } - dls->mode |= mode; - dls->refs++; - } - else - debug("reference called with NULL argument"); - - return dls; -} - -static const struct mach_header *my_find_image(const char *name) -{ - const struct mach_header *mh = 0; - const char *id = NULL; - int i = _dyld_image_count(); - int j; - mh = (struct mach_header *) - dyld_NSAddImage(name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | - NSADDIMAGE_OPTION_RETURN_ON_ERROR); - if (!mh) - { - for (j = 0; j < i; j++) - { - id = _dyld_get_image_name(j); - if (!SDL_strcmp(id, name)) - { - mh = _dyld_get_image_header(j); - break; - } - } - } - return mh; -} - -/* - * dyld adds libraries by first adding the directly dependant libraries in link order, and - * then adding the dependencies for those libraries, so we should do the same... but we don't - * bother adding the extra dependencies, if the symbols are neither in the loaded image nor - * any of it's direct dependencies, then it probably isn't there. - */ -static NSSymbol search_linked_libs(const struct mach_header * mh, const char *symbol) -{ - unsigned int n; - struct load_command *lc = 0; - struct mach_header *wh; - NSSymbol nssym = 0; - if (dyld_NSAddImage && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage) - { - lc = (struct load_command *)((char *)mh + sizeof(struct mach_header)); - for (n = 0; n < mh->ncmds; n++, lc = (struct load_command *)((char *)lc + lc->cmdsize)) - { - if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) - { - if ((wh = (struct mach_header *) - my_find_image((char *)(((struct dylib_command *)lc)->dylib.name.offset + - (char *)lc)))) - { - if (dyld_NSIsSymbolNameDefinedInImage(wh, symbol)) - { - nssym = dyld_NSLookupSymbolInImage(wh, - symbol, - NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | - NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - break; - } - } - } - } - if ((!nssym) && NSIsSymbolNameDefined(symbol)) - { - /* I've never seen this debug message...*/ - debug("Symbol \"%s\" is defined but was not found", symbol); - } - } - return nssym; -} - -/* Up to the caller to SDL_free() returned string */ -static inline char *dyld_error_str() -{ - NSLinkEditErrors dylder; - int dylderno; - const char *dylderrstr; - const char *dyldfile; - char* retStr = NULL; - NSLinkEditError(&dylder, &dylderno, &dyldfile, &dylderrstr); - if (dylderrstr && *dylderrstr) - { - retStr = SDL_strdup(dylderrstr); - } - return retStr; -} - -static void *dlsymIntern(struct dlstatus *dls, const char *symbol, int canSetError) -{ - NSSymbol nssym = 0; -#ifdef __GCC__ - void *caller = __builtin_return_address(1); /* Be *very* careful about inlining */ -#else - void *caller = NULL; -#endif - const struct mach_header *caller_mh = 0; - char *savedErrorStr = NULL; - resetdlerror(); -#ifndef RTLD_SELF -#define RTLD_SELF ((void *) -3) -#endif - if (NULL == dls) - dls = RTLD_SELF; - if ((RTLD_NEXT == dls) || (RTLD_SELF == dls)) - { - if (dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage && caller) - { - caller_mh = image_for_address(caller); - if (RTLD_SELF == dls) - { - /* FIXME: We should be using the NSModule api, if SELF is an MH_BUNDLE - * But it appears to work anyway, and looking at the code in dyld_libfuncs.c - * this is acceptable. - */ - if (dyld_NSIsSymbolNameDefinedInImage(caller_mh, symbol)) - { - nssym = dyld_NSLookupSymbolInImage(caller_mh, - symbol, - NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | - NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - } - } - if (!nssym) - { - if (RTLD_SELF == dls) - savedErrorStr = dyld_error_str(); - nssym = search_linked_libs(caller_mh, symbol); - } - } - else - { - if (canSetError) - error("RTLD_SELF and RTLD_NEXT are not supported"); - return NULL; - } - } - if (!nssym) - { - - if (RTLD_DEFAULT == dls) - { - dls = &mainStatus; - } - if (!isValidStatus(dls)) - return NULL; - - if (dls->module != MAGIC_DYLIB_MOD) - { - nssym = NSLookupSymbolInModule(dls->module, symbol); - if (!nssym && NSIsSymbolNameDefined(symbol)) - { - debug("Searching dependencies"); - savedErrorStr = dyld_error_str(); - nssym = search_linked_libs(get_mach_header_from_NSModule(dls->module), symbol); - } - } - else if (dls->lib && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage) - { - if (dyld_NSIsSymbolNameDefinedInImage(dls->lib, symbol)) - { - nssym = dyld_NSLookupSymbolInImage(dls->lib, - symbol, - NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | - NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - } - else if (NSIsSymbolNameDefined(symbol)) - { - debug("Searching dependencies"); - savedErrorStr = dyld_error_str(); - nssym = search_linked_libs(dls->lib, symbol); - } - } - else if (dls->module == MAGIC_DYLIB_MOD) - { - /* Global context, use NSLookupAndBindSymbol */ - if (NSIsSymbolNameDefined(symbol)) - { - /* There doesn't seem to be a return on error option for this call??? - this is potentially broken, if binding fails, it will improperly - exit the application. */ - nssym = NSLookupAndBindSymbol(symbol); - } - else - { - if (savedErrorStr) - SDL_free(savedErrorStr); - savedErrorStr = SDL_malloc(256); - SDL_snprintf(savedErrorStr, 256, "Symbol \"%s\" not in global context",symbol); - } - } - } - /* Error reporting */ - if (!nssym) - { - if (!savedErrorStr || !SDL_strlen(savedErrorStr)) - { - if (savedErrorStr) - SDL_free(savedErrorStr); - savedErrorStr = SDL_malloc(256); - SDL_snprintf(savedErrorStr, 256,"Symbol \"%s\" not found",symbol); - } - if (canSetError) - { - error(savedErrorStr); - } - else - { - debug(savedErrorStr); - } - if (savedErrorStr) - SDL_free(savedErrorStr); - return NULL; - } - return NSAddressOfSymbol(nssym); -} - -static struct dlstatus *loadModule(const char *path, const struct stat *sbuf, int mode) -{ - NSObjectFileImage ofi = 0; - NSObjectFileImageReturnCode ofirc; - struct dlstatus *dls; - NSLinkEditErrors ler; - int lerno; - const char *errstr; - const char *file; - void (*init) (void); - - ofirc = NSCreateObjectFileImageFromFile(path, &ofi); - switch (ofirc) - { - case NSObjectFileImageSuccess: - break; - case NSObjectFileImageInappropriateFile: - if (dyld_NSAddImage && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage) - { - if (isFlagSet(mode, RTLD_LOCAL)) - { - warning("trying to open a .dylib with RTLD_LOCAL"); - error("unable to open this file with RTLD_LOCAL"); - return NULL; - } - } - else - { - error("opening this file is unsupported on this system"); - return NULL; - } - break; - case NSObjectFileImageFailure: - error("object file setup failure"); - return NULL; - case NSObjectFileImageArch: - error("no object for this architecture"); - return NULL; - case NSObjectFileImageFormat: - error("bad object file format"); - return NULL; - case NSObjectFileImageAccess: - error("can't read object file"); - return NULL; - default: - error("unknown error from NSCreateObjectFileImageFromFile()"); - return NULL; - } - dls = lookupStatus(sbuf); - if (!dls) - { - dls = allocStatus(); - } - if (!dls) - { - error("unable to allocate memory"); - return NULL; - } - // dls->lib = 0; - if (ofirc == NSObjectFileImageInappropriateFile) - { - if ((dls->lib = dyld_NSAddImage(path, NSADDIMAGE_OPTION_RETURN_ON_ERROR))) - { - debug("Dynamic lib loaded at %ld", dls->lib); - ofi = MAGIC_DYLIB_OFI; - dls->module = MAGIC_DYLIB_MOD; - ofirc = NSObjectFileImageSuccess; - /* Although it is possible with a bit of work to modify this so it works and - functions with RTLD_NOW, I don't deem it necessary at the moment */ - } - if (!(dls->module)) - { - NSLinkEditError(&ler, &lerno, &file, &errstr); - if (!errstr || (!SDL_strlen(errstr))) - error("Can't open this file type"); - else - error(errstr); - if ((dls->flags & DL_IN_LIST) == 0) - { - SDL_free(dls); - } - return NULL; - } - } - else - { - dls->module = NSLinkModule(ofi, path, - NSLINKMODULE_OPTION_RETURN_ON_ERROR | - NSLINKMODULE_OPTION_PRIVATE | - (isFlagSet(mode, RTLD_NOW) ? NSLINKMODULE_OPTION_BINDNOW : 0)); - NSDestroyObjectFileImage(ofi); - if (dls->module) - { - dls->lib = get_mach_header_from_NSModule(dls->module); - } - } - if (!dls->module) - { - NSLinkEditError(&ler, &lerno, &file, &errstr); - if ((dls->flags & DL_IN_LIST) == 0) - { - SDL_free(dls); - } - error(errstr); - return NULL; - } - - insertStatus(dls, sbuf); - dls = reference(dls, mode); - if ((init = dlsymIntern(dls, "__init", 0))) - { - debug("calling _init()"); - init(); - } - return dls; -} - -inline static void dlcompat_init_check(void) -{ - static pthread_mutex_t l = PTHREAD_MUTEX_INITIALIZER; - static int init_done = 0; - - pthread_mutex_lock(&l); - if (!init_done) { - dlcompat_init_func(); - init_done = 1; - } - pthread_mutex_unlock(&l); -} - -static void dlcompat_init_func(void) -{ - _dyld_func_lookup("__dyld_NSAddImage", (void **)&dyld_NSAddImage); - _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage", - (void **)&dyld_NSIsSymbolNameDefinedInImage); - _dyld_func_lookup("__dyld_NSLookupSymbolInImage", (void **)&dyld_NSLookupSymbolInImage); - if (pthread_mutex_init(&dlcompat_mutex, NULL)) - exit(1); - if (pthread_key_create(&dlerror_key, &dlerrorfree)) - exit(1); -} - -static void resetdlerror() -{ - struct dlthread *tss; - tss = pthread_getspecific(dlerror_key); - tss->errset = 0; -} - -static void dlerrorfree(void *data) -{ - SDL_free(data); -} - -/* We kind of want a recursive lock here, but meet a little trouble - * because they are not available pre OS X 10.2, so we fake it - * using thread specific storage to keep a lock count - */ -static inline void dolock(void) -{ - int err = 0; - struct dlthread *tss; - dlcompat_init_check(); - tss = pthread_getspecific(dlerror_key); - if (!tss) - { - tss = SDL_malloc(sizeof(struct dlthread)); - tss->lockcnt = 0; - tss->errset = 0; - if (pthread_setspecific(dlerror_key, tss)) - { - fprintf(stderr,"dlcompat: pthread_setspecific failed\n"); - exit(1); - } - } - if (!tss->lockcnt) - err = pthread_mutex_lock(&dlcompat_mutex); - tss->lockcnt = tss->lockcnt +1; - if (err) - exit(err); -} - -static inline void dounlock(void) -{ - int err = 0; - struct dlthread *tss; - tss = pthread_getspecific(dlerror_key); - tss->lockcnt = tss->lockcnt -1; - if (!tss->lockcnt) - err = pthread_mutex_unlock(&dlcompat_mutex); - if (err) - exit(err); -} - -static void *SDL_OSX_dlopen(const char *path, int mode) -{ - const struct stat *sbuf; - struct dlstatus *dls; - const char *fullPath; - - dolock(); - resetdlerror(); - if (!path) - { - dls = &mainStatus; - goto dlopenok; - } - if (!(sbuf = findFile(path, &fullPath))) - { - error("file \"%s\" not found", path); - goto dlopenerror; - } - /* Now checks that it hasn't been closed already */ - if ((dls = lookupStatus(sbuf)) && (dls->refs > 0)) - { - /* debug("status found"); */ - dls = reference(dls, mode); - goto dlopenok; - } -#ifdef RTLD_NOLOAD - if (isFlagSet(mode, RTLD_NOLOAD)) - { - error("no existing handle and RTLD_NOLOAD specified"); - goto dlopenerror; - } -#endif - if (isFlagSet(mode, RTLD_LAZY) && isFlagSet(mode, RTLD_NOW)) - { - error("how can I load something both RTLD_LAZY and RTLD_NOW?"); - goto dlopenerror; - } - dls = loadModule(fullPath, sbuf, mode); - - dlopenok: - dounlock(); - return (void *)dls; - dlopenerror: - dounlock(); - return NULL; -} - -#if !FINK_BUILD -static void *SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol) -{ - int sym_len = SDL_strlen(symbol); - void *value = NULL; - char *malloc_sym = NULL; - dolock(); - malloc_sym = SDL_malloc(sym_len + 2); - if (malloc_sym) - { - SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol); - value = dlsymIntern(handle, malloc_sym, 1); - SDL_free(malloc_sym); - } - else - { - error("Unable to allocate memory"); - goto dlsymerror; - } - dounlock(); - return value; - dlsymerror: - dounlock(); - return NULL; -} -#endif - -#if FINK_BUILD - -static void *dlsym_prepend_underscore(void *handle, const char *symbol) -{ - void *answer; - dolock(); - answer = dlsym_prepend_underscore_intern(handle, symbol); - dounlock(); - return answer; -} - -static void *dlsym_prepend_underscore_intern(void *handle, const char *symbol) -{ -/* - * A quick and easy way for porting packages which call dlsym(handle,"sym") - * If the porter adds -Ddlsym=dlsym_prepend_underscore to the CFLAGS then - * this function will be called, and will add the required underscore. - * - * Note that I haven't figured out yet which should be "standard", prepend - * the underscore always, or not at all. These global functions need to go away - * for opendarwin. - */ - int sym_len = SDL_strlen(symbol); - void *value = NULL; - char *malloc_sym = NULL; - malloc_sym = SDL_malloc(sym_len + 2); - if (malloc_sym) - { - SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol); - value = dlsymIntern(handle, malloc_sym, 1); - SDL_free(malloc_sym); - } - else - { - error("Unable to allocate memory"); - } - return value; -} - -static void *dlsym_auto_underscore(void *handle, const char *symbol) -{ - void *answer; - dolock(); - answer = dlsym_auto_underscore_intern(handle, symbol); - dounlock(); - return answer; - -} -static void *dlsym_auto_underscore_intern(void *handle, const char *symbol) -{ - struct dlstatus *dls = handle; - void *addr = 0; - addr = dlsymIntern(dls, symbol, 0); - if (!addr) - addr = dlsym_prepend_underscore_intern(handle, symbol); - return addr; -} - - -static void *SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol) -{ - struct dlstatus *dls = handle; - void *addr = 0; - dolock(); - addr = dlsymIntern(dls, symbol, 1); - dounlock(); - return addr; -} -#endif - -static int SDL_OSX_dlclose(void *handle) -{ - struct dlstatus *dls = handle; - dolock(); - resetdlerror(); - if (!isValidStatus(dls)) - { - goto dlcloseerror; - } - if (dls->module == MAGIC_DYLIB_MOD) - { - const char *name; - if (!dls->lib) - { - name = "global context"; - } - else - { - name = get_lib_name(dls->lib); - } - warning("trying to close a .dylib!"); - error("Not closing \"%s\" - dynamic libraries cannot be closed", name); - goto dlcloseerror; - } - if (!dls->module) - { - error("module already closed"); - goto dlcloseerror; - } - - if (dls->refs == 1) - { - unsigned long options = 0; - void (*fini) (void); - if ((fini = dlsymIntern(dls, "__fini", 0))) - { - debug("calling _fini()"); - fini(); - } - options |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; -#ifdef RTLD_NODELETE - if (isFlagSet(dls->mode, RTLD_NODELETE)) - options |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; -#endif - if (!NSUnLinkModule(dls->module, options)) - { - error("unable to unlink module"); - goto dlcloseerror; - } - dls->refs--; - dls->module = 0; - /* Note: the dlstatus struct dls is neither removed from the list - * nor is the memory it occupies freed. This shouldn't pose a - * problem in mostly all cases, though. - */ - } - dounlock(); - return 0; - dlcloseerror: - dounlock(); - return 1; -} - -static const char *SDL_OSX_dlerror(void) -{ - struct dlthread *tss; - const char * err_str = NULL; - dlcompat_init_check(); - tss = pthread_getspecific(dlerror_key); - if (tss != NULL && tss->errset != 0) { - tss->errset = 0; - err_str = tss->errstr; - } - return (err_str); -} - -/* Given an address, return the mach_header for the image containing it - * or zero if the given address is not contained in any loaded images. - */ -static const struct mach_header *image_for_address(const void *address) -{ - unsigned long i; - unsigned long j; - unsigned long count = _dyld_image_count(); - const struct mach_header *mh = 0; - struct load_command *lc = 0; - unsigned long addr = 0; - for (i = 0; i < count; i++) - { - addr = (unsigned long)address - _dyld_get_image_vmaddr_slide(i); - mh = _dyld_get_image_header(i); - if (mh) - { - lc = (struct load_command *)((char *)mh + sizeof(struct mach_header)); - for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize)) - { - if (LC_SEGMENT == lc->cmd && - addr >= ((struct segment_command *)lc)->vmaddr && - addr < - ((struct segment_command *)lc)->vmaddr + ((struct segment_command *)lc)->vmsize) - { - goto image_found; - } - } - } - mh = 0; - } - image_found: - return mh; -} - -#if 0 /* unused */ -static int SDL_OSX_dladdr(const void * dl_restrict p, SDL_OSX_Dl_info * dl_restrict info) -{ -/* - FIXME: USe the routine image_for_address. -*/ - unsigned long i; - unsigned long j; - unsigned long count = _dyld_image_count(); - struct mach_header *mh = 0; - struct load_command *lc = 0; - unsigned long addr = NULL; - unsigned long table_off = (unsigned long)0; - int found = 0; - if (!info) - return 0; - dolock(); - resetdlerror(); - info->dli_fname = 0; - info->dli_fbase = 0; - info->dli_sname = 0; - info->dli_saddr = 0; -/* Some of this was swiped from code posted by Douglas Davidson - * to darwin-development AT lists DOT apple DOT com and slightly modified - */ - for (i = 0; i < count; i++) - { - addr = (unsigned long)p - _dyld_get_image_vmaddr_slide(i); - mh = _dyld_get_image_header(i); - if (mh) - { - lc = (struct load_command *)((char *)mh + sizeof(struct mach_header)); - for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize)) - { - if (LC_SEGMENT == lc->cmd && - addr >= ((struct segment_command *)lc)->vmaddr && - addr < - ((struct segment_command *)lc)->vmaddr + ((struct segment_command *)lc)->vmsize) - { - info->dli_fname = _dyld_get_image_name(i); - info->dli_fbase = (void *)mh; - found = 1; - break; - } - } - if (found) - break; - } - } - if (!found) - { - dounlock(); - return 0; - } - lc = (struct load_command *)((char *)mh + sizeof(struct mach_header)); - for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize)) - { - if (LC_SEGMENT == lc->cmd) - { - if (!SDL_strcmp(((struct segment_command *)lc)->segname, "__LINKEDIT")) - break; - } - } - table_off = - ((unsigned long)((struct segment_command *)lc)->vmaddr) - - ((unsigned long)((struct segment_command *)lc)->fileoff) + _dyld_get_image_vmaddr_slide(i); - debug("table off %x", table_off); - - lc = (struct load_command *)((char *)mh + sizeof(struct mach_header)); - for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize)) - { - if (LC_SYMTAB == lc->cmd) - { - - struct nlist *symtable = (struct nlist *)(((struct symtab_command *)lc)->symoff + table_off); - unsigned long numsyms = ((struct symtab_command *)lc)->nsyms; - struct nlist *nearest = NULL; - unsigned long diff = 0xffffffff; - unsigned long strtable = (unsigned long)(((struct symtab_command *)lc)->stroff + table_off); - debug("symtable %x", symtable); - for (i = 0; i < numsyms; i++) - { - /* Ignore the following kinds of Symbols */ - if ((!symtable->n_value) /* Undefined */ - || (symtable->n_type >= N_PEXT) /* Debug symbol */ - || (!(symtable->n_type & N_EXT)) /* Local Symbol */ - ) - { - symtable++; - continue; - } - if ((addr >= symtable->n_value) && (diff >= (symtable->n_value - addr))) - { - diff = (unsigned long)symtable->n_value - addr; - nearest = symtable; - } - symtable++; - } - if (nearest) - { - info->dli_saddr = nearest->n_value + ((void *)p - addr); - info->dli_sname = (char *)(strtable + nearest->n_un.n_strx); - } - } - } - dounlock(); - return 1; -} -#endif - -/* - * Implement the dlfunc() interface, which behaves exactly the same as - * dlsym() except that it returns a function pointer instead of a data - * pointer. This can be used by applications to avoid compiler warnings - * about undefined behavior, and is intended as prior art for future - * POSIX standardization. This function requires that all pointer types - * have the same representation, which is true on all platforms FreeBSD - * runs on, but is not guaranteed by the C standard. - */ -#if 0 -static dlfunc_t SDL_OSX_dlfunc(void * dl_restrict handle, const char * dl_restrict symbol) -{ - union - { - void *d; - dlfunc_t f; - } rv; - int sym_len = SDL_strlen(symbol); - char *malloc_sym = NULL; - dolock(); - malloc_sym = SDL_malloc(sym_len + 2); - if (malloc_sym) - { - SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol); - rv.d = dlsymIntern(handle, malloc_sym, 1); - SDL_free(malloc_sym); - } - else - { - error("Unable to allocate memory"); - goto dlfuncerror; - } - dounlock(); - return rv.f; - dlfuncerror: - dounlock(); - return NULL; -} -#endif - - - -/* dlcompat ends, here's the SDL interface... --ryan. */ - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent library loading routines */ - -#include "SDL_loadso.h" - -void *SDL_LoadObject(const char *sofile) -{ - void *handle = SDL_OSX_dlopen(sofile, RTLD_NOW); - const char *loaderror = SDL_OSX_dlerror(); - if ( handle == NULL ) { - SDL_SetError("Failed loading %s: %s", sofile, loaderror); - } - return(handle); -} - -void *SDL_LoadFunction(void *handle, const char *name) -{ - void *symbol = SDL_OSX_dlsym(handle, name); - if ( symbol == NULL ) { - SDL_SetError("Failed loading %s: %s", name, SDL_OSX_dlerror()); - } - return(symbol); -} - -void SDL_UnloadObject(void *handle) -{ - if ( handle != NULL ) { - SDL_OSX_dlclose(handle); - } -} - -#endif /* SDL_LOADSO_DLCOMPAT */ diff --git a/src/loadso/mint/SDL_sysloadso.c b/src/loadso/mint/SDL_sysloadso.c deleted file mode 100644 index d6dd732ca8..0000000000 --- a/src/loadso/mint/SDL_sysloadso.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_LOADSO_LDG - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent library loading routines */ - -#include -#include -#include - -#include "SDL_loadso.h" - -void *SDL_LoadObject(const char *sofile) -{ - const char *loaderror = "Unknown error"; - void *handle = (void *)ldg_open((char *)sofile, ldg_global); - if ( handle == NULL ) { - SDL_SetError("Failed loading %s: %s", sofile, loaderror); - } - return(handle); -} - -void *SDL_LoadFunction(void *handle, const char *name) -{ - const char *loaderror = "Unknown error"; - void *symbol = (void *)ldg_find((char *)name, (LDG *)handle); - if ( symbol == NULL ) { - SDL_SetError("Failed loading %s: %s", name, loaderror); - } - return(symbol); -} - -void SDL_UnloadObject(void *handle) -{ - if ( handle != NULL ) { - ldg_close((LDG *)handle, ldg_global); - } -} - -#endif /* SDL_LOADSO_LDG */ diff --git a/src/loadso/os2/SDL_sysloadso.c b/src/loadso/os2/SDL_sysloadso.c deleted file mode 100644 index 62ea536dd0..0000000000 --- a/src/loadso/os2/SDL_sysloadso.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_LOADSO_OS2 - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent library loading routines */ - -#include -#define INCL_DOSERRORS -#define INCL_DOSMODULEMGR -#include - -#include "SDL_loadso.h" - -void *SDL_LoadObject(const char *sofile) -{ - HMODULE handle = NULL; - char buf[512]; - APIRET ulrc = DosLoadModule(buf, sizeof (buf), (char *) sofile, &handle); - - /* Generate an error message if all loads failed */ - if ((ulrc != NO_ERROR) || (handle == NULL)) - SDL_SetError("Failed loading %s: %s", sofile, buf); - - return((void *) handle); -} - -void *SDL_LoadFunction(void *handle, const char *name) -{ - const char *loaderror = "Unknown error"; - void *symbol = NULL; - APIRET ulrc = DosQueryProcAddr((HMODULE)handle, 0, (char *)name, &symbol); - if (ulrc == ERROR_INVALID_HANDLE) - loaderror = "Invalid module handle"; - else if (ulrc == ERROR_INVALID_NAME) - loaderror = "Symbol not found"; - - if (symbol == NULL) - SDL_SetError("Failed loading %s: %s", name, loaderror); - - return(symbol); -} - -void SDL_UnloadObject(void *handle) -{ - if ( handle != NULL ) - DosFreeModule((HMODULE) handle); -} - -#endif /* SDL_LOADSO_OS2 */ diff --git a/src/loadso/win32/SDL_sysloadso.c b/src/loadso/win32/SDL_sysloadso.c deleted file mode 100644 index 784c7e7786..0000000000 --- a/src/loadso/win32/SDL_sysloadso.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_LOADSO_WIN32 - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* System dependent library loading routines */ - -#define WIN32_LEAN_AND_MEAN -#include - -#include "SDL_loadso.h" - -void *SDL_LoadObject(const char *sofile) -{ - void *handle = NULL; - const char *loaderror = "Unknown error"; - -#if defined(_WIN32_WCE) - char errbuf[512]; - - wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t)); - wchar_t *sofile_t = SDL_malloc((MAX_PATH+1) * sizeof(wchar_t)); - - MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, sofile, -1, sofile_t, MAX_PATH); - handle = (void *)LoadLibrary(sofile_t); - - /* Generate an error message if all loads failed */ - if ( handle == NULL ) { - FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM), - NULL, GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - errbuf_t, SDL_arraysize(errbuf), NULL); - WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL); - loaderror = errbuf; - } - - SDL_free(sofile_t); - SDL_free(errbuf_t); - -#else /*if defined(__WIN32__)*/ - char errbuf[512]; - - handle = (void *)LoadLibrary(sofile); - - /* Generate an error message if all loads failed */ - if ( handle == NULL ) { - FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM), - NULL, GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - errbuf, SDL_arraysize(errbuf), NULL); - loaderror = errbuf; - } -#endif - - if ( handle == NULL ) { - SDL_SetError("Failed loading %s: %s", sofile, loaderror); - } - return(handle); -} - -void *SDL_LoadFunction(void *handle, const char *name) -{ - void *symbol = NULL; - const char *loaderror = "Unknown error"; - -#if defined(_WIN32_WCE) - char errbuf[512]; - int length = SDL_strlen(name); - - wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t)); - wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t)); - - MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length+1); - - symbol = (void *)GetProcAddress((HMODULE)handle, name_t); - if ( symbol == NULL ) { - FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM), - NULL, GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - errbuf_t, SDL_arraysize(errbuf), NULL); - WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL); - loaderror = errbuf; - } - - SDL_free(name_t); - SDL_free(errbuf_t); - -#else /*if defined(WIN32)*/ - char errbuf[512]; - - symbol = (void *)GetProcAddress((HMODULE)handle, name); - if ( symbol == NULL ) { - FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM), - NULL, GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - errbuf, SDL_arraysize(errbuf), NULL); - loaderror = errbuf; - } -#endif - - if ( symbol == NULL ) { - SDL_SetError("Failed loading %s: %s", name, loaderror); - } - return(symbol); -} - -void SDL_UnloadObject(void *handle) -{ - if ( handle != NULL ) { - FreeLibrary((HMODULE)handle); - } -} - -#endif /* SDL_LOADSO_WIN32 */ diff --git a/src/loadso/windows/SDL_sysloadso.c b/src/loadso/windows/SDL_sysloadso.c new file mode 100644 index 0000000000..21e7a6c546 --- /dev/null +++ b/src/loadso/windows/SDL_sysloadso.c @@ -0,0 +1,72 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef SDL_LOADSO_WINDOWS + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* System dependent library loading routines */ + +#include "../../core/windows/SDL_windows.h" + +#include "SDL_loadso.h" + +void * +SDL_LoadObject(const char *sofile) +{ + LPTSTR tstr = WIN_UTF8ToString(sofile); + void *handle = (void *) LoadLibrary(tstr); + SDL_free(tstr); + + /* Generate an error message if all loads failed */ + if (handle == NULL) { + char errbuf[512]; + SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf)); + SDL_strlcat(errbuf, sofile, SDL_arraysize(errbuf)); + WIN_SetError(errbuf); + } + return handle; +} + +void * +SDL_LoadFunction(void *handle, const char *name) +{ + void *symbol = (void *) GetProcAddress((HMODULE) handle, name); + if (symbol == NULL) { + char errbuf[512]; + SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf)); + SDL_strlcat(errbuf, name, SDL_arraysize(errbuf)); + WIN_SetError(errbuf); + } + return symbol; +} + +void +SDL_UnloadObject(void *handle) +{ + if (handle != NULL) { + FreeLibrary((HMODULE) handle); + } +} + +#endif /* SDL_LOADSO_WINDOWS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/main/android/SDL_android_main.c b/src/main/android/SDL_android_main.c new file mode 100644 index 0000000000..0622a12c4e --- /dev/null +++ b/src/main/android/SDL_android_main.c @@ -0,0 +1,38 @@ + +#include "SDL_config.h" + +#ifdef __ANDROID__ + +/* Include the SDL main definition header */ +#include "SDL_main.h" + +/******************************************************************************* + Functions called by JNI +*******************************************************************************/ +#include + +// Called before SDL_main() to initialize JNI bindings in SDL library +extern void SDL_Android_Init(JNIEnv* env, jclass cls); + +// Start up the SDL app +void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj) +{ + /* This interface could expand with ABI negotiation, calbacks, etc. */ + SDL_Android_Init(env, cls); + + SDL_SetMainReady(); + + /* Run the application code! */ + int status; + char *argv[2]; + argv[0] = SDL_strdup("SDL_app"); + argv[1] = NULL; + status = SDL_main(1, argv); + + /* Do not issue an exit or the whole application will terminate instead of just the SDL thread */ + //exit(status); +} + +#endif /* __ANDROID__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/main/beos/SDL_BApp.h b/src/main/beos/SDL_BApp.h new file mode 100644 index 0000000000..2a64455b68 --- /dev/null +++ b/src/main/beos/SDL_BApp.h @@ -0,0 +1,380 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#ifndef SDL_BAPP_H +#define SDL_BAPP_H + +#include +#include + +#include "../../video/bwindow/SDL_bkeyboard.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "SDL_config.h" + +#include "SDL_video.h" + +/* Local includes */ +#include "../../events/SDL_events_c.h" +#include "../../video/bwindow/SDL_bkeyboard.h" +#include "../../video/bwindow/SDL_bframebuffer.h" + +#ifdef __cplusplus +} +#endif + +#include + + + + +/* Forward declarations */ +class SDL_BWin; + +/* Message constants */ +enum ToSDL { + /* Intercepted by BWindow on its way to BView */ + BAPP_MOUSE_MOVED, + BAPP_MOUSE_BUTTON, + BAPP_MOUSE_WHEEL, + BAPP_KEY, + BAPP_REPAINT, /* from _UPDATE_ */ + /* From BWindow */ + BAPP_MAXIMIZE, /* from B_ZOOM */ + BAPP_MINIMIZE, + BAPP_RESTORE, /* TODO: IMPLEMENT! */ + BAPP_SHOW, + BAPP_HIDE, + BAPP_MOUSE_FOCUS, /* caused by MOUSE_MOVE */ + BAPP_KEYBOARD_FOCUS, /* from WINDOW_ACTIVATED */ + BAPP_WINDOW_CLOSE_REQUESTED, + BAPP_WINDOW_MOVED, + BAPP_WINDOW_RESIZED, + BAPP_SCREEN_CHANGED +}; + + + +/* Create a descendant of BApplication */ +class SDL_BApp : public BApplication { +public: + SDL_BApp(const char* signature) : + BApplication(signature) { + _current_context = NULL; + } + + + virtual ~SDL_BApp() { + } + + + + /* Event-handling functions */ + virtual void MessageReceived(BMessage* message) { + /* Sort out SDL-related messages */ + switch ( message->what ) { + case BAPP_MOUSE_MOVED: + _HandleMouseMove(message); + break; + + case BAPP_MOUSE_BUTTON: + _HandleMouseButton(message); + break; + + case BAPP_MOUSE_WHEEL: + _HandleMouseWheel(message); + break; + + case BAPP_KEY: + _HandleKey(message); + break; + + case BAPP_REPAINT: + _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_EXPOSED); + break; + + case BAPP_MAXIMIZE: + _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_MAXIMIZED); + break; + + case BAPP_MINIMIZE: + _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_MINIMIZED); + break; + + case BAPP_SHOW: + _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_SHOWN); + break; + + case BAPP_HIDE: + _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_HIDDEN); + break; + + case BAPP_MOUSE_FOCUS: + _HandleMouseFocus(message); + break; + + case BAPP_KEYBOARD_FOCUS: + _HandleKeyboardFocus(message); + break; + + case BAPP_WINDOW_CLOSE_REQUESTED: + _HandleBasicWindowEvent(message, SDL_WINDOWEVENT_CLOSE); + break; + + case BAPP_WINDOW_MOVED: + _HandleWindowMoved(message); + break; + + case BAPP_WINDOW_RESIZED: + _HandleWindowResized(message); + break; + + case BAPP_SCREEN_CHANGED: + /* TODO: Handle screen resize or workspace change */ + break; + + default: + BApplication::MessageReceived(message); + break; + } + } + + /* Window creation/destruction methods */ + int32 GetID(SDL_Window *win) { + int32 i; + for(i = 0; i < _GetNumWindowSlots(); ++i) { + if( GetSDLWindow(i) == NULL ) { + _SetSDLWindow(win, i); + return i; + } + } + + /* Expand the vector if all slots are full */ + if( i == _GetNumWindowSlots() ) { + _PushBackWindow(win); + return i; + } + + /* TODO: error handling */ + return 0; + } + + /* FIXME: Bad coding practice, but I can't include SDL_BWin.h here. Is + there another way to do this? */ + void ClearID(SDL_BWin *bwin); /* Defined in SDL_BeApp.cc */ + + + SDL_Window *GetSDLWindow(int32 winID) { + return _window_map[winID]; + } + + void SetCurrentContext(BGLView *newContext) { + if(_current_context) + _current_context->UnlockGL(); + _current_context = newContext; + _current_context->LockGL(); + } +private: + /* Event management */ + void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) { + SDL_Window *win; + int32 winID; + if( + !_GetWinID(msg, &winID) + ) { + return; + } + win = GetSDLWindow(winID); + SDL_SendWindowEvent(win, sdlEventType, 0, 0); + } + + void _HandleMouseMove(BMessage *msg) { + SDL_Window *win; + int32 winID; + int32 x = 0, y = 0; + if( + !_GetWinID(msg, &winID) || + msg->FindInt32("x", &x) != B_OK || /* x movement */ + msg->FindInt32("y", &y) != B_OK /* y movement */ + ) { + return; + } + win = GetSDLWindow(winID); + SDL_SendMouseMotion(win, 0, 0, x, y); + + /* Tell the application that the mouse passed over, redraw needed */ + BE_UpdateWindowFramebuffer(NULL,win,NULL,-1); + } + + void _HandleMouseButton(BMessage *msg) { + SDL_Window *win; + int32 winID; + int32 button, state; /* left/middle/right, pressed/released */ + if( + !_GetWinID(msg, &winID) || + msg->FindInt32("button-id", &button) != B_OK || + msg->FindInt32("button-state", &state) != B_OK + ) { + return; + } + win = GetSDLWindow(winID); + SDL_SendMouseButton(win, 0, state, button); + } + + void _HandleMouseWheel(BMessage *msg) { + SDL_Window *win; + int32 winID; + int32 xTicks, yTicks; + if( + !_GetWinID(msg, &winID) || + msg->FindInt32("xticks", &xTicks) != B_OK || + msg->FindInt32("yticks", &yTicks) != B_OK + ) { + return; + } + win = GetSDLWindow(winID); + SDL_SendMouseWheel(win, 0, xTicks, yTicks); + } + + void _HandleKey(BMessage *msg) { + int32 scancode, state; /* scancode, pressed/released */ + if( + msg->FindInt32("key-state", &state) != B_OK || + msg->FindInt32("key-scancode", &scancode) != B_OK + ) { + return; + } + + /* Make sure this isn't a repeated event (key pressed and held) */ + if(state == SDL_PRESSED && BE_GetKeyState(scancode) == SDL_PRESSED) { + return; + } + BE_SetKeyState(scancode, state); + SDL_SendKeyboardKey(state, BE_GetScancodeFromBeKey(scancode)); + } + + void _HandleMouseFocus(BMessage *msg) { + SDL_Window *win; + int32 winID; + bool bSetFocus; /* If false, lose focus */ + if( + !_GetWinID(msg, &winID) || + msg->FindBool("focusGained", &bSetFocus) != B_OK + ) { + return; + } + win = GetSDLWindow(winID); + if(bSetFocus) { + SDL_SetMouseFocus(win); + } else if(SDL_GetMouseFocus() == win) { + /* Only lose all focus if this window was the current focus */ + SDL_SetMouseFocus(NULL); + } + } + + void _HandleKeyboardFocus(BMessage *msg) { + SDL_Window *win; + int32 winID; + bool bSetFocus; /* If false, lose focus */ + if( + !_GetWinID(msg, &winID) || + msg->FindBool("focusGained", &bSetFocus) != B_OK + ) { + return; + } + win = GetSDLWindow(winID); + if(bSetFocus) { + SDL_SetKeyboardFocus(win); + } else if(SDL_GetKeyboardFocus() == win) { + /* Only lose all focus if this window was the current focus */ + SDL_SetKeyboardFocus(NULL); + } + } + + void _HandleWindowMoved(BMessage *msg) { + SDL_Window *win; + int32 winID; + int32 xPos, yPos; + /* Get the window id and new x/y position of the window */ + if( + !_GetWinID(msg, &winID) || + msg->FindInt32("window-x", &xPos) != B_OK || + msg->FindInt32("window-y", &yPos) != B_OK + ) { + return; + } + win = GetSDLWindow(winID); + SDL_SendWindowEvent(win, SDL_WINDOWEVENT_MOVED, xPos, yPos); + } + + void _HandleWindowResized(BMessage *msg) { + SDL_Window *win; + int32 winID; + int32 w, h; + /* Get the window id ]and new x/y position of the window */ + if( + !_GetWinID(msg, &winID) || + msg->FindInt32("window-w", &w) != B_OK || + msg->FindInt32("window-h", &h) != B_OK + ) { + return; + } + win = GetSDLWindow(winID); + SDL_SendWindowEvent(win, SDL_WINDOWEVENT_RESIZED, w, h); + } + + bool _GetWinID(BMessage *msg, int32 *winID) { + return msg->FindInt32("window-id", winID) == B_OK; + } + + + + /* Vector functions: Wraps vector stuff in case we need to change + implementation */ + void _SetSDLWindow(SDL_Window *win, int32 winID) { + _window_map[winID] = win; + } + + int32 _GetNumWindowSlots() { + return _window_map.size(); + } + + + void _PopBackWindow() { + _window_map.pop_back(); + } + + void _PushBackWindow(SDL_Window *win) { + _window_map.push_back(win); + } + + + /* Members */ + vector _window_map; /* Keeps track of SDL_Windows by index-id*/ + + display_mode *_saved_mode; + BGLView *_current_context; +}; + +#endif diff --git a/src/main/beos/SDL_BeApp.cc b/src/main/beos/SDL_BeApp.cc index 8b793779ac..fb622ab1dd 100644 --- a/src/main/beos/SDL_BeApp.cc +++ b/src/main/beos/SDL_BeApp.cc @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#if defined(__BEOS__) || defined(__HAIKU__) + /* Handle the BeApp specific portions of the application */ #include @@ -28,84 +29,108 @@ #include #include +#include "SDL_BApp.h" /* SDL_BApp class definition */ #include "SDL_BeApp.h" #include "SDL_thread.h" #include "SDL_timer.h" #include "SDL_error.h" +#include "../../video/bwindow/SDL_BWin.h" + +#ifdef __cplusplus +extern "C" { +#endif /* Flag to tell whether or not the Be application is active or not */ int SDL_BeAppActive = 0; static SDL_Thread *SDL_AppThread = NULL; -static int StartBeApp(void *unused) +static int +StartBeApp(void *unused) { - if(!be_app) { - BApplication *App; + BApplication *App; - App = new BApplication("application/x-SDL-executable"); + App = new SDL_BApp("application/x-SDL-executable"); - App->Run(); - delete App; - } - return(0); + App->Run(); + delete App; + return (0); } /* Initialize the Be Application, if it's not already started */ -int SDL_InitBeApp(void) +int +SDL_InitBeApp(void) { - /* Create the BApplication that handles appserver interaction */ - if ( SDL_BeAppActive <= 0 ) { - SDL_AppThread = SDL_CreateThread(StartBeApp, NULL); - if ( SDL_AppThread == NULL ) { - SDL_SetError("Couldn't create BApplication thread"); - return(-1); - } - - /* Change working to directory to that of executable */ - app_info info; - if (B_OK == be_app->GetAppInfo(&info)) { - entry_ref ref = info.ref; - BEntry entry; - if (B_OK == entry.SetTo(&ref)) { - BPath path; - if (B_OK == path.SetTo(&entry)) { - if (B_OK == path.GetParent(&path)) { - chdir(path.Path()); - } - } - } - } - - do { - SDL_Delay(10); - } while ( (be_app == NULL) || be_app->IsLaunching() ); - - /* Mark the application active */ - SDL_BeAppActive = 0; - } - - /* Increment the application reference count */ - ++SDL_BeAppActive; - - /* The app is running, and we're ready to go */ - return(0); + /* Create the BApplication that handles appserver interaction */ + if (SDL_BeAppActive <= 0) { + SDL_AppThread = SDL_CreateThread(StartBeApp, "SDLApplication", NULL); + if (SDL_AppThread == NULL) { + return SDL_SetError("Couldn't create BApplication thread"); + } + + /* Change working to directory to that of executable */ + app_info info; + if (B_OK == be_app->GetAppInfo(&info)) { + entry_ref ref = info.ref; + BEntry entry; + if (B_OK == entry.SetTo(&ref)) { + BPath path; + if (B_OK == path.SetTo(&entry)) { + if (B_OK == path.GetParent(&path)) { + chdir(path.Path()); + } + } + } + } + + do { + SDL_Delay(10); + } while ((be_app == NULL) || be_app->IsLaunching()); + + /* Mark the application active */ + SDL_BeAppActive = 0; + } + + /* Increment the application reference count */ + ++SDL_BeAppActive; + + /* The app is running, and we're ready to go */ + return (0); } /* Quit the Be Application, if there's nothing left to do */ -void SDL_QuitBeApp(void) +void +SDL_QuitBeApp(void) { - /* Decrement the application reference count */ - --SDL_BeAppActive; - - /* If the reference count reached zero, clean up the app */ - if ( SDL_BeAppActive == 0 ) { - if ( SDL_AppThread != NULL ) { - if ( be_app != NULL ) { /* Not tested */ - be_app->PostMessage(B_QUIT_REQUESTED); - } - SDL_WaitThread(SDL_AppThread, NULL); - SDL_AppThread = NULL; - } - /* be_app should now be NULL since be_app has quit */ + /* Decrement the application reference count */ + --SDL_BeAppActive; + + /* If the reference count reached zero, clean up the app */ + if (SDL_BeAppActive == 0) { + if (SDL_AppThread != NULL) { + if (be_app != NULL) { /* Not tested */ + be_app->PostMessage(B_QUIT_REQUESTED); + } + SDL_WaitThread(SDL_AppThread, NULL); + SDL_AppThread = NULL; + } + /* be_app should now be NULL since be_app has quit */ + } +} + +#ifdef __cplusplus +} +#endif + +/* SDL_BApp functions */ +void SDL_BApp::ClearID(SDL_BWin *bwin) { + _SetSDLWindow(NULL, bwin->GetID()); + int32 i = _GetNumWindowSlots() - 1; + while(i >= 0 && GetSDLWindow(i) == NULL) { + _PopBackWindow(); + --i; } } + +#endif /* __BEOS__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/main/beos/SDL_BeApp.h b/src/main/beos/SDL_BeApp.h index 9f88212438..5bc5251d34 100644 --- a/src/main/beos/SDL_BeApp.h +++ b/src/main/beos/SDL_BeApp.h @@ -1,26 +1,29 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" + +#ifdef __cplusplus +extern "C" { +#endif /* Handle the BeApp specific portions of the application */ /* Initialize the Be Application, if it's not already started */ @@ -31,3 +34,8 @@ extern void SDL_QuitBeApp(void); /* Flag to tell whether the app is active or not */ extern int SDL_BeAppActive; +/* vi: set ts=4 sw=4 expandtab: */ + +#ifdef __cplusplus +} +#endif diff --git a/src/main/dummy/SDL_dummy_main.c b/src/main/dummy/SDL_dummy_main.c index da47d06a87..87955239a8 100644 --- a/src/main/dummy/SDL_dummy_main.c +++ b/src/main/dummy/SDL_dummy_main.c @@ -1,13 +1,25 @@ /* Include the SDL main definition header */ +#include "SDL_config.h" #include "SDL_main.h" #ifdef main #undef main -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { - return(SDL_main(argc, argv)); + return (SDL_main(argc, argv)); } #else /* Nothing to do on this platform */ +int +SDL_main_stub_symbol(void); + +int +SDL_main_stub_symbol(void) +{ + return 0; +} #endif + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/main/macos/SDL.r b/src/main/macos/SDL.r deleted file mode 100644 index 438f6872ef..0000000000 --- a/src/main/macos/SDL.r +++ /dev/null @@ -1 +0,0 @@ -data 'DLOG' (1000) { $"0072 0040 00EA 01B3 0001 0100 0000 0000 0000 03E8 0C43 6F6D 6D61 6E64 204C 696E" /* .r.@.ê.³...........è.Command Lin */ $"6500 280A" /* e.( */ }; data 'DLOG' (1001) { $"0072 0040 00DB 01AC 0001 0100 0000 0000 0000 03E9 0C45 7272 6F72 2057 696E 646F" /* .r.@.Û.¬...........é.Error Windo */ $"7700 280A" /* w.( */ }; data 'DLOG' (1002) { $"00B8 00BE 0147 01D8 0005 0100 0000 0000 0000 03EA 1643 6F6E 6669 726D 2044 6973" /* .¸.¾.G.Ø...........ê.Confirm Dis */ $"706C 6179 2043 6861 6E67 6510 280A" /* play Change.( */ }; data 'DITL' (1000) { $"0005 0000 0000 0052 0113 0066 0158 0402 4F4B 0000 0000 0052 00C2 0066 0107 0406" /* .......R...f.X..OK.....R.Â.f.... */ $"4361 6E63 656C 0000 0000 000F 0084 001F 0155 1000 0000 0000 0054 0019 0066 007D" /* Cancel.......„...U.......T...f.} */ $"050E 4F75 7470 7574 2074 6F20 6669 6C65 0000 0000 000F 0018 001F 007F 080D 436F" /* ..Output to file..............Co */ $"6D6D 616E 6420 4C69 6E65 3A00 0000 0000 0030 0018 0040 0158 0702 0080" /* mmand Line:......0...@.X...€ */ }; data 'DITL' (1001) { $"0001 0000 0000 0046 0120 005A 015A 0402 4F4B 0000 0000 0010 000A 0038 0160 0800" /* .......F. .Z.Z..OK.......Â.8.`.. */ }; data 'DITL' (1002) { $"0002 0000 0000 006F 001E 0083 0058 0406 4361 6E63 656C 0000 0000 006E 00C0 0082" /* .......o...ƒ.X..Cancel.....n.À.‚ */ $"00FA 0402 4F4B 0000 0000 000E 000F 005F 010C 88B3 5468 6520 7365 7474 696E 6720" /* .ú..OK........._..ˆ³The setting */ $"666F 7220 796F 7572 206D 6F6E 6974 6F72 2068 6173 2062 6565 6E20 6368 616E 6765" /* for your monitor has been change */ $"642C 2061 6E64 2069 7420 6D61 7920 6E6F 7420 6265 2064 6973 706C 6179 6564 2063" /* d, and it may not be displayed c */ $"6F72 7265 6374 6C79 2E20 546F 2063 6F6E 6669 726D 2074 6865 2064 6973 706C 6179" /* orrectly. To confirm the display */ $"2069 7320 636F 7272 6563 742C 2063 6C69 636B 204F 4B2E 2054 6F20 7265 7475 726E" /* is correct, click OK. To return */ $"2074 6F20 7468 6520 6F72 6967 696E 616C 2073 6574 7469 6E67 2C20 636C 6963 6B20" /* to the original setting, click */ $"4361 6E63 656C 2E00" /* Cancel.. */ }; data 'MENU' (128, preload) { $"0080 0000 0000 0000 0000 FFFF FFFB 0114 0C41 626F 7574 2053 444C 2E2E 2E00 0000" /* .€........ÿÿÿû...About SDL...... */ $"0001 2D00 0000 0000" /* ..-..... */ }; data 'MENU' (129) { $"0081 0000 0000 0000 0000 FFFF FFFF 0C56 6964 656F 2044 7269 7665 7219 4472 6177" /* .........ÿÿÿÿ.Video Driver.Draw */ $"5370 726F 636B 6574 2028 4675 6C6C 7363 7265 656E 2900 0000 001E 546F 6F6C 426F" /* Sprocket (Fullscreen).....ToolBo */ $"7820 2028 4675 6C6C 7363 7265 656E 2F57 696E 646F 7765 6429 0000 0000 00" /* x (Fullscreen/Windowed)..... */ }; data 'CNTL' (128) { $"0000 0000 0010 0140 0000 0100 0064 0081 03F0 0000 0000 0D56 6964 656F 2044 7269" /* .......@.....d..ð.....Video Dri */ $"7665 723A" /* ver: */ }; data 'TMPL' (128, "CLne") { $"0C43 6F6D 6D61 6E64 204C 696E 6550 5354 520C 5669 6465 6F20 4472 6976 6572 5053" /* .Command LinePSTR.Video DriverPS */ $"5452 0C53 6176 6520 546F 2046 696C 6542 4F4F 4C" /* TR.Save To FileBOOL */ }; \ No newline at end of file diff --git a/src/main/macos/SDL.shlib.r b/src/main/macos/SDL.shlib.r deleted file mode 100644 index 313c79485a..0000000000 --- a/src/main/macos/SDL.shlib.r +++ /dev/null @@ -1 +0,0 @@ - #ifndef __TYPES_R__ #include "Types.r" #endif #ifndef __BALLOONS_R__ #include "Balloons.r" #endif #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define REVISION 13 #define STATE release /* development | alpha | beta | release */ #define RELEASE_NO 0 /* number after letter, or zero for release */ #define COUNTRY verUS #define VERSION_STRING "1.2.13" #define NAME "SDL" #define SHORT_DESCRIPTION "Simple DirectMedia Layer by Sam Lantinga" #define LONG_DESCRIPTION "A cross-platform multimedia library.\n\nhttp://www.libsdl.org" resource 'vers' (1) { VERSION_MAJOR, (VERSION_MINOR << 4) | REVISION, STATE, RELEASE_NO, COUNTRY, VERSION_STRING, VERSION_STRING }; resource 'vers' (2) { VERSION_MAJOR, (VERSION_MINOR << 4) | REVISION, STATE, RELEASE_NO, COUNTRY, VERSION_STRING, SHORT_DESCRIPTION }; /* Extension Manager info */ data 'CCI' (128) { NAME "\n\n" LONG_DESCRIPTION }; /* Finder help balloon */ resource 'hfdr' (kHMHelpID) { HelpMgrVersion, hmDefaultOptions, 0, 0, { HMStringItem { NAME "\n\n" LONG_DESCRIPTION } } }; \ No newline at end of file diff --git a/src/main/macos/SDL_main.c b/src/main/macos/SDL_main.c deleted file mode 100644 index ff1ffdca0d..0000000000 --- a/src/main/macos/SDL_main.c +++ /dev/null @@ -1,610 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* This file takes care of command line argument parsing, and stdio redirection - in the MacOS environment. (stdio/stderr is *not* directed for Mach-O builds) - */ - -#if defined(__APPLE__) && defined(__MACH__) -#include -#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335) -#include -#else -#include -#include -#include -#include -#include -#endif - -/* Include the SDL main definition header */ -#include "SDL.h" -#include "SDL_main.h" -#ifdef main -#undef main -#endif - -#if !(defined(__APPLE__) && defined(__MACH__)) -/* The standard output files */ -#define STDOUT_FILE "stdout.txt" -#define STDERR_FILE "stderr.txt" -#endif - -#if !defined(__MWERKS__) && !TARGET_API_MAC_CARBON - /* In MPW, the qd global has been removed from the libraries */ - QDGlobals qd; -#endif - -/* Structure for keeping prefs in 1 variable */ -typedef struct { - Str255 command_line; - Str255 video_driver_name; - Boolean output_to_file; -} PrefsRecord; - -/* See if the command key is held down at startup */ -static Boolean CommandKeyIsDown(void) -{ - KeyMap theKeyMap; - - GetKeys(theKeyMap); - - if (((unsigned char *) theKeyMap)[6] & 0x80) { - return(true); - } - return(false); -} - -#if !(defined(__APPLE__) && defined(__MACH__)) - -/* Parse a command line buffer into arguments */ -static int ParseCommandLine(char *cmdline, char **argv) -{ - char *bufp; - int argc; - - argc = 0; - for ( bufp = cmdline; *bufp; ) { - /* Skip leading whitespace */ - while ( SDL_isspace(*bufp) ) { - ++bufp; - } - /* Skip over argument */ - if ( *bufp == '"' ) { - ++bufp; - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && (*bufp != '"') ) { - ++bufp; - } - } else { - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && ! SDL_isspace(*bufp) ) { - ++bufp; - } - } - if ( *bufp ) { - if ( argv ) { - *bufp = '\0'; - } - ++bufp; - } - } - if ( argv ) { - argv[argc] = NULL; - } - return(argc); -} - -/* Remove the output files if there was no output written */ -static void cleanup_output(void) -{ - FILE *file; - int empty; - - /* Flush the output in case anything is queued */ - fclose(stdout); - fclose(stderr); - - /* See if the files have any output in them */ - file = fopen(STDOUT_FILE, "rb"); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - remove(STDOUT_FILE); - } - } - file = fopen(STDERR_FILE, "rb"); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - remove(STDERR_FILE); - } - } -} - -#endif //!(defined(__APPLE__) && defined(__MACH__)) - -static int getCurrentAppName (StrFileName name) { - - ProcessSerialNumber process; - ProcessInfoRec process_info; - FSSpec process_fsp; - - process.highLongOfPSN = 0; - process.lowLongOfPSN = kCurrentProcess; - process_info.processInfoLength = sizeof (process_info); - process_info.processName = NULL; - process_info.processAppSpec = &process_fsp; - - if ( noErr != GetProcessInformation (&process, &process_info) ) - return 0; - - SDL_memcpy(name, process_fsp.name, process_fsp.name[0] + 1); - return 1; -} - -static int getPrefsFile (FSSpec *prefs_fsp, int create) { - - /* The prefs file name is the application name, possibly truncated, */ - /* plus " Preferences */ - - #define SUFFIX " Preferences" - #define MAX_NAME 19 /* 31 - strlen (SUFFIX) */ - - short volume_ref_number; - long directory_id; - StrFileName prefs_name; - StrFileName app_name; - - /* Get Preferences folder - works with Multiple Users */ - if ( noErr != FindFolder ( kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder, - &volume_ref_number, &directory_id) ) - exit (-1); - - if ( ! getCurrentAppName (app_name) ) - exit (-1); - - /* Truncate if name is too long */ - if (app_name[0] > MAX_NAME ) - app_name[0] = MAX_NAME; - - SDL_memcpy(prefs_name + 1, app_name + 1, app_name[0]); - SDL_memcpy(prefs_name + app_name[0] + 1, SUFFIX, strlen (SUFFIX)); - prefs_name[0] = app_name[0] + strlen (SUFFIX); - - /* Make the file spec for prefs file */ - if ( noErr != FSMakeFSSpec (volume_ref_number, directory_id, prefs_name, prefs_fsp) ) { - if ( !create ) - return 0; - else { - /* Create the prefs file */ - SDL_memcpy(prefs_fsp->name, prefs_name, prefs_name[0] + 1); - prefs_fsp->parID = directory_id; - prefs_fsp->vRefNum = volume_ref_number; - - FSpCreateResFile (prefs_fsp, 0x3f3f3f3f, 'pref', 0); // '????' parsed as trigraph - - if ( noErr != ResError () ) - return 0; - } - } - return 1; -} - -static int readPrefsResource (PrefsRecord *prefs) { - - Handle prefs_handle; - - prefs_handle = Get1Resource( 'CLne', 128 ); - - if (prefs_handle != NULL) { - int offset = 0; -// int j = 0; - - HLock(prefs_handle); - - /* Get command line string */ - SDL_memcpy(prefs->command_line, *prefs_handle, (*prefs_handle)[0]+1); - - /* Get video driver name */ - offset += (*prefs_handle)[0] + 1; - SDL_memcpy(prefs->video_driver_name, *prefs_handle + offset, (*prefs_handle)[offset] + 1); - - /* Get save-to-file option (1 or 0) */ - offset += (*prefs_handle)[offset] + 1; - prefs->output_to_file = (*prefs_handle)[offset]; - - ReleaseResource( prefs_handle ); - - return ResError() == noErr; - } - - return 0; -} - -static int writePrefsResource (PrefsRecord *prefs, short resource_file) { - - Handle prefs_handle; - - UseResFile (resource_file); - - prefs_handle = Get1Resource ( 'CLne', 128 ); - if (prefs_handle != NULL) - RemoveResource (prefs_handle); - - prefs_handle = NewHandle ( prefs->command_line[0] + prefs->video_driver_name[0] + 4 ); - if (prefs_handle != NULL) { - - int offset; - - HLock (prefs_handle); - - /* Command line text */ - offset = 0; - SDL_memcpy(*prefs_handle, prefs->command_line, prefs->command_line[0] + 1); - - /* Video driver name */ - offset += prefs->command_line[0] + 1; - SDL_memcpy(*prefs_handle + offset, prefs->video_driver_name, prefs->video_driver_name[0] + 1); - - /* Output-to-file option */ - offset += prefs->video_driver_name[0] + 1; - *( *((char**)prefs_handle) + offset) = (char)prefs->output_to_file; - *( *((char**)prefs_handle) + offset + 1) = 0; - - AddResource (prefs_handle, 'CLne', 128, "\pCommand Line"); - WriteResource (prefs_handle); - UpdateResFile (resource_file); - DisposeHandle (prefs_handle); - - return ResError() == noErr; - } - - return 0; -} - -static int readPreferences (PrefsRecord *prefs) { - - int no_error = 1; - FSSpec prefs_fsp; - - /* Check for prefs file first */ - if ( getPrefsFile (&prefs_fsp, 0) ) { - - short prefs_resource; - - prefs_resource = FSpOpenResFile (&prefs_fsp, fsRdPerm); - if ( prefs_resource == -1 ) /* this shouldn't happen, but... */ - return 0; - - UseResFile (prefs_resource); - no_error = readPrefsResource (prefs); - CloseResFile (prefs_resource); - } - - /* Fall back to application's resource fork (reading only, so this is safe) */ - else { - - no_error = readPrefsResource (prefs); - } - - return no_error; -} - -static int writePreferences (PrefsRecord *prefs) { - - int no_error = 1; - FSSpec prefs_fsp; - - /* Get prefs file, create if it doesn't exist */ - if ( getPrefsFile (&prefs_fsp, 1) ) { - - short prefs_resource; - - prefs_resource = FSpOpenResFile (&prefs_fsp, fsRdWrPerm); - if (prefs_resource == -1) - return 0; - no_error = writePrefsResource (prefs, prefs_resource); - CloseResFile (prefs_resource); - } - - return no_error; -} - -/* This is where execution begins */ -int main(int argc, char *argv[]) -{ - -#if !(defined(__APPLE__) && defined(__MACH__)) -#pragma unused(argc, argv) -#endif - -#define DEFAULT_ARGS "\p" /* pascal string for default args */ -#define DEFAULT_VIDEO_DRIVER "\ptoolbox" /* pascal string for default video driver name */ -#define DEFAULT_OUTPUT_TO_FILE 1 /* 1 == output to file, 0 == no output */ - -#define VIDEO_ID_DRAWSPROCKET 1 /* these correspond to popup menu choices */ -#define VIDEO_ID_TOOLBOX 2 - - PrefsRecord prefs = { DEFAULT_ARGS, DEFAULT_VIDEO_DRIVER, DEFAULT_OUTPUT_TO_FILE }; - -#if !(defined(__APPLE__) && defined(__MACH__)) - int nargs; - char **args; - char *commandLine; - - StrFileName appNameText; -#endif - int videodriver = VIDEO_ID_TOOLBOX; - int settingsChanged = 0; - - long i; - - /* Kyle's SDL command-line dialog code ... */ -#if !TARGET_API_MAC_CARBON - InitGraf (&qd.thePort); - InitFonts (); - InitWindows (); - InitMenus (); - InitDialogs (nil); -#endif - InitCursor (); - FlushEvents(everyEvent,0); -#if !TARGET_API_MAC_CARBON - MaxApplZone (); -#endif - MoreMasters (); - MoreMasters (); -#if 0 - /* Intialize SDL, and put up a dialog if we fail */ - if ( SDL_Init (0) < 0 ) { - -#define kErr_OK 1 -#define kErr_Text 2 - - DialogPtr errorDialog; - short dummyType; - Rect dummyRect; - Handle dummyHandle; - short itemHit; - - errorDialog = GetNewDialog (1001, nil, (WindowPtr)-1); - if (errorDialog == NULL) - return -1; - DrawDialog (errorDialog); - - GetDialogItem (errorDialog, kErr_Text, &dummyType, &dummyHandle, &dummyRect); - SetDialogItemText (dummyHandle, "\pError Initializing SDL"); - -#if TARGET_API_MAC_CARBON - SetPort (GetDialogPort(errorDialog)); -#else - SetPort (errorDialog); -#endif - do { - ModalDialog (nil, &itemHit); - } while (itemHit != kErr_OK); - - DisposeDialog (errorDialog); - exit (-1); - } - atexit(cleanup_output); - atexit(SDL_Quit); -#endif - -/* Set up SDL's QuickDraw environment */ -#if !TARGET_API_MAC_CARBON - SDL_InitQuickDraw(&qd); -#endif - - if ( readPreferences (&prefs) ) { - - if (SDL_memcmp(prefs.video_driver_name+1, "DSp", 3) == 0) - videodriver = 1; - else if (SDL_memcmp(prefs.video_driver_name+1, "toolbox", 7) == 0) - videodriver = 2; - } - - if ( CommandKeyIsDown() ) { - -#define kCL_OK 1 -#define kCL_Cancel 2 -#define kCL_Text 3 -#define kCL_File 4 -#define kCL_Video 6 - - DialogPtr commandDialog; - short dummyType; - Rect dummyRect; - Handle dummyHandle; - short itemHit; - #if TARGET_API_MAC_CARBON - ControlRef control; - #endif - - /* Assume that they will change settings, rather than do exhaustive check */ - settingsChanged = 1; - - /* Create dialog and display it */ - commandDialog = GetNewDialog (1000, nil, (WindowPtr)-1); - #if TARGET_API_MAC_CARBON - SetPort ( GetDialogPort(commandDialog) ); - #else - SetPort (commandDialog); - #endif - - /* Setup controls */ - #if TARGET_API_MAC_CARBON - GetDialogItemAsControl(commandDialog, kCL_File, &control); - SetControlValue (control, prefs.output_to_file); - #else - GetDialogItem (commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */ - SetControlValue ((ControlHandle)dummyHandle, prefs.output_to_file ); - #endif - - GetDialogItem (commandDialog, kCL_Text, &dummyType, &dummyHandle, &dummyRect); - SetDialogItemText (dummyHandle, prefs.command_line); - - #if TARGET_API_MAC_CARBON - GetDialogItemAsControl(commandDialog, kCL_Video, &control); - SetControlValue (control, videodriver); - #else - GetDialogItem (commandDialog, kCL_Video, &dummyType, &dummyHandle, &dummyRect); - SetControlValue ((ControlRef)dummyHandle, videodriver); - #endif - - SetDialogDefaultItem (commandDialog, kCL_OK); - SetDialogCancelItem (commandDialog, kCL_Cancel); - - do { - - ModalDialog(nil, &itemHit); /* wait for user response */ - - /* Toggle command-line output checkbox */ - if ( itemHit == kCL_File ) { - #if TARGET_API_MAC_CARBON - GetDialogItemAsControl(commandDialog, kCL_File, &control); - SetControlValue (control, !GetControlValue(control)); - #else - GetDialogItem(commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */ - SetControlValue((ControlHandle)dummyHandle, !GetControlValue((ControlHandle)dummyHandle) ); - #endif - } - - } while (itemHit != kCL_OK && itemHit != kCL_Cancel); - - /* Get control values, even if they did not change */ - GetDialogItem (commandDialog, kCL_Text, &dummyType, &dummyHandle, &dummyRect); /* MJS */ - GetDialogItemText (dummyHandle, prefs.command_line); - - #if TARGET_API_MAC_CARBON - GetDialogItemAsControl(commandDialog, kCL_File, &control); - prefs.output_to_file = GetControlValue(control); - #else - GetDialogItem (commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */ - prefs.output_to_file = GetControlValue ((ControlHandle)dummyHandle); - #endif - - #if TARGET_API_MAC_CARBON - GetDialogItemAsControl(commandDialog, kCL_Video, &control); - videodriver = GetControlValue(control); - #else - GetDialogItem (commandDialog, kCL_Video, &dummyType, &dummyHandle, &dummyRect); - videodriver = GetControlValue ((ControlRef)dummyHandle); - #endif - - DisposeDialog (commandDialog); - - if (itemHit == kCL_Cancel ) { - exit (0); - } - } - - /* Set pseudo-environment variables for video driver, update prefs */ - switch ( videodriver ) { - case VIDEO_ID_DRAWSPROCKET: - SDL_putenv("SDL_VIDEODRIVER=DSp"); - SDL_memcpy(prefs.video_driver_name, "\pDSp", 4); - break; - case VIDEO_ID_TOOLBOX: - SDL_putenv("SDL_VIDEODRIVER=toolbox"); - SDL_memcpy(prefs.video_driver_name, "\ptoolbox", 8); - break; - } - -#if !(defined(__APPLE__) && defined(__MACH__)) - /* Redirect standard I/O to files */ - if ( prefs.output_to_file ) { - freopen (STDOUT_FILE, "w", stdout); - freopen (STDERR_FILE, "w", stderr); - } else { - fclose (stdout); - fclose (stderr); - } -#endif - - if (settingsChanged) { - /* Save the prefs, even if they might not have changed (but probably did) */ - if ( ! writePreferences (&prefs) ) - fprintf (stderr, "WARNING: Could not save preferences!\n"); - } - -#if !(defined(__APPLE__) && defined(__MACH__)) - appNameText[0] = 0; - getCurrentAppName (appNameText); /* check for error here ? */ - - commandLine = (char*) malloc (appNameText[0] + prefs.command_line[0] + 2); - if ( commandLine == NULL ) { - exit(-1); - } - - /* Rather than rewrite ParseCommandLine method, let's replace */ - /* any spaces in application name with underscores, */ - /* so that the app name is only 1 argument */ - for (i = 1; i < 1+appNameText[0]; i++) - if ( appNameText[i] == ' ' ) appNameText[i] = '_'; - - /* Copy app name & full command text to command-line C-string */ - SDL_memcpy(commandLine, appNameText + 1, appNameText[0]); - commandLine[appNameText[0]] = ' '; - SDL_memcpy(commandLine + appNameText[0] + 1, prefs.command_line + 1, prefs.command_line[0]); - commandLine[ appNameText[0] + 1 + prefs.command_line[0] ] = '\0'; - - /* Parse C-string into argv and argc */ - nargs = ParseCommandLine (commandLine, NULL); - args = (char **)malloc((nargs+1)*(sizeof *args)); - if ( args == NULL ) { - exit(-1); - } - ParseCommandLine (commandLine, args); - - /* Run the main application code */ - SDL_main(nargs, args); - free (args); - free (commandLine); - - /* Remove useless stdout.txt and stderr.txt */ - cleanup_output (); -#else // defined(__APPLE__) && defined(__MACH__) - SDL_main(argc, argv); -#endif - - /* Exit cleanly, calling atexit() functions */ - exit (0); - - /* Never reached, but keeps the compiler quiet */ - return (0); -} diff --git a/src/main/macos/SIZE.r b/src/main/macos/SIZE.r deleted file mode 100644 index 940f37fc7f..0000000000 --- a/src/main/macos/SIZE.r +++ /dev/null @@ -1 +0,0 @@ - #include "Processes.r" resource 'SIZE' (-1) { reserved, acceptSuspendResumeEvents, reserved, canBackground, doesActivateOnFGSwitch, backgroundAndForeground, getFrontClicks, ignoreAppDiedEvents, is32BitCompatible, isHighLevelEventAware, onlyLocalHLEvents, notStationeryAware, useTextEditServices, reserved, reserved, reserved, 5242880, // 5 megs minimum 5242880 // 5 megs maximum }; \ No newline at end of file diff --git a/src/main/macos/exports/Makefile b/src/main/macos/exports/Makefile deleted file mode 100644 index 5f37ae0760..0000000000 --- a/src/main/macos/exports/Makefile +++ /dev/null @@ -1,39 +0,0 @@ - -EXPORTS = SDL.x -HEADERS = \ - ../../../../include/SDL.h \ - ../../../../include/SDL_active.h \ - ../../../../include/SDL_audio.h \ - ../../../../include/SDL_byteorder.h \ - ../../../../include/SDL_cdrom.h \ - ../../../../include/SDL_copying.h \ - ../../../../include/SDL_cpuinfo.h \ - ../../../../include/SDL_endian.h \ - ../../../../include/SDL_error.h \ - ../../../../include/SDL_events.h \ - ../../../../include/SDL_getenv.h \ - ../../../../include/SDL_joystick.h \ - ../../../../include/SDL_keyboard.h \ - ../../../../include/SDL_keysym.h \ - ../../../../include/SDL_loadso.h \ - ../../../../include/SDL_mouse.h \ - ../../../../include/SDL_mutex.h \ - ../../../../include/SDL_name.h \ - ../../../../include/SDL_platform.h \ - ../../../../include/SDL_quit.h \ - ../../../../include/SDL_rwops.h \ - ../../../../include/SDL_syswm.h \ - ../../../../include/SDL_thread.h \ - ../../../../include/SDL_timer.h \ - ../../../../include/SDL_types.h \ - ../../../../include/SDL_version.h \ - ../../../../include/SDL_video.h - - -all: $(EXPORTS) - -$(EXPORTS): Makefile gendef.pl $(HEADERS) - perl gendef.pl $(HEADERS) >$@ || rm $@ - -clean: - rm -f $(EXPORTS) diff --git a/src/main/macos/exports/SDL.x b/src/main/macos/exports/SDL.x deleted file mode 100644 index 4830c43e93..0000000000 --- a/src/main/macos/exports/SDL.x +++ /dev/null @@ -1 +0,0 @@ - SDL_Init SDL_InitSubSystem SDL_QuitSubSystem SDL_WasInit SDL_Quit SDL_GetAppState SDL_AudioInit SDL_AudioQuit SDL_AudioDriverName SDL_OpenAudio SDL_GetAudioStatus SDL_PauseAudio SDL_LoadWAV_RW SDL_FreeWAV SDL_BuildAudioCVT SDL_ConvertAudio SDL_MixAudio SDL_LockAudio SDL_UnlockAudio SDL_CloseAudio SDL_CDNumDrives SDL_CDName SDL_CDOpen SDL_CDStatus SDL_CDPlayTracks SDL_CDPlay SDL_CDPause SDL_CDResume SDL_CDStop SDL_CDEject SDL_CDClose SDL_HasRDTSC SDL_HasMMX SDL_HasMMXExt SDL_Has3DNow SDL_Has3DNowExt SDL_HasSSE SDL_HasSSE2 SDL_HasAltiVec SDL_SetError SDL_GetError SDL_ClearError SDL_Error SDL_PumpEvents SDL_PeepEvents SDL_PollEvent SDL_WaitEvent SDL_PushEvent SDL_SetEventFilter SDL_GetEventFilter SDL_EventState SDL_NumJoysticks SDL_JoystickName SDL_JoystickOpen SDL_JoystickOpened SDL_JoystickIndex SDL_JoystickNumAxes SDL_JoystickNumBalls SDL_JoystickNumHats SDL_JoystickNumButtons SDL_JoystickUpdate SDL_JoystickEventState SDL_JoystickGetAxis SDL_JoystickGetHat SDL_JoystickGetBall SDL_JoystickGetButton SDL_JoystickClose SDL_EnableUNICODE SDL_EnableKeyRepeat SDL_GetKeyRepeat SDL_GetKeyState SDL_GetModState SDL_SetModState SDL_GetKeyName SDL_LoadObject SDL_LoadFunction SDL_UnloadObject SDL_GetMouseState SDL_GetRelativeMouseState SDL_WarpMouse SDL_CreateCursor SDL_SetCursor SDL_GetCursor SDL_FreeCursor SDL_ShowCursor SDL_CreateMutex SDL_mutexP SDL_mutexV SDL_DestroyMutex SDL_CreateSemaphore SDL_DestroySemaphore SDL_SemWait SDL_SemTryWait SDL_SemWaitTimeout SDL_SemPost SDL_SemValue SDL_CreateCond SDL_DestroyCond SDL_CondSignal SDL_CondBroadcast SDL_CondWait SDL_CondWaitTimeout SDL_RWFromFile SDL_RWFromFP SDL_RWFromMem SDL_RWFromConstMem SDL_AllocRW SDL_FreeRW SDL_ReadLE16 SDL_ReadBE16 SDL_ReadLE32 SDL_ReadBE32 SDL_ReadLE64 SDL_ReadBE64 SDL_WriteLE16 SDL_WriteBE16 SDL_WriteLE32 SDL_WriteBE32 SDL_WriteLE64 SDL_WriteBE64 SDL_GetWMInfo SDL_CreateThread SDL_CreateThread SDL_ThreadID SDL_GetThreadID SDL_WaitThread SDL_KillThread SDL_GetTicks SDL_Delay SDL_SetTimer SDL_AddTimer SDL_RemoveTimer SDL_Linked_Version SDL_VideoInit SDL_VideoQuit SDL_VideoDriverName SDL_GetVideoSurface SDL_GetVideoInfo SDL_VideoModeOK SDL_ListModes SDL_SetVideoMode SDL_UpdateRects SDL_UpdateRect SDL_Flip SDL_SetGamma SDL_SetGammaRamp SDL_GetGammaRamp SDL_SetColors SDL_SetPalette SDL_MapRGB SDL_MapRGBA SDL_GetRGB SDL_GetRGBA SDL_CreateRGBSurface SDL_CreateRGBSurfaceFrom SDL_FreeSurface SDL_LockSurface SDL_UnlockSurface SDL_LoadBMP_RW SDL_SaveBMP_RW SDL_SetColorKey SDL_SetAlpha SDL_SetClipRect SDL_GetClipRect SDL_ConvertSurface SDL_UpperBlit SDL_LowerBlit SDL_FillRect SDL_DisplayFormat SDL_DisplayFormatAlpha SDL_CreateYUVOverlay SDL_LockYUVOverlay SDL_UnlockYUVOverlay SDL_DisplayYUVOverlay SDL_FreeYUVOverlay SDL_GL_LoadLibrary SDL_GL_GetProcAddress SDL_GL_SetAttribute SDL_GL_GetAttribute SDL_GL_SwapBuffers SDL_GL_UpdateRects SDL_GL_Lock SDL_GL_Unlock SDL_WM_SetCaption SDL_WM_GetCaption SDL_WM_SetIcon SDL_WM_IconifyWindow SDL_WM_ToggleFullScreen SDL_WM_GrabInput SDL_SoftStretch SDL_putenv SDL_getenv SDL_qsort SDL_revcpy SDL_strlcpy SDL_strlcat SDL_strdup SDL_strrev SDL_strupr SDL_strlwr SDL_ltoa SDL_ultoa SDL_strcasecmp SDL_strncasecmp SDL_snprintf SDL_vsnprintf SDL_iconv SDL_iconv_string SDL_InitQuickDraw \ No newline at end of file diff --git a/src/main/macos/exports/gendef.pl b/src/main/macos/exports/gendef.pl deleted file mode 100644 index 9cffca92aa..0000000000 --- a/src/main/macos/exports/gendef.pl +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/perl -# -# Program to take a set of header files and generate DLL export definitions - -# Special exports to ignore for this platform - -while ( ($file = shift(@ARGV)) ) { - if ( ! defined(open(FILE, $file)) ) { - warn "Couldn't open $file: $!\n"; - next; - } - $printed_header = 0; - $file =~ s,.*/,,; - while () { - if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) { - if ( not $exclude{$1} ) { - print "\t$1\r"; - } - } - } - close(FILE); -} - -# Special exports to include for this platform -print "\tSDL_putenv\r"; -print "\tSDL_getenv\r"; -print "\tSDL_qsort\r"; -print "\tSDL_revcpy\r"; -print "\tSDL_strlcpy\r"; -print "\tSDL_strlcat\r"; -print "\tSDL_strdup\r"; -print "\tSDL_strrev\r"; -print "\tSDL_strupr\r"; -print "\tSDL_strlwr\r"; -print "\tSDL_ltoa\r"; -print "\tSDL_ultoa\r"; -print "\tSDL_strcasecmp\r"; -print "\tSDL_strncasecmp\r"; -print "\tSDL_snprintf\r"; -print "\tSDL_vsnprintf\r"; -print "\tSDL_iconv\r"; -print "\tSDL_iconv_string\r"; -print "\tSDL_InitQuickDraw\r"; diff --git a/src/main/macosx/Info.plist.in b/src/main/macosx/Info.plist.in deleted file mode 100644 index b3d69abac9..0000000000 --- a/src/main/macosx/Info.plist.in +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - @EXECUTABLE_NAME@ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - @PACKAGE@ - CFBundlePackageType - APPL - CFBundleShortVersionString - @VERSION@ - CFBundleSignature - ???? - NSMainNibFile - SDLMain.nib - NSPrincipalClass - NSApplication - - diff --git a/src/main/macosx/SDLMain.h b/src/main/macosx/SDLMain.h deleted file mode 100644 index c56d90cbe8..0000000000 --- a/src/main/macosx/SDLMain.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#ifndef _SDLMain_h_ -#define _SDLMain_h_ - -#import - -@interface SDLMain : NSObject -@end - -#endif /* _SDLMain_h_ */ diff --git a/src/main/macosx/SDLMain.m b/src/main/macosx/SDLMain.m deleted file mode 100644 index 2434f81aa9..0000000000 --- a/src/main/macosx/SDLMain.m +++ /dev/null @@ -1,381 +0,0 @@ -/* SDLMain.m - main entry point for our Cocoa-ized SDL app - Initial Version: Darrell Walisser - Non-NIB-Code & other changes: Max Horn - - Feel free to customize this file to suit your needs -*/ - -#include "SDL.h" -#include "SDLMain.h" -#include /* for MAXPATHLEN */ -#include - -/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, - but the method still is there and works. To avoid warnings, we declare - it ourselves here. */ -@interface NSApplication(SDL_Missing_Methods) -- (void)setAppleMenu:(NSMenu *)menu; -@end - -/* Use this flag to determine whether we use SDLMain.nib or not */ -#define SDL_USE_NIB_FILE 0 - -/* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 -#ifdef SDL_USE_CPS -/* Portions of CPS.h */ -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - -#endif /* SDL_USE_CPS */ - -static int gArgc; -static char **gArgv; -static BOOL gFinderLaunch; -static BOOL gCalledAppMainline = FALSE; - -static NSString *getApplicationName(void) -{ - const NSDictionary *dict; - NSString *appName = 0; - - /* Determine the application name */ - dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); - if (dict) - appName = [dict objectForKey: @"CFBundleName"]; - - if (![appName length]) - appName = [[NSProcessInfo processInfo] processName]; - - return appName; -} - -#if SDL_USE_NIB_FILE -/* A helper category for NSString */ -@interface NSString (ReplaceSubString) -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; -@end -#endif - -@interface NSApplication (SDLApplication) -@end - -@implementation NSApplication (SDLApplication) -/* Invoked from the Quit menu item */ -- (void)terminate:(id)sender -{ - /* Post a SDL_QUIT event */ - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); -} -@end - -/* The main class of the application, the application's delegate */ -@implementation SDLMain - -/* Set the working directory to the .app's parent directory */ -- (void) setupWorkingDirectory:(BOOL)shouldChdir -{ - if (shouldChdir) - { - char parentdir[MAXPATHLEN]; - CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); - if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) { - chdir(parentdir); /* chdir to the binary app's parent */ - } - CFRelease(url); - CFRelease(url2); - } -} - -#if SDL_USE_NIB_FILE - -/* Fix menu to contain the real app name instead of "SDL App" */ -- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName -{ - NSRange aRange; - NSEnumerator *enumerator; - NSMenuItem *menuItem; - - aRange = [[aMenu title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; - - enumerator = [[aMenu itemArray] objectEnumerator]; - while ((menuItem = [enumerator nextObject])) - { - aRange = [[menuItem title] rangeOfString:@"SDL App"]; - if (aRange.length != 0) - [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; - if ([menuItem hasSubmenu]) - [self fixMenu:[menuItem submenu] withAppName:appName]; - } -} - -#else - -static void setApplicationMenu(void) -{ - /* warning: this code is very odd */ - NSMenu *appleMenu; - NSMenuItem *menuItem; - NSString *title; - NSString *appName; - - appName = getApplicationName(); - appleMenu = [[NSMenu alloc] initWithTitle:@""]; - - /* Add menu items */ - title = [@"About " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Hide " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; - - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; - [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; - - [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; - - [appleMenu addItem:[NSMenuItem separatorItem]]; - - title = [@"Quit " stringByAppendingString:appName]; - [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; - - - /* Put menu into the menubar */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; - [menuItem setSubmenu:appleMenu]; - [[NSApp mainMenu] addItem:menuItem]; - - /* Tell the application object that this is now the application menu */ - [NSApp setAppleMenu:appleMenu]; - - /* Finally give up our references to the objects */ - [appleMenu release]; - [menuItem release]; -} - -/* Create a window menu */ -static void setupWindowMenu(void) -{ - NSMenu *windowMenu; - NSMenuItem *windowMenuItem; - NSMenuItem *menuItem; - - windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; - - /* "Minimize" item */ - menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; - [windowMenu addItem:menuItem]; - [menuItem release]; - - /* Put menu into the menubar */ - windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; - [windowMenuItem setSubmenu:windowMenu]; - [[NSApp mainMenu] addItem:windowMenuItem]; - - /* Tell the application object that this is now the window menu */ - [NSApp setWindowsMenu:windowMenu]; - - /* Finally give up our references to the objects */ - [windowMenu release]; - [windowMenuItem release]; -} - -/* Replacement for NSApplicationMain */ -static void CustomApplicationMain (int argc, char **argv) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SDLMain *sdlMain; - - /* Ensure the application object is initialised */ - [NSApplication sharedApplication]; - -#ifdef SDL_USE_CPS - { - CPSProcessSerNum PSN; - /* Tell the dock about us */ - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [NSApplication sharedApplication]; - } -#endif /* SDL_USE_CPS */ - - /* Set up the menubar */ - [NSApp setMainMenu:[[NSMenu alloc] init]]; - setApplicationMenu(); - setupWindowMenu(); - - /* Create SDLMain and make it the app delegate */ - sdlMain = [[SDLMain alloc] init]; - [NSApp setDelegate:sdlMain]; - - /* Start the main event loop */ - [NSApp run]; - - [sdlMain release]; - [pool release]; -} - -#endif - - -/* - * Catch document open requests...this lets us notice files when the app - * was launched by double-clicking a document, or when a document was - * dragged/dropped on the app's icon. You need to have a - * CFBundleDocumentsType section in your Info.plist to get this message, - * apparently. - * - * Files are added to gArgv, so to the app, they'll look like command line - * arguments. Previously, apps launched from the finder had nothing but - * an argv[0]. - * - * This message may be received multiple times to open several docs on launch. - * - * This message is ignored once the app's mainline has been called. - */ -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - const char *temparg; - size_t arglen; - char *arg; - char **newargv; - - if (!gFinderLaunch) /* MacOS is passing command line args. */ - return FALSE; - - if (gCalledAppMainline) /* app has started, ignore this document. */ - return FALSE; - - temparg = [filename UTF8String]; - arglen = SDL_strlen(temparg) + 1; - arg = (char *) SDL_malloc(arglen); - if (arg == NULL) - return FALSE; - - newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2)); - if (newargv == NULL) - { - SDL_free(arg); - return FALSE; - } - gArgv = newargv; - - SDL_strlcpy(arg, temparg, arglen); - gArgv[gArgc++] = arg; - gArgv[gArgc] = NULL; - return TRUE; -} - - -/* Called when the internal event loop has just started running */ -- (void) applicationDidFinishLaunching: (NSNotification *) note -{ - int status; - - /* Set the working directory to the .app's parent directory */ - [self setupWorkingDirectory:gFinderLaunch]; - -#if SDL_USE_NIB_FILE - /* Set the main menu to contain the real app name instead of "SDL App" */ - [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; -#endif - - /* Hand off to main application code */ - gCalledAppMainline = TRUE; - status = SDL_main (gArgc, gArgv); - - /* We're done, thank you for playing */ - exit(status); -} -@end - - -@implementation NSString (ReplaceSubString) - -- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString -{ - unsigned int bufferSize; - unsigned int selfLen = [self length]; - unsigned int aStringLen = [aString length]; - unichar *buffer; - NSRange localRange; - NSString *result; - - bufferSize = selfLen + aStringLen - aRange.length; - buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); - - /* Get first part into buffer */ - localRange.location = 0; - localRange.length = aRange.location; - [self getCharacters:buffer range:localRange]; - - /* Get middle part into buffer */ - localRange.location = 0; - localRange.length = aStringLen; - [aString getCharacters:(buffer+aRange.location) range:localRange]; - - /* Get last part into buffer */ - localRange.location = aRange.location + aRange.length; - localRange.length = selfLen - localRange.location; - [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; - - /* Build output string */ - result = [NSString stringWithCharacters:buffer length:bufferSize]; - - NSDeallocateMemoryPages(buffer, bufferSize); - - return result; -} - -@end - - - -#ifdef main -# undef main -#endif - - -/* Main entry point to executable - should *not* be SDL_main! */ -int main (int argc, char **argv) -{ - /* Copy the arguments into a global variable */ - /* This is passed if we are launched by double-clicking */ - if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { - gArgv = (char **) SDL_malloc(sizeof (char *) * 2); - gArgv[0] = argv[0]; - gArgv[1] = NULL; - gArgc = 1; - gFinderLaunch = YES; - } else { - int i; - gArgc = argc; - gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); - for (i = 0; i <= argc; i++) - gArgv[i] = argv[i]; - gFinderLaunch = NO; - } - -#if SDL_USE_NIB_FILE - NSApplicationMain (argc, argv); -#else - CustomApplicationMain (argc, argv); -#endif - return 0; -} - diff --git a/src/main/macosx/SDLMain.nib/classes.nib b/src/main/macosx/SDLMain.nib/classes.nib deleted file mode 100644 index f8f4e9a4b9..0000000000 --- a/src/main/macosx/SDLMain.nib/classes.nib +++ /dev/null @@ -1,12 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {makeFullscreen = id; quit = id; }; - CLASS = SDLMain; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -} diff --git a/src/main/macosx/SDLMain.nib/info.nib b/src/main/macosx/SDLMain.nib/info.nib deleted file mode 100644 index 2211cf9d75..0000000000 --- a/src/main/macosx/SDLMain.nib/info.nib +++ /dev/null @@ -1,12 +0,0 @@ - - - - - IBDocumentLocation - 49 97 356 240 0 0 987 746 - IBMainMenuLocation - 20 515 195 44 0 46 800 532 - IBUserGuides - - - diff --git a/src/main/macosx/SDLMain.nib/objects.nib b/src/main/macosx/SDLMain.nib/objects.nib deleted file mode 100644 index 9f697b0ee7..0000000000 Binary files a/src/main/macosx/SDLMain.nib/objects.nib and /dev/null differ diff --git a/src/main/macosx/info.nib b/src/main/macosx/info.nib deleted file mode 100644 index d13726f807..0000000000 --- a/src/main/macosx/info.nib +++ /dev/null @@ -1 +0,0 @@ -// This is just a stub file to force automake to create the install directory diff --git a/src/main/psp/SDL_psp_main.c b/src/main/psp/SDL_psp_main.c new file mode 100644 index 0000000000..77ef39d5a9 --- /dev/null +++ b/src/main/psp/SDL_psp_main.c @@ -0,0 +1,80 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_main.h" +#include +#include +#include +#include +#include +#include + +/* If application's main() is redefined as SDL_main, and libSDLmain is + linked, then this file will create the standard exit callback, + define the PSP_MODULE_INFO macro, and exit back to the browser when + the program is finished. + + You can still override other parameters in your own code if you + desire, such as PSP_HEAP_SIZE_KB, PSP_MAIN_THREAD_ATTR, + PSP_MAIN_THREAD_STACK_SIZE, etc. +*/ + +PSP_MODULE_INFO("SDL App", 0, 1, 1); + +int sdl_psp_exit_callback(int arg1, int arg2, void *common) +{ + exit(0); + return 0; +} + +int sdl_psp_callback_thread(SceSize args, void *argp) +{ + int cbid; + cbid = sceKernelCreateCallback("Exit Callback", + sdl_psp_exit_callback, NULL); + sceKernelRegisterExitCallback(cbid); + sceKernelSleepThreadCB(); + return 0; +} + +int sdl_psp_setup_callbacks(void) +{ + int thid = 0; + thid = sceKernelCreateThread("update_thread", + sdl_psp_callback_thread, 0x11, 0xFA0, 0, 0); + if(thid >= 0) + sceKernelStartThread(thid, 0, 0); + return thid; +} + +int main(int argc, char *argv[]) +{ + pspDebugScreenInit(); + sdl_psp_setup_callbacks(); + + /* Register sceKernelExitGame() to be called when we exit */ + atexit(sceKernelExitGame); + + SDL_SetMainReady(); + + (void)SDL_main(argc, argv); + return 0; +} diff --git a/src/main/qtopia/SDL_qtopia_main.cc b/src/main/qtopia/SDL_qtopia_main.cc deleted file mode 100644 index 46fd518ff0..0000000000 --- a/src/main/qtopia/SDL_qtopia_main.cc +++ /dev/null @@ -1,47 +0,0 @@ - -/* Include the SDL main definition header */ -#include "SDL_main.h" -#include -#include -#ifdef main -#undef main -#endif -#ifdef QWS -#include -#include -#include -#include - -// Workaround for OPIE to remove taskbar icon. Also fixes -// some issues in Qtopia where there are left-over qcop files in /tmp/. -// I'm guessing this will also clean up the taskbar in the Sharp version -// of Qtopia. -static inline void cleanupQCop() { - QString appname(qApp->argv()[0]); - int slash = appname.findRev("/"); - if(slash != -1) { appname = appname.mid(slash+1); } - QString cmd = QPEApplication::qpeDir() + "bin/qcop QPE/System 'closing(QString)' '"+appname+"'"; - system(cmd.latin1()); - cmd = "/tmp/qcop-msg-"+appname; - unlink(cmd.latin1()); -} - -static QPEApplication *app; -#endif - -extern int SDL_main(int argc, char *argv[]); - -int main(int argc, char *argv[]) -{ -#ifdef QWS - // This initializes the Qtopia application. It needs to be done here - // because it parses command line options. - app = new QPEApplication(argc, argv); - QWidget dummy; - app->showMainWidget(&dummy); - atexit(cleanupQCop); -#endif - // Exit here because if return is used, the application - // doesn't seem to quit correctly. - exit(SDL_main(argc, argv)); -} diff --git a/src/main/symbian/EKA1/SDL_main.cpp b/src/main/symbian/EKA1/SDL_main.cpp deleted file mode 100644 index 683db874ff..0000000000 --- a/src/main/symbian/EKA1/SDL_main.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* - SDL_main.cpp - The Epoc executable startup functions - - Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi) -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "SDL_error.h" - -#if defined(__WINS__) -#include -IMPORT_C void RegisterWsExe(const TDesC &aName); -#endif - -/* The prototype for the application's main() function */ -#define main SDL_main -extern "C" int main (int argc, char *argv[], char *envp[]); -extern "C" void exit (int ret); - - -/* Epoc main function */ - -#ifdef __WINS__ - - -void GetCmdLine(int& aArgc, char**& aArgv) - { - RChunk chunk; - - if(chunk.OpenGlobal(RThread().Name(), ETrue) != KErrNone) - return; - - TUint* ptr = (TUint*) chunk.Base(); - if(ptr != NULL) - { - aArgc = (int) *(ptr); // count - aArgv = (char**) *(ptr + 1); - } - chunk.Close(); - } - -#endif - - -TInt E32Main() - { - /* Get the clean-up stack */ - CTrapCleanup* cleanup = CTrapCleanup::New(); - - /* Arrange for multi-threaded operation */ - SpawnPosixServerThread(); - - /* Get args and environment */ - int argc=0; - char** argv=0; - char** envp=0; - -#ifndef __WINS__ - __crt0(argc,argv,envp); -#else - GetCmdLine(argc, argv); -#endif - /* Start the application! */ - - /* Create stdlib */ - _REENT; - - /* Set process and thread priority and name */ - - RThread currentThread; - RProcess thisProcess; - TParse exeName; - exeName.Set(thisProcess.FileName(), NULL, NULL); - currentThread.Rename(exeName.Name()); - currentThread.SetProcessPriority(EPriorityLow); - currentThread.SetPriority(EPriorityMuchLess); - - /* Call stdlib main */ - int ret = main(argc, argv, envp); /* !! process exits here if there is "exit()" in main! */ - - /* Call exit */ - //exit(ret); /* !! process exits here! */ - //Markus: I do not understand above - //I commented it at let this function - //to return ret value - was it purpose - //that cleanup below is not called at all - why? - - /* Free resources and return */ - - _cleanup(); //this is normally called at exit, I call it here, Markus - - CloseSTDLIB(); - delete cleanup; -#ifdef __WINS__ -// User::Panic(_L("exit"), ret); - // RThread().Kill(ret); //Markus get rid of this thread - // RThread().RaiseException(EExcKill); -#endif - return ret;//Markus, or exit(ret); ?? - //return(KErrNone); - } - - -#ifdef __WINS__ -EXPORT_C TInt WinsMain() - { - return E32Main(); - // return WinsMain(0, 0, 0); - } -#endif - -/* Epoc dll entry point */ -#if defined(__WINS__) -GLDEF_C TInt E32Dll(TDllReason) - { - return(KErrNone); - } -#endif - - diff --git a/src/main/symbian/EKA2/SDL_main.cpp b/src/main/symbian/EKA2/SDL_main.cpp deleted file mode 100644 index 3dc69d4aad..0000000000 --- a/src/main/symbian/EKA2/SDL_main.cpp +++ /dev/null @@ -1,1035 +0,0 @@ -/* - SDL_Main.cpp - Symbian OS services for SDL - - Markus Mertama -*/ - - -#include "epoc_sdl.h" - -#include"sdlepocapi.h" -#include -#include -#include -#include - -#include "vectorbuffer.h" -#include -#include -#include -#include "SDL_epocevents_c.h" -#include "SDL_keysym.h" -#include "dsa.h" - - -#ifdef SYMBIANC -#include -#endif - -//Markus Mertama - - -extern SDLKey* KeyMap(); -extern void ResetKeyMap(); - -class CCurrentAppUi; - -//const TUid KSDLUid = { 0xF01F3D69 }; - -NONSHARABLE_CLASS(EnvUtils) - { - public: - static void DisableKeyBlocking(); - static TBool Rendezvous(RThread& aThread, TRequestStatus& aStatus); - }; - -TInt Panic(TInt aErr, TInt aLine) - { - TBuf<64> b; - b.Format(_L("Main at %d"), aLine); - User::Panic(b, aErr); - return 0; - } - - -NONSHARABLE_CLASS(CCurrentAppUi) : public CAknAppUi - { - public: - static CCurrentAppUi* Cast(CEikAppUi* aUi); - void DisableKeyBlocking(); - }; - - -CCurrentAppUi* CCurrentAppUi::Cast(CEikAppUi* aUi) - { - return static_cast(aUi); - } - -void CCurrentAppUi::DisableKeyBlocking() - { - SetKeyBlockMode(ENoKeyBlock); - } - - -class CEventQueue : public CBase, public MEventQueue - { - public: - static CEventQueue* NewL(); - ~CEventQueue(); - public: - TInt Append(const TWsEvent& aEvent); - const TWsEvent& Shift(); - void Lock(); - void Unlock(); - TBool HasData(); - private: - TVector iVector; - RCriticalSection iCS; - }; - - CEventQueue* CEventQueue::NewL() - { - CEventQueue* q = new (ELeave) CEventQueue(); - CleanupStack::PushL(q); - User::LeaveIfError(q->iCS.CreateLocal()); - CleanupStack::Pop(); - return q; - } - -CEventQueue::~CEventQueue() - { - iCS.Close(); - } - -TInt CEventQueue::Append(const TWsEvent& aEvent) - { - iCS.Wait(); - const TInt err = iVector.Append(aEvent); - iCS.Signal(); - return err; - } - - -TBool CEventQueue::HasData() - { - return iVector.Size() > 0; - } - - -void CEventQueue::Lock() - { - iCS.Wait(); - } - -void CEventQueue::Unlock() - { - iCS.Signal(); - } - -const TWsEvent& CEventQueue::Shift() - { - const TWsEvent& event = iVector.Shift(); - return event; - } - - -TSdlCleanupItem::TSdlCleanupItem(TSdlCleanupOperation aOperation, TAny* aItem) : -iOperation(aOperation), iItem(aItem), iThread(RThread().Id()) - { - } - -class CEikonEnv; -class CSdlAppServ; - - -NONSHARABLE_CLASS(EpocSdlEnvData) - { - public: - void Free(); - CEventQueue* iEventQueue; - TMainFunc iMain; - TInt iEpocEnvFlags; - int iArgc; - char** iArgv; - CDsa* iDsa; - CSdlAppServ* iAppSrv; - TThreadId iId; - CArrayFix* iCleanupItems; - CEikAppUi* iAppUi; - CSDL* iSdl; - }; - - -EpocSdlEnvData* gEpocEnv; - -#define MAINFUNC(x) EXPORT_C TMainFunc::TMainFunc(mainfunc##x aFunc){Mem::FillZ(iMainFunc, sizeof(iMainFunc)); iMainFunc[x - 1] = (void*) aFunc;} - -MAINFUNC(1) -MAINFUNC(2) -MAINFUNC(3) -MAINFUNC(4) -MAINFUNC(5) -MAINFUNC(6) - -EXPORT_C TMainFunc::TMainFunc() - { - Mem::FillZ(iMainFunc, sizeof(iMainFunc)); - } - - -const void* TMainFunc::operator[](TInt aIndex) const - { - return iMainFunc[aIndex]; - } - - -NONSHARABLE_CLASS(CSdlAppServ) : public CActive - { - public: - enum - { - EAppSrvNoop = CDsa::ELastDsaRequest, - EAppSrvWindowWidth, - EAppSrvWindowHeight, - EAppSrvWindowDisplayMode, - EAppSrvWindowPointerCursorMode, - EAppSrvDsaStatus, - EAppSrvStopThread, - EAppSrvWaitDsa - }; - CSdlAppServ(); - void ConstructL(); - ~CSdlAppServ(); - TInt Request(TInt aService); - TInt RequestValue(TInt aService); - void Init(); - void PanicMain(TInt aReason); - void PanicMain(const TDesC& aInfo, TInt aReason); - void SetObserver(MSDLObserver* aObserver); - TInt ObserverEvent(TInt aEvent, TInt aParam); - void SetParam(TInt aParam); - void HandleObserverValue(TInt aService, TInt aReturnValue, TBool aMainThread); - MSDLObserver* Observer(); - private: - void RunL(); - void DoCancel(); - private: - const TThreadId iMainId; - RThread iAppThread; - TInt iService; - TInt iReturnValue; - RSemaphore iSema; - MSDLObserver* iObserver; - TRequestStatus* iStatusPtr; - }; - -CSdlAppServ::CSdlAppServ() : CActive(CActive::EPriorityHigh), iMainId(RThread().Id()) - { - } - - - -MSDLObserver* CSdlAppServ::Observer() - { - return iObserver; - } - - -void CSdlAppServ::SetObserver(MSDLObserver* aObserver) - { - iObserver = aObserver; - } - -TInt CSdlAppServ::ObserverEvent(TInt aEvent, TInt aParam) - { - if(iObserver != NULL) - { - if(RThread().Id() == gEpocEnv->iId) - { - return iObserver->SdlThreadEvent(aEvent, aParam); - } - else if(RThread().Id() == iMainId) - { - return iObserver->SdlEvent(aEvent, aParam); - } - PANIC(KErrNotSupported); - } - return 0; - } - -void CSdlAppServ::PanicMain(TInt aReason) - { - iAppThread.Panic(RThread().Name(), aReason); - } - -void CSdlAppServ::PanicMain(const TDesC& aInfo, TInt aReason) - { - iAppThread.Panic(aInfo, aReason); - } - -void CSdlAppServ::ConstructL() - { - CActiveScheduler::Add(this); - User::LeaveIfError(iSema.CreateLocal(1)); - iStatus = KRequestPending; - iStatusPtr = &iStatus; - SetActive(); - } - - CSdlAppServ::~CSdlAppServ() - { - Cancel(); - if(iSema.Handle() != NULL) - iSema.Signal(); - iSema.Close(); - iAppThread.Close(); - } - -TInt CSdlAppServ::Request(TInt aService) - { - if(RThread().Id() != iAppThread.Id()) - { - iSema.Wait(); - iService = aService; - iAppThread.RequestComplete(iStatusPtr, KErrNone); - return KErrNone; - } - return KErrBadHandle; - } - -TInt CSdlAppServ::RequestValue(TInt aService) - { - Request(aService); - Request(EAppSrvNoop); - return iReturnValue; - } - -void CSdlAppServ::Init() - { - PANIC_IF_ERROR(iAppThread.Open(iMainId)); - } - -void CSdlAppServ::SetParam(TInt aParam) - { - iReturnValue = aParam; - } - -void CSdlAppServ::HandleObserverValue(TInt aService, TInt aReturnValue, TBool aMainThread) - { - if(iObserver != NULL && aMainThread) - { - switch(aService) - { - case MSDLObserver::EEventScreenSizeChanged: - if(aReturnValue == MSDLObserver::EScreenSizeChangedDefaultPalette) - EpocSdlEnv::LockPalette(EFalse); - break; - } - } - if(!aMainThread && aService == MSDLObserver::EEventSuspend) - { - if(iObserver == NULL || - (gEpocEnv->iDsa->Stopped() && aReturnValue != MSDLObserver::ESuspendNoSuspend)) - { - EpocSdlEnv::Suspend(); - } - } - } - -void CSdlAppServ::RunL() - { - if(iStatus == KErrNone) - { - switch(iService) - { - case CSdlAppServ::EAppSrvWaitDsa: - EpocSdlEnv::SetWaitDsa(); - iReturnValue = EpocSdlEnv::IsDsaAvailable(); - // } - // gEpocEnv->iDsa->Stop(); - // gEpocEnv->iDsa->RestartL(); - break; - case CSdlAppServ::EAppSrvStopThread: - gEpocEnv->iDsa->SetSuspend(); - break; - case EpocSdlEnv::EDisableKeyBlocking: - EnvUtils::DisableKeyBlocking(); - break; - - case EAppSrvWindowPointerCursorMode: - iReturnValue = gEpocEnv->iDsa != NULL ? - gEpocEnv->iDsa->Session().PointerCursorMode() : KErrNotReady; - break; - case EAppSrvDsaStatus: - gEpocEnv->iDsa->Stop(); - iReturnValue = KErrNone; - break; - case CDsa::ERequestUpdate: - gEpocEnv->iDsa->UnlockHWSurfaceRequestComplete(); - break; - case EAppSrvNoop: - break; - case MSDLObserver::EEventResume: - case MSDLObserver::EEventSuspend: - case MSDLObserver::EEventScreenSizeChanged: - case MSDLObserver::EEventWindowReserved: - case MSDLObserver::EEventKeyMapInit: - case MSDLObserver::EEventWindowNotAvailable: - case MSDLObserver::EEventMainExit: - iReturnValue = ObserverEvent(iService, iReturnValue); - HandleObserverValue(iService, iReturnValue, ETrue); - break; - default: - PANIC(KErrNotSupported); - } - iStatus = KRequestPending; - iStatusPtr = &iStatus; - SetActive(); - } - iSema.Signal(); - } - -void CSdlAppServ::DoCancel() - { - iSema.Wait(); - TRequestStatus* s = &iStatus; - iAppThread.RequestComplete(s, KErrCancel); - } - - - -MEventQueue& EpocSdlEnv::EventQueue() - { - __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady)); - return *gEpocEnv->iEventQueue; - } - - -TBool EpocSdlEnv::Flags(TInt aFlag) - { - const TInt flag = gEpocEnv->iEpocEnvFlags & aFlag; - return flag == aFlag; - } - -TInt EpocSdlEnv::Argc() - { - __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady)); - return gEpocEnv->iArgc; - } - - -char** EpocSdlEnv::Argv() - { - __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady)); - return gEpocEnv->iArgv; - } - - -TBool EpocSdlEnv::IsDsaAvailable() - { - __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady)); - return gEpocEnv->iDsa != NULL && gEpocEnv->iDsa->IsDsaAvailable(); - } - - -void EpocSdlEnv::WaitDsaAvailable() - { - EpocSdlEnv::ObserverEvent(MSDLObserver::EEventWindowNotAvailable, 0); - gEpocEnv->iAppSrv->Request(CSdlAppServ::EAppSrvStopThread); - if(EpocSdlEnv::Flags(CSDL::EEnableFocusStop)) - { - EpocSdlEnv::ObserverEvent(MSDLObserver::EEventSuspend, 0); - } - } - -void EpocSdlEnv::Suspend() - { - if(gEpocEnv->iDsa->Stopped() || EpocSdlEnv::Flags(CSDL::EEnableFocusStop)) - { - // gEpocEnv->iDsa->ReleaseStop(); - gEpocEnv->iDsa->SetSuspend(); - RThread().Suspend(); - EpocSdlEnv::ObserverEvent(MSDLObserver::EEventResume, 0); - } - } - -void EpocSdlEnv::SetWaitDsa() - { - if(!IsDsaAvailable()) - { - RThread th; - th.Open(gEpocEnv->iId); - th.Suspend(); - th.Close(); - gEpocEnv->iDsa->SetSuspend(); - } - } - -void EpocSdlEnv::Resume() - { - gEpocEnv->iDsa->Resume(); - RThread th; - th.Open(gEpocEnv->iId); - th.Resume(); - th.Close(); - - const TInt value = gEpocEnv->iAppSrv->ObserverEvent(MSDLObserver::EEventResume, 0); - gEpocEnv->iAppSrv->HandleObserverValue(MSDLObserver::EEventResume, value, ETrue); - } - - -TInt EpocSdlEnv::AllocSwSurface(const TSize& aSize, TDisplayMode aMode) - { - return gEpocEnv->iDsa->AllocSurface(EFalse, aSize, aMode); - } - -TInt EpocSdlEnv::AllocHwSurface(const TSize& aSize, TDisplayMode aMode) - { - return gEpocEnv->iDsa->AllocSurface(ETrue, aSize, aMode); - } - - -void EpocSdlEnv::UnlockHwSurface() - { - gEpocEnv->iDsa->UnlockHwSurface(); - } - -TUint8* EpocSdlEnv::LockHwSurface() - { - return gEpocEnv->iDsa->LockHwSurface(); - } - - -void EpocSdlEnv::UpdateSwSurface() - { - gEpocEnv->iDsa->UpdateSwSurface(); - } - -TBool EpocSdlEnv::AddUpdateRect(TUint8* aAddress, const TRect& aUpdateRect, const TRect& aRect) - { - return gEpocEnv->iDsa->AddUpdateRect(aAddress, aUpdateRect, aRect); - } - -void EpocSdlEnv::Request(TInt aService) - { - __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady)); - gEpocEnv->iAppSrv->Request(aService); - } - - -TSize EpocSdlEnv::WindowSize(const TSize& aRequestedSize) - { - __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady)); - if(EpocSdlEnv::Flags(CSDL::EAllowImageResize) && gEpocEnv->iDsa->WindowSize() != aRequestedSize) - { - TRAP_IGNORE(gEpocEnv->iDsa->CreateZoomerL(aRequestedSize)); - } - return gEpocEnv->iDsa->WindowSize(); - } - - TSize EpocSdlEnv::WindowSize() - { - __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady)); - return gEpocEnv->iDsa->WindowSize(); - } - -TDisplayMode EpocSdlEnv::DisplayMode() - { - return gEpocEnv->iDsa->DisplayMode(); - } - -TPointerCursorMode EpocSdlEnv::PointerMode() - { - return static_cast - (gEpocEnv->iAppSrv->RequestValue(CSdlAppServ::EAppSrvWindowPointerCursorMode)); - } - -TInt EpocSdlEnv::SetPalette(TInt aFirstcolor, TInt aColorCount, TUint32* aPalette) - { - return gEpocEnv->iDsa->SetPalette(aFirstcolor, aColorCount, aPalette); - } - -void EpocSdlEnv::PanicMain(TInt aErr) - { - gEpocEnv->iAppSrv->PanicMain(aErr); - } - - -TInt EpocSdlEnv::AppendCleanupItem(const TSdlCleanupItem& aItem) - { - TRAPD(err, gEpocEnv->iCleanupItems->AppendL(aItem)); - return err; - } - -void EpocSdlEnv::RemoveCleanupItem(TAny* aItem) - { - for(TInt i = 0; i < gEpocEnv->iCleanupItems->Count(); i++) - { - if(gEpocEnv->iCleanupItems->At(i).iItem == aItem) - gEpocEnv->iCleanupItems->Delete(i); - } - } - -void EpocSdlEnv::CleanupItems() - { - const TThreadId id = RThread().Id(); - TInt last = gEpocEnv->iCleanupItems->Count() - 1; - TInt i; - for(i = last; i >= 0 ; i--) - { - TSdlCleanupItem& item = gEpocEnv->iCleanupItems->At(i); - if(item.iThread == id) - { - item.iThread = TThreadId(0); - item.iOperation(item.iItem); - } - } - last = gEpocEnv->iCleanupItems->Count() - 1; - for(i = last; i >= 0 ; i--) - { - TSdlCleanupItem& item = gEpocEnv->iCleanupItems->At(i); - if(item.iThread == TThreadId(0)) - { - gEpocEnv->iCleanupItems->Delete(i); - } - } - } - -void EpocSdlEnv::FreeSurface() - { - Request(CSdlAppServ::EAppSrvDsaStatus); - gEpocEnv->iDsa->Free(); - } - -void EpocSdlEnv::LockPalette(TBool aLock) - { - gEpocEnv->iDsa->LockPalette(aLock); - } - -void EpocSdlEnv::ObserverEvent(TInt aService, TInt aParam) - { - const TBool sdlThread = RThread().Id() == gEpocEnv->iId; - const TInt valuea = gEpocEnv->iAppSrv->ObserverEvent(aService, aParam); - gEpocEnv->iAppSrv->HandleObserverValue(aService, valuea, !sdlThread); - if(sdlThread) - { - gEpocEnv->iAppSrv->SetParam(aParam); - const TInt valuet = gEpocEnv->iAppSrv->RequestValue(aService); - gEpocEnv->iAppSrv->HandleObserverValue(aService, valuet, EFalse); - } - } - - -TPoint EpocSdlEnv::WindowCoordinates(const TPoint& aPoint) - { - return gEpocEnv->iDsa->WindowCoordinates(aPoint); - } - -void EpocSdlEnv::PanicMain(const TDesC& aInfo, TInt aErr) - { - gEpocEnv->iAppSrv->PanicMain(aInfo, aErr); - } -//Dsa is a low priority ao, it has to wait if its pending event, but ws -//event has been prioritized before it -//this is not called from app thread! -void EpocSdlEnv::WaitDeviceChange() - { - LockPalette(ETrue); - gEpocEnv->iAppSrv->RequestValue(CSdlAppServ::EAppSrvWaitDsa); - const TSize sz = WindowSize(); - const TInt param = reinterpret_cast(&sz); - ObserverEvent(MSDLObserver::EEventScreenSizeChanged, param); - - // RThread().Suspend(); - } - -LOCAL_C TBool CheckSdl() - { - TInt isExit = ETrue; - RThread sdl; - if(sdl.Open(gEpocEnv->iId) == KErrNone) - { - if(sdl.ExitType() == EExitPending) - { - isExit = EFalse; - } - sdl.Close(); - } - return isExit; - } - -void EpocSdlEnvData::Free() - { - if(RThread().Id() == gEpocEnv->iId) - { - iDsa->Free(); - return; - } - - __ASSERT_ALWAYS(iArgv == NULL || CheckSdl(), PANIC(KErrNotReady)); - - for(TInt i = 0; i < iArgc; i++) - User::Free( iArgv[i] ); - - User::Free(iArgv); - - - delete iEventQueue; - - if(iDsa != NULL) - iDsa->Free(); - - delete iDsa; - delete iAppSrv; - } - -_LIT(KSDLMain, "SDLMain"); - -LOCAL_C int MainL() - { - gEpocEnv->iCleanupItems = new (ELeave) CArrayFixFlat(8); - - char** envp=0; - /* !! process exits here if there is "exit()" in main! */ - int ret = 0; - for(TInt i = 0; i < 6; i++) - { - void* f = (void*) gEpocEnv->iMain[i]; - if(f != NULL) - { - switch(i) - { - case 0: - ret = ((mainfunc1)f)(); - return ret; - case 3: - ((mainfunc1)f)(); - return ret; - case 1: - ret = ((mainfunc2)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv()); - return ret; - case 4: - ((mainfunc2)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv()); - return ret; - case 2: - ret = ((mainfunc3)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv(), envp); - return ret; - case 5: - ((mainfunc3)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv(), envp); - return ret; - } - } - } - PANIC(KErrNotFound); - return 0; - } - -LOCAL_C TInt DoMain(TAny* /*aParam*/) - { - - - CTrapCleanup* cleanup = CTrapCleanup::New(); - - TBool fbsconnected = EFalse; - if(RFbsSession::GetSession() == NULL) - { - PANIC_IF_ERROR(RFbsSession::Connect()); - fbsconnected = ETrue; - } - - gEpocEnv->iAppSrv->Init(); - -#ifdef SYMBIANC - // Create stdlib - _REENT; -#endif - - // Call stdlib main - int ret = 0; - - //completes waiting rendesvous - RThread::Rendezvous(KErrNone); - - TRAPD(err, err = MainL()); - - EpocSdlEnv::ObserverEvent(MSDLObserver::EEventMainExit, err); - - // Free resources and return - - EpocSdlEnv::CleanupItems(); - - gEpocEnv->iCleanupItems->Reset(); - delete gEpocEnv->iCleanupItems; - gEpocEnv->iCleanupItems = NULL; - - gEpocEnv->Free(); //free up in thread resources - -#ifdef SYMBIANC - _cleanup(); //this is normally called at exit, I call it here -#endif - - if(fbsconnected) - RFbsSession::Disconnect(); - -#ifdef SYMBIANC - CloseSTDLIB(); -#endif - - // delete as; - delete cleanup; - - return err == KErrNone ? ret : err;; - } - - - -EXPORT_C CSDL::~CSDL() - { - gEpocEnv->Free(); - User::Free(gEpocEnv); - gEpocEnv->iSdl = NULL; - } - -EXPORT_C CSDL* CSDL::NewL(TInt aFlags) - { - __ASSERT_ALWAYS(gEpocEnv == NULL, PANIC(KErrAlreadyExists)); - gEpocEnv = (EpocSdlEnvData*) User::AllocL(sizeof(EpocSdlEnvData)); - Mem::FillZ(gEpocEnv, sizeof(EpocSdlEnvData)); - - gEpocEnv->iEpocEnvFlags = aFlags; - gEpocEnv->iEventQueue = CEventQueue::NewL(); - - gEpocEnv->iAppSrv = new (ELeave) CSdlAppServ(); - gEpocEnv->iAppSrv->ConstructL(); - - CSDL* sdl = new (ELeave) CSDL(); - - gEpocEnv->iSdl = sdl; - - return sdl; - } - - /* -EXPORT_C void CSDL::ReInitL(TFlags aFlags) - { - const TFlags prevFlags = gEpocEnv->iEpocEnvFlags; - gEpocEnv->iEpocEnvFlags = aFlags; - TInt err = KErrNone; - if(((prevFlags & EDrawModeDSB) != (aFlags & EDrawModeDSB)) && gEpocEnv->iDsa) - { - delete gEpocEnv->iDsa; - gEpocEnv->iDsa = NULL; - gEpocEnv->iDsa = CDsa::RecreateL(EpocSdlEnv::Flags(CSDL::EDrawModeDSB)); - } - } - */ - - -EXPORT_C void CSDL::SetContainerWindowL(RWindow& aWindow, RWsSession& aSession, CWsScreenDevice& aDevice) - { - if(gEpocEnv->iDsa == NULL) - gEpocEnv->iDsa = CDsa::CreateL(aSession); - gEpocEnv->iDsa->ConstructL(aWindow, aDevice); - } - - -EXPORT_C TThreadId CSDL::CallMainL(const TMainFunc& aFunc, TRequestStatus* const aStatus, const CDesC8Array* const aArg, TInt aFlags, TInt aStackSize) - { - ASSERT(gEpocEnv != NULL); - gEpocEnv->iMain = aFunc; - const TBool args = aArg != NULL; - - gEpocEnv->iArgc = aArg->Count() + 1; - gEpocEnv->iArgv = (char**) User::AllocL(sizeof(char*) * (gEpocEnv->iArgc + 1)); - - TInt k = 0; - const TFileName processName = RProcess().FileName(); - const TInt len = processName.Length(); - gEpocEnv->iArgv[k] = (char*) User::AllocL(len + 1); - Mem::Copy(gEpocEnv->iArgv[k], processName.Ptr(), len); - gEpocEnv->iArgv[k][len] = 0; - - for(TInt i = 0; args && (i < aArg->Count()); i++) - { - k++; - const TInt len = aArg->MdcaPoint(i).Length(); - gEpocEnv->iArgv[k] = (char*) User::AllocL(len + 1); - Mem::Copy(gEpocEnv->iArgv[k], aArg->MdcaPoint(i).Ptr(), len); - gEpocEnv->iArgv[k][len] = 0; - } - - gEpocEnv->iArgv[gEpocEnv->iArgc] = NULL; - - RThread thread; - User::LeaveIfError(thread.Create(KSDLMain, DoMain, aStackSize, NULL, NULL)); - - if(aStatus != NULL) - { - thread.Logon(*aStatus); - } - - gEpocEnv->iId = thread.Id(); - thread.SetPriority(EPriorityLess); - if((aFlags & CSDL::ERequestResume) == 0) - { - thread.Resume(); - } - thread.Close(); - return gEpocEnv->iId; - } - -EXPORT_C TInt CSDL::AppendWsEvent(const TWsEvent& aEvent) - { - return EpocSdlEnv::EventQueue().Append(aEvent); - } - -EXPORT_C void CSDL::SDLPanic(const TDesC& aInfo, TInt aErr) - { - EpocSdlEnv::PanicMain(aInfo, aErr); - } - -EXPORT_C TInt CSDL::GetSDLCode(TInt aScanCode) - { - if(aScanCode < 0) - return MAX_SCANCODE; - if(aScanCode >= MAX_SCANCODE) - return -1; - return KeyMap()[aScanCode]; - } - -EXPORT_C TInt CSDL::SDLCodesCount() const - { - return MAX_SCANCODE; - } - -EXPORT_C void CSDL::ResetSDLCodes() - { - ResetKeyMap(); - } - -EXPORT_C void CSDL::SetOrientation(TOrientationMode aMode) - { - gEpocEnv->iDsa->SetOrientation(aMode); - } - -EXPORT_C TInt CSDL::SetSDLCode(TInt aScanCode, TInt aSDLCode) - { - const TInt current = GetSDLCode(aScanCode); - if(aScanCode >= 0 && aScanCode < MAX_SCANCODE) - KeyMap()[aScanCode] = static_cast(aSDLCode); - return current; - } - - -EXPORT_C MSDLObserver* CSDL::Observer() - { - return gEpocEnv->iAppSrv->Observer(); - } - -EXPORT_C void CSDL::SetObserver(MSDLObserver* aObserver) - { - gEpocEnv->iAppSrv->SetObserver(aObserver); - } - -EXPORT_C void CSDL::Resume() - { - EpocSdlEnv::Resume(); - } - -EXPORT_C void CSDL::Suspend() - { - gEpocEnv->iDsa->DoStop(); - } - -EXPORT_C CSDL::CSDL() - { - } - -EXPORT_C void CSDL::DisableKeyBlocking(CAknAppUi& aAppUi) const - { - gEpocEnv->iAppUi = &aAppUi; - EnvUtils::DisableKeyBlocking(); - } - -EXPORT_C TInt CSDL::SetBlitter(MBlitter* aBlitter) - { - if(gEpocEnv && gEpocEnv->iDsa) - { - gEpocEnv->iDsa->SetBlitter(aBlitter); - return KErrNone; - } - return KErrNotReady; - } - - -EXPORT_C TInt CSDL::AppendOverlay(MOverlay& aOverlay, TInt aPriority) - { - if(gEpocEnv && gEpocEnv->iDsa) - { - return gEpocEnv->iDsa->AppendOverlay(aOverlay, aPriority); - } - return KErrNotReady; - } - -EXPORT_C TInt CSDL::RemoveOverlay(MOverlay& aOverlay) - { - if(gEpocEnv && gEpocEnv->iDsa) - { - return gEpocEnv->iDsa->RemoveOverlay(aOverlay); - } - return KErrNotReady; - } - -EXPORT_C TInt CSDL::RedrawRequest() - { - if(gEpocEnv && gEpocEnv->iDsa) - { - return gEpocEnv->iDsa->RedrawRequest(); - } - return KErrNotReady; - } - -/* -EXPORT_C CSDL* CSDL::Current() - { - return gEpocEnv != NULL ? gEpocEnv->iSdl : NULL; - } - - -EXPORT_C TInt CSDL::SetVolume(TInt aVolume) - { - return EpocSdlEnv::SetVolume(aVolume); - } - -EXPORT_C TInt CSDL::Volume() const - { - return EpocSdlEnv::Volume(); - } - -EXPORT_C TInt CSDL::MaxVolume() const - { - return EpocSdlEnv::MaxVolume(); - } -*/ - -void EnvUtils::DisableKeyBlocking() - { - if(gEpocEnv->iAppUi != NULL) - return CCurrentAppUi::Cast(gEpocEnv->iAppUi)->DisableKeyBlocking(); - } - -TBool EnvUtils::Rendezvous(RThread& aThread, TRequestStatus& aStatus) - { - if(gEpocEnv->iId != TThreadId(0) && - aThread.Open(gEpocEnv->iId) && - aThread.ExitType() == EExitPending) - { - aThread.Rendezvous(aStatus); - return ETrue; - } - return EFalse; - } - - - diff --git a/src/main/symbian/EKA2/sdlexe.cpp b/src/main/symbian/EKA2/sdlexe.cpp deleted file mode 100644 index bb160c4090..0000000000 --- a/src/main/symbian/EKA2/sdlexe.cpp +++ /dev/null @@ -1,809 +0,0 @@ -// INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - - -// FORWARD DECLARATIONS -class CApaDocument; - - -//const TUid KSDLUID = { 0xF01F605E }; - -LOCAL_C void MakeCCmdLineL(const TDesC8& aParam, CDesC8Array& aArray) - { - - const TChar dq('\"'); - - TLex8 lex(aParam); - TBool in = EFalse; - - lex.SkipSpaceAndMark(); - - while(!lex.Eos()) - { - TPtrC8 ptr; - if(in) - { - const TPtrC8 rem = lex.RemainderFromMark(); - const TInt pos = rem.Locate(dq); - if(pos > 0) - { - lex.Inc(pos); - ptr.Set(lex.MarkedToken()); - lex.SkipAndMark(1); - } - else - { - ptr.Set(rem); - } - in = EFalse; - } - else - { - ptr.Set(lex.NextToken()); - const TInt pos = ptr.Locate(dq); - if(pos == 0) - { - lex.UnGetToMark(); - lex.SkipAndMark(1); - in = ETrue; - continue; // back to in brace - } - else - lex.SkipSpaceAndMark(); - } - - aArray.AppendL(ptr); - - } - } - -NONSHARABLE_CLASS(TVirtualCursor) : public MOverlay - { - public: - TVirtualCursor(); - void Set(const TRect& aRect, CFbsBitmap* aBmp, CFbsBitmap* aAlpha); - void Move(TInt aX, TInt aY); - void MakeEvent(TWsEvent& aEvent, const TPoint& aBasePos) const; - void Toggle(); - TBool IsOn() const; - private: - void Draw(CBitmapContext& aGc, const TRect& aTargetRect, const TSize& aSize); - private: - TRect iRect; - TPoint iInc; - TPoint iPos; - TBool iIsOn; - CFbsBitmap* iCBmp; - CFbsBitmap* iAlpha; - }; - - -TVirtualCursor::TVirtualCursor() : iInc(0, 0), iIsOn(EFalse), iCBmp(NULL) - { - } - -const TInt KMaxMove = 10; - -void TVirtualCursor::Move(TInt aX, TInt aY) - { - if(aX > 0 && iInc.iX > 0) - ++iInc.iX; - else if(aX < 0 && iInc.iX < 0) - --iInc.iX; - else - iInc.iX = aX; - - if(aY > 0 && iInc.iY > 0) - ++iInc.iY; - else if(aY < 0 && iInc.iY < 0) - --iInc.iY; - else - iInc.iY = aY; - - iInc.iX = Min(KMaxMove, iInc.iX); - - iInc.iX = Max(-KMaxMove, iInc.iX); - - iInc.iY = Min(KMaxMove, iInc.iY); - - iInc.iY =Max(-KMaxMove, iInc.iY); - - const TPoint pos = iPos + iInc; - if(iRect.Contains(pos)) - { - iPos = pos; - } - else - { - iInc = TPoint(0, 0); - } - } - - -void TVirtualCursor::Toggle() - { - iIsOn = !iIsOn; - } - - -TBool TVirtualCursor::IsOn() const - { - return iIsOn; - } - -void TVirtualCursor::Set(const TRect& aRect, CFbsBitmap* aBmp, CFbsBitmap* aAlpha) - { - iRect = aRect; - iCBmp = aBmp; - iAlpha = aAlpha; - } - - -void TVirtualCursor::MakeEvent(TWsEvent& aEvent, const TPoint& aBasePos) const - { - aEvent.SetType(EEventPointer), - aEvent.SetTimeNow(); - TPointerEvent& pointer = *aEvent.Pointer(); - pointer.iType = TPointerEvent::EButton1Down; - pointer.iPosition = iPos; - pointer.iParentPosition = aBasePos; - } - - -void TVirtualCursor::Draw(CBitmapContext& aGc, const TRect& /*aTargetRect*/, const TSize& /*aSize*/) - { - if(iIsOn && iCBmp != NULL) - { - const TRect rect(TPoint(0, 0), iCBmp->SizeInPixels()); - aGc.AlphaBlendBitmaps(iPos, iCBmp, rect, iAlpha, TPoint(0, 0)); - } - - } - -NONSHARABLE_CLASS(TSdlClass) - { - public: - TSdlClass(); - void SetMain(const TMainFunc& aFunc, TInt aFlags, MSDLMainObs* aObs, TInt aExeFlags); - TInt SdlFlags() const; - const TMainFunc& Main() const; - void SendEvent(TInt aEvent, TInt aParam, CSDL* aSDL); - TInt AppFlags() const; - void AppFlags(TInt aFlags); - private: - TMainFunc iFunc; - TInt iSdlFlags; - TInt iExeFlags; - MSDLMainObs* iObs; - }; - - -void TSdlClass::AppFlags(TInt aFlags) - { - iExeFlags |= aFlags; - } - -void TSdlClass::SendEvent(TInt aEvent, TInt aParam, CSDL* aSDL) - { - if(iObs != NULL) - iObs->SDLMainEvent(aEvent, aParam, aSDL); - } - -TInt TSdlClass::AppFlags() const - { - return iExeFlags; - } - -void TSdlClass::SetMain(const TMainFunc& aFunc, TInt aFlags, MSDLMainObs* aObs, TInt aExeFlags) - { - iFunc = aFunc; - iSdlFlags = aFlags; - iExeFlags = aExeFlags; - iObs = aObs; - } - -const TMainFunc& TSdlClass::Main() const - { - return iFunc; - } - - - TInt TSdlClass::SdlFlags() const - { - return iSdlFlags; - } - - - -TSdlClass::TSdlClass() - { - Mem::FillZ(this, sizeof(this)); - } - -TSdlClass gSDLClass; - - -//////////////////////////////////////////////////////////////// - -NONSHARABLE_CLASS(CSDLApplication) : public CAknApplication - { - public: - CSDLApplication(); - private: - CApaDocument* CreateDocumentL(); - TFileName ResourceFileName() const; - TUid AppDllUid() const; - void FindMeL(); - TUid iUid; - }; - -NONSHARABLE_CLASS(CSDLDocument) : public CEikDocument - { - public: - CSDLDocument(CEikApplication& aApp); - private: - CEikAppUi* CreateAppUiL(); - - }; - - //////////////////////////////////////////////////////////////////// - - -NONSHARABLE_CLASS(MExitWait) - { - public: - virtual void DoExit(TInt aErr) = 0; - }; - -///////////////////////////////////////////////////////////////////////// - -NONSHARABLE_CLASS(CExitWait) : public CActive - { - public: - CExitWait(MExitWait& aWait); - ~CExitWait(); - private: - void RunL(); - void DoCancel(); - private: - MExitWait& iWait; - TRequestStatus* iStatusPtr; - }; - -//////////////////////////////////////////////////////////////////////// - - -NONSHARABLE_CLASS(CSDLWin) : public CCoeControl - { - public: - void ConstructL(const TRect& aRect); - RWindow& GetWindow() const; - void SetNoDraw(); - private: - void Draw(const TRect& aRect) const; - private: - TBool iNoDraw; - }; - - -//////////////////////////////////////////////////////////////////////////// - -NONSHARABLE_CLASS(CSDLAppUi) : public CAknAppUi, public MExitWait, MSDLObserver - { - public: - ~CSDLAppUi(); - private: // New functions - void ConstructL(); - void HandleCommandL(TInt aCommand); - void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination); - void HandleResourceChangeL(TInt aType); - - void DoExit(TInt aErr); - - TInt SdlEvent(TInt aEvent, TInt aParam); - TInt SdlThreadEvent(TInt aEvent, TInt aParam); - - void StartL(); - static TBool StartL(TAny* aThis); - - TBool ParamEditorL(TDes& aCheat); - - TBool ProcessCommandParametersL(CApaCommandLine &aCommandLine); - - void PrepareToExit(); - void HandleConsoleWindowL(); - void HandleConsoleWindow(); - void HandleForegroundEventL(TBool aForeground); - - static TBool IdleRequestL(TAny* aThis); - - TBool HandleKeyL(const TWsEvent& aEvent); - - - private: - CExitWait* iWait; - CSDLWin* iSDLWin; - CSDL* iSdl; - CIdle* iStarter; - TBool iExitRequest; - CDesC8Array* iParams; - TInt iResOffset; - CIdle* iIdle; - TInt iStdOut; - TVirtualCursor iCursor; - CFbsBitmap* iCBmp; - CFbsBitmap* iAlpha; - // TTime iLastPress; - // CSDL::TOrientationMode iOrientation; - }; - -////////////////////////////////////////////////////////////////////////////////////////7 - -CApaDocument* CSDLApplication::CreateDocumentL() - { - return new (ELeave) CSDLDocument(*this); - } - -TUid CSDLApplication::AppDllUid() const - { - return iUid; - } - - -CSDLApplication::CSDLApplication() - { - TRAPD(err, FindMeL()); - ASSERT(err == KErrNone); - } - -void CSDLApplication::FindMeL() - { - RApaLsSession apa; - User::LeaveIfError(apa.Connect()); - CleanupClosePushL(apa); - User::LeaveIfError(apa.GetAllApps()); - TFileName name = RProcess().FileName(); - TApaAppInfo info; - while(apa.GetNextApp(info) == KErrNone) - { - if(info.iFullName.CompareF(name) == 0) - { - iUid = info.iUid; - break; - } - } - CleanupStack::PopAndDestroy(); - } - -TFileName CSDLApplication::ResourceFileName() const - { - return KNullDesC(); - } - -/////////////////////////////////////////////////////////////////////////////////////////// - -CExitWait::CExitWait(MExitWait& aWait) : CActive(CActive::EPriorityStandard), iWait(aWait) - { - CActiveScheduler::Add(this); - SetActive(); - iStatusPtr = &iStatus; - } - -CExitWait::~CExitWait() - { - Cancel(); - } - -void CExitWait::RunL() - { - if(iStatusPtr != NULL ) - iWait.DoExit(iStatus.Int()); - } - -void CExitWait::DoCancel() - { - if(iStatusPtr != NULL ) - User::RequestComplete(iStatusPtr , KErrCancel); - } - - -////////////////////////////////////////////////////////////////////////////////////////////// - -CSDLDocument::CSDLDocument(CEikApplication& aApp) : CEikDocument(aApp) - {} - -CEikAppUi* CSDLDocument::CreateAppUiL() - { - return new (ELeave) CSDLAppUi; - } - -/////////////////////////////////////////////////////////////////////////// - -void CSDLWin:: ConstructL(const TRect& aRect) - { - CreateWindowL(); - SetRect(aRect); - ActivateL(); - } - - -RWindow& CSDLWin::GetWindow() const - { - return Window(); - } - - -void CSDLWin::Draw(const TRect& /*aRect*/) const - { - if(!iNoDraw) - { - CWindowGc& gc = SystemGc(); - gc.SetPenStyle(CGraphicsContext::ESolidPen); - gc.SetPenColor(KRgbGray); - gc.SetBrushStyle(CGraphicsContext::ESolidBrush); - gc.SetBrushColor(0xaaaaaa); - gc.DrawRect(Rect()); - } - } - -void CSDLWin::SetNoDraw() - { - iNoDraw = ETrue; - } - -///////////////////////////////////////////////////////////////////////// - -CSDLAppUi::~CSDLAppUi() - { - if(iIdle) - iIdle->Cancel(); - delete iIdle; - if(iStarter != NULL) - iStarter->Cancel(); - delete iStarter; - delete iWait; - delete iSdl; - delete iSDLWin; - delete iParams; - delete iCBmp; - delete iAlpha; - } - - -void CSDLAppUi::ConstructL() - { - BaseConstructL(ENoAppResourceFile | ENoScreenFurniture); - - - RLibrary lib; - User::LeaveIfError(lib.Load(_L("sdlexe.dll"))); - TFileName name = lib.FileName(); - lib.Close(); - name.Replace(3, name.Length() - 3, _L("resource\\apps\\sdlexe.rsc")); - BaflUtils::NearestLanguageFile(iEikonEnv->FsSession(), name); - iResOffset = iCoeEnv->AddResourceFileL(name); - - name.Replace(name.Length() - 3, 3, _L("mbm")); - - TEntry e; - const TInt err = iEikonEnv->FsSession().Entry(name, e); - - iCBmp = iEikonEnv->CreateBitmapL(name, 0); - iAlpha = iEikonEnv->CreateBitmapL(name, 1); - - iIdle = CIdle::NewL(CActive::EPriorityIdle); - - iSDLWin = new (ELeave) CSDLWin; - iSDLWin->ConstructL(ApplicationRect()); - - iSdl = CSDL::NewL(gSDLClass.SdlFlags()); - - gSDLClass.SendEvent(MSDLMainObs::ESDLCreated, 0, iSdl); - - iSdl->SetObserver(this); - iSdl->DisableKeyBlocking(*this); - iSdl->SetContainerWindowL( - iSDLWin->GetWindow(), - iEikonEnv->WsSession(), - *iEikonEnv->ScreenDevice()); - iSdl->AppendOverlay(iCursor, 0); - - iCursor.Set(TRect(TPoint(0, 0), iSDLWin->Size()), iCBmp, iAlpha); - - iStarter = CIdle::NewL(CActive::EPriorityLow); - iStarter->Start(TCallBack(StartL, this)); - - - } - - - -TBool CSDLAppUi::StartL(TAny* aThis) - { - static_cast(aThis)->StartL(); - return EFalse; - } - - -void CSDLAppUi::PrepareToExit() - { - CAknAppUiBase::PrepareToExit(); //aknappu::PrepareToExit crashes - iCoeEnv->DeleteResourceFile(iResOffset); - } - -TBool CSDLAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine) - { - const TPtrC8 cmdLine = aCommandLine.TailEnd(); - iParams = new (ELeave) CDesC8ArrayFlat(8); - MakeCCmdLineL(cmdLine, *iParams); - return EFalse; - } - - - TBool CSDLAppUi::ParamEditorL(TDes& aCheat) - { - CAknTextQueryDialog* query = CAknTextQueryDialog::NewL(aCheat); - CleanupStack::PushL(query); - query->SetPromptL(_L("Enter parameters")); - CleanupStack::Pop(); - return query->ExecuteLD(R_PARAMEDITOR); - } - - void CSDLAppUi::StartL() - { - if(gSDLClass.AppFlags() & SDLEnv::EParamQuery) - { - TBuf8<256> cmd; - RFile file; - TInt err = file.Open(iEikonEnv->FsSession(), _L("sdl_param.txt"),EFileRead); - if(err == KErrNone) - { - file.Read(cmd); - file.Close(); - MakeCCmdLineL(cmd, *iParams); - } - if(err != KErrNone || gSDLClass.AppFlags() & (SDLEnv::EParamQueryDialog ^ SDLEnv::EParamQuery)) - { - TBuf<256> buffer; - if(ParamEditorL(buffer)) - { - cmd.Copy(buffer); - MakeCCmdLineL(cmd, *iParams); - } - } - } - iWait = new (ELeave) CExitWait(*this); - iSdl->CallMainL(gSDLClass.Main(), &iWait->iStatus, iParams, CSDL::ENoParamFlags, 0xA000); - } - -void CSDLAppUi::HandleCommandL(TInt aCommand) - { - switch(aCommand) - { - case EAknSoftkeyBack: - case EAknSoftkeyExit: - case EAknCmdExit: - case EEikCmdExit: - gSDLClass.AppFlags(SDLEnv::EAllowConsoleView); - if(iWait == NULL || !iWait->IsActive() || iSdl == NULL) - { - Exit(); - } - else if(!iExitRequest) - { - iExitRequest = ETrue; //trick how SDL can be closed! - iSdl->Suspend(); - } - break; - } - } - - - -TBool CSDLAppUi::HandleKeyL(const TWsEvent& aEvent) - { - const TInt type = aEvent.Type(); - if(!(type == EEventKey || type == EEventKeyUp || type == EEventKeyDown)) - { - return ETrue; - } - const TKeyEvent& key = *aEvent.Key(); - if((key.iScanCode == EStdKeyYes) && (gSDLClass.AppFlags() & SDLEnv::EVirtualMouse)) - { - if(type == EEventKeyUp) - { - iCursor.Toggle(); - iSdl->RedrawRequest(); - } - return EFalse; - } - if(iCursor.IsOn()) - { - switch(key.iScanCode) - { - case EStdKeyUpArrow: - iCursor.Move(0, -1); - break; - case EStdKeyDownArrow: - iCursor.Move(0, 1); - break; - case EStdKeyLeftArrow: - iCursor.Move(-1, 0); - break; - case EStdKeyRightArrow: - iCursor.Move(1, 0); - break; - case EStdKeyDevice3: - if(type == EEventKeyUp) - { - TWsEvent event; - iCursor.MakeEvent(event, iSDLWin->Position()); - iSdl->AppendWsEvent(event); - } - return EFalse; - default: - return ETrue; - } - iSdl->RedrawRequest(); - return EFalse; - } - return ETrue; - } - - void CSDLAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination) - { - if(iSdl && iWait && HandleKeyL(aEvent)) - iSdl->AppendWsEvent(aEvent); - CAknAppUi::HandleWsEventL(aEvent, aDestination); - } - - void CSDLAppUi::HandleResourceChangeL(TInt aType) - { - CAknAppUi::HandleResourceChangeL(aType); - if(aType == KEikDynamicLayoutVariantSwitch) - { - iSDLWin->SetRect(ApplicationRect()); - iSdl->SetContainerWindowL( - iSDLWin->GetWindow(), - iEikonEnv->WsSession(), - *iEikonEnv->ScreenDevice()); - } - } - - -void CSDLAppUi::DoExit(TInt/*Err*/) - { - iExitRequest = ETrue; - Exit(); - } - - - TInt CSDLAppUi::SdlThreadEvent(TInt aEvent, TInt /*aParam*/) - { - switch(aEvent) - { - case MSDLObserver::EEventResume: - break; - case MSDLObserver::EEventSuspend: - if(iExitRequest) - return MSDLObserver::ESuspendNoSuspend; - break; - case MSDLObserver::EEventWindowReserved: - break; - case MSDLObserver::EEventWindowNotAvailable: - break; - case MSDLObserver::EEventScreenSizeChanged: - break; - } - return MSDLObserver::EParameterNone; - } - -TInt CSDLAppUi::SdlEvent(TInt aEvent, TInt /*aParam*/) - { - switch(aEvent) - { - case MSDLObserver::EEventResume: - break; - case MSDLObserver::EEventSuspend: - if(iExitRequest) - return MSDLObserver::ESuspendNoSuspend; - break; - case MSDLObserver::EEventWindowReserved: - break; - case MSDLObserver::EEventWindowNotAvailable: - { - TRAP_IGNORE(HandleConsoleWindowL()); - } - break; - case MSDLObserver::EEventScreenSizeChanged: - break; - case MSDLObserver::EEventKeyMapInit: - break; - case MSDLObserver::EEventMainExit: - if(iStdOut != 0) - { - gSDLClass.AppFlags(SDLEnv::EAllowConsoleView); - iEikonEnv->WsSession().SetWindowGroupOrdinalPosition(iStdOut, 0); - } - break; - } - return MSDLObserver::EParameterNone; - } - -void CSDLAppUi::HandleForegroundEventL(TBool aForeground) - { - CAknAppUi::HandleForegroundEventL(aForeground); - if(!aForeground) - HandleConsoleWindow(); - } - -void CSDLAppUi::HandleConsoleWindow() - { - if(!iIdle->IsActive()) - iIdle->Start(TCallBack(IdleRequestL, this)); - } - -TBool CSDLAppUi::IdleRequestL(TAny* aThis) - { - static_cast(aThis)->HandleConsoleWindowL(); - return EFalse; - } - -void CSDLAppUi::HandleConsoleWindowL() - { - if(gSDLClass.AppFlags() & SDLEnv::EAllowConsoleView) - { - return; - } - RWsSession& ses = iEikonEnv->WsSession(); - const TInt focus = ses.GetFocusWindowGroup(); - CApaWindowGroupName* name = CApaWindowGroupName::NewLC(ses, focus); - const TPtrC caption = name->Caption(); - if(0 == caption.CompareF(_L("STDOUT"))) - { - iStdOut = focus; - ses.SetWindowGroupOrdinalPosition(iEikonEnv->RootWin().Identifier(), 0); - } - CleanupStack::PopAndDestroy(); //name - } - - -//////////////////////////////////////////////////////////////////////// - - -CApaApplication* NewApplication() - { - return new CSDLApplication(); - } - - -EXPORT_C TInt SDLEnv::SetMain(const TMainFunc& aFunc, TInt aSdlFlags, MSDLMainObs* aObs, TInt aSdlExeFlags) - { - gSDLClass.SetMain(aFunc, aSdlFlags, aObs, aSdlExeFlags); - return EikStart::RunApplication(NewApplication); - } - -////////////////////////////////////////////////////////////////////// - -TInt SDLUiPrint(const TDesC8& /*aInfo*/) - { - return KErrNotFound; - } - - - diff --git a/src/main/symbian/EKA2/sdllib.cpp b/src/main/symbian/EKA2/sdllib.cpp deleted file mode 100644 index 7c09996ec7..0000000000 --- a/src/main/symbian/EKA2/sdllib.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include -#include - - -GLREF_C TInt E32Main() - { - return SDLEnv::SetMain(SDL_main, CSDL::EEnableFocusStop | CSDL::EAllowImageResize, - NULL, SDLEnv::EParamQuery | SDLEnv::EVirtualMouse); - } - - \ No newline at end of file diff --git a/src/main/symbian/EKA2/vectorbuffer.cpp b/src/main/symbian/EKA2/vectorbuffer.cpp deleted file mode 100644 index 72c3b3e5c0..0000000000 --- a/src/main/symbian/EKA2/vectorbuffer.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - vectorbuffer.cpp - yet another circle buffer - - Markus Mertama -*/ - -#include"vectorbuffer.h" - - - -void VectorPanic(TInt aErr, TInt aLine) - { - TBuf<64> b; - b.Format(_L("vector buffer at % d "), aLine); - User::Panic(b, aErr); - } - -void TNodeBuffer::TNode::Terminator(TNodeBuffer::TNode* aNode) - { - Mem::Copy(iSucc, &aNode, sizeof(TNode*)); - } - -TInt TNodeBuffer::TNode::Size() const - { - return reinterpret_cast(iSucc) - Ptr(); - } - -const TUint8* TNodeBuffer::TNode::Ptr() const - { - return reinterpret_cast(this) + sizeof(TNode); - } - -TNodeBuffer::TNode* TNodeBuffer::TNode::Empty(TUint8* aBuffer) - { - TNode* node = reinterpret_cast(aBuffer); - node->iSucc = node + 1; - return node; - } - - TNodeBuffer::TNode* TNodeBuffer::TNode::New(TNode* aPred, const TDesC8& aData) - { - TNode* node = aPred->Size() == 0 ? aPred : aPred->iSucc; - - - TUint8* start = reinterpret_cast(node) + sizeof(TNode); - node->iSucc = reinterpret_cast(start + aData.Size()); - node->iSucc->iSucc = NULL; //terminator - - __ASSERT_DEBUG(node->Size() == aData.Size(), VECPANIC(KErrCorrupt)); - - Mem::Copy(start, aData.Ptr(), aData.Size()); - return node; - } - - - - - - - - \ No newline at end of file diff --git a/src/main/symbian/EKA2/vectorbuffer.h b/src/main/symbian/EKA2/vectorbuffer.h deleted file mode 100644 index 3d8be58d6a..0000000000 --- a/src/main/symbian/EKA2/vectorbuffer.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - vectorbuffer.cpp - yet another circle buffer - - Markus Mertama -*/ - -#ifndef __VECTORBUFFER_H__ -#define __VECTORBUFFER_H__ - -#include -#define VLOG(x) -#define VECPANIC(x) VectorPanic(x, __LINE__) -void VectorPanic(TInt, TInt); - - -//int DEBUG_INT; - -NONSHARABLE_CLASS(TNodeBuffer) - { - public: - protected: - NONSHARABLE_CLASS(TNode) - { - public: - static TNode* Empty(TUint8* iBuffer); - static TNode* New(TNode* aPrev, const TDesC8& aData); - const TUint8* Ptr() const; - TInt Size() const; - inline TNode* Succ(); - static void SetSucc(TNode*& aNode); - void Terminator(TNode* aNode); - private: - TNode* iSucc; - }; - }; - -inline TNodeBuffer::TNode* TNodeBuffer::TNode::Succ() - { - return iSucc; - } - -template -NONSHARABLE_CLASS(TVectorBuffer) : public TNodeBuffer - { - public: - TVectorBuffer(); - TInt Append(const TDesC8& aData); - // TInt AppendOverwrite(const TDesC8& aData); - TPtrC8 Shift(); - TPtrC8 operator[](TInt aIndex) const; - TInt Size() const; - private: - TInt GetRoom(TInt aSize) const; - TInt Unreserved() const; - private: - TNode* iTop; - TNode* iBottom; - TInt iSize; - TUint8 iBuffer[C]; - }; - -template -TVectorBuffer::TVectorBuffer() : iSize(0) - { - Mem::FillZ(iBuffer, C); - iTop = TNode::Empty(iBuffer); //these points to buffer - iBottom = TNode::Empty(iBuffer); - } - -template -TInt TVectorBuffer::Unreserved() const - { - __ASSERT_DEBUG(iBottom < iBottom->Succ(), VECPANIC(KErrCorrupt)); - const TInt bytesbetween = - reinterpret_cast(iBottom->Succ()) - - reinterpret_cast(iTop); - const TInt topsize = sizeof(TNode); - if(bytesbetween > 0) //bytesbetween is room between bottom and top - { //therefore free room is subracted from free space - - const TInt room = C - bytesbetween - topsize; - return room; - } - if(bytesbetween == 0) - { - - if(Size() > 0) - return 0; - else - return C - topsize; - } - const TInt room = -bytesbetween - topsize; //free is space between pointers - return room; - } - -template -TInt TVectorBuffer::GetRoom(TInt aSize) const - { - const TInt bytesnew = sizeof(TNode) + aSize; - const TInt room = Unreserved() - bytesnew; - return room; - } - -template -TInt TVectorBuffer::Append(const TDesC8& aData) //ei ole ok! - { - const TInt len = aData.Length(); - if(GetRoom(len) < 0) - { - return KErrOverflow; - } - if(iBottom->Succ()->Ptr() - iBuffer > (C - (len + TInt(sizeof(TNode))))) - { - VLOG("rc"); - // RDebug::Print(_L("vector: append")); - TNode* p = TNode::Empty(iBuffer); - iBottom->Terminator(p); - iBottom = p; - return Append(aData); - // Append(); - // iBottom = TNode::New(p, aData); //just append something into end - } - - //DEBUG_INT++; - - iBottom = TNode::New(iBottom, aData); - - iSize += len; - return KErrNone; - } - -/* -template -TInt TVectorBuffer::AppendOverwrite(const TDesC8& aData) //ei ole ok! - { - while(Append(aData) == KErrOverflow) - { - if(iTop->Succ() == NULL) - { - return KErrUnderflow; - } - //Shift(); //data is lost - } - return KErrNone; - } -*/ -template -TPtrC8 TVectorBuffer::Shift() - { - __ASSERT_ALWAYS(iTop->Succ() != NULL, VECPANIC(KErrUnderflow)); //can never pass-by bottom - TNode* node = iTop; - iTop = iTop->Succ(); - if(iTop > node) - { - // DEBUG_INT--; - iSize -= node->Size(); - return TPtrC8(node->Ptr(), node->Size()); - } - else - { - // RDebug::Print(_L("vector: shift")); - return Shift(); //this happens when buffer is terminated, and data lies in next - } - } - -template -TInt TVectorBuffer::Size() const - { - return iSize; - } - -template -TPtrC8 TVectorBuffer::operator[](TInt aIndex) const - { - TInt index = 0; - TNode* t = iTop->Size() > 0 ? iTop : iTop->Succ(); //eliminate terminator - while(index < aIndex) - { - TNode* nt = t->Succ(); - if(nt < t) - { - nt = nt->Succ(); - } - t = nt; - if(t->Size() > 0) - index++; - __ASSERT_ALWAYS(t->Succ() != NULL, VECPANIC(KErrUnderflow)); //can never pass-by bottom - } - return t->Ptr(); - } - - -template -NONSHARABLE_CLASS(TVector) : public TVectorBuffer - { - public: - TVector(); - TInt Append(const T& aData); - const T& Shift(); - TInt Size() const; - const T& operator[](TInt aIndex) const; - }; - -template -TVector::TVector() : TVectorBuffer() - { - } - -template -TInt TVector::Append(const T& aData) - { - const TPckgC data(aData); - return TVectorBuffer::Append(data); - } - -template -const T& TVector::Shift() - { - const TPtrC8 ptr = TVectorBuffer::Shift(); - return *(reinterpret_cast(ptr.Ptr())); - } - - -template -TInt TVector::Size() const - { - return TVectorBuffer::Size() / sizeof(T); - } - -template -const T& TVector::operator[](TInt aIndex) const - { - const TPtrC8 ptr = TVectorBuffer::operator[](aIndex); - return *(reinterpret_cast(ptr.Ptr())); - } - -#endif - - diff --git a/src/main/win32/SDL_win32_main.c b/src/main/win32/SDL_win32_main.c deleted file mode 100644 index 672b48c12e..0000000000 --- a/src/main/win32/SDL_win32_main.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 - - The WinMain function -- calls your program's main() function -*/ - -#include -#include - -#define WIN32_LEAN_AND_MEAN -#include - -#ifdef _WIN32_WCE -# define DIR_SEPERATOR TEXT("\\") -# undef _getcwd -# define _getcwd(str,len) wcscpy(str,TEXT("")) -# define setbuf(f,b) -# define setvbuf(w,x,y,z) -# define fopen _wfopen -# define freopen _wfreopen -# define remove(x) DeleteFile(x) -#else -# define DIR_SEPERATOR TEXT("/") -# include -#endif - -/* Include the SDL main definition header */ -#include "SDL.h" -#include "SDL_main.h" - -#ifdef main -# ifndef _WIN32_WCE_EMULATION -# undef main -# endif /* _WIN32_WCE_EMULATION */ -#endif /* main */ - -/* The standard output files */ -#define STDOUT_FILE TEXT("stdout.txt") -#define STDERR_FILE TEXT("stderr.txt") - -/* Set a variable to tell if the stdio redirect has been enabled. */ -static int stdioRedirectEnabled = 0; - -#ifdef _WIN32_WCE - static wchar_t stdoutPath[MAX_PATH]; - static wchar_t stderrPath[MAX_PATH]; -#else - static char stdoutPath[MAX_PATH]; - static char stderrPath[MAX_PATH]; -#endif - -#if defined(_WIN32_WCE) && _WIN32_WCE < 300 -/* seems to be undefined in Win CE although in online help */ -#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) -#endif /* _WIN32_WCE < 300 */ - -static void UnEscapeQuotes( char *arg ) -{ - char *last = NULL; - - while( *arg ) { - if( *arg == '"' && *last == '\\' ) { - char *c_curr = arg; - char *c_last = last; - - while( *c_curr ) { - *c_last = *c_curr; - c_last = c_curr; - c_curr++; - } - *c_last = '\0'; - } - last = arg; - arg++; - } -} - -/* Parse a command line buffer into arguments */ -static int ParseCommandLine(char *cmdline, char **argv) -{ - char *bufp; - char *lastp = NULL; - int argc, last_argc; - - argc = last_argc = 0; - for ( bufp = cmdline; *bufp; ) { - /* Skip leading whitespace */ - while ( isspace(*bufp) ) { - ++bufp; - } - /* Skip over argument */ - if ( *bufp == '"' ) { - ++bufp; - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && ( *bufp != '"' || (lastp && *lastp == '\\') ) ) { - lastp = bufp; - ++bufp; - } - } else { - if ( *bufp ) { - if ( argv ) { - argv[argc] = bufp; - } - ++argc; - } - /* Skip over word */ - while ( *bufp && ! isspace(*bufp) ) { - ++bufp; - } - } - if ( *bufp ) { - if ( argv ) { - *bufp = '\0'; - } - ++bufp; - } - - /* Strip out \ from \" sequences */ - if( argv && last_argc != argc ) { - UnEscapeQuotes( argv[last_argc] ); - } - last_argc = argc; - } - if ( argv ) { - argv[argc] = NULL; - } - return(argc); -} - -/* Show an error message */ -static void ShowError(const char *title, const char *message) -{ -/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */ -#ifdef USE_MESSAGEBOX - MessageBox(NULL, message, title, MB_ICONEXCLAMATION|MB_OK); -#else - fprintf(stderr, "%s: %s\n", title, message); -#endif -} - -/* Pop up an out of memory message, returns to Windows */ -static BOOL OutOfMemory(void) -{ - ShowError("Fatal Error", "Out of memory - aborting"); - return FALSE; -} - -/* SDL_Quit() shouldn't be used with atexit() directly because - calling conventions may differ... */ -static void cleanup(void) -{ - SDL_Quit(); -} - -/* Remove the output files if there was no output written */ -static void cleanup_output(void) { - FILE *file; - int empty; - - /* Flush the output in case anything is queued */ - fclose(stdout); - fclose(stderr); - - /* Without redirection we're done */ - if (!stdioRedirectEnabled) { - return; - } - - /* See if the files have any output in them */ - if ( stdoutPath[0] ) { - file = fopen(stdoutPath, TEXT("rb")); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - remove(stdoutPath); - } - } - } - if ( stderrPath[0] ) { - file = fopen(stderrPath, TEXT("rb")); - if ( file ) { - empty = (fgetc(file) == EOF) ? 1 : 0; - fclose(file); - if ( empty ) { - remove(stderrPath); - } - } - } -} - -/* Redirect the output (stdout and stderr) to a file */ -static void redirect_output(void) -{ - DWORD pathlen; -#ifdef _WIN32_WCE - wchar_t path[MAX_PATH]; -#else - char path[MAX_PATH]; -#endif - FILE *newfp; - - pathlen = GetModuleFileName(NULL, path, SDL_arraysize(path)); - while ( pathlen > 0 && path[pathlen] != '\\' ) { - --pathlen; - } - path[pathlen] = '\0'; - -#ifdef _WIN32_WCE - wcsncpy( stdoutPath, path, SDL_arraysize(stdoutPath) ); - wcsncat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); -#else - SDL_strlcpy( stdoutPath, path, SDL_arraysize(stdoutPath) ); - SDL_strlcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); -#endif - - /* Redirect standard input and standard output */ - newfp = freopen(stdoutPath, TEXT("w"), stdout); - -#ifndef _WIN32_WCE - if ( newfp == NULL ) { /* This happens on NT */ -#if !defined(stdout) - stdout = fopen(stdoutPath, TEXT("w")); -#else - newfp = fopen(stdoutPath, TEXT("w")); - if ( newfp ) { - *stdout = *newfp; - } -#endif - } -#endif /* _WIN32_WCE */ - -#ifdef _WIN32_WCE - wcsncpy( stderrPath, path, SDL_arraysize(stdoutPath) ); - wcsncat( stderrPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); -#else - SDL_strlcpy( stderrPath, path, SDL_arraysize(stderrPath) ); - SDL_strlcat( stderrPath, DIR_SEPERATOR STDERR_FILE, SDL_arraysize(stderrPath) ); -#endif - - newfp = freopen(stderrPath, TEXT("w"), stderr); -#ifndef _WIN32_WCE - if ( newfp == NULL ) { /* This happens on NT */ -#if !defined(stderr) - stderr = fopen(stderrPath, TEXT("w")); -#else - newfp = fopen(stderrPath, TEXT("w")); - if ( newfp ) { - *stderr = *newfp; - } -#endif - } -#endif /* _WIN32_WCE */ - - setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* Line buffered */ - setbuf(stderr, NULL); /* No buffering */ - stdioRedirectEnabled = 1; -} - -#if defined(_MSC_VER) && !defined(_WIN32_WCE) -/* The VC++ compiler needs main defined */ -#define console_main main -#endif - -/* This is where execution begins [console apps] */ -int console_main(int argc, char *argv[]) -{ - size_t n; - char *bufp, *appname; - int status; - - /* Get the class name from argv[0] */ - appname = argv[0]; - if ( (bufp=SDL_strrchr(argv[0], '\\')) != NULL ) { - appname = bufp+1; - } else - if ( (bufp=SDL_strrchr(argv[0], '/')) != NULL ) { - appname = bufp+1; - } - - if ( (bufp=SDL_strrchr(appname, '.')) == NULL ) - n = SDL_strlen(appname); - else - n = (bufp-appname); - - bufp = SDL_stack_alloc(char, n+1); - if ( bufp == NULL ) { - return OutOfMemory(); - } - SDL_strlcpy(bufp, appname, n+1); - appname = bufp; - - /* Load SDL dynamic link library */ - if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) { - ShowError("WinMain() error", SDL_GetError()); - return(FALSE); - } - atexit(cleanup_output); - atexit(cleanup); - - /* Sam: - We still need to pass in the application handle so that - DirectInput will initialize properly when SDL_RegisterApp() - is called later in the video initialization. - */ - SDL_SetModuleHandle(GetModuleHandle(NULL)); - - /* Run the application main() code */ - status = SDL_main(argc, argv); - - /* Exit cleanly, calling atexit() functions */ - exit(status); - - /* Hush little compiler, don't you cry... */ - return 0; -} - -/* This is where execution begins [windowed apps] */ -#ifdef _WIN32_WCE -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw) -#else -int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) -#endif -{ - HMODULE handle; - char **argv; - int argc; - char *cmdline; - char *env_str; -#ifdef _WIN32_WCE - wchar_t *bufp; - int nLen; -#else - char *bufp; - size_t nLen; -#endif - - /* Start up DDHELP.EXE before opening any files, so DDHELP doesn't - keep them open. This is a hack.. hopefully it will be fixed - someday. DDHELP.EXE starts up the first time DDRAW.DLL is loaded. - */ - handle = LoadLibrary(TEXT("DDRAW.DLL")); - if ( handle != NULL ) { - FreeLibrary(handle); - } - - /* Check for stdio redirect settings and do the redirection */ - if ((env_str = SDL_getenv("SDL_STDIO_REDIRECT"))) { - if (SDL_atoi(env_str)) { - redirect_output(); - } - } -#ifndef NO_STDIO_REDIRECT - else { - redirect_output(); - } -#endif - -#ifdef _WIN32_WCE - nLen = wcslen(szCmdLine)+128+1; - bufp = SDL_stack_alloc(wchar_t, nLen*2); - wcscpy (bufp, TEXT("\"")); - GetModuleFileName(NULL, bufp+1, 128-3); - wcscpy (bufp+wcslen(bufp), TEXT("\" ")); - wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp)); - nLen = wcslen(bufp)+1; - cmdline = SDL_stack_alloc(char, nLen); - if ( cmdline == NULL ) { - return OutOfMemory(); - } - WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL); -#else - /* Grab the command line */ - bufp = GetCommandLine(); - nLen = SDL_strlen(bufp)+1; - cmdline = SDL_stack_alloc(char, nLen); - if ( cmdline == NULL ) { - return OutOfMemory(); - } - SDL_strlcpy(cmdline, bufp, nLen); -#endif - - /* Parse it into argv and argc */ - argc = ParseCommandLine(cmdline, NULL); - argv = SDL_stack_alloc(char*, argc+1); - if ( argv == NULL ) { - return OutOfMemory(); - } - ParseCommandLine(cmdline, argv); - - /* Run the main program (after a little SDL initialization) */ - console_main(argc, argv); - - /* Hush little compiler, don't you cry... */ - return 0; -} diff --git a/src/main/win32/version.rc b/src/main/win32/version.rc deleted file mode 100644 index 16921cee3a..0000000000 --- a/src/main/win32/version.rc +++ /dev/null @@ -1,38 +0,0 @@ - -#include "winresrc.h" - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,14,0 - PRODUCTVERSION 1,2,14,0 - FILEFLAGSMASK 0x3fL - FILEFLAGS 0x0L - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "1, 2, 14, 0\0" - VALUE "InternalName", "SDL\0" - VALUE "LegalCopyright", "Copyright © 2009 Sam Lantinga\0" - VALUE "OriginalFilename", "SDL.dll\0" - VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "1, 2, 14, 0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/src/main/windows/SDL_windows_main.c b/src/main/windows/SDL_windows_main.c new file mode 100644 index 0000000000..519ce14b8b --- /dev/null +++ b/src/main/windows/SDL_windows_main.c @@ -0,0 +1,189 @@ +/* + SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 + + The WinMain function -- calls your program's main() function +*/ +#include "SDL_config.h" + +#ifdef __WIN32__ + +#include +#include + +#define WIN32_LEAN_AND_MEAN +#include + +/* Include the SDL main definition header */ +#include "SDL.h" +#include "SDL_main.h" + +#ifdef main +# undef main +#endif /* main */ + +static void +UnEscapeQuotes(char *arg) +{ + char *last = NULL; + + while (*arg) { + if (*arg == '"' && (last != NULL && *last == '\\')) { + char *c_curr = arg; + char *c_last = last; + + while (*c_curr) { + *c_last = *c_curr; + c_last = c_curr; + c_curr++; + } + *c_last = '\0'; + } + last = arg; + arg++; + } +} + +/* Parse a command line buffer into arguments */ +static int +ParseCommandLine(char *cmdline, char **argv) +{ + char *bufp; + char *lastp = NULL; + int argc, last_argc; + + argc = last_argc = 0; + for (bufp = cmdline; *bufp;) { + /* Skip leading whitespace */ + while (SDL_isspace(*bufp)) { + ++bufp; + } + /* Skip over argument */ + if (*bufp == '"') { + ++bufp; + if (*bufp) { + if (argv) { + argv[argc] = bufp; + } + ++argc; + } + /* Skip over word */ + lastp = bufp; + while (*bufp && (*bufp != '"' || *lastp == '\\')) { + lastp = bufp; + ++bufp; + } + } else { + if (*bufp) { + if (argv) { + argv[argc] = bufp; + } + ++argc; + } + /* Skip over word */ + while (*bufp && !SDL_isspace(*bufp)) { + ++bufp; + } + } + if (*bufp) { + if (argv) { + *bufp = '\0'; + } + ++bufp; + } + + /* Strip out \ from \" sequences */ + if (argv && last_argc != argc) { + UnEscapeQuotes(argv[last_argc]); + } + last_argc = argc; + } + if (argv) { + argv[argc] = NULL; + } + return (argc); +} + +/* Show an error message */ +static void +ShowError(const char *title, const char *message) +{ +/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */ +#ifdef USE_MESSAGEBOX + MessageBox(NULL, message, title, MB_ICONEXCLAMATION | MB_OK); +#else + fprintf(stderr, "%s: %s\n", title, message); +#endif +} + +/* Pop up an out of memory message, returns to Windows */ +static BOOL +OutOfMemory(void) +{ + ShowError("Fatal Error", "Out of memory - aborting"); + return FALSE; +} + +#if defined(_MSC_VER) +/* The VC++ compiler needs main defined */ +#define console_main main +#endif + +/* This is where execution begins [console apps] */ +int +console_main(int argc, char *argv[]) +{ + int status; + + SDL_SetMainReady(); + + /* Run the application main() code */ + status = SDL_main(argc, argv); + + /* Exit cleanly, calling atexit() functions */ + exit(status); + + /* Hush little compiler, don't you cry... */ + return 0; +} + +/* This is where execution begins [windowed apps] */ +int WINAPI +WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) +{ + char **argv; + int argc; + char *cmdline; + + /* Grab the command line */ + TCHAR *text = GetCommandLine(); +#if UNICODE + cmdline = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(text), (SDL_wcslen(text)+1)*sizeof(WCHAR)); +#else + cmdline = SDL_strdup(text); +#endif + if (cmdline == NULL) { + return OutOfMemory(); + } + + /* Parse it into argv and argc */ + argc = ParseCommandLine(cmdline, NULL); + argv = SDL_stack_alloc(char *, argc + 1); + if (argv == NULL) { + return OutOfMemory(); + } + ParseCommandLine(cmdline, argv); + + /* Run the main program */ + console_main(argc, argv); + + SDL_stack_free(argv); + + SDL_free(cmdline); + + /* Hush little compiler, don't you cry... */ + return 0; +} + +#endif /* __WIN32__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc new file mode 100644 index 0000000000..129a1f5dd7 --- /dev/null +++ b/src/main/windows/version.rc @@ -0,0 +1,38 @@ + +#include "winresrc.h" + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,0,0,0 + PRODUCTVERSION 2,0,0,0 + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "\0" + VALUE "FileDescription", "SDL\0" + VALUE "FileVersion", "2, 0, 0, 0\0" + VALUE "InternalName", "SDL\0" + VALUE "LegalCopyright", "Copyright © 2013 Sam Lantinga\0" + VALUE "OriginalFilename", "SDL.dll\0" + VALUE "ProductName", "Simple DirectMedia Layer\0" + VALUE "ProductVersion", "2, 0, 0, 0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END diff --git a/src/power/SDL_power.c b/src/power/SDL_power.c new file mode 100644 index 0000000000..b8f3ae40fc --- /dev/null +++ b/src/power/SDL_power.c @@ -0,0 +1,116 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" +#include "SDL_power.h" + +/* + * Returns SDL_TRUE if we have a definitive answer. + * SDL_FALSE to try next implementation. + */ +typedef SDL_bool + (*SDL_GetPowerInfo_Impl) (SDL_PowerState * state, int *seconds, + int *percent); + +SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_BeOS(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *); +SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *); + +#ifndef SDL_POWER_DISABLED +#ifdef SDL_POWER_HARDWIRED +/* This is for things that _never_ have a battery */ +static SDL_bool +SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent) +{ + *seconds = -1; + *percent = -1; + *state = SDL_POWERSTATE_NO_BATTERY; + return SDL_TRUE; +} +#endif +#endif + + +static SDL_GetPowerInfo_Impl implementations[] = { +#ifndef SDL_POWER_DISABLED +#ifdef SDL_POWER_LINUX /* in order of preference. More than could work. */ + SDL_GetPowerInfo_Linux_proc_acpi, + SDL_GetPowerInfo_Linux_proc_apm, +#endif +#ifdef SDL_POWER_WINDOWS /* handles Win32, Win64, PocketPC. */ + SDL_GetPowerInfo_Windows, +#endif +#ifdef SDL_POWER_UIKIT /* handles iPhone/iPad/etc */ + SDL_GetPowerInfo_UIKit, +#endif +#ifdef SDL_POWER_MACOSX /* handles Mac OS X, Darwin. */ + SDL_GetPowerInfo_MacOSX, +#endif +#ifdef SDL_POWER_BEOS /* handles BeOS, Zeta, with euc.jp apm driver. */ + SDL_GetPowerInfo_BeOS, +#endif +#ifdef SDL_POWER_ANDROID /* handles Android. */ + SDL_GetPowerInfo_Android, +#endif +#ifdef SDL_POWER_PSP /* handles PSP. */ + SDL_GetPowerInfo_PSP, +#endif + +#ifdef SDL_POWER_HARDWIRED + SDL_GetPowerInfo_Hardwired, +#endif +#endif +}; + +SDL_PowerState +SDL_GetPowerInfo(int *seconds, int *percent) +{ + const int total = sizeof(implementations) / sizeof(implementations[0]); + int _seconds, _percent; + SDL_PowerState retval; + int i; + + /* Make these never NULL for platform-specific implementations. */ + if (seconds == NULL) { + seconds = &_seconds; + } + + if (percent == NULL) { + percent = &_percent; + } + + for (i = 0; i < total; i++) { + if (implementations[i] (&retval, seconds, percent)) { + return retval; + } + } + + /* nothing was definitive. */ + *seconds = -1; + *percent = -1; + return SDL_POWERSTATE_UNKNOWN; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/android/SDL_syspower.c b/src/power/android/SDL_syspower.c new file mode 100644 index 0000000000..adedd04c7c --- /dev/null +++ b/src/power/android/SDL_syspower.c @@ -0,0 +1,63 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_POWER_DISABLED +#if SDL_POWER_ANDROID + +#include "SDL_power.h" + +#include "../../core/android/SDL_android.h" + +SDL_bool +SDL_GetPowerInfo_Android(SDL_PowerState * state, int *seconds, int *percent) +{ + int battery; + int plugged; + int charged; + + if (Android_JNI_GetPowerInfo(&plugged, &charged, &battery, seconds, percent) != -1) { + if (plugged) { + if (charged) { + *state = SDL_POWERSTATE_CHARGED; + } else if (battery) { + *state = SDL_POWERSTATE_CHARGING; + } else { + *state = SDL_POWERSTATE_NO_BATTERY; + *seconds = -1; + *percent = -1; + } + } else { + *state = SDL_POWERSTATE_ON_BATTERY; + } + } else { + *state = SDL_POWERSTATE_UNKNOWN; + *seconds = -1; + *percent = -1; + } + + return SDL_TRUE; +} + +#endif /* SDL_POWER_ANDROID */ +#endif /* SDL_POWER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/beos/SDL_syspower.c b/src/power/beos/SDL_syspower.c new file mode 100644 index 0000000000..8f172cc0e8 --- /dev/null +++ b/src/power/beos/SDL_syspower.c @@ -0,0 +1,125 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_POWER_DISABLED +#if SDL_POWER_BEOS + +#include +#include +#include +#include +#include +#include + +/* These values are from apm.h ... */ +#define APM_DEVICE_PATH "/dev/misc/apm" +#define APM_FUNC_OFFSET 0x5300 +#define APM_FUNC_GET_POWER_STATUS 10 +#define APM_DEVICE_ALL 1 +#define APM_BIOS_CALL (B_DEVICE_OP_CODES_END + 3) + +#include "SDL_power.h" + +SDL_bool +SDL_GetPowerInfo_BeOS(SDL_PowerState * state, int *seconds, int *percent) +{ + const int fd = open("/dev/misc/apm", O_RDONLY); + SDL_bool need_details = SDL_FALSE; + uint16 regs[6]; + uint8 ac_status; + uint8 battery_status; + uint8 battery_flags; + uint8 battery_life; + uint32 battery_time; + int rc; + + if (fd == -1) { + return SDL_FALSE; /* maybe some other method will work? */ + } + + memset(regs, '\0', sizeof(regs)); + regs[0] = APM_FUNC_OFFSET + APM_FUNC_GET_POWER_STATUS; + regs[1] = APM_DEVICE_ALL; + rc = ioctl(fd, APM_BIOS_CALL, regs); + close(fd); + + if (rc < 0) { + return SDL_FALSE; + } + + ac_status = regs[1] >> 8; + battery_status = regs[1] & 0xFF; + battery_flags = regs[2] >> 8; + battery_life = regs[2] & 0xFF; + battery_time = (uint32) regs[3]; + + /* in theory, _something_ should be set in battery_flags, right? */ + if (battery_flags == 0x00) { /* older APM BIOS? Less fields. */ + battery_time = 0xFFFF; + if (battery_status == 0xFF) { + battery_flags = 0xFF; + } else { + battery_flags = (1 << battery_status); + } + } + + if ((battery_time != 0xFFFF) && (battery_time & (1 << 15))) { + /* time is in minutes, not seconds */ + battery_time = (battery_time & 0x7FFF) * 60; + } + + if (battery_flags == 0xFF) { /* unknown state */ + *state = SDL_POWERSTATE_UNKNOWN; + } else if (battery_flags & (1 << 7)) { /* no battery */ + *state = SDL_POWERSTATE_NO_BATTERY; + } else if (battery_flags & (1 << 3)) { /* charging */ + *state = SDL_POWERSTATE_CHARGING; + need_details = SDL_TRUE; + } else if (ac_status == 1) { + *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ + need_details = SDL_TRUE; + } else { + *state = SDL_POWERSTATE_ON_BATTERY; /* not on AC. */ + need_details = SDL_TRUE; + } + + *percent = -1; + *seconds = -1; + if (need_details) { + const int pct = (int) battery_life; + const int secs = (int) battery_time; + + if (pct != 255) { /* 255 == unknown */ + *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ + } + if (secs != 0xFFFF) { /* 0xFFFF == unknown */ + *seconds = secs; + } + } + + return SDL_TRUE; /* the definitive answer if APM driver replied. */ +} + +#endif /* SDL_POWER_BEOS */ +#endif /* SDL_POWER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c new file mode 100644 index 0000000000..d9616de257 --- /dev/null +++ b/src/power/linux/SDL_syspower.c @@ -0,0 +1,429 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_POWER_DISABLED +#if SDL_POWER_LINUX + +#include +#include + +#include +#include +#include +#include + +#include "SDL_power.h" + +static const char *proc_apm_path = "/proc/apm"; +static const char *proc_acpi_battery_path = "/proc/acpi/battery"; +static const char *proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter"; + +static int open_acpi_file(const char *base, const char *node, const char *key) +{ + const size_t pathlen = strlen(base) + strlen(node) + strlen(key) + 3; + char *path = (char *) alloca(pathlen); + if (path == NULL) { + return -1; /* oh well. */ + } + + snprintf(path, pathlen, "%s/%s/%s", base, node, key); + return open(path, O_RDONLY); +} + + +static SDL_bool +load_acpi_file(const char *base, const char *node, const char *key, + char *buf, size_t buflen) +{ + ssize_t br = 0; + const int fd = open_acpi_file(base, node, key); + if (fd == -1) { + return SDL_FALSE; + } + br = read(fd, buf, buflen-1); + close(fd); + if (br < 0) { + return SDL_FALSE; + } + buf[br] = '\0'; /* null-terminate the string. */ + return SDL_TRUE; +} + + +static SDL_bool +make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) +{ + char *ptr = *_ptr; + + while (*ptr == ' ') { + ptr++; /* skip whitespace. */ + } + + if (*ptr == '\0') { + return SDL_FALSE; /* EOF. */ + } + + *_key = ptr; + + while ((*ptr != ':') && (*ptr != '\0')) { + ptr++; + } + + if (*ptr == '\0') { + return SDL_FALSE; /* (unexpected) EOF. */ + } + + *(ptr++) = '\0'; /* terminate the key. */ + + while ((*ptr == ' ') && (*ptr != '\0')) { + ptr++; /* skip whitespace. */ + } + + if (*ptr == '\0') { + return SDL_FALSE; /* (unexpected) EOF. */ + } + + *_val = ptr; + + while ((*ptr != '\n') && (*ptr != '\0')) { + ptr++; + } + + if (*ptr != '\0') { + *(ptr++) = '\0'; /* terminate the value. */ + } + + *_ptr = ptr; /* store for next time. */ + return SDL_TRUE; +} + +static void +check_proc_acpi_battery(const char * node, SDL_bool * have_battery, + SDL_bool * charging, int *seconds, int *percent) +{ + const char *base = proc_acpi_battery_path; + char info[1024]; + char state[1024]; + char *ptr = NULL; + char *key = NULL; + char *val = NULL; + SDL_bool charge = SDL_FALSE; + SDL_bool choose = SDL_FALSE; + int maximum = -1; + int remaining = -1; + int secs = -1; + int pct = -1; + + if (!load_acpi_file(base, node, "state", state, sizeof (state))) { + return; + } else if (!load_acpi_file(base, node, "info", info, sizeof (info))) { + return; + } + + ptr = &state[0]; + while (make_proc_acpi_key_val(&ptr, &key, &val)) { + if (strcmp(key, "present") == 0) { + if (strcmp(val, "yes") == 0) { + *have_battery = SDL_TRUE; + } + } else if (strcmp(key, "charging state") == 0) { + /* !!! FIXME: what exactly _does_ charging/discharging mean? */ + if (strcmp(val, "charging/discharging") == 0) { + charge = SDL_TRUE; + } else if (strcmp(val, "charging") == 0) { + charge = SDL_TRUE; + } + } else if (strcmp(key, "remaining capacity") == 0) { + char *endptr = NULL; + const int cvt = (int) strtol(val, &endptr, 10); + if (*endptr == ' ') { + remaining = cvt; + } + } + } + + ptr = &info[0]; + while (make_proc_acpi_key_val(&ptr, &key, &val)) { + if (strcmp(key, "design capacity") == 0) { + char *endptr = NULL; + const int cvt = (int) strtol(val, &endptr, 10); + if (*endptr == ' ') { + maximum = cvt; + } + } + } + + if ((maximum >= 0) && (remaining >= 0)) { + pct = (int) ((((float) remaining) / ((float) maximum)) * 100.0f); + if (pct < 0) { + pct = 0; + } else if (pct > 100) { + pct = 100; + } + } + + /* !!! FIXME: calculate (secs). */ + + /* + * We pick the battery that claims to have the most minutes left. + * (failing a report of minutes, we'll take the highest percent.) + */ + if ((secs < 0) && (*seconds < 0)) { + if ((pct < 0) && (*percent < 0)) { + choose = SDL_TRUE; /* at least we know there's a battery. */ + } + if (pct > *percent) { + choose = SDL_TRUE; + } + } else if (secs > *seconds) { + choose = SDL_TRUE; + } + + if (choose) { + *seconds = secs; + *percent = pct; + *charging = charge; + } +} + +static void +check_proc_acpi_ac_adapter(const char * node, SDL_bool * have_ac) +{ + const char *base = proc_acpi_ac_adapter_path; + char state[256]; + char *ptr = NULL; + char *key = NULL; + char *val = NULL; + + if (!load_acpi_file(base, node, "state", state, sizeof (state))) { + return; + } + + ptr = &state[0]; + while (make_proc_acpi_key_val(&ptr, &key, &val)) { + if (strcmp(key, "state") == 0) { + if (strcmp(val, "on-line") == 0) { + *have_ac = SDL_TRUE; + } + } + } +} + + +SDL_bool +SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState * state, + int *seconds, int *percent) +{ + struct dirent *dent = NULL; + DIR *dirp = NULL; + SDL_bool have_battery = SDL_FALSE; + SDL_bool have_ac = SDL_FALSE; + SDL_bool charging = SDL_FALSE; + + *seconds = -1; + *percent = -1; + *state = SDL_POWERSTATE_UNKNOWN; + + dirp = opendir(proc_acpi_battery_path); + if (dirp == NULL) { + return SDL_FALSE; /* can't use this interface. */ + } else { + while ((dent = readdir(dirp)) != NULL) { + const char *node = dent->d_name; + check_proc_acpi_battery(node, &have_battery, &charging, + seconds, percent); + } + closedir(dirp); + } + + dirp = opendir(proc_acpi_ac_adapter_path); + if (dirp == NULL) { + return SDL_FALSE; /* can't use this interface. */ + } else { + while ((dent = readdir(dirp)) != NULL) { + const char *node = dent->d_name; + check_proc_acpi_ac_adapter(node, &have_ac); + } + closedir(dirp); + } + + if (!have_battery) { + *state = SDL_POWERSTATE_NO_BATTERY; + } else if (charging) { + *state = SDL_POWERSTATE_CHARGING; + } else if (have_ac) { + *state = SDL_POWERSTATE_CHARGED; + } else { + *state = SDL_POWERSTATE_ON_BATTERY; + } + + return SDL_TRUE; /* definitive answer. */ +} + + +static SDL_bool +next_string(char **_ptr, char **_str) +{ + char *ptr = *_ptr; + char *str = *_str; + + while (*ptr == ' ') { /* skip any spaces... */ + ptr++; + } + + if (*ptr == '\0') { + return SDL_FALSE; + } + + str = ptr; + while ((*ptr != ' ') && (*ptr != '\n') && (*ptr != '\0')) + ptr++; + + if (*ptr != '\0') + *(ptr++) = '\0'; + + *_str = str; + *_ptr = ptr; + return SDL_TRUE; +} + +static SDL_bool +int_string(char *str, int *val) +{ + char *endptr = NULL; + *val = (int) strtol(str, &endptr, 0); + return ((*str != '\0') && (*endptr == '\0')); +} + +/* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */ +SDL_bool +SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, + int *seconds, int *percent) +{ + SDL_bool need_details = SDL_FALSE; + int ac_status = 0; + int battery_status = 0; + int battery_flag = 0; + int battery_percent = 0; + int battery_time = 0; + const int fd = open(proc_apm_path, O_RDONLY); + char buf[128]; + char *ptr = &buf[0]; + char *str = NULL; + ssize_t br; + + if (fd == -1) { + return SDL_FALSE; /* can't use this interface. */ + } + + br = read(fd, buf, sizeof (buf) - 1); + close(fd); + + if (br < 0) { + return SDL_FALSE; + } + + buf[br] = '\0'; /* null-terminate the string. */ + if (!next_string(&ptr, &str)) { /* driver version */ + return SDL_FALSE; + } + if (!next_string(&ptr, &str)) { /* BIOS version */ + return SDL_FALSE; + } + if (!next_string(&ptr, &str)) { /* APM flags */ + return SDL_FALSE; + } + + if (!next_string(&ptr, &str)) { /* AC line status */ + return SDL_FALSE; + } else if (!int_string(str, &ac_status)) { + return SDL_FALSE; + } + + if (!next_string(&ptr, &str)) { /* battery status */ + return SDL_FALSE; + } else if (!int_string(str, &battery_status)) { + return SDL_FALSE; + } + if (!next_string(&ptr, &str)) { /* battery flag */ + return SDL_FALSE; + } else if (!int_string(str, &battery_flag)) { + return SDL_FALSE; + } + if (!next_string(&ptr, &str)) { /* remaining battery life percent */ + return SDL_FALSE; + } + if (str[strlen(str) - 1] == '%') { + str[strlen(str) - 1] = '\0'; + } + if (!int_string(str, &battery_percent)) { + return SDL_FALSE; + } + + if (!next_string(&ptr, &str)) { /* remaining battery life time */ + return SDL_FALSE; + } else if (!int_string(str, &battery_time)) { + return SDL_FALSE; + } + + if (!next_string(&ptr, &str)) { /* remaining battery life time units */ + return SDL_FALSE; + } else if (strcmp(str, "min") == 0) { + battery_time *= 60; + } + + if (battery_flag == 0xFF) { /* unknown state */ + *state = SDL_POWERSTATE_UNKNOWN; + } else if (battery_flag & (1 << 7)) { /* no battery */ + *state = SDL_POWERSTATE_NO_BATTERY; + } else if (battery_flag & (1 << 3)) { /* charging */ + *state = SDL_POWERSTATE_CHARGING; + need_details = SDL_TRUE; + } else if (ac_status == 1) { + *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ + need_details = SDL_TRUE; + } else { + *state = SDL_POWERSTATE_ON_BATTERY; + need_details = SDL_TRUE; + } + + *percent = -1; + *seconds = -1; + if (need_details) { + const int pct = battery_percent; + const int secs = battery_time; + + if (pct >= 0) { /* -1 == unknown */ + *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ + } + if (secs >= 0) { /* -1 == unknown */ + *seconds = secs; + } + } + + return SDL_TRUE; +} + +#endif /* SDL_POWER_LINUX */ +#endif /* SDL_POWER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/macosx/SDL_syspower.c b/src/power/macosx/SDL_syspower.c new file mode 100644 index 0000000000..572dcfdd08 --- /dev/null +++ b/src/power/macosx/SDL_syspower.c @@ -0,0 +1,192 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_POWER_DISABLED +#if SDL_POWER_MACOSX + +#include +#include +#include + +#include "SDL_power.h" + +/* Carbon is so verbose... */ +#define STRMATCH(a,b) (CFStringCompare(a, b, 0) == kCFCompareEqualTo) +#define GETVAL(k,v) \ + CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **) v) + +/* Note that AC power sources also include a laptop battery it is charging. */ +static void +checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, + SDL_bool * charging, int *seconds, int *percent) +{ + CFStringRef strval; /* don't CFRelease() this. */ + CFBooleanRef bval; + CFNumberRef numval; + SDL_bool charge = SDL_FALSE; + SDL_bool choose = SDL_FALSE; + SDL_bool is_ac = SDL_FALSE; + int secs = -1; + int maxpct = -1; + int pct = -1; + + if ((GETVAL(kIOPSIsPresentKey, &bval)) && (bval == kCFBooleanFalse)) { + return; /* nothing to see here. */ + } + + if (!GETVAL(kIOPSPowerSourceStateKey, &strval)) { + return; + } + + if (STRMATCH(strval, CFSTR(kIOPSACPowerValue))) { + is_ac = *have_ac = SDL_TRUE; + } else if (!STRMATCH(strval, CFSTR(kIOPSBatteryPowerValue))) { + return; /* not a battery? */ + } + + if ((GETVAL(kIOPSIsChargingKey, &bval)) && (bval == kCFBooleanTrue)) { + charge = SDL_TRUE; + } + + if (GETVAL(kIOPSMaxCapacityKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + if (val > 0) { + *have_battery = SDL_TRUE; + maxpct = (int) val; + } + } + + if (GETVAL(kIOPSMaxCapacityKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + if (val > 0) { + *have_battery = SDL_TRUE; + maxpct = (int) val; + } + } + + if (GETVAL(kIOPSTimeToEmptyKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + + /* Mac OS X reports 0 minutes until empty if you're plugged in. :( */ + if ((val == 0) && (is_ac)) { + val = -1; /* !!! FIXME: calc from timeToFull and capacity? */ + } + + secs = (int) val; + if (secs > 0) { + secs *= 60; /* value is in minutes, so convert to seconds. */ + } + } + + if (GETVAL(kIOPSCurrentCapacityKey, &numval)) { + SInt32 val = -1; + CFNumberGetValue(numval, kCFNumberSInt32Type, &val); + pct = (int) val; + } + + if ((pct > 0) && (maxpct > 0)) { + pct = (int) ((((double) pct) / ((double) maxpct)) * 100.0); + } + + if (pct > 100) { + pct = 100; + } + + /* + * We pick the battery that claims to have the most minutes left. + * (failing a report of minutes, we'll take the highest percent.) + */ + if ((secs < 0) && (*seconds < 0)) { + if ((pct < 0) && (*percent < 0)) { + choose = SDL_TRUE; /* at least we know there's a battery. */ + } + if (pct > *percent) { + choose = SDL_TRUE; + } + } else if (secs > *seconds) { + choose = SDL_TRUE; + } + + if (choose) { + *seconds = secs; + *percent = pct; + *charging = charge; + } +} + +#undef GETVAL +#undef STRMATCH + + +SDL_bool +SDL_GetPowerInfo_MacOSX(SDL_PowerState * state, int *seconds, int *percent) +{ + CFTypeRef blob = IOPSCopyPowerSourcesInfo(); + + *seconds = -1; + *percent = -1; + *state = SDL_POWERSTATE_UNKNOWN; + + if (blob != NULL) { + CFArrayRef list = IOPSCopyPowerSourcesList(blob); + if (list != NULL) { + /* don't CFRelease() the list items, or dictionaries! */ + SDL_bool have_ac = SDL_FALSE; + SDL_bool have_battery = SDL_FALSE; + SDL_bool charging = SDL_FALSE; + const CFIndex total = CFArrayGetCount(list); + CFIndex i; + for (i = 0; i < total; i++) { + CFTypeRef ps = (CFTypeRef) CFArrayGetValueAtIndex(list, i); + CFDictionaryRef dict = + IOPSGetPowerSourceDescription(blob, ps); + if (dict != NULL) { + checkps(dict, &have_ac, &have_battery, &charging, + seconds, percent); + } + } + + if (!have_battery) { + *state = SDL_POWERSTATE_NO_BATTERY; + } else if (charging) { + *state = SDL_POWERSTATE_CHARGING; + } else if (have_ac) { + *state = SDL_POWERSTATE_CHARGED; + } else { + *state = SDL_POWERSTATE_ON_BATTERY; + } + + CFRelease(list); + } + CFRelease(blob); + } + + return SDL_TRUE; /* always the definitive answer on Mac OS X. */ +} + +#endif /* SDL_POWER_MACOSX */ +#endif /* SDL_POWER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/psp/SDL_syspower.c b/src/power/psp/SDL_syspower.c new file mode 100644 index 0000000000..8c791bba4d --- /dev/null +++ b/src/power/psp/SDL_syspower.c @@ -0,0 +1,68 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +#ifndef SDL_POWER_DISABLED +#if SDL_POWER_PSP + +#include "SDL_power.h" +#include + + +SDL_bool +SDL_GetPowerInfo_PSP(SDL_PowerState * state, int *seconds, + int *percent) +{ + int battery = scePowerIsBatteryExist(); + int plugged = scePowerIsPowerOnline(); + int charging = scePowerIsBatteryCharging(); + + *state = SDL_POWERSTATE_UNKNOWN; + *seconds = -1; + *percent = -1; + + if (!battery) { + *state = SDL_POWERSTATE_NO_BATTERY; + *seconds = -1; + *percent = -1; + } else if (charging) { + *state = SDL_POWERSTATE_CHARGING; + *percent = scePowerGetBatteryLifePercent(); + *seconds = scePowerGetBatteryLifeTime()*60; + } else if (plugged) { + *state = SDL_POWERSTATE_CHARGED; + *percent = scePowerGetBatteryLifePercent(); + *seconds = scePowerGetBatteryLifeTime()*60; + } else { + *state = SDL_POWERSTATE_ON_BATTERY; + *percent = scePowerGetBatteryLifePercent(); + *seconds = scePowerGetBatteryLifeTime()*60; + } + + + return SDL_TRUE; /* always the definitive answer on PSP. */ +} + +#endif /* SDL_POWER_PSP */ +#endif /* SDL_POWER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/uikit/SDL_syspower.h b/src/power/uikit/SDL_syspower.h new file mode 100644 index 0000000000..ce3bc2e739 --- /dev/null +++ b/src/power/uikit/SDL_syspower.h @@ -0,0 +1,32 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_POWER_UIKIT + +#include "SDL_power.h" + +void SDL_UIKit_UpdateBatteryMonitoring(void); +SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent); + +#endif /* SDL_POWER_UIKIT */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/uikit/SDL_syspower.m b/src/power/uikit/SDL_syspower.m new file mode 100644 index 0000000000..3364da56ee --- /dev/null +++ b/src/power/uikit/SDL_syspower.m @@ -0,0 +1,101 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_POWER_DISABLED +#if SDL_POWER_UIKIT + +#import + +#include "SDL_power.h" +#include "SDL_timer.h" +#include "SDL_assert.h" +#include "SDL_syspower.h" + +/* turn off the battery monitor if it's been more than X ms since last check. */ +static const int BATTERY_MONITORING_TIMEOUT = 3000; +static Uint32 SDL_UIKitLastPowerInfoQuery = 0; + +void +SDL_UIKit_UpdateBatteryMonitoring(void) +{ + if (SDL_UIKitLastPowerInfoQuery) { + const Uint32 prev = SDL_UIKitLastPowerInfoQuery; + const UInt32 now = SDL_GetTicks(); + const UInt32 ticks = now - prev; + /* if timer wrapped (now < prev), shut down, too. */ + if ((now < prev) || (ticks >= BATTERY_MONITORING_TIMEOUT)) { + UIDevice *uidev = [UIDevice currentDevice]; + SDL_assert([uidev isBatteryMonitoringEnabled] == YES); + [uidev setBatteryMonitoringEnabled:NO]; + SDL_UIKitLastPowerInfoQuery = 0; + } + } +} + +SDL_bool +SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent) +{ + UIDevice *uidev = [UIDevice currentDevice]; + + if (!SDL_UIKitLastPowerInfoQuery) { + SDL_assert([uidev isBatteryMonitoringEnabled] == NO); + [uidev setBatteryMonitoringEnabled:YES]; + } + + /* UIKit_GL_SwapWindow() (etc) will check this and disable the battery + * monitoring if the app hasn't queried it in the last X seconds. + * Apparently monitoring the battery burns battery life. :) + * Apple's docs say not to monitor the battery unless you need it. + */ + SDL_UIKitLastPowerInfoQuery = SDL_GetTicks(); + + *seconds = -1; /* no API to estimate this in UIKit. */ + + switch ([uidev batteryState]) + { + case UIDeviceBatteryStateCharging: + *state = SDL_POWERSTATE_CHARGING; + break; + + case UIDeviceBatteryStateFull: + *state = SDL_POWERSTATE_CHARGED; + break; + + case UIDeviceBatteryStateUnplugged: + *state = SDL_POWERSTATE_ON_BATTERY; + break; + + case UIDeviceBatteryStateUnknown: + default: + *state = SDL_POWERSTATE_UNKNOWN; + break; + } + + const float level = [uidev batteryLevel]; + *percent = ( (level < 0.0f) ? -1 : (((int) (level + 0.5f)) * 100) ); + return SDL_TRUE; /* always the definitive answer on iPhoneOS. */ +} + +#endif /* SDL_POWER_UIKIT */ +#endif /* SDL_POWER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/power/windows/SDL_syspower.c b/src/power/windows/SDL_syspower.c new file mode 100644 index 0000000000..29ddb0f8f1 --- /dev/null +++ b/src/power/windows/SDL_syspower.c @@ -0,0 +1,76 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef SDL_POWER_DISABLED +#if SDL_POWER_WINDOWS + +#include "../../core/windows/SDL_windows.h" + +#include "SDL_power.h" + +SDL_bool +SDL_GetPowerInfo_Windows(SDL_PowerState * state, int *seconds, int *percent) +{ + SYSTEM_POWER_STATUS status; + SDL_bool need_details = SDL_FALSE; + + /* This API should exist back to Win95. */ + if (!GetSystemPowerStatus(&status)) + { + /* !!! FIXME: push GetLastError() into SDL_GetError() */ + *state = SDL_POWERSTATE_UNKNOWN; + } else if (status.BatteryFlag == 0xFF) { /* unknown state */ + *state = SDL_POWERSTATE_UNKNOWN; + } else if (status.BatteryFlag & (1 << 7)) { /* no battery */ + *state = SDL_POWERSTATE_NO_BATTERY; + } else if (status.BatteryFlag & (1 << 3)) { /* charging */ + *state = SDL_POWERSTATE_CHARGING; + need_details = SDL_TRUE; + } else if (status.ACLineStatus == 1) { + *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ + need_details = SDL_TRUE; + } else { + *state = SDL_POWERSTATE_ON_BATTERY; /* not on AC. */ + need_details = SDL_TRUE; + } + + *percent = -1; + *seconds = -1; + if (need_details) { + const int pct = (int) status.BatteryLifePercent; + const int secs = (int) status.BatteryLifeTime; + + if (pct != 255) { /* 255 == unknown */ + *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ + } + if (secs != 0xFFFFFFFF) { /* ((DWORD)-1) == unknown */ + *seconds = secs; + } + } + + return SDL_TRUE; /* always the definitive answer on Windows. */ +} + +#endif /* SDL_POWER_WINDOWS */ +#endif /* SDL_POWER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c new file mode 100644 index 0000000000..5dfc38dcb6 --- /dev/null +++ b/src/render/SDL_render.c @@ -0,0 +1,1774 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* The SDL 2D rendering system */ + +#include "SDL_hints.h" +#include "SDL_log.h" +#include "SDL_render.h" +#include "SDL_sysrender.h" +#include "software/SDL_render_sw_c.h" + + +#define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData" + +#define CHECK_RENDERER_MAGIC(renderer, retval) \ + if (!renderer || renderer->magic != &renderer_magic) { \ + SDL_SetError("Invalid renderer"); \ + return retval; \ + } + +#define CHECK_TEXTURE_MAGIC(texture, retval) \ + if (!texture || texture->magic != &texture_magic) { \ + SDL_SetError("Invalid texture"); \ + return retval; \ + } + + +#if !SDL_RENDER_DISABLED +static const SDL_RenderDriver *render_drivers[] = { +#if SDL_VIDEO_RENDER_D3D + &D3D_RenderDriver, +#endif +#if SDL_VIDEO_RENDER_OGL + &GL_RenderDriver, +#endif +#if SDL_VIDEO_RENDER_OGL_ES2 + &GLES2_RenderDriver, +#endif +#if SDL_VIDEO_RENDER_OGL_ES + &GLES_RenderDriver, +#endif +#if SDL_VIDEO_RENDER_DIRECTFB + &DirectFB_RenderDriver, +#endif +#if SDL_VIDEO_RENDER_PSP + &PSP_RenderDriver, +#endif + &SW_RenderDriver +}; +#endif /* !SDL_RENDER_DISABLED */ + +static char renderer_magic; +static char texture_magic; + +static int UpdateLogicalSize(SDL_Renderer *renderer); + +int +SDL_GetNumRenderDrivers(void) +{ +#if !SDL_RENDER_DISABLED + return SDL_arraysize(render_drivers); +#else + return 0; +#endif +} + +int +SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info) +{ +#if !SDL_RENDER_DISABLED + if (index < 0 || index >= SDL_GetNumRenderDrivers()) { + return SDL_SetError("index must be in the range of 0 - %d", + SDL_GetNumRenderDrivers() - 1); + } + *info = render_drivers[index]->info; + return 0; +#else + return SDL_SetError("SDL not built with rendering support"); +#endif +} + +static int +SDL_RendererEventWatch(void *userdata, SDL_Event *event) +{ + SDL_Renderer *renderer = (SDL_Renderer *)userdata; + + if (event->type == SDL_WINDOWEVENT) { + SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); + if (window == renderer->window) { + if (renderer->WindowEvent) { + renderer->WindowEvent(renderer, &event->window); + } + + if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { + if (renderer->logical_w) { + UpdateLogicalSize(renderer); + } else { + /* Window was resized, reset viewport */ + int w, h; + + SDL_GetWindowSize(window, &w, &h); + if (renderer->target) { + renderer->viewport_backup.x = 0; + renderer->viewport_backup.y = 0; + renderer->viewport_backup.w = w; + renderer->viewport_backup.h = h; + } else { + renderer->viewport.x = 0; + renderer->viewport.y = 0; + renderer->viewport.w = w; + renderer->viewport.h = h; + renderer->UpdateViewport(renderer); + } + } + } else if (event->window.event == SDL_WINDOWEVENT_HIDDEN) { + renderer->hidden = SDL_TRUE; + } else if (event->window.event == SDL_WINDOWEVENT_SHOWN) { + if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)) { + renderer->hidden = SDL_FALSE; + } + } else if (event->window.event == SDL_WINDOWEVENT_MINIMIZED) { + renderer->hidden = SDL_TRUE; + } else if (event->window.event == SDL_WINDOWEVENT_RESTORED) { + if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_HIDDEN)) { + renderer->hidden = SDL_FALSE; + } + } + } + } else if (event->type == SDL_MOUSEMOTION) { + if (renderer->logical_w) { + event->motion.x -= renderer->viewport.x; + event->motion.y -= renderer->viewport.y; + event->motion.x = (int)(event->motion.x / renderer->scale.x); + event->motion.y = (int)(event->motion.y / renderer->scale.y); + if (event->motion.xrel > 0) { + event->motion.xrel = SDL_max(1, (int)(event->motion.xrel / renderer->scale.x)); + } else if (event->motion.xrel < 0) { + event->motion.xrel = SDL_min(-1, (int)(event->motion.xrel / renderer->scale.x)); + } + if (event->motion.yrel > 0) { + event->motion.yrel = SDL_max(1, (int)(event->motion.yrel / renderer->scale.y)); + } else if (event->motion.yrel < 0) { + event->motion.yrel = SDL_min(-1, (int)(event->motion.yrel / renderer->scale.y)); + } + } + } else if (event->type == SDL_MOUSEBUTTONDOWN || + event->type == SDL_MOUSEBUTTONUP) { + if (renderer->logical_w) { + event->button.x -= renderer->viewport.x; + event->button.y -= renderer->viewport.y; + event->button.x = (int)(event->button.x / renderer->scale.x); + event->button.y = (int)(event->button.y / renderer->scale.y); + } + } + return 0; +} + +int +SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, + SDL_Window **window, SDL_Renderer **renderer) +{ + *window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + width, height, window_flags); + if (!*window) { + *renderer = NULL; + return -1; + } + + *renderer = SDL_CreateRenderer(*window, -1, 0); + if (!*renderer) { + return -1; + } + + return 0; +} + +SDL_Renderer * +SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) +{ +#if !SDL_RENDER_DISABLED + SDL_Renderer *renderer = NULL; + int n = SDL_GetNumRenderDrivers(); + const char *hint; + + if (!window) { + SDL_SetError("Invalid window"); + return NULL; + } + + if (SDL_GetRenderer(window)) { + SDL_SetError("Renderer already associated with window"); + return NULL; + } + + hint = SDL_GetHint(SDL_HINT_RENDER_VSYNC); + if (hint) { + if (*hint == '0') { + flags &= ~SDL_RENDERER_PRESENTVSYNC; + } else { + flags |= SDL_RENDERER_PRESENTVSYNC; + } + } + + if (index < 0) { + hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER); + if (hint) { + for (index = 0; index < n; ++index) { + const SDL_RenderDriver *driver = render_drivers[index]; + + if (SDL_strcasecmp(hint, driver->info.name) == 0) { + /* Create a new renderer instance */ + renderer = driver->CreateRenderer(window, flags); + break; + } + } + } + + if (!renderer) { + for (index = 0; index < n; ++index) { + const SDL_RenderDriver *driver = render_drivers[index]; + + if ((driver->info.flags & flags) == flags) { + /* Create a new renderer instance */ + renderer = driver->CreateRenderer(window, flags); + if (renderer) { + /* Yay, we got one! */ + break; + } + } + } + } + if (index == n) { + SDL_SetError("Couldn't find matching render driver"); + return NULL; + } + } else { + if (index >= SDL_GetNumRenderDrivers()) { + SDL_SetError("index must be -1 or in the range of 0 - %d", + SDL_GetNumRenderDrivers() - 1); + return NULL; + } + /* Create a new renderer instance */ + renderer = render_drivers[index]->CreateRenderer(window, flags); + } + + if (renderer) { + renderer->magic = &renderer_magic; + renderer->window = window; + renderer->scale.x = 1.0f; + renderer->scale.y = 1.0f; + + if (SDL_GetWindowFlags(window) & (SDL_WINDOW_HIDDEN|SDL_WINDOW_MINIMIZED)) { + renderer->hidden = SDL_TRUE; + } else { + renderer->hidden = SDL_FALSE; + } + + SDL_SetWindowData(window, SDL_WINDOWRENDERDATA, renderer); + + SDL_RenderSetViewport(renderer, NULL); + + SDL_AddEventWatch(SDL_RendererEventWatch, renderer); + + SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, + "Created renderer: %s", renderer->info.name); + } + return renderer; +#else + SDL_SetError("SDL not built with rendering support"); + return NULL; +#endif +} + +SDL_Renderer * +SDL_CreateSoftwareRenderer(SDL_Surface * surface) +{ +#if !SDL_RENDER_DISABLED + SDL_Renderer *renderer; + + renderer = SW_CreateRendererForSurface(surface); + + if (renderer) { + renderer->magic = &renderer_magic; + renderer->scale.x = 1.0f; + renderer->scale.y = 1.0f; + + SDL_RenderSetViewport(renderer, NULL); + } + return renderer; +#else + SDL_SetError("SDL not built with rendering support"); + return NULL; +#endif /* !SDL_RENDER_DISABLED */ +} + +SDL_Renderer * +SDL_GetRenderer(SDL_Window * window) +{ + return (SDL_Renderer *)SDL_GetWindowData(window, SDL_WINDOWRENDERDATA); +} + +int +SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + *info = renderer->info; + return 0; +} + +int +SDL_GetRendererOutputSize(SDL_Renderer * renderer, int *w, int *h) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (renderer->target) { + return SDL_QueryTexture(renderer->target, NULL, NULL, w, h); + } else if (renderer->window) { + SDL_GetWindowSize(renderer->window, w, h); + return 0; + } else if (renderer->GetOutputSize) { + return renderer->GetOutputSize(renderer, w, h); + } else { + /* This should never happen */ + SDL_SetError("Renderer doesn't support querying output size"); + return -1; + } +} + +static SDL_bool +IsSupportedFormat(SDL_Renderer * renderer, Uint32 format) +{ + Uint32 i; + + for (i = 0; i < renderer->info.num_texture_formats; ++i) { + if (renderer->info.texture_formats[i] == format) { + return SDL_TRUE; + } + } + return SDL_FALSE; +} + +static Uint32 +GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format) +{ + Uint32 i; + + if (SDL_ISPIXELFORMAT_FOURCC(format)) { + /* Look for an exact match */ + for (i = 0; i < renderer->info.num_texture_formats; ++i) { + if (renderer->info.texture_formats[i] == format) { + return renderer->info.texture_formats[i]; + } + } + } else { + SDL_bool hasAlpha = SDL_ISPIXELFORMAT_ALPHA(format); + + /* We just want to match the first format that has the same channels */ + for (i = 0; i < renderer->info.num_texture_formats; ++i) { + if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) && + SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == hasAlpha) { + return renderer->info.texture_formats[i]; + } + } + } + return renderer->info.texture_formats[0]; +} + +SDL_Texture * +SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int h) +{ + SDL_Texture *texture; + + CHECK_RENDERER_MAGIC(renderer, NULL); + + if (!format) { + format = renderer->info.texture_formats[0]; + } + if (SDL_ISPIXELFORMAT_INDEXED(format)) { + SDL_SetError("Palettized textures are not supported"); + return NULL; + } + if (w <= 0 || h <= 0) { + SDL_SetError("Texture dimensions can't be 0"); + return NULL; + } + texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture)); + if (!texture) { + SDL_OutOfMemory(); + return NULL; + } + texture->magic = &texture_magic; + texture->format = format; + texture->access = access; + texture->w = w; + texture->h = h; + texture->r = 255; + texture->g = 255; + texture->b = 255; + texture->a = 255; + texture->renderer = renderer; + texture->next = renderer->textures; + if (renderer->textures) { + renderer->textures->prev = texture; + } + renderer->textures = texture; + + if (IsSupportedFormat(renderer, format)) { + if (renderer->CreateTexture(renderer, texture) < 0) { + SDL_DestroyTexture(texture); + return 0; + } + } else { + texture->native = SDL_CreateTexture(renderer, + GetClosestSupportedFormat(renderer, format), + access, w, h); + if (!texture->native) { + SDL_DestroyTexture(texture); + return NULL; + } + + /* Swap textures to have texture before texture->native in the list */ + texture->native->next = texture->next; + if (texture->native->next) { + texture->native->next->prev = texture->native; + } + texture->prev = texture->native->prev; + if (texture->prev) { + texture->prev->next = texture; + } + texture->native->prev = texture; + texture->next = texture->native; + renderer->textures = texture; + + if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { + texture->yuv = SDL_SW_CreateYUVTexture(format, w, h); + if (!texture->yuv) { + SDL_DestroyTexture(texture); + return NULL; + } + } else if (access == SDL_TEXTUREACCESS_STREAMING) { + /* The pitch is 4 byte aligned */ + texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3); + texture->pixels = SDL_calloc(1, texture->pitch * h); + if (!texture->pixels) { + SDL_DestroyTexture(texture); + return NULL; + } + } + } + return texture; +} + +SDL_Texture * +SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface) +{ + const SDL_PixelFormat *fmt; + SDL_bool needAlpha; + Uint32 i; + Uint32 format; + SDL_Texture *texture; + + CHECK_RENDERER_MAGIC(renderer, NULL); + + if (!surface) { + SDL_SetError("SDL_CreateTextureFromSurface() passed NULL surface"); + return NULL; + } + + /* See what the best texture format is */ + fmt = surface->format; + if (fmt->Amask || SDL_GetColorKey(surface, NULL) == 0) { + needAlpha = SDL_TRUE; + } else { + needAlpha = SDL_FALSE; + } + format = renderer->info.texture_formats[0]; + for (i = 0; i < renderer->info.num_texture_formats; ++i) { + if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) && + SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) { + format = renderer->info.texture_formats[i]; + break; + } + } + + texture = SDL_CreateTexture(renderer, format, SDL_TEXTUREACCESS_STATIC, + surface->w, surface->h); + if (!texture) { + return NULL; + } + + if (format == surface->format->format) { + if (SDL_MUSTLOCK(surface)) { + SDL_LockSurface(surface); + SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch); + SDL_UnlockSurface(surface); + } else { + SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch); + } + } else { + SDL_PixelFormat *dst_fmt; + SDL_Surface *temp = NULL; + + /* Set up a destination surface for the texture update */ + dst_fmt = SDL_AllocFormat(format); + temp = SDL_ConvertSurface(surface, dst_fmt, 0); + SDL_FreeFormat(dst_fmt); + if (temp) { + SDL_UpdateTexture(texture, NULL, temp->pixels, temp->pitch); + SDL_FreeSurface(temp); + } else { + SDL_DestroyTexture(texture); + return NULL; + } + } + + { + Uint8 r, g, b, a; + SDL_BlendMode blendMode; + + SDL_GetSurfaceColorMod(surface, &r, &g, &b); + SDL_SetTextureColorMod(texture, r, g, b); + + SDL_GetSurfaceAlphaMod(surface, &a); + SDL_SetTextureAlphaMod(texture, a); + + if (SDL_GetColorKey(surface, NULL) == 0) { + /* We converted to a texture with alpha format */ + SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); + } else { + SDL_GetSurfaceBlendMode(surface, &blendMode); + SDL_SetTextureBlendMode(texture, blendMode); + } + } + return texture; +} + +int +SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access, + int *w, int *h) +{ + CHECK_TEXTURE_MAGIC(texture, -1); + + if (format) { + *format = texture->format; + } + if (access) { + *access = texture->access; + } + if (w) { + *w = texture->w; + } + if (h) { + *h = texture->h; + } + return 0; +} + +int +SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + if (r < 255 || g < 255 || b < 255) { + texture->modMode |= SDL_TEXTUREMODULATE_COLOR; + } else { + texture->modMode &= ~SDL_TEXTUREMODULATE_COLOR; + } + texture->r = r; + texture->g = g; + texture->b = b; + if (texture->native) { + return SDL_SetTextureColorMod(texture->native, r, g, b); + } else if (renderer->SetTextureColorMod) { + return renderer->SetTextureColorMod(renderer, texture); + } else { + return 0; + } +} + +int +SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g, + Uint8 * b) +{ + CHECK_TEXTURE_MAGIC(texture, -1); + + if (r) { + *r = texture->r; + } + if (g) { + *g = texture->g; + } + if (b) { + *b = texture->b; + } + return 0; +} + +int +SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + if (alpha < 255) { + texture->modMode |= SDL_TEXTUREMODULATE_ALPHA; + } else { + texture->modMode &= ~SDL_TEXTUREMODULATE_ALPHA; + } + texture->a = alpha; + if (texture->native) { + return SDL_SetTextureAlphaMod(texture->native, alpha); + } else if (renderer->SetTextureAlphaMod) { + return renderer->SetTextureAlphaMod(renderer, texture); + } else { + return 0; + } +} + +int +SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha) +{ + CHECK_TEXTURE_MAGIC(texture, -1); + + if (alpha) { + *alpha = texture->a; + } + return 0; +} + +int +SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + + renderer = texture->renderer; + texture->blendMode = blendMode; + if (texture->native) { + return SDL_SetTextureBlendMode(texture->native, blendMode); + } else if (renderer->SetTextureBlendMode) { + return renderer->SetTextureBlendMode(renderer, texture); + } else { + return 0; + } +} + +int +SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode) +{ + CHECK_TEXTURE_MAGIC(texture, -1); + + if (blendMode) { + *blendMode = texture->blendMode; + } + return 0; +} + +static int +SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, + const void *pixels, int pitch) +{ + SDL_Texture *native = texture->native; + SDL_Rect full_rect; + + if (SDL_SW_UpdateYUVTexture(texture->yuv, rect, pixels, pitch) < 0) { + return -1; + } + + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = texture->w; + full_rect.h = texture->h; + rect = &full_rect; + + if (texture->access == SDL_TEXTUREACCESS_STREAMING) { + /* We can lock the texture and copy to it */ + void *native_pixels; + int native_pitch; + + if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) { + return -1; + } + SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format, + rect->w, rect->h, native_pixels, native_pitch); + SDL_UnlockTexture(native); + } else { + /* Use a temporary buffer for updating */ + void *temp_pixels; + int temp_pitch; + + temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3); + temp_pixels = SDL_malloc(rect->h * temp_pitch); + if (!temp_pixels) { + return SDL_OutOfMemory(); + } + SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format, + rect->w, rect->h, temp_pixels, temp_pitch); + SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch); + SDL_free(temp_pixels); + } + return 0; +} + +static int +SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect, + const void *pixels, int pitch) +{ + SDL_Texture *native = texture->native; + + if (texture->access == SDL_TEXTUREACCESS_STREAMING) { + /* We can lock the texture and copy to it */ + void *native_pixels; + int native_pitch; + + if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) { + return -1; + } + SDL_ConvertPixels(rect->w, rect->h, + texture->format, pixels, pitch, + native->format, native_pixels, native_pitch); + SDL_UnlockTexture(native); + } else { + /* Use a temporary buffer for updating */ + void *temp_pixels; + int temp_pitch; + + temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3); + temp_pixels = SDL_malloc(rect->h * temp_pitch); + if (!temp_pixels) { + return SDL_OutOfMemory(); + } + SDL_ConvertPixels(rect->w, rect->h, + texture->format, pixels, pitch, + native->format, temp_pixels, temp_pitch); + SDL_UpdateTexture(native, rect, temp_pixels, temp_pitch); + SDL_free(temp_pixels); + } + return 0; +} + +int +SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, + const void *pixels, int pitch) +{ + SDL_Renderer *renderer; + SDL_Rect full_rect; + + CHECK_TEXTURE_MAGIC(texture, -1); + + if (!pixels) { + return SDL_InvalidParamError("pixels"); + } + if (!pitch) { + return SDL_InvalidParamError("pitch"); + } + + if (!rect) { + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = texture->w; + full_rect.h = texture->h; + rect = &full_rect; + } + + if (texture->yuv) { + return SDL_UpdateTextureYUV(texture, rect, pixels, pitch); + } else if (texture->native) { + return SDL_UpdateTextureNative(texture, rect, pixels, pitch); + } else { + renderer = texture->renderer; + return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch); + } +} + +static int +SDL_LockTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, + void **pixels, int *pitch) +{ + return SDL_SW_LockYUVTexture(texture->yuv, rect, pixels, pitch); +} + +static int +SDL_LockTextureNative(SDL_Texture * texture, const SDL_Rect * rect, + void **pixels, int *pitch) +{ + texture->locked_rect = *rect; + *pixels = (void *) ((Uint8 *) texture->pixels + + rect->y * texture->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pitch = texture->pitch; + return 0; +} + +int +SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, + void **pixels, int *pitch) +{ + SDL_Renderer *renderer; + SDL_Rect full_rect; + + CHECK_TEXTURE_MAGIC(texture, -1); + + if (texture->access != SDL_TEXTUREACCESS_STREAMING) { + return SDL_SetError("SDL_LockTexture(): texture must be streaming"); + } + + if (!rect) { + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = texture->w; + full_rect.h = texture->h; + rect = &full_rect; + } + + if (texture->yuv) { + return SDL_LockTextureYUV(texture, rect, pixels, pitch); + } else if (texture->native) { + return SDL_LockTextureNative(texture, rect, pixels, pitch); + } else { + renderer = texture->renderer; + return renderer->LockTexture(renderer, texture, rect, pixels, pitch); + } +} + +static void +SDL_UnlockTextureYUV(SDL_Texture * texture) +{ + SDL_Texture *native = texture->native; + void *native_pixels; + int native_pitch; + SDL_Rect rect; + + rect.x = 0; + rect.y = 0; + rect.w = texture->w; + rect.h = texture->h; + + if (SDL_LockTexture(native, &rect, &native_pixels, &native_pitch) < 0) { + return; + } + SDL_SW_CopyYUVToRGB(texture->yuv, &rect, native->format, + rect.w, rect.h, native_pixels, native_pitch); + SDL_UnlockTexture(native); +} + +static void +SDL_UnlockTextureNative(SDL_Texture * texture) +{ + SDL_Texture *native = texture->native; + void *native_pixels; + int native_pitch; + const SDL_Rect *rect = &texture->locked_rect; + const void* pixels = (void *) ((Uint8 *) texture->pixels + + rect->y * texture->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + int pitch = texture->pitch; + + if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) { + return; + } + SDL_ConvertPixels(rect->w, rect->h, + texture->format, pixels, pitch, + native->format, native_pixels, native_pitch); + SDL_UnlockTexture(native); +} + +void +SDL_UnlockTexture(SDL_Texture * texture) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, ); + + if (texture->access != SDL_TEXTUREACCESS_STREAMING) { + return; + } + if (texture->yuv) { + SDL_UnlockTextureYUV(texture); + } else if (texture->native) { + SDL_UnlockTextureNative(texture); + } else { + renderer = texture->renderer; + renderer->UnlockTexture(renderer, texture); + } +} + +SDL_bool +SDL_RenderTargetSupported(SDL_Renderer *renderer) +{ + if (!renderer || !renderer->SetRenderTarget) { + return SDL_FALSE; + } + return (renderer->info.flags & SDL_RENDERER_TARGETTEXTURE) != 0; +} + +int +SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) +{ + if (!SDL_RenderTargetSupported(renderer)) { + return SDL_Unsupported(); + } + if (texture == renderer->target) { + /* Nothing to do! */ + return 0; + } + + /* texture == NULL is valid and means reset the target to the window */ + if (texture) { + CHECK_TEXTURE_MAGIC(texture, -1); + if (renderer != texture->renderer) { + return SDL_SetError("Texture was not created with this renderer"); + } + if (texture->access != SDL_TEXTUREACCESS_TARGET) { + return SDL_SetError("Texture not created with SDL_TEXTUREACCESS_TARGET"); + } + if (texture->native) { + /* Always render to the native texture */ + texture = texture->native; + } + } + + if (texture && !renderer->target) { + /* Make a backup of the viewport */ + renderer->viewport_backup = renderer->viewport; + renderer->clip_rect_backup = renderer->clip_rect; + renderer->scale_backup = renderer->scale; + renderer->logical_w_backup = renderer->logical_w; + renderer->logical_h_backup = renderer->logical_h; + } + renderer->target = texture; + + if (renderer->SetRenderTarget(renderer, texture) < 0) { + return -1; + } + + if (texture) { + renderer->viewport.x = 0; + renderer->viewport.y = 0; + renderer->viewport.w = texture->w; + renderer->viewport.h = texture->h; + renderer->scale.x = 1.0f; + renderer->scale.y = 1.0f; + renderer->logical_w = texture->w; + renderer->logical_h = texture->h; + } else { + renderer->viewport = renderer->viewport_backup; + renderer->clip_rect = renderer->clip_rect_backup; + renderer->scale = renderer->scale_backup; + renderer->logical_w = renderer->logical_w_backup; + renderer->logical_h = renderer->logical_h_backup; + } + if (renderer->UpdateViewport(renderer) < 0) { + return -1; + } + if (renderer->UpdateClipRect(renderer) < 0) { + return -1; + } + + /* All set! */ + return 0; +} + +SDL_Texture * +SDL_GetRenderTarget(SDL_Renderer *renderer) +{ + return renderer->target; +} + +static int +UpdateLogicalSize(SDL_Renderer *renderer) +{ + int w, h; + float want_aspect; + float real_aspect; + float scale; + SDL_Rect viewport; + + if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) { + return -1; + } + + want_aspect = (float)renderer->logical_w / renderer->logical_h; + real_aspect = (float)w / h; + + /* Clear the scale because we're setting viewport in output coordinates */ + SDL_RenderSetScale(renderer, 1.0f, 1.0f); + + if (SDL_fabs(want_aspect-real_aspect) < 0.0001) { + /* The aspect ratios are the same, just scale appropriately */ + scale = (float)w / renderer->logical_w; + SDL_RenderSetViewport(renderer, NULL); + } else if (want_aspect > real_aspect) { + /* We want a wider aspect ratio than is available - letterbox it */ + scale = (float)w / renderer->logical_w; + viewport.x = 0; + viewport.w = w; + viewport.h = (int)SDL_ceil(renderer->logical_h * scale); + viewport.y = (h - viewport.h) / 2; + SDL_RenderSetViewport(renderer, &viewport); + } else { + /* We want a narrower aspect ratio than is available - use side-bars */ + scale = (float)h / renderer->logical_h; + viewport.y = 0; + viewport.h = h; + viewport.w = (int)SDL_ceil(renderer->logical_w * scale); + viewport.x = (w - viewport.w) / 2; + SDL_RenderSetViewport(renderer, &viewport); + } + + /* Set the new scale */ + SDL_RenderSetScale(renderer, scale, scale); + + return 0; +} + +int +SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!w || !h) { + /* Clear any previous logical resolution */ + renderer->logical_w = 0; + renderer->logical_h = 0; + SDL_RenderSetViewport(renderer, NULL); + SDL_RenderSetScale(renderer, 1.0f, 1.0f); + return 0; + } + + renderer->logical_w = w; + renderer->logical_h = h; + + return UpdateLogicalSize(renderer); +} + +void +SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h) +{ + CHECK_RENDERER_MAGIC(renderer, ); + + if (w) { + *w = renderer->logical_w; + } + if (h) { + *h = renderer->logical_h; + } +} + +int +SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (rect) { + renderer->viewport.x = (int)SDL_floor(rect->x * renderer->scale.x); + renderer->viewport.y = (int)SDL_floor(rect->y * renderer->scale.y); + renderer->viewport.w = (int)SDL_ceil(rect->w * renderer->scale.x); + renderer->viewport.h = (int)SDL_ceil(rect->h * renderer->scale.y); + } else { + renderer->viewport.x = 0; + renderer->viewport.y = 0; + if (SDL_GetRendererOutputSize(renderer, &renderer->viewport.w, &renderer->viewport.h) < 0) { + return -1; + } + } + return renderer->UpdateViewport(renderer); +} + +void +SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect) +{ + CHECK_RENDERER_MAGIC(renderer, ); + + if (rect) { + rect->x = (int)(renderer->viewport.x / renderer->scale.x); + rect->y = (int)(renderer->viewport.y / renderer->scale.y); + rect->w = (int)(renderer->viewport.w / renderer->scale.x); + rect->h = (int)(renderer->viewport.h / renderer->scale.y); + } +} + +int +SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect) +{ + CHECK_RENDERER_MAGIC(renderer, -1) + + if (rect) { + renderer->clip_rect.x = (int)SDL_floor(rect->x * renderer->scale.x); + renderer->clip_rect.y = (int)SDL_floor(rect->y * renderer->scale.y); + renderer->clip_rect.w = (int)SDL_ceil(rect->w * renderer->scale.x); + renderer->clip_rect.h = (int)SDL_ceil(rect->h * renderer->scale.y); + } else { + SDL_zero(renderer->clip_rect); + } + return renderer->UpdateClipRect(renderer); +} + +void +SDL_RenderGetClipRect(SDL_Renderer * renderer, SDL_Rect * rect) +{ + CHECK_RENDERER_MAGIC(renderer, ) + + if (rect) { + rect->x = (int)(renderer->clip_rect.x / renderer->scale.x); + rect->y = (int)(renderer->clip_rect.y / renderer->scale.y); + rect->w = (int)(renderer->clip_rect.w / renderer->scale.x); + rect->h = (int)(renderer->clip_rect.h / renderer->scale.y); + } +} + +int +SDL_RenderSetScale(SDL_Renderer * renderer, float scaleX, float scaleY) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + renderer->scale.x = scaleX; + renderer->scale.y = scaleY; + return 0; +} + +void +SDL_RenderGetScale(SDL_Renderer * renderer, float *scaleX, float *scaleY) +{ + CHECK_RENDERER_MAGIC(renderer, ); + + if (scaleX) { + *scaleX = renderer->scale.x; + } + if (scaleY) { + *scaleY = renderer->scale.y; + } +} + +int +SDL_SetRenderDrawColor(SDL_Renderer * renderer, + Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + renderer->r = r; + renderer->g = g; + renderer->b = b; + renderer->a = a; + return 0; +} + +int +SDL_GetRenderDrawColor(SDL_Renderer * renderer, + Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + if (r) { + *r = renderer->r; + } + if (g) { + *g = renderer->g; + } + if (b) { + *b = renderer->b; + } + if (a) { + *a = renderer->a; + } + return 0; +} + +int +SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + renderer->blendMode = blendMode; + return 0; +} + +int +SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + *blendMode = renderer->blendMode; + return 0; +} + +int +SDL_RenderClear(SDL_Renderer * renderer) +{ + CHECK_RENDERER_MAGIC(renderer, -1); + + /* Don't draw while we're hidden */ + if (renderer->hidden) { + return 0; + } + return renderer->RenderClear(renderer); +} + +int +SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y) +{ + SDL_Point point; + + point.x = x; + point.y = y; + return SDL_RenderDrawPoints(renderer, &point, 1); +} + +static int +RenderDrawPointsWithRects(SDL_Renderer * renderer, + const SDL_Point * points, int count) +{ + SDL_FRect *frects; + int i; + int status; + + frects = SDL_stack_alloc(SDL_FRect, count); + if (!frects) { + return SDL_OutOfMemory(); + } + for (i = 0; i < count; ++i) { + frects[i].x = points[i].x * renderer->scale.x; + frects[i].y = points[i].y * renderer->scale.y; + frects[i].w = renderer->scale.x; + frects[i].h = renderer->scale.y; + } + + status = renderer->RenderFillRects(renderer, frects, count); + + SDL_stack_free(frects); + + return status; +} + +int +SDL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, int count) +{ + SDL_FPoint *fpoints; + int i; + int status; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!points) { + return SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points"); + } + if (count < 1) { + return 0; + } + /* Don't draw while we're hidden */ + if (renderer->hidden) { + return 0; + } + + if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) { + return RenderDrawPointsWithRects(renderer, points, count); + } + + fpoints = SDL_stack_alloc(SDL_FPoint, count); + if (!fpoints) { + return SDL_OutOfMemory(); + } + for (i = 0; i < count; ++i) { + fpoints[i].x = points[i].x * renderer->scale.x; + fpoints[i].y = points[i].y * renderer->scale.y; + } + + status = renderer->RenderDrawPoints(renderer, fpoints, count); + + SDL_stack_free(fpoints); + + return status; +} + +int +SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) +{ + SDL_Point points[2]; + + points[0].x = x1; + points[0].y = y1; + points[1].x = x2; + points[1].y = y2; + return SDL_RenderDrawLines(renderer, points, 2); +} + +static int +RenderDrawLinesWithRects(SDL_Renderer * renderer, + const SDL_Point * points, int count) +{ + SDL_FRect *frect; + SDL_FRect *frects; + SDL_FPoint fpoints[2]; + int i, nrects; + int status; + + frects = SDL_stack_alloc(SDL_FRect, count-1); + if (!frects) { + return SDL_OutOfMemory(); + } + + status = 0; + nrects = 0; + for (i = 0; i < count-1; ++i) { + if (points[i].x == points[i+1].x) { + int minY = SDL_min(points[i].y, points[i+1].y); + int maxY = SDL_max(points[i].y, points[i+1].y); + + frect = &frects[nrects++]; + frect->x = points[i].x * renderer->scale.x; + frect->y = minY * renderer->scale.y; + frect->w = renderer->scale.x; + frect->h = (maxY - minY + 1) * renderer->scale.y; + } else if (points[i].y == points[i+1].y) { + int minX = SDL_min(points[i].x, points[i+1].x); + int maxX = SDL_max(points[i].x, points[i+1].x); + + frect = &frects[nrects++]; + frect->x = minX * renderer->scale.x; + frect->y = points[i].y * renderer->scale.y; + frect->w = (maxX - minX + 1) * renderer->scale.x; + frect->h = renderer->scale.y; + } else { + /* FIXME: We can't use a rect for this line... */ + fpoints[0].x = points[i].x * renderer->scale.x; + fpoints[0].y = points[i].y * renderer->scale.y; + fpoints[1].x = points[i+1].x * renderer->scale.x; + fpoints[1].y = points[i+1].y * renderer->scale.y; + status += renderer->RenderDrawLines(renderer, fpoints, 2); + } + } + + status += renderer->RenderFillRects(renderer, frects, nrects); + + SDL_stack_free(frects); + + if (status < 0) { + status = -1; + } + return status; +} + +int +SDL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, int count) +{ + SDL_FPoint *fpoints; + int i; + int status; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!points) { + return SDL_SetError("SDL_RenderDrawLines(): Passed NULL points"); + } + if (count < 2) { + return 0; + } + /* Don't draw while we're hidden */ + if (renderer->hidden) { + return 0; + } + + if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) { + return RenderDrawLinesWithRects(renderer, points, count); + } + + fpoints = SDL_stack_alloc(SDL_FPoint, count); + if (!fpoints) { + return SDL_OutOfMemory(); + } + for (i = 0; i < count; ++i) { + fpoints[i].x = points[i].x * renderer->scale.x; + fpoints[i].y = points[i].y * renderer->scale.y; + } + + status = renderer->RenderDrawLines(renderer, fpoints, count); + + SDL_stack_free(fpoints); + + return status; +} + +int +SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect) +{ + SDL_Rect full_rect; + SDL_Point points[5]; + + CHECK_RENDERER_MAGIC(renderer, -1); + + /* If 'rect' == NULL, then outline the whole surface */ + if (!rect) { + SDL_RenderGetViewport(renderer, &full_rect); + full_rect.x = 0; + full_rect.y = 0; + rect = &full_rect; + } + + points[0].x = rect->x; + points[0].y = rect->y; + points[1].x = rect->x+rect->w-1; + points[1].y = rect->y; + points[2].x = rect->x+rect->w-1; + points[2].y = rect->y+rect->h-1; + points[3].x = rect->x; + points[3].y = rect->y+rect->h-1; + points[4].x = rect->x; + points[4].y = rect->y; + return SDL_RenderDrawLines(renderer, points, 5); +} + +int +SDL_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect * rects, int count) +{ + int i; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!rects) { + return SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects"); + } + if (count < 1) { + return 0; + } + + /* Don't draw while we're hidden */ + if (renderer->hidden) { + return 0; + } + for (i = 0; i < count; ++i) { + if (SDL_RenderDrawRect(renderer, &rects[i]) < 0) { + return -1; + } + } + return 0; +} + +int +SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect) +{ + SDL_Rect full_rect = { 0, 0, 0, 0 }; + + CHECK_RENDERER_MAGIC(renderer, -1); + + /* If 'rect' == NULL, then outline the whole surface */ + if (!rect) { + SDL_RenderGetViewport(renderer, &full_rect); + full_rect.x = 0; + full_rect.y = 0; + rect = &full_rect; + } + return SDL_RenderFillRects(renderer, rect, 1); +} + +int +SDL_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect * rects, int count) +{ + SDL_FRect *frects; + int i; + int status; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!rects) { + return SDL_SetError("SDL_RenderFillRects(): Passed NULL rects"); + } + if (count < 1) { + return 0; + } + /* Don't draw while we're hidden */ + if (renderer->hidden) { + return 0; + } + + frects = SDL_stack_alloc(SDL_FRect, count); + if (!frects) { + return SDL_OutOfMemory(); + } + for (i = 0; i < count; ++i) { + frects[i].x = rects[i].x * renderer->scale.x; + frects[i].y = rects[i].y * renderer->scale.y; + frects[i].w = rects[i].w * renderer->scale.x; + frects[i].h = rects[i].h * renderer->scale.y; + } + + status = renderer->RenderFillRects(renderer, frects, count); + + SDL_stack_free(frects); + + return status; +} + +int +SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_Rect * dstrect) +{ + SDL_Rect real_srcrect = { 0, 0, 0, 0 }; + SDL_Rect real_dstrect = { 0, 0, 0, 0 }; + SDL_FRect frect; + + CHECK_RENDERER_MAGIC(renderer, -1); + CHECK_TEXTURE_MAGIC(texture, -1); + + if (renderer != texture->renderer) { + return SDL_SetError("Texture was not created with this renderer"); + } + + real_srcrect.x = 0; + real_srcrect.y = 0; + real_srcrect.w = texture->w; + real_srcrect.h = texture->h; + if (srcrect) { + if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) { + return 0; + } + } + + SDL_RenderGetViewport(renderer, &real_dstrect); + real_dstrect.x = 0; + real_dstrect.y = 0; + if (dstrect) { + if (!SDL_HasIntersection(dstrect, &real_dstrect)) { + return 0; + } + real_dstrect = *dstrect; + } + + if (texture->native) { + texture = texture->native; + } + + /* Don't draw while we're hidden */ + if (renderer->hidden) { + return 0; + } + + frect.x = real_dstrect.x * renderer->scale.x; + frect.y = real_dstrect.y * renderer->scale.y; + frect.w = real_dstrect.w * renderer->scale.x; + frect.h = real_dstrect.h * renderer->scale.y; + + return renderer->RenderCopy(renderer, texture, &real_srcrect, &frect); +} + + +int +SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_Rect * dstrect, + const double angle, const SDL_Point *center, const SDL_RendererFlip flip) +{ + SDL_Rect real_srcrect = { 0, 0, 0, 0 }; + SDL_Rect real_dstrect = { 0, 0, 0, 0 }; + SDL_Point real_center; + SDL_FRect frect; + SDL_FPoint fcenter; + + CHECK_RENDERER_MAGIC(renderer, -1); + CHECK_TEXTURE_MAGIC(texture, -1); + + if (renderer != texture->renderer) { + return SDL_SetError("Texture was not created with this renderer"); + } + if (!renderer->RenderCopyEx) { + return SDL_SetError("Renderer does not support RenderCopyEx"); + } + + real_srcrect.x = 0; + real_srcrect.y = 0; + real_srcrect.w = texture->w; + real_srcrect.h = texture->h; + if (srcrect) { + if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) { + return 0; + } + } + + /* We don't intersect the dstrect with the viewport as RenderCopy does because of potential rotation clipping issues... TODO: should we? */ + if (dstrect) { + real_dstrect = *dstrect; + } else { + SDL_RenderGetViewport(renderer, &real_dstrect); + real_dstrect.x = 0; + real_dstrect.y = 0; + } + + if (texture->native) { + texture = texture->native; + } + + if(center) real_center = *center; + else { + real_center.x = real_dstrect.w/2; + real_center.y = real_dstrect.h/2; + } + + frect.x = real_dstrect.x * renderer->scale.x; + frect.y = real_dstrect.y * renderer->scale.y; + frect.w = real_dstrect.w * renderer->scale.x; + frect.h = real_dstrect.h * renderer->scale.y; + + fcenter.x = real_center.x * renderer->scale.x; + fcenter.y = real_center.y * renderer->scale.y; + + return renderer->RenderCopyEx(renderer, texture, &real_srcrect, &frect, angle, &fcenter, flip); +} + +int +SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch) +{ + SDL_Rect real_rect; + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (!renderer->RenderReadPixels) { + return SDL_Unsupported(); + } + + if (!format) { + format = SDL_GetWindowPixelFormat(renderer->window); + } + + real_rect.x = renderer->viewport.x; + real_rect.y = renderer->viewport.y; + real_rect.w = renderer->viewport.w; + real_rect.h = renderer->viewport.h; + if (rect) { + if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) { + return 0; + } + if (real_rect.y > rect->y) { + pixels = (Uint8 *)pixels + pitch * (real_rect.y - rect->y); + } + if (real_rect.x > rect->x) { + int bpp = SDL_BYTESPERPIXEL(format); + pixels = (Uint8 *)pixels + bpp * (real_rect.x - rect->x); + } + } + + return renderer->RenderReadPixels(renderer, &real_rect, + format, pixels, pitch); +} + +void +SDL_RenderPresent(SDL_Renderer * renderer) +{ + CHECK_RENDERER_MAGIC(renderer, ); + + /* Don't draw while we're hidden */ + if (renderer->hidden) { + return; + } + renderer->RenderPresent(renderer); +} + +void +SDL_DestroyTexture(SDL_Texture * texture) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, ); + + renderer = texture->renderer; + if (texture == renderer->target) { + SDL_SetRenderTarget(renderer, NULL); + } + + texture->magic = NULL; + + if (texture->next) { + texture->next->prev = texture->prev; + } + if (texture->prev) { + texture->prev->next = texture->next; + } else { + renderer->textures = texture->next; + } + + if (texture->native) { + SDL_DestroyTexture(texture->native); + } + if (texture->yuv) { + SDL_SW_DestroyYUVTexture(texture->yuv); + } + if (texture->pixels) { + SDL_free(texture->pixels); + } + + renderer->DestroyTexture(renderer, texture); + SDL_free(texture); +} + +void +SDL_DestroyRenderer(SDL_Renderer * renderer) +{ + CHECK_RENDERER_MAGIC(renderer, ); + + SDL_DelEventWatch(SDL_RendererEventWatch, renderer); + + /* Free existing textures for this renderer */ + while (renderer->textures) { + SDL_DestroyTexture(renderer->textures); + } + + if (renderer->window) { + SDL_SetWindowData(renderer->window, SDL_WINDOWRENDERDATA, NULL); + } + + /* It's no longer magical... */ + renderer->magic = NULL; + + /* Free the renderer instance */ + renderer->DestroyRenderer(renderer); +} + +int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + renderer = texture->renderer; + if (texture->native) { + return SDL_GL_BindTexture(texture->native, texw, texh); + } else if (renderer && renderer->GL_BindTexture) { + return renderer->GL_BindTexture(renderer, texture, texw, texh); + } else { + return SDL_Unsupported(); + } +} + +int SDL_GL_UnbindTexture(SDL_Texture *texture) +{ + SDL_Renderer *renderer; + + CHECK_TEXTURE_MAGIC(texture, -1); + renderer = texture->renderer; + if (renderer && renderer->GL_UnbindTexture) { + return renderer->GL_UnbindTexture(renderer, texture); + } + + return SDL_Unsupported(); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h new file mode 100644 index 0000000000..f06ee1d803 --- /dev/null +++ b/src/render/SDL_sysrender.h @@ -0,0 +1,190 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_sysrender_h +#define _SDL_sysrender_h + +#include "SDL_render.h" +#include "SDL_events.h" +#include "SDL_yuv_sw_c.h" + +/* The SDL 2D rendering system */ + +typedef struct SDL_RenderDriver SDL_RenderDriver; + +typedef struct +{ + float x; + float y; +} SDL_FPoint; + +typedef struct +{ + float x; + float y; + float w; + float h; +} SDL_FRect; + +/* Define the SDL texture structure */ +struct SDL_Texture +{ + const void *magic; + Uint32 format; /**< The pixel format of the texture */ + int access; /**< SDL_TextureAccess */ + int w; /**< The width of the texture */ + int h; /**< The height of the texture */ + int modMode; /**< The texture modulation mode */ + SDL_BlendMode blendMode; /**< The texture blend mode */ + Uint8 r, g, b, a; /**< Texture modulation values */ + + SDL_Renderer *renderer; + + /* Support for formats not supported directly by the renderer */ + SDL_Texture *native; + SDL_SW_YUVTexture *yuv; + void *pixels; + int pitch; + SDL_Rect locked_rect; + + void *driverdata; /**< Driver specific texture representation */ + + SDL_Texture *prev; + SDL_Texture *next; +}; + +/* Define the SDL renderer structure */ +struct SDL_Renderer +{ + const void *magic; + + void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event); + int (*GetOutputSize) (SDL_Renderer * renderer, int *w, int *h); + int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); + int (*SetTextureColorMod) (SDL_Renderer * renderer, + SDL_Texture * texture); + int (*SetTextureAlphaMod) (SDL_Renderer * renderer, + SDL_Texture * texture); + int (*SetTextureBlendMode) (SDL_Renderer * renderer, + SDL_Texture * texture); + int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, + int pitch); + int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch); + void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture); + int (*SetRenderTarget) (SDL_Renderer * renderer, SDL_Texture * texture); + int (*UpdateViewport) (SDL_Renderer * renderer); + int (*UpdateClipRect) (SDL_Renderer * renderer); + int (*RenderClear) (SDL_Renderer * renderer); + int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_FPoint * points, + int count); + int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_FPoint * points, + int count); + int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_FRect * rects, + int count); + int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect); + int (*RenderCopyEx) (SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcquad, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip); + int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch); + void (*RenderPresent) (SDL_Renderer * renderer); + void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture); + + void (*DestroyRenderer) (SDL_Renderer * renderer); + + int (*GL_BindTexture) (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh); + int (*GL_UnbindTexture) (SDL_Renderer * renderer, SDL_Texture *texture); + + /* The current renderer info */ + SDL_RendererInfo info; + + /* The window associated with the renderer */ + SDL_Window *window; + SDL_bool hidden; + + /* The logical resolution for rendering */ + int logical_w; + int logical_h; + int logical_w_backup; + int logical_h_backup; + + /* The drawable area within the window */ + SDL_Rect viewport; + SDL_Rect viewport_backup; + + /* The clip rectangle within the window */ + SDL_Rect clip_rect; + SDL_Rect clip_rect_backup; + + /* The render output coordinate scale */ + SDL_FPoint scale; + SDL_FPoint scale_backup; + + /* The list of textures */ + SDL_Texture *textures; + SDL_Texture *target; + + Uint8 r, g, b, a; /**< Color for drawing operations values */ + SDL_BlendMode blendMode; /**< The drawing blend mode */ + + void *driverdata; +}; + +/* Define the SDL render driver structure */ +struct SDL_RenderDriver +{ + SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags); + + /* Info about the renderer capabilities */ + SDL_RendererInfo info; +}; + +#if !SDL_RENDER_DISABLED + +#if SDL_VIDEO_RENDER_D3D +extern SDL_RenderDriver D3D_RenderDriver; +#endif +#if SDL_VIDEO_RENDER_OGL +extern SDL_RenderDriver GL_RenderDriver; +#endif +#if SDL_VIDEO_RENDER_OGL_ES2 +extern SDL_RenderDriver GLES2_RenderDriver; +#endif +#if SDL_VIDEO_RENDER_OGL_ES +extern SDL_RenderDriver GLES_RenderDriver; +#endif +#if SDL_VIDEO_RENDER_DIRECTFB +extern SDL_RenderDriver DirectFB_RenderDriver; +#endif +#if SDL_VIDEO_RENDER_PSP +extern SDL_RenderDriver PSP_RenderDriver; +#endif +extern SDL_RenderDriver SW_RenderDriver; + +#endif /* !SDL_RENDER_DISABLED */ + +#endif /* _SDL_sysrender_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_yuv_mmx.c b/src/render/SDL_yuv_mmx.c new file mode 100644 index 0000000000..b223d2d281 --- /dev/null +++ b/src/render/SDL_yuv_mmx.c @@ -0,0 +1,431 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES + +#include "SDL_stdinc.h" + +#include "mmx.h" + +/* *INDENT-OFF* */ + +static mmx_t MMX_0080w = { .ud = {0x00800080, 0x00800080} }; +static mmx_t MMX_00FFw = { .ud = {0x00ff00ff, 0x00ff00ff} }; +static mmx_t MMX_FF00w = { .ud = {0xff00ff00, 0xff00ff00} }; + +static mmx_t MMX_Ycoeff = { .uw = {0x004a, 0x004a, 0x004a, 0x004a} }; + +static mmx_t MMX_UbluRGB = { .uw = {0x0072, 0x0072, 0x0072, 0x0072} }; +static mmx_t MMX_VredRGB = { .uw = {0x0059, 0x0059, 0x0059, 0x0059} }; +static mmx_t MMX_UgrnRGB = { .uw = {0xffea, 0xffea, 0xffea, 0xffea} }; +static mmx_t MMX_VgrnRGB = { .uw = {0xffd2, 0xffd2, 0xffd2, 0xffd2} }; + +static mmx_t MMX_Ublu5x5 = { .uw = {0x0081, 0x0081, 0x0081, 0x0081} }; +static mmx_t MMX_Vred5x5 = { .uw = {0x0066, 0x0066, 0x0066, 0x0066} }; +static mmx_t MMX_Ugrn565 = { .uw = {0xffe8, 0xffe8, 0xffe8, 0xffe8} }; +static mmx_t MMX_Vgrn565 = { .uw = {0xffcd, 0xffcd, 0xffcd, 0xffcd} }; + +static mmx_t MMX_red565 = { .uw = {0xf800, 0xf800, 0xf800, 0xf800} }; +static mmx_t MMX_grn565 = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} }; + +/** + This MMX assembler is my first assembler/MMX program ever. + Thus it maybe buggy. + Send patches to: + mvogt@rhrk.uni-kl.de + + After it worked fine I have "obfuscated" the code a bit to have + more parallism in the MMX units. This means I moved + initilisation around and delayed other instruction. + Performance measurement did not show that this brought any advantage + but in theory it _should_ be faster this way. + + The overall performanve gain to the C based dither was 30%-40%. + The MMX routine calculates 256bit=8RGB values in each cycle + (4 for row1 & 4 for row2) + + The red/green/blue.. coefficents are taken from the mpeg_play + player. They look nice, but I dont know if you can have + better values, to avoid integer rounding errors. + + + IMPORTANT: + ========== + + It is a requirement that the cr/cb/lum are 8 byte aligned and + the out are 16byte aligned or you will/may get segfaults + +*/ + +void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod ) +{ + Uint32 *row1; + Uint32 *row2; + + unsigned char* y = lum +cols*rows; /* Pointer to the end */ + int x = 0; + row1 = (Uint32 *)out; /* 32 bit target */ + row2 = (Uint32 *)out+cols+mod; /* start of second row */ + mod = (mod+cols+mod)*4; /* increment for row1 in byte */ + + __asm__ __volatile__ ( + /* tap dance to workaround the inability to use %%ebx at will... */ + /* move one thing to the stack... */ + "pushl $0\n" /* save a slot on the stack. */ + "pushl %%ebx\n" /* save %%ebx. */ + "movl %0, %%ebx\n" /* put the thing in ebx. */ + "movl %%ebx,4(%%esp)\n" /* put the thing in the stack slot. */ + "popl %%ebx\n" /* get back %%ebx (the PIC register). */ + + ".align 8\n" + "1:\n" + + /* create Cr (result in mm1) */ + "pushl %%ebx\n" + "movl 4(%%esp),%%ebx\n" + "movd (%%ebx),%%mm1\n" /* 0 0 0 0 v3 v2 v1 v0 */ + "popl %%ebx\n" + "pxor %%mm7,%%mm7\n" /* 00 00 00 00 00 00 00 00 */ + "movd (%2), %%mm2\n" /* 0 0 0 0 l3 l2 l1 l0 */ + "punpcklbw %%mm7,%%mm1\n" /* 0 v3 0 v2 00 v1 00 v0 */ + "punpckldq %%mm1,%%mm1\n" /* 00 v1 00 v0 00 v1 00 v0 */ + "psubw %9,%%mm1\n" /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */ + + /* create Cr_g (result in mm0) */ + "movq %%mm1,%%mm0\n" /* r1 r1 r0 r0 r1 r1 r0 r0 */ + "pmullw %10,%%mm0\n" /* red*-46dec=0.7136*64 */ + "pmullw %11,%%mm1\n" /* red*89dec=1.4013*64 */ + "psraw $6, %%mm0\n" /* red=red/64 */ + "psraw $6, %%mm1\n" /* red=red/64 */ + + /* create L1 L2 (result in mm2,mm4) */ + /* L2=lum+cols */ + "movq (%2,%4),%%mm3\n" /* 0 0 0 0 L3 L2 L1 L0 */ + "punpckldq %%mm3,%%mm2\n" /* L3 L2 L1 L0 l3 l2 l1 l0 */ + "movq %%mm2,%%mm4\n" /* L3 L2 L1 L0 l3 l2 l1 l0 */ + "pand %12,%%mm2\n" /* L3 0 L1 0 l3 0 l1 0 */ + "pand %13,%%mm4\n" /* 0 L2 0 L0 0 l2 0 l0 */ + "psrlw $8,%%mm2\n" /* 0 L3 0 L1 0 l3 0 l1 */ + + /* create R (result in mm6) */ + "movq %%mm2,%%mm5\n" /* 0 L3 0 L1 0 l3 0 l1 */ + "movq %%mm4,%%mm6\n" /* 0 L2 0 L0 0 l2 0 l0 */ + "paddsw %%mm1, %%mm5\n" /* lum1+red:x R3 x R1 x r3 x r1 */ + "paddsw %%mm1, %%mm6\n" /* lum1+red:x R2 x R0 x r2 x r0 */ + "packuswb %%mm5,%%mm5\n" /* R3 R1 r3 r1 R3 R1 r3 r1 */ + "packuswb %%mm6,%%mm6\n" /* R2 R0 r2 r0 R2 R0 r2 r0 */ + "pxor %%mm7,%%mm7\n" /* 00 00 00 00 00 00 00 00 */ + "punpcklbw %%mm5,%%mm6\n" /* R3 R2 R1 R0 r3 r2 r1 r0 */ + + /* create Cb (result in mm1) */ + "movd (%1), %%mm1\n" /* 0 0 0 0 u3 u2 u1 u0 */ + "punpcklbw %%mm7,%%mm1\n" /* 0 u3 0 u2 00 u1 00 u0 */ + "punpckldq %%mm1,%%mm1\n" /* 00 u1 00 u0 00 u1 00 u0 */ + "psubw %9,%%mm1\n" /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */ + + /* create Cb_g (result in mm5) */ + "movq %%mm1,%%mm5\n" /* u1 u1 u0 u0 u1 u1 u0 u0 */ + "pmullw %14,%%mm5\n" /* blue*-109dec=1.7129*64 */ + "pmullw %15,%%mm1\n" /* blue*114dec=1.78125*64 */ + "psraw $6, %%mm5\n" /* blue=red/64 */ + "psraw $6, %%mm1\n" /* blue=blue/64 */ + + /* create G (result in mm7) */ + "movq %%mm2,%%mm3\n" /* 0 L3 0 L1 0 l3 0 l1 */ + "movq %%mm4,%%mm7\n" /* 0 L2 0 L0 0 l2 0 l1 */ + "paddsw %%mm5, %%mm3\n" /* lum1+Cb_g:x G3t x G1t x g3t x g1t */ + "paddsw %%mm5, %%mm7\n" /* lum1+Cb_g:x G2t x G0t x g2t x g0t */ + "paddsw %%mm0, %%mm3\n" /* lum1+Cr_g:x G3 x G1 x g3 x g1 */ + "paddsw %%mm0, %%mm7\n" /* lum1+blue:x G2 x G0 x g2 x g0 */ + "packuswb %%mm3,%%mm3\n" /* G3 G1 g3 g1 G3 G1 g3 g1 */ + "packuswb %%mm7,%%mm7\n" /* G2 G0 g2 g0 G2 G0 g2 g0 */ + "punpcklbw %%mm3,%%mm7\n" /* G3 G2 G1 G0 g3 g2 g1 g0 */ + + /* create B (result in mm5) */ + "movq %%mm2,%%mm3\n" /* 0 L3 0 L1 0 l3 0 l1 */ + "movq %%mm4,%%mm5\n" /* 0 L2 0 L0 0 l2 0 l1 */ + "paddsw %%mm1, %%mm3\n" /* lum1+blue:x B3 x B1 x b3 x b1 */ + "paddsw %%mm1, %%mm5\n" /* lum1+blue:x B2 x B0 x b2 x b0 */ + "packuswb %%mm3,%%mm3\n" /* B3 B1 b3 b1 B3 B1 b3 b1 */ + "packuswb %%mm5,%%mm5\n" /* B2 B0 b2 b0 B2 B0 b2 b0 */ + "punpcklbw %%mm3,%%mm5\n" /* B3 B2 B1 B0 b3 b2 b1 b0 */ + + /* fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */ + + "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */ + "pxor %%mm4,%%mm4\n" /* 0 0 0 0 0 0 0 0 */ + "movq %%mm6,%%mm1\n" /* R3 R2 R1 R0 r3 r2 r1 r0 */ + "movq %%mm5,%%mm3\n" /* B3 B2 B1 B0 b3 b2 b1 b0 */ + + /* process lower lum */ + "punpcklbw %%mm4,%%mm1\n" /* 0 r3 0 r2 0 r1 0 r0 */ + "punpcklbw %%mm4,%%mm3\n" /* 0 b3 0 b2 0 b1 0 b0 */ + "movq %%mm1,%%mm2\n" /* 0 r3 0 r2 0 r1 0 r0 */ + "movq %%mm3,%%mm0\n" /* 0 b3 0 b2 0 b1 0 b0 */ + "punpcklwd %%mm1,%%mm3\n" /* 0 r1 0 b1 0 r0 0 b0 */ + "punpckhwd %%mm2,%%mm0\n" /* 0 r3 0 b3 0 r2 0 b2 */ + + "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */ + "movq %%mm7,%%mm1\n" /* G3 G2 G1 G0 g3 g2 g1 g0 */ + "punpcklbw %%mm1,%%mm2\n" /* g3 0 g2 0 g1 0 g0 0 */ + "punpcklwd %%mm4,%%mm2\n" /* 0 0 g1 0 0 0 g0 0 */ + "por %%mm3, %%mm2\n" /* 0 r1 g1 b1 0 r0 g0 b0 */ + "movq %%mm2,(%3)\n" /* wrote out ! row1 */ + + "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */ + "punpcklbw %%mm1,%%mm4\n" /* g3 0 g2 0 g1 0 g0 0 */ + "punpckhwd %%mm2,%%mm4\n" /* 0 0 g3 0 0 0 g2 0 */ + "por %%mm0, %%mm4\n" /* 0 r3 g3 b3 0 r2 g2 b2 */ + "movq %%mm4,8(%3)\n" /* wrote out ! row1 */ + + /* fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */ + /* this can be done "destructive" */ + "pxor %%mm2,%%mm2\n" /* 0 0 0 0 0 0 0 0 */ + "punpckhbw %%mm2,%%mm6\n" /* 0 R3 0 R2 0 R1 0 R0 */ + "punpckhbw %%mm1,%%mm5\n" /* G3 B3 G2 B2 G1 B1 G0 B0 */ + "movq %%mm5,%%mm1\n" /* G3 B3 G2 B2 G1 B1 G0 B0 */ + "punpcklwd %%mm6,%%mm1\n" /* 0 R1 G1 B1 0 R0 G0 B0 */ + "movq %%mm1,(%5)\n" /* wrote out ! row2 */ + "punpckhwd %%mm6,%%mm5\n" /* 0 R3 G3 B3 0 R2 G2 B2 */ + "movq %%mm5,8(%5)\n" /* wrote out ! row2 */ + + "addl $4,%2\n" /* lum+4 */ + "leal 16(%3),%3\n" /* row1+16 */ + "leal 16(%5),%5\n" /* row2+16 */ + "addl $2,(%%esp)\n" /* cr+2 */ + "addl $2,%1\n" /* cb+2 */ + + "addl $4,%6\n" /* x+4 */ + "cmpl %4,%6\n" + + "jl 1b\n" + "addl %4,%2\n" /* lum += cols */ + "addl %8,%3\n" /* row1+= mod */ + "addl %8,%5\n" /* row2+= mod */ + "movl $0,%6\n" /* x=0 */ + "cmpl %7,%2\n" + "jl 1b\n" + + "addl $4,%%esp\n" /* get rid of the stack slot we reserved. */ + "emms\n" /* reset MMX registers. */ + : + : "m" (cr), "r"(cb),"r"(lum), + "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod), + "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB), + "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB), + "m"(MMX_UbluRGB) + ); +} + +void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod ) +{ + Uint16 *row1; + Uint16 *row2; + + unsigned char* y = lum +cols*rows; /* Pointer to the end */ + int x = 0; + row1 = (Uint16 *)out; /* 16 bit target */ + row2 = (Uint16 *)out+cols+mod; /* start of second row */ + mod = (mod+cols+mod)*2; /* increment for row1 in byte */ + + __asm__ __volatile__( + /* tap dance to workaround the inability to use %%ebx at will... */ + /* move one thing to the stack... */ + "pushl $0\n" /* save a slot on the stack. */ + "pushl %%ebx\n" /* save %%ebx. */ + "movl %0, %%ebx\n" /* put the thing in ebx. */ + "movl %%ebx, 4(%%esp)\n" /* put the thing in the stack slot. */ + "popl %%ebx\n" /* get back %%ebx (the PIC register). */ + + ".align 8\n" + "1:\n" + + "movd (%1), %%mm0\n" /* 4 Cb 0 0 0 0 u3 u2 u1 u0 */ + "pxor %%mm7, %%mm7\n" + "pushl %%ebx\n" + "movl 4(%%esp), %%ebx\n" + "movd (%%ebx), %%mm1\n" /* 4 Cr 0 0 0 0 v3 v2 v1 v0 */ + "popl %%ebx\n" + + "punpcklbw %%mm7, %%mm0\n" /* 4 W cb 0 u3 0 u2 0 u1 0 u0 */ + "punpcklbw %%mm7, %%mm1\n" /* 4 W cr 0 v3 0 v2 0 v1 0 v0 */ + "psubw %9, %%mm0\n" + "psubw %9, %%mm1\n" + "movq %%mm0, %%mm2\n" /* Cb 0 u3 0 u2 0 u1 0 u0 */ + "movq %%mm1, %%mm3\n" /* Cr */ + "pmullw %10, %%mm2\n" /* Cb2green 0 R3 0 R2 0 R1 0 R0 */ + "movq (%2), %%mm6\n" /* L1 l7 L6 L5 L4 L3 L2 L1 L0 */ + "pmullw %11, %%mm0\n" /* Cb2blue */ + "pand %12, %%mm6\n" /* L1 00 L6 00 L4 00 L2 00 L0 */ + "pmullw %13, %%mm3\n" /* Cr2green */ + "movq (%2), %%mm7\n" /* L2 */ + "pmullw %14, %%mm1\n" /* Cr2red */ + "psrlw $8, %%mm7\n" /* L2 00 L7 00 L5 00 L3 00 L1 */ + "pmullw %15, %%mm6\n" /* lum1 */ + "paddw %%mm3, %%mm2\n" /* Cb2green + Cr2green == green */ + "pmullw %15, %%mm7\n" /* lum2 */ + + "movq %%mm6, %%mm4\n" /* lum1 */ + "paddw %%mm0, %%mm6\n" /* lum1 +blue 00 B6 00 B4 00 B2 00 B0 */ + "movq %%mm4, %%mm5\n" /* lum1 */ + "paddw %%mm1, %%mm4\n" /* lum1 +red 00 R6 00 R4 00 R2 00 R0 */ + "paddw %%mm2, %%mm5\n" /* lum1 +green 00 G6 00 G4 00 G2 00 G0 */ + "psraw $6, %%mm4\n" /* R1 0 .. 64 */ + "movq %%mm7, %%mm3\n" /* lum2 00 L7 00 L5 00 L3 00 L1 */ + "psraw $6, %%mm5\n" /* G1 - .. + */ + "paddw %%mm0, %%mm7\n" /* Lum2 +blue 00 B7 00 B5 00 B3 00 B1 */ + "psraw $6, %%mm6\n" /* B1 0 .. 64 */ + "packuswb %%mm4, %%mm4\n" /* R1 R1 */ + "packuswb %%mm5, %%mm5\n" /* G1 G1 */ + "packuswb %%mm6, %%mm6\n" /* B1 B1 */ + "punpcklbw %%mm4, %%mm4\n" + "punpcklbw %%mm5, %%mm5\n" + + "pand %16, %%mm4\n" + "psllw $3, %%mm5\n" /* GREEN 1 */ + "punpcklbw %%mm6, %%mm6\n" + "pand %17, %%mm5\n" + "pand %16, %%mm6\n" + "por %%mm5, %%mm4\n" /* */ + "psrlw $11, %%mm6\n" /* BLUE 1 */ + "movq %%mm3, %%mm5\n" /* lum2 */ + "paddw %%mm1, %%mm3\n" /* lum2 +red 00 R7 00 R5 00 R3 00 R1 */ + "paddw %%mm2, %%mm5\n" /* lum2 +green 00 G7 00 G5 00 G3 00 G1 */ + "psraw $6, %%mm3\n" /* R2 */ + "por %%mm6, %%mm4\n" /* MM4 */ + "psraw $6, %%mm5\n" /* G2 */ + "movq (%2, %4), %%mm6\n" /* L3 load lum2 */ + "psraw $6, %%mm7\n" + "packuswb %%mm3, %%mm3\n" + "packuswb %%mm5, %%mm5\n" + "packuswb %%mm7, %%mm7\n" + "pand %12, %%mm6\n" /* L3 */ + "punpcklbw %%mm3, %%mm3\n" + "punpcklbw %%mm5, %%mm5\n" + "pmullw %15, %%mm6\n" /* lum3 */ + "punpcklbw %%mm7, %%mm7\n" + "psllw $3, %%mm5\n" /* GREEN 2 */ + "pand %16, %%mm7\n" + "pand %16, %%mm3\n" + "psrlw $11, %%mm7\n" /* BLUE 2 */ + "pand %17, %%mm5\n" + "por %%mm7, %%mm3\n" + "movq (%2,%4), %%mm7\n" /* L4 load lum2 */ + "por %%mm5, %%mm3\n" + "psrlw $8, %%mm7\n" /* L4 */ + "movq %%mm4, %%mm5\n" + "punpcklwd %%mm3, %%mm4\n" + "pmullw %15, %%mm7\n" /* lum4 */ + "punpckhwd %%mm3, %%mm5\n" + + "movq %%mm4, (%3)\n" /* write row1 */ + "movq %%mm5, 8(%3)\n" /* write row1 */ + + "movq %%mm6, %%mm4\n" /* Lum3 */ + "paddw %%mm0, %%mm6\n" /* Lum3 +blue */ + + "movq %%mm4, %%mm5\n" /* Lum3 */ + "paddw %%mm1, %%mm4\n" /* Lum3 +red */ + "paddw %%mm2, %%mm5\n" /* Lum3 +green */ + "psraw $6, %%mm4\n" + "movq %%mm7, %%mm3\n" /* Lum4 */ + "psraw $6, %%mm5\n" + "paddw %%mm0, %%mm7\n" /* Lum4 +blue */ + "psraw $6, %%mm6\n" /* Lum3 +blue */ + "movq %%mm3, %%mm0\n" /* Lum4 */ + "packuswb %%mm4, %%mm4\n" + "paddw %%mm1, %%mm3\n" /* Lum4 +red */ + "packuswb %%mm5, %%mm5\n" + "paddw %%mm2, %%mm0\n" /* Lum4 +green */ + "packuswb %%mm6, %%mm6\n" + "punpcklbw %%mm4, %%mm4\n" + "punpcklbw %%mm5, %%mm5\n" + "punpcklbw %%mm6, %%mm6\n" + "psllw $3, %%mm5\n" /* GREEN 3 */ + "pand %16, %%mm4\n" + "psraw $6, %%mm3\n" /* psr 6 */ + "psraw $6, %%mm0\n" + "pand %16, %%mm6\n" /* BLUE */ + "pand %17, %%mm5\n" + "psrlw $11, %%mm6\n" /* BLUE 3 */ + "por %%mm5, %%mm4\n" + "psraw $6, %%mm7\n" + "por %%mm6, %%mm4\n" + "packuswb %%mm3, %%mm3\n" + "packuswb %%mm0, %%mm0\n" + "packuswb %%mm7, %%mm7\n" + "punpcklbw %%mm3, %%mm3\n" + "punpcklbw %%mm0, %%mm0\n" + "punpcklbw %%mm7, %%mm7\n" + "pand %16, %%mm3\n" + "pand %16, %%mm7\n" /* BLUE */ + "psllw $3, %%mm0\n" /* GREEN 4 */ + "psrlw $11, %%mm7\n" + "pand %17, %%mm0\n" + "por %%mm7, %%mm3\n" + "por %%mm0, %%mm3\n" + + "movq %%mm4, %%mm5\n" + + "punpcklwd %%mm3, %%mm4\n" + "punpckhwd %%mm3, %%mm5\n" + + "movq %%mm4, (%5)\n" + "movq %%mm5, 8(%5)\n" + + "addl $8, %6\n" + "addl $8, %2\n" + "addl $4, (%%esp)\n" + "addl $4, %1\n" + "cmpl %4, %6\n" + "leal 16(%3), %3\n" + "leal 16(%5),%5\n" /* row2+16 */ + + "jl 1b\n" + "addl %4, %2\n" /* lum += cols */ + "addl %8, %3\n" /* row1+= mod */ + "addl %8, %5\n" /* row2+= mod */ + "movl $0, %6\n" /* x=0 */ + "cmpl %7, %2\n" + "jl 1b\n" + "addl $4, %%esp\n" /* get rid of the stack slot we reserved. */ + "emms\n" + : + : "m" (cr), "r"(cb),"r"(lum), + "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod), + "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5), + "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5), + "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565) + ); +} + +/* *INDENT-ON* */ + +#endif /* GCC3 i386 inline assembly */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c new file mode 100644 index 0000000000..bb235b0a2b --- /dev/null +++ b/src/render/SDL_yuv_sw.c @@ -0,0 +1,1357 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* This is the software implementation of the YUV texture support */ + +/* This code was derived from code carrying the following copyright notices: + + * Copyright (c) 1995 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + + * Copyright (c) 1995 Erik Corry + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, + * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF + * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" + * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, + * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + + * Portions of this software Copyright (c) 1995 Brown University. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement + * is hereby granted, provided that the above copyright notice and the + * following two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN + * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" + * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, + * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "SDL_assert.h" +#include "SDL_video.h" +#include "SDL_cpuinfo.h" +#include "SDL_yuv_sw_c.h" + + +/* The colorspace conversion functions */ + +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES +extern void Color565DitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod); +extern void ColorRGBDitherYV12MMX1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod); +#endif + +static void +Color16DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned short *row1; + unsigned short *row2; + unsigned char *lum2; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + row1 = (unsigned short *) out; + row2 = row1 + cols + mod; + lum2 = lum + cols; + + mod += cols + mod; + + y = rows / 2; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + ++cr; + ++cb; + + L = *lum++; + *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + + L = *lum++; + *row1++ = (unsigned short) (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + + + /* Now, do second row. */ + + L = *lum2++; + *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + + L = *lum2++; + *row2++ = (unsigned short) (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + } + + /* + * These values are at the start of the next line, (due + * to the ++'s above),but they need to be at the start + * of the line after that. + */ + lum += cols; + lum2 += cols; + row1 += mod; + row2 += mod; + } +} + +static void +Color24DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int value; + unsigned char *row1; + unsigned char *row2; + unsigned char *lum2; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + row1 = out; + row2 = row1 + cols * 3 + mod * 3; + lum2 = lum + cols; + + mod += cols + mod; + mod *= 3; + + y = rows / 2; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + ++cr; + ++cb; + + L = *lum++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + *row1++ = (value) & 0xFF; + *row1++ = (value >> 8) & 0xFF; + *row1++ = (value >> 16) & 0xFF; + + L = *lum++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + *row1++ = (value) & 0xFF; + *row1++ = (value >> 8) & 0xFF; + *row1++ = (value >> 16) & 0xFF; + + + /* Now, do second row. */ + + L = *lum2++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + *row2++ = (value) & 0xFF; + *row2++ = (value >> 8) & 0xFF; + *row2++ = (value >> 16) & 0xFF; + + L = *lum2++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + *row2++ = (value) & 0xFF; + *row2++ = (value >> 8) & 0xFF; + *row2++ = (value >> 16) & 0xFF; + } + + /* + * These values are at the start of the next line, (due + * to the ++'s above),but they need to be at the start + * of the line after that. + */ + lum += cols; + lum2 += cols; + row1 += mod; + row2 += mod; + } +} + +static void +Color32DitherYV12Mod1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int *row1; + unsigned int *row2; + unsigned char *lum2; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + row1 = (unsigned int *) out; + row2 = row1 + cols + mod; + lum2 = lum + cols; + + mod += cols + mod; + + y = rows / 2; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + ++cr; + ++cb; + + L = *lum++; + *row1++ = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + + L = *lum++; + *row1++ = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + + + /* Now, do second row. */ + + L = *lum2++; + *row2++ = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + + L = *lum2++; + *row2++ = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + } + + /* + * These values are at the start of the next line, (due + * to the ++'s above),but they need to be at the start + * of the line after that. + */ + lum += cols; + lum2 += cols; + row1 += mod; + row2 += mod; + } +} + +/* + * In this function I make use of a nasty trick. The tables have the lower + * 16 bits replicated in the upper 16. This means I can write ints and get + * the horisontal doubling for free (almost). + */ +static void +Color16DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int *row1 = (unsigned int *) out; + const int next_row = cols + (mod / 2); + unsigned int *row2 = row1 + 2 * next_row; + unsigned char *lum2; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + lum2 = lum + cols; + + mod = (next_row * 3) + (mod / 2); + + y = rows / 2; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + ++cr; + ++cb; + + L = *lum++; + row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + row1++; + + L = *lum++; + row1[0] = row1[next_row] = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + row1++; + + + /* Now, do second row. */ + + L = *lum2++; + row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + row2++; + + L = *lum2++; + row2[0] = row2[next_row] = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + row2++; + } + + /* + * These values are at the start of the next line, (due + * to the ++'s above),but they need to be at the start + * of the line after that. + */ + lum += cols; + lum2 += cols; + row1 += mod; + row2 += mod; + } +} + +static void +Color24DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int value; + unsigned char *row1 = out; + const int next_row = (cols * 2 + mod) * 3; + unsigned char *row2 = row1 + 2 * next_row; + unsigned char *lum2; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + lum2 = lum + cols; + + mod = next_row * 3 + mod * 3; + + y = rows / 2; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + ++cr; + ++cb; + + L = *lum++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] = + row1[next_row + 3 + 0] = (value) & 0xFF; + row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] = + row1[next_row + 3 + 1] = (value >> 8) & 0xFF; + row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] = + row1[next_row + 3 + 2] = (value >> 16) & 0xFF; + row1 += 2 * 3; + + L = *lum++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row1[0 + 0] = row1[3 + 0] = row1[next_row + 0] = + row1[next_row + 3 + 0] = (value) & 0xFF; + row1[0 + 1] = row1[3 + 1] = row1[next_row + 1] = + row1[next_row + 3 + 1] = (value >> 8) & 0xFF; + row1[0 + 2] = row1[3 + 2] = row1[next_row + 2] = + row1[next_row + 3 + 2] = (value >> 16) & 0xFF; + row1 += 2 * 3; + + + /* Now, do second row. */ + + L = *lum2++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] = + row2[next_row + 3 + 0] = (value) & 0xFF; + row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] = + row2[next_row + 3 + 1] = (value >> 8) & 0xFF; + row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] = + row2[next_row + 3 + 2] = (value >> 16) & 0xFF; + row2 += 2 * 3; + + L = *lum2++; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row2[0 + 0] = row2[3 + 0] = row2[next_row + 0] = + row2[next_row + 3 + 0] = (value) & 0xFF; + row2[0 + 1] = row2[3 + 1] = row2[next_row + 1] = + row2[next_row + 3 + 1] = (value >> 8) & 0xFF; + row2[0 + 2] = row2[3 + 2] = row2[next_row + 2] = + row2[next_row + 3 + 2] = (value >> 16) & 0xFF; + row2 += 2 * 3; + } + + /* + * These values are at the start of the next line, (due + * to the ++'s above),but they need to be at the start + * of the line after that. + */ + lum += cols; + lum2 += cols; + row1 += mod; + row2 += mod; + } +} + +static void +Color32DitherYV12Mod2X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int *row1 = (unsigned int *) out; + const int next_row = cols * 2 + mod; + unsigned int *row2 = row1 + 2 * next_row; + unsigned char *lum2; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + lum2 = lum + cols; + + mod = (next_row * 3) + mod; + + y = rows / 2; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + ++cr; + ++cb; + + L = *lum++; + row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] = + (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row1 += 2; + + L = *lum++; + row1[0] = row1[1] = row1[next_row] = row1[next_row + 1] = + (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row1 += 2; + + + /* Now, do second row. */ + + L = *lum2++; + row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] = + (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row2 += 2; + + L = *lum2++; + row2[0] = row2[1] = row2[next_row] = row2[next_row + 1] = + (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row2 += 2; + } + + /* + * These values are at the start of the next line, (due + * to the ++'s above),but they need to be at the start + * of the line after that. + */ + lum += cols; + lum2 += cols; + row1 += mod; + row2 += mod; + } +} + +static void +Color16DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned short *row; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + row = (unsigned short *) out; + + y = rows; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + cr += 4; + cb += 4; + + L = *lum; + lum += 2; + *row++ = (unsigned short) (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + + L = *lum; + lum += 2; + *row++ = (unsigned short) (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + + } + + row += mod; + } +} + +static void +Color24DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int value; + unsigned char *row; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + row = (unsigned char *) out; + mod *= 3; + y = rows; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + cr += 4; + cb += 4; + + L = *lum; + lum += 2; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + *row++ = (value) & 0xFF; + *row++ = (value >> 8) & 0xFF; + *row++ = (value >> 16) & 0xFF; + + L = *lum; + lum += 2; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + *row++ = (value) & 0xFF; + *row++ = (value >> 8) & 0xFF; + *row++ = (value >> 16) & 0xFF; + + } + row += mod; + } +} + +static void +Color32DitherYUY2Mod1X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int *row; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + row = (unsigned int *) out; + y = rows; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + cr += 4; + cb += 4; + + L = *lum; + lum += 2; + *row++ = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + + L = *lum; + lum += 2; + *row++ = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + + + } + row += mod; + } +} + +/* + * In this function I make use of a nasty trick. The tables have the lower + * 16 bits replicated in the upper 16. This means I can write ints and get + * the horisontal doubling for free (almost). + */ +static void +Color16DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int *row = (unsigned int *) out; + const int next_row = cols + (mod / 2); + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + + y = rows; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + cr += 4; + cb += 4; + + L = *lum; + lum += 2; + row[0] = row[next_row] = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + row++; + + L = *lum; + lum += 2; + row[0] = row[next_row] = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | + rgb_2_pix[L + cb_b]); + row++; + + } + row += next_row; + } +} + +static void +Color24DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int value; + unsigned char *row = out; + const int next_row = (cols * 2 + mod) * 3; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + y = rows; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + cr += 4; + cb += 4; + + L = *lum; + lum += 2; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row[0 + 0] = row[3 + 0] = row[next_row + 0] = + row[next_row + 3 + 0] = (value) & 0xFF; + row[0 + 1] = row[3 + 1] = row[next_row + 1] = + row[next_row + 3 + 1] = (value >> 8) & 0xFF; + row[0 + 2] = row[3 + 2] = row[next_row + 2] = + row[next_row + 3 + 2] = (value >> 16) & 0xFF; + row += 2 * 3; + + L = *lum; + lum += 2; + value = (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row[0 + 0] = row[3 + 0] = row[next_row + 0] = + row[next_row + 3 + 0] = (value) & 0xFF; + row[0 + 1] = row[3 + 1] = row[next_row + 1] = + row[next_row + 3 + 1] = (value >> 8) & 0xFF; + row[0 + 2] = row[3 + 2] = row[next_row + 2] = + row[next_row + 3 + 2] = (value >> 16) & 0xFF; + row += 2 * 3; + + } + row += next_row; + } +} + +static void +Color32DitherYUY2Mod2X(int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod) +{ + unsigned int *row = (unsigned int *) out; + const int next_row = cols * 2 + mod; + int x, y; + int cr_r; + int crb_g; + int cb_b; + int cols_2 = cols / 2; + mod += mod; + y = rows; + while (y--) { + x = cols_2; + while (x--) { + register int L; + + cr_r = 0 * 768 + 256 + colortab[*cr + 0 * 256]; + crb_g = 1 * 768 + 256 + colortab[*cr + 1 * 256] + + colortab[*cb + 2 * 256]; + cb_b = 2 * 768 + 256 + colortab[*cb + 3 * 256]; + cr += 4; + cb += 4; + + L = *lum; + lum += 2; + row[0] = row[1] = row[next_row] = row[next_row + 1] = + (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row += 2; + + L = *lum; + lum += 2; + row[0] = row[1] = row[next_row] = row[next_row + 1] = + (rgb_2_pix[L + cr_r] | + rgb_2_pix[L + crb_g] | rgb_2_pix[L + cb_b]); + row += 2; + + + } + + row += next_row; + } +} + +/* + * How many 1 bits are there in the Uint32. + * Low performance, do not call often. + */ +static int +number_of_bits_set(Uint32 a) +{ + if (!a) + return 0; + if (a & 1) + return 1 + number_of_bits_set(a >> 1); + return (number_of_bits_set(a >> 1)); +} + +/* + * How many 0 bits are there at least significant end of Uint32. + * Low performance, do not call often. + */ +static int +free_bits_at_bottom(Uint32 a) +{ + /* assume char is 8 bits */ + if (!a) + return sizeof(Uint32) * 8; + if (((Sint32) a) & 1l) + return 0; + return 1 + free_bits_at_bottom(a >> 1); +} + +static int +SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format) +{ + Uint32 *r_2_pix_alloc; + Uint32 *g_2_pix_alloc; + Uint32 *b_2_pix_alloc; + int i; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + if (!SDL_PixelFormatEnumToMasks + (target_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) || bpp < 15) { + return SDL_SetError("Unsupported YUV destination format"); + } + + swdata->target_format = target_format; + r_2_pix_alloc = &swdata->rgb_2_pix[0 * 768]; + g_2_pix_alloc = &swdata->rgb_2_pix[1 * 768]; + b_2_pix_alloc = &swdata->rgb_2_pix[2 * 768]; + + /* + * Set up entries 0-255 in rgb-to-pixel value tables. + */ + for (i = 0; i < 256; ++i) { + r_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Rmask)); + r_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Rmask); + r_2_pix_alloc[i + 256] |= Amask; + g_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Gmask)); + g_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Gmask); + g_2_pix_alloc[i + 256] |= Amask; + b_2_pix_alloc[i + 256] = i >> (8 - number_of_bits_set(Bmask)); + b_2_pix_alloc[i + 256] <<= free_bits_at_bottom(Bmask); + b_2_pix_alloc[i + 256] |= Amask; + } + + /* + * If we have 16-bit output depth, then we double the value + * in the top word. This means that we can write out both + * pixels in the pixel doubling mode with one op. It is + * harmless in the normal case as storing a 32-bit value + * through a short pointer will lose the top bits anyway. + */ + if (SDL_BYTESPERPIXEL(target_format) == 2) { + for (i = 0; i < 256; ++i) { + r_2_pix_alloc[i + 256] |= (r_2_pix_alloc[i + 256]) << 16; + g_2_pix_alloc[i + 256] |= (g_2_pix_alloc[i + 256]) << 16; + b_2_pix_alloc[i + 256] |= (b_2_pix_alloc[i + 256]) << 16; + } + } + + /* + * Spread out the values we have to the rest of the array so that + * we do not need to check for overflow. + */ + for (i = 0; i < 256; ++i) { + r_2_pix_alloc[i] = r_2_pix_alloc[256]; + r_2_pix_alloc[i + 512] = r_2_pix_alloc[511]; + g_2_pix_alloc[i] = g_2_pix_alloc[256]; + g_2_pix_alloc[i + 512] = g_2_pix_alloc[511]; + b_2_pix_alloc[i] = b_2_pix_alloc[256]; + b_2_pix_alloc[i + 512] = b_2_pix_alloc[511]; + } + + /* You have chosen wisely... */ + switch (swdata->format) { + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + if (SDL_BYTESPERPIXEL(target_format) == 2) { +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES + /* inline assembly functions */ + if (SDL_HasMMX() && (Rmask == 0xF800) && + (Gmask == 0x07E0) && (Bmask == 0x001F) + && (swdata->w & 15) == 0) { +/*printf("Using MMX 16-bit 565 dither\n");*/ + swdata->Display1X = Color565DitherYV12MMX1X; + } else { +/*printf("Using C 16-bit dither\n");*/ + swdata->Display1X = Color16DitherYV12Mod1X; + } +#else + swdata->Display1X = Color16DitherYV12Mod1X; +#endif + swdata->Display2X = Color16DitherYV12Mod2X; + } + if (SDL_BYTESPERPIXEL(target_format) == 3) { + swdata->Display1X = Color24DitherYV12Mod1X; + swdata->Display2X = Color24DitherYV12Mod2X; + } + if (SDL_BYTESPERPIXEL(target_format) == 4) { +#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES + /* inline assembly functions */ + if (SDL_HasMMX() && (Rmask == 0x00FF0000) && + (Gmask == 0x0000FF00) && + (Bmask == 0x000000FF) && (swdata->w & 15) == 0) { +/*printf("Using MMX 32-bit dither\n");*/ + swdata->Display1X = ColorRGBDitherYV12MMX1X; + } else { +/*printf("Using C 32-bit dither\n");*/ + swdata->Display1X = Color32DitherYV12Mod1X; + } +#else + swdata->Display1X = Color32DitherYV12Mod1X; +#endif + swdata->Display2X = Color32DitherYV12Mod2X; + } + break; + case SDL_PIXELFORMAT_YUY2: + case SDL_PIXELFORMAT_UYVY: + case SDL_PIXELFORMAT_YVYU: + if (SDL_BYTESPERPIXEL(target_format) == 2) { + swdata->Display1X = Color16DitherYUY2Mod1X; + swdata->Display2X = Color16DitherYUY2Mod2X; + } + if (SDL_BYTESPERPIXEL(target_format) == 3) { + swdata->Display1X = Color24DitherYUY2Mod1X; + swdata->Display2X = Color24DitherYUY2Mod2X; + } + if (SDL_BYTESPERPIXEL(target_format) == 4) { + swdata->Display1X = Color32DitherYUY2Mod1X; + swdata->Display2X = Color32DitherYUY2Mod2X; + } + break; + default: + /* We should never get here (caught above) */ + break; + } + + if (swdata->display) { + SDL_FreeSurface(swdata->display); + swdata->display = NULL; + } + return 0; +} + +SDL_SW_YUVTexture * +SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) +{ + SDL_SW_YUVTexture *swdata; + int *Cr_r_tab; + int *Cr_g_tab; + int *Cb_g_tab; + int *Cb_b_tab; + int i; + int CR, CB; + + switch (format) { + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + case SDL_PIXELFORMAT_YUY2: + case SDL_PIXELFORMAT_UYVY: + case SDL_PIXELFORMAT_YVYU: + break; + default: + SDL_SetError("Unsupported YUV format"); + return NULL; + } + + swdata = (SDL_SW_YUVTexture *) SDL_calloc(1, sizeof(*swdata)); + if (!swdata) { + SDL_OutOfMemory(); + return NULL; + } + + swdata->format = format; + swdata->target_format = SDL_PIXELFORMAT_UNKNOWN; + swdata->w = w; + swdata->h = h; + swdata->pixels = (Uint8 *) SDL_malloc(w * h * 2); + swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int)); + swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32)); + if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) { + SDL_SW_DestroyYUVTexture(swdata); + SDL_OutOfMemory(); + return NULL; + } + + /* Generate the tables for the display surface */ + Cr_r_tab = &swdata->colortab[0 * 256]; + Cr_g_tab = &swdata->colortab[1 * 256]; + Cb_g_tab = &swdata->colortab[2 * 256]; + Cb_b_tab = &swdata->colortab[3 * 256]; + for (i = 0; i < 256; i++) { + /* Gamma correction (luminescence table) and chroma correction + would be done here. See the Berkeley mpeg_play sources. + */ + CB = CR = (i - 128); + Cr_r_tab[i] = (int) ((0.419 / 0.299) * CR); + Cr_g_tab[i] = (int) (-(0.299 / 0.419) * CR); + Cb_g_tab[i] = (int) (-(0.114 / 0.331) * CB); + Cb_b_tab[i] = (int) ((0.587 / 0.331) * CB); + } + + /* Find the pitch and offset values for the overlay */ + switch (format) { + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + swdata->pitches[0] = w; + swdata->pitches[1] = swdata->pitches[0] / 2; + swdata->pitches[2] = swdata->pitches[0] / 2; + swdata->planes[0] = swdata->pixels; + swdata->planes[1] = swdata->planes[0] + swdata->pitches[0] * h; + swdata->planes[2] = swdata->planes[1] + swdata->pitches[1] * h / 2; + break; + case SDL_PIXELFORMAT_YUY2: + case SDL_PIXELFORMAT_UYVY: + case SDL_PIXELFORMAT_YVYU: + swdata->pitches[0] = w * 2; + swdata->planes[0] = swdata->pixels; + break; + default: + SDL_assert(0 && "We should never get here (caught above)"); + break; + } + + /* We're all done.. */ + return (swdata); +} + +int +SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels, + int *pitch) +{ + *pixels = swdata->planes[0]; + *pitch = swdata->pitches[0]; + return 0; +} + +int +SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, + const void *pixels, int pitch) +{ + switch (swdata->format) { + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + if (rect->x == 0 && rect->y == 0 && + rect->w == swdata->w && rect->h == swdata->h) { + SDL_memcpy(swdata->pixels, pixels, + (swdata->h * swdata->w) + (swdata->h * swdata->w) / 2); + } else { + Uint8 *src, *dst; + int row; + size_t length; + + /* Copy the Y plane */ + src = (Uint8 *) pixels; + dst = swdata->pixels + rect->y * swdata->w + rect->x; + length = rect->w; + for (row = 0; row < rect->h; ++row) { + SDL_memcpy(dst, src, length); + src += pitch; + dst += swdata->w; + } + + /* Copy the next plane */ + src = (Uint8 *) pixels + rect->h * pitch; + dst = swdata->pixels + swdata->h * swdata->w; + dst += rect->y/2 * swdata->w/2 + rect->x/2; + length = rect->w / 2; + for (row = 0; row < rect->h/2; ++row) { + SDL_memcpy(dst, src, length); + src += pitch/2; + dst += swdata->w/2; + } + + /* Copy the next plane */ + src = (Uint8 *) pixels + rect->h * pitch + (rect->h * pitch) / 4; + dst = swdata->pixels + swdata->h * swdata->w + + (swdata->h * swdata->w) / 4; + dst += rect->y/2 * swdata->w/2 + rect->x/2; + length = rect->w / 2; + for (row = 0; row < rect->h/2; ++row) { + SDL_memcpy(dst, src, length); + src += pitch/2; + dst += swdata->w/2; + } + } + break; + case SDL_PIXELFORMAT_YUY2: + case SDL_PIXELFORMAT_UYVY: + case SDL_PIXELFORMAT_YVYU: + { + Uint8 *src, *dst; + int row; + size_t length; + + src = (Uint8 *) pixels; + dst = + swdata->planes[0] + rect->y * swdata->pitches[0] + + rect->x * 2; + length = rect->w * 2; + for (row = 0; row < rect->h; ++row) { + SDL_memcpy(dst, src, length); + src += pitch; + dst += swdata->pitches[0]; + } + } + break; + } + return 0; +} + +int +SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, + void **pixels, int *pitch) +{ + switch (swdata->format) { + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + if (rect + && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w + || rect->h != swdata->h)) { + return SDL_SetError + ("YV12 and IYUV textures only support full surface locks"); + } + break; + } + + if (rect) { + *pixels = swdata->planes[0] + rect->y * swdata->pitches[0] + rect->x * 2; + } else { + *pixels = swdata->planes[0]; + } + *pitch = swdata->pitches[0]; + return 0; +} + +void +SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata) +{ +} + +int +SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect, + Uint32 target_format, int w, int h, void *pixels, + int pitch) +{ + int stretch; + int scale_2x; + Uint8 *lum, *Cr, *Cb; + int mod; + + /* Make sure we're set up to display in the desired format */ + if (target_format != swdata->target_format) { + if (SDL_SW_SetupYUVDisplay(swdata, target_format) < 0) { + return -1; + } + } + + stretch = 0; + scale_2x = 0; + if (srcrect->x || srcrect->y || srcrect->w < swdata->w + || srcrect->h < swdata->h) { + /* The source rectangle has been clipped. + Using a scratch surface is easier than adding clipped + source support to all the blitters, plus that would + slow them down in the general unclipped case. + */ + stretch = 1; + } else if ((srcrect->w != w) || (srcrect->h != h)) { + if ((w == 2 * srcrect->w) && (h == 2 * srcrect->h)) { + scale_2x = 1; + } else { + stretch = 1; + } + } + if (stretch) { + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + if (swdata->display) { + swdata->display->w = w; + swdata->display->h = h; + swdata->display->pixels = pixels; + swdata->display->pitch = pitch; + } else { + /* This must have succeeded in SDL_SW_SetupYUVDisplay() earlier */ + SDL_PixelFormatEnumToMasks(target_format, &bpp, &Rmask, &Gmask, + &Bmask, &Amask); + swdata->display = + SDL_CreateRGBSurfaceFrom(pixels, w, h, bpp, pitch, Rmask, + Gmask, Bmask, Amask); + if (!swdata->display) { + return (-1); + } + } + if (!swdata->stretch) { + /* This must have succeeded in SDL_SW_SetupYUVDisplay() earlier */ + SDL_PixelFormatEnumToMasks(target_format, &bpp, &Rmask, &Gmask, + &Bmask, &Amask); + swdata->stretch = + SDL_CreateRGBSurface(0, swdata->w, swdata->h, bpp, Rmask, + Gmask, Bmask, Amask); + if (!swdata->stretch) { + return (-1); + } + } + pixels = swdata->stretch->pixels; + pitch = swdata->stretch->pitch; + } + switch (swdata->format) { + case SDL_PIXELFORMAT_YV12: + lum = swdata->planes[0]; + Cr = swdata->planes[1]; + Cb = swdata->planes[2]; + break; + case SDL_PIXELFORMAT_IYUV: + lum = swdata->planes[0]; + Cr = swdata->planes[2]; + Cb = swdata->planes[1]; + break; + case SDL_PIXELFORMAT_YUY2: + lum = swdata->planes[0]; + Cr = lum + 3; + Cb = lum + 1; + break; + case SDL_PIXELFORMAT_UYVY: + lum = swdata->planes[0] + 1; + Cr = lum + 1; + Cb = lum - 1; + break; + case SDL_PIXELFORMAT_YVYU: + lum = swdata->planes[0]; + Cr = lum + 1; + Cb = lum + 3; + break; + default: + return SDL_SetError("Unsupported YUV format in copy"); + } + mod = (pitch / SDL_BYTESPERPIXEL(target_format)); + + if (scale_2x) { + mod -= (swdata->w * 2); + swdata->Display2X(swdata->colortab, swdata->rgb_2_pix, + lum, Cr, Cb, pixels, swdata->h, swdata->w, mod); + } else { + mod -= swdata->w; + swdata->Display1X(swdata->colortab, swdata->rgb_2_pix, + lum, Cr, Cb, pixels, swdata->h, swdata->w, mod); + } + if (stretch) { + SDL_Rect rect = *srcrect; + SDL_SoftStretch(swdata->stretch, &rect, swdata->display, NULL); + } + return 0; +} + +void +SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata) +{ + if (swdata) { + if (swdata->pixels) { + SDL_free(swdata->pixels); + } + if (swdata->colortab) { + SDL_free(swdata->colortab); + } + if (swdata->rgb_2_pix) { + SDL_free(swdata->rgb_2_pix); + } + if (swdata->stretch) { + SDL_FreeSurface(swdata->stretch); + } + if (swdata->display) { + SDL_FreeSurface(swdata->display); + } + SDL_free(swdata); + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_yuv_sw_c.h b/src/render/SDL_yuv_sw_c.h new file mode 100644 index 0000000000..9debacbcf1 --- /dev/null +++ b/src/render/SDL_yuv_sw_c.h @@ -0,0 +1,68 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_video.h" + +/* This is the software implementation of the YUV texture support */ + +struct SDL_SW_YUVTexture +{ + Uint32 format; + Uint32 target_format; + int w, h; + Uint8 *pixels; + int *colortab; + Uint32 *rgb_2_pix; + void (*Display1X) (int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod); + void (*Display2X) (int *colortab, Uint32 * rgb_2_pix, + unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols, int mod); + + /* These are just so we don't have to allocate them separately */ + Uint16 pitches[3]; + Uint8 *planes[3]; + + /* This is a temporary surface in case we have to stretch copy */ + SDL_Surface *stretch; + SDL_Surface *display; +}; + +typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture; + +SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h); +int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels, + int *pitch); +int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, + const void *pixels, int pitch); +int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, + void **pixels, int *pitch); +void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata); +int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect, + Uint32 target_format, int w, int h, void *pixels, + int pitch); +void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c new file mode 100644 index 0000000000..e9fc0ce042 --- /dev/null +++ b/src/render/direct3d/SDL_render_d3d.c @@ -0,0 +1,1844 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED + + +#include "../../core/windows/SDL_windows.h" + +#include "SDL_hints.h" +#include "SDL_loadso.h" +#include "SDL_syswm.h" +#include "../SDL_sysrender.h" +#include + +#if SDL_VIDEO_RENDER_D3D +#define D3D_DEBUG_INFO +#include +#endif + + +typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK; +typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX; +typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3; + +DEFINE_GUID(IID_ID3DXMatrixStack, +0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85); + +#undef INTERFACE +#define INTERFACE ID3DXMatrixStack + +DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Pop)(THIS) PURE; + STDMETHOD(Push)(THIS) PURE; + STDMETHOD(LoadIdentity)(THIS) PURE; + STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE; + STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE; + STDMETHOD(RotateAxis)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + STDMETHOD(RotateAxisLocal)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE; + STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE; + STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE; + STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE; + STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE; +}; + +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define ID3DXMatrixStack_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define ID3DXMatrixStack_AddRef(p) (p)->lpVtbl->AddRef(p) +#define ID3DXMatrixStack_Release(p) (p)->lpVtbl->Release(p) +#define ID3DXMatrixStack_Pop(p) (p)->lpVtbl->Pop(p) +#define ID3DXMatrixStack_Push(p) (p)->lpVtbl->Push(p) +#define ID3DXMatrixStack_LoadIdentity(p) (p)->lpVtbl->LoadIdentity(p) +#define ID3DXMatrixStack_LoadMatrix(p,a) (p)->lpVtbl->LoadMatrix(p,a) +#define ID3DXMatrixStack_MultMatrix(p,a) (p)->lpVtbl->MultMatrix(p,a) +#define ID3DXMatrixStack_MultMatrixLocal(p,a) (p)->lpVtbl->MultMatrixLocal(p,a) +#define ID3DXMatrixStack_RotateAxis(p,a,b) (p)->lpVtbl->RotateAxis(p,a,b) +#define ID3DXMatrixStack_RotateAxisLocal(p,a,b) (p)->lpVtbl->RotateAxisLocal(p,a,b) +#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c) (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c) +#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c) +#define ID3DXMatrixStack_Scale(p,a,b,c) (p)->lpVtbl->Scale(p,a,b,c) +#define ID3DXMatrixStack_ScaleLocal(p,a,b,c) (p)->lpVtbl->ScaleLocal(p,a,b,c) +#define ID3DXMatrixStack_Translate(p,a,b,c) (p)->lpVtbl->Translate(p,a,b,c) +#define ID3DXMatrixStack_TranslateLocal(p,a,b,c) (p)->lpVtbl->TranslateLocal(p,a,b,c) +#define ID3DXMatrixStack_GetTop(p) (p)->lpVtbl->GetTop(p) +#else +#define ID3DXMatrixStack_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define ID3DXMatrixStack_AddRef(p) (p)->AddRef() +#define ID3DXMatrixStack_Release(p) (p)->Release() +#define ID3DXMatrixStack_Pop(p) (p)->Pop() +#define ID3DXMatrixStack_Push(p) (p)->Push() +#define ID3DXMatrixStack_LoadIdentity(p) (p)->LoadIdentity() +#define ID3DXMatrixStack_LoadMatrix(p,a) (p)->LoadMatrix(a) +#define ID3DXMatrixStack_MultMatrix(p,a) (p)->MultMatrix(a) +#define ID3DXMatrixStack_MultMatrixLocal(p,a) (p)->MultMatrixLocal(a) +#define ID3DXMatrixStack_RotateAxis(p,a,b) (p)->RotateAxis(a,b) +#define ID3DXMatrixStack_RotateAxisLocal(p,a,b) (p)->RotateAxisLocal(a,b) +#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c) (p)->RotateYawPitchRollLocal(a,b,c) +#define ID3DXMatrixStack_Scale(p,a,b,c) (p)->Scale(a,b,c) +#define ID3DXMatrixStack_ScaleLocal(p,a,b,c) (p)->ScaleLocal(a,b,c) +#define ID3DXMatrixStack_Translate(p,a,b,c) (p)->Translate(a,b,c) +#define ID3DXMatrixStack_TranslateLocal(p,a,b,c) (p)->TranslateLocal(a,b,c) +#define ID3DXMatrixStack_GetTop(p) (p)->GetTop() +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack); + +#ifdef __cplusplus +} +#endif + +#ifdef ASSEMBLE_SHADER +/************************************************************************** + * ID3DXBuffer: + * ------------ + * The buffer object is used by D3DX to return arbitrary size data. + * + * GetBufferPointer - + * Returns a pointer to the beginning of the buffer. + * + * GetBufferSize - + * Returns the size of the buffer, in bytes. + **************************************************************************/ + +typedef interface ID3DXBuffer ID3DXBuffer; +typedef interface ID3DXBuffer *LPD3DXBUFFER; + +/* {8BA5FB08-5195-40e2-AC58-0D989C3A0102} */ +DEFINE_GUID(IID_ID3DXBuffer, +0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); + +#undef INTERFACE +#define INTERFACE ID3DXBuffer + +typedef interface ID3DXBuffer { + const struct ID3DXBufferVtbl FAR* lpVtbl; +} ID3DXBuffer; +typedef const struct ID3DXBufferVtbl ID3DXBufferVtbl; +const struct ID3DXBufferVtbl +{ + /* IUnknown */ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + /* ID3DXBuffer */ + STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; +}; + +HRESULT WINAPI + D3DXAssembleShader( + LPCSTR pSrcData, + UINT SrcDataLen, + CONST LPVOID* pDefines, + LPVOID pInclude, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs); + +static void PrintShaderData(LPDWORD shader_data, DWORD shader_size) +{ + OutputDebugStringA("const DWORD shader_data[] = {\n\t"); + { + SDL_bool newline = SDL_FALSE; + unsigned i; + for (i = 0; i < shader_size / sizeof(DWORD); ++i) { + char dword[11]; + if (i > 0) { + if ((i%6) == 0) { + newline = SDL_TRUE; + } + if (newline) { + OutputDebugStringA(",\n "); + newline = SDL_FALSE; + } else { + OutputDebugStringA(", "); + } + } + SDL_snprintf(dword, sizeof(dword), "0x%8.8x", shader_data[i]); + OutputDebugStringA(dword); + } + OutputDebugStringA("\n};\n"); + } +} + +#endif /* ASSEMBLE_SHADER */ + + +/* Direct3D renderer implementation */ + +static SDL_Renderer *D3D_CreateRenderer(SDL_Window * window, Uint32 flags); +static void D3D_WindowEvent(SDL_Renderer * renderer, + const SDL_WindowEvent *event); +static int D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, + int pitch); +static int D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch); +static void D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture); +static int D3D_UpdateViewport(SDL_Renderer * renderer); +static int D3D_UpdateClipRect(SDL_Renderer * renderer); +static int D3D_RenderClear(SDL_Renderer * renderer); +static int D3D_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int D3D_RenderDrawLines(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int D3D_RenderFillRects(SDL_Renderer * renderer, + const SDL_FRect * rects, int count); +static int D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect); +static int D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip); +static int D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch); +static void D3D_RenderPresent(SDL_Renderer * renderer); +static void D3D_DestroyTexture(SDL_Renderer * renderer, + SDL_Texture * texture); +static void D3D_DestroyRenderer(SDL_Renderer * renderer); + + +SDL_RenderDriver D3D_RenderDriver = { + D3D_CreateRenderer, + { + "direct3d", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 1, + {SDL_PIXELFORMAT_ARGB8888}, + 0, + 0} +}; + +typedef struct +{ + void* d3dDLL; + IDirect3D9 *d3d; + IDirect3DDevice9 *device; + UINT adapter; + D3DPRESENT_PARAMETERS pparams; + SDL_bool updateSize; + SDL_bool beginScene; + SDL_bool enableSeparateAlphaBlend; + D3DTEXTUREFILTERTYPE scaleMode[8]; + IDirect3DSurface9 *defaultRenderTarget; + IDirect3DSurface9 *currentRenderTarget; + void* d3dxDLL; + ID3DXMatrixStack *matrixStack; + LPDIRECT3DPIXELSHADER9 ps_yuv; +} D3D_RenderData; + +typedef struct +{ + IDirect3DTexture9 *texture; + D3DTEXTUREFILTERTYPE scaleMode; + + /* YV12 texture support */ + SDL_bool yuv; + IDirect3DTexture9 *utexture; + IDirect3DTexture9 *vtexture; + Uint8 *pixels; + int pitch; + SDL_Rect locked_rect; +} D3D_TextureData; + +typedef struct +{ + float x, y, z; + DWORD color; + float u, v; +} Vertex; + +static int +D3D_SetError(const char *prefix, HRESULT result) +{ + const char *error; + + switch (result) { + case D3DERR_WRONGTEXTUREFORMAT: + error = "WRONGTEXTUREFORMAT"; + break; + case D3DERR_UNSUPPORTEDCOLOROPERATION: + error = "UNSUPPORTEDCOLOROPERATION"; + break; + case D3DERR_UNSUPPORTEDCOLORARG: + error = "UNSUPPORTEDCOLORARG"; + break; + case D3DERR_UNSUPPORTEDALPHAOPERATION: + error = "UNSUPPORTEDALPHAOPERATION"; + break; + case D3DERR_UNSUPPORTEDALPHAARG: + error = "UNSUPPORTEDALPHAARG"; + break; + case D3DERR_TOOMANYOPERATIONS: + error = "TOOMANYOPERATIONS"; + break; + case D3DERR_CONFLICTINGTEXTUREFILTER: + error = "CONFLICTINGTEXTUREFILTER"; + break; + case D3DERR_UNSUPPORTEDFACTORVALUE: + error = "UNSUPPORTEDFACTORVALUE"; + break; + case D3DERR_CONFLICTINGRENDERSTATE: + error = "CONFLICTINGRENDERSTATE"; + break; + case D3DERR_UNSUPPORTEDTEXTUREFILTER: + error = "UNSUPPORTEDTEXTUREFILTER"; + break; + case D3DERR_CONFLICTINGTEXTUREPALETTE: + error = "CONFLICTINGTEXTUREPALETTE"; + break; + case D3DERR_DRIVERINTERNALERROR: + error = "DRIVERINTERNALERROR"; + break; + case D3DERR_NOTFOUND: + error = "NOTFOUND"; + break; + case D3DERR_MOREDATA: + error = "MOREDATA"; + break; + case D3DERR_DEVICELOST: + error = "DEVICELOST"; + break; + case D3DERR_DEVICENOTRESET: + error = "DEVICENOTRESET"; + break; + case D3DERR_NOTAVAILABLE: + error = "NOTAVAILABLE"; + break; + case D3DERR_OUTOFVIDEOMEMORY: + error = "OUTOFVIDEOMEMORY"; + break; + case D3DERR_INVALIDDEVICE: + error = "INVALIDDEVICE"; + break; + case D3DERR_INVALIDCALL: + error = "INVALIDCALL"; + break; + case D3DERR_DRIVERINVALIDCALL: + error = "DRIVERINVALIDCALL"; + break; + case D3DERR_WASSTILLDRAWING: + error = "WASSTILLDRAWING"; + break; + default: + error = "UNKNOWN"; + break; + } + return SDL_SetError("%s: %s", prefix, error); +} + +static D3DFORMAT +PixelFormatToD3DFMT(Uint32 format) +{ + switch (format) { + case SDL_PIXELFORMAT_RGB565: + return D3DFMT_R5G6B5; + case SDL_PIXELFORMAT_RGB888: + return D3DFMT_X8R8G8B8; + case SDL_PIXELFORMAT_ARGB8888: + return D3DFMT_A8R8G8B8; + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + return D3DFMT_L8; + default: + return D3DFMT_UNKNOWN; + } +} + +static Uint32 +D3DFMTToPixelFormat(D3DFORMAT format) +{ + switch (format) { + case D3DFMT_R5G6B5: + return SDL_PIXELFORMAT_RGB565; + case D3DFMT_X8R8G8B8: + return SDL_PIXELFORMAT_RGB888; + case D3DFMT_A8R8G8B8: + return SDL_PIXELFORMAT_ARGB8888; + default: + return SDL_PIXELFORMAT_UNKNOWN; + } +} + +static int +D3D_Reset(SDL_Renderer * renderer) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + HRESULT result; + + /* Release the default render target before reset */ + if (data->defaultRenderTarget) { + IDirect3DSurface9_Release(data->defaultRenderTarget); + data->defaultRenderTarget = NULL; + } + + result = IDirect3DDevice9_Reset(data->device, &data->pparams); + if (FAILED(result)) { + if (result == D3DERR_DEVICELOST) { + /* Don't worry about it, we'll reset later... */ + return 0; + } else { + return D3D_SetError("Reset()", result); + } + } + IDirect3DDevice9_SetVertexShader(data->device, NULL); + IDirect3DDevice9_SetFVF(data->device, + D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE, + D3DCULL_NONE); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE); + IDirect3DDevice9_GetRenderTarget(data->device, 0, &data->defaultRenderTarget); + SDL_memset(data->scaleMode, 0xFF, sizeof(data->scaleMode)); + D3D_UpdateViewport(renderer); + return 0; +} + +static int +D3D_ActivateRenderer(SDL_Renderer * renderer) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + HRESULT result; + + if (data->updateSize) { + SDL_Window *window = renderer->window; + int w, h; + + SDL_GetWindowSize(window, &w, &h); + data->pparams.BackBufferWidth = w; + data->pparams.BackBufferHeight = h; + if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) { + data->pparams.BackBufferFormat = + PixelFormatToD3DFMT(SDL_GetWindowPixelFormat(window)); + } else { + data->pparams.BackBufferFormat = D3DFMT_UNKNOWN; + } + if (D3D_Reset(renderer) < 0) { + return -1; + } + + data->updateSize = SDL_FALSE; + } + if (data->beginScene) { + result = IDirect3DDevice9_BeginScene(data->device); + if (result == D3DERR_DEVICELOST) { + if (D3D_Reset(renderer) < 0) { + return -1; + } + result = IDirect3DDevice9_BeginScene(data->device); + } + if (FAILED(result)) { + return D3D_SetError("BeginScene()", result); + } + data->beginScene = SDL_FALSE; + } + return 0; +} + +SDL_Renderer * +D3D_CreateRenderer(SDL_Window * window, Uint32 flags) +{ + SDL_Renderer *renderer; + D3D_RenderData *data; + SDL_SysWMinfo windowinfo; + HRESULT result; + D3DPRESENT_PARAMETERS pparams; + IDirect3DSwapChain9 *chain; + D3DCAPS9 caps; + Uint32 window_flags; + int w, h; + SDL_DisplayMode fullscreen_mode; + D3DMATRIX matrix; + int d3dxVersion; + char d3dxDLLFile[50]; + + renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); + if (!renderer) { + SDL_OutOfMemory(); + return NULL; + } + + data = (D3D_RenderData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + SDL_free(renderer); + SDL_OutOfMemory(); + return NULL; + } + + data->d3dDLL = SDL_LoadObject("D3D9.DLL"); + if (data->d3dDLL) { + IDirect3D9 *(WINAPI * D3DCreate) (UINT SDKVersion); + + D3DCreate = + (IDirect3D9 * (WINAPI *) (UINT)) SDL_LoadFunction(data->d3dDLL, + "Direct3DCreate9"); + if (D3DCreate) { + data->d3d = D3DCreate(D3D_SDK_VERSION); + } + if (!data->d3d) { + SDL_UnloadObject(data->d3dDLL); + data->d3dDLL = NULL; + } + + for (d3dxVersion=50;d3dxVersion>0;d3dxVersion--) { + LPTSTR dllName; + SDL_snprintf(d3dxDLLFile, sizeof(d3dxDLLFile), "D3DX9_%02d.dll", d3dxVersion); + dllName = WIN_UTF8ToString(d3dxDLLFile); + data->d3dxDLL = (void *)LoadLibrary(dllName); /* not using SDL_LoadObject() as we want silently fail - no error message */ + SDL_free(dllName); + if (data->d3dxDLL) { + HRESULT (WINAPI *D3DXCreateMatrixStack) (DWORD Flags, LPD3DXMATRIXSTACK* ppStack); + D3DXCreateMatrixStack = (HRESULT (WINAPI *) (DWORD, LPD3DXMATRIXSTACK*)) SDL_LoadFunction(data->d3dxDLL, "D3DXCreateMatrixStack"); + if (D3DXCreateMatrixStack) { + D3DXCreateMatrixStack(0, &data->matrixStack); + break; + } + } + } + + if (!data->matrixStack) { + if (data->d3dxDLL) SDL_UnloadObject(data->d3dxDLL); + } + } + + + + if (!data->d3d || !data->matrixStack) { + SDL_free(renderer); + SDL_free(data); + SDL_SetError("Unable to create Direct3D interface"); + return NULL; + } + + renderer->WindowEvent = D3D_WindowEvent; + renderer->CreateTexture = D3D_CreateTexture; + renderer->UpdateTexture = D3D_UpdateTexture; + renderer->LockTexture = D3D_LockTexture; + renderer->UnlockTexture = D3D_UnlockTexture; + renderer->SetRenderTarget = D3D_SetRenderTarget; + renderer->UpdateViewport = D3D_UpdateViewport; + renderer->UpdateClipRect = D3D_UpdateClipRect; + renderer->RenderClear = D3D_RenderClear; + renderer->RenderDrawPoints = D3D_RenderDrawPoints; + renderer->RenderDrawLines = D3D_RenderDrawLines; + renderer->RenderFillRects = D3D_RenderFillRects; + renderer->RenderCopy = D3D_RenderCopy; + renderer->RenderCopyEx = D3D_RenderCopyEx; + renderer->RenderReadPixels = D3D_RenderReadPixels; + renderer->RenderPresent = D3D_RenderPresent; + renderer->DestroyTexture = D3D_DestroyTexture; + renderer->DestroyRenderer = D3D_DestroyRenderer; + renderer->info = D3D_RenderDriver.info; + renderer->driverdata = data; + + renderer->info.flags = SDL_RENDERER_ACCELERATED; + + SDL_VERSION(&windowinfo.version); + SDL_GetWindowWMInfo(window, &windowinfo); + + window_flags = SDL_GetWindowFlags(window); + SDL_GetWindowSize(window, &w, &h); + SDL_GetWindowDisplayMode(window, &fullscreen_mode); + + SDL_zero(pparams); + pparams.hDeviceWindow = windowinfo.info.win.window; + pparams.BackBufferWidth = w; + pparams.BackBufferHeight = h; + if (window_flags & SDL_WINDOW_FULLSCREEN) { + pparams.BackBufferFormat = + PixelFormatToD3DFMT(fullscreen_mode.format); + } else { + pparams.BackBufferFormat = D3DFMT_UNKNOWN; + } + pparams.BackBufferCount = 1; + pparams.SwapEffect = D3DSWAPEFFECT_DISCARD; + + if (window_flags & SDL_WINDOW_FULLSCREEN) { + if ( ( window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) == SDL_WINDOW_FULLSCREEN_DESKTOP ) { + pparams.Windowed = TRUE; + pparams.FullScreen_RefreshRateInHz = 0; + } else { + pparams.Windowed = FALSE; + pparams.FullScreen_RefreshRateInHz = + fullscreen_mode.refresh_rate; + } + } else { + pparams.Windowed = TRUE; + pparams.FullScreen_RefreshRateInHz = 0; + } + if (flags & SDL_RENDERER_PRESENTVSYNC) { + pparams.PresentationInterval = D3DPRESENT_INTERVAL_ONE; + } else { + pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; + } + + /* FIXME: Which adapter? */ + data->adapter = D3DADAPTER_DEFAULT; + IDirect3D9_GetDeviceCaps(data->d3d, data->adapter, D3DDEVTYPE_HAL, &caps); + + result = IDirect3D9_CreateDevice(data->d3d, data->adapter, + D3DDEVTYPE_HAL, + pparams.hDeviceWindow, + D3DCREATE_FPU_PRESERVE | ((caps. + DevCaps & + D3DDEVCAPS_HWTRANSFORMANDLIGHT) ? + D3DCREATE_HARDWARE_VERTEXPROCESSING : + D3DCREATE_SOFTWARE_VERTEXPROCESSING), + &pparams, &data->device); + if (FAILED(result)) { + D3D_DestroyRenderer(renderer); + D3D_SetError("CreateDevice()", result); + return NULL; + } + data->beginScene = SDL_TRUE; + SDL_memset(data->scaleMode, 0xFF, sizeof(data->scaleMode)); + + /* Get presentation parameters to fill info */ + result = IDirect3DDevice9_GetSwapChain(data->device, 0, &chain); + if (FAILED(result)) { + D3D_DestroyRenderer(renderer); + D3D_SetError("GetSwapChain()", result); + return NULL; + } + result = IDirect3DSwapChain9_GetPresentParameters(chain, &pparams); + if (FAILED(result)) { + IDirect3DSwapChain9_Release(chain); + D3D_DestroyRenderer(renderer); + D3D_SetError("GetPresentParameters()", result); + return NULL; + } + IDirect3DSwapChain9_Release(chain); + if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) { + renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; + } + data->pparams = pparams; + + IDirect3DDevice9_GetDeviceCaps(data->device, &caps); + renderer->info.max_texture_width = caps.MaxTextureWidth; + renderer->info.max_texture_height = caps.MaxTextureHeight; + if (caps.NumSimultaneousRTs >= 2) { + renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE; + } + + if (caps.PrimitiveMiscCaps & D3DPMISCCAPS_SEPARATEALPHABLEND) { + data->enableSeparateAlphaBlend = SDL_TRUE; + } + + /* Set up parameters for rendering */ + IDirect3DDevice9_SetVertexShader(data->device, NULL); + IDirect3DDevice9_SetFVF(data->device, + D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_ZENABLE, D3DZB_FALSE); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_CULLMODE, + D3DCULL_NONE); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_LIGHTING, FALSE); + /* Enable color modulation by diffuse color */ + IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLOROP, + D3DTOP_MODULATE); + IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG1, + D3DTA_TEXTURE); + IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_COLORARG2, + D3DTA_DIFFUSE); + /* Enable alpha modulation by diffuse alpha */ + IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAOP, + D3DTOP_MODULATE); + IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG1, + D3DTA_TEXTURE); + IDirect3DDevice9_SetTextureStageState(data->device, 0, D3DTSS_ALPHAARG2, + D3DTA_DIFFUSE); + /* Enable separate alpha blend function, if possible */ + if (data->enableSeparateAlphaBlend) { + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SEPARATEALPHABLENDENABLE, TRUE); + } + /* Disable second texture stage, since we're done */ + IDirect3DDevice9_SetTextureStageState(data->device, 1, D3DTSS_COLOROP, + D3DTOP_DISABLE); + IDirect3DDevice9_SetTextureStageState(data->device, 1, D3DTSS_ALPHAOP, + D3DTOP_DISABLE); + + /* Store the default render target */ + IDirect3DDevice9_GetRenderTarget(data->device, 0, &data->defaultRenderTarget ); + data->currentRenderTarget = NULL; + + /* Set an identity world and view matrix */ + matrix.m[0][0] = 1.0f; + matrix.m[0][1] = 0.0f; + matrix.m[0][2] = 0.0f; + matrix.m[0][3] = 0.0f; + matrix.m[1][0] = 0.0f; + matrix.m[1][1] = 1.0f; + matrix.m[1][2] = 0.0f; + matrix.m[1][3] = 0.0f; + matrix.m[2][0] = 0.0f; + matrix.m[2][1] = 0.0f; + matrix.m[2][2] = 1.0f; + matrix.m[2][3] = 0.0f; + matrix.m[3][0] = 0.0f; + matrix.m[3][1] = 0.0f; + matrix.m[3][2] = 0.0f; + matrix.m[3][3] = 1.0f; + IDirect3DDevice9_SetTransform(data->device, D3DTS_WORLD, &matrix); + IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, &matrix); + + if (caps.MaxSimultaneousTextures >= 3) + { +#ifdef ASSEMBLE_SHADER + /* This shader was created by running the following HLSL through the fxc compiler + and then tuning the generated assembly. + + fxc /T fx_4_0 /O3 /Gfa /Fc yuv.fxc yuv.fx + + --- yuv.fx --- + Texture2D g_txY; + Texture2D g_txU; + Texture2D g_txV; + + SamplerState samLinear + { + Filter = ANISOTROPIC; + AddressU = Clamp; + AddressV = Clamp; + MaxAnisotropy = 1; + }; + + struct VS_OUTPUT + { + float2 TextureUV : TEXCOORD0; + }; + + struct PS_OUTPUT + { + float4 RGBAColor : SV_Target; + }; + + PS_OUTPUT YUV420( VS_OUTPUT In ) + { + const float3 offset = {-0.0625, -0.5, -0.5}; + const float3 Rcoeff = {1.164, 0.000, 1.596}; + const float3 Gcoeff = {1.164, -0.391, -0.813}; + const float3 Bcoeff = {1.164, 2.018, 0.000}; + + PS_OUTPUT Output; + float2 TextureUV = In.TextureUV; + + float3 yuv; + yuv.x = g_txY.Sample( samLinear, TextureUV ).r; + yuv.y = g_txU.Sample( samLinear, TextureUV ).r; + yuv.z = g_txV.Sample( samLinear, TextureUV ).r; + + yuv += offset; + Output.RGBAColor.r = dot(yuv, Rcoeff); + Output.RGBAColor.g = dot(yuv, Gcoeff); + Output.RGBAColor.b = dot(yuv, Bcoeff); + Output.RGBAColor.a = 1.0f; + + return Output; + } + + technique10 RenderYUV420 + { + pass P0 + { + SetPixelShader( CompileShader( ps_4_0_level_9_0, YUV420() ) ); + } + } + */ + const char *shader_text = + "ps_2_0\n" + "def c0, -0.0625, -0.5, -0.5, 1\n" + "def c1, 1.16400003, 0, 1.59599996, 0\n" + "def c2, 1.16400003, -0.391000003, -0.813000023, 0\n" + "def c3, 1.16400003, 2.01799989, 0, 0\n" + "dcl t0.xy\n" + "dcl v0.xyzw\n" + "dcl_2d s0\n" + "dcl_2d s1\n" + "dcl_2d s2\n" + "texld r0, t0, s0\n" + "texld r1, t0, s1\n" + "texld r2, t0, s2\n" + "mov r0.y, r1.x\n" + "mov r0.z, r2.x\n" + "add r0.xyz, r0, c0\n" + "dp3 r1.x, r0, c1\n" + "dp3 r1.y, r0, c2\n" + "dp2add r1.z, r0, c3, c3.z\n" /* Logically this is "dp3 r1.z, r0, c3" but the optimizer did its magic */ + "mov r1.w, c0.w\n" + "mul r0, r1, v0\n" /* Not in the HLSL, multiply by vertex color */ + "mov oC0, r0\n" + ; + LPD3DXBUFFER pCode; + LPD3DXBUFFER pErrorMsgs; + LPDWORD shader_data = NULL; + DWORD shader_size = 0; + result = D3DXAssembleShader(shader_text, SDL_strlen(shader_text), NULL, NULL, 0, &pCode, &pErrorMsgs); + if (!FAILED(result)) { + shader_data = (DWORD*)pCode->lpVtbl->GetBufferPointer(pCode); + shader_size = pCode->lpVtbl->GetBufferSize(pCode); + PrintShaderData(shader_data, shader_size); + } else { + const char *error = (const char *)pErrorMsgs->lpVtbl->GetBufferPointer(pErrorMsgs); + SDL_SetError("Couldn't assemble shader: %s", error); + } +#else + const DWORD shader_data[] = { + 0xffff0200, 0x05000051, 0xa00f0000, 0xbd800000, 0xbf000000, 0xbf000000, + 0x3f800000, 0x05000051, 0xa00f0001, 0x3f94fdf4, 0x00000000, 0x3fcc49ba, + 0x00000000, 0x05000051, 0xa00f0002, 0x3f94fdf4, 0xbec83127, 0xbf5020c5, + 0x00000000, 0x05000051, 0xa00f0003, 0x3f94fdf4, 0x400126e9, 0x00000000, + 0x00000000, 0x0200001f, 0x80000000, 0xb0030000, 0x0200001f, 0x80000000, + 0x900f0000, 0x0200001f, 0x90000000, 0xa00f0800, 0x0200001f, 0x90000000, + 0xa00f0801, 0x0200001f, 0x90000000, 0xa00f0802, 0x03000042, 0x800f0000, + 0xb0e40000, 0xa0e40800, 0x03000042, 0x800f0001, 0xb0e40000, 0xa0e40801, + 0x03000042, 0x800f0002, 0xb0e40000, 0xa0e40802, 0x02000001, 0x80020000, + 0x80000001, 0x02000001, 0x80040000, 0x80000002, 0x03000002, 0x80070000, + 0x80e40000, 0xa0e40000, 0x03000008, 0x80010001, 0x80e40000, 0xa0e40001, + 0x03000008, 0x80020001, 0x80e40000, 0xa0e40002, 0x0400005a, 0x80040001, + 0x80e40000, 0xa0e40003, 0xa0aa0003, 0x02000001, 0x80080001, 0xa0ff0000, + 0x03000005, 0x800f0000, 0x80e40001, 0x90e40000, 0x02000001, 0x800f0800, + 0x80e40000, 0x0000ffff + }; +#endif + if (shader_data != NULL) { + result = IDirect3DDevice9_CreatePixelShader(data->device, shader_data, &data->ps_yuv); + if (!FAILED(result)) { + renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12; + renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV; + } else { + D3D_SetError("CreatePixelShader()", result); + } + } + } + + return renderer; +} + +static void +D3D_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + + if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { + data->updateSize = SDL_TRUE; + } +} + +static D3DTEXTUREFILTERTYPE +GetScaleQuality(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); + + if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { + return D3DTEXF_POINT; + } else /*if (*hint == '1' || SDL_strcasecmp(hint, "linear") == 0)*/ { + return D3DTEXF_LINEAR; + } +} + +static int +D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata; + D3D_TextureData *data; + D3DPOOL pool; + DWORD usage; + HRESULT result; + + data = (D3D_TextureData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + return SDL_OutOfMemory(); + } + data->scaleMode = GetScaleQuality(); + + texture->driverdata = data; + +#ifdef USE_DYNAMIC_TEXTURE + if (texture->access == SDL_TEXTUREACCESS_STREAMING) { + pool = D3DPOOL_DEFAULT; + usage = D3DUSAGE_DYNAMIC; + } else +#endif + if (texture->access == SDL_TEXTUREACCESS_TARGET) { + /* D3DPOOL_MANAGED does not work with D3DUSAGE_RENDERTARGET */ + pool = D3DPOOL_DEFAULT; + usage = D3DUSAGE_RENDERTARGET; + } else { + pool = D3DPOOL_MANAGED; + usage = 0; + } + + result = + IDirect3DDevice9_CreateTexture(renderdata->device, texture->w, + texture->h, 1, usage, + PixelFormatToD3DFMT(texture->format), + pool, &data->texture, NULL); + if (FAILED(result)) { + return D3D_SetError("CreateTexture()", result); + } + + if (texture->format == SDL_PIXELFORMAT_YV12 || + texture->format == SDL_PIXELFORMAT_IYUV) { + data->yuv = SDL_TRUE; + + result = + IDirect3DDevice9_CreateTexture(renderdata->device, texture->w / 2, + texture->h / 2, 1, usage, + PixelFormatToD3DFMT(texture->format), + pool, &data->utexture, NULL); + if (FAILED(result)) { + return D3D_SetError("CreateTexture()", result); + } + + result = + IDirect3DDevice9_CreateTexture(renderdata->device, texture->w / 2, + texture->h / 2, 1, usage, + PixelFormatToD3DFMT(texture->format), + pool, &data->vtexture, NULL); + if (FAILED(result)) { + return D3D_SetError("CreateTexture()", result); + } + } + + return 0; +} + +static int +D3D_UpdateTextureInternal(IDirect3DTexture9 *texture, Uint32 format, SDL_bool full_texture, int x, int y, int w, int h, const void *pixels, int pitch) +{ + RECT d3drect; + D3DLOCKED_RECT locked; + const Uint8 *src; + Uint8 *dst; + int row, length; + HRESULT result; + + if (full_texture) { + result = IDirect3DTexture9_LockRect(texture, 0, &locked, NULL, D3DLOCK_DISCARD); + } else { + d3drect.left = x; + d3drect.right = x + w; + d3drect.top = y; + d3drect.bottom = y + h; + result = IDirect3DTexture9_LockRect(texture, 0, &locked, &d3drect, 0); + } + + if (FAILED(result)) { + return D3D_SetError("LockRect()", result); + } + + src = (const Uint8 *)pixels; + dst = locked.pBits; + length = w * SDL_BYTESPERPIXEL(format); + if (length == pitch && length == locked.Pitch) { + SDL_memcpy(dst, src, length*h); + } else { + for (row = 0; row < h; ++row) { + SDL_memcpy(dst, src, length); + src += pitch; + dst += locked.Pitch; + } + } + IDirect3DTexture9_UnlockRect(texture, 0); + + return 0; +} + +static int +D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, int pitch) +{ + D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; + SDL_bool full_texture = SDL_FALSE; + +#ifdef USE_DYNAMIC_TEXTURE + if (texture->access == SDL_TEXTUREACCESS_STREAMING && + rect->x == 0 && rect->y == 0 && + rect->w == texture->w && rect->h == texture->h) { + full_texture = SDL_TRUE; + } +#endif + + if (D3D_UpdateTextureInternal(data->texture, texture->format, full_texture, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) { + return -1; + } + + if (data->yuv) { + /* Skip to the correct offset into the next texture */ + pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + + if (D3D_UpdateTextureInternal(texture->format == SDL_PIXELFORMAT_YV12 ? data->vtexture : data->utexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, pixels, pitch / 2) < 0) { + return -1; + } + + /* Skip to the correct offset into the next texture */ + pixels = (const void*)((const Uint8*)pixels + (rect->h * pitch)/4); + if (D3D_UpdateTextureInternal(texture->format == SDL_PIXELFORMAT_YV12 ? data->utexture : data->vtexture, texture->format, full_texture, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, pixels, pitch / 2) < 0) { + return -1; + } + } + return 0; +} + +static int +D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch) +{ + D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; + RECT d3drect; + D3DLOCKED_RECT locked; + HRESULT result; + + if (data->yuv) { + // It's more efficient to upload directly... + if (!data->pixels) { + data->pitch = texture->w; + data->pixels = (Uint8 *)SDL_malloc((texture->h * data->pitch * 3) / 2); + if (!data->pixels) { + return SDL_OutOfMemory(); + } + } + data->locked_rect = *rect; + *pixels = + (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pitch = data->pitch; + } else { + d3drect.left = rect->x; + d3drect.right = rect->x + rect->w; + d3drect.top = rect->y; + d3drect.bottom = rect->y + rect->h; + + result = IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0); + if (FAILED(result)) { + return D3D_SetError("LockRect()", result); + } + *pixels = locked.pBits; + *pitch = locked.Pitch; + } + return 0; +} + +static void +D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; + + if (data->yuv) { + const SDL_Rect *rect = &data->locked_rect; + void *pixels = + (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + D3D_UpdateTexture(renderer, texture, rect, pixels, data->pitch); + } else { + IDirect3DTexture9_UnlockRect(data->texture, 0); + } +} + +static int +D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_TextureData *texturedata; + HRESULT result; + + D3D_ActivateRenderer(renderer); + + /* Release the previous render target if it wasn't the default one */ + if (data->currentRenderTarget != NULL) { + IDirect3DSurface9_Release(data->currentRenderTarget); + data->currentRenderTarget = NULL; + } + + if (texture == NULL) { + IDirect3DDevice9_SetRenderTarget(data->device, 0, data->defaultRenderTarget); + return 0; + } + + texturedata = (D3D_TextureData *) texture->driverdata; + result = IDirect3DTexture9_GetSurfaceLevel(texturedata->texture, 0, &data->currentRenderTarget); + if(FAILED(result)) { + return D3D_SetError("GetSurfaceLevel()", result); + } + result = IDirect3DDevice9_SetRenderTarget(data->device, 0, data->currentRenderTarget); + if(FAILED(result)) { + return D3D_SetError("SetRenderTarget()", result); + } + + return 0; +} + +static int +D3D_UpdateViewport(SDL_Renderer * renderer) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3DVIEWPORT9 viewport; + D3DMATRIX matrix; + + /* Set the viewport */ + viewport.X = renderer->viewport.x; + viewport.Y = renderer->viewport.y; + viewport.Width = renderer->viewport.w; + viewport.Height = renderer->viewport.h; + viewport.MinZ = 0.0f; + viewport.MaxZ = 1.0f; + IDirect3DDevice9_SetViewport(data->device, &viewport); + + /* Set an orthographic projection matrix */ + if (renderer->viewport.w && renderer->viewport.h) { + matrix.m[0][0] = 2.0f / renderer->viewport.w; + matrix.m[0][1] = 0.0f; + matrix.m[0][2] = 0.0f; + matrix.m[0][3] = 0.0f; + matrix.m[1][0] = 0.0f; + matrix.m[1][1] = -2.0f / renderer->viewport.h; + matrix.m[1][2] = 0.0f; + matrix.m[1][3] = 0.0f; + matrix.m[2][0] = 0.0f; + matrix.m[2][1] = 0.0f; + matrix.m[2][2] = 1.0f; + matrix.m[2][3] = 0.0f; + matrix.m[3][0] = -1.0f; + matrix.m[3][1] = 1.0f; + matrix.m[3][2] = 0.0f; + matrix.m[3][3] = 1.0f; + IDirect3DDevice9_SetTransform(data->device, D3DTS_PROJECTION, &matrix); + } + + return 0; +} + +static int +D3D_UpdateClipRect(SDL_Renderer * renderer) +{ + const SDL_Rect *rect = &renderer->clip_rect; + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + RECT r; + HRESULT result; + + if (!SDL_RectEmpty(rect)) { + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, TRUE); + r.left = rect->x; + r.top = rect->y; + r.right = rect->x + rect->w; + r.bottom = rect->y + rect->h; + + result = IDirect3DDevice9_SetScissorRect(data->device, &r); + if (result != D3D_OK) { + D3D_SetError("SetScissor()", result); + return -1; + } + } else { + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, FALSE); + } + return 0; +} + +static int +D3D_RenderClear(SDL_Renderer * renderer) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + DWORD color; + HRESULT result; + + if (D3D_ActivateRenderer(renderer) < 0) { + return -1; + } + + color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); + + /* Don't reset the viewport if we don't have to! */ + if (!renderer->viewport.x && !renderer->viewport.y && + renderer->viewport.w == data->pparams.BackBufferWidth && + renderer->viewport.h == data->pparams.BackBufferHeight) { + result = IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0); + } else { + D3DVIEWPORT9 viewport; + + /* Clear is defined to clear the entire render target */ + viewport.X = 0; + viewport.Y = 0; + viewport.Width = data->pparams.BackBufferWidth; + viewport.Height = data->pparams.BackBufferHeight; + viewport.MinZ = 0.0f; + viewport.MaxZ = 1.0f; + IDirect3DDevice9_SetViewport(data->device, &viewport); + + result = IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0); + + /* Reset the viewport */ + viewport.X = renderer->viewport.x; + viewport.Y = renderer->viewport.y; + viewport.Width = renderer->viewport.w; + viewport.Height = renderer->viewport.h; + viewport.MinZ = 0.0f; + viewport.MaxZ = 1.0f; + IDirect3DDevice9_SetViewport(data->device, &viewport); + } + + if (FAILED(result)) { + return D3D_SetError("Clear()", result); + } + return 0; +} + +static void +D3D_SetBlendMode(D3D_RenderData * data, int blendMode) +{ + switch (blendMode) { + case SDL_BLENDMODE_NONE: + IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE, + FALSE); + break; + case SDL_BLENDMODE_BLEND: + IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE, + TRUE); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND, + D3DBLEND_SRCALPHA); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND, + D3DBLEND_INVSRCALPHA); + if (data->enableSeparateAlphaBlend) { + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLENDALPHA, + D3DBLEND_ONE); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLENDALPHA, + D3DBLEND_INVSRCALPHA); + } + break; + case SDL_BLENDMODE_ADD: + IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE, + TRUE); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND, + D3DBLEND_SRCALPHA); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND, + D3DBLEND_ONE); + if (data->enableSeparateAlphaBlend) { + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLENDALPHA, + D3DBLEND_ZERO); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLENDALPHA, + D3DBLEND_ONE); + } + break; + case SDL_BLENDMODE_MOD: + IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE, + TRUE); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND, + D3DBLEND_ZERO); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND, + D3DBLEND_SRCCOLOR); + if (data->enableSeparateAlphaBlend) { + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLENDALPHA, + D3DBLEND_ZERO); + IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLENDALPHA, + D3DBLEND_ONE); + } + break; + } +} + +static int +D3D_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + DWORD color; + Vertex *vertices; + int i; + HRESULT result; + + if (D3D_ActivateRenderer(renderer) < 0) { + return -1; + } + + D3D_SetBlendMode(data, renderer->blendMode); + + result = + IDirect3DDevice9_SetTexture(data->device, 0, + (IDirect3DBaseTexture9 *) 0); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + + color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); + + vertices = SDL_stack_alloc(Vertex, count); + for (i = 0; i < count; ++i) { + vertices[i].x = points[i].x; + vertices[i].y = points[i].y; + vertices[i].z = 0.0f; + vertices[i].color = color; + vertices[i].u = 0.0f; + vertices[i].v = 0.0f; + } + result = + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, + vertices, sizeof(*vertices)); + SDL_stack_free(vertices); + if (FAILED(result)) { + return D3D_SetError("DrawPrimitiveUP()", result); + } + return 0; +} + +static int +D3D_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + DWORD color; + Vertex *vertices; + int i; + HRESULT result; + + if (D3D_ActivateRenderer(renderer) < 0) { + return -1; + } + + D3D_SetBlendMode(data, renderer->blendMode); + + result = + IDirect3DDevice9_SetTexture(data->device, 0, + (IDirect3DBaseTexture9 *) 0); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + + color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); + + vertices = SDL_stack_alloc(Vertex, count); + for (i = 0; i < count; ++i) { + vertices[i].x = points[i].x; + vertices[i].y = points[i].y; + vertices[i].z = 0.0f; + vertices[i].color = color; + vertices[i].u = 0.0f; + vertices[i].v = 0.0f; + } + result = + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, count-1, + vertices, sizeof(*vertices)); + + /* DirectX 9 has the same line rasterization semantics as GDI, + so we need to close the endpoint of the line */ + if (count == 2 || + points[0].x != points[count-1].x || points[0].y != points[count-1].y) { + vertices[0].x = points[count-1].x; + vertices[0].y = points[count-1].y; + result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, 1, vertices, sizeof(*vertices)); + } + + SDL_stack_free(vertices); + if (FAILED(result)) { + return D3D_SetError("DrawPrimitiveUP()", result); + } + return 0; +} + +static int +D3D_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, + int count) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + DWORD color; + int i; + float minx, miny, maxx, maxy; + Vertex vertices[4]; + HRESULT result; + + if (D3D_ActivateRenderer(renderer) < 0) { + return -1; + } + + D3D_SetBlendMode(data, renderer->blendMode); + + result = + IDirect3DDevice9_SetTexture(data->device, 0, + (IDirect3DBaseTexture9 *) 0); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + + color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b); + + for (i = 0; i < count; ++i) { + const SDL_FRect *rect = &rects[i]; + + minx = rect->x; + miny = rect->y; + maxx = rect->x + rect->w; + maxy = rect->y + rect->h; + + vertices[0].x = minx; + vertices[0].y = miny; + vertices[0].z = 0.0f; + vertices[0].color = color; + vertices[0].u = 0.0f; + vertices[0].v = 0.0f; + + vertices[1].x = maxx; + vertices[1].y = miny; + vertices[1].z = 0.0f; + vertices[1].color = color; + vertices[1].u = 0.0f; + vertices[1].v = 0.0f; + + vertices[2].x = maxx; + vertices[2].y = maxy; + vertices[2].z = 0.0f; + vertices[2].color = color; + vertices[2].u = 0.0f; + vertices[2].v = 0.0f; + + vertices[3].x = minx; + vertices[3].y = maxy; + vertices[3].z = 0.0f; + vertices[3].color = color; + vertices[3].u = 0.0f; + vertices[3].v = 0.0f; + + result = + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, + 2, vertices, sizeof(*vertices)); + if (FAILED(result)) { + return D3D_SetError("DrawPrimitiveUP()", result); + } + } + return 0; +} + +static void +D3D_UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, unsigned index) +{ + if (texturedata->scaleMode != data->scaleMode[index]) { + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MINFILTER, + texturedata->scaleMode); + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MAGFILTER, + texturedata->scaleMode); + data->scaleMode[index] = texturedata->scaleMode; + } +} + +static int +D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; + LPDIRECT3DPIXELSHADER9 shader = NULL; + float minx, miny, maxx, maxy; + float minu, maxu, minv, maxv; + DWORD color; + Vertex vertices[4]; + HRESULT result; + + if (D3D_ActivateRenderer(renderer) < 0) { + return -1; + } + + minx = dstrect->x - 0.5f; + miny = dstrect->y - 0.5f; + maxx = dstrect->x + dstrect->w - 0.5f; + maxy = dstrect->y + dstrect->h - 0.5f; + + minu = (float) srcrect->x / texture->w; + maxu = (float) (srcrect->x + srcrect->w) / texture->w; + minv = (float) srcrect->y / texture->h; + maxv = (float) (srcrect->y + srcrect->h) / texture->h; + + color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b); + + vertices[0].x = minx; + vertices[0].y = miny; + vertices[0].z = 0.0f; + vertices[0].color = color; + vertices[0].u = minu; + vertices[0].v = minv; + + vertices[1].x = maxx; + vertices[1].y = miny; + vertices[1].z = 0.0f; + vertices[1].color = color; + vertices[1].u = maxu; + vertices[1].v = minv; + + vertices[2].x = maxx; + vertices[2].y = maxy; + vertices[2].z = 0.0f; + vertices[2].color = color; + vertices[2].u = maxu; + vertices[2].v = maxv; + + vertices[3].x = minx; + vertices[3].y = maxy; + vertices[3].z = 0.0f; + vertices[3].color = color; + vertices[3].u = minu; + vertices[3].v = maxv; + + D3D_SetBlendMode(data, texture->blendMode); + + D3D_UpdateTextureScaleMode(data, texturedata, 0); + + result = + IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *) + texturedata->texture); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + + if (texturedata->yuv) { + shader = data->ps_yuv; + + D3D_UpdateTextureScaleMode(data, texturedata, 1); + D3D_UpdateTextureScaleMode(data, texturedata, 2); + + result = + IDirect3DDevice9_SetTexture(data->device, 1, (IDirect3DBaseTexture9 *) + texturedata->utexture); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + + result = + IDirect3DDevice9_SetTexture(data->device, 2, (IDirect3DBaseTexture9 *) + texturedata->vtexture); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + } + + if (shader) { + result = IDirect3DDevice9_SetPixelShader(data->device, shader); + if (FAILED(result)) { + return D3D_SetError("SetShader()", result); + } + } + result = + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2, + vertices, sizeof(*vertices)); + if (FAILED(result)) { + return D3D_SetError("DrawPrimitiveUP()", result); + } + if (shader) { + result = IDirect3DDevice9_SetPixelShader(data->device, NULL); + if (FAILED(result)) { + return D3D_SetError("SetShader()", result); + } + } + return 0; +} + + +static int +D3D_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; + LPDIRECT3DPIXELSHADER9 shader = NULL; + float minx, miny, maxx, maxy; + float minu, maxu, minv, maxv; + float centerx, centery; + DWORD color; + Vertex vertices[4]; + HRESULT result; + + if (D3D_ActivateRenderer(renderer) < 0) { + return -1; + } + + centerx = center->x; + centery = center->y; + + if (flip & SDL_FLIP_HORIZONTAL) { + minx = dstrect->w - centerx - 0.5f; + maxx = -centerx - 0.5f; + } + else { + minx = -centerx - 0.5f; + maxx = dstrect->w - centerx - 0.5f; + } + + if (flip & SDL_FLIP_VERTICAL) { + miny = dstrect->h - centery - 0.5f; + maxy = -centery - 0.5f; + } + else { + miny = -centery - 0.5f; + maxy = dstrect->h - centery - 0.5f; + } + + minu = (float) srcrect->x / texture->w; + maxu = (float) (srcrect->x + srcrect->w) / texture->w; + minv = (float) srcrect->y / texture->h; + maxv = (float) (srcrect->y + srcrect->h) / texture->h; + + color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b); + + vertices[0].x = minx; + vertices[0].y = miny; + vertices[0].z = 0.0f; + vertices[0].color = color; + vertices[0].u = minu; + vertices[0].v = minv; + + vertices[1].x = maxx; + vertices[1].y = miny; + vertices[1].z = 0.0f; + vertices[1].color = color; + vertices[1].u = maxu; + vertices[1].v = minv; + + vertices[2].x = maxx; + vertices[2].y = maxy; + vertices[2].z = 0.0f; + vertices[2].color = color; + vertices[2].u = maxu; + vertices[2].v = maxv; + + vertices[3].x = minx; + vertices[3].y = maxy; + vertices[3].z = 0.0f; + vertices[3].color = color; + vertices[3].u = minu; + vertices[3].v = maxv; + + D3D_SetBlendMode(data, texture->blendMode); + + /* Rotate and translate */ + ID3DXMatrixStack_Push(data->matrixStack); + ID3DXMatrixStack_LoadIdentity(data->matrixStack); + ID3DXMatrixStack_RotateYawPitchRoll(data->matrixStack, 0.0, 0.0, (float)(M_PI * (float) angle / 180.0f)); + ID3DXMatrixStack_Translate(data->matrixStack, (float)dstrect->x + centerx, (float)dstrect->y + centery, (float)0.0); + IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)ID3DXMatrixStack_GetTop(data->matrixStack)); + + D3D_UpdateTextureScaleMode(data, texturedata, 0); + + result = + IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *) + texturedata->texture); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + + if (texturedata->yuv) { + shader = data->ps_yuv; + + D3D_UpdateTextureScaleMode(data, texturedata, 1); + D3D_UpdateTextureScaleMode(data, texturedata, 2); + + result = + IDirect3DDevice9_SetTexture(data->device, 1, (IDirect3DBaseTexture9 *) + texturedata->utexture); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + + result = + IDirect3DDevice9_SetTexture(data->device, 2, (IDirect3DBaseTexture9 *) + texturedata->vtexture); + if (FAILED(result)) { + return D3D_SetError("SetTexture()", result); + } + } + + if (shader) { + result = IDirect3DDevice9_SetPixelShader(data->device, shader); + if (FAILED(result)) { + return D3D_SetError("SetShader()", result); + } + } + result = + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2, + vertices, sizeof(*vertices)); + if (FAILED(result)) { + return D3D_SetError("DrawPrimitiveUP()", result); + } + if (shader) { + result = IDirect3DDevice9_SetPixelShader(data->device, NULL); + if (FAILED(result)) { + return D3D_SetError("SetShader()", result); + } + } + ID3DXMatrixStack_Pop(data->matrixStack); + ID3DXMatrixStack_Push(data->matrixStack); + ID3DXMatrixStack_LoadIdentity(data->matrixStack); + IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)ID3DXMatrixStack_GetTop(data->matrixStack)); + ID3DXMatrixStack_Pop(data->matrixStack); + return 0; +} + +static int +D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3DSURFACE_DESC desc; + LPDIRECT3DSURFACE9 backBuffer; + LPDIRECT3DSURFACE9 surface; + RECT d3drect; + D3DLOCKED_RECT locked; + HRESULT result; + + result = IDirect3DDevice9_GetBackBuffer(data->device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer); + if (FAILED(result)) { + return D3D_SetError("GetBackBuffer()", result); + } + + result = IDirect3DSurface9_GetDesc(backBuffer, &desc); + if (FAILED(result)) { + IDirect3DSurface9_Release(backBuffer); + return D3D_SetError("GetDesc()", result); + } + + result = IDirect3DDevice9_CreateOffscreenPlainSurface(data->device, desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surface, NULL); + if (FAILED(result)) { + IDirect3DSurface9_Release(backBuffer); + return D3D_SetError("CreateOffscreenPlainSurface()", result); + } + + result = IDirect3DDevice9_GetRenderTargetData(data->device, backBuffer, surface); + if (FAILED(result)) { + IDirect3DSurface9_Release(surface); + IDirect3DSurface9_Release(backBuffer); + return D3D_SetError("GetRenderTargetData()", result); + } + + d3drect.left = rect->x; + d3drect.right = rect->x + rect->w; + d3drect.top = rect->y; + d3drect.bottom = rect->y + rect->h; + + result = IDirect3DSurface9_LockRect(surface, &locked, &d3drect, D3DLOCK_READONLY); + if (FAILED(result)) { + IDirect3DSurface9_Release(surface); + IDirect3DSurface9_Release(backBuffer); + return D3D_SetError("LockRect()", result); + } + + SDL_ConvertPixels(rect->w, rect->h, + D3DFMTToPixelFormat(desc.Format), locked.pBits, locked.Pitch, + format, pixels, pitch); + + IDirect3DSurface9_UnlockRect(surface); + + IDirect3DSurface9_Release(surface); + IDirect3DSurface9_Release(backBuffer); + + return 0; +} + +static void +D3D_RenderPresent(SDL_Renderer * renderer) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + HRESULT result; + + if (!data->beginScene) { + IDirect3DDevice9_EndScene(data->device); + data->beginScene = SDL_TRUE; + } + + result = IDirect3DDevice9_TestCooperativeLevel(data->device); + if (result == D3DERR_DEVICELOST) { + /* We'll reset later */ + return; + } + if (result == D3DERR_DEVICENOTRESET) { + D3D_Reset(renderer); + } + result = IDirect3DDevice9_Present(data->device, NULL, NULL, NULL, NULL); + if (FAILED(result)) { + D3D_SetError("Present()", result); + } +} + +static void +D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; + + if (!data) { + return; + } + if (data->texture) { + IDirect3DTexture9_Release(data->texture); + } + if (data->utexture) { + IDirect3DTexture9_Release(data->utexture); + } + if (data->vtexture) { + IDirect3DTexture9_Release(data->vtexture); + } + if (data->pixels) { + SDL_free(data->pixels); + } + SDL_free(data); + texture->driverdata = NULL; +} + +static void +D3D_DestroyRenderer(SDL_Renderer * renderer) +{ + D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + + if (data) { + /* Release the render target */ + if (data->defaultRenderTarget) { + IDirect3DSurface9_Release(data->defaultRenderTarget); + data->defaultRenderTarget = NULL; + } + if (data->currentRenderTarget != NULL) { + IDirect3DSurface9_Release(data->currentRenderTarget); + data->currentRenderTarget = NULL; + } + + if (data->device) { + IDirect3DDevice9_Release(data->device); + } + if (data->d3d) { + IDirect3D9_Release(data->d3d); + ID3DXMatrixStack_Release(data->matrixStack); + SDL_UnloadObject(data->d3dDLL); + } + SDL_free(data); + } + SDL_free(renderer); +} + +#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/mmx.h b/src/render/mmx.h new file mode 100644 index 0000000000..3bd00ac239 --- /dev/null +++ b/src/render/mmx.h @@ -0,0 +1,642 @@ +/* mmx.h + + MultiMedia eXtensions GCC interface library for IA32. + + To use this library, simply include this header file + and compile with GCC. You MUST have inlining enabled + in order for mmx_ok() to work; this can be done by + simply using -O on the GCC command line. + + Compiling with -DMMX_TRACE will cause detailed trace + output to be sent to stderr for each mmx operation. + This adds lots of code, and obviously slows execution to + a crawl, but can be very useful for debugging. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT + LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR ANY PARTICULAR PURPOSE. + + 1997-99 by H. Dietz and R. Fisher + + Notes: + It appears that the latest gas has the pand problem fixed, therefore + I'll undefine BROKEN_PAND by default. +*/ + +#ifndef _MMX_H +#define _MMX_H + + +/* Warning: at this writing, the version of GAS packaged + with most Linux distributions does not handle the + parallel AND operation mnemonic correctly. If the + symbol BROKEN_PAND is defined, a slower alternative + coding will be used. If execution of mmxtest results + in an illegal instruction fault, define this symbol. +*/ +#undef BROKEN_PAND + + +/* The type of an value that fits in an MMX register + (note that long long constant values MUST be suffixed + by LL and unsigned long long values by ULL, lest + they be truncated by the compiler) +*/ +typedef union +{ + long long q; /* Quadword (64-bit) value */ + unsigned long long uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} __attribute__ ((aligned(8))) mmx_t; /* On an 8-byte (64-bit) boundary */ + + +#if 0 +/* Function to test if multimedia instructions are supported... +*/ +inline extern int +mm_support(void) +{ + /* Returns 1 if MMX instructions are supported, + 3 if Cyrix MMX and Extended MMX instructions are supported + 5 if AMD MMX and 3DNow! instructions are supported + 0 if hardware does not support any of these + */ + register int rval = 0; + + __asm__ __volatile__( + /* See if CPUID instruction is supported ... */ + /* ... Get copies of EFLAGS into eax and ecx */ + "pushf\n\t" + "popl %%eax\n\t" "movl %%eax, %%ecx\n\t" + /* ... Toggle the ID bit in one copy and store */ + /* to the EFLAGS reg */ + "xorl $0x200000, %%eax\n\t" + "push %%eax\n\t" "popf\n\t" + /* ... Get the (hopefully modified) EFLAGS */ + "pushf\n\t" "popl %%eax\n\t" + /* ... Compare and test result */ + "xorl %%eax, %%ecx\n\t" "testl $0x200000, %%ecx\n\t" "jz NotSupported1\n\t" /* CPUID not supported */ + /* Get standard CPUID information, and + go to a specific vendor section */ + "movl $0, %%eax\n\t" "cpuid\n\t" + /* Check for Intel */ + "cmpl $0x756e6547, %%ebx\n\t" + "jne TryAMD\n\t" + "cmpl $0x49656e69, %%edx\n\t" + "jne TryAMD\n\t" + "cmpl $0x6c65746e, %%ecx\n" + "jne TryAMD\n\t" "jmp Intel\n\t" + /* Check for AMD */ + "\nTryAMD:\n\t" + "cmpl $0x68747541, %%ebx\n\t" + "jne TryCyrix\n\t" + "cmpl $0x69746e65, %%edx\n\t" + "jne TryCyrix\n\t" + "cmpl $0x444d4163, %%ecx\n" + "jne TryCyrix\n\t" "jmp AMD\n\t" + /* Check for Cyrix */ + "\nTryCyrix:\n\t" + "cmpl $0x69727943, %%ebx\n\t" + "jne NotSupported2\n\t" + "cmpl $0x736e4978, %%edx\n\t" + "jne NotSupported3\n\t" + "cmpl $0x64616574, %%ecx\n\t" + "jne NotSupported4\n\t" + /* Drop through to Cyrix... */ + /* Cyrix Section */ + /* See if extended CPUID level 80000001 is supported */ + /* The value of CPUID/80000001 for the 6x86MX is undefined + according to the Cyrix CPU Detection Guide (Preliminary + Rev. 1.01 table 1), so we'll check the value of eax for + CPUID/0 to see if standard CPUID level 2 is supported. + According to the table, the only CPU which supports level + 2 is also the only one which supports extended CPUID levels. + */ + "cmpl $0x2, %%eax\n\t" "jne MMXtest\n\t" /* Use standard CPUID instead */ + /* Extended CPUID supported (in theory), so get extended + features */ + "movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%eax\n\t" /* Test for MMX */ + "jz NotSupported5\n\t" /* MMX not supported */ + "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */ + "jnz EMMXSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */ + "jmp Return\n\n" "EMMXSupported:\n\t" "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */ + "jmp Return\n\t" + /* AMD Section */ + "AMD:\n\t" + /* See if extended CPUID is supported */ + "movl $0x80000000, %%eax\n\t" "cpuid\n\t" "cmpl $0x80000000, %%eax\n\t" "jl MMXtest\n\t" /* Use standard CPUID instead */ + /* Extended CPUID supported, so get extended features */ + "movl $0x80000001, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */ + "jz NotSupported6\n\t" /* MMX not supported */ + "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */ + "jnz ThreeDNowSupported\n\t" "movl $1, %0:\n\n\t" /* MMX Supported */ + "jmp Return\n\n" "ThreeDNowSupported:\n\t" "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */ + "jmp Return\n\t" + /* Intel Section */ + "Intel:\n\t" + /* Check for MMX */ + "MMXtest:\n\t" "movl $1, %%eax\n\t" "cpuid\n\t" "testl $0x00800000, %%edx\n\t" /* Test for MMX */ + "jz NotSupported7\n\t" /* MMX Not supported */ + "movl $1, %0:\n\n\t" /* MMX Supported */ + "jmp Return\n\t" + /* Nothing supported */ + "\nNotSupported1:\n\t" "#movl $101, %0:\n\n\t" "\nNotSupported2:\n\t" "#movl $102, %0:\n\n\t" "\nNotSupported3:\n\t" "#movl $103, %0:\n\n\t" "\nNotSupported4:\n\t" "#movl $104, %0:\n\n\t" "\nNotSupported5:\n\t" "#movl $105, %0:\n\n\t" "\nNotSupported6:\n\t" "#movl $106, %0:\n\n\t" "\nNotSupported7:\n\t" "#movl $107, %0:\n\n\t" "movl $0, %0:\n\n\t" "Return:\n\t":"=a"(rval): /* no input */ + :"eax", "ebx", "ecx", "edx"); + + /* Return */ + return (rval); +} + +/* Function to test if mmx instructions are supported... +*/ +inline extern int +mmx_ok(void) +{ + /* Returns 1 if MMX instructions are supported, 0 otherwise */ + return (mm_support() & 0x1); +} +#endif + +/* Helper functions for the instruction macros that follow... + (note that memory-to-register, m2r, instructions are nearly + as efficient as register-to-register, r2r, instructions; + however, memory-to-memory instructions are really simulated + as a convenience, and are only 1/3 as efficient) +*/ +#ifdef MMX_TRACE + +/* Include the stuff for printing a trace to stderr... +*/ + +#define mmx_i2r(op, imm, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace.uq = (imm); \ + printf(#op "_i2r(" #imm "=0x%08x%08x, ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#reg "=0x%08x%08x) => ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (imm)); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#reg "=0x%08x%08x\n", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_m2r(op, mem, reg) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mem); \ + printf(#op "_m2r(" #mem "=0x%08x%08x, ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#reg "=0x%08x%08x) => ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (mem)); \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#reg "=0x%08x%08x\n", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_r2m(op, reg, mem) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__ ("movq %%" #reg ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#op "_r2m(" #reg "=0x%08x%08x, ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + mmx_trace = (mem); \ + printf(#mem "=0x%08x%08x) => ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=X" (mem) \ + : /* nothing */ ); \ + mmx_trace = (mem); \ + printf(#mem "=0x%08x%08x\n", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_r2r(op, regs, regd) \ + { \ + mmx_t mmx_trace; \ + __asm__ __volatile__ ("movq %%" #regs ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#op "_r2r(" #regs "=0x%08x%08x, ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ ("movq %%" #regd ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#regd "=0x%08x%08x) => ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd); \ + __asm__ __volatile__ ("movq %%" #regd ", %0" \ + : "=X" (mmx_trace) \ + : /* nothing */ ); \ + printf(#regd "=0x%08x%08x\n", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#define mmx_m2m(op, mems, memd) \ + { \ + mmx_t mmx_trace; \ + mmx_trace = (mems); \ + printf(#op "_m2m(" #mems "=0x%08x%08x, ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + mmx_trace = (memd); \ + printf(#memd "=0x%08x%08x) => ", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (memd) \ + : "X" (mems)); \ + mmx_trace = (memd); \ + printf(#memd "=0x%08x%08x\n", \ + mmx_trace.d[1], mmx_trace.d[0]); \ + } + +#else + +/* These macros are a lot simpler without the tracing... +*/ + +#define mmx_i2r(op, imm, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "X" (imm) ) + +#define mmx_m2r(op, mem, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "m" (mem)) + +#define mmx_r2m(op, reg, mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=m" (mem) \ + : /* nothing */ ) + +#define mmx_r2r(op, regs, regd) \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd) + +#define mmx_m2m(op, mems, memd) \ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (memd) \ + : "X" (mems)) + +#endif + + +/* 1x64 MOVe Quadword + (this is both a load and a store... + in fact, it is the only way to store) +*/ +#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) +#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) +#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) +#define movq(vars, vard) \ + __asm__ __volatile__ ("movq %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) + + +/* 1x32 MOVe Doubleword + (like movq, this is both load and store... + but is most useful for moving things between + mmx registers and ordinary registers) +*/ +#define movd_m2r(var, reg) mmx_m2r(movd, var, reg) +#define movd_r2m(reg, var) mmx_r2m(movd, reg, var) +#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) +#define movd(vars, vard) \ + __asm__ __volatile__ ("movd %1, %%mm0\n\t" \ + "movd %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) + + +/* 2x32, 4x16, and 8x8 Parallel ADDs +*/ +#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg) +#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd) +#define paddd(vars, vard) mmx_m2m(paddd, vars, vard) + +#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) +#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) +#define paddw(vars, vard) mmx_m2m(paddw, vars, vard) + +#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg) +#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd) +#define paddb(vars, vard) mmx_m2m(paddb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic +*/ +#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg) +#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd) +#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard) + +#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg) +#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd) +#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic +*/ +#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg) +#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd) +#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard) + +#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg) +#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd) +#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel SUBs +*/ +#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg) +#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd) +#define psubd(vars, vard) mmx_m2m(psubd, vars, vard) + +#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) +#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) +#define psubw(vars, vard) mmx_m2m(psubw, vars, vard) + +#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg) +#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd) +#define psubb(vars, vard) mmx_m2m(psubb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic +*/ +#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg) +#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) +#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard) + +#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg) +#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd) +#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic +*/ +#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg) +#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd) +#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard) + +#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg) +#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd) +#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard) + + +/* 4x16 Parallel MULs giving Low 4x16 portions of results +*/ +#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg) +#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd) +#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard) + + +/* 4x16 Parallel MULs giving High 4x16 portions of results +*/ +#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) +#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) +#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard) + + +/* 4x16->2x32 Parallel Mul-ADD + (muls like pmullw, then adds adjacent 16-bit fields + in the multiply result to make the final 2x32 result) +*/ +#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg) +#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) +#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard) + + +/* 1x64 bitwise AND +*/ +#ifdef BROKEN_PAND +#define pand_m2r(var, reg) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, reg); \ + mmx_m2r(pandn, var, reg); \ + } +#define pand_r2r(regs, regd) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, regd); \ + mmx_r2r(pandn, regs, regd) \ + } +#define pand(vars, vard) \ + { \ + movq_m2r(vard, mm0); \ + mmx_m2r(pandn, (mmx_t) -1LL, mm0); \ + mmx_m2r(pandn, vars, mm0); \ + movq_r2m(mm0, vard); \ + } +#else +#define pand_m2r(var, reg) mmx_m2r(pand, var, reg) +#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd) +#define pand(vars, vard) mmx_m2m(pand, vars, vard) +#endif + + +/* 1x64 bitwise AND with Not the destination +*/ +#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg) +#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd) +#define pandn(vars, vard) mmx_m2m(pandn, vars, vard) + + +/* 1x64 bitwise OR +*/ +#define por_m2r(var, reg) mmx_m2r(por, var, reg) +#define por_r2r(regs, regd) mmx_r2r(por, regs, regd) +#define por(vars, vard) mmx_m2m(por, vars, vard) + + +/* 1x64 bitwise eXclusive OR +*/ +#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg) +#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) +#define pxor(vars, vard) mmx_m2m(pxor, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality + (resulting fields are either 0 or -1) +*/ +#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg) +#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd) +#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard) + +#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg) +#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd) +#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard) + +#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg) +#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd) +#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than + (resulting fields are either 0 or -1) +*/ +#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg) +#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd) +#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard) + +#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg) +#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) +#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard) + +#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg) +#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd) +#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical +*/ +#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg) +#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg) +#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd) +#define psllq(vars, vard) mmx_m2m(psllq, vars, vard) + +#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg) +#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg) +#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd) +#define pslld(vars, vard) mmx_m2m(pslld, vars, vard) + +#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) +#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg) +#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd) +#define psllw(vars, vard) mmx_m2m(psllw, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical +*/ +#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg) +#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg) +#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd) +#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard) + +#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg) +#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg) +#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd) +#define psrld(vars, vard) mmx_m2m(psrld, vars, vard) + +#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg) +#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg) +#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd) +#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard) + + +/* 2x32 and 4x16 Parallel Shift Right Arithmetic +*/ +#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) +#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg) +#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd) +#define psrad(vars, vard) mmx_m2m(psrad, vars, vard) + +#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) +#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg) +#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd) +#define psraw(vars, vard) mmx_m2m(psraw, vars, vard) + + +/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate + (packs source and dest fields into dest in that order) +*/ +#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg) +#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) +#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard) + +#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg) +#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd) +#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard) + + +/* 4x16->8x8 PACK and Unsigned Saturate + (packs source and dest fields into dest in that order) +*/ +#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg) +#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) +#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low + (interleaves low half of dest with low half of source + as padding in each result field) +*/ +#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg) +#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) +#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard) + +#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) +#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) +#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard) + +#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg) +#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) +#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High + (interleaves high half of dest with high half of source + as padding in each result field) +*/ +#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg) +#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) +#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard) + +#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) +#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) +#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard) + +#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg) +#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) +#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard) + + +/* Empty MMx State + (used to clean-up when going from mmx to float use + of the registers that are shared by both; note that + there is no float-to-mmx operation needed, because + only the float tag word info is corruptible) +*/ +#ifdef MMX_TRACE + +#define emms() \ + { \ + printf("emms()\n"); \ + __asm__ __volatile__ ("emms"); \ + } + +#else + +#define emms() __asm__ __volatile__ ("emms") + +#endif + +#endif +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_glfuncs.h b/src/render/opengl/SDL_glfuncs.h new file mode 100644 index 0000000000..7544929fce --- /dev/null +++ b/src/render/opengl/SDL_glfuncs.h @@ -0,0 +1,456 @@ +/* list of OpenGL functions sorted alphabetically + If you need to use a GL function from the SDL video subsystem, + change its entry from SDL_PROC_UNUSED to SDL_PROC and rebuild. +*/ +#define SDL_PROC_UNUSED(ret,func,params) + +SDL_PROC_UNUSED(void, glAccum, (GLenum, GLfloat)) +SDL_PROC_UNUSED(void, glAlphaFunc, (GLenum, GLclampf)) +SDL_PROC_UNUSED(GLboolean, glAreTexturesResident, + (GLsizei, const GLuint *, GLboolean *)) +SDL_PROC_UNUSED(void, glArrayElement, (GLint)) +SDL_PROC(void, glBegin, (GLenum)) +SDL_PROC(void, glBindTexture, (GLenum, GLuint)) +SDL_PROC_UNUSED(void, glBitmap, + (GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat, + const GLubyte *)) +SDL_PROC(void, glBlendFunc, (GLenum, GLenum)) +SDL_PROC(void, glBlendFuncSeparate, (GLenum, GLenum, GLenum, GLenum)) +SDL_PROC_UNUSED(void, glCallList, (GLuint)) +SDL_PROC_UNUSED(void, glCallLists, (GLsizei, GLenum, const GLvoid *)) +SDL_PROC(void, glClear, (GLbitfield)) +SDL_PROC_UNUSED(void, glClearAccum, (GLfloat, GLfloat, GLfloat, GLfloat)) +SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf)) +SDL_PROC_UNUSED(void, glClearDepth, (GLclampd)) +SDL_PROC_UNUSED(void, glClearIndex, (GLfloat)) +SDL_PROC_UNUSED(void, glClearStencil, (GLint)) +SDL_PROC_UNUSED(void, glClipPlane, (GLenum, const GLdouble *)) +SDL_PROC_UNUSED(void, glColor3b, (GLbyte, GLbyte, GLbyte)) +SDL_PROC_UNUSED(void, glColor3bv, (const GLbyte *)) +SDL_PROC_UNUSED(void, glColor3d, (GLdouble, GLdouble, GLdouble)) +SDL_PROC_UNUSED(void, glColor3dv, (const GLdouble *)) +SDL_PROC_UNUSED(void, glColor3f, (GLfloat, GLfloat, GLfloat)) +SDL_PROC_UNUSED(void, glColor3fv, (const GLfloat *)) +SDL_PROC_UNUSED(void, glColor3i, (GLint, GLint, GLint)) +SDL_PROC_UNUSED(void, glColor3iv, (const GLint *)) +SDL_PROC_UNUSED(void, glColor3s, (GLshort, GLshort, GLshort)) +SDL_PROC_UNUSED(void, glColor3sv, (const GLshort *)) +SDL_PROC_UNUSED(void, glColor3ub, (GLubyte, GLubyte, GLubyte)) +SDL_PROC_UNUSED(void, glColor3ubv, (const GLubyte *)) +SDL_PROC_UNUSED(void, glColor3ui, (GLuint, GLuint, GLuint)) +SDL_PROC_UNUSED(void, glColor3uiv, (const GLuint *)) +SDL_PROC_UNUSED(void, glColor3us, (GLushort, GLushort, GLushort)) +SDL_PROC_UNUSED(void, glColor3usv, (const GLushort *)) +SDL_PROC_UNUSED(void, glColor4b, (GLbyte, GLbyte, GLbyte, GLbyte)) +SDL_PROC_UNUSED(void, glColor4bv, (const GLbyte *)) +SDL_PROC_UNUSED(void, glColor4d, (GLdouble, GLdouble, GLdouble, GLdouble)) +SDL_PROC_UNUSED(void, glColor4dv, (const GLdouble *)) +SDL_PROC(void, glColor4f, (GLfloat, GLfloat, GLfloat, GLfloat)) +SDL_PROC_UNUSED(void, glColor4fv, (const GLfloat *)) +SDL_PROC_UNUSED(void, glColor4i, (GLint, GLint, GLint, GLint)) +SDL_PROC_UNUSED(void, glColor4iv, (const GLint *)) +SDL_PROC_UNUSED(void, glColor4s, (GLshort, GLshort, GLshort, GLshort)) +SDL_PROC_UNUSED(void, glColor4sv, (const GLshort *)) +SDL_PROC_UNUSED(void, glColor4ub, + (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)) +SDL_PROC_UNUSED(void, glColor4ubv, (const GLubyte * v)) +SDL_PROC_UNUSED(void, glColor4ui, + (GLuint red, GLuint green, GLuint blue, GLuint alpha)) +SDL_PROC_UNUSED(void, glColor4uiv, (const GLuint * v)) +SDL_PROC_UNUSED(void, glColor4us, + (GLushort red, GLushort green, GLushort blue, GLushort alpha)) +SDL_PROC_UNUSED(void, glColor4usv, (const GLushort * v)) +SDL_PROC_UNUSED(void, glColorMask, + (GLboolean red, GLboolean green, GLboolean blue, + GLboolean alpha)) +SDL_PROC_UNUSED(void, glColorMaterial, (GLenum face, GLenum mode)) +SDL_PROC_UNUSED(void, glColorPointer, + (GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer)) +SDL_PROC_UNUSED(void, glCopyPixels, + (GLint x, GLint y, GLsizei width, GLsizei height, + GLenum type)) +SDL_PROC_UNUSED(void, glCopyTexImage1D, + (GLenum target, GLint level, GLenum internalFormat, GLint x, + GLint y, GLsizei width, GLint border)) +SDL_PROC_UNUSED(void, glCopyTexImage2D, + (GLenum target, GLint level, GLenum internalFormat, GLint x, + GLint y, GLsizei width, GLsizei height, GLint border)) +SDL_PROC_UNUSED(void, glCopyTexSubImage1D, + (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, + GLsizei width)) +SDL_PROC_UNUSED(void, glCopyTexSubImage2D, + (GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height)) +SDL_PROC_UNUSED(void, glCullFace, (GLenum mode)) +SDL_PROC_UNUSED(void, glDeleteLists, (GLuint list, GLsizei range)) +SDL_PROC(void, glDeleteTextures, (GLsizei n, const GLuint * textures)) +SDL_PROC_UNUSED(void, glDepthFunc, (GLenum func)) +SDL_PROC_UNUSED(void, glDepthMask, (GLboolean flag)) +SDL_PROC_UNUSED(void, glDepthRange, (GLclampd zNear, GLclampd zFar)) +SDL_PROC(void, glDisable, (GLenum cap)) +SDL_PROC_UNUSED(void, glDisableClientState, (GLenum array)) +SDL_PROC_UNUSED(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count)) +SDL_PROC_UNUSED(void, glDrawBuffer, (GLenum mode)) +SDL_PROC_UNUSED(void, glDrawElements, + (GLenum mode, GLsizei count, GLenum type, + const GLvoid * indices)) +SDL_PROC(void, glDrawPixels, + (GLsizei width, GLsizei height, GLenum format, GLenum type, + const GLvoid * pixels)) +SDL_PROC_UNUSED(void, glEdgeFlag, (GLboolean flag)) +SDL_PROC_UNUSED(void, glEdgeFlagPointer, + (GLsizei stride, const GLvoid * pointer)) +SDL_PROC_UNUSED(void, glEdgeFlagv, (const GLboolean * flag)) +SDL_PROC(void, glEnable, (GLenum cap)) +SDL_PROC_UNUSED(void, glEnableClientState, (GLenum array)) +SDL_PROC(void, glEnd, (void)) +SDL_PROC_UNUSED(void, glEndList, (void)) +SDL_PROC_UNUSED(void, glEvalCoord1d, (GLdouble u)) +SDL_PROC_UNUSED(void, glEvalCoord1dv, (const GLdouble * u)) +SDL_PROC_UNUSED(void, glEvalCoord1f, (GLfloat u)) +SDL_PROC_UNUSED(void, glEvalCoord1fv, (const GLfloat * u)) +SDL_PROC_UNUSED(void, glEvalCoord2d, (GLdouble u, GLdouble v)) +SDL_PROC_UNUSED(void, glEvalCoord2dv, (const GLdouble * u)) +SDL_PROC_UNUSED(void, glEvalCoord2f, (GLfloat u, GLfloat v)) +SDL_PROC_UNUSED(void, glEvalCoord2fv, (const GLfloat * u)) +SDL_PROC_UNUSED(void, glEvalMesh1, (GLenum mode, GLint i1, GLint i2)) +SDL_PROC_UNUSED(void, glEvalMesh2, + (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)) +SDL_PROC_UNUSED(void, glEvalPoint1, (GLint i)) +SDL_PROC_UNUSED(void, glEvalPoint2, (GLint i, GLint j)) +SDL_PROC_UNUSED(void, glFeedbackBuffer, + (GLsizei size, GLenum type, GLfloat * buffer)) +SDL_PROC_UNUSED(void, glFinish, (void)) +SDL_PROC_UNUSED(void, glFlush, (void)) +SDL_PROC_UNUSED(void, glFogf, (GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glFogfv, (GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glFogi, (GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glFogiv, (GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glFrontFace, (GLenum mode)) +SDL_PROC_UNUSED(void, glFrustum, + (GLdouble left, GLdouble right, GLdouble bottom, + GLdouble top, GLdouble zNear, GLdouble zFar)) +SDL_PROC_UNUSED(GLuint, glGenLists, (GLsizei range)) +SDL_PROC(void, glGenTextures, (GLsizei n, GLuint * textures)) +SDL_PROC_UNUSED(void, glGetBooleanv, (GLenum pname, GLboolean * params)) +SDL_PROC_UNUSED(void, glGetClipPlane, (GLenum plane, GLdouble * equation)) +SDL_PROC_UNUSED(void, glGetDoublev, (GLenum pname, GLdouble * params)) +SDL_PROC(GLenum, glGetError, (void)) +SDL_PROC_UNUSED(void, glGetFloatv, (GLenum pname, GLfloat * params)) +SDL_PROC(void, glGetIntegerv, (GLenum pname, GLint * params)) +SDL_PROC_UNUSED(void, glGetLightfv, + (GLenum light, GLenum pname, GLfloat * params)) +SDL_PROC_UNUSED(void, glGetLightiv, + (GLenum light, GLenum pname, GLint * params)) +SDL_PROC_UNUSED(void, glGetMapdv, (GLenum target, GLenum query, GLdouble * v)) +SDL_PROC_UNUSED(void, glGetMapfv, (GLenum target, GLenum query, GLfloat * v)) +SDL_PROC_UNUSED(void, glGetMapiv, (GLenum target, GLenum query, GLint * v)) +SDL_PROC_UNUSED(void, glGetMaterialfv, + (GLenum face, GLenum pname, GLfloat * params)) +SDL_PROC_UNUSED(void, glGetMaterialiv, + (GLenum face, GLenum pname, GLint * params)) +SDL_PROC_UNUSED(void, glGetPixelMapfv, (GLenum map, GLfloat * values)) +SDL_PROC_UNUSED(void, glGetPixelMapuiv, (GLenum map, GLuint * values)) +SDL_PROC_UNUSED(void, glGetPixelMapusv, (GLenum map, GLushort * values)) +SDL_PROC(void, glGetPointerv, (GLenum pname, GLvoid * *params)) +SDL_PROC_UNUSED(void, glGetPolygonStipple, (GLubyte * mask)) +SDL_PROC(const GLubyte *, glGetString, (GLenum name)) +SDL_PROC_UNUSED(void, glGetTexEnvfv, + (GLenum target, GLenum pname, GLfloat * params)) +SDL_PROC_UNUSED(void, glGetTexEnviv, + (GLenum target, GLenum pname, GLint * params)) +SDL_PROC_UNUSED(void, glGetTexGendv, + (GLenum coord, GLenum pname, GLdouble * params)) +SDL_PROC_UNUSED(void, glGetTexGenfv, + (GLenum coord, GLenum pname, GLfloat * params)) +SDL_PROC_UNUSED(void, glGetTexGeniv, + (GLenum coord, GLenum pname, GLint * params)) +SDL_PROC_UNUSED(void, glGetTexImage, + (GLenum target, GLint level, GLenum format, GLenum type, + GLvoid * pixels)) +SDL_PROC_UNUSED(void, glGetTexLevelParameterfv, + (GLenum target, GLint level, GLenum pname, GLfloat * params)) +SDL_PROC_UNUSED(void, glGetTexLevelParameteriv, + (GLenum target, GLint level, GLenum pname, GLint * params)) +SDL_PROC_UNUSED(void, glGetTexParameterfv, + (GLenum target, GLenum pname, GLfloat * params)) +SDL_PROC_UNUSED(void, glGetTexParameteriv, + (GLenum target, GLenum pname, GLint * params)) +SDL_PROC_UNUSED(void, glHint, (GLenum target, GLenum mode)) +SDL_PROC_UNUSED(void, glIndexMask, (GLuint mask)) +SDL_PROC_UNUSED(void, glIndexPointer, + (GLenum type, GLsizei stride, const GLvoid * pointer)) +SDL_PROC_UNUSED(void, glIndexd, (GLdouble c)) +SDL_PROC_UNUSED(void, glIndexdv, (const GLdouble * c)) +SDL_PROC_UNUSED(void, glIndexf, (GLfloat c)) +SDL_PROC_UNUSED(void, glIndexfv, (const GLfloat * c)) +SDL_PROC_UNUSED(void, glIndexi, (GLint c)) +SDL_PROC_UNUSED(void, glIndexiv, (const GLint * c)) +SDL_PROC_UNUSED(void, glIndexs, (GLshort c)) +SDL_PROC_UNUSED(void, glIndexsv, (const GLshort * c)) +SDL_PROC_UNUSED(void, glIndexub, (GLubyte c)) +SDL_PROC_UNUSED(void, glIndexubv, (const GLubyte * c)) +SDL_PROC_UNUSED(void, glInitNames, (void)) +SDL_PROC_UNUSED(void, glInterleavedArrays, + (GLenum format, GLsizei stride, const GLvoid * pointer)) +SDL_PROC_UNUSED(GLboolean, glIsEnabled, (GLenum cap)) +SDL_PROC_UNUSED(GLboolean, glIsList, (GLuint list)) +SDL_PROC_UNUSED(GLboolean, glIsTexture, (GLuint texture)) +SDL_PROC_UNUSED(void, glLightModelf, (GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glLightModelfv, (GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glLightModeli, (GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glLightModeliv, (GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glLightf, (GLenum light, GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glLightfv, + (GLenum light, GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glLighti, (GLenum light, GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glLightiv, + (GLenum light, GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glLineStipple, (GLint factor, GLushort pattern)) +SDL_PROC(void, glLineWidth, (GLfloat width)) +SDL_PROC_UNUSED(void, glListBase, (GLuint base)) +SDL_PROC(void, glLoadIdentity, (void)) +SDL_PROC_UNUSED(void, glLoadMatrixd, (const GLdouble * m)) +SDL_PROC_UNUSED(void, glLoadMatrixf, (const GLfloat * m)) +SDL_PROC_UNUSED(void, glLoadName, (GLuint name)) +SDL_PROC_UNUSED(void, glLogicOp, (GLenum opcode)) +SDL_PROC_UNUSED(void, glMap1d, + (GLenum target, GLdouble u1, GLdouble u2, GLint stride, + GLint order, const GLdouble * points)) +SDL_PROC_UNUSED(void, glMap1f, + (GLenum target, GLfloat u1, GLfloat u2, GLint stride, + GLint order, const GLfloat * points)) +SDL_PROC_UNUSED(void, glMap2d, + (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, + GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, + GLint vorder, const GLdouble * points)) +SDL_PROC_UNUSED(void, glMap2f, + (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, + GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, + GLint vorder, const GLfloat * points)) +SDL_PROC_UNUSED(void, glMapGrid1d, (GLint un, GLdouble u1, GLdouble u2)) +SDL_PROC_UNUSED(void, glMapGrid1f, (GLint un, GLfloat u1, GLfloat u2)) +SDL_PROC_UNUSED(void, glMapGrid2d, + (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, + GLdouble v2)) +SDL_PROC_UNUSED(void, glMapGrid2f, + (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, + GLfloat v2)) +SDL_PROC_UNUSED(void, glMaterialf, (GLenum face, GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glMaterialfv, + (GLenum face, GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glMateriali, (GLenum face, GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glMaterialiv, + (GLenum face, GLenum pname, const GLint * params)) +SDL_PROC(void, glMatrixMode, (GLenum mode)) +SDL_PROC_UNUSED(void, glMultMatrixd, (const GLdouble * m)) +SDL_PROC_UNUSED(void, glMultMatrixf, (const GLfloat * m)) +SDL_PROC_UNUSED(void, glNewList, (GLuint list, GLenum mode)) +SDL_PROC_UNUSED(void, glNormal3b, (GLbyte nx, GLbyte ny, GLbyte nz)) +SDL_PROC_UNUSED(void, glNormal3bv, (const GLbyte * v)) +SDL_PROC_UNUSED(void, glNormal3d, (GLdouble nx, GLdouble ny, GLdouble nz)) +SDL_PROC_UNUSED(void, glNormal3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz)) +SDL_PROC_UNUSED(void, glNormal3fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glNormal3i, (GLint nx, GLint ny, GLint nz)) +SDL_PROC_UNUSED(void, glNormal3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glNormal3s, (GLshort nx, GLshort ny, GLshort nz)) +SDL_PROC_UNUSED(void, glNormal3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glNormalPointer, + (GLenum type, GLsizei stride, const GLvoid * pointer)) +SDL_PROC(void, glOrtho, + (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, + GLdouble zNear, GLdouble zFar)) +SDL_PROC_UNUSED(void, glPassThrough, (GLfloat token)) +SDL_PROC_UNUSED(void, glPixelMapfv, + (GLenum map, GLsizei mapsize, const GLfloat * values)) +SDL_PROC_UNUSED(void, glPixelMapuiv, + (GLenum map, GLsizei mapsize, const GLuint * values)) +SDL_PROC_UNUSED(void, glPixelMapusv, + (GLenum map, GLsizei mapsize, const GLushort * values)) +SDL_PROC_UNUSED(void, glPixelStoref, (GLenum pname, GLfloat param)) +SDL_PROC(void, glPixelStorei, (GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glPixelTransferf, (GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glPixelTransferi, (GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glPixelZoom, (GLfloat xfactor, GLfloat yfactor)) +SDL_PROC(void, glPointSize, (GLfloat size)) +SDL_PROC_UNUSED(void, glPolygonMode, (GLenum face, GLenum mode)) +SDL_PROC_UNUSED(void, glPolygonOffset, (GLfloat factor, GLfloat units)) +SDL_PROC_UNUSED(void, glPolygonStipple, (const GLubyte * mask)) +SDL_PROC_UNUSED(void, glPopAttrib, (void)) +SDL_PROC_UNUSED(void, glPopClientAttrib, (void)) +SDL_PROC(void, glPopMatrix, (void)) +SDL_PROC_UNUSED(void, glPopName, (void)) +SDL_PROC_UNUSED(void, glPrioritizeTextures, + (GLsizei n, const GLuint * textures, + const GLclampf * priorities)) +SDL_PROC_UNUSED(void, glPushAttrib, (GLbitfield mask)) +SDL_PROC_UNUSED(void, glPushClientAttrib, (GLbitfield mask)) +SDL_PROC(void, glPushMatrix, (void)) +SDL_PROC_UNUSED(void, glPushName, (GLuint name)) +SDL_PROC_UNUSED(void, glRasterPos2d, (GLdouble x, GLdouble y)) +SDL_PROC_UNUSED(void, glRasterPos2dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glRasterPos2f, (GLfloat x, GLfloat y)) +SDL_PROC_UNUSED(void, glRasterPos2fv, (const GLfloat * v)) +SDL_PROC(void, glRasterPos2i, (GLint x, GLint y)) +SDL_PROC_UNUSED(void, glRasterPos2iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glRasterPos2s, (GLshort x, GLshort y)) +SDL_PROC_UNUSED(void, glRasterPos2sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glRasterPos3d, (GLdouble x, GLdouble y, GLdouble z)) +SDL_PROC_UNUSED(void, glRasterPos3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glRasterPos3f, (GLfloat x, GLfloat y, GLfloat z)) +SDL_PROC_UNUSED(void, glRasterPos3fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glRasterPos3i, (GLint x, GLint y, GLint z)) +SDL_PROC_UNUSED(void, glRasterPos3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glRasterPos3s, (GLshort x, GLshort y, GLshort z)) +SDL_PROC_UNUSED(void, glRasterPos3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glRasterPos4d, + (GLdouble x, GLdouble y, GLdouble z, GLdouble w)) +SDL_PROC_UNUSED(void, glRasterPos4dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glRasterPos4f, + (GLfloat x, GLfloat y, GLfloat z, GLfloat w)) +SDL_PROC_UNUSED(void, glRasterPos4fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glRasterPos4i, (GLint x, GLint y, GLint z, GLint w)) +SDL_PROC_UNUSED(void, glRasterPos4iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glRasterPos4s, + (GLshort x, GLshort y, GLshort z, GLshort w)) +SDL_PROC_UNUSED(void, glRasterPos4sv, (const GLshort * v)) +SDL_PROC(void, glReadBuffer, (GLenum mode)) +SDL_PROC(void, glReadPixels, + (GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, GLvoid * pixels)) +SDL_PROC_UNUSED(void, glRectd, + (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)) +SDL_PROC_UNUSED(void, glRectdv, (const GLdouble * v1, const GLdouble * v2)) +SDL_PROC(void, glRectf, + (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)) +SDL_PROC_UNUSED(void, glRectfv, (const GLfloat * v1, const GLfloat * v2)) +SDL_PROC_UNUSED(void, glRecti, (GLint x1, GLint y1, GLint x2, GLint y2)) +SDL_PROC_UNUSED(void, glRectiv, (const GLint * v1, const GLint * v2)) +SDL_PROC_UNUSED(void, glRects, + (GLshort x1, GLshort y1, GLshort x2, GLshort y2)) +SDL_PROC_UNUSED(void, glRectsv, (const GLshort * v1, const GLshort * v2)) +SDL_PROC_UNUSED(GLint, glRenderMode, (GLenum mode)) +SDL_PROC(void, glRotated, + (GLdouble angle, GLdouble x, GLdouble y, GLdouble z)) +SDL_PROC_UNUSED(void, glRotatef, + (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) +SDL_PROC_UNUSED(void, glScaled, (GLdouble x, GLdouble y, GLdouble z)) +SDL_PROC_UNUSED(void, glScalef, (GLfloat x, GLfloat y, GLfloat z)) +SDL_PROC(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height)) +SDL_PROC_UNUSED(void, glSelectBuffer, (GLsizei size, GLuint * buffer)) +SDL_PROC_UNUSED(void, glShadeModel, (GLenum mode)) +SDL_PROC_UNUSED(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask)) +SDL_PROC_UNUSED(void, glStencilMask, (GLuint mask)) +SDL_PROC_UNUSED(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass)) +SDL_PROC_UNUSED(void, glTexCoord1d, (GLdouble s)) +SDL_PROC_UNUSED(void, glTexCoord1dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glTexCoord1f, (GLfloat s)) +SDL_PROC_UNUSED(void, glTexCoord1fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord1i, (GLint s)) +SDL_PROC_UNUSED(void, glTexCoord1iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord1s, (GLshort s)) +SDL_PROC_UNUSED(void, glTexCoord1sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoord2d, (GLdouble s, GLdouble t)) +SDL_PROC_UNUSED(void, glTexCoord2dv, (const GLdouble * v)) +SDL_PROC(void, glTexCoord2f, (GLfloat s, GLfloat t)) +SDL_PROC_UNUSED(void, glTexCoord2fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord2i, (GLint s, GLint t)) +SDL_PROC_UNUSED(void, glTexCoord2iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord2s, (GLshort s, GLshort t)) +SDL_PROC_UNUSED(void, glTexCoord2sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoord3d, (GLdouble s, GLdouble t, GLdouble r)) +SDL_PROC_UNUSED(void, glTexCoord3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glTexCoord3f, (GLfloat s, GLfloat t, GLfloat r)) +SDL_PROC_UNUSED(void, glTexCoord3fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord3i, (GLint s, GLint t, GLint r)) +SDL_PROC_UNUSED(void, glTexCoord3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord3s, (GLshort s, GLshort t, GLshort r)) +SDL_PROC_UNUSED(void, glTexCoord3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoord4d, + (GLdouble s, GLdouble t, GLdouble r, GLdouble q)) +SDL_PROC_UNUSED(void, glTexCoord4dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glTexCoord4f, + (GLfloat s, GLfloat t, GLfloat r, GLfloat q)) +SDL_PROC_UNUSED(void, glTexCoord4fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord4i, (GLint s, GLint t, GLint r, GLint q)) +SDL_PROC_UNUSED(void, glTexCoord4iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord4s, + (GLshort s, GLshort t, GLshort r, GLshort q)) +SDL_PROC_UNUSED(void, glTexCoord4sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoordPointer, + (GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer)) +SDL_PROC(void, glTexEnvf, (GLenum target, GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glTexEnvfv, + (GLenum target, GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glTexEnvi, (GLenum target, GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glTexEnviv, + (GLenum target, GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glTexGend, (GLenum coord, GLenum pname, GLdouble param)) +SDL_PROC_UNUSED(void, glTexGendv, + (GLenum coord, GLenum pname, const GLdouble * params)) +SDL_PROC_UNUSED(void, glTexGenf, (GLenum coord, GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glTexGenfv, + (GLenum coord, GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glTexGeni, (GLenum coord, GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glTexGeniv, + (GLenum coord, GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glTexImage1D, + (GLenum target, GLint level, GLint internalformat, + GLsizei width, GLint border, GLenum format, GLenum type, + const GLvoid * pixels)) +SDL_PROC(void, glTexImage2D, + (GLenum target, GLint level, GLint internalformat, GLsizei width, + GLsizei height, GLint border, GLenum format, GLenum type, + const GLvoid * pixels)) +SDL_PROC_UNUSED(void, glTexParameterf, + (GLenum target, GLenum pname, GLfloat param)) +SDL_PROC_UNUSED(void, glTexParameterfv, + (GLenum target, GLenum pname, const GLfloat * params)) +SDL_PROC(void, glTexParameteri, (GLenum target, GLenum pname, GLint param)) +SDL_PROC_UNUSED(void, glTexParameteriv, + (GLenum target, GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glTexSubImage1D, + (GLenum target, GLint level, GLint xoffset, GLsizei width, + GLenum format, GLenum type, const GLvoid * pixels)) +SDL_PROC(void, glTexSubImage2D, + (GLenum target, GLint level, GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, GLenum type, + const GLvoid * pixels)) +SDL_PROC_UNUSED(void, glTranslated, (GLdouble x, GLdouble y, GLdouble z)) +SDL_PROC(void, glTranslatef, (GLfloat x, GLfloat y, GLfloat z)) +SDL_PROC_UNUSED(void, glVertex2d, (GLdouble x, GLdouble y)) +SDL_PROC_UNUSED(void, glVertex2dv, (const GLdouble * v)) +SDL_PROC(void, glVertex2f, (GLfloat x, GLfloat y)) +SDL_PROC_UNUSED(void, glVertex2fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glVertex2i, (GLint x, GLint y)) +SDL_PROC_UNUSED(void, glVertex2iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glVertex2s, (GLshort x, GLshort y)) +SDL_PROC_UNUSED(void, glVertex2sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glVertex3d, (GLdouble x, GLdouble y, GLdouble z)) +SDL_PROC_UNUSED(void, glVertex3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glVertex3f, (GLfloat x, GLfloat y, GLfloat z)) +SDL_PROC_UNUSED(void, glVertex3fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glVertex3i, (GLint x, GLint y, GLint z)) +SDL_PROC_UNUSED(void, glVertex3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glVertex3s, (GLshort x, GLshort y, GLshort z)) +SDL_PROC_UNUSED(void, glVertex3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glVertex4d, + (GLdouble x, GLdouble y, GLdouble z, GLdouble w)) +SDL_PROC_UNUSED(void, glVertex4dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glVertex4f, + (GLfloat x, GLfloat y, GLfloat z, GLfloat w)) +SDL_PROC_UNUSED(void, glVertex4fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glVertex4i, (GLint x, GLint y, GLint z, GLint w)) +SDL_PROC_UNUSED(void, glVertex4iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glVertex4s, + (GLshort x, GLshort y, GLshort z, GLshort w)) +SDL_PROC_UNUSED(void, glVertex4sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glVertexPointer, + (GLint size, GLenum type, GLsizei stride, + const GLvoid * pointer)) +SDL_PROC(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height)) + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c new file mode 100644 index 0000000000..697a974c50 --- /dev/null +++ b/src/render/opengl/SDL_render_gl.c @@ -0,0 +1,1410 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED + +#include "SDL_hints.h" +#include "SDL_log.h" +#include "SDL_opengl.h" +#include "../SDL_sysrender.h" +#include "SDL_shaders_gl.h" + +#ifdef __MACOSX__ +#include +#endif + + +/* OpenGL renderer implementation */ + +/* Details on optimizing the texture path on Mac OS X: + http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/opengl_texturedata.html +*/ + +/* Used to re-create the window with OpenGL capability */ +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); + +static const float inv255f = 1.0f / 255.0f; + +static SDL_Renderer *GL_CreateRenderer(SDL_Window * window, Uint32 flags); +static void GL_WindowEvent(SDL_Renderer * renderer, + const SDL_WindowEvent *event); +static int GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, + int pitch); +static int GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch); +static void GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture); +static int GL_UpdateViewport(SDL_Renderer * renderer); +static int GL_UpdateClipRect(SDL_Renderer * renderer); +static int GL_RenderClear(SDL_Renderer * renderer); +static int GL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int GL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int GL_RenderFillRects(SDL_Renderer * renderer, + const SDL_FRect * rects, int count); +static int GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect); +static int GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip); +static int GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch); +static void GL_RenderPresent(SDL_Renderer * renderer); +static void GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static void GL_DestroyRenderer(SDL_Renderer * renderer); +static int GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh); +static int GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture); + +SDL_RenderDriver GL_RenderDriver = { + GL_CreateRenderer, + { + "opengl", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 1, + {SDL_PIXELFORMAT_ARGB8888}, + 0, + 0} +}; + +typedef struct GL_FBOList GL_FBOList; + +struct GL_FBOList +{ + Uint32 w, h; + GLuint FBO; + GL_FBOList *next; +}; + +typedef struct +{ + SDL_GLContext context; + + SDL_bool debug_enabled; + SDL_bool GL_ARB_debug_output_supported; + int errors; + char **error_messages; + GLDEBUGPROCARB next_error_callback; + GLvoid *next_error_userparam; + + SDL_bool GL_ARB_texture_rectangle_supported; + struct { + GL_Shader shader; + Uint32 color; + int blendMode; + } current; + + SDL_bool GL_EXT_framebuffer_object_supported; + GL_FBOList *framebuffers; + + /* OpenGL functions */ +#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#include "SDL_glfuncs.h" +#undef SDL_PROC + + /* Multitexture support */ + SDL_bool GL_ARB_multitexture_supported; + PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; + GLint num_texture_units; + + PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT; + PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT; + PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT; + PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT; + PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT; + + /* Shader support */ + GL_ShaderContext *shaders; + +} GL_RenderData; + +typedef struct +{ + GLuint texture; + GLenum type; + GLfloat texw; + GLfloat texh; + GLenum format; + GLenum formattype; + void *pixels; + int pitch; + SDL_Rect locked_rect; + + /* YV12 texture support */ + SDL_bool yuv; + GLuint utexture; + GLuint vtexture; + + GL_FBOList *fbo; +} GL_TextureData; + +SDL_FORCE_INLINE const char* +GL_TranslateError (GLenum error) +{ +#define GL_ERROR_TRANSLATE(e) case e: return #e; + switch (error) { + GL_ERROR_TRANSLATE(GL_INVALID_ENUM) + GL_ERROR_TRANSLATE(GL_INVALID_VALUE) + GL_ERROR_TRANSLATE(GL_INVALID_OPERATION) + GL_ERROR_TRANSLATE(GL_OUT_OF_MEMORY) + GL_ERROR_TRANSLATE(GL_NO_ERROR) + GL_ERROR_TRANSLATE(GL_STACK_OVERFLOW) + GL_ERROR_TRANSLATE(GL_STACK_UNDERFLOW) + GL_ERROR_TRANSLATE(GL_TABLE_TOO_LARGE) + default: + return "UNKNOWN"; +} +#undef GL_ERROR_TRANSLATE +} + +SDL_FORCE_INLINE void +GL_ClearErrors(SDL_Renderer *renderer) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + if (!data->debug_enabled) + { + return; + } + if (data->GL_ARB_debug_output_supported) { + if (data->errors) { + int i; + for (i = 0; i < data->errors; ++i) { + SDL_free(data->error_messages[i]); + } + SDL_free(data->error_messages); + + data->errors = 0; + data->error_messages = NULL; + } + } else { + while (data->glGetError() != GL_NO_ERROR) { + continue; + } + } +} + +SDL_FORCE_INLINE int +GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + int ret = 0; + + if (!data->debug_enabled) + { + return 0; + } + if (data->GL_ARB_debug_output_supported) { + if (data->errors) { + int i; + for (i = 0; i < data->errors; ++i) { + SDL_SetError("%s: %s (%d): %s %s", prefix, file, line, function, data->error_messages[i]); + ret = -1; + } + GL_ClearErrors(renderer); + } + } else { + /* check gl errors (can return multiple errors) */ + for (;;) { + GLenum error = data->glGetError(); + if (error != GL_NO_ERROR) { + if (prefix == NULL || prefix[0] == '\0') { + prefix = "generic"; + } + SDL_SetError("%s: %s (%d): %s %s (0x%X)", prefix, file, line, function, GL_TranslateError(error), error); + ret = -1; + } else { + break; + } + } + } + return ret; +} + +#if 0 +#define GL_CheckError(prefix, renderer) +#elif defined(_MSC_VER) +#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __FUNCTION__) +#else +#define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, __FILE__, __LINE__, __PRETTY_FUNCTION__) +#endif + +static int +GL_LoadFunctions(GL_RenderData * data) +{ +#ifdef __SDL_NOGETPROCADDR__ +#define SDL_PROC(ret,func,params) data->func=func; +#else +#define SDL_PROC(ret,func,params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if ( ! data->func ) { \ + return SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \ + } \ + } while ( 0 ); +#endif /* __SDL_NOGETPROCADDR__ */ + +#include "SDL_glfuncs.h" +#undef SDL_PROC + return 0; +} + +static SDL_GLContext SDL_CurrentContext = NULL; + +static int +GL_ActivateRenderer(SDL_Renderer * renderer) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + if (SDL_CurrentContext != data->context) { + if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) { + return -1; + } + SDL_CurrentContext = data->context; + + GL_UpdateViewport(renderer); + } + + GL_ClearErrors(renderer); + + return 0; +} + +/* This is called if we need to invalidate all of the SDL OpenGL state */ +static void +GL_ResetState(SDL_Renderer *renderer) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + if (SDL_CurrentContext == data->context) { + GL_UpdateViewport(renderer); + } else { + GL_ActivateRenderer(renderer); + } + + data->current.shader = SHADER_NONE; + data->current.color = 0; + data->current.blendMode = -1; + + data->glDisable(GL_DEPTH_TEST); + data->glDisable(GL_CULL_FACE); + /* This ended up causing video discrepancies between OpenGL and Direct3D */ + /*data->glEnable(GL_LINE_SMOOTH);*/ + + data->glMatrixMode(GL_MODELVIEW); + data->glLoadIdentity(); + + GL_CheckError("", renderer); +} + +static void APIENTRY +GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, void *userParam) +{ + SDL_Renderer *renderer = (SDL_Renderer *) userParam; + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + if (type == GL_DEBUG_TYPE_ERROR_ARB) { + /* Record this error */ + ++data->errors; + data->error_messages = SDL_realloc(data->error_messages, data->errors * sizeof(*data->error_messages)); + if (data->error_messages) { + data->error_messages[data->errors-1] = SDL_strdup(message); + } + } + + /* If there's another error callback, pass it along, otherwise log it */ + if (data->next_error_callback) { + data->next_error_callback(source, type, id, severity, length, message, data->next_error_userparam); + } else { + if (type == GL_DEBUG_TYPE_ERROR_ARB) { + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "%s", message); + } else { + SDL_LogDebug(SDL_LOG_CATEGORY_RENDER, "%s", message); + } + } +} + +static GL_FBOList * +GL_GetFBO(GL_RenderData *data, Uint32 w, Uint32 h) +{ + GL_FBOList *result = data->framebuffers; + + while (result && ((result->w != w) || (result->h != h))) { + result = result->next; + } + + if (!result) { + result = SDL_malloc(sizeof(GL_FBOList)); + if (result) { + result->w = w; + result->h = h; + data->glGenFramebuffersEXT(1, &result->FBO); + result->next = data->framebuffers; + data->framebuffers = result; + } + } + return result; +} + +SDL_Renderer * +GL_CreateRenderer(SDL_Window * window, Uint32 flags) +{ + SDL_Renderer *renderer; + GL_RenderData *data; + const char *hint; + GLint value; + Uint32 window_flags; + + window_flags = SDL_GetWindowFlags(window); + if (!(window_flags & SDL_WINDOW_OPENGL)) { + if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) { + /* Uh oh, better try to put it back... */ + SDL_RecreateWindow(window, window_flags); + return NULL; + } + } + + renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); + if (!renderer) { + SDL_OutOfMemory(); + return NULL; + } + + data = (GL_RenderData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + GL_DestroyRenderer(renderer); + SDL_OutOfMemory(); + return NULL; + } + + renderer->WindowEvent = GL_WindowEvent; + renderer->CreateTexture = GL_CreateTexture; + renderer->UpdateTexture = GL_UpdateTexture; + renderer->LockTexture = GL_LockTexture; + renderer->UnlockTexture = GL_UnlockTexture; + renderer->SetRenderTarget = GL_SetRenderTarget; + renderer->UpdateViewport = GL_UpdateViewport; + renderer->UpdateClipRect = GL_UpdateClipRect; + renderer->RenderClear = GL_RenderClear; + renderer->RenderDrawPoints = GL_RenderDrawPoints; + renderer->RenderDrawLines = GL_RenderDrawLines; + renderer->RenderFillRects = GL_RenderFillRects; + renderer->RenderCopy = GL_RenderCopy; + renderer->RenderCopyEx = GL_RenderCopyEx; + renderer->RenderReadPixels = GL_RenderReadPixels; + renderer->RenderPresent = GL_RenderPresent; + renderer->DestroyTexture = GL_DestroyTexture; + renderer->DestroyRenderer = GL_DestroyRenderer; + renderer->GL_BindTexture = GL_BindTexture; + renderer->GL_UnbindTexture = GL_UnbindTexture; + renderer->info = GL_RenderDriver.info; + renderer->info.flags = SDL_RENDERER_ACCELERATED; + renderer->driverdata = data; + renderer->window = window; + + data->context = SDL_GL_CreateContext(window); + if (!data->context) { + GL_DestroyRenderer(renderer); + return NULL; + } + if (SDL_GL_MakeCurrent(window, data->context) < 0) { + GL_DestroyRenderer(renderer); + return NULL; + } + + if (GL_LoadFunctions(data) < 0) { + GL_DestroyRenderer(renderer); + return NULL; + } + +#ifdef __MACOSX__ + /* Enable multi-threaded rendering */ + /* Disabled until Ryan finishes his VBO/PBO code... + CGLEnable(CGLGetCurrentContext(), kCGLCEMPEngine); + */ +#endif + + if (flags & SDL_RENDERER_PRESENTVSYNC) { + SDL_GL_SetSwapInterval(1); + } else { + SDL_GL_SetSwapInterval(0); + } + if (SDL_GL_GetSwapInterval() > 0) { + renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; + } + + /* Check for debug output support */ + if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_FLAGS, &value) == 0 && + (value & SDL_GL_CONTEXT_DEBUG_FLAG)) { + data->debug_enabled = SDL_TRUE; + } + if (data->debug_enabled && SDL_GL_ExtensionSupported("GL_ARB_debug_output")) { + PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB"); + + data->GL_ARB_debug_output_supported = SDL_TRUE; + data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)&data->next_error_callback); + data->glGetPointerv(GL_DEBUG_CALLBACK_USER_PARAM_ARB, &data->next_error_userparam); + glDebugMessageCallbackARBFunc(GL_HandleDebugMessage, renderer); + + /* Make sure our callback is called when errors actually happen */ + data->glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB); + } + + if (SDL_GL_ExtensionSupported("GL_ARB_texture_rectangle") + || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) { + data->GL_ARB_texture_rectangle_supported = SDL_TRUE; + data->glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &value); + renderer->info.max_texture_width = value; + renderer->info.max_texture_height = value; + } else { + data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value); + renderer->info.max_texture_width = value; + renderer->info.max_texture_height = value; + } + + /* Check for multitexture support */ + if (SDL_GL_ExtensionSupported("GL_ARB_multitexture")) { + data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB"); + if (data->glActiveTextureARB) { + data->GL_ARB_multitexture_supported = SDL_TRUE; + data->glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->num_texture_units); + } + } + + /* Check for shader support */ + hint = SDL_GetHint(SDL_HINT_RENDER_OPENGL_SHADERS); + if (!hint || *hint != '0') { + data->shaders = GL_CreateShaderContext(); + } + SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, "OpenGL shaders: %s", + data->shaders ? "ENABLED" : "DISABLED"); + + /* We support YV12 textures using 3 textures and a shader */ + if (data->shaders && data->num_texture_units >= 3) { + renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12; + renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV; + } + + if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object")) { + data->GL_EXT_framebuffer_object_supported = SDL_TRUE; + data->glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) + SDL_GL_GetProcAddress("glGenFramebuffersEXT"); + data->glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC) + SDL_GL_GetProcAddress("glDeleteFramebuffersEXT"); + data->glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) + SDL_GL_GetProcAddress("glFramebufferTexture2DEXT"); + data->glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC) + SDL_GL_GetProcAddress("glBindFramebufferEXT"); + data->glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) + SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT"); + renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE; + } + data->framebuffers = NULL; + + /* Set up parameters for rendering */ + GL_ResetState(renderer); + + return renderer; +} + +static void +GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +{ + if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED || + event->event == SDL_WINDOWEVENT_SHOWN || + event->event == SDL_WINDOWEVENT_HIDDEN) { + /* Rebind the context to the window area and update matrices */ + SDL_CurrentContext = NULL; + } +} + +SDL_FORCE_INLINE int +power_of_2(int input) +{ + int value = 1; + + while (value < input) { + value <<= 1; + } + return value; +} + +SDL_FORCE_INLINE SDL_bool +convert_format(GL_RenderData *renderdata, Uint32 pixel_format, + GLint* internalFormat, GLenum* format, GLenum* type) +{ + switch (pixel_format) { + case SDL_PIXELFORMAT_ARGB8888: + *internalFormat = GL_RGBA8; + *format = GL_BGRA; + *type = GL_UNSIGNED_INT_8_8_8_8_REV; + break; + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + *internalFormat = GL_LUMINANCE; + *format = GL_LUMINANCE; + *type = GL_UNSIGNED_BYTE; + break; + default: + return SDL_FALSE; + } + return SDL_TRUE; +} + +static GLenum +GetScaleQuality(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); + + if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { + return GL_NEAREST; + } else { + return GL_LINEAR; + } +} + +static int +GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_TextureData *data; + GLint internalFormat; + GLenum format, type; + int texture_w, texture_h; + GLenum scaleMode; + + GL_ActivateRenderer(renderer); + + if (!convert_format(renderdata, texture->format, &internalFormat, + &format, &type)) { + return SDL_SetError("Texture format %s not supported by OpenGL", + SDL_GetPixelFormatName(texture->format)); + } + + data = (GL_TextureData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + return SDL_OutOfMemory(); + } + + if (texture->access == SDL_TEXTUREACCESS_STREAMING) { + size_t size; + data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format); + size = texture->h * data->pitch; + if (texture->format == SDL_PIXELFORMAT_YV12 || + texture->format == SDL_PIXELFORMAT_IYUV) { + /* Need to add size for the U and V planes */ + size += (2 * (texture->h * data->pitch) / 4); + } + data->pixels = SDL_calloc(1, size); + if (!data->pixels) { + SDL_free(data); + return SDL_OutOfMemory(); + } + } + + texture->driverdata = data; + + if (texture->access == SDL_TEXTUREACCESS_TARGET) { + data->fbo = GL_GetFBO(renderdata, texture->w, texture->h); + } else { + data->fbo = NULL; + } + + GL_CheckError("", renderer); + renderdata->glGenTextures(1, &data->texture); + if (GL_CheckError("glGenTexures()", renderer) < 0) { + SDL_free(data); + return -1; + } + if ((renderdata->GL_ARB_texture_rectangle_supported) + /*&& texture->access != SDL_TEXTUREACCESS_TARGET*/){ + data->type = GL_TEXTURE_RECTANGLE_ARB; + texture_w = texture->w; + texture_h = texture->h; + data->texw = (GLfloat) texture_w; + data->texh = (GLfloat) texture_h; + } else { + data->type = GL_TEXTURE_2D; + texture_w = power_of_2(texture->w); + texture_h = power_of_2(texture->h); + data->texw = (GLfloat) (texture->w) / texture_w; + data->texh = (GLfloat) texture->h / texture_h; + } + + data->format = format; + data->formattype = type; + scaleMode = GetScaleQuality(); + renderdata->glEnable(data->type); + renderdata->glBindTexture(data->type, data->texture); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, scaleMode); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, scaleMode); + /* According to the spec, CLAMP_TO_EDGE is the default for TEXTURE_RECTANGLE + and setting it causes an INVALID_ENUM error in the latest NVidia drivers. + */ + if (data->type != GL_TEXTURE_RECTANGLE_ARB) { + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S, + GL_CLAMP_TO_EDGE); + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T, + GL_CLAMP_TO_EDGE); + } +#ifdef __MACOSX__ +#ifndef GL_TEXTURE_STORAGE_HINT_APPLE +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#endif +#ifndef STORAGE_CACHED_APPLE +#define STORAGE_CACHED_APPLE 0x85BE +#endif +#ifndef STORAGE_SHARED_APPLE +#define STORAGE_SHARED_APPLE 0x85BF +#endif + if (texture->access == SDL_TEXTUREACCESS_STREAMING) { + renderdata->glTexParameteri(data->type, GL_TEXTURE_STORAGE_HINT_APPLE, + GL_STORAGE_SHARED_APPLE); + } else { + renderdata->glTexParameteri(data->type, GL_TEXTURE_STORAGE_HINT_APPLE, + GL_STORAGE_CACHED_APPLE); + } + if (texture->access == SDL_TEXTUREACCESS_STREAMING + && texture->format == SDL_PIXELFORMAT_ARGB8888 + && (texture->w % 8) == 0) { + renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); + renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, + (data->pitch / SDL_BYTESPERPIXEL(texture->format))); + renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w, + texture_h, 0, format, type, data->pixels); + renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE); + } + else +#endif + { + renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w, + texture_h, 0, format, type, NULL); + } + renderdata->glDisable(data->type); + if (GL_CheckError("glTexImage2D()", renderer) < 0) { + return -1; + } + + if (texture->format == SDL_PIXELFORMAT_YV12 || + texture->format == SDL_PIXELFORMAT_IYUV) { + data->yuv = SDL_TRUE; + + renderdata->glGenTextures(1, &data->utexture); + renderdata->glGenTextures(1, &data->vtexture); + renderdata->glEnable(data->type); + + renderdata->glBindTexture(data->type, data->utexture); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, + scaleMode); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, + scaleMode); + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S, + GL_CLAMP_TO_EDGE); + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T, + GL_CLAMP_TO_EDGE); + renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w/2, + texture_h/2, 0, format, type, NULL); + + renderdata->glBindTexture(data->type, data->vtexture); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, + scaleMode); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, + scaleMode); + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S, + GL_CLAMP_TO_EDGE); + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T, + GL_CLAMP_TO_EDGE); + renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w/2, + texture_h/2, 0, format, type, NULL); + + renderdata->glDisable(data->type); + } + + return GL_CheckError("", renderer); +} + +static int +GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, int pitch) +{ + GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_TextureData *data = (GL_TextureData *) texture->driverdata; + + GL_ActivateRenderer(renderer); + + renderdata->glEnable(data->type); + renderdata->glBindTexture(data->type, data->texture); + renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, + (pitch / SDL_BYTESPERPIXEL(texture->format))); + renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w, + rect->h, data->format, data->formattype, + pixels); + if (data->yuv) { + renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / 2)); + + /* Skip to the correct offset into the next texture */ + pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + if (texture->format == SDL_PIXELFORMAT_YV12) { + renderdata->glBindTexture(data->type, data->vtexture); + } else { + renderdata->glBindTexture(data->type, data->utexture); + } + renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2, + rect->w/2, rect->h/2, + data->format, data->formattype, pixels); + + /* Skip to the correct offset into the next texture */ + pixels = (const void*)((const Uint8*)pixels + (rect->h * pitch)/4); + if (texture->format == SDL_PIXELFORMAT_YV12) { + renderdata->glBindTexture(data->type, data->utexture); + } else { + renderdata->glBindTexture(data->type, data->vtexture); + } + renderdata->glTexSubImage2D(data->type, 0, rect->x/2, rect->y/2, + rect->w/2, rect->h/2, + data->format, data->formattype, pixels); + } + renderdata->glDisable(data->type); + return GL_CheckError("glTexSubImage2D()", renderer); +} + +static int +GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch) +{ + GL_TextureData *data = (GL_TextureData *) texture->driverdata; + + data->locked_rect = *rect; + *pixels = + (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pitch = data->pitch; + return 0; +} + +static void +GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GL_TextureData *data = (GL_TextureData *) texture->driverdata; + const SDL_Rect *rect; + void *pixels; + + rect = &data->locked_rect; + pixels = + (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + GL_UpdateTexture(renderer, texture, rect, pixels, data->pitch); +} + +static int +GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_TextureData *texturedata; + GLenum status; + + GL_ActivateRenderer(renderer); + + if (texture == NULL) { + data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + return 0; + } + + texturedata = (GL_TextureData *) texture->driverdata; + data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, texturedata->fbo->FBO); + /* TODO: check if texture pixel format allows this operation */ + data->glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, texturedata->type, texturedata->texture, 0); + /* Check FBO status */ + status = data->glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + return SDL_SetError("glFramebufferTexture2DEXT() failed"); + } + return 0; +} + +static int +GL_UpdateViewport(SDL_Renderer * renderer) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + if (SDL_CurrentContext != data->context) { + /* We'll update the viewport after we rebind the context */ + return 0; + } + + data->glViewport(renderer->viewport.x, renderer->viewport.y, + renderer->viewport.w, renderer->viewport.h); + + data->glMatrixMode(GL_PROJECTION); + data->glLoadIdentity(); + if (renderer->viewport.w && renderer->viewport.h) { + if (renderer->target) { + data->glOrtho((GLdouble) 0, + (GLdouble) renderer->viewport.w, + (GLdouble) 0, + (GLdouble) renderer->viewport.h, + 0.0, 1.0); + } else { + data->glOrtho((GLdouble) 0, + (GLdouble) renderer->viewport.w, + (GLdouble) renderer->viewport.h, + (GLdouble) 0, + 0.0, 1.0); + } + } + return GL_CheckError("", renderer); +} + +static int +GL_UpdateClipRect(SDL_Renderer * renderer) +{ + const SDL_Rect *rect = &renderer->clip_rect; + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + if (!SDL_RectEmpty(rect)) { + data->glEnable(GL_SCISSOR_TEST); + data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h); + } else { + data->glDisable(GL_SCISSOR_TEST); + } + return 0; +} + +static void +GL_SetShader(GL_RenderData * data, GL_Shader shader) +{ + if (data->shaders && shader != data->current.shader) { + GL_SelectShader(data->shaders, shader); + data->current.shader = shader; + } +} + +static void +GL_SetColor(GL_RenderData * data, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + Uint32 color = ((a << 24) | (r << 16) | (g << 8) | b); + + if (color != data->current.color) { + data->glColor4f((GLfloat) r * inv255f, + (GLfloat) g * inv255f, + (GLfloat) b * inv255f, + (GLfloat) a * inv255f); + data->current.color = color; + } +} + +static void +GL_SetBlendMode(GL_RenderData * data, int blendMode) +{ + if (blendMode != data->current.blendMode) { + switch (blendMode) { + case SDL_BLENDMODE_NONE: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + data->glDisable(GL_BLEND); + break; + case SDL_BLENDMODE_BLEND: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + data->glEnable(GL_BLEND); + data->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + break; + case SDL_BLENDMODE_ADD: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + data->glEnable(GL_BLEND); + data->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE); + break; + case SDL_BLENDMODE_MOD: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + data->glEnable(GL_BLEND); + data->glBlendFuncSeparate(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE); + break; + } + data->current.blendMode = blendMode; + } +} + +static void +GL_SetDrawingState(SDL_Renderer * renderer) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + GL_ActivateRenderer(renderer); + + GL_SetColor(data, renderer->r, + renderer->g, + renderer->b, + renderer->a); + + GL_SetBlendMode(data, renderer->blendMode); + + GL_SetShader(data, SHADER_SOLID); +} + +static int +GL_RenderClear(SDL_Renderer * renderer) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + GL_ActivateRenderer(renderer); + + data->glClearColor((GLfloat) renderer->r * inv255f, + (GLfloat) renderer->g * inv255f, + (GLfloat) renderer->b * inv255f, + (GLfloat) renderer->a * inv255f); + + data->glClear(GL_COLOR_BUFFER_BIT); + + return 0; +} + +static int +GL_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + int i; + + GL_SetDrawingState(renderer); + + data->glBegin(GL_POINTS); + for (i = 0; i < count; ++i) { + data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); + } + data->glEnd(); + + return 0; +} + +static int +GL_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + int i; + + GL_SetDrawingState(renderer); + + if (count > 2 && + points[0].x == points[count-1].x && points[0].y == points[count-1].y) { + data->glBegin(GL_LINE_LOOP); + /* GL_LINE_LOOP takes care of the final segment */ + --count; + for (i = 0; i < count; ++i) { + data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); + } + data->glEnd(); + } else { +#if defined(__APPLE__) || defined(__WIN32__) +#else + int x1, y1, x2, y2; +#endif + + data->glBegin(GL_LINE_STRIP); + for (i = 0; i < count; ++i) { + data->glVertex2f(0.5f + points[i].x, 0.5f + points[i].y); + } + data->glEnd(); + + /* The line is half open, so we need one more point to complete it. + * http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node47.html + * If we have to, we can use vertical line and horizontal line textures + * for vertical and horizontal lines, and then create custom textures + * for diagonal lines and software render those. It's terrible, but at + * least it would be pixel perfect. + */ + data->glBegin(GL_POINTS); +#if defined(__APPLE__) || defined(__WIN32__) + /* Mac OS X and Windows seem to always leave the second point open */ + data->glVertex2f(0.5f + points[count-1].x, 0.5f + points[count-1].y); +#else + /* Linux seems to leave the right-most or bottom-most point open */ + x1 = points[0].x; + y1 = points[0].y; + x2 = points[count-1].x; + y2 = points[count-1].y; + + if (x1 > x2) { + data->glVertex2f(0.5f + x1, 0.5f + y1); + } else if (x2 > x1) { + data->glVertex2f(0.5f + x2, 0.5f + y2); + } else if (y1 > y2) { + data->glVertex2f(0.5f + x1, 0.5f + y1); + } else if (y2 > y1) { + data->glVertex2f(0.5f + x2, 0.5f + y2); + } +#endif + data->glEnd(); + } + return GL_CheckError("", renderer); +} + +static int +GL_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + int i; + + GL_SetDrawingState(renderer); + + for (i = 0; i < count; ++i) { + const SDL_FRect *rect = &rects[i]; + + data->glRectf(rect->x, rect->y, rect->x + rect->w, rect->y + rect->h); + } + return GL_CheckError("", renderer); +} + +static int +GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata; + GLfloat minx, miny, maxx, maxy; + GLfloat minu, maxu, minv, maxv; + + GL_ActivateRenderer(renderer); + + data->glEnable(texturedata->type); + if (texturedata->yuv) { + data->glActiveTextureARB(GL_TEXTURE2_ARB); + data->glBindTexture(texturedata->type, texturedata->vtexture); + + data->glActiveTextureARB(GL_TEXTURE1_ARB); + data->glBindTexture(texturedata->type, texturedata->utexture); + + data->glActiveTextureARB(GL_TEXTURE0_ARB); + } + data->glBindTexture(texturedata->type, texturedata->texture); + + if (texture->modMode) { + GL_SetColor(data, texture->r, texture->g, texture->b, texture->a); + } else { + GL_SetColor(data, 255, 255, 255, 255); + } + + GL_SetBlendMode(data, texture->blendMode); + + if (texturedata->yuv) { + GL_SetShader(data, SHADER_YV12); + } else { + GL_SetShader(data, SHADER_RGB); + } + + minx = dstrect->x; + miny = dstrect->y; + maxx = dstrect->x + dstrect->w; + maxy = dstrect->y + dstrect->h; + + minu = (GLfloat) srcrect->x / texture->w; + minu *= texturedata->texw; + maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w; + maxu *= texturedata->texw; + minv = (GLfloat) srcrect->y / texture->h; + minv *= texturedata->texh; + maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h; + maxv *= texturedata->texh; + + data->glBegin(GL_TRIANGLE_STRIP); + data->glTexCoord2f(minu, minv); + data->glVertex2f(minx, miny); + data->glTexCoord2f(maxu, minv); + data->glVertex2f(maxx, miny); + data->glTexCoord2f(minu, maxv); + data->glVertex2f(minx, maxy); + data->glTexCoord2f(maxu, maxv); + data->glVertex2f(maxx, maxy); + data->glEnd(); + + data->glDisable(texturedata->type); + + return GL_CheckError("", renderer); +} + +static int +GL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata; + GLfloat minx, miny, maxx, maxy; + GLfloat centerx, centery; + GLfloat minu, maxu, minv, maxv; + + GL_ActivateRenderer(renderer); + + data->glEnable(texturedata->type); + if (texturedata->yuv) { + data->glActiveTextureARB(GL_TEXTURE2_ARB); + data->glBindTexture(texturedata->type, texturedata->vtexture); + + data->glActiveTextureARB(GL_TEXTURE1_ARB); + data->glBindTexture(texturedata->type, texturedata->utexture); + + data->glActiveTextureARB(GL_TEXTURE0_ARB); + } + data->glBindTexture(texturedata->type, texturedata->texture); + + if (texture->modMode) { + GL_SetColor(data, texture->r, texture->g, texture->b, texture->a); + } else { + GL_SetColor(data, 255, 255, 255, 255); + } + + GL_SetBlendMode(data, texture->blendMode); + + if (texturedata->yuv) { + GL_SetShader(data, SHADER_YV12); + } else { + GL_SetShader(data, SHADER_RGB); + } + + centerx = center->x; + centery = center->y; + + if (flip & SDL_FLIP_HORIZONTAL) { + minx = dstrect->w - centerx; + maxx = -centerx; + } + else { + minx = -centerx; + maxx = dstrect->w - centerx; + } + + if (flip & SDL_FLIP_VERTICAL) { + miny = dstrect->h - centery; + maxy = -centery; + } + else { + miny = -centery; + maxy = dstrect->h - centery; + } + + minu = (GLfloat) srcrect->x / texture->w; + minu *= texturedata->texw; + maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w; + maxu *= texturedata->texw; + minv = (GLfloat) srcrect->y / texture->h; + minv *= texturedata->texh; + maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h; + maxv *= texturedata->texh; + + /* Translate to flip, rotate, translate to position */ + data->glPushMatrix(); + data->glTranslatef((GLfloat)dstrect->x + centerx, (GLfloat)dstrect->y + centery, (GLfloat)0.0); + data->glRotated(angle, (GLdouble)0.0, (GLdouble)0.0, (GLdouble)1.0); + + data->glBegin(GL_TRIANGLE_STRIP); + data->glTexCoord2f(minu, minv); + data->glVertex2f(minx, miny); + data->glTexCoord2f(maxu, minv); + data->glVertex2f(maxx, miny); + data->glTexCoord2f(minu, maxv); + data->glVertex2f(minx, maxy); + data->glTexCoord2f(maxu, maxv); + data->glVertex2f(maxx, maxy); + data->glEnd(); + data->glPopMatrix(); + + data->glDisable(texturedata->type); + + return GL_CheckError("", renderer); +} + +static int +GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + Uint32 temp_format = SDL_PIXELFORMAT_ARGB8888; + void *temp_pixels; + int temp_pitch; + GLint internalFormat; + GLenum format, type; + Uint8 *src, *dst, *tmp; + int w, h, length, rows; + int status; + + GL_ActivateRenderer(renderer); + + temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format); + temp_pixels = SDL_malloc(rect->h * temp_pitch); + if (!temp_pixels) { + return SDL_OutOfMemory(); + } + + convert_format(data, temp_format, &internalFormat, &format, &type); + + SDL_GetRendererOutputSize(renderer, &w, &h); + + data->glPixelStorei(GL_PACK_ALIGNMENT, 1); + data->glPixelStorei(GL_PACK_ROW_LENGTH, + (temp_pitch / SDL_BYTESPERPIXEL(temp_format))); + + data->glReadPixels(rect->x, (h-rect->y)-rect->h, rect->w, rect->h, + format, type, temp_pixels); + + GL_CheckError("", renderer); + + /* Flip the rows to be top-down */ + length = rect->w * SDL_BYTESPERPIXEL(temp_format); + src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch; + dst = (Uint8*)temp_pixels; + tmp = SDL_stack_alloc(Uint8, length); + rows = rect->h / 2; + while (rows--) { + SDL_memcpy(tmp, dst, length); + SDL_memcpy(dst, src, length); + SDL_memcpy(src, tmp, length); + dst += temp_pitch; + src -= temp_pitch; + } + SDL_stack_free(tmp); + + status = SDL_ConvertPixels(rect->w, rect->h, + temp_format, temp_pixels, temp_pitch, + pixel_format, pixels, pitch); + SDL_free(temp_pixels); + + return status; +} + +static void +GL_RenderPresent(SDL_Renderer * renderer) +{ + GL_ActivateRenderer(renderer); + + SDL_GL_SwapWindow(renderer->window); +} + +static void +GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_TextureData *data = (GL_TextureData *) texture->driverdata; + + GL_ActivateRenderer(renderer); + + if (!data) { + return; + } + if (data->texture) { + renderdata->glDeleteTextures(1, &data->texture); + } + if (data->yuv) { + renderdata->glDeleteTextures(1, &data->utexture); + renderdata->glDeleteTextures(1, &data->vtexture); + } + if (data->pixels) { + SDL_free(data->pixels); + } + SDL_free(data); + texture->driverdata = NULL; +} + +static void +GL_DestroyRenderer(SDL_Renderer * renderer) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + + if (data) { + GL_ClearErrors(renderer); + if (data->GL_ARB_debug_output_supported) { + PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB"); + + /* Uh oh, we don't have a safe way of removing ourselves from the callback chain, if it changed after we set our callback. */ + /* For now, just always replace the callback with the original one */ + glDebugMessageCallbackARBFunc(data->next_error_callback, data->next_error_userparam); + } + if (data->shaders) { + GL_DestroyShaderContext(data->shaders); + } + if (data->context) { + while (data->framebuffers) { + GL_FBOList *nextnode = data->framebuffers->next; + /* delete the framebuffer object */ + data->glDeleteFramebuffersEXT(1, &data->framebuffers->FBO); + GL_CheckError("", renderer); + SDL_free(data->framebuffers); + data->framebuffers = nextnode; + } + SDL_GL_DeleteContext(data->context); + } + SDL_free(data); + } + SDL_free(renderer); +} + +static int +GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata; + GL_ActivateRenderer(renderer); + + data->glEnable(texturedata->type); + if (texturedata->yuv) { + data->glActiveTextureARB(GL_TEXTURE2_ARB); + data->glBindTexture(texturedata->type, texturedata->vtexture); + + data->glActiveTextureARB(GL_TEXTURE1_ARB); + data->glBindTexture(texturedata->type, texturedata->utexture); + + data->glActiveTextureARB(GL_TEXTURE0_ARB); + } + data->glBindTexture(texturedata->type, texturedata->texture); + + if(texw) *texw = (float)texturedata->texw; + if(texh) *texh = (float)texturedata->texh; + + return 0; +} + +static int +GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) +{ + GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata; + GL_ActivateRenderer(renderer); + + if (texturedata->yuv) { + data->glActiveTextureARB(GL_TEXTURE2_ARB); + data->glDisable(texturedata->type); + + data->glActiveTextureARB(GL_TEXTURE1_ARB); + data->glDisable(texturedata->type); + + data->glActiveTextureARB(GL_TEXTURE0_ARB); + } + + data->glDisable(texturedata->type); + + return 0; +} + +#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_shaders_gl.c b/src/render/opengl/SDL_shaders_gl.c new file mode 100644 index 0000000000..1e6262191d --- /dev/null +++ b/src/render/opengl/SDL_shaders_gl.c @@ -0,0 +1,358 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED + +#include "SDL_stdinc.h" +#include "SDL_log.h" +#include "SDL_opengl.h" +#include "SDL_video.h" +#include "SDL_shaders_gl.h" + +/* OpenGL shader implementation */ + +/*#define DEBUG_SHADERS*/ + +typedef struct +{ + GLhandleARB program; + GLhandleARB vert_shader; + GLhandleARB frag_shader; +} GL_ShaderData; + +struct GL_ShaderContext +{ + GLenum (*glGetError)(void); + + PFNGLATTACHOBJECTARBPROC glAttachObjectARB; + PFNGLCOMPILESHADERARBPROC glCompileShaderARB; + PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB; + PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB; + PFNGLDELETEOBJECTARBPROC glDeleteObjectARB; + PFNGLGETINFOLOGARBPROC glGetInfoLogARB; + PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB; + PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB; + PFNGLLINKPROGRAMARBPROC glLinkProgramARB; + PFNGLSHADERSOURCEARBPROC glShaderSourceARB; + PFNGLUNIFORM1IARBPROC glUniform1iARB; + PFNGLUNIFORM1FARBPROC glUniform1fARB; + PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB; + + SDL_bool GL_ARB_texture_rectangle_supported; + + GL_ShaderData shaders[NUM_SHADERS]; +}; + +/* + * NOTE: Always use sampler2D, etc here. We'll #define them to the + * texture_rectangle versions if we choose to use that extension. + */ +static const char *shader_source[NUM_SHADERS][2] = +{ + /* SHADER_NONE */ + { NULL, NULL }, + + /* SHADER_SOLID */ + { + /* vertex shader */ +"varying vec4 v_color;\n" +"\n" +"void main()\n" +"{\n" +" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" +" v_color = gl_Color;\n" +"}", + /* fragment shader */ +"varying vec4 v_color;\n" +"\n" +"void main()\n" +"{\n" +" gl_FragColor = v_color;\n" +"}" + }, + + /* SHADER_RGB */ + { + /* vertex shader */ +"varying vec4 v_color;\n" +"varying vec2 v_texCoord;\n" +"\n" +"void main()\n" +"{\n" +" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" +" v_color = gl_Color;\n" +" v_texCoord = vec2(gl_MultiTexCoord0);\n" +"}", + /* fragment shader */ +"varying vec4 v_color;\n" +"varying vec2 v_texCoord;\n" +"uniform sampler2D tex0;\n" +"\n" +"void main()\n" +"{\n" +" gl_FragColor = texture2D(tex0, v_texCoord) * v_color;\n" +"}" + }, + + /* SHADER_YV12 */ + { + /* vertex shader */ +"varying vec4 v_color;\n" +"varying vec2 v_texCoord;\n" +"\n" +"void main()\n" +"{\n" +" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" +" v_color = gl_Color;\n" +" v_texCoord = vec2(gl_MultiTexCoord0);\n" +"}", + /* fragment shader */ +"varying vec4 v_color;\n" +"varying vec2 v_texCoord;\n" +"uniform sampler2D tex0; // Y \n" +"uniform sampler2D tex1; // U \n" +"uniform sampler2D tex2; // V \n" +"\n" +"// YUV offset \n" +"const vec3 offset = vec3(-0.0625, -0.5, -0.5);\n" +"\n" +"// RGB coefficients \n" +"const vec3 Rcoeff = vec3(1.164, 0.000, 1.596);\n" +"const vec3 Gcoeff = vec3(1.164, -0.391, -0.813);\n" +"const vec3 Bcoeff = vec3(1.164, 2.018, 0.000);\n" +"\n" +"void main()\n" +"{\n" +" vec2 tcoord;\n" +" vec3 yuv, rgb;\n" +"\n" +" // Get the Y value \n" +" tcoord = v_texCoord;\n" +" yuv.x = texture2D(tex0, tcoord).r;\n" +"\n" +" // Get the U and V values \n" +" tcoord *= 0.5;\n" +" yuv.y = texture2D(tex1, tcoord).r;\n" +" yuv.z = texture2D(tex2, tcoord).r;\n" +"\n" +" // Do the color transform \n" +" yuv += offset;\n" +" rgb.r = dot(yuv, Rcoeff);\n" +" rgb.g = dot(yuv, Gcoeff);\n" +" rgb.b = dot(yuv, Bcoeff);\n" +"\n" +" // That was easy. :) \n" +" gl_FragColor = vec4(rgb, 1.0) * v_color;\n" +"}" + }, +}; + +static SDL_bool +CompileShader(GL_ShaderContext *ctx, GLhandleARB shader, const char *defines, const char *source) +{ + GLint status; + const char *sources[2]; + + sources[0] = defines; + sources[1] = source; + + ctx->glShaderSourceARB(shader, SDL_arraysize(sources), sources, NULL); + ctx->glCompileShaderARB(shader); + ctx->glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); + if (status == 0) { + GLint length; + char *info; + + ctx->glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); + info = SDL_stack_alloc(char, length+1); + ctx->glGetInfoLogARB(shader, length, NULL, info); + SDL_LogError(SDL_LOG_CATEGORY_RENDER, + "Failed to compile shader:\n%s%s\n%s", defines, source, info); +#ifdef DEBUG_SHADERS + fprintf(stderr, + "Failed to compile shader:\n%s%s\n%s", defines, source, info); +#endif + SDL_stack_free(info); + + return SDL_FALSE; + } else { + return SDL_TRUE; + } +} + +static SDL_bool +CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) +{ + const int num_tmus_bound = 4; + const char *vert_defines = ""; + const char *frag_defines = ""; + int i; + GLint location; + + if (index == SHADER_NONE) { + return SDL_TRUE; + } + + ctx->glGetError(); + + /* Make sure we use the correct sampler type for our texture type */ + if (ctx->GL_ARB_texture_rectangle_supported) { + frag_defines = +"#define sampler2D sampler2DRect\n" +"#define texture2D texture2DRect\n"; + } + + /* Create one program object to rule them all */ + data->program = ctx->glCreateProgramObjectARB(); + + /* Create the vertex shader */ + data->vert_shader = ctx->glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); + if (!CompileShader(ctx, data->vert_shader, vert_defines, shader_source[index][0])) { + return SDL_FALSE; + } + + /* Create the fragment shader */ + data->frag_shader = ctx->glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); + if (!CompileShader(ctx, data->frag_shader, frag_defines, shader_source[index][1])) { + return SDL_FALSE; + } + + /* ... and in the darkness bind them */ + ctx->glAttachObjectARB(data->program, data->vert_shader); + ctx->glAttachObjectARB(data->program, data->frag_shader); + ctx->glLinkProgramARB(data->program); + + /* Set up some uniform variables */ + ctx->glUseProgramObjectARB(data->program); + for (i = 0; i < num_tmus_bound; ++i) { + char tex_name[10]; + SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i); + location = ctx->glGetUniformLocationARB(data->program, tex_name); + if (location >= 0) { + ctx->glUniform1iARB(location, i); + } + } + ctx->glUseProgramObjectARB(0); + + return (ctx->glGetError() == GL_NO_ERROR); +} + +static void +DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data) +{ + ctx->glDeleteObjectARB(data->vert_shader); + ctx->glDeleteObjectARB(data->frag_shader); + ctx->glDeleteObjectARB(data->program); +} + +GL_ShaderContext * +GL_CreateShaderContext() +{ + GL_ShaderContext *ctx; + SDL_bool shaders_supported; + int i; + + ctx = (GL_ShaderContext *)SDL_calloc(1, sizeof(*ctx)); + if (!ctx) { + return NULL; + } + + if (SDL_GL_ExtensionSupported("GL_ARB_texture_rectangle") + || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) { + ctx->GL_ARB_texture_rectangle_supported = SDL_TRUE; + } + + /* Check for shader support */ + shaders_supported = SDL_FALSE; + if (SDL_GL_ExtensionSupported("GL_ARB_shader_objects") && + SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") && + SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") && + SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) { + ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError"); + ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB"); + ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB"); + ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB"); + ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB"); + ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB"); + ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB"); + ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB"); + ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB"); + ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB"); + ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB"); + ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB"); + ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB"); + ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB"); + if (ctx->glGetError && + ctx->glAttachObjectARB && + ctx->glCompileShaderARB && + ctx->glCreateProgramObjectARB && + ctx->glCreateShaderObjectARB && + ctx->glDeleteObjectARB && + ctx->glGetInfoLogARB && + ctx->glGetObjectParameterivARB && + ctx->glGetUniformLocationARB && + ctx->glLinkProgramARB && + ctx->glShaderSourceARB && + ctx->glUniform1iARB && + ctx->glUniform1fARB && + ctx->glUseProgramObjectARB) { + shaders_supported = SDL_TRUE; + } + } + + if (!shaders_supported) { + SDL_free(ctx); + return NULL; + } + + /* Compile all the shaders */ + for (i = 0; i < NUM_SHADERS; ++i) { + if (!CompileShaderProgram(ctx, i, &ctx->shaders[i])) { + GL_DestroyShaderContext(ctx); + return NULL; + } + } + + /* We're done! */ + return ctx; +} + +void +GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader) +{ + ctx->glUseProgramObjectARB(ctx->shaders[shader].program); +} + +void +GL_DestroyShaderContext(GL_ShaderContext *ctx) +{ + int i; + + for (i = 0; i < NUM_SHADERS; ++i) { + DestroyShaderProgram(ctx, &ctx->shaders[i]); + } + SDL_free(ctx); +} + +#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_shaders_gl.h b/src/render/opengl/SDL_shaders_gl.h new file mode 100644 index 0000000000..c4b7e0b18d --- /dev/null +++ b/src/render/opengl/SDL_shaders_gl.h @@ -0,0 +1,39 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* OpenGL shader implementation */ + +typedef enum { + SHADER_NONE, + SHADER_SOLID, + SHADER_RGB, + SHADER_YV12, + NUM_SHADERS +} GL_Shader; + +typedef struct GL_ShaderContext GL_ShaderContext; + +extern GL_ShaderContext * GL_CreateShaderContext(); +extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader); +extern void GL_DestroyShaderContext(GL_ShaderContext *ctx); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengles/SDL_glesfuncs.h b/src/render/opengles/SDL_glesfuncs.h new file mode 100644 index 0000000000..4a6384da6b --- /dev/null +++ b/src/render/opengles/SDL_glesfuncs.h @@ -0,0 +1,42 @@ +SDL_PROC(void, glBindTexture, (GLenum, GLuint)) +SDL_PROC(void, glBlendFunc, (GLenum, GLenum)) +SDL_PROC(void, glBlendFuncSeparateOES, (GLenum, GLenum, GLenum, GLenum)) +SDL_PROC(void, glClear, (GLbitfield)) +SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf)) +SDL_PROC(void, glColor4f, (GLfloat, GLfloat, GLfloat, GLfloat)) +SDL_PROC(void, glDeleteTextures, (GLsizei, const GLuint *)) +SDL_PROC(void, glDisable, (GLenum)) +SDL_PROC(void, glDisableClientState, (GLenum array)) +SDL_PROC(void, glDrawArrays, (GLenum, GLint, GLsizei)) +SDL_PROC(void, glDrawTexfOES, (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat)) +SDL_PROC(void, glEnable, (GLenum)) +SDL_PROC(void, glEnableClientState, (GLenum)) +SDL_PROC(void, glFinish, (void)) +SDL_PROC(void, glGenFramebuffersOES, (GLsizei, GLuint *)) +SDL_PROC(void, glGenTextures, (GLsizei, GLuint *)) +SDL_PROC(GLenum, glGetError, (void)) +SDL_PROC(void, glGetIntegerv, (GLenum, GLint *)) +SDL_PROC(void, glLoadIdentity, (void)) +SDL_PROC(void, glMatrixMode, (GLenum)) +SDL_PROC(void, glOrthof, (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat)) +SDL_PROC(void, glPixelStorei, (GLenum, GLint)) +SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*)) +SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei)) +SDL_PROC(void, glTexCoordPointer, (GLint, GLenum, GLsizei, const GLvoid *)) +SDL_PROC(void, glTexEnvf, (GLenum, GLenum, GLfloat)) +SDL_PROC(void, glTexImage2D, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *)) +SDL_PROC(void, glTexParameteri, (GLenum, GLenum, GLint)) +SDL_PROC(void, glTexParameteriv, (GLenum, GLenum, const GLint *)) +SDL_PROC(void, glTexSubImage2D, (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) +SDL_PROC(void, glVertexPointer, (GLint, GLenum, GLsizei, const GLvoid *)) +SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei)) +SDL_PROC(void, glBindFramebufferOES, (GLenum, GLuint)) +SDL_PROC(void, glFramebufferTexture2DOES, (GLenum, GLenum, GLenum, GLuint, GLint)) +SDL_PROC(GLenum, glCheckFramebufferStatusOES, (GLenum)) +SDL_PROC(void, glPushMatrix, (void)) +SDL_PROC(void, glTranslatef, (GLfloat, GLfloat, GLfloat)) +SDL_PROC(void, glRotatef, (GLfloat, GLfloat, GLfloat, GLfloat)) +SDL_PROC(void, glPopMatrix, (void)) +SDL_PROC(void, glDeleteFramebuffersOES, (GLsizei, const GLuint*)) + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c new file mode 100644 index 0000000000..ab0f01d4e6 --- /dev/null +++ b/src/render/opengles/SDL_render_gles.c @@ -0,0 +1,1153 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED + +#include "SDL_hints.h" +#include "SDL_opengles.h" +#include "../SDL_sysrender.h" + +#if defined(SDL_VIDEO_DRIVER_PANDORA) + +/* Empty function stub to get OpenGL ES 1.x support without */ +/* OpenGL ES extension GL_OES_draw_texture supported */ +GL_API void GL_APIENTRY +glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) +{ + return; +} + +#endif /* PANDORA */ + +/* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ + +/* Used to re-create the window with OpenGL ES capability */ +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); + +static const float inv255f = 1.0f / 255.0f; + +static SDL_Renderer *GLES_CreateRenderer(SDL_Window * window, Uint32 flags); +static void GLES_WindowEvent(SDL_Renderer * renderer, + const SDL_WindowEvent *event); +static int GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, + int pitch); +static int GLES_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch); +static void GLES_UnlockTexture(SDL_Renderer * renderer, + SDL_Texture * texture); +static int GLES_SetRenderTarget(SDL_Renderer * renderer, + SDL_Texture * texture); +static int GLES_UpdateViewport(SDL_Renderer * renderer); +static int GLES_UpdateClipRect(SDL_Renderer * renderer); +static int GLES_RenderClear(SDL_Renderer * renderer); +static int GLES_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int GLES_RenderDrawLines(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int GLES_RenderFillRects(SDL_Renderer * renderer, + const SDL_FRect * rects, int count); +static int GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_FRect * dstrect); +static int GLES_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip); +static int GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch); +static void GLES_RenderPresent(SDL_Renderer * renderer); +static void GLES_DestroyTexture(SDL_Renderer * renderer, + SDL_Texture * texture); +static void GLES_DestroyRenderer(SDL_Renderer * renderer); +static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh); +static int GLES_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture); + +typedef struct GLES_FBOList GLES_FBOList; + +struct GLES_FBOList +{ + Uint32 w, h; + GLuint FBO; + GLES_FBOList *next; +}; + + +SDL_RenderDriver GLES_RenderDriver = { + GLES_CreateRenderer, + { + "opengles", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 1, + {SDL_PIXELFORMAT_ABGR8888}, + 0, + 0} +}; + +typedef struct +{ + SDL_GLContext context; + struct { + Uint32 color; + int blendMode; + SDL_bool tex_coords; + } current; + +#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#include "SDL_glesfuncs.h" +#undef SDL_PROC + SDL_bool GL_OES_framebuffer_object_supported; + GLES_FBOList *framebuffers; + GLuint window_framebuffer; + + SDL_bool useDrawTexture; + SDL_bool GL_OES_draw_texture_supported; + SDL_bool GL_OES_blend_func_separate_supported; +} GLES_RenderData; + +typedef struct +{ + GLuint texture; + GLenum type; + GLfloat texw; + GLfloat texh; + GLenum format; + GLenum formattype; + void *pixels; + int pitch; + GLES_FBOList *fbo; +} GLES_TextureData; + +static int +GLES_SetError(const char *prefix, GLenum result) +{ + const char *error; + + switch (result) { + case GL_NO_ERROR: + error = "GL_NO_ERROR"; + break; + case GL_INVALID_ENUM: + error = "GL_INVALID_ENUM"; + break; + case GL_INVALID_VALUE: + error = "GL_INVALID_VALUE"; + break; + case GL_INVALID_OPERATION: + error = "GL_INVALID_OPERATION"; + break; + case GL_STACK_OVERFLOW: + error = "GL_STACK_OVERFLOW"; + break; + case GL_STACK_UNDERFLOW: + error = "GL_STACK_UNDERFLOW"; + break; + case GL_OUT_OF_MEMORY: + error = "GL_OUT_OF_MEMORY"; + break; + default: + error = "UNKNOWN"; + break; + } + return SDL_SetError("%s: %s", prefix, error); +} + +static int GLES_LoadFunctions(GLES_RenderData * data) +{ +#if SDL_VIDEO_DRIVER_UIKIT +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_ANDROID +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_PANDORA +#define __SDL_NOGETPROCADDR__ +#endif + +#ifdef __SDL_NOGETPROCADDR__ +#define SDL_PROC(ret,func,params) data->func=func; +#else +#define SDL_PROC(ret,func,params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if ( ! data->func ) { \ + return SDL_SetError("Couldn't load GLES function %s: %s\n", #func, SDL_GetError()); \ + } \ + } while ( 0 ); +#endif /* _SDL_NOGETPROCADDR_ */ + +#include "SDL_glesfuncs.h" +#undef SDL_PROC + return 0; +} + +static SDL_GLContext SDL_CurrentContext = NULL; + +GLES_FBOList * +GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h) +{ + GLES_FBOList *result = data->framebuffers; + while ((result) && ((result->w != w) || (result->h != h)) ) + { + result = result->next; + } + if (result == NULL) + { + result = SDL_malloc(sizeof(GLES_FBOList)); + result->w = w; + result->h = h; + data->glGenFramebuffersOES(1, &result->FBO); + result->next = data->framebuffers; + data->framebuffers = result; + } + return result; +} + + +static int +GLES_ActivateRenderer(SDL_Renderer * renderer) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + if (SDL_CurrentContext != data->context) { + if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) { + return -1; + } + SDL_CurrentContext = data->context; + + GLES_UpdateViewport(renderer); + } + return 0; +} + +/* This is called if we need to invalidate all of the SDL OpenGL state */ +static void +GLES_ResetState(SDL_Renderer *renderer) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + if (SDL_CurrentContext == data->context) { + GLES_UpdateViewport(renderer); + } else { + GLES_ActivateRenderer(renderer); + } + + data->current.color = 0; + data->current.blendMode = -1; + data->current.tex_coords = SDL_FALSE; + + data->glDisable(GL_DEPTH_TEST); + data->glDisable(GL_CULL_FACE); + + data->glMatrixMode(GL_MODELVIEW); + data->glLoadIdentity(); + + data->glEnableClientState(GL_VERTEX_ARRAY); + data->glDisableClientState(GL_TEXTURE_COORD_ARRAY); +} + +SDL_Renderer * +GLES_CreateRenderer(SDL_Window * window, Uint32 flags) +{ + + SDL_Renderer *renderer; + GLES_RenderData *data; + GLint value; + Uint32 windowFlags; + + SDL_GL_SetAttribute(SDL_GL_CONTEXT_EGL, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + + windowFlags = SDL_GetWindowFlags(window); + if (!(windowFlags & SDL_WINDOW_OPENGL)) { + if (SDL_RecreateWindow(window, windowFlags | SDL_WINDOW_OPENGL) < 0) { + /* Uh oh, better try to put it back... */ + SDL_RecreateWindow(window, windowFlags); + return NULL; + } + } + + renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); + if (!renderer) { + SDL_OutOfMemory(); + return NULL; + } + + data = (GLES_RenderData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + GLES_DestroyRenderer(renderer); + SDL_OutOfMemory(); + return NULL; + } + + renderer->WindowEvent = GLES_WindowEvent; + renderer->CreateTexture = GLES_CreateTexture; + renderer->UpdateTexture = GLES_UpdateTexture; + renderer->LockTexture = GLES_LockTexture; + renderer->UnlockTexture = GLES_UnlockTexture; + renderer->SetRenderTarget = GLES_SetRenderTarget; + renderer->UpdateViewport = GLES_UpdateViewport; + renderer->UpdateClipRect = GLES_UpdateClipRect; + renderer->RenderClear = GLES_RenderClear; + renderer->RenderDrawPoints = GLES_RenderDrawPoints; + renderer->RenderDrawLines = GLES_RenderDrawLines; + renderer->RenderFillRects = GLES_RenderFillRects; + renderer->RenderCopy = GLES_RenderCopy; + renderer->RenderCopyEx = GLES_RenderCopyEx; + renderer->RenderReadPixels = GLES_RenderReadPixels; + renderer->RenderPresent = GLES_RenderPresent; + renderer->DestroyTexture = GLES_DestroyTexture; + renderer->DestroyRenderer = GLES_DestroyRenderer; + renderer->GL_BindTexture = GLES_BindTexture; + renderer->GL_UnbindTexture = GLES_UnbindTexture; + renderer->info = GLES_RenderDriver.info; + renderer->info.flags = SDL_RENDERER_ACCELERATED; + renderer->driverdata = data; + renderer->window = window; + + data->context = SDL_GL_CreateContext(window); + if (!data->context) { + GLES_DestroyRenderer(renderer); + return NULL; + } + if (SDL_GL_MakeCurrent(window, data->context) < 0) { + GLES_DestroyRenderer(renderer); + return NULL; + } + + if (GLES_LoadFunctions(data) < 0) { + GLES_DestroyRenderer(renderer); + return NULL; + } + + if (flags & SDL_RENDERER_PRESENTVSYNC) { + SDL_GL_SetSwapInterval(1); + } else { + SDL_GL_SetSwapInterval(0); + } + if (SDL_GL_GetSwapInterval() > 0) { + renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; + } + +#if SDL_VIDEO_DRIVER_PANDORA + data->GL_OES_draw_texture_supported = SDL_FALSE; + data->useDrawTexture = SDL_FALSE; +#else + if (SDL_GL_ExtensionSupported("GL_OES_draw_texture")) { + data->GL_OES_draw_texture_supported = SDL_TRUE; + data->useDrawTexture = SDL_TRUE; + } else { + data->GL_OES_draw_texture_supported = SDL_FALSE; + data->useDrawTexture = SDL_FALSE; + } +#endif + + value = 0; + data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value); + renderer->info.max_texture_width = value; + value = 0; + data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value); + renderer->info.max_texture_height = value; + + if (SDL_GL_ExtensionSupported("GL_OES_framebuffer_object")) { + data->GL_OES_framebuffer_object_supported = SDL_TRUE; + renderer->info.flags |= SDL_RENDERER_TARGETTEXTURE; + + value = 0; + data->glGetIntegerv(GL_FRAMEBUFFER_BINDING_OES, &value); + data->window_framebuffer = (GLuint)value; + } + data->framebuffers = NULL; + + if (SDL_GL_ExtensionSupported("GL_OES_blend_func_separate")) { + data->GL_OES_blend_func_separate_supported = SDL_TRUE; + } + + /* Set up parameters for rendering */ + GLES_ResetState(renderer); + + return renderer; +} + +static void +GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED || + event->event == SDL_WINDOWEVENT_SHOWN || + event->event == SDL_WINDOWEVENT_HIDDEN) { + /* Rebind the context to the window area and update matrices */ + SDL_CurrentContext = NULL; + } + + if (event->event == SDL_WINDOWEVENT_MINIMIZED) { + /* According to Apple documentation, we need to finish drawing NOW! */ + data->glFinish(); + } +} + +static __inline__ int +power_of_2(int input) +{ + int value = 1; + + while (value < input) { + value <<= 1; + } + return value; +} + +static GLenum +GetScaleQuality(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); + + if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { + return GL_NEAREST; + } else { + return GL_LINEAR; + } +} + +static int +GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; + GLES_TextureData *data; + GLint internalFormat; + GLenum format, type; + int texture_w, texture_h; + GLenum scaleMode; + GLenum result; + + GLES_ActivateRenderer(renderer); + + switch (texture->format) { + case SDL_PIXELFORMAT_ABGR8888: + internalFormat = GL_RGBA; + format = GL_RGBA; + type = GL_UNSIGNED_BYTE; + break; + default: + return SDL_SetError("Texture format not supported"); + } + + data = (GLES_TextureData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + return SDL_OutOfMemory(); + } + + if (texture->access == SDL_TEXTUREACCESS_STREAMING) { + data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format); + data->pixels = SDL_calloc(1, texture->h * data->pitch); + if (!data->pixels) { + SDL_free(data); + return SDL_OutOfMemory(); + } + } + + texture->driverdata = data; + if (texture->access == SDL_TEXTUREACCESS_TARGET) { + data->fbo = GLES_GetFBO(renderer->driverdata, texture->w, texture->h); + } else { + data->fbo = NULL; + } + + renderdata->glGetError(); + renderdata->glEnable(GL_TEXTURE_2D); + renderdata->glGenTextures(1, &data->texture); + result = renderdata->glGetError(); + if (result != GL_NO_ERROR) { + SDL_free(data); + return GLES_SetError("glGenTextures()", result); + } + + data->type = GL_TEXTURE_2D; + /* no NPOV textures allowed in OpenGL ES (yet) */ + texture_w = power_of_2(texture->w); + texture_h = power_of_2(texture->h); + data->texw = (GLfloat) texture->w / texture_w; + data->texh = (GLfloat) texture->h / texture_h; + + data->format = format; + data->formattype = type; + scaleMode = GetScaleQuality(); + renderdata->glBindTexture(data->type, data->texture); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MIN_FILTER, scaleMode); + renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, scaleMode); + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w, + texture_h, 0, format, type, NULL); + renderdata->glDisable(GL_TEXTURE_2D); + + result = renderdata->glGetError(); + if (result != GL_NO_ERROR) { + return GLES_SetError("glTexImage2D()", result); + } + return 0; +} + +static int +GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, int pitch) +{ + GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; + GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + Uint8 *blob = NULL; + Uint8 *src; + int srcPitch; + int y; + + GLES_ActivateRenderer(renderer); + + /* Bail out if we're supposed to update an empty rectangle */ + if (rect->w <= 0 || rect->h <= 0) + return 0; + + /* Reformat the texture data into a tightly packed array */ + srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format); + src = (Uint8 *)pixels; + if (pitch != srcPitch) { + blob = (Uint8 *)SDL_malloc(srcPitch * rect->h); + if (!blob) { + return SDL_OutOfMemory(); + } + src = blob; + for (y = 0; y < rect->h; ++y) { + SDL_memcpy(src, pixels, srcPitch); + src += srcPitch; + pixels = (Uint8 *)pixels + pitch; + } + src = blob; + } + + /* Create a texture subimage with the supplied data */ + renderdata->glGetError(); + renderdata->glEnable(data->type); + renderdata->glBindTexture(data->type, data->texture); + renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + renderdata->glTexSubImage2D(data->type, + 0, + rect->x, + rect->y, + rect->w, + rect->h, + data->format, + data->formattype, + src); + if (blob) { + SDL_free(blob); + } + + if (renderdata->glGetError() != GL_NO_ERROR) + { + return SDL_SetError("Failed to update texture"); + } + return 0; +} + +static int +GLES_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch) +{ + GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + + *pixels = + (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pitch = data->pitch; + return 0; +} + +static void +GLES_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + SDL_Rect rect; + + /* We do whole texture updates, at least for now */ + rect.x = 0; + rect.y = 0; + rect.w = texture->w; + rect.h = texture->h; + GLES_UpdateTexture(renderer, texture, &rect, data->pixels, data->pitch); +} + +static int +GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_TextureData *texturedata = NULL; + GLenum status; + + GLES_ActivateRenderer(renderer); + + if (texture == NULL) { + data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, data->window_framebuffer); + return 0; + } + + texturedata = (GLES_TextureData *) texture->driverdata; + data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, texturedata->fbo->FBO); + /* TODO: check if texture pixel format allows this operation */ + data->glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, texturedata->type, texturedata->texture, 0); + /* Check FBO status */ + status = data->glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES); + if (status != GL_FRAMEBUFFER_COMPLETE_OES) { + return SDL_SetError("glFramebufferTexture2DOES() failed"); + } + return 0; +} + +static int +GLES_UpdateViewport(SDL_Renderer * renderer) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + if (SDL_CurrentContext != data->context) { + /* We'll update the viewport after we rebind the context */ + return 0; + } + + data->glViewport(renderer->viewport.x, renderer->viewport.y, + renderer->viewport.w, renderer->viewport.h); + + if (renderer->viewport.w && renderer->viewport.h) { + data->glMatrixMode(GL_PROJECTION); + data->glLoadIdentity(); + data->glOrthof((GLfloat) 0, + (GLfloat) renderer->viewport.w, + (GLfloat) renderer->viewport.h, + (GLfloat) 0, 0.0, 1.0); + } + return 0; +} + +static int +GLES_UpdateClipRect(SDL_Renderer * renderer) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + const SDL_Rect *rect = &renderer->clip_rect; + + if (SDL_CurrentContext != data->context) { + /* We'll update the clip rect after we rebind the context */ + return 0; + } + + if (!SDL_RectEmpty(rect)) { + data->glEnable(GL_SCISSOR_TEST); + data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h); + } else { + data->glDisable(GL_SCISSOR_TEST); + } + return 0; +} + +static void +GLES_SetColor(GLES_RenderData * data, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + Uint32 color = ((a << 24) | (r << 16) | (g << 8) | b); + + if (color != data->current.color) { + data->glColor4f((GLfloat) r * inv255f, + (GLfloat) g * inv255f, + (GLfloat) b * inv255f, + (GLfloat) a * inv255f); + data->current.color = color; + } +} + +static void +GLES_SetBlendMode(GLES_RenderData * data, int blendMode) +{ + if (blendMode != data->current.blendMode) { + switch (blendMode) { + case SDL_BLENDMODE_NONE: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + data->glDisable(GL_BLEND); + break; + case SDL_BLENDMODE_BLEND: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + data->glEnable(GL_BLEND); + if (data->GL_OES_blend_func_separate_supported) { + data->glBlendFuncSeparateOES(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + data->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + break; + case SDL_BLENDMODE_ADD: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + data->glEnable(GL_BLEND); + if (data->GL_OES_blend_func_separate_supported) { + data->glBlendFuncSeparateOES(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE); + } else { + data->glBlendFunc(GL_SRC_ALPHA, GL_ONE); + } + break; + case SDL_BLENDMODE_MOD: + data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + data->glEnable(GL_BLEND); + if (data->GL_OES_blend_func_separate_supported) { + data->glBlendFuncSeparateOES(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE); + } else { + data->glBlendFunc(GL_ZERO, GL_SRC_COLOR); + } + break; + } + data->current.blendMode = blendMode; + } +} + +static void +GLES_SetTexCoords(GLES_RenderData * data, SDL_bool enabled) +{ + if (enabled != data->current.tex_coords) { + if (enabled) { + data->glEnableClientState(GL_TEXTURE_COORD_ARRAY); + } else { + data->glDisableClientState(GL_TEXTURE_COORD_ARRAY); + } + data->current.tex_coords = enabled; + } +} + +static void +GLES_SetDrawingState(SDL_Renderer * renderer) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + GLES_ActivateRenderer(renderer); + + GLES_SetColor(data, (GLfloat) renderer->r, + (GLfloat) renderer->g, + (GLfloat) renderer->b, + (GLfloat) renderer->a); + + GLES_SetBlendMode(data, renderer->blendMode); + + GLES_SetTexCoords(data, SDL_FALSE); +} + +static int +GLES_RenderClear(SDL_Renderer * renderer) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + GLES_ActivateRenderer(renderer); + + data->glClearColor((GLfloat) renderer->r * inv255f, + (GLfloat) renderer->g * inv255f, + (GLfloat) renderer->b * inv255f, + (GLfloat) renderer->a * inv255f); + + data->glClear(GL_COLOR_BUFFER_BIT); + + return 0; +} + +static int +GLES_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + GLES_SetDrawingState(renderer); + + data->glVertexPointer(2, GL_FLOAT, 0, points); + data->glDrawArrays(GL_POINTS, 0, count); + + return 0; +} + +static int +GLES_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + GLES_SetDrawingState(renderer); + + data->glVertexPointer(2, GL_FLOAT, 0, points); + if (count > 2 && + points[0].x == points[count-1].x && points[0].y == points[count-1].y) { + /* GL_LINE_LOOP takes care of the final segment */ + --count; + data->glDrawArrays(GL_LINE_LOOP, 0, count); + } else { + data->glDrawArrays(GL_LINE_STRIP, 0, count); + /* We need to close the endpoint of the line */ + data->glDrawArrays(GL_POINTS, count-1, 1); + } + + return 0; +} + +static int +GLES_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, + int count) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + int i; + + GLES_SetDrawingState(renderer); + + for (i = 0; i < count; ++i) { + const SDL_FRect *rect = &rects[i]; + GLfloat minx = rect->x; + GLfloat maxx = rect->x + rect->w; + GLfloat miny = rect->y; + GLfloat maxy = rect->y + rect->h; + GLfloat vertices[8]; + vertices[0] = minx; + vertices[1] = miny; + vertices[2] = maxx; + vertices[3] = miny; + vertices[4] = minx; + vertices[5] = maxy; + vertices[6] = maxx; + vertices[7] = maxy; + + data->glVertexPointer(2, GL_FLOAT, 0, vertices); + data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + } + + return 0; +} + +static int +GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata; + GLfloat minx, miny, maxx, maxy; + GLfloat minu, maxu, minv, maxv; + + GLES_ActivateRenderer(renderer); + + data->glEnable(GL_TEXTURE_2D); + + data->glBindTexture(texturedata->type, texturedata->texture); + + if (texture->modMode) { + GLES_SetColor(data, texture->r, texture->g, texture->b, texture->a); + } else { + GLES_SetColor(data, 255, 255, 255, 255); + } + + GLES_SetBlendMode(data, texture->blendMode); + + GLES_SetTexCoords(data, SDL_TRUE); + + if (data->GL_OES_draw_texture_supported && data->useDrawTexture) { + /* this code is a little funny because the viewport is upside down vs SDL's coordinate system */ + GLint cropRect[4]; + int w, h; + SDL_Window *window = renderer->window; + + SDL_GetWindowSize(window, &w, &h); + if (renderer->target) { + cropRect[0] = srcrect->x; + cropRect[1] = srcrect->y; + cropRect[2] = srcrect->w; + cropRect[3] = srcrect->h; + data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, + cropRect); + data->glDrawTexfOES(renderer->viewport.x + dstrect->x, renderer->viewport.y + dstrect->y, 0, + dstrect->w, dstrect->h); + } else { + cropRect[0] = srcrect->x; + cropRect[1] = srcrect->y + srcrect->h; + cropRect[2] = srcrect->w; + cropRect[3] = -srcrect->h; + data->glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, + cropRect); + data->glDrawTexfOES(renderer->viewport.x + dstrect->x, + h - (renderer->viewport.y + dstrect->y) - dstrect->h, 0, + dstrect->w, dstrect->h); + } + } else { + + minx = dstrect->x; + miny = dstrect->y; + maxx = dstrect->x + dstrect->w; + maxy = dstrect->y + dstrect->h; + + minu = (GLfloat) srcrect->x / texture->w; + minu *= texturedata->texw; + maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w; + maxu *= texturedata->texw; + minv = (GLfloat) srcrect->y / texture->h; + minv *= texturedata->texh; + maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h; + maxv *= texturedata->texh; + + GLfloat vertices[8]; + GLfloat texCoords[8]; + + vertices[0] = minx; + vertices[1] = miny; + vertices[2] = maxx; + vertices[3] = miny; + vertices[4] = minx; + vertices[5] = maxy; + vertices[6] = maxx; + vertices[7] = maxy; + + texCoords[0] = minu; + texCoords[1] = minv; + texCoords[2] = maxu; + texCoords[3] = minv; + texCoords[4] = minu; + texCoords[5] = maxv; + texCoords[6] = maxu; + texCoords[7] = maxv; + + data->glVertexPointer(2, GL_FLOAT, 0, vertices); + data->glTexCoordPointer(2, GL_FLOAT, 0, texCoords); + data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + } + data->glDisable(GL_TEXTURE_2D); + + return 0; +} + +static int +GLES_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) +{ + + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata; + GLfloat minx, miny, maxx, maxy; + GLfloat minu, maxu, minv, maxv; + GLfloat centerx, centery; + + GLES_ActivateRenderer(renderer); + + data->glEnable(GL_TEXTURE_2D); + + data->glBindTexture(texturedata->type, texturedata->texture); + + if (texture->modMode) { + GLES_SetColor(data, texture->r, texture->g, texture->b, texture->a); + } else { + GLES_SetColor(data, 255, 255, 255, 255); + } + + GLES_SetBlendMode(data, texture->blendMode); + + GLES_SetTexCoords(data, SDL_TRUE); + + centerx = center->x; + centery = center->y; + + /* Rotate and translate */ + data->glPushMatrix(); + data->glTranslatef(dstrect->x + centerx, dstrect->y + centery, 0.0f); + data->glRotatef((GLfloat)angle, 0.0f, 0.0f, 1.0f); + + if (flip & SDL_FLIP_HORIZONTAL) { + minx = dstrect->w - centerx; + maxx = -centerx; + } else { + minx = -centerx; + maxx = dstrect->w - centerx; + } + + if (flip & SDL_FLIP_VERTICAL) { + miny = dstrect->h - centery; + maxy = -centery; + } else { + miny = -centery; + maxy = dstrect->h - centery; + } + + minu = (GLfloat) srcrect->x / texture->w; + minu *= texturedata->texw; + maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w; + maxu *= texturedata->texw; + minv = (GLfloat) srcrect->y / texture->h; + minv *= texturedata->texh; + maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h; + maxv *= texturedata->texh; + + GLfloat vertices[8]; + GLfloat texCoords[8]; + + vertices[0] = minx; + vertices[1] = miny; + vertices[2] = maxx; + vertices[3] = miny; + vertices[4] = minx; + vertices[5] = maxy; + vertices[6] = maxx; + vertices[7] = maxy; + + texCoords[0] = minu; + texCoords[1] = minv; + texCoords[2] = maxu; + texCoords[3] = minv; + texCoords[4] = minu; + texCoords[5] = maxv; + texCoords[6] = maxu; + texCoords[7] = maxv; + data->glVertexPointer(2, GL_FLOAT, 0, vertices); + data->glTexCoordPointer(2, GL_FLOAT, 0, texCoords); + data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + data->glPopMatrix(); + data->glDisable(GL_TEXTURE_2D); + + return 0; +} + +static int +GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + Uint32 temp_format = SDL_PIXELFORMAT_ABGR8888; + void *temp_pixels; + int temp_pitch; + Uint8 *src, *dst, *tmp; + int w, h, length, rows; + int status; + + GLES_ActivateRenderer(renderer); + + temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format); + temp_pixels = SDL_malloc(rect->h * temp_pitch); + if (!temp_pixels) { + return SDL_OutOfMemory(); + } + + SDL_GetRendererOutputSize(renderer, &w, &h); + + data->glPixelStorei(GL_PACK_ALIGNMENT, 1); + + data->glReadPixels(rect->x, (h-rect->y)-rect->h, rect->w, rect->h, + GL_RGBA, GL_UNSIGNED_BYTE, temp_pixels); + + /* Flip the rows to be top-down */ + length = rect->w * SDL_BYTESPERPIXEL(temp_format); + src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch; + dst = (Uint8*)temp_pixels; + tmp = SDL_stack_alloc(Uint8, length); + rows = rect->h / 2; + while (rows--) { + SDL_memcpy(tmp, dst, length); + SDL_memcpy(dst, src, length); + SDL_memcpy(src, tmp, length); + dst += temp_pitch; + src -= temp_pitch; + } + SDL_stack_free(tmp); + + status = SDL_ConvertPixels(rect->w, rect->h, + temp_format, temp_pixels, temp_pitch, + pixel_format, pixels, pitch); + SDL_free(temp_pixels); + + return status; +} + +static void +GLES_RenderPresent(SDL_Renderer * renderer) +{ + GLES_ActivateRenderer(renderer); + + SDL_GL_SwapWindow(renderer->window); +} + +static void +GLES_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; + + GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + + GLES_ActivateRenderer(renderer); + + if (!data) { + return; + } + if (data->texture) { + renderdata->glDeleteTextures(1, &data->texture); + } + if (data->pixels) { + SDL_free(data->pixels); + } + SDL_free(data); + texture->driverdata = NULL; +} + +static void +GLES_DestroyRenderer(SDL_Renderer * renderer) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + + if (data) { + if (data->context) { + while (data->framebuffers) { + GLES_FBOList *nextnode = data->framebuffers->next; + data->glDeleteFramebuffersOES(1, &data->framebuffers->FBO); + SDL_free(data->framebuffers); + data->framebuffers = nextnode; + } + SDL_GL_DeleteContext(data->context); + } + SDL_free(data); + } + SDL_free(renderer); +} + +static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata; + GLES_ActivateRenderer(renderer); + + data->glEnable(GL_TEXTURE_2D); + data->glBindTexture(texturedata->type, texturedata->texture); + + if(texw) *texw = (float)texturedata->texw; + if(texh) *texh = (float)texturedata->texh; + + return 0; +} + +static int GLES_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) +{ + GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata; + GLES_ActivateRenderer(renderer); + data->glDisable(texturedata->type); + + return 0; +} + +#endif /* SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengles2/SDL_gles2funcs.h b/src/render/opengles2/SDL_gles2funcs.h new file mode 100644 index 0000000000..b201bdfd10 --- /dev/null +++ b/src/render/opengles2/SDL_gles2funcs.h @@ -0,0 +1,48 @@ +SDL_PROC(void, glActiveTexture, (GLenum)) +SDL_PROC(void, glAttachShader, (GLuint, GLuint)) +SDL_PROC(void, glBindAttribLocation, (GLuint, GLuint, const char *)) +SDL_PROC(void, glBindTexture, (GLenum, GLuint)) +SDL_PROC(void, glBlendFuncSeparate, (GLenum, GLenum, GLenum, GLenum)) +SDL_PROC(void, glClear, (GLbitfield)) +SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf)) +SDL_PROC(void, glCompileShader, (GLuint)) +SDL_PROC(GLuint, glCreateProgram, (void)) +SDL_PROC(GLuint, glCreateShader, (GLenum)) +SDL_PROC(void, glDeleteProgram, (GLuint)) +SDL_PROC(void, glDeleteShader, (GLuint)) +SDL_PROC(void, glDeleteTextures, (GLsizei, const GLuint *)) +SDL_PROC(void, glDisable, (GLenum)) +SDL_PROC(void, glDisableVertexAttribArray, (GLuint)) +SDL_PROC(void, glDrawArrays, (GLenum, GLint, GLsizei)) +SDL_PROC(void, glEnable, (GLenum)) +SDL_PROC(void, glEnableVertexAttribArray, (GLuint)) +SDL_PROC(void, glFinish, (void)) +SDL_PROC(void, glGenFramebuffers, (GLsizei, GLuint *)) +SDL_PROC(void, glGenTextures, (GLsizei, GLuint *)) +SDL_PROC(void, glGetBooleanv, (GLenum, GLboolean *)) +SDL_PROC(const GLubyte *, glGetString, (GLenum)) +SDL_PROC(GLenum, glGetError, (void)) +SDL_PROC(void, glGetIntegerv, (GLenum, GLint *)) +SDL_PROC(void, glGetProgramiv, (GLuint, GLenum, GLint *)) +SDL_PROC(void, glGetShaderInfoLog, (GLuint, GLsizei, GLsizei *, char *)) +SDL_PROC(void, glGetShaderiv, (GLuint, GLenum, GLint *)) +SDL_PROC(GLint, glGetUniformLocation, (GLuint, const char *)) +SDL_PROC(void, glLinkProgram, (GLuint)) +SDL_PROC(void, glPixelStorei, (GLenum, GLint)) +SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*)) +SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei)) +SDL_PROC(void, glShaderBinary, (GLsizei, const GLuint *, GLenum, const void *, GLsizei)) +SDL_PROC(void, glShaderSource, (GLuint, GLsizei, const char **, const GLint *)) +SDL_PROC(void, glTexImage2D, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *)) +SDL_PROC(void, glTexParameteri, (GLenum, GLenum, GLint)) +SDL_PROC(void, glTexSubImage2D, (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)) +SDL_PROC(void, glUniform1i, (GLint, GLint)) +SDL_PROC(void, glUniform4f, (GLint, GLfloat, GLfloat, GLfloat, GLfloat)) +SDL_PROC(void, glUniformMatrix4fv, (GLint, GLsizei, GLboolean, const GLfloat *)) +SDL_PROC(void, glUseProgram, (GLuint)) +SDL_PROC(void, glVertexAttribPointer, (GLuint, GLint, GLenum, GLboolean, GLsizei, const void *)) +SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei)) +SDL_PROC(void, glBindFramebuffer, (GLenum, GLuint)) +SDL_PROC(void, glFramebufferTexture2D, (GLenum, GLenum, GLenum, GLuint, GLint)) +SDL_PROC(GLenum, glCheckFramebufferStatus, (GLenum)) +SDL_PROC(void, glDeleteFramebuffers, (GLsizei, const GLuint *)) diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c new file mode 100644 index 0000000000..a0ab943659 --- /dev/null +++ b/src/render/opengles2/SDL_render_gles2.c @@ -0,0 +1,1758 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED + +#include "SDL_hints.h" +#include "SDL_opengles2.h" +#include "../SDL_sysrender.h" +#include "SDL_shaders_gles2.h" + +/* Used to re-create the window with OpenGL ES capability */ +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); + +/************************************************************************************************* + * Bootstrap data * + *************************************************************************************************/ + +static SDL_Renderer *GLES2_CreateRenderer(SDL_Window *window, Uint32 flags); + +SDL_RenderDriver GLES2_RenderDriver = { + GLES2_CreateRenderer, + { + "opengles2", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 4, + {SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_BGR888}, + 0, + 0 + } +}; + +/************************************************************************************************* + * Context structures * + *************************************************************************************************/ + +typedef struct GLES2_FBOList GLES2_FBOList; + +struct GLES2_FBOList +{ + Uint32 w, h; + GLuint FBO; + GLES2_FBOList *next; +}; + +typedef struct GLES2_TextureData +{ + GLenum texture; + GLenum texture_type; + GLenum pixel_format; + GLenum pixel_type; + void *pixel_data; + size_t pitch; + GLES2_FBOList *fbo; +} GLES2_TextureData; + +typedef struct GLES2_ShaderCacheEntry +{ + GLuint id; + GLES2_ShaderType type; + const GLES2_ShaderInstance *instance; + int references; + struct GLES2_ShaderCacheEntry *prev; + struct GLES2_ShaderCacheEntry *next; +} GLES2_ShaderCacheEntry; + +typedef struct GLES2_ShaderCache +{ + int count; + GLES2_ShaderCacheEntry *head; +} GLES2_ShaderCache; + +typedef struct GLES2_ProgramCacheEntry +{ + GLuint id; + SDL_BlendMode blend_mode; + GLES2_ShaderCacheEntry *vertex_shader; + GLES2_ShaderCacheEntry *fragment_shader; + GLuint uniform_locations[16]; + struct GLES2_ProgramCacheEntry *prev; + struct GLES2_ProgramCacheEntry *next; +} GLES2_ProgramCacheEntry; + +typedef struct GLES2_ProgramCache +{ + int count; + GLES2_ProgramCacheEntry *head; + GLES2_ProgramCacheEntry *tail; +} GLES2_ProgramCache; + +typedef enum +{ + GLES2_ATTRIBUTE_POSITION = 0, + GLES2_ATTRIBUTE_TEXCOORD = 1, + GLES2_ATTRIBUTE_ANGLE = 2, + GLES2_ATTRIBUTE_CENTER = 3, +} GLES2_Attribute; + +typedef enum +{ + GLES2_UNIFORM_PROJECTION, + GLES2_UNIFORM_TEXTURE, + GLES2_UNIFORM_MODULATION, + GLES2_UNIFORM_COLOR, + GLES2_UNIFORM_COLORTABLE +} GLES2_Uniform; + +typedef enum +{ + GLES2_IMAGESOURCE_SOLID, + GLES2_IMAGESOURCE_TEXTURE_ABGR, + GLES2_IMAGESOURCE_TEXTURE_ARGB, + GLES2_IMAGESOURCE_TEXTURE_RGB, + GLES2_IMAGESOURCE_TEXTURE_BGR +} GLES2_ImageSource; + +typedef struct GLES2_DriverContext +{ + SDL_GLContext *context; + struct { + int blendMode; + SDL_bool tex_coords; + } current; + +#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#include "SDL_gles2funcs.h" +#undef SDL_PROC + GLES2_FBOList *framebuffers; + GLuint window_framebuffer; + + int shader_format_count; + GLenum *shader_formats; + GLES2_ShaderCache shader_cache; + GLES2_ProgramCache program_cache; + GLES2_ProgramCacheEntry *current_program; +} GLES2_DriverContext; + +#define GLES2_MAX_CACHED_PROGRAMS 8 + +/************************************************************************************************* + * Renderer state APIs * + *************************************************************************************************/ + +static int GLES2_ActivateRenderer(SDL_Renderer *renderer); +static void GLES2_WindowEvent(SDL_Renderer * renderer, + const SDL_WindowEvent *event); +static int GLES2_UpdateViewport(SDL_Renderer * renderer); +static void GLES2_DestroyRenderer(SDL_Renderer *renderer); +static int GLES2_SetOrthographicProjection(SDL_Renderer *renderer); + + +static SDL_GLContext SDL_CurrentContext = NULL; + +static int GLES2_LoadFunctions(GLES2_DriverContext * data) +{ +#if SDL_VIDEO_DRIVER_UIKIT +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_ANDROID +#define __SDL_NOGETPROCADDR__ +#elif SDL_VIDEO_DRIVER_PANDORA +#define __SDL_NOGETPROCADDR__ +#endif + +#if defined __SDL_NOGETPROCADDR__ +#define SDL_PROC(ret,func,params) data->func=func; +#else +#define SDL_PROC(ret,func,params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if ( ! data->func ) { \ + return SDL_SetError("Couldn't load GLES2 function %s: %s\n", #func, SDL_GetError()); \ + } \ + } while ( 0 ); +#endif /* _SDL_NOGETPROCADDR_ */ + +#include "SDL_gles2funcs.h" +#undef SDL_PROC + return 0; +} + +GLES2_FBOList * +GLES2_GetFBO(GLES2_DriverContext *data, Uint32 w, Uint32 h) +{ + GLES2_FBOList *result = data->framebuffers; + while ((result) && ((result->w != w) || (result->h != h)) ) + { + result = result->next; + } + if (result == NULL) + { + result = SDL_malloc(sizeof(GLES2_FBOList)); + result->w = w; + result->h = h; + data->glGenFramebuffers(1, &result->FBO); + result->next = data->framebuffers; + data->framebuffers = result; + } + return result; +} + +static int +GLES2_ActivateRenderer(SDL_Renderer * renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + + if (SDL_CurrentContext != rdata->context) { + /* Null out the current program to ensure we set it again */ + rdata->current_program = NULL; + + if (SDL_GL_MakeCurrent(renderer->window, rdata->context) < 0) { + return -1; + } + SDL_CurrentContext = rdata->context; + + GLES2_UpdateViewport(renderer); + } + return 0; +} + +static void +GLES2_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + + if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED || + event->event == SDL_WINDOWEVENT_SHOWN || + event->event == SDL_WINDOWEVENT_HIDDEN) { + /* Rebind the context to the window area */ + SDL_CurrentContext = NULL; + } + + if (event->event == SDL_WINDOWEVENT_MINIMIZED) { + /* According to Apple documentation, we need to finish drawing NOW! */ + rdata->glFinish(); + } +} + +static int +GLES2_UpdateViewport(SDL_Renderer * renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + + if (SDL_CurrentContext != rdata->context) { + /* We'll update the viewport after we rebind the context */ + return 0; + } + + rdata->glViewport(renderer->viewport.x, renderer->viewport.y, + renderer->viewport.w, renderer->viewport.h); + + if (rdata->current_program) { + GLES2_SetOrthographicProjection(renderer); + } + return 0; +} + +static int +GLES2_UpdateClipRect(SDL_Renderer * renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + const SDL_Rect *rect = &renderer->clip_rect; + + if (SDL_CurrentContext != rdata->context) { + /* We'll update the clip rect after we rebind the context */ + return 0; + } + + if (!SDL_RectEmpty(rect)) { + rdata->glEnable(GL_SCISSOR_TEST); + rdata->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h); + } else { + rdata->glDisable(GL_SCISSOR_TEST); + } + return 0; +} + +static void +GLES2_DestroyRenderer(SDL_Renderer *renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + + /* Deallocate everything */ + if (rdata) { + GLES2_ActivateRenderer(renderer); + + { + GLES2_ShaderCacheEntry *entry; + GLES2_ShaderCacheEntry *next; + entry = rdata->shader_cache.head; + while (entry) + { + rdata->glDeleteShader(entry->id); + next = entry->next; + SDL_free(entry); + entry = next; + } + } + { + GLES2_ProgramCacheEntry *entry; + GLES2_ProgramCacheEntry *next; + entry = rdata->program_cache.head; + while (entry) { + rdata->glDeleteProgram(entry->id); + next = entry->next; + SDL_free(entry); + entry = next; + } + } + if (rdata->context) { + while (rdata->framebuffers) { + GLES2_FBOList *nextnode = rdata->framebuffers->next; + rdata->glDeleteFramebuffers(1, &rdata->framebuffers->FBO); + SDL_free(rdata->framebuffers); + rdata->framebuffers = nextnode; + } + SDL_GL_DeleteContext(rdata->context); + } + if (rdata->shader_formats) { + SDL_free(rdata->shader_formats); + } + SDL_free(rdata); + } + SDL_free(renderer); +} + +/************************************************************************************************* + * Texture APIs * + *************************************************************************************************/ + +static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture); +static void GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture); +static int GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, + void **pixels, int *pitch); +static void GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture); +static int GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, + const void *pixels, int pitch); +static int GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture); + +static GLenum +GetScaleQuality(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); + + if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { + return GL_NEAREST; + } else { + return GL_LINEAR; + } +} + +static int +GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLES2_TextureData *tdata; + GLenum format; + GLenum type; + GLenum scaleMode; + + GLES2_ActivateRenderer(renderer); + + /* Determine the corresponding GLES texture format params */ + switch (texture->format) + { + case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_BGR888: + case SDL_PIXELFORMAT_RGB888: + format = GL_RGBA; + type = GL_UNSIGNED_BYTE; + break; + default: + return SDL_SetError("Texture format not supported"); + } + + /* Allocate a texture struct */ + tdata = (GLES2_TextureData *)SDL_calloc(1, sizeof(GLES2_TextureData)); + if (!tdata) { + return SDL_OutOfMemory(); + } + tdata->texture = 0; + tdata->texture_type = GL_TEXTURE_2D; + tdata->pixel_format = format; + tdata->pixel_type = type; + scaleMode = GetScaleQuality(); + + /* Allocate a blob for image data */ + if (texture->access == SDL_TEXTUREACCESS_STREAMING) { + tdata->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format); + tdata->pixel_data = SDL_calloc(1, tdata->pitch * texture->h); + if (!tdata->pixel_data) { + SDL_free(tdata); + return SDL_OutOfMemory(); + } + } + + /* Allocate the texture */ + rdata->glGetError(); + rdata->glGenTextures(1, &tdata->texture); + if (rdata->glGetError() != GL_NO_ERROR) { + SDL_free(tdata); + return SDL_SetError("Texture creation failed in glGenTextures()"); + } + rdata->glActiveTexture(GL_TEXTURE0); + rdata->glBindTexture(tdata->texture_type, tdata->texture); + rdata->glTexParameteri(tdata->texture_type, GL_TEXTURE_MIN_FILTER, scaleMode); + rdata->glTexParameteri(tdata->texture_type, GL_TEXTURE_MAG_FILTER, scaleMode); + rdata->glTexParameteri(tdata->texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + rdata->glTexParameteri(tdata->texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + rdata->glTexImage2D(tdata->texture_type, 0, format, texture->w, texture->h, 0, format, type, NULL); + if (rdata->glGetError() != GL_NO_ERROR) { + rdata->glDeleteTextures(1, &tdata->texture); + SDL_free(tdata); + return SDL_SetError("Texture creation failed"); + } + texture->driverdata = tdata; + + if (texture->access == SDL_TEXTUREACCESS_TARGET) { + tdata->fbo = GLES2_GetFBO(renderer->driverdata, texture->w, texture->h); + } else { + tdata->fbo = NULL; + } + + return 0; +} + +static void +GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + + GLES2_ActivateRenderer(renderer); + + /* Destroy the texture */ + if (tdata) + { + rdata->glDeleteTextures(1, &tdata->texture); + SDL_free(tdata->pixel_data); + SDL_free(tdata); + texture->driverdata = NULL; + } +} + +static int +GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, + void **pixels, int *pitch) +{ + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + + /* Retrieve the buffer/pitch for the specified region */ + *pixels = (Uint8 *)tdata->pixel_data + + (tdata->pitch * rect->y) + + (rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pitch = tdata->pitch; + + return 0; +} + +static void +GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) +{ + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + SDL_Rect rect; + + /* We do whole texture updates, at least for now */ + rect.x = 0; + rect.y = 0; + rect.w = texture->w; + rect.h = texture->h; + GLES2_UpdateTexture(renderer, texture, &rect, tdata->pixel_data, tdata->pitch); +} + +static int +GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, + const void *pixels, int pitch) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + Uint8 *blob = NULL; + Uint8 *src; + int srcPitch; + int y; + + GLES2_ActivateRenderer(renderer); + + /* Bail out if we're supposed to update an empty rectangle */ + if (rect->w <= 0 || rect->h <= 0) + return 0; + + /* Reformat the texture data into a tightly packed array */ + srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format); + src = (Uint8 *)pixels; + if (pitch != srcPitch) { + blob = (Uint8 *)SDL_malloc(srcPitch * rect->h); + if (!blob) { + return SDL_OutOfMemory(); + } + src = blob; + for (y = 0; y < rect->h; ++y) + { + SDL_memcpy(src, pixels, srcPitch); + src += srcPitch; + pixels = (Uint8 *)pixels + pitch; + } + src = blob; + } + + /* Create a texture subimage with the supplied data */ + rdata->glGetError(); + rdata->glActiveTexture(GL_TEXTURE0); + rdata->glBindTexture(tdata->texture_type, tdata->texture); + rdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + rdata->glTexSubImage2D(tdata->texture_type, + 0, + rect->x, + rect->y, + rect->w, + rect->h, + tdata->pixel_format, + tdata->pixel_type, + src); + if (blob) { + SDL_free(blob); + } + + if (rdata->glGetError() != GL_NO_ERROR) { + return SDL_SetError("Failed to update texture"); + } + return 0; +} + +static int +GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +{ + GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata; + GLES2_TextureData *texturedata = NULL; + GLenum status; + + if (texture == NULL) { + data->glBindFramebuffer(GL_FRAMEBUFFER, data->window_framebuffer); + } else { + texturedata = (GLES2_TextureData *) texture->driverdata; + data->glBindFramebuffer(GL_FRAMEBUFFER, texturedata->fbo->FBO); + /* TODO: check if texture pixel format allows this operation */ + data->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texturedata->texture_type, texturedata->texture, 0); + /* Check FBO status */ + status = data->glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + return SDL_SetError("glFramebufferTexture2D() failed"); + } + } + return 0; +} + +/************************************************************************************************* + * Shader management functions * + *************************************************************************************************/ + +static GLES2_ShaderCacheEntry *GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type, + SDL_BlendMode blendMode); +static void GLES2_EvictShader(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *entry); +static GLES2_ProgramCacheEntry *GLES2_CacheProgram(SDL_Renderer *renderer, + GLES2_ShaderCacheEntry *vertex, + GLES2_ShaderCacheEntry *fragment, + SDL_BlendMode blendMode); +static int GLES2_SelectProgram(SDL_Renderer *renderer, GLES2_ImageSource source, + SDL_BlendMode blendMode); + +static GLES2_ProgramCacheEntry * +GLES2_CacheProgram(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *vertex, + GLES2_ShaderCacheEntry *fragment, SDL_BlendMode blendMode) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLES2_ProgramCacheEntry *entry; + GLES2_ShaderCacheEntry *shaderEntry; + GLint linkSuccessful; + + /* Check if we've already cached this program */ + entry = rdata->program_cache.head; + while (entry) + { + if (entry->vertex_shader == vertex && entry->fragment_shader == fragment) + break; + entry = entry->next; + } + if (entry) + { + if (rdata->program_cache.head != entry) + { + if (entry->next) + entry->next->prev = entry->prev; + if (entry->prev) + entry->prev->next = entry->next; + entry->prev = NULL; + entry->next = rdata->program_cache.head; + rdata->program_cache.head->prev = entry; + rdata->program_cache.head = entry; + } + return entry; + } + + /* Create a program cache entry */ + entry = (GLES2_ProgramCacheEntry *)SDL_calloc(1, sizeof(GLES2_ProgramCacheEntry)); + if (!entry) + { + SDL_OutOfMemory(); + return NULL; + } + entry->vertex_shader = vertex; + entry->fragment_shader = fragment; + entry->blend_mode = blendMode; + + /* Create the program and link it */ + rdata->glGetError(); + entry->id = rdata->glCreateProgram(); + rdata->glAttachShader(entry->id, vertex->id); + rdata->glAttachShader(entry->id, fragment->id); + rdata->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_POSITION, "a_position"); + rdata->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_TEXCOORD, "a_texCoord"); + rdata->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_ANGLE, "a_angle"); + rdata->glBindAttribLocation(entry->id, GLES2_ATTRIBUTE_CENTER, "a_center"); + rdata->glLinkProgram(entry->id); + rdata->glGetProgramiv(entry->id, GL_LINK_STATUS, &linkSuccessful); + if (rdata->glGetError() != GL_NO_ERROR || !linkSuccessful) + { + rdata->glDeleteProgram(entry->id); + SDL_free(entry); + SDL_SetError("Failed to link shader program"); + return NULL; + } + + /* Predetermine locations of uniform variables */ + entry->uniform_locations[GLES2_UNIFORM_PROJECTION] = + rdata->glGetUniformLocation(entry->id, "u_projection"); + entry->uniform_locations[GLES2_UNIFORM_TEXTURE] = + rdata->glGetUniformLocation(entry->id, "u_texture"); + entry->uniform_locations[GLES2_UNIFORM_MODULATION] = + rdata->glGetUniformLocation(entry->id, "u_modulation"); + entry->uniform_locations[GLES2_UNIFORM_COLOR] = + rdata->glGetUniformLocation(entry->id, "u_color"); + entry->uniform_locations[GLES2_UNIFORM_COLORTABLE] = + rdata->glGetUniformLocation(entry->id, "u_colorTable"); + + /* Cache the linked program */ + if (rdata->program_cache.head) + { + entry->next = rdata->program_cache.head; + rdata->program_cache.head->prev = entry; + } + else + { + rdata->program_cache.tail = entry; + } + rdata->program_cache.head = entry; + ++rdata->program_cache.count; + + /* Increment the refcount of the shaders we're using */ + ++vertex->references; + ++fragment->references; + + /* Evict the last entry from the cache if we exceed the limit */ + if (rdata->program_cache.count > GLES2_MAX_CACHED_PROGRAMS) + { + shaderEntry = rdata->program_cache.tail->vertex_shader; + if (--shaderEntry->references <= 0) + GLES2_EvictShader(renderer, shaderEntry); + shaderEntry = rdata->program_cache.tail->fragment_shader; + if (--shaderEntry->references <= 0) + GLES2_EvictShader(renderer, shaderEntry); + rdata->glDeleteProgram(rdata->program_cache.tail->id); + rdata->program_cache.tail = rdata->program_cache.tail->prev; + SDL_free(rdata->program_cache.tail->next); + rdata->program_cache.tail->next = NULL; + --rdata->program_cache.count; + } + return entry; +} + +static GLES2_ShaderCacheEntry * +GLES2_CacheShader(SDL_Renderer *renderer, GLES2_ShaderType type, SDL_BlendMode blendMode) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + const GLES2_Shader *shader; + const GLES2_ShaderInstance *instance = NULL; + GLES2_ShaderCacheEntry *entry = NULL; + GLint compileSuccessful = GL_FALSE; + int i, j; + + /* Find the corresponding shader */ + shader = GLES2_GetShader(type, blendMode); + if (!shader) + { + SDL_SetError("No shader matching the requested characteristics was found"); + return NULL; + } + + /* Find a matching shader instance that's supported on this hardware */ + for (i = 0; i < shader->instance_count && !instance; ++i) + { + for (j = 0; j < rdata->shader_format_count && !instance; ++j) + { + if (!shader->instances) + continue; + if (!shader->instances[i]) + continue; + if (shader->instances[i]->format != rdata->shader_formats[j]) + continue; + instance = shader->instances[i]; + } + } + if (!instance) + { + SDL_SetError("The specified shader cannot be loaded on the current platform"); + return NULL; + } + + /* Check if we've already cached this shader */ + entry = rdata->shader_cache.head; + while (entry) + { + if (entry->instance == instance) + break; + entry = entry->next; + } + if (entry) + return entry; + + /* Create a shader cache entry */ + entry = (GLES2_ShaderCacheEntry *)SDL_calloc(1, sizeof(GLES2_ShaderCacheEntry)); + if (!entry) + { + SDL_OutOfMemory(); + return NULL; + } + entry->type = type; + entry->instance = instance; + + /* Compile or load the selected shader instance */ + rdata->glGetError(); + entry->id = rdata->glCreateShader(instance->type); + if (instance->format == (GLenum)-1) + { + rdata->glShaderSource(entry->id, 1, (const char **)&instance->data, NULL); + rdata->glCompileShader(entry->id); + rdata->glGetShaderiv(entry->id, GL_COMPILE_STATUS, &compileSuccessful); + } + else + { + rdata->glShaderBinary(1, &entry->id, instance->format, instance->data, instance->length); + compileSuccessful = GL_TRUE; + } + if (rdata->glGetError() != GL_NO_ERROR || !compileSuccessful) + { + char *info = NULL; + int length = 0; + + rdata->glGetShaderiv(entry->id, GL_INFO_LOG_LENGTH, &length); + if (length > 0) { + info = SDL_stack_alloc(char, length); + if (info) { + rdata->glGetShaderInfoLog(entry->id, length, &length, info); + } + } + if (info) { + SDL_SetError("Failed to load the shader: %s", info); + SDL_stack_free(info); + } else { + SDL_SetError("Failed to load the shader"); + } + rdata->glDeleteShader(entry->id); + SDL_free(entry); + return NULL; + } + + /* Link the shader entry in at the front of the cache */ + if (rdata->shader_cache.head) + { + entry->next = rdata->shader_cache.head; + rdata->shader_cache.head->prev = entry; + } + rdata->shader_cache.head = entry; + ++rdata->shader_cache.count; + return entry; +} + +static void +GLES2_EvictShader(SDL_Renderer *renderer, GLES2_ShaderCacheEntry *entry) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + + /* Unlink the shader from the cache */ + if (entry->next) + entry->next->prev = entry->prev; + if (entry->prev) + entry->prev->next = entry->next; + if (rdata->shader_cache.head == entry) + rdata->shader_cache.head = entry->next; + --rdata->shader_cache.count; + + /* Deallocate the shader */ + rdata->glDeleteShader(entry->id); + SDL_free(entry); +} + +static int +GLES2_SelectProgram(SDL_Renderer *renderer, GLES2_ImageSource source, SDL_BlendMode blendMode) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLES2_ShaderCacheEntry *vertex = NULL; + GLES2_ShaderCacheEntry *fragment = NULL; + GLES2_ShaderType vtype, ftype; + GLES2_ProgramCacheEntry *program; + + /* Select an appropriate shader pair for the specified modes */ + vtype = GLES2_SHADER_VERTEX_DEFAULT; + switch (source) + { + case GLES2_IMAGESOURCE_SOLID: + ftype = GLES2_SHADER_FRAGMENT_SOLID_SRC; + break; + case GLES2_IMAGESOURCE_TEXTURE_ABGR: + ftype = GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC; + break; + case GLES2_IMAGESOURCE_TEXTURE_ARGB: + ftype = GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC; + break; + case GLES2_IMAGESOURCE_TEXTURE_RGB: + ftype = GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC; + break; + case GLES2_IMAGESOURCE_TEXTURE_BGR: + ftype = GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC; + break; + default: + goto fault; + } + + /* Load the requested shaders */ + vertex = GLES2_CacheShader(renderer, vtype, blendMode); + if (!vertex) + goto fault; + fragment = GLES2_CacheShader(renderer, ftype, blendMode); + if (!fragment) + goto fault; + + /* Check if we need to change programs at all */ + if (rdata->current_program && + rdata->current_program->vertex_shader == vertex && + rdata->current_program->fragment_shader == fragment) + return 0; + + /* Generate a matching program */ + program = GLES2_CacheProgram(renderer, vertex, fragment, blendMode); + if (!program) + goto fault; + + /* Select that program in OpenGL */ + rdata->glGetError(); + rdata->glUseProgram(program->id); + if (rdata->glGetError() != GL_NO_ERROR) + { + SDL_SetError("Failed to select program"); + goto fault; + } + + /* Set the current program */ + rdata->current_program = program; + + /* Activate an orthographic projection */ + if (GLES2_SetOrthographicProjection(renderer) < 0) + goto fault; + + /* Clean up and return */ + return 0; +fault: + if (vertex && vertex->references <= 0) + GLES2_EvictShader(renderer, vertex); + if (fragment && fragment->references <= 0) + GLES2_EvictShader(renderer, fragment); + rdata->current_program = NULL; + return -1; +} + +static int +GLES2_SetOrthographicProjection(SDL_Renderer *renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLfloat projection[4][4]; + GLuint locProjection; + + if (!renderer->viewport.w || !renderer->viewport.h) { + return 0; + } + + /* Prepare an orthographic projection */ + projection[0][0] = 2.0f / renderer->viewport.w; + projection[0][1] = 0.0f; + projection[0][2] = 0.0f; + projection[0][3] = 0.0f; + projection[1][0] = 0.0f; + if (renderer->target) { + projection[1][1] = 2.0f / renderer->viewport.h; + } else { + projection[1][1] = -2.0f / renderer->viewport.h; + } + projection[1][2] = 0.0f; + projection[1][3] = 0.0f; + projection[2][0] = 0.0f; + projection[2][1] = 0.0f; + projection[2][2] = 0.0f; + projection[2][3] = 0.0f; + projection[3][0] = -1.0f; + if (renderer->target) { + projection[3][1] = -1.0f; + } else { + projection[3][1] = 1.0f; + } + projection[3][2] = 0.0f; + projection[3][3] = 1.0f; + + /* Set the projection matrix */ + locProjection = rdata->current_program->uniform_locations[GLES2_UNIFORM_PROJECTION]; + rdata->glGetError(); + rdata->glUniformMatrix4fv(locProjection, 1, GL_FALSE, (GLfloat *)projection); + if (rdata->glGetError() != GL_NO_ERROR) { + return SDL_SetError("Failed to set orthographic projection"); + } + return 0; +} + +/************************************************************************************************* + * Rendering functions * + *************************************************************************************************/ + +static const float inv255f = 1.0f / 255.0f; + +static int GLES2_RenderClear(SDL_Renderer *renderer); +static int GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +static int GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count); +static int GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count); +static int GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, + const SDL_FRect *dstrect); +static int GLES2_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip); +static int GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch); +static void GLES2_RenderPresent(SDL_Renderer *renderer); + + +static int +GLES2_RenderClear(SDL_Renderer * renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + + GLES2_ActivateRenderer(renderer); + + rdata->glClearColor((GLfloat) renderer->r * inv255f, + (GLfloat) renderer->g * inv255f, + (GLfloat) renderer->b * inv255f, + (GLfloat) renderer->a * inv255f); + + rdata->glClear(GL_COLOR_BUFFER_BIT); + + return 0; +} + +static void +GLES2_SetBlendMode(GLES2_DriverContext *rdata, int blendMode) +{ + if (blendMode != rdata->current.blendMode) { + switch (blendMode) { + default: + case SDL_BLENDMODE_NONE: + rdata->glDisable(GL_BLEND); + break; + case SDL_BLENDMODE_BLEND: + rdata->glEnable(GL_BLEND); + rdata->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + break; + case SDL_BLENDMODE_ADD: + rdata->glEnable(GL_BLEND); + rdata->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ZERO, GL_ONE); + break; + case SDL_BLENDMODE_MOD: + rdata->glEnable(GL_BLEND); + rdata->glBlendFuncSeparate(GL_ZERO, GL_SRC_COLOR, GL_ZERO, GL_ONE); + break; + } + rdata->current.blendMode = blendMode; + } +} + +static void +GLES2_SetTexCoords(GLES2_DriverContext * rdata, SDL_bool enabled) +{ + if (enabled != rdata->current.tex_coords) { + if (enabled) { + rdata->glEnableVertexAttribArray(GLES2_ATTRIBUTE_TEXCOORD); + } else { + rdata->glDisableVertexAttribArray(GLES2_ATTRIBUTE_TEXCOORD); + } + rdata->current.tex_coords = enabled; + } +} + +static int +GLES2_SetDrawingState(SDL_Renderer * renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + int blendMode = renderer->blendMode; + GLuint locColor; + + rdata->glGetError(); + + GLES2_ActivateRenderer(renderer); + + GLES2_SetBlendMode(rdata, blendMode); + + GLES2_SetTexCoords(rdata, SDL_FALSE); + + /* Activate an appropriate shader and set the projection matrix */ + if (GLES2_SelectProgram(renderer, GLES2_IMAGESOURCE_SOLID, blendMode) < 0) + return -1; + + /* Select the color to draw with */ + locColor = rdata->current_program->uniform_locations[GLES2_UNIFORM_COLOR]; + if (renderer->target && + (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || + renderer->target->format == SDL_PIXELFORMAT_RGB888)) { + rdata->glUniform4f(locColor, + renderer->b * inv255f, + renderer->g * inv255f, + renderer->r * inv255f, + renderer->a * inv255f); + } else { + rdata->glUniform4f(locColor, + renderer->r * inv255f, + renderer->g * inv255f, + renderer->b * inv255f, + renderer->a * inv255f); + } + return 0; +} + +static int +GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLfloat *vertices; + int idx; + + if (GLES2_SetDrawingState(renderer) < 0) { + return -1; + } + + /* Emit the specified vertices as points */ + vertices = SDL_stack_alloc(GLfloat, count * 2); + for (idx = 0; idx < count; ++idx) { + GLfloat x = points[idx].x + 0.5f; + GLfloat y = points[idx].y + 0.5f; + + vertices[idx * 2] = x; + vertices[(idx * 2) + 1] = y; + } + rdata->glGetError(); + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + rdata->glDrawArrays(GL_POINTS, 0, count); + SDL_stack_free(vertices); + if (rdata->glGetError() != GL_NO_ERROR) { + return SDL_SetError("Failed to render points"); + } + return 0; +} + +static int +GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLfloat *vertices; + int idx; + + if (GLES2_SetDrawingState(renderer) < 0) { + return -1; + } + + /* Emit a line strip including the specified vertices */ + vertices = SDL_stack_alloc(GLfloat, count * 2); + for (idx = 0; idx < count; ++idx) { + GLfloat x = points[idx].x + 0.5f; + GLfloat y = points[idx].y + 0.5f; + + vertices[idx * 2] = x; + vertices[(idx * 2) + 1] = y; + } + rdata->glGetError(); + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + rdata->glDrawArrays(GL_LINE_STRIP, 0, count); + + /* We need to close the endpoint of the line */ + if (count == 2 || + points[0].x != points[count-1].x || points[0].y != points[count-1].y) { + rdata->glDrawArrays(GL_POINTS, count-1, 1); + } + SDL_stack_free(vertices); + if (rdata->glGetError() != GL_NO_ERROR) { + return SDL_SetError("Failed to render lines"); + } + return 0; +} + +static int +GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLfloat vertices[8]; + int idx; + + if (GLES2_SetDrawingState(renderer) < 0) { + return -1; + } + + /* Emit a line loop for each rectangle */ + rdata->glGetError(); + for (idx = 0; idx < count; ++idx) { + const SDL_FRect *rect = &rects[idx]; + + GLfloat xMin = rect->x; + GLfloat xMax = (rect->x + rect->w); + GLfloat yMin = rect->y; + GLfloat yMax = (rect->y + rect->h); + + vertices[0] = xMin; + vertices[1] = yMin; + vertices[2] = xMax; + vertices[3] = yMin; + vertices[4] = xMin; + vertices[5] = yMax; + vertices[6] = xMax; + vertices[7] = yMax; + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + rdata->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + } + if (rdata->glGetError() != GL_NO_ERROR) { + return SDL_SetError("Failed to render filled rects"); + } + return 0; +} + +static int +GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, + const SDL_FRect *dstrect) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_ImageSource sourceType; + SDL_BlendMode blendMode; + GLfloat vertices[8]; + GLfloat texCoords[8]; + GLuint locTexture; + GLuint locModulation; + + GLES2_ActivateRenderer(renderer); + + /* Activate an appropriate shader and set the projection matrix */ + blendMode = texture->blendMode; + if (renderer->target) { + /* Check if we need to do color mapping between the source and render target textures */ + if (renderer->target->format != texture->format) { + switch (texture->format) + { + case SDL_PIXELFORMAT_ABGR8888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; + } + break; + case SDL_PIXELFORMAT_ARGB8888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; + } + break; + case SDL_PIXELFORMAT_BGR888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + } + break; + case SDL_PIXELFORMAT_RGB888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + } + break; + } + } + else sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */ + } + else { + switch (texture->format) + { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; + break; + default: + return -1; + } + } + if (GLES2_SelectProgram(renderer, sourceType, blendMode) < 0) + return -1; + + /* Select the target texture */ + locTexture = rdata->current_program->uniform_locations[GLES2_UNIFORM_TEXTURE]; + rdata->glGetError(); + rdata->glActiveTexture(GL_TEXTURE0); + rdata->glBindTexture(tdata->texture_type, tdata->texture); + rdata->glUniform1i(locTexture, 0); + + /* Configure color modulation */ + locModulation = rdata->current_program->uniform_locations[GLES2_UNIFORM_MODULATION]; + if (renderer->target && + (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || + renderer->target->format == SDL_PIXELFORMAT_RGB888)) { + rdata->glUniform4f(locModulation, + texture->b * inv255f, + texture->g * inv255f, + texture->r * inv255f, + texture->a * inv255f); + } else { + rdata->glUniform4f(locModulation, + texture->r * inv255f, + texture->g * inv255f, + texture->b * inv255f, + texture->a * inv255f); + } + + /* Configure texture blending */ + GLES2_SetBlendMode(rdata, blendMode); + + GLES2_SetTexCoords(rdata, SDL_TRUE); + + /* Emit the textured quad */ + vertices[0] = dstrect->x; + vertices[1] = dstrect->y; + vertices[2] = (dstrect->x + dstrect->w); + vertices[3] = dstrect->y; + vertices[4] = dstrect->x; + vertices[5] = (dstrect->y + dstrect->h); + vertices[6] = (dstrect->x + dstrect->w); + vertices[7] = (dstrect->y + dstrect->h); + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + texCoords[0] = srcrect->x / (GLfloat)texture->w; + texCoords[1] = srcrect->y / (GLfloat)texture->h; + texCoords[2] = (srcrect->x + srcrect->w) / (GLfloat)texture->w; + texCoords[3] = srcrect->y / (GLfloat)texture->h; + texCoords[4] = srcrect->x / (GLfloat)texture->w; + texCoords[5] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; + texCoords[6] = (srcrect->x + srcrect->w) / (GLfloat)texture->w; + texCoords[7] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords); + rdata->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + if (rdata->glGetError() != GL_NO_ERROR) { + return SDL_SetError("Failed to render texture"); + } + return 0; +} + +static int +GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, + const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_ImageSource sourceType; + SDL_BlendMode blendMode; + GLfloat vertices[8]; + GLfloat texCoords[8]; + GLuint locTexture; + GLuint locModulation; + GLfloat translate[8]; + GLfloat fAngle[4]; + GLfloat tmp; + + GLES2_ActivateRenderer(renderer); + + rdata->glEnableVertexAttribArray(GLES2_ATTRIBUTE_CENTER); + rdata->glEnableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE); + fAngle[0] = fAngle[1] = fAngle[2] = fAngle[3] = (GLfloat)(360.0f - angle); + /* Calculate the center of rotation */ + translate[0] = translate[2] = translate[4] = translate[6] = (center->x + dstrect->x); + translate[1] = translate[3] = translate[5] = translate[7] = (center->y + dstrect->y); + + /* Activate an appropriate shader and set the projection matrix */ + blendMode = texture->blendMode; + if (renderer->target) { + /* Check if we need to do color mapping between the source and render target textures */ + if (renderer->target->format != texture->format) { + switch (texture->format) + { + case SDL_PIXELFORMAT_ABGR8888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; + } + break; + case SDL_PIXELFORMAT_ARGB8888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; + } + break; + case SDL_PIXELFORMAT_BGR888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + } + break; + case SDL_PIXELFORMAT_RGB888: + switch (renderer->target->format) + { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + } + break; + } + } + else sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */ + } + else { + switch (texture->format) + { + case SDL_PIXELFORMAT_ABGR8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; + case SDL_PIXELFORMAT_ARGB8888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_BGR888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; + case SDL_PIXELFORMAT_RGB888: + sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; + break; + default: + return -1; + } + } + if (GLES2_SelectProgram(renderer, sourceType, blendMode) < 0) + return -1; + + /* Select the target texture */ + locTexture = rdata->current_program->uniform_locations[GLES2_UNIFORM_TEXTURE]; + rdata->glGetError(); + rdata->glActiveTexture(GL_TEXTURE0); + rdata->glBindTexture(tdata->texture_type, tdata->texture); + rdata->glUniform1i(locTexture, 0); + + /* Configure color modulation */ + locModulation = rdata->current_program->uniform_locations[GLES2_UNIFORM_MODULATION]; + if (renderer->target && + (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || + renderer->target->format == SDL_PIXELFORMAT_RGB888)) { + rdata->glUniform4f(locModulation, + texture->b * inv255f, + texture->g * inv255f, + texture->r * inv255f, + texture->a * inv255f); + } else { + rdata->glUniform4f(locModulation, + texture->r * inv255f, + texture->g * inv255f, + texture->b * inv255f, + texture->a * inv255f); + } + + /* Configure texture blending */ + GLES2_SetBlendMode(rdata, blendMode); + + GLES2_SetTexCoords(rdata, SDL_TRUE); + + /* Emit the textured quad */ + vertices[0] = dstrect->x; + vertices[1] = dstrect->y; + vertices[2] = (dstrect->x + dstrect->w); + vertices[3] = dstrect->y; + vertices[4] = dstrect->x; + vertices[5] = (dstrect->y + dstrect->h); + vertices[6] = (dstrect->x + dstrect->w); + vertices[7] = (dstrect->y + dstrect->h); + if (flip & SDL_FLIP_HORIZONTAL) { + tmp = vertices[0]; + vertices[0] = vertices[4] = vertices[2]; + vertices[2] = vertices[6] = tmp; + } + if (flip & SDL_FLIP_VERTICAL) { + tmp = vertices[1]; + vertices[1] = vertices[3] = vertices[5]; + vertices[5] = vertices[7] = tmp; + } + + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 1, GL_FLOAT, GL_FALSE, 0, &fAngle); + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_CENTER, 2, GL_FLOAT, GL_FALSE, 0, translate); + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); + + texCoords[0] = srcrect->x / (GLfloat)texture->w; + texCoords[1] = srcrect->y / (GLfloat)texture->h; + texCoords[2] = (srcrect->x + srcrect->w) / (GLfloat)texture->w; + texCoords[3] = srcrect->y / (GLfloat)texture->h; + texCoords[4] = srcrect->x / (GLfloat)texture->w; + texCoords[5] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; + texCoords[6] = (srcrect->x + srcrect->w) / (GLfloat)texture->w; + texCoords[7] = (srcrect->y + srcrect->h) / (GLfloat)texture->h; + rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords); + rdata->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); + rdata->glDisableVertexAttribArray(GLES2_ATTRIBUTE_CENTER); + rdata->glDisableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE); + if (rdata->glGetError() != GL_NO_ERROR) { + return SDL_SetError("Failed to render texture"); + } + return 0; +} + +static int +GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata; + Uint32 temp_format = SDL_PIXELFORMAT_ABGR8888; + void *temp_pixels; + int temp_pitch; + Uint8 *src, *dst, *tmp; + int w, h, length, rows; + int status; + + GLES2_ActivateRenderer(renderer); + + temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format); + temp_pixels = SDL_malloc(rect->h * temp_pitch); + if (!temp_pixels) { + return SDL_OutOfMemory(); + } + + SDL_GetRendererOutputSize(renderer, &w, &h); + + rdata->glPixelStorei(GL_PACK_ALIGNMENT, 1); + + rdata->glReadPixels(rect->x, (h-rect->y)-rect->h, rect->w, rect->h, + GL_RGBA, GL_UNSIGNED_BYTE, temp_pixels); + + /* Flip the rows to be top-down */ + length = rect->w * SDL_BYTESPERPIXEL(temp_format); + src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch; + dst = (Uint8*)temp_pixels; + tmp = SDL_stack_alloc(Uint8, length); + rows = rect->h / 2; + while (rows--) { + SDL_memcpy(tmp, dst, length); + SDL_memcpy(dst, src, length); + SDL_memcpy(src, tmp, length); + dst += temp_pitch; + src -= temp_pitch; + } + SDL_stack_free(tmp); + + status = SDL_ConvertPixels(rect->w, rect->h, + temp_format, temp_pixels, temp_pitch, + pixel_format, pixels, pitch); + SDL_free(temp_pixels); + + return status; +} + +static void +GLES2_RenderPresent(SDL_Renderer *renderer) +{ + GLES2_ActivateRenderer(renderer); + + /* Tell the video driver to swap buffers */ + SDL_GL_SwapWindow(renderer->window); +} + + +/************************************************************************************************* + * Bind/unbinding of textures + *************************************************************************************************/ +static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh); +static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture); + +static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh) { + GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata; + GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata; + GLES2_ActivateRenderer(renderer); + + data->glBindTexture(texturedata->texture_type, texturedata->texture); + + if(texw) *texw = 1.0; + if(texh) *texh = 1.0; + + return 0; +} + +static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) { + GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata; + GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata; + GLES2_ActivateRenderer(renderer); + + data->glBindTexture(texturedata->texture_type, 0); + + return 0; +} + + +/************************************************************************************************* + * Renderer instantiation * + *************************************************************************************************/ + +#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B + +static void +GLES2_ResetState(SDL_Renderer *renderer) +{ + GLES2_DriverContext *rdata = (GLES2_DriverContext *) renderer->driverdata; + + if (SDL_CurrentContext == rdata->context) { + GLES2_UpdateViewport(renderer); + } else { + GLES2_ActivateRenderer(renderer); + } + + rdata->current.blendMode = -1; + rdata->current.tex_coords = SDL_FALSE; + + rdata->glEnableVertexAttribArray(GLES2_ATTRIBUTE_POSITION); + rdata->glDisableVertexAttribArray(GLES2_ATTRIBUTE_TEXCOORD); +} + +static SDL_Renderer * +GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) +{ + SDL_Renderer *renderer; + GLES2_DriverContext *rdata; + GLint nFormats; +#ifndef ZUNE_HD + GLboolean hasCompiler; +#endif + Uint32 windowFlags; + GLint window_framebuffer; + + SDL_GL_SetAttribute(SDL_GL_CONTEXT_EGL, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); + + windowFlags = SDL_GetWindowFlags(window); + if (!(windowFlags & SDL_WINDOW_OPENGL)) { + if (SDL_RecreateWindow(window, windowFlags | SDL_WINDOW_OPENGL) < 0) { + /* Uh oh, better try to put it back... */ + SDL_RecreateWindow(window, windowFlags); + return NULL; + } + } + + /* Create the renderer struct */ + renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(SDL_Renderer)); + if (!renderer) { + SDL_OutOfMemory(); + return NULL; + } + + rdata = (GLES2_DriverContext *)SDL_calloc(1, sizeof(GLES2_DriverContext)); + if (!rdata) { + GLES2_DestroyRenderer(renderer); + SDL_OutOfMemory(); + return NULL; + } + renderer->info = GLES2_RenderDriver.info; + renderer->info.flags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE; + renderer->driverdata = rdata; + renderer->window = window; + + /* Create an OpenGL ES 2.0 context */ + rdata->context = SDL_GL_CreateContext(window); + if (!rdata->context) + { + GLES2_DestroyRenderer(renderer); + return NULL; + } + if (SDL_GL_MakeCurrent(window, rdata->context) < 0) { + GLES2_DestroyRenderer(renderer); + return NULL; + } + + if (GLES2_LoadFunctions(rdata) < 0) { + GLES2_DestroyRenderer(renderer); + return NULL; + } + + if (flags & SDL_RENDERER_PRESENTVSYNC) { + SDL_GL_SetSwapInterval(1); + } else { + SDL_GL_SetSwapInterval(0); + } + if (SDL_GL_GetSwapInterval() > 0) { + renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; + } + + /* Determine supported shader formats */ + /* HACK: glGetInteger is broken on the Zune HD's compositor, so we just hardcode this */ + rdata->glGetError(); +#ifdef ZUNE_HD + nFormats = 1; +#else /* !ZUNE_HD */ + rdata->glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &nFormats); + rdata->glGetBooleanv(GL_SHADER_COMPILER, &hasCompiler); + if (hasCompiler) + ++nFormats; +#endif /* ZUNE_HD */ + rdata->shader_formats = (GLenum *)SDL_calloc(nFormats, sizeof(GLenum)); + if (!rdata->shader_formats) + { + GLES2_DestroyRenderer(renderer); + SDL_OutOfMemory(); + return NULL; + } + rdata->shader_format_count = nFormats; +#ifdef ZUNE_HD + rdata->shader_formats[0] = GL_NVIDIA_PLATFORM_BINARY_NV; +#else /* !ZUNE_HD */ + rdata->glGetIntegerv(GL_SHADER_BINARY_FORMATS, (GLint *)rdata->shader_formats); + if (rdata->glGetError() != GL_NO_ERROR) + { + GLES2_DestroyRenderer(renderer); + SDL_SetError("Failed to query supported shader formats"); + return NULL; + } + if (hasCompiler) + rdata->shader_formats[nFormats - 1] = (GLenum)-1; +#endif /* ZUNE_HD */ + + rdata->framebuffers = NULL; + rdata->glGetIntegerv(GL_FRAMEBUFFER_BINDING, &window_framebuffer); + rdata->window_framebuffer = (GLuint)window_framebuffer; + + /* Populate the function pointers for the module */ + renderer->WindowEvent = &GLES2_WindowEvent; + renderer->CreateTexture = &GLES2_CreateTexture; + renderer->UpdateTexture = &GLES2_UpdateTexture; + renderer->LockTexture = &GLES2_LockTexture; + renderer->UnlockTexture = &GLES2_UnlockTexture; + renderer->SetRenderTarget = &GLES2_SetRenderTarget; + renderer->UpdateViewport = &GLES2_UpdateViewport; + renderer->UpdateClipRect = &GLES2_UpdateClipRect; + renderer->RenderClear = &GLES2_RenderClear; + renderer->RenderDrawPoints = &GLES2_RenderDrawPoints; + renderer->RenderDrawLines = &GLES2_RenderDrawLines; + renderer->RenderFillRects = &GLES2_RenderFillRects; + renderer->RenderCopy = &GLES2_RenderCopy; + renderer->RenderCopyEx = &GLES2_RenderCopyEx; + renderer->RenderReadPixels = &GLES2_RenderReadPixels; + renderer->RenderPresent = &GLES2_RenderPresent; + renderer->DestroyTexture = &GLES2_DestroyTexture; + renderer->DestroyRenderer = &GLES2_DestroyRenderer; + renderer->GL_BindTexture = &GLES2_BindTexture; + renderer->GL_UnbindTexture = &GLES2_UnbindTexture; + + GLES2_ResetState(renderer); + + return renderer; +} + +#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengles2/SDL_shaders_gles2.c b/src/render/opengles2/SDL_shaders_gles2.c new file mode 100644 index 0000000000..fb6921fd09 --- /dev/null +++ b/src/render/opengles2/SDL_shaders_gles2.c @@ -0,0 +1,785 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED + +#include "SDL_video.h" +#include "SDL_opengles2.h" +#include "SDL_shaders_gles2.h" +#include "SDL_stdinc.h" + +/************************************************************************************************* + * Vertex/fragment shader source * + *************************************************************************************************/ + +static const Uint8 GLES2_VertexSrc_Default_[] = " \ + uniform mat4 u_projection; \ + attribute vec2 a_position; \ + attribute vec2 a_texCoord; \ + attribute float a_angle; \ + attribute vec2 a_center; \ + varying vec2 v_texCoord; \ + \ + void main() \ + { \ + float angle = radians(a_angle); \ + float c = cos(angle); \ + float s = sin(angle); \ + mat2 rotationMatrix = mat2(c, -s, s, c); \ + vec2 position = rotationMatrix * (a_position - a_center) + a_center; \ + v_texCoord = a_texCoord; \ + gl_Position = u_projection * vec4(position, 0.0, 1.0);\ + gl_PointSize = 1.0; \ + } \ +"; + +static const Uint8 GLES2_FragmentSrc_SolidSrc_[] = " \ + precision mediump float; \ + uniform vec4 u_color; \ + \ + void main() \ + { \ + gl_FragColor = u_color; \ + } \ +"; + +static const Uint8 GLES2_FragmentSrc_TextureABGRSrc_[] = " \ + precision mediump float; \ + uniform sampler2D u_texture; \ + uniform vec4 u_modulation; \ + varying vec2 v_texCoord; \ + \ + void main() \ + { \ + gl_FragColor = texture2D(u_texture, v_texCoord); \ + gl_FragColor *= u_modulation; \ + } \ +"; + +/* ARGB to ABGR conversion */ +static const Uint8 GLES2_FragmentSrc_TextureARGBSrc_[] = " \ + precision mediump float; \ + uniform sampler2D u_texture; \ + uniform vec4 u_modulation; \ + varying vec2 v_texCoord; \ + \ + void main() \ + { \ + vec4 abgr = texture2D(u_texture, v_texCoord); \ + gl_FragColor = abgr; \ + gl_FragColor.r = abgr.b; \ + gl_FragColor.b = abgr.r; \ + gl_FragColor *= u_modulation; \ + } \ +"; + +/* RGB to ABGR conversion */ +static const Uint8 GLES2_FragmentSrc_TextureRGBSrc_[] = " \ + precision mediump float; \ + uniform sampler2D u_texture; \ + uniform vec4 u_modulation; \ + varying vec2 v_texCoord; \ + \ + void main() \ + { \ + vec4 abgr = texture2D(u_texture, v_texCoord); \ + gl_FragColor = abgr; \ + gl_FragColor.r = abgr.b; \ + gl_FragColor.b = abgr.r; \ + gl_FragColor.a = 1.0; \ + gl_FragColor *= u_modulation; \ + } \ +"; + +/* BGR to ABGR conversion */ +static const Uint8 GLES2_FragmentSrc_TextureBGRSrc_[] = " \ + precision mediump float; \ + uniform sampler2D u_texture; \ + uniform vec4 u_modulation; \ + varying vec2 v_texCoord; \ + \ + void main() \ + { \ + vec4 abgr = texture2D(u_texture, v_texCoord); \ + gl_FragColor = abgr; \ + gl_FragColor.a = 1.0; \ + gl_FragColor *= u_modulation; \ + } \ +"; + +static const GLES2_ShaderInstance GLES2_VertexSrc_Default = { + GL_VERTEX_SHADER, + GLES2_SOURCE_SHADER, + sizeof(GLES2_VertexSrc_Default_), + GLES2_VertexSrc_Default_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentSrc_SolidSrc = { + GL_FRAGMENT_SHADER, + GLES2_SOURCE_SHADER, + sizeof(GLES2_FragmentSrc_SolidSrc_), + GLES2_FragmentSrc_SolidSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureABGRSrc = { + GL_FRAGMENT_SHADER, + GLES2_SOURCE_SHADER, + sizeof(GLES2_FragmentSrc_TextureABGRSrc_), + GLES2_FragmentSrc_TextureABGRSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureARGBSrc = { + GL_FRAGMENT_SHADER, + GLES2_SOURCE_SHADER, + sizeof(GLES2_FragmentSrc_TextureARGBSrc_), + GLES2_FragmentSrc_TextureARGBSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureRGBSrc = { + GL_FRAGMENT_SHADER, + GLES2_SOURCE_SHADER, + sizeof(GLES2_FragmentSrc_TextureRGBSrc_), + GLES2_FragmentSrc_TextureRGBSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentSrc_TextureBGRSrc = { + GL_FRAGMENT_SHADER, + GLES2_SOURCE_SHADER, + sizeof(GLES2_FragmentSrc_TextureBGRSrc_), + GLES2_FragmentSrc_TextureBGRSrc_ +}; + +/************************************************************************************************* + * Vertex/fragment shader binaries (NVIDIA Tegra 1/2) * + *************************************************************************************************/ + +#if GLES2_INCLUDE_NVIDIA_SHADERS + +#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B + +static const Uint8 GLES2_VertexTegra_Default_[] = { + 243, 193, 1, 142, 31, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, + 0, 0, 46, 0, 0, 0, 48, 0, 0, 0, 2, 0, 0, 0, 85, 0, 0, 0, 2, 0, 0, 0, 24, 0, 0, 0, 3, 0, 0, 0, + 91, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 0, 5, 0, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 95, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, + 13, 0, 0, 0, 102, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 16, 0, 0, 0, 104, 0, 0, 0, 1, 0, 0, 0, 32, 0, 0, 0, 17, 0, 0, 0, 112, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 112, 0, 0, 0, 80, 0, 0, 0, 80, 0, 0, 0, 19, 0, 0, 0, 132, 0, + 0, 0, 104, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, + 95, 112, 111, 115, 105, 116, 105, 111, 110, 0, 97, 95, 116, 101, 120, 67, 111, 111, 114, 100, + 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 112, 114, 111, 106, 101, 99, + 116, 105, 111, 110, 0, 0, 0, 0, 0, 0, 0, 82, 139, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 80, 139, 0, + 0, 1, 0, 0, 0, 22, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 33, 0, 0, 0, 92, 139, 0, 0, + 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 240, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 64, 0, 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 193, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 66, 24, 0, 6, 34, 108, 28, + 0, 0, 42, 16, 128, 0, 195, 192, 6, 129, 252, 255, 65, 96, 108, 28, 0, 0, 0, 0, 0, 1, 195, 192, + 6, 1, 252, 255, 33, 96, 108, 156, 31, 64, 8, 1, 64, 0, 131, 192, 6, 1, 156, 159, 65, 96, 108, + 28, 0, 0, 85, 32, 0, 1, 195, 192, 6, 1, 252, 255, 33, 96, 108, 156, 31, 64, 0, 64, 64, 0, 131, + 192, 134, 1, 152, 31, 65, 96, 108, 156, 31, 64, 127, 48, 0, 1, 195, 192, 6, 129, 129, 255, 33, + 96 +}; + +static const Uint8 GLES2_FragmentTegra_None_SolidSrc_[] = { + 155, 191, 159, 1, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, + 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0, + 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0, + 0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 240, 0, 0, + 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, + 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 0, 0, 0, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0, 0, 0, + 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 0, 40, 0, 0, 0, 242, 65, 63, + 192, 200, 0, 0, 0, 242, 65, 63, 128, 168, 0, 0, 0, 242, 65, 63, 64, 72, 0, 0, 0, 242, 65, 63, + 1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0 +}; + +static const Uint8 GLES2_FragmentTegra_Alpha_SolidSrc_[] = { + 169, 153, 195, 28, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, + 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0, + 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0, + 0, 220, 0, 0, 0, 220, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 118, 118, 17, 241, 0, 0, 0, 240, 0, + 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 21, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, + 1, 0, 0, 0, 3, 0, 0, 0, 3, 0, 65, 37, 8, 0, 129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 21, 0, + 0, 0, 0, 3, 0, 1, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 39, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0, 9, 0, 0, 0, 24, 0, 4, 40, 232, 231, 15, + 0, 0, 242, 65, 62, 194, 72, 1, 0, 0, 250, 65, 63, 194, 40, 1, 0, 0, 250, 65, 63, 192, 168, 1, + 0, 0, 242, 1, 64, 192, 168, 1, 0, 0, 242, 1, 68, 168, 32, 0, 0, 0, 50, 64, 0, 192, 168, 15, + 0, 0, 242, 1, 66, 168, 64, 0, 16, 0, 242, 65, 1, 232, 231, 15, 0, 0, 242, 65, 62, 168, 160, + 0, 0, 0, 50, 64, 2, 104, 192, 0, 0, 36, 48, 66, 4, 232, 231, 15, 0, 0, 242, 65, 62, 3, 0, 6, + 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 41, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 2, 0 +}; + +static const Uint8 GLES2_FragmentTegra_Additive_SolidSrc_[] = { + 59, 71, 42, 17, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, 0, + 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0, + 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0, + 0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 22, 22, 17, 241, 0, 0, 0, 240, 0, + 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, + 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0, + 0, 0, 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 192, 200, 0, 0, 0, 26, + 0, 70, 192, 40, 0, 0, 0, 2, 0, 64, 192, 72, 0, 0, 0, 10, 0, 66, 192, 168, 0, 0, 0, 18, 0, 68, + 1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0 +}; + +static const Uint8 GLES2_FragmentTegra_Modulated_SolidSrc_[] = { + 37, 191, 49, 17, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, 0, + 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 75, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, + 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 75, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 13, 0, + 0, 0, 82, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 84, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 92, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 15, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 113, 0, 0, + 0, 108, 0, 0, 0, 108, 0, 0, 0, 20, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, + 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 117, 95, 99, 111, 108, 111, 114, 0, 0, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 32, 32, 17, 241, 0, 0, 0, 240, 0, + 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, + 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 0, + 0, 0, 0, 1, 0, 1, 39, 0, 0, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 104, 192, 0, 0, 0, 242, + 1, 70, 8, 32, 0, 0, 0, 242, 1, 64, 40, 64, 0, 0, 0, 242, 1, 66, 72, 160, 0, 0, 0, 242, 1, 68, + 1, 0, 6, 40, 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0 +}; + +static const Uint8 GLES2_FragmentTegra_None_TextureSrc_[] = { + 220, 217, 41, 211, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, + 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, + 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0, + 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0, + 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135, + 0, 0, 0, 120, 0, 0, 0, 120, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108, + 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, + 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 65, 37, 0, 0, 0, 0, 1, 0, + 0, 21, 0, 0, 0, 0, 1, 0, 1, 38, 1, 0, 0, 0, 2, 0, 4, 38, 186, 81, 78, 16, 2, 1, 0, 0, 1, 0, + 1, 39, 0, 4, 0, 0, 1, 0, 1, 40, 1, 0, 0, 0, 8, 0, 4, 40, 104, 192, 0, 0, 0, 242, 1, 70, 8, 32, + 0, 0, 0, 242, 1, 64, 40, 64, 0, 0, 0, 242, 1, 66, 72, 160, 0, 0, 0, 242, 1, 68, 1, 0, 6, 40, + 0, 0, 0, 0, 1, 0, 1, 41, 5, 0, 2, 0 +}; + +static const Uint8 GLES2_FragmentTegra_Alpha_TextureSrc_[] = { + 71, 202, 114, 229, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, + 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, + 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0, + 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0, + 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135, + 0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108, + 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 118, 118, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, + 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, + 1, 0, 0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0, + 8, 0, 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186, + 81, 78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0, + 0, 0, 16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 8, 192, 1, 0, 0, 242, 1, 64, 104, 32, 1, 0, + 0, 242, 1, 70, 72, 64, 1, 0, 0, 242, 1, 68, 154, 192, 0, 0, 37, 34, 64, 3, 8, 32, 0, 0, 5, 58, + 208, 4, 40, 64, 0, 0, 5, 50, 208, 4, 72, 160, 0, 0, 37, 42, 208, 4, 2, 0, 6, 40, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0 +}; + +static const Uint8 GLES2_FragmentTegra_Additive_TextureSrc_[] = { + 161, 234, 193, 234, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, + 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, + 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0, + 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0, + 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135, + 0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108, + 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 22, 22, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, + 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, + 0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0, 8, 0, + 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186, 81, + 78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0, + 16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 104, 32, 1, 0, 0, 242, 1, 70, 8, 192, 1, 0, 0, 242, + 1, 64, 72, 64, 1, 0, 0, 242, 1, 68, 136, 192, 0, 0, 0, 26, 64, 4, 136, 32, 0, 0, 0, 2, 64, 7, + 136, 64, 0, 0, 0, 10, 64, 6, 136, 160, 0, 0, 0, 18, 64, 5, 2, 0, 6, 40, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0 +}; + +static const Uint8 GLES2_FragmentTegra_Modulated_TextureSrc_[] = { + 75, 132, 201, 227, 47, 109, 131, 38, 6, 0, 1, 0, 5, 0, 0, 0, 17, 0, 0, 0, 1, 0, 0, 0, 73, 0, + 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 2, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, + 82, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 6, 0, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, + 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 87, 0, 0, 0, 2, 0, 0, 0, 56, 0, 0, 0, + 13, 0, 0, 0, 101, 0, 0, 0, 4, 0, 0, 0, 16, 0, 0, 0, 14, 0, 0, 0, 105, 0, 0, 0, 1, 0, 0, 0, 4, + 0, 0, 0, 22, 0, 0, 0, 106, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 23, 0, 0, 0, 114, 0, 0, 0, 1, 0, + 0, 0, 4, 0, 0, 0, 15, 0, 0, 0, 115, 0, 0, 0, 1, 0, 0, 0, 80, 0, 0, 0, 17, 0, 0, 0, 135, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 135, + 0, 0, 0, 176, 0, 0, 0, 176, 0, 0, 0, 20, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, + 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 97, 110, 70, 73, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 118, 95, 116, 101, 120, 67, 111, 111, 114, 100, 0, 117, 95, 109, 111, 100, 117, 108, + 97, 116, 105, 111, 110, 0, 117, 95, 116, 101, 120, 116, 117, 114, 101, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 82, 139, 0, 0, 1, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 94, 139, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 5, 48, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 32, 32, 17, 241, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 240, + 0, 0, 0, 240, 0, 0, 0, 240, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1, 0, + 0, 0, 2, 0, 0, 0, 21, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 65, 82, 50, 48, 45, 66, 73, 78, 1, 0, 0, 0, 2, 0, 0, 0, 2, 0, 65, 37, 0, 0, 0, 0, 8, 0, + 129, 0, 1, 0, 0, 21, 0, 0, 0, 0, 2, 0, 1, 38, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 38, 186, 81, + 78, 16, 2, 1, 0, 0, 2, 0, 1, 39, 0, 4, 0, 0, 0, 0, 0, 0, 2, 0, 1, 40, 1, 0, 0, 0, 5, 0, 0, 0, + 16, 0, 4, 40, 40, 160, 1, 0, 0, 242, 1, 66, 8, 192, 1, 0, 0, 242, 1, 64, 104, 32, 1, 0, 0, 242, + 1, 70, 72, 64, 1, 0, 0, 242, 1, 68, 104, 192, 0, 0, 0, 242, 65, 4, 232, 32, 0, 0, 0, 242, 65, + 0, 40, 64, 0, 0, 0, 242, 65, 6, 72, 160, 0, 0, 0, 242, 65, 5, 2, 0, 6, 40, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 1, 41, 0, 0, 0, 0, 5, 0, 2, 0 +}; + +static const GLES2_ShaderInstance GLES2_VertexTegra_Default = { + GL_VERTEX_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_VertexTegra_Default_), + GLES2_VertexTegra_Default_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_None_SolidSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_None_SolidSrc_), + GLES2_FragmentTegra_None_SolidSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_Alpha_SolidSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_Alpha_SolidSrc_), + GLES2_FragmentTegra_Alpha_SolidSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_Additive_SolidSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_Additive_SolidSrc_), + GLES2_FragmentTegra_Additive_SolidSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_Modulated_SolidSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_Modulated_SolidSrc_), + GLES2_FragmentTegra_Modulated_SolidSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_None_TextureSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_None_TextureSrc_), + GLES2_FragmentTegra_None_TextureSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_Alpha_TextureSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_Alpha_TextureSrc_), + GLES2_FragmentTegra_Alpha_TextureSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_Additive_TextureSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_Additive_TextureSrc_), + GLES2_FragmentTegra_Additive_TextureSrc_ +}; + +static const GLES2_ShaderInstance GLES2_FragmentTegra_Modulated_TextureSrc = { + GL_FRAGMENT_SHADER, + GL_NVIDIA_PLATFORM_BINARY_NV, + sizeof(GLES2_FragmentTegra_Modulated_TextureSrc_), + GLES2_FragmentTegra_Modulated_TextureSrc_ +}; + +#endif /* GLES2_INCLUDE_NVIDIA_SHADERS */ + +/************************************************************************************************* + * Vertex/fragment shader definitions * + *************************************************************************************************/ + +static GLES2_Shader GLES2_VertexShader_Default = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_VertexTegra_Default, +#endif + &GLES2_VertexSrc_Default + } +}; + +static GLES2_Shader GLES2_FragmentShader_None_SolidSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_None_SolidSrc, +#endif + &GLES2_FragmentSrc_SolidSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Alpha_SolidSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_Alpha_SolidSrc, +#endif + &GLES2_FragmentSrc_SolidSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Additive_SolidSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_Additive_SolidSrc, +#endif + &GLES2_FragmentSrc_SolidSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Modulated_SolidSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_Modulated_SolidSrc, +#endif + &GLES2_FragmentSrc_SolidSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_None_TextureABGRSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_None_TextureSrc, +#endif + &GLES2_FragmentSrc_TextureABGRSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Alpha_TextureABGRSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_Alpha_TextureSrc, +#endif + &GLES2_FragmentSrc_TextureABGRSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Additive_TextureABGRSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_Additive_TextureSrc, +#endif + &GLES2_FragmentSrc_TextureABGRSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Modulated_TextureABGRSrc = { +#if GLES2_INCLUDE_NVIDIA_SHADERS + 2, +#else + 1, +#endif + { +#if GLES2_INCLUDE_NVIDIA_SHADERS + &GLES2_FragmentTegra_Modulated_TextureSrc, +#endif + &GLES2_FragmentSrc_TextureABGRSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_None_TextureARGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureARGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Alpha_TextureARGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureARGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Additive_TextureARGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureARGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Modulated_TextureARGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureARGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_None_TextureRGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureRGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Alpha_TextureRGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureRGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Additive_TextureRGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureRGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Modulated_TextureRGBSrc = { + 1, + { + &GLES2_FragmentSrc_TextureRGBSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_None_TextureBGRSrc = { + 1, + { + &GLES2_FragmentSrc_TextureBGRSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Alpha_TextureBGRSrc = { + 1, + { + &GLES2_FragmentSrc_TextureBGRSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Additive_TextureBGRSrc = { + 1, + { + &GLES2_FragmentSrc_TextureBGRSrc + } +}; + +static GLES2_Shader GLES2_FragmentShader_Modulated_TextureBGRSrc = { + 1, + { + &GLES2_FragmentSrc_TextureBGRSrc + } +}; + +/************************************************************************************************* + * Shader selector * + *************************************************************************************************/ + +const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMode) +{ + switch (type) + { + case GLES2_SHADER_VERTEX_DEFAULT: + return &GLES2_VertexShader_Default; + case GLES2_SHADER_FRAGMENT_SOLID_SRC: + switch (blendMode) + { + case SDL_BLENDMODE_NONE: + return &GLES2_FragmentShader_None_SolidSrc; + case SDL_BLENDMODE_BLEND: + return &GLES2_FragmentShader_Alpha_SolidSrc; + case SDL_BLENDMODE_ADD: + return &GLES2_FragmentShader_Additive_SolidSrc; + case SDL_BLENDMODE_MOD: + return &GLES2_FragmentShader_Modulated_SolidSrc; + default: + return NULL; + } + case GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC: + switch (blendMode) + { + case SDL_BLENDMODE_NONE: + return &GLES2_FragmentShader_None_TextureABGRSrc; + case SDL_BLENDMODE_BLEND: + return &GLES2_FragmentShader_Alpha_TextureABGRSrc; + case SDL_BLENDMODE_ADD: + return &GLES2_FragmentShader_Additive_TextureABGRSrc; + case SDL_BLENDMODE_MOD: + return &GLES2_FragmentShader_Modulated_TextureABGRSrc; + default: + return NULL; + } + case GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC: + switch (blendMode) + { + case SDL_BLENDMODE_NONE: + return &GLES2_FragmentShader_None_TextureARGBSrc; + case SDL_BLENDMODE_BLEND: + return &GLES2_FragmentShader_Alpha_TextureARGBSrc; + case SDL_BLENDMODE_ADD: + return &GLES2_FragmentShader_Additive_TextureARGBSrc; + case SDL_BLENDMODE_MOD: + return &GLES2_FragmentShader_Modulated_TextureARGBSrc; + default: + return NULL; + } + + case GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC: + switch (blendMode) + { + case SDL_BLENDMODE_NONE: + return &GLES2_FragmentShader_None_TextureRGBSrc; + case SDL_BLENDMODE_BLEND: + return &GLES2_FragmentShader_Alpha_TextureRGBSrc; + case SDL_BLENDMODE_ADD: + return &GLES2_FragmentShader_Additive_TextureRGBSrc; + case SDL_BLENDMODE_MOD: + return &GLES2_FragmentShader_Modulated_TextureRGBSrc; + default: + return NULL; + } + + case GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC: + switch (blendMode) + { + case SDL_BLENDMODE_NONE: + return &GLES2_FragmentShader_None_TextureBGRSrc; + case SDL_BLENDMODE_BLEND: + return &GLES2_FragmentShader_Alpha_TextureBGRSrc; + case SDL_BLENDMODE_ADD: + return &GLES2_FragmentShader_Additive_TextureBGRSrc; + case SDL_BLENDMODE_MOD: + return &GLES2_FragmentShader_Modulated_TextureBGRSrc; + default: + return NULL; + } + + default: + return NULL; + } +} + +#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengles2/SDL_shaders_gles2.h b/src/render/opengles2/SDL_shaders_gles2.h new file mode 100644 index 0000000000..73f706649f --- /dev/null +++ b/src/render/opengles2/SDL_shaders_gles2.h @@ -0,0 +1,60 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_OGL_ES2 + +#ifndef SDL_shaderdata_h_ +#define SDL_shaderdata_h_ + +typedef struct GLES2_ShaderInstance +{ + GLenum type; + GLenum format; + int length; + const void *data; +} GLES2_ShaderInstance; + +typedef struct GLES2_Shader +{ + int instance_count; + const GLES2_ShaderInstance *instances[4]; +} GLES2_Shader; + +typedef enum +{ + GLES2_SHADER_VERTEX_DEFAULT, + GLES2_SHADER_FRAGMENT_SOLID_SRC, + GLES2_SHADER_FRAGMENT_TEXTURE_ABGR_SRC, + GLES2_SHADER_FRAGMENT_TEXTURE_ARGB_SRC, + GLES2_SHADER_FRAGMENT_TEXTURE_BGR_SRC, + GLES2_SHADER_FRAGMENT_TEXTURE_RGB_SRC +} GLES2_ShaderType; + +#define GLES2_SOURCE_SHADER (GLenum)-1 + +const GLES2_Shader *GLES2_GetShader(GLES2_ShaderType type, SDL_BlendMode blendMode); + +#endif /* SDL_shaderdata_h_ */ + +#endif /* SDL_VIDEO_RENDER_OGL_ES2 */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c new file mode 100644 index 0000000000..7ea536d145 --- /dev/null +++ b/src/render/psp/SDL_render_psp.c @@ -0,0 +1,1023 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_RENDER_PSP + +#include "SDL_hints.h" +#include "../SDL_sysrender.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + +/* PSP renderer implementation, based on the PGE */ + + +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); + + +static SDL_Renderer *PSP_CreateRenderer(SDL_Window * window, Uint32 flags); +static void PSP_WindowEvent(SDL_Renderer * renderer, + const SDL_WindowEvent *event); +static int PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, + int pitch); +static int PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch); +static void PSP_UnlockTexture(SDL_Renderer * renderer, + SDL_Texture * texture); +static int PSP_SetRenderTarget(SDL_Renderer * renderer, + SDL_Texture * texture); +static int PSP_UpdateViewport(SDL_Renderer * renderer); +static int PSP_RenderClear(SDL_Renderer * renderer); +static int PSP_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int PSP_RenderDrawLines(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int PSP_RenderFillRects(SDL_Renderer * renderer, + const SDL_FRect * rects, int count); +static int PSP_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_FRect * dstrect); +static int PSP_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch); +static int PSP_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip); +static void PSP_RenderPresent(SDL_Renderer * renderer); +static void PSP_DestroyTexture(SDL_Renderer * renderer, + SDL_Texture * texture); +static void PSP_DestroyRenderer(SDL_Renderer * renderer); + +/* +SDL_RenderDriver PSP_RenderDriver = { + PSP_CreateRenderer, + { + "PSP", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 1, + {SDL_PIXELFORMAT_ABGR8888}, + 0, + 0} +}; +*/ +SDL_RenderDriver PSP_RenderDriver = { + .CreateRenderer = PSP_CreateRenderer, + .info = { + .name = "PSP", + .flags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE, + .num_texture_formats = 4, + .texture_formats = { [0] = SDL_PIXELFORMAT_BGR565, + [1] = SDL_PIXELFORMAT_ABGR1555, + [2] = SDL_PIXELFORMAT_ABGR4444, + [3] = SDL_PIXELFORMAT_ABGR8888, + }, + .max_texture_width = 512, + .max_texture_height = 512, + } +}; + +#define PSP_SCREEN_WIDTH 480 +#define PSP_SCREEN_HEIGHT 272 + +#define PSP_FRAME_BUFFER_WIDTH 512 +#define PSP_FRAME_BUFFER_SIZE (PSP_FRAME_BUFFER_WIDTH*PSP_SCREEN_HEIGHT) + +static unsigned int __attribute__((aligned(16))) DisplayList[262144]; + + +#define COL5650(r,g,b,a) ((r>>3) | ((g>>2)<<5) | ((b>>3)<<11)) +#define COL5551(r,g,b,a) ((r>>3) | ((g>>3)<<5) | ((b>>3)<<10) | (a>0?0x7000:0)) +#define COL4444(r,g,b,a) ((r>>4) | ((g>>4)<<4) | ((b>>4)<<8) | ((a>>4)<<12)) +#define COL8888(r,g,b,a) ((r) | ((g)<<8) | ((b)<<16) | ((a)<<24)) + + +typedef struct +{ + void* frontbuffer ; + void* backbuffer ; + SDL_bool initialized ; + SDL_bool displayListAvail ; + unsigned int psm ; + unsigned int bpp ; + + SDL_bool vsync; + unsigned int currentColor; + int currentBlendMode; + +} PSP_RenderData; + + +typedef struct +{ + void *data; /**< Image data. */ + unsigned int size; /**< Size of data in bytes. */ + unsigned int width; /**< Image width. */ + unsigned int height; /**< Image height. */ + unsigned int textureWidth; /**< Texture width (power of two). */ + unsigned int textureHeight; /**< Texture height (power of two). */ + unsigned int bits; /**< Image bits per pixel. */ + unsigned int format; /**< Image format - one of ::pgePixelFormat. */ + unsigned int pitch; + SDL_bool swizzled; /**< Is image swizzled. */ + +} PSP_TextureData; + +typedef struct +{ + float x, y, z; +} VertV; + + +typedef struct +{ + float u, v; + float x, y, z; + +} VertTV; + + +/* Return next power of 2 */ +static int +TextureNextPow2(unsigned int w) +{ + if(w == 0) + return 0; + + unsigned int n = 2; + + while(w > n) + n <<= 1; + + return n; +} + + +static int +GetScaleQuality(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); + + if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { + return GU_NEAREST; /* GU_NEAREST good for tile-map */ + } else { + return GU_LINEAR; /* GU_LINEAR good for scaling */ + } +} + +static int +PixelFormatToPSPFMT(Uint32 format) +{ + switch (format) { + case SDL_PIXELFORMAT_BGR565: + return GU_PSM_5650; + case SDL_PIXELFORMAT_ABGR1555: + return GU_PSM_5551; + case SDL_PIXELFORMAT_ABGR4444: + return GU_PSM_4444; + case SDL_PIXELFORMAT_ABGR8888: + return GU_PSM_8888; + default: + return GU_PSM_8888; + } +} + +void +StartDrawing(SDL_Renderer * renderer) +{ + PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + if(data->displayListAvail) + return; + + sceGuStart(GU_DIRECT, DisplayList); + data->displayListAvail = SDL_TRUE; +} + + +int +TextureSwizzle(PSP_TextureData *psp_texture) +{ + if(psp_texture->swizzled) + return 1; + + int bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3); + int height = psp_texture->size / bytewidth; + + int rowblocks = (bytewidth>>4); + int rowblocksadd = (rowblocks-1)<<7; + unsigned int blockaddress = 0; + unsigned int *src = (unsigned int*) psp_texture->data; + + unsigned char *data = NULL; + data = malloc(psp_texture->size); + + int j; + + for(j = 0; j < height; j++, blockaddress += 16) + { + unsigned int *block; + + block = (unsigned int*)&data[blockaddress]; + + int i; + + for(i = 0; i < rowblocks; i++) + { + *block++ = *src++; + *block++ = *src++; + *block++ = *src++; + *block++ = *src++; + block += 28; + } + + if((j & 0x7) == 0x7) + blockaddress += rowblocksadd; + } + + free(psp_texture->data); + psp_texture->data = data; + psp_texture->swizzled = SDL_TRUE; + + return 1; +} +int TextureUnswizzle(PSP_TextureData *psp_texture) +{ + if(!psp_texture->swizzled) + return 1; + + int blockx, blocky; + + int bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3); + int height = psp_texture->size / bytewidth; + + int widthblocks = bytewidth/16; + int heightblocks = height/8; + + int dstpitch = (bytewidth - 16)/4; + int dstrow = bytewidth * 8; + + unsigned int *src = (unsigned int*) psp_texture->data; + + unsigned char *data = NULL; + + data = malloc(psp_texture->size); + + if(!data) + return 0; + + sceKernelDcacheWritebackAll(); + + int j; + + unsigned char *ydst = (unsigned char *)data; + + for(blocky = 0; blocky < heightblocks; ++blocky) + { + unsigned char *xdst = ydst; + + for(blockx = 0; blockx < widthblocks; ++blockx) + { + unsigned int *block; + + block = (unsigned int*)xdst; + + for(j = 0; j < 8; ++j) + { + *(block++) = *(src++); + *(block++) = *(src++); + *(block++) = *(src++); + *(block++) = *(src++); + block += dstpitch; + } + + xdst += 16; + } + + ydst += dstrow; + } + + free(psp_texture->data); + + psp_texture->data = data; + + psp_texture->swizzled = SDL_FALSE; + + return 1; +} + +SDL_Renderer * +PSP_CreateRenderer(SDL_Window * window, Uint32 flags) +{ + + SDL_Renderer *renderer; + PSP_RenderData *data; + int pixelformat; + renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); + if (!renderer) { + SDL_OutOfMemory(); + return NULL; + } + + data = (PSP_RenderData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + PSP_DestroyRenderer(renderer); + SDL_OutOfMemory(); + return NULL; + } + + + renderer->WindowEvent = PSP_WindowEvent; + renderer->CreateTexture = PSP_CreateTexture; + renderer->UpdateTexture = PSP_UpdateTexture; + renderer->LockTexture = PSP_LockTexture; + renderer->UnlockTexture = PSP_UnlockTexture; + renderer->SetRenderTarget = PSP_SetRenderTarget; + renderer->UpdateViewport = PSP_UpdateViewport; + renderer->RenderClear = PSP_RenderClear; + renderer->RenderDrawPoints = PSP_RenderDrawPoints; + renderer->RenderDrawLines = PSP_RenderDrawLines; + renderer->RenderFillRects = PSP_RenderFillRects; + renderer->RenderCopy = PSP_RenderCopy; + renderer->RenderReadPixels = PSP_RenderReadPixels; + renderer->RenderCopyEx = PSP_RenderCopyEx; + renderer->RenderPresent = PSP_RenderPresent; + renderer->DestroyTexture = PSP_DestroyTexture; + renderer->DestroyRenderer = PSP_DestroyRenderer; + renderer->info = PSP_RenderDriver.info; + renderer->info.flags = SDL_RENDERER_ACCELERATED; + renderer->driverdata = data; + renderer->window = window; + + if (data->initialized != SDL_FALSE) + return 0; + data->initialized = SDL_TRUE; + + if (flags & SDL_RENDERER_PRESENTVSYNC) { + data->vsync = SDL_TRUE; + } else { + data->vsync = SDL_FALSE; + } + + pixelformat=PixelFormatToPSPFMT(SDL_GetWindowPixelFormat(window)); + switch(pixelformat) + { + case GU_PSM_4444: + case GU_PSM_5650: + case GU_PSM_5551: + data->frontbuffer = (unsigned int *)(PSP_FRAME_BUFFER_SIZE<<1); + data->backbuffer = (unsigned int *)(0); + data->bpp = 2; + data->psm = pixelformat; + break; + default: + data->frontbuffer = (unsigned int *)(PSP_FRAME_BUFFER_SIZE<<2); + data->backbuffer = (unsigned int *)(0); + data->bpp = 4; + data->psm = GU_PSM_8888; + break; + } + + sceGuInit(); + /* setup GU */ + sceGuStart(GU_DIRECT, DisplayList); + sceGuDrawBuffer(data->psm, data->frontbuffer, PSP_FRAME_BUFFER_WIDTH); + sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, data->backbuffer, PSP_FRAME_BUFFER_WIDTH); + + + sceGuOffset(2048 - (PSP_SCREEN_WIDTH>>1), 2048 - (PSP_SCREEN_HEIGHT>>1)); + sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); + + data->frontbuffer = vabsptr(data->frontbuffer); + data->backbuffer = vabsptr(data->backbuffer); + + /* Scissoring */ + sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); + sceGuEnable(GU_SCISSOR_TEST); + + /* Backface culling */ + sceGuFrontFace(GU_CCW); + sceGuEnable(GU_CULL_FACE); + + /* Texturing */ + sceGuEnable(GU_TEXTURE_2D); + sceGuShadeModel(GU_SMOOTH); + sceGuTexWrap(GU_REPEAT, GU_REPEAT); + + /* Blending */ + sceGuEnable(GU_BLEND); + sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0); + + sceGuTexFilter(GU_LINEAR,GU_LINEAR); + + sceGuFinish(); + sceGuSync(0,0); + sceDisplayWaitVblankStartCB(); + sceGuDisplay(GU_TRUE); + + return renderer; +} + +static void +PSP_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +{ + +} + + +static int +PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ +// PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; + PSP_TextureData* psp_texture = (PSP_TextureData*) SDL_calloc(1, sizeof(*psp_texture));; + + if(!psp_texture) + return -1; + + psp_texture->swizzled = SDL_FALSE; + psp_texture->width = texture->w; + psp_texture->height = texture->h; + psp_texture->textureHeight = TextureNextPow2(texture->h); + psp_texture->textureWidth = TextureNextPow2(texture->w); + psp_texture->format = PixelFormatToPSPFMT(texture->format); + + switch(psp_texture->format) + { + case GU_PSM_5650: + case GU_PSM_5551: + case GU_PSM_4444: + psp_texture->bits = 16; + break; + + case GU_PSM_8888: + psp_texture->bits = 32; + break; + + default: + return -1; + } + + psp_texture->pitch = psp_texture->textureWidth * SDL_BYTESPERPIXEL(texture->format); + psp_texture->size = psp_texture->textureHeight*psp_texture->pitch; + psp_texture->data = SDL_calloc(1, psp_texture->size); + + if(!psp_texture->data) + { + SDL_free(psp_texture); + return SDL_OutOfMemory(); + } + texture->driverdata = psp_texture; + + return 0; +} + + +void +TextureActivate(SDL_Texture * texture) +{ + PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + int scaleMode = GetScaleQuality(); + + /* Swizzling is useless with small textures. */ + if (texture->w >= 16 || texture->h >= 16) + { + TextureSwizzle(psp_texture); + } + + sceGuEnable(GU_TEXTURE_2D); + sceGuTexWrap(GU_REPEAT, GU_REPEAT); + sceGuTexMode(psp_texture->format, 0, 0, psp_texture->swizzled); + sceGuTexFilter(scaleMode, scaleMode); /* GU_NEAREST good for tile-map */ + /* GU_LINEAR good for scaling */ + sceGuTexImage(0, psp_texture->textureWidth, psp_texture->textureHeight, psp_texture->textureWidth, psp_texture->data); + sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); +} + + +static int +PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, int pitch) +{ +// PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + const Uint8 *src; + Uint8 *dst; + int row, length,dpitch; + src = pixels; + + PSP_LockTexture(renderer, texture,rect,(void **)&dst, &dpitch); + length = rect->w * SDL_BYTESPERPIXEL(texture->format); + if (length == pitch && length == dpitch) { + SDL_memcpy(dst, src, length*rect->h); + } else { + for (row = 0; row < rect->h; ++row) { + SDL_memcpy(dst, src, length); + src += pitch; + dst += dpitch; + } + } + + sceKernelDcacheWritebackAll(); + return 0; +} + +static int +PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch) +{ + PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + + *pixels = + (void *) ((Uint8 *) psp_texture->data + rect->y * psp_texture->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pitch = psp_texture->pitch; + return 0; +} + +static void +PSP_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + SDL_Rect rect; + + /* We do whole texture updates, at least for now */ + rect.x = 0; + rect.y = 0; + rect.w = texture->w; + rect.h = texture->h; + PSP_UpdateTexture(renderer, texture, &rect, psp_texture->data, psp_texture->pitch); +} + +static int +PSP_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +{ + + return 0; +} + +static int +PSP_UpdateViewport(SDL_Renderer * renderer) +{ + + return 0; +} + + +static void +PSP_SetBlendMode(SDL_Renderer * renderer, int blendMode) +{ + PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + if (blendMode != data-> currentBlendMode) { + switch (blendMode) { + case SDL_BLENDMODE_NONE: + sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); + sceGuDisable(GU_BLEND); + break; + case SDL_BLENDMODE_BLEND: + sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); + sceGuEnable(GU_BLEND); + sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0 ); + break; + case SDL_BLENDMODE_ADD: + sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); + sceGuEnable(GU_BLEND); + sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_FIX, 0, 0x00FFFFFF ); + break; + case SDL_BLENDMODE_MOD: + sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); + sceGuEnable(GU_BLEND); + sceGuBlendFunc( GU_ADD, GU_FIX, GU_SRC_COLOR, 0, 0); + break; + } + data->currentBlendMode = blendMode; + } +} + + + +static int +PSP_RenderClear(SDL_Renderer * renderer) +{ + /* start list */ + StartDrawing(renderer); + int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r; + sceGuClearColor(color); + sceGuClearDepth(0); + sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT|GU_FAST_CLEAR_BIT); + + return 0; +} + +static int +PSP_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r; + int i; + StartDrawing(renderer); + VertV* vertices = (VertV*)sceGuGetMemory(count*sizeof(VertV)); + + for (i = 0; i < count; ++i) { + vertices[i].x = points[i].x; + vertices[i].y = points[i].y; + vertices[i].z = 0.0f; + } + sceGuDisable(GU_TEXTURE_2D); + sceGuColor(color); + sceGuShadeModel(GU_FLAT); + sceGuDrawArray(GU_POINTS, GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, vertices); + sceGuShadeModel(GU_SMOOTH); + sceGuEnable(GU_TEXTURE_2D); + + return 0; +} + +static int +PSP_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r; + int i; + StartDrawing(renderer); + VertV* vertices = (VertV*)sceGuGetMemory(count*sizeof(VertV)); + + for (i = 0; i < count; ++i) { + vertices[i].x = points[i].x; + vertices[i].y = points[i].y; + vertices[i].z = 0.0f; + } + + sceGuDisable(GU_TEXTURE_2D); + sceGuColor(color); + sceGuShadeModel(GU_FLAT); + sceGuDrawArray(GU_LINE_STRIP, GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, vertices); + sceGuShadeModel(GU_SMOOTH); + sceGuEnable(GU_TEXTURE_2D); + + return 0; +} + +static int +PSP_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, + int count) +{ + int color = renderer->a << 24 | renderer->b << 16 | renderer->g << 8 | renderer->r; + int i; + StartDrawing(renderer); + + for (i = 0; i < count; ++i) { + const SDL_FRect *rect = &rects[i]; + VertV* vertices = (VertV*)sceGuGetMemory((sizeof(VertV)<<1)); + vertices[0].x = rect->x; + vertices[0].y = rect->y; + vertices[0].z = 0.0f; + + vertices[1].x = rect->x + rect->w; + vertices[1].y = rect->y + rect->h; + vertices[1].z = 0.0f; + + sceGuDisable(GU_TEXTURE_2D); + sceGuColor(color); + sceGuShadeModel(GU_FLAT); + sceGuDrawArray(GU_SPRITES, GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices); + sceGuShadeModel(GU_SMOOTH); + sceGuEnable(GU_TEXTURE_2D); + } + + return 0; +} + + +#define PI 3.14159265358979f + +#define radToDeg(x) ((x)*180.f/PI) +#define degToRad(x) ((x)*PI/180.f) + +float MathAbs(float x) +{ + float result; + + __asm__ volatile ( + "mtv %1, S000\n" + "vabs.s S000, S000\n" + "mfv %0, S000\n" + : "=r"(result) : "r"(x)); + + return result; +} + +void MathSincos(float r, float *s, float *c) +{ + __asm__ volatile ( + "mtv %2, S002\n" + "vcst.s S003, VFPU_2_PI\n" + "vmul.s S002, S002, S003\n" + "vrot.p C000, S002, [s, c]\n" + "mfv %0, S000\n" + "mfv %1, S001\n" + : "=r"(*s), "=r"(*c): "r"(r)); +} + +void Swap(float *a, float *b) +{ + float n=*a; + *a = *b; + *b = n; +} + +static int +PSP_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect) +{ + float x, y, width, height; + float u0, v0, u1, v1; + unsigned char alpha; + + x = dstrect->x; + y = dstrect->y; + width = dstrect->w; + height = dstrect->h; + + u0 = srcrect->x; + v0 = srcrect->y; + u1 = srcrect->x + srcrect->w; + v1 = srcrect->y + srcrect->h; + + alpha = texture->a; + + StartDrawing(renderer); + TextureActivate(texture); + PSP_SetBlendMode(renderer, renderer->blendMode); + + if(alpha != 255) + { + sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); + sceGuColor(GU_RGBA(255, 255, 255, alpha)); + }else{ + sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); + sceGuColor(0xFFFFFFFF); + } + + if((MathAbs(u1) - MathAbs(u0)) < 64.0f) + { + VertTV* vertices = (VertTV*)sceGuGetMemory((sizeof(VertTV))<<1); + + vertices[0].u = u0; + vertices[0].v = v0; + vertices[0].x = x; + vertices[0].y = y; + vertices[0].z = 0; + + vertices[1].u = u1; + vertices[1].v = v1; + vertices[1].x = x + width; + vertices[1].y = y + height; + vertices[1].z = 0; + + sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices); + } + else + { + float start, end; + float curU = u0; + float curX = x; + float endX = x + width; + float slice = 64.0f; + float ustep = (u1 - u0)/width * slice; + + if(ustep < 0.0f) + ustep = -ustep; + + for(start = 0, end = width; start < end; start += slice) + { + VertTV* vertices = (VertTV*)sceGuGetMemory((sizeof(VertTV))<<1); + + float polyWidth = ((curX + slice) > endX) ? (endX - curX) : slice; + float sourceWidth = ((curU + ustep) > u1) ? (u1 - curU) : ustep; + + vertices[0].u = curU; + vertices[0].v = v0; + vertices[0].x = curX; + vertices[0].y = y; + vertices[0].z = 0; + + curU += sourceWidth; + curX += polyWidth; + + vertices[1].u = curU; + vertices[1].v = v1; + vertices[1].x = curX; + vertices[1].y = (y + height); + vertices[1].z = 0; + + sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2, 0, vertices); + } + } + + if(alpha != 255) + sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); + return 0; +} + +static int +PSP_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 pixel_format, void * pixels, int pitch) + +{ + return 0; +} + + +static int +PSP_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) +{ + float x, y, width, height; + float u0, v0, u1, v1; + unsigned char alpha; + float centerx, centery; + + x = dstrect->x; + y = dstrect->y; + width = dstrect->w; + height = dstrect->h; + + u0 = srcrect->x; + v0 = srcrect->y; + u1 = srcrect->x + srcrect->w; + v1 = srcrect->y + srcrect->h; + + centerx = center->x; + centery = center->y; + + alpha = texture->a; + + StartDrawing(renderer); + TextureActivate(texture); + PSP_SetBlendMode(renderer, renderer->blendMode); + + if(alpha != 255) + { + sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); + sceGuColor(GU_RGBA(255, 255, 255, alpha)); + }else{ + sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); + sceGuColor(0xFFFFFFFF); + } + +// x += width * 0.5f; +// y += height * 0.5f; + x += centerx; + y += centery; + + float c, s; + + MathSincos(degToRad(angle), &s, &c); + +// width *= 0.5f; +// height *= 0.5f; + width -= centerx; + height -= centery; + + + float cw = c*width; + float sw = s*width; + float ch = c*height; + float sh = s*height; + + VertTV* vertices = (VertTV*)sceGuGetMemory(sizeof(VertTV)<<2); + + vertices[0].u = u0; + vertices[0].v = v0; + vertices[0].x = x - cw + sh; + vertices[0].y = y - sw - ch; + vertices[0].z = 0; + + vertices[1].u = u0; + vertices[1].v = v1; + vertices[1].x = x - cw - sh; + vertices[1].y = y - sw + ch; + vertices[1].z = 0; + + vertices[2].u = u1; + vertices[2].v = v1; + vertices[2].x = x + cw - sh; + vertices[2].y = y + sw + ch; + vertices[2].z = 0; + + vertices[3].u = u1; + vertices[3].v = v0; + vertices[3].x = x + cw + sh; + vertices[3].y = y + sw - ch; + vertices[3].z = 0; + + if (flip & SDL_FLIP_HORIZONTAL) { + Swap(&vertices[0].v, &vertices[2].v); + Swap(&vertices[1].v, &vertices[3].v); + } + if (flip & SDL_FLIP_VERTICAL) { + Swap(&vertices[0].u, &vertices[2].u); + Swap(&vertices[1].u, &vertices[3].u); + } + + sceGuDrawArray(GU_TRIANGLE_FAN, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, vertices); + + if(alpha != 255) + sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA); + return 0; +} + +static void +PSP_RenderPresent(SDL_Renderer * renderer) +{ + PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + if(!data->displayListAvail) + return; + + data->displayListAvail = SDL_FALSE; + sceGuFinish(); + sceGuSync(0,0); + +// if(data->vsync) + sceDisplayWaitVblankStart(); + + data->backbuffer = data->frontbuffer; + data->frontbuffer = vabsptr(sceGuSwapBuffers()); + +} + +static void +PSP_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + + if (renderdata == 0) + return; + + if(psp_texture == 0) + return; + + if(psp_texture->data != 0) + { + SDL_free(psp_texture->data); + } + SDL_free(psp_texture); + texture->driverdata = NULL; +} + +static void +PSP_DestroyRenderer(SDL_Renderer * renderer) +{ + PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + if (data) { + if (!data->initialized) + return; + + StartDrawing(renderer); + + sceGuTerm(); +// vfree(data->backbuffer); +// vfree(data->frontbuffer); + + data->initialized = SDL_FALSE; + data->displayListAvail = SDL_FALSE; + SDL_free(data); + } + SDL_free(renderer); +} + +#endif /* SDL_VIDEO_RENDER_PSP */ + +/* vi: set ts=4 sw=4 expandtab: */ + diff --git a/src/render/software/SDL_blendfillrect.c b/src/render/software/SDL_blendfillrect.c new file mode 100644 index 0000000000..ea05ea64b5 --- /dev/null +++ b/src/render/software/SDL_blendfillrect.c @@ -0,0 +1,336 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if !SDL_RENDER_DISABLED + +#include "SDL_draw.h" +#include "SDL_blendfillrect.h" + + +static int +SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB555); + break; + case SDL_BLENDMODE_ADD: + FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB555); + break; + case SDL_BLENDMODE_MOD: + FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB555); + break; + default: + FILLRECT(Uint16, DRAW_SETPIXEL_RGB555); + break; + } + return 0; +} + +static int +SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB565); + break; + case SDL_BLENDMODE_ADD: + FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB565); + break; + case SDL_BLENDMODE_MOD: + FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB565); + break; + default: + FILLRECT(Uint16, DRAW_SETPIXEL_RGB565); + break; + } + return 0; +} + +static int +SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGB888); + break; + case SDL_BLENDMODE_ADD: + FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGB888); + break; + case SDL_BLENDMODE_MOD: + FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGB888); + break; + default: + FILLRECT(Uint32, DRAW_SETPIXEL_RGB888); + break; + } + return 0; +} + +static int +SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888); + break; + case SDL_BLENDMODE_ADD: + FILLRECT(Uint32, DRAW_SETPIXEL_ADD_ARGB8888); + break; + case SDL_BLENDMODE_MOD: + FILLRECT(Uint32, DRAW_SETPIXEL_MOD_ARGB8888); + break; + default: + FILLRECT(Uint32, DRAW_SETPIXEL_ARGB8888); + break; + } + return 0; +} + +static int +SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + SDL_PixelFormat *fmt = dst->format; + unsigned inva = 0xff - a; + + switch (fmt->BytesPerPixel) { + case 2: + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB); + break; + case SDL_BLENDMODE_ADD: + FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB); + break; + case SDL_BLENDMODE_MOD: + FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB); + break; + default: + FILLRECT(Uint16, DRAW_SETPIXEL_RGB); + break; + } + return 0; + case 4: + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGB); + break; + case SDL_BLENDMODE_ADD: + FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGB); + break; + case SDL_BLENDMODE_MOD: + FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGB); + break; + default: + FILLRECT(Uint32, DRAW_SETPIXEL_RGB); + break; + } + return 0; + default: + return SDL_Unsupported(); + } +} + +static int +SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + SDL_PixelFormat *fmt = dst->format; + unsigned inva = 0xff - a; + + switch (fmt->BytesPerPixel) { + case 4: + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGBA); + break; + case SDL_BLENDMODE_ADD: + FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGBA); + break; + case SDL_BLENDMODE_MOD: + FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGBA); + break; + default: + FILLRECT(Uint32, DRAW_SETPIXEL_RGBA); + break; + } + return 0; + default: + return SDL_Unsupported(); + } +} + +int +SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + SDL_Rect clipped; + + if (!dst) { + return SDL_SetError("Passed NULL destination surface"); + } + + /* This function doesn't work on surfaces < 8 bpp */ + if (dst->format->BitsPerPixel < 8) { + return SDL_SetError("SDL_BlendFillRect(): Unsupported surface format"); + } + + /* If 'rect' == NULL, then fill the whole surface */ + if (rect) { + /* Perform clipping */ + if (!SDL_IntersectRect(rect, &dst->clip_rect, &clipped)) { + return 0; + } + rect = &clipped; + } else { + rect = &dst->clip_rect; + } + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(r, a); + g = DRAW_MUL(g, a); + b = DRAW_MUL(b, a); + } + + switch (dst->format->BitsPerPixel) { + case 15: + switch (dst->format->Rmask) { + case 0x7C00: + return SDL_BlendFillRect_RGB555(dst, rect, blendMode, r, g, b, a); + } + break; + case 16: + switch (dst->format->Rmask) { + case 0xF800: + return SDL_BlendFillRect_RGB565(dst, rect, blendMode, r, g, b, a); + } + break; + case 32: + switch (dst->format->Rmask) { + case 0x00FF0000: + if (!dst->format->Amask) { + return SDL_BlendFillRect_RGB888(dst, rect, blendMode, r, g, b, a); + } else { + return SDL_BlendFillRect_ARGB8888(dst, rect, blendMode, r, g, b, a); + } + break; + } + break; + default: + break; + } + + if (!dst->format->Amask) { + return SDL_BlendFillRect_RGB(dst, rect, blendMode, r, g, b, a); + } else { + return SDL_BlendFillRect_RGBA(dst, rect, blendMode, r, g, b, a); + } +} + +int +SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + SDL_Rect rect; + int i; + int (*func)(SDL_Surface * dst, const SDL_Rect * rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; + int status = 0; + + if (!dst) { + return SDL_SetError("Passed NULL destination surface"); + } + + /* This function doesn't work on surfaces < 8 bpp */ + if (dst->format->BitsPerPixel < 8) { + return SDL_SetError("SDL_BlendFillRects(): Unsupported surface format"); + } + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(r, a); + g = DRAW_MUL(g, a); + b = DRAW_MUL(b, a); + } + + /* FIXME: Does this function pointer slow things down significantly? */ + switch (dst->format->BitsPerPixel) { + case 15: + switch (dst->format->Rmask) { + case 0x7C00: + func = SDL_BlendFillRect_RGB555; + } + break; + case 16: + switch (dst->format->Rmask) { + case 0xF800: + func = SDL_BlendFillRect_RGB565; + } + break; + case 32: + switch (dst->format->Rmask) { + case 0x00FF0000: + if (!dst->format->Amask) { + func = SDL_BlendFillRect_RGB888; + } else { + func = SDL_BlendFillRect_ARGB8888; + } + break; + } + break; + default: + break; + } + + if (!func) { + if (!dst->format->Amask) { + func = SDL_BlendFillRect_RGB; + } else { + func = SDL_BlendFillRect_RGBA; + } + } + + for (i = 0; i < count; ++i) { + /* Perform clipping */ + if (!SDL_IntersectRect(&rects[i], &dst->clip_rect, &rect)) { + continue; + } + status = func(dst, &rect, blendMode, r, g, b, a); + } + return status; +} + +#endif /* !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendfillrect.h b/src/render/software/SDL_blendfillrect.h new file mode 100644 index 0000000000..ed7981dafb --- /dev/null +++ b/src/render/software/SDL_blendfillrect.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + + +extern int SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendline.c b/src/render/software/SDL_blendline.c new file mode 100644 index 0000000000..2ab0231b5d --- /dev/null +++ b/src/render/software/SDL_blendline.c @@ -0,0 +1,777 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if !SDL_RENDER_DISABLED + +#include "SDL_draw.h" +#include "SDL_blendline.h" +#include "SDL_blendpoint.h" + + +static void +SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) +{ + const SDL_PixelFormat *fmt = dst->format; + unsigned r, g, b, a, inva; + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(_r, _a); + g = DRAW_MUL(_g, _a); + b = DRAW_MUL(_b, _a); + a = _a; + } else { + r = _r; + g = _g; + b = _b; + a = _a; + } + inva = (a ^ 0xff); + + if (y1 == y2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end); + break; + case SDL_BLENDMODE_ADD: + HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end); + break; + case SDL_BLENDMODE_MOD: + HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end); + break; + default: + HLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end); + break; + } + } else if (x1 == x2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end); + break; + case SDL_BLENDMODE_ADD: + VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end); + break; + case SDL_BLENDMODE_MOD: + VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end); + break; + default: + VLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end); + break; + } + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end); + break; + case SDL_BLENDMODE_ADD: + DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end); + break; + case SDL_BLENDMODE_MOD: + DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end); + break; + default: + DLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end); + break; + } + } else { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY2_BLEND_RGB, DRAW_SETPIXELXY2_BLEND_RGB, + draw_end); + break; + case SDL_BLENDMODE_ADD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY2_ADD_RGB, DRAW_SETPIXELXY2_ADD_RGB, + draw_end); + break; + case SDL_BLENDMODE_MOD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY2_MOD_RGB, DRAW_SETPIXELXY2_MOD_RGB, + draw_end); + break; + default: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY2_RGB, DRAW_SETPIXELXY2_BLEND_RGB, + draw_end); + break; + } + } +} + +static void +SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) +{ + unsigned r, g, b, a, inva; + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(_r, _a); + g = DRAW_MUL(_g, _a); + b = DRAW_MUL(_b, _a); + a = _a; + } else { + r = _r; + g = _g; + b = _b; + a = _a; + } + inva = (a ^ 0xff); + + if (y1 == y2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end); + break; + case SDL_BLENDMODE_ADD: + HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end); + break; + case SDL_BLENDMODE_MOD: + HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end); + break; + default: + HLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end); + break; + } + } else if (x1 == x2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end); + break; + case SDL_BLENDMODE_ADD: + VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end); + break; + case SDL_BLENDMODE_MOD: + VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end); + break; + default: + VLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end); + break; + } + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end); + break; + case SDL_BLENDMODE_ADD: + DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end); + break; + case SDL_BLENDMODE_MOD: + DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end); + break; + default: + DLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end); + break; + } + } else { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_RGB555, DRAW_SETPIXELXY_BLEND_RGB555, + draw_end); + break; + case SDL_BLENDMODE_ADD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_ADD_RGB555, DRAW_SETPIXELXY_ADD_RGB555, + draw_end); + break; + case SDL_BLENDMODE_MOD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_MOD_RGB555, DRAW_SETPIXELXY_MOD_RGB555, + draw_end); + break; + default: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_RGB555, DRAW_SETPIXELXY_BLEND_RGB555, + draw_end); + break; + } + } +} + +static void +SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) +{ + unsigned r, g, b, a, inva; + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(_r, _a); + g = DRAW_MUL(_g, _a); + b = DRAW_MUL(_b, _a); + a = _a; + } else { + r = _r; + g = _g; + b = _b; + a = _a; + } + inva = (a ^ 0xff); + + if (y1 == y2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end); + break; + case SDL_BLENDMODE_ADD: + HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end); + break; + case SDL_BLENDMODE_MOD: + HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end); + break; + default: + HLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end); + break; + } + } else if (x1 == x2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end); + break; + case SDL_BLENDMODE_ADD: + VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end); + break; + case SDL_BLENDMODE_MOD: + VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end); + break; + default: + VLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end); + break; + } + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end); + break; + case SDL_BLENDMODE_ADD: + DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end); + break; + case SDL_BLENDMODE_MOD: + DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end); + break; + default: + DLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end); + break; + } + } else { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_RGB565, DRAW_SETPIXELXY_BLEND_RGB565, + draw_end); + break; + case SDL_BLENDMODE_ADD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_ADD_RGB565, DRAW_SETPIXELXY_ADD_RGB565, + draw_end); + break; + case SDL_BLENDMODE_MOD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_MOD_RGB565, DRAW_SETPIXELXY_MOD_RGB565, + draw_end); + break; + default: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_RGB565, DRAW_SETPIXELXY_BLEND_RGB565, + draw_end); + break; + } + } +} + +static void +SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) +{ + const SDL_PixelFormat *fmt = dst->format; + unsigned r, g, b, a, inva; + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(_r, _a); + g = DRAW_MUL(_g, _a); + b = DRAW_MUL(_b, _a); + a = _a; + } else { + r = _r; + g = _g; + b = _b; + a = _a; + } + inva = (a ^ 0xff); + + if (y1 == y2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end); + break; + case SDL_BLENDMODE_ADD: + HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end); + break; + case SDL_BLENDMODE_MOD: + HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end); + break; + default: + HLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end); + break; + } + } else if (x1 == x2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end); + break; + case SDL_BLENDMODE_ADD: + VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end); + break; + case SDL_BLENDMODE_MOD: + VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end); + break; + default: + VLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end); + break; + } + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end); + break; + case SDL_BLENDMODE_ADD: + DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end); + break; + case SDL_BLENDMODE_MOD: + DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end); + break; + default: + DLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end); + break; + } + } else { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_BLEND_RGB, DRAW_SETPIXELXY4_BLEND_RGB, + draw_end); + break; + case SDL_BLENDMODE_ADD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_ADD_RGB, DRAW_SETPIXELXY4_ADD_RGB, + draw_end); + break; + case SDL_BLENDMODE_MOD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_MOD_RGB, DRAW_SETPIXELXY4_MOD_RGB, + draw_end); + break; + default: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_RGB, DRAW_SETPIXELXY4_BLEND_RGB, + draw_end); + break; + } + } +} + +static void +SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) +{ + const SDL_PixelFormat *fmt = dst->format; + unsigned r, g, b, a, inva; + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(_r, _a); + g = DRAW_MUL(_g, _a); + b = DRAW_MUL(_b, _a); + a = _a; + } else { + r = _r; + g = _g; + b = _b; + a = _a; + } + inva = (a ^ 0xff); + + if (y1 == y2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end); + break; + case SDL_BLENDMODE_ADD: + HLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end); + break; + case SDL_BLENDMODE_MOD: + HLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end); + break; + default: + HLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end); + break; + } + } else if (x1 == x2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end); + break; + case SDL_BLENDMODE_ADD: + VLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end); + break; + case SDL_BLENDMODE_MOD: + VLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end); + break; + default: + VLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end); + break; + } + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end); + break; + case SDL_BLENDMODE_ADD: + DLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end); + break; + case SDL_BLENDMODE_MOD: + DLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end); + break; + default: + DLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end); + break; + } + } else { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_BLEND_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA, + draw_end); + break; + case SDL_BLENDMODE_ADD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_ADD_RGBA, DRAW_SETPIXELXY4_ADD_RGBA, + draw_end); + break; + case SDL_BLENDMODE_MOD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_MOD_RGBA, DRAW_SETPIXELXY4_MOD_RGBA, + draw_end); + break; + default: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA, + draw_end); + break; + } + } +} + +static void +SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) +{ + unsigned r, g, b, a, inva; + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(_r, _a); + g = DRAW_MUL(_g, _a); + b = DRAW_MUL(_b, _a); + a = _a; + } else { + r = _r; + g = _g; + b = _b; + a = _a; + } + inva = (a ^ 0xff); + + if (y1 == y2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end); + break; + case SDL_BLENDMODE_ADD: + HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end); + break; + case SDL_BLENDMODE_MOD: + HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end); + break; + default: + HLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end); + break; + } + } else if (x1 == x2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end); + break; + case SDL_BLENDMODE_ADD: + VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end); + break; + case SDL_BLENDMODE_MOD: + VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end); + break; + default: + VLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end); + break; + } + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB888, draw_end); + break; + case SDL_BLENDMODE_ADD: + DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB888, draw_end); + break; + case SDL_BLENDMODE_MOD: + DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end); + break; + default: + DLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end); + break; + } + } else { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_RGB888, DRAW_SETPIXELXY_BLEND_RGB888, + draw_end); + break; + case SDL_BLENDMODE_ADD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_ADD_RGB888, DRAW_SETPIXELXY_ADD_RGB888, + draw_end); + break; + case SDL_BLENDMODE_MOD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_MOD_RGB888, DRAW_SETPIXELXY_MOD_RGB888, + draw_end); + break; + default: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_RGB888, DRAW_SETPIXELXY_BLEND_RGB888, + draw_end); + break; + } + } +} + +static void +SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) +{ + unsigned r, g, b, a, inva; + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(_r, _a); + g = DRAW_MUL(_g, _a); + b = DRAW_MUL(_b, _a); + a = _a; + } else { + r = _r; + g = _g; + b = _b; + a = _a; + } + inva = (a ^ 0xff); + + if (y1 == y2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end); + break; + case SDL_BLENDMODE_ADD: + HLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end); + break; + case SDL_BLENDMODE_MOD: + HLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end); + break; + default: + HLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end); + break; + } + } else if (x1 == x2) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end); + break; + case SDL_BLENDMODE_ADD: + VLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end); + break; + case SDL_BLENDMODE_MOD: + VLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end); + break; + default: + VLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end); + break; + } + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end); + break; + case SDL_BLENDMODE_ADD: + DLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end); + break; + case SDL_BLENDMODE_MOD: + DLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end); + break; + default: + DLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end); + break; + } + } else { + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888, + draw_end); + break; + case SDL_BLENDMODE_ADD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_ADD_ARGB8888, DRAW_SETPIXELXY_ADD_ARGB8888, + draw_end); + break; + case SDL_BLENDMODE_MOD: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_MOD_ARGB8888, DRAW_SETPIXELXY_MOD_ARGB8888, + draw_end); + break; + default: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888, + draw_end); + break; + } + } +} + +typedef void (*BlendLineFunc) (SDL_Surface * dst, + int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, + Uint8 r, Uint8 g, Uint8 b, Uint8 a, + SDL_bool draw_end); + +static BlendLineFunc +SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt) +{ + switch (fmt->BytesPerPixel) { + case 2: + if (fmt->Rmask == 0x7C00) { + return SDL_BlendLine_RGB555; + } else if (fmt->Rmask == 0xF800) { + return SDL_BlendLine_RGB565; + } else { + return SDL_BlendLine_RGB2; + } + break; + case 4: + if (fmt->Rmask == 0x00FF0000) { + if (fmt->Amask) { + return SDL_BlendLine_ARGB8888; + } else { + return SDL_BlendLine_RGB888; + } + } else { + if (fmt->Amask) { + return SDL_BlendLine_RGBA4; + } else { + return SDL_BlendLine_RGB4; + } + } + } + return NULL; +} + +int +SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + BlendLineFunc func; + + if (!dst) { + return SDL_SetError("SDL_BlendLine(): Passed NULL destination surface"); + } + + func = SDL_CalculateBlendLineFunc(dst->format); + if (!func) { + return SDL_SetError("SDL_BlendLine(): Unsupported surface format"); + } + + /* Perform clipping */ + /* FIXME: We don't actually want to clip, as it may change line slope */ + if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + return 0; + } + + func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, SDL_TRUE); + return 0; +} + +int +SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + int i; + int x1, y1; + int x2, y2; + SDL_bool draw_end; + BlendLineFunc func; + + if (!dst) { + return SDL_SetError("SDL_BlendLines(): Passed NULL destination surface"); + } + + func = SDL_CalculateBlendLineFunc(dst->format); + if (!func) { + return SDL_SetError("SDL_BlendLines(): Unsupported surface format"); + } + + for (i = 1; i < count; ++i) { + x1 = points[i-1].x; + y1 = points[i-1].y; + x2 = points[i].x; + y2 = points[i].y; + + /* Perform clipping */ + /* FIXME: We don't actually want to clip, as it may change line slope */ + if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + continue; + } + + /* Draw the end if it was clipped */ + draw_end = (x2 != points[i].x || y2 != points[i].y); + + func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, draw_end); + } + if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) { + SDL_BlendPoint(dst, points[count-1].x, points[count-1].y, + blendMode, r, g, b, a); + } + return 0; +} + +#endif /* !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendline.h b/src/render/software/SDL_blendline.h new file mode 100644 index 0000000000..813240144b --- /dev/null +++ b/src/render/software/SDL_blendline.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + + +extern int SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendpoint.c b/src/render/software/SDL_blendpoint.c new file mode 100644 index 0000000000..e2fa66fd80 --- /dev/null +++ b/src/render/software/SDL_blendpoint.c @@ -0,0 +1,343 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if !SDL_RENDER_DISABLED + +#include "SDL_draw.h" +#include "SDL_blendpoint.h" + + +static int +SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DRAW_SETPIXELXY_BLEND_RGB555(x, y); + break; + case SDL_BLENDMODE_ADD: + DRAW_SETPIXELXY_ADD_RGB555(x, y); + break; + case SDL_BLENDMODE_MOD: + DRAW_SETPIXELXY_MOD_RGB555(x, y); + break; + default: + DRAW_SETPIXELXY_RGB555(x, y); + break; + } + return 0; +} + +static int +SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DRAW_SETPIXELXY_BLEND_RGB565(x, y); + break; + case SDL_BLENDMODE_ADD: + DRAW_SETPIXELXY_ADD_RGB565(x, y); + break; + case SDL_BLENDMODE_MOD: + DRAW_SETPIXELXY_MOD_RGB565(x, y); + break; + default: + DRAW_SETPIXELXY_RGB565(x, y); + break; + } + return 0; +} + +static int +SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DRAW_SETPIXELXY_BLEND_RGB888(x, y); + break; + case SDL_BLENDMODE_ADD: + DRAW_SETPIXELXY_ADD_RGB888(x, y); + break; + case SDL_BLENDMODE_MOD: + DRAW_SETPIXELXY_MOD_RGB888(x, y); + break; + default: + DRAW_SETPIXELXY_RGB888(x, y); + break; + } + return 0; +} + +static int +SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, + Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + unsigned inva = 0xff - a; + + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DRAW_SETPIXELXY_BLEND_ARGB8888(x, y); + break; + case SDL_BLENDMODE_ADD: + DRAW_SETPIXELXY_ADD_ARGB8888(x, y); + break; + case SDL_BLENDMODE_MOD: + DRAW_SETPIXELXY_MOD_ARGB8888(x, y); + break; + default: + DRAW_SETPIXELXY_ARGB8888(x, y); + break; + } + return 0; +} + +static int +SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) +{ + SDL_PixelFormat *fmt = dst->format; + unsigned inva = 0xff - a; + + switch (fmt->BytesPerPixel) { + case 2: + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DRAW_SETPIXELXY2_BLEND_RGB(x, y); + break; + case SDL_BLENDMODE_ADD: + DRAW_SETPIXELXY2_ADD_RGB(x, y); + break; + case SDL_BLENDMODE_MOD: + DRAW_SETPIXELXY2_MOD_RGB(x, y); + break; + default: + DRAW_SETPIXELXY2_RGB(x, y); + break; + } + return 0; + case 4: + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DRAW_SETPIXELXY4_BLEND_RGB(x, y); + break; + case SDL_BLENDMODE_ADD: + DRAW_SETPIXELXY4_ADD_RGB(x, y); + break; + case SDL_BLENDMODE_MOD: + DRAW_SETPIXELXY4_MOD_RGB(x, y); + break; + default: + DRAW_SETPIXELXY4_RGB(x, y); + break; + } + return 0; + default: + return SDL_Unsupported(); + } +} + +static int +SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) +{ + SDL_PixelFormat *fmt = dst->format; + unsigned inva = 0xff - a; + + switch (fmt->BytesPerPixel) { + case 4: + switch (blendMode) { + case SDL_BLENDMODE_BLEND: + DRAW_SETPIXELXY4_BLEND_RGBA(x, y); + break; + case SDL_BLENDMODE_ADD: + DRAW_SETPIXELXY4_ADD_RGBA(x, y); + break; + case SDL_BLENDMODE_MOD: + DRAW_SETPIXELXY4_MOD_RGBA(x, y); + break; + default: + DRAW_SETPIXELXY4_RGBA(x, y); + break; + } + return 0; + default: + return SDL_Unsupported(); + } +} + +int +SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) +{ + if (!dst) { + return SDL_SetError("Passed NULL destination surface"); + } + + /* This function doesn't work on surfaces < 8 bpp */ + if (dst->format->BitsPerPixel < 8) { + return SDL_SetError("SDL_BlendPoint(): Unsupported surface format"); + } + + /* Perform clipping */ + if (x < dst->clip_rect.x || y < dst->clip_rect.y || + x >= (dst->clip_rect.x + dst->clip_rect.w) || + y >= (dst->clip_rect.y + dst->clip_rect.h)) { + return 0; + } + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(r, a); + g = DRAW_MUL(g, a); + b = DRAW_MUL(b, a); + } + + switch (dst->format->BitsPerPixel) { + case 15: + switch (dst->format->Rmask) { + case 0x7C00: + return SDL_BlendPoint_RGB555(dst, x, y, blendMode, r, g, b, a); + } + break; + case 16: + switch (dst->format->Rmask) { + case 0xF800: + return SDL_BlendPoint_RGB565(dst, x, y, blendMode, r, g, b, a); + } + break; + case 32: + switch (dst->format->Rmask) { + case 0x00FF0000: + if (!dst->format->Amask) { + return SDL_BlendPoint_RGB888(dst, x, y, blendMode, r, g, b, + a); + } else { + return SDL_BlendPoint_ARGB8888(dst, x, y, blendMode, r, g, b, + a); + } + break; + } + break; + default: + break; + } + + if (!dst->format->Amask) { + return SDL_BlendPoint_RGB(dst, x, y, blendMode, r, g, b, a); + } else { + return SDL_BlendPoint_RGBA(dst, x, y, blendMode, r, g, b, a); + } +} + +int +SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + int minx, miny; + int maxx, maxy; + int i; + int x, y; + int (*func)(SDL_Surface * dst, int x, int y, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; + int status = 0; + + if (!dst) { + return SDL_SetError("Passed NULL destination surface"); + } + + /* This function doesn't work on surfaces < 8 bpp */ + if (dst->format->BitsPerPixel < 8) { + return SDL_SetError("SDL_BlendPoints(): Unsupported surface format"); + } + + if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { + r = DRAW_MUL(r, a); + g = DRAW_MUL(g, a); + b = DRAW_MUL(b, a); + } + + /* FIXME: Does this function pointer slow things down significantly? */ + switch (dst->format->BitsPerPixel) { + case 15: + switch (dst->format->Rmask) { + case 0x7C00: + func = SDL_BlendPoint_RGB555; + break; + } + break; + case 16: + switch (dst->format->Rmask) { + case 0xF800: + func = SDL_BlendPoint_RGB565; + break; + } + break; + case 32: + switch (dst->format->Rmask) { + case 0x00FF0000: + if (!dst->format->Amask) { + func = SDL_BlendPoint_RGB888; + } else { + func = SDL_BlendPoint_ARGB8888; + } + break; + } + break; + default: + break; + } + + if (!func) { + if (!dst->format->Amask) { + func = SDL_BlendPoint_RGB; + } else { + func = SDL_BlendPoint_RGBA; + } + } + + minx = dst->clip_rect.x; + maxx = dst->clip_rect.x + dst->clip_rect.w - 1; + miny = dst->clip_rect.y; + maxy = dst->clip_rect.y + dst->clip_rect.h - 1; + + for (i = 0; i < count; ++i) { + x = points[i].x; + y = points[i].y; + + if (x < minx || x > maxx || y < miny || y > maxy) { + continue; + } + status = func(dst, x, y, blendMode, r, g, b, a); + } + return status; +} + +#endif /* !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendpoint.h b/src/render/software/SDL_blendpoint.h new file mode 100644 index 0000000000..ec7cfa754f --- /dev/null +++ b/src/render/software/SDL_blendpoint.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + + +extern int SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_draw.h b/src/render/software/SDL_draw.h new file mode 100644 index 0000000000..c529e98ee2 --- /dev/null +++ b/src/render/software/SDL_draw.h @@ -0,0 +1,575 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "../../video/SDL_blit.h" + +/* This code assumes that r, g, b, a are the source color, + * and in the blend and add case, the RGB values are premultiplied by a. + */ + +#define DRAW_MUL(_a, _b) (((unsigned)(_a)*(_b))/255) + +#define DRAW_FASTSETPIXEL(type) \ + *pixel = (type) color + +#define DRAW_FASTSETPIXEL1 DRAW_FASTSETPIXEL(Uint8) +#define DRAW_FASTSETPIXEL2 DRAW_FASTSETPIXEL(Uint16) +#define DRAW_FASTSETPIXEL4 DRAW_FASTSETPIXEL(Uint32) + +#define DRAW_FASTSETPIXELXY(x, y, type, bpp, color) \ + *(type *)((Uint8 *)dst->pixels + (y) * dst->pitch \ + + (x) * bpp) = (type) color + +#define DRAW_FASTSETPIXELXY1(x, y) DRAW_FASTSETPIXELXY(x, y, Uint8, 1, color) +#define DRAW_FASTSETPIXELXY2(x, y) DRAW_FASTSETPIXELXY(x, y, Uint16, 2, color) +#define DRAW_FASTSETPIXELXY4(x, y) DRAW_FASTSETPIXELXY(x, y, Uint32, 4, color) + +#define DRAW_SETPIXEL(setpixel) \ +do { \ + unsigned sr = r, sg = g, sb = b, sa = a; (void) sa; \ + setpixel; \ +} while (0) + +#define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \ +do { \ + unsigned sr, sg, sb, sa; (void) sa; \ + getpixel; \ + sr = DRAW_MUL(inva, sr) + r; \ + sg = DRAW_MUL(inva, sg) + g; \ + sb = DRAW_MUL(inva, sb) + b; \ + setpixel; \ +} while (0) + +#define DRAW_SETPIXEL_ADD(getpixel, setpixel) \ +do { \ + unsigned sr, sg, sb, sa; (void) sa; \ + getpixel; \ + sr += r; if (sr > 0xff) sr = 0xff; \ + sg += g; if (sg > 0xff) sg = 0xff; \ + sb += b; if (sb > 0xff) sb = 0xff; \ + setpixel; \ +} while (0) + +#define DRAW_SETPIXEL_MOD(getpixel, setpixel) \ +do { \ + unsigned sr, sg, sb, sa; (void) sa; \ + getpixel; \ + sr = DRAW_MUL(sr, r); \ + sg = DRAW_MUL(sg, g); \ + sb = DRAW_MUL(sb, b); \ + setpixel; \ +} while (0) + +#define DRAW_SETPIXELXY(x, y, type, bpp, op) \ +do { \ + type *pixel = (type *)((Uint8 *)dst->pixels + (y) * dst->pitch \ + + (x) * bpp); \ + op; \ +} while (0) + +/* + * Define draw operators for RGB555 + */ + +#define DRAW_SETPIXEL_RGB555 \ + DRAW_SETPIXEL(RGB555_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_BLEND_RGB555 \ + DRAW_SETPIXEL_BLEND(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ + RGB555_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_ADD_RGB555 \ + DRAW_SETPIXEL_ADD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ + RGB555_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_MOD_RGB555 \ + DRAW_SETPIXEL_MOD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ + RGB555_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXELXY_RGB555(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB555) + +#define DRAW_SETPIXELXY_BLEND_RGB555(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB555) + +#define DRAW_SETPIXELXY_ADD_RGB555(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB555) + +#define DRAW_SETPIXELXY_MOD_RGB555(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB555) + +/* + * Define draw operators for RGB565 + */ + +#define DRAW_SETPIXEL_RGB565 \ + DRAW_SETPIXEL(RGB565_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_BLEND_RGB565 \ + DRAW_SETPIXEL_BLEND(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ + RGB565_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_ADD_RGB565 \ + DRAW_SETPIXEL_ADD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ + RGB565_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_MOD_RGB565 \ + DRAW_SETPIXEL_MOD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ + RGB565_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXELXY_RGB565(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB565) + +#define DRAW_SETPIXELXY_BLEND_RGB565(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB565) + +#define DRAW_SETPIXELXY_ADD_RGB565(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB565) + +#define DRAW_SETPIXELXY_MOD_RGB565(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB565) + +/* + * Define draw operators for RGB888 + */ + +#define DRAW_SETPIXEL_RGB888 \ + DRAW_SETPIXEL(RGB888_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_BLEND_RGB888 \ + DRAW_SETPIXEL_BLEND(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ + RGB888_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_ADD_RGB888 \ + DRAW_SETPIXEL_ADD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ + RGB888_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXEL_MOD_RGB888 \ + DRAW_SETPIXEL_MOD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ + RGB888_FROM_RGB(*pixel, sr, sg, sb)) + +#define DRAW_SETPIXELXY_RGB888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGB888) + +#define DRAW_SETPIXELXY_BLEND_RGB888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGB888) + +#define DRAW_SETPIXELXY_ADD_RGB888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGB888) + +#define DRAW_SETPIXELXY_MOD_RGB888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB888) + +/* + * Define draw operators for ARGB8888 + */ + +#define DRAW_SETPIXEL_ARGB8888 \ + DRAW_SETPIXEL(ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) + +#define DRAW_SETPIXEL_BLEND_ARGB8888 \ + DRAW_SETPIXEL_BLEND(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ + ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) + +#define DRAW_SETPIXEL_ADD_ARGB8888 \ + DRAW_SETPIXEL_ADD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ + ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) + +#define DRAW_SETPIXEL_MOD_ARGB8888 \ + DRAW_SETPIXEL_MOD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ + ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) + +#define DRAW_SETPIXELXY_ARGB8888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ARGB8888) + +#define DRAW_SETPIXELXY_BLEND_ARGB8888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_ARGB8888) + +#define DRAW_SETPIXELXY_ADD_ARGB8888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_ARGB8888) + +#define DRAW_SETPIXELXY_MOD_ARGB8888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_ARGB8888) + +/* + * Define draw operators for general RGB + */ + +#define DRAW_SETPIXEL_RGB \ + DRAW_SETPIXEL(PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) + +#define DRAW_SETPIXEL_BLEND_RGB \ + DRAW_SETPIXEL_BLEND(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ + PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) + +#define DRAW_SETPIXEL_ADD_RGB \ + DRAW_SETPIXEL_ADD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ + PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) + +#define DRAW_SETPIXEL_MOD_RGB \ + DRAW_SETPIXEL_MOD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ + PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) + +#define DRAW_SETPIXELXY2_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB) + +#define DRAW_SETPIXELXY4_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGB) + +#define DRAW_SETPIXELXY2_BLEND_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB) + +#define DRAW_SETPIXELXY4_BLEND_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGB) + +#define DRAW_SETPIXELXY2_ADD_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB) + +#define DRAW_SETPIXELXY4_ADD_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGB) + +#define DRAW_SETPIXELXY2_MOD_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB) + +#define DRAW_SETPIXELXY4_MOD_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB) + + +/* + * Define draw operators for general RGBA + */ + +#define DRAW_SETPIXEL_RGBA \ + DRAW_SETPIXEL(PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) + +#define DRAW_SETPIXEL_BLEND_RGBA \ + DRAW_SETPIXEL_BLEND(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ + PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) + +#define DRAW_SETPIXEL_ADD_RGBA \ + DRAW_SETPIXEL_ADD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ + PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) + +#define DRAW_SETPIXEL_MOD_RGBA \ + DRAW_SETPIXEL_MOD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ + PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) + +#define DRAW_SETPIXELXY4_RGBA(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGBA) + +#define DRAW_SETPIXELXY4_BLEND_RGBA(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGBA) + +#define DRAW_SETPIXELXY4_ADD_RGBA(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGBA) + +#define DRAW_SETPIXELXY4_MOD_RGBA(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGBA) + +/* + * Define line drawing macro + */ + +#define ABS(_x) ((_x) < 0 ? -(_x) : (_x)) + +/* Horizontal line */ +#define HLINE(type, op, draw_end) \ +{ \ + int length; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + type *pixel; \ + if (x1 <= x2) { \ + pixel = (type *)dst->pixels + y1 * pitch + x1; \ + length = draw_end ? (x2-x1+1) : (x2-x1); \ + } else { \ + pixel = (type *)dst->pixels + y1 * pitch + x2; \ + if (!draw_end) { \ + ++pixel; \ + } \ + length = draw_end ? (x1-x2+1) : (x1-x2); \ + } \ + while (length--) { \ + op; \ + ++pixel; \ + } \ +} + +/* Vertical line */ +#define VLINE(type, op, draw_end) \ +{ \ + int length; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + type *pixel; \ + if (y1 <= y2) { \ + pixel = (type *)dst->pixels + y1 * pitch + x1; \ + length = draw_end ? (y2-y1+1) : (y2-y1); \ + } else { \ + pixel = (type *)dst->pixels + y2 * pitch + x1; \ + if (!draw_end) { \ + pixel += pitch; \ + } \ + length = draw_end ? (y1-y2+1) : (y1-y2); \ + } \ + while (length--) { \ + op; \ + pixel += pitch; \ + } \ +} + +/* Diagonal line */ +#define DLINE(type, op, draw_end) \ +{ \ + int length; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + type *pixel; \ + if (y1 <= y2) { \ + pixel = (type *)dst->pixels + y1 * pitch + x1; \ + if (x1 <= x2) { \ + ++pitch; \ + } else { \ + --pitch; \ + } \ + length = (y2-y1); \ + } else { \ + pixel = (type *)dst->pixels + y2 * pitch + x2; \ + if (x2 <= x1) { \ + ++pitch; \ + } else { \ + --pitch; \ + } \ + if (!draw_end) { \ + pixel += pitch; \ + } \ + length = (y1-y2); \ + } \ + if (draw_end) { \ + ++length; \ + } \ + while (length--) { \ + op; \ + pixel += pitch; \ + } \ +} + +/* Bresenham's line algorithm */ +#define BLINE(x1, y1, x2, y2, op, draw_end) \ +{ \ + int i, deltax, deltay, numpixels; \ + int d, dinc1, dinc2; \ + int x, xinc1, xinc2; \ + int y, yinc1, yinc2; \ + \ + deltax = ABS(x2 - x1); \ + deltay = ABS(y2 - y1); \ + \ + if (deltax >= deltay) { \ + numpixels = deltax + 1; \ + d = (2 * deltay) - deltax; \ + dinc1 = deltay * 2; \ + dinc2 = (deltay - deltax) * 2; \ + xinc1 = 1; \ + xinc2 = 1; \ + yinc1 = 0; \ + yinc2 = 1; \ + } else { \ + numpixels = deltay + 1; \ + d = (2 * deltax) - deltay; \ + dinc1 = deltax * 2; \ + dinc2 = (deltax - deltay) * 2; \ + xinc1 = 0; \ + xinc2 = 1; \ + yinc1 = 1; \ + yinc2 = 1; \ + } \ + \ + if (x1 > x2) { \ + xinc1 = -xinc1; \ + xinc2 = -xinc2; \ + } \ + if (y1 > y2) { \ + yinc1 = -yinc1; \ + yinc2 = -yinc2; \ + } \ + \ + x = x1; \ + y = y1; \ + \ + if (!draw_end) { \ + --numpixels; \ + } \ + for (i = 0; i < numpixels; ++i) { \ + op(x, y); \ + if (d < 0) { \ + d += dinc1; \ + x += xinc1; \ + y += yinc1; \ + } else { \ + d += dinc2; \ + x += xinc2; \ + y += yinc2; \ + } \ + } \ +} + +/* Xiaolin Wu's line algorithm, based on Michael Abrash's implementation */ +#define WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \ +{ \ + Uint16 ErrorAdj, ErrorAcc; \ + Uint16 ErrorAccTemp, Weighting; \ + int DeltaX, DeltaY, Temp, XDir; \ + unsigned r, g, b, a, inva; \ + \ + /* Draw the initial pixel, which is always exactly intersected by \ + the line and so needs no weighting */ \ + opaque_op(x1, y1); \ + \ + /* Draw the final pixel, which is always exactly intersected by the line \ + and so needs no weighting */ \ + if (draw_end) { \ + opaque_op(x2, y2); \ + } \ + \ + /* Make sure the line runs top to bottom */ \ + if (y1 > y2) { \ + Temp = y1; y1 = y2; y2 = Temp; \ + Temp = x1; x1 = x2; x2 = Temp; \ + } \ + DeltaY = y2 - y1; \ + \ + if ((DeltaX = x2 - x1) >= 0) { \ + XDir = 1; \ + } else { \ + XDir = -1; \ + DeltaX = -DeltaX; /* make DeltaX positive */ \ + } \ + \ + /* line is not horizontal, diagonal, or vertical */ \ + ErrorAcc = 0; /* initialize the line error accumulator to 0 */ \ + \ + /* Is this an X-major or Y-major line? */ \ + if (DeltaY > DeltaX) { \ + /* Y-major line; calculate 16-bit fixed-point fractional part of a \ + pixel that X advances each time Y advances 1 pixel, truncating the \ + result so that we won't overrun the endpoint along the X axis */ \ + ErrorAdj = ((unsigned long) DeltaX << 16) / (unsigned long) DeltaY; \ + /* Draw all pixels other than the first and last */ \ + while (--DeltaY) { \ + ErrorAccTemp = ErrorAcc; /* remember currrent accumulated error */ \ + ErrorAcc += ErrorAdj; /* calculate error for next pixel */ \ + if (ErrorAcc <= ErrorAccTemp) { \ + /* The error accumulator turned over, so advance the X coord */ \ + x1 += XDir; \ + } \ + y1++; /* Y-major, so always advance Y */ \ + /* The IntensityBits most significant bits of ErrorAcc give us the \ + intensity weighting for this pixel, and the complement of the \ + weighting for the paired pixel */ \ + Weighting = ErrorAcc >> 8; \ + { \ + a = DRAW_MUL(_a, (Weighting ^ 255)); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1, y1); \ + } \ + { \ + a = DRAW_MUL(_a, Weighting); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1 + XDir, y1); \ + } \ + } \ + } else { \ + /* X-major line; calculate 16-bit fixed-point fractional part of a \ + pixel that Y advances each time X advances 1 pixel, truncating the \ + result to avoid overrunning the endpoint along the X axis */ \ + ErrorAdj = ((unsigned long) DeltaY << 16) / (unsigned long) DeltaX; \ + /* Draw all pixels other than the first and last */ \ + while (--DeltaX) { \ + ErrorAccTemp = ErrorAcc; /* remember currrent accumulated error */ \ + ErrorAcc += ErrorAdj; /* calculate error for next pixel */ \ + if (ErrorAcc <= ErrorAccTemp) { \ + /* The error accumulator turned over, so advance the Y coord */ \ + y1++; \ + } \ + x1 += XDir; /* X-major, so always advance X */ \ + /* The IntensityBits most significant bits of ErrorAcc give us the \ + intensity weighting for this pixel, and the complement of the \ + weighting for the paired pixel */ \ + Weighting = ErrorAcc >> 8; \ + { \ + a = DRAW_MUL(_a, (Weighting ^ 255)); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1, y1); \ + } \ + { \ + a = DRAW_MUL(_a, Weighting); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1, y1 + 1); \ + } \ + } \ + } \ +} + +#ifdef AA_LINES +#define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \ + WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) +#else +#define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \ + BLINE(x1, y1, x2, y2, opaque_op, draw_end) +#endif + +/* + * Define fill rect macro + */ + +#define FILLRECT(type, op) \ +do { \ + int width = rect->w; \ + int height = rect->h; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + int skip = pitch - width; \ + type *pixel = (type *)dst->pixels + rect->y * pitch + rect->x; \ + while (height--) { \ + { int n = (width+3)/4; \ + switch (width & 3) { \ + case 0: do { op; pixel++; \ + case 3: op; pixel++; \ + case 2: op; pixel++; \ + case 1: op; pixel++; \ + } while ( --n > 0 ); \ + } \ + } \ + pixel += skip; \ + } \ +} while (0) + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_drawline.c b/src/render/software/SDL_drawline.c new file mode 100644 index 0000000000..5cda4ccca2 --- /dev/null +++ b/src/render/software/SDL_drawline.c @@ -0,0 +1,209 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if !SDL_RENDER_DISABLED + +#include "SDL_draw.h" +#include "SDL_drawline.h" +#include "SDL_drawpoint.h" + + +static void +SDL_DrawLine1(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, + SDL_bool draw_end) +{ + if (y1 == y2) { + int length; + int pitch = (dst->pitch / dst->format->BytesPerPixel); + Uint8 *pixel; + if (x1 <= x2) { + pixel = (Uint8 *)dst->pixels + y1 * pitch + x1; + length = draw_end ? (x2-x1+1) : (x2-x1); + } else { + pixel = (Uint8 *)dst->pixels + y1 * pitch + x2; + if (!draw_end) { + ++pixel; + } + length = draw_end ? (x1-x2+1) : (x1-x2); + } + SDL_memset(pixel, color, length); + } else if (x1 == x2) { + VLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end); + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + DLINE(Uint8, DRAW_FASTSETPIXEL1, draw_end); + } else { + BLINE(x1, y1, x2, y2, DRAW_FASTSETPIXELXY1, draw_end); + } +} + +static void +SDL_DrawLine2(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, + SDL_bool draw_end) +{ + if (y1 == y2) { + HLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end); + } else if (x1 == x2) { + VLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end); + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + DLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end); + } else { + Uint8 _r, _g, _b, _a; + const SDL_PixelFormat * fmt = dst->format; + SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a); + if (fmt->Rmask == 0x7C00) { + AALINE(x1, y1, x2, y2, + DRAW_FASTSETPIXELXY2, DRAW_SETPIXELXY_BLEND_RGB555, + draw_end); + } else if (fmt->Rmask == 0xF800) { + AALINE(x1, y1, x2, y2, + DRAW_FASTSETPIXELXY2, DRAW_SETPIXELXY_BLEND_RGB565, + draw_end); + } else { + AALINE(x1, y1, x2, y2, + DRAW_FASTSETPIXELXY2, DRAW_SETPIXELXY2_BLEND_RGB, + draw_end); + } + } +} + +static void +SDL_DrawLine4(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, + SDL_bool draw_end) +{ + if (y1 == y2) { + HLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end); + } else if (x1 == x2) { + VLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end); + } else if (ABS(x1 - x2) == ABS(y1 - y2)) { + DLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end); + } else { + Uint8 _r, _g, _b, _a; + const SDL_PixelFormat * fmt = dst->format; + SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a); + if (fmt->Rmask == 0x00FF0000) { + if (!fmt->Amask) { + AALINE(x1, y1, x2, y2, + DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY_BLEND_RGB888, + draw_end); + } else { + AALINE(x1, y1, x2, y2, + DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY_BLEND_ARGB8888, + draw_end); + } + } else { + AALINE(x1, y1, x2, y2, + DRAW_FASTSETPIXELXY4, DRAW_SETPIXELXY4_BLEND_RGB, + draw_end); + } + } +} + +typedef void (*DrawLineFunc) (SDL_Surface * dst, + int x1, int y1, int x2, int y2, + Uint32 color, SDL_bool draw_end); + +static DrawLineFunc +SDL_CalculateDrawLineFunc(const SDL_PixelFormat * fmt) +{ + switch (fmt->BytesPerPixel) { + case 1: + if (fmt->BitsPerPixel < 8) { + break; + } + return SDL_DrawLine1; + case 2: + return SDL_DrawLine2; + case 4: + return SDL_DrawLine4; + } + return NULL; +} + +int +SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color) +{ + DrawLineFunc func; + + if (!dst) { + return SDL_SetError("SDL_DrawLine(): Passed NULL destination surface"); + } + + func = SDL_CalculateDrawLineFunc(dst->format); + if (!func) { + return SDL_SetError("SDL_DrawLine(): Unsupported surface format"); + } + + /* Perform clipping */ + /* FIXME: We don't actually want to clip, as it may change line slope */ + if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + return 0; + } + + func(dst, x1, y1, x2, y2, color, SDL_TRUE); + return 0; +} + +int +SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, + Uint32 color) +{ + int i; + int x1, y1; + int x2, y2; + SDL_bool draw_end; + DrawLineFunc func; + + if (!dst) { + return SDL_SetError("SDL_DrawLines(): Passed NULL destination surface"); + } + + func = SDL_CalculateDrawLineFunc(dst->format); + if (!func) { + return SDL_SetError("SDL_DrawLines(): Unsupported surface format"); + } + + for (i = 1; i < count; ++i) { + x1 = points[i-1].x; + y1 = points[i-1].y; + x2 = points[i].x; + y2 = points[i].y; + + /* Perform clipping */ + /* FIXME: We don't actually want to clip, as it may change line slope */ + if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + continue; + } + + /* Draw the end if it was clipped */ + draw_end = (x2 != points[i].x || y2 != points[i].y); + + func(dst, x1, y1, x2, y2, color, draw_end); + } + if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) { + SDL_DrawPoint(dst, points[count-1].x, points[count-1].y, color); + } + return 0; +} + +#endif /* !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_drawline.h b/src/render/software/SDL_drawline.h new file mode 100644 index 0000000000..5b6a098499 --- /dev/null +++ b/src/render/software/SDL_drawline.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + + +extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color); +extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_drawpoint.c b/src/render/software/SDL_drawpoint.c new file mode 100644 index 0000000000..1ae8419c1c --- /dev/null +++ b/src/render/software/SDL_drawpoint.c @@ -0,0 +1,114 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if !SDL_RENDER_DISABLED + +#include "SDL_draw.h" +#include "SDL_drawpoint.h" + + +int +SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color) +{ + if (!dst) { + return SDL_SetError("Passed NULL destination surface"); + } + + /* This function doesn't work on surfaces < 8 bpp */ + if (dst->format->BitsPerPixel < 8) { + return SDL_SetError("SDL_DrawPoint(): Unsupported surface format"); + } + + /* Perform clipping */ + if (x < dst->clip_rect.x || y < dst->clip_rect.y || + x >= (dst->clip_rect.x + dst->clip_rect.w) || + y >= (dst->clip_rect.y + dst->clip_rect.h)) { + return 0; + } + + switch (dst->format->BytesPerPixel) { + case 1: + DRAW_FASTSETPIXELXY1(x, y); + break; + case 2: + DRAW_FASTSETPIXELXY2(x, y); + break; + case 3: + return SDL_Unsupported(); + case 4: + DRAW_FASTSETPIXELXY4(x, y); + break; + } + return 0; +} + +int +SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, + Uint32 color) +{ + int minx, miny; + int maxx, maxy; + int i; + int x, y; + + if (!dst) { + return SDL_SetError("Passed NULL destination surface"); + } + + /* This function doesn't work on surfaces < 8 bpp */ + if (dst->format->BitsPerPixel < 8) { + return SDL_SetError("SDL_DrawPoints(): Unsupported surface format"); + } + + minx = dst->clip_rect.x; + maxx = dst->clip_rect.x + dst->clip_rect.w - 1; + miny = dst->clip_rect.y; + maxy = dst->clip_rect.y + dst->clip_rect.h - 1; + + for (i = 0; i < count; ++i) { + x = points[i].x; + y = points[i].y; + + if (x < minx || x > maxx || y < miny || y > maxy) { + continue; + } + + switch (dst->format->BytesPerPixel) { + case 1: + DRAW_FASTSETPIXELXY1(x, y); + break; + case 2: + DRAW_FASTSETPIXELXY2(x, y); + break; + case 3: + return SDL_Unsupported(); + case 4: + DRAW_FASTSETPIXELXY4(x, y); + break; + } + } + return 0; +} + +#endif /* !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_drawpoint.h b/src/render/software/SDL_drawpoint.h new file mode 100644 index 0000000000..512ef6471c --- /dev/null +++ b/src/render/software/SDL_drawpoint.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + + +extern int SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color); +extern int SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c new file mode 100644 index 0000000000..78f6ca1e98 --- /dev/null +++ b/src/render/software/SDL_render_sw.c @@ -0,0 +1,729 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if !SDL_RENDER_DISABLED + +#include "../SDL_sysrender.h" +#include "SDL_render_sw_c.h" +#include "SDL_hints.h" + +#include "SDL_draw.h" +#include "SDL_blendfillrect.h" +#include "SDL_blendline.h" +#include "SDL_blendpoint.h" +#include "SDL_drawline.h" +#include "SDL_drawpoint.h" +#include "SDL_rotate.h" + +/* SDL surface based renderer implementation */ + +static SDL_Renderer *SW_CreateRenderer(SDL_Window * window, Uint32 flags); +static void SW_WindowEvent(SDL_Renderer * renderer, + const SDL_WindowEvent *event); +static int SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h); +static int SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int SW_SetTextureColorMod(SDL_Renderer * renderer, + SDL_Texture * texture); +static int SW_SetTextureAlphaMod(SDL_Renderer * renderer, + SDL_Texture * texture); +static int SW_SetTextureBlendMode(SDL_Renderer * renderer, + SDL_Texture * texture); +static int SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, + int pitch); +static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch); +static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static int SW_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture); +static int SW_UpdateViewport(SDL_Renderer * renderer); +static int SW_UpdateClipRect(SDL_Renderer * renderer); +static int SW_RenderClear(SDL_Renderer * renderer); +static int SW_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int SW_RenderDrawLines(SDL_Renderer * renderer, + const SDL_FPoint * points, int count); +static int SW_RenderFillRects(SDL_Renderer * renderer, + const SDL_FRect * rects, int count); +static int SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect); +static int SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip); +static int SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch); +static void SW_RenderPresent(SDL_Renderer * renderer); +static void SW_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static void SW_DestroyRenderer(SDL_Renderer * renderer); + + +SDL_RenderDriver SW_RenderDriver = { + SW_CreateRenderer, + { + "software", + SDL_RENDERER_SOFTWARE | SDL_RENDERER_TARGETTEXTURE, + 8, + { + SDL_PIXELFORMAT_RGB555, + SDL_PIXELFORMAT_RGB565, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_BGR888, + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_BGRA8888 + }, + 0, + 0} +}; + +typedef struct +{ + SDL_Surface *surface; + SDL_Surface *window; +} SW_RenderData; + + +static SDL_Surface * +SW_ActivateRenderer(SDL_Renderer * renderer) +{ + SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + + if (!data->surface) { + data->surface = data->window; + } + if (!data->surface) { + SDL_Surface *surface = SDL_GetWindowSurface(renderer->window); + if (surface) { + data->surface = data->window = surface; + + SW_UpdateViewport(renderer); + SW_UpdateClipRect(renderer); + } + } + return data->surface; +} + +SDL_Renderer * +SW_CreateRendererForSurface(SDL_Surface * surface) +{ + SDL_Renderer *renderer; + SW_RenderData *data; + + if (!surface) { + SDL_SetError("Can't create renderer for NULL surface"); + return NULL; + } + + renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); + if (!renderer) { + SDL_OutOfMemory(); + return NULL; + } + + data = (SW_RenderData *) SDL_calloc(1, sizeof(*data)); + if (!data) { + SW_DestroyRenderer(renderer); + SDL_OutOfMemory(); + return NULL; + } + data->surface = surface; + + renderer->WindowEvent = SW_WindowEvent; + renderer->GetOutputSize = SW_GetOutputSize; + renderer->CreateTexture = SW_CreateTexture; + renderer->SetTextureColorMod = SW_SetTextureColorMod; + renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; + renderer->SetTextureBlendMode = SW_SetTextureBlendMode; + renderer->UpdateTexture = SW_UpdateTexture; + renderer->LockTexture = SW_LockTexture; + renderer->UnlockTexture = SW_UnlockTexture; + renderer->SetRenderTarget = SW_SetRenderTarget; + renderer->UpdateViewport = SW_UpdateViewport; + renderer->UpdateClipRect = SW_UpdateClipRect; + renderer->RenderClear = SW_RenderClear; + renderer->RenderDrawPoints = SW_RenderDrawPoints; + renderer->RenderDrawLines = SW_RenderDrawLines; + renderer->RenderFillRects = SW_RenderFillRects; + renderer->RenderCopy = SW_RenderCopy; + renderer->RenderCopyEx = SW_RenderCopyEx; + renderer->RenderReadPixels = SW_RenderReadPixels; + renderer->RenderPresent = SW_RenderPresent; + renderer->DestroyTexture = SW_DestroyTexture; + renderer->DestroyRenderer = SW_DestroyRenderer; + renderer->info = SW_RenderDriver.info; + renderer->driverdata = data; + + SW_ActivateRenderer(renderer); + + return renderer; +} + +SDL_Renderer * +SW_CreateRenderer(SDL_Window * window, Uint32 flags) +{ + SDL_Surface *surface; + + surface = SDL_GetWindowSurface(window); + if (!surface) { + return NULL; + } + return SW_CreateRendererForSurface(surface); +} + +static void +SW_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +{ + SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + + if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { + data->surface = NULL; + data->window = NULL; + } +} + +static int +SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + + if (surface) { + if (w) { + *w = surface->w; + } + if (h) { + *h = surface->h; + } + return 0; + } else { + SDL_SetError("Software renderer doesn't have an output surface"); + return -1; + } +} + +static int +SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + if (!SDL_PixelFormatEnumToMasks + (texture->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + return SDL_SetError("Unknown texture format"); + } + + texture->driverdata = + SDL_CreateRGBSurface(0, texture->w, texture->h, bpp, Rmask, Gmask, + Bmask, Amask); + SDL_SetSurfaceColorMod(texture->driverdata, texture->r, texture->g, + texture->b); + SDL_SetSurfaceAlphaMod(texture->driverdata, texture->a); + SDL_SetSurfaceBlendMode(texture->driverdata, texture->blendMode); + + if (texture->access == SDL_TEXTUREACCESS_STATIC) { + SDL_SetSurfaceRLE(texture->driverdata, 1); + } + + if (!texture->driverdata) { + return -1; + } + return 0; +} + +static int +SW_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture) +{ + SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + return SDL_SetSurfaceColorMod(surface, texture->r, texture->g, + texture->b); +} + +static int +SW_SetTextureAlphaMod(SDL_Renderer * renderer, SDL_Texture * texture) +{ + SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + return SDL_SetSurfaceAlphaMod(surface, texture->a); +} + +static int +SW_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) +{ + SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + return SDL_SetSurfaceBlendMode(surface, texture->blendMode); +} + +static int +SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, const void *pixels, int pitch) +{ + SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + Uint8 *src, *dst; + int row; + size_t length; + + if(SDL_MUSTLOCK(surface)) + SDL_LockSurface(surface); + src = (Uint8 *) pixels; + dst = (Uint8 *) surface->pixels + + rect->y * surface->pitch + + rect->x * surface->format->BytesPerPixel; + length = rect->w * surface->format->BytesPerPixel; + for (row = 0; row < rect->h; ++row) { + SDL_memcpy(dst, src, length); + src += pitch; + dst += surface->pitch; + } + if(SDL_MUSTLOCK(surface)) + SDL_UnlockSurface(surface); + return 0; +} + +static int +SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * rect, void **pixels, int *pitch) +{ + SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + + *pixels = + (void *) ((Uint8 *) surface->pixels + rect->y * surface->pitch + + rect->x * surface->format->BytesPerPixel); + *pitch = surface->pitch; + return 0; +} + +static void +SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ +} + +static int +SW_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +{ + SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + + if (texture ) { + data->surface = (SDL_Surface *) texture->driverdata; + } else { + data->surface = data->window; + } + return 0; +} + +static int +SW_UpdateViewport(SDL_Renderer * renderer) +{ + SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SDL_Surface *surface = data->surface; + + if (!surface) { + /* We'll update the viewport after we recreate the surface */ + return 0; + } + + SDL_SetClipRect(data->surface, &renderer->viewport); + return 0; +} + +static int +SW_UpdateClipRect(SDL_Renderer * renderer) +{ + SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SDL_Surface *surface = data->surface; + const SDL_Rect *rect = &renderer->clip_rect; + + if (surface) { + if (!SDL_RectEmpty(rect)) { + SDL_SetClipRect(surface, rect); + } else { + SDL_SetClipRect(surface, NULL); + } + } + return 0; +} + +static int +SW_RenderClear(SDL_Renderer * renderer) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + Uint32 color; + SDL_Rect clip_rect; + + if (!surface) { + return -1; + } + + color = SDL_MapRGBA(surface->format, + renderer->r, renderer->g, renderer->b, renderer->a); + + /* By definition the clear ignores the clip rect */ + clip_rect = surface->clip_rect; + SDL_SetClipRect(surface, NULL); + SDL_FillRect(surface, NULL, color); + SDL_SetClipRect(surface, &clip_rect); + return 0; +} + +static int +SW_RenderDrawPoints(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + SDL_Point *final_points; + int i, status; + + if (!surface) { + return -1; + } + + final_points = SDL_stack_alloc(SDL_Point, count); + if (!final_points) { + return SDL_OutOfMemory(); + } + if (renderer->viewport.x || renderer->viewport.y) { + int x = renderer->viewport.x; + int y = renderer->viewport.y; + + for (i = 0; i < count; ++i) { + final_points[i].x = (int)(x + points[i].x); + final_points[i].y = (int)(y + points[i].y); + } + } else { + for (i = 0; i < count; ++i) { + final_points[i].x = (int)points[i].x; + final_points[i].y = (int)points[i].y; + } + } + + /* Draw the points! */ + if (renderer->blendMode == SDL_BLENDMODE_NONE) { + Uint32 color = SDL_MapRGBA(surface->format, + renderer->r, renderer->g, renderer->b, + renderer->a); + + status = SDL_DrawPoints(surface, final_points, count, color); + } else { + status = SDL_BlendPoints(surface, final_points, count, + renderer->blendMode, + renderer->r, renderer->g, renderer->b, + renderer->a); + } + SDL_stack_free(final_points); + + return status; +} + +static int +SW_RenderDrawLines(SDL_Renderer * renderer, const SDL_FPoint * points, + int count) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + SDL_Point *final_points; + int i, status; + + if (!surface) { + return -1; + } + + final_points = SDL_stack_alloc(SDL_Point, count); + if (!final_points) { + return SDL_OutOfMemory(); + } + if (renderer->viewport.x || renderer->viewport.y) { + int x = renderer->viewport.x; + int y = renderer->viewport.y; + + for (i = 0; i < count; ++i) { + final_points[i].x = (int)(x + points[i].x); + final_points[i].y = (int)(y + points[i].y); + } + } else { + for (i = 0; i < count; ++i) { + final_points[i].x = (int)points[i].x; + final_points[i].y = (int)points[i].y; + } + } + + /* Draw the lines! */ + if (renderer->blendMode == SDL_BLENDMODE_NONE) { + Uint32 color = SDL_MapRGBA(surface->format, + renderer->r, renderer->g, renderer->b, + renderer->a); + + status = SDL_DrawLines(surface, final_points, count, color); + } else { + status = SDL_BlendLines(surface, final_points, count, + renderer->blendMode, + renderer->r, renderer->g, renderer->b, + renderer->a); + } + SDL_stack_free(final_points); + + return status; +} + +static int +SW_RenderFillRects(SDL_Renderer * renderer, const SDL_FRect * rects, int count) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + SDL_Rect *final_rects; + int i, status; + + if (!surface) { + return -1; + } + + final_rects = SDL_stack_alloc(SDL_Rect, count); + if (!final_rects) { + return SDL_OutOfMemory(); + } + if (renderer->viewport.x || renderer->viewport.y) { + int x = renderer->viewport.x; + int y = renderer->viewport.y; + + for (i = 0; i < count; ++i) { + final_rects[i].x = (int)(x + rects[i].x); + final_rects[i].y = (int)(y + rects[i].y); + final_rects[i].w = SDL_max((int)rects[i].w, 1); + final_rects[i].h = SDL_max((int)rects[i].h, 1); + } + } else { + for (i = 0; i < count; ++i) { + final_rects[i].x = (int)rects[i].x; + final_rects[i].y = (int)rects[i].y; + final_rects[i].w = SDL_max((int)rects[i].w, 1); + final_rects[i].h = SDL_max((int)rects[i].h, 1); + } + } + + if (renderer->blendMode == SDL_BLENDMODE_NONE) { + Uint32 color = SDL_MapRGBA(surface->format, + renderer->r, renderer->g, renderer->b, + renderer->a); + status = SDL_FillRects(surface, final_rects, count, color); + } else { + status = SDL_BlendFillRects(surface, final_rects, count, + renderer->blendMode, + renderer->r, renderer->g, renderer->b, + renderer->a); + } + SDL_stack_free(final_rects); + + return status; +} + +static int +SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + SDL_Surface *src = (SDL_Surface *) texture->driverdata; + SDL_Rect final_rect; + + if (!surface) { + return -1; + } + + if (renderer->viewport.x || renderer->viewport.y) { + final_rect.x = (int)(renderer->viewport.x + dstrect->x); + final_rect.y = (int)(renderer->viewport.y + dstrect->y); + } else { + final_rect.x = (int)dstrect->x; + final_rect.y = (int)dstrect->y; + } + final_rect.w = (int)dstrect->w; + final_rect.h = (int)dstrect->h; + + if ( srcrect->w == final_rect.w && srcrect->h == final_rect.h ) { + return SDL_BlitSurface(src, srcrect, surface, &final_rect); + } else { + return SDL_BlitScaled(src, srcrect, surface, &final_rect); + } +} + +static int +GetScaleQuality(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); + + if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { + return 0; + } else { + return 1; + } +} + +static int +SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, + const SDL_Rect * srcrect, const SDL_FRect * dstrect, + const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + SDL_Surface *src = (SDL_Surface *) texture->driverdata; + SDL_Rect final_rect, tmp_rect; + SDL_Surface *surface_rotated, *surface_scaled; + Uint32 colorkey; + int retval, dstwidth, dstheight, abscenterx, abscentery; + double cangle, sangle, px, py, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y; + + if (!surface) { + return -1; + } + + if (renderer->viewport.x || renderer->viewport.y) { + final_rect.x = (int)(renderer->viewport.x + dstrect->x); + final_rect.y = (int)(renderer->viewport.y + dstrect->y); + } else { + final_rect.x = (int)dstrect->x; + final_rect.y = (int)dstrect->y; + } + final_rect.w = (int)dstrect->w; + final_rect.h = (int)dstrect->h; + + surface_scaled = SDL_CreateRGBSurface(SDL_SWSURFACE, final_rect.w, final_rect.h, src->format->BitsPerPixel, + src->format->Rmask, src->format->Gmask, + src->format->Bmask, src->format->Amask ); + if (surface_scaled) { + SDL_GetColorKey(src, &colorkey); + SDL_SetColorKey(surface_scaled, SDL_TRUE, colorkey); + tmp_rect = final_rect; + tmp_rect.x = 0; + tmp_rect.y = 0; + + retval = SDL_BlitScaled(src, srcrect, surface_scaled, &tmp_rect); + if (!retval) { + _rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, -angle, &dstwidth, &dstheight, &cangle, &sangle); + surface_rotated = _rotateSurface(surface_scaled, -angle, dstwidth/2, dstheight/2, GetScaleQuality(), flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle); + if(surface_rotated) { + /* Find out where the new origin is by rotating the four final_rect points around the center and then taking the extremes */ + abscenterx = final_rect.x + (int)center->x; + abscentery = final_rect.y + (int)center->y; + /* Compensate the angle inversion to match the behaviour of the other backends */ + sangle = -sangle; + + /* Top Left */ + px = final_rect.x - abscenterx; + py = final_rect.y - abscentery; + p1x = px * cangle - py * sangle + abscenterx; + p1y = px * sangle + py * cangle + abscentery; + + /* Top Right */ + px = final_rect.x + final_rect.w - abscenterx; + py = final_rect.y - abscentery; + p2x = px * cangle - py * sangle + abscenterx; + p2y = px * sangle + py * cangle + abscentery; + + /* Bottom Left */ + px = final_rect.x - abscenterx; + py = final_rect.y + final_rect.h - abscentery; + p3x = px * cangle - py * sangle + abscenterx; + p3y = px * sangle + py * cangle + abscentery; + + /* Bottom Right */ + px = final_rect.x + final_rect.w - abscenterx; + py = final_rect.y + final_rect.h - abscentery; + p4x = px * cangle - py * sangle + abscenterx; + p4y = px * sangle + py * cangle + abscentery; + + tmp_rect.x = (int)MIN(MIN(p1x, p2x), MIN(p3x, p4x)); + tmp_rect.y = (int)MIN(MIN(p1y, p2y), MIN(p3y, p4y)); + tmp_rect.w = dstwidth; + tmp_rect.h = dstheight; + + retval = SDL_BlitSurface(surface_rotated, NULL, surface, &tmp_rect); + SDL_FreeSurface(surface_scaled); + SDL_FreeSurface(surface_rotated); + return retval; + } + } + return retval; + } + + return -1; +} + +static int +SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, + Uint32 format, void * pixels, int pitch) +{ + SDL_Surface *surface = SW_ActivateRenderer(renderer); + Uint32 src_format; + void *src_pixels; + SDL_Rect final_rect; + + if (!surface) { + return -1; + } + + if (renderer->viewport.x || renderer->viewport.y) { + final_rect.x = renderer->viewport.x + rect->x; + final_rect.y = renderer->viewport.y + rect->y; + final_rect.w = rect->w; + final_rect.h = rect->h; + rect = &final_rect; + } + + if (rect->x < 0 || rect->x+rect->w > surface->w || + rect->y < 0 || rect->y+rect->h > surface->h) { + return SDL_SetError("Tried to read outside of surface bounds"); + } + + src_format = surface->format->format; + src_pixels = (void*)((Uint8 *) surface->pixels + + rect->y * surface->pitch + + rect->x * surface->format->BytesPerPixel); + + return SDL_ConvertPixels(rect->w, rect->h, + src_format, src_pixels, surface->pitch, + format, pixels, pitch); +} + +static void +SW_RenderPresent(SDL_Renderer * renderer) +{ + SDL_Window *window = renderer->window; + + if (window) { + SDL_UpdateWindowSurface(window); + } +} + +static void +SW_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +{ + SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + + SDL_FreeSurface(surface); +} + +static void +SW_DestroyRenderer(SDL_Renderer * renderer) +{ + SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + + if (data) { + SDL_free(data); + } + SDL_free(renderer); +} + +#endif /* !SDL_RENDER_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_render_sw_c.h b/src/render/software/SDL_render_sw_c.h new file mode 100644 index 0000000000..7ba0a7eec3 --- /dev/null +++ b/src/render/software/SDL_render_sw_c.h @@ -0,0 +1,24 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c new file mode 100644 index 0000000000..b315535870 --- /dev/null +++ b/src/render/software/SDL_rotate.c @@ -0,0 +1,499 @@ +/* + +SDL_rotate.c: rotates 32bit or 8bit surfaces + +Shamelessly stolen from SDL_gfx by Andreas Schiffler. Original copyright follows: + +Copyright (C) 2001-2011 Andreas Schiffler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. + +Andreas Schiffler -- aschiffler at ferzkopp dot net + +*/ +#include "SDL_config.h" + +#ifdef WIN32 +#include +#endif + +#include +#include + +#include "SDL.h" +#include "SDL_rotate.h" + +/* ---- Internally used structures */ + +/*! +\brief A 32 bit RGBA pixel. +*/ +typedef struct tColorRGBA { + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 a; +} tColorRGBA; + +/*! +\brief A 8bit Y/palette pixel. +*/ +typedef struct tColorY { + Uint8 y; +} tColorY; + +/*! +\brief Returns maximum of two numbers a and b. +*/ +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) + +/*! +\brief Number of guard rows added to destination surfaces. + +This is a simple but effective workaround for observed issues. +These rows allocate extra memory and are then hidden from the surface. +Rows are added to the end of destination surfaces when they are allocated. +This catches any potential overflows which seem to happen with +just the right src image dimensions and scale/rotation and can lead +to a situation where the program can segfault. +*/ +#define GUARD_ROWS (2) + +/*! +\brief Lower limit of absolute zoom factor or rotation degrees. +*/ +#define VALUE_LIMIT 0.001 + +/*! +\brief Returns colorkey info for a surface +*/ +Uint32 _colorkey(SDL_Surface *src) +{ + Uint32 key = 0; + SDL_GetColorKey(src, &key); + return key; +} + + +/*! +\brief Internal target surface sizing function for rotations with trig result return. + +\param width The source surface width. +\param height The source surface height. +\param angle The angle to rotate in degrees. +\param dstwidth The calculated width of the destination surface. +\param dstheight The calculated height of the destination surface. +\param cangle The sine of the angle +\param sangle The cosine of the angle + +*/ +void _rotozoomSurfaceSizeTrig(int width, int height, double angle, + int *dstwidth, int *dstheight, + double *cangle, double *sangle) +{ + double x, y, cx, cy, sx, sy; + double radangle; + int dstwidthhalf, dstheighthalf; + + /* + * Determine destination width and height by rotating a centered source box + */ + radangle = angle * (M_PI / 180.0); + *sangle = SDL_sin(radangle); + *cangle = SDL_cos(radangle); + x = (double)(width / 2); + y = (double)(height / 2); + cx = *cangle * x; + cy = *cangle * y; + sx = *sangle * x; + sy = *sangle * y; + + dstwidthhalf = MAX((int) + SDL_ceil(MAX(MAX(MAX(SDL_fabs(cx + sy), SDL_fabs(cx - sy)), SDL_fabs(-cx + sy)), SDL_fabs(-cx - sy))), 1); + dstheighthalf = MAX((int) + SDL_ceil(MAX(MAX(MAX(SDL_fabs(sx + cy), SDL_fabs(sx - cy)), SDL_fabs(-sx + cy)), SDL_fabs(-sx - cy))), 1); + *dstwidth = 2 * dstwidthhalf; + *dstheight = 2 * dstheighthalf; +} + + +/*! +\brief Internal 32 bit rotozoomer with optional anti-aliasing. + +Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control +parameters by scanning the destination surface and applying optionally anti-aliasing +by bilinear interpolation. +Assumes src and dst surfaces are of 32 bit depth. +Assumes dst surface was allocated with the correct dimensions. + +\param src Source surface. +\param dst Destination surface. +\param cx Horizontal center coordinate. +\param cy Vertical center coordinate. +\param isin Integer version of sine of angle. +\param icos Integer version of cosine of angle. +\param flipx Flag indicating horizontal mirroring should be applied. +\param flipy Flag indicating vertical mirroring should be applied. +\param smooth Flag indicating anti-aliasing should be used. +*/ +void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth) +{ + int x, y, t1, t2, dx, dy, xd, yd, sdx, sdy, ax, ay, ex, ey, sw, sh; + tColorRGBA c00, c01, c10, c11, cswap; + tColorRGBA *pc, *sp; + int gap; + + /* + * Variable setup + */ + xd = ((src->w - dst->w) << 15); + yd = ((src->h - dst->h) << 15); + ax = (cx << 16) - (icos * cx); + ay = (cy << 16) - (isin * cx); + sw = src->w - 1; + sh = src->h - 1; + pc = (tColorRGBA*) dst->pixels; + gap = dst->pitch - dst->w * 4; + + /* + * Switch between interpolating and non-interpolating code + */ + if (smooth) { + for (y = 0; y < dst->h; y++) { + dy = cy - y; + sdx = (ax + (isin * dy)) + xd; + sdy = (ay - (icos * dy)) + yd; + for (x = 0; x < dst->w; x++) { + dx = (sdx >> 16); + dy = (sdy >> 16); + if (flipx) dx = sw - dx; + if (flipy) dy = sh - dy; + if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) { + sp = (tColorRGBA *)src->pixels;; + sp += ((src->pitch/4) * dy); + sp += dx; + c00 = *sp; + sp += 1; + c01 = *sp; + sp += (src->pitch/4); + c11 = *sp; + sp -= 1; + c10 = *sp; + if (flipx) { + cswap = c00; c00=c01; c01=cswap; + cswap = c10; c10=c11; c11=cswap; + } + if (flipy) { + cswap = c00; c00=c10; c10=cswap; + cswap = c01; c01=c11; c11=cswap; + } + /* + * Interpolate colors + */ + ex = (sdx & 0xffff); + ey = (sdy & 0xffff); + t1 = ((((c01.r - c00.r) * ex) >> 16) + c00.r) & 0xff; + t2 = ((((c11.r - c10.r) * ex) >> 16) + c10.r) & 0xff; + pc->r = (((t2 - t1) * ey) >> 16) + t1; + t1 = ((((c01.g - c00.g) * ex) >> 16) + c00.g) & 0xff; + t2 = ((((c11.g - c10.g) * ex) >> 16) + c10.g) & 0xff; + pc->g = (((t2 - t1) * ey) >> 16) + t1; + t1 = ((((c01.b - c00.b) * ex) >> 16) + c00.b) & 0xff; + t2 = ((((c11.b - c10.b) * ex) >> 16) + c10.b) & 0xff; + pc->b = (((t2 - t1) * ey) >> 16) + t1; + t1 = ((((c01.a - c00.a) * ex) >> 16) + c00.a) & 0xff; + t2 = ((((c11.a - c10.a) * ex) >> 16) + c10.a) & 0xff; + pc->a = (((t2 - t1) * ey) >> 16) + t1; + } + sdx += icos; + sdy += isin; + pc++; + } + pc = (tColorRGBA *) ((Uint8 *) pc + gap); + } + } else { + for (y = 0; y < dst->h; y++) { + dy = cy - y; + sdx = (ax + (isin * dy)) + xd; + sdy = (ay - (icos * dy)) + yd; + for (x = 0; x < dst->w; x++) { + dx = (short) (sdx >> 16); + dy = (short) (sdy >> 16); + if (flipx) dx = (src->w-1)-dx; + if (flipy) dy = (src->h-1)-dy; + if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { + sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy); + sp += dx; + *pc = *sp; + } + sdx += icos; + sdy += isin; + pc++; + } + pc = (tColorRGBA *) ((Uint8 *) pc + gap); + } + } +} + +/*! + +\brief Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing. + +Rotates and zooms 8 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control +parameters by scanning the destination surface. +Assumes src and dst surfaces are of 8 bit depth. +Assumes dst surface was allocated with the correct dimensions. + +\param src Source surface. +\param dst Destination surface. +\param cx Horizontal center coordinate. +\param cy Vertical center coordinate. +\param isin Integer version of sine of angle. +\param icos Integer version of cosine of angle. +\param flipx Flag indicating horizontal mirroring should be applied. +\param flipy Flag indicating vertical mirroring should be applied. +*/ +void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int isin, int icos, int flipx, int flipy) +{ + int x, y, dx, dy, xd, yd, sdx, sdy, ax, ay; + tColorY *pc, *sp; + int gap; + + /* + * Variable setup + */ + xd = ((src->w - dst->w) << 15); + yd = ((src->h - dst->h) << 15); + ax = (cx << 16) - (icos * cx); + ay = (cy << 16) - (isin * cx); + pc = (tColorY*) dst->pixels; + gap = dst->pitch - dst->w; + /* + * Clear surface to colorkey + */ + SDL_memset(pc, (int)(_colorkey(src) & 0xff), dst->pitch * dst->h); + /* + * Iterate through destination surface + */ + for (y = 0; y < dst->h; y++) { + dy = cy - y; + sdx = (ax + (isin * dy)) + xd; + sdy = (ay - (icos * dy)) + yd; + for (x = 0; x < dst->w; x++) { + dx = (short) (sdx >> 16); + dy = (short) (sdy >> 16); + if (flipx) dx = (src->w-1)-dx; + if (flipy) dy = (src->h-1)-dy; + if ((dx >= 0) && (dy >= 0) && (dx < src->w) && (dy < src->h)) { + sp = (tColorY *) (src->pixels); + sp += (src->pitch * dy + dx); + *pc = *sp; + } + sdx += icos; + sdy += isin; + pc++; + } + pc += gap; + } +} + + + + +/*! +\brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. + +Rotates a 32bit or 8bit 'src' surface to newly created 'dst' surface. +'angle' is the rotation in degrees, 'centerx' and 'centery' the rotation center. If 'smooth' is set +then the destination 32bit surface is anti-aliased. If the surface is not 8bit +or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly. + +\param src The surface to rotozoom. +\param angle The angle to rotate in degrees. +\param centerx The horizontal coordinate of the center of rotation +\param zoomy The vertical coordinate of the center of rotation +\param smooth Antialiasing flag; set to SMOOTHING_ON to enable. +\param flipx Set to 1 to flip the image horizontally +\param flipy Set to 1 to flip the image vertically +\param dstwidth The destination surface width +\param dstheight The destination surface height +\param cangle The angle cosine +\param sangle The angle sine +\return The new rotated surface. + +*/ + +SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle) +{ + SDL_Surface *rz_src; + SDL_Surface *rz_dst; + int is32bit; + int i, src_converted; + Uint8 r,g,b; + Uint32 colorkey = 0; + int colorKeyAvailable = 0; + double sangleinv, cangleinv; + + /* + * Sanity check + */ + if (src == NULL) + return (NULL); + + if (src->flags & SDL_TRUE/*SDL_SRCCOLORKEY*/) + { + colorkey = _colorkey(src); + SDL_GetRGB(colorkey, src->format, &r, &g, &b); + colorKeyAvailable = 1; + } + /* + * Determine if source surface is 32bit or 8bit + */ + is32bit = (src->format->BitsPerPixel == 32); + if ((is32bit) || (src->format->BitsPerPixel == 8)) { + /* + * Use source surface 'as is' + */ + rz_src = src; + src_converted = 0; + } else { + /* + * New source surface is 32bit with a defined RGBA ordering + */ + rz_src = + SDL_CreateRGBSurface(SDL_SWSURFACE, src->w, src->h, 32, +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 +#else + 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff +#endif + ); + if(colorKeyAvailable) + SDL_SetColorKey(src, 0, 0); + + SDL_BlitSurface(src, NULL, rz_src, NULL); + + if(colorKeyAvailable) + SDL_SetColorKey(src, SDL_TRUE /*SDL_SRCCOLORKEY*/, colorkey); + src_converted = 1; + is32bit = 1; + } + + + /* Determine target size */ + /*_rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, &dstwidth, &dstheight, &cangle, &sangle); */ + + /* + * Calculate target factors from sin/cos and zoom + */ + sangleinv = sangle*65536.0; + cangleinv = cangle*65536.0; + + /* + * Alloc space to completely contain the rotated surface + */ + rz_dst = NULL; + if (is32bit) { + /* + * Target surface is 32bit with source RGBA/ABGR ordering + */ + rz_dst = + SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 32, + rz_src->format->Rmask, rz_src->format->Gmask, + rz_src->format->Bmask, rz_src->format->Amask); + } else { + /* + * Target surface is 8bit + */ + rz_dst = SDL_CreateRGBSurface(SDL_SWSURFACE, dstwidth, dstheight + GUARD_ROWS, 8, 0, 0, 0, 0); + } + + /* Check target */ + if (rz_dst == NULL) + return NULL; + + /* Adjust for guard rows */ + rz_dst->h = dstheight; + + if (colorKeyAvailable == 1){ + colorkey = SDL_MapRGB(rz_dst->format, r, g, b); + + SDL_FillRect(rz_dst, NULL, colorkey ); + } + + /* + * Lock source surface + */ + if (SDL_MUSTLOCK(rz_src)) { + SDL_LockSurface(rz_src); + } + + /* + * Check which kind of surface we have + */ + if (is32bit) { + /* + * Call the 32bit transformation routine to do the rotation (using alpha) + */ + _transformSurfaceRGBA(rz_src, rz_dst, centerx, centery, + (int) (sangleinv), (int) (cangleinv), + flipx, flipy, + smooth); + /* + * Turn on source-alpha support + */ + /*SDL_SetAlpha(rz_dst, SDL_SRCALPHA, 255);*/ + SDL_SetColorKey(rz_dst, /*SDL_SRCCOLORKEY*/ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src)); + } else { + /* + * Copy palette and colorkey info + */ + for (i = 0; i < rz_src->format->palette->ncolors; i++) { + rz_dst->format->palette->colors[i] = rz_src->format->palette->colors[i]; + } + rz_dst->format->palette->ncolors = rz_src->format->palette->ncolors; + /* + * Call the 8bit transformation routine to do the rotation + */ + transformSurfaceY(rz_src, rz_dst, centerx, centery, + (int) (sangleinv), (int) (cangleinv), + flipx, flipy); + SDL_SetColorKey(rz_dst, /*SDL_SRCCOLORKEY*/ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src)); + } + /* + * Unlock source surface + */ + if (SDL_MUSTLOCK(rz_src)) { + SDL_UnlockSurface(rz_src); + } + + /* + * Cleanup temp surface + */ + if (src_converted) { + SDL_FreeSurface(rz_src); + } + + /* + * Return destination surface + */ + return (rz_dst); +} + diff --git a/src/render/software/SDL_rotate.h b/src/render/software/SDL_rotate.h new file mode 100644 index 0000000000..26bb8ad1c1 --- /dev/null +++ b/src/render/software/SDL_rotate.h @@ -0,0 +1,7 @@ +#ifndef MIN +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +extern SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle); +extern void _rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle); + diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index 30aba12fae..0cd4405491 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -1,247 +1,270 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #include "SDL_stdinc.h" -#ifndef HAVE_GETENV - -#if defined(__WIN32__) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) - -#define WIN32_LEAN_AND_MEAN -#include - +#if !defined(SDL_setenv) && defined(__WIN32__) +#include "../core/windows/SDL_windows.h" /* Note this isn't thread-safe! */ - -static char *SDL_envmem = NULL; /* Ugh, memory leak */ +static char *SDL_envmem = NULL; /* Ugh, memory leak */ static size_t SDL_envmemlen = 0; +#endif + -/* Put a variable of the form "name=value" into the environment */ -int SDL_putenv(const char *variable) +/* Put a variable into the environment */ +#if defined(HAVE_SETENV) +int +SDL_setenv(const char *name, const char *value, int overwrite) { - size_t bufferlen; - char *value; - const char *sep; - - sep = SDL_strchr(variable, '='); - if ( sep == NULL ) { - return -1; - } - bufferlen = SDL_strlen(variable)+1; - if ( bufferlen > SDL_envmemlen ) { - char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen); - if ( newmem == NULL ) { - return -1; - } - SDL_envmem = newmem; - SDL_envmemlen = bufferlen; - } - SDL_strlcpy(SDL_envmem, variable, bufferlen); - value = SDL_envmem + (sep - variable); - *value++ = '\0'; - if ( !SetEnvironmentVariable(SDL_envmem, *value ? value : NULL) ) { - return -1; - } - return 0; + return setenv(name, value, overwrite); } - -/* Retrieve a variable named "name" from the environment */ -char *SDL_getenv(const char *name) +#elif defined(__WIN32__) +int +SDL_setenv(const char *name, const char *value, int overwrite) { - size_t bufferlen; - - bufferlen = GetEnvironmentVariable(name, SDL_envmem, (DWORD)SDL_envmemlen); - if ( bufferlen == 0 ) { - return NULL; - } - if ( bufferlen > SDL_envmemlen ) { - char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen); - if ( newmem == NULL ) { - return NULL; - } - SDL_envmem = newmem; - SDL_envmemlen = bufferlen; - GetEnvironmentVariable(name, SDL_envmem, (DWORD)SDL_envmemlen); - } - return SDL_envmem; + if (!overwrite) { + char ch = 0; + const size_t len = GetEnvironmentVariableA(name, &ch, sizeof (ch)); + if (len > 0) { + return 0; /* asked not to overwrite existing value. */ + } + } + if (!SetEnvironmentVariableA(name, *value ? value : NULL)) { + return -1; + } + return 0; } +/* We have a real environment table, but no real setenv? Fake it w/ putenv. */ +#elif (defined(HAVE_GETENV) && defined(HAVE_PUTENV) && !defined(HAVE_SETENV)) +int +SDL_setenv(const char *name, const char *value, int overwrite) +{ + size_t len; + char *new_variable; -#else /* roll our own */ + if (getenv(name) != NULL) { + if (overwrite) { + unsetenv(name); + } else { + return 0; /* leave the existing one there. */ + } + } -static char **SDL_env = (char **)0; + /* This leaks. Sorry. Get a better OS so we don't have to do this. */ + len = SDL_strlen(name) + SDL_strlen(value) + 2; + new_variable = (char *) SDL_malloc(len); + if (!new_variable) { + return (-1); + } -/* Put a variable of the form "name=value" into the environment */ -int SDL_putenv(const char *variable) + SDL_snprintf(new_variable, len, "%s=%s", name, value); + return putenv(new_variable); +} +#else /* roll our own */ +static char **SDL_env = (char **) 0; +int +SDL_setenv(const char *name, const char *value, int overwrite) { - const char *name, *value; - int added; - int len, i; - char **new_env; - char *new_variable; - - /* A little error checking */ - if ( ! variable ) { - return(-1); - } - name = variable; - for ( value=variable; *value && (*value != '='); ++value ) { - /* Keep looking for '=' */ ; - } - if ( *value ) { - ++value; - } else { - return(-1); - } - - /* Allocate memory for the variable */ - new_variable = SDL_strdup(variable); - if ( ! new_variable ) { - return(-1); - } - - /* Actually put it into the environment */ - added = 0; - i = 0; - if ( SDL_env ) { - /* Check to see if it's already there... */ - len = (value - name); - for ( ; SDL_env[i]; ++i ) { - if ( SDL_strncmp(SDL_env[i], name, len) == 0 ) { - break; - } - } - /* If we found it, just replace the entry */ - if ( SDL_env[i] ) { - SDL_free(SDL_env[i]); - SDL_env[i] = new_variable; - added = 1; - } - } - - /* Didn't find it in the environment, expand and add */ - if ( ! added ) { - new_env = SDL_realloc(SDL_env, (i+2)*sizeof(char *)); - if ( new_env ) { - SDL_env = new_env; - SDL_env[i++] = new_variable; - SDL_env[i++] = (char *)0; - added = 1; - } else { - SDL_free(new_variable); - } - } - return (added ? 0 : -1); + int added; + int len, i; + char **new_env; + char *new_variable; + + /* A little error checking */ + if (!name || !value) { + return (-1); + } + + /* See if it already exists */ + if (!overwrite && SDL_getenv(name)) { + return 0; + } + + /* Allocate memory for the variable */ + len = SDL_strlen(name) + SDL_strlen(value) + 2; + new_variable = (char *) SDL_malloc(len); + if (!new_variable) { + return (-1); + } + + SDL_snprintf(new_variable, len, "%s=%s", name, value); + value = new_variable + SDL_strlen(name) + 1; + name = new_variable; + + /* Actually put it into the environment */ + added = 0; + i = 0; + if (SDL_env) { + /* Check to see if it's already there... */ + len = (value - name); + for (; SDL_env[i]; ++i) { + if (SDL_strncmp(SDL_env[i], name, len) == 0) { + break; + } + } + /* If we found it, just replace the entry */ + if (SDL_env[i]) { + SDL_free(SDL_env[i]); + SDL_env[i] = new_variable; + added = 1; + } + } + + /* Didn't find it in the environment, expand and add */ + if (!added) { + new_env = SDL_realloc(SDL_env, (i + 2) * sizeof(char *)); + if (new_env) { + SDL_env = new_env; + SDL_env[i++] = new_variable; + SDL_env[i++] = (char *) 0; + added = 1; + } else { + SDL_free(new_variable); + } + } + return (added ? 0 : -1); } +#endif /* Retrieve a variable named "name" from the environment */ -char *SDL_getenv(const char *name) +#if defined(HAVE_GETENV) +char * +SDL_getenv(const char *name) { - int len, i; - char *value; - - value = (char *)0; - if ( SDL_env ) { - len = SDL_strlen(name); - for ( i=0; SDL_env[i] && !value; ++i ) { - if ( (SDL_strncmp(SDL_env[i], name, len) == 0) && - (SDL_env[i][len] == '=') ) { - value = &SDL_env[i][len+1]; - } - } - } - return value; + return getenv(name); } +#elif defined(__WIN32__) +char * +SDL_getenv(const char *name) +{ + size_t bufferlen; + + bufferlen = + GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen); + if (bufferlen == 0) { + return NULL; + } + if (bufferlen > SDL_envmemlen) { + char *newmem = (char *) SDL_realloc(SDL_envmem, bufferlen); + if (newmem == NULL) { + return NULL; + } + SDL_envmem = newmem; + SDL_envmemlen = bufferlen; + GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen); + } + return SDL_envmem; +} +#else +char * +SDL_getenv(const char *name) +{ + int len, i; + char *value; -#endif /* __WIN32__ */ + value = (char *) 0; + if (SDL_env) { + len = SDL_strlen(name); + for (i = 0; SDL_env[i] && !value; ++i) { + if ((SDL_strncmp(SDL_env[i], name, len) == 0) && + (SDL_env[i][len] == '=')) { + value = &SDL_env[i][len + 1]; + } + } + } + return value; +} +#endif -#endif /* !HAVE_GETENV */ #ifdef TEST_MAIN #include -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { - char *value; - - printf("Checking for non-existent variable... "); - fflush(stdout); - if ( ! SDL_getenv("EXISTS") ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - printf("Setting FIRST=VALUE1 in the environment... "); - fflush(stdout); - if ( SDL_putenv("FIRST=VALUE1") == 0 ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - printf("Getting FIRST from the environment... "); - fflush(stdout); - value = SDL_getenv("FIRST"); - if ( value && (SDL_strcmp(value, "VALUE1") == 0) ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - printf("Setting SECOND=VALUE2 in the environment... "); - fflush(stdout); - if ( SDL_putenv("SECOND=VALUE2") == 0 ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - printf("Getting SECOND from the environment... "); - fflush(stdout); - value = SDL_getenv("SECOND"); - if ( value && (SDL_strcmp(value, "VALUE2") == 0) ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - printf("Setting FIRST=NOVALUE in the environment... "); - fflush(stdout); - if ( SDL_putenv("FIRST=NOVALUE") == 0 ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - printf("Getting FIRST from the environment... "); - fflush(stdout); - value = SDL_getenv("FIRST"); - if ( value && (SDL_strcmp(value, "NOVALUE") == 0) ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - printf("Checking for non-existent variable... "); - fflush(stdout); - if ( ! SDL_getenv("EXISTS") ) { - printf("okay\n"); - } else { - printf("failed\n"); - } - return(0); + char *value; + + printf("Checking for non-existent variable... "); + fflush(stdout); + if (!SDL_getenv("EXISTS")) { + printf("okay\n"); + } else { + printf("failed\n"); + } + printf("Setting FIRST=VALUE1 in the environment... "); + fflush(stdout); + if (SDL_setenv("FIRST", "VALUE1", 0) == 0) { + printf("okay\n"); + } else { + printf("failed\n"); + } + printf("Getting FIRST from the environment... "); + fflush(stdout); + value = SDL_getenv("FIRST"); + if (value && (SDL_strcmp(value, "VALUE1") == 0)) { + printf("okay\n"); + } else { + printf("failed\n"); + } + printf("Setting SECOND=VALUE2 in the environment... "); + fflush(stdout); + if (SDL_setenv("SECOND", "VALUE2", 0) == 0) { + printf("okay\n"); + } else { + printf("failed\n"); + } + printf("Getting SECOND from the environment... "); + fflush(stdout); + value = SDL_getenv("SECOND"); + if (value && (SDL_strcmp(value, "VALUE2") == 0)) { + printf("okay\n"); + } else { + printf("failed\n"); + } + printf("Setting FIRST=NOVALUE in the environment... "); + fflush(stdout); + if (SDL_setenv("FIRST", "NOVALUE", 1) == 0) { + printf("okay\n"); + } else { + printf("failed\n"); + } + printf("Getting FIRST from the environment... "); + fflush(stdout); + value = SDL_getenv("FIRST"); + if (value && (SDL_strcmp(value, "NOVALUE") == 0)) { + printf("okay\n"); + } else { + printf("failed\n"); + } + printf("Checking for non-existent variable... "); + fflush(stdout); + if (!SDL_getenv("EXISTS")) { + printf("okay\n"); + } else { + printf("failed\n"); + } + return (0); } #endif /* TEST_MAIN */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index fa56a99ec1..109e03ed66 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -32,36 +31,51 @@ iconv() may or may not use const char ** for the inbuf param. If we get this wrong, it's just a warning, so no big deal. */ -#if defined(_XGP6) || \ - defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) +#if defined(_XGP6) || defined(__APPLE__) || \ + (defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))) #define ICONV_INBUF_NONCONST #endif #include -size_t SDL_iconv(SDL_iconv_t cd, - const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft) +SDL_COMPILE_TIME_ASSERT(iconv_t, sizeof (iconv_t) <= sizeof (SDL_iconv_t)); + +SDL_iconv_t +SDL_iconv_open(const char *tocode, const char *fromcode) +{ + return (SDL_iconv_t) ((size_t) iconv_open(tocode, fromcode)); +} + +int +SDL_iconv_close(SDL_iconv_t cd) +{ + return iconv_close((iconv_t) ((size_t) cd)); +} + +size_t +SDL_iconv(SDL_iconv_t cd, + const char **inbuf, size_t * inbytesleft, + char **outbuf, size_t * outbytesleft) { - size_t retCode; + size_t retCode; #ifdef ICONV_INBUF_NONCONST - retCode = iconv(cd, (char **)inbuf, inbytesleft, outbuf, outbytesleft); + retCode = iconv((iconv_t) ((size_t) cd), (char **) inbuf, inbytesleft, outbuf, outbytesleft); #else - retCode = iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft); + retCode = iconv((iconv_t) ((size_t) cd), inbuf, inbytesleft, outbuf, outbytesleft); #endif - if ( retCode == (size_t)-1 ) { - switch(errno) { - case E2BIG: - return SDL_ICONV_E2BIG; - case EILSEQ: - return SDL_ICONV_EILSEQ; - case EINVAL: - return SDL_ICONV_EINVAL; - default: - return SDL_ICONV_ERROR; - } - } - return retCode; + if (retCode == (size_t) - 1) { + switch (errno) { + case E2BIG: + return SDL_ICONV_E2BIG; + case EILSEQ: + return SDL_ICONV_EILSEQ; + case EINVAL: + return SDL_ICONV_EINVAL; + default: + return SDL_ICONV_ERROR; + } + } + return retCode; } #else @@ -75,807 +89,836 @@ size_t SDL_iconv(SDL_iconv_t cd, #define UNKNOWN_ASCII '?' #define UNKNOWN_UNICODE 0xFFFD -enum { - ENCODING_UNKNOWN, - ENCODING_ASCII, - ENCODING_LATIN1, - ENCODING_UTF8, - ENCODING_UTF16, /* Needs byte order marker */ - ENCODING_UTF16BE, - ENCODING_UTF16LE, - ENCODING_UTF32, /* Needs byte order marker */ - ENCODING_UTF32BE, - ENCODING_UTF32LE, - ENCODING_UCS2, /* Native byte order assumed */ - ENCODING_UCS4, /* Native byte order assumed */ +enum +{ + ENCODING_UNKNOWN, + ENCODING_ASCII, + ENCODING_LATIN1, + ENCODING_UTF8, + ENCODING_UTF16, /* Needs byte order marker */ + ENCODING_UTF16BE, + ENCODING_UTF16LE, + ENCODING_UTF32, /* Needs byte order marker */ + ENCODING_UTF32BE, + ENCODING_UTF32LE, + ENCODING_UCS2BE, + ENCODING_UCS2LE, + ENCODING_UCS4BE, + ENCODING_UCS4LE, }; #if SDL_BYTEORDER == SDL_BIG_ENDIAN #define ENCODING_UTF16NATIVE ENCODING_UTF16BE #define ENCODING_UTF32NATIVE ENCODING_UTF32BE +#define ENCODING_UCS2NATIVE ENCODING_UCS2BE +#define ENCODING_UCS4NATIVE ENCODING_UCS4BE #else #define ENCODING_UTF16NATIVE ENCODING_UTF16LE #define ENCODING_UTF32NATIVE ENCODING_UTF32LE +#define ENCODING_UCS2NATIVE ENCODING_UCS2LE +#define ENCODING_UCS4NATIVE ENCODING_UCS4LE #endif struct _SDL_iconv_t { - int src_fmt; - int dst_fmt; + int src_fmt; + int dst_fmt; }; -static struct { - const char *name; - int format; +static struct +{ + const char *name; + int format; } encodings[] = { - { "ASCII", ENCODING_ASCII }, - { "US-ASCII", ENCODING_ASCII }, - { "8859-1", ENCODING_LATIN1 }, - { "ISO-8859-1", ENCODING_LATIN1 }, - { "UTF8", ENCODING_UTF8 }, - { "UTF-8", ENCODING_UTF8 }, - { "UTF16", ENCODING_UTF16 }, - { "UTF-16", ENCODING_UTF16 }, - { "UTF16BE", ENCODING_UTF16BE }, - { "UTF-16BE", ENCODING_UTF16BE }, - { "UTF16LE", ENCODING_UTF16LE }, - { "UTF-16LE", ENCODING_UTF16LE }, - { "UTF32", ENCODING_UTF32 }, - { "UTF-32", ENCODING_UTF32 }, - { "UTF32BE", ENCODING_UTF32BE }, - { "UTF-32BE", ENCODING_UTF32BE }, - { "UTF32LE", ENCODING_UTF32LE }, - { "UTF-32LE", ENCODING_UTF32LE }, - { "UCS2", ENCODING_UCS2 }, - { "UCS-2", ENCODING_UCS2 }, - { "UCS4", ENCODING_UCS4 }, - { "UCS-4", ENCODING_UCS4 }, +/* *INDENT-OFF* */ + { "ASCII", ENCODING_ASCII }, + { "US-ASCII", ENCODING_ASCII }, + { "8859-1", ENCODING_LATIN1 }, + { "ISO-8859-1", ENCODING_LATIN1 }, + { "UTF8", ENCODING_UTF8 }, + { "UTF-8", ENCODING_UTF8 }, + { "UTF16", ENCODING_UTF16 }, + { "UTF-16", ENCODING_UTF16 }, + { "UTF16BE", ENCODING_UTF16BE }, + { "UTF-16BE", ENCODING_UTF16BE }, + { "UTF16LE", ENCODING_UTF16LE }, + { "UTF-16LE", ENCODING_UTF16LE }, + { "UTF32", ENCODING_UTF32 }, + { "UTF-32", ENCODING_UTF32 }, + { "UTF32BE", ENCODING_UTF32BE }, + { "UTF-32BE", ENCODING_UTF32BE }, + { "UTF32LE", ENCODING_UTF32LE }, + { "UTF-32LE", ENCODING_UTF32LE }, + { "UCS2", ENCODING_UCS2BE }, + { "UCS-2", ENCODING_UCS2BE }, + { "UCS-2LE", ENCODING_UCS2LE }, + { "UCS-2BE", ENCODING_UCS2BE }, + { "UCS-2-INTERNAL", ENCODING_UCS2NATIVE }, + { "UCS4", ENCODING_UCS4BE }, + { "UCS-4", ENCODING_UCS4BE }, + { "UCS-4LE", ENCODING_UCS4LE }, + { "UCS-4BE", ENCODING_UCS4BE }, + { "UCS-4-INTERNAL", ENCODING_UCS4NATIVE }, +/* *INDENT-ON* */ }; -static const char *getlocale(char *buffer, size_t bufsize) +static const char * +getlocale(char *buffer, size_t bufsize) { - const char *lang; - char *ptr; - - lang = SDL_getenv("LC_ALL"); - if ( !lang ) { - lang = SDL_getenv("LC_CTYPE"); - } - if ( !lang ) { - lang = SDL_getenv("LC_MESSAGES"); - } - if ( !lang ) { - lang = SDL_getenv("LANG"); - } - if ( !lang || !*lang || SDL_strcmp(lang, "C") == 0 ) { - lang = "ASCII"; - } - - /* We need to trim down strings like "en_US.UTF-8@blah" to "UTF-8" */ - ptr = SDL_strchr(lang, '.'); - if (ptr != NULL) { - lang = ptr + 1; - } - - SDL_strlcpy(buffer, lang, bufsize); - ptr = SDL_strchr(buffer, '@'); - if (ptr != NULL) { - *ptr = '\0'; /* chop end of string. */ - } - - return buffer; + const char *lang; + char *ptr; + + lang = SDL_getenv("LC_ALL"); + if (!lang) { + lang = SDL_getenv("LC_CTYPE"); + } + if (!lang) { + lang = SDL_getenv("LC_MESSAGES"); + } + if (!lang) { + lang = SDL_getenv("LANG"); + } + if (!lang || !*lang || SDL_strcmp(lang, "C") == 0) { + lang = "ASCII"; + } + + /* We need to trim down strings like "en_US.UTF-8@blah" to "UTF-8" */ + ptr = SDL_strchr(lang, '.'); + if (ptr != NULL) { + lang = ptr + 1; + } + + SDL_strlcpy(buffer, lang, bufsize); + ptr = SDL_strchr(buffer, '@'); + if (ptr != NULL) { + *ptr = '\0'; /* chop end of string. */ + } + + return buffer; } -SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) +SDL_iconv_t +SDL_iconv_open(const char *tocode, const char *fromcode) { - int src_fmt = ENCODING_UNKNOWN; - int dst_fmt = ENCODING_UNKNOWN; - int i; - char fromcode_buffer[64]; - char tocode_buffer[64]; - - if ( !fromcode || !*fromcode ) { - fromcode = getlocale(fromcode_buffer, sizeof(fromcode_buffer)); - } - if ( !tocode || !*tocode ) { - tocode = getlocale(tocode_buffer, sizeof(tocode_buffer)); - } - for ( i = 0; i < SDL_arraysize(encodings); ++i ) { - if ( SDL_strcasecmp(fromcode, encodings[i].name) == 0 ) { - src_fmt = encodings[i].format; - if ( dst_fmt != ENCODING_UNKNOWN ) { - break; - } - } - if ( SDL_strcasecmp(tocode, encodings[i].name) == 0 ) { - dst_fmt = encodings[i].format; - if ( src_fmt != ENCODING_UNKNOWN ) { - break; - } - } - } - if ( src_fmt != ENCODING_UNKNOWN && dst_fmt != ENCODING_UNKNOWN ) { - SDL_iconv_t cd = (SDL_iconv_t)SDL_malloc(sizeof(*cd)); - if ( cd ) { - cd->src_fmt = src_fmt; - cd->dst_fmt = dst_fmt; - return cd; - } - } - return (SDL_iconv_t)-1; + int src_fmt = ENCODING_UNKNOWN; + int dst_fmt = ENCODING_UNKNOWN; + int i; + char fromcode_buffer[64]; + char tocode_buffer[64]; + + if (!fromcode || !*fromcode) { + fromcode = getlocale(fromcode_buffer, sizeof(fromcode_buffer)); + } + if (!tocode || !*tocode) { + tocode = getlocale(tocode_buffer, sizeof(tocode_buffer)); + } + for (i = 0; i < SDL_arraysize(encodings); ++i) { + if (SDL_strcasecmp(fromcode, encodings[i].name) == 0) { + src_fmt = encodings[i].format; + if (dst_fmt != ENCODING_UNKNOWN) { + break; + } + } + if (SDL_strcasecmp(tocode, encodings[i].name) == 0) { + dst_fmt = encodings[i].format; + if (src_fmt != ENCODING_UNKNOWN) { + break; + } + } + } + if (src_fmt != ENCODING_UNKNOWN && dst_fmt != ENCODING_UNKNOWN) { + SDL_iconv_t cd = (SDL_iconv_t) SDL_malloc(sizeof(*cd)); + if (cd) { + cd->src_fmt = src_fmt; + cd->dst_fmt = dst_fmt; + return cd; + } + } + return (SDL_iconv_t) - 1; } -size_t SDL_iconv(SDL_iconv_t cd, - const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft) +size_t +SDL_iconv(SDL_iconv_t cd, + const char **inbuf, size_t * inbytesleft, + char **outbuf, size_t * outbytesleft) { - /* For simplicity, we'll convert everything to and from UCS-4 */ - const char *src; - char *dst; - size_t srclen, dstlen; - Uint32 ch = 0; - size_t total; - - if ( !inbuf || !*inbuf ) { - /* Reset the context */ - return 0; - } - if ( !outbuf || !*outbuf || !outbytesleft || !*outbytesleft ) { - return SDL_ICONV_E2BIG; - } - src = *inbuf; - srclen = (inbytesleft ? *inbytesleft : 0); - dst = *outbuf; - dstlen = *outbytesleft; - - switch ( cd->src_fmt ) { - case ENCODING_UTF16: - /* Scan for a byte order marker */ - { - Uint8 *p = (Uint8 *)src; - size_t n = srclen / 2; - while ( n ) { - if ( p[0] == 0xFF && p[1] == 0xFE ) { - cd->src_fmt = ENCODING_UTF16BE; - break; - } else if ( p[0] == 0xFE && p[1] == 0xFF ) { - cd->src_fmt = ENCODING_UTF16LE; - break; - } - p += 2; - --n; - } - if ( n == 0 ) { - /* We can't tell, default to host order */ - cd->src_fmt = ENCODING_UTF16NATIVE; - } - } - break; - case ENCODING_UTF32: - /* Scan for a byte order marker */ - { - Uint8 *p = (Uint8 *)src; - size_t n = srclen / 4; - while ( n ) { - if ( p[0] == 0xFF && p[1] == 0xFE && - p[2] == 0x00 && p[3] == 0x00 ) { - cd->src_fmt = ENCODING_UTF32BE; - break; - } else if ( p[0] == 0x00 && p[1] == 0x00 && - p[2] == 0xFE && p[3] == 0xFF ) { - cd->src_fmt = ENCODING_UTF32LE; - break; - } - p += 4; - --n; - } - if ( n == 0 ) { - /* We can't tell, default to host order */ - cd->src_fmt = ENCODING_UTF32NATIVE; - } - } - break; - } - - switch ( cd->dst_fmt ) { - case ENCODING_UTF16: - /* Default to host order, need to add byte order marker */ - if ( dstlen < 2 ) { - return SDL_ICONV_E2BIG; - } - *(Uint16 *)dst = UNICODE_BOM; - dst += 2; - dstlen -= 2; - cd->dst_fmt = ENCODING_UTF16NATIVE; - break; - case ENCODING_UTF32: - /* Default to host order, need to add byte order marker */ - if ( dstlen < 4 ) { - return SDL_ICONV_E2BIG; - } - *(Uint32 *)dst = UNICODE_BOM; - dst += 4; - dstlen -= 4; - cd->dst_fmt = ENCODING_UTF32NATIVE; - break; - } - - total = 0; - while ( srclen > 0 ) { - /* Decode a character */ - switch ( cd->src_fmt ) { - case ENCODING_ASCII: - { - Uint8 *p = (Uint8 *)src; - ch = (Uint32)(p[0] & 0x7F); - ++src; - --srclen; - } - break; - case ENCODING_LATIN1: - { - Uint8 *p = (Uint8 *)src; - ch = (Uint32)p[0]; - ++src; - --srclen; - } - break; - case ENCODING_UTF8: /* RFC 3629 */ - { - Uint8 *p = (Uint8 *)src; - size_t left = 0; - SDL_bool overlong = SDL_FALSE; - if ( p[0] >= 0xFC ) { - if ( (p[0] & 0xFE) != 0xFC ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if ( p[0] == 0xFC ) { - overlong = SDL_TRUE; - } - ch = (Uint32)(p[0] & 0x01); - left = 5; - } - } else if ( p[0] >= 0xF8 ) { - if ( (p[0] & 0xFC) != 0xF8 ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if ( p[0] == 0xF8 ) { - overlong = SDL_TRUE; - } - ch = (Uint32)(p[0] & 0x03); - left = 4; - } - } else if ( p[0] >= 0xF0 ) { - if ( (p[0] & 0xF8) != 0xF0 ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if ( p[0] == 0xF0 ) { - overlong = SDL_TRUE; - } - ch = (Uint32)(p[0] & 0x07); - left = 3; - } - } else if ( p[0] >= 0xE0 ) { - if ( (p[0] & 0xF0) != 0xE0 ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if ( p[0] == 0xE0 ) { - overlong = SDL_TRUE; - } - ch = (Uint32)(p[0] & 0x0F); - left = 2; - } - } else if ( p[0] >= 0xC0 ) { - if ( (p[0] & 0xE0) != 0xC0 ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if ( (p[0] & 0xDE) == 0xC0 ) { - overlong = SDL_TRUE; - } - ch = (Uint32)(p[0] & 0x1F); - left = 1; - } - } else { - if ( (p[0] & 0x80) != 0x00 ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - ch = (Uint32)p[0]; - } - } - ++src; - --srclen; - if ( srclen < left ) { - return SDL_ICONV_EINVAL; - } - while ( left-- ) { - ++p; - if ( (p[0] & 0xC0) != 0x80 ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - break; - } - ch <<= 6; - ch |= (p[0] & 0x3F); - ++src; - --srclen; - } - if ( overlong ) { - /* Potential security risk - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } - if ( (ch >= 0xD800 && ch <= 0xDFFF) || - (ch == 0xFFFE || ch == 0xFFFF) || - ch > 0x10FFFF ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } - } - break; - case ENCODING_UTF16BE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *)src; - Uint16 W1, W2; - if ( srclen < 2 ) { - return SDL_ICONV_EINVAL; - } - W1 = ((Uint16)p[0] << 8) | - (Uint16)p[1]; - src += 2; - srclen -= 2; - if ( W1 < 0xD800 || W1 > 0xDFFF ) { - ch = (Uint32)W1; - break; - } - if ( W1 > 0xDBFF ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - break; - } - if ( srclen < 2 ) { - return SDL_ICONV_EINVAL; - } - p = (Uint8 *)src; - W2 = ((Uint16)p[0] << 8) | - (Uint16)p[1]; - src += 2; - srclen -= 2; - if ( W2 < 0xDC00 || W2 > 0xDFFF ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - break; - } - ch = (((Uint32)(W1 & 0x3FF) << 10) | - (Uint32)(W2 & 0x3FF)) + 0x10000; - } - break; - case ENCODING_UTF16LE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *)src; - Uint16 W1, W2; - if ( srclen < 2 ) { - return SDL_ICONV_EINVAL; - } - W1 = ((Uint16)p[1] << 8) | - (Uint16)p[0]; - src += 2; - srclen -= 2; - if ( W1 < 0xD800 || W1 > 0xDFFF ) { - ch = (Uint32)W1; - break; - } - if ( W1 > 0xDBFF ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - break; - } - if ( srclen < 2 ) { - return SDL_ICONV_EINVAL; - } - p = (Uint8 *)src; - W2 = ((Uint16)p[1] << 8) | - (Uint16)p[0]; - src += 2; - srclen -= 2; - if ( W2 < 0xDC00 || W2 > 0xDFFF ) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - break; - } - ch = (((Uint32)(W1 & 0x3FF) << 10) | - (Uint32)(W2 & 0x3FF)) + 0x10000; - } - break; - case ENCODING_UTF32BE: - { - Uint8 *p = (Uint8 *)src; - if ( srclen < 4 ) { - return SDL_ICONV_EINVAL; - } - ch = ((Uint32)p[0] << 24) | - ((Uint32)p[1] << 16) | - ((Uint32)p[2] << 8) | - (Uint32)p[3]; - src += 4; - srclen -= 4; - } - break; - case ENCODING_UTF32LE: - { - Uint8 *p = (Uint8 *)src; - if ( srclen < 4 ) { - return SDL_ICONV_EINVAL; - } - ch = ((Uint32)p[3] << 24) | - ((Uint32)p[2] << 16) | - ((Uint32)p[1] << 8) | - (Uint32)p[0]; - src += 4; - srclen -= 4; - } - break; - case ENCODING_UCS2: - { - Uint16 *p = (Uint16 *)src; - if ( srclen < 2 ) { - return SDL_ICONV_EINVAL; - } - ch = *p; - src += 2; - srclen -= 2; - } - break; - case ENCODING_UCS4: - { - Uint32 *p = (Uint32 *)src; - if ( srclen < 4 ) { - return SDL_ICONV_EINVAL; - } - ch = *p; - src += 4; - srclen -= 4; - } - break; - } - - /* Encode a character */ - switch ( cd->dst_fmt ) { - case ENCODING_ASCII: - { - Uint8 *p = (Uint8 *)dst; - if ( dstlen < 1 ) { - return SDL_ICONV_E2BIG; - } - if ( ch > 0x7F ) { - *p = UNKNOWN_ASCII; - } else { - *p = (Uint8)ch; - } - ++dst; - --dstlen; - } - break; - case ENCODING_LATIN1: - { - Uint8 *p = (Uint8 *)dst; - if ( dstlen < 1 ) { - return SDL_ICONV_E2BIG; - } - if ( ch > 0xFF ) { - *p = UNKNOWN_ASCII; - } else { - *p = (Uint8)ch; - } - ++dst; - --dstlen; - } - break; - case ENCODING_UTF8: /* RFC 3629 */ - { - Uint8 *p = (Uint8 *)dst; - if ( ch > 0x10FFFF ) { - ch = UNKNOWN_UNICODE; - } - if ( ch <= 0x7F ) { - if ( dstlen < 1 ) { - return SDL_ICONV_E2BIG; - } - *p = (Uint8)ch; - ++dst; - --dstlen; - } else if ( ch <= 0x7FF ) { - if ( dstlen < 2 ) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F); - p[1] = 0x80 | (Uint8)(ch & 0x3F); - dst += 2; - dstlen -= 2; - } else if ( ch <= 0xFFFF ) { - if ( dstlen < 3 ) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F); - p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F); - p[2] = 0x80 | (Uint8)(ch & 0x3F); - dst += 3; - dstlen -= 3; - } else if ( ch <= 0x1FFFFF ) { - if ( dstlen < 4 ) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xF0 | (Uint8)((ch >> 18) & 0x07); - p[1] = 0x80 | (Uint8)((ch >> 12) & 0x3F); - p[2] = 0x80 | (Uint8)((ch >> 6) & 0x3F); - p[3] = 0x80 | (Uint8)(ch & 0x3F); - dst += 4; - dstlen -= 4; - } else if ( ch <= 0x3FFFFFF ) { - if ( dstlen < 5 ) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xF8 | (Uint8)((ch >> 24) & 0x03); - p[1] = 0x80 | (Uint8)((ch >> 18) & 0x3F); - p[2] = 0x80 | (Uint8)((ch >> 12) & 0x3F); - p[3] = 0x80 | (Uint8)((ch >> 6) & 0x3F); - p[4] = 0x80 | (Uint8)(ch & 0x3F); - dst += 5; - dstlen -= 5; - } else { - if ( dstlen < 6 ) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xFC | (Uint8)((ch >> 30) & 0x01); - p[1] = 0x80 | (Uint8)((ch >> 24) & 0x3F); - p[2] = 0x80 | (Uint8)((ch >> 18) & 0x3F); - p[3] = 0x80 | (Uint8)((ch >> 12) & 0x3F); - p[4] = 0x80 | (Uint8)((ch >> 6) & 0x3F); - p[5] = 0x80 | (Uint8)(ch & 0x3F); - dst += 6; - dstlen -= 6; - } - } - break; - case ENCODING_UTF16BE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *)dst; - if ( ch > 0x10FFFF ) { - ch = UNKNOWN_UNICODE; - } - if ( ch < 0x10000 ) { - if ( dstlen < 2 ) { - return SDL_ICONV_E2BIG; - } - p[0] = (Uint8)(ch >> 8); - p[1] = (Uint8)ch; - dst += 2; - dstlen -= 2; - } else { - Uint16 W1, W2; - if ( dstlen < 4 ) { - return SDL_ICONV_E2BIG; - } - ch = ch - 0x10000; - W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF); - W2 = 0xDC00 | (Uint16)(ch & 0x3FF); - p[0] = (Uint8)(W1 >> 8); - p[1] = (Uint8)W1; - p[2] = (Uint8)(W2 >> 8); - p[3] = (Uint8)W2; - dst += 4; - dstlen -= 4; - } - } - break; - case ENCODING_UTF16LE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *)dst; - if ( ch > 0x10FFFF ) { - ch = UNKNOWN_UNICODE; - } - if ( ch < 0x10000 ) { - if ( dstlen < 2 ) { - return SDL_ICONV_E2BIG; - } - p[1] = (Uint8)(ch >> 8); - p[0] = (Uint8)ch; - dst += 2; - dstlen -= 2; - } else { - Uint16 W1, W2; - if ( dstlen < 4 ) { - return SDL_ICONV_E2BIG; - } - ch = ch - 0x10000; - W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF); - W2 = 0xDC00 | (Uint16)(ch & 0x3FF); - p[1] = (Uint8)(W1 >> 8); - p[0] = (Uint8)W1; - p[3] = (Uint8)(W2 >> 8); - p[2] = (Uint8)W2; - dst += 4; - dstlen -= 4; - } - } - break; - case ENCODING_UTF32BE: - { - Uint8 *p = (Uint8 *)dst; - if ( ch > 0x10FFFF ) { - ch = UNKNOWN_UNICODE; - } - if ( dstlen < 4 ) { - return SDL_ICONV_E2BIG; - } - p[0] = (Uint8)(ch >> 24); - p[1] = (Uint8)(ch >> 16); - p[2] = (Uint8)(ch >> 8); - p[3] = (Uint8)ch; - dst += 4; - dstlen -= 4; - } - break; - case ENCODING_UTF32LE: - { - Uint8 *p = (Uint8 *)dst; - if ( ch > 0x10FFFF ) { - ch = UNKNOWN_UNICODE; - } - if ( dstlen < 4 ) { - return SDL_ICONV_E2BIG; - } - p[3] = (Uint8)(ch >> 24); - p[2] = (Uint8)(ch >> 16); - p[1] = (Uint8)(ch >> 8); - p[0] = (Uint8)ch; - dst += 4; - dstlen -= 4; - } - break; - case ENCODING_UCS2: - { - Uint16 *p = (Uint16 *)dst; - if ( ch > 0xFFFF ) { - ch = UNKNOWN_UNICODE; - } - if ( dstlen < 2 ) { - return SDL_ICONV_E2BIG; - } - *p = (Uint16)ch; - dst += 2; - dstlen -= 2; - } - break; - case ENCODING_UCS4: - { - Uint32 *p = (Uint32 *)dst; - if ( ch > 0x7FFFFFFF ) { - ch = UNKNOWN_UNICODE; - } - if ( dstlen < 4 ) { - return SDL_ICONV_E2BIG; - } - *p = ch; - dst += 4; - dstlen -= 4; - } - break; - } - - /* Update state */ - *inbuf = src; - *inbytesleft = srclen; - *outbuf = dst; - *outbytesleft = dstlen; - ++total; - } - return total; + /* For simplicity, we'll convert everything to and from UCS-4 */ + const char *src; + char *dst; + size_t srclen, dstlen; + Uint32 ch = 0; + size_t total; + + if (!inbuf || !*inbuf) { + /* Reset the context */ + return 0; + } + if (!outbuf || !*outbuf || !outbytesleft || !*outbytesleft) { + return SDL_ICONV_E2BIG; + } + src = *inbuf; + srclen = (inbytesleft ? *inbytesleft : 0); + dst = *outbuf; + dstlen = *outbytesleft; + + switch (cd->src_fmt) { + case ENCODING_UTF16: + /* Scan for a byte order marker */ + { + Uint8 *p = (Uint8 *) src; + size_t n = srclen / 2; + while (n) { + if (p[0] == 0xFF && p[1] == 0xFE) { + cd->src_fmt = ENCODING_UTF16BE; + break; + } else if (p[0] == 0xFE && p[1] == 0xFF) { + cd->src_fmt = ENCODING_UTF16LE; + break; + } + p += 2; + --n; + } + if (n == 0) { + /* We can't tell, default to host order */ + cd->src_fmt = ENCODING_UTF16NATIVE; + } + } + break; + case ENCODING_UTF32: + /* Scan for a byte order marker */ + { + Uint8 *p = (Uint8 *) src; + size_t n = srclen / 4; + while (n) { + if (p[0] == 0xFF && p[1] == 0xFE && + p[2] == 0x00 && p[3] == 0x00) { + cd->src_fmt = ENCODING_UTF32BE; + break; + } else if (p[0] == 0x00 && p[1] == 0x00 && + p[2] == 0xFE && p[3] == 0xFF) { + cd->src_fmt = ENCODING_UTF32LE; + break; + } + p += 4; + --n; + } + if (n == 0) { + /* We can't tell, default to host order */ + cd->src_fmt = ENCODING_UTF32NATIVE; + } + } + break; + } + + switch (cd->dst_fmt) { + case ENCODING_UTF16: + /* Default to host order, need to add byte order marker */ + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + *(Uint16 *) dst = UNICODE_BOM; + dst += 2; + dstlen -= 2; + cd->dst_fmt = ENCODING_UTF16NATIVE; + break; + case ENCODING_UTF32: + /* Default to host order, need to add byte order marker */ + if (dstlen < 4) { + return SDL_ICONV_E2BIG; + } + *(Uint32 *) dst = UNICODE_BOM; + dst += 4; + dstlen -= 4; + cd->dst_fmt = ENCODING_UTF32NATIVE; + break; + } + + total = 0; + while (srclen > 0) { + /* Decode a character */ + switch (cd->src_fmt) { + case ENCODING_ASCII: + { + Uint8 *p = (Uint8 *) src; + ch = (Uint32) (p[0] & 0x7F); + ++src; + --srclen; + } + break; + case ENCODING_LATIN1: + { + Uint8 *p = (Uint8 *) src; + ch = (Uint32) p[0]; + ++src; + --srclen; + } + break; + case ENCODING_UTF8: /* RFC 3629 */ + { + Uint8 *p = (Uint8 *) src; + size_t left = 0; + SDL_bool overlong = SDL_FALSE; + if (p[0] >= 0xFC) { + if ((p[0] & 0xFE) != 0xFC) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } else { + if (p[0] == 0xFC && srclen > 1 && (p[1] & 0xFC) == 0x80) { + overlong = SDL_TRUE; + } + ch = (Uint32) (p[0] & 0x01); + left = 5; + } + } else if (p[0] >= 0xF8) { + if ((p[0] & 0xFC) != 0xF8) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } else { + if (p[0] == 0xF8 && srclen > 1 && (p[1] & 0xF8) == 0x80) { + overlong = SDL_TRUE; + } + ch = (Uint32) (p[0] & 0x03); + left = 4; + } + } else if (p[0] >= 0xF0) { + if ((p[0] & 0xF8) != 0xF0) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } else { + if (p[0] == 0xF0 && srclen > 1 && (p[1] & 0xF0) == 0x80) { + overlong = SDL_TRUE; + } + ch = (Uint32) (p[0] & 0x07); + left = 3; + } + } else if (p[0] >= 0xE0) { + if ((p[0] & 0xF0) != 0xE0) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } else { + if (p[0] == 0xE0 && srclen > 1 && (p[1] & 0xE0) == 0x80) { + overlong = SDL_TRUE; + } + ch = (Uint32) (p[0] & 0x0F); + left = 2; + } + } else if (p[0] >= 0xC0) { + if ((p[0] & 0xE0) != 0xC0) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } else { + if ((p[0] & 0xDE) == 0xC0) { + overlong = SDL_TRUE; + } + ch = (Uint32) (p[0] & 0x1F); + left = 1; + } + } else { + if ((p[0] & 0x80) != 0x00) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } else { + ch = (Uint32) p[0]; + } + } + ++src; + --srclen; + if (srclen < left) { + return SDL_ICONV_EINVAL; + } + while (left--) { + ++p; + if ((p[0] & 0xC0) != 0x80) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + ch <<= 6; + ch |= (p[0] & 0x3F); + ++src; + --srclen; + } + if (overlong) { + /* Potential security risk + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } + if ((ch >= 0xD800 && ch <= 0xDFFF) || + (ch == 0xFFFE || ch == 0xFFFF) || ch > 0x10FFFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } + } + break; + case ENCODING_UTF16BE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *) src; + Uint16 W1, W2; + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + W1 = ((Uint16) p[0] << 8) | (Uint16) p[1]; + src += 2; + srclen -= 2; + if (W1 < 0xD800 || W1 > 0xDFFF) { + ch = (Uint32) W1; + break; + } + if (W1 > 0xDBFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + p = (Uint8 *) src; + W2 = ((Uint16) p[0] << 8) | (Uint16) p[1]; + src += 2; + srclen -= 2; + if (W2 < 0xDC00 || W2 > 0xDFFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + ch = (((Uint32) (W1 & 0x3FF) << 10) | + (Uint32) (W2 & 0x3FF)) + 0x10000; + } + break; + case ENCODING_UTF16LE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *) src; + Uint16 W1, W2; + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + W1 = ((Uint16) p[1] << 8) | (Uint16) p[0]; + src += 2; + srclen -= 2; + if (W1 < 0xD800 || W1 > 0xDFFF) { + ch = (Uint32) W1; + break; + } + if (W1 > 0xDBFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + p = (Uint8 *) src; + W2 = ((Uint16) p[1] << 8) | (Uint16) p[0]; + src += 2; + srclen -= 2; + if (W2 < 0xDC00 || W2 > 0xDFFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + ch = (((Uint32) (W1 & 0x3FF) << 10) | + (Uint32) (W2 & 0x3FF)) + 0x10000; + } + break; + case ENCODING_UCS2LE: + { + Uint8 *p = (Uint8 *) src; + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + ch = ((Uint32) p[1] << 8) | (Uint32) p[0]; + src += 2; + srclen -= 2; + } + break; + case ENCODING_UCS2BE: + { + Uint8 *p = (Uint8 *) src; + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + ch = ((Uint32) p[0] << 8) | (Uint32) p[1]; + src += 2; + srclen -= 2; + } + break; + case ENCODING_UCS4BE: + case ENCODING_UTF32BE: + { + Uint8 *p = (Uint8 *) src; + if (srclen < 4) { + return SDL_ICONV_EINVAL; + } + ch = ((Uint32) p[0] << 24) | + ((Uint32) p[1] << 16) | + ((Uint32) p[2] << 8) | (Uint32) p[3]; + src += 4; + srclen -= 4; + } + break; + case ENCODING_UCS4LE: + case ENCODING_UTF32LE: + { + Uint8 *p = (Uint8 *) src; + if (srclen < 4) { + return SDL_ICONV_EINVAL; + } + ch = ((Uint32) p[3] << 24) | + ((Uint32) p[2] << 16) | + ((Uint32) p[1] << 8) | (Uint32) p[0]; + src += 4; + srclen -= 4; + } + break; + } + + /* Encode a character */ + switch (cd->dst_fmt) { + case ENCODING_ASCII: + { + Uint8 *p = (Uint8 *) dst; + if (dstlen < 1) { + return SDL_ICONV_E2BIG; + } + if (ch > 0x7F) { + *p = UNKNOWN_ASCII; + } else { + *p = (Uint8) ch; + } + ++dst; + --dstlen; + } + break; + case ENCODING_LATIN1: + { + Uint8 *p = (Uint8 *) dst; + if (dstlen < 1) { + return SDL_ICONV_E2BIG; + } + if (ch > 0xFF) { + *p = UNKNOWN_ASCII; + } else { + *p = (Uint8) ch; + } + ++dst; + --dstlen; + } + break; + case ENCODING_UTF8: /* RFC 3629 */ + { + Uint8 *p = (Uint8 *) dst; + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; + } + if (ch <= 0x7F) { + if (dstlen < 1) { + return SDL_ICONV_E2BIG; + } + *p = (Uint8) ch; + ++dst; + --dstlen; + } else if (ch <= 0x7FF) { + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + p[0] = 0xC0 | (Uint8) ((ch >> 6) & 0x1F); + p[1] = 0x80 | (Uint8) (ch & 0x3F); + dst += 2; + dstlen -= 2; + } else if (ch <= 0xFFFF) { + if (dstlen < 3) { + return SDL_ICONV_E2BIG; + } + p[0] = 0xE0 | (Uint8) ((ch >> 12) & 0x0F); + p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[2] = 0x80 | (Uint8) (ch & 0x3F); + dst += 3; + dstlen -= 3; + } else if (ch <= 0x1FFFFF) { + if (dstlen < 4) { + return SDL_ICONV_E2BIG; + } + p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07); + p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); + p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[3] = 0x80 | (Uint8) (ch & 0x3F); + dst += 4; + dstlen -= 4; + } else if (ch <= 0x3FFFFFF) { + if (dstlen < 5) { + return SDL_ICONV_E2BIG; + } + p[0] = 0xF8 | (Uint8) ((ch >> 24) & 0x03); + p[1] = 0x80 | (Uint8) ((ch >> 18) & 0x3F); + p[2] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); + p[3] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[4] = 0x80 | (Uint8) (ch & 0x3F); + dst += 5; + dstlen -= 5; + } else { + if (dstlen < 6) { + return SDL_ICONV_E2BIG; + } + p[0] = 0xFC | (Uint8) ((ch >> 30) & 0x01); + p[1] = 0x80 | (Uint8) ((ch >> 24) & 0x3F); + p[2] = 0x80 | (Uint8) ((ch >> 18) & 0x3F); + p[3] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); + p[4] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); + p[5] = 0x80 | (Uint8) (ch & 0x3F); + dst += 6; + dstlen -= 6; + } + } + break; + case ENCODING_UTF16BE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *) dst; + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; + } + if (ch < 0x10000) { + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + p[0] = (Uint8) (ch >> 8); + p[1] = (Uint8) ch; + dst += 2; + dstlen -= 2; + } else { + Uint16 W1, W2; + if (dstlen < 4) { + return SDL_ICONV_E2BIG; + } + ch = ch - 0x10000; + W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF); + W2 = 0xDC00 | (Uint16) (ch & 0x3FF); + p[0] = (Uint8) (W1 >> 8); + p[1] = (Uint8) W1; + p[2] = (Uint8) (W2 >> 8); + p[3] = (Uint8) W2; + dst += 4; + dstlen -= 4; + } + } + break; + case ENCODING_UTF16LE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *) dst; + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; + } + if (ch < 0x10000) { + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + p[1] = (Uint8) (ch >> 8); + p[0] = (Uint8) ch; + dst += 2; + dstlen -= 2; + } else { + Uint16 W1, W2; + if (dstlen < 4) { + return SDL_ICONV_E2BIG; + } + ch = ch - 0x10000; + W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF); + W2 = 0xDC00 | (Uint16) (ch & 0x3FF); + p[1] = (Uint8) (W1 >> 8); + p[0] = (Uint8) W1; + p[3] = (Uint8) (W2 >> 8); + p[2] = (Uint8) W2; + dst += 4; + dstlen -= 4; + } + } + break; + case ENCODING_UCS2BE: + { + Uint8 *p = (Uint8 *) dst; + if (ch > 0xFFFF) { + ch = UNKNOWN_UNICODE; + } + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + p[0] = (Uint8) (ch >> 8); + p[1] = (Uint8) ch; + dst += 2; + dstlen -= 2; + } + break; + case ENCODING_UCS2LE: + { + Uint8 *p = (Uint8 *) dst; + if (ch > 0xFFFF) { + ch = UNKNOWN_UNICODE; + } + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + p[1] = (Uint8) (ch >> 8); + p[0] = (Uint8) ch; + dst += 2; + dstlen -= 2; + } + break; + case ENCODING_UTF32BE: + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; + } + case ENCODING_UCS4BE: + if (ch > 0x7FFFFFFF) { + ch = UNKNOWN_UNICODE; + } + { + Uint8 *p = (Uint8 *) dst; + if (dstlen < 4) { + return SDL_ICONV_E2BIG; + } + p[0] = (Uint8) (ch >> 24); + p[1] = (Uint8) (ch >> 16); + p[2] = (Uint8) (ch >> 8); + p[3] = (Uint8) ch; + dst += 4; + dstlen -= 4; + } + break; + case ENCODING_UTF32LE: + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; + } + case ENCODING_UCS4LE: + if (ch > 0x7FFFFFFF) { + ch = UNKNOWN_UNICODE; + } + { + Uint8 *p = (Uint8 *) dst; + if (dstlen < 4) { + return SDL_ICONV_E2BIG; + } + p[3] = (Uint8) (ch >> 24); + p[2] = (Uint8) (ch >> 16); + p[1] = (Uint8) (ch >> 8); + p[0] = (Uint8) ch; + dst += 4; + dstlen -= 4; + } + break; + } + + /* Update state */ + *inbuf = src; + *inbytesleft = srclen; + *outbuf = dst; + *outbytesleft = dstlen; + ++total; + } + return total; } -int SDL_iconv_close(SDL_iconv_t cd) +int +SDL_iconv_close(SDL_iconv_t cd) { - if ( cd && cd != (SDL_iconv_t)-1 ) { - SDL_free(cd); - } - return 0; + if (cd && cd != (SDL_iconv_t) - 1) { + SDL_free(cd); + } + return 0; } #endif /* !HAVE_ICONV */ -char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft) +char * +SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, + size_t inbytesleft) { - SDL_iconv_t cd; - char *string; - size_t stringsize; - char *outbuf; - size_t outbytesleft; - size_t retCode = 0; - - cd = SDL_iconv_open(tocode, fromcode); - if ( cd == (SDL_iconv_t)-1 ) { - /* See if we can recover here (fixes iconv on Solaris 11) */ - if ( !tocode || !*tocode ) { - tocode = "UTF-8"; - } - if ( !fromcode || !*fromcode ) { - fromcode = "UTF-8"; - } - cd = SDL_iconv_open(tocode, fromcode); - } - if ( cd == (SDL_iconv_t)-1 ) { - return NULL; - } - - stringsize = inbytesleft > 4 ? inbytesleft : 4; - string = SDL_malloc(stringsize); - if ( !string ) { - SDL_iconv_close(cd); - return NULL; - } - outbuf = string; - outbytesleft = stringsize; - SDL_memset(outbuf, 0, 4); - - while ( inbytesleft > 0 ) { - retCode = SDL_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - switch (retCode) { - case SDL_ICONV_E2BIG: - { - char *oldstring = string; - stringsize *= 2; - string = SDL_realloc(string, stringsize); - if ( !string ) { - SDL_iconv_close(cd); - return NULL; - } - outbuf = string + (outbuf - oldstring); - outbytesleft = stringsize - (outbuf - string); - SDL_memset(outbuf, 0, 4); - } - break; - case SDL_ICONV_EILSEQ: - /* Try skipping some input data - not perfect, but... */ - ++inbuf; - --inbytesleft; - break; - case SDL_ICONV_EINVAL: - case SDL_ICONV_ERROR: - /* We can't continue... */ - inbytesleft = 0; - break; - } - } - SDL_iconv_close(cd); - - return string; + SDL_iconv_t cd; + char *string; + size_t stringsize; + char *outbuf; + size_t outbytesleft; + size_t retCode = 0; + + cd = SDL_iconv_open(tocode, fromcode); + if (cd == (SDL_iconv_t) - 1) { + /* See if we can recover here (fixes iconv on Solaris 11) */ + if (!tocode || !*tocode) { + tocode = "UTF-8"; + } + if (!fromcode || !*fromcode) { + fromcode = "UTF-8"; + } + cd = SDL_iconv_open(tocode, fromcode); + } + if (cd == (SDL_iconv_t) - 1) { + return NULL; + } + + stringsize = inbytesleft > 4 ? inbytesleft : 4; + string = SDL_malloc(stringsize); + if (!string) { + SDL_iconv_close(cd); + return NULL; + } + outbuf = string; + outbytesleft = stringsize; + SDL_memset(outbuf, 0, 4); + + while (inbytesleft > 0) { + retCode = SDL_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + switch (retCode) { + case SDL_ICONV_E2BIG: + { + char *oldstring = string; + stringsize *= 2; + string = SDL_realloc(string, stringsize); + if (!string) { + SDL_iconv_close(cd); + return NULL; + } + outbuf = string + (outbuf - oldstring); + outbytesleft = stringsize - (outbuf - string); + SDL_memset(outbuf, 0, 4); + } + break; + case SDL_ICONV_EILSEQ: + /* Try skipping some input data - not perfect, but... */ + ++inbuf; + --inbytesleft; + break; + case SDL_ICONV_EINVAL: + case SDL_ICONV_ERROR: + /* We can't continue... */ + inbytesleft = 0; + break; + } + } + SDL_iconv_close(cd); + + return string; } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index f025e4349a..7a85a3b49d 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -25,7 +24,29 @@ #include "SDL_stdinc.h" -#ifndef HAVE_MALLOC +#if defined(HAVE_MALLOC) + +void *SDL_malloc(size_t size) +{ + return malloc(size); +} + +void *SDL_calloc(size_t nmemb, size_t size) +{ + return calloc(nmemb, size); +} + +void *SDL_realloc(void *ptr, size_t size) +{ + return realloc(ptr, size); +} + +void SDL_free(void *ptr) +{ + free(ptr); +} + +#else /* the rest of this is a LOT of tapdancing to implement malloc. :) */ #define LACKS_SYS_TYPES_H #define LACKS_STDIO_H @@ -399,9 +420,9 @@ MALLINFO_FIELD_TYPE default: size_t size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set REALLOC_ZERO_BYTES_FREES default: not defined - This should be set if a call to realloc with zero bytes should - be the same as a call to free. Some people think it should. Otherwise, - since this malloc returns a unique pointer for malloc(0), so does + This should be set if a call to realloc with zero bytes should + be the same as a call to free. Some people think it should. Otherwise, + since this malloc returns a unique pointer for malloc(0), so does realloc(p, 0). LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H @@ -477,8 +498,8 @@ DEFAULT_MMAP_THRESHOLD default: 256K #ifndef WIN32 #ifdef _WIN32 #define WIN32 1 -#endif /* _WIN32 */ -#endif /* WIN32 */ +#endif /* _WIN32 */ +#endif /* WIN32 */ #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include @@ -491,130 +512,130 @@ DEFAULT_MMAP_THRESHOLD default: 256K #define LACKS_STRINGS_H #define LACKS_SYS_TYPES_H #define LACKS_ERRNO_H -#define LACKS_FCNTL_H +#define LACKS_FCNTL_H #define MALLOC_FAILURE_ACTION -#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ -#endif /* WIN32 */ +#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ +#endif /* WIN32 */ #if defined(DARWIN) || defined(_DARWIN) /* Mac OSX docs advise not to use sbrk; it seems better to use mmap */ #ifndef HAVE_MORECORE #define HAVE_MORECORE 0 #define HAVE_MMAP 1 -#endif /* HAVE_MORECORE */ -#endif /* DARWIN */ +#endif /* HAVE_MORECORE */ +#endif /* DARWIN */ #ifndef LACKS_SYS_TYPES_H -#include /* For size_t */ -#endif /* LACKS_SYS_TYPES_H */ +#include /* For size_t */ +#endif /* LACKS_SYS_TYPES_H */ /* The maximum possible size_t value has all bits set */ #define MAX_SIZE_T (~(size_t)0) #ifndef ONLY_MSPACES #define ONLY_MSPACES 0 -#endif /* ONLY_MSPACES */ +#endif /* ONLY_MSPACES */ #ifndef MSPACES #if ONLY_MSPACES #define MSPACES 1 -#else /* ONLY_MSPACES */ +#else /* ONLY_MSPACES */ #define MSPACES 0 -#endif /* ONLY_MSPACES */ -#endif /* MSPACES */ +#endif /* ONLY_MSPACES */ +#endif /* MSPACES */ #ifndef MALLOC_ALIGNMENT #define MALLOC_ALIGNMENT ((size_t)8U) -#endif /* MALLOC_ALIGNMENT */ +#endif /* MALLOC_ALIGNMENT */ #ifndef FOOTERS #define FOOTERS 0 -#endif /* FOOTERS */ +#endif /* FOOTERS */ #ifndef ABORT #define ABORT abort() -#endif /* ABORT */ +#endif /* ABORT */ #ifndef ABORT_ON_ASSERT_FAILURE #define ABORT_ON_ASSERT_FAILURE 1 -#endif /* ABORT_ON_ASSERT_FAILURE */ +#endif /* ABORT_ON_ASSERT_FAILURE */ #ifndef PROCEED_ON_ERROR #define PROCEED_ON_ERROR 0 -#endif /* PROCEED_ON_ERROR */ +#endif /* PROCEED_ON_ERROR */ #ifndef USE_LOCKS #define USE_LOCKS 0 -#endif /* USE_LOCKS */ +#endif /* USE_LOCKS */ #ifndef INSECURE #define INSECURE 0 -#endif /* INSECURE */ +#endif /* INSECURE */ #ifndef HAVE_MMAP #define HAVE_MMAP 1 -#endif /* HAVE_MMAP */ +#endif /* HAVE_MMAP */ #ifndef MMAP_CLEARS #define MMAP_CLEARS 1 -#endif /* MMAP_CLEARS */ +#endif /* MMAP_CLEARS */ #ifndef HAVE_MREMAP #ifdef linux #define HAVE_MREMAP 1 -#else /* linux */ +#else /* linux */ #define HAVE_MREMAP 0 -#endif /* linux */ -#endif /* HAVE_MREMAP */ +#endif /* linux */ +#endif /* HAVE_MREMAP */ #ifndef MALLOC_FAILURE_ACTION #define MALLOC_FAILURE_ACTION errno = ENOMEM; -#endif /* MALLOC_FAILURE_ACTION */ +#endif /* MALLOC_FAILURE_ACTION */ #ifndef HAVE_MORECORE #if ONLY_MSPACES #define HAVE_MORECORE 0 -#else /* ONLY_MSPACES */ +#else /* ONLY_MSPACES */ #define HAVE_MORECORE 1 -#endif /* ONLY_MSPACES */ -#endif /* HAVE_MORECORE */ +#endif /* ONLY_MSPACES */ +#endif /* HAVE_MORECORE */ #if !HAVE_MORECORE #define MORECORE_CONTIGUOUS 0 -#else /* !HAVE_MORECORE */ +#else /* !HAVE_MORECORE */ #ifndef MORECORE #define MORECORE sbrk -#endif /* MORECORE */ +#endif /* MORECORE */ #ifndef MORECORE_CONTIGUOUS #define MORECORE_CONTIGUOUS 1 -#endif /* MORECORE_CONTIGUOUS */ -#endif /* HAVE_MORECORE */ +#endif /* MORECORE_CONTIGUOUS */ +#endif /* HAVE_MORECORE */ #ifndef DEFAULT_GRANULARITY #if MORECORE_CONTIGUOUS -#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ -#else /* MORECORE_CONTIGUOUS */ +#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ +#else /* MORECORE_CONTIGUOUS */ #define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) -#endif /* MORECORE_CONTIGUOUS */ -#endif /* DEFAULT_GRANULARITY */ +#endif /* MORECORE_CONTIGUOUS */ +#endif /* DEFAULT_GRANULARITY */ #ifndef DEFAULT_TRIM_THRESHOLD #ifndef MORECORE_CANNOT_TRIM #define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) -#else /* MORECORE_CANNOT_TRIM */ +#else /* MORECORE_CANNOT_TRIM */ #define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T -#endif /* MORECORE_CANNOT_TRIM */ -#endif /* DEFAULT_TRIM_THRESHOLD */ +#endif /* MORECORE_CANNOT_TRIM */ +#endif /* DEFAULT_TRIM_THRESHOLD */ #ifndef DEFAULT_MMAP_THRESHOLD #if HAVE_MMAP #define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) -#else /* HAVE_MMAP */ +#else /* HAVE_MMAP */ #define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T -#endif /* HAVE_MMAP */ -#endif /* DEFAULT_MMAP_THRESHOLD */ +#endif /* HAVE_MMAP */ +#endif /* DEFAULT_MMAP_THRESHOLD */ #ifndef USE_BUILTIN_FFS #define USE_BUILTIN_FFS 0 -#endif /* USE_BUILTIN_FFS */ +#endif /* USE_BUILTIN_FFS */ #ifndef USE_DEV_RANDOM #define USE_DEV_RANDOM 0 -#endif /* USE_DEV_RANDOM */ +#endif /* USE_DEV_RANDOM */ #ifndef NO_MALLINFO #define NO_MALLINFO 0 -#endif /* NO_MALLINFO */ +#endif /* NO_MALLINFO */ #ifndef MALLINFO_FIELD_TYPE #define MALLINFO_FIELD_TYPE size_t -#endif /* MALLINFO_FIELD_TYPE */ +#endif /* MALLINFO_FIELD_TYPE */ -#define memset SDL_memset -#define memcpy SDL_memcpy -#define malloc SDL_malloc -#define calloc SDL_calloc -#define realloc SDL_realloc -#define free SDL_free +#define memset SDL_memset +#define memcpy SDL_memcpy +#define malloc SDL_malloc +#define calloc SDL_calloc +#define realloc SDL_realloc +#define free SDL_free /* mallopt tuning options. SVID/XPG defines four standard parameter @@ -658,25 +679,27 @@ DEFAULT_MMAP_THRESHOLD default: 256K #include "/usr/include/malloc.h" #else /* HAVE_USR_INCLUDE_MALLOC_H */ -struct mallinfo { - MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ - MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ - MALLINFO_FIELD_TYPE smblks; /* always 0 */ - MALLINFO_FIELD_TYPE hblks; /* always 0 */ - MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ - MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ - MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ - MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ - MALLINFO_FIELD_TYPE fordblks; /* total free space */ - MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ +struct mallinfo +{ + MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ + MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ + MALLINFO_FIELD_TYPE smblks; /* always 0 */ + MALLINFO_FIELD_TYPE hblks; /* always 0 */ + MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ + MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ + MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ + MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ + MALLINFO_FIELD_TYPE fordblks; /* total free space */ + MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ }; #endif /* HAVE_USR_INCLUDE_MALLOC_H */ #endif /* NO_MALLINFO */ #ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +extern "C" +{ +#endif /* __cplusplus */ #if !ONLY_MSPACES @@ -699,7 +722,7 @@ extern "C" { #define dlmalloc_max_footprint malloc_max_footprint #define dlindependent_calloc independent_calloc #define dlindependent_comalloc independent_comalloc -#endif /* USE_DL_PREFIX */ +#endif /* USE_DL_PREFIX */ /* @@ -716,7 +739,7 @@ extern "C" { maximum supported value of n differs across systems, but is in all cases less than the maximum representable value of a size_t. */ -void* dlmalloc(size_t); + void *dlmalloc(size_t); /* free(void* p) @@ -725,14 +748,14 @@ void* dlmalloc(size_t); It has no effect if p is null. If p was not malloced or already freed, free(p) will by default cause the current program to abort. */ -void dlfree(void*); + void dlfree(void *); /* calloc(size_t n_elements, size_t element_size); Returns a pointer to n_elements * element_size bytes, with all locations set to zero. */ -void* dlcalloc(size_t, size_t); + void *dlcalloc(size_t, size_t); /* realloc(void* p, size_t n) @@ -757,7 +780,7 @@ void* dlcalloc(size_t, size_t); to be used as an argument to realloc is not supported. */ -void* dlrealloc(void*, size_t); + void *dlrealloc(void *, size_t); /* memalign(size_t alignment, size_t n); @@ -771,14 +794,14 @@ void* dlrealloc(void*, size_t); Overreliance on memalign is a sure way to fragment space. */ -void* dlmemalign(size_t, size_t); + void *dlmemalign(size_t, size_t); /* valloc(size_t n); Equivalent to memalign(pagesize, n), where pagesize is the page size of the system. If the pagesize is unknown, 4096 is used. */ -void* dlvalloc(size_t); + void *dlvalloc(size_t); /* mallopt(int parameter_number, int parameter_value) @@ -798,7 +821,7 @@ void* dlvalloc(size_t); M_GRANULARITY -2 page size any power of 2 >= page size M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) */ -int dlmallopt(int, int); + int dlmallopt(int, int); /* malloc_footprint(); @@ -809,7 +832,7 @@ int dlmallopt(int, int); Even if locks are otherwise defined, this function does not use them, so results might not be up to date. */ -size_t dlmalloc_footprint(void); + size_t dlmalloc_footprint(void); /* malloc_max_footprint(); @@ -822,7 +845,7 @@ size_t dlmalloc_footprint(void); otherwise defined, this function does not use them, so results might not be up to date. */ -size_t dlmalloc_max_footprint(void); + size_t dlmalloc_max_footprint(void); #if !NO_MALLINFO /* @@ -847,8 +870,8 @@ size_t dlmalloc_max_footprint(void); be kept as longs, the reported values may wrap around zero and thus be inaccurate. */ -struct mallinfo dlmallinfo(void); -#endif /* NO_MALLINFO */ + struct mallinfo dlmallinfo(void); +#endif /* NO_MALLINFO */ /* independent_calloc(size_t n_elements, size_t element_size, void* chunks[]); @@ -902,7 +925,7 @@ struct mallinfo dlmallinfo(void); return first; } */ -void** dlindependent_calloc(size_t, size_t, void**); + void **dlindependent_calloc(size_t, size_t, void **); /* independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]); @@ -963,7 +986,7 @@ void** dlindependent_calloc(size_t, size_t, void**); since it cannot reuse existing noncontiguous small chunks that might be available for some of the elements. */ -void** dlindependent_comalloc(size_t, size_t*, void**); + void **dlindependent_comalloc(size_t, size_t *, void **); /* @@ -971,7 +994,7 @@ void** dlindependent_comalloc(size_t, size_t*, void**); Equivalent to valloc(minimum-page-that-holds(n)), that is, round up n to nearest pagesize. */ -void* dlpvalloc(size_t); + void *dlpvalloc(size_t); /* malloc_trim(size_t pad); @@ -994,7 +1017,7 @@ void* dlpvalloc(size_t); Malloc_trim returns 1 if it actually released any memory, else 0. */ -int dlmalloc_trim(size_t); + int dlmalloc_trim(size_t); /* malloc_usable_size(void* p); @@ -1010,7 +1033,7 @@ int dlmalloc_trim(size_t); p = malloc(n); assert(malloc_usable_size(p) >= 256); */ -size_t dlmalloc_usable_size(void*); + size_t dlmalloc_usable_size(void *); /* malloc_stats(); @@ -1031,9 +1054,9 @@ size_t dlmalloc_usable_size(void*); malloc_stats prints only the most commonly interesting statistics. More information can be obtained by calling mallinfo. */ -void dlmalloc_stats(void); + void dlmalloc_stats(void); -#endif /* ONLY_MSPACES */ +#endif /* ONLY_MSPACES */ #if MSPACES @@ -1041,7 +1064,7 @@ void dlmalloc_stats(void); mspace is an opaque type representing an independent region of space that supports mspace_malloc, etc. */ -typedef void* mspace; + typedef void *mspace; /* create_mspace creates and returns a new independent space with the @@ -1054,7 +1077,7 @@ typedef void* mspace; compiling with a different DEFAULT_GRANULARITY or dynamically setting with mallopt(M_GRANULARITY, value). */ -mspace create_mspace(size_t capacity, int locked); + mspace create_mspace(size_t capacity, int locked); /* destroy_mspace destroys the given space, and attempts to return all @@ -1062,7 +1085,7 @@ mspace create_mspace(size_t capacity, int locked); bytes freed. After destruction, the results of access to all memory used by the space become undefined. */ -size_t destroy_mspace(mspace msp); + size_t destroy_mspace(mspace msp); /* create_mspace_with_base uses the memory supplied as the initial base @@ -1073,13 +1096,13 @@ size_t destroy_mspace(mspace msp); Destroying this space will deallocate all additionally allocated space (if possible) but not the initial base. */ -mspace create_mspace_with_base(void* base, size_t capacity, int locked); + mspace create_mspace_with_base(void *base, size_t capacity, int locked); /* mspace_malloc behaves as malloc, but operates within the given space. */ -void* mspace_malloc(mspace msp, size_t bytes); + void *mspace_malloc(mspace msp, size_t bytes); /* mspace_free behaves as free, but operates within @@ -1089,7 +1112,7 @@ void* mspace_malloc(mspace msp, size_t bytes); free may be called instead of mspace_free because freed chunks from any space are handled by their originating spaces. */ -void mspace_free(mspace msp, void* mem); + void mspace_free(mspace msp, void *mem); /* mspace_realloc behaves as realloc, but operates within @@ -1100,45 +1123,45 @@ void mspace_free(mspace msp, void* mem); realloced chunks from any space are handled by their originating spaces. */ -void* mspace_realloc(mspace msp, void* mem, size_t newsize); + void *mspace_realloc(mspace msp, void *mem, size_t newsize); /* mspace_calloc behaves as calloc, but operates within the given space. */ -void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); + void *mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); /* mspace_memalign behaves as memalign, but operates within the given space. */ -void* mspace_memalign(mspace msp, size_t alignment, size_t bytes); + void *mspace_memalign(mspace msp, size_t alignment, size_t bytes); /* mspace_independent_calloc behaves as independent_calloc, but operates within the given space. */ -void** mspace_independent_calloc(mspace msp, size_t n_elements, - size_t elem_size, void* chunks[]); + void **mspace_independent_calloc(mspace msp, size_t n_elements, + size_t elem_size, void *chunks[]); /* mspace_independent_comalloc behaves as independent_comalloc, but operates within the given space. */ -void** mspace_independent_comalloc(mspace msp, size_t n_elements, - size_t sizes[], void* chunks[]); + void **mspace_independent_comalloc(mspace msp, size_t n_elements, + size_t sizes[], void *chunks[]); /* mspace_footprint() returns the number of bytes obtained from the system for this space. */ -size_t mspace_footprint(mspace msp); + size_t mspace_footprint(mspace msp); /* mspace_max_footprint() returns the peak number of bytes obtained from the system for this space. */ -size_t mspace_max_footprint(mspace msp); + size_t mspace_max_footprint(mspace msp); #if !NO_MALLINFO @@ -1146,30 +1169,30 @@ size_t mspace_max_footprint(mspace msp); mspace_mallinfo behaves as mallinfo, but reports properties of the given space. */ -struct mallinfo mspace_mallinfo(mspace msp); -#endif /* NO_MALLINFO */ + struct mallinfo mspace_mallinfo(mspace msp); +#endif /* NO_MALLINFO */ /* mspace_malloc_stats behaves as malloc_stats, but reports properties of the given space. */ -void mspace_malloc_stats(mspace msp); + void mspace_malloc_stats(mspace msp); /* mspace_trim behaves as malloc_trim, but operates within the given space. */ -int mspace_trim(mspace msp, size_t pad); + int mspace_trim(mspace msp, size_t pad); /* An alias for mallopt. */ -int mspace_mallopt(int, int); + int mspace_mallopt(int, int); -#endif /* MSPACES */ +#endif /* MSPACES */ #ifdef __cplusplus -}; /* end of extern "C" */ +}; /* end of extern "C" */ #endif /* __cplusplus */ /* @@ -1185,21 +1208,21 @@ int mspace_mallopt(int, int); /*------------------------------ internal #includes ---------------------- */ #ifdef _MSC_VER -#pragma warning( disable : 4146 ) /* no "unsigned" warnings */ +#pragma warning( disable : 4146 ) /* no "unsigned" warnings */ #endif /* _MSC_VER */ #ifndef LACKS_STDIO_H -#include /* for printing in malloc_stats */ +#include /* for printing in malloc_stats */ #endif #ifndef LACKS_ERRNO_H -#include /* for MALLOC_FAILURE_ACTION */ +#include /* for MALLOC_FAILURE_ACTION */ #endif /* LACKS_ERRNO_H */ #if FOOTERS -#include /* for magic initialization */ +#include /* for magic initialization */ #endif /* FOOTERS */ #ifndef LACKS_STDLIB_H -#include /* for abort() */ +#include /* for abort() */ #endif /* LACKS_STDLIB_H */ #ifdef DEBUG #if ABORT_ON_ASSERT_FAILURE @@ -1207,20 +1230,20 @@ int mspace_mallopt(int, int); #else /* ABORT_ON_ASSERT_FAILURE */ #include #endif /* ABORT_ON_ASSERT_FAILURE */ -#else /* DEBUG */ +#else /* DEBUG */ #define assert(x) #endif /* DEBUG */ #ifndef LACKS_STRING_H -#include /* for memset etc */ -#endif /* LACKS_STRING_H */ +#include /* for memset etc */ +#endif /* LACKS_STRING_H */ #if USE_BUILTIN_FFS #ifndef LACKS_STRINGS_H -#include /* for ffs */ +#include /* for ffs */ #endif /* LACKS_STRINGS_H */ #endif /* USE_BUILTIN_FFS */ #if HAVE_MMAP #ifndef LACKS_SYS_MMAN_H -#include /* for mmap */ +#include /* for mmap */ #endif /* LACKS_SYS_MMAN_H */ #ifndef LACKS_FCNTL_H #include @@ -1228,17 +1251,17 @@ int mspace_mallopt(int, int); #endif /* HAVE_MMAP */ #if HAVE_MORECORE #ifndef LACKS_UNISTD_H -#include /* for sbrk */ +#include /* for sbrk */ #else /* LACKS_UNISTD_H */ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) -extern void* sbrk(ptrdiff_t); +extern void *sbrk(ptrdiff_t); #endif /* FreeBSD etc */ #endif /* LACKS_UNISTD_H */ #endif /* HAVE_MMAP */ #ifndef WIN32 #ifndef malloc_getpagesize -# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ +# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ # ifndef _SC_PAGE_SIZE # define _SC_PAGE_SIZE _SC_PAGESIZE # endif @@ -1247,10 +1270,10 @@ extern void* sbrk(ptrdiff_t); # define malloc_getpagesize sysconf(_SC_PAGE_SIZE) # else # if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) - extern size_t getpagesize(); +extern size_t getpagesize(); # define malloc_getpagesize getpagesize() # else -# ifdef WIN32 /* use supplied emulation of getpagesize */ +# ifdef WIN32 /* use supplied emulation of getpagesize */ # define malloc_getpagesize getpagesize() # else # ifndef LACKS_SYS_PARAM_H @@ -1321,7 +1344,7 @@ extern void* sbrk(ptrdiff_t); /* MORECORE and MMAP must return MFAIL on failure */ #define MFAIL ((void*)(MAX_SIZE_T)) -#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ +#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ #if !HAVE_MMAP #define IS_MMAPPED_BIT (SIZE_T_ZERO) @@ -1349,7 +1372,7 @@ extern void* sbrk(ptrdiff_t); is unlikely to be needed, but is supplied just in case. */ #define MMAP_FLAGS (MAP_PRIVATE) -static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ +static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ #define CALL_MMAP(s) ((dev_zero_fd < 0) ? \ (dev_zero_fd = open("/dev/zero", O_RDWR), \ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \ @@ -1360,34 +1383,41 @@ static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ #else /* WIN32 */ /* Win32 MMAP via VirtualAlloc */ -static void* win32mmap(size_t size) { - void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); - return (ptr != 0)? ptr: MFAIL; +static void * +win32mmap(size_t size) +{ + void *ptr = + VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + return (ptr != 0) ? ptr : MFAIL; } /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ -static void* win32direct_mmap(size_t size) { - void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, - PAGE_READWRITE); - return (ptr != 0)? ptr: MFAIL; +static void * +win32direct_mmap(size_t size) +{ + void *ptr = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, + PAGE_READWRITE); + return (ptr != 0) ? ptr : MFAIL; } /* This function supports releasing coalesed segments */ -static int win32munmap(void* ptr, size_t size) { - MEMORY_BASIC_INFORMATION minfo; - char* cptr = ptr; - while (size) { - if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) - return -1; - if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || - minfo.State != MEM_COMMIT || minfo.RegionSize > size) - return -1; - if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) - return -1; - cptr += minfo.RegionSize; - size -= minfo.RegionSize; - } - return 0; +static int +win32munmap(void *ptr, size_t size) +{ + MEMORY_BASIC_INFORMATION minfo; + char *cptr = ptr; + while (size) { + if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) + return -1; + if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || + minfo.State != MEM_COMMIT || minfo.RegionSize > size) + return -1; + if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) + return -1; + cptr += minfo.RegionSize; + size -= minfo.RegionSize; + } + return 0; } #define CALL_MMAP(s) win32mmap(s) @@ -1398,13 +1428,13 @@ static int win32munmap(void* ptr, size_t size) { #if HAVE_MMAP && HAVE_MREMAP #define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv)) -#else /* HAVE_MMAP && HAVE_MREMAP */ +#else /* HAVE_MMAP && HAVE_MREMAP */ #define CALL_MREMAP(addr, osz, nsz, mv) MFAIL #endif /* HAVE_MMAP && HAVE_MREMAP */ #if HAVE_MORECORE #define CALL_MORECORE(S) MORECORE(S) -#else /* HAVE_MORECORE */ +#else /* HAVE_MORECORE */ #define CALL_MORECORE(S) MFAIL #endif /* HAVE_MORECORE */ @@ -1454,21 +1484,25 @@ static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER; */ #define MLOCK_T long -static int win32_acquire_lock (MLOCK_T *sl) { - for (;;) { +static int +win32_acquire_lock(MLOCK_T * sl) +{ + for (;;) { #ifdef InterlockedCompareExchangePointer - if (!InterlockedCompareExchange(sl, 1, 0)) - return 0; -#else /* Use older void* version */ - if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0)) - return 0; + if (!InterlockedCompareExchange(sl, 1, 0)) + return 0; +#else /* Use older void* version */ + if (!InterlockedCompareExchange((void **) sl, (void *) 1, (void *) 0)) + return 0; #endif /* InterlockedCompareExchangePointer */ - Sleep (0); - } + Sleep(0); + } } -static void win32_release_lock (MLOCK_T *sl) { - InterlockedExchange (sl, 0); +static void +win32_release_lock(MLOCK_T * sl) +{ + InterlockedExchange(sl, 0); } #define INITIAL_LOCK(l) *(l)=0 @@ -1481,7 +1515,7 @@ static MLOCK_T magic_init_mutex; #endif /* WIN32 */ #define USE_LOCK_BIT (2U) -#else /* USE_LOCKS */ +#else /* USE_LOCKS */ #define USE_LOCK_BIT (0U) #define INITIAL_LOCK(l) #endif /* USE_LOCKS */ @@ -1497,7 +1531,7 @@ static MLOCK_T magic_init_mutex; #if USE_LOCKS #define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex); #define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex); -#else /* USE_LOCKS */ +#else /* USE_LOCKS */ #define ACQUIRE_MAGIC_INIT_LOCK() #define RELEASE_MAGIC_INIT_LOCK() #endif /* USE_LOCKS */ @@ -1640,19 +1674,20 @@ static MLOCK_T magic_init_mutex; */ -struct malloc_chunk { - size_t prev_foot; /* Size of previous chunk (if free). */ - size_t head; /* Size and inuse bits. */ - struct malloc_chunk* fd; /* double links -- used only if free. */ - struct malloc_chunk* bk; +struct malloc_chunk +{ + size_t prev_foot; /* Size of previous chunk (if free). */ + size_t head; /* Size and inuse bits. */ + struct malloc_chunk *fd; /* double links -- used only if free. */ + struct malloc_chunk *bk; }; -typedef struct malloc_chunk mchunk; -typedef struct malloc_chunk* mchunkptr; -typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */ -typedef size_t bindex_t; /* Described below */ -typedef unsigned int binmap_t; /* Described below */ -typedef unsigned int flag_t; /* The type of various bit flag sets */ +typedef struct malloc_chunk mchunk; +typedef struct malloc_chunk *mchunkptr; +typedef struct malloc_chunk *sbinptr; /* The type of bins of chunks */ +typedef size_t bindex_t; /* Described below */ +typedef unsigned int binmap_t; /* Described below */ +typedef unsigned int flag_t; /* The type of various bit flag sets */ /* ------------------- Chunks sizes and alignments ----------------------- */ @@ -1845,21 +1880,22 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ is of course much better. */ -struct malloc_tree_chunk { - /* The first four fields must be compatible with malloc_chunk */ - size_t prev_foot; - size_t head; - struct malloc_tree_chunk* fd; - struct malloc_tree_chunk* bk; - - struct malloc_tree_chunk* child[2]; - struct malloc_tree_chunk* parent; - bindex_t index; +struct malloc_tree_chunk +{ + /* The first four fields must be compatible with malloc_chunk */ + size_t prev_foot; + size_t head; + struct malloc_tree_chunk *fd; + struct malloc_tree_chunk *bk; + + struct malloc_tree_chunk *child[2]; + struct malloc_tree_chunk *parent; + bindex_t index; }; -typedef struct malloc_tree_chunk tchunk; -typedef struct malloc_tree_chunk* tchunkptr; -typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */ +typedef struct malloc_tree_chunk tchunk; +typedef struct malloc_tree_chunk *tchunkptr; +typedef struct malloc_tree_chunk *tbinptr; /* The type of bins of trees */ /* A little helper macro for trees */ #define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) @@ -1921,18 +1957,19 @@ typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */ and deallocated/trimmed using MORECORE with negative arguments. */ -struct malloc_segment { - char* base; /* base address */ - size_t size; /* allocated size */ - struct malloc_segment* next; /* ptr to next segment */ - flag_t sflags; /* mmap and extern flag */ +struct malloc_segment +{ + char *base; /* base address */ + size_t size; /* allocated size */ + struct malloc_segment *next; /* ptr to next segment */ + flag_t sflags; /* mmap and extern flag */ }; #define is_mmapped_segment(S) ((S)->sflags & IS_MMAPPED_BIT) #define is_extern_segment(S) ((S)->sflags & EXTERN_BIT) -typedef struct malloc_segment msegment; -typedef struct malloc_segment* msegmentptr; +typedef struct malloc_segment msegment; +typedef struct malloc_segment *msegmentptr; /* ---------------------------- malloc_state ----------------------------- */ @@ -2019,28 +2056,29 @@ typedef struct malloc_segment* msegmentptr; #define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) #define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) -struct malloc_state { - binmap_t smallmap; - binmap_t treemap; - size_t dvsize; - size_t topsize; - char* least_addr; - mchunkptr dv; - mchunkptr top; - size_t trim_check; - size_t magic; - mchunkptr smallbins[(NSMALLBINS+1)*2]; - tbinptr treebins[NTREEBINS]; - size_t footprint; - size_t max_footprint; - flag_t mflags; +struct malloc_state +{ + binmap_t smallmap; + binmap_t treemap; + size_t dvsize; + size_t topsize; + char *least_addr; + mchunkptr dv; + mchunkptr top; + size_t trim_check; + size_t magic; + mchunkptr smallbins[(NSMALLBINS + 1) * 2]; + tbinptr treebins[NTREEBINS]; + size_t footprint; + size_t max_footprint; + flag_t mflags; #if USE_LOCKS - MLOCK_T mutex; /* locate lock among fields that rarely change */ -#endif /* USE_LOCKS */ - msegment seg; + MLOCK_T mutex; /* locate lock among fields that rarely change */ +#endif /* USE_LOCKS */ + msegment seg; }; -typedef struct malloc_state* mstate; +typedef struct malloc_state *mstate; /* ------------- Global malloc_state and malloc_params ------------------- */ @@ -2050,13 +2088,14 @@ typedef struct malloc_state* mstate; initialized in init_mparams. */ -struct malloc_params { - size_t magic; - size_t page_size; - size_t granularity; - size_t mmap_threshold; - size_t trim_threshold; - flag_t default_mflags; +struct malloc_params +{ + size_t magic; + size_t page_size; + size_t granularity; + size_t mmap_threshold; + size_t trim_threshold; + flag_t default_mflags; }; static struct malloc_params mparams; @@ -2105,30 +2144,34 @@ static struct malloc_state _gm_; ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) /* Return segment holding given address */ -static msegmentptr segment_holding(mstate m, char* addr) { - msegmentptr sp = &m->seg; - for (;;) { - if (addr >= sp->base && addr < sp->base + sp->size) - return sp; - if ((sp = sp->next) == 0) - return 0; - } +static msegmentptr +segment_holding(mstate m, char *addr) +{ + msegmentptr sp = &m->seg; + for (;;) { + if (addr >= sp->base && addr < sp->base + sp->size) + return sp; + if ((sp = sp->next) == 0) + return 0; + } } /* Return true if segment contains a segment link */ -static int has_segment_link(mstate m, msegmentptr ss) { - msegmentptr sp = &m->seg; - for (;;) { - if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size) - return 1; - if ((sp = sp->next) == 0) - return 0; - } +static int +has_segment_link(mstate m, msegmentptr ss) +{ + msegmentptr sp = &m->seg; + for (;;) { + if ((char *) sp >= ss->base && (char *) sp < ss->base + ss->size) + return 1; + if ((sp = sp->next) == 0) + return 0; + } } #ifndef MORECORE_CANNOT_TRIM #define should_trim(M,s) ((s) > (M)->trim_check) -#else /* MORECORE_CANNOT_TRIM */ +#else /* MORECORE_CANNOT_TRIM */ #define should_trim(M,s) (0) #endif /* MORECORE_CANNOT_TRIM */ @@ -2160,11 +2203,11 @@ static int has_segment_link(mstate m, msegmentptr ss) { #ifndef PREACTION #define PREACTION(M) (0) -#endif /* PREACTION */ +#endif /* PREACTION */ #ifndef POSTACTION #define POSTACTION(M) -#endif /* POSTACTION */ +#endif /* POSTACTION */ #endif /* USE_LOCKS */ @@ -2218,17 +2261,17 @@ static void reset_on_error(mstate m); #define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P) #define check_malloc_state(M) do_check_malloc_state(M) -static void do_check_any_chunk(mstate m, mchunkptr p); -static void do_check_top_chunk(mstate m, mchunkptr p); -static void do_check_mmapped_chunk(mstate m, mchunkptr p); -static void do_check_inuse_chunk(mstate m, mchunkptr p); -static void do_check_free_chunk(mstate m, mchunkptr p); -static void do_check_malloced_chunk(mstate m, void* mem, size_t s); -static void do_check_tree(mstate m, tchunkptr t); -static void do_check_treebin(mstate m, bindex_t i); -static void do_check_smallbin(mstate m, bindex_t i); -static void do_check_malloc_state(mstate m); -static int bin_find(mstate m, mchunkptr x); +static void do_check_any_chunk(mstate m, mchunkptr p); +static void do_check_top_chunk(mstate m, mchunkptr p); +static void do_check_mmapped_chunk(mstate m, mchunkptr p); +static void do_check_inuse_chunk(mstate m, mchunkptr p); +static void do_check_free_chunk(mstate m, mchunkptr p); +static void do_check_malloced_chunk(mstate m, void *mem, size_t s); +static void do_check_tree(mstate m, tchunkptr t); +static void do_check_treebin(mstate m, bindex_t i); +static void do_check_smallbin(mstate m, bindex_t i); +static void do_check_malloc_state(mstate m); +static int bin_find(mstate m, mchunkptr x); static size_t traverse_and_check(mstate m); #endif /* DEBUG */ @@ -2394,7 +2437,7 @@ static size_t traverse_and_check(mstate m); #if (FOOTERS && !INSECURE) /* Check if (alleged) mstate m has expected magic field */ #define ok_magic(M) ((M)->magic == mparams.magic) -#else /* (FOOTERS && !INSECURE) */ +#else /* (FOOTERS && !INSECURE) */ #define ok_magic(M) (1) #endif /* (FOOTERS && !INSECURE) */ @@ -2459,446 +2502,474 @@ static size_t traverse_and_check(mstate m); /* ---------------------------- setting mparams -------------------------- */ /* Initialize mparams */ -static int init_mparams(void) { - if (mparams.page_size == 0) { - size_t s; - - mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; - mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; +static int +init_mparams(void) +{ + if (mparams.page_size == 0) { + size_t s; + + mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; + mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; #if MORECORE_CONTIGUOUS - mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT; -#else /* MORECORE_CONTIGUOUS */ - mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT; + mparams.default_mflags = USE_LOCK_BIT | USE_MMAP_BIT; +#else /* MORECORE_CONTIGUOUS */ + mparams.default_mflags = + USE_LOCK_BIT | USE_MMAP_BIT | USE_NONCONTIGUOUS_BIT; #endif /* MORECORE_CONTIGUOUS */ #if (FOOTERS && !INSECURE) - { + { #if USE_DEV_RANDOM - int fd; - unsigned char buf[sizeof(size_t)]; - /* Try to use /dev/urandom, else fall back on using time */ - if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 && - read(fd, buf, sizeof(buf)) == sizeof(buf)) { - s = *((size_t *) buf); - close(fd); - } - else + int fd; + unsigned char buf[sizeof(size_t)]; + /* Try to use /dev/urandom, else fall back on using time */ + if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 && + read(fd, buf, sizeof(buf)) == sizeof(buf)) { + s = *((size_t *) buf); + close(fd); + } else #endif /* USE_DEV_RANDOM */ - s = (size_t)(time(0) ^ (size_t)0x55555555U); + s = (size_t) (time(0) ^ (size_t) 0x55555555U); - s |= (size_t)8U; /* ensure nonzero */ - s &= ~(size_t)7U; /* improve chances of fault for bad values */ + s |= (size_t) 8U; /* ensure nonzero */ + s &= ~(size_t) 7U; /* improve chances of fault for bad values */ - } + } #else /* (FOOTERS && !INSECURE) */ - s = (size_t)0x58585858U; + s = (size_t) 0x58585858U; #endif /* (FOOTERS && !INSECURE) */ - ACQUIRE_MAGIC_INIT_LOCK(); - if (mparams.magic == 0) { - mparams.magic = s; - /* Set up lock for main malloc area */ - INITIAL_LOCK(&gm->mutex); - gm->mflags = mparams.default_mflags; - } - RELEASE_MAGIC_INIT_LOCK(); + ACQUIRE_MAGIC_INIT_LOCK(); + if (mparams.magic == 0) { + mparams.magic = s; + /* Set up lock for main malloc area */ + INITIAL_LOCK(&gm->mutex); + gm->mflags = mparams.default_mflags; + } + RELEASE_MAGIC_INIT_LOCK(); #ifndef WIN32 - mparams.page_size = malloc_getpagesize; - mparams.granularity = ((DEFAULT_GRANULARITY != 0)? - DEFAULT_GRANULARITY : mparams.page_size); + mparams.page_size = malloc_getpagesize; + mparams.granularity = ((DEFAULT_GRANULARITY != 0) ? + DEFAULT_GRANULARITY : mparams.page_size); #else /* WIN32 */ - { - SYSTEM_INFO system_info; - GetSystemInfo(&system_info); - mparams.page_size = system_info.dwPageSize; - mparams.granularity = system_info.dwAllocationGranularity; - } + { + SYSTEM_INFO system_info; + GetSystemInfo(&system_info); + mparams.page_size = system_info.dwPageSize; + mparams.granularity = system_info.dwAllocationGranularity; + } #endif /* WIN32 */ - /* Sanity-check configuration: - size_t must be unsigned and as wide as pointer type. - ints must be at least 4 bytes. - alignment must be at least 8. - Alignment, min chunk size, and page size must all be powers of 2. - */ - if ((sizeof(size_t) != sizeof(char*)) || - (MAX_SIZE_T < MIN_CHUNK_SIZE) || - (sizeof(int) < 4) || - (MALLOC_ALIGNMENT < (size_t)8U) || - ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) || - ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) || - ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) || - ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0)) - ABORT; - } - return 0; + /* Sanity-check configuration: + size_t must be unsigned and as wide as pointer type. + ints must be at least 4 bytes. + alignment must be at least 8. + Alignment, min chunk size, and page size must all be powers of 2. + */ + if ((sizeof(size_t) != sizeof(char *)) || + (MAX_SIZE_T < MIN_CHUNK_SIZE) || + (sizeof(int) < 4) || + (MALLOC_ALIGNMENT < (size_t) 8U) || + ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT - SIZE_T_ONE)) != 0) || + ((MCHUNK_SIZE & (MCHUNK_SIZE - SIZE_T_ONE)) != 0) || + ((mparams.granularity & (mparams.granularity - SIZE_T_ONE)) != 0) + || ((mparams.page_size & (mparams.page_size - SIZE_T_ONE)) != 0)) + ABORT; + } + return 0; } /* support for mallopt */ -static int change_mparam(int param_number, int value) { - size_t val = (size_t)value; - init_mparams(); - switch(param_number) { - case M_TRIM_THRESHOLD: - mparams.trim_threshold = val; - return 1; - case M_GRANULARITY: - if (val >= mparams.page_size && ((val & (val-1)) == 0)) { - mparams.granularity = val; - return 1; +static int +change_mparam(int param_number, int value) +{ + size_t val = (size_t) value; + init_mparams(); + switch (param_number) { + case M_TRIM_THRESHOLD: + mparams.trim_threshold = val; + return 1; + case M_GRANULARITY: + if (val >= mparams.page_size && ((val & (val - 1)) == 0)) { + mparams.granularity = val; + return 1; + } else + return 0; + case M_MMAP_THRESHOLD: + mparams.mmap_threshold = val; + return 1; + default: + return 0; } - else - return 0; - case M_MMAP_THRESHOLD: - mparams.mmap_threshold = val; - return 1; - default: - return 0; - } } #if DEBUG /* ------------------------- Debugging Support --------------------------- */ /* Check properties of any chunk, whether free, inuse, mmapped etc */ -static void do_check_any_chunk(mstate m, mchunkptr p) { - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); +static void +do_check_any_chunk(mstate m, mchunkptr p) +{ + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); } /* Check properties of top chunk */ -static void do_check_top_chunk(mstate m, mchunkptr p) { - msegmentptr sp = segment_holding(m, (char*)p); - size_t sz = chunksize(p); - assert(sp != 0); - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); - assert(sz == m->topsize); - assert(sz > 0); - assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE); - assert(pinuse(p)); - assert(!next_pinuse(p)); +static void +do_check_top_chunk(mstate m, mchunkptr p) +{ + msegmentptr sp = segment_holding(m, (char *) p); + size_t sz = chunksize(p); + assert(sp != 0); + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); + assert(sz == m->topsize); + assert(sz > 0); + assert(sz == ((sp->base + sp->size) - (char *) p) - TOP_FOOT_SIZE); + assert(pinuse(p)); + assert(!next_pinuse(p)); } /* Check properties of (inuse) mmapped chunks */ -static void do_check_mmapped_chunk(mstate m, mchunkptr p) { - size_t sz = chunksize(p); - size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD); - assert(is_mmapped(p)); - assert(use_mmap(m)); - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); - assert(!is_small(sz)); - assert((len & (mparams.page_size-SIZE_T_ONE)) == 0); - assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); - assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0); +static void +do_check_mmapped_chunk(mstate m, mchunkptr p) +{ + size_t sz = chunksize(p); + size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD); + assert(is_mmapped(p)); + assert(use_mmap(m)); + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); + assert(!is_small(sz)); + assert((len & (mparams.page_size - SIZE_T_ONE)) == 0); + assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); + assert(chunk_plus_offset(p, sz + SIZE_T_SIZE)->head == 0); } /* Check properties of inuse chunks */ -static void do_check_inuse_chunk(mstate m, mchunkptr p) { - do_check_any_chunk(m, p); - assert(cinuse(p)); - assert(next_pinuse(p)); - /* If not pinuse and not mmapped, previous chunk has OK offset */ - assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); - if (is_mmapped(p)) - do_check_mmapped_chunk(m, p); +static void +do_check_inuse_chunk(mstate m, mchunkptr p) +{ + do_check_any_chunk(m, p); + assert(cinuse(p)); + assert(next_pinuse(p)); + /* If not pinuse and not mmapped, previous chunk has OK offset */ + assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); + if (is_mmapped(p)) + do_check_mmapped_chunk(m, p); } /* Check properties of free chunks */ -static void do_check_free_chunk(mstate m, mchunkptr p) { - size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); - mchunkptr next = chunk_plus_offset(p, sz); - do_check_any_chunk(m, p); - assert(!cinuse(p)); - assert(!next_pinuse(p)); - assert (!is_mmapped(p)); - if (p != m->dv && p != m->top) { - if (sz >= MIN_CHUNK_SIZE) { - assert((sz & CHUNK_ALIGN_MASK) == 0); - assert(is_aligned(chunk2mem(p))); - assert(next->prev_foot == sz); - assert(pinuse(p)); - assert (next == m->top || cinuse(next)); - assert(p->fd->bk == p); - assert(p->bk->fd == p); +static void +do_check_free_chunk(mstate m, mchunkptr p) +{ + size_t sz = p->head & ~(PINUSE_BIT | CINUSE_BIT); + mchunkptr next = chunk_plus_offset(p, sz); + do_check_any_chunk(m, p); + assert(!cinuse(p)); + assert(!next_pinuse(p)); + assert(!is_mmapped(p)); + if (p != m->dv && p != m->top) { + if (sz >= MIN_CHUNK_SIZE) { + assert((sz & CHUNK_ALIGN_MASK) == 0); + assert(is_aligned(chunk2mem(p))); + assert(next->prev_foot == sz); + assert(pinuse(p)); + assert(next == m->top || cinuse(next)); + assert(p->fd->bk == p); + assert(p->bk->fd == p); + } else /* markers are always of size SIZE_T_SIZE */ + assert(sz == SIZE_T_SIZE); } - else /* markers are always of size SIZE_T_SIZE */ - assert(sz == SIZE_T_SIZE); - } } /* Check properties of malloced chunks at the point they are malloced */ -static void do_check_malloced_chunk(mstate m, void* mem, size_t s) { - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); - do_check_inuse_chunk(m, p); - assert((sz & CHUNK_ALIGN_MASK) == 0); - assert(sz >= MIN_CHUNK_SIZE); - assert(sz >= s); - /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ - assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); - } +static void +do_check_malloced_chunk(mstate m, void *mem, size_t s) +{ + if (mem != 0) { + mchunkptr p = mem2chunk(mem); + size_t sz = p->head & ~(PINUSE_BIT | CINUSE_BIT); + do_check_inuse_chunk(m, p); + assert((sz & CHUNK_ALIGN_MASK) == 0); + assert(sz >= MIN_CHUNK_SIZE); + assert(sz >= s); + /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ + assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); + } } /* Check a tree and its subtrees. */ -static void do_check_tree(mstate m, tchunkptr t) { - tchunkptr head = 0; - tchunkptr u = t; - bindex_t tindex = t->index; - size_t tsize = chunksize(t); - bindex_t idx; - compute_tree_index(tsize, idx); - assert(tindex == idx); - assert(tsize >= MIN_LARGE_SIZE); - assert(tsize >= minsize_for_tree_index(idx)); - assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1)))); - - do { /* traverse through chain of same-sized nodes */ - do_check_any_chunk(m, ((mchunkptr)u)); - assert(u->index == tindex); - assert(chunksize(u) == tsize); - assert(!cinuse(u)); - assert(!next_pinuse(u)); - assert(u->fd->bk == u); - assert(u->bk->fd == u); - if (u->parent == 0) { - assert(u->child[0] == 0); - assert(u->child[1] == 0); - } - else { - assert(head == 0); /* only one node on chain has parent */ - head = u; - assert(u->parent != u); - assert (u->parent->child[0] == u || - u->parent->child[1] == u || - *((tbinptr*)(u->parent)) == u); - if (u->child[0] != 0) { - assert(u->child[0]->parent == u); - assert(u->child[0] != u); - do_check_tree(m, u->child[0]); - } - if (u->child[1] != 0) { - assert(u->child[1]->parent == u); - assert(u->child[1] != u); - do_check_tree(m, u->child[1]); - } - if (u->child[0] != 0 && u->child[1] != 0) { - assert(chunksize(u->child[0]) < chunksize(u->child[1])); - } - } - u = u->fd; - } while (u != t); - assert(head != 0); +static void +do_check_tree(mstate m, tchunkptr t) +{ + tchunkptr head = 0; + tchunkptr u = t; + bindex_t tindex = t->index; + size_t tsize = chunksize(t); + bindex_t idx; + compute_tree_index(tsize, idx); + assert(tindex == idx); + assert(tsize >= MIN_LARGE_SIZE); + assert(tsize >= minsize_for_tree_index(idx)); + assert((idx == NTREEBINS - 1) + || (tsize < minsize_for_tree_index((idx + 1)))); + + do { /* traverse through chain of same-sized nodes */ + do_check_any_chunk(m, ((mchunkptr) u)); + assert(u->index == tindex); + assert(chunksize(u) == tsize); + assert(!cinuse(u)); + assert(!next_pinuse(u)); + assert(u->fd->bk == u); + assert(u->bk->fd == u); + if (u->parent == 0) { + assert(u->child[0] == 0); + assert(u->child[1] == 0); + } else { + assert(head == 0); /* only one node on chain has parent */ + head = u; + assert(u->parent != u); + assert(u->parent->child[0] == u || + u->parent->child[1] == u || + *((tbinptr *) (u->parent)) == u); + if (u->child[0] != 0) { + assert(u->child[0]->parent == u); + assert(u->child[0] != u); + do_check_tree(m, u->child[0]); + } + if (u->child[1] != 0) { + assert(u->child[1]->parent == u); + assert(u->child[1] != u); + do_check_tree(m, u->child[1]); + } + if (u->child[0] != 0 && u->child[1] != 0) { + assert(chunksize(u->child[0]) < chunksize(u->child[1])); + } + } + u = u->fd; + } while (u != t); + assert(head != 0); } /* Check all the chunks in a treebin. */ -static void do_check_treebin(mstate m, bindex_t i) { - tbinptr* tb = treebin_at(m, i); - tchunkptr t = *tb; - int empty = (m->treemap & (1U << i)) == 0; - if (t == 0) - assert(empty); - if (!empty) - do_check_tree(m, t); +static void +do_check_treebin(mstate m, bindex_t i) +{ + tbinptr *tb = treebin_at(m, i); + tchunkptr t = *tb; + int empty = (m->treemap & (1U << i)) == 0; + if (t == 0) + assert(empty); + if (!empty) + do_check_tree(m, t); } /* Check all the chunks in a smallbin. */ -static void do_check_smallbin(mstate m, bindex_t i) { - sbinptr b = smallbin_at(m, i); - mchunkptr p = b->bk; - unsigned int empty = (m->smallmap & (1U << i)) == 0; - if (p == b) - assert(empty); - if (!empty) { - for (; p != b; p = p->bk) { - size_t size = chunksize(p); - mchunkptr q; - /* each chunk claims to be free */ - do_check_free_chunk(m, p); - /* chunk belongs in bin */ - assert(small_index(size) == i); - assert(p->bk == b || chunksize(p->bk) == chunksize(p)); - /* chunk is followed by an inuse chunk */ - q = next_chunk(p); - if (q->head != FENCEPOST_HEAD) - do_check_inuse_chunk(m, q); +static void +do_check_smallbin(mstate m, bindex_t i) +{ + sbinptr b = smallbin_at(m, i); + mchunkptr p = b->bk; + unsigned int empty = (m->smallmap & (1U << i)) == 0; + if (p == b) + assert(empty); + if (!empty) { + for (; p != b; p = p->bk) { + size_t size = chunksize(p); + mchunkptr q; + /* each chunk claims to be free */ + do_check_free_chunk(m, p); + /* chunk belongs in bin */ + assert(small_index(size) == i); + assert(p->bk == b || chunksize(p->bk) == chunksize(p)); + /* chunk is followed by an inuse chunk */ + q = next_chunk(p); + if (q->head != FENCEPOST_HEAD) + do_check_inuse_chunk(m, q); + } } - } } /* Find x in a bin. Used in other check functions. */ -static int bin_find(mstate m, mchunkptr x) { - size_t size = chunksize(x); - if (is_small(size)) { - bindex_t sidx = small_index(size); - sbinptr b = smallbin_at(m, sidx); - if (smallmap_is_marked(m, sidx)) { - mchunkptr p = b; - do { - if (p == x) - return 1; - } while ((p = p->fd) != b); - } - } - else { - bindex_t tidx; - compute_tree_index(size, tidx); - if (treemap_is_marked(m, tidx)) { - tchunkptr t = *treebin_at(m, tidx); - size_t sizebits = size << leftshift_for_tree_index(tidx); - while (t != 0 && chunksize(t) != size) { - t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; - sizebits <<= 1; - } - if (t != 0) { - tchunkptr u = t; - do { - if (u == (tchunkptr)x) - return 1; - } while ((u = u->fd) != t); - } +static int +bin_find(mstate m, mchunkptr x) +{ + size_t size = chunksize(x); + if (is_small(size)) { + bindex_t sidx = small_index(size); + sbinptr b = smallbin_at(m, sidx); + if (smallmap_is_marked(m, sidx)) { + mchunkptr p = b; + do { + if (p == x) + return 1; + } while ((p = p->fd) != b); + } + } else { + bindex_t tidx; + compute_tree_index(size, tidx); + if (treemap_is_marked(m, tidx)) { + tchunkptr t = *treebin_at(m, tidx); + size_t sizebits = size << leftshift_for_tree_index(tidx); + while (t != 0 && chunksize(t) != size) { + t = t->child[(sizebits >> (SIZE_T_BITSIZE - SIZE_T_ONE)) & 1]; + sizebits <<= 1; + } + if (t != 0) { + tchunkptr u = t; + do { + if (u == (tchunkptr) x) + return 1; + } while ((u = u->fd) != t); + } + } } - } - return 0; + return 0; } /* Traverse each chunk and check it; return total */ -static size_t traverse_and_check(mstate m) { - size_t sum = 0; - if (is_initialized(m)) { - msegmentptr s = &m->seg; - sum += m->topsize + TOP_FOOT_SIZE; - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - mchunkptr lastq = 0; - assert(pinuse(q)); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - sum += chunksize(q); - if (cinuse(q)) { - assert(!bin_find(m, q)); - do_check_inuse_chunk(m, q); - } - else { - assert(q == m->dv || bin_find(m, q)); - assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */ - do_check_free_chunk(m, q); +static size_t +traverse_and_check(mstate m) +{ + size_t sum = 0; + if (is_initialized(m)) { + msegmentptr s = &m->seg; + sum += m->topsize + TOP_FOOT_SIZE; + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + mchunkptr lastq = 0; + assert(pinuse(q)); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + sum += chunksize(q); + if (cinuse(q)) { + assert(!bin_find(m, q)); + do_check_inuse_chunk(m, q); + } else { + assert(q == m->dv || bin_find(m, q)); + assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */ + do_check_free_chunk(m, q); + } + lastq = q; + q = next_chunk(q); + } + s = s->next; } - lastq = q; - q = next_chunk(q); - } - s = s->next; } - } - return sum; + return sum; } /* Check all properties of malloc_state. */ -static void do_check_malloc_state(mstate m) { - bindex_t i; - size_t total; - /* check bins */ - for (i = 0; i < NSMALLBINS; ++i) - do_check_smallbin(m, i); - for (i = 0; i < NTREEBINS; ++i) - do_check_treebin(m, i); - - if (m->dvsize != 0) { /* check dv chunk */ - do_check_any_chunk(m, m->dv); - assert(m->dvsize == chunksize(m->dv)); - assert(m->dvsize >= MIN_CHUNK_SIZE); - assert(bin_find(m, m->dv) == 0); - } +static void +do_check_malloc_state(mstate m) +{ + bindex_t i; + size_t total; + /* check bins */ + for (i = 0; i < NSMALLBINS; ++i) + do_check_smallbin(m, i); + for (i = 0; i < NTREEBINS; ++i) + do_check_treebin(m, i); + + if (m->dvsize != 0) { /* check dv chunk */ + do_check_any_chunk(m, m->dv); + assert(m->dvsize == chunksize(m->dv)); + assert(m->dvsize >= MIN_CHUNK_SIZE); + assert(bin_find(m, m->dv) == 0); + } - if (m->top != 0) { /* check top chunk */ - do_check_top_chunk(m, m->top); - assert(m->topsize == chunksize(m->top)); - assert(m->topsize > 0); - assert(bin_find(m, m->top) == 0); - } + if (m->top != 0) { /* check top chunk */ + do_check_top_chunk(m, m->top); + assert(m->topsize == chunksize(m->top)); + assert(m->topsize > 0); + assert(bin_find(m, m->top) == 0); + } - total = traverse_and_check(m); - assert(total <= m->footprint); - assert(m->footprint <= m->max_footprint); + total = traverse_and_check(m); + assert(total <= m->footprint); + assert(m->footprint <= m->max_footprint); } #endif /* DEBUG */ /* ----------------------------- statistics ------------------------------ */ #if !NO_MALLINFO -static struct mallinfo internal_mallinfo(mstate m) { - struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - if (!PREACTION(m)) { - check_malloc_state(m); - if (is_initialized(m)) { - size_t nfree = SIZE_T_ONE; /* top always free */ - size_t mfree = m->topsize + TOP_FOOT_SIZE; - size_t sum = mfree; - msegmentptr s = &m->seg; - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - size_t sz = chunksize(q); - sum += sz; - if (!cinuse(q)) { - mfree += sz; - ++nfree; - } - q = next_chunk(q); +static struct mallinfo +internal_mallinfo(mstate m) +{ + struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + if (!PREACTION(m)) { + check_malloc_state(m); + if (is_initialized(m)) { + size_t nfree = SIZE_T_ONE; /* top always free */ + size_t mfree = m->topsize + TOP_FOOT_SIZE; + size_t sum = mfree; + msegmentptr s = &m->seg; + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + size_t sz = chunksize(q); + sum += sz; + if (!cinuse(q)) { + mfree += sz; + ++nfree; + } + q = next_chunk(q); + } + s = s->next; + } + + nm.arena = sum; + nm.ordblks = nfree; + nm.hblkhd = m->footprint - sum; + nm.usmblks = m->max_footprint; + nm.uordblks = m->footprint - mfree; + nm.fordblks = mfree; + nm.keepcost = m->topsize; } - s = s->next; - } - nm.arena = sum; - nm.ordblks = nfree; - nm.hblkhd = m->footprint - sum; - nm.usmblks = m->max_footprint; - nm.uordblks = m->footprint - mfree; - nm.fordblks = mfree; - nm.keepcost = m->topsize; + POSTACTION(m); } - - POSTACTION(m); - } - return nm; + return nm; } #endif /* !NO_MALLINFO */ -static void internal_malloc_stats(mstate m) { - if (!PREACTION(m)) { - size_t maxfp = 0; - size_t fp = 0; - size_t used = 0; - check_malloc_state(m); - if (is_initialized(m)) { - msegmentptr s = &m->seg; - maxfp = m->max_footprint; - fp = m->footprint; - used = fp - (m->topsize + TOP_FOOT_SIZE); - - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - if (!cinuse(q)) - used -= chunksize(q); - q = next_chunk(q); +static void +internal_malloc_stats(mstate m) +{ + if (!PREACTION(m)) { + size_t maxfp = 0; + size_t fp = 0; + size_t used = 0; + check_malloc_state(m); + if (is_initialized(m)) { + msegmentptr s = &m->seg; + maxfp = m->max_footprint; + fp = m->footprint; + used = fp - (m->topsize + TOP_FOOT_SIZE); + + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + if (!cinuse(q)) + used -= chunksize(q); + q = next_chunk(q); + } + s = s->next; + } } - s = s->next; - } - } - #ifndef LACKS_STDIO_H - fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp)); - fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp)); - fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used)); + fprintf(stderr, "max system bytes = %10lu\n", + (unsigned long) (maxfp)); + fprintf(stderr, "system bytes = %10lu\n", (unsigned long) (fp)); + fprintf(stderr, "in use bytes = %10lu\n", (unsigned long) (used)); #endif - POSTACTION(m); - } + POSTACTION(m); + } } /* ----------------------- Operations on smallbins ----------------------- */ @@ -3162,905 +3233,927 @@ static void internal_malloc_stats(mstate m) { */ /* Malloc using mmap */ -static void* mmap_alloc(mstate m, size_t nb) { - size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - if (mmsize > nb) { /* Check for wrap around 0 */ - char* mm = (char*)(DIRECT_MMAP(mmsize)); - if (mm != CMFAIL) { - size_t offset = align_offset(chunk2mem(mm)); - size_t psize = mmsize - offset - MMAP_FOOT_PAD; - mchunkptr p = (mchunkptr)(mm + offset); - p->prev_foot = offset | IS_MMAPPED_BIT; - (p)->head = (psize|CINUSE_BIT); - mark_inuse_foot(m, p, psize); - chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0; - - if (mm < m->least_addr) - m->least_addr = mm; - if ((m->footprint += mmsize) > m->max_footprint) - m->max_footprint = m->footprint; - assert(is_aligned(chunk2mem(p))); - check_mmapped_chunk(m, p); - return chunk2mem(p); +static void * +mmap_alloc(mstate m, size_t nb) +{ + size_t mmsize = + granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); + if (mmsize > nb) { /* Check for wrap around 0 */ + char *mm = (char *) (DIRECT_MMAP(mmsize)); + if (mm != CMFAIL) { + size_t offset = align_offset(chunk2mem(mm)); + size_t psize = mmsize - offset - MMAP_FOOT_PAD; + mchunkptr p = (mchunkptr) (mm + offset); + p->prev_foot = offset | IS_MMAPPED_BIT; + (p)->head = (psize | CINUSE_BIT); + mark_inuse_foot(m, p, psize); + chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; + chunk_plus_offset(p, psize + SIZE_T_SIZE)->head = 0; + + if (mm < m->least_addr) + m->least_addr = mm; + if ((m->footprint += mmsize) > m->max_footprint) + m->max_footprint = m->footprint; + assert(is_aligned(chunk2mem(p))); + check_mmapped_chunk(m, p); + return chunk2mem(p); + } } - } - return 0; + return 0; } /* Realloc using mmap */ -static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) { - size_t oldsize = chunksize(oldp); - if (is_small(nb)) /* Can't shrink mmap regions below small size */ - return 0; - /* Keep old chunk if big enough but not too big */ - if (oldsize >= nb + SIZE_T_SIZE && - (oldsize - nb) <= (mparams.granularity << 1)) - return oldp; - else { - size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT; - size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; - size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES + - CHUNK_ALIGN_MASK); - char* cp = (char*)CALL_MREMAP((char*)oldp - offset, - oldmmsize, newmmsize, 1); - if (cp != CMFAIL) { - mchunkptr newp = (mchunkptr)(cp + offset); - size_t psize = newmmsize - offset - MMAP_FOOT_PAD; - newp->head = (psize|CINUSE_BIT); - mark_inuse_foot(m, newp, psize); - chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0; - - if (cp < m->least_addr) - m->least_addr = cp; - if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) - m->max_footprint = m->footprint; - check_mmapped_chunk(m, newp); - return newp; +static mchunkptr +mmap_resize(mstate m, mchunkptr oldp, size_t nb) +{ + size_t oldsize = chunksize(oldp); + if (is_small(nb)) /* Can't shrink mmap regions below small size */ + return 0; + /* Keep old chunk if big enough but not too big */ + if (oldsize >= nb + SIZE_T_SIZE && + (oldsize - nb) <= (mparams.granularity << 1)) + return oldp; + else { + size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT; + size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; + size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES + + CHUNK_ALIGN_MASK); + char *cp = (char *) CALL_MREMAP((char *) oldp - offset, + oldmmsize, newmmsize, 1); + if (cp != CMFAIL) { + mchunkptr newp = (mchunkptr) (cp + offset); + size_t psize = newmmsize - offset - MMAP_FOOT_PAD; + newp->head = (psize | CINUSE_BIT); + mark_inuse_foot(m, newp, psize); + chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; + chunk_plus_offset(newp, psize + SIZE_T_SIZE)->head = 0; + + if (cp < m->least_addr) + m->least_addr = cp; + if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) + m->max_footprint = m->footprint; + check_mmapped_chunk(m, newp); + return newp; + } } - } - return 0; + return 0; } /* -------------------------- mspace management -------------------------- */ /* Initialize top chunk and its size */ -static void init_top(mstate m, mchunkptr p, size_t psize) { - /* Ensure alignment */ - size_t offset = align_offset(chunk2mem(p)); - p = (mchunkptr)((char*)p + offset); - psize -= offset; - - m->top = p; - m->topsize = psize; - p->head = psize | PINUSE_BIT; - /* set size of fake trailing chunk holding overhead space only once */ - chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; - m->trim_check = mparams.trim_threshold; /* reset on each update */ +static void +init_top(mstate m, mchunkptr p, size_t psize) +{ + /* Ensure alignment */ + size_t offset = align_offset(chunk2mem(p)); + p = (mchunkptr) ((char *) p + offset); + psize -= offset; + + m->top = p; + m->topsize = psize; + p->head = psize | PINUSE_BIT; + /* set size of fake trailing chunk holding overhead space only once */ + chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; + m->trim_check = mparams.trim_threshold; /* reset on each update */ } /* Initialize bins for a new mstate that is otherwise zeroed out */ -static void init_bins(mstate m) { - /* Establish circular links for smallbins */ - bindex_t i; - for (i = 0; i < NSMALLBINS; ++i) { - sbinptr bin = smallbin_at(m,i); - bin->fd = bin->bk = bin; - } +static void +init_bins(mstate m) +{ + /* Establish circular links for smallbins */ + bindex_t i; + for (i = 0; i < NSMALLBINS; ++i) { + sbinptr bin = smallbin_at(m, i); + bin->fd = bin->bk = bin; + } } #if PROCEED_ON_ERROR /* default corruption action */ -static void reset_on_error(mstate m) { - int i; - ++malloc_corruption_error_count; - /* Reinitialize fields to forget about all memory */ - m->smallbins = m->treebins = 0; - m->dvsize = m->topsize = 0; - m->seg.base = 0; - m->seg.size = 0; - m->seg.next = 0; - m->top = m->dv = 0; - for (i = 0; i < NTREEBINS; ++i) - *treebin_at(m, i) = 0; - init_bins(m); +static void +reset_on_error(mstate m) +{ + int i; + ++malloc_corruption_error_count; + /* Reinitialize fields to forget about all memory */ + m->smallbins = m->treebins = 0; + m->dvsize = m->topsize = 0; + m->seg.base = 0; + m->seg.size = 0; + m->seg.next = 0; + m->top = m->dv = 0; + for (i = 0; i < NTREEBINS; ++i) + *treebin_at(m, i) = 0; + init_bins(m); } #endif /* PROCEED_ON_ERROR */ /* Allocate chunk and prepend remainder with chunk in successor base. */ -static void* prepend_alloc(mstate m, char* newbase, char* oldbase, - size_t nb) { - mchunkptr p = align_as_chunk(newbase); - mchunkptr oldfirst = align_as_chunk(oldbase); - size_t psize = (char*)oldfirst - (char*)p; - mchunkptr q = chunk_plus_offset(p, nb); - size_t qsize = psize - nb; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - - assert((char*)oldfirst > (char*)q); - assert(pinuse(oldfirst)); - assert(qsize >= MIN_CHUNK_SIZE); - - /* consolidate remainder with first chunk of old base */ - if (oldfirst == m->top) { - size_t tsize = m->topsize += qsize; - m->top = q; - q->head = tsize | PINUSE_BIT; - check_top_chunk(m, q); - } - else if (oldfirst == m->dv) { - size_t dsize = m->dvsize += qsize; - m->dv = q; - set_size_and_pinuse_of_free_chunk(q, dsize); - } - else { - if (!cinuse(oldfirst)) { - size_t nsize = chunksize(oldfirst); - unlink_chunk(m, oldfirst, nsize); - oldfirst = chunk_plus_offset(oldfirst, nsize); - qsize += nsize; +static void * +prepend_alloc(mstate m, char *newbase, char *oldbase, size_t nb) +{ + mchunkptr p = align_as_chunk(newbase); + mchunkptr oldfirst = align_as_chunk(oldbase); + size_t psize = (char *) oldfirst - (char *) p; + mchunkptr q = chunk_plus_offset(p, nb); + size_t qsize = psize - nb; + set_size_and_pinuse_of_inuse_chunk(m, p, nb); + + assert((char *) oldfirst > (char *) q); + assert(pinuse(oldfirst)); + assert(qsize >= MIN_CHUNK_SIZE); + + /* consolidate remainder with first chunk of old base */ + if (oldfirst == m->top) { + size_t tsize = m->topsize += qsize; + m->top = q; + q->head = tsize | PINUSE_BIT; + check_top_chunk(m, q); + } else if (oldfirst == m->dv) { + size_t dsize = m->dvsize += qsize; + m->dv = q; + set_size_and_pinuse_of_free_chunk(q, dsize); + } else { + if (!cinuse(oldfirst)) { + size_t nsize = chunksize(oldfirst); + unlink_chunk(m, oldfirst, nsize); + oldfirst = chunk_plus_offset(oldfirst, nsize); + qsize += nsize; + } + set_free_with_pinuse(q, qsize, oldfirst); + insert_chunk(m, q, qsize); + check_free_chunk(m, q); } - set_free_with_pinuse(q, qsize, oldfirst); - insert_chunk(m, q, qsize); - check_free_chunk(m, q); - } - check_malloced_chunk(m, chunk2mem(p), nb); - return chunk2mem(p); + check_malloced_chunk(m, chunk2mem(p), nb); + return chunk2mem(p); } /* Add a segment to hold a new noncontiguous region */ -static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) { - /* Determine locations and sizes of segment, fenceposts, old top */ - char* old_top = (char*)m->top; - msegmentptr oldsp = segment_holding(m, old_top); - char* old_end = oldsp->base + oldsp->size; - size_t ssize = pad_request(sizeof(struct malloc_segment)); - char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - size_t offset = align_offset(chunk2mem(rawsp)); - char* asp = rawsp + offset; - char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp; - mchunkptr sp = (mchunkptr)csp; - msegmentptr ss = (msegmentptr)(chunk2mem(sp)); - mchunkptr tnext = chunk_plus_offset(sp, ssize); - mchunkptr p = tnext; - int nfences = 0; - - /* reset top to new space */ - init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); - - /* Set up segment record */ - assert(is_aligned(ss)); - set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); - *ss = m->seg; /* Push current record */ - m->seg.base = tbase; - m->seg.size = tsize; - m->seg.sflags = mmapped; - m->seg.next = ss; - - /* Insert trailing fenceposts */ - for (;;) { - mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); - p->head = FENCEPOST_HEAD; - ++nfences; - if ((char*)(&(nextp->head)) < old_end) - p = nextp; - else - break; - } - assert(nfences >= 2); - - /* Insert the rest of old top into a bin as an ordinary free chunk */ - if (csp != old_top) { - mchunkptr q = (mchunkptr)old_top; - size_t psize = csp - old_top; - mchunkptr tn = chunk_plus_offset(q, psize); - set_free_with_pinuse(q, psize, tn); - insert_chunk(m, q, psize); - } +static void +add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped) +{ + /* Determine locations and sizes of segment, fenceposts, old top */ + char *old_top = (char *) m->top; + msegmentptr oldsp = segment_holding(m, old_top); + char *old_end = oldsp->base + oldsp->size; + size_t ssize = pad_request(sizeof(struct malloc_segment)); + char *rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); + size_t offset = align_offset(chunk2mem(rawsp)); + char *asp = rawsp + offset; + char *csp = (asp < (old_top + MIN_CHUNK_SIZE)) ? old_top : asp; + mchunkptr sp = (mchunkptr) csp; + msegmentptr ss = (msegmentptr) (chunk2mem(sp)); + mchunkptr tnext = chunk_plus_offset(sp, ssize); + mchunkptr p = tnext; + int nfences = 0; + + /* reset top to new space */ + init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE); + + /* Set up segment record */ + assert(is_aligned(ss)); + set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); + *ss = m->seg; /* Push current record */ + m->seg.base = tbase; + m->seg.size = tsize; + m->seg.sflags = mmapped; + m->seg.next = ss; + + /* Insert trailing fenceposts */ + for (;;) { + mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); + p->head = FENCEPOST_HEAD; + ++nfences; + if ((char *) (&(nextp->head)) < old_end) + p = nextp; + else + break; + } + assert(nfences >= 2); + + /* Insert the rest of old top into a bin as an ordinary free chunk */ + if (csp != old_top) { + mchunkptr q = (mchunkptr) old_top; + size_t psize = csp - old_top; + mchunkptr tn = chunk_plus_offset(q, psize); + set_free_with_pinuse(q, psize, tn); + insert_chunk(m, q, psize); + } - check_top_chunk(m, m->top); + check_top_chunk(m, m->top); } /* -------------------------- System allocation -------------------------- */ /* Get memory from system using MORECORE or MMAP */ -static void* sys_alloc(mstate m, size_t nb) { - char* tbase = CMFAIL; - size_t tsize = 0; - flag_t mmap_flag = 0; - - init_mparams(); - - /* Directly map large chunks */ - if (use_mmap(m) && nb >= mparams.mmap_threshold) { - void* mem = mmap_alloc(m, nb); - if (mem != 0) - return mem; - } +static void * +sys_alloc(mstate m, size_t nb) +{ + char *tbase = CMFAIL; + size_t tsize = 0; + flag_t mmap_flag = 0; + + init_mparams(); + + /* Directly map large chunks */ + if (use_mmap(m) && nb >= mparams.mmap_threshold) { + void *mem = mmap_alloc(m, nb); + if (mem != 0) + return mem; + } - /* - Try getting memory in any of three ways (in most-preferred to - least-preferred order): - 1. A call to MORECORE that can normally contiguously extend memory. + /* + Try getting memory in any of three ways (in most-preferred to + least-preferred order): + 1. A call to MORECORE that can normally contiguously extend memory. (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or or main space is mmapped or a previous contiguous call failed) - 2. A call to MMAP new space (disabled if not HAVE_MMAP). + 2. A call to MMAP new space (disabled if not HAVE_MMAP). Note that under the default settings, if MORECORE is unable to fulfill a request, and HAVE_MMAP is true, then mmap is used as a noncontiguous system allocator. This is a useful backup strategy for systems with holes in address spaces -- in this case sbrk cannot contiguously expand the heap, but mmap may be able to find space. - 3. A call to MORECORE that cannot usually contiguously extend memory. + 3. A call to MORECORE that cannot usually contiguously extend memory. (disabled if not HAVE_MORECORE) - */ - - if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { - char* br = CMFAIL; - msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top); - size_t asize = 0; - ACQUIRE_MORECORE_LOCK(); - - if (ss == 0) { /* First time through or recovery */ - char* base = (char*)CALL_MORECORE(0); - if (base != CMFAIL) { - asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE); - /* Adjust to end on a page boundary */ - if (!is_page_aligned(base)) - asize += (page_align((size_t)base) - (size_t)base); - /* Can't call MORECORE if size is negative when treated as signed */ - if (asize < HALF_MAX_SIZE_T && - (br = (char*)(CALL_MORECORE(asize))) == base) { - tbase = base; - tsize = asize; + */ + + if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { + char *br = CMFAIL; + msegmentptr ss = + (m->top == 0) ? 0 : segment_holding(m, (char *) m->top); + size_t asize = 0; + ACQUIRE_MORECORE_LOCK(); + + if (ss == 0) { /* First time through or recovery */ + char *base = (char *) CALL_MORECORE(0); + if (base != CMFAIL) { + asize = + granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + + SIZE_T_ONE); + /* Adjust to end on a page boundary */ + if (!is_page_aligned(base)) + asize += (page_align((size_t) base) - (size_t) base); + /* Can't call MORECORE if size is negative when treated as signed */ + if (asize < HALF_MAX_SIZE_T && + (br = (char *) (CALL_MORECORE(asize))) == base) { + tbase = base; + tsize = asize; + } + } + } else { + /* Subtract out existing available top space from MORECORE request. */ + asize = + granularity_align(nb - m->topsize + TOP_FOOT_SIZE + + MALLOC_ALIGNMENT + SIZE_T_ONE); + /* Use mem here only if it did continuously extend old space */ + if (asize < HALF_MAX_SIZE_T && + (br = + (char *) (CALL_MORECORE(asize))) == ss->base + ss->size) { + tbase = br; + tsize = asize; + } } - } - } - else { - /* Subtract out existing available top space from MORECORE request. */ - asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE); - /* Use mem here only if it did continuously extend old space */ - if (asize < HALF_MAX_SIZE_T && - (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) { - tbase = br; - tsize = asize; - } - } - if (tbase == CMFAIL) { /* Cope with partial failure */ - if (br != CMFAIL) { /* Try to use/extend the space we did get */ - if (asize < HALF_MAX_SIZE_T && - asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) { - size_t esize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE - asize); - if (esize < HALF_MAX_SIZE_T) { - char* end = (char*)CALL_MORECORE(esize); - if (end != CMFAIL) - asize += esize; - else { /* Can't use; try to release */ - end = (char*)CALL_MORECORE(-asize); - br = CMFAIL; + if (tbase == CMFAIL) { /* Cope with partial failure */ + if (br != CMFAIL) { /* Try to use/extend the space we did get */ + if (asize < HALF_MAX_SIZE_T && + asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) { + size_t esize = + granularity_align(nb + TOP_FOOT_SIZE + + MALLOC_ALIGNMENT + SIZE_T_ONE - + asize); + if (esize < HALF_MAX_SIZE_T) { + char *end = (char *) CALL_MORECORE(esize); + if (end != CMFAIL) + asize += esize; + else { /* Can't use; try to release */ + end = (char *) CALL_MORECORE(-asize); + br = CMFAIL; + } + } + } } - } + if (br != CMFAIL) { /* Use the space we did get */ + tbase = br; + tsize = asize; + } else + disable_contiguous(m); /* Don't try contiguous path in the future */ } - } - if (br != CMFAIL) { /* Use the space we did get */ - tbase = br; - tsize = asize; - } - else - disable_contiguous(m); /* Don't try contiguous path in the future */ - } - - RELEASE_MORECORE_LOCK(); - } - if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ - size_t req = nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE; - size_t rsize = granularity_align(req); - if (rsize > nb) { /* Fail if wraps around zero */ - char* mp = (char*)(CALL_MMAP(rsize)); - if (mp != CMFAIL) { - tbase = mp; - tsize = rsize; - mmap_flag = IS_MMAPPED_BIT; - } + RELEASE_MORECORE_LOCK(); } - } - if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ - size_t asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE); - if (asize < HALF_MAX_SIZE_T) { - char* br = CMFAIL; - char* end = CMFAIL; - ACQUIRE_MORECORE_LOCK(); - br = (char*)(CALL_MORECORE(asize)); - end = (char*)(CALL_MORECORE(0)); - RELEASE_MORECORE_LOCK(); - if (br != CMFAIL && end != CMFAIL && br < end) { - size_t ssize = end - br; - if (ssize > nb + TOP_FOOT_SIZE) { - tbase = br; - tsize = ssize; + if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ + size_t req = nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE; + size_t rsize = granularity_align(req); + if (rsize > nb) { /* Fail if wraps around zero */ + char *mp = (char *) (CALL_MMAP(rsize)); + if (mp != CMFAIL) { + tbase = mp; + tsize = rsize; + mmap_flag = IS_MMAPPED_BIT; + } } - } } - } - if (tbase != CMFAIL) { - - if ((m->footprint += tsize) > m->max_footprint) - m->max_footprint = m->footprint; - - if (!is_initialized(m)) { /* first-time initialization */ - m->seg.base = m->least_addr = tbase; - m->seg.size = tsize; - m->seg.sflags = mmap_flag; - m->magic = mparams.magic; - init_bins(m); - if (is_global(m)) - init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); - else { - /* Offset top by embedded malloc_state */ - mchunkptr mn = next_chunk(mem2chunk(m)); - init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE); - } + if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ + size_t asize = + granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + + SIZE_T_ONE); + if (asize < HALF_MAX_SIZE_T) { + char *br = CMFAIL; + char *end = CMFAIL; + ACQUIRE_MORECORE_LOCK(); + br = (char *) (CALL_MORECORE(asize)); + end = (char *) (CALL_MORECORE(0)); + RELEASE_MORECORE_LOCK(); + if (br != CMFAIL && end != CMFAIL && br < end) { + size_t ssize = end - br; + if (ssize > nb + TOP_FOOT_SIZE) { + tbase = br; + tsize = ssize; + } + } + } } - else { - /* Try to merge with an existing segment */ - msegmentptr sp = &m->seg; - while (sp != 0 && tbase != sp->base + sp->size) - sp = sp->next; - if (sp != 0 && - !is_extern_segment(sp) && - (sp->sflags & IS_MMAPPED_BIT) == mmap_flag && - segment_holds(sp, m->top)) { /* append */ - sp->size += tsize; - init_top(m, m->top, m->topsize + tsize); - } - else { - if (tbase < m->least_addr) - m->least_addr = tbase; - sp = &m->seg; - while (sp != 0 && sp->base != tbase + tsize) - sp = sp->next; - if (sp != 0 && - !is_extern_segment(sp) && - (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) { - char* oldbase = sp->base; - sp->base = tbase; - sp->size += tsize; - return prepend_alloc(m, tbase, oldbase, nb); + if (tbase != CMFAIL) { + + if ((m->footprint += tsize) > m->max_footprint) + m->max_footprint = m->footprint; + + if (!is_initialized(m)) { /* first-time initialization */ + m->seg.base = m->least_addr = tbase; + m->seg.size = tsize; + m->seg.sflags = mmap_flag; + m->magic = mparams.magic; + init_bins(m); + if (is_global(m)) + init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE); + else { + /* Offset top by embedded malloc_state */ + mchunkptr mn = next_chunk(mem2chunk(m)); + init_top(m, mn, + (size_t) ((tbase + tsize) - (char *) mn) - + TOP_FOOT_SIZE); + } + } + + else { + /* Try to merge with an existing segment */ + msegmentptr sp = &m->seg; + while (sp != 0 && tbase != sp->base + sp->size) + sp = sp->next; + if (sp != 0 && !is_extern_segment(sp) && (sp->sflags & IS_MMAPPED_BIT) == mmap_flag && segment_holds(sp, m->top)) { /* append */ + sp->size += tsize; + init_top(m, m->top, m->topsize + tsize); + } else { + if (tbase < m->least_addr) + m->least_addr = tbase; + sp = &m->seg; + while (sp != 0 && sp->base != tbase + tsize) + sp = sp->next; + if (sp != 0 && + !is_extern_segment(sp) && + (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) { + char *oldbase = sp->base; + sp->base = tbase; + sp->size += tsize; + return prepend_alloc(m, tbase, oldbase, nb); + } else + add_segment(m, tbase, tsize, mmap_flag); + } } - else - add_segment(m, tbase, tsize, mmap_flag); - } - } - if (nb < m->topsize) { /* Allocate from new or extended top space */ - size_t rsize = m->topsize -= nb; - mchunkptr p = m->top; - mchunkptr r = m->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - check_top_chunk(m, m->top); - check_malloced_chunk(m, chunk2mem(p), nb); - return chunk2mem(p); + if (nb < m->topsize) { /* Allocate from new or extended top space */ + size_t rsize = m->topsize -= nb; + mchunkptr p = m->top; + mchunkptr r = m->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(m, p, nb); + check_top_chunk(m, m->top); + check_malloced_chunk(m, chunk2mem(p), nb); + return chunk2mem(p); + } } - } - MALLOC_FAILURE_ACTION; - return 0; + MALLOC_FAILURE_ACTION; + return 0; } /* ----------------------- system deallocation -------------------------- */ /* Unmap and unlink any mmapped segments that don't contain used chunks */ -static size_t release_unused_segments(mstate m) { - size_t released = 0; - msegmentptr pred = &m->seg; - msegmentptr sp = pred->next; - while (sp != 0) { - char* base = sp->base; - size_t size = sp->size; - msegmentptr next = sp->next; - if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { - mchunkptr p = align_as_chunk(base); - size_t psize = chunksize(p); - /* Can unmap if first chunk holds entire segment and not pinned */ - if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) { - tchunkptr tp = (tchunkptr)p; - assert(segment_holds(sp, (char*)sp)); - if (p == m->dv) { - m->dv = 0; - m->dvsize = 0; - } - else { - unlink_large_chunk(m, tp); - } - if (CALL_MUNMAP(base, size) == 0) { - released += size; - m->footprint -= size; - /* unlink obsoleted record */ - sp = pred; - sp->next = next; - } - else { /* back out if cannot unmap */ - insert_large_chunk(m, tp, psize); +static size_t +release_unused_segments(mstate m) +{ + size_t released = 0; + msegmentptr pred = &m->seg; + msegmentptr sp = pred->next; + while (sp != 0) { + char *base = sp->base; + size_t size = sp->size; + msegmentptr next = sp->next; + if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { + mchunkptr p = align_as_chunk(base); + size_t psize = chunksize(p); + /* Can unmap if first chunk holds entire segment and not pinned */ + if (!cinuse(p) + && (char *) p + psize >= base + size - TOP_FOOT_SIZE) { + tchunkptr tp = (tchunkptr) p; + assert(segment_holds(sp, (char *) sp)); + if (p == m->dv) { + m->dv = 0; + m->dvsize = 0; + } else { + unlink_large_chunk(m, tp); + } + if (CALL_MUNMAP(base, size) == 0) { + released += size; + m->footprint -= size; + /* unlink obsoleted record */ + sp = pred; + sp->next = next; + } else { /* back out if cannot unmap */ + insert_large_chunk(m, tp, psize); + } + } } - } + pred = sp; + sp = next; } - pred = sp; - sp = next; - } - return released; + return released; } -static int sys_trim(mstate m, size_t pad) { - size_t released = 0; - if (pad < MAX_REQUEST && is_initialized(m)) { - pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ - - if (m->topsize > pad) { - /* Shrink top space in granularity-size units, keeping at least one */ - size_t unit = mparams.granularity; - size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - - SIZE_T_ONE) * unit; - msegmentptr sp = segment_holding(m, (char*)m->top); - - if (!is_extern_segment(sp)) { - if (is_mmapped_segment(sp)) { - if (HAVE_MMAP && - sp->size >= extra && - !has_segment_link(m, sp)) { /* can't shrink if pinned */ - size_t newsize = sp->size - extra; - /* Prefer mremap, fall back to munmap */ - if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || - (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { - released = extra; +static int +sys_trim(mstate m, size_t pad) +{ + size_t released = 0; + if (pad < MAX_REQUEST && is_initialized(m)) { + pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ + + if (m->topsize > pad) { + /* Shrink top space in granularity-size units, keeping at least one */ + size_t unit = mparams.granularity; + size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - + SIZE_T_ONE) * unit; + msegmentptr sp = segment_holding(m, (char *) m->top); + + if (!is_extern_segment(sp)) { + if (is_mmapped_segment(sp)) { + if (HAVE_MMAP && sp->size >= extra && !has_segment_link(m, sp)) { /* can't shrink if pinned */ + size_t newsize = sp->size - extra; + /* Prefer mremap, fall back to munmap */ + if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != + MFAIL) + || (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { + released = extra; + } + } + } else if (HAVE_MORECORE) { + if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ + extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; + ACQUIRE_MORECORE_LOCK(); + { + /* Make sure end of memory is where we last set it. */ + char *old_br = (char *) (CALL_MORECORE(0)); + if (old_br == sp->base + sp->size) { + char *rel_br = (char *) (CALL_MORECORE(-extra)); + char *new_br = (char *) (CALL_MORECORE(0)); + if (rel_br != CMFAIL && new_br < old_br) + released = old_br - new_br; + } + } + RELEASE_MORECORE_LOCK(); + } } - } - } - else if (HAVE_MORECORE) { - if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ - extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; - ACQUIRE_MORECORE_LOCK(); - { - /* Make sure end of memory is where we last set it. */ - char* old_br = (char*)(CALL_MORECORE(0)); - if (old_br == sp->base + sp->size) { - char* rel_br = (char*)(CALL_MORECORE(-extra)); - char* new_br = (char*)(CALL_MORECORE(0)); - if (rel_br != CMFAIL && new_br < old_br) - released = old_br - new_br; + + if (released != 0) { + sp->size -= released; + m->footprint -= released; + init_top(m, m->top, m->topsize - released); + check_top_chunk(m, m->top); } - } - RELEASE_MORECORE_LOCK(); } - } - - if (released != 0) { - sp->size -= released; - m->footprint -= released; - init_top(m, m->top, m->topsize - released); - check_top_chunk(m, m->top); - } - } - /* Unmap any unused mmapped segments */ - if (HAVE_MMAP) - released += release_unused_segments(m); + /* Unmap any unused mmapped segments */ + if (HAVE_MMAP) + released += release_unused_segments(m); - /* On failure, disable autotrim to avoid repeated failed future calls */ - if (released == 0) - m->trim_check = MAX_SIZE_T; - } + /* On failure, disable autotrim to avoid repeated failed future calls */ + if (released == 0) + m->trim_check = MAX_SIZE_T; + } - return (released != 0)? 1 : 0; + return (released != 0) ? 1 : 0; } /* ---------------------------- malloc support --------------------------- */ /* allocate a large request from the best fitting chunk in a treebin */ -static void* tmalloc_large(mstate m, size_t nb) { - tchunkptr v = 0; - size_t rsize = -nb; /* Unsigned negation */ - tchunkptr t; - bindex_t idx; - compute_tree_index(nb, idx); - - if ((t = *treebin_at(m, idx)) != 0) { - /* Traverse tree for this bin looking for node with size == nb */ - size_t sizebits = nb << leftshift_for_tree_index(idx); - tchunkptr rst = 0; /* The deepest untaken right subtree */ - for (;;) { - tchunkptr rt; - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - v = t; - if ((rsize = trem) == 0) - break; - } - rt = t->child[1]; - t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; - if (rt != 0 && rt != t) - rst = rt; - if (t == 0) { - t = rst; /* set t to least subtree holding sizes > nb */ - break; - } - sizebits <<= 1; +static void * +tmalloc_large(mstate m, size_t nb) +{ + tchunkptr v = 0; + size_t rsize = -nb; /* Unsigned negation */ + tchunkptr t; + bindex_t idx; + compute_tree_index(nb, idx); + + if ((t = *treebin_at(m, idx)) != 0) { + /* Traverse tree for this bin looking for node with size == nb */ + size_t sizebits = nb << leftshift_for_tree_index(idx); + tchunkptr rst = 0; /* The deepest untaken right subtree */ + for (;;) { + tchunkptr rt; + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + v = t; + if ((rsize = trem) == 0) + break; + } + rt = t->child[1]; + t = t->child[(sizebits >> (SIZE_T_BITSIZE - SIZE_T_ONE)) & 1]; + if (rt != 0 && rt != t) + rst = rt; + if (t == 0) { + t = rst; /* set t to least subtree holding sizes > nb */ + break; + } + sizebits <<= 1; + } } - } - if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ - binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; - if (leftbits != 0) { - bindex_t i; - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - t = *treebin_at(m, i); + if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ + binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; + if (leftbits != 0) { + bindex_t i; + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + t = *treebin_at(m, i); + } } - } - while (t != 0) { /* find smallest of tree or subtree */ - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; + while (t != 0) { /* find smallest of tree or subtree */ + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + rsize = trem; + v = t; + } + t = leftmost_child(t); } - t = leftmost_child(t); - } - /* If dv is a better fit, return 0 so malloc will use it */ - if (v != 0 && rsize < (size_t)(m->dvsize - nb)) { - if (RTCHECK(ok_address(m, v))) { /* split */ - mchunkptr r = chunk_plus_offset(v, nb); - assert(chunksize(v) == rsize + nb); - if (RTCHECK(ok_next(v, r))) { - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(m, v, (rsize + nb)); - else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - insert_chunk(m, r, rsize); + /* If dv is a better fit, return 0 so malloc will use it */ + if (v != 0 && rsize < (size_t) (m->dvsize - nb)) { + if (RTCHECK(ok_address(m, v))) { /* split */ + mchunkptr r = chunk_plus_offset(v, nb); + assert(chunksize(v) == rsize + nb); + if (RTCHECK(ok_next(v, r))) { + unlink_large_chunk(m, v); + if (rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(m, v, (rsize + nb)); + else { + set_size_and_pinuse_of_inuse_chunk(m, v, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + insert_chunk(m, r, rsize); + } + return chunk2mem(v); + } } - return chunk2mem(v); - } + CORRUPTION_ERROR_ACTION(m); } - CORRUPTION_ERROR_ACTION(m); - } - return 0; + return 0; } /* allocate a small request from the best fitting chunk in a treebin */ -static void* tmalloc_small(mstate m, size_t nb) { - tchunkptr t, v; - size_t rsize; - bindex_t i; - binmap_t leastbit = least_bit(m->treemap); - compute_bit2idx(leastbit, i); - - v = t = *treebin_at(m, i); - rsize = chunksize(t) - nb; - - while ((t = leftmost_child(t)) != 0) { - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; +static void * +tmalloc_small(mstate m, size_t nb) +{ + tchunkptr t, v; + size_t rsize; + bindex_t i; + binmap_t leastbit = least_bit(m->treemap); + compute_bit2idx(leastbit, i); + + v = t = *treebin_at(m, i); + rsize = chunksize(t) - nb; + + while ((t = leftmost_child(t)) != 0) { + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + rsize = trem; + v = t; + } } - } - if (RTCHECK(ok_address(m, v))) { - mchunkptr r = chunk_plus_offset(v, nb); - assert(chunksize(v) == rsize + nb); - if (RTCHECK(ok_next(v, r))) { - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(m, v, (rsize + nb)); - else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(m, r, rsize); - } - return chunk2mem(v); + if (RTCHECK(ok_address(m, v))) { + mchunkptr r = chunk_plus_offset(v, nb); + assert(chunksize(v) == rsize + nb); + if (RTCHECK(ok_next(v, r))) { + unlink_large_chunk(m, v); + if (rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(m, v, (rsize + nb)); + else { + set_size_and_pinuse_of_inuse_chunk(m, v, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(m, r, rsize); + } + return chunk2mem(v); + } } - } - CORRUPTION_ERROR_ACTION(m); - return 0; + CORRUPTION_ERROR_ACTION(m); + return 0; } /* --------------------------- realloc support --------------------------- */ -static void* internal_realloc(mstate m, void* oldmem, size_t bytes) { - if (bytes >= MAX_REQUEST) { - MALLOC_FAILURE_ACTION; - return 0; - } - if (!PREACTION(m)) { - mchunkptr oldp = mem2chunk(oldmem); - size_t oldsize = chunksize(oldp); - mchunkptr next = chunk_plus_offset(oldp, oldsize); - mchunkptr newp = 0; - void* extra = 0; - - /* Try to either shrink or extend into top. Else malloc-copy-free */ - - if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) && - ok_next(oldp, next) && ok_pinuse(next))) { - size_t nb = request2size(bytes); - if (is_mmapped(oldp)) - newp = mmap_resize(m, oldp, nb); - else if (oldsize >= nb) { /* already big enough */ - size_t rsize = oldsize - nb; - newp = oldp; - if (rsize >= MIN_CHUNK_SIZE) { - mchunkptr remainder = chunk_plus_offset(newp, nb); - set_inuse(m, newp, nb); - set_inuse(m, remainder, rsize); - extra = chunk2mem(remainder); - } - } - else if (next == m->top && oldsize + m->topsize > nb) { - /* Expand into top */ - size_t newsize = oldsize + m->topsize; - size_t newtopsize = newsize - nb; - mchunkptr newtop = chunk_plus_offset(oldp, nb); - set_inuse(m, oldp, nb); - newtop->head = newtopsize |PINUSE_BIT; - m->top = newtop; - m->topsize = newtopsize; - newp = oldp; - } - } - else { - USAGE_ERROR_ACTION(m, oldmem); - POSTACTION(m); - return 0; +static void * +internal_realloc(mstate m, void *oldmem, size_t bytes) +{ + if (bytes >= MAX_REQUEST) { + MALLOC_FAILURE_ACTION; + return 0; } + if (!PREACTION(m)) { + mchunkptr oldp = mem2chunk(oldmem); + size_t oldsize = chunksize(oldp); + mchunkptr next = chunk_plus_offset(oldp, oldsize); + mchunkptr newp = 0; + void *extra = 0; + + /* Try to either shrink or extend into top. Else malloc-copy-free */ + + if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) && + ok_next(oldp, next) && ok_pinuse(next))) { + size_t nb = request2size(bytes); + if (is_mmapped(oldp)) + newp = mmap_resize(m, oldp, nb); + else if (oldsize >= nb) { /* already big enough */ + size_t rsize = oldsize - nb; + newp = oldp; + if (rsize >= MIN_CHUNK_SIZE) { + mchunkptr remainder = chunk_plus_offset(newp, nb); + set_inuse(m, newp, nb); + set_inuse(m, remainder, rsize); + extra = chunk2mem(remainder); + } + } else if (next == m->top && oldsize + m->topsize > nb) { + /* Expand into top */ + size_t newsize = oldsize + m->topsize; + size_t newtopsize = newsize - nb; + mchunkptr newtop = chunk_plus_offset(oldp, nb); + set_inuse(m, oldp, nb); + newtop->head = newtopsize | PINUSE_BIT; + m->top = newtop; + m->topsize = newtopsize; + newp = oldp; + } + } else { + USAGE_ERROR_ACTION(m, oldmem); + POSTACTION(m); + return 0; + } - POSTACTION(m); + POSTACTION(m); - if (newp != 0) { - if (extra != 0) { - internal_free(m, extra); - } - check_inuse_chunk(m, newp); - return chunk2mem(newp); - } - else { - void* newmem = internal_malloc(m, bytes); - if (newmem != 0) { - size_t oc = oldsize - overhead_for(oldp); - memcpy(newmem, oldmem, (oc < bytes)? oc : bytes); - internal_free(m, oldmem); - } - return newmem; + if (newp != 0) { + if (extra != 0) { + internal_free(m, extra); + } + check_inuse_chunk(m, newp); + return chunk2mem(newp); + } else { + void *newmem = internal_malloc(m, bytes); + if (newmem != 0) { + size_t oc = oldsize - overhead_for(oldp); + memcpy(newmem, oldmem, (oc < bytes) ? oc : bytes); + internal_free(m, oldmem); + } + return newmem; + } } - } - return 0; + return 0; } /* --------------------------- memalign support -------------------------- */ -static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { - if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */ - return internal_malloc(m, bytes); - if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ - alignment = MIN_CHUNK_SIZE; - if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */ - size_t a = MALLOC_ALIGNMENT << 1; - while (a < alignment) a <<= 1; - alignment = a; - } - - if (bytes >= MAX_REQUEST - alignment) { - if (m != 0) { /* Test isn't needed but avoids compiler warning */ - MALLOC_FAILURE_ACTION; +static void * +internal_memalign(mstate m, size_t alignment, size_t bytes) +{ + if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */ + return internal_malloc(m, bytes); + if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ + alignment = MIN_CHUNK_SIZE; + if ((alignment & (alignment - SIZE_T_ONE)) != 0) { /* Ensure a power of 2 */ + size_t a = MALLOC_ALIGNMENT << 1; + while (a < alignment) + a <<= 1; + alignment = a; } - } - else { - size_t nb = request2size(bytes); - size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; - char* mem = (char*)internal_malloc(m, req); - if (mem != 0) { - void* leader = 0; - void* trailer = 0; - mchunkptr p = mem2chunk(mem); - - if (PREACTION(m)) return 0; - if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */ - /* - Find an aligned spot inside chunk. Since we need to give - back leading space in a chunk of at least MIN_CHUNK_SIZE, if - the first calculation places us at a spot with less than - MIN_CHUNK_SIZE leader, we can move to the next aligned spot. - We've allocated enough total room so that this is always - possible. - */ - char* br = (char*)mem2chunk((size_t)(((size_t)(mem + - alignment - - SIZE_T_ONE)) & - -alignment)); - char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)? - br : br+alignment; - mchunkptr newp = (mchunkptr)pos; - size_t leadsize = pos - (char*)(p); - size_t newsize = chunksize(p) - leadsize; - - if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ - newp->prev_foot = p->prev_foot + leadsize; - newp->head = (newsize|CINUSE_BIT); - } - else { /* Otherwise, give back leader, use the rest */ - set_inuse(m, newp, newsize); - set_inuse(m, p, leadsize); - leader = chunk2mem(p); - } - p = newp; - } - /* Give back spare room at the end */ - if (!is_mmapped(p)) { - size_t size = chunksize(p); - if (size > nb + MIN_CHUNK_SIZE) { - size_t remainder_size = size - nb; - mchunkptr remainder = chunk_plus_offset(p, nb); - set_inuse(m, p, nb); - set_inuse(m, remainder, remainder_size); - trailer = chunk2mem(remainder); + if (bytes >= MAX_REQUEST - alignment) { + if (m != 0) { /* Test isn't needed but avoids compiler warning */ + MALLOC_FAILURE_ACTION; } - } + } else { + size_t nb = request2size(bytes); + size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; + char *mem = (char *) internal_malloc(m, req); + if (mem != 0) { + void *leader = 0; + void *trailer = 0; + mchunkptr p = mem2chunk(mem); + + if (PREACTION(m)) + return 0; + if ((((size_t) (mem)) % alignment) != 0) { /* misaligned */ + /* + Find an aligned spot inside chunk. Since we need to give + back leading space in a chunk of at least MIN_CHUNK_SIZE, if + the first calculation places us at a spot with less than + MIN_CHUNK_SIZE leader, we can move to the next aligned spot. + We've allocated enough total room so that this is always + possible. + */ + char *br = (char *) mem2chunk((size_t) (((size_t) (mem + + alignment - + SIZE_T_ONE)) + & -alignment)); + char *pos = + ((size_t) (br - (char *) (p)) >= + MIN_CHUNK_SIZE) ? br : br + alignment; + mchunkptr newp = (mchunkptr) pos; + size_t leadsize = pos - (char *) (p); + size_t newsize = chunksize(p) - leadsize; + + if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ + newp->prev_foot = p->prev_foot + leadsize; + newp->head = (newsize | CINUSE_BIT); + } else { /* Otherwise, give back leader, use the rest */ + set_inuse(m, newp, newsize); + set_inuse(m, p, leadsize); + leader = chunk2mem(p); + } + p = newp; + } - assert (chunksize(p) >= nb); - assert((((size_t)(chunk2mem(p))) % alignment) == 0); - check_inuse_chunk(m, p); - POSTACTION(m); - if (leader != 0) { - internal_free(m, leader); - } - if (trailer != 0) { - internal_free(m, trailer); - } - return chunk2mem(p); + /* Give back spare room at the end */ + if (!is_mmapped(p)) { + size_t size = chunksize(p); + if (size > nb + MIN_CHUNK_SIZE) { + size_t remainder_size = size - nb; + mchunkptr remainder = chunk_plus_offset(p, nb); + set_inuse(m, p, nb); + set_inuse(m, remainder, remainder_size); + trailer = chunk2mem(remainder); + } + } + + assert(chunksize(p) >= nb); + assert((((size_t) (chunk2mem(p))) % alignment) == 0); + check_inuse_chunk(m, p); + POSTACTION(m); + if (leader != 0) { + internal_free(m, leader); + } + if (trailer != 0) { + internal_free(m, trailer); + } + return chunk2mem(p); + } } - } - return 0; + return 0; } /* ------------------------ comalloc/coalloc support --------------------- */ -static void** ialloc(mstate m, - size_t n_elements, - size_t* sizes, - int opts, - void* chunks[]) { - /* - This provides common support for independent_X routines, handling - all of the combinations that can result. - - The opts arg has: - bit 0 set if all elements are same size (using sizes[0]) - bit 1 set if elements should be zeroed - */ - - size_t element_size; /* chunksize of each element, if all same */ - size_t contents_size; /* total size of elements */ - size_t array_size; /* request size of pointer array */ - void* mem; /* malloced aggregate space */ - mchunkptr p; /* corresponding chunk */ - size_t remainder_size; /* remaining bytes while splitting */ - void** marray; /* either "chunks" or malloced ptr array */ - mchunkptr array_chunk; /* chunk for malloced ptr array */ - flag_t was_enabled; /* to disable mmap */ - size_t size; - size_t i; - - /* compute array length, if needed */ - if (chunks != 0) { - if (n_elements == 0) - return chunks; /* nothing to do */ - marray = chunks; - array_size = 0; - } - else { - /* if empty req, must still return chunk representing empty array */ - if (n_elements == 0) - return (void**)internal_malloc(m, 0); - marray = 0; - array_size = request2size(n_elements * (sizeof(void*))); - } - - /* compute total element size */ - if (opts & 0x1) { /* all-same-size */ - element_size = request2size(*sizes); - contents_size = n_elements * element_size; - } - else { /* add up all the sizes */ - element_size = 0; - contents_size = 0; - for (i = 0; i != n_elements; ++i) - contents_size += request2size(sizes[i]); - } - - size = contents_size + array_size; - - /* - Allocate the aggregate chunk. First disable direct-mmapping so - malloc won't use it, since we would not be able to later - free/realloc space internal to a segregated mmap region. - */ - was_enabled = use_mmap(m); - disable_mmap(m); - mem = internal_malloc(m, size - CHUNK_OVERHEAD); - if (was_enabled) - enable_mmap(m); - if (mem == 0) - return 0; - - if (PREACTION(m)) return 0; - p = mem2chunk(mem); - remainder_size = chunksize(p); - - assert(!is_mmapped(p)); +static void ** +ialloc(mstate m, size_t n_elements, size_t * sizes, int opts, void *chunks[]) +{ + /* + This provides common support for independent_X routines, handling + all of the combinations that can result. + + The opts arg has: + bit 0 set if all elements are same size (using sizes[0]) + bit 1 set if elements should be zeroed + */ + + size_t element_size; /* chunksize of each element, if all same */ + size_t contents_size; /* total size of elements */ + size_t array_size; /* request size of pointer array */ + void *mem; /* malloced aggregate space */ + mchunkptr p; /* corresponding chunk */ + size_t remainder_size; /* remaining bytes while splitting */ + void **marray; /* either "chunks" or malloced ptr array */ + mchunkptr array_chunk; /* chunk for malloced ptr array */ + flag_t was_enabled; /* to disable mmap */ + size_t size; + size_t i; + + /* compute array length, if needed */ + if (chunks != 0) { + if (n_elements == 0) + return chunks; /* nothing to do */ + marray = chunks; + array_size = 0; + } else { + /* if empty req, must still return chunk representing empty array */ + if (n_elements == 0) + return (void **) internal_malloc(m, 0); + marray = 0; + array_size = request2size(n_elements * (sizeof(void *))); + } - if (opts & 0x2) { /* optionally clear the elements */ - memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); - } + /* compute total element size */ + if (opts & 0x1) { /* all-same-size */ + element_size = request2size(*sizes); + contents_size = n_elements * element_size; + } else { /* add up all the sizes */ + element_size = 0; + contents_size = 0; + for (i = 0; i != n_elements; ++i) + contents_size += request2size(sizes[i]); + } - /* If not provided, allocate the pointer array as final part of chunk */ - if (marray == 0) { - size_t array_chunk_size; - array_chunk = chunk_plus_offset(p, contents_size); - array_chunk_size = remainder_size - contents_size; - marray = (void**) (chunk2mem(array_chunk)); - set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); - remainder_size = contents_size; - } + size = contents_size + array_size; + + /* + Allocate the aggregate chunk. First disable direct-mmapping so + malloc won't use it, since we would not be able to later + free/realloc space internal to a segregated mmap region. + */ + was_enabled = use_mmap(m); + disable_mmap(m); + mem = internal_malloc(m, size - CHUNK_OVERHEAD); + if (was_enabled) + enable_mmap(m); + if (mem == 0) + return 0; + + if (PREACTION(m)) + return 0; + p = mem2chunk(mem); + remainder_size = chunksize(p); + + assert(!is_mmapped(p)); + + if (opts & 0x2) { /* optionally clear the elements */ + memset((size_t *) mem, 0, remainder_size - SIZE_T_SIZE - array_size); + } - /* split out elements */ - for (i = 0; ; ++i) { - marray[i] = chunk2mem(p); - if (i != n_elements-1) { - if (element_size != 0) - size = element_size; - else - size = request2size(sizes[i]); - remainder_size -= size; - set_size_and_pinuse_of_inuse_chunk(m, p, size); - p = chunk_plus_offset(p, size); + /* If not provided, allocate the pointer array as final part of chunk */ + if (marray == 0) { + size_t array_chunk_size; + array_chunk = chunk_plus_offset(p, contents_size); + array_chunk_size = remainder_size - contents_size; + marray = (void **) (chunk2mem(array_chunk)); + set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); + remainder_size = contents_size; } - else { /* the final element absorbs any overallocation slop */ - set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); - break; + + /* split out elements */ + for (i = 0;; ++i) { + marray[i] = chunk2mem(p); + if (i != n_elements - 1) { + if (element_size != 0) + size = element_size; + else + size = request2size(sizes[i]); + remainder_size -= size; + set_size_and_pinuse_of_inuse_chunk(m, p, size); + p = chunk_plus_offset(p, size); + } else { /* the final element absorbs any overallocation slop */ + set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); + break; + } } - } #if DEBUG - if (marray != chunks) { - /* final element must have exactly exhausted chunk */ - if (element_size != 0) { - assert(remainder_size == element_size); - } - else { - assert(remainder_size == request2size(sizes[i])); + if (marray != chunks) { + /* final element must have exactly exhausted chunk */ + if (element_size != 0) { + assert(remainder_size == element_size); + } else { + assert(remainder_size == request2size(sizes[i])); + } + check_inuse_chunk(m, mem2chunk(marray)); } - check_inuse_chunk(m, mem2chunk(marray)); - } - for (i = 0; i != n_elements; ++i) - check_inuse_chunk(m, mem2chunk(marray[i])); + for (i = 0; i != n_elements; ++i) + check_inuse_chunk(m, mem2chunk(marray[i])); #endif /* DEBUG */ - POSTACTION(m); - return marray; + POSTACTION(m); + return marray; } @@ -4068,343 +4161,369 @@ static void** ialloc(mstate m, #if !ONLY_MSPACES -void* dlmalloc(size_t bytes) { - /* - Basic algorithm: - If a small request (< 256 bytes minus per-chunk overhead): +void * +dlmalloc(size_t bytes) +{ + /* + Basic algorithm: + If a small request (< 256 bytes minus per-chunk overhead): 1. If one exists, use a remainderless chunk in associated smallbin. - (Remainderless means that there are too few excess bytes to - represent as a chunk.) + (Remainderless means that there are too few excess bytes to + represent as a chunk.) 2. If it is big enough, use the dv chunk, which is normally the - chunk adjacent to the one used for the most recent small request. + chunk adjacent to the one used for the most recent small request. 3. If one exists, split the smallest available chunk in a bin, - saving remainder in dv. + saving remainder in dv. 4. If it is big enough, use the top chunk. 5. If available, get memory from system and use it - Otherwise, for a large request: + Otherwise, for a large request: 1. Find the smallest available binned chunk that fits, and use it - if it is better fitting than dv chunk, splitting if necessary. + if it is better fitting than dv chunk, splitting if necessary. 2. If better fitting than any binned chunk, use the dv chunk. 3. If it is big enough, use the top chunk. 4. If request size >= mmap threshold, try to directly mmap this chunk. 5. If available, get memory from system and use it - The ugly goto's here ensure that postaction occurs along all paths. - */ - - if (!PREACTION(gm)) { - void* mem; - size_t nb; - if (bytes <= MAX_SMALL_REQUEST) { - bindex_t idx; - binmap_t smallbits; - nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); - idx = small_index(nb); - smallbits = gm->smallmap >> idx; - - if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ - mchunkptr b, p; - idx += ~smallbits & 1; /* Uses next bin if idx empty */ - b = smallbin_at(gm, idx); - p = b->fd; - assert(chunksize(p) == small_index2size(idx)); - unlink_first_small_chunk(gm, b, p, idx); - set_inuse_and_pinuse(gm, p, small_index2size(idx)); - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } + The ugly goto's here ensure that postaction occurs along all paths. + */ + + if (!PREACTION(gm)) { + void *mem; + size_t nb; + if (bytes <= MAX_SMALL_REQUEST) { + bindex_t idx; + binmap_t smallbits; + nb = (bytes < MIN_REQUEST) ? MIN_CHUNK_SIZE : pad_request(bytes); + idx = small_index(nb); + smallbits = gm->smallmap >> idx; + + if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ + mchunkptr b, p; + idx += ~smallbits & 1; /* Uses next bin if idx empty */ + b = smallbin_at(gm, idx); + p = b->fd; + assert(chunksize(p) == small_index2size(idx)); + unlink_first_small_chunk(gm, b, p, idx); + set_inuse_and_pinuse(gm, p, small_index2size(idx)); + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } - else if (nb > gm->dvsize) { - if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ - mchunkptr b, p, r; - size_t rsize; - bindex_t i; - binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - b = smallbin_at(gm, i); - p = b->fd; - assert(chunksize(p) == small_index2size(i)); - unlink_first_small_chunk(gm, b, p, i); - rsize = small_index2size(i) - nb; - /* Fit here cannot be remainderless if 4byte sizes */ - if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(gm, p, small_index2size(i)); - else { - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - r = chunk_plus_offset(p, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(gm, r, rsize); - } - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; + else if (nb > gm->dvsize) { + if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ + mchunkptr b, p, r; + size_t rsize; + bindex_t i; + binmap_t leftbits = + (smallbits << idx) & left_bits(idx2bit(idx)); + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + b = smallbin_at(gm, i); + p = b->fd; + assert(chunksize(p) == small_index2size(i)); + unlink_first_small_chunk(gm, b, p, i); + rsize = small_index2size(i) - nb; + /* Fit here cannot be remainderless if 4byte sizes */ + if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(gm, p, small_index2size(i)); + else { + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + r = chunk_plus_offset(p, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(gm, r, rsize); + } + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + + else if (gm->treemap != 0 + && (mem = tmalloc_small(gm, nb)) != 0) { + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + } + } else if (bytes >= MAX_REQUEST) + nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ + else { + nb = pad_request(bytes); + if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { + check_malloced_chunk(gm, mem, nb); + goto postaction; + } } - else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) { - check_malloced_chunk(gm, mem, nb); - goto postaction; + if (nb <= gm->dvsize) { + size_t rsize = gm->dvsize - nb; + mchunkptr p = gm->dv; + if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ + mchunkptr r = gm->dv = chunk_plus_offset(p, nb); + gm->dvsize = rsize; + set_size_and_pinuse_of_free_chunk(r, rsize); + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + } else { /* exhaust dv */ + size_t dvs = gm->dvsize; + gm->dvsize = 0; + gm->dv = 0; + set_inuse_and_pinuse(gm, p, dvs); + } + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; } - } - } - else if (bytes >= MAX_REQUEST) - nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ - else { - nb = pad_request(bytes); - if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - } - if (nb <= gm->dvsize) { - size_t rsize = gm->dvsize - nb; - mchunkptr p = gm->dv; - if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ - mchunkptr r = gm->dv = chunk_plus_offset(p, nb); - gm->dvsize = rsize; - set_size_and_pinuse_of_free_chunk(r, rsize); - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - } - else { /* exhaust dv */ - size_t dvs = gm->dvsize; - gm->dvsize = 0; - gm->dv = 0; - set_inuse_and_pinuse(gm, p, dvs); - } - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - - else if (nb < gm->topsize) { /* Split top */ - size_t rsize = gm->topsize -= nb; - mchunkptr p = gm->top; - mchunkptr r = gm->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - mem = chunk2mem(p); - check_top_chunk(gm, gm->top); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } + else if (nb < gm->topsize) { /* Split top */ + size_t rsize = gm->topsize -= nb; + mchunkptr p = gm->top; + mchunkptr r = gm->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + mem = chunk2mem(p); + check_top_chunk(gm, gm->top); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } - mem = sys_alloc(gm, nb); + mem = sys_alloc(gm, nb); - postaction: - POSTACTION(gm); - return mem; - } + postaction: + POSTACTION(gm); + return mem; + } - return 0; + return 0; } -void dlfree(void* mem) { - /* - Consolidate freed chunks with preceeding or succeeding bordering - free chunks, if they exist, and then place in a bin. Intermixed - with special cases for top, dv, mmapped chunks, and usage errors. - */ +void +dlfree(void *mem) +{ + /* + Consolidate freed chunks with preceeding or succeeding bordering + free chunks, if they exist, and then place in a bin. Intermixed + with special cases for top, dv, mmapped chunks, and usage errors. + */ - if (mem != 0) { - mchunkptr p = mem2chunk(mem); + if (mem != 0) { + mchunkptr p = mem2chunk(mem); #if FOOTERS - mstate fm = get_mstate_for(p); - if (!ok_magic(fm)) { - USAGE_ERROR_ACTION(fm, p); - return; - } + mstate fm = get_mstate_for(p); + if (!ok_magic(fm)) { + USAGE_ERROR_ACTION(fm, p); + return; + } #else /* FOOTERS */ #define fm gm #endif /* FOOTERS */ - if (!PREACTION(fm)) { - check_inuse_chunk(fm, p); - if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { - size_t psize = chunksize(p); - mchunkptr next = chunk_plus_offset(p, psize); - if (!pinuse(p)) { - size_t prevsize = p->prev_foot; - if ((prevsize & IS_MMAPPED_BIT) != 0) { - prevsize &= ~IS_MMAPPED_BIT; - psize += prevsize + MMAP_FOOT_PAD; - if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) - fm->footprint -= psize; - goto postaction; - } - else { - mchunkptr prev = chunk_minus_offset(p, prevsize); - psize += prevsize; - p = prev; - if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ - if (p != fm->dv) { - unlink_chunk(fm, p, prevsize); - } - else if ((next->head & INUSE_BITS) == INUSE_BITS) { - fm->dvsize = psize; - set_free_with_pinuse(p, psize, next); - goto postaction; - } - } - else - goto erroraction; - } - } - - if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { - if (!cinuse(next)) { /* consolidate forward */ - if (next == fm->top) { - size_t tsize = fm->topsize += psize; - fm->top = p; - p->head = tsize | PINUSE_BIT; - if (p == fm->dv) { - fm->dv = 0; - fm->dvsize = 0; - } - if (should_trim(fm, tsize)) - sys_trim(fm, 0); - goto postaction; - } - else if (next == fm->dv) { - size_t dsize = fm->dvsize += psize; - fm->dv = p; - set_size_and_pinuse_of_free_chunk(p, dsize); - goto postaction; + if (!PREACTION(fm)) { + check_inuse_chunk(fm, p); + if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { + size_t psize = chunksize(p); + mchunkptr next = chunk_plus_offset(p, psize); + if (!pinuse(p)) { + size_t prevsize = p->prev_foot; + if ((prevsize & IS_MMAPPED_BIT) != 0) { + prevsize &= ~IS_MMAPPED_BIT; + psize += prevsize + MMAP_FOOT_PAD; + if (CALL_MUNMAP((char *) p - prevsize, psize) == 0) + fm->footprint -= psize; + goto postaction; + } else { + mchunkptr prev = chunk_minus_offset(p, prevsize); + psize += prevsize; + p = prev; + if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ + if (p != fm->dv) { + unlink_chunk(fm, p, prevsize); + } else if ((next->head & INUSE_BITS) == + INUSE_BITS) { + fm->dvsize = psize; + set_free_with_pinuse(p, psize, next); + goto postaction; + } + } else + goto erroraction; + } + } + + if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { + if (!cinuse(next)) { /* consolidate forward */ + if (next == fm->top) { + size_t tsize = fm->topsize += psize; + fm->top = p; + p->head = tsize | PINUSE_BIT; + if (p == fm->dv) { + fm->dv = 0; + fm->dvsize = 0; + } + if (should_trim(fm, tsize)) + sys_trim(fm, 0); + goto postaction; + } else if (next == fm->dv) { + size_t dsize = fm->dvsize += psize; + fm->dv = p; + set_size_and_pinuse_of_free_chunk(p, dsize); + goto postaction; + } else { + size_t nsize = chunksize(next); + psize += nsize; + unlink_chunk(fm, next, nsize); + set_size_and_pinuse_of_free_chunk(p, psize); + if (p == fm->dv) { + fm->dvsize = psize; + goto postaction; + } + } + } else + set_free_with_pinuse(p, psize, next); + insert_chunk(fm, p, psize); + check_free_chunk(fm, p); + goto postaction; + } } - else { - size_t nsize = chunksize(next); - psize += nsize; - unlink_chunk(fm, next, nsize); - set_size_and_pinuse_of_free_chunk(p, psize); - if (p == fm->dv) { - fm->dvsize = psize; - goto postaction; - } - } - } - else - set_free_with_pinuse(p, psize, next); - insert_chunk(fm, p, psize); - check_free_chunk(fm, p); - goto postaction; + erroraction: + USAGE_ERROR_ACTION(fm, p); + postaction: + POSTACTION(fm); } - } - erroraction: - USAGE_ERROR_ACTION(fm, p); - postaction: - POSTACTION(fm); } - } #if !FOOTERS #undef fm #endif /* FOOTERS */ } -void* dlcalloc(size_t n_elements, size_t elem_size) { - void* mem; - size_t req = 0; - if (n_elements != 0) { - req = n_elements * elem_size; - if (((n_elements | elem_size) & ~(size_t)0xffff) && - (req / n_elements != elem_size)) - req = MAX_SIZE_T; /* force downstream failure on overflow */ - } - mem = dlmalloc(req); - if (mem != 0 && calloc_must_clear(mem2chunk(mem))) - memset(mem, 0, req); - return mem; +void * +dlcalloc(size_t n_elements, size_t elem_size) +{ + void *mem; + size_t req = 0; + if (n_elements != 0) { + req = n_elements * elem_size; + if (((n_elements | elem_size) & ~(size_t) 0xffff) && + (req / n_elements != elem_size)) + req = MAX_SIZE_T; /* force downstream failure on overflow */ + } + mem = dlmalloc(req); + if (mem != 0 && calloc_must_clear(mem2chunk(mem))) + memset(mem, 0, req); + return mem; } -void* dlrealloc(void* oldmem, size_t bytes) { - if (oldmem == 0) - return dlmalloc(bytes); +void * +dlrealloc(void *oldmem, size_t bytes) +{ + if (oldmem == 0) + return dlmalloc(bytes); #ifdef REALLOC_ZERO_BYTES_FREES - if (bytes == 0) { - dlfree(oldmem); - return 0; - } + if (bytes == 0) { + dlfree(oldmem); + return 0; + } #endif /* REALLOC_ZERO_BYTES_FREES */ - else { + else { #if ! FOOTERS - mstate m = gm; + mstate m = gm; #else /* FOOTERS */ - mstate m = get_mstate_for(mem2chunk(oldmem)); - if (!ok_magic(m)) { - USAGE_ERROR_ACTION(m, oldmem); - return 0; - } + mstate m = get_mstate_for(mem2chunk(oldmem)); + if (!ok_magic(m)) { + USAGE_ERROR_ACTION(m, oldmem); + return 0; + } #endif /* FOOTERS */ - return internal_realloc(m, oldmem, bytes); - } + return internal_realloc(m, oldmem, bytes); + } } -void* dlmemalign(size_t alignment, size_t bytes) { - return internal_memalign(gm, alignment, bytes); +void * +dlmemalign(size_t alignment, size_t bytes) +{ + return internal_memalign(gm, alignment, bytes); } -void** dlindependent_calloc(size_t n_elements, size_t elem_size, - void* chunks[]) { - size_t sz = elem_size; /* serves as 1-element array */ - return ialloc(gm, n_elements, &sz, 3, chunks); +void ** +dlindependent_calloc(size_t n_elements, size_t elem_size, void *chunks[]) +{ + size_t sz = elem_size; /* serves as 1-element array */ + return ialloc(gm, n_elements, &sz, 3, chunks); } -void** dlindependent_comalloc(size_t n_elements, size_t sizes[], - void* chunks[]) { - return ialloc(gm, n_elements, sizes, 0, chunks); +void ** +dlindependent_comalloc(size_t n_elements, size_t sizes[], void *chunks[]) +{ + return ialloc(gm, n_elements, sizes, 0, chunks); } -void* dlvalloc(size_t bytes) { - size_t pagesz; - init_mparams(); - pagesz = mparams.page_size; - return dlmemalign(pagesz, bytes); +void * +dlvalloc(size_t bytes) +{ + size_t pagesz; + init_mparams(); + pagesz = mparams.page_size; + return dlmemalign(pagesz, bytes); } -void* dlpvalloc(size_t bytes) { - size_t pagesz; - init_mparams(); - pagesz = mparams.page_size; - return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); +void * +dlpvalloc(size_t bytes) +{ + size_t pagesz; + init_mparams(); + pagesz = mparams.page_size; + return dlmemalign(pagesz, + (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); } -int dlmalloc_trim(size_t pad) { - int result = 0; - if (!PREACTION(gm)) { - result = sys_trim(gm, pad); - POSTACTION(gm); - } - return result; +int +dlmalloc_trim(size_t pad) +{ + int result = 0; + if (!PREACTION(gm)) { + result = sys_trim(gm, pad); + POSTACTION(gm); + } + return result; } -size_t dlmalloc_footprint(void) { - return gm->footprint; +size_t +dlmalloc_footprint(void) +{ + return gm->footprint; } -size_t dlmalloc_max_footprint(void) { - return gm->max_footprint; +size_t +dlmalloc_max_footprint(void) +{ + return gm->max_footprint; } #if !NO_MALLINFO -struct mallinfo dlmallinfo(void) { - return internal_mallinfo(gm); +struct mallinfo +dlmallinfo(void) +{ + return internal_mallinfo(gm); } #endif /* NO_MALLINFO */ -void dlmalloc_stats() { - internal_malloc_stats(gm); +void +dlmalloc_stats() +{ + internal_malloc_stats(gm); } -size_t dlmalloc_usable_size(void* mem) { - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - if (cinuse(p)) - return chunksize(p) - overhead_for(p); - } - return 0; +size_t +dlmalloc_usable_size(void *mem) +{ + if (mem != 0) { + mchunkptr p = mem2chunk(mem); + if (cinuse(p)) + return chunksize(p) - overhead_for(p); + } + return 0; } -int dlmallopt(int param_number, int value) { - return change_mparam(param_number, value); +int +dlmallopt(int param_number, int value) +{ + return change_mparam(param_number, value); } #endif /* !ONLY_MSPACES */ @@ -4413,78 +4532,85 @@ int dlmallopt(int param_number, int value) { #if MSPACES -static mstate init_user_mstate(char* tbase, size_t tsize) { - size_t msize = pad_request(sizeof(struct malloc_state)); - mchunkptr mn; - mchunkptr msp = align_as_chunk(tbase); - mstate m = (mstate)(chunk2mem(msp)); - memset(m, 0, msize); - INITIAL_LOCK(&m->mutex); - msp->head = (msize|PINUSE_BIT|CINUSE_BIT); - m->seg.base = m->least_addr = tbase; - m->seg.size = m->footprint = m->max_footprint = tsize; - m->magic = mparams.magic; - m->mflags = mparams.default_mflags; - disable_contiguous(m); - init_bins(m); - mn = next_chunk(mem2chunk(m)); - init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE); - check_top_chunk(m, m->top); - return m; +static mstate +init_user_mstate(char *tbase, size_t tsize) +{ + size_t msize = pad_request(sizeof(struct malloc_state)); + mchunkptr mn; + mchunkptr msp = align_as_chunk(tbase); + mstate m = (mstate) (chunk2mem(msp)); + memset(m, 0, msize); + INITIAL_LOCK(&m->mutex); + msp->head = (msize | PINUSE_BIT | CINUSE_BIT); + m->seg.base = m->least_addr = tbase; + m->seg.size = m->footprint = m->max_footprint = tsize; + m->magic = mparams.magic; + m->mflags = mparams.default_mflags; + disable_contiguous(m); + init_bins(m); + mn = next_chunk(mem2chunk(m)); + init_top(m, mn, (size_t) ((tbase + tsize) - (char *) mn) - TOP_FOOT_SIZE); + check_top_chunk(m, m->top); + return m; } -mspace create_mspace(size_t capacity, int locked) { - mstate m = 0; - size_t msize = pad_request(sizeof(struct malloc_state)); - init_mparams(); /* Ensure pagesize etc initialized */ - - if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { - size_t rs = ((capacity == 0)? mparams.granularity : - (capacity + TOP_FOOT_SIZE + msize)); - size_t tsize = granularity_align(rs); - char* tbase = (char*)(CALL_MMAP(tsize)); - if (tbase != CMFAIL) { - m = init_user_mstate(tbase, tsize); - m->seg.sflags = IS_MMAPPED_BIT; - set_lock(m, locked); +mspace +create_mspace(size_t capacity, int locked) +{ + mstate m = 0; + size_t msize = pad_request(sizeof(struct malloc_state)); + init_mparams(); /* Ensure pagesize etc initialized */ + + if (capacity < (size_t) - (msize + TOP_FOOT_SIZE + mparams.page_size)) { + size_t rs = ((capacity == 0) ? mparams.granularity : + (capacity + TOP_FOOT_SIZE + msize)); + size_t tsize = granularity_align(rs); + char *tbase = (char *) (CALL_MMAP(tsize)); + if (tbase != CMFAIL) { + m = init_user_mstate(tbase, tsize); + m->seg.sflags = IS_MMAPPED_BIT; + set_lock(m, locked); + } } - } - return (mspace)m; + return (mspace) m; } -mspace create_mspace_with_base(void* base, size_t capacity, int locked) { - mstate m = 0; - size_t msize = pad_request(sizeof(struct malloc_state)); - init_mparams(); /* Ensure pagesize etc initialized */ - - if (capacity > msize + TOP_FOOT_SIZE && - capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { - m = init_user_mstate((char*)base, capacity); - m->seg.sflags = EXTERN_BIT; - set_lock(m, locked); - } - return (mspace)m; +mspace +create_mspace_with_base(void *base, size_t capacity, int locked) +{ + mstate m = 0; + size_t msize = pad_request(sizeof(struct malloc_state)); + init_mparams(); /* Ensure pagesize etc initialized */ + + if (capacity > msize + TOP_FOOT_SIZE && + capacity < (size_t) - (msize + TOP_FOOT_SIZE + mparams.page_size)) { + m = init_user_mstate((char *) base, capacity); + m->seg.sflags = EXTERN_BIT; + set_lock(m, locked); + } + return (mspace) m; } -size_t destroy_mspace(mspace msp) { - size_t freed = 0; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - msegmentptr sp = &ms->seg; - while (sp != 0) { - char* base = sp->base; - size_t size = sp->size; - flag_t flag = sp->sflags; - sp = sp->next; - if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) && - CALL_MUNMAP(base, size) == 0) - freed += size; +size_t +destroy_mspace(mspace msp) +{ + size_t freed = 0; + mstate ms = (mstate) msp; + if (ok_magic(ms)) { + msegmentptr sp = &ms->seg; + while (sp != 0) { + char *base = sp->base; + size_t size = sp->size; + flag_t flag = sp->sflags; + sp = sp->next; + if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) && + CALL_MUNMAP(base, size) == 0) + freed += size; + } + } else { + USAGE_ERROR_ACTION(ms, ms); } - } - else { - USAGE_ERROR_ACTION(ms,ms); - } - return freed; + return freed; } /* @@ -4493,344 +4619,363 @@ size_t destroy_mspace(mspace msp) { */ -void* mspace_malloc(mspace msp, size_t bytes) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - if (!PREACTION(ms)) { - void* mem; - size_t nb; - if (bytes <= MAX_SMALL_REQUEST) { - bindex_t idx; - binmap_t smallbits; - nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); - idx = small_index(nb); - smallbits = ms->smallmap >> idx; - - if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ - mchunkptr b, p; - idx += ~smallbits & 1; /* Uses next bin if idx empty */ - b = smallbin_at(ms, idx); - p = b->fd; - assert(chunksize(p) == small_index2size(idx)); - unlink_first_small_chunk(ms, b, p, idx); - set_inuse_and_pinuse(ms, p, small_index2size(idx)); - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } +void * +mspace_malloc(mspace msp, size_t bytes) +{ + mstate ms = (mstate) msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms, ms); + return 0; + } + if (!PREACTION(ms)) { + void *mem; + size_t nb; + if (bytes <= MAX_SMALL_REQUEST) { + bindex_t idx; + binmap_t smallbits; + nb = (bytes < MIN_REQUEST) ? MIN_CHUNK_SIZE : pad_request(bytes); + idx = small_index(nb); + smallbits = ms->smallmap >> idx; + + if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ + mchunkptr b, p; + idx += ~smallbits & 1; /* Uses next bin if idx empty */ + b = smallbin_at(ms, idx); + p = b->fd; + assert(chunksize(p) == small_index2size(idx)); + unlink_first_small_chunk(ms, b, p, idx); + set_inuse_and_pinuse(ms, p, small_index2size(idx)); + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } - else if (nb > ms->dvsize) { - if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ - mchunkptr b, p, r; - size_t rsize; - bindex_t i; - binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - b = smallbin_at(ms, i); - p = b->fd; - assert(chunksize(p) == small_index2size(i)); - unlink_first_small_chunk(ms, b, p, i); - rsize = small_index2size(i) - nb; - /* Fit here cannot be remainderless if 4byte sizes */ - if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(ms, p, small_index2size(i)); - else { - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - r = chunk_plus_offset(p, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(ms, r, rsize); - } - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; + else if (nb > ms->dvsize) { + if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ + mchunkptr b, p, r; + size_t rsize; + bindex_t i; + binmap_t leftbits = + (smallbits << idx) & left_bits(idx2bit(idx)); + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + b = smallbin_at(ms, i); + p = b->fd; + assert(chunksize(p) == small_index2size(i)); + unlink_first_small_chunk(ms, b, p, i); + rsize = small_index2size(i) - nb; + /* Fit here cannot be remainderless if 4byte sizes */ + if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(ms, p, small_index2size(i)); + else { + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + r = chunk_plus_offset(p, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(ms, r, rsize); + } + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + + else if (ms->treemap != 0 + && (mem = tmalloc_small(ms, nb)) != 0) { + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + } + } else if (bytes >= MAX_REQUEST) + nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ + else { + nb = pad_request(bytes); + if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { + check_malloced_chunk(ms, mem, nb); + goto postaction; + } } - else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { - check_malloced_chunk(ms, mem, nb); - goto postaction; + if (nb <= ms->dvsize) { + size_t rsize = ms->dvsize - nb; + mchunkptr p = ms->dv; + if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ + mchunkptr r = ms->dv = chunk_plus_offset(p, nb); + ms->dvsize = rsize; + set_size_and_pinuse_of_free_chunk(r, rsize); + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + } else { /* exhaust dv */ + size_t dvs = ms->dvsize; + ms->dvsize = 0; + ms->dv = 0; + set_inuse_and_pinuse(ms, p, dvs); + } + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; } - } - } - else if (bytes >= MAX_REQUEST) - nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ - else { - nb = pad_request(bytes); - if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - } - - if (nb <= ms->dvsize) { - size_t rsize = ms->dvsize - nb; - mchunkptr p = ms->dv; - if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ - mchunkptr r = ms->dv = chunk_plus_offset(p, nb); - ms->dvsize = rsize; - set_size_and_pinuse_of_free_chunk(r, rsize); - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - } - else { /* exhaust dv */ - size_t dvs = ms->dvsize; - ms->dvsize = 0; - ms->dv = 0; - set_inuse_and_pinuse(ms, p, dvs); - } - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - else if (nb < ms->topsize) { /* Split top */ - size_t rsize = ms->topsize -= nb; - mchunkptr p = ms->top; - mchunkptr r = ms->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - mem = chunk2mem(p); - check_top_chunk(ms, ms->top); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } + else if (nb < ms->topsize) { /* Split top */ + size_t rsize = ms->topsize -= nb; + mchunkptr p = ms->top; + mchunkptr r = ms->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + mem = chunk2mem(p); + check_top_chunk(ms, ms->top); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } - mem = sys_alloc(ms, nb); + mem = sys_alloc(ms, nb); - postaction: - POSTACTION(ms); - return mem; - } + postaction: + POSTACTION(ms); + return mem; + } - return 0; + return 0; } -void mspace_free(mspace msp, void* mem) { - if (mem != 0) { - mchunkptr p = mem2chunk(mem); +void +mspace_free(mspace msp, void *mem) +{ + if (mem != 0) { + mchunkptr p = mem2chunk(mem); #if FOOTERS - mstate fm = get_mstate_for(p); + mstate fm = get_mstate_for(p); #else /* FOOTERS */ - mstate fm = (mstate)msp; + mstate fm = (mstate) msp; #endif /* FOOTERS */ - if (!ok_magic(fm)) { - USAGE_ERROR_ACTION(fm, p); - return; - } - if (!PREACTION(fm)) { - check_inuse_chunk(fm, p); - if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { - size_t psize = chunksize(p); - mchunkptr next = chunk_plus_offset(p, psize); - if (!pinuse(p)) { - size_t prevsize = p->prev_foot; - if ((prevsize & IS_MMAPPED_BIT) != 0) { - prevsize &= ~IS_MMAPPED_BIT; - psize += prevsize + MMAP_FOOT_PAD; - if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) - fm->footprint -= psize; - goto postaction; - } - else { - mchunkptr prev = chunk_minus_offset(p, prevsize); - psize += prevsize; - p = prev; - if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ - if (p != fm->dv) { - unlink_chunk(fm, p, prevsize); - } - else if ((next->head & INUSE_BITS) == INUSE_BITS) { - fm->dvsize = psize; - set_free_with_pinuse(p, psize, next); - goto postaction; - } - } - else - goto erroraction; - } + if (!ok_magic(fm)) { + USAGE_ERROR_ACTION(fm, p); + return; } - - if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { - if (!cinuse(next)) { /* consolidate forward */ - if (next == fm->top) { - size_t tsize = fm->topsize += psize; - fm->top = p; - p->head = tsize | PINUSE_BIT; - if (p == fm->dv) { - fm->dv = 0; - fm->dvsize = 0; - } - if (should_trim(fm, tsize)) - sys_trim(fm, 0); - goto postaction; - } - else if (next == fm->dv) { - size_t dsize = fm->dvsize += psize; - fm->dv = p; - set_size_and_pinuse_of_free_chunk(p, dsize); - goto postaction; + if (!PREACTION(fm)) { + check_inuse_chunk(fm, p); + if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { + size_t psize = chunksize(p); + mchunkptr next = chunk_plus_offset(p, psize); + if (!pinuse(p)) { + size_t prevsize = p->prev_foot; + if ((prevsize & IS_MMAPPED_BIT) != 0) { + prevsize &= ~IS_MMAPPED_BIT; + psize += prevsize + MMAP_FOOT_PAD; + if (CALL_MUNMAP((char *) p - prevsize, psize) == 0) + fm->footprint -= psize; + goto postaction; + } else { + mchunkptr prev = chunk_minus_offset(p, prevsize); + psize += prevsize; + p = prev; + if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ + if (p != fm->dv) { + unlink_chunk(fm, p, prevsize); + } else if ((next->head & INUSE_BITS) == + INUSE_BITS) { + fm->dvsize = psize; + set_free_with_pinuse(p, psize, next); + goto postaction; + } + } else + goto erroraction; + } + } + + if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { + if (!cinuse(next)) { /* consolidate forward */ + if (next == fm->top) { + size_t tsize = fm->topsize += psize; + fm->top = p; + p->head = tsize | PINUSE_BIT; + if (p == fm->dv) { + fm->dv = 0; + fm->dvsize = 0; + } + if (should_trim(fm, tsize)) + sys_trim(fm, 0); + goto postaction; + } else if (next == fm->dv) { + size_t dsize = fm->dvsize += psize; + fm->dv = p; + set_size_and_pinuse_of_free_chunk(p, dsize); + goto postaction; + } else { + size_t nsize = chunksize(next); + psize += nsize; + unlink_chunk(fm, next, nsize); + set_size_and_pinuse_of_free_chunk(p, psize); + if (p == fm->dv) { + fm->dvsize = psize; + goto postaction; + } + } + } else + set_free_with_pinuse(p, psize, next); + insert_chunk(fm, p, psize); + check_free_chunk(fm, p); + goto postaction; + } } - else { - size_t nsize = chunksize(next); - psize += nsize; - unlink_chunk(fm, next, nsize); - set_size_and_pinuse_of_free_chunk(p, psize); - if (p == fm->dv) { - fm->dvsize = psize; - goto postaction; - } - } - } - else - set_free_with_pinuse(p, psize, next); - insert_chunk(fm, p, psize); - check_free_chunk(fm, p); - goto postaction; + erroraction: + USAGE_ERROR_ACTION(fm, p); + postaction: + POSTACTION(fm); } - } - erroraction: - USAGE_ERROR_ACTION(fm, p); - postaction: - POSTACTION(fm); } - } } -void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) { - void* mem; - size_t req = 0; - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - if (n_elements != 0) { - req = n_elements * elem_size; - if (((n_elements | elem_size) & ~(size_t)0xffff) && - (req / n_elements != elem_size)) - req = MAX_SIZE_T; /* force downstream failure on overflow */ - } - mem = internal_malloc(ms, req); - if (mem != 0 && calloc_must_clear(mem2chunk(mem))) - memset(mem, 0, req); - return mem; +void * +mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) +{ + void *mem; + size_t req = 0; + mstate ms = (mstate) msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms, ms); + return 0; + } + if (n_elements != 0) { + req = n_elements * elem_size; + if (((n_elements | elem_size) & ~(size_t) 0xffff) && + (req / n_elements != elem_size)) + req = MAX_SIZE_T; /* force downstream failure on overflow */ + } + mem = internal_malloc(ms, req); + if (mem != 0 && calloc_must_clear(mem2chunk(mem))) + memset(mem, 0, req); + return mem; } -void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) { - if (oldmem == 0) - return mspace_malloc(msp, bytes); +void * +mspace_realloc(mspace msp, void *oldmem, size_t bytes) +{ + if (oldmem == 0) + return mspace_malloc(msp, bytes); #ifdef REALLOC_ZERO_BYTES_FREES - if (bytes == 0) { - mspace_free(msp, oldmem); - return 0; - } + if (bytes == 0) { + mspace_free(msp, oldmem); + return 0; + } #endif /* REALLOC_ZERO_BYTES_FREES */ - else { + else { #if FOOTERS - mchunkptr p = mem2chunk(oldmem); - mstate ms = get_mstate_for(p); + mchunkptr p = mem2chunk(oldmem); + mstate ms = get_mstate_for(p); #else /* FOOTERS */ - mstate ms = (mstate)msp; + mstate ms = (mstate) msp; #endif /* FOOTERS */ - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms, ms); + return 0; + } + return internal_realloc(ms, oldmem, bytes); } - return internal_realloc(ms, oldmem, bytes); - } } -void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - return internal_memalign(ms, alignment, bytes); +void * +mspace_memalign(mspace msp, size_t alignment, size_t bytes) +{ + mstate ms = (mstate) msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms, ms); + return 0; + } + return internal_memalign(ms, alignment, bytes); } -void** mspace_independent_calloc(mspace msp, size_t n_elements, - size_t elem_size, void* chunks[]) { - size_t sz = elem_size; /* serves as 1-element array */ - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - return ialloc(ms, n_elements, &sz, 3, chunks); +void ** +mspace_independent_calloc(mspace msp, size_t n_elements, + size_t elem_size, void *chunks[]) +{ + size_t sz = elem_size; /* serves as 1-element array */ + mstate ms = (mstate) msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms, ms); + return 0; + } + return ialloc(ms, n_elements, &sz, 3, chunks); } -void** mspace_independent_comalloc(mspace msp, size_t n_elements, - size_t sizes[], void* chunks[]) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - return 0; - } - return ialloc(ms, n_elements, sizes, 0, chunks); +void ** +mspace_independent_comalloc(mspace msp, size_t n_elements, + size_t sizes[], void *chunks[]) +{ + mstate ms = (mstate) msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms, ms); + return 0; + } + return ialloc(ms, n_elements, sizes, 0, chunks); } -int mspace_trim(mspace msp, size_t pad) { - int result = 0; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - if (!PREACTION(ms)) { - result = sys_trim(ms, pad); - POSTACTION(ms); +int +mspace_trim(mspace msp, size_t pad) +{ + int result = 0; + mstate ms = (mstate) msp; + if (ok_magic(ms)) { + if (!PREACTION(ms)) { + result = sys_trim(ms, pad); + POSTACTION(ms); + } + } else { + USAGE_ERROR_ACTION(ms, ms); } - } - else { - USAGE_ERROR_ACTION(ms,ms); - } - return result; + return result; } -void mspace_malloc_stats(mspace msp) { - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - internal_malloc_stats(ms); - } - else { - USAGE_ERROR_ACTION(ms,ms); - } +void +mspace_malloc_stats(mspace msp) +{ + mstate ms = (mstate) msp; + if (ok_magic(ms)) { + internal_malloc_stats(ms); + } else { + USAGE_ERROR_ACTION(ms, ms); + } } -size_t mspace_footprint(mspace msp) { - size_t result; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - result = ms->footprint; - } - USAGE_ERROR_ACTION(ms,ms); - return result; +size_t +mspace_footprint(mspace msp) +{ + size_t result; + mstate ms = (mstate) msp; + if (ok_magic(ms)) { + result = ms->footprint; + } + USAGE_ERROR_ACTION(ms, ms); + return result; } -size_t mspace_max_footprint(mspace msp) { - size_t result; - mstate ms = (mstate)msp; - if (ok_magic(ms)) { - result = ms->max_footprint; - } - USAGE_ERROR_ACTION(ms,ms); - return result; +size_t +mspace_max_footprint(mspace msp) +{ + size_t result; + mstate ms = (mstate) msp; + if (ok_magic(ms)) { + result = ms->max_footprint; + } + USAGE_ERROR_ACTION(ms, ms); + return result; } #if !NO_MALLINFO -struct mallinfo mspace_mallinfo(mspace msp) { - mstate ms = (mstate)msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms,ms); - } - return internal_mallinfo(ms); +struct mallinfo +mspace_mallinfo(mspace msp) +{ + mstate ms = (mstate) msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms, ms); + } + return internal_mallinfo(ms); } #endif /* NO_MALLINFO */ -int mspace_mallopt(int param_number, int value) { - return change_mparam(param_number, value); +int +mspace_mallopt(int param_number, int value) +{ + return change_mparam(param_number, value); } #endif /* MSPACES */ @@ -5105,7 +5250,9 @@ int mspace_mallopt(int param_number, int value) { Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) * Based loosely on libg++-1.2X malloc. (It retains some of the overall structure of old version, but most details differ.) - + */ #endif /* !HAVE_MALLOC */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index 2b5abea8ab..0130d5a3b1 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -49,11 +49,20 @@ #include */ #include "SDL_stdinc.h" +#include "SDL_assert.h" + +#if defined(HAVE_QSORT) +void +SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) +{ + qsort(base, nmemb, size, compare); +} +#else #ifdef assert #undef assert #endif -#define assert(X) +#define assert(X) SDL_assert(X) #ifdef malloc #undef malloc #endif @@ -75,10 +84,7 @@ #endif #define qsort SDL_qsort - -#ifndef HAVE_QSORT - -static char _ID[]=""; +static const char _ID[] = ""; /* How many bytes are there per word? (Must be a power of 2, * and must in fact equal sizeof(int).) @@ -99,7 +105,7 @@ static char _ID[]=""; */ #define TRUNC_nonaligned 12 #define TRUNC_aligned 12 -#define TRUNC_words 12*WORD_BYTES /* nb different meaning */ +#define TRUNC_words 12*WORD_BYTES /* nb different meaning */ /* We use a simple pivoting algorithm for shortish sub-arrays * and a more complicated one for larger ones. The threshold @@ -107,7 +113,11 @@ static char _ID[]=""; */ #define PIVOT_THRESHOLD 40 -typedef struct { char * first; char * last; } stack_entry; +typedef struct +{ + char *first; + char *last; +} stack_entry; #define pushLeft {stack[stacktop].first=ffirst;stack[stacktop++].last=last;} #define pushRight {stack[stacktop].first=first;stack[stacktop++].last=llast;} #define doLeft {first=ffirst;llast=last;continue;} @@ -279,165 +289,188 @@ typedef struct { char * first; char * last; } stack_entry; /* ---------------------------------------------------------------------- */ -static char * pivot_big(char *first, char *mid, char *last, size_t size, - int compare(const void *, const void *)) { - size_t d=(((last-first)/size)>>3)*size; - char *m1,*m2,*m3; - { char *a=first, *b=first+d, *c=first+2*d; +static char * +pivot_big(char *first, char *mid, char *last, size_t size, + int compare(const void *, const void *)) +{ + size_t d = (((last - first) / size) >> 3) * size; + char *m1, *m2, *m3; + { + char *a = first, *b = first + d, *c = first + 2 * d; #ifdef DEBUG_QSORT -fprintf(stderr,"< %d %d %d\n",*(int*)a,*(int*)b,*(int*)c); + fprintf(stderr, "< %d %d %d\n", *(int *) a, *(int *) b, *(int *) c); #endif - m1 = compare(a,b)<0 ? - (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a)) - : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b)); - } - { char *a=mid-d, *b=mid, *c=mid+d; + m1 = compare(a, b) < 0 ? + (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a)) + : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b)); + } + { + char *a = mid - d, *b = mid, *c = mid + d; #ifdef DEBUG_QSORT -fprintf(stderr,". %d %d %d\n",*(int*)a,*(int*)b,*(int*)c); + fprintf(stderr, ". %d %d %d\n", *(int *) a, *(int *) b, *(int *) c); #endif - m2 = compare(a,b)<0 ? - (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a)) - : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b)); - } - { char *a=last-2*d, *b=last-d, *c=last; + m2 = compare(a, b) < 0 ? + (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a)) + : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b)); + } + { + char *a = last - 2 * d, *b = last - d, *c = last; #ifdef DEBUG_QSORT -fprintf(stderr,"> %d %d %d\n",*(int*)a,*(int*)b,*(int*)c); + fprintf(stderr, "> %d %d %d\n", *(int *) a, *(int *) b, *(int *) c); #endif - m3 = compare(a,b)<0 ? - (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a)) - : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b)); - } + m3 = compare(a, b) < 0 ? + (compare(b, c) < 0 ? b : (compare(a, c) < 0 ? c : a)) + : (compare(a, c) < 0 ? a : (compare(b, c) < 0 ? c : b)); + } #ifdef DEBUG_QSORT -fprintf(stderr,"-> %d %d %d\n",*(int*)m1,*(int*)m2,*(int*)m3); + fprintf(stderr, "-> %d %d %d\n", *(int *) m1, *(int *) m2, *(int *) m3); #endif - return compare(m1,m2)<0 ? - (compare(m2,m3)<0 ? m2 : (compare(m1,m3)<0 ? m3 : m1)) - : (compare(m1,m3)<0 ? m1 : (compare(m2,m3)<0 ? m3 : m2)); + return compare(m1, m2) < 0 ? + (compare(m2, m3) < 0 ? m2 : (compare(m1, m3) < 0 ? m3 : m1)) + : (compare(m1, m3) < 0 ? m1 : (compare(m2, m3) < 0 ? m3 : m2)); } /* ---------------------------------------------------------------------- */ -static void qsort_nonaligned(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)) { - - stack_entry stack[STACK_SIZE]; - int stacktop=0; - char *first,*last; - char *pivot=malloc(size); - size_t trunc=TRUNC_nonaligned*size; - assert(pivot!=0); - - first=(char*)base; last=first+(nmemb-1)*size; - - if ((size_t)(last-first)>trunc) { - char *ffirst=first, *llast=last; - while (1) { - /* Select pivot */ - { char * mid=first+size*((last-first)/size >> 1); - Pivot(SWAP_nonaligned,size); - memcpy(pivot,mid,size); - } - /* Partition. */ - Partition(SWAP_nonaligned,size); - /* Prepare to recurse/iterate. */ - Recurse(trunc) +static void +qsort_nonaligned(void *base, size_t nmemb, size_t size, + int (*compare) (const void *, const void *)) +{ + + stack_entry stack[STACK_SIZE]; + int stacktop = 0; + char *first, *last; + char *pivot = malloc(size); + size_t trunc = TRUNC_nonaligned * size; + assert(pivot != 0); + + first = (char *) base; + last = first + (nmemb - 1) * size; + + if ((size_t) (last - first) > trunc) { + char *ffirst = first, *llast = last; + while (1) { + /* Select pivot */ + { + char *mid = first + size * ((last - first) / size >> 1); + Pivot(SWAP_nonaligned, size); + memcpy(pivot, mid, size); + } + /* Partition. */ + Partition(SWAP_nonaligned, size); + /* Prepare to recurse/iterate. */ + Recurse(trunc)} } - } - PreInsertion(SWAP_nonaligned,TRUNC_nonaligned,size); - Insertion(SWAP_nonaligned); - free(pivot); + PreInsertion(SWAP_nonaligned, TRUNC_nonaligned, size); + Insertion(SWAP_nonaligned); + free(pivot); } -static void qsort_aligned(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)) { - - stack_entry stack[STACK_SIZE]; - int stacktop=0; - char *first,*last; - char *pivot=malloc(size); - size_t trunc=TRUNC_aligned*size; - assert(pivot!=0); - - first=(char*)base; last=first+(nmemb-1)*size; - - if ((size_t)(last-first)>trunc) { - char *ffirst=first,*llast=last; - while (1) { - /* Select pivot */ - { char * mid=first+size*((last-first)/size >> 1); - Pivot(SWAP_aligned,size); - memcpy(pivot,mid,size); - } - /* Partition. */ - Partition(SWAP_aligned,size); - /* Prepare to recurse/iterate. */ - Recurse(trunc) +static void +qsort_aligned(void *base, size_t nmemb, size_t size, + int (*compare) (const void *, const void *)) +{ + + stack_entry stack[STACK_SIZE]; + int stacktop = 0; + char *first, *last; + char *pivot = malloc(size); + size_t trunc = TRUNC_aligned * size; + assert(pivot != 0); + + first = (char *) base; + last = first + (nmemb - 1) * size; + + if ((size_t) (last - first) > trunc) { + char *ffirst = first, *llast = last; + while (1) { + /* Select pivot */ + { + char *mid = first + size * ((last - first) / size >> 1); + Pivot(SWAP_aligned, size); + memcpy(pivot, mid, size); + } + /* Partition. */ + Partition(SWAP_aligned, size); + /* Prepare to recurse/iterate. */ + Recurse(trunc)} } - } - PreInsertion(SWAP_aligned,TRUNC_aligned,size); - Insertion(SWAP_aligned); - free(pivot); + PreInsertion(SWAP_aligned, TRUNC_aligned, size); + Insertion(SWAP_aligned); + free(pivot); } -static void qsort_words(void *base, size_t nmemb, - int (*compare)(const void *, const void *)) { +static void +qsort_words(void *base, size_t nmemb, + int (*compare) (const void *, const void *)) +{ - stack_entry stack[STACK_SIZE]; - int stacktop=0; - char *first,*last; - char *pivot=malloc(WORD_BYTES); - assert(pivot!=0); + stack_entry stack[STACK_SIZE]; + int stacktop = 0; + char *first, *last; + char *pivot = malloc(WORD_BYTES); + assert(pivot != 0); - first=(char*)base; last=first+(nmemb-1)*WORD_BYTES; + first = (char *) base; + last = first + (nmemb - 1) * WORD_BYTES; - if (last-first>TRUNC_words) { - char *ffirst=first, *llast=last; - while (1) { + if (last - first > TRUNC_words) { + char *ffirst = first, *llast = last; + while (1) { #ifdef DEBUG_QSORT -fprintf(stderr,"Doing %d:%d: ", - (first-(char*)base)/WORD_BYTES, - (last-(char*)base)/WORD_BYTES); + fprintf(stderr, "Doing %d:%d: ", + (first - (char *) base) / WORD_BYTES, + (last - (char *) base) / WORD_BYTES); #endif - /* Select pivot */ - { char * mid=first+WORD_BYTES*((last-first) / (2*WORD_BYTES)); - Pivot(SWAP_words,WORD_BYTES); - *(int*)pivot=*(int*)mid; - } + /* Select pivot */ + { + char *mid = + first + WORD_BYTES * ((last - first) / (2 * WORD_BYTES)); + Pivot(SWAP_words, WORD_BYTES); + *(int *) pivot = *(int *) mid; + } #ifdef DEBUG_QSORT -fprintf(stderr,"pivot=%d\n",*(int*)pivot); + fprintf(stderr, "pivot=%d\n", *(int *) pivot); #endif - /* Partition. */ - Partition(SWAP_words,WORD_BYTES); - /* Prepare to recurse/iterate. */ - Recurse(TRUNC_words) + /* Partition. */ + Partition(SWAP_words, WORD_BYTES); + /* Prepare to recurse/iterate. */ + Recurse(TRUNC_words)} } - } - PreInsertion(SWAP_words,(TRUNC_words/WORD_BYTES),WORD_BYTES); - /* Now do insertion sort. */ - last=((char*)base)+nmemb*WORD_BYTES; - for (first=((char*)base)+WORD_BYTES;first!=last;first+=WORD_BYTES) { - /* Find the right place for |first|. My apologies for var reuse */ - int *pl=(int*)(first-WORD_BYTES),*pr=(int*)first; - *(int*)pivot=*(int*)first; - for (;compare(pl,pivot)>0;pr=pl,--pl) { - *pr=*pl; } - if (pr!=(int*)first) *pr=*(int*)pivot; - } - free(pivot); + PreInsertion(SWAP_words, (TRUNC_words / WORD_BYTES), WORD_BYTES); + /* Now do insertion sort. */ + last = ((char *) base) + nmemb * WORD_BYTES; + for (first = ((char *) base) + WORD_BYTES; first != last; + first += WORD_BYTES) { + /* Find the right place for |first|. My apologies for var reuse */ + int *pl = (int *) (first - WORD_BYTES), *pr = (int *) first; + *(int *) pivot = *(int *) first; + for (; compare(pl, pivot) > 0; pr = pl, --pl) { + *pr = *pl; + } + if (pr != (int *) first) + *pr = *(int *) pivot; + } + free(pivot); } /* ---------------------------------------------------------------------- */ -void qsort(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)) { - - if (nmemb<=1) return; - if (((uintptr_t)base|size)&(WORD_BYTES-1)) - qsort_nonaligned(base,nmemb,size,compare); - else if (size!=WORD_BYTES) - qsort_aligned(base,nmemb,size,compare); - else - qsort_words(base,nmemb,compare); +void +qsort(void *base, size_t nmemb, size_t size, + int (*compare) (const void *, const void *)) +{ + + if (nmemb <= 1) + return; + if (((uintptr_t) base | size) & (WORD_BYTES - 1)) + qsort_nonaligned(base, nmemb, size, compare); + else if (size != WORD_BYTES) + qsort_aligned(base, nmemb, size, compare); + else + qsort_words(base, nmemb, compare); } -#endif /* !HAVE_QSORT */ +#endif /* !SDL_qsort */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c index 5c88fe72c9..2ee62beee3 100644 --- a/src/stdlib/SDL_stdlib.c +++ b/src/stdlib/SDL_stdlib.c @@ -1,29 +1,192 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* This file contains portable stdlib functions for SDL */ #include "SDL_stdinc.h" +#include "../libm/math_libm.h" + + +double +SDL_atan(double x) +{ +#ifdef HAVE_ATAN + return atan(x); +#else + return SDL_uclibc_atan(x); +#endif /* HAVE_ATAN */ +} + +double +SDL_atan2(double x, double y) +{ +#if defined(HAVE_ATAN2) + return atan2(x, y); +#else + return SDL_uclibc_atan2(x, y); +#endif /* HAVE_ATAN2 */ +} + +double +SDL_ceil(double x) +{ +#ifdef HAVE_CEIL + return ceil(x); +#else + return (double)(int)((x)+0.5); +#endif /* HAVE_CEIL */ +} + +double +SDL_copysign(double x, double y) +{ +#if defined(HAVE_COPYSIGN) + return copysign(x, y); +#else + return SDL_uclibc_copysign(x, y); +#endif /* HAVE_COPYSIGN */ +} + +double +SDL_cos(double x) +{ +#if defined(HAVE_COS) + return cos(x); +#else + return SDL_uclibc_cos(x); +#endif /* HAVE_COS */ +} + +float +SDL_cosf(float x) +{ +#ifdef HAVE_COSF + return cosf(x); +#else + return (float)SDL_cos((double)x); +#endif +} + +double +SDL_fabs(double x) +{ +#if defined(HAVE_FABS) + return fabs(x); +#else + return SDL_uclibc_fabs(x); +#endif /* HAVE_FABS */ +} + +double +SDL_floor(double x) +{ +#if defined(HAVE_FLOOR) + return floor(x); +#else + return SDL_uclibc_floor(x); +#endif /* HAVE_FLOOR */ +} + +double +SDL_log(double x) +{ +#if defined(HAVE_LOG) + return log(x); +#else + return SDL_uclibc_log(x); +#endif /* HAVE_LOG */ +} + +double +SDL_pow(double x, double y) +{ +#if defined(HAVE_POW) + return pow(x, y); +#else + return SDL_uclibc_pow(x, y); +#endif /* HAVE_POW */ +} + +double +SDL_scalbn(double x, int n) +{ +#if defined(HAVE_SCALBN) + return scalbn(x, n); +#else + return SDL_uclibc_scalbn(x, n); +#endif /* HAVE_SCALBN */ +} + +double +SDL_sin(double x) +{ +#if defined(HAVE_SIN) + return sin(x); +#else + return SDL_uclibc_sin(x); +#endif /* HAVE_SIN */ +} + +float +SDL_sinf(float x) +{ +#ifdef HAVE_SINF + return sinf(x); +#else + return (float)SDL_sin((double)x); +#endif /* HAVE_SINF */ +} + +double +SDL_sqrt(double x) +{ +#if defined(HAVE_SQRT) + return sqrt(x); +#else + return SDL_uclibc_sqrt(x); +#endif +} + +int SDL_abs(int x) +{ +#ifdef HAVE_ABS + return abs(x); +#else + return ((x) < 0 ? -(x) : (x)); +#endif +} + +#ifdef HAVE_CTYPE_H +int SDL_isdigit(int x) { return isdigit(x); } +int SDL_isspace(int x) { return isspace(x); } +int SDL_toupper(int x) { return toupper(x); } +int SDL_tolower(int x) { return tolower(x); } +#else +int SDL_isdigit(int x) { return ((x) >= '0') && ((x) <= '9'); } +int SDL_isspace(int x) { return ((x) == ' ') || ((x) == '\t') || ((x) == '\r') || ((x) == '\n') || ((x) == '\f') || ((x) == '\v'); } +int SDL_toupper(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); } +int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); } +#endif + #ifndef HAVE_LIBC /* These are some C runtime intrinsics that need to be defined */ @@ -32,589 +195,712 @@ #ifndef __FLTUSED__ #define __FLTUSED__ -#ifdef __cplusplus - extern "C" -#endif - __declspec(selectany) int _fltused=1; +__declspec(selectany) int _fltused = 1; #endif +/* The optimizer on Visual Studio 2010/2012 generates memcpy() calls */ +#if _MSC_VER >= 1600 && defined(_WIN64) && !defined(_DEBUG) +#include + +#pragma function(memcpy) +void * memcpy ( void * destination, const void * source, size_t num ) +{ + const Uint8 *src = (const Uint8 *)source; + Uint8 *dst = (Uint8 *)destination; + size_t i; + + /* All WIN64 architectures have SSE, right? */ + if (!((uintptr_t) src & 15) && !((uintptr_t) dst & 15)) { + __m128 values[4]; + for (i = num / 64; i--;) { + _mm_prefetch(src, _MM_HINT_NTA); + values[0] = *(__m128 *) (src + 0); + values[1] = *(__m128 *) (src + 16); + values[2] = *(__m128 *) (src + 32); + values[3] = *(__m128 *) (src + 48); + _mm_stream_ps((float *) (dst + 0), values[0]); + _mm_stream_ps((float *) (dst + 16), values[1]); + _mm_stream_ps((float *) (dst + 32), values[2]); + _mm_stream_ps((float *) (dst + 48), values[3]); + src += 64; + dst += 64; + } + num &= 63; + } + + while (num--) { + *dst++ = *src++; + } + return destination; +} +#endif /* _MSC_VER == 1600 && defined(_WIN64) && !defined(_DEBUG) */ + +#ifdef _M_IX86 + +void +__declspec(naked) +_chkstk() +{ +} + /* Float to long */ -void __declspec(naked) _ftol() +void +__declspec(naked) +_ftol() { - __asm { - push ebp - mov ebp,esp - sub esp,20h - and esp,0FFFFFFF0h - fld st(0) - fst dword ptr [esp+18h] - fistp qword ptr [esp+10h] - fild qword ptr [esp+10h] - mov edx,dword ptr [esp+18h] - mov eax,dword ptr [esp+10h] - test eax,eax - je integer_QnaN_or_zero + /* *INDENT-OFF* */ + __asm { + push ebp + mov ebp,esp + sub esp,20h + and esp,0FFFFFFF0h + fld st(0) + fst dword ptr [esp+18h] + fistp qword ptr [esp+10h] + fild qword ptr [esp+10h] + mov edx,dword ptr [esp+18h] + mov eax,dword ptr [esp+10h] + test eax,eax + je integer_QnaN_or_zero arg_is_not_integer_QnaN: - fsubp st(1),st - test edx,edx - jns positive - fstp dword ptr [esp] - mov ecx,dword ptr [esp] - xor ecx,80000000h - add ecx,7FFFFFFFh - adc eax,0 - mov edx,dword ptr [esp+14h] - adc edx,0 - jmp localexit + fsubp st(1),st + test edx,edx + jns positive + fstp dword ptr [esp] + mov ecx,dword ptr [esp] + xor ecx,80000000h + add ecx,7FFFFFFFh + adc eax,0 + mov edx,dword ptr [esp+14h] + adc edx,0 + jmp localexit positive: - fstp dword ptr [esp] - mov ecx,dword ptr [esp] - add ecx,7FFFFFFFh - sbb eax,0 - mov edx,dword ptr [esp+14h] - sbb edx,0 - jmp localexit + fstp dword ptr [esp] + mov ecx,dword ptr [esp] + add ecx,7FFFFFFFh + sbb eax,0 + mov edx,dword ptr [esp+14h] + sbb edx,0 + jmp localexit integer_QnaN_or_zero: - mov edx,dword ptr [esp+14h] - test edx,7FFFFFFFh - jne arg_is_not_integer_QnaN - fstp dword ptr [esp+18h] - fstp dword ptr [esp+18h] + mov edx,dword ptr [esp+14h] + test edx,7FFFFFFFh + jne arg_is_not_integer_QnaN + fstp dword ptr [esp+18h] + fstp dword ptr [esp+18h] localexit: - leave - ret - } + leave + ret + } + /* *INDENT-ON* */ } -void __declspec(naked) _ftol2_sse() + +void +_ftol2_sse() { - _ftol(); + _ftol(); } /* 64-bit math operators for 32-bit systems */ -void __declspec(naked) _allmul() +void +__declspec(naked) +_allmul() { - __asm { - push ebp - mov ebp,esp - push edi - push esi - push ebx - sub esp,0Ch - mov eax,dword ptr [ebp+10h] - mov edi,dword ptr [ebp+8] - mov ebx,eax - mov esi,eax - sar esi,1Fh - mov eax,dword ptr [ebp+8] - mul ebx - imul edi,esi - mov ecx,edx - mov dword ptr [ebp-18h],eax - mov edx,dword ptr [ebp+0Ch] - add ecx,edi - imul ebx,edx - mov eax,dword ptr [ebp-18h] - lea ebx,[ebx+ecx] - mov dword ptr [ebp-14h],ebx - mov edx,dword ptr [ebp-14h] - add esp,0Ch - pop ebx - pop esi - pop edi - pop ebp - ret - } + /* *INDENT-OFF* */ + __asm { + push ebp + mov ebp,esp + push edi + push esi + push ebx + sub esp,0Ch + mov eax,dword ptr [ebp+10h] + mov edi,dword ptr [ebp+8] + mov ebx,eax + mov esi,eax + sar esi,1Fh + mov eax,dword ptr [ebp+8] + mul ebx + imul edi,esi + mov ecx,edx + mov dword ptr [ebp-18h],eax + mov edx,dword ptr [ebp+0Ch] + add ecx,edi + imul ebx,edx + mov eax,dword ptr [ebp-18h] + lea ebx,[ebx+ecx] + mov dword ptr [ebp-14h],ebx + mov edx,dword ptr [ebp-14h] + add esp,0Ch + pop ebx + pop esi + pop edi + pop ebp + ret 10h + } + /* *INDENT-ON* */ } -void __declspec(naked) _alldiv() + +void +__declspec(naked) +_alldiv() { - __asm { - push edi - push esi - push ebx - xor edi,edi - mov eax,dword ptr [esp+14h] - or eax,eax - jge L1 - inc edi - mov edx,dword ptr [esp+10h] - neg eax - neg edx - sbb eax,0 - mov dword ptr [esp+14h],eax - mov dword ptr [esp+10h],edx + /* *INDENT-OFF* */ + __asm { + push edi + push esi + push ebx + xor edi,edi + mov eax,dword ptr [esp+14h] + or eax,eax + jge L1 + inc edi + mov edx,dword ptr [esp+10h] + neg eax + neg edx + sbb eax,0 + mov dword ptr [esp+14h],eax + mov dword ptr [esp+10h],edx L1: - mov eax,dword ptr [esp+1Ch] - or eax,eax - jge L2 - inc edi - mov edx,dword ptr [esp+18h] - neg eax - neg edx - sbb eax,0 - mov dword ptr [esp+1Ch],eax - mov dword ptr [esp+18h],edx + mov eax,dword ptr [esp+1Ch] + or eax,eax + jge L2 + inc edi + mov edx,dword ptr [esp+18h] + neg eax + neg edx + sbb eax,0 + mov dword ptr [esp+1Ch],eax + mov dword ptr [esp+18h],edx L2: - or eax,eax - jne L3 - mov ecx,dword ptr [esp+18h] - mov eax,dword ptr [esp+14h] - xor edx,edx - div ecx - mov ebx,eax - mov eax,dword ptr [esp+10h] - div ecx - mov edx,ebx - jmp L4 + or eax,eax + jne L3 + mov ecx,dword ptr [esp+18h] + mov eax,dword ptr [esp+14h] + xor edx,edx + div ecx + mov ebx,eax + mov eax,dword ptr [esp+10h] + div ecx + mov edx,ebx + jmp L4 L3: - mov ebx,eax - mov ecx,dword ptr [esp+18h] - mov edx,dword ptr [esp+14h] - mov eax,dword ptr [esp+10h] + mov ebx,eax + mov ecx,dword ptr [esp+18h] + mov edx,dword ptr [esp+14h] + mov eax,dword ptr [esp+10h] L5: - shr ebx,1 - rcr ecx,1 - shr edx,1 - rcr eax,1 - or ebx,ebx - jne L5 - div ecx - mov esi,eax - mul dword ptr [esp+1Ch] - mov ecx,eax - mov eax,dword ptr [esp+18h] - mul esi - add edx,ecx - jb L6 - cmp edx,dword ptr [esp+14h] - ja L6 - jb L7 - cmp eax,dword ptr [esp+10h] - jbe L7 + shr ebx,1 + rcr ecx,1 + shr edx,1 + rcr eax,1 + or ebx,ebx + jne L5 + div ecx + mov esi,eax + mul dword ptr [esp+1Ch] + mov ecx,eax + mov eax,dword ptr [esp+18h] + mul esi + add edx,ecx + jb L6 + cmp edx,dword ptr [esp+14h] + ja L6 + jb L7 + cmp eax,dword ptr [esp+10h] + jbe L7 L6: - dec esi + dec esi L7: - xor edx,edx - mov eax,esi + xor edx,edx + mov eax,esi L4: - dec edi - jne L8 - neg edx - neg eax - sbb edx,0 + dec edi + jne L8 + neg edx + neg eax + sbb edx,0 L8: - pop ebx - pop esi - pop edi - ret 10h - } + pop ebx + pop esi + pop edi + ret 10h + } + /* *INDENT-ON* */ } -void __declspec(naked) _aulldiv() + +void +__declspec(naked) +_aulldiv() { - __asm { - push ebx - push esi - mov eax,dword ptr [esp+18h] - or eax,eax - jne L1 - mov ecx,dword ptr [esp+14h] - mov eax,dword ptr [esp+10h] - xor edx,edx - div ecx - mov ebx,eax - mov eax,dword ptr [esp+0Ch] - div ecx - mov edx,ebx - jmp L2 + /* *INDENT-OFF* */ + __asm { + push ebx + push esi + mov eax,dword ptr [esp+18h] + or eax,eax + jne L1 + mov ecx,dword ptr [esp+14h] + mov eax,dword ptr [esp+10h] + xor edx,edx + div ecx + mov ebx,eax + mov eax,dword ptr [esp+0Ch] + div ecx + mov edx,ebx + jmp L2 L1: - mov ecx,eax - mov ebx,dword ptr [esp+14h] - mov edx,dword ptr [esp+10h] - mov eax,dword ptr [esp+0Ch] + mov ecx,eax + mov ebx,dword ptr [esp+14h] + mov edx,dword ptr [esp+10h] + mov eax,dword ptr [esp+0Ch] L3: - shr ecx,1 - rcr ebx,1 - shr edx,1 - rcr eax,1 - or ecx,ecx - jne L3 - div ebx - mov esi,eax - mul dword ptr [esp+18h] - mov ecx,eax - mov eax,dword ptr [esp+14h] - mul esi - add edx,ecx - jb L4 - cmp edx,dword ptr [esp+10h] - ja L4 - jb L5 - cmp eax,dword ptr [esp+0Ch] - jbe L5 + shr ecx,1 + rcr ebx,1 + shr edx,1 + rcr eax,1 + or ecx,ecx + jne L3 + div ebx + mov esi,eax + mul dword ptr [esp+18h] + mov ecx,eax + mov eax,dword ptr [esp+14h] + mul esi + add edx,ecx + jb L4 + cmp edx,dword ptr [esp+10h] + ja L4 + jb L5 + cmp eax,dword ptr [esp+0Ch] + jbe L5 L4: - dec esi + dec esi L5: - xor edx,edx - mov eax,esi + xor edx,edx + mov eax,esi L2: - pop esi - pop ebx - ret 10h - } + pop esi + pop ebx + ret 10h + } + /* *INDENT-ON* */ } -void __declspec(naked) _allrem() + +void +__declspec(naked) +_allrem() { - __asm { - push ebx - push edi - xor edi,edi - mov eax,dword ptr [esp+10h] - or eax,eax - jge L1 - inc edi - mov edx,dword ptr [esp+0Ch] - neg eax - neg edx - sbb eax,0 - mov dword ptr [esp+10h],eax - mov dword ptr [esp+0Ch],edx + /* *INDENT-OFF* */ + __asm { + push ebx + push edi + xor edi,edi + mov eax,dword ptr [esp+10h] + or eax,eax + jge L1 + inc edi + mov edx,dword ptr [esp+0Ch] + neg eax + neg edx + sbb eax,0 + mov dword ptr [esp+10h],eax + mov dword ptr [esp+0Ch],edx L1: - mov eax,dword ptr [esp+18h] - or eax,eax - jge L2 - mov edx,dword ptr [esp+14h] - neg eax - neg edx - sbb eax,0 - mov dword ptr [esp+18h],eax - mov dword ptr [esp+14h],edx + mov eax,dword ptr [esp+18h] + or eax,eax + jge L2 + mov edx,dword ptr [esp+14h] + neg eax + neg edx + sbb eax,0 + mov dword ptr [esp+18h],eax + mov dword ptr [esp+14h],edx L2: - or eax,eax - jne L3 - mov ecx,dword ptr [esp+14h] - mov eax,dword ptr [esp+10h] - xor edx,edx - div ecx - mov eax,dword ptr [esp+0Ch] - div ecx - mov eax,edx - xor edx,edx - dec edi - jns L4 - jmp L8 + or eax,eax + jne L3 + mov ecx,dword ptr [esp+14h] + mov eax,dword ptr [esp+10h] + xor edx,edx + div ecx + mov eax,dword ptr [esp+0Ch] + div ecx + mov eax,edx + xor edx,edx + dec edi + jns L4 + jmp L8 L3: - mov ebx,eax - mov ecx,dword ptr [esp+14h] - mov edx,dword ptr [esp+10h] - mov eax,dword ptr [esp+0Ch] + mov ebx,eax + mov ecx,dword ptr [esp+14h] + mov edx,dword ptr [esp+10h] + mov eax,dword ptr [esp+0Ch] L5: - shr ebx,1 - rcr ecx,1 - shr edx,1 - rcr eax,1 - or ebx,ebx - jne L5 - div ecx - mov ecx,eax - mul dword ptr [esp+18h] - xchg eax,ecx - mul dword ptr [esp+14h] - add edx,ecx - jb L6 - cmp edx,dword ptr [esp+10h] - ja L6 - jb L7 - cmp eax,dword ptr [esp+0Ch] - jbe L7 + shr ebx,1 + rcr ecx,1 + shr edx,1 + rcr eax,1 + or ebx,ebx + jne L5 + div ecx + mov ecx,eax + mul dword ptr [esp+18h] + xchg eax,ecx + mul dword ptr [esp+14h] + add edx,ecx + jb L6 + cmp edx,dword ptr [esp+10h] + ja L6 + jb L7 + cmp eax,dword ptr [esp+0Ch] + jbe L7 L6: - sub eax,dword ptr [esp+14h] - sbb edx,dword ptr [esp+18h] + sub eax,dword ptr [esp+14h] + sbb edx,dword ptr [esp+18h] L7: - sub eax,dword ptr [esp+0Ch] - sbb edx,dword ptr [esp+10h] - dec edi - jns L8 + sub eax,dword ptr [esp+0Ch] + sbb edx,dword ptr [esp+10h] + dec edi + jns L8 L4: - neg edx - neg eax - sbb edx,0 + neg edx + neg eax + sbb edx,0 L8: - pop edi - pop ebx - ret 10h - } + pop edi + pop ebx + ret 10h + } + /* *INDENT-ON* */ } -void __declspec(naked) _aullrem() + +void +__declspec(naked) +_aullrem() { - __asm { - push ebx - mov eax,dword ptr [esp+14h] - or eax,eax - jne L1 - mov ecx,dword ptr [esp+10h] - mov eax,dword ptr [esp+0Ch] - xor edx,edx - div ecx - mov eax,dword ptr [esp+8] - div ecx - mov eax,edx - xor edx,edx - jmp L2 + /* *INDENT-OFF* */ + __asm { + push ebx + mov eax,dword ptr [esp+14h] + or eax,eax + jne L1 + mov ecx,dword ptr [esp+10h] + mov eax,dword ptr [esp+0Ch] + xor edx,edx + div ecx + mov eax,dword ptr [esp+8] + div ecx + mov eax,edx + xor edx,edx + jmp L2 L1: - mov ecx,eax - mov ebx,dword ptr [esp+10h] - mov edx,dword ptr [esp+0Ch] - mov eax,dword ptr [esp+8] + mov ecx,eax + mov ebx,dword ptr [esp+10h] + mov edx,dword ptr [esp+0Ch] + mov eax,dword ptr [esp+8] L3: - shr ecx,1 - rcr ebx,1 - shr edx,1 - rcr eax,1 - or ecx,ecx - jne L3 - div ebx - mov ecx,eax - mul dword ptr [esp+14h] - xchg eax,ecx - mul dword ptr [esp+10h] - add edx,ecx - jb L4 - cmp edx,dword ptr [esp+0Ch] - ja L4 - jb L5 - cmp eax,dword ptr [esp+8] - jbe L5 + shr ecx,1 + rcr ebx,1 + shr edx,1 + rcr eax,1 + or ecx,ecx + jne L3 + div ebx + mov ecx,eax + mul dword ptr [esp+14h] + xchg eax,ecx + mul dword ptr [esp+10h] + add edx,ecx + jb L4 + cmp edx,dword ptr [esp+0Ch] + ja L4 + jb L5 + cmp eax,dword ptr [esp+8] + jbe L5 L4: - sub eax,dword ptr [esp+10h] - sbb edx,dword ptr [esp+14h] + sub eax,dword ptr [esp+10h] + sbb edx,dword ptr [esp+14h] L5: - sub eax,dword ptr [esp+8] - sbb edx,dword ptr [esp+0Ch] - neg edx - neg eax - sbb edx,0 + sub eax,dword ptr [esp+8] + sbb edx,dword ptr [esp+0Ch] + neg edx + neg eax + sbb edx,0 L2: - pop ebx - ret 10h - } + pop ebx + ret 10h + } + /* *INDENT-ON* */ } -void __declspec(naked) _alldvrm() + +void +__declspec(naked) +_alldvrm() { - __asm { - push edi - push esi - push ebp - xor edi,edi - xor ebp,ebp - mov eax,dword ptr [esp+14h] - or eax,eax - jge L1 - inc edi - inc ebp - mov edx,dword ptr [esp+10h] - neg eax - neg edx - sbb eax,0 - mov dword ptr [esp+14h],eax - mov dword ptr [esp+10h],edx + /* *INDENT-OFF* */ + __asm { + push edi + push esi + push ebp + xor edi,edi + xor ebp,ebp + mov eax,dword ptr [esp+14h] + or eax,eax + jge L1 + inc edi + inc ebp + mov edx,dword ptr [esp+10h] + neg eax + neg edx + sbb eax,0 + mov dword ptr [esp+14h],eax + mov dword ptr [esp+10h],edx L1: - mov eax,dword ptr [esp+1Ch] - or eax,eax - jge L2 - inc edi - mov edx,dword ptr [esp+18h] - neg eax - neg edx - sbb eax,0 - mov dword ptr [esp+1Ch],eax - mov dword ptr [esp+18h],edx + mov eax,dword ptr [esp+1Ch] + or eax,eax + jge L2 + inc edi + mov edx,dword ptr [esp+18h] + neg eax + neg edx + sbb eax,0 + mov dword ptr [esp+1Ch],eax + mov dword ptr [esp+18h],edx L2: - or eax,eax - jne L3 - mov ecx,dword ptr [esp+18h] - mov eax,dword ptr [esp+14h] - xor edx,edx - div ecx - mov ebx,eax - mov eax,dword ptr [esp+10h] - div ecx - mov esi,eax - mov eax,ebx - mul dword ptr [esp+18h] - mov ecx,eax - mov eax,esi - mul dword ptr [esp+18h] - add edx,ecx - jmp L4 + or eax,eax + jne L3 + mov ecx,dword ptr [esp+18h] + mov eax,dword ptr [esp+14h] + xor edx,edx + div ecx + mov ebx,eax + mov eax,dword ptr [esp+10h] + div ecx + mov esi,eax + mov eax,ebx + mul dword ptr [esp+18h] + mov ecx,eax + mov eax,esi + mul dword ptr [esp+18h] + add edx,ecx + jmp L4 L3: - mov ebx,eax - mov ecx,dword ptr [esp+18h] - mov edx,dword ptr [esp+14h] - mov eax,dword ptr [esp+10h] + mov ebx,eax + mov ecx,dword ptr [esp+18h] + mov edx,dword ptr [esp+14h] + mov eax,dword ptr [esp+10h] L5: - shr ebx,1 - rcr ecx,1 - shr edx,1 - rcr eax,1 - or ebx,ebx - jne L5 - div ecx - mov esi,eax - mul dword ptr [esp+1Ch] - mov ecx,eax - mov eax,dword ptr [esp+18h] - mul esi - add edx,ecx - jb L6 - cmp edx,dword ptr [esp+14h] - ja L6 - jb L7 - cmp eax,dword ptr [esp+10h] - jbe L7 + shr ebx,1 + rcr ecx,1 + shr edx,1 + rcr eax,1 + or ebx,ebx + jne L5 + div ecx + mov esi,eax + mul dword ptr [esp+1Ch] + mov ecx,eax + mov eax,dword ptr [esp+18h] + mul esi + add edx,ecx + jb L6 + cmp edx,dword ptr [esp+14h] + ja L6 + jb L7 + cmp eax,dword ptr [esp+10h] + jbe L7 L6: - dec esi - sub eax,dword ptr [esp+18h] - sbb edx,dword ptr [esp+1Ch] + dec esi + sub eax,dword ptr [esp+18h] + sbb edx,dword ptr [esp+1Ch] L7: - xor ebx,ebx + xor ebx,ebx L4: - sub eax,dword ptr [esp+10h] - sbb edx,dword ptr [esp+14h] - dec ebp - jns L9 - neg edx - neg eax - sbb edx,0 + sub eax,dword ptr [esp+10h] + sbb edx,dword ptr [esp+14h] + dec ebp + jns L9 + neg edx + neg eax + sbb edx,0 L9: - mov ecx,edx - mov edx,ebx - mov ebx,ecx - mov ecx,eax - mov eax,esi - dec edi - jne L8 - neg edx - neg eax - sbb edx,0 + mov ecx,edx + mov edx,ebx + mov ebx,ecx + mov ecx,eax + mov eax,esi + dec edi + jne L8 + neg edx + neg eax + sbb edx,0 L8: - pop ebp - pop esi - pop edi - ret 10h - } + pop ebp + pop esi + pop edi + ret 10h + } + /* *INDENT-ON* */ } -void __declspec(naked) _aulldvrm() + +void +__declspec(naked) +_aulldvrm() { - __asm { - push esi - mov eax,dword ptr [esp+14h] - or eax,eax - jne L1 - mov ecx,dword ptr [esp+10h] - mov eax,dword ptr [esp+0Ch] - xor edx,edx - div ecx - mov ebx,eax - mov eax,dword ptr [esp+8] - div ecx - mov esi,eax - mov eax,ebx - mul dword ptr [esp+10h] - mov ecx,eax - mov eax,esi - mul dword ptr [esp+10h] - add edx,ecx - jmp L2 + /* *INDENT-OFF* */ + __asm { + push esi + mov eax,dword ptr [esp+14h] + or eax,eax + jne L1 + mov ecx,dword ptr [esp+10h] + mov eax,dword ptr [esp+0Ch] + xor edx,edx + div ecx + mov ebx,eax + mov eax,dword ptr [esp+8] + div ecx + mov esi,eax + mov eax,ebx + mul dword ptr [esp+10h] + mov ecx,eax + mov eax,esi + mul dword ptr [esp+10h] + add edx,ecx + jmp L2 L1: - mov ecx,eax - mov ebx,dword ptr [esp+10h] - mov edx,dword ptr [esp+0Ch] - mov eax,dword ptr [esp+8] + mov ecx,eax + mov ebx,dword ptr [esp+10h] + mov edx,dword ptr [esp+0Ch] + mov eax,dword ptr [esp+8] L3: - shr ecx,1 - rcr ebx,1 - shr edx,1 - rcr eax,1 - or ecx,ecx - jne L3 - div ebx - mov esi,eax - mul dword ptr [esp+14h] - mov ecx,eax - mov eax,dword ptr [esp+10h] - mul esi - add edx,ecx - jb L4 - cmp edx,dword ptr [esp+0Ch] - ja L4 - jb L5 - cmp eax,dword ptr [esp+8] - jbe L5 + shr ecx,1 + rcr ebx,1 + shr edx,1 + rcr eax,1 + or ecx,ecx + jne L3 + div ebx + mov esi,eax + mul dword ptr [esp+14h] + mov ecx,eax + mov eax,dword ptr [esp+10h] + mul esi + add edx,ecx + jb L4 + cmp edx,dword ptr [esp+0Ch] + ja L4 + jb L5 + cmp eax,dword ptr [esp+8] + jbe L5 L4: - dec esi - sub eax,dword ptr [esp+10h] - sbb edx,dword ptr [esp+14h] + dec esi + sub eax,dword ptr [esp+10h] + sbb edx,dword ptr [esp+14h] L5: - xor ebx,ebx + xor ebx,ebx L2: - sub eax,dword ptr [esp+8] - sbb edx,dword ptr [esp+0Ch] - neg edx - neg eax - sbb edx,0 - mov ecx,edx - mov edx,ebx - mov ebx,ecx - mov ecx,eax - mov eax,esi - pop esi - ret 10h - } + sub eax,dword ptr [esp+8] + sbb edx,dword ptr [esp+0Ch] + neg edx + neg eax + sbb edx,0 + mov ecx,edx + mov edx,ebx + mov ebx,ecx + mov ecx,eax + mov eax,esi + pop esi + ret 10h + } + /* *INDENT-ON* */ } -void __declspec(naked) _allshl() + +void +__declspec(naked) +_allshl() { - __asm { - cmp cl,40h - jae RETZERO - cmp cl,20h - jae MORE32 - shld edx,eax,cl - shl eax,cl - ret + /* *INDENT-OFF* */ + __asm { + cmp cl,40h + jae RETZERO + cmp cl,20h + jae MORE32 + shld edx,eax,cl + shl eax,cl + ret MORE32: - mov edx,eax - xor eax,eax - and cl,1Fh - shl edx,cl - ret + mov edx,eax + xor eax,eax + and cl,1Fh + shl edx,cl + ret RETZERO: - xor eax,eax - xor edx,edx - ret - } + xor eax,eax + xor edx,edx + ret + } + /* *INDENT-ON* */ } -void __declspec(naked) _aullshr() + +void +__declspec(naked) +_allshr() { - __asm { - cmp cl,40h - jae RETZERO - cmp cl,20h - jae MORE32 - shrd eax,edx,cl - shr edx,cl - ret + /* *INDENT-OFF* */ + __asm { + cmp cl,40h + jae RETZERO + cmp cl,20h + jae MORE32 + shrd eax,edx,cl + sar edx,cl + ret MORE32: - mov eax,edx - xor edx,edx - and cl,1Fh - shr eax,cl - ret + mov eax,edx + xor edx,edx + and cl,1Fh + sar eax,cl + ret RETZERO: - xor eax,eax - xor edx,edx - ret - } + xor eax,eax + xor edx,edx + ret + } + /* *INDENT-ON* */ } +void +__declspec(naked) +_aullshr() +{ + /* *INDENT-OFF* */ + __asm { + cmp cl,40h + jae RETZERO + cmp cl,20h + jae MORE32 + shrd eax,edx,cl + shr edx,cl + ret +MORE32: + mov eax,edx + xor edx,edx + and cl,1Fh + shr eax,cl + ret +RETZERO: + xor eax,eax + xor edx,edx + ret + } + /* *INDENT-ON* */ +} + +#endif /* _M_IX86 */ + #endif /* MSC_VER */ #endif /* !HAVE_LIBC */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 550a623a95..89f5f358eb 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -29,27 +28,43 @@ #define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F')) #define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f')) +#define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4) +#define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF) + +static int UTF8_TrailingBytes(unsigned char c) +{ + if (c >= 0xC0 && c <= 0xDF) + return 1; + else if (c >= 0xE0 && c <= 0xEF) + return 2; + else if (c >= 0xF0 && c <= 0xF4) + return 3; + else + return 0; +} + #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL) -static size_t SDL_ScanLong(const char *text, int radix, long *valuep) +static size_t +SDL_ScanLong(const char *text, int radix, long *valuep) { const char *textstart = text; long value = 0; SDL_bool negative = SDL_FALSE; - if ( *text == '-' ) { + if (*text == '-') { negative = SDL_TRUE; ++text; } - if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) { + if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { text += 2; } - for ( ; ; ) { + for (;;) { int v; - if ( SDL_isdigit((unsigned char) *text) ) { + if (SDL_isdigit((unsigned char) *text)) { v = *text - '0'; - } else if ( radix == 16 && SDL_isupperhex(*text) ) { + } else if (radix == 16 && SDL_isupperhex(*text)) { v = 10 + (*text - 'A'); - } else if ( radix == 16 && SDL_islowerhex(*text) ) { + } else if (radix == 16 && SDL_islowerhex(*text)) { v = 10 + (*text - 'a'); } else { break; @@ -58,8 +73,8 @@ static size_t SDL_ScanLong(const char *text, int radix, long *valuep) value += v; ++text; } - if ( valuep ) { - if ( negative && value ) { + if (valuep) { + if (negative && value) { *valuep = -value; } else { *valuep = value; @@ -70,21 +85,22 @@ static size_t SDL_ScanLong(const char *text, int radix, long *valuep) #endif #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) -static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep) +static size_t +SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep) { const char *textstart = text; unsigned long value = 0; - if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) { + if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { text += 2; } - for ( ; ; ) { + for (;;) { int v; - if ( SDL_isdigit((unsigned char) *text) ) { + if (SDL_isdigit((unsigned char) *text)) { v = *text - '0'; - } else if ( radix == 16 && SDL_isupperhex(*text) ) { + } else if (radix == 16 && SDL_isupperhex(*text)) { v = 10 + (*text - 'A'); - } else if ( radix == 16 && SDL_islowerhex(*text) ) { + } else if (radix == 16 && SDL_islowerhex(*text)) { v = 10 + (*text - 'a'); } else { break; @@ -93,7 +109,7 @@ static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *v value += v; ++text; } - if ( valuep ) { + if (valuep) { *valuep = value; } return (text - textstart); @@ -101,21 +117,22 @@ static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *v #endif #ifndef HAVE_SSCANF -static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep) +static size_t +SDL_ScanUintPtrT(const char *text, int radix, uintptr_t * valuep) { const char *textstart = text; uintptr_t value = 0; - if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) { + if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { text += 2; } - for ( ; ; ) { + for (;;) { int v; - if ( SDL_isdigit((unsigned char) *text) ) { + if (SDL_isdigit((unsigned char) *text)) { v = *text - '0'; - } else if ( radix == 16 && SDL_isupperhex(*text) ) { + } else if (radix == 16 && SDL_isupperhex(*text)) { v = 10 + (*text - 'A'); - } else if ( radix == 16 && SDL_islowerhex(*text) ) { + } else if (radix == 16 && SDL_islowerhex(*text)) { v = 10 + (*text - 'a'); } else { break; @@ -124,35 +141,35 @@ static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep) value += v; ++text; } - if ( valuep ) { + if (valuep) { *valuep = value; } return (text - textstart); } #endif -#ifdef SDL_HAS_64BIT_TYPE #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOLL) -static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 *valuep) +static size_t +SDL_ScanLongLong(const char *text, int radix, Sint64 * valuep) { const char *textstart = text; Sint64 value = 0; SDL_bool negative = SDL_FALSE; - if ( *text == '-' ) { + if (*text == '-') { negative = SDL_TRUE; ++text; } - if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) { + if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { text += 2; } - for ( ; ; ) { + for (;;) { int v; - if ( SDL_isdigit((unsigned char) *text) ) { + if (SDL_isdigit((unsigned char) *text)) { v = *text - '0'; - } else if ( radix == 16 && SDL_isupperhex(*text) ) { + } else if (radix == 16 && SDL_isupperhex(*text)) { v = 10 + (*text - 'A'); - } else if ( radix == 16 && SDL_islowerhex(*text) ) { + } else if (radix == 16 && SDL_islowerhex(*text)) { v = 10 + (*text - 'a'); } else { break; @@ -161,8 +178,8 @@ static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 *valuep) value += v; ++text; } - if ( valuep ) { - if ( negative && value ) { + if (valuep) { + if (negative && value) { *valuep = -value; } else { *valuep = value; @@ -173,21 +190,22 @@ static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 *valuep) #endif #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOULL) -static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 *valuep) +static size_t +SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 * valuep) { const char *textstart = text; Uint64 value = 0; - if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) { + if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { text += 2; } - for ( ; ; ) { + for (;;) { int v; - if ( SDL_isdigit((unsigned char) *text) ) { + if (SDL_isdigit((unsigned char) *text)) { v = *text - '0'; - } else if ( radix == 16 && SDL_isupperhex(*text) ) { + } else if (radix == 16 && SDL_isupperhex(*text)) { v = 10 + (*text - 'A'); - } else if ( radix == 16 && SDL_islowerhex(*text) ) { + } else if (radix == 16 && SDL_islowerhex(*text)) { v = 10 + (*text - 'a'); } else { break; @@ -196,40 +214,40 @@ static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 *valu value += v; ++text; } - if ( valuep ) { + if (valuep) { *valuep = value; } return (text - textstart); } #endif -#endif /* SDL_HAS_64BIT_TYPE */ #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD) -static size_t SDL_ScanFloat(const char *text, double *valuep) +static size_t +SDL_ScanFloat(const char *text, double *valuep) { const char *textstart = text; unsigned long lvalue = 0; double value = 0.0; SDL_bool negative = SDL_FALSE; - if ( *text == '-' ) { + if (*text == '-') { negative = SDL_TRUE; ++text; } text += SDL_ScanUnsignedLong(text, 10, &lvalue); value += lvalue; - if ( *text == '.' ) { + if (*text == '.') { int mult = 10; ++text; - while ( SDL_isdigit((unsigned char) *text) ) { + while (SDL_isdigit((unsigned char) *text)) { lvalue = *text - '0'; - value += (double)lvalue / mult; + value += (double) lvalue / mult; mult *= 10; ++text; } } - if ( valuep ) { - if ( negative && value ) { + if (valuep) { + if (negative && value) { *valuep = -value; } else { *valuep = value; @@ -239,211 +257,375 @@ static size_t SDL_ScanFloat(const char *text, double *valuep) } #endif -#ifndef SDL_memset -void *SDL_memset(void *dst, int c, size_t len) +void * +SDL_memset(void *dst, int c, size_t len) { +#if defined(HAVE_MEMSET) + return memset(dst, c, len); +#else size_t left = (len % 4); - if ( len >= 4 ) { - Uint32 value = 0; - Uint32 *dstp = (Uint32 *)dst; - int i; - for (i = 0; i < 4; ++i) { - value <<= 8; - value |= c; - } - len /= 4; - while ( len-- ) { - *dstp++ = value; - } + Uint32 *dstp4; + Uint8 *dstp1; + Uint32 value4 = (c | (c << 8) | (c << 16) | (c << 24)); + Uint8 value1 = (Uint8) c; + + dstp4 = (Uint32 *) dst; + len /= 4; + while (len--) { + *dstp4++ = value4; } - if ( left > 0 ) { - Uint8 value = (Uint8)c; - Uint8 *dstp = (Uint8 *)dst; - switch(left) { - case 3: - *dstp++ = value; - case 2: - *dstp++ = value; - case 1: - *dstp++ = value; - } + + dstp1 = (Uint8 *) dstp4; + switch (left) { + case 3: + *dstp1++ = value1; + case 2: + *dstp1++ = value1; + case 1: + *dstp1++ = value1; } + return dst; +#endif /* HAVE_MEMSET */ } -#endif -#ifndef SDL_memcpy -void *SDL_memcpy(void *dst, const void *src, size_t len) +void * +SDL_memcpy(void *dst, const void *src, size_t len) { - char *srcp = (char *)src; - char *dstp = (char *)dst; - while ( len-- ) { - *dstp++ = *srcp++; +#ifdef __GNUC__ + /* Presumably this is well tuned for speed. + On my machine this is twice as fast as the C code below. + */ + return __builtin_memcpy(dst, src, len); +#elif defined(HAVE_MEMCPY) + return memcpy(dst, src, len); +#elif defined(HAVE_BCOPY) + bcopy(src, dst, len); + return dst; +#else + /* GCC 4.9.0 with -O3 will generate movaps instructions with the loop + using Uint32* pointers, so we need to make sure the pointers are + aligned before we loop using them. + */ + if (((intptr_t)src & 0x3) || ((intptr_t)dst & 0x3)) { + /* Do an unaligned byte copy */ + Uint8 *srcp1 = (Uint8 *)src; + Uint8 *dstp1 = (Uint8 *)dst; + + while (len--) { + *dstp1++ = *srcp1++; + } + } else { + size_t left = (len % 4); + Uint32 *srcp4, *dstp4; + Uint8 *srcp1, *dstp1; + + srcp4 = (Uint32 *) src; + dstp4 = (Uint32 *) dst; + len /= 4; + while (len--) { + *dstp4++ = *srcp4++; + } + + srcp1 = (Uint8 *) srcp4; + dstp1 = (Uint8 *) dstp4; + switch (left) { + case 3: + *dstp1++ = *srcp1++; + case 2: + *dstp1++ = *srcp1++; + case 1: + *dstp1++ = *srcp1++; + } } return dst; +#endif /* __GNUC__ */ } -#endif -#ifndef SDL_revcpy -void *SDL_revcpy(void *dst, const void *src, size_t len) +void * +SDL_memmove(void *dst, const void *src, size_t len) { - char *srcp = (char *)src; - char *dstp = (char *)dst; - srcp += len-1; - dstp += len-1; - while ( len-- ) { - *dstp-- = *srcp--; +#if defined(HAVE_MEMMOVE) + return memmove(dst, src, len); +#else + char *srcp = (char *) src; + char *dstp = (char *) dst; + + if (src < dst) { + srcp += len - 1; + dstp += len - 1; + while (len--) { + *dstp-- = *srcp--; + } + } else { + while (len--) { + *dstp++ = *srcp++; + } } return dst; +#endif /* HAVE_MEMMOVE */ } -#endif -#ifndef SDL_memcmp -int SDL_memcmp(const void *s1, const void *s2, size_t len) +int +SDL_memcmp(const void *s1, const void *s2, size_t len) { - char *s1p = (char *)s1; - char *s2p = (char *)s2; - while ( len-- ) { - if ( *s1p != *s2p ) { +#if defined(HAVE_MEMCMP) + return memcmp(s1, s2, len); +#else + char *s1p = (char *) s1; + char *s2p = (char *) s2; + while (len--) { + if (*s1p != *s2p) { return (*s1p - *s2p); - } - ++s1p; - ++s2p; + } + ++s1p; + ++s2p; } return 0; +#endif /* HAVE_MEMCMP */ } -#endif -#ifndef HAVE_STRLEN -size_t SDL_strlen(const char *string) +size_t +SDL_strlen(const char *string) { +#if defined(HAVE_STRLEN) + return strlen(string); +#else size_t len = 0; - while ( *string++ ) { + while (*string++) { ++len; } return len; +#endif /* HAVE_STRLEN */ +} + +size_t +SDL_wcslen(const wchar_t * string) +{ +#if defined(HAVE_WCSLEN) + return wcslen(string); +#else + size_t len = 0; + while (*string++) { + ++len; + } + return len; +#endif /* HAVE_WCSLEN */ +} + +size_t +SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen) +{ +#if defined(HAVE_WCSLCPY) + return wcslcpy(dst, src, maxlen); +#else + size_t srclen = SDL_wcslen(src); + if (maxlen > 0) { + size_t len = SDL_min(srclen, maxlen - 1); + SDL_memcpy(dst, src, len * sizeof(wchar_t)); + dst[len] = '\0'; + } + return srclen; +#endif /* HAVE_WCSLCPY */ } -#endif -#ifndef HAVE_STRLCPY -size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen) +size_t +SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen) { +#if defined(HAVE_WCSLCAT) + return wcslcat(dst, src, maxlen); +#else + size_t dstlen = SDL_wcslen(dst); + size_t srclen = SDL_wcslen(src); + if (dstlen < maxlen) { + SDL_wcslcpy(dst + dstlen, src, maxlen - dstlen); + } + return dstlen + srclen; +#endif /* HAVE_WCSLCAT */ +} + +size_t +SDL_strlcpy(char *dst, const char *src, size_t maxlen) +{ +#if defined(HAVE_STRLCPY) + return strlcpy(dst, src, maxlen); +#else size_t srclen = SDL_strlen(src); - if ( maxlen > 0 ) { - size_t len = SDL_min(srclen, maxlen-1); + if (maxlen > 0) { + size_t len = SDL_min(srclen, maxlen - 1); SDL_memcpy(dst, src, len); dst[len] = '\0'; } return srclen; +#endif /* HAVE_STRLCPY */ +} + +size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes) +{ + size_t src_bytes = SDL_strlen(src); + size_t bytes = SDL_min(src_bytes, dst_bytes - 1); + size_t i = 0; + char trailing_bytes = 0; + if (bytes) + { + unsigned char c = (unsigned char)src[bytes - 1]; + if (UTF8_IsLeadByte(c)) + --bytes; + else if (UTF8_IsTrailingByte(c)) + { + for (i = bytes - 1; i != 0; --i) + { + c = (unsigned char)src[i]; + trailing_bytes = UTF8_TrailingBytes(c); + if (trailing_bytes) + { + if (bytes - i != trailing_bytes + 1) + bytes = i; + + break; + } + } + } + SDL_memcpy(dst, src, bytes); + } + dst[bytes] = '\0'; + return bytes; } -#endif -#ifndef HAVE_STRLCAT -size_t SDL_strlcat(char *dst, const char *src, size_t maxlen) +size_t +SDL_strlcat(char *dst, const char *src, size_t maxlen) { +#if defined(HAVE_STRLCAT) + return strlcat(dst, src, maxlen); +#else size_t dstlen = SDL_strlen(dst); size_t srclen = SDL_strlen(src); - if ( dstlen < maxlen ) { - SDL_strlcpy(dst+dstlen, src, maxlen-dstlen); + if (dstlen < maxlen) { + SDL_strlcpy(dst + dstlen, src, maxlen - dstlen); } - return dstlen+srclen; + return dstlen + srclen; +#endif /* HAVE_STRLCAT */ } -#endif -#ifndef HAVE_STRDUP -char *SDL_strdup(const char *string) +char * +SDL_strdup(const char *string) { - size_t len = SDL_strlen(string)+1; +#if defined(HAVE_STRDUP) + return strdup(string); +#else + size_t len = SDL_strlen(string) + 1; char *newstr = SDL_malloc(len); - if ( newstr ) { + if (newstr) { SDL_strlcpy(newstr, string, len); } return newstr; +#endif /* HAVE_STRDUP */ } -#endif -#ifndef HAVE__STRREV -char *SDL_strrev(char *string) +char * +SDL_strrev(char *string) { +#if defined(HAVE__STRREV) + return _strrev(string); +#else size_t len = SDL_strlen(string); char *a = &string[0]; - char *b = &string[len-1]; + char *b = &string[len - 1]; len /= 2; - while ( len-- ) { + while (len--) { char c = *a; *a++ = *b; *b-- = c; } return string; +#endif /* HAVE__STRREV */ } -#endif -#ifndef HAVE__STRUPR -char *SDL_strupr(char *string) +char * +SDL_strupr(char *string) { +#if defined(HAVE__STRUPR) + return _strupr(string); +#else char *bufp = string; - while ( *bufp ) { + while (*bufp) { *bufp = SDL_toupper((unsigned char) *bufp); - ++bufp; + ++bufp; } return string; +#endif /* HAVE__STRUPR */ } -#endif -#ifndef HAVE__STRLWR -char *SDL_strlwr(char *string) +char * +SDL_strlwr(char *string) { +#if defined(HAVE__STRLWR) + return _strlwr(string); +#else char *bufp = string; - while ( *bufp ) { + while (*bufp) { *bufp = SDL_tolower((unsigned char) *bufp); - ++bufp; + ++bufp; } return string; +#endif /* HAVE__STRLWR */ } -#endif -#ifndef HAVE_STRCHR -char *SDL_strchr(const char *string, int c) +char * +SDL_strchr(const char *string, int c) { - while ( *string ) { - if ( *string == c ) { - return (char *)string; +#ifdef HAVE_STRCHR + return SDL_const_cast(char*,strchr(string, c)); +#elif defined(HAVE_INDEX) + return SDL_const_cast(char*,index(string, c)); +#else + while (*string) { + if (*string == c) { + return (char *) string; } - ++string; + ++string; } return NULL; +#endif /* HAVE_STRCHR */ } -#endif -#ifndef HAVE_STRRCHR -char *SDL_strrchr(const char *string, int c) +char * +SDL_strrchr(const char *string, int c) { +#ifdef HAVE_STRRCHR + return SDL_const_cast(char*,strrchr(string, c)); +#elif defined(HAVE_RINDEX) + return SDL_const_cast(char*,rindex(string, c)); +#else const char *bufp = string + SDL_strlen(string) - 1; - while ( bufp >= string ) { - if ( *bufp == c ) { - return (char *)bufp; + while (bufp >= string) { + if (*bufp == c) { + return (char *) bufp; } - --bufp; + --bufp; } return NULL; +#endif /* HAVE_STRRCHR */ } -#endif -#ifndef HAVE_STRSTR -char *SDL_strstr(const char *haystack, const char *needle) +char * +SDL_strstr(const char *haystack, const char *needle) { +#if defined(HAVE_STRSTR) + return SDL_const_cast(char*,strstr(haystack, needle)); +#else size_t length = SDL_strlen(needle); - while ( *haystack ) { - if ( SDL_strncmp(haystack, needle, length) == 0 ) { - return (char *)haystack; + while (*haystack) { + if (SDL_strncmp(haystack, needle, length) == 0) { + return (char *) haystack; } - ++haystack; + ++haystack; } return NULL; +#endif /* HAVE_STRSTR */ } -#endif -#if !defined(HAVE__LTOA) || !defined(HAVE__I64TOA) || \ +#if !defined(HAVE__LTOA) || !defined(HAVE__I64TOA) || \ !defined(HAVE__ULTOA) || !defined(HAVE__UI64TOA) static const char ntoa_table[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', @@ -453,17 +635,40 @@ static const char ntoa_table[] = { }; #endif /* ntoa() conversion table */ -#ifndef HAVE__LTOA -char *SDL_ltoa(long value, char *string, int radix) +char * +SDL_itoa(int value, char *string, int radix) { +#ifdef HAVE_ITOA + return itoa(value, string, radix); +#else + return SDL_ltoa((long)value, string, radix); +#endif /* HAVE_ITOA */ +} + +char * +SDL_uitoa(unsigned int value, char *string, int radix) +{ +#ifdef HAVE__UITOA + return _uitoa(value, string, radix); +#else + return SDL_ultoa((unsigned long)value, string, radix); +#endif /* HAVE__UITOA */ +} + +char * +SDL_ltoa(long value, char *string, int radix) +{ +#if defined(HAVE__LTOA) + return _ltoa(value, string, radix); +#else char *bufp = string; - if ( value < 0 ) { + if (value < 0) { *bufp++ = '-'; value = -value; } - if ( value ) { - while ( value > 0 ) { + if (value) { + while (value > 0) { *bufp++ = ntoa_table[value % radix]; value /= radix; } @@ -473,23 +678,26 @@ char *SDL_ltoa(long value, char *string, int radix) *bufp = '\0'; /* The numbers went into the string backwards. :) */ - if ( *string == '-' ) { - SDL_strrev(string+1); + if (*string == '-') { + SDL_strrev(string + 1); } else { SDL_strrev(string); } return string; +#endif /* HAVE__LTOA */ } -#endif -#ifndef HAVE__ULTOA -char *SDL_ultoa(unsigned long value, char *string, int radix) +char * +SDL_ultoa(unsigned long value, char *string, int radix) { +#if defined(HAVE__ULTOA) + return _ultoa(value, string, radix); +#else char *bufp = string; - if ( value ) { - while ( value > 0 ) { + if (value) { + while (value > 0) { *bufp++ = ntoa_table[value % radix]; value /= radix; } @@ -502,66 +710,23 @@ char *SDL_ultoa(unsigned long value, char *string, int radix) SDL_strrev(string); return string; +#endif /* HAVE__ULTOA */ } -#endif - -#ifndef HAVE_STRTOL -long SDL_strtol(const char *string, char **endp, int base) -{ - size_t len; - long value; - - if ( !base ) { - if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) { - base = 16; - } else { - base = 10; - } - } - - len = SDL_ScanLong(string, base, &value); - if ( endp ) { - *endp = (char *)string + len; - } - return value; -} -#endif - -#ifndef HAVE_STRTOUL -unsigned long SDL_strtoul(const char *string, char **endp, int base) -{ - size_t len; - unsigned long value; - - if ( !base ) { - if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) { - base = 16; - } else { - base = 10; - } - } - - len = SDL_ScanUnsignedLong(string, base, &value); - if ( endp ) { - *endp = (char *)string + len; - } - return value; -} -#endif - -#ifdef SDL_HAS_64BIT_TYPE -#ifndef HAVE__I64TOA -char *SDL_lltoa(Sint64 value, char *string, int radix) +char * +SDL_lltoa(Sint64 value, char *string, int radix) { +#if defined(HAVE__I64TOA) + return _i64toa(value, string, radix); +#else char *bufp = string; - if ( value < 0 ) { + if (value < 0) { *bufp++ = '-'; value = -value; } - if ( value ) { - while ( value > 0 ) { + if (value) { + while (value > 0) { *bufp++ = ntoa_table[value % radix]; value /= radix; } @@ -571,23 +736,26 @@ char *SDL_lltoa(Sint64 value, char *string, int radix) *bufp = '\0'; /* The numbers went into the string backwards. :) */ - if ( *string == '-' ) { - SDL_strrev(string+1); + if (*string == '-') { + SDL_strrev(string + 1); } else { SDL_strrev(string); } return string; +#endif /* HAVE__I64TOA */ } -#endif -#ifndef HAVE__UI64TOA -char *SDL_ulltoa(Uint64 value, char *string, int radix) +char * +SDL_ulltoa(Uint64 value, char *string, int radix) { +#if defined(HAVE__UI64TOA) + return _ui64toa(value, string, radix); +#else char *bufp = string; - if ( value ) { - while ( value > 0 ) { + if (value) { + while (value > 0) { *bufp++ = ntoa_table[value % radix]; value /= radix; } @@ -600,17 +768,88 @@ char *SDL_ulltoa(Uint64 value, char *string, int radix) SDL_strrev(string); return string; +#endif /* HAVE__UI64TOA */ } -#endif -#ifndef HAVE_STRTOLL -Sint64 SDL_strtoll(const char *string, char **endp, int base) +int SDL_atoi(const char *string) +{ +#ifdef HAVE_ATOI + return atoi(string); +#else + return SDL_strtol(string, NULL, 0); +#endif /* HAVE_ATOI */ +} + +double SDL_atof(const char *string) +{ +#ifdef HAVE_ATOF + return (double) atof(string); +#else + return SDL_strtod(string, NULL); +#endif /* HAVE_ATOF */ +} + +long +SDL_strtol(const char *string, char **endp, int base) +{ +#if defined(HAVE_STRTOL) + return strtol(string, endp, base); +#else + size_t len; + long value; + + if (!base) { + if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { + base = 16; + } else { + base = 10; + } + } + + len = SDL_ScanLong(string, base, &value); + if (endp) { + *endp = (char *) string + len; + } + return value; +#endif /* HAVE_STRTOL */ +} + +unsigned long +SDL_strtoul(const char *string, char **endp, int base) +{ +#if defined(HAVE_STRTOUL) + return strtoul(string, endp, base); +#else + size_t len; + unsigned long value; + + if (!base) { + if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { + base = 16; + } else { + base = 10; + } + } + + len = SDL_ScanUnsignedLong(string, base, &value); + if (endp) { + *endp = (char *) string + len; + } + return value; +#endif /* HAVE_STRTOUL */ +} + +Sint64 +SDL_strtoll(const char *string, char **endp, int base) { +#if defined(HAVE_STRTOLL) + return strtoll(string, endp, base); +#else size_t len; Sint64 value; - if ( !base ) { - if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) { + if (!base) { + if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { base = 16; } else { base = 10; @@ -618,21 +857,24 @@ Sint64 SDL_strtoll(const char *string, char **endp, int base) } len = SDL_ScanLongLong(string, base, &value); - if ( endp ) { - *endp = (char *)string + len; + if (endp) { + *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOLL */ } -#endif -#ifndef HAVE_STRTOULL -Uint64 SDL_strtoull(const char *string, char **endp, int base) +Uint64 +SDL_strtoull(const char *string, char **endp, int base) { +#if defined(HAVE_STRTOULL) + return strtoull(string, endp, base); +#else size_t len; Uint64 value; - if ( !base ) { - if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) { + if (!base) { + if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { base = 16; } else { base = 10; @@ -640,114 +882,152 @@ Uint64 SDL_strtoull(const char *string, char **endp, int base) } len = SDL_ScanUnsignedLongLong(string, base, &value); - if ( endp ) { - *endp = (char *)string + len; + if (endp) { + *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOULL */ } -#endif -#endif /* SDL_HAS_64BIT_TYPE */ - -#ifndef HAVE_STRTOD -double SDL_strtod(const char *string, char **endp) +double +SDL_strtod(const char *string, char **endp) { +#if defined(HAVE_STRTOD) + return strtod(string, endp); +#else size_t len; double value; len = SDL_ScanFloat(string, &value); - if ( endp ) { - *endp = (char *)string + len; + if (endp) { + *endp = (char *) string + len; } return value; +#endif /* HAVE_STRTOD */ } -#endif -#ifndef HAVE_STRCMP -int SDL_strcmp(const char *str1, const char *str2) +int +SDL_strcmp(const char *str1, const char *str2) { +#if defined(HAVE_STRCMP) + return strcmp(str1, str2); +#else while (*str1 && *str2) { - if ( *str1 != *str2 ) + if (*str1 != *str2) break; ++str1; ++str2; } - return (int)((unsigned char)*str1 - (unsigned char)*str2); + return (int) ((unsigned char) *str1 - (unsigned char) *str2); +#endif /* HAVE_STRCMP */ } -#endif -#ifndef HAVE_STRNCMP -int SDL_strncmp(const char *str1, const char *str2, size_t maxlen) +int +SDL_strncmp(const char *str1, const char *str2, size_t maxlen) { - while ( *str1 && *str2 && maxlen ) { - if ( *str1 != *str2 ) +#if defined(HAVE_STRNCMP) + return strncmp(str1, str2, maxlen); +#else + while (*str1 && *str2 && maxlen) { + if (*str1 != *str2) break; ++str1; ++str2; --maxlen; } - if ( ! maxlen ) { + if (!maxlen) { return 0; } - return (int)((unsigned char)*str1 - (unsigned char)*str2); + return (int) ((unsigned char) *str1 - (unsigned char) *str2); +#endif /* HAVE_STRNCMP */ } -#endif -#if !defined(HAVE_STRCASECMP) && !defined(HAVE__STRICMP) -int SDL_strcasecmp(const char *str1, const char *str2) +int +SDL_strcasecmp(const char *str1, const char *str2) { +#ifdef HAVE_STRCASECMP + return strcasecmp(str1, str2); +#elif defined(HAVE__STRICMP) + return _stricmp(str1, str2); +#else char a = 0; char b = 0; - while ( *str1 && *str2 ) { - a = SDL_tolower((unsigned char) *str1); - b = SDL_tolower((unsigned char) *str2); - if ( a != b ) + while (*str1 && *str2) { + a = SDL_toupper((unsigned char) *str1); + b = SDL_toupper((unsigned char) *str2); + if (a != b) break; ++str1; ++str2; } - return (int)((unsigned char)a - (unsigned char)b); + a = SDL_toupper(*str1); + b = SDL_toupper(*str2); + return (int) ((unsigned char) a - (unsigned char) b); +#endif /* HAVE_STRCASECMP */ } -#endif -#if !defined(HAVE_STRNCASECMP) && !defined(HAVE__STRNICMP) -int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) +int +SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) { +#ifdef HAVE_STRNCASECMP + return strncasecmp(str1, str2, maxlen); +#elif defined(HAVE__STRNICMP) + return _strnicmp(str1, str2, maxlen); +#else char a = 0; char b = 0; - while ( *str1 && *str2 && maxlen ) { + while (*str1 && *str2 && maxlen) { a = SDL_tolower((unsigned char) *str1); b = SDL_tolower((unsigned char) *str2); - if ( a != b ) + if (a != b) break; ++str1; ++str2; --maxlen; } - return (int)((unsigned char)a - (unsigned char)b); + if (maxlen == 0) { + return 0; + } else { + a = SDL_tolower((unsigned char) *str1); + b = SDL_tolower((unsigned char) *str2); + return (int) ((unsigned char) a - (unsigned char) b); + } +#endif /* HAVE_STRNCASECMP */ } -#endif -#ifndef HAVE_SSCANF -int SDL_sscanf(const char *text, const char *fmt, ...) +#ifdef HAVE_SSCANF +int +SDL_sscanf(const char *text, const char *fmt, ...) +{ + int rc; + va_list ap; + va_start(ap, fmt); + rc = vsscanf(text, fmt, ap); + va_end(ap); + return rc; +} +#else +int +SDL_sscanf(const char *text, const char *fmt, ...) { va_list ap; int retval = 0; va_start(ap, fmt); - while ( *fmt ) { - if ( *fmt == ' ' ) { - while ( SDL_isspace((unsigned char) *text) ) { + while (*fmt) { + if (*fmt == ' ') { + while (SDL_isspace((unsigned char) *text)) { ++text; } ++fmt; continue; } - if ( *fmt == '%' ) { + if (*fmt == '%') { SDL_bool done = SDL_FALSE; long count = 0; int radix = 10; - enum { + enum + { DO_SHORT, DO_INT, DO_LONG, @@ -756,31 +1036,31 @@ int SDL_sscanf(const char *text, const char *fmt, ...) SDL_bool suppress = SDL_FALSE; ++fmt; - if ( *fmt == '%' ) { - if ( *text == '%' ) { + if (*fmt == '%') { + if (*text == '%') { ++text; ++fmt; continue; } break; } - if ( *fmt == '*' ) { + if (*fmt == '*') { suppress = SDL_TRUE; ++fmt; } fmt += SDL_ScanLong(fmt, 10, &count); - if ( *fmt == 'c' ) { - if ( ! count ) { + if (*fmt == 'c') { + if (!count) { count = 1; } - if ( suppress ) { - while ( count-- ) { + if (suppress) { + while (count--) { ++text; } } else { - char *valuep = va_arg(ap, char*); - while ( count-- ) { + char *valuep = va_arg(ap, char *); + while (count--) { *valuep++ = *text++; } ++retval; @@ -788,200 +1068,198 @@ int SDL_sscanf(const char *text, const char *fmt, ...) continue; } - while ( SDL_isspace((unsigned char) *text) ) { + while (SDL_isspace((unsigned char) *text)) { ++text; } /* FIXME: implement more of the format specifiers */ while (!done) { - switch(*fmt) { - case '*': - suppress = SDL_TRUE; - break; - case 'h': - if ( inttype > DO_SHORT ) { - ++inttype; - } - break; - case 'l': - if ( inttype < DO_LONGLONG ) { - ++inttype; - } - break; - case 'I': - if ( SDL_strncmp(fmt, "I64", 3) == 0 ) { - fmt += 2; - inttype = DO_LONGLONG; + switch (*fmt) { + case '*': + suppress = SDL_TRUE; + break; + case 'h': + if (inttype > DO_SHORT) { + ++inttype; + } + break; + case 'l': + if (inttype < DO_LONGLONG) { + ++inttype; + } + break; + case 'I': + if (SDL_strncmp(fmt, "I64", 3) == 0) { + fmt += 2; + inttype = DO_LONGLONG; + } + break; + case 'i': + { + int index = 0; + if (text[index] == '-') { + ++index; } - break; - case 'i': - { - int index = 0; - if ( text[index] == '-' ) { - ++index; - } - if ( text[index] == '0' ) { - if ( SDL_tolower((unsigned char) text[index+1]) == 'x' ) { - radix = 16; - } else { - radix = 8; - } + if (text[index] == '0') { + if (SDL_tolower((unsigned char) text[index + 1]) == 'x') { + radix = 16; + } else { + radix = 8; } } - /* Fall through to %d handling */ - case 'd': -#ifdef SDL_HAS_64BIT_TYPE - if ( inttype == DO_LONGLONG ) { - Sint64 value; - text += SDL_ScanLongLong(text, radix, &value); - if ( ! suppress ) { - Sint64 *valuep = va_arg(ap, Sint64*); - *valuep = value; - ++retval; - } + } + /* Fall through to %d handling */ + case 'd': + if (inttype == DO_LONGLONG) { + Sint64 value; + text += SDL_ScanLongLong(text, radix, &value); + if (!suppress) { + Sint64 *valuep = va_arg(ap, Sint64 *); + *valuep = value; + ++retval; } - else -#endif /* SDL_HAS_64BIT_TYPE */ - { - long value; - text += SDL_ScanLong(text, radix, &value); - if ( ! suppress ) { - switch (inttype) { - case DO_SHORT: - { short* valuep = va_arg(ap, short*); - *valuep = (short)value; - } - break; - case DO_INT: - { int* valuep = va_arg(ap, int*); - *valuep = (int)value; - } - break; - case DO_LONG: - { long* valuep = va_arg(ap, long*); - *valuep = value; - } - break; - case DO_LONGLONG: - /* Handled above */ - break; + } else { + long value; + text += SDL_ScanLong(text, radix, &value); + if (!suppress) { + switch (inttype) { + case DO_SHORT: + { + short *valuep = va_arg(ap, short *); + *valuep = (short) value; + } + break; + case DO_INT: + { + int *valuep = va_arg(ap, int *); + *valuep = (int) value; + } + break; + case DO_LONG: + { + long *valuep = va_arg(ap, long *); + *valuep = value; } - ++retval; + break; + case DO_LONGLONG: + /* Handled above */ + break; } + ++retval; } - done = SDL_TRUE; - break; - case 'o': - if ( radix == 10 ) { - radix = 8; - } - /* Fall through to unsigned handling */ - case 'x': - case 'X': - if ( radix == 10 ) { - radix = 16; - } - /* Fall through to unsigned handling */ - case 'u': -#ifdef SDL_HAS_64BIT_TYPE - if ( inttype == DO_LONGLONG ) { - Uint64 value; - text += SDL_ScanUnsignedLongLong(text, radix, &value); - if ( ! suppress ) { - Uint64 *valuep = va_arg(ap, Uint64*); - *valuep = value; - ++retval; - } + } + done = SDL_TRUE; + break; + case 'o': + if (radix == 10) { + radix = 8; + } + /* Fall through to unsigned handling */ + case 'x': + case 'X': + if (radix == 10) { + radix = 16; + } + /* Fall through to unsigned handling */ + case 'u': + if (inttype == DO_LONGLONG) { + Uint64 value; + text += SDL_ScanUnsignedLongLong(text, radix, &value); + if (!suppress) { + Uint64 *valuep = va_arg(ap, Uint64 *); + *valuep = value; + ++retval; } - else -#endif /* SDL_HAS_64BIT_TYPE */ - { - unsigned long value; - text += SDL_ScanUnsignedLong(text, radix, &value); - if ( ! suppress ) { - switch (inttype) { - case DO_SHORT: - { short* valuep = va_arg(ap, short*); - *valuep = (short)value; - } - break; - case DO_INT: - { int* valuep = va_arg(ap, int*); - *valuep = (int)value; - } - break; - case DO_LONG: - { long* valuep = va_arg(ap, long*); - *valuep = value; - } - break; - case DO_LONGLONG: - /* Handled above */ - break; + } else { + unsigned long value; + text += SDL_ScanUnsignedLong(text, radix, &value); + if (!suppress) { + switch (inttype) { + case DO_SHORT: + { + short *valuep = va_arg(ap, short *); + *valuep = (short) value; + } + break; + case DO_INT: + { + int *valuep = va_arg(ap, int *); + *valuep = (int) value; + } + break; + case DO_LONG: + { + long *valuep = va_arg(ap, long *); + *valuep = value; } - ++retval; + break; + case DO_LONGLONG: + /* Handled above */ + break; } + ++retval; } - done = SDL_TRUE; - break; - case 'p': - { - uintptr_t value; - text += SDL_ScanUintPtrT(text, 16, &value); - if ( ! suppress ) { - void** valuep = va_arg(ap, void**); - *valuep = (void*)value; - ++retval; - } + } + done = SDL_TRUE; + break; + case 'p': + { + uintptr_t value; + text += SDL_ScanUintPtrT(text, 16, &value); + if (!suppress) { + void **valuep = va_arg(ap, void **); + *valuep = (void *) value; + ++retval; } - done = SDL_TRUE; - break; - case 'f': - { - double value; - text += SDL_ScanFloat(text, &value); - if ( ! suppress ) { - float* valuep = va_arg(ap, float*); - *valuep = (float)value; - ++retval; - } + } + done = SDL_TRUE; + break; + case 'f': + { + double value; + text += SDL_ScanFloat(text, &value); + if (!suppress) { + float *valuep = va_arg(ap, float *); + *valuep = (float) value; + ++retval; } - done = SDL_TRUE; - break; - case 's': - if ( suppress ) { - while ( !SDL_isspace((unsigned char) *text) ) { - ++text; - if ( count ) { - if ( --count == 0 ) { - break; - } + } + done = SDL_TRUE; + break; + case 's': + if (suppress) { + while (!SDL_isspace((unsigned char) *text)) { + ++text; + if (count) { + if (--count == 0) { + break; } } - } else { - char *valuep = va_arg(ap, char*); - while ( !SDL_isspace((unsigned char) *text) ) { - *valuep++ = *text++; - if ( count ) { - if ( --count == 0 ) { - break; - } + } + } else { + char *valuep = va_arg(ap, char *); + while (!SDL_isspace((unsigned char) *text)) { + *valuep++ = *text++; + if (count) { + if (--count == 0) { + break; } } - *valuep = '\0'; - ++retval; } - done = SDL_TRUE; - break; - default: - done = SDL_TRUE; - break; + *valuep = '\0'; + ++retval; + } + done = SDL_TRUE; + break; + default: + done = SDL_TRUE; + break; } ++fmt; } continue; } - if ( *text == *fmt ) { + if (*text == *fmt) { ++text; ++fmt; continue; @@ -993,10 +1271,10 @@ int SDL_sscanf(const char *text, const char *fmt, ...) return retval; } -#endif +#endif /* HAVE_SSCANF */ -#ifndef HAVE_SNPRINTF -int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...) +int +SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...) { va_list ap; int retval; @@ -1007,242 +1285,362 @@ int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...) return retval; } -#endif -#ifndef HAVE_VSNPRINTF -static size_t SDL_PrintLong(char *text, long value, int radix, size_t maxlen) +#ifdef HAVE_VSNPRINTF +int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) { - char num[130]; - size_t size; - - SDL_ltoa(value, num, radix); - size = SDL_strlen(num); - if ( size >= maxlen ) { - size = maxlen-1; + return vsnprintf(text, maxlen, fmt, ap); +} +#else + /* FIXME: implement more of the format specifiers */ +typedef struct +{ + SDL_bool left_justify; + SDL_bool force_sign; + SDL_bool force_type; + SDL_bool pad_zeroes; + SDL_bool do_lowercase; + int width; + int radix; + int precision; +} SDL_FormatInfo; + +static size_t +SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string) +{ + size_t length = 0; + + if (info && info->width && (size_t)info->width > SDL_strlen(string)) { + char fill = info->pad_zeroes ? '0' : ' '; + size_t width = info->width - SDL_strlen(string); + while (width-- > 0 && maxlen > 0) { + *text++ = fill; + ++length; + --maxlen; + } } - SDL_strlcpy(text, num, size+1); - return size; + length += SDL_strlcpy(text, string, maxlen); + + if (info && info->do_lowercase) { + SDL_strlwr(text); + } + return length; } -static size_t SDL_PrintUnsignedLong(char *text, unsigned long value, int radix, size_t maxlen) + +static size_t +SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value) { char num[130]; - size_t size; - - SDL_ultoa(value, num, radix); - size = SDL_strlen(num); - if ( size >= maxlen ) { - size = maxlen-1; - } - SDL_strlcpy(text, num, size+1); - return size; + SDL_ltoa(value, num, info ? info->radix : 10); + return SDL_PrintString(text, maxlen, info, num); } -#ifdef SDL_HAS_64BIT_TYPE -static size_t SDL_PrintLongLong(char *text, Sint64 value, int radix, size_t maxlen) + +static size_t +SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value) { char num[130]; - size_t size; - - SDL_lltoa(value, num, radix); - size = SDL_strlen(num); - if ( size >= maxlen ) { - size = maxlen-1; - } - SDL_strlcpy(text, num, size+1); - return size; + SDL_ultoa(value, num, info ? info->radix : 10); + return SDL_PrintString(text, maxlen, info, num); } -static size_t SDL_PrintUnsignedLongLong(char *text, Uint64 value, int radix, size_t maxlen) + +static size_t +SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value) { char num[130]; - size_t size; - SDL_ulltoa(value, num, radix); - size = SDL_strlen(num); - if ( size >= maxlen ) { - size = maxlen-1; - } - SDL_strlcpy(text, num, size+1); + SDL_lltoa(value, num, info ? info->radix : 10); + return SDL_PrintString(text, maxlen, info, num); +} - return size; +static size_t +SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value) +{ + char num[130]; + + SDL_ulltoa(value, num, info ? info->radix : 10); + return SDL_PrintString(text, maxlen, info, num); } -#endif /* SDL_HAS_64BIT_TYPE */ -static size_t SDL_PrintFloat(char *text, double arg, size_t maxlen) + +static size_t +SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg) { + int width; + size_t len; + size_t left = maxlen; char *textstart = text; - if ( arg ) { + + if (arg) { /* This isn't especially accurate, but hey, it's easy. :) */ - const double precision = 0.00000001; - size_t len; unsigned long value; - if ( arg < 0 ) { - *text++ = '-'; - --maxlen; + if (arg < 0) { + if (left > 1) { + *text = '-'; + --left; + } + ++text; arg = -arg; + } else if (info->force_sign) { + if (left > 1) { + *text = '+'; + --left; + } + ++text; } - value = (unsigned long)arg; - len = SDL_PrintUnsignedLong(text, value, 10, maxlen); + value = (unsigned long) arg; + len = SDL_PrintUnsignedLong(text, left, NULL, value); text += len; - maxlen -= len; + if (len >= left) { + left = SDL_min(left, 1); + } else { + left -= len; + } arg -= value; - if ( arg > precision && maxlen ) { + if (info->precision < 0) { + info->precision = 6; + } + if (info->force_type || info->precision > 0) { int mult = 10; - *text++ = '.'; - while ( (arg > precision) && maxlen ) { - value = (unsigned long)(arg * mult); - len = SDL_PrintUnsignedLong(text, value, 10, maxlen); + if (left > 1) { + *text = '.'; + --left; + } + ++text; + while (info->precision-- > 0) { + value = (unsigned long) (arg * mult); + len = SDL_PrintUnsignedLong(text, left, NULL, value); text += len; - maxlen -= len; - arg -= (double)value / mult; + if (len >= left) { + left = SDL_min(left, 1); + } else { + left -= len; + } + arg -= (double) value / mult; mult *= 10; } } } else { - *text++ = '0'; + if (left > 1) { + *text = '0'; + --left; + } + ++text; + if (info->force_type) { + if (left > 1) { + *text = '.'; + --left; + } + ++text; + } } - return (text - textstart); -} -static size_t SDL_PrintString(char *text, const char *string, size_t maxlen) -{ - char *textstart = text; - while ( *string && maxlen-- ) { - *text++ = *string++; + + width = info->width - (int)(text - textstart); + if (width > 0) { + char fill = info->pad_zeroes ? '0' : ' '; + char *end = text+left-1; + len = (text - textstart); + for (len = (text - textstart); len--; ) { + if ((textstart+len+width) < end) { + *(textstart+len+width) = *(textstart+len); + } + } + len = (size_t)width; + text += len; + if (len >= left) { + left = SDL_min(left, 1); + } else { + left -= len; + } + while (len--) { + if (textstart+len < end) { + textstart[len] = fill; + } + } } + return (text - textstart); } -int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) + +int +SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap) { + size_t left = maxlen; char *textstart = text; - if ( maxlen <= 0 ) { - return 0; - } - --maxlen; /* For the trailing '\0' */ - while ( *fmt && maxlen ) { - if ( *fmt == '%' ) { + + while (*fmt) { + if (*fmt == '%') { SDL_bool done = SDL_FALSE; size_t len = 0; - SDL_bool do_lowercase = SDL_FALSE; - int radix = 10; - enum { + SDL_bool check_flag; + SDL_FormatInfo info; + enum + { DO_INT, DO_LONG, DO_LONGLONG } inttype = DO_INT; - ++fmt; - /* FIXME: implement more of the format specifiers */ - while ( *fmt == '.' || (*fmt >= '0' && *fmt <= '9') ) { + SDL_zero(info); + info.radix = 10; + info.precision = -1; + + check_flag = SDL_TRUE; + while (check_flag) { + ++fmt; + switch (*fmt) { + case '-': + info.left_justify = SDL_TRUE; + break; + case '+': + info.force_sign = SDL_TRUE; + break; + case '#': + info.force_type = SDL_TRUE; + break; + case '0': + info.pad_zeroes = SDL_TRUE; + break; + default: + check_flag = SDL_FALSE; + break; + } + } + + if (*fmt >= '0' && *fmt <= '9') { + info.width = SDL_strtol(fmt, (char **)&fmt, 0); + } + + if (*fmt == '.') { ++fmt; + if (*fmt >= '0' && *fmt <= '9') { + info.precision = SDL_strtol(fmt, (char **)&fmt, 0); + } else { + info.precision = 0; + } } + while (!done) { - switch(*fmt) { - case '%': + switch (*fmt) { + case '%': + if (left > 1) { *text = '%'; - len = 1; - done = SDL_TRUE; - break; - case 'c': - /* char is promoted to int when passed through (...) */ - *text = (char)va_arg(ap, int); - len = 1; - done = SDL_TRUE; - break; - case 'h': - /* short is promoted to int when passed through (...) */ - break; - case 'l': - if ( inttype < DO_LONGLONG ) { - ++inttype; - } + } + len = 1; + done = SDL_TRUE; + break; + case 'c': + /* char is promoted to int when passed through (...) */ + if (left > 1) { + *text = (char) va_arg(ap, int); + } + len = 1; + done = SDL_TRUE; + break; + case 'h': + /* short is promoted to int when passed through (...) */ + break; + case 'l': + if (inttype < DO_LONGLONG) { + ++inttype; + } + break; + case 'I': + if (SDL_strncmp(fmt, "I64", 3) == 0) { + fmt += 2; + inttype = DO_LONGLONG; + } + break; + case 'i': + case 'd': + switch (inttype) { + case DO_INT: + len = SDL_PrintLong(text, left, &info, + (long) va_arg(ap, int)); break; - case 'I': - if ( SDL_strncmp(fmt, "I64", 3) == 0 ) { - fmt += 2; - inttype = DO_LONGLONG; - } + case DO_LONG: + len = SDL_PrintLong(text, left, &info, + va_arg(ap, long)); break; - case 'i': - case 'd': - switch (inttype) { - case DO_INT: - len = SDL_PrintLong(text, (long)va_arg(ap, int), radix, maxlen); - break; - case DO_LONG: - len = SDL_PrintLong(text, va_arg(ap, long), radix, maxlen); - break; - case DO_LONGLONG: -#ifdef SDL_HAS_64BIT_TYPE - len = SDL_PrintLongLong(text, va_arg(ap, Sint64), radix, maxlen); -#else - len = SDL_PrintLong(text, va_arg(ap, long), radix, maxlen); -#endif - break; - } - done = SDL_TRUE; + case DO_LONGLONG: + len = SDL_PrintLongLong(text, left, &info, + va_arg(ap, Sint64)); break; - case 'p': - case 'x': - do_lowercase = SDL_TRUE; - /* Fall through to 'X' handling */ - case 'X': - if ( radix == 10 ) { - radix = 16; - } - if ( *fmt == 'p' ) { - inttype = DO_LONG; - } - /* Fall through to unsigned handling */ - case 'o': - if ( radix == 10 ) { - radix = 8; - } - /* Fall through to unsigned handling */ - case 'u': - switch (inttype) { - case DO_INT: - len = SDL_PrintUnsignedLong(text, (unsigned long)va_arg(ap, unsigned int), radix, maxlen); - break; - case DO_LONG: - len = SDL_PrintUnsignedLong(text, va_arg(ap, unsigned long), radix, maxlen); - break; - case DO_LONGLONG: -#ifdef SDL_HAS_64BIT_TYPE - len = SDL_PrintUnsignedLongLong(text, va_arg(ap, Uint64), radix, maxlen); -#else - len = SDL_PrintUnsignedLong(text, va_arg(ap, unsigned long), radix, maxlen); -#endif - break; - } - if ( do_lowercase ) { - SDL_strlwr(text); - } - done = SDL_TRUE; - break; - case 'f': - len = SDL_PrintFloat(text, va_arg(ap, double), maxlen); - done = SDL_TRUE; + } + done = SDL_TRUE; + break; + case 'p': + case 'x': + info.do_lowercase = SDL_TRUE; + /* Fall through to 'X' handling */ + case 'X': + if (info.radix == 10) { + info.radix = 16; + } + if (*fmt == 'p') { + inttype = DO_LONG; + } + /* Fall through to unsigned handling */ + case 'o': + if (info.radix == 10) { + info.radix = 8; + } + /* Fall through to unsigned handling */ + case 'u': + info.pad_zeroes = SDL_TRUE; + switch (inttype) { + case DO_INT: + len = SDL_PrintUnsignedLong(text, left, &info, + (unsigned long) + va_arg(ap, unsigned int)); break; - case 's': - len = SDL_PrintString(text, va_arg(ap, char*), maxlen); - done = SDL_TRUE; + case DO_LONG: + len = SDL_PrintUnsignedLong(text, left, &info, + va_arg(ap, unsigned long)); break; - default: - done = SDL_TRUE; + case DO_LONGLONG: + len = SDL_PrintUnsignedLongLong(text, left, &info, + va_arg(ap, Uint64)); break; + } + done = SDL_TRUE; + break; + case 'f': + len = SDL_PrintFloat(text, left, &info, va_arg(ap, double)); + done = SDL_TRUE; + break; + case 's': + len = SDL_PrintString(text, left, &info, va_arg(ap, char *)); + done = SDL_TRUE; + break; + default: + done = SDL_TRUE; + break; } ++fmt; } text += len; - maxlen -= len; + if (len >= left) { + left = SDL_min(left, 1); + } else { + left -= len; + } } else { - *text++ = *fmt++; - --maxlen; + if (left > 1) { + *text = *fmt; + --left; + } + ++fmt; + ++text; } } - *text = '\0'; - - return (text - textstart); + if (left > 0) { + *text = '\0'; + } + return (int)(text - textstart); } -#endif +#endif /* HAVE_VSNPRINTF */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_assert.c b/src/test/SDL_test_assert.c new file mode 100644 index 0000000000..41a3df68fd --- /dev/null +++ b/src/test/SDL_test_assert.c @@ -0,0 +1,150 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + + Used by the test framework and test cases. + +*/ + +#include "SDL_config.h" + +#include "SDL_test.h" + +/* Assert check message format */ +const char *SDLTest_AssertCheckFormat = "Assert '%s': %s"; + +/* Assert summary message format */ +const char *SDLTest_AssertSummaryFormat = "Assert Summary: Total=%d Passed=%d Failed=%d"; + +/*! \brief counts the failed asserts */ +static Uint32 SDLTest_AssertsFailed = 0; + +/*! \brief counts the passed asserts */ +static Uint32 SDLTest_AssertsPassed = 0; + +/* + * Assert that logs and break execution flow on failures (i.e. for harness errors). + */ +void SDLTest_Assert(int assertCondition, const char *assertDescription, ...) +{ + va_list list; + char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; + + /* Print assert description into a buffer */ + SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); + va_start(list, assertDescription); + SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); + va_end(list); + + /* Log, then assert and break on failure */ + SDL_assert((SDLTest_AssertCheck(assertCondition, logMessage))); +} + +/* + * Assert that logs but does not break execution flow on failures (i.e. for test cases). + */ +int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...) +{ + va_list list; + char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; + + /* Print assert description into a buffer */ + SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); + va_start(list, assertDescription); + SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); + va_end(list); + + /* Log pass or fail message */ + if (assertCondition == ASSERT_FAIL) + { + SDLTest_AssertsFailed++; + SDLTest_LogError(SDLTest_AssertCheckFormat, logMessage, "Failed"); + } + else + { + SDLTest_AssertsPassed++; + SDLTest_Log(SDLTest_AssertCheckFormat, logMessage, "Passed"); + } + + return assertCondition; +} + +/* + * Explicitly passing Assert that logs (i.e. for test cases). + */ +void SDLTest_AssertPass(const char *assertDescription, ...) +{ + va_list list; + char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; + + /* Print assert description into a buffer */ + SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); + va_start(list, assertDescription); + SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); + va_end(list); + + /* Log pass message */ + SDLTest_AssertsPassed++; + SDLTest_Log(SDLTest_AssertCheckFormat, logMessage, "Pass"); +} + +/* + * Resets the assert summary counters to zero. + */ +void SDLTest_ResetAssertSummary() +{ + SDLTest_AssertsPassed = 0; + SDLTest_AssertsFailed = 0; +} + +/* + * Logs summary of all assertions (total, pass, fail) since last reset + * as INFO (failed==0) or ERROR (failed > 0). + */ +void SDLTest_LogAssertSummary() +{ + Uint32 totalAsserts = SDLTest_AssertsPassed + SDLTest_AssertsFailed; + if (SDLTest_AssertsFailed == 0) + { + SDLTest_Log(SDLTest_AssertSummaryFormat, totalAsserts, SDLTest_AssertsPassed, SDLTest_AssertsFailed); + } + else + { + SDLTest_LogError(SDLTest_AssertSummaryFormat, totalAsserts, SDLTest_AssertsPassed, SDLTest_AssertsFailed); + } +} + +/* + * Converts the current assert state into a test result + */ +int SDLTest_AssertSummaryToTestResult() +{ + if (SDLTest_AssertsFailed > 0) { + return TEST_RESULT_FAILED; + } else { + if (SDLTest_AssertsPassed > 0) { + return TEST_RESULT_PASSED; + } else { + return TEST_RESULT_NO_ASSERT; + } + } +} diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c new file mode 100644 index 0000000000..14add55b2e --- /dev/null +++ b/src/test/SDL_test_common.c @@ -0,0 +1,1411 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* Ported from original test\common.c file. */ + +#include "SDL_config.h" +#include "SDL_test.h" + +#include + +#define VIDEO_USAGE \ +"[--video driver] [--renderer driver] [--gldebug] [--info all|video|modes|render|event] [--log all|error|system|audio|video|render|input] [--display N] [--fullscreen | --fullscreen-desktop | --windows N] [--title title] [--icon icon.bmp] [--center | --position X,Y] [--geometry WxH] [--min-geometry WxH] [--max-geometry WxH] [--logical WxH] [--scale N] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab]" + +#define AUDIO_USAGE \ +"[--rate N] [--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE] [--channels N] [--samples N]" + +SDLTest_CommonState * +SDLTest_CommonCreateState(char **argv, Uint32 flags) +{ + SDLTest_CommonState *state = (SDLTest_CommonState *)SDL_calloc(1, sizeof(*state)); + if (!state) { + SDL_OutOfMemory(); + return NULL; + } + + /* Initialize some defaults */ + state->argv = argv; + state->flags = flags; + state->window_title = argv[0]; + state->window_flags = 0; + state->window_x = SDL_WINDOWPOS_UNDEFINED; + state->window_y = SDL_WINDOWPOS_UNDEFINED; + state->window_w = DEFAULT_WINDOW_WIDTH; + state->window_h = DEFAULT_WINDOW_HEIGHT; + state->num_windows = 1; + state->audiospec.freq = 22050; + state->audiospec.format = AUDIO_S16; + state->audiospec.channels = 2; + state->audiospec.samples = 2048; + + /* Set some very sane GL defaults */ + state->gl_red_size = 3; + state->gl_green_size = 3; + state->gl_blue_size = 2; + state->gl_alpha_size = 0; + state->gl_buffer_size = 0; + state->gl_depth_size = 16; + state->gl_stencil_size = 0; + state->gl_double_buffer = 1; + state->gl_accum_red_size = 0; + state->gl_accum_green_size = 0; + state->gl_accum_blue_size = 0; + state->gl_accum_alpha_size = 0; + state->gl_stereo = 0; + state->gl_multisamplebuffers = 0; + state->gl_multisamplesamples = 0; + state->gl_retained_backing = 1; + state->gl_accelerated = -1; + state->gl_debug = 0; + + return state; +} + +int +SDLTest_CommonArg(SDLTest_CommonState * state, int index) +{ + char **argv = state->argv; + + if (SDL_strcasecmp(argv[index], "--video") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->videodriver = argv[index]; + return 2; + } + if (SDL_strcasecmp(argv[index], "--renderer") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->renderdriver = argv[index]; + return 2; + } + if (SDL_strcasecmp(argv[index], "--gldebug") == 0) { + state->gl_debug = 1; + return 1; + } + if (SDL_strcasecmp(argv[index], "--info") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + if (SDL_strcasecmp(argv[index], "all") == 0) { + state->verbose |= + (VERBOSE_VIDEO | VERBOSE_MODES | VERBOSE_RENDER | + VERBOSE_EVENT); + return 2; + } + if (SDL_strcasecmp(argv[index], "video") == 0) { + state->verbose |= VERBOSE_VIDEO; + return 2; + } + if (SDL_strcasecmp(argv[index], "modes") == 0) { + state->verbose |= VERBOSE_MODES; + return 2; + } + if (SDL_strcasecmp(argv[index], "render") == 0) { + state->verbose |= VERBOSE_RENDER; + return 2; + } + if (SDL_strcasecmp(argv[index], "event") == 0) { + state->verbose |= VERBOSE_EVENT; + return 2; + } + return -1; + } + if (SDL_strcasecmp(argv[index], "--log") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + if (SDL_strcasecmp(argv[index], "all") == 0) { + SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE); + return 2; + } + if (SDL_strcasecmp(argv[index], "error") == 0) { + SDL_LogSetPriority(SDL_LOG_CATEGORY_ERROR, SDL_LOG_PRIORITY_VERBOSE); + return 2; + } + if (SDL_strcasecmp(argv[index], "system") == 0) { + SDL_LogSetPriority(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE); + return 2; + } + if (SDL_strcasecmp(argv[index], "audio") == 0) { + SDL_LogSetPriority(SDL_LOG_CATEGORY_AUDIO, SDL_LOG_PRIORITY_VERBOSE); + return 2; + } + if (SDL_strcasecmp(argv[index], "video") == 0) { + SDL_LogSetPriority(SDL_LOG_CATEGORY_VIDEO, SDL_LOG_PRIORITY_VERBOSE); + return 2; + } + if (SDL_strcasecmp(argv[index], "render") == 0) { + SDL_LogSetPriority(SDL_LOG_CATEGORY_RENDER, SDL_LOG_PRIORITY_VERBOSE); + return 2; + } + if (SDL_strcasecmp(argv[index], "input") == 0) { + SDL_LogSetPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE); + return 2; + } + return -1; + } + if (SDL_strcasecmp(argv[index], "--display") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->display = SDL_atoi(argv[index]); + if (SDL_WINDOWPOS_ISUNDEFINED(state->window_x)) { + state->window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->display); + state->window_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->display); + } + if (SDL_WINDOWPOS_ISCENTERED(state->window_x)) { + state->window_x = SDL_WINDOWPOS_CENTERED_DISPLAY(state->display); + state->window_y = SDL_WINDOWPOS_CENTERED_DISPLAY(state->display); + } + return 2; + } + if (SDL_strcasecmp(argv[index], "--fullscreen") == 0) { + state->window_flags |= SDL_WINDOW_FULLSCREEN; + state->num_windows = 1; + return 1; + } + if (SDL_strcasecmp(argv[index], "--fullscreen-desktop") == 0) { + state->window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + state->num_windows = 1; + return 1; + } + if (SDL_strcasecmp(argv[index], "--windows") == 0) { + ++index; + if (!argv[index] || !SDL_isdigit(*argv[index])) { + return -1; + } + if (!(state->window_flags & SDL_WINDOW_FULLSCREEN)) { + state->num_windows = SDL_atoi(argv[index]); + } + return 2; + } + if (SDL_strcasecmp(argv[index], "--title") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->window_title = argv[index]; + return 2; + } + if (SDL_strcasecmp(argv[index], "--icon") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->window_icon = argv[index]; + return 2; + } + if (SDL_strcasecmp(argv[index], "--center") == 0) { + state->window_x = SDL_WINDOWPOS_CENTERED; + state->window_y = SDL_WINDOWPOS_CENTERED; + return 1; + } + if (SDL_strcasecmp(argv[index], "--position") == 0) { + char *x, *y; + ++index; + if (!argv[index]) { + return -1; + } + x = argv[index]; + y = argv[index]; + while (*y && *y != ',') { + ++y; + } + if (!*y) { + return -1; + } + *y++ = '\0'; + state->window_x = SDL_atoi(x); + state->window_y = SDL_atoi(y); + return 2; + } + if (SDL_strcasecmp(argv[index], "--geometry") == 0) { + char *w, *h; + ++index; + if (!argv[index]) { + return -1; + } + w = argv[index]; + h = argv[index]; + while (*h && *h != 'x') { + ++h; + } + if (!*h) { + return -1; + } + *h++ = '\0'; + state->window_w = SDL_atoi(w); + state->window_h = SDL_atoi(h); + return 2; + } + if (SDL_strcasecmp(argv[index], "--min-geometry") == 0) { + char *w, *h; + ++index; + if (!argv[index]) { + return -1; + } + w = argv[index]; + h = argv[index]; + while (*h && *h != 'x') { + ++h; + } + if (!*h) { + return -1; + } + *h++ = '\0'; + state->window_minW = SDL_atoi(w); + state->window_minH = SDL_atoi(h); + return 2; + } + if (SDL_strcasecmp(argv[index], "--max-geometry") == 0) { + char *w, *h; + ++index; + if (!argv[index]) { + return -1; + } + w = argv[index]; + h = argv[index]; + while (*h && *h != 'x') { + ++h; + } + if (!*h) { + return -1; + } + *h++ = '\0'; + state->window_maxW = SDL_atoi(w); + state->window_maxH = SDL_atoi(h); + return 2; + } + if (SDL_strcasecmp(argv[index], "--logical") == 0) { + char *w, *h; + ++index; + if (!argv[index]) { + return -1; + } + w = argv[index]; + h = argv[index]; + while (*h && *h != 'x') { + ++h; + } + if (!*h) { + return -1; + } + *h++ = '\0'; + state->logical_w = SDL_atoi(w); + state->logical_h = SDL_atoi(h); + return 2; + } + if (SDL_strcasecmp(argv[index], "--scale") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->scale = (float)SDL_atof(argv[index]); + return 2; + } + if (SDL_strcasecmp(argv[index], "--depth") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->depth = SDL_atoi(argv[index]); + return 2; + } + if (SDL_strcasecmp(argv[index], "--refresh") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->refresh_rate = SDL_atoi(argv[index]); + return 2; + } + if (SDL_strcasecmp(argv[index], "--vsync") == 0) { + state->render_flags |= SDL_RENDERER_PRESENTVSYNC; + return 1; + } + if (SDL_strcasecmp(argv[index], "--noframe") == 0) { + state->window_flags |= SDL_WINDOW_BORDERLESS; + return 1; + } + if (SDL_strcasecmp(argv[index], "--resize") == 0) { + state->window_flags |= SDL_WINDOW_RESIZABLE; + return 1; + } + if (SDL_strcasecmp(argv[index], "--minimize") == 0) { + state->window_flags |= SDL_WINDOW_MINIMIZED; + return 1; + } + if (SDL_strcasecmp(argv[index], "--maximize") == 0) { + state->window_flags |= SDL_WINDOW_MAXIMIZED; + return 1; + } + if (SDL_strcasecmp(argv[index], "--grab") == 0) { + state->window_flags |= SDL_WINDOW_INPUT_GRABBED; + return 1; + } + if (SDL_strcasecmp(argv[index], "--rate") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->audiospec.freq = SDL_atoi(argv[index]); + return 2; + } + if (SDL_strcasecmp(argv[index], "--format") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + if (SDL_strcasecmp(argv[index], "U8") == 0) { + state->audiospec.format = AUDIO_U8; + return 2; + } + if (SDL_strcasecmp(argv[index], "S8") == 0) { + state->audiospec.format = AUDIO_S8; + return 2; + } + if (SDL_strcasecmp(argv[index], "U16") == 0) { + state->audiospec.format = AUDIO_U16; + return 2; + } + if (SDL_strcasecmp(argv[index], "U16LE") == 0) { + state->audiospec.format = AUDIO_U16LSB; + return 2; + } + if (SDL_strcasecmp(argv[index], "U16BE") == 0) { + state->audiospec.format = AUDIO_U16MSB; + return 2; + } + if (SDL_strcasecmp(argv[index], "S16") == 0) { + state->audiospec.format = AUDIO_S16; + return 2; + } + if (SDL_strcasecmp(argv[index], "S16LE") == 0) { + state->audiospec.format = AUDIO_S16LSB; + return 2; + } + if (SDL_strcasecmp(argv[index], "S16BE") == 0) { + state->audiospec.format = AUDIO_S16MSB; + return 2; + } + return -1; + } + if (SDL_strcasecmp(argv[index], "--channels") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->audiospec.channels = (Uint8) SDL_atoi(argv[index]); + return 2; + } + if (SDL_strcasecmp(argv[index], "--samples") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->audiospec.samples = (Uint16) SDL_atoi(argv[index]); + return 2; + } + if ((SDL_strcasecmp(argv[index], "-h") == 0) + || (SDL_strcasecmp(argv[index], "--help") == 0)) { + /* Print the usage message */ + return -1; + } + if (SDL_strcmp(argv[index], "-NSDocumentRevisionsDebugMode") == 0) { + /* Debug flag sent by Xcode */ + return 2; + } + return 0; +} + +const char * +SDLTest_CommonUsage(SDLTest_CommonState * state) +{ + switch (state->flags & (SDL_INIT_VIDEO | SDL_INIT_AUDIO)) { + case SDL_INIT_VIDEO: + return VIDEO_USAGE; + case SDL_INIT_AUDIO: + return AUDIO_USAGE; + case (SDL_INIT_VIDEO | SDL_INIT_AUDIO): + return VIDEO_USAGE " " AUDIO_USAGE; + default: + return ""; + } +} + +static void +SDLTest_PrintRendererFlag(Uint32 flag) +{ + switch (flag) { + case SDL_RENDERER_PRESENTVSYNC: + fprintf(stderr, "PresentVSync"); + break; + case SDL_RENDERER_ACCELERATED: + fprintf(stderr, "Accelerated"); + break; + default: + fprintf(stderr, "0x%8.8x", flag); + break; + } +} + +static void +SDLTest_PrintPixelFormat(Uint32 format) +{ + switch (format) { + case SDL_PIXELFORMAT_UNKNOWN: + fprintf(stderr, "Unknwon"); + break; + case SDL_PIXELFORMAT_INDEX1LSB: + fprintf(stderr, "Index1LSB"); + break; + case SDL_PIXELFORMAT_INDEX1MSB: + fprintf(stderr, "Index1MSB"); + break; + case SDL_PIXELFORMAT_INDEX4LSB: + fprintf(stderr, "Index4LSB"); + break; + case SDL_PIXELFORMAT_INDEX4MSB: + fprintf(stderr, "Index4MSB"); + break; + case SDL_PIXELFORMAT_INDEX8: + fprintf(stderr, "Index8"); + break; + case SDL_PIXELFORMAT_RGB332: + fprintf(stderr, "RGB332"); + break; + case SDL_PIXELFORMAT_RGB444: + fprintf(stderr, "RGB444"); + break; + case SDL_PIXELFORMAT_RGB555: + fprintf(stderr, "RGB555"); + break; + case SDL_PIXELFORMAT_BGR555: + fprintf(stderr, "BGR555"); + break; + case SDL_PIXELFORMAT_ARGB4444: + fprintf(stderr, "ARGB4444"); + break; + case SDL_PIXELFORMAT_ABGR4444: + fprintf(stderr, "ABGR4444"); + break; + case SDL_PIXELFORMAT_ARGB1555: + fprintf(stderr, "ARGB1555"); + break; + case SDL_PIXELFORMAT_ABGR1555: + fprintf(stderr, "ABGR1555"); + break; + case SDL_PIXELFORMAT_RGB565: + fprintf(stderr, "RGB565"); + break; + case SDL_PIXELFORMAT_BGR565: + fprintf(stderr, "BGR565"); + break; + case SDL_PIXELFORMAT_RGB24: + fprintf(stderr, "RGB24"); + break; + case SDL_PIXELFORMAT_BGR24: + fprintf(stderr, "BGR24"); + break; + case SDL_PIXELFORMAT_RGB888: + fprintf(stderr, "RGB888"); + break; + case SDL_PIXELFORMAT_BGR888: + fprintf(stderr, "BGR888"); + break; + case SDL_PIXELFORMAT_ARGB8888: + fprintf(stderr, "ARGB8888"); + break; + case SDL_PIXELFORMAT_RGBA8888: + fprintf(stderr, "RGBA8888"); + break; + case SDL_PIXELFORMAT_ABGR8888: + fprintf(stderr, "ABGR8888"); + break; + case SDL_PIXELFORMAT_BGRA8888: + fprintf(stderr, "BGRA8888"); + break; + case SDL_PIXELFORMAT_ARGB2101010: + fprintf(stderr, "ARGB2101010"); + break; + case SDL_PIXELFORMAT_YV12: + fprintf(stderr, "YV12"); + break; + case SDL_PIXELFORMAT_IYUV: + fprintf(stderr, "IYUV"); + break; + case SDL_PIXELFORMAT_YUY2: + fprintf(stderr, "YUY2"); + break; + case SDL_PIXELFORMAT_UYVY: + fprintf(stderr, "UYVY"); + break; + case SDL_PIXELFORMAT_YVYU: + fprintf(stderr, "YVYU"); + break; + default: + fprintf(stderr, "0x%8.8x", format); + break; + } +} + +static void +SDLTest_PrintRenderer(SDL_RendererInfo * info) +{ + int i, count; + + fprintf(stderr, " Renderer %s:\n", info->name); + + fprintf(stderr, " Flags: 0x%8.8X", info->flags); + fprintf(stderr, " ("); + count = 0; + for (i = 0; i < sizeof(info->flags) * 8; ++i) { + Uint32 flag = (1 << i); + if (info->flags & flag) { + if (count > 0) { + fprintf(stderr, " | "); + } + SDLTest_PrintRendererFlag(flag); + ++count; + } + } + fprintf(stderr, ")\n"); + + fprintf(stderr, " Texture formats (%d): ", info->num_texture_formats); + for (i = 0; i < (int) info->num_texture_formats; ++i) { + if (i > 0) { + fprintf(stderr, ", "); + } + SDLTest_PrintPixelFormat(info->texture_formats[i]); + } + fprintf(stderr, "\n"); + + if (info->max_texture_width || info->max_texture_height) { + fprintf(stderr, " Max Texture Size: %dx%d\n", + info->max_texture_width, info->max_texture_height); + } +} + +static SDL_Surface * +SDLTest_LoadIcon(const char *file) +{ + SDL_Surface *icon; + + /* Load the icon surface */ + icon = SDL_LoadBMP(file); + if (icon == NULL) { + fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError()); + return (NULL); + } + + if (icon->format->palette) { + /* Set the colorkey */ + SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels)); + } + + return (icon); +} + +SDL_bool +SDLTest_CommonInit(SDLTest_CommonState * state) +{ + int i, j, m, n, w, h; + SDL_DisplayMode fullscreen_mode; + + if (state->flags & SDL_INIT_VIDEO) { + if (state->verbose & VERBOSE_VIDEO) { + n = SDL_GetNumVideoDrivers(); + if (n == 0) { + fprintf(stderr, "No built-in video drivers\n"); + } else { + fprintf(stderr, "Built-in video drivers:"); + for (i = 0; i < n; ++i) { + if (i > 0) { + fprintf(stderr, ","); + } + fprintf(stderr, " %s", SDL_GetVideoDriver(i)); + } + fprintf(stderr, "\n"); + } + } + if (SDL_VideoInit(state->videodriver) < 0) { + fprintf(stderr, "Couldn't initialize video driver: %s\n", + SDL_GetError()); + return SDL_FALSE; + } + if (state->verbose & VERBOSE_VIDEO) { + fprintf(stderr, "Video driver: %s\n", + SDL_GetCurrentVideoDriver()); + } + + /* Upload GL settings */ + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, state->gl_red_size); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, state->gl_green_size); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, state->gl_blue_size); + SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, state->gl_alpha_size); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, state->gl_double_buffer); + SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, state->gl_buffer_size); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, state->gl_depth_size); + SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, state->gl_stencil_size); + SDL_GL_SetAttribute(SDL_GL_ACCUM_RED_SIZE, state->gl_accum_red_size); + SDL_GL_SetAttribute(SDL_GL_ACCUM_GREEN_SIZE, state->gl_accum_green_size); + SDL_GL_SetAttribute(SDL_GL_ACCUM_BLUE_SIZE, state->gl_accum_blue_size); + SDL_GL_SetAttribute(SDL_GL_ACCUM_ALPHA_SIZE, state->gl_accum_alpha_size); + SDL_GL_SetAttribute(SDL_GL_STEREO, state->gl_stereo); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, state->gl_multisamplebuffers); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, state->gl_multisamplesamples); + if (state->gl_accelerated >= 0) { + SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, + state->gl_accelerated); + } + SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, state->gl_retained_backing); + if (state->gl_major_version) { + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, state->gl_major_version); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, state->gl_minor_version); + } + if (state->gl_debug) { + SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG); + } + + if (state->verbose & VERBOSE_MODES) { + SDL_Rect bounds; + SDL_DisplayMode mode; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + n = SDL_GetNumVideoDisplays(); + fprintf(stderr, "Number of displays: %d\n", n); + for (i = 0; i < n; ++i) { + fprintf(stderr, "Display %d: %s\n", i, SDL_GetDisplayName(i)); + + SDL_zero(bounds); + SDL_GetDisplayBounds(i, &bounds); + fprintf(stderr, "Bounds: %dx%d at %d,%d\n", bounds.w, bounds.h, bounds.x, bounds.y); + + SDL_GetDesktopDisplayMode(i, &mode); + SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask, + &Bmask, &Amask); + fprintf(stderr, + " Current mode: %dx%d@%dHz, %d bits-per-pixel (%s)\n", + mode.w, mode.h, mode.refresh_rate, bpp, + SDL_GetPixelFormatName(mode.format)); + if (Rmask || Gmask || Bmask) { + fprintf(stderr, " Red Mask = 0x%.8x\n", Rmask); + fprintf(stderr, " Green Mask = 0x%.8x\n", Gmask); + fprintf(stderr, " Blue Mask = 0x%.8x\n", Bmask); + if (Amask) + fprintf(stderr, " Alpha Mask = 0x%.8x\n", Amask); + } + + /* Print available fullscreen video modes */ + m = SDL_GetNumDisplayModes(i); + if (m == 0) { + fprintf(stderr, "No available fullscreen video modes\n"); + } else { + fprintf(stderr, " Fullscreen video modes:\n"); + for (j = 0; j < m; ++j) { + SDL_GetDisplayMode(i, j, &mode); + SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, + &Gmask, &Bmask, &Amask); + fprintf(stderr, + " Mode %d: %dx%d@%dHz, %d bits-per-pixel (%s)\n", + j, mode.w, mode.h, mode.refresh_rate, bpp, + SDL_GetPixelFormatName(mode.format)); + if (Rmask || Gmask || Bmask) { + fprintf(stderr, " Red Mask = 0x%.8x\n", + Rmask); + fprintf(stderr, " Green Mask = 0x%.8x\n", + Gmask); + fprintf(stderr, " Blue Mask = 0x%.8x\n", + Bmask); + if (Amask) + fprintf(stderr, + " Alpha Mask = 0x%.8x\n", + Amask); + } + } + } + } + } + + if (state->verbose & VERBOSE_RENDER) { + SDL_RendererInfo info; + + n = SDL_GetNumRenderDrivers(); + if (n == 0) { + fprintf(stderr, "No built-in render drivers\n"); + } else { + fprintf(stderr, "Built-in render drivers:\n"); + for (i = 0; i < n; ++i) { + SDL_GetRenderDriverInfo(i, &info); + SDLTest_PrintRenderer(&info); + } + } + } + + SDL_zero(fullscreen_mode); + switch (state->depth) { + case 8: + fullscreen_mode.format = SDL_PIXELFORMAT_INDEX8; + break; + case 15: + fullscreen_mode.format = SDL_PIXELFORMAT_RGB555; + break; + case 16: + fullscreen_mode.format = SDL_PIXELFORMAT_RGB565; + break; + case 24: + fullscreen_mode.format = SDL_PIXELFORMAT_RGB24; + break; + default: + fullscreen_mode.format = SDL_PIXELFORMAT_RGB888; + break; + } + fullscreen_mode.refresh_rate = state->refresh_rate; + + state->windows = + (SDL_Window **) SDL_malloc(state->num_windows * + sizeof(*state->windows)); + state->renderers = + (SDL_Renderer **) SDL_malloc(state->num_windows * + sizeof(*state->renderers)); + if (!state->windows || !state->renderers) { + fprintf(stderr, "Out of memory!\n"); + return SDL_FALSE; + } + for (i = 0; i < state->num_windows; ++i) { + char title[1024]; + + if (state->num_windows > 1) { + SDL_snprintf(title, SDL_arraysize(title), "%s %d", + state->window_title, i + 1); + } else { + SDL_strlcpy(title, state->window_title, SDL_arraysize(title)); + } + state->windows[i] = + SDL_CreateWindow(title, state->window_x, state->window_y, + state->window_w, state->window_h, + state->window_flags); + if (!state->windows[i]) { + fprintf(stderr, "Couldn't create window: %s\n", + SDL_GetError()); + return SDL_FALSE; + } + if (state->window_minW || state->window_minH) { + SDL_SetWindowMinimumSize(state->windows[i], state->window_minW, state->window_minH); + } + if (state->window_maxW || state->window_maxH) { + SDL_SetWindowMaximumSize(state->windows[i], state->window_maxW, state->window_maxH); + } + SDL_GetWindowSize(state->windows[i], &w, &h); + if (!(state->window_flags & SDL_WINDOW_RESIZABLE) && + (w != state->window_w || h != state->window_h)) { + printf("Window requested size %dx%d, got %dx%d\n", state->window_w, state->window_h, w, h); + state->window_w = w; + state->window_h = h; + } + if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) { + fprintf(stderr, "Can't set up fullscreen display mode: %s\n", + SDL_GetError()); + return SDL_FALSE; + } + + if (state->window_icon) { + SDL_Surface *icon = SDLTest_LoadIcon(state->window_icon); + if (icon) { + SDL_SetWindowIcon(state->windows[i], icon); + SDL_FreeSurface(icon); + } + } + + SDL_ShowWindow(state->windows[i]); + + state->renderers[i] = NULL; + + if (!state->skip_renderer + && (state->renderdriver + || !(state->window_flags & SDL_WINDOW_OPENGL))) { + m = -1; + if (state->renderdriver) { + SDL_RendererInfo info; + n = SDL_GetNumRenderDrivers(); + for (j = 0; j < n; ++j) { + SDL_GetRenderDriverInfo(j, &info); + if (SDL_strcasecmp(info.name, state->renderdriver) == + 0) { + m = j; + break; + } + } + if (m == n) { + fprintf(stderr, + "Couldn't find render driver named %s", + state->renderdriver); + return SDL_FALSE; + } + } + state->renderers[i] = SDL_CreateRenderer(state->windows[i], + m, state->render_flags); + if (!state->renderers[i]) { + fprintf(stderr, "Couldn't create renderer: %s\n", + SDL_GetError()); + return SDL_FALSE; + } + if (state->logical_w && state->logical_h) { + SDL_RenderSetLogicalSize(state->renderers[i], state->logical_w, state->logical_h); + } else if (state->scale) { + SDL_RenderSetScale(state->renderers[i], state->scale, state->scale); + } + if (state->verbose & VERBOSE_RENDER) { + SDL_RendererInfo info; + + fprintf(stderr, "Current renderer:\n"); + SDL_GetRendererInfo(state->renderers[i], &info); + SDLTest_PrintRenderer(&info); + } + } + } + } + + if (state->flags & SDL_INIT_AUDIO) { + if (state->verbose & VERBOSE_AUDIO) { + n = SDL_GetNumAudioDrivers(); + if (n == 0) { + fprintf(stderr, "No built-in audio drivers\n"); + } else { + fprintf(stderr, "Built-in audio drivers:"); + for (i = 0; i < n; ++i) { + if (i > 0) { + fprintf(stderr, ","); + } + fprintf(stderr, " %s", SDL_GetAudioDriver(i)); + } + fprintf(stderr, "\n"); + } + } + if (SDL_AudioInit(state->audiodriver) < 0) { + fprintf(stderr, "Couldn't initialize audio driver: %s\n", + SDL_GetError()); + return SDL_FALSE; + } + if (state->verbose & VERBOSE_VIDEO) { + fprintf(stderr, "Audio driver: %s\n", + SDL_GetCurrentAudioDriver()); + } + + if (SDL_OpenAudio(&state->audiospec, NULL) < 0) { + fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); + return SDL_FALSE; + } + } + + return SDL_TRUE; +} + +static void +SDLTest_PrintEvent(SDL_Event * event) +{ + if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) { + /* Mouse and finger motion are really spammy */ + return; + } + + fprintf(stderr, "SDL EVENT: "); + switch (event->type) { + case SDL_WINDOWEVENT: + switch (event->window.event) { + case SDL_WINDOWEVENT_SHOWN: + fprintf(stderr, "Window %d shown", event->window.windowID); + break; + case SDL_WINDOWEVENT_HIDDEN: + fprintf(stderr, "Window %d hidden", event->window.windowID); + break; + case SDL_WINDOWEVENT_EXPOSED: + fprintf(stderr, "Window %d exposed", event->window.windowID); + break; + case SDL_WINDOWEVENT_MOVED: + fprintf(stderr, "Window %d moved to %d,%d", + event->window.windowID, event->window.data1, + event->window.data2); + break; + case SDL_WINDOWEVENT_RESIZED: + fprintf(stderr, "Window %d resized to %dx%d", + event->window.windowID, event->window.data1, + event->window.data2); + break; + case SDL_WINDOWEVENT_SIZE_CHANGED: + fprintf(stderr, "Window %d changed size to %dx%d", + event->window.windowID, event->window.data1, + event->window.data2); + break; + case SDL_WINDOWEVENT_MINIMIZED: + fprintf(stderr, "Window %d minimized", event->window.windowID); + break; + case SDL_WINDOWEVENT_MAXIMIZED: + fprintf(stderr, "Window %d maximized", event->window.windowID); + break; + case SDL_WINDOWEVENT_RESTORED: + fprintf(stderr, "Window %d restored", event->window.windowID); + break; + case SDL_WINDOWEVENT_ENTER: + fprintf(stderr, "Mouse entered window %d", + event->window.windowID); + break; + case SDL_WINDOWEVENT_LEAVE: + fprintf(stderr, "Mouse left window %d", event->window.windowID); + break; + case SDL_WINDOWEVENT_FOCUS_GAINED: + fprintf(stderr, "Window %d gained keyboard focus", + event->window.windowID); + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + fprintf(stderr, "Window %d lost keyboard focus", + event->window.windowID); + break; + case SDL_WINDOWEVENT_CLOSE: + fprintf(stderr, "Window %d closed", event->window.windowID); + break; + default: + fprintf(stderr, "Window %d got unknown event %d", + event->window.windowID, event->window.event); + break; + } + break; + case SDL_KEYDOWN: + fprintf(stderr, + "Keyboard: key pressed in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s", + event->key.windowID, + event->key.keysym.scancode, + SDL_GetScancodeName(event->key.keysym.scancode), + event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym)); + break; + case SDL_KEYUP: + fprintf(stderr, + "Keyboard: key released in window %d: scancode 0x%08X = %s, keycode 0x%08X = %s", + event->key.windowID, + event->key.keysym.scancode, + SDL_GetScancodeName(event->key.keysym.scancode), + event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym)); + break; + case SDL_TEXTINPUT: + fprintf(stderr, "Keyboard: text input \"%s\" in window %d", + event->text.text, event->text.windowID); + break; + case SDL_MOUSEMOTION: + fprintf(stderr, "Mouse: moved to %d,%d (%d,%d) in window %d", + event->motion.x, event->motion.y, + event->motion.xrel, event->motion.yrel, + event->motion.windowID); + break; + case SDL_MOUSEBUTTONDOWN: + fprintf(stderr, "Mouse: button %d pressed at %d,%d in window %d", + event->button.button, event->button.x, event->button.y, + event->button.windowID); + break; + case SDL_MOUSEBUTTONUP: + fprintf(stderr, "Mouse: button %d released at %d,%d in window %d", + event->button.button, event->button.x, event->button.y, + event->button.windowID); + break; + case SDL_MOUSEWHEEL: + fprintf(stderr, + "Mouse: wheel scrolled %d in x and %d in y in window %d", + event->wheel.x, event->wheel.y, event->wheel.windowID); + break; + case SDL_JOYBALLMOTION: + fprintf(stderr, "Joystick %d: ball %d moved by %d,%d", + event->jball.which, event->jball.ball, event->jball.xrel, + event->jball.yrel); + break; + case SDL_JOYHATMOTION: + fprintf(stderr, "Joystick %d: hat %d moved to ", event->jhat.which, + event->jhat.hat); + switch (event->jhat.value) { + case SDL_HAT_CENTERED: + fprintf(stderr, "CENTER"); + break; + case SDL_HAT_UP: + fprintf(stderr, "UP"); + break; + case SDL_HAT_RIGHTUP: + fprintf(stderr, "RIGHTUP"); + break; + case SDL_HAT_RIGHT: + fprintf(stderr, "RIGHT"); + break; + case SDL_HAT_RIGHTDOWN: + fprintf(stderr, "RIGHTDOWN"); + break; + case SDL_HAT_DOWN: + fprintf(stderr, "DOWN"); + break; + case SDL_HAT_LEFTDOWN: + fprintf(stderr, "LEFTDOWN"); + break; + case SDL_HAT_LEFT: + fprintf(stderr, "LEFT"); + break; + case SDL_HAT_LEFTUP: + fprintf(stderr, "LEFTUP"); + break; + default: + fprintf(stderr, "UNKNOWN"); + break; + } + break; + case SDL_JOYBUTTONDOWN: + fprintf(stderr, "Joystick %d: button %d pressed", + event->jbutton.which, event->jbutton.button); + break; + case SDL_JOYBUTTONUP: + fprintf(stderr, "Joystick %d: button %d released", + event->jbutton.which, event->jbutton.button); + break; + case SDL_CLIPBOARDUPDATE: + fprintf(stderr, "Clipboard updated"); + break; + + case SDL_FINGERDOWN: + case SDL_FINGERUP: + fprintf(stderr, "Finger: %s touch=%lld, finger=%lld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f", + (event->type == SDL_FINGERDOWN) ? "down" : "up", + (long long) event->tfinger.touchId, + (long long) event->tfinger.fingerId, + event->tfinger.x, event->tfinger.y, + event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure); + break; + + case SDL_QUIT: + fprintf(stderr, "Quit requested"); + break; + case SDL_USEREVENT: + fprintf(stderr, "User event %d", event->user.code); + break; + default: + fprintf(stderr, "Unknown event %d", event->type); + break; + } + fprintf(stderr, "\n"); +} + +static void +SDLTest_ScreenShot(SDL_Renderer *renderer) +{ + SDL_Rect viewport; + SDL_Surface *surface; + + if (!renderer) { + return; + } + + SDL_RenderGetViewport(renderer, &viewport); + surface = SDL_CreateRGBSurface(0, viewport.w, viewport.h, 24, +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + 0x00FF0000, 0x0000FF00, 0x000000FF, +#else + 0x000000FF, 0x0000FF00, 0x00FF0000, +#endif + 0x00000000); + if (!surface) { + fprintf(stderr, "Couldn't create surface: %s\n", SDL_GetError()); + return; + } + + if (SDL_RenderReadPixels(renderer, NULL, surface->format->format, + surface->pixels, surface->pitch) < 0) { + fprintf(stderr, "Couldn't read screen: %s\n", SDL_GetError()); + return; + } + + if (SDL_SaveBMP(surface, "screenshot.bmp") < 0) { + fprintf(stderr, "Couldn't save screenshot.bmp: %s\n", SDL_GetError()); + return; + } +} + +static void +FullscreenTo(int index, int windowId) +{ + Uint32 flags; + struct SDL_Rect rect = { 0, 0, 0, 0 }; + SDL_Window *window = SDL_GetWindowFromID(windowId); + if (!window) { + return; + } + + SDL_GetDisplayBounds( index, &rect ); + + flags = SDL_GetWindowFlags(window); + if (flags & SDL_WINDOW_FULLSCREEN) { + SDL_SetWindowFullscreen( window, SDL_FALSE ); + SDL_Delay( 15 ); + } + + SDL_SetWindowPosition( window, rect.x, rect.y ); + SDL_SetWindowFullscreen( window, SDL_TRUE ); +} + +void +SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) +{ + int i; + static SDL_MouseMotionEvent lastEvent; + + if (state->verbose & VERBOSE_EVENT) { + SDLTest_PrintEvent(event); + } + + switch (event->type) { + case SDL_WINDOWEVENT: + switch (event->window.event) { + case SDL_WINDOWEVENT_CLOSE: + { + SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); + if (window) { + SDL_DestroyWindow(window); + } + } + break; + } + break; + case SDL_KEYDOWN: + switch (event->key.keysym.sym) { + /* Add hotkeys here */ + case SDLK_PRINTSCREEN: { + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + for (i = 0; i < state->num_windows; ++i) { + if (window == state->windows[i]) { + SDLTest_ScreenShot(state->renderers[i]); + } + } + } + } + break; + case SDLK_EQUALS: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-+ double the size of the window */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + int w, h; + SDL_GetWindowSize(window, &w, &h); + SDL_SetWindowSize(window, w*2, h*2); + } + } + break; + case SDLK_MINUS: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-- half the size of the window */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + int w, h; + SDL_GetWindowSize(window, &w, &h); + SDL_SetWindowSize(window, w/2, h/2); + } + } + break; + case SDLK_c: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-C copy awesome text! */ + SDL_SetClipboardText("SDL rocks!\nYou know it!"); + printf("Copied text to clipboard\n"); + } + if (event->key.keysym.mod & KMOD_ALT) { + /* Alt-C toggle a render clip rectangle */ + for (i = 0; i < state->num_windows; ++i) { + int w, h; + if (state->renderers[i]) { + SDL_Rect clip; + SDL_GetWindowSize(state->windows[i], &w, &h); + SDL_RenderGetClipRect(state->renderers[i], &clip); + if (SDL_RectEmpty(&clip)) { + clip.x = w/4; + clip.y = h/4; + clip.w = w/2; + clip.h = h/2; + SDL_RenderSetClipRect(state->renderers[i], &clip); + } else { + SDL_RenderSetClipRect(state->renderers[i], NULL); + } + } + } + } + break; + case SDLK_v: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-V paste awesome text! */ + char *text = SDL_GetClipboardText(); + if (*text) { + printf("Clipboard: %s\n", text); + } else { + printf("Clipboard is empty\n"); + } + SDL_free(text); + } + break; + case SDLK_g: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-G toggle grab */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + SDL_SetWindowGrab(window, !SDL_GetWindowGrab(window) ? SDL_TRUE : SDL_FALSE); + } + } + break; + case SDLK_m: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-M maximize */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + Uint32 flags = SDL_GetWindowFlags(window); + if (flags & SDL_WINDOW_MAXIMIZED) { + SDL_RestoreWindow(window); + } else { + SDL_MaximizeWindow(window); + } + } + } + break; + case SDLK_r: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-R toggle mouse relative mode */ + SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode() ? SDL_TRUE : SDL_FALSE); + } + break; + case SDLK_z: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-Z minimize */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + SDL_MinimizeWindow(window); + } + } + break; + case SDLK_RETURN: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-Enter toggle fullscreen */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + Uint32 flags = SDL_GetWindowFlags(window); + if (flags & SDL_WINDOW_FULLSCREEN) { + SDL_SetWindowFullscreen(window, SDL_FALSE); + } else { + SDL_SetWindowFullscreen(window, SDL_TRUE); + } + } + } else if (event->key.keysym.mod & KMOD_ALT) { + /* Alt-Enter toggle fullscreen desktop */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + Uint32 flags = SDL_GetWindowFlags(window); + if (flags & SDL_WINDOW_FULLSCREEN) { + SDL_SetWindowFullscreen(window, SDL_FALSE); + } else { + SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); + } + } + } + break; + case SDLK_b: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-B toggle window border */ + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + const Uint32 flags = SDL_GetWindowFlags(window); + const SDL_bool b = ((flags & SDL_WINDOW_BORDERLESS) != 0) ? SDL_TRUE : SDL_FALSE; + SDL_SetWindowBordered(window, b); + } + } + break; + case SDLK_0: + if (event->key.keysym.mod & KMOD_CTRL) { + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Test Message", "You're awesome!", window); + } + break; + case SDLK_1: + if (event->key.keysym.mod & KMOD_CTRL) { + FullscreenTo(0, event->key.windowID); + } + break; + case SDLK_2: + if (event->key.keysym.mod & KMOD_CTRL) { + FullscreenTo(1, event->key.windowID); + } + break; + case SDLK_ESCAPE: + *done = 1; + break; + case SDLK_SPACE: + { + char message[256]; + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + + SDL_snprintf(message, sizeof(message), "(%i, %i), rel (%i, %i)\n", lastEvent.x, lastEvent.y, lastEvent.xrel, lastEvent.yrel); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Last mouse position", message, window); + break; + } + default: + break; + } + break; + case SDL_QUIT: + *done = 1; + break; + case SDL_MOUSEMOTION: + lastEvent = event->motion; + break; + } +} + +void +SDLTest_CommonQuit(SDLTest_CommonState * state) +{ + int i; + + if (state->windows) { + SDL_free(state->windows); + } + if (state->renderers) { + for (i = 0; i < state->num_windows; ++i) { + if (state->renderers[i]) { + SDL_DestroyRenderer(state->renderers[i]); + } + } + SDL_free(state->renderers); + } + if (state->flags & SDL_INIT_VIDEO) { + SDL_VideoQuit(); + } + if (state->flags & SDL_INIT_AUDIO) { + SDL_AudioQuit(); + } + SDL_free(state); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_compare.c b/src/test/SDL_test_compare.c new file mode 100644 index 0000000000..33f237311b --- /dev/null +++ b/src/test/SDL_test_compare.c @@ -0,0 +1,107 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + + Based on automated SDL_Surface tests originally written by Edgar Simo 'bobbens'. + + Rewritten for test lib by Andreas Schiffler. + +*/ + +#include "SDL_config.h" + +#include "SDL_test.h" + + +/* Counter for _CompareSurface calls; used for filename creation when comparisons fail */ +static int _CompareSurfaceCount = 0; + +/* Compare surfaces */ +int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error) +{ + int ret; + int i,j; + int bpp, bpp_reference; + Uint8 *p, *p_reference; + int dist; + Uint8 R, G, B, A; + Uint8 Rd, Gd, Bd, Ad; + char imageFilename[128]; + char referenceFilename[128]; + + /* Validate input surfaces */ + if (surface == NULL || referenceSurface == NULL) { + return -1; + } + + /* Make sure surface size is the same. */ + if ((surface->w != referenceSurface->w) || (surface->h != referenceSurface->h)) { + return -2; + } + + /* Sanitize input value */ + if (allowable_error<0) { + allowable_error = 0; + } + + SDL_LockSurface( surface ); + SDL_LockSurface( referenceSurface ); + + ret = 0; + bpp = surface->format->BytesPerPixel; + bpp_reference = referenceSurface->format->BytesPerPixel; + /* Compare image - should be same format. */ + for (j=0; jh; j++) { + for (i=0; iw; i++) { + p = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp; + p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference; + + SDL_GetRGBA(*(Uint32*)p, surface->format, &R, &G, &B, &A); + SDL_GetRGBA(*(Uint32*)p_reference, referenceSurface->format, &Rd, &Gd, &Bd, &Ad); + + dist = 0; + dist += (R-Rd)*(R-Rd); + dist += (G-Gd)*(G-Gd); + dist += (B-Bd)*(B-Bd); + + /* Allow some difference in blending accuracy */ + if (dist > allowable_error) { + ret++; + } + } + } + + SDL_UnlockSurface( surface ); + SDL_UnlockSurface( referenceSurface ); + + /* Save test image and reference for analysis on failures */ + _CompareSurfaceCount++; + if (ret != 0) { + SDL_snprintf(imageFilename, 127, "CompareSurfaces%04d_TestOutput.bmp", _CompareSurfaceCount); + SDL_SaveBMP(surface, imageFilename); + SDL_snprintf(referenceFilename, 127, "CompareSurfaces%04d_Reference.bmp", _CompareSurfaceCount); + SDL_SaveBMP(referenceSurface, referenceFilename); + SDLTest_LogError("Surfaces from failed comparison saved as '%s' and '%s'", imageFilename, referenceFilename); + } + + return ret; +} diff --git a/src/test/SDL_test_crc32.c b/src/test/SDL_test_crc32.c new file mode 100644 index 0000000000..d6685c347b --- /dev/null +++ b/src/test/SDL_test_crc32.c @@ -0,0 +1,165 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + + Used by the test execution component. + Original source code contributed by A. Schiffler for GSOC project. + +*/ + +#include "SDL_config.h" + +#include "SDL_test.h" + + +int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext) +{ + int i,j; + CrcUint32 c; + + /* Sanity check context pointer */ + if (crcContext==NULL) { + return -1; + } + + /* + * Build auxiliary table for parallel byte-at-a-time CRC-32 + */ +#ifdef ORIGINAL_METHOD + for (i = 0; i < 256; ++i) { + for (c = i << 24, j = 8; j > 0; --j) { + c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1); + } + crcContext->crc32_table[i] = c; + } +#else + for (i=0; i<256; i++) { + c = i; + for (j=8; j>0; j--) { + if (c & 1) { + c = (c >> 1) ^ CRC32_POLY; + } else { + c >>= 1; + } + } + crcContext->crc32_table[i] = c; + } +#endif + + return 0; +} + +/* Complete CRC32 calculation on a memory block */ + +int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) +{ + if (SDLTest_Crc32CalcStart(crcContext,crc32)) { + return -1; + } + + if (SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) { + return -1; + } + + if (SDLTest_Crc32CalcEnd(crcContext, crc32)) { + return -1; + } + + return 0; +} + +/* Start crc calculation */ + +int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32) +{ + /* Sanity check pointers */ + if (crcContext==NULL) { + *crc32=0; + return -1; + } + + /* + * Preload shift register, per CRC-32 spec + */ + *crc32 = 0xffffffff; + + return 0; +} + +/* Finish crc calculation */ + +int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32) +{ + /* Sanity check pointers */ + if (crcContext==NULL) { + *crc32=0; + return -1; + } + + /* + * Return complement, per CRC-32 spec + */ + *crc32 = (~(*crc32)); + + return 0; +} + +/* Include memory block in crc */ + +int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) +{ + CrcUint8 *p; + register CrcUint32 crc; + + if (crcContext==NULL) { + *crc32=0; + return -1; + } + + if (inBuf==NULL) { + return -1; + } + + /* + * Calculate CRC from data + */ + crc = *crc32; + for (p = inBuf; inLen > 0; ++p, --inLen) { +#ifdef ORIGINAL_METHOD + crc = (crc << 8) ^ crcContext->crc32_table[(crc >> 24) ^ *p]; +#else + crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->crc32_table[ (crc ^ *p) & 0xFF ]; +#endif + } + *crc32 = crc; + + return 0; +} + +int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext) +{ + if (crcContext==NULL) { + return -1; + } + + return 0; +} diff --git a/src/test/SDL_test_font.c b/src/test/SDL_test_font.c new file mode 100644 index 0000000000..144bcad02a --- /dev/null +++ b/src/test/SDL_test_font.c @@ -0,0 +1,3238 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_test.h" + +/* ---- 8x8 font definition ---- */ + +/* Originally part of SDL2_gfx */ + +/* ZLIB (c) A. Schiffler 2012 */ + +#define SDL_TESTFONTDATAMAX (8*256) + +static unsigned char SDLTest_FontData[SDL_TESTFONTDATAMAX] = { + + /* + * 0 0x00 '^@' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 1 0x01 '^A' + */ + 0x7e, /* 01111110 */ + 0x81, /* 10000001 */ + 0xa5, /* 10100101 */ + 0x81, /* 10000001 */ + 0xbd, /* 10111101 */ + 0x99, /* 10011001 */ + 0x81, /* 10000001 */ + 0x7e, /* 01111110 */ + + /* + * 2 0x02 '^B' + */ + 0x7e, /* 01111110 */ + 0xff, /* 11111111 */ + 0xdb, /* 11011011 */ + 0xff, /* 11111111 */ + 0xc3, /* 11000011 */ + 0xe7, /* 11100111 */ + 0xff, /* 11111111 */ + 0x7e, /* 01111110 */ + + /* + * 3 0x03 '^C' + */ + 0x6c, /* 01101100 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0x7c, /* 01111100 */ + 0x38, /* 00111000 */ + 0x10, /* 00010000 */ + 0x00, /* 00000000 */ + + /* + * 4 0x04 '^D' + */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x7c, /* 01111100 */ + 0xfe, /* 11111110 */ + 0x7c, /* 01111100 */ + 0x38, /* 00111000 */ + 0x10, /* 00010000 */ + 0x00, /* 00000000 */ + + /* + * 5 0x05 '^E' + */ + 0x38, /* 00111000 */ + 0x7c, /* 01111100 */ + 0x38, /* 00111000 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0xd6, /* 11010110 */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + + /* + * 6 0x06 '^F' + */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x7c, /* 01111100 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0x7c, /* 01111100 */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + + /* + * 7 0x07 '^G' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 8 0x08 '^H' + */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xe7, /* 11100111 */ + 0xc3, /* 11000011 */ + 0xc3, /* 11000011 */ + 0xe7, /* 11100111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + + /* + * 9 0x09 '^I' + */ + 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x42, /* 01000010 */ + 0x42, /* 01000010 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 10 0x0a '^J' + */ + 0xff, /* 11111111 */ + 0xc3, /* 11000011 */ + 0x99, /* 10011001 */ + 0xbd, /* 10111101 */ + 0xbd, /* 10111101 */ + 0x99, /* 10011001 */ + 0xc3, /* 11000011 */ + 0xff, /* 11111111 */ + + /* + * 11 0x0b '^K' + */ + 0x0f, /* 00001111 */ + 0x07, /* 00000111 */ + 0x0f, /* 00001111 */ + 0x7d, /* 01111101 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x78, /* 01111000 */ + + /* + * 12 0x0c '^L' + */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + + /* + * 13 0x0d '^M' + */ + 0x3f, /* 00111111 */ + 0x33, /* 00110011 */ + 0x3f, /* 00111111 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x70, /* 01110000 */ + 0xf0, /* 11110000 */ + 0xe0, /* 11100000 */ + + /* + * 14 0x0e '^N' + */ + 0x7f, /* 01111111 */ + 0x63, /* 01100011 */ + 0x7f, /* 01111111 */ + 0x63, /* 01100011 */ + 0x63, /* 01100011 */ + 0x67, /* 01100111 */ + 0xe6, /* 11100110 */ + 0xc0, /* 11000000 */ + + /* + * 15 0x0f '^O' + */ + 0x18, /* 00011000 */ + 0xdb, /* 11011011 */ + 0x3c, /* 00111100 */ + 0xe7, /* 11100111 */ + 0xe7, /* 11100111 */ + 0x3c, /* 00111100 */ + 0xdb, /* 11011011 */ + 0x18, /* 00011000 */ + + /* + * 16 0x10 '^P' + */ + 0x80, /* 10000000 */ + 0xe0, /* 11100000 */ + 0xf8, /* 11111000 */ + 0xfe, /* 11111110 */ + 0xf8, /* 11111000 */ + 0xe0, /* 11100000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* + * 17 0x11 '^Q' + */ + 0x02, /* 00000010 */ + 0x0e, /* 00001110 */ + 0x3e, /* 00111110 */ + 0xfe, /* 11111110 */ + 0x3e, /* 00111110 */ + 0x0e, /* 00001110 */ + 0x02, /* 00000010 */ + 0x00, /* 00000000 */ + + /* + * 18 0x12 '^R' + */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + + /* + * 19 0x13 '^S' + */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + + /* + * 20 0x14 '^T' + */ + 0x7f, /* 01111111 */ + 0xdb, /* 11011011 */ + 0xdb, /* 11011011 */ + 0x7b, /* 01111011 */ + 0x1b, /* 00011011 */ + 0x1b, /* 00011011 */ + 0x1b, /* 00011011 */ + 0x00, /* 00000000 */ + + /* + * 21 0x15 '^U' + */ + 0x3e, /* 00111110 */ + 0x61, /* 01100001 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x86, /* 10000110 */ + 0x7c, /* 01111100 */ + + /* + * 22 0x16 '^V' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x7e, /* 01111110 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* + * 23 0x17 '^W' + */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + + /* + * 24 0x18 '^X' + */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 25 0x19 '^Y' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 26 0x1a '^Z' + */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0xfe, /* 11111110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 27 0x1b '^[' + */ + 0x00, /* 00000000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0xfe, /* 11111110 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 28 0x1c '^\' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 29 0x1d '^]' + */ + 0x00, /* 00000000 */ + 0x24, /* 00100100 */ + 0x66, /* 01100110 */ + 0xff, /* 11111111 */ + 0x66, /* 01100110 */ + 0x24, /* 00100100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 30 0x1e '^^' + */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 31 0x1f '^_' + */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0x7e, /* 01111110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 32 0x20 ' ' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 33 0x21 '!' + */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 34 0x22 '"' + */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x24, /* 00100100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 35 0x23 '#' + */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* + * 36 0x24 '$' + */ + 0x18, /* 00011000 */ + 0x3e, /* 00111110 */ + 0x60, /* 01100000 */ + 0x3c, /* 00111100 */ + 0x06, /* 00000110 */ + 0x7c, /* 01111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 37 0x25 '%' + */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xcc, /* 11001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x66, /* 01100110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 38 0x26 '&' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 39 0x27 ''' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 40 0x28 '(' + */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x00, /* 00000000 */ + + /* + * 41 0x29 ')' + */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* + * 42 0x2a '*' + */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0xff, /* 11111111 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 43 0x2b '+' + */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 44 0x2c ',' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + + /* + * 45 0x2d '-' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 46 0x2e '.' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 47 0x2f '/' + */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + 0x80, /* 10000000 */ + 0x00, /* 00000000 */ + + /* + * 48 0x30 '0' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xd6, /* 11010110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* + * 49 0x31 '1' + */ + 0x18, /* 00011000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* + * 50 0x32 '2' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0x06, /* 00000110 */ + 0x1c, /* 00011100 */ + 0x30, /* 00110000 */ + 0x66, /* 01100110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* + * 51 0x33 '3' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0x06, /* 00000110 */ + 0x3c, /* 00111100 */ + 0x06, /* 00000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 52 0x34 '4' + */ + 0x1c, /* 00011100 */ + 0x3c, /* 00111100 */ + 0x6c, /* 01101100 */ + 0xcc, /* 11001100 */ + 0xfe, /* 11111110 */ + 0x0c, /* 00001100 */ + 0x1e, /* 00011110 */ + 0x00, /* 00000000 */ + + /* + * 53 0x35 '5' + */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xfc, /* 11111100 */ + 0x06, /* 00000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 54 0x36 '6' + */ + 0x38, /* 00111000 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + 0xfc, /* 11111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 55 0x37 '7' + */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + + /* + * 56 0x38 '8' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 57 0x39 '9' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7e, /* 01111110 */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* + * 58 0x3a ':' + */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 59 0x3b ';' + */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + + /* + * 60 0x3c '<' + */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x06, /* 00000110 */ + 0x00, /* 00000000 */ + + /* + * 61 0x3d '=' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 62 0x3e '>' + */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0x00, /* 00000000 */ + + /* + * 63 0x3f '?' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 64 0x40 '@' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xde, /* 11011110 */ + 0xde, /* 11011110 */ + 0xde, /* 11011110 */ + 0xc0, /* 11000000 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* + * 65 0x41 'A' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 66 0x42 'B' + */ + 0xfc, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0xfc, /* 11111100 */ + 0x00, /* 00000000 */ + + /* + * 67 0x43 'C' + */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 68 0x44 'D' + */ + 0xf8, /* 11111000 */ + 0x6c, /* 01101100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x6c, /* 01101100 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + + /* + * 69 0x45 'E' + */ + 0xfe, /* 11111110 */ + 0x62, /* 01100010 */ + 0x68, /* 01101000 */ + 0x78, /* 01111000 */ + 0x68, /* 01101000 */ + 0x62, /* 01100010 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* + * 70 0x46 'F' + */ + 0xfe, /* 11111110 */ + 0x62, /* 01100010 */ + 0x68, /* 01101000 */ + 0x78, /* 01111000 */ + 0x68, /* 01101000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* + * 71 0x47 'G' + */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xce, /* 11001110 */ + 0x66, /* 01100110 */ + 0x3a, /* 00111010 */ + 0x00, /* 00000000 */ + + /* + * 72 0x48 'H' + */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 73 0x49 'I' + */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 74 0x4a 'J' + */ + 0x1e, /* 00011110 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x78, /* 01111000 */ + 0x00, /* 00000000 */ + + /* + * 75 0x4b 'K' + */ + 0xe6, /* 11100110 */ + 0x66, /* 01100110 */ + 0x6c, /* 01101100 */ + 0x78, /* 01111000 */ + 0x6c, /* 01101100 */ + 0x66, /* 01100110 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* + * 76 0x4c 'L' + */ + 0xf0, /* 11110000 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0x62, /* 01100010 */ + 0x66, /* 01100110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* + * 77 0x4d 'M' + */ + 0xc6, /* 11000110 */ + 0xee, /* 11101110 */ + 0xfe, /* 11111110 */ + 0xfe, /* 11111110 */ + 0xd6, /* 11010110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 78 0x4e 'N' + */ + 0xc6, /* 11000110 */ + 0xe6, /* 11100110 */ + 0xf6, /* 11110110 */ + 0xde, /* 11011110 */ + 0xce, /* 11001110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 79 0x4f 'O' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 80 0x50 'P' + */ + 0xfc, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* + * 81 0x51 'Q' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xce, /* 11001110 */ + 0x7c, /* 01111100 */ + 0x0e, /* 00001110 */ + + /* + * 82 0x52 'R' + */ + 0xfc, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x6c, /* 01101100 */ + 0x66, /* 01100110 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* + * 83 0x53 'S' + */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 84 0x54 'T' + */ + 0x7e, /* 01111110 */ + 0x7e, /* 01111110 */ + 0x5a, /* 01011010 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 85 0x55 'U' + */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 86 0x56 'V' + */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* + * 87 0x57 'W' + */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* + * 88 0x58 'X' + */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 89 0x59 'Y' + */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 90 0x5a 'Z' + */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x8c, /* 10001100 */ + 0x18, /* 00011000 */ + 0x32, /* 00110010 */ + 0x66, /* 01100110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* + * 91 0x5b '[' + */ + 0x3c, /* 00111100 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 92 0x5c '\' + */ + 0xc0, /* 11000000 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x06, /* 00000110 */ + 0x02, /* 00000010 */ + 0x00, /* 00000000 */ + + /* + * 93 0x5d ']' + */ + 0x3c, /* 00111100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 94 0x5e '^' + */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 95 0x5f '_' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + + /* + * 96 0x60 '`' + */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 97 0x61 'a' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 98 0x62 'b' + */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0x7c, /* 01111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + + /* + * 99 0x63 'c' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc0, /* 11000000 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 100 0x64 'd' + */ + 0x1c, /* 00011100 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 101 0x65 'e' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 102 0x66 'f' + */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x60, /* 01100000 */ + 0xf8, /* 11111000 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* + * 103 0x67 'g' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x7c, /* 01111100 */ + 0x0c, /* 00001100 */ + 0xf8, /* 11111000 */ + + /* + * 104 0x68 'h' + */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0x6c, /* 01101100 */ + 0x76, /* 01110110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* + * 105 0x69 'i' + */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 106 0x6a 'j' + */ + 0x06, /* 00000110 */ + 0x00, /* 00000000 */ + 0x06, /* 00000110 */ + 0x06, /* 00000110 */ + 0x06, /* 00000110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + + /* + * 107 0x6b 'k' + */ + 0xe0, /* 11100000 */ + 0x60, /* 01100000 */ + 0x66, /* 01100110 */ + 0x6c, /* 01101100 */ + 0x78, /* 01111000 */ + 0x6c, /* 01101100 */ + 0xe6, /* 11100110 */ + 0x00, /* 00000000 */ + + /* + * 108 0x6c 'l' + */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 109 0x6d 'm' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xec, /* 11101100 */ + 0xfe, /* 11111110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0x00, /* 00000000 */ + + /* + * 110 0x6e 'n' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + + /* + * 111 0x6f 'o' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 112 0x70 'p' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + + /* + * 113 0x71 'q' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x7c, /* 01111100 */ + 0x0c, /* 00001100 */ + 0x1e, /* 00011110 */ + + /* + * 114 0x72 'r' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x76, /* 01110110 */ + 0x60, /* 01100000 */ + 0x60, /* 01100000 */ + 0xf0, /* 11110000 */ + 0x00, /* 00000000 */ + + /* + * 115 0x73 's' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x06, /* 00000110 */ + 0xfc, /* 11111100 */ + 0x00, /* 00000000 */ + + /* + * 116 0x74 't' + */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0xfc, /* 11111100 */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x36, /* 00110110 */ + 0x1c, /* 00011100 */ + 0x00, /* 00000000 */ + + /* + * 117 0x75 'u' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 118 0x76 'v' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* + * 119 0x77 'w' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xd6, /* 11010110 */ + 0xd6, /* 11010110 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* + * 120 0x78 'x' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 121 0x79 'y' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7e, /* 01111110 */ + 0x06, /* 00000110 */ + 0xfc, /* 11111100 */ + + /* + * 122 0x7a 'z' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x4c, /* 01001100 */ + 0x18, /* 00011000 */ + 0x32, /* 00110010 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* + * 123 0x7b '{' + */ + 0x0e, /* 00001110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x70, /* 01110000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x0e, /* 00001110 */ + 0x00, /* 00000000 */ + + /* + * 124 0x7c '|' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 125 0x7d '}' + */ + 0x70, /* 01110000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x0e, /* 00001110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* + * 126 0x7e '~' + */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 127 0x7f '' + */ + 0x00, /* 00000000 */ + 0x10, /* 00010000 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* + * 128 0x80 '€' + */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x0c, /* 00001100 */ + 0x78, /* 01111000 */ + + /* + * 129 0x81 '' + */ + 0xcc, /* 11001100 */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 130 0x82 '‚' + */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 131 0x83 'ƒ' + */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 132 0x84 '„' + */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 133 0x85 '…' + */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 134 0x86 '†' + */ + 0x30, /* 00110000 */ + 0x30, /* 00110000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 135 0x87 '‡' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x7e, /* 01111110 */ + 0x0c, /* 00001100 */ + 0x38, /* 00111000 */ + + /* + * 136 0x88 'ˆ' + */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 137 0x89 '‰' + */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 138 0x8a 'Š' + */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 139 0x8b '‹' + */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 140 0x8c 'Œ' + */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 141 0x8d '' + */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 142 0x8e 'Ž' + */ + 0xc6, /* 11000110 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 143 0x8f '' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 144 0x90 '' + */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0xf8, /* 11111000 */ + 0xc0, /* 11000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* + * 145 0x91 '‘' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0xd8, /* 11011000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* + * 146 0x92 '’' + */ + 0x3e, /* 00111110 */ + 0x6c, /* 01101100 */ + 0xcc, /* 11001100 */ + 0xfe, /* 11111110 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xce, /* 11001110 */ + 0x00, /* 00000000 */ + + /* + * 147 0x93 '“' + */ + 0x7c, /* 01111100 */ + 0x82, /* 10000010 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 148 0x94 '”' + */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 149 0x95 '•' + */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 150 0x96 '–' + */ + 0x78, /* 01111000 */ + 0x84, /* 10000100 */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 151 0x97 '—' + */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 152 0x98 '˜' + */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7e, /* 01111110 */ + 0x06, /* 00000110 */ + 0xfc, /* 11111100 */ + + /* + * 153 0x99 '™' + */ + 0xc6, /* 11000110 */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* + * 154 0x9a 'š' + */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 155 0x9b '›' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 156 0x9c 'œ' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x64, /* 01100100 */ + 0xf0, /* 11110000 */ + 0x60, /* 01100000 */ + 0x66, /* 01100110 */ + 0xfc, /* 11111100 */ + 0x00, /* 00000000 */ + + /* + * 157 0x9d '' + */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 158 0x9e 'ž' + */ + 0xf8, /* 11111000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xfa, /* 11111010 */ + 0xc6, /* 11000110 */ + 0xcf, /* 11001111 */ + 0xc6, /* 11000110 */ + 0xc7, /* 11000111 */ + + /* + * 159 0x9f 'Ÿ' + */ + 0x0e, /* 00001110 */ + 0x1b, /* 00011011 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0xd8, /* 11011000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* + * 160 0xa0 ' ' + */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x7c, /* 01111100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 161 0xa1 '¡' + */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x38, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 162 0xa2 '¢' + */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + + /* + * 163 0xa3 '£' + */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 164 0xa4 '¤' + */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0xdc, /* 11011100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + + /* + * 165 0xa5 '¥' + */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0xe6, /* 11100110 */ + 0xf6, /* 11110110 */ + 0xde, /* 11011110 */ + 0xce, /* 11001110 */ + 0x00, /* 00000000 */ + + /* + * 166 0xa6 '¦' + */ + 0x3c, /* 00111100 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x3e, /* 00111110 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 167 0xa7 '§' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 168 0xa8 '¨' + */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x63, /* 01100011 */ + 0x3e, /* 00111110 */ + 0x00, /* 00000000 */ + + /* + * 169 0xa9 '©' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 170 0xaa 'ª' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x06, /* 00000110 */ + 0x06, /* 00000110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 171 0xab '«' + */ + 0x63, /* 01100011 */ + 0xe6, /* 11100110 */ + 0x6c, /* 01101100 */ + 0x7e, /* 01111110 */ + 0x33, /* 00110011 */ + 0x66, /* 01100110 */ + 0xcc, /* 11001100 */ + 0x0f, /* 00001111 */ + + /* + * 172 0xac '¬' + */ + 0x63, /* 01100011 */ + 0xe6, /* 11100110 */ + 0x6c, /* 01101100 */ + 0x7a, /* 01111010 */ + 0x36, /* 00110110 */ + 0x6a, /* 01101010 */ + 0xdf, /* 11011111 */ + 0x06, /* 00000110 */ + + /* + * 173 0xad '­' + */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 174 0xae '®' + */ + 0x00, /* 00000000 */ + 0x33, /* 00110011 */ + 0x66, /* 01100110 */ + 0xcc, /* 11001100 */ + 0x66, /* 01100110 */ + 0x33, /* 00110011 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 175 0xaf '¯' + */ + 0x00, /* 00000000 */ + 0xcc, /* 11001100 */ + 0x66, /* 01100110 */ + 0x33, /* 00110011 */ + 0x66, /* 01100110 */ + 0xcc, /* 11001100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 176 0xb0 '°' + */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + 0x22, /* 00100010 */ + 0x88, /* 10001000 */ + + /* + * 177 0xb1 '±' + */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + 0x55, /* 01010101 */ + 0xaa, /* 10101010 */ + + /* + * 178 0xb2 '²' + */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + 0x77, /* 01110111 */ + 0xdd, /* 11011101 */ + + /* + * 179 0xb3 '³' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 180 0xb4 '´' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 181 0xb5 'µ' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 182 0xb6 '¶' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf6, /* 11110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 183 0xb7 '·' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 184 0xb8 '¸' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 185 0xb9 '¹' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf6, /* 11110110 */ + 0x06, /* 00000110 */ + 0xf6, /* 11110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 186 0xba 'º' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 187 0xbb '»' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x06, /* 00000110 */ + 0xf6, /* 11110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 188 0xbc '¼' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf6, /* 11110110 */ + 0x06, /* 00000110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 189 0xbd '½' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 190 0xbe '¾' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 191 0xbf '¿' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xf8, /* 11111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 192 0xc0 'À' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 193 0xc1 'Á' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 194 0xc2 'Â' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 195 0xc3 'Ã' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 196 0xc4 'Ä' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 197 0xc5 'Å' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 198 0xc6 'Æ' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 199 0xc7 'Ç' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x37, /* 00110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 200 0xc8 'È' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x37, /* 00110111 */ + 0x30, /* 00110000 */ + 0x3f, /* 00111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 201 0xc9 'É' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 00111111 */ + 0x30, /* 00110000 */ + 0x37, /* 00110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 202 0xca 'Ê' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf7, /* 11110111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 203 0xcb 'Ë' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xf7, /* 11110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 204 0xcc 'Ì' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x37, /* 00110111 */ + 0x30, /* 00110000 */ + 0x37, /* 00110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 205 0xcd 'Í' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 206 0xce 'Î' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xf7, /* 11110111 */ + 0x00, /* 00000000 */ + 0xf7, /* 11110111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 207 0xcf 'Ï' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 208 0xd0 'Ð' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 209 0xd1 'Ñ' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 210 0xd2 'Ò' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 211 0xd3 'Ó' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x3f, /* 00111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 212 0xd4 'Ô' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 213 0xd5 'Õ' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 214 0xd6 'Ö' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 00111111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 215 0xd7 '×' + */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0xff, /* 11111111 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + + /* + * 216 0xd8 'Ø' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0xff, /* 11111111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 217 0xd9 'Ù' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xf8, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 218 0xda 'Ú' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1f, /* 00011111 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 219 0xdb 'Û' + */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + + /* + * 220 0xdc 'Ü' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + + /* + * 221 0xdd 'Ý' + */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + 0xf0, /* 11110000 */ + + /* + * 222 0xde 'Þ' + */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + 0x0f, /* 00001111 */ + + /* + * 223 0xdf 'ß' + */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 224 0xe0 'à' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0xc8, /* 11001000 */ + 0xdc, /* 11011100 */ + 0x76, /* 01110110 */ + 0x00, /* 00000000 */ + + /* + * 225 0xe1 'á' + */ + 0x78, /* 01111000 */ + 0xcc, /* 11001100 */ + 0xcc, /* 11001100 */ + 0xd8, /* 11011000 */ + 0xcc, /* 11001100 */ + 0xc6, /* 11000110 */ + 0xcc, /* 11001100 */ + 0x00, /* 00000000 */ + + /* + * 226 0xe2 'â' + */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0xc0, /* 11000000 */ + 0x00, /* 00000000 */ + + /* + * 227 0xe3 'ã' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x00, /* 00000000 */ + + /* + * 228 0xe4 'ä' + */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + + /* + * 229 0xe5 'å' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xd8, /* 11011000 */ + 0xd8, /* 11011000 */ + 0xd8, /* 11011000 */ + 0x70, /* 01110000 */ + 0x00, /* 00000000 */ + + /* + * 230 0xe6 'æ' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x7c, /* 01111100 */ + 0xc0, /* 11000000 */ + + /* + * 231 0xe7 'ç' + */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + + /* + * 232 0xe8 'è' + */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + + /* + * 233 0xe9 'é' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xfe, /* 11111110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + + /* + * 234 0xea 'ê' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0xee, /* 11101110 */ + 0x00, /* 00000000 */ + + /* + * 235 0xeb 'ë' + */ + 0x0e, /* 00001110 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x3e, /* 00111110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + + /* + * 236 0xec 'ì' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xdb, /* 11011011 */ + 0xdb, /* 11011011 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 237 0xed 'í' + */ + 0x06, /* 00000110 */ + 0x0c, /* 00001100 */ + 0x7e, /* 01111110 */ + 0xdb, /* 11011011 */ + 0xdb, /* 11011011 */ + 0x7e, /* 01111110 */ + 0x60, /* 01100000 */ + 0xc0, /* 11000000 */ + + /* + * 238 0xee 'î' + */ + 0x1e, /* 00011110 */ + 0x30, /* 00110000 */ + 0x60, /* 01100000 */ + 0x7e, /* 01111110 */ + 0x60, /* 01100000 */ + 0x30, /* 00110000 */ + 0x1e, /* 00011110 */ + 0x00, /* 00000000 */ + + /* + * 239 0xef 'ï' + */ + 0x00, /* 00000000 */ + 0x7c, /* 01111100 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0xc6, /* 11000110 */ + 0x00, /* 00000000 */ + + /* + * 240 0xf0 'ð' + */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0xfe, /* 11111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 241 0xf1 'ñ' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* + * 242 0xf2 'ò' + */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* + * 243 0xf3 'ó' + */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00001100 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + + /* + * 244 0xf4 'ô' + */ + 0x0e, /* 00001110 */ + 0x1b, /* 00011011 */ + 0x1b, /* 00011011 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + + /* + * 245 0xf5 'õ' + */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0xd8, /* 11011000 */ + 0xd8, /* 11011000 */ + 0x70, /* 01110000 */ + + /* + * 246 0xf6 'ö' + */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 247 0xf7 '÷' + */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0x76, /* 01110110 */ + 0xdc, /* 11011100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 248 0xf8 'ø' + */ + 0x38, /* 00111000 */ + 0x6c, /* 01101100 */ + 0x6c, /* 01101100 */ + 0x38, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 249 0xf9 'ù' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 250 0xfa 'ú' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 251 0xfb 'û' + */ + 0x0f, /* 00001111 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0x0c, /* 00001100 */ + 0xec, /* 11101100 */ + 0x6c, /* 01101100 */ + 0x3c, /* 00111100 */ + 0x1c, /* 00011100 */ + + /* + * 252 0xfc 'ü' + */ + 0x6c, /* 01101100 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x36, /* 00110110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 253 0xfd 'ý' + */ + 0x78, /* 01111000 */ + 0x0c, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00110000 */ + 0x7c, /* 01111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 254 0xfe 'þ' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + + /* + * 255 0xff ' ' + */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + +}; + + +/* ---- Character */ + +/*! +\brief Global cache for 8x8 pixel font textures created at runtime. +*/ +static SDL_Texture *SDLTest_CharTextureCache[256]; + +int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c) +{ + const Uint32 charWidth = 8; + const Uint32 charHeight = 8; + const Uint32 charSize = 8; + SDL_Rect srect; + SDL_Rect drect; + int result; + Uint32 ix, iy; + const unsigned char *charpos; + Uint8 *curpos; + Uint8 patt, mask; + Uint8 *linepos; + Uint32 pitch; + SDL_Surface *character; + Uint32 ci; + Uint8 r, g, b, a; + + /* + * Setup source rectangle + */ + srect.x = 0; + srect.y = 0; + srect.w = charWidth; + srect.h = charHeight; + + /* + * Setup destination rectangle + */ + drect.x = x; + drect.y = y; + drect.w = charWidth; + drect.h = charHeight; + + /* Character index in cache */ + ci = (unsigned char)c; + + /* + * Create new charWidth x charHeight bitmap surface if not already present. + */ + if (SDLTest_CharTextureCache[ci] == NULL) { + /* + * Redraw character into surface + */ + character = SDL_CreateRGBSurface(SDL_SWSURFACE, + charWidth, charHeight, 32, + 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); + if (character == NULL) { + return (-1); + } + + charpos = SDLTest_FontData + ci * charSize; + linepos = (Uint8 *)character->pixels; + pitch = character->pitch; + + /* + * Drawing loop + */ + patt = 0; + for (iy = 0; iy < charWidth; iy++) { + mask = 0x00; + curpos = linepos; + for (ix = 0; ix < charWidth; ix++) { + if (!(mask >>= 1)) { + patt = *charpos++; + mask = 0x80; + } + if (patt & mask) { + *(Uint32 *)curpos = 0xffffffff; + } else { + *(Uint32 *)curpos = 0; + } + curpos += 4; + } + linepos += pitch; + } + + /* Convert temp surface into texture */ + SDLTest_CharTextureCache[ci] = SDL_CreateTextureFromSurface(renderer, character); + SDL_FreeSurface(character); + + /* + * Check pointer + */ + if (SDLTest_CharTextureCache[ci] == NULL) { + return (-1); + } + } + + /* + * Set color + */ + result = 0; + result |= SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a); + result |= SDL_SetTextureColorMod(SDLTest_CharTextureCache[ci], r, g, b); + result |= SDL_SetTextureAlphaMod(SDLTest_CharTextureCache[ci], a); + + /* + * Draw texture onto destination + */ + result |= SDL_RenderCopy(renderer, SDLTest_CharTextureCache[ci], &srect, &drect); + + return (result); +} + +int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s) +{ + const Uint32 charWidth = 8; + int result = 0; + int curx = x; + int cury = y; + const char *curchar = s; + + while (*curchar && !result) { + result |= SDLTest_DrawCharacter(renderer, curx, cury, *curchar); + curx += charWidth; + curchar++; + } + + return (result); +} + diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c new file mode 100644 index 0000000000..8a27fd0117 --- /dev/null +++ b/src/test/SDL_test_fuzzer.c @@ -0,0 +1,524 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + + Data generators for fuzzing test data in a reproducible way. + +*/ + +#include "SDL_config.h" + +/* Visual Studio 2008 doesn't have stdint.h */ +#if defined(_MSC_VER) && _MSC_VER <= 1500 +#define UINT8_MAX ~(Uint8)0 +#define UINT16_MAX ~(Uint16)0 +#define UINT32_MAX ~(Uint32)0 +#define UINT64_MAX ~(Uint64)0 +#else +#include +#endif +#include +#include +#include +#include + +#include "SDL_test.h" + +/** + * Counter for fuzzer invocations + */ +static int fuzzerInvocationCounter = 0; + +/** + * Context for shared random number generator + */ +static SDLTest_RandomContext rndContext; + +/* + * Note: doxygen documentation markup for functions is in the header file. + */ + +void +SDLTest_FuzzerInit(Uint64 execKey) +{ + Uint32 a = (execKey >> 32) & 0x00000000FFFFFFFF; + Uint32 b = execKey & 0x00000000FFFFFFFF; + SDL_memset((void *)&rndContext, 0, sizeof(SDLTest_RandomContext)); + SDLTest_RandomInit(&rndContext, a, b); + fuzzerInvocationCounter = 0; +} + +int +SDLTest_GetFuzzerInvocationCount() +{ + return fuzzerInvocationCounter; +} + +Uint8 +SDLTest_RandomUint8() +{ + fuzzerInvocationCounter++; + + return (Uint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; +} + +Sint8 +SDLTest_RandomSint8() +{ + fuzzerInvocationCounter++; + + return (Sint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; +} + +Uint16 +SDLTest_RandomUint16() +{ + fuzzerInvocationCounter++; + + return (Uint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; +} + +Sint16 +SDLTest_RandomSint16() +{ + fuzzerInvocationCounter++; + + return (Sint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; +} + +Sint32 +SDLTest_RandomSint32() +{ + fuzzerInvocationCounter++; + + return (Sint32) SDLTest_RandomInt(&rndContext); +} + +Uint32 +SDLTest_RandomUint32() +{ + fuzzerInvocationCounter++; + + return (Uint32) SDLTest_RandomInt(&rndContext); +} + +Uint64 +SDLTest_RandomUint64() +{ + Uint64 value = 0; + Uint32 *vp = (void *)&value; + + fuzzerInvocationCounter++; + + vp[0] = SDLTest_RandomSint32(); + vp[1] = SDLTest_RandomSint32(); + + return value; +} + +Sint64 +SDLTest_RandomSint64() +{ + Uint64 value = 0; + Uint32 *vp = (void *)&value; + + fuzzerInvocationCounter++; + + vp[0] = SDLTest_RandomSint32(); + vp[1] = SDLTest_RandomSint32(); + + return value; +} + + + +Sint32 +SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) +{ + Sint64 min = pMin; + Sint64 max = pMax; + Sint64 temp; + Sint64 number; + + if(pMin > pMax) { + temp = min; + min = max; + max = temp; + } else if(pMin == pMax) { + return (Sint32)min; + } + + number = SDLTest_RandomUint32(); + /* invocation count increment in preceeding call */ + + return (Sint32)((number % ((max + 1) - min)) + min); +} + +/*! + * Generates a unsigned boundary value between the given boundaries. + * Boundary values are inclusive. See the examples below. + * If boundary2 < boundary1, the values are swapped. + * If boundary1 == boundary2, value of boundary1 will be returned + * + * Generating boundary values for Uint8: + * BoundaryValues(UINT8_MAX, 10, 20, True) -> [10,11,19,20] + * BoundaryValues(UINT8_MAX, 10, 20, False) -> [9,21] + * BoundaryValues(UINT8_MAX, 0, 15, True) -> [0, 1, 14, 15] + * BoundaryValues(UINT8_MAX, 0, 15, False) -> [16] + * BoundaryValues(UINT8_MAX, 0, 0xFF, False) -> [0], error set + * + * Generator works the same for other types of unsigned integers. + * + * \param maxValue The biggest value that is acceptable for this data type. + * For instance, for Uint8 -> 255, Uint16 -> 65536 etc. + * \param boundary1 defines lower boundary + * \param boundary2 defines upper boundary + * \param validDomain Generate only for valid domain (for the data type) + * + * \returns Returns a random boundary value for the domain or 0 in case of error + */ +Uint64 +SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) +{ + Uint64 b1, b2; + Uint64 delta; + Uint64 tempBuf[4]; + Uint8 index; + + /* Maybe swap */ + if (boundary1 > boundary2) { + b1 = boundary2; + b2 = boundary1; + } else { + b1 = boundary1; + b2 = boundary2; + } + + index = 0; + if (validDomain == SDL_TRUE) { + if (b1 == b2) { + return b1; + } + + /* Generate up to 4 values within bounds */ + delta = b2 - b1; + if (delta < 4) { + do { + tempBuf[index] = b1 + index; + index++; + } while (index < delta); + } else { + tempBuf[index] = b1; + index++; + tempBuf[index] = b1 + 1; + index++; + tempBuf[index] = b2 - 1; + index++; + tempBuf[index] = b2; + index++; + } + } else { + /* Generate up to 2 values outside of bounds */ + if (b1 > 0) { + tempBuf[index] = b1 - 1; + index++; + } + + if (b2 < maxValue) { + tempBuf[index] = b2 + 1; + index++; + } + } + + if (index == 0) { + /* There are no valid boundaries */ + SDL_Unsupported(); + return 0; + } + + return tempBuf[SDLTest_RandomUint8() % index]; +} + + +Uint8 +SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain) +{ + /* max value for Uint8 */ + const Uint64 maxValue = UCHAR_MAX; + return (Uint8)SDLTest_GenerateUnsignedBoundaryValues(maxValue, + (Uint64) boundary1, (Uint64) boundary2, + validDomain); +} + +Uint16 +SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain) +{ + /* max value for Uint16 */ + const Uint64 maxValue = USHRT_MAX; + return (Uint16)SDLTest_GenerateUnsignedBoundaryValues(maxValue, + (Uint64) boundary1, (Uint64) boundary2, + validDomain); +} + +Uint32 +SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain) +{ + /* max value for Uint32 */ + #if ((ULONG_MAX) == (UINT_MAX)) + const Uint64 maxValue = ULONG_MAX; + #else + const Uint64 maxValue = UINT_MAX; + #endif + return (Uint32)SDLTest_GenerateUnsignedBoundaryValues(maxValue, + (Uint64) boundary1, (Uint64) boundary2, + validDomain); +} + +Uint64 +SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) +{ + /* max value for Uint64 */ + const Uint64 maxValue = ULLONG_MAX; + return SDLTest_GenerateUnsignedBoundaryValues(maxValue, + (Uint64) boundary1, (Uint64) boundary2, + validDomain); +} + +/*! + * Generates a signed boundary value between the given boundaries. + * Boundary values are inclusive. See the examples below. + * If boundary2 < boundary1, the values are swapped. + * If boundary1 == boundary2, value of boundary1 will be returned + * + * Generating boundary values for Sint8: + * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -10, 20, True) -> [-10,-9,19,20] + * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -10, 20, False) -> [-11,21] + * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -30, -15, True) -> [-30, -29, -16, -15] + * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -127, 15, False) -> [16] + * SignedBoundaryValues(SCHAR_MIN, SCHAR_MAX, -127, 127, False) -> [0], error set + * + * Generator works the same for other types of signed integers. + * + * \param minValue The smallest value that is acceptable for this data type. + * For instance, for Uint8 -> -127, etc. + * \param maxValue The biggest value that is acceptable for this data type. + * For instance, for Uint8 -> 127, etc. + * \param boundary1 defines lower boundary + * \param boundary2 defines upper boundary + * \param validDomain Generate only for valid domain (for the data type) + * + * \returns Returns a random boundary value for the domain or 0 in case of error + */ +Sint64 +SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) +{ + Sint64 b1, b2; + Sint64 delta; + Sint64 tempBuf[4]; + Uint8 index; + + /* Maybe swap */ + if (boundary1 > boundary2) { + b1 = boundary2; + b2 = boundary1; + } else { + b1 = boundary1; + b2 = boundary2; + } + + index = 0; + if (validDomain == SDL_TRUE) { + if (b1 == b2) { + return b1; + } + + /* Generate up to 4 values within bounds */ + delta = b2 - b1; + if (delta < 4) { + do { + tempBuf[index] = b1 + index; + index++; + } while (index < delta); + } else { + tempBuf[index] = b1; + index++; + tempBuf[index] = b1 + 1; + index++; + tempBuf[index] = b2 - 1; + index++; + tempBuf[index] = b2; + index++; + } + } else { + /* Generate up to 2 values outside of bounds */ + if (b1 > minValue) { + tempBuf[index] = b1 - 1; + index++; + } + + if (b2 < maxValue) { + tempBuf[index] = b2 + 1; + index++; + } + } + + if (index == 0) { + /* There are no valid boundaries */ + SDL_Unsupported(); + return minValue; + } + + return tempBuf[SDLTest_RandomUint8() % index]; +} + + +Sint8 +SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain) +{ + /* min & max values for Sint8 */ + const Sint64 maxValue = SCHAR_MAX; + const Sint64 minValue = SCHAR_MIN; + return (Sint8)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, + (Sint64) boundary1, (Sint64) boundary2, + validDomain); +} + +Sint16 +SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain) +{ + /* min & max values for Sint16 */ + const Sint64 maxValue = SHRT_MAX; + const Sint64 minValue = SHRT_MIN; + return (Sint16)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, + (Sint64) boundary1, (Sint64) boundary2, + validDomain); +} + +Sint32 +SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain) +{ + /* min & max values for Sint32 */ + #if ((ULONG_MAX) == (UINT_MAX)) + const Sint64 maxValue = LONG_MAX; + const Sint64 minValue = LONG_MIN; + #else + const Sint64 maxValue = INT_MAX; + const Sint64 minValue = INT_MIN; + #endif + return (Sint32)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, + (Sint64) boundary1, (Sint64) boundary2, + validDomain); +} + +Sint64 +SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) +{ + /* min & max values for Sint64 */ + const Sint64 maxValue = LLONG_MAX; + const Sint64 minValue = LLONG_MIN; + return SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, + boundary1, boundary2, + validDomain); +} + +float +SDLTest_RandomUnitFloat() +{ + return (float) SDLTest_RandomUint32() / UINT_MAX; +} + +float +SDLTest_RandomFloat() +{ + return (float) (SDLTest_RandomUnitDouble() * (double)2.0 * (double)FLT_MAX - (double)(FLT_MAX)); +} + +double +SDLTest_RandomUnitDouble() +{ + return (double) (SDLTest_RandomUint64() >> 11) * (1.0/9007199254740992.0); +} + +double +SDLTest_RandomDouble() +{ + double r = 0.0; + double s = 1.0; + do { + s /= UINT_MAX + 1.0; + r += (double)SDLTest_RandomInt(&rndContext) * s; + } while (s > DBL_EPSILON); + + fuzzerInvocationCounter++; + + return r; +} + + +char * +SDLTest_RandomAsciiString() +{ + return SDLTest_RandomAsciiStringWithMaximumLength(255); +} + +char * +SDLTest_RandomAsciiStringWithMaximumLength(int maxLength) +{ + int size; + + if(maxLength < 1) { + SDL_InvalidParamError("maxLength"); + return NULL; + } + + size = (SDLTest_RandomUint32() % (maxLength + 1)); + + return SDLTest_RandomAsciiStringOfSize(size); +} + +char * +SDLTest_RandomAsciiStringOfSize(int size) +{ + char *string; + int counter; + + + if(size < 1) { + SDL_InvalidParamError("size"); + return NULL; + } + + string = (char *)SDL_malloc((size + 1) * sizeof(char)); + if (string==NULL) { + return NULL; + } + + for(counter = 0; counter < size; ++counter) { + string[counter] = (char)SDLTest_RandomIntegerInRange(32, 126); + } + + string[counter] = '\0'; + + fuzzerInvocationCounter++; + + return string; +} diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c new file mode 100644 index 0000000000..291874566f --- /dev/null +++ b/src/test/SDL_test_harness.c @@ -0,0 +1,635 @@ +/* +Simple DirectMedia Layer +Copyright (C) 1997-2013 Sam Lantinga + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not +claim that you wrote the original software. If you use this software +in a product, an acknowledgment in the product documentation would be +appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be +misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" + +#include "SDL_test.h" + +#include +#include +#include +#include + +/* Invalid test name/description message format */ +const char *SDLTest_InvalidNameFormat = "(Invalid)"; + +/* Log summary message format */ +const char *SDLTest_LogSummaryFormat = "%s Summary: Total=%d Passed=%d Failed=%d Skipped=%d"; + +/* Final result message format */ +const char *SDLTest_FinalResultFormat = ">>> %s '%s': %s\n"; + +/*! \brief Timeout for single test case execution */ +static Uint32 SDLTest_TestCaseTimeout = 3600; + +/** +* Generates a random run seed string for the harness. The generated seed +* will contain alphanumeric characters (0-9A-Z). +* +* Note: The returned string needs to be deallocated by the caller. +* +* \param length The length of the seed string to generate +* +* \returns The generated seed string +*/ +char * +SDLTest_GenerateRunSeed(const int length) +{ + char *seed = NULL; + SDLTest_RandomContext randomContext; + int counter; + + /* Sanity check input */ + if (length <= 0) { + SDLTest_LogError("The length of the harness seed must be >0."); + return NULL; + } + + /* Allocate output buffer */ + seed = (char *)SDL_malloc((length + 1) * sizeof(char)); + if (seed == NULL) { + SDLTest_LogError("SDL_malloc for run seed output buffer failed."); + return NULL; + } + + /* Generate a random string of alphanumeric characters */ + SDLTest_RandomInitTime(&randomContext); + for (counter = 0; counter < length - 1; ++counter) { + unsigned int number = SDLTest_Random(&randomContext); + char ch = (char) (number % (91 - 48)) + 48; + if (ch >= 58 && ch <= 64) { + ch = 65; + } + seed[counter] = ch; + } + seed[counter] = '\0'; + + return seed; +} + +/** +* Generates an execution key for the fuzzer. +* +* \param runSeed The run seed to use +* \param suiteName The name of the test suite +* \param testName The name of the test +* \param iteration The iteration count +* +* \returns The generated execution key to initialize the fuzzer with. +* +*/ +Uint64 +SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iteration) +{ + SDLTest_Md5Context md5Context; + Uint64 *keys; + char iterationString[16]; + Uint32 runSeedLength; + Uint32 suiteNameLength; + Uint32 testNameLength; + Uint32 iterationStringLength; + Uint32 entireStringLength; + char *buffer; + + if (runSeed == NULL || SDL_strlen(runSeed)==0) { + SDLTest_LogError("Invalid runSeed string."); + return -1; + } + + if (suiteName == NULL || SDL_strlen(suiteName)==0) { + SDLTest_LogError("Invalid suiteName string."); + return -1; + } + + if (testName == NULL || SDL_strlen(testName)==0) { + SDLTest_LogError("Invalid testName string."); + return -1; + } + + if (iteration <= 0) { + SDLTest_LogError("Invalid iteration count."); + return -1; + } + + /* Convert iteration number into a string */ + SDL_memset(iterationString, 0, sizeof(iterationString)); + SDL_snprintf(iterationString, sizeof(iterationString) - 1, "%d", iteration); + + /* Combine the parameters into single string */ + runSeedLength = SDL_strlen(runSeed); + suiteNameLength = SDL_strlen(suiteName); + testNameLength = SDL_strlen(testName); + iterationStringLength = SDL_strlen(iterationString); + entireStringLength = runSeedLength + suiteNameLength + testNameLength + iterationStringLength + 1; + buffer = (char *)SDL_malloc(entireStringLength); + if (buffer == NULL) { + SDLTest_LogError("SDL_malloc failed to allocate buffer for execKey generation."); + return 0; + } + SDL_snprintf(buffer, entireStringLength, "%s%s%s%d", runSeed, suiteName, testName, iteration); + + /* Hash string and use half of the digest as 64bit exec key */ + SDLTest_Md5Init(&md5Context); + SDLTest_Md5Update(&md5Context, (unsigned char *)buffer, entireStringLength); + SDLTest_Md5Final(&md5Context); + SDL_free(buffer); + keys = (Uint64 *)md5Context.digest; + + return keys[0]; +} + +/** +* \brief Set timeout handler for test. +* +* Note: SDL_Init(SDL_INIT_TIMER) will be called if it wasn't done so before. +* +* \param timeout Timeout interval in seconds. +* \param callback Function that will be called after timeout has elapsed. +* +* \return Timer id or -1 on failure. +*/ +SDL_TimerID +SDLTest_SetTestTimeout(int timeout, void (*callback)()) +{ + Uint32 timeoutInMilliseconds; + SDL_TimerID timerID; + + if (callback == NULL) { + SDLTest_LogError("Timeout callback can't be NULL"); + return -1; + } + + if (timeout < 0) { + SDLTest_LogError("Timeout value must be bigger than zero."); + return -1; + } + + /* Init SDL timer if not initialized before */ + if (SDL_WasInit(SDL_INIT_TIMER) == 0) { + if (SDL_InitSubSystem(SDL_INIT_TIMER)) { + SDLTest_LogError("Failed to init timer subsystem: %s", SDL_GetError()); + return -1; + } + } + + /* Set timer */ + timeoutInMilliseconds = timeout * 1000; + timerID = SDL_AddTimer(timeoutInMilliseconds, (SDL_TimerCallback)callback, 0x0); + if (timerID == 0) { + SDLTest_LogError("Creation of SDL timer failed: %s", SDL_GetError()); + return -1; + } + + return timerID; +} + +/** +* \brief Timeout handler. Aborts test run and exits harness process. +*/ +void + SDLTest_BailOut() +{ + SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run."); + exit(TEST_ABORTED); /* bail out from the test */ +} + +/** +* \brief Execute a test using the given execution key. +* +* \param testSuite Suite containing the test case. +* \param testCase Case to execute. +* \param execKey Execution key for the fuzzer. +* +* \returns Test case result. +*/ +int +SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey) +{ + SDL_TimerID timer = 0; + int testCaseResult = 0; + int testResult = 0; + int fuzzerCount; + + if (testSuite==NULL || testCase==NULL || testSuite->name==NULL || testCase->name==NULL) + { + SDLTest_LogError("Setup failure: testSuite or testCase references NULL"); + return TEST_RESULT_SETUP_FAILURE; + } + + if (!testCase->enabled) + { + SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)"); + return TEST_RESULT_SKIPPED; + } + + + /* Initialize fuzzer */ + SDLTest_FuzzerInit(execKey); + + /* Reset assert tracker */ + SDLTest_ResetAssertSummary(); + + /* Set timeout timer */ + timer = SDLTest_SetTestTimeout(SDLTest_TestCaseTimeout, SDLTest_BailOut); + + /* Maybe run suite initalizer function */ + if (testSuite->testSetUp) { + testSuite->testSetUp(0x0); + if (SDLTest_AssertSummaryToTestResult() == TEST_RESULT_FAILED) { + SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite Setup", testSuite->name, "Failed"); + return TEST_RESULT_SETUP_FAILURE; + } + } + + /* Run test case function */ + testCaseResult = testCase->testCase(0x0); + + /* Convert test execution result into harness result */ + if (testCaseResult == TEST_SKIPPED) { + /* Test was programatically skipped */ + testResult = TEST_RESULT_SKIPPED; + } else if (testCaseResult == TEST_STARTED) { + /* Test did not return a TEST_COMPLETED value; assume it failed */ + testResult = TEST_RESULT_FAILED; + } else if (testCaseResult == TEST_ABORTED) { + /* Test was aborted early; assume it failed */ + testResult = TEST_RESULT_FAILED; + } else { + /* Perform failure analysis based on asserts */ + testResult = SDLTest_AssertSummaryToTestResult(); + } + + /* Maybe run suite cleanup function (ignore failed asserts) */ + if (testSuite->testTearDown) { + testSuite->testTearDown(0x0); + } + + /* Cancel timeout timer */ + if (timer) { + SDL_RemoveTimer(timer); + } + + /* Report on asserts and fuzzer usage */ + fuzzerCount = SDLTest_GetFuzzerInvocationCount(); + if (fuzzerCount > 0) { + SDLTest_Log("Fuzzer invocations: %d", fuzzerCount); + } + + /* Final log based on test execution result */ + if (testCaseResult == TEST_SKIPPED) { + /* Test was programatically skipped */ + SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Programmatically)"); + } else if (testCaseResult == TEST_STARTED) { + /* Test did not return a TEST_COMPLETED value; assume it failed */ + SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (test started, but did not return TEST_COMPLETED)"); + } else if (testCaseResult == TEST_ABORTED) { + /* Test was aborted early; assume it failed */ + SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (Aborted)"); + } else { + SDLTest_LogAssertSummary(); + } + + return testResult; +} + +/* Prints summary of all suites/tests contained in the given reference */ +void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites) +{ + int suiteCounter; + int testCounter; + SDLTest_TestSuiteReference *testSuite; + SDLTest_TestCaseReference *testCase; + + /* Loop over all suites */ + suiteCounter = 0; + while(&testSuites[suiteCounter]) { + testSuite=&testSuites[suiteCounter]; + suiteCounter++; + SDLTest_Log("Test Suite %i - %s\n", suiteCounter, + (testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat); + + /* Loop over all test cases */ + testCounter = 0; + while(testSuite->testCases[testCounter]) + { + testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter]; + testCounter++; + SDLTest_Log(" Test Case %i - %s: %s", testCounter, + (testCase->name) ? testCase->name : SDLTest_InvalidNameFormat, + (testCase->description) ? testCase->description : SDLTest_InvalidNameFormat); + } + } +} + +/* Gets a timer value in seconds */ +float GetClock() +{ + float currentClock = (float)clock(); + return currentClock / (float)CLOCKS_PER_SEC; +} + +/** +* \brief Execute a test suite using the given run seend and execution key. +* +* The filter string is matched to the suite name (full comparison) to select a single suite, +* or if no suite matches, it is matched to the test names (full comparison) to select a single test. +* +* \param testSuites Suites containing the test case. +* \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. +* \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. +* \param filter Filter specification. NULL disables. Case sensitive. +* \param testIterations Number of iterations to run each test case. +* +* \returns Test run result; 0 when all tests passed, 1 if any tests failed. +*/ +int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations) +{ + int suiteCounter; + int testCounter; + int iterationCounter; + SDLTest_TestSuiteReference *testSuite; + SDLTest_TestCaseReference *testCase; + const char *runSeed = NULL; + char *currentSuiteName; + char *currentTestName; + Uint64 execKey; + float runStartSeconds; + float suiteStartSeconds; + float testStartSeconds; + float runEndSeconds; + float suiteEndSeconds; + float testEndSeconds; + float runtime; + int suiteFilter = 0; + char *suiteFilterName = NULL; + int testFilter = 0; + char *testFilterName = NULL; + int testResult = 0; + int runResult = 0; + Uint32 totalTestFailedCount = 0; + Uint32 totalTestPassedCount = 0; + Uint32 totalTestSkippedCount = 0; + Uint32 testFailedCount = 0; + Uint32 testPassedCount = 0; + Uint32 testSkippedCount = 0; + Uint32 countSum = 0; + char *logFormat = (char *)SDLTest_LogSummaryFormat; + + /* Sanitize test iterations */ + if (testIterations < 1) { + testIterations = 1; + } + + /* Generate run see if we don't have one already */ + if (userRunSeed == NULL || SDL_strlen(userRunSeed) == 0) { + runSeed = SDLTest_GenerateRunSeed(16); + if (runSeed == NULL) { + SDLTest_LogError("Generating a random seed failed"); + return 2; + } + } else { + runSeed = userRunSeed; + } + + + /* Reset per-run counters */ + totalTestFailedCount = 0; + totalTestPassedCount = 0; + totalTestSkippedCount = 0; + + /* Take time - run start */ + runStartSeconds = GetClock(); + + /* Log run with fuzzer parameters */ + SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed); + + /* Initialize filtering */ + if (filter != NULL && SDL_strlen(filter) > 0) { + /* Loop over all suites to check if we have a filter match */ + suiteCounter = 0; + while (testSuites[suiteCounter] && suiteFilter == 0) { + testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter]; + suiteCounter++; + if (testSuite->name != NULL && SDL_strcmp(filter, testSuite->name) == 0) { + /* Matched a suite name */ + suiteFilter = 1; + suiteFilterName = testSuite->name; + SDLTest_Log("Filtering: running only suite '%s'", suiteFilterName); + break; + } + + /* Within each suite, loop over all test cases to check if we have a filter match */ + testCounter = 0; + while (testSuite->testCases[testCounter] && testFilter == 0) + { + testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter]; + testCounter++; + if (testCase->name != NULL && SDL_strcmp(filter, testCase->name) == 0) { + /* Matched a test name */ + suiteFilter = 1; + suiteFilterName = testSuite->name; + testFilter = 1; + testFilterName = testCase->name; + SDLTest_Log("Filtering: running only test '%s' in suite '%s'", testFilterName, suiteFilterName); + break; + } + } + } + + if (suiteFilter == 0 && testFilter == 0) { + SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter); + SDLTest_Log("Exit code: 2"); + return 2; + } + } + + /* Loop over all suites */ + suiteCounter = 0; + while(testSuites[suiteCounter]) { + testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter]; + currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat); + suiteCounter++; + + /* Filter suite if flag set and we have a name */ + if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL && + SDL_strcmp(suiteFilterName, testSuite->name) != 0) { + /* Skip suite */ + SDLTest_Log("===== Test Suite %i: '%s' skipped\n", + suiteCounter, + currentSuiteName); + } else { + + /* Reset per-suite counters */ + testFailedCount = 0; + testPassedCount = 0; + testSkippedCount = 0; + + /* Take time - suite start */ + suiteStartSeconds = GetClock(); + + /* Log suite started */ + SDLTest_Log("===== Test Suite %i: '%s' started\n", + suiteCounter, + currentSuiteName); + + /* Loop over all test cases */ + testCounter = 0; + while(testSuite->testCases[testCounter]) + { + testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter]; + currentTestName = (char *)((testCase->name) ? testCase->name : SDLTest_InvalidNameFormat); + testCounter++; + + /* Filter tests if flag set and we have a name */ + if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL && + SDL_strcmp(testFilterName, testCase->name) != 0) { + /* Skip test */ + SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n", + suiteCounter, + testCounter, + currentTestName); + } else { + /* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */ + if (testFilter == 1 && !testCase->enabled) { + SDLTest_Log("Force run of disabled test since test filter was set"); + testCase->enabled = 1; + } + + /* Take time - test start */ + testStartSeconds = GetClock(); + + /* Log test started */ + SDLTest_Log("----- Test Case %i.%i: '%s' started", + suiteCounter, + testCounter, + currentTestName); + if (testCase->description != NULL && SDL_strlen(testCase->description)>0) { + SDLTest_Log("Test Description: '%s'", + (testCase->description) ? testCase->description : SDLTest_InvalidNameFormat); + } + + /* Loop over all iterations */ + iterationCounter = 0; + while(iterationCounter < testIterations) + { + iterationCounter++; + + if (userExecKey != 0) { + execKey = userExecKey; + } else { + execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter); + } + + SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey); + testResult = SDLTest_RunTest(testSuite, testCase, execKey); + + if (testResult == TEST_RESULT_PASSED) { + testPassedCount++; + totalTestPassedCount++; + } else if (testResult == TEST_RESULT_SKIPPED) { + testSkippedCount++; + totalTestSkippedCount++; + } else { + testFailedCount++; + totalTestFailedCount++; + } + } + + /* Take time - test end */ + testEndSeconds = GetClock(); + runtime = testEndSeconds - testStartSeconds; + if (runtime < 0.0f) runtime = 0.0f; + + if (testIterations > 1) { + /* Log test runtime */ + SDLTest_Log("Runtime of %i iterations: %.1f sec", testIterations, runtime); + SDLTest_Log("Average Test runtime: %.5f sec", runtime / (float)testIterations); + } else { + /* Log test runtime */ + SDLTest_Log("Total Test runtime: %.1f sec", runtime); + } + + /* Log final test result */ + switch (testResult) { + case TEST_RESULT_PASSED: + SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Passed"); + break; + case TEST_RESULT_FAILED: + SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Failed"); + break; + case TEST_RESULT_NO_ASSERT: + SDLTest_LogError((char *)SDLTest_FinalResultFormat,"Test", currentTestName, "No Asserts"); + break; + } + + } + } + + /* Take time - suite end */ + suiteEndSeconds = GetClock(); + runtime = suiteEndSeconds - suiteStartSeconds; + if (runtime < 0.0f) runtime = 0.0f; + + /* Log suite runtime */ + SDLTest_Log("Total Suite runtime: %.1f sec", runtime); + + /* Log summary and final Suite result */ + countSum = testPassedCount + testFailedCount + testSkippedCount; + if (testFailedCount == 0) + { + SDLTest_Log(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount); + SDLTest_Log((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Passed"); + } + else + { + SDLTest_LogError(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount); + SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Failed"); + } + + } + } + + /* Take time - run end */ + runEndSeconds = GetClock(); + runtime = runEndSeconds - runStartSeconds; + if (runtime < 0.0f) runtime = 0.0f; + + /* Log total runtime */ + SDLTest_Log("Total Run runtime: %.1f sec", runtime); + + /* Log summary and final run result */ + countSum = totalTestPassedCount + totalTestFailedCount + totalTestSkippedCount; + if (totalTestFailedCount == 0) + { + runResult = 0; + SDLTest_Log(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount); + SDLTest_Log((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Passed"); + } + else + { + runResult = 1; + SDLTest_LogError(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount); + SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Failed"); + } + + SDLTest_Log("Exit code: %d", runResult); + return runResult; +} diff --git a/src/test/SDL_test_imageBlit.c b/src/test/SDL_test_imageBlit.c new file mode 100644 index 0000000000..d1d12952c2 --- /dev/null +++ b/src/test/SDL_test_imageBlit.c @@ -0,0 +1,1557 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_test.h" + +/* GIMP RGB C-Source image dump (blit.c) */ + +const SDLTest_SurfaceImage_t SDLTest_imageBlit = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0", +}; + +/** + * \brief Returns the Blit test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlit() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlit.pixel_data, + SDLTest_imageBlit.width, + SDLTest_imageBlit.height, + SDLTest_imageBlit.bytes_per_pixel * 8, + SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} + +const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\0\0\0\0" + "\0\0(\0\0(\0\0\0\0\0\0\0\0<\0\0<\0\0\0\0\0\0\0\0P\0\0P\0\0\0\0\0\0\0\0d\0" + "\0d\0\0\0\0\0\0\0\0x\0\0x\0\0\0\0\0\0\0\0\214\0\0\214\0\0\0\0\0\0\0\0\240" + "\0\0\240\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0\310\0\0\310\0\0\0\0" + "\0\0\0\0\334\0\0\334\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360" + "\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0\0\0(\0\0" + "(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0d\0\0d\0\0" + "\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0\0\240\0\0" + "\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310\0\0\0\0" + "\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0" + "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0" + "\0\0(\0\0(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0" + "d\0\0d\0\0\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0" + "\0\240\0\0\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310" + "\0\0\0\0\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0" + "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0\0\0\0$\24\0" + "$\24\0\0\0\0\0\0\0$(\0$(\0\0\0\0\0\0\0$<\0$<\0\0\0\0\0\0\0$P\0$P\0\0\0\0" + "\0\0\0$d\0$d\0\0\0\0\0\0\0$x\0$x\0\0\0\0\0\0\0$\214\0$\214\0\0\0\0\0\0\0" + "$\240\0$\240\0\0\0\0\0\0\0$\264\0$\264\0\0\0\0\0\0\0$\310\0$\310\0\0\0\0" + "\0\0\0$\334\0$\334\0\0\0\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360" + "\0$\360\0$\360\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0" + "$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0" + "$\214\0$\214\0$\214\0\0\0\0$\240\0$\240\0$\240\0\0\0\0$\264\0$\264\0$\264" + "\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334\0$\334\0$\334\0\0\0\0$\360\0$\360" + "\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0" + "\0\0\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0" + "$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0" + "$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0$\214\0$\214\0$\214\0\0\0\0$\240\0$\240" + "\0$\240\0\0\0\0$\264\0$\264\0$\264\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334" + "\0$\334\0$\334\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$" + "\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0" + "\0\0\0\0H\0\0H\0\0\0\0\0\0\0\0H\24\0H\24\0\0\0\0\0\0\0H(\0H(\0\0\0\0\0\0" + "\0H<\0H<\0\0\0\0\0\0\0HP\0HP\0\0\0\0\0\0\0Hd\0Hd\0\0\0\0\0\0\0Hx\0Hx\0\0" + "\0\0\0\0\0H\214\0H\214\0\0\0\0\0\0\0H\240\0H\240\0\0\0\0\0\0\0H\264\0H\264" + "\0\0\0\0\0\0\0H\310\0H\310\0\0\0\0\0\0\0H\334\0H\334\0\0\0\0\0\0\0H\360\0" + "H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0\0\0\0\0\0\0$\360\0$\360" + "\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0H\24\0H\24\0H\24" + "\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd" + "\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0H\214\0\0\0\0H\240\0H\240\0H\240" + "\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310\0H\310\0H\310\0\0\0\0H\334\0H\334" + "\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H" + "\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0" + "H\0\0H\0\0\0\0\0H\24\0H\24\0H\24\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0" + "\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0" + "H\214\0\0\0\0H\240\0H\240\0H\240\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310" + "\0H\310\0H\310\0\0\0\0H\334\0H\334\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360" + "\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0" + "\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0H\0\0H\0\0H\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\0\0\0l\24\0l\24\0\0\0\0\0\0" + "\0l(\0l(\0\0\0\0\0\0\0l<\0l<\0\0\0\0\0\0\0lP\0lP\0\0\0\0\0\0\0ld\0ld\0\0" + "\0\0\0\0\0lx\0lx\0\0\0\0\0\0\0l\214\0l\214\0\0\0\0\0\0\0l\240\0l\240\0\0" + "\0\0\0\0\0l\264\0l\264\0\0\0\0\0\0\0l\310\0l\310\0\0\0\0\0\0\0l\334\0l\334" + "\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0" + "\0\0\0\0\0H\360\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0" + "\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0\0\0l<\0l<\0l<\0\0\0\0lP\0lP" + "\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0\0\0l\214\0l\214\0l\214\0\0\0" + "\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0l\264\0\0\0\0l\310\0l\310\0l\310" + "\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360" + "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0" + "\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0" + "\0\0l<\0l<\0l<\0\0\0\0lP\0lP\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0" + "\0\0l\214\0l\214\0l\214\0\0\0\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0" + "l\264\0\0\0\0l\310\0l\310\0l\310\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360" + "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0" + "l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360" + "\0\0\0\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\0\0" + "\0\220\24\0\220\24\0\0\0\0\0\0\0\220(\0\220(\0\0\0\0\0\0\0\220<\0\220<\0" + "\0\0\0\0\0\0\220P\0\220P\0\0\0\0\0\0\0\220d\0\220d\0\0\0\0\0\0\0\220x\0\220" + "x\0\0\0\0\0\0\0\220\214\0\220\214\0\0\0\0\0\0\0\220\240\0\220\240\0\0\0\0" + "\0\0\0\220\264\0\220\264\0\0\0\0\0\0\0\220\310\0\220\310\0\0\0\0\0\0\0\220" + "\334\0\220\334\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\220" + "\360\0\220\360\0\220\360\0\220\360\0\0\0\0\0\0\0l\360\0l\360\0l\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\220\24\0\220\24\0" + "\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220<\0\220<\0\220<\0\0\0\0\220" + "P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0\0\0\220x\0\220x\0\220x\0\0" + "\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240\0\220\240\0\220\240\0\0" + "\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310\0\220\310\0\220\310\0\0" + "\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360\0\220\360\0\220\360\0\220" + "\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360" + "\0\220\360\0\0\0\0l\360\0l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220" + "\0\0\0\0\0\220\24\0\220\24\0\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220" + "<\0\220<\0\220<\0\0\0\0\220P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0" + "\0\0\220x\0\220x\0\220x\0\0\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240" + "\0\220\240\0\220\240\0\0\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310" + "\0\220\310\0\220\310\0\0\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360" + "\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0" + "\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360\0" + "l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0" + "\264\24\0\264\24\0\0\0\0\0\0\0\264(\0\264(\0\0\0\0\0\0\0\264<\0\264<\0\0" + "\0\0\0\0\0\264P\0\264P\0\0\0\0\0\0\0\264d\0\264d\0\0\0\0\0\0\0\264x\0\264" + "x\0\0\0\0\0\0\0\264\214\0\264\214\0\0\0\0\0\0\0\264\240\0\264\240\0\0\0\0" + "\0\0\0\264\264\0\264\264\0\0\0\0\0\0\0\264\310\0\264\310\0\0\0\0\0\0\0\264" + "\334\0\264\334\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264" + "\360\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\220\360\0\220\360\0\220" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264" + "\24\0\264\24\0\264\24\0\0\0\0\264(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264" + "<\0\0\0\0\264P\0\264P\0\264P\0\0\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264" + "x\0\264x\0\0\0\0\264\214\0\264\214\0\264\214\0\0\0\0\264\240\0\264\240\0" + "\264\240\0\0\0\0\264\264\0\264\264\0\264\264\0\0\0\0\264\310\0\264\310\0" + "\264\310\0\0\0\0\264\334\0\264\334\0\264\334\0\0\0\0\264\360\0\264\360\0" + "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264" + "\360\0\264\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\220\0" + "\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264\24\0\264\24\0\264\24\0\0\0\0\264" + "(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264<\0\0\0\0\264P\0\264P\0\264P\0\0" + "\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264x\0\264x\0\0\0\0\264\214\0\264" + "\214\0\264\214\0\0\0\0\264\240\0\264\240\0\264\240\0\0\0\0\264\264\0\264" + "\264\0\264\264\0\0\0\0\264\310\0\264\310\0\264\310\0\0\0\0\264\334\0\264" + "\334\0\264\334\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0" + "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264" + "\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\0\0\0\264\0\0\264\0\0" + "\264\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0" + "\264\360\0\264\360\0\264\360\0\0\0\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\264" + "\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\0\0\0\330\24\0\330\24\0\0\0\0\0\0" + "\0\330(\0\330(\0\0\0\0\0\0\0\330<\0\330<\0\0\0\0\0\0\0\330P\0\330P\0\0\0" + "\0\0\0\0\330d\0\330d\0\0\0\0\0\0\0\330x\0\330x\0\0\0\0\0\0\0\330\214\0\330" + "\214\0\0\0\0\0\0\0\330\240\0\330\240\0\0\0\0\0\0\0\330\264\0\330\264\0\0" + "\0\0\0\0\0\330\310\0\330\310\0\0\0\0\0\0\0\330\334\0\330\334\0\0\0\0\0\0" + "\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0" + "\330\360\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0" + "\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0" + "\0\0\330(\0\330(\0\330(\0\0\0\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0" + "\330P\0\0\0\0\330d\0\330d\0\330d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214" + "\0\330\214\0\330\214\0\0\0\0\330\240\0\330\240\0\330\240\0\0\0\0\330\264" + "\0\330\264\0\330\264\0\0\0\0\330\310\0\330\310\0\330\310\0\0\0\0\330\334" + "\0\330\334\0\330\334\0\0\0\0\330\360\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360" + "\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\330\0\0\330\0\0" + "\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0\0\0\330(\0\330(\0\330(\0\0\0" + "\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0\330P\0\0\0\0\330d\0\330d\0\330" + "d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214\0\330\214\0\330\214\0\0\0\0" + "\330\240\0\330\240\0\330\240\0\0\0\0\330\264\0\330\264\0\330\264\0\0\0\0" + "\330\310\0\330\310\0\330\310\0\0\0\0\330\334\0\330\334\0\330\334\0\0\0\0" + "\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\0\0\0" + "\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\374\0\0" + "\374\0\0\0\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0" + "\0\0\374<\0\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0" + "\0\0\0\0\0\374x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374" + "\240\0\374\240\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374" + "\310\0\0\0\0\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330" + "\360\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374" + "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" + "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" + "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" + "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" + "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" + "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0" + "\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0" + "\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x" + "\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374" + "\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374" + "\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330" + "\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0" + "\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374" + "P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0" + "\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0" + "\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0" + "\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374" + "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" + "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" + "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" + "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" + "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" + "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" + "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" + "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" + "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" + "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" + "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374" + "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374" + "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374" + "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374" + "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374" + "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334" + "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334\0\0" + "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0" + "\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374" + "<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374" + "x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374" + "\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374" + "\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374" + "(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0" + "\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374" + "\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374" + "\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374" + "\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0" + "\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0" + "\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214" + "\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264" + "\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334" + "\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374" + "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374" + "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374" + "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374" + "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374" + "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374" + "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" + "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" + "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" + "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" + "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" + "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" + "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" + "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" + "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" + "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" + "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" + "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" + "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" + "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" + "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" + "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24" + "\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0" + "\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0" + "\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0" + "\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334" + "\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0" + "\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0" + "\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0" + "\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374" + "x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240" + "\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0" + "\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24\0" + "\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0\0" + "\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0\0" + "\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0\374" + "\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334\0\374" + "\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0" + "\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P" + "\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374" + "\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374" + "\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374" + "\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0" + "\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0" + "\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374" + "x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0" + "\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374" + "\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the BlitColor test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitColor() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlitColor.pixel_data, + SDLTest_imageBlitColor.width, + SDLTest_imageBlitColor.height, + SDLTest_imageBlitColor.bytes_per_pixel * 8, + SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} + +const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\20\20\0" + "\20\20\0""88\0""88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0II\0\224\224\0\224" + "\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302\302\0HH\0HH\0\324" + "\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0""00\0""00\0\356\356\0\356\356" + "\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16\0\374\374\0\374\374" + "\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\24\24\0\24\24\0\24\24\0\20\20\0""88\0""88\0""88\0**\0ff\0ff\0ff\0FF\0" + "\215\215\0\215\215\0\215\215\0UU\0\255\255\0\255\255\0\255\255\0[[\0\306" + "\306\0\306\306\0\306\306\0YY\0\331\331\0\331\331\0\331\331\0PP\0\350\350" + "\0\350\350\0\350\350\0DD\0\362\362\0\362\362\0\362\362\0""44\0\370\370\0" + "\370\370\0\370\370\0\"\"\0\374\374\0\374\374\0\374\374\0\16\16\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\374\374\0" + "\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\20\20\0""88\0" + """88\0""88\0**\0ff\0ff\0ff\0FF\0\226\226\0\226\226\0\215\215\0UU\0\271\271" + "\0\271\271\0\255\255\0[[\0\323\323\0\323\323\0\306\306\0YY\0\345\345\0\345" + "\345\0\331\331\0PP\0\360\360\0\360\360\0\350\350\0DD\0\370\370\0\370\370" + "\0\362\362\0""44\0\374\374\0\374\374\0\370\370\0\"\"\0\376\376\0\376\376" + "\0\374\374\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" + "\0\24\24\0\24\24\0\20\20\0""33\0""33\0""33\0&&\0OO\0OO\0OO\0""55\0``\0``" + "\0``\0::\0``\0``\0``\0""22\0WW\0WW\0WW\0''\0II\0II\0II\0\33\33\0""99\0""9" + "9\0""99\0\20\20\0))\0))\0))\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17" + "\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0" + "\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\360\360\0\360\360\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\16\16" + "\0""33\0GG\0GG\0""00\0``\0\210\210\0\210\210\0TT\0\204\204\0\263\263\0\263" + "\263\0ee\0\222\222\0\315\315\0\312\312\0gg\0\216\216\0\331\331\0\327\327" + "\0cc\0\202\202\0\340\340\0\337\337\0YY\0qq\0\345\345\0\344\344\0NN\0^^\0" + "\352\352\0\352\352\0@@\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364" + "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" + "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" + "\16\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24" + "\24\0\24\24\0\22\22\0\24\24\0""88\0""88\0//\0BB\0pp\0pp\0UU\0ss\0\242\242" + "\0\242\242\0oo\0\230\230\0\306\306\0\306\306\0ww\0\265\265\0\335\335\0\335" + "\335\0ss\0\313\313\0\353\353\0\353\353\0ii\0\333\333\0\364\364\0\364\364" + "\0ZZ\0\351\351\0\371\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0""6" + "6\0\370\370\0\376\376\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16" + "\16\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376" + "\0\376\376\0\360\360\0\360\360\0\360\360\0\360\360\0\16\16\0\360\360\0\360" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\22\22\0\"\"\0""88\0" + """88\0//\0OO\0pp\0pp\0WW\0\203\203\0\242\242\0\242\242\0qq\0\256\256\0\312" + "\312\0\301\301\0||\0\313\313\0\342\342\0\325\325\0yy\0\336\336\0\360\360" + "\0\342\342\0mm\0\353\353\0\367\367\0\354\354\0\\\\\0\363\363\0\373\373\0" + "\362\362\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373" + "\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375" + "\0\360\360\0\374\374\0\360\360\0\376\376\0\16\16\0\360\360\0\360\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\22\22\0&&\0\"\"\0""88\0//\0PP\0HH\0gg\0NN" + "\0pp\0ee\0}}\0VV\0{{\0oo\0\202\202\0NN\0qq\0jj\0vv\0>>\0``\0\\\\\0cc\0,," + "\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0" + "\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7" + "\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360" + "\360\0\376\376\0\376\376\0\16\16\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" + "\0&&\0&&\0\"\"\0""66\0[[\0oo\0ee\0``\0\220\220\0\270\270\0\250\250\0xx\0" + "\250\250\0\327\327\0\311\311\0zz\0\246\246\0\341\341\0\325\325\0rr\0\230" + "\230\0\343\343\0\334\334\0gg\0\205\205\0\344\344\0\340\340\0[[\0rr\0\346" + "\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" + """11\0""66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16" + "\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362\0\376" + "\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\22\22\0&&\0&&\0\37\37\0;;\0``\0``\0HH\0qq\0\237\237" + "\0\237\237\0nn\0\227\227\0\306\306\0\306\306\0}}\0\254\254\0\334\334\0\334" + "\334\0}}\0\275\275\0\347\347\0\347\347\0vv\0\316\316\0\357\357\0\357\357" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0&&\0##\0--\0``\0``\0TT\0cc\0\237\237\0\231\231\0||\0\223\223\0\306\306" + "\0\301\301\0\217\217\0\267\267\0\336\336\0\322\322\0\220\220\0\317\317\0" + "\352\352\0\334\334\0\202\202\0\337\337\0\362\362\0\345\345\0qq\0\353\353" + "\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371\371\0\375" + "\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376\376\0\376" + "\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0\376\376\0" + "\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0##\0""77\0--\0``\0PP\0nn\0[[\0\222\222\0kk\0\211\211\0qq\0\231\231\0" + "ff\0\210\210\0uu\0\217\217\0UU\0vv\0ll\0zz\0@@\0aa\0]]\0dd\0,,\0MM\0KK\0" + "OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0\33\33\0\33" + "\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2" + "\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\376" + "\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0##\0""77\0""77" + "\0--\0UU\0zz\0\216\216\0ww\0}}\0\254\254\0\324\324\0\264\264\0\207\207\0" + "\266\266\0\345\345\0\316\316\0\177\177\0\254\254\0\346\346\0\326\326\0rr" + "\0\231\231\0\344\344\0\334\334\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr" + "\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357" + "\357\0""11\0""66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0" + "\16\16\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362" + "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0""77\0--\0CC\0~~\0~~\0\\\\\0||\0" + "\274\274\0\274\274\0||\0\235\235\0\325\325\0\325\325\0\204\204\0\256\256" + "\0\340\340\0\340\340\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316" + "\0\360\360\0\360\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371" + "\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376" + "\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0" + "\360\360\0\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0&&\0""77\0""22\0--\0``\0vv\0pp\0gg\0\243\243\0\255\255" + "\0\225\225\0\231\231\0\311\311\0\314\314\0\235\235\0\271\271\0\337\337\0" + "\326\326\0\224\224\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362" + "\362\0\345\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373" + "\0\362\362\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0" + "\373\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0" + "\375\375\0\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376" + "\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222" + "\222\0kk\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm" + "\0zz\0@@\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0" + "))\0**\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0" + "\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16" + "\0\16\16\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203" + "\203\0\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317" + "\0\200\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334" + "\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0" + "\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364" + "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" + "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" + "\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" + "\0""77\0""77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302" + "\302\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341" + "\341\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360" + "\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371" + "\0II\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0" + "\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0" + "\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235" + "\0\234\234\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0" + "\225\225\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345" + "\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362" + "\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0" + "\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0" + "\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk" + "\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@" + "\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0" + "\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7" + "\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16" + "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0" + "\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200" + "\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg" + "\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352" + "\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364" + "\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0" + "\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16" + "\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" + """77\0""77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302" + "\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341" + "\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" + "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" + "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" + "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" + "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" + "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" + "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" + "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" + "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" + "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" + "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" + "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" + "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" + "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" + "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" + "\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364\0\40\40" + "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" + "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" + "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0" + """77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" + "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" + "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" + "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" + "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" + "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" + "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" + "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" + "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" + "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" + "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" + "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" + "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" + "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" + "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" + "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" + "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" + "\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364\0\40\40" + "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" + "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" + "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0" + """77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" + "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" + "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" + "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" + "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" + "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" + "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" + "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" + "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\213\213\0mm\0\237\237\0uu\0\275\275" + "\0\232\232\0\306\306\0\204\204\0\331\331\0\272\272\0\336\336\0\205\205\0" + "\345\345\0\320\320\0\352\352\0{{\0\355\355\0\337\337\0\362\362\0mm\0\363" + "\363\0\353\353\0\370\370\0\\\\\0\367\367\0\363\363\0\373\373\0II\0\373\373" + "\0\371\371\0\375\375\0""66\0\375\375\0\374\374\0\376\376\0\"\"\0\376\376" + "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\375\375\0\375\375" + "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0##\0""77\0""77\0""99\0gg\0\205\205\0\205\205\0ww\0\224\224\0" + "\310\310\0\310\310\0\247\247\0\240\240\0\354\354\0\354\354\0\306\306\0\227" + "\227\0\372\372\0\372\372\0\325\325\0\205\205\0\375\375\0\375\375\0\342\342" + "\0rr\0\376\376\0\376\376\0\354\354\0^^\0\376\376\0\376\376\0\363\363\0JJ" + "\0\376\376\0\376\376\0\370\370\0""66\0\376\376\0\376\376\0\374\374\0\"\"" + "\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375" + "\0\376\376\0\376\376\0\376\376\0\362\362\0\376\376\0\376\376\0\376\376\0" + "\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0""77\0""11\0>>\0~~\0~~\0bb" + "\0__\0\261\261\0\261\261\0\212\212\0``\0\277\277\0\277\277\0\230\230\0SS" + "\0\275\275\0\275\275\0\233\233\0@@\0\273\273\0\273\273\0\240\240\0//\0\274" + "\274\0\274\274\0\252\252\0!!\0\301\301\0\301\301\0\266\266\0\25\25\0\311" + "\311\0\311\311\0\303\303\0\14\14\0\324\324\0\324\324\0\322\322\0\6\6\0\342" + "\342\0\342\342\0\341\341\0\1\1\0\361\361\0\361\361\0\361\361\0\15\15\0\15" + "\15\0\15\15\0\15\15\0\362\362\0\362\362\0\362\362\0\360\360\0\16\16\0\16" + "\16\0\16\16\0\2\2\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0&&\0""77\0""77\0\34\34\0SS\0kk\0\206\206\0BB\0\214\214\0\232\232" + "\0\302\302\0YY\0\250\250\0\255\255\0\340\340\0XX\0\264\264\0\264\264\0\355" + "\355\0SS\0\265\265\0\266\266\0\364\364\0JJ\0\270\270\0\272\272\0\371\371" + "\0AA\0\277\277\0\300\300\0\374\374\0""66\0\310\310\0\311\311\0\375\375\0" + "**\0\324\324\0\324\324\0\376\376\0\34\34\0\341\341\0\342\342\0\376\376\0" + "\15\15\0\361\361\0\361\361\0\376\376\0\361\361\0\15\15\0\15\15\0\376\376" + "\0\15\15\0\361\361\0\361\361\0\373\373\0\362\362\0\15\15\0\16\16\0\376\376" + "\0\16\16\0\361\361\0\376\376\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0&&\0&&\0""77\0))\0SS\0SS\0kk\0DD\0\205\205\0}}\0\222\222\0WW\0\241\241" + "\0\230\230\0\245\245\0XX\0\261\261\0\252\252\0\261\261\0SS\0\264\264\0\263" + "\263\0\265\265\0JJ\0\270\270\0\271\271\0\272\272\0AA\0\276\276\0\300\300" + "\0\300\300\0""66\0\310\310\0\311\311\0\311\311\0**\0\324\324\0\324\324\0" + "\324\324\0\34\34\0\341\341\0\342\342\0\342\342\0\15\15\0\361\361\0\361\361" + "\0\361\361\0\361\361\0\15\15\0\15\15\0\15\15\0\15\15\0\361\361\0\361\361" + "\0\361\361\0\362\362\0\15\15\0\16\16\0\16\16\0\16\16\0\361\361\0\376\376" + "\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0&&\0&&\0))\0pp\0cc\0cc" + "\0QQ\0\261\261\0\244\244\0\244\244\0ll\0\335\335\0\323\323\0\323\323\0ww" + "\0\364\364\0\356\356\0\356\356\0ss\0\370\370\0\371\371\0\371\371\0ii\0\372" + "\372\0\375\375\0\375\375\0YY\0\374\374\0\376\376\0\376\376\0HH\0\375\375" + "\0\376\376\0\376\376\0""66\0\376\376\0\376\376\0\376\376\0\"\"\0\376\376" + "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" + "\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\40\40\0QQ\0pp\0pp\0KK" + "\0\215\215\0\261\261\0\261\261\0pp\0\274\274\0\337\337\0\337\337\0\200\200" + "\0\332\332\0\364\364\0\364\364\0}}\0\350\350\0\373\373\0\373\373\0oo\0\361" + "\361\0\375\375\0\375\375\0]]\0\367\367\0\376\376\0\376\376\0JJ\0\373\373" + "\0\376\376\0\376\376\0""66\0\375\375\0\376\376\0\376\376\0\"\"\0\376\376" + "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" + "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\20\20\0""88\0WW\0pp\0" + "==\0ss\0\212\212\0\252\252\0dd\0\250\250\0\264\264\0\312\312\0rr\0\313\313" + "\0\315\315\0\331\331\0rr\0\340\340\0\331\331\0\340\340\0hh\0\355\355\0\341" + "\341\0\345\345\0YY\0\366\366\0\350\350\0\352\352\0HH\0\372\372\0\356\356" + "\0\357\357\0""66\0\375\375\0\364\364\0\364\364\0\"\"\0\376\376\0\371\371" + "\0\371\371\0\16\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361" + "\361\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\375\375\0" + "\376\376\0\375\375\0\374\374\0\360\360\0\376\376\0\376\376\0\360\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0&&\0\40\40\0""88\0""88\0WW\0BB\0ff" + "\0ZZ\0}}\0^^\0\226\226\0\201\201\0\241\241\0nn\0\301\301\0\246\246\0\277" + "\277\0rr\0\333\333\0\301\301\0\321\321\0ii\0\353\353\0\323\323\0\335\335" + "\0[[\0\365\365\0\341\341\0\346\346\0II\0\372\372\0\353\353\0\356\356\0""6" + "6\0\375\375\0\363\363\0\364\364\0\"\"\0\376\376\0\371\371\0\371\371\0\16" + "\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361\361\0\361\361" + "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\374\374\0\375\375\0\374" + "\374\0\374\374\0\361\361\0\376\376\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0""88\0""88\0BB\0~~\0ff\0ff\0" + "^^\0\256\256\0\226\226\0\226\226\0qq\0\325\325\0\277\277\0\277\277\0ss\0" + "\350\350\0\331\331\0\331\331\0jj\0\363\363\0\353\353\0\353\353\0[[\0\371" + "\371\0\365\365\0\365\365\0II\0\374\374\0\372\372\0\372\372\0""66\0\375\375" + "\0\375\375\0\375\375\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" + "\376\376\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\376" + "\376\0\361\361\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0HH\0""88\0BB\0~~\0~~\0ff\0^^\0\263" + "\263\0\263\263\0\231\231\0nn\0\330\330\0\330\330\0\274\274\0pp\0\353\353" + "\0\353\353\0\324\324\0hh\0\365\365\0\365\365\0\345\345\0ZZ\0\373\373\0\373" + "\373\0\361\361\0II\0\375\375\0\375\375\0\370\370\0""66\0\376\376\0\376\376" + "\0\374\374\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" + "\376\376\0\374\374\0\374\374\0\376\376\0\376\376\0\361\361\0\360\360\0\360" + "\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0" + "\0\0\0\0((\0HH\0\40\40\0\25\25\0QQ\0\207\207\0KK\0--\0}}\0\262\262\0bb\0" + """44\0\235\235\0\320\320\0ff\0""00\0\257\257\0\341\341\0cc\0))\0\272\272" + "\0\354\354\0ZZ\0\37\37\0\303\303\0\363\363\0OO\0\26\26\0\314\314\0\370\370" + "\0AA\0\15\15\0\326\326\0\373\373\0""22\0\6\6\0\343\343\0\375\375\0!!\0\1" + "\1\0\362\362\0\376\376\0\16\16\0\16\16\0\16\16\0\375\375\0\375\375\0\375" + "\375\0\376\376\0\362\362\0\360\360\0\361\361\0\376\376\0\14\14\0\0\0\0\0" + "\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" + "\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0PP\0PP\0\10" + "\10\0\4\4\0dd\0dd\0\14\14\0\6\6\0xx\0xx\0\14\14\0\5\5\0\214\214\0\214\214" + "\0\13\13\0\4\4\0\240\240\0\240\240\0\10\10\0\2\2\0\264\264\0\264\264\0\5" + "\5\0\1\1\0\310\310\0\310\310\0\3\3\0\0\0\0\334\334\0\334\334\0\1\1\0\0\0" + "\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\1\1\0\0\0\0\0\0\0\14" + "\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0" + "\0<<\0<<\0\0\0\0\0\0\0XX\0XX\0\0\0\0\0\0\0pp\0pp\0\0\0\0\0\0\0\204\204\0" + "\204\204\0\0\0\0\0\0\0\227\227\0\227\227\0\0\0\0\0\0\0\250\250\0\250\250" + "\0\0\0\0\0\0\0\271\271\0\271\271\0\0\0\0\0\0\0\313\313\0\313\313\0\0\0\0" + "\0\0\0\335\335\0\335\335\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\1" + "\1\0\1\1\0\0\0\0\0\0\0\14\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" + "\24\24\0\24\24\0\0\0\0((\0((\0((\0\0\0\0<<\0HH\0HH\0\10\10\0PP\0dd\0dd\0" + "\14\14\0dd\0||\0||\0\14\14\0xx\0\221\221\0\221\221\0\13\13\0\214\214\0\243" + "\243\0\243\243\0\10\10\0\240\240\0\264\264\0\264\264\0\5\5\0\264\264\0\303" + "\303\0\303\303\0\3\3\0\310\310\0\322\322\0\322\322\0\1\1\0\334\334\0\341" + "\341\0\341\341\0\0\0\0\360\360\0\361\361\0\361\361\0\1\1\0\0\0\0\14\14\0" + "\14\14\0\14\14\0\0\0\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" + "\24\24\0\20\20\0\20\20\0""88\0""88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0" + "II\0\224\224\0\224\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302" + "\302\0HH\0HH\0\324\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0""00\0""00" + "\0\356\356\0\356\356\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16" + "\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0" + "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the BlitAlpha test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitAlpha() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlitAlpha.pixel_data, + SDLTest_imageBlitAlpha.width, + SDLTest_imageBlitAlpha.height, + SDLTest_imageBlitAlpha.bytes_per_pixel * 8, + SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} diff --git a/src/test/SDL_test_imageBlitBlend.c b/src/test/SDL_test_imageBlitBlend.c new file mode 100644 index 0000000000..06dbfabd4a --- /dev/null +++ b/src/test/SDL_test_imageBlitBlend.c @@ -0,0 +1,2843 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_test.h" + +/* GIMP RGB C-Source image dump (alpha.c) */ + +const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" + "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" + "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" + "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" + "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" + "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" + "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" + "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" + "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" + "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" + "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" + "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" + "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" + "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" + "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" + "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the BlitBlendAdd test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlendAdd() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlitBlendAdd.pixel_data, + SDLTest_imageBlitBlendAdd.width, + SDLTest_imageBlitBlendAdd.height, + SDLTest_imageBlitBlendAdd.bytes_per_pixel * 8, + SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} + +const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240" + "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" + "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240" + "\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" + "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" + "\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240\0\240\240\0\240\240" + "\0aa\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww" + "\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305" + "\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305" + "\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305" + "\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305" + "\0\305\305\0\305\305\0\240\240\0\240\240\0\240\240\0\240\240\0dd\0dd\0dd" + "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240" + "\0\240\240\0\240\240\0aa\0\305\305\0\305\305\0\305\305\0ww\0\333\333\0\333" + "\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333" + "\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305" + "\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305" + "\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww" + "\0\333\333\0\333\333\0\305\305\0\305\305\0\305\305\0\305\305\0\240\240\0" + "\240\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0dd\0dd\0dd\0<<\0aa\0aa\0aa\0::\0HH\0HH\0HH\0++\0PP\0PP\0PP\0""00\0PP" + "\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP" + "\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP" + "\0PP\0PP\0PP\0HH\0HH\0HH\0HH\0aa\0aa\0aa\0aa\0dd\0dd\0dd\0dd\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0dd\0dd\0dd\0$$\0aa\0\305\305\0\305\305\0``\0\205\205\0\351\351\0" + "\351\351\0||\0\222\222\0\321\321\0\321\321\0\177\177\0\225\225\0\324\324" + "\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0" + "\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225" + "\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177" + "\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0" + "\177\177\0\225\225\0\324\324\0\321\321\0\222\222\0\222\222\0\321\321\0\314" + "\314\0\351\351\0\351\351\0\254\254\0\236\236\0\305\305\0\305\305\0aa\0<<" + "\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0dd\0\240\240\0\240\240\0aa\0\255\255" + "\0\322\322\0\322\322\0\177\177\0\315\315\0\343\343\0\343\343\0\211\211\0" + "\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211" + "\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346" + "\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0" + "\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346" + "\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\320\320" + "\0\327\327\0\327\327\0\322\322\0\276\276\0\322\322\0\322\322\0\305\305\0" + "yy\0\210\210\0\210\210\0dd\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0\210\210\0\240" + "\240\0\240\240\0aa\0\266\266\0\322\322\0\322\322\0\205\205\0\327\327\0\343" + "\343\0\343\343\0\215\215\0\346\346\0\357\357\0\331\331\0\222\222\0\347\347" + "\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0" + "\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222" + "\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331" + "\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0" + "\331\331\0\222\222\0\357\357\0\346\346\0\320\320\0\351\351\0\327\327\0\343" + "\343\0\276\276\0\333\333\0\322\322\0\266\266\0yy\0\240\240\0\210\210\0\240" + "\240\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0dd\0<<\0\240\240\0\210\210\0\240\240\0aa\0ww\0nn\0\177" + "\177\0MM\0SS\0OO\0SS\0""22\0WW\0TT\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0" + "XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0" + "XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0XX\0TT\0TT\0LL\0OO\0SS" + "\0SS\0ss\0\177\177\0nn\0nn\0yy\0\210\210\0\240\240\0\240\240\0<<\0dd\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<" + "\0\240\240\0\240\240\0\210\210\0HH\0\205\205\0\351\351\0\333\333\0pp\0\225" + "\225\0\371\371\0\363\363\0\202\202\0\231\231\0\330\330\0\325\325\0\203\203" + "\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0" + "\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324" + "\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331" + "\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0" + "\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\325\325\0\231\231\0\231" + "\231\0\330\330\0\323\323\0\371\371\0\371\371\0\274\274\0\257\257\0\351\351" + "\0\351\351\0\205\205\0``\0\240\240\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\240\240" + "\0\240\240\0RR\0\207\207\0\304\304\0\304\304\0nn\0\275\275\0\343\343\0\343" + "\343\0\205\205\0\324\324\0\352\352\0\352\352\0\214\214\0\316\316\0\352\352" + "\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0" + "\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316" + "\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213" + "\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0" + "\213\213\0\316\316\0\352\352\0\352\352\0\214\214\0\324\324\0\336\336\0\336" + "\336\0\331\331\0\310\310\0\343\343\0\343\343\0\325\325\0\217\217\0\254\254" + "\0\254\254\0\207\207\0aa\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0aa" + "\0\225\225\0\304\304\0\304\304\0\205\205\0\276\276\0\343\343\0\340\340\0" + "\222\222\0\333\333\0\352\352\0\351\351\0\226\226\0\347\347\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\366\366\0\336\336\0\351\351\0\304\304\0\351\351\0\343\343\0\304\304\0\217" + "\217\0\333\333\0\254\254\0\266\266\0aa\0\240\240\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\305\305\0\225\225\0\304\304\0ww\0\205\205\0ss\0\211\211\0RR\0VV\0PP\0" + "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0||\0\217\217\0\254\254\0\266\266\0\305\305\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\225\225\0UU\0\222\222\0\366\366\0\340\340\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0mm\0\266\266\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\214\214\0\321\321\0\321\321\0rr\0\277\277\0\346\346\0\346" + "\346\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\331\331\0\312\312\0\346\346\0\346\346\0\330\330\0\224\224\0\271\271" + "\0\271\271\0\217\217\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\222\222\0\277\277\0\343\343\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\336\336\0\352\352\0\306\306\0\354\354\0\344\344\0\305\305\0\227" + "\227\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" + "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\340\340\0\300\300\0\343\343\0\210\210" + "\0\354\354\0\333\333\0\352\352\0\215\215\0\361\361\0\350\350\0\362\362\0" + "\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361" + "\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351" + "\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0" + "\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351" + "\351\0\351\351\0\361\361\0\223\223\0\351\351\0\362\362\0\351\351\0\351\351" + "\0\323\323\0\336\336\0\351\351\0\351\351\0\304\304\0\343\343\0\305\305\0" + "\317\317\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0\222\222\0\361\361\0\361\361\0\316\316\0\230\230" + "\0\373\373\0\373\373\0\344\344\0\231\231\0\375\375\0\375\375\0\357\357\0" + "\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347" + "\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375" + "\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0" + "\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375" + "\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\360\360\0\373\373" + "\0\375\375\0\375\375\0\347\347\0\367\367\0\373\373\0\373\373\0\326\326\0" + "\351\351\0\361\361\0\361\361\0\271\271\0\276\276\0\305\305\0\305\305\0aa" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0<<\0\305\305\0\305\305\0\236\236\0HH\0\271\271\0\271\271\0\224\224\0VV" + "\0\277\277\0\277\277\0\251\251\0DD\0\252\252\0\252\252\0\235\235\0FF\0\253" + "\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253" + "\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253" + "\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253" + "\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\235" + "\235\0rr\0uu\0uu\0^^\0\272\272\0\277\277\0\277\277\0\230\230\0\205\205\0" + "\222\222\0\222\222\0MM\0\266\266\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305" + "\305\0\305\305\0RR\0\236\236\0\254\254\0\361\361\0VV\0\267\267\0\263\263" + "\0\356\356\0ee\0\247\247\0\244\244\0\356\356\0^^\0\251\251\0\247\247\0\365" + "\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365" + "\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb" + "\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242" + "\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0\252\252\0ee" + "\0jj\0\345\345\0tt\0\246\246\0\251\251\0\321\321\0\272\272\0ff\0\222\222" + "\0\322\322\0ww\0\210\210\0\305\305\0\305\305\0\240\240\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240" + "\0\305\305\0``\0\236\236\0\236\236\0\254\254\0VV\0\264\264\0\254\254\0\261" + "\261\0dd\0\246\246\0\240\240\0\243\243\0^^\0\251\251\0\246\246\0\246\246" + "\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb" + "\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242" + "\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242" + "\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0\251\251\0dd\0hh" + "\0hh\0pp\0\243\243\0\240\240\0\236\236\0\264\264\0cc\0\177\177\0ww\0ww\0" + "\225\225\0\305\305\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0\240\240\0``" + "\0\351\351\0\333\333\0\333\333\0||\0\366\366\0\361\361\0\361\361\0\211\211" + "\0\373\373\0\371\371\0\371\371\0\221\221\0\375\375\0\374\374\0\374\374\0" + "\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374" + "\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374" + "\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0" + "\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365" + "\365\0\374\374\0\374\374\0\375\375\0\356\356\0\371\371\0\371\371\0\372\372" + "\0\340\340\0\361\361\0\361\361\0\364\364\0\307\307\0\333\333\0\333\333\0" + "\351\351\0\225\225\0\240\240\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240\240" + "\0aa\0\304\304\0\351\351\0\351\351\0\205\205\0\340\340\0\366\366\0\366\366" + "\0\222\222\0\355\355\0\373\373\0\373\373\0\227\227\0\364\364\0\375\375\0" + "\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375" + "\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360" + "\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0" + "\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230" + "\230\0\360\360\0\375\375\0\375\375\0\373\373\0\356\356\0\373\373\0\373\373" + "\0\367\367\0\340\340\0\364\364\0\364\364\0\354\354\0\304\304\0\351\351\0" + "\351\351\0\322\322\0\210\210\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240" + "\240\0<<\0\240\240\0\305\305\0\351\351\0ww\0\320\320\0\301\301\0\324\324" + "\0\211\211\0\345\345\0\316\316\0\324\324\0\217\217\0\356\356\0\323\323\0" + "\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323" + "\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354" + "\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0" + "\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223" + "\223\0\354\354\0\323\323\0\326\326\0\362\362\0\344\344\0\261\261\0\272\272" + "\0\364\364\0\340\340\0\225\225\0\205\205\0\340\340\0\276\276\0\351\351\0" + "\266\266\0\240\240\0dd\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\240\240\0aa\0\240" + "\240\0\240\240\0\305\305\0ww\0\305\305\0\240\240\0\266\266\0\205\205\0\333" + "\333\0\266\266\0\304\304\0\215\215\0\352\352\0\305\305\0\314\314\0\222\222" + "\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0" + "\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314" + "\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305" + "\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0" + "\305\305\0\314\314\0\361\361\0\335\335\0\242\242\0\236\236\0\333\333\0\312" + "\312\0ii\0aa\0\305\305\0\255\255\0\266\266\0\240\240\0\240\240\0\210\210" + "\0\240\240\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0aa\0\305\305\0\240\240\0\240\240\0ww\0\333" + "\333\0\305\305\0\305\305\0\205\205\0\351\351\0\333\333\0\333\333\0\217\217" + "\0\363\363\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0" + "\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351" + "\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351" + "\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0" + "\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\363\363\0\345" + "\345\0\333\333\0\333\333\0\340\340\0\312\312\0\305\305\0\305\305\0\322\322" + "\0\255\255\0\240\240\0\240\240\0\305\305\0\210\210\0dd\0dd\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd" + "\0dd\0dd\0aa\0\305\305\0\305\305\0\240\240\0ww\0\333\333\0\333\333\0\305" + "\305\0\205\205\0\355\355\0\355\355\0\336\336\0\215\215\0\364\364\0\364\364" + "\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0" + "\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364" + "\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215" + "\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0" + "\215\215\0\364\364\0\364\364\0\335\335\0\351\351\0\355\355\0\355\355\0\312" + "\312\0\305\305\0\322\322\0\322\322\0\255\255\0\240\240\0\305\305\0\305\305" + "\0\210\210\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0\305\305\0aa" + "\0""11\0\225\225\0\351\351\0\205\205\0HH\0\254\254\0\333\333\0ww\0BB\0\264" + "\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0" + "nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264" + "\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0" + "BB\0\264\264\0\340\340\0nn\0nn\0\205\205\0\314\314\0\266\266\0\304\304\0" + "\351\351\0\236\236\0yy\0\210\210\0\305\305\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\25\25\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0" + "\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0" + "\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0" + "yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0" + "\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0" + "yy\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd" + "\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210" + "\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210" + "\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25" + "\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210" + "\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0$$\0\0\0\0<<\0<<\0<<\0\0" + "\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" + "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" + "\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240" + "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" + "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0\240\240\0\240\240" + "\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the BlitBlend test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlend() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlitBlend.pixel_data, + SDLTest_imageBlitBlend.width, + SDLTest_imageBlitBlend.height, + SDLTest_imageBlitBlend.bytes_per_pixel * 8, + SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} + +const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the BlitBlendMod test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlendMod() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlitBlendMod.pixel_data, + SDLTest_imageBlitBlendMod.width, + SDLTest_imageBlitBlendMod.height, + SDLTest_imageBlitBlendMod.bytes_per_pixel * 8, + SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} + +const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = { + 80, 60, 3, + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377", +}; + +/** + * \brief Returns the BlitBlendNone test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlendNone() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlitBlendNone.pixel_data, + SDLTest_imageBlitBlendNone.width, + SDLTest_imageBlitBlendNone.height, + SDLTest_imageBlitBlendNone.bytes_per_pixel * 8, + SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} + +const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\0\0\0\0\0" + "\0\11\0\0\11\0\0\0\0\0\0\0\0\16\0\0\16\0\0\0\0\0\0\0\0\11\0\0\11\0\0\0\0" + "\0\0\0\0\14\0\0\14\0\0\0\0\0\0\0\0\17\0\0\17\0\0\0\0\0\0\0\0\21\0\0\21\0" + "\0\0\0\0\0\0\0K\0\0K\0\0\0\0\0\0\0\0T\0\0T\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0" + "\0\0\0\0g\0\0g\0\0\0\0\0\0\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" + "\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11" + "\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\11\0\0\0\0\0\14\0\0\14" + "\0\0\14\0\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24" + "\0\0\24\0\0K\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0" + "\0g\0\0\0\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" + "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11\0\0\0\0\0" + "\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\22\0\0\0\0\0\14\0\0\14\0\0\14\0" + "\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24\0\0\24" + "\0\0\24\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0\0g\0" + "\0\0\0\0q\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" + "\0\0\317\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\10\0\0\10\0\0\10\0\0\0\0\0\15" + "\0\0\15\0\0\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0J\0\0J\0\0J\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\317" + "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1" + "\0\0\4\0\0\4\0\0\0\0\0\0\0\0\7\0\0\7\0\0\0\0\0\0\0\0&\0\0&\0\0\32\0\0\32" + "\0\0&\0\0&\0\0&\0\0&\0\0C\0\0C\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0\0\0\0\17\251" + "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\0\0\0\0" + "\0\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\6\2\0\6\2\0\0\1\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0" + "\17\0\0\0\0\0\4\0\0\11\0\0\11\0\0\0\0\6+\0\6+\0\0&\0\0\32\0\0&\0\0&\0\0&" + "\0\0&\0\0""5\0\0""5\0\2\210\0\0\0\0\0C\0\0|\0\0|\0\0\0\0\17\251\0\17\251" + "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251" + "\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" + "\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\6\2\0\6\2\0\6\2\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1" + "\0\0\1\0\0\0\0\0\17\0\0\17\0\0\4\0\0\0\0\6+\0\6+\0\6+\0\0\32\0\0&\0\0&\0" + "\0&\0\0&\0\0""5\0\0""5\0\0""5\0\0\0\0\2\210\0\2\210\0\0C\0\0\0\0\17\251\0" + "\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0" + "\17\251\0\17\251\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "$\360\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0" + "\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\14\1\0\14\1\0\14\1" + "\0\14\1\0\15\1\0\15\1\0\0\0\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16" + "\2\0\0\0\0\0\0\0\14!\0\14!\0\14!\0\14!\0\17(\0\17(\0\0\0\0\0\0\0\14+\0\14" + "+\0\14+\0\14+\0\20""9\0\20""9\0\0\0\0\0\0\0\36\215\0\36\215\0\36\215\0\36" + "\215\0(\264\0(\264\0\0\0\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251" + "\0\36\251\0\36\251\0\36\251\0\0\0\0\0\0\0$\360\0$\360\0$\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3" + "\0\36\3\0\14\1\0\14\1\0\15\1\0\15\1\0\15\1\0\0\0\0\14\2\0\14\2\0\14\2\0\14" + "\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14\3\0\14!\0\14!\0\17(\0\17(\0\17" + "(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20""9\0\20""9\0\20""9\0\0\0\0\14""7\0\14" + """7\0\36\215\0\36\215\0(\264\0(\264\0(\264\0\0\0\0\36\251\0\36\251\0\36\251" + "\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0H\360\0" + "H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3\0\36\3\0\36\3\0\14\1\0\15\1\0\15\1\0\15\1" + "\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14" + "\3\0\14\3\0\14!\0\17(\0\17(\0\17(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20""9\0" + "\20""9\0\20""9\0\0\0\0\14""7\0\14""7\0\14""7\0\36\215\0(\264\0(\264\0(\264" + "\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36" + "\251\0\36\251\0\36\251\0\36\251\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\13\1\0\13\1\0\13\1\0\13\1\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11!\0" + "\11!\0\11!\0\11!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\23n\0\23n\0\23n\0\23n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\1\0\1\1\0\0\0\0\0\0\0\0\0\0\0\0\0\25\0\0\25\0\0\25\0\0\27\0" + "\0\13\0\0\13\0\0\1\0\0\11\0\0\4\0\0\4\0\0\0\0\0\0\0\0\25\3\0\25\3\0\0\0\0" + "\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\3\1\0\3\1\0\2\1\0\7\5\0\7\3\0\7\3\0\0" + "\0\0\0\0\0\25""4\0\25""4\0\0\0\0\0\0\0\25""4\0\25""4\0\25""4\0\25""4\0\20" + "\35\0\20\35\0\11\22\0\23F\0\34""6\0\34""6\0\0\0\0\0\0\0L\317\0L\317\0L\317" + "\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0\0\0\0""2\317\0""2\317\0""2\317" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\0\0\0\0\0\0\0\0\0\25\0\0\25" + "\0\0\25\0\0\4\0\0\5\0\0\2\0\0\1\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7\0\37\7" + "\0\25\3\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\15\4\0\11\3\0\7" + "\3\0\14\10\0\14\10\0\0\0\0\25\16\0\25\16\0\25""4\0\0\0\0\25""4\0\25""4\0" + "\25""4\0\25""4\0&Q\0&Q\0&Q\0\31""5\0\34""6\0&j\0&j\0\0\0\0""5q\0""5q\0L\317" + "\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0""2" + "\317\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\1\0\0\0\0\0\0\0\25\0" + "\0\25\0\0\25\0\0\31\1\0\5\0\0\5\0\0\2\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7" + "\0\37\7\0\37\7\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\37\6\0\11" + "\3\0\16\6\0\16\6\0\7\3\0\0\0\0\25\16\0\25\16\0\25\16\0\0\0\0\25""4\0\25""4" + "\0\25""4\0\25""4\0&Q\0&Q\0&Q\0\31""5\0+X\0+X\0\34""6\0\0\0\0""5q\0""5q\0" + """5q\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317" + "\0L\317\0\0\0\0""2\317\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0" + "\0\0\0\0\25\0\0\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0L\317\0L\317\0L\317\0L\317" + "\0\0\0\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0e\4\0e\4\0\0\0\0\0\0\0e\11\0e\11\0\0\0\0\0\0\0e\16\0e\16\0\0\0\0\0\0" + "\0G\11\0G\11\0\0\0\0\0\0\0G\14\0G\14\0\0\0\0\0\0\0G\17\0G\17\0\0\0\0\0\0" + "\0G\21\0G\21\0\0\0\0\0\0\0GK\0GK\0\0\0\0\0\0\0GT\0GT\0\0\0\0\0\0\0G^\0G^" + "\0\0\0\0\0\0\0Gg\0Gg\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" + "\0e\317\0e\317\0\0\0\0\0\0\0L\317\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0e\4\0e\4\0e\4\0\0\0\0e\11\0e\11\0e\11\0\0\0" + "\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0G\11\0\0\0\0G\14\0G\14\0G\14\0\0\0" + "\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0\0G\24\0G\24\0GK\0\0\0\0" + "GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg\0\0\0\0Gq\0Gq\0e\317\0e\317" + "\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0\0\0\0L\317\0L" + "\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0e\4\0e\4\0e\4\0\0\0" + "\0e\11\0e\11\0e\11\0\0\0\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0e\22\0\0\0" + "\0G\14\0G\14\0G\14\0\0\0\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0" + "\0G\24\0G\24\0G\24\0\0\0\0GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg" + "\0\0\0\0Gq\0Gq\0Gq\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" + "\0e\317\0e\317\0e\317\0\0\0\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0e\4\0e\4\0e\4\0\0\0\0b\10\0b\10\0b\10\0\0\0\0b\15\0b\15\0b\15\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0<\16\0<\16\0<\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0""2J\0""2J\0""2J\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e" + "\317\0\0\0\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0c\0\0c\0\0\0\0\0" + "`\0\0c\0\0c\0\0\2\0\0c\1\0i\0\0i\0\0\0\0\0\0\0\0e\0\0e\0\0\0\0\0\0\0\0{\1" + "\0{\1\0f\0\0f\0\0z\1\0z\1\0z\1\0z\1\0)\4\0)\4\0\0\0\0\0\0\0Q\7\0Q\7\0\0\0" + "\0\0\0\0{&\0{&\0W\32\0W\32\0z&\0z&\0z&\0z&\0IC\0IC\0\0\0\0\0\0\0X^\0X^\0" + "\0\0\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0" + "\261\251\0\261\251\0\0\0\0\0\0\0e\317\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\216\1\0c\0\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0k\1\0i\0\0" + "\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0{\1\0f\0\0z\1\0z\1\0z\1\0z\1" + "\0\221\1\0\221\1\0\221\17\0\0\0\0)\4\0c\11\0c\11\0\0\0\0\256+\0\256+\0{&" + "\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\243\210\0\0\0\0IC\0{|\0{|\0\0\0\0" + "\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261" + "\251\0\261\251\0\261\251\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0" + "k\1\0k\1\0\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0\256\2\0f\0\0z\1\0" + "z\1\0z\1\0z\1\0\221\1\0\221\1\0\221\1\0\0\0\0\221\17\0\221\17\0)\4\0\0\0" + "\0\256+\0\256+\0\256+\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\2415\0\0\0\0" + "\243\210\0\243\210\0IC\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261" + "\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\264\360" + "\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1" + "\0\211\1\0c\0\0\2\0\0c\0\0c\0\0k\0\0\12\0\0k\1\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0\264\360" + "\0\264\360\0\264\360\0\0\0\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216\1" + "\0c\0\0\2\0\0c\0\0k\0\0q\0\0\20\0\0\0\0\0\0\0\0\322\1\0\322\1\0\322\1\0\322" + "\1\0\346\1\0\346\1\0\0\0\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0" + "\363\2\0\0\0\0\0\0\0\322!\0\322!\0\322!\0\322!\0\371(\0\371(\0\0\0\0\0\0" + "\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\0\0\0\0\0\0\325\215\0\325\215" + "\0\325\215\0\325\215\0\374\264\0\374\264\0\0\0\0\0\0\0\325\251\0\325\251" + "\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\0\0\0\0\0" + "\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216" + "\1\0c\0\0\2\0\0f\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\322\1\0\322\1\0\346" + "\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0\363\2" + "\0\363\2\0\0\0\0\322\3\0\322\3\0\322!\0\322!\0\371(\0\371(\0\371(\0\0\0\0" + "\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\3227\0\3227\0\325" + "\215\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0\325\251\0" + "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" + "\251\0\330\360\0\330\360\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\216\1\0\216\1\0c\0\0\10\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\325" + "\3\0\322\1\0\346\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2" + "\0\363\2\0\363\2\0\363\2\0\0\0\0\322\3\0\322\3\0\322\3\0\322!\0\371(\0\371" + "(\0\371(\0\0\0\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\322" + "7\0\3227\0\3227\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0" + "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" + "\251\0\325\251\0\325\251\0\330\360\0\330\360\0\330\360\0\0\0\0\264\360\0" + "\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0i\0\0\10\0\0m\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\275\1\0\275\1\0\275\1\0" + "\275\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\244!\0\244!\0\244!\0\244!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213n\0\213n\0\213n\0\213n\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\224\1\0i\0\0\10\0" + "\0\0\0\0\0\0\0\325\3\0\325\3\0\325\3\0\351\3\0\365\1\0\365\1\0\14\0\0\313" + "\2\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" + "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0\304-\0Y!\0Y!\0\0\0\0\0\0\0\371p\0" + "\371p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0""3(\0\247\227\0\211" + "s\0\211s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\224\1\0i\0\0\0\0\0\0\0\0\325\3\0\325" + "\3\0\325\3\0\17\2\0\"\2\0!\0\0\35\0\0#\2\0\342\4\0\342\4\0\0\0\0\371\37\0" + "\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775" + "\0\374%\0\304\34\0Y!\0\373C\0\373C\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371" + "p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\211s\0\375" + "\342\0\375\342\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0" + "\0\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\224\1\0\0\0" + "\0\0\0\0\325\3\0\325\3\0\325\3\0\344\5\0\"\2\0\"\2\0\200\0\0#\2\0\342\4\0" + "\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37" + "\0\371\37\0\3775\0\3775\0\3775\0\304\34\0\3732\0\3732\0Y!\0\0\0\0\371p\0" + "\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377" + "\256\0\247q\0\375\274\0\375\274\0\211s\0\0\0\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\12\0\0\0\0\0i\0\0\0\0\0\325\3\0\325\3\0\344\5\0\344\5" + "\0\"\2\0\36\1\0""4\2\0#\2\0\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0" + "\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\3732\0" + "\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371" + "p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0" + "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0" + "\10\0\0\0\0\0\325\3\0\344\5\0\344\5\0\344\5\0\340\4\0\367\11\0\364\3\0#\2" + "\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371" + "\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\3732\0\3732\0\0\0\0\371p\0\371p" + "\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0" + "\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\10\0\0\0\0\0\0\0\0\17\2\0\17" + "\2\0\17\2\0\323\2\0\352\7\0\347\2\0\26\1\0\0\0\0\371\37\0\371\37\0\371\37" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0\0\0\0""7\36\0""6\25\0" + """6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0" + "O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\12\0" + "\0\10\0\0\0\0\0\17\2\0\17\2\0\344\5\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0" + "\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\362\4\0\0\0\0/\26\0/\26\0" + "\3775\0$\21\0""7\36\0""7\36\0\3672\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0" + "\0\0\0\0\370A\0\0\0\0O>\0O>\0\377\256\0""3(\0VK\0VK\0\372\264\0\0\0\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\341\271\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\343\350\0\0\0\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\10\0\0\0\0" + "\0\17\2\0\17\2\0\17\2\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0\0\371\37\0\371" + "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0$\21\0""7\36" + "\0""7\36\0""6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0O>\0O>\0O>\0""3(\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\5\0\0\5\0\0\5\0\0\0\0\0\344\5\0\344\5\0\344\5\0\316\4\0\367" + "\11\0\367\11\0\364\3\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371" + "\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0" + "\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377" + "\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5" + "\0\0\5\0\0\5\0\0\17\2\0\344\5\0\344\5\0\316\4\0\345\11\0\367\11\0\364\3\0" + "\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37" + "\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371" + "p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q" + "\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\0\0\0\17\2" + "\0\344\5\0\344\5\0\15\1\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37\0\371\37\0" + "\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0\307)\0\376" + "G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0" + "\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0" + "\5\0\0\17\2\0\17\2\0\344\5\0\316\4\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37" + "\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0" + "\307)\0\376G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" + "p\0\371p\0\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\5\0\0\24\2\0\17\2\0\17\2\0\316\4\0\345\11\0$\6\0#\2\0\0\0\0\371" + "\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0" + "\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0" + "\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274" + "\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\24\2\0\24" + "\2\0\17\2\0\316\4\0\345\11\0\342\3\0#\2\0\0\0\0\371\37\0\371\37\0\371\37" + "\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0" + "\376G\0\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" + "p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274" + "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\24\2\0\5\0\0\0\0\0\27\5\0\342\3\0\313" + "\1\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\371\37\0\0\0\0\0\0\0/\26\0" + "\3775\0\371\37\0\302\30\0\3716\0Y!\0#\14\0\0\0\0\371p\0\371p\0\0\0\0\0\0" + "\0\0\0\0\371p\0\0\0\0\0\0\0O>\0\377\256\0\371p\0\243I\0\371\224\0\211s\0" + """3(\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0\0\371" + "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0\0\0\0" + "\0""6\25\0""6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374" + "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0" + "\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0" + "\0\0\0\0""6\25\0""6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0" + "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\16\0\0\0\0\0\26\1\0\26\1\0\26" + "\1\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0" + "/\26\0.\17\0\0\0\0""6\25\0""6\25\0""6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0" + "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360" + "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\14\0\0\14" + "\0\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" + "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0#\14\0Y!\0Y!\0\0\0\0\0\0\0\371p\0\371" + "p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0""3(\0""3(\0\211s\0\211" + "s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the BlitBlendAll test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlendAll() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageBlitBlendAll.pixel_data, + SDLTest_imageBlitBlendAll.width, + SDLTest_imageBlitBlendAll.height, + SDLTest_imageBlitBlendAll.bytes_per_pixel * 8, + SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} diff --git a/src/test/SDL_test_imageFace.c b/src/test/SDL_test_imageFace.c new file mode 100644 index 0000000000..46c117a4f6 --- /dev/null +++ b/src/test/SDL_test_imageFace.c @@ -0,0 +1,246 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_test.h" + +/* GIMP RGBA C-Source image dump (face.c) */ + +const SDLTest_SurfaceImage_t SDLTest_imageFace = { + 32, 32, 4, + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0" + "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0" + "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377" + "\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0" + "\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0" + "\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0" + "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0" + "\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377" + "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377" + "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" + "\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377" + "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" + "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0" + "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0" + "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0", +}; + +/** + * \brief Returns the Face test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageFace() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imageFace.pixel_data, + SDLTest_imageFace.width, + SDLTest_imageFace.height, + SDLTest_imageFace.bytes_per_pixel * 8, + SDLTest_imageFace.width * SDLTest_imageFace.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} + diff --git a/src/test/SDL_test_imagePrimitives.c b/src/test/SDL_test_imagePrimitives.c new file mode 100644 index 0000000000..93b99d6922 --- /dev/null +++ b/src/test/SDL_test_imagePrimitives.c @@ -0,0 +1,512 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_test.h" + +/* GIMP RGB C-Source image dump (primitives.c) */ + +const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = { + 80, 60, 3, + "\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15" + "I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310" + "\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0" + "\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0" + "\0\5ii\0\0\0\5ii\0\0\0\3\1\1\0\0\0\5\2\1\0\0\0\7\3\2\0\0\0\11\4\3\0\0\0\13" + "\5\3\0\0\0\15\6\4\0\0\0\17\7\5\0\0\0\21\10\5\0\0\0\23\11\6\0\0\0\25\12\7" + "\0\0\0\27\13\7\0\0\0\31\14\10\0\0\0\33\15\11\0\0\0\35\16\11\0\0\0\37\17\12" + "\0\0\0!\20\13\0\0\0#\21\13\0\0\0%\22\14\0\0\0'\23\15\15I\310)\24\15\15I\310" + "+\25\16\15I\310-\26\17\15I\310/\27\17\15I\3101\30\20\15I\3103\31\21\15I\310" + "5\32\21\15I\3107\33\22\15I\3109\34\23\15I\310;\35\23\15I\310=\36\24\15I\310" + "?\37\25\15I\310A\40\25\15I\310C!\26\15I\310E\"\27\15I\310G#\27\15I\310I$" + "\30\15I\310K%\31\15I\310M&\31\5iiO'\32\0\0\0\0\0\0\5ii\0\0\0\10\4\2\0\0\0" + "\14\6\4\0\0\0\20\10\5\0\0\0\24\12\6\0\0\0\30\14\10\0\0\0\34\16\11\0\0\0\40" + "\20\12\0\0\0$\22\14\0\0\0(\24\15\0\0\0,\26\16\0\0\0""0\30\20\0\0\0""4\32" + "\21\0\0\0""8\34\22\0\0\0<\36\24\0\0\0@\40\25\0\0\0D\"\26\0\0\0H$\30\0\0\0" + "L&\31\0\0\0P(\32\15I\310T*\34\15I\310X,\35\15I\310\\.\36\15I\310`0\40\15" + "I\310d2!\15I\310h4\"\15I\310l6$\15I\310p8%\15I\310t:&\15I\310x<(\15I\310" + "|>)\15I\310\200@*\15I\310\204B,\15I\310\210D-\15I\310\214F.\15I\310\220H" + "0\15I\310\224J1\15I\310\230L2\5ii\234N4\15I\310\0\0\0\0\0\0\0\0\0\5ii\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d" + "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5" + "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0""77\5\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5" + "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5i" + "i\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\5ii\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310" + "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d7" + "7\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5" + "ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\5ii\15I\310\15I\310\15I\310\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii" + "\15I\310\15I\310\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\5ii\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\5ii", +}; + +/** + * \brief Returns the Primitives test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImagePrimitives() +{ + SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + (void*)SDLTest_imagePrimitives.pixel_data, + SDLTest_imagePrimitives.width, + SDLTest_imagePrimitives.height, + SDLTest_imagePrimitives.bytes_per_pixel * 8, + SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel, +#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) + 0xff000000, /* Red bit mask. */ + 0x00ff0000, /* Green bit mask. */ + 0x0000ff00, /* Blue bit mask. */ + 0x000000ff /* Alpha bit mask. */ +#else + 0x000000ff, /* Red bit mask. */ + 0x0000ff00, /* Green bit mask. */ + 0x00ff0000, /* Blue bit mask. */ + 0xff000000 /* Alpha bit mask. */ +#endif + ); + return surface; +} diff --git a/src/test/SDL_test_imagePrimitivesBlend.c b/src/test/SDL_test_imagePrimitivesBlend.c new file mode 100644 index 0000000000..ce9adc51a9 --- /dev/null +++ b/src/test/SDL_test_imagePrimitivesBlend.c @@ -0,0 +1,694 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_test.h" + +/* GIMP RGB C-Source image dump (alpha.c) */ + +const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = { + 80, 60, 3, + "\260e\15\222\356/\37\313\15\36\330\17K\3745D\3471\0\20\0D\3502D\3502<\321" + ",\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0-\0\377\377" + "\377\377\377\377\311\324\311\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\0H\0\377\377\377\377\377\377\256\307\256\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\0c\0\377\377\377\377\377\377" + "\223\300\223\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\0~\0\377\377\377\377\377\377x\277x\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\0\231\0\377\377\377\377\377\377]\303]\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\0\264\0\377\377\377\377\377" + "\377B\316B\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0" + "\317\0\377\377\377\377\377\377'\335'\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\0\352\0\377\377\377#\262\6\260d\15\260e\15\224\357" + "/&\262\6\34\300\5.\314\22\40\315\12[\3747M\332/\27\331\12\27\331\12K\374" + "5K\3745K\3745D\3471D\3471D\3471D\3471D\3471D\3502D\3502D\3502D\3502D\350" + "2D\3502D\3502D\3502D\3502D\3502\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377,\372\27\273\3465\327" + "Q.\260d\15\213\213\40\241\3601\200\366*=\265\13?\301\25s\375\265\14\177\252+\201\210\16\245\204" + "*\377\314U\312\\,\224'\11\260i\17\244\210\40\232\2211\331\353J\215\2351\377" + "\377\276\200\2521\200\2542\375\377\310u\2661t\2702t\2702\367\377\324\325" + "\355\305h\3021h\3042h\3042\377\377\377\377\377\377\364\377\336\335\364\323" + "\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346" + "\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377" + "\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\3342\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\27\331\12Y\316-h\3021\243\370Cg\230\15\230\224\"\245" + "\204*\377\314U\310J\21\327Q.\260b\21\245\2041\370\343N\230\2242\331\353J" + "\214\2402\377\377\276\200\2521\200\2542\375\377\310\317\344\266u\2661t\270" + "2\377\377\377\367\377\324\325\355\305h\3021h\3042h\3042h\3042\377\377\377" + "\377\377\377\364\377\336\335\364\323\335\364\323\335\364\323\335\364\323" + "\\\3202\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371" + "\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377\377" + "\377\377\377\377\377\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\334" + "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377K\3745!\315\13d\304,p\270)\177\252+\23\13\6\232\2211\245\204" + "1\347\270O\377\277Y\324<\22\265V\24\377\330Q\244\210\40#(\13\230\224\"\331" + "\353Ju\211.\377\377\276\200\2521\210\273:\200\2542\375\377\310\20""3\6u\266" + "1t\2702\271\307\271\367\377\324\325\355\305\341\377\321h\3021h\3042\16L\7" + "h\3042\377\377\377\242\300\242\377\377\377\335\364\323\355\377\343\335\364" + "\323\335\364\323\14f\7\\\3202\\\3202>\250*\\\3202\377\377\377\377\377\377" + "\377\377\377\377\377\377$\231$\377\377\377\377\377\377s\303s\377\377\377" + "\346\371\342\376\377\372\346\371\342\346\371\342\40\257\37\346\371\342\346" + "\371\342\\\316\\\377\377\377\377\377\377\377\377\377\377\377\377P\3342\13" + "\262\7P\3342P\3342*\327%P\3342P\3342o\377Q\377\377\377\377\377\377$\352$" + "\377\377\377\377\377\377K\3745]\3749s\375<\212\373@\243\370C\274\363G\331" + "\353J\370\343N\377\330Q\377\314U\377\277Y\377\260\\\224(\11\260|\36\245\204" + "1\377\377\250\232\2211\230\224\"\215\2351\214\2402\377\377\276\312\332\250" + "\200\2521\200\2542\377\377\377\317\344\266u\2661t\2702t\2702\377\377\377" + "\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\3042h\3042\377\377" + "\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364\323\335\364" + "\323\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342" + "\346\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377P\3342P\3342" + "P\3342P\3342\377\377\377K\3745O\3321\\\3161h\3021t\2702~\254'\214\240%\377" + "\377\262\370\343N\377\330Q\262x1\277l1\312`1\327R.\260X\23\377\330Q\244\210" + "2\377\377\250\230\2242\377\377\262\215\2351\214\2402\377\377\377\312\332" + "\250\200\2521\200\2542\377\377\377\375\377\310\317\344\266u\2661t\2702t\270" + "2\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\304" + "2h\3042h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\\\3202\\\320" + "2\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346\371\342\346" + "\371\342\346\371\342\346\371\342\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377D\3471O\3321\21\7\11c\304+\367\377\324o\2520\200\252" + "1\214\2402\235\226'\377\377\250\377\330Q!\20\11\277l1\310d2\266?\33\224(" + "\11\260|\36\257\217;\377\377\250\232\2211\34$\11\377\377\262\215\2351q\206" + "0\377\377\377\312\332\250\217\303@\200\2542\200\25420Z0\317\344\266\317\344" + "\266X\2260t\2702t\2702\377\377\377\377\377\377\325\355\305(l%\325\355\305" + "\325\355\305K\2410h\3042h\3042\377\377\377\377\377\377\377\377\3770\2200" + "\377\377\377\377\377\377t\274p\335\364\323\335\364\323\373\377\361\377\377" + "\377\377\377\377\21\213\11\\\3202\\\3202<\274/\\\3202\377\377\377\377\377" + "\377\377\377\377\377\377\3770\3060\377\377\377\377\377\377V\330V\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\3770\3410\346\371\342\346" + "\371\342>\352>\346\371\342\377\377\377D\3471P\3342\364\377\352s\375\3369\\\3202\377\377\377\377\377\377\377\377\377\377\377\377D\3502\371\377" + "\364O\3321\\\3202\364\377\336h\3042\367\377\324u\2661\200\2542\377\377\276" + "\215\2351\230\2242\307\300\213\244\2102\377\377\234\262x1\274p2\377\337\207" + "\312`1\324E\30\327T1\260|2\377\377\234\245\2041\244\2102\377\377\250\232" + "\2211\230\2242\377\377\377\310\316\231\215\2351\214\2402\377\377\377\377" + "\377\377\312\332\250\312\332\250\200\2542\200\2542\377\377\377\377\377\377" + "\317\344\266\317\344\266\317\344\266t\2702t\2702t\2702\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355" + "\305\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\377\377" + "\377\377\377\377\377\377\377\\\3202\\\3202\\\3202\377\377\377D\3502\371\377" + "\364O\3321\377\377\377\\\3161h\3042\367\377\324t\2702\375\377\310\200\252" + "1\377\377\377\215\2351\230\2242\377\377\250\244\2102\377\377\234\262x1\274" + "p2\316\214_\310d2\377\310|\327T1\227/\14\377\377\377\307\260|\244\2102\377" + "\377\377\307\300\213\230\2242\230\2242\377\377\377\310\316\231\214\2402\214" + "\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\2542\377" + "\377\377\377\377\377\377\377\377\317\344\266\317\344\266\317\344\266t\270" + "2t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377h\3042h\3042" + "h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364" + "\323\335\364\323\335\364\323\377\377\377\377\377\377\377\377\377\377\377" + "\377D\3502\371\377\364R\3344\364\377\352\\\3161H\22Hh\3021\377\377\377o\244" + "2\200\2542\312\332\250\226\245<\377\377\262\230\2242H-/\245\2041\377\377" + "\377\233i5\274p2\277l1\331sC\377\310|\324X2*\15\3\260|2\377\377\234\206s" + "7\244\2102\377\377\250\340\337\244\230\2242\377\377\377Hc2\310\316\231\214" + "\2402n\211:\377\377\377\377\377\377\353\377\311\312\332\250\200\2542$T\16" + "\377\377\377\377\377\377\236\277\236\377\377\377\317\344\266\367\377\336" + "\377\377\377t\2702\40n\16t\2702\377\377\377\212\303\212\377\377\377\377\377" + "\377\377\377\377\325\355\305\325\355\305<\2477\377\377\377\377\377\377O\276" + "Ah\3042h\3042\237\377i\377\377\377\377\377\377H\317H\377\377\377\377\377" + "\377c\335c\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323>\337" + ";\335\364\323\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\364" + "\377\336h\3042\367\377\324t\2702\375\377\310\200\2542\377\377\276\214\240" + "2\377\377\262\232\2211\377\377\377\245\2041\377\377\377\262x1\377\377\377" + "\277l1\310d2\312`1\324X2\327T1\260|2\377\377\377\307\260|\244\2102\377\377" + "\377\307\300\213\232\2211\230\2242\377\377\377\377\377\262\310\316\231\214" + "\2402\214\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200" + "\2542\200\2542\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266" + "\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\325\355" + "\305\377\377\377\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\335" + "\364\323h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377" + "\377\215\2351\377\377\377\232\2211\377\377\377\245\2041\377\377\377\262x" + "1\377\377\377\277l1\377\377\377\312`1\377\310|\327T1\227/\14\377\377\377" + "\307\260|\244\2102\244\2102\377\377\377\307\300\213\230\2242\230\2242\377" + "\377\377\310\316\231\310\316\231\214\2402\214\2402\377\377\377\377\377\377" + "\312\332\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377" + "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" + "\377t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\377\377" + "\377\377\377\377\377\377\377h\3042h\3042h\3042\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360" + "T\11TO\3321\377\377\377Z\3002\377\377\377h\3042\377\377\334t\2702\375\377" + "\310*\30\20\312\332\250\214\2402\262\260\214\230\2242\307\300\213\377\377" + "\377\245\2041\377\377\377:\35\20\377\377\377\277l1\316\264w\310d2\377\310" + "|\356qL\227/\14\260|2TZ3\307\260|\244\2102\274\302\274\307\300\213\307\300" + "\213\273\301U\377\377\377\377\377\377A^2\310\316\231\214\2402o\216B\377\377" + "\377\377\377\377\366\377\324\312\332\250\312\332\250*a\20\200\2542\377\377" + "\377\230\301\230\377\377\377\377\377\377\377\377\353\317\344\266\317\344" + "\266T\253Tt\2702t\2702]\265I\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377T\306T\377\377\377\325\355\305l\324i\325\355\305\377\377" + "\377\377\377\377\377\377\377h\3042\"\254\20h\3042h\3042b\353b\377\377\377" + "\377\377\377D\3502\362\375\360\377\377\377O\3321\377\377\377\\\3202\364\377" + "\336h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377\377" + "\214\2402\377\377\262\230\2242\307\300\213\244\2102\307\260|\377\377\377" + "\262x1\377\377\377\274p2\377\337\207\310d2\377\310|\324X2\333bB\260|2\377" + "\377\377\307\260|\244\2102\244\2102\377\377\377\307\300\213\232\2211\230" + "\2242\377\377\377\377\377\377\310\316\231\310\316\231\214\2402\214\2402\377" + "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\254" + "2\200\2542\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" + "\344\266\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\325\355\305" + "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377\377\377\377" + "h\3042h\3042\377\377\377\377\377\377D\3471\377\377\377P\3342\364\377\352" + "\\\3202\335\364\323\377\377\377h\3021\377\377\377t\2702\375\377\310\200\254" + "2\312\332\250\377\377\377\215\2351\377\377\377\230\2242\377\377\250\244\210" + "2\307\260|\377\377\377\262x1\377\377\377\274p2\377\337\207\310d2\323xQ\324" + "X2\327T1\227/\14\260|2\377\377\234\307\260|\244\2102\377\377\377\377\377" + "\377\307\300\213\230\2242\230\2242\377\377\377\377\377\377\310\316\231\310" + "\316\231\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250" + "\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" + "\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325" + "\355\305\377\377\377\377\377\377`\0`\377\377\377D\3471\371\366\371P\3342" + "\346\371\342\377\377\377\\\3161\377\377\377'\24\22\325\355\305t\2702\276" + "\310\251\377\377\377\200\2542\377\377\316\214\2402\310\316\231`6`\230\224" + "2\377\377\250\222u<\307\260|\377\377\377\315\214L\377\377\377\274p2M,#\310" + "d2\312`1\306\304\306\324X2\333bB\325\242W\377\377\377\307\260|=9\22\244\210" + "2\377\377\377\227\234w\307\300\213\230\2242\307\322a\377\377\377\377\377" + "\377Km9\310\316\231\214\2402r\226K\377\377\377\377\377\377\377\377\377\312" + "\332\250\312\332\250`\242`\200\2542\200\2542\224\306\224\377\377\377\377" + "\377\377\377\377\377\377\377\377\317\344\266M\250D\317\344\266\377\377\377" + "\203\322\203t\2702t\2702\301\377\177\377\377\377\377\377\377`\330`\377\377" + "\377\377\377\377r\344r\377\377\377\377\377\377\377\377\377\325\355\305\377" + "\377\377\377\377\377D\3502\371\377\364P\3342\346\371\342\377\377\377\\\320" + "2\364\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\200\2542\312" + "\332\250\377\377\377\214\2402\310\316\231\230\2242\307\300\213\377\377\377" + "\244\2102\307\260|\377\377\377\200U0\220^\377\7\4/\227U[\246]\377\255Q1\377" + "\242y\10\3/\306M@\6\4/{^\377mVvmVv\6\5/h\\\377h\\\377\\U\204\12\12\360\5" + "\5/VX\377VX\377\12\12\360LR\221\12\12\360\5\6/\214\2402\377\377\377\377\377" + "\377\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200" + "\2542\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344" + "\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371" + "\342\377\377\377\\\3202\335\364\323\377\377\377h\3042\367\377\324t\2702\317" + "\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402\377\377\262" + "\230\2242\307\300\213\377\377\377\244\2102\307\260|{^\377\200U0\220^\377" + "\7\4/\227U[\246]\377\7\3/\377\242y\236\37""2\306M0\210%\14T-2{^\377mVv\6" + "\5/\6\5/h\\\377\\U\204\\U\204\5\5/\5\5/VX\377VX\377LR\221LR\221\377\377\377" + "\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250\312\332" + "\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266\377" + "\377\377\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377D\3502\365\375\363\377\377" + "\377O\3321l\22l\\\3202\335\364\323\357\346\357h\3042\325\355\305\377\377" + "\377t\2702\317\344\266l-l\200\2521\377\377\377\204\211=\310\316\231\377\377" + "\377\262\243L\307\300\213\377\377\377E&\25mVv{^\377ySB\220^\377\7\4/\275" + "t\201\246]\377\7\3/I\37!\277Z\377\10\3/\237YQ\6\4/{^\377\236\213\247mVv\6" + "\5/,-lh\\\377\\U\204dow\5\5/\5\5/\222\251\377VX\377\310\316\231T{@\377\377" + "\377\214\2402w\240V\377\377\377\377\377\377\377\377\377\377\377\377\312\332" + "\250U\231G\377\377\377\200\2542q\270\\\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377l\317l\317\344\266\317\344\266z\330v\377\377\377" + "\377\377\377\323\377\221t\2702t\2702l\352l\377\377\377\377\377\377\377\377" + "\377D\3502\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\364" + "\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200" + "\2542\312\332\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\307" + "\300\213\377\377\377\6\5/mVv{^\377\200U0\220^\377\7\4/\227U[\246]\377\7\3" + "/\255RN\277Z\377\10\3/\306M@\6\4/{^\377{^\377mVv\6\5/\6\5/h\\\377h\\\377" + "\\U\204\12\12\360\5\5/\12\12\360\377\377\377\377\377\377\310\316\231\310" + "\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377" + "\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200\254" + "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\317\344\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702" + "\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\3342\346\371\342" + "\377\377\377\\\3202\335\364\323\377\377\377h\3042\325\355\305\377\377\377" + "t\2702\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402" + "\310\316\231\377\377\377\230\2242\307\300\213h\\\377\6\5/mVv{^\377\200U0" + "\220^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{" + "^\377mVvmVv\6\5/\12\12\360h\\\377\\U\204\\U\204\5\5/\230\2242\377\377\377" + "\377\377\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214" + "\2402\377\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332" + "\250\377\377\377\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" + "\344\266\377\377\377\377\377\377\377\377\377\377\377\377D\3502q\10p\377\377" + "\377P\3342\335\350\332\377\377\377\\\3202\351\366\337\377\377\377h\3042d" + "!\\\377\377\377t\2702\277\302\252\377\377\377\200\2542\343\345\301\377\377" + "\377\214\2402^2H\377\377\377\230\2242\257\235\204h\\\377\6\5/\223o\234{^" + "\377\6\4/<\36""1\377\252\215j)2\211XK\377\250\203\202$2\337~c\377\242y\236" + "\37""2]#\26\306M@\6\4/ym\274{^\377mVvELn\6\5/h\\\37703x\\U\204\307\300\213" + "\204\226\\\230\2242\377\377\377\377\377\377\377\377\377\310\316\231^\212" + "H\377\377\377\214\2402}\256b\377\377\377\377\377\377\377\377\377\377\377" + "\377\312\332\250_\251O\377\377\377\377\377\377y\310j\200\2542\377\377\377" + "\377\377\377\377\377\377\377\377\377x\341x\377\377\377\377\377\377\177\350" + "|\317\344\266\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\334" + "2\346\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\304" + "2\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200\2542\312\332" + "\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\\U\204h\\\377" + "\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\255" + "RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377mVvmVv\6\5/\12\12\360h\\\377" + "\377\377\377\307\300\213\377\377\377\230\2242\230\2242\377\377\377\377\377" + "\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214\2402\377" + "\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\312" + "\332\250\377\377\377\200\2542\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\350" + "2\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377\377\377\\\320" + "2\335\364\323\377\377\377h\3042\325\355\305\377\377\377t\2702\317\344\266" + "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\214\2402\310\316" + "\231\377\377\377\5\5/\\U\204h\\\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220" + "^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{^\377" + "\12\12\360mVv\6\5/\6\5/\377\377\377\377\377\377\307\300\213\307\300\213\377" + "\377\377\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" + "\231\310\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377" + "\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377\377\377\377\377" + "\204\0\204\377\377\377D\3502\355\364\353\377\377\377\377\377\377Y\335;\346" + "\371\342\377\377\377/\26\31\335\364\323\377\377\377k\255<\325\355\305\377" + "\377\377\377\377\377t\2702\317\344\266\2046\204\200\2542\312\332\250\340" + "\317\340\214\2402\310\316\231\377\377\377VX\377\5\5//\33Dh\\\377\6\5/tVz" + "{^\377\6\4/=0\377\201Vi\220^\377\3\1\30\227U[\246]\377?6U\255RN\277Z\377" + "\337]s\306M0\306M@\3\2\30{^\377{^\377yv}mVv\244\2102\377\377\377\377\377" + "\377\377\377\377gyG\307\300\213\230\2242\212\242h\377\377\377\377\377\377" + "\377\377\377\377\377\377\310\316\231g\230O\377\377\377\214\2402\205\274q" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377h\270V\312\332" + "\250\377\377\377\222\344\222\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346" + "\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\3042\325" + "\355\305\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" + "\332\250\377\377\377\214\2402\310\316\231VX\377\12\12\360\5\5/\\U\204h\\" + "\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3" + "/\255RN\255RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377\12\12\360\307\260" + "|\244\2102\244\2102\377\377\377\377\377\377\377\377\377\307\300\213\377\377" + "\377\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310" + "\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377" + "\377\377\377\200\2542\200\2542\377\377\377\377\377\377D\3502\377\377\377" + "\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\377\377\377" + "\335\364\323\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702" + "\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\377\377\377\214" + "\2402LR\221VX\377\5\5/\\U\204\12\12\360h\\\377\6\5/mVv{^\377\6\4/\12\12\360" + "\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\7\3/\255RN\277Z\377\10\3/\306M@" + "\6\4/\6\4/{^\377\377\377\377\307\260|\377\377\377\244\2102\377\377\377\377" + "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\377\377" + "\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231\377\377" + "\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377\377\377\377" + "\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377\377-\17\34\346" + "\371\342\377\377\377\363\346\363\\\3202\335\364\323\377\377\377h\3042\377" + "\377\377x)o\377\377\377t\2702\301\276\255\377\377\377\377\377\377\243\273" + "U\312\332\250\377\377\377O-\34\12\12\360LR\221gU\333\5\5/\\U\204<)\377h\\" + "\377\6\5/=!B{^\377\6\4/A2\306\201Vi\220^\377I9q\227U[\246]\377]-\220\7\3" + "/\255RN\245q\304\10\3/\306M0\377\236\221\6\4/\377\377\377\220\231\220\307" + "\260|\307\260|\226\227m\244\2102\377\377\377\377\377\377\377\377\377\307" + "\300\213p\207N\230\2242\230\2242\254\316\254\377\377\377\377\377\377\377" + "\377\377\310\316\231\310\316\231\220\317\220\377\377\377\214\2402\216\316" + "\200\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377r\310^\312" + "\332\250\377\377\377\377\377\377\377\377\377D\3502\362\375\360\377\377\377" + "P\3342\377\377\377\346\371\342\377\377\377\\\3202\335\364\323\377\377\377" + "\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702\317\344\266" + "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\5\6/LR\221\12\12" + "\360VX\377\5\5/\\U\204h\\\377\12\12\360\6\5/mVv{^\377\6\4/\12\12\360\201" + "Vi\220^\377\7\4/\227U[\12\12\360\246]\377\7\3/\255RN\277Z\377\277Z\377\10" + "\3/\306M@\260|2\260|2\377\377\377\377\377\377\307\260|\377\377\377\244\210" + "2\377\377\377\377\377\377\377\377\377\377\377\377\307\300\213\377\377\377" + "\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" + "\231\310\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377D\3502\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377" + "\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\325\355\305\377" + "\377\377\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" + "\332\250\377\377\377\12\12\360\5\6/LR\221VX\377\12\12\360\5\5/\\U\204h\\" + "\377\6\5/\12\12\360mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\227" + "U[\246]\377\7\3/\255RN\12\12\360\277Z\377\10\3/\333bB\377\377\377\260|2\377" + "\377\377\377\377\377\307\260|\307\260|\244\2102\244\2102\377\377\377\377" + "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\230\224" + "2\377\377\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231" + "\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377)\10\36\362\375\360\377\377\377\370" + "\356\370P\3342\346\371\342\377\377\377\377\377\377\\\3202\207\"\201\377\377" + "\377\377\377\377p\250D\325\355\305\377\377\377\377\377\377t\2702\317\344" + "\266\234?\234\200\2542\377\377\377\274\260\244FS\377\5\6/;#\377LR\221VX\377" + "\3\1\34\12\12\360\\U\204{^\330\6\5/\12\12\360\257\203\270{^\377\6\4/\6\4" + "\222\201Vi\220^\377P@d\12\12\360\227U[\370\244\377\7\3/\255RNi./\277Z\377" + "\324X2\264\202w\333bB\260|2\377\377\377\377\377\377\377\377\377yvK\377\377" + "\377\244\2102\236\247|\377\377\377\377\377\377\377\377\377\307\300\213\307" + "\300\213\234\306\234\230\2242\377\377\377\256\330\256\377\377\377\377\377" + "\377\377\377\377\310\316\231\310\316\231\234\341\234\377\377\377\214\240" + "2\232\343\223\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375" + "\360\377\377\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\" + "\3202\335\364\323\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377" + "\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312\332\250\12" + "\12\360FS\377\5\6/LR\221\12\12\360RW\255\3\5\35\6\11\224ZT\\d[\261\3\4\35" + "\6\11\224lVTw]\264\4\4\35\6\11\224\200VN\214]\270\4\3\35\6\11\224\226UG\242" + "\\\274\4\3\35\4\3\35\254R@\377\377\311\203U\36\203U\36\323a:my\36my\36\377" + "\377\276\377\377\276\243\255X\243\255X\236\371\236e\204\36\236\371\236\374" + "\377\273\236\371\236\236\371\236\234\275`\236\371\236^\220\36^\220\36\236" + "\371\236\352\377\267\352\377\267\236\371\236\236\371\236\310\316\231\310" + "\316\231\377\377\377\377\377\377\214\2402\377\377\377\377\377\377\377\377" + "\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346\371\342\377\377" + "\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\377\377" + "\377\325\355\305\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377" + "\377\377\200\2542\346\3\4\35lVT\4\4hw]\264\4\4\35aK\244\200VN\214]\270kZ\371\4\3\35" + "\270\212Io\225o\377\377\306{a\36\253\300\253\304wB\377\377\311\377\377\377" + "\203U\36\323a:\224D(my\36\236\371\236\307\316\266\377\377\276\236\371\236" + "\377\377\343\236\371\236e\204\36Gk\25\236\371\236\374\377\273\260\334\260" + "\236\371\236\234\275`\377\377\377\377\377\377\230\2242k\207#\377\377\377" + "\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377" + "\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\\3202\377\377" + "\377\335\364\323\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377" + "\377\377\377\377\377t\2702\317\344\266\377\377\3778L\377\12\12\360\5\6/<" + "L\237\12\12\360BR\252\3\5\35\6\11\224JQbRW\255\6\11\224\3\5\35ZT\\\6\11\224" + "d[\261\6\11\224\3\4\35lVT\6\11\224w]\264\4\4\35\6\11\224\200VN\214]\270\6" + "\11\224tm\36\270\212I\270\212I\377\377\306{a\36{a\36\304wB\236\371\236\377" + "\377\311\203U\36\236\371\236\323a:my\36my\36\236\371\236\377\377\276\236" + "\371\236\243\255X\243\255X\236\371\236e\204\36\236\371\236\374\377\273\374" + "\377\273\236\371\236\307\300\213\307\300\213\377\377\377\377\377\377\230" + "\2242\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377" + "\377\377\377\377\377P\3342\377\377\377\346\371\342\377\377\377\377\377\377" + "\\\3202\335\364\323\377\377\377\377\377\377\377\377\377h\3042\325\355\305" + "\377\377\377\377\377\377t\2702\377\377\377\317\344\2668L\377\12\12\360\5" + "\6/\12\12\360 + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + + Used by the test framework and test cases. + +*/ + +/* quiet windows compiler warnings */ +#define _CRT_SECURE_NO_WARNINGS + +#include "SDL_config.h" + +#include /* va_list */ +#include +#include +#include + +#include "SDL.h" + +#include "SDL_test.h" + +/*! + * Converts unix timestamp to its ascii representation in localtime + * + * Note: Uses a static buffer internally, so the return value + * isn't valid after the next call of this function. If you + * want to retain the return value, make a copy of it. + * + * \param timestamp A Timestamp, i.e. time(0) + * + * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02' + */ +char *SDLTest_TimestampToString(const time_t timestamp) +{ + time_t copy; + static char buffer[64]; + struct tm *local; + const char *fmt = "%x %X"; + + SDL_memset(buffer, 0, sizeof(buffer)); + copy = timestamp; + local = localtime(©); + strftime(buffer, sizeof(buffer), fmt, local); + + return buffer; +} + +/* + * Prints given message with a timestamp in the TEST category and INFO priority. + */ +void SDLTest_Log(const char *fmt, ...) +{ + va_list list; + char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; + + /* Print log message into a buffer */ + SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); + va_start(list, fmt); + SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list); + va_end(list); + + /* Log with timestamp and newline */ + SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_INFO, " %s: %s", SDLTest_TimestampToString(time(0)), logMessage); +} + +/* + * Prints given message with a timestamp in the TEST category and the ERROR priority. + */ +void SDLTest_LogError(const char *fmt, ...) +{ + va_list list; + char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH]; + + /* Print log message into a buffer */ + SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); + va_start(list, fmt); + SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list); + va_end(list); + + /* Log with timestamp and newline */ + SDL_LogMessage(SDL_LOG_CATEGORY_TEST, SDL_LOG_PRIORITY_ERROR, "%s: %s", SDLTest_TimestampToString(time(0)), logMessage); +} diff --git a/src/test/SDL_test_md5.c b/src/test/SDL_test_md5.c new file mode 100644 index 0000000000..3f42ed3566 --- /dev/null +++ b/src/test/SDL_test_md5.c @@ -0,0 +1,336 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + *********************************************************************** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. ** + *********************************************************************** + */ + +/* + *********************************************************************** + ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** + ** ** + ** License to copy and use this software is granted provided that ** + ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** + ** Digest Algorithm" in all material mentioning or referencing this ** + ** software or this function. ** + ** ** + ** License is also granted to make and use derivative works ** + ** provided that such works are identified as "derived from the RSA ** + ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** + ** material mentioning or referencing the derived work. ** + ** ** + ** RSA Data Security, Inc. makes no representations concerning ** + ** either the merchantability of this software or the suitability ** + ** of this software for any particular purpose. It is provided "as ** + ** is" without express or implied warranty of any kind. ** + ** ** + ** These notices must be retained in any copies of any part of this ** + ** documentation and/or software. ** + *********************************************************************** + */ + +#include "SDL_config.h" + +#include "SDL_test.h" + +/* Forward declaration of static helper function */ +static void SDLTest_Md5Transform(MD5UINT4 * buf, MD5UINT4 * in); + +static unsigned char MD5PADDING[64] = { + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* F, G, H and I are basic MD5 functions */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ + +/* Rotation is separate from addition to prevent recomputation */ +#define FF(a, b, c, d, x, s, ac) \ + {(a) += F ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) \ + {(a) += G ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) \ + {(a) += H ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) \ + {(a) += I ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +/* + The routine MD5Init initializes the message-digest context + mdContext. All fields are set to zero. +*/ + +void SDLTest_Md5Init(SDLTest_Md5Context * mdContext) +{ + if (mdContext==NULL) return; + + mdContext->i[0] = mdContext->i[1] = (MD5UINT4) 0; + + /* + * Load magic initialization constants. + */ + mdContext->buf[0] = (MD5UINT4) 0x67452301; + mdContext->buf[1] = (MD5UINT4) 0xefcdab89; + mdContext->buf[2] = (MD5UINT4) 0x98badcfe; + mdContext->buf[3] = (MD5UINT4) 0x10325476; +} + +/* + The routine MD5Update updates the message-digest context to + account for the presence of each of the characters inBuf[0..inLen-1] + in the message whose digest is being computed. +*/ + +void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, + unsigned int inLen) +{ + MD5UINT4 in[16]; + int mdi; + unsigned int i, ii; + + if (mdContext == NULL) return; + if (inBuf == NULL || inLen < 1) return; + + /* + * compute number of bytes mod 64 + */ + mdi = (int) ((mdContext->i[0] >> 3) & 0x3F); + + /* + * update number of bits + */ + if ((mdContext->i[0] + ((MD5UINT4) inLen << 3)) < mdContext->i[0]) + mdContext->i[1]++; + mdContext->i[0] += ((MD5UINT4) inLen << 3); + mdContext->i[1] += ((MD5UINT4) inLen >> 29); + + while (inLen--) { + /* + * add new character to buffer, increment mdi + */ + mdContext->in[mdi++] = *inBuf++; + + /* + * transform if necessary + */ + if (mdi == 0x40) { + for (i = 0, ii = 0; i < 16; i++, ii += 4) + in[i] = (((MD5UINT4) mdContext->in[ii + 3]) << 24) | + (((MD5UINT4) mdContext->in[ii + 2]) << 16) | + (((MD5UINT4) mdContext->in[ii + 1]) << 8) | + ((MD5UINT4) mdContext->in[ii]); + SDLTest_Md5Transform(mdContext->buf, in); + mdi = 0; + } + } +} + +/* + The routine MD5Final terminates the message-digest computation and + ends with the desired message digest in mdContext->digest[0...15]. +*/ + +void SDLTest_Md5Final(SDLTest_Md5Context * mdContext) +{ + MD5UINT4 in[16]; + int mdi; + unsigned int i, ii; + unsigned int padLen; + + if (mdContext == NULL) return; + + /* + * save number of bits + */ + in[14] = mdContext->i[0]; + in[15] = mdContext->i[1]; + + /* + * compute number of bytes mod 64 + */ + mdi = (int) ((mdContext->i[0] >> 3) & 0x3F); + + /* + * pad out to 56 mod 64 + */ + padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); + SDLTest_Md5Update(mdContext, MD5PADDING, padLen); + + /* + * append length in bits and transform + */ + for (i = 0, ii = 0; i < 14; i++, ii += 4) + in[i] = (((MD5UINT4) mdContext->in[ii + 3]) << 24) | + (((MD5UINT4) mdContext->in[ii + 2]) << 16) | + (((MD5UINT4) mdContext->in[ii + 1]) << 8) | + ((MD5UINT4) mdContext->in[ii]); + SDLTest_Md5Transform(mdContext->buf, in); + + /* + * store buffer in digest + */ + for (i = 0, ii = 0; i < 4; i++, ii += 4) { + mdContext->digest[ii] = (unsigned char) (mdContext->buf[i] & 0xFF); + mdContext->digest[ii + 1] = + (unsigned char) ((mdContext->buf[i] >> 8) & 0xFF); + mdContext->digest[ii + 2] = + (unsigned char) ((mdContext->buf[i] >> 16) & 0xFF); + mdContext->digest[ii + 3] = + (unsigned char) ((mdContext->buf[i] >> 24) & 0xFF); + } +} + +/* Basic MD5 step. Transforms buf based on in. + */ +static void SDLTest_Md5Transform(MD5UINT4 * buf, MD5UINT4 * in) +{ + MD5UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; + + /* + * Round 1 + */ +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 + FF(a, b, c, d, in[0], S11, 3614090360u); /* 1 */ + FF(d, a, b, c, in[1], S12, 3905402710u); /* 2 */ + FF(c, d, a, b, in[2], S13, 606105819u); /* 3 */ + FF(b, c, d, a, in[3], S14, 3250441966u); /* 4 */ + FF(a, b, c, d, in[4], S11, 4118548399u); /* 5 */ + FF(d, a, b, c, in[5], S12, 1200080426u); /* 6 */ + FF(c, d, a, b, in[6], S13, 2821735955u); /* 7 */ + FF(b, c, d, a, in[7], S14, 4249261313u); /* 8 */ + FF(a, b, c, d, in[8], S11, 1770035416u); /* 9 */ + FF(d, a, b, c, in[9], S12, 2336552879u); /* 10 */ + FF(c, d, a, b, in[10], S13, 4294925233u); /* 11 */ + FF(b, c, d, a, in[11], S14, 2304563134u); /* 12 */ + FF(a, b, c, d, in[12], S11, 1804603682u); /* 13 */ + FF(d, a, b, c, in[13], S12, 4254626195u); /* 14 */ + FF(c, d, a, b, in[14], S13, 2792965006u); /* 15 */ + FF(b, c, d, a, in[15], S14, 1236535329u); /* 16 */ + + /* + * Round 2 + */ +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 + GG(a, b, c, d, in[1], S21, 4129170786u); /* 17 */ + GG(d, a, b, c, in[6], S22, 3225465664u); /* 18 */ + GG(c, d, a, b, in[11], S23, 643717713u); /* 19 */ + GG(b, c, d, a, in[0], S24, 3921069994u); /* 20 */ + GG(a, b, c, d, in[5], S21, 3593408605u); /* 21 */ + GG(d, a, b, c, in[10], S22, 38016083u); /* 22 */ + GG(c, d, a, b, in[15], S23, 3634488961u); /* 23 */ + GG(b, c, d, a, in[4], S24, 3889429448u); /* 24 */ + GG(a, b, c, d, in[9], S21, 568446438u); /* 25 */ + GG(d, a, b, c, in[14], S22, 3275163606u); /* 26 */ + GG(c, d, a, b, in[3], S23, 4107603335u); /* 27 */ + GG(b, c, d, a, in[8], S24, 1163531501u); /* 28 */ + GG(a, b, c, d, in[13], S21, 2850285829u); /* 29 */ + GG(d, a, b, c, in[2], S22, 4243563512u); /* 30 */ + GG(c, d, a, b, in[7], S23, 1735328473u); /* 31 */ + GG(b, c, d, a, in[12], S24, 2368359562u); /* 32 */ + + /* + * Round 3 + */ +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 + HH(a, b, c, d, in[5], S31, 4294588738u); /* 33 */ + HH(d, a, b, c, in[8], S32, 2272392833u); /* 34 */ + HH(c, d, a, b, in[11], S33, 1839030562u); /* 35 */ + HH(b, c, d, a, in[14], S34, 4259657740u); /* 36 */ + HH(a, b, c, d, in[1], S31, 2763975236u); /* 37 */ + HH(d, a, b, c, in[4], S32, 1272893353u); /* 38 */ + HH(c, d, a, b, in[7], S33, 4139469664u); /* 39 */ + HH(b, c, d, a, in[10], S34, 3200236656u); /* 40 */ + HH(a, b, c, d, in[13], S31, 681279174u); /* 41 */ + HH(d, a, b, c, in[0], S32, 3936430074u); /* 42 */ + HH(c, d, a, b, in[3], S33, 3572445317u); /* 43 */ + HH(b, c, d, a, in[6], S34, 76029189u); /* 44 */ + HH(a, b, c, d, in[9], S31, 3654602809u); /* 45 */ + HH(d, a, b, c, in[12], S32, 3873151461u); /* 46 */ + HH(c, d, a, b, in[15], S33, 530742520u); /* 47 */ + HH(b, c, d, a, in[2], S34, 3299628645u); /* 48 */ + + /* + * Round 4 + */ +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + II(a, b, c, d, in[0], S41, 4096336452u); /* 49 */ + II(d, a, b, c, in[7], S42, 1126891415u); /* 50 */ + II(c, d, a, b, in[14], S43, 2878612391u); /* 51 */ + II(b, c, d, a, in[5], S44, 4237533241u); /* 52 */ + II(a, b, c, d, in[12], S41, 1700485571u); /* 53 */ + II(d, a, b, c, in[3], S42, 2399980690u); /* 54 */ + II(c, d, a, b, in[10], S43, 4293915773u); /* 55 */ + II(b, c, d, a, in[1], S44, 2240044497u); /* 56 */ + II(a, b, c, d, in[8], S41, 1873313359u); /* 57 */ + II(d, a, b, c, in[15], S42, 4264355552u); /* 58 */ + II(c, d, a, b, in[6], S43, 2734768916u); /* 59 */ + II(b, c, d, a, in[13], S44, 1309151649u); /* 60 */ + II(a, b, c, d, in[4], S41, 4149444226u); /* 61 */ + II(d, a, b, c, in[11], S42, 3174756917u); /* 62 */ + II(c, d, a, b, in[2], S43, 718787259u); /* 63 */ + II(b, c, d, a, in[9], S44, 3951481745u); /* 64 */ + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} diff --git a/src/test/SDL_test_random.c b/src/test/SDL_test_random.c new file mode 100644 index 0000000000..2c70dbd47d --- /dev/null +++ b/src/test/SDL_test_random.c @@ -0,0 +1,94 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* + + A portable "32-bit Multiply with carry" random number generator. + + Used by the fuzzer component. + Original source code contributed by A. Schiffler for GSOC project. + +*/ + +#include "SDL_config.h" + +#include +#include +#include + +#include "SDL_test.h" + +/* Initialize random number generator with two integer variables */ + +void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, unsigned int ci) +{ + if (rndContext==NULL) return; + + /* + * Choose a value for 'a' from this list + * 1791398085 1929682203 1683268614 1965537969 1675393560 + * 1967773755 1517746329 1447497129 1655692410 1606218150 + * 2051013963 1075433238 1557985959 1781943330 1893513180 + * 1631296680 2131995753 2083801278 1873196400 1554115554 + */ + rndContext->a = 1655692410; + rndContext->x = 30903; + rndContext->c = 0; + if (xi != 0) { + rndContext->x = xi; + } + rndContext->c = ci; + rndContext->ah = rndContext->a >> 16; + rndContext->al = rndContext->a & 65535; +} + +/* Initialize random number generator from system time */ + +void SDLTest_RandomInitTime(SDLTest_RandomContext * rndContext) +{ + int a, b; + + if (rndContext==NULL) return; + + srand((unsigned int)time(NULL)); + a=rand(); + srand(clock()); + b=rand(); + SDLTest_RandomInit(rndContext, a, b); +} + +/* Returns random numbers */ + +unsigned int SDLTest_Random(SDLTest_RandomContext * rndContext) +{ + unsigned int xh, xl; + + if (rndContext==NULL) return -1; + + xh = rndContext->x >> 16, xl = rndContext->x & 65535; + rndContext->x = rndContext->x * rndContext->a + rndContext->c; + rndContext->c = + xh * rndContext->ah + ((xh * rndContext->al) >> 16) + + ((xl * rndContext->ah) >> 16); + if (xl * rndContext->al >= (~rndContext->c + 1)) + rndContext->c++; + return (rndContext->x); +} diff --git a/src/thread/SDL_systhread.h b/src/thread/SDL_systhread.h index a59ac50386..738ea27b00 100644 --- a/src/thread/SDL_systhread.h +++ b/src/thread/SDL_systhread.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -33,20 +32,30 @@ on success. */ #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); +extern int SDL_SYS_CreateThread(SDL_Thread * thread, void *args, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); #else -extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args); +extern int SDL_SYS_CreateThread(SDL_Thread * thread, void *args); #endif /* This function does any necessary setup in the child thread */ -extern void SDL_SYS_SetupThread(void); +extern void SDL_SYS_SetupThread(const char *name); + +/* This function sets the current thread priority */ +extern int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority); /* This function waits for the thread to finish and frees any data allocated by SDL_SYS_CreateThread() */ -extern void SDL_SYS_WaitThread(SDL_Thread *thread); +extern void SDL_SYS_WaitThread(SDL_Thread * thread); + +/* Get the thread local storage for this thread */ +extern SDL_TLSData *SDL_SYS_GetTLSData(); -/* This function kills the thread and returns */ -extern void SDL_SYS_KillThread(SDL_Thread *thread); +/* Set the thread local storage for this thread */ +extern int SDL_SYS_SetTLSData(SDL_TLSData *data); #endif /* _SDL_systhread_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index 250371dd89..5eaed0c0c8 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -1,300 +1,409 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* System independent thread management routines for SDL */ -#include "SDL_mutex.h" #include "SDL_thread.h" #include "SDL_thread_c.h" #include "SDL_systhread.h" +#include "../SDL_error_c.h" -#define ARRAY_CHUNKSIZE 32 -/* The array of threads currently active in the application - (except the main thread) - The manipulation of an array here is safer than using a linked list. -*/ -static int SDL_maxthreads = 0; -static int SDL_numthreads = 0; -static SDL_Thread **SDL_Threads = NULL; -static SDL_mutex *thread_lock = NULL; -int SDL_ThreadsInit(void) +SDL_TLSID +SDL_TLSCreate() { - int retval; - - retval = 0; - thread_lock = SDL_CreateMutex(); - if ( thread_lock == NULL ) { - retval = -1; - } - return(retval); + static SDL_atomic_t SDL_tls_id; + return SDL_AtomicIncRef(&SDL_tls_id)+1; } -/* This should never be called... - If this is called by SDL_Quit(), we don't know whether or not we should - clean up threads here. If any threads are still running after this call, - they will no longer have access to any per-thread data. - */ -void SDL_ThreadsQuit(void) +void * +SDL_TLSGet(SDL_TLSID id) { - SDL_mutex *mutex; + SDL_TLSData *storage; - mutex = thread_lock; - thread_lock = NULL; - if ( mutex != NULL ) { - SDL_DestroyMutex(mutex); - } + storage = SDL_SYS_GetTLSData(); + if (!storage || id == 0 || id > storage->limit) { + return NULL; + } + return storage->array[id-1].data; } -/* Routines for manipulating the thread list */ -static void SDL_AddThread(SDL_Thread *thread) +int +SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void *)) { - /* WARNING: - If the very first threads are created simultaneously, then - there could be a race condition causing memory corruption. - In practice, this isn't a problem because by definition there - is only one thread running the first time this is called. - */ - if ( !thread_lock ) { - if ( SDL_ThreadsInit() < 0 ) { - return; - } - } - SDL_mutexP(thread_lock); - - /* Expand the list of threads, if necessary */ -#ifdef DEBUG_THREADS - printf("Adding thread (%d already - %d max)\n", - SDL_numthreads, SDL_maxthreads); -#endif - if ( SDL_numthreads == SDL_maxthreads ) { - SDL_Thread **threads; - threads = (SDL_Thread **)SDL_realloc(SDL_Threads, - (SDL_maxthreads+ARRAY_CHUNKSIZE)*(sizeof *threads)); - if ( threads == NULL ) { - SDL_OutOfMemory(); - goto done; - } - SDL_maxthreads += ARRAY_CHUNKSIZE; - SDL_Threads = threads; - } - SDL_Threads[SDL_numthreads++] = thread; -done: - SDL_mutexV(thread_lock); + SDL_TLSData *storage; + + if (id == 0) { + return SDL_InvalidParamError("id"); + } + + storage = SDL_SYS_GetTLSData(); + if (!storage || (id > storage->limit)) { + unsigned int i, oldlimit, newlimit; + + oldlimit = storage ? storage->limit : 0; + newlimit = (id + TLS_ALLOC_CHUNKSIZE); + storage = (SDL_TLSData *)SDL_realloc(storage, sizeof(*storage)+(newlimit-1)*sizeof(storage->array[0])); + if (!storage) { + return SDL_OutOfMemory(); + } + storage->limit = newlimit; + for (i = oldlimit; i < newlimit; ++i) { + storage->array[i].data = NULL; + storage->array[i].destructor = NULL; + } + if (SDL_SYS_SetTLSData(storage) != 0) { + return -1; + } + } + + storage->array[id-1].data = SDL_const_cast(void*, value); + storage->array[id-1].destructor = destructor; + return 0; } -static void SDL_DelThread(SDL_Thread *thread) +static void +SDL_TLSCleanup() { - int i; - - if ( !thread_lock ) { - return; - } - SDL_mutexP(thread_lock); - for ( i=0; i 0 ) { - while ( i < SDL_numthreads ) { - SDL_Threads[i] = SDL_Threads[i+1]; - ++i; - } - } else { - SDL_maxthreads = 0; - SDL_free(SDL_Threads); - SDL_Threads = NULL; - } -#ifdef DEBUG_THREADS - printf("Deleting thread (%d left - %d max)\n", - SDL_numthreads, SDL_maxthreads); -#endif - } - SDL_mutexV(thread_lock); + SDL_TLSData *storage; + + storage = SDL_SYS_GetTLSData(); + if (storage) { + unsigned int i; + for (i = 0; i < storage->limit; ++i) { + if (storage->array[i].destructor) { + storage->array[i].destructor(storage->array[i].data); + } + } + SDL_SYS_SetTLSData(NULL); + SDL_free(storage); + } +} -#if 0 /* There could be memory corruption if another thread is starting */ - if ( SDL_Threads == NULL ) { - SDL_ThreadsQuit(); - } -#endif + +/* This is a generic implementation of thread-local storage which doesn't + require additional OS support. + + It is not especially efficient and doesn't clean up thread-local storage + as threads exit. If there is a real OS that doesn't support thread-local + storage this implementation should be improved to be production quality. +*/ + +typedef struct SDL_TLSEntry { + SDL_threadID thread; + SDL_TLSData *storage; + struct SDL_TLSEntry *next; +} SDL_TLSEntry; + +static SDL_mutex *SDL_generic_TLS_mutex; +static SDL_TLSEntry *SDL_generic_TLS; + + +SDL_TLSData * +SDL_Generic_GetTLSData() +{ + SDL_threadID thread = SDL_ThreadID(); + SDL_TLSEntry *entry; + SDL_TLSData *storage = NULL; + + if (!SDL_generic_TLS_mutex) { + static SDL_SpinLock tls_lock; + SDL_AtomicLock(&tls_lock); + if (!SDL_generic_TLS_mutex) { + SDL_mutex *mutex = SDL_CreateMutex(); + SDL_MemoryBarrierRelease(); + SDL_generic_TLS_mutex = mutex; + if (!SDL_generic_TLS_mutex) { + SDL_AtomicUnlock(&tls_lock); + return NULL; + } + } + SDL_AtomicUnlock(&tls_lock); + } + + SDL_MemoryBarrierAcquire(); + SDL_LockMutex(SDL_generic_TLS_mutex); + for (entry = SDL_generic_TLS; entry; entry = entry->next) { + if (entry->thread == thread) { + storage = entry->storage; + break; + } + } + SDL_UnlockMutex(SDL_generic_TLS_mutex); + + return storage; } -/* The default (non-thread-safe) global error variable */ -static SDL_error SDL_global_error; +int +SDL_Generic_SetTLSData(SDL_TLSData *storage) +{ + SDL_threadID thread = SDL_ThreadID(); + SDL_TLSEntry *prev, *entry; + + /* SDL_Generic_GetTLSData() is always called first, so we can assume SDL_generic_TLS_mutex */ + SDL_LockMutex(SDL_generic_TLS_mutex); + prev = NULL; + for (entry = SDL_generic_TLS; entry; entry = entry->next) { + if (entry->thread == thread) { + if (storage) { + entry->storage = storage; + } else { + if (prev) { + prev->next = entry->next; + } else { + SDL_generic_TLS = entry->next; + } + SDL_free(entry); + } + break; + } + prev = entry; + } + if (!entry) { + entry = (SDL_TLSEntry *)SDL_malloc(sizeof(*entry)); + if (entry) { + entry->thread = thread; + entry->storage = storage; + entry->next = SDL_generic_TLS; + SDL_generic_TLS = entry; + } + } + SDL_UnlockMutex(SDL_generic_TLS_mutex); + + if (!entry) { + return SDL_OutOfMemory(); + } + return 0; +} /* Routine to get the thread-specific error variable */ -SDL_error *SDL_GetErrBuf(void) +SDL_error * +SDL_GetErrBuf(void) { - SDL_error *errbuf; - - errbuf = &SDL_global_error; - if ( SDL_Threads ) { - int i; - Uint32 this_thread; - - this_thread = SDL_ThreadID(); - SDL_mutexP(thread_lock); - for ( i=0; ithreadid ) { - errbuf = &SDL_Threads[i]->errbuf; - break; - } - } - SDL_mutexV(thread_lock); - } - return(errbuf); + static SDL_SpinLock tls_lock; + static SDL_bool tls_being_created; + static SDL_TLSID tls_errbuf; + static SDL_error SDL_global_errbuf; + const SDL_error *ALLOCATION_IN_PROGRESS = (SDL_error *)-1; + SDL_error *errbuf; + + /* tls_being_created is there simply to prevent recursion if SDL_TLSCreate() fails. + It also means it's possible for another thread to also use SDL_global_errbuf, + but that's very unlikely and hopefully won't cause issues. + */ + if (!tls_errbuf && !tls_being_created) { + SDL_AtomicLock(&tls_lock); + if (!tls_errbuf) { + SDL_TLSID slot; + tls_being_created = SDL_TRUE; + slot = SDL_TLSCreate(); + tls_being_created = SDL_FALSE; + SDL_MemoryBarrierRelease(); + tls_errbuf = slot; + } + SDL_AtomicUnlock(&tls_lock); + } + if (!tls_errbuf) { + return &SDL_global_errbuf; + } + + SDL_MemoryBarrierAcquire(); + errbuf = (SDL_error *)SDL_TLSGet(tls_errbuf); + if (errbuf == ALLOCATION_IN_PROGRESS) { + return &SDL_global_errbuf; + } + if (!errbuf) { + /* Mark that we're in the middle of allocating our buffer */ + SDL_TLSSet(tls_errbuf, ALLOCATION_IN_PROGRESS, NULL); + errbuf = (SDL_error *)SDL_malloc(sizeof(*errbuf)); + if (!errbuf) { + SDL_TLSSet(tls_errbuf, NULL, NULL); + return &SDL_global_errbuf; + } + SDL_zerop(errbuf); + SDL_TLSSet(tls_errbuf, errbuf, SDL_free); + } + return errbuf; } /* Arguments and callback to setup and run the user thread function */ -typedef struct { - int (SDLCALL *func)(void *); - void *data; - SDL_Thread *info; - SDL_sem *wait; +typedef struct +{ + int (SDLCALL * func) (void *); + void *data; + SDL_Thread *info; + SDL_sem *wait; } thread_args; -void SDL_RunThread(void *data) +void +SDL_RunThread(void *data) { - thread_args *args; - int (SDLCALL *userfunc)(void *); - void *userdata; - int *statusloc; - - /* Perform any system-dependent setup - - this function cannot fail, and cannot use SDL_SetError() - */ - SDL_SYS_SetupThread(); - - /* Get the thread id */ - args = (thread_args *)data; - args->info->threadid = SDL_ThreadID(); - - /* Figure out what function to run */ - userfunc = args->func; - userdata = args->data; - statusloc = &args->info->status; - - /* Wake up the parent thread */ - SDL_SemPost(args->wait); - - /* Run the function */ - *statusloc = userfunc(userdata); + thread_args *args = (thread_args *) data; + int (SDLCALL * userfunc) (void *) = args->func; + void *userdata = args->data; + int *statusloc = &args->info->status; + + /* Perform any system-dependent setup - this function may not fail */ + SDL_SYS_SetupThread(args->info->name); + + /* Get the thread id */ + args->info->threadid = SDL_ThreadID(); + + /* Wake up the parent thread */ + SDL_SemPost(args->wait); + + /* Run the function */ + *statusloc = userfunc(userdata); + + /* Clean up thread-local storage */ + SDL_TLSCleanup(); } #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD #undef SDL_CreateThread -DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) +DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(int (SDLCALL * fn) (void *), + const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread) #else -DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data) +DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(int (SDLCALL * fn) (void *), + const char *name, void *data) #endif { - SDL_Thread *thread; - thread_args *args; - int ret; - - /* Allocate memory for the thread info structure */ - thread = (SDL_Thread *)SDL_malloc(sizeof(*thread)); - if ( thread == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - SDL_memset(thread, 0, (sizeof *thread)); - thread->status = -1; - - /* Set up the arguments for the thread */ - args = (thread_args *)SDL_malloc(sizeof(*args)); - if ( args == NULL ) { - SDL_OutOfMemory(); - SDL_free(thread); - return(NULL); - } - args->func = fn; - args->data = data; - args->info = thread; - args->wait = SDL_CreateSemaphore(0); - if ( args->wait == NULL ) { - SDL_free(thread); - SDL_free(args); - return(NULL); - } - - /* Add the thread to the list of available threads */ - SDL_AddThread(thread); - - /* Create the thread and go! */ + SDL_Thread *thread; + thread_args *args; + int ret; + + /* Allocate memory for the thread info structure */ + thread = (SDL_Thread *) SDL_malloc(sizeof(*thread)); + if (thread == NULL) { + SDL_OutOfMemory(); + return (NULL); + } + SDL_memset(thread, 0, (sizeof *thread)); + thread->status = -1; + + /* Set up the arguments for the thread */ + if (name != NULL) { + thread->name = SDL_strdup(name); + if (thread->name == NULL) { + SDL_OutOfMemory(); + SDL_free(thread); + return (NULL); + } + } + + /* Set up the arguments for the thread */ + args = (thread_args *) SDL_malloc(sizeof(*args)); + if (args == NULL) { + SDL_OutOfMemory(); + if (thread->name) { + SDL_free(thread->name); + } + SDL_free(thread); + return (NULL); + } + args->func = fn; + args->data = data; + args->info = thread; + args->wait = SDL_CreateSemaphore(0); + if (args->wait == NULL) { + if (thread->name) { + SDL_free(thread->name); + } + SDL_free(thread); + SDL_free(args); + return (NULL); + } + + /* Create the thread and go! */ #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD - ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread); + ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread); #else - ret = SDL_SYS_CreateThread(thread, args); + ret = SDL_SYS_CreateThread(thread, args); #endif - if ( ret >= 0 ) { - /* Wait for the thread function to use arguments */ - SDL_SemWait(args->wait); - } else { - /* Oops, failed. Gotta free everything */ - SDL_DelThread(thread); - SDL_free(thread); - thread = NULL; - } - SDL_DestroySemaphore(args->wait); - SDL_free(args); - - /* Everything is running now */ - return(thread); + if (ret >= 0) { + /* Wait for the thread function to use arguments */ + SDL_SemWait(args->wait); + } else { + /* Oops, failed. Gotta free everything */ + if (thread->name) { + SDL_free(thread->name); + } + SDL_free(thread); + thread = NULL; + } + SDL_DestroySemaphore(args->wait); + SDL_free(args); + + /* Everything is running now */ + return (thread); +} + +SDL_threadID +SDL_GetThreadID(SDL_Thread * thread) +{ + SDL_threadID id; + + if (thread) { + id = thread->threadid; + } else { + id = SDL_ThreadID(); + } + return id; } -void SDL_WaitThread(SDL_Thread *thread, int *status) +const char * +SDL_GetThreadName(SDL_Thread * thread) { - if ( thread ) { - SDL_SYS_WaitThread(thread); - if ( status ) { - *status = thread->status; - } - SDL_DelThread(thread); - SDL_free(thread); - } + if (thread) { + return thread->name; + } else { + return NULL; + } } -Uint32 SDL_GetThreadID(SDL_Thread *thread) +int +SDL_SetThreadPriority(SDL_ThreadPriority priority) { - Uint32 id; - - if ( thread ) { - id = thread->threadid; - } else { - id = SDL_ThreadID(); - } - return(id); + return SDL_SYS_SetThreadPriority(priority); } -void SDL_KillThread(SDL_Thread *thread) +void +SDL_WaitThread(SDL_Thread * thread, int *status) { - if ( thread ) { - SDL_SYS_KillThread(thread); - SDL_WaitThread(thread, NULL); - } + if (thread) { + SDL_SYS_WaitThread(thread); + if (status) { + *status = thread->status; + } + if (thread->name) { + SDL_free(thread->name); + } + SDL_free(thread); + } } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index 8af6e52f41..1971ded24c 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -29,20 +28,14 @@ #include "generic/SDL_systhread_c.h" #elif SDL_THREAD_BEOS #include "beos/SDL_systhread_c.h" -#elif SDL_THREAD_DC -#include "dc/SDL_systhread_c.h" -#elif SDL_THREAD_OS2 -#include "os2/SDL_systhread_c.h" -#elif SDL_THREAD_PTH -#include "pth/SDL_systhread_c.h" +#elif SDL_THREAD_EPOC +#include "epoc/SDL_systhread_c.h" #elif SDL_THREAD_PTHREAD #include "pthread/SDL_systhread_c.h" -#elif SDL_THREAD_SPROC -#include "irix/SDL_systhread_c.h" -#elif SDL_THREAD_WIN32 -#include "win32/SDL_systhread_c.h" -#elif SDL_THREAD_SYMBIAN -#include "symbian/SDL_systhread_c.h" +#elif SDL_THREAD_WINDOWS +#include "windows/SDL_systhread_c.h" +#elif SDL_THREAD_PSP +#include "psp/SDL_systhread_c.h" #else #error Need thread implementation for this platform #include "generic/SDL_systhread_c.h" @@ -50,15 +43,43 @@ #include "../SDL_error_c.h" /* This is the system-independent thread info structure */ -struct SDL_Thread { - Uint32 threadid; - SYS_ThreadHandle handle; - int status; - SDL_error errbuf; - void *data; +struct SDL_Thread +{ + SDL_threadID threadid; + SYS_ThreadHandle handle; + int status; + SDL_error errbuf; + char *name; + void *data; }; /* This is the function called to run a thread */ extern void SDL_RunThread(void *data); +/* This is the system-independent thread local storage structure */ +typedef struct { + unsigned int limit; + struct { + void *data; + void (*destructor)(void*); + } array[1]; +} SDL_TLSData; + +/* This is how many TLS entries we allocate at once */ +#define TLS_ALLOC_CHUNKSIZE 4 + +/* Get cross-platform, slow, thread local storage for this thread. + This is only intended as a fallback if getting real thread-local + storage fails or isn't supported on this platform. + */ +extern SDL_TLSData *SDL_Generic_GetTLSData(); + +/* Set cross-platform, slow, thread local storage for this thread. + This is only intended as a fallback if getting real thread-local + storage fails or isn't supported on this platform. + */ +extern int SDL_Generic_SetTLSData(SDL_TLSData *data); + #endif /* _SDL_thread_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/beos/SDL_syssem.c b/src/thread/beos/SDL_syssem.c index eba1944bc8..9661f90121 100644 --- a/src/thread/beos/SDL_syssem.c +++ b/src/thread/beos/SDL_syssem.c @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#ifdef SDL_THREAD_BEOS + /* Semaphores in the BeOS environment */ #include @@ -28,115 +29,123 @@ #include "SDL_thread.h" -struct SDL_semaphore { - sem_id id; +struct SDL_semaphore +{ + sem_id id; }; /* Create a counting semaphore */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem * +SDL_CreateSemaphore(Uint32 initial_value) { - SDL_sem *sem; - - sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); - if ( sem ) { - sem->id = create_sem(initial_value, "SDL semaphore"); - if ( sem->id < B_NO_ERROR ) { - SDL_SetError("create_sem() failed"); - SDL_free(sem); - sem = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(sem); + SDL_sem *sem; + + sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); + if (sem) { + sem->id = create_sem(initial_value, "SDL semaphore"); + if (sem->id < B_NO_ERROR) { + SDL_SetError("create_sem() failed"); + SDL_free(sem); + sem = NULL; + } + } else { + SDL_OutOfMemory(); + } + return (sem); } /* Free the semaphore */ -void SDL_DestroySemaphore(SDL_sem *sem) +void +SDL_DestroySemaphore(SDL_sem * sem) { - if ( sem ) { - if ( sem->id >= B_NO_ERROR ) { - delete_sem(sem->id); - } - SDL_free(sem); - } + if (sem) { + if (sem->id >= B_NO_ERROR) { + delete_sem(sem->id); + } + SDL_free(sem); + } } -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) +int +SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { - int32 val; - int retval; + int32 val; + int retval; - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } tryagain: - if ( timeout == SDL_MUTEX_MAXWAIT ) { - val = acquire_sem(sem->id); - } else { - timeout *= 1000; /* BeOS uses a timeout in microseconds */ - val = acquire_sem_etc(sem->id, 1, B_RELATIVE_TIMEOUT, timeout); - } - switch (val) { - case B_INTERRUPTED: - goto tryagain; - case B_NO_ERROR: - retval = 0; - break; - case B_TIMED_OUT: - retval = SDL_MUTEX_TIMEDOUT; - break; - case B_WOULD_BLOCK: - retval = SDL_MUTEX_TIMEDOUT; - break; - default: - SDL_SetError("acquire_sem() failed"); - retval = -1; - break; - } - - return retval; + if (timeout == SDL_MUTEX_MAXWAIT) { + val = acquire_sem(sem->id); + } else { + timeout *= 1000; /* BeOS uses a timeout in microseconds */ + val = acquire_sem_etc(sem->id, 1, B_RELATIVE_TIMEOUT, timeout); + } + switch (val) { + case B_INTERRUPTED: + goto tryagain; + case B_NO_ERROR: + retval = 0; + break; + case B_TIMED_OUT: + retval = SDL_MUTEX_TIMEDOUT; + break; + case B_WOULD_BLOCK: + retval = SDL_MUTEX_TIMEDOUT; + break; + default: + retval = SDL_SetError("acquire_sem() failed"); + break; + } + + return retval; } -int SDL_SemTryWait(SDL_sem *sem) +int +SDL_SemTryWait(SDL_sem * sem) { - return SDL_SemWaitTimeout(sem, 0); + return SDL_SemWaitTimeout(sem, 0); } -int SDL_SemWait(SDL_sem *sem) +int +SDL_SemWait(SDL_sem * sem) { - return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); + return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } /* Returns the current count of the semaphore */ -Uint32 SDL_SemValue(SDL_sem *sem) +Uint32 +SDL_SemValue(SDL_sem * sem) { - int32 count; - Uint32 value; - - value = 0; - if ( sem ) { - get_sem_count(sem->id, &count); - if ( count > 0 ) { - value = (Uint32)count; - } - } - return value; + int32 count; + Uint32 value; + + value = 0; + if (sem) { + get_sem_count(sem->id, &count); + if (count > 0) { + value = (Uint32) count; + } + } + return value; } /* Atomically increases the semaphore's count (not blocking) */ -int SDL_SemPost(SDL_sem *sem) +int +SDL_SemPost(SDL_sem * sem) { - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - if ( release_sem(sem->id) != B_NO_ERROR ) { - SDL_SetError("release_sem() failed"); - return -1; - } - return 0; + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } + + if (release_sem(sem->id) != B_NO_ERROR) { + return SDL_SetError("release_sem() failed"); + } + return 0; } + +#endif /* SDL_THREAD_BEOS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/beos/SDL_systhread.c b/src/thread/beos/SDL_systhread.c index 63b52075f0..11646f9749 100644 --- a/src/thread/beos/SDL_systhread.c +++ b/src/thread/beos/SDL_systhread.c @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#ifdef SDL_THREAD_BEOS + /* BeOS thread management routines for SDL */ #include @@ -34,63 +35,92 @@ static int sig_list[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0 + SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0 }; -void SDL_MaskSignals(sigset_t *omask) +void +SDL_MaskSignals(sigset_t * omask) { - sigset_t mask; - int i; - - sigemptyset(&mask); - for ( i=0; sig_list[i]; ++i ) { - sigaddset(&mask, sig_list[i]); - } - sigprocmask(SIG_BLOCK, &mask, omask); + sigset_t mask; + int i; + + sigemptyset(&mask); + for (i = 0; sig_list[i]; ++i) { + sigaddset(&mask, sig_list[i]); + } + sigprocmask(SIG_BLOCK, &mask, omask); } -void SDL_UnmaskSignals(sigset_t *omask) + +void +SDL_UnmaskSignals(sigset_t * omask) { - sigprocmask(SIG_SETMASK, omask, NULL); + sigprocmask(SIG_SETMASK, omask, NULL); } -static int32 RunThread(void *data) +static int32 +RunThread(void *data) { - SDL_RunThread(data); - return(0); + SDL_RunThread(data); + return (0); } -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) +int +SDL_SYS_CreateThread(SDL_Thread * thread, void *args) { - /* Create the thread and go! */ - thread->handle=spawn_thread(RunThread, "SDL", B_NORMAL_PRIORITY, args); - if ( (thread->handle == B_NO_MORE_THREADS) || - (thread->handle == B_NO_MEMORY) ) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - resume_thread(thread->handle); - return(0); + /* The docs say the thread name can't be longer than B_OS_NAME_LENGTH. */ + const char *threadname = thread->name ? thread->name : "SDL Thread"; + char name[B_OS_NAME_LENGTH]; + SDL_snprintf(name, sizeof (name), "%s", threadname); + name[sizeof (name) - 1] = '\0'; + + /* Create the thread and go! */ + thread->handle = spawn_thread(RunThread, name, B_NORMAL_PRIORITY, args); + if ((thread->handle == B_NO_MORE_THREADS) || + (thread->handle == B_NO_MEMORY)) { + return SDL_SetError("Not enough resources to create thread"); + } + resume_thread(thread->handle); + return (0); } -void SDL_SYS_SetupThread(void) +void +SDL_SYS_SetupThread(const char *name) { - /* Mask asynchronous signals for this thread */ - SDL_MaskSignals(NULL); + /* We set the thread name during SDL_SYS_CreateThread(). */ + /* Mask asynchronous signals for this thread */ + SDL_MaskSignals(NULL); } -Uint32 SDL_ThreadID(void) +SDL_threadID +SDL_ThreadID(void) { - return((Uint32)find_thread(NULL)); + return ((SDL_threadID) find_thread(NULL)); } -void SDL_SYS_WaitThread(SDL_Thread *thread) +int +SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { - status_t the_status; - - wait_for_thread(thread->handle, &the_status); + int32 value; + + if (priority == SDL_THREAD_PRIORITY_LOW) { + value = B_LOW_PRIORITY; + } else if (priority == SDL_THREAD_PRIORITY_HIGH) { + value = B_URGENT_DISPLAY_PRIORITY; + } else { + value = B_NORMAL_PRIORITY; + } + set_thread_priority(find_thread(NULL), value); + return 0; } -void SDL_SYS_KillThread(SDL_Thread *thread) +void +SDL_SYS_WaitThread(SDL_Thread * thread) { - kill_thread(thread->handle); + status_t the_status; + + wait_for_thread(thread->handle, &the_status); } + +#endif /* SDL_THREAD_BEOS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/beos/SDL_systhread_c.h b/src/thread/beos/SDL_systhread_c.h index f82548e463..a350ab5944 100644 --- a/src/thread/beos/SDL_systhread_c.h +++ b/src/thread/beos/SDL_systhread_c.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -27,5 +26,7 @@ typedef thread_id SYS_ThreadHandle; /* Functions needed to work with system threads in other portions of SDL */ -extern void SDL_MaskSignals(sigset_t *omask); -extern void SDL_UnmaskSignals(sigset_t *omask); +extern void SDL_MaskSignals(sigset_t * omask); +extern void SDL_UnmaskSignals(sigset_t * omask); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/beos/SDL_systls.c b/src/thread/beos/SDL_systls.c new file mode 100644 index 0000000000..8e941289a7 --- /dev/null +++ b/src/thread/beos/SDL_systls.c @@ -0,0 +1,70 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" +#include "SDL_thread.h" +#include "../SDL_thread_c.h" + +#if SDL_THREAD_BEOS + +#include + + +static int32 thread_local_storage = B_NO_MEMORY; +static SDL_bool generic_local_storage = SDL_FALSE; + +SDL_TLSData * +SDL_SYS_GetTLSData() +{ + if (thread_local_storage == B_NO_MEMORY && !generic_local_storage) { + static SDL_SpinLock lock; + SDL_AtomicLock(&lock); + if (thread_local_storage == B_NO_MEMORY && !generic_local_storage) { + int32 storage = tls_allocate(); + if (storage != B_NO_MEMORY) { + SDL_MemoryBarrierRelease(); + thread_local_storage = storage; + } else { + generic_local_storage = SDL_TRUE; + } + } + SDL_AtomicUnlock(&lock); + } + if (generic_local_storage) { + return SDL_Generic_GetTLSData(); + } + SDL_MemoryBarrierAcquire(); + return (SDL_TLSData *)tls_get(thread_local_storage); +} + +int +SDL_SYS_SetTLSData(SDL_TLSData *data) +{ + if (generic_local_storage) { + return SDL_Generic_SetTLSData(data); + } + tls_set(thread_local_storage, data); + return 0; +} + +#endif /* SDL_THREAD_BEOS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/dc/SDL_syscond.c b/src/thread/dc/SDL_syscond.c deleted file mode 100644 index f6e7223e3d..0000000000 --- a/src/thread/dc/SDL_syscond.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* An implementation of condition variables using semaphores and mutexes */ -/* - This implementation borrows heavily from the BeOS condition variable - implementation, written by Christopher Tate and Owen Smith. Thanks! - */ - -#include "SDL_thread.h" - -struct SDL_cond -{ - SDL_mutex *lock; - int waiting; - int signals; - SDL_sem *wait_sem; - SDL_sem *wait_done; -}; - -/* Create a condition variable */ -SDL_cond * SDL_CreateCond(void) -{ - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if ( cond ) { - cond->lock = SDL_CreateMutex(); - cond->wait_sem = SDL_CreateSemaphore(0); - cond->wait_done = SDL_CreateSemaphore(0); - cond->waiting = cond->signals = 0; - if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) { - SDL_DestroyCond(cond); - cond = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(cond); -} - -/* Destroy a condition variable */ -void SDL_DestroyCond(SDL_cond *cond) -{ - if ( cond ) { - if ( cond->wait_sem ) { - SDL_DestroySemaphore(cond->wait_sem); - } - if ( cond->wait_done ) { - SDL_DestroySemaphore(cond->wait_done); - } - if ( cond->lock ) { - SDL_DestroyMutex(cond->lock); - } - SDL_free(cond); - } -} - -/* Restart one of the threads that are waiting on the condition variable */ -int SDL_CondSignal(SDL_cond *cond) -{ - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if ( cond->waiting > cond->signals ) { - ++cond->signals; - SDL_SemPost(cond->wait_sem); - SDL_UnlockMutex(cond->lock); - SDL_SemWait(cond->wait_done); - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Restart all threads that are waiting on the condition variable */ -int SDL_CondBroadcast(SDL_cond *cond) -{ - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if ( cond->waiting > cond->signals ) { - int i, num_waiting; - - num_waiting = (cond->waiting - cond->signals); - cond->signals = cond->waiting; - for ( i=0; iwait_sem); - } - /* Now all released threads are blocked here, waiting for us. - Collect them all (and win fabulous prizes!) :-) - */ - SDL_UnlockMutex(cond->lock); - for ( i=0; iwait_done); - } - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Wait on the condition variable for at most 'ms' milliseconds. - The mutex must be locked before entering this function! - The mutex is unlocked during the wait, and locked again after the wait. - -Typical use: - -Thread A: - SDL_LockMutex(lock); - while ( ! condition ) { - SDL_CondWait(cond); - } - SDL_UnlockMutex(lock); - -Thread B: - SDL_LockMutex(lock); - ... - condition = true; - ... - SDL_UnlockMutex(lock); - */ -int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* Obtain the protection mutex, and increment the number of waiters. - This allows the signal mechanism to only perform a signal if there - are waiting threads. - */ - SDL_LockMutex(cond->lock); - ++cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Unlock the mutex, as is required by condition variable semantics */ - SDL_UnlockMutex(mutex); - - /* Wait for a signal */ - if ( ms == SDL_MUTEX_MAXWAIT ) { - retval = SDL_SemWait(cond->wait_sem); - } else { - retval = SDL_SemWaitTimeout(cond->wait_sem, ms); - } - - /* Let the signaler know we have completed the wait, otherwise - the signaler can race ahead and get the condition semaphore - if we are stopped between the mutex unlock and semaphore wait, - giving a deadlock. See the following URL for details: - http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html - */ - SDL_LockMutex(cond->lock); - if ( cond->signals > 0 ) { - /* If we timed out, we need to eat a condition signal */ - if ( retval > 0 ) { - SDL_SemWait(cond->wait_sem); - } - /* We always notify the signal thread that we are done */ - SDL_SemPost(cond->wait_done); - - /* Signal handshake complete */ - --cond->signals; - } - --cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Lock the mutex, as is required by condition variable semantics */ - SDL_LockMutex(mutex); - - return retval; -} - -/* Wait on the condition variable forever */ -int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) -{ - return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); -} diff --git a/src/thread/dc/SDL_syscond_c.h b/src/thread/dc/SDL_syscond_c.h deleted file mode 100644 index 1120b2d80d..0000000000 --- a/src/thread/dc/SDL_syscond_c.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - diff --git a/src/thread/dc/SDL_sysmutex.c b/src/thread/dc/SDL_sysmutex.c deleted file mode 100644 index c6c465131b..0000000000 --- a/src/thread/dc/SDL_sysmutex.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* An implementation of mutexes using semaphores */ - -#include "SDL_thread.h" -#include "SDL_systhread_c.h" - -#include - -struct SDL_mutex { - int recursive; - Uint32 owner; - spinlock_t mutex; -}; - -/* Create a mutex */ -SDL_mutex *SDL_CreateMutex(void) -{ - SDL_mutex *mutex; - - /* Allocate mutex memory */ - mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); - if ( mutex ) { - spinlock_init(&mutex->mutex); - mutex->recursive = 0; - mutex->owner = 0; - } else { - SDL_OutOfMemory(); - } - return mutex; -} - -/* Free the mutex */ -void SDL_DestroyMutex(SDL_mutex *mutex) -{ - if ( mutex ) { - SDL_free(mutex); - } -} - -/* Lock the semaphore */ -int SDL_mutexP(SDL_mutex *mutex) -{ -#if SDL_THREADS_DISABLED - return SDL_arraysize(return ),0; -#else - Uint32 this_thread; - - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - this_thread = SDL_ThreadID(); - if ( mutex->owner == this_thread ) { - ++mutex->recursive; - } else { - /* The order of operations is important. - We set the locking thread id after we obtain the lock - so unlocks from other threads will fail. - */ - spinlock_lock(&mutex->mutex); - mutex->owner = this_thread; - mutex->recursive = 0; - } - - return 0; -#endif /* SDL_THREADS_DISABLED */ -} - -/* Unlock the mutex */ -int SDL_mutexV(SDL_mutex *mutex) -{ -#if SDL_THREADS_DISABLED - return 0; -#else - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - /* If we don't own the mutex, we can't unlock it */ - if ( SDL_ThreadID() != mutex->owner ) { - SDL_SetError("mutex not owned by this thread"); - return -1; - } - - if ( mutex->recursive ) { - --mutex->recursive; - } else { - /* The order of operations is important. - First reset the owner so another thread doesn't lock - the mutex and set the ownership before we reset it, - then release the lock semaphore. - */ - mutex->owner = 0; - spinlock_unlock(&mutex->mutex); - } - return 0; -#endif /* SDL_THREADS_DISABLED */ -} diff --git a/src/thread/dc/SDL_sysmutex_c.h b/src/thread/dc/SDL_sysmutex_c.h deleted file mode 100644 index 1120b2d80d..0000000000 --- a/src/thread/dc/SDL_sysmutex_c.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - diff --git a/src/thread/dc/SDL_syssem.c b/src/thread/dc/SDL_syssem.c deleted file mode 100644 index 9831ccdbd7..0000000000 --- a/src/thread/dc/SDL_syssem.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#include - -#include "SDL_config.h" - -/* An implementation of semaphores using mutexes and condition variables */ - -#include "SDL_timer.h" -#include "SDL_thread.h" -#include "SDL_systhread_c.h" - - -#if SDL_THREADS_DISABLED - -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - SDL_SetError("SDL not configured with thread support"); - return (SDL_sem *)0; -} - -void SDL_DestroySemaphore(SDL_sem *sem) -{ - return; -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -int SDL_SemWait(SDL_sem *sem) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -Uint32 SDL_SemValue(SDL_sem *sem) -{ - return 0; -} - -int SDL_SemPost(SDL_sem *sem) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -#else - -#include - -struct SDL_semaphore -{ - semaphore_t sem; -}; - -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - return (SDL_sem *)sem_create(initial_value); -} - -/* WARNING: - You cannot call this function when another thread is using the semaphore. -*/ -void SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return; - } - - sem_destroy(&sem->sem); -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = sem_trywait(&sem->sem); - if (retval==0) return 0; - else return SDL_MUTEX_TIMEDOUT; - - return retval; -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - /* A timeout of 0 is an easy case */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } - - retval = sem_wait_timed(&sem->sem,timeout); - if (retval==-1) retval= SDL_MUTEX_TIMEDOUT; - - return retval; -} - -int SDL_SemWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - while ( ((retval = sem_wait(&sem->sem)) == -1) && (errno == EINTR) ) {} - return retval; -} - -Uint32 SDL_SemValue(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - return sem_count(&sem->sem); -} - -int SDL_SemPost(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - sem_signal(&sem->sem); - return 0; -} - -#endif /* SDL_THREADS_DISABLED */ diff --git a/src/thread/dc/SDL_syssem_c.h b/src/thread/dc/SDL_syssem_c.h deleted file mode 100644 index 1120b2d80d..0000000000 --- a/src/thread/dc/SDL_syssem_c.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - diff --git a/src/thread/dc/SDL_systhread.c b/src/thread/dc/SDL_systhread.c deleted file mode 100644 index dd26675491..0000000000 --- a/src/thread/dc/SDL_systhread.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Thread management routines for SDL */ - -#include "SDL_thread.h" -#include "../SDL_thread_c.h" -#include "../SDL_systhread.h" - -#include - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - thread->handle = thd_create(SDL_RunThread,args); - if (thread->handle == NULL) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - return; -} - -Uint32 SDL_ThreadID(void) -{ - return (Uint32)thd_get_current(); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - thd_wait(thread->handle); -} - -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - thd_destroy(thread->handle); -} diff --git a/src/thread/dc/SDL_systhread_c.h b/src/thread/dc/SDL_systhread_c.h deleted file mode 100644 index 3cda1a4a51..0000000000 --- a/src/thread/dc/SDL_systhread_c.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -typedef struct kthread* SYS_ThreadHandle; diff --git a/src/thread/generic/SDL_syscond.c b/src/thread/generic/SDL_syscond.c index f6e7223e3d..5c8fe8bd66 100644 --- a/src/thread/generic/SDL_syscond.c +++ b/src/thread/generic/SDL_syscond.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -31,107 +30,109 @@ struct SDL_cond { - SDL_mutex *lock; - int waiting; - int signals; - SDL_sem *wait_sem; - SDL_sem *wait_done; + SDL_mutex *lock; + int waiting; + int signals; + SDL_sem *wait_sem; + SDL_sem *wait_done; }; /* Create a condition variable */ -SDL_cond * SDL_CreateCond(void) +SDL_cond * +SDL_CreateCond(void) { - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if ( cond ) { - cond->lock = SDL_CreateMutex(); - cond->wait_sem = SDL_CreateSemaphore(0); - cond->wait_done = SDL_CreateSemaphore(0); - cond->waiting = cond->signals = 0; - if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) { - SDL_DestroyCond(cond); - cond = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(cond); + SDL_cond *cond; + + cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); + if (cond) { + cond->lock = SDL_CreateMutex(); + cond->wait_sem = SDL_CreateSemaphore(0); + cond->wait_done = SDL_CreateSemaphore(0); + cond->waiting = cond->signals = 0; + if (!cond->lock || !cond->wait_sem || !cond->wait_done) { + SDL_DestroyCond(cond); + cond = NULL; + } + } else { + SDL_OutOfMemory(); + } + return (cond); } /* Destroy a condition variable */ -void SDL_DestroyCond(SDL_cond *cond) +void +SDL_DestroyCond(SDL_cond * cond) { - if ( cond ) { - if ( cond->wait_sem ) { - SDL_DestroySemaphore(cond->wait_sem); - } - if ( cond->wait_done ) { - SDL_DestroySemaphore(cond->wait_done); - } - if ( cond->lock ) { - SDL_DestroyMutex(cond->lock); - } - SDL_free(cond); - } + if (cond) { + if (cond->wait_sem) { + SDL_DestroySemaphore(cond->wait_sem); + } + if (cond->wait_done) { + SDL_DestroySemaphore(cond->wait_done); + } + if (cond->lock) { + SDL_DestroyMutex(cond->lock); + } + SDL_free(cond); + } } /* Restart one of the threads that are waiting on the condition variable */ -int SDL_CondSignal(SDL_cond *cond) +int +SDL_CondSignal(SDL_cond * cond) { - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if ( cond->waiting > cond->signals ) { - ++cond->signals; - SDL_SemPost(cond->wait_sem); - SDL_UnlockMutex(cond->lock); - SDL_SemWait(cond->wait_done); - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + /* If there are waiting threads not already signalled, then + signal the condition and wait for the thread to respond. + */ + SDL_LockMutex(cond->lock); + if (cond->waiting > cond->signals) { + ++cond->signals; + SDL_SemPost(cond->wait_sem); + SDL_UnlockMutex(cond->lock); + SDL_SemWait(cond->wait_done); + } else { + SDL_UnlockMutex(cond->lock); + } + + return 0; } /* Restart all threads that are waiting on the condition variable */ -int SDL_CondBroadcast(SDL_cond *cond) +int +SDL_CondBroadcast(SDL_cond * cond) { - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if ( cond->waiting > cond->signals ) { - int i, num_waiting; - - num_waiting = (cond->waiting - cond->signals); - cond->signals = cond->waiting; - for ( i=0; iwait_sem); - } - /* Now all released threads are blocked here, waiting for us. - Collect them all (and win fabulous prizes!) :-) - */ - SDL_UnlockMutex(cond->lock); - for ( i=0; iwait_done); - } - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + /* If there are waiting threads not already signalled, then + signal the condition and wait for the thread to respond. + */ + SDL_LockMutex(cond->lock); + if (cond->waiting > cond->signals) { + int i, num_waiting; + + num_waiting = (cond->waiting - cond->signals); + cond->signals = cond->waiting; + for (i = 0; i < num_waiting; ++i) { + SDL_SemPost(cond->wait_sem); + } + /* Now all released threads are blocked here, waiting for us. + Collect them all (and win fabulous prizes!) :-) + */ + SDL_UnlockMutex(cond->lock); + for (i = 0; i < num_waiting; ++i) { + SDL_SemWait(cond->wait_done); + } + } else { + SDL_UnlockMutex(cond->lock); + } + + return 0; } /* Wait on the condition variable for at most 'ms' milliseconds. @@ -141,75 +142,79 @@ int SDL_CondBroadcast(SDL_cond *cond) Typical use: Thread A: - SDL_LockMutex(lock); - while ( ! condition ) { - SDL_CondWait(cond); - } - SDL_UnlockMutex(lock); + SDL_LockMutex(lock); + while ( ! condition ) { + SDL_CondWait(cond, lock); + } + SDL_UnlockMutex(lock); Thread B: - SDL_LockMutex(lock); - ... - condition = true; - ... - SDL_UnlockMutex(lock); + SDL_LockMutex(lock); + ... + condition = true; + ... + SDL_CondSignal(cond); + SDL_UnlockMutex(lock); */ -int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) +int +SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) { - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* Obtain the protection mutex, and increment the number of waiters. - This allows the signal mechanism to only perform a signal if there - are waiting threads. - */ - SDL_LockMutex(cond->lock); - ++cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Unlock the mutex, as is required by condition variable semantics */ - SDL_UnlockMutex(mutex); - - /* Wait for a signal */ - if ( ms == SDL_MUTEX_MAXWAIT ) { - retval = SDL_SemWait(cond->wait_sem); - } else { - retval = SDL_SemWaitTimeout(cond->wait_sem, ms); - } - - /* Let the signaler know we have completed the wait, otherwise - the signaler can race ahead and get the condition semaphore - if we are stopped between the mutex unlock and semaphore wait, - giving a deadlock. See the following URL for details: - http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html - */ - SDL_LockMutex(cond->lock); - if ( cond->signals > 0 ) { - /* If we timed out, we need to eat a condition signal */ - if ( retval > 0 ) { - SDL_SemWait(cond->wait_sem); - } - /* We always notify the signal thread that we are done */ - SDL_SemPost(cond->wait_done); - - /* Signal handshake complete */ - --cond->signals; - } - --cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Lock the mutex, as is required by condition variable semantics */ - SDL_LockMutex(mutex); - - return retval; + int retval; + + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + /* Obtain the protection mutex, and increment the number of waiters. + This allows the signal mechanism to only perform a signal if there + are waiting threads. + */ + SDL_LockMutex(cond->lock); + ++cond->waiting; + SDL_UnlockMutex(cond->lock); + + /* Unlock the mutex, as is required by condition variable semantics */ + SDL_UnlockMutex(mutex); + + /* Wait for a signal */ + if (ms == SDL_MUTEX_MAXWAIT) { + retval = SDL_SemWait(cond->wait_sem); + } else { + retval = SDL_SemWaitTimeout(cond->wait_sem, ms); + } + + /* Let the signaler know we have completed the wait, otherwise + the signaler can race ahead and get the condition semaphore + if we are stopped between the mutex unlock and semaphore wait, + giving a deadlock. See the following URL for details: + http://web.archive.org/web/20010914175514/http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html#Workshop + */ + SDL_LockMutex(cond->lock); + if (cond->signals > 0) { + /* If we timed out, we need to eat a condition signal */ + if (retval > 0) { + SDL_SemWait(cond->wait_sem); + } + /* We always notify the signal thread that we are done */ + SDL_SemPost(cond->wait_done); + + /* Signal handshake complete */ + --cond->signals; + } + --cond->waiting; + SDL_UnlockMutex(cond->lock); + + /* Lock the mutex, as is required by condition variable semantics */ + SDL_LockMutex(mutex); + + return retval; } /* Wait on the condition variable forever */ -int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) +int +SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) { - return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); + return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/generic/SDL_sysmutex.c b/src/thread/generic/SDL_sysmutex.c index ecfea876a5..3e3c1fea90 100644 --- a/src/thread/generic/SDL_sysmutex.c +++ b/src/thread/generic/SDL_sysmutex.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -27,103 +26,140 @@ #include "SDL_systhread_c.h" -struct SDL_mutex { - int recursive; - Uint32 owner; - SDL_sem *sem; +struct SDL_mutex +{ + int recursive; + SDL_threadID owner; + SDL_sem *sem; }; /* Create a mutex */ -SDL_mutex *SDL_CreateMutex(void) +SDL_mutex * +SDL_CreateMutex(void) { - SDL_mutex *mutex; - - /* Allocate mutex memory */ - mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); - if ( mutex ) { - /* Create the mutex semaphore, with initial value 1 */ - mutex->sem = SDL_CreateSemaphore(1); - mutex->recursive = 0; - mutex->owner = 0; - if ( ! mutex->sem ) { - SDL_free(mutex); - mutex = NULL; - } - } else { - SDL_OutOfMemory(); - } - return mutex; + SDL_mutex *mutex; + + /* Allocate mutex memory */ + mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); + if (mutex) { + /* Create the mutex semaphore, with initial value 1 */ + mutex->sem = SDL_CreateSemaphore(1); + mutex->recursive = 0; + mutex->owner = 0; + if (!mutex->sem) { + SDL_free(mutex); + mutex = NULL; + } + } else { + SDL_OutOfMemory(); + } + return mutex; } /* Free the mutex */ -void SDL_DestroyMutex(SDL_mutex *mutex) +void +SDL_DestroyMutex(SDL_mutex * mutex) +{ + if (mutex) { + if (mutex->sem) { + SDL_DestroySemaphore(mutex->sem); + } + SDL_free(mutex); + } +} + +/* Lock the mutex */ +int +SDL_LockMutex(SDL_mutex * mutex) { - if ( mutex ) { - if ( mutex->sem ) { - SDL_DestroySemaphore(mutex->sem); - } - SDL_free(mutex); - } +#if SDL_THREADS_DISABLED + return 0; +#else + SDL_threadID this_thread; + + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + this_thread = SDL_ThreadID(); + if (mutex->owner == this_thread) { + ++mutex->recursive; + } else { + /* The order of operations is important. + We set the locking thread id after we obtain the lock + so unlocks from other threads will fail. + */ + SDL_SemWait(mutex->sem); + mutex->owner = this_thread; + mutex->recursive = 0; + } + + return 0; +#endif /* SDL_THREADS_DISABLED */ } -/* Lock the semaphore */ -int SDL_mutexP(SDL_mutex *mutex) +/* try Lock the mutex */ +int +SDL_TryLockMutex(SDL_mutex * mutex) { #if SDL_THREADS_DISABLED - return 0; + return 0; #else - Uint32 this_thread; - - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - this_thread = SDL_ThreadID(); - if ( mutex->owner == this_thread ) { - ++mutex->recursive; - } else { - /* The order of operations is important. - We set the locking thread id after we obtain the lock - so unlocks from other threads will fail. - */ - SDL_SemWait(mutex->sem); - mutex->owner = this_thread; - mutex->recursive = 0; - } - - return 0; + int retval = 0; + SDL_threadID this_thread; + + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + this_thread = SDL_ThreadID(); + if (mutex->owner == this_thread) { + ++mutex->recursive; + } else { + /* The order of operations is important. + We set the locking thread id after we obtain the lock + so unlocks from other threads will fail. + */ + retval = SDL_SemWait(mutex->sem); + if (retval == 0) { + mutex->owner = this_thread; + mutex->recursive = 0; + } + } + + return retval; #endif /* SDL_THREADS_DISABLED */ } /* Unlock the mutex */ -int SDL_mutexV(SDL_mutex *mutex) +int +SDL_mutexV(SDL_mutex * mutex) { #if SDL_THREADS_DISABLED - return 0; + return 0; #else - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - /* If we don't own the mutex, we can't unlock it */ - if ( SDL_ThreadID() != mutex->owner ) { - SDL_SetError("mutex not owned by this thread"); - return -1; - } - - if ( mutex->recursive ) { - --mutex->recursive; - } else { - /* The order of operations is important. - First reset the owner so another thread doesn't lock - the mutex and set the ownership before we reset it, - then release the lock semaphore. - */ - mutex->owner = 0; - SDL_SemPost(mutex->sem); - } - return 0; + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + /* If we don't own the mutex, we can't unlock it */ + if (SDL_ThreadID() != mutex->owner) { + return SDL_SetError("mutex not owned by this thread"); + } + + if (mutex->recursive) { + --mutex->recursive; + } else { + /* The order of operations is important. + First reset the owner so another thread doesn't lock + the mutex and set the ownership before we reset it, + then release the lock semaphore. + */ + mutex->owner = 0; + SDL_SemPost(mutex->sem); + } + return 0; #endif /* SDL_THREADS_DISABLED */ } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/generic/SDL_sysmutex_c.h b/src/thread/generic/SDL_sysmutex_c.h index 1120b2d80d..8d6dbdc2be 100644 --- a/src/thread/generic/SDL_sysmutex_c.h +++ b/src/thread/generic/SDL_sysmutex_c.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" - +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/generic/SDL_syssem.c b/src/thread/generic/SDL_syssem.c index 1d289c05d0..bfb011dda7 100644 --- a/src/thread/generic/SDL_syssem.c +++ b/src/thread/generic/SDL_syssem.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -30,182 +29,189 @@ #if SDL_THREADS_DISABLED -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem * +SDL_CreateSemaphore(Uint32 initial_value) { - SDL_SetError("SDL not configured with thread support"); - return (SDL_sem *)0; + SDL_SetError("SDL not built with thread support"); + return (SDL_sem *) 0; } -void SDL_DestroySemaphore(SDL_sem *sem) +void +SDL_DestroySemaphore(SDL_sem * sem) { - return; } -int SDL_SemTryWait(SDL_sem *sem) +int +SDL_SemTryWait(SDL_sem * sem) { - SDL_SetError("SDL not configured with thread support"); - return -1; + return SDL_SetError("SDL not built with thread support"); } -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) +int +SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { - SDL_SetError("SDL not configured with thread support"); - return -1; + return SDL_SetError("SDL not built with thread support"); } -int SDL_SemWait(SDL_sem *sem) +int +SDL_SemWait(SDL_sem * sem) { - SDL_SetError("SDL not configured with thread support"); - return -1; + return SDL_SetError("SDL not built with thread support"); } -Uint32 SDL_SemValue(SDL_sem *sem) +Uint32 +SDL_SemValue(SDL_sem * sem) { - return 0; + return 0; } -int SDL_SemPost(SDL_sem *sem) +int +SDL_SemPost(SDL_sem * sem) { - SDL_SetError("SDL not configured with thread support"); - return -1; + return SDL_SetError("SDL not built with thread support"); } #else struct SDL_semaphore { - Uint32 count; - Uint32 waiters_count; - SDL_mutex *count_lock; - SDL_cond *count_nonzero; + Uint32 count; + Uint32 waiters_count; + SDL_mutex *count_lock; + SDL_cond *count_nonzero; }; -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem * +SDL_CreateSemaphore(Uint32 initial_value) { - SDL_sem *sem; - - sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); - if ( ! sem ) { - SDL_OutOfMemory(); - return NULL; - } - sem->count = initial_value; - sem->waiters_count = 0; - - sem->count_lock = SDL_CreateMutex(); - sem->count_nonzero = SDL_CreateCond(); - if ( ! sem->count_lock || ! sem->count_nonzero ) { - SDL_DestroySemaphore(sem); - return NULL; - } - - return sem; + SDL_sem *sem; + + sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); + if (!sem) { + SDL_OutOfMemory(); + return NULL; + } + sem->count = initial_value; + sem->waiters_count = 0; + + sem->count_lock = SDL_CreateMutex(); + sem->count_nonzero = SDL_CreateCond(); + if (!sem->count_lock || !sem->count_nonzero) { + SDL_DestroySemaphore(sem); + return NULL; + } + + return sem; } /* WARNING: You cannot call this function when another thread is using the semaphore. */ -void SDL_DestroySemaphore(SDL_sem *sem) +void +SDL_DestroySemaphore(SDL_sem * sem) { - if ( sem ) { - sem->count = 0xFFFFFFFF; - while ( sem->waiters_count > 0) { - SDL_CondSignal(sem->count_nonzero); - SDL_Delay(10); - } - SDL_DestroyCond(sem->count_nonzero); - if ( sem->count_lock ) { - SDL_mutexP(sem->count_lock); - SDL_mutexV(sem->count_lock); - SDL_DestroyMutex(sem->count_lock); - } - SDL_free(sem); - } + if (sem) { + sem->count = 0xFFFFFFFF; + while (sem->waiters_count > 0) { + SDL_CondSignal(sem->count_nonzero); + SDL_Delay(10); + } + SDL_DestroyCond(sem->count_nonzero); + if (sem->count_lock) { + SDL_LockMutex(sem->count_lock); + SDL_UnlockMutex(sem->count_lock); + SDL_DestroyMutex(sem->count_lock); + } + SDL_free(sem); + } } -int SDL_SemTryWait(SDL_sem *sem) +int +SDL_SemTryWait(SDL_sem * sem) { - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = SDL_MUTEX_TIMEDOUT; - SDL_LockMutex(sem->count_lock); - if ( sem->count > 0 ) { - --sem->count; - retval = 0; - } - SDL_UnlockMutex(sem->count_lock); - - return retval; + int retval; + + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } + + retval = SDL_MUTEX_TIMEDOUT; + SDL_LockMutex(sem->count_lock); + if (sem->count > 0) { + --sem->count; + retval = 0; + } + SDL_UnlockMutex(sem->count_lock); + + return retval; } -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) +int +SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - /* A timeout of 0 is an easy case */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } - - SDL_LockMutex(sem->count_lock); - ++sem->waiters_count; - retval = 0; - while ( (sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT) ) { - retval = SDL_CondWaitTimeout(sem->count_nonzero, - sem->count_lock, timeout); - } - --sem->waiters_count; - if (retval == 0) { - --sem->count; - } - SDL_UnlockMutex(sem->count_lock); - - return retval; + int retval; + + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } + + /* A timeout of 0 is an easy case */ + if (timeout == 0) { + return SDL_SemTryWait(sem); + } + + SDL_LockMutex(sem->count_lock); + ++sem->waiters_count; + retval = 0; + while ((sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT)) { + retval = SDL_CondWaitTimeout(sem->count_nonzero, + sem->count_lock, timeout); + } + --sem->waiters_count; + if (retval == 0) { + --sem->count; + } + SDL_UnlockMutex(sem->count_lock); + + return retval; } -int SDL_SemWait(SDL_sem *sem) +int +SDL_SemWait(SDL_sem * sem) { - return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); + return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } -Uint32 SDL_SemValue(SDL_sem *sem) +Uint32 +SDL_SemValue(SDL_sem * sem) { - Uint32 value; - - value = 0; - if ( sem ) { - SDL_LockMutex(sem->count_lock); - value = sem->count; - SDL_UnlockMutex(sem->count_lock); - } - return value; + Uint32 value; + + value = 0; + if (sem) { + SDL_LockMutex(sem->count_lock); + value = sem->count; + SDL_UnlockMutex(sem->count_lock); + } + return value; } -int SDL_SemPost(SDL_sem *sem) +int +SDL_SemPost(SDL_sem * sem) { - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - SDL_LockMutex(sem->count_lock); - if ( sem->waiters_count > 0 ) { - SDL_CondSignal(sem->count_nonzero); - } - ++sem->count; - SDL_UnlockMutex(sem->count_lock); - - return 0; + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } + + SDL_LockMutex(sem->count_lock); + if (sem->waiters_count > 0) { + SDL_CondSignal(sem->count_nonzero); + } + ++sem->count; + SDL_UnlockMutex(sem->count_lock); + + return 0; } #endif /* SDL_THREADS_DISABLED */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/generic/SDL_systhread.c b/src/thread/generic/SDL_systhread.c index c380121ff6..139f8ac03d 100644 --- a/src/thread/generic/SDL_systhread.c +++ b/src/thread/generic/SDL_systhread.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,29 +25,41 @@ #include "SDL_thread.h" #include "../SDL_systhread.h" -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) +#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD +int +SDL_SYS_CreateThread(SDL_Thread * thread, void *args, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread) +#else +int +SDL_SYS_CreateThread(SDL_Thread * thread, void *args) +#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ { - SDL_SetError("Threads are not supported on this platform"); - return(-1); + return SDL_SetError("Threads are not supported on this platform"); } -void SDL_SYS_SetupThread(void) +void +SDL_SYS_SetupThread(const char *name) { - return; + return; } -Uint32 SDL_ThreadID(void) +SDL_threadID +SDL_ThreadID(void) { - return(0); + return (0); } -void SDL_SYS_WaitThread(SDL_Thread *thread) +int +SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { - return; + return (0); } -void SDL_SYS_KillThread(SDL_Thread *thread) +void +SDL_SYS_WaitThread(SDL_Thread * thread) { - return; + return; } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/generic/SDL_systhread_c.h b/src/thread/generic/SDL_systhread_c.h index 1535b50191..b6c99c90e3 100644 --- a/src/thread/generic/SDL_systhread_c.h +++ b/src/thread/generic/SDL_systhread_c.h @@ -1,25 +1,26 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Stub until we implement threads on this platform */ typedef int SYS_ThreadHandle; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/generic/SDL_systls.c b/src/thread/generic/SDL_systls.c new file mode 100644 index 0000000000..bdb83dbf9a --- /dev/null +++ b/src/thread/generic/SDL_systls.c @@ -0,0 +1,38 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" +#include "../SDL_thread_c.h" + + +SDL_TLSData * +SDL_SYS_GetTLSData() +{ + return SDL_Generic_GetTLSData(); +} + +int +SDL_SYS_SetTLSData(SDL_TLSData *data) +{ + return SDL_Generic_SetTLSData(data); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/irix/SDL_syssem.c b/src/thread/irix/SDL_syssem.c deleted file mode 100644 index 208c379cdd..0000000000 --- a/src/thread/irix/SDL_syssem.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include "SDL_thread.h" -#include "SDL_timer.h" - - -#include -#include -#include -#include -#include -#include - -#include "SDL_error.h" -#include "SDL_thread.h" - - -struct SDL_semaphore { - int id; -}; - -/* Not defined by many operating systems, use configure to detect */ -/* -#if !defined(HAVE_SEMUN) -union semun { - int val; - struct semid_ds *buf; - ushort *array; -}; -#endif -*/ - -static struct sembuf op_trywait[2] = { - { 0, -1, (IPC_NOWAIT|SEM_UNDO) } /* Decrement semaphore, no block */ -}; -static struct sembuf op_wait[2] = { - { 0, -1, SEM_UNDO } /* Decrement semaphore */ -}; -static struct sembuf op_post[1] = { - { 0, 1, (IPC_NOWAIT|SEM_UNDO) } /* Increment semaphore */ -}; - -/* Create a blockable semaphore */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - extern int _creating_thread_lock; /* SDL_threads.c */ - SDL_sem *sem; - union semun init; - - sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); - if ( sem == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - sem->id = semget(IPC_PRIVATE, 1, (0600|IPC_CREAT)); - if ( sem->id < 0 ) { - SDL_SetError("Couldn't create semaphore"); - SDL_free(sem); - return(NULL); - } - init.val = initial_value; /* Initialize semaphore */ - semctl(sem->id, 0, SETVAL, init); - return(sem); -} - -void SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( sem ) { -#ifdef __IRIX__ - semctl(sem->id, 0, IPC_RMID); -#else - union semun dummy; - dummy.val = 0; - semctl(sem->id, 0, IPC_RMID, dummy); -#endif - SDL_free(sem); - } -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = 0; - tryagain: - if ( semop(sem->id, op_trywait, 1) < 0 ) { - if ( errno == EINTR ) { - goto tryagain; - } - retval = SDL_MUTEX_TIMEDOUT; - } - return retval; -} - -int SDL_SemWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = 0; - tryagain: - if ( semop(sem->id, op_wait, 1) < 0 ) { - if ( errno == EINTR ) { - goto tryagain; - } - SDL_SetError("Semaphore operation error"); - retval = -1; - } - return retval; -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - /* Try the easy cases first */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } - if ( timeout == SDL_MUTEX_MAXWAIT ) { - return SDL_SemWait(sem); - } - - /* Ack! We have to busy wait... */ - timeout += SDL_GetTicks(); - do { - retval = SDL_SemTryWait(sem); - if ( retval == 0 ) { - break; - } - SDL_Delay(1); - } while ( SDL_GetTicks() < timeout ); - - return retval; -} - -Uint32 SDL_SemValue(SDL_sem *sem) -{ - int semval; - Uint32 value; - - value = 0; - if ( sem ) { - tryagain: -#ifdef __IRIX__ - semval = semctl(sem->id, 0, GETVAL); -#else - { - union semun arg; - arg.val = 0; - semval = semctl(sem->id, 0, GETVAL, arg); - } -#endif - if ( semval < 0 ) { - if ( errno == EINTR ) { - goto tryagain; - } - } else { - value = (Uint32)semval; - } - } - return value; -} - -int SDL_SemPost(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = 0; - tryagain: - if ( semop(sem->id, op_post, 1) < 0 ) { - if ( errno == EINTR ) { - goto tryagain; - } - SDL_SetError("Semaphore operation error"); - retval = -1; - } - return retval; -} diff --git a/src/thread/irix/SDL_systhread.c b/src/thread/irix/SDL_systhread.c deleted file mode 100644 index 7ae7fc6771..0000000000 --- a/src/thread/irix/SDL_systhread.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* IRIX thread management routines for SDL */ - -#include -#include -#include -#include -#include - -#include "SDL_thread.h" -#include "../SDL_systhread.h" - - -static int sig_list[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCLD, SIGWINCH, - SIGVTALRM, SIGPROF, 0 -}; - - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - /* Create the thread and go! */ - if ( sproc(SDL_RunThread, PR_SALL, args) < 0 ) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - int i; - sigset_t mask; - - /* Mask asynchronous signals for this thread */ - sigemptyset(&mask); - for ( i=0; sig_list[i]; ++i ) { - sigaddset(&mask, sig_list[i]); - } - sigprocmask(SIG_BLOCK, &mask, NULL); -} - -/* WARNING: This may not work for systems with 64-bit pid_t */ -Uint32 SDL_ThreadID(void) -{ - return((Uint32)getpid()); -} - -/* WARNING: This may not work for systems with 64-bit pid_t */ -void SDL_WaitThread(SDL_Thread *thread, int *status) -{ - errno = 0; - while ( errno != ECHILD ) { - waitpid(thread->handle, NULL, 0); - } -} - -/* WARNING: This may not work for systems with 64-bit pid_t */ -void SDL_KillThread(SDL_Thread *thread) -{ - kill(thread->handle, SIGKILL); -} - diff --git a/src/thread/irix/SDL_systhread_c.h b/src/thread/irix/SDL_systhread_c.h deleted file mode 100644 index ee28634fb1..0000000000 --- a/src/thread/irix/SDL_systhread_c.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include - -typedef pid_t SYS_ThreadHandle; - diff --git a/src/thread/os2/SDL_syscond.c b/src/thread/os2/SDL_syscond.c deleted file mode 100644 index 3e80594c2a..0000000000 --- a/src/thread/os2/SDL_syscond.c +++ /dev/null @@ -1,215 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* An implementation of condition variables using semaphores and mutexes */ -/* - This implementation borrows heavily from the BeOS condition variable - implementation, written by Christopher Tate and Owen Smith. Thanks! - */ - -#include "SDL_thread.h" - -struct SDL_cond -{ - SDL_mutex *lock; - int waiting; - int signals; - SDL_sem *wait_sem; - SDL_sem *wait_done; -}; - -/* Create a condition variable */ -DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void) -{ - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if ( cond ) { - cond->lock = SDL_CreateMutex(); - cond->wait_sem = SDL_CreateSemaphore(0); - cond->wait_done = SDL_CreateSemaphore(0); - cond->waiting = cond->signals = 0; - if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) { - SDL_DestroyCond(cond); - cond = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(cond); -} - -/* Destroy a condition variable */ -DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond) -{ - if ( cond ) { - if ( cond->wait_sem ) { - SDL_DestroySemaphore(cond->wait_sem); - } - if ( cond->wait_done ) { - SDL_DestroySemaphore(cond->wait_done); - } - if ( cond->lock ) { - SDL_DestroyMutex(cond->lock); - } - SDL_free(cond); - } -} - -/* Restart one of the threads that are waiting on the condition variable */ -DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond) -{ - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if ( cond->waiting > cond->signals ) { - ++cond->signals; - SDL_SemPost(cond->wait_sem); - SDL_UnlockMutex(cond->lock); - SDL_SemWait(cond->wait_done); - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Restart all threads that are waiting on the condition variable */ -DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond) -{ - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if ( cond->waiting > cond->signals ) { - int i, num_waiting; - - num_waiting = (cond->waiting - cond->signals); - cond->signals = cond->waiting; - for ( i=0; iwait_sem); - } - /* Now all released threads are blocked here, waiting for us. - Collect them all (and win fabulous prizes!) :-) - */ - SDL_UnlockMutex(cond->lock); - for ( i=0; iwait_done); - } - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Wait on the condition variable for at most 'ms' milliseconds. - The mutex must be locked before entering this function! - The mutex is unlocked during the wait, and locked again after the wait. - -Typical use: - -Thread A: - SDL_LockMutex(lock); - while ( ! condition ) { - SDL_CondWait(cond); - } - SDL_UnlockMutex(lock); - -Thread B: - SDL_LockMutex(lock); - ... - condition = true; - ... - SDL_UnlockMutex(lock); - */ -DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - /* Obtain the protection mutex, and increment the number of waiters. - This allows the signal mechanism to only perform a signal if there - are waiting threads. - */ - SDL_LockMutex(cond->lock); - ++cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Unlock the mutex, as is required by condition variable semantics */ - SDL_UnlockMutex(mutex); - - /* Wait for a signal */ - if ( ms == SDL_MUTEX_MAXWAIT ) { - retval = SDL_SemWait(cond->wait_sem); - } else { - retval = SDL_SemWaitTimeout(cond->wait_sem, ms); - } - - /* Let the signaler know we have completed the wait, otherwise - the signaler can race ahead and get the condition semaphore - if we are stopped between the mutex unlock and semaphore wait, - giving a deadlock. See the following URL for details: - http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html - */ - SDL_LockMutex(cond->lock); - if ( cond->signals > 0 ) { - /* If we timed out, we need to eat a condition signal */ - if ( retval > 0 ) { - SDL_SemWait(cond->wait_sem); - } - /* We always notify the signal thread that we are done */ - SDL_SemPost(cond->wait_done); - - /* Signal handshake complete */ - --cond->signals; - } - --cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Lock the mutex, as is required by condition variable semantics */ - SDL_LockMutex(mutex); - - return retval; -} - -/* Wait on the condition variable forever */ -DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) -{ - return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); -} diff --git a/src/thread/os2/SDL_syscond_c.h b/src/thread/os2/SDL_syscond_c.h deleted file mode 100644 index 1120b2d80d..0000000000 --- a/src/thread/os2/SDL_syscond_c.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - diff --git a/src/thread/os2/SDL_sysmutex.c b/src/thread/os2/SDL_sysmutex.c deleted file mode 100644 index 1e21897656..0000000000 --- a/src/thread/os2/SDL_sysmutex.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Mutex functions using the OS/2 API */ - -#define INCL_DOSERRORS -#define INCL_DOSSEMAPHORES -#include - -#include "SDL_mutex.h" - - -struct SDL_mutex { - HMTX hmtxID; -}; - -/* Create a mutex */ -DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void) -{ - SDL_mutex *mutex; - APIRET ulrc; - - /* Allocate mutex memory */ - mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); - if (mutex) - { - /* Create the mutex, with initial value signaled */ - ulrc = DosCreateMutexSem(NULL, // Create unnamed semaphore - &(mutex->hmtxID), // Pointer to handle - 0L, // Flags: create it private (not shared) - FALSE); // Initial value: unowned - if (ulrc!=NO_ERROR) - { - SDL_SetError("Couldn't create mutex"); - SDL_free(mutex); - mutex = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(mutex); -} - -/* Free the mutex */ -DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex) -{ - if ( mutex ) - { - if ( mutex->hmtxID ) - { - DosCloseMutexSem(mutex->hmtxID); - mutex->hmtxID = 0; - } - SDL_free(mutex); - } -} - -/* Lock the mutex */ -DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex) -{ - if ( mutex == NULL ) - { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - if ( DosRequestMutexSem(mutex->hmtxID, SEM_INDEFINITE_WAIT) != NO_ERROR ) - { - SDL_SetError("Couldn't wait on mutex"); - return -1; - } - return(0); -} - -/* Unlock the mutex */ -DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex) -{ - if ( mutex == NULL ) - { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - if ( DosReleaseMutexSem(mutex->hmtxID) != NO_ERROR ) - { - SDL_SetError("Couldn't release mutex"); - return -1; - } - return(0); -} diff --git a/src/thread/os2/SDL_syssem.c b/src/thread/os2/SDL_syssem.c deleted file mode 100644 index d6dfba67bb..0000000000 --- a/src/thread/os2/SDL_syssem.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Semaphore functions using the OS/2 API */ - -#define INCL_DOS -#define INCL_DOSERRORS -#define INCL_DOSSEMAPHORES -#include - -#include "SDL_thread.h" -#include "SDL_timer.h" - - -struct SDL_semaphore { - HMTX id; - HEV changed; - Uint32 value; -}; - - -/* Create a semaphore */ -DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value) -{ - SDL_sem *sem; - ULONG ulrc; - - /* Allocate sem memory */ - sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); - if ( sem ) { - /* Create the mutex semaphore */ - ulrc = DosCreateMutexSem(NULL,&(sem->id),0,TRUE); - if ( ulrc ) { - SDL_SetError("Couldn't create semaphore"); - SDL_free(sem); - sem = NULL; - } else - { - DosCreateEventSem(NULL, &(sem->changed), 0, FALSE); - sem->value = initial_value; - DosReleaseMutexSem(sem->id); - } - } else { - SDL_OutOfMemory(); - } - return(sem); -} - -/* Free the semaphore */ -DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( sem ) { - if ( sem->id ) { - DosCloseEventSem(sem->changed); - DosCloseMutexSem(sem->id); - sem->id = 0; - } - SDL_free(sem); - } -} - -DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - ULONG ulrc; - - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return -1; - } - - if ( timeout == SDL_MUTEX_MAXWAIT ) { - while (1) { - ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT); - if (ulrc) { - /* if error waiting mutex */ - SDL_SetError("DosRequestMutexSem() failed"); - return -1; - } else if (sem->value) { - sem->value--; - DosReleaseMutexSem(sem->id); - return 0; - } else { - ULONG ulPostCount; - DosResetEventSem(sem->changed, &ulPostCount); - DosReleaseMutexSem(sem->id); - /* continue waiting until somebody posts the semaphore */ - DosWaitEventSem(sem->changed, SEM_INDEFINITE_WAIT); - } - } - } else - if ( timeout == 0 ) - { - ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT); - if (ulrc==NO_ERROR) - { - if (sem->value) - { - sem->value--; - DosReleaseMutexSem(sem->id); - return 0; - } else - { - DosReleaseMutexSem(sem->id); - return SDL_MUTEX_TIMEDOUT; - } - } else - { - SDL_SetError("DosRequestMutexSem() failed"); - return -1; - } - } else { - ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT); - if (ulrc) { - /* if error waiting mutex */ - SDL_SetError("DosRequestMutexSem() failed"); - return -1; - } else - if (sem->value) { - sem->value--; - DosReleaseMutexSem(sem->id); - return 0; - } else { - ULONG ulPostCount; - DosResetEventSem(sem->changed, &ulPostCount); - DosReleaseMutexSem(sem->id); - /* continue waiting until somebody posts the semaphore */ - ulrc = DosWaitEventSem(sem->changed, timeout); - if (ulrc==NO_ERROR) - return 0; - else - return SDL_MUTEX_TIMEDOUT; - } - } - /* never reached */ - return -1; -} - -DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem) -{ - return SDL_SemWaitTimeout(sem, 0); -} - -DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem) -{ - return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); -} - -/* Returns the current count of the semaphore */ -DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return 0; - } - return sem->value; -} - -DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return -1; - } - if ( DosRequestMutexSem(sem->id,SEM_INDEFINITE_WAIT) ) { - SDL_SetError("DosRequestMutexSem() failed"); - return -1; - } - sem->value++; - DosPostEventSem(sem->changed); - DosReleaseMutexSem(sem->id); - return 0; -} diff --git a/src/thread/os2/SDL_systhread.c b/src/thread/os2/SDL_systhread.c deleted file mode 100644 index 33f815a5fb..0000000000 --- a/src/thread/os2/SDL_systhread.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* OS/2 thread management routines for SDL */ - -#include -#define INCL_DOSERRORS -#define INCL_DOSPROCESS -#include - -#include "SDL_thread.h" -#include "../SDL_systhread.h" -#include "../SDL_thread_c.h" - -typedef struct ThreadStartParms -{ - void *args; - pfnSDL_CurrentEndThread pfnCurrentEndThread; -} tThreadStartParms, *pThreadStartParms; - -static void threadfunc(void *pparm) -{ - pThreadStartParms pThreadParms = pparm; - pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL; - - // Call the thread function! - SDL_RunThread(pThreadParms->args); - - // Get the current endthread we have to use! - if (pThreadParms) - { - pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread; - SDL_free(pThreadParms); - } - // Call endthread! - if (pfnCurrentEndThread) - (*pfnCurrentEndThread)(); -} - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) -{ - pThreadStartParms pThreadParms = SDL_malloc(sizeof(tThreadStartParms)); - if (!pThreadParms) - { - SDL_SetError("Not enough memory to create thread"); - return(-1); - } - - // Save the function which we will have to call to clear the RTL of calling app! - pThreadParms->pfnCurrentEndThread = pfnEndThread; - // Also save the real parameters we have to pass to thread function - pThreadParms->args = args; - // Start the thread using the runtime library of calling app! - thread->threadid = thread->handle = (*pfnBeginThread)(threadfunc, NULL, 512*1024, pThreadParms); - if ((int)thread->threadid <= 0) - { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - return; -} - -DECLSPEC Uint32 SDLCALL SDL_ThreadID(void) -{ - PTIB tib; - DosGetInfoBlocks(&tib, NULL); - return((Uint32) (tib->tib_ptib2->tib2_ultid)); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - TID tid = thread->handle; - DosWaitThread(&tid, DCWW_WAIT); -} - -/* WARNING: This function is really a last resort. - * Threads should be signaled and then exit by themselves. - * TerminateThread() doesn't perform stack and DLL cleanup. - */ -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - DosKillThread(thread->handle); -} diff --git a/src/thread/os2/SDL_systhread_c.h b/src/thread/os2/SDL_systhread_c.h deleted file mode 100644 index 3b94dfed53..0000000000 --- a/src/thread/os2/SDL_systhread_c.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#define INCL_DOSPROCESS -#include - -typedef TID SYS_ThreadHandle; - diff --git a/src/thread/psp/SDL_syscond.c b/src/thread/psp/SDL_syscond.c new file mode 100644 index 0000000000..f540cddb6d --- /dev/null +++ b/src/thread/psp/SDL_syscond.c @@ -0,0 +1,220 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* An implementation of condition variables using semaphores and mutexes */ +/* + This implementation borrows heavily from the BeOS condition variable + implementation, written by Christopher Tate and Owen Smith. Thanks! + */ + +#include "SDL_thread.h" + +struct SDL_cond +{ + SDL_mutex *lock; + int waiting; + int signals; + SDL_sem *wait_sem; + SDL_sem *wait_done; +}; + +/* Create a condition variable */ +SDL_cond * +SDL_CreateCond(void) +{ + SDL_cond *cond; + + cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); + if (cond) { + cond->lock = SDL_CreateMutex(); + cond->wait_sem = SDL_CreateSemaphore(0); + cond->wait_done = SDL_CreateSemaphore(0); + cond->waiting = cond->signals = 0; + if (!cond->lock || !cond->wait_sem || !cond->wait_done) { + SDL_DestroyCond(cond); + cond = NULL; + } + } else { + SDL_OutOfMemory(); + } + return (cond); +} + +/* Destroy a condition variable */ +void +SDL_DestroyCond(SDL_cond * cond) +{ + if (cond) { + if (cond->wait_sem) { + SDL_DestroySemaphore(cond->wait_sem); + } + if (cond->wait_done) { + SDL_DestroySemaphore(cond->wait_done); + } + if (cond->lock) { + SDL_DestroyMutex(cond->lock); + } + SDL_free(cond); + } +} + +/* Restart one of the threads that are waiting on the condition variable */ +int +SDL_CondSignal(SDL_cond * cond) +{ + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + /* If there are waiting threads not already signalled, then + signal the condition and wait for the thread to respond. + */ + SDL_LockMutex(cond->lock); + if (cond->waiting > cond->signals) { + ++cond->signals; + SDL_SemPost(cond->wait_sem); + SDL_UnlockMutex(cond->lock); + SDL_SemWait(cond->wait_done); + } else { + SDL_UnlockMutex(cond->lock); + } + + return 0; +} + +/* Restart all threads that are waiting on the condition variable */ +int +SDL_CondBroadcast(SDL_cond * cond) +{ + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + /* If there are waiting threads not already signalled, then + signal the condition and wait for the thread to respond. + */ + SDL_LockMutex(cond->lock); + if (cond->waiting > cond->signals) { + int i, num_waiting; + + num_waiting = (cond->waiting - cond->signals); + cond->signals = cond->waiting; + for (i = 0; i < num_waiting; ++i) { + SDL_SemPost(cond->wait_sem); + } + /* Now all released threads are blocked here, waiting for us. + Collect them all (and win fabulous prizes!) :-) + */ + SDL_UnlockMutex(cond->lock); + for (i = 0; i < num_waiting; ++i) { + SDL_SemWait(cond->wait_done); + } + } else { + SDL_UnlockMutex(cond->lock); + } + + return 0; +} + +/* Wait on the condition variable for at most 'ms' milliseconds. + The mutex must be locked before entering this function! + The mutex is unlocked during the wait, and locked again after the wait. + +Typical use: + +Thread A: + SDL_LockMutex(lock); + while ( ! condition ) { + SDL_CondWait(cond, lock); + } + SDL_UnlockMutex(lock); + +Thread B: + SDL_LockMutex(lock); + ... + condition = true; + ... + SDL_CondSignal(cond); + SDL_UnlockMutex(lock); + */ +int +SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) +{ + int retval; + + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + /* Obtain the protection mutex, and increment the number of waiters. + This allows the signal mechanism to only perform a signal if there + are waiting threads. + */ + SDL_LockMutex(cond->lock); + ++cond->waiting; + SDL_UnlockMutex(cond->lock); + + /* Unlock the mutex, as is required by condition variable semantics */ + SDL_UnlockMutex(mutex); + + /* Wait for a signal */ + if (ms == SDL_MUTEX_MAXWAIT) { + retval = SDL_SemWait(cond->wait_sem); + } else { + retval = SDL_SemWaitTimeout(cond->wait_sem, ms); + } + + /* Let the signaler know we have completed the wait, otherwise + the signaler can race ahead and get the condition semaphore + if we are stopped between the mutex unlock and semaphore wait, + giving a deadlock. See the following URL for details: + http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html + */ + SDL_LockMutex(cond->lock); + if (cond->signals > 0) { + /* If we timed out, we need to eat a condition signal */ + if (retval > 0) { + SDL_SemWait(cond->wait_sem); + } + /* We always notify the signal thread that we are done */ + SDL_SemPost(cond->wait_done); + + /* Signal handshake complete */ + --cond->signals; + } + --cond->waiting; + SDL_UnlockMutex(cond->lock); + + /* Lock the mutex, as is required by condition variable semantics */ + SDL_LockMutex(mutex); + + return retval; +} + +/* Wait on the condition variable forever */ +int +SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) +{ + return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_sysmutex.c b/src/thread/psp/SDL_sysmutex.c new file mode 100644 index 0000000000..6bb68a23d1 --- /dev/null +++ b/src/thread/psp/SDL_sysmutex.c @@ -0,0 +1,132 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* An implementation of mutexes using semaphores */ + +#include "SDL_thread.h" +#include "SDL_systhread_c.h" + + +struct SDL_mutex +{ + int recursive; + SDL_threadID owner; + SDL_sem *sem; +}; + +/* Create a mutex */ +SDL_mutex * +SDL_CreateMutex(void) +{ + SDL_mutex *mutex; + + /* Allocate mutex memory */ + mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); + if (mutex) { + /* Create the mutex semaphore, with initial value 1 */ + mutex->sem = SDL_CreateSemaphore(1); + mutex->recursive = 0; + mutex->owner = 0; + if (!mutex->sem) { + SDL_free(mutex); + mutex = NULL; + } + } else { + SDL_OutOfMemory(); + } + return mutex; +} + +/* Free the mutex */ +void +SDL_DestroyMutex(SDL_mutex * mutex) +{ + if (mutex) { + if (mutex->sem) { + SDL_DestroySemaphore(mutex->sem); + } + SDL_free(mutex); + } +} + +/* Lock the semaphore */ +int +SDL_mutexP(SDL_mutex * mutex) +{ +#if SDL_THREADS_DISABLED + return 0; +#else + SDL_threadID this_thread; + + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + this_thread = SDL_ThreadID(); + if (mutex->owner == this_thread) { + ++mutex->recursive; + } else { + /* The order of operations is important. + We set the locking thread id after we obtain the lock + so unlocks from other threads will fail. + */ + SDL_SemWait(mutex->sem); + mutex->owner = this_thread; + mutex->recursive = 0; + } + + return 0; +#endif /* SDL_THREADS_DISABLED */ +} + +/* Unlock the mutex */ +int +SDL_mutexV(SDL_mutex * mutex) +{ +#if SDL_THREADS_DISABLED + return 0; +#else + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + /* If we don't own the mutex, we can't unlock it */ + if (SDL_ThreadID() != mutex->owner) { + return SDL_SetError("mutex not owned by this thread"); + } + + if (mutex->recursive) { + --mutex->recursive; + } else { + /* The order of operations is important. + First reset the owner so another thread doesn't lock + the mutex and set the ownership before we reset it, + then release the lock semaphore. + */ + mutex->owner = 0; + SDL_SemPost(mutex->sem); + } + return 0; +#endif /* SDL_THREADS_DISABLED */ +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_sysmutex_c.h b/src/thread/psp/SDL_sysmutex_c.h new file mode 100644 index 0000000000..8d6dbdc2be --- /dev/null +++ b/src/thread/psp/SDL_sysmutex_c.h @@ -0,0 +1,22 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c new file mode 100644 index 0000000000..8eff409e0b --- /dev/null +++ b/src/thread/psp/SDL_syssem.c @@ -0,0 +1,156 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* Semaphore functions for the PSP. */ + +#include +#include + +#include "SDL_error.h" +#include "SDL_thread.h" + +#include +#include + +struct SDL_semaphore { + SceUID semid; +}; + + +/* Create a semaphore */ +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) +{ + SDL_sem *sem; + + sem = (SDL_sem *) malloc(sizeof(*sem)); + if (sem != NULL) { + /* TODO: Figure out the limit on the maximum value. */ + sem->semid = sceKernelCreateSema("SDL sema", 0, initial_value, 255, NULL); + if (sem->semid < 0) { + SDL_SetError("Couldn't create semaphore"); + free(sem); + sem = NULL; + } + } else { + SDL_OutOfMemory(); + } + + return sem; +} + +/* Free the semaphore */ +void SDL_DestroySemaphore(SDL_sem *sem) +{ + if (sem != NULL) { + if (sem->semid > 0) { + sceKernelDeleteSema(sem->semid); + sem->semid = 0; + } + + free(sem); + } +} + +/* TODO: This routine is a bit overloaded. + * If the timeout is 0 then just poll the semaphore; if it's SDL_MUTEX_MAXWAIT, pass + * NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout + * is specified, convert it to microseconds. */ +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) +{ + Uint32 *pTimeout; + unsigned int res; + + if (sem == NULL) { + SDL_SetError("Passed a NULL sem"); + return 0; + } + + if (timeout == 0) { + res = sceKernelPollSema(sem->semid, 1); + if (res < 0) { + return SDL_MUTEX_TIMEDOUT; + } + return 0; + } + + if (timeout == SDL_MUTEX_MAXWAIT) { + pTimeout = NULL; + } else { + timeout *= 1000; /* Convert to microseconds. */ + pTimeout = &timeout; + } + + res = sceKernelWaitSema(sem->semid, 1, pTimeout); + switch (res) { + case SCE_KERNEL_ERROR_OK: + return 0; + case SCE_KERNEL_ERROR_WAIT_TIMEOUT: + return SDL_MUTEX_TIMEDOUT; + default: + return SDL_SetError("WaitForSingleObject() failed"); + } +} + +int SDL_SemTryWait(SDL_sem *sem) +{ + return SDL_SemWaitTimeout(sem, 0); +} + +int SDL_SemWait(SDL_sem *sem) +{ + return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); +} + +/* Returns the current count of the semaphore */ +Uint32 SDL_SemValue(SDL_sem *sem) +{ + SceKernelSemaInfo info; + + if (sem == NULL) { + SDL_SetError("Passed a NULL sem"); + return 0; + } + + if (sceKernelReferSemaStatus(sem->semid, &info) >= 0) { + return info.currentCount; + } + + return 0; +} + +int SDL_SemPost(SDL_sem *sem) +{ + int res; + + if (sem == NULL) { + return SDL_SetError("Passed a NULL sem"); + } + + res = sceKernelSignalSema(sem->semid, 1); + if (res < 0) { + return SDL_SetError("sceKernelSignalSema() failed"); + } + + return 0; +} + +/* vim: ts=4 sw=4 + */ diff --git a/src/thread/psp/SDL_systhread.c b/src/thread/psp/SDL_systhread.c new file mode 100644 index 0000000000..05a2341fe0 --- /dev/null +++ b/src/thread/psp/SDL_systhread.c @@ -0,0 +1,102 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + + +/* PSP thread management routines for SDL */ + +#include +#include + +#include "SDL_error.h" +#include "SDL_thread.h" +#include "../SDL_systhread.h" +#include "../SDL_thread_c.h" +#include +#include + + +static int ThreadEntry(SceSize args, void *argp) +{ + SDL_RunThread(*(void **) argp); + return 0; +} + +int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) +{ + SceKernelThreadInfo status; + int priority = 32; + + /* Set priority of new thread to the same as the current thread */ + status.size = sizeof(SceKernelThreadInfo); + if (sceKernelReferThreadStatus(sceKernelGetThreadId(), &status) == 0) { + priority = status.currentPriority; + } + + thread->handle = sceKernelCreateThread("SDL thread", ThreadEntry, + priority, 0x8000, + PSP_THREAD_ATTR_VFPU, NULL); + if (thread->handle < 0) { + return SDL_SetError("sceKernelCreateThread() failed"); + } + + sceKernelStartThread(thread->handle, 4, &args); + return 0; +} + +void SDL_SYS_SetupThread(const char *name) +{ + /* Do nothing. */ +} + +SDL_threadID SDL_ThreadID(void) +{ + return (SDL_threadID) sceKernelGetThreadId(); +} + +void SDL_SYS_WaitThread(SDL_Thread *thread) +{ + sceKernelWaitThreadEnd(thread->handle, NULL); + sceKernelDeleteThread(thread->handle); +} + +void SDL_SYS_KillThread(SDL_Thread *thread) +{ + sceKernelTerminateDeleteThread(thread->handle); +} + +int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) +{ + int value; + + if (priority == SDL_THREAD_PRIORITY_LOW) { + value = 19; + } else if (priority == SDL_THREAD_PRIORITY_HIGH) { + value = -20; + } else { + value = 0; + } + + return sceKernelChangeThreadPriority(sceKernelGetThreadId(),value); + +} + +/* vim: ts=4 sw=4 + */ diff --git a/src/thread/psp/SDL_systhread_c.h b/src/thread/psp/SDL_systhread_c.h new file mode 100644 index 0000000000..a806edec9b --- /dev/null +++ b/src/thread/psp/SDL_systhread_c.h @@ -0,0 +1,24 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +typedef SceUID SYS_ThreadHandle; diff --git a/src/thread/pth/SDL_syscond.c b/src/thread/pth/SDL_syscond.c deleted file mode 100644 index ede74aaeae..0000000000 --- a/src/thread/pth/SDL_syscond.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - * GNU pth conditions variables - * - * Patrice Mandin - */ - -#include - -#include "SDL_thread.h" -#include "SDL_sysmutex_c.h" - -struct SDL_cond -{ - pth_cond_t condpth_p; -}; - -/* Create a condition variable */ -SDL_cond * SDL_CreateCond(void) -{ - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if ( cond ) { - if ( pth_cond_init(&(cond->condpth_p)) < 0 ) { - SDL_SetError("pthread_cond_init() failed"); - SDL_free(cond); - cond = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(cond); -} - -/* Destroy a condition variable */ -void SDL_DestroyCond(SDL_cond *cond) -{ - if ( cond ) { - SDL_free(cond); - } -} - -/* Restart one of the threads that are waiting on the condition variable */ -int SDL_CondSignal(SDL_cond *cond) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pth_cond_notify(&(cond->condpth_p), FALSE) != 0 ) { - SDL_SetError("pth_cond_notify() failed"); - retval = -1; - } - return retval; -} - -/* Restart all threads that are waiting on the condition variable */ -int SDL_CondBroadcast(SDL_cond *cond) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pth_cond_notify(&(cond->condpth_p), TRUE) != 0 ) { - SDL_SetError("pth_cond_notify() failed"); - retval = -1; - } - return retval; -} - -/* Wait on the condition variable for at most 'ms' milliseconds. - The mutex must be locked before entering this function! - The mutex is unlocked during the wait, and locked again after the wait. - -Typical use: - -Thread A: - SDL_LockMutex(lock); - while ( ! condition ) { - SDL_CondWait(cond); - } - SDL_UnlockMutex(lock); - -Thread B: - SDL_LockMutex(lock); - ... - condition = true; - ... - SDL_UnlockMutex(lock); - */ -int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) -{ - int retval; - pth_event_t ev; - int sec; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - - sec = ms/1000; - ev = pth_event(PTH_EVENT_TIME, pth_timeout(sec,(ms-sec*1000)*1000)); - - if ( pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), ev) != 0 ) { - SDL_SetError("pth_cond_await() failed"); - retval = -1; - } - - pth_event_free(ev, PTH_FREE_ALL); - - return retval; -} - -/* Wait on the condition variable forever */ -int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), NULL) != 0 ) { - SDL_SetError("pth_cond_await() failed"); - retval = -1; - } - return retval; -} diff --git a/src/thread/pth/SDL_sysmutex.c b/src/thread/pth/SDL_sysmutex.c deleted file mode 100644 index ca83b92c24..0000000000 --- a/src/thread/pth/SDL_sysmutex.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - * GNU pth mutexes - * - * Patrice Mandin - */ - -#include - -#include "SDL_mutex.h" -#include "SDL_sysmutex_c.h" - -/* Create a mutex */ -SDL_mutex *SDL_CreateMutex(void) -{ - SDL_mutex *mutex; - - /* Allocate mutex memory */ - mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); - if ( mutex ) { - /* Create the mutex, with initial value signaled */ - if (!pth_mutex_init(&(mutex->mutexpth_p))) { - SDL_SetError("Couldn't create mutex"); - SDL_free(mutex); - mutex = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(mutex); -} - -/* Free the mutex */ -void SDL_DestroyMutex(SDL_mutex *mutex) -{ - if ( mutex ) { - SDL_free(mutex); - } -} - -/* Lock the mutex */ -int SDL_mutexP(SDL_mutex *mutex) -{ - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - pth_mutex_acquire(&(mutex->mutexpth_p), FALSE, NULL); - - return(0); -} - -/* Unlock the mutex */ -int SDL_mutexV(SDL_mutex *mutex) -{ - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - pth_mutex_release(&(mutex->mutexpth_p)); - - return(0); -} diff --git a/src/thread/pth/SDL_sysmutex_c.h b/src/thread/pth/SDL_sysmutex_c.h deleted file mode 100644 index d29060e9ff..0000000000 --- a/src/thread/pth/SDL_sysmutex_c.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_SYSMUTEX_C_H_ -#define _SDL_SYSMUTEX_C_H_ - -struct SDL_mutex { - pth_mutex_t mutexpth_p; -}; - -#endif /* _SDL_SYSMUTEX_C_H_ */ diff --git a/src/thread/pth/SDL_systhread.c b/src/thread/pth/SDL_systhread.c deleted file mode 100644 index bfccaf340f..0000000000 --- a/src/thread/pth/SDL_systhread.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - * GNU pth threads - * - * Patrice Mandin - */ - -#include -#include - -#include "SDL_thread.h" -#include "../SDL_thread_c.h" -#include "../SDL_systhread.h" - -/* List of signals to mask in the subthreads */ -static int sig_list[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, - SIGVTALRM, SIGPROF, 0 -}; - -static void *RunThread(void *data) -{ - SDL_RunThread(data); - pth_exit((void*)0); - return((void *)0); /* Prevent compiler warning */ -} - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - pth_attr_t type; - - /* Create a new attribute */ - type = pth_attr_new(); - if ( type == NULL ) { - SDL_SetError("Couldn't initialize pth attributes"); - return(-1); - } - pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE); - - /* Create the thread and go! */ - thread->handle = pth_spawn(type, RunThread, args); - if ( thread->handle == NULL ) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - int i; - sigset_t mask; - int oldstate; - - /* Mask asynchronous signals for this thread */ - sigemptyset(&mask); - for ( i=0; sig_list[i]; ++i ) { - sigaddset(&mask, sig_list[i]); - } - pth_sigmask(SIG_BLOCK, &mask, 0); - - /* Allow ourselves to be asynchronously cancelled */ - pth_cancel_state(PTH_CANCEL_ASYNCHRONOUS, &oldstate); -} - -/* WARNING: This may not work for systems with 64-bit pid_t */ -Uint32 SDL_ThreadID(void) -{ - return((Uint32)pth_self()); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - pth_join(thread->handle, NULL); -} - -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - pth_cancel(thread->handle); - pth_join(thread->handle, NULL); -} diff --git a/src/thread/pth/SDL_systhread_c.h b/src/thread/pth/SDL_systhread_c.h deleted file mode 100644 index 50bb26df54..0000000000 --- a/src/thread/pth/SDL_systhread_c.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_SYSTHREAD_C_H_ -#define _SDL_SYSTHREAD_C_H_ - -#include - -typedef pth_t SYS_ThreadHandle; - -#endif /* _SDL_SYSTHREAD_C_H_ */ diff --git a/src/thread/pthread/SDL_syscond.c b/src/thread/pthread/SDL_syscond.c index 15bce96614..1eb4f29f98 100644 --- a/src/thread/pthread/SDL_syscond.c +++ b/src/thread/pthread/SDL_syscond.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -31,125 +30,119 @@ struct SDL_cond { - pthread_cond_t cond; + pthread_cond_t cond; }; /* Create a condition variable */ -SDL_cond * SDL_CreateCond(void) +SDL_cond * +SDL_CreateCond(void) { - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if ( cond ) { - if ( pthread_cond_init(&cond->cond, NULL) < 0 ) { - SDL_SetError("pthread_cond_init() failed"); - SDL_free(cond); - cond = NULL; - } - } - return(cond); + SDL_cond *cond; + + cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); + if (cond) { + if (pthread_cond_init(&cond->cond, NULL) < 0) { + SDL_SetError("pthread_cond_init() failed"); + SDL_free(cond); + cond = NULL; + } + } + return (cond); } /* Destroy a condition variable */ -void SDL_DestroyCond(SDL_cond *cond) +void +SDL_DestroyCond(SDL_cond * cond) { - if ( cond ) { - pthread_cond_destroy(&cond->cond); - SDL_free(cond); - } + if (cond) { + pthread_cond_destroy(&cond->cond); + SDL_free(cond); + } } /* Restart one of the threads that are waiting on the condition variable */ -int SDL_CondSignal(SDL_cond *cond) +int +SDL_CondSignal(SDL_cond * cond) { - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pthread_cond_signal(&cond->cond) != 0 ) { - SDL_SetError("pthread_cond_signal() failed"); - retval = -1; - } - return retval; + int retval; + + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + retval = 0; + if (pthread_cond_signal(&cond->cond) != 0) { + return SDL_SetError("pthread_cond_signal() failed"); + } + return retval; } /* Restart all threads that are waiting on the condition variable */ -int SDL_CondBroadcast(SDL_cond *cond) +int +SDL_CondBroadcast(SDL_cond * cond) { - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pthread_cond_broadcast(&cond->cond) != 0 ) { - SDL_SetError("pthread_cond_broadcast() failed"); - retval = -1; - } - return retval; + int retval; + + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + retval = 0; + if (pthread_cond_broadcast(&cond->cond) != 0) { + return SDL_SetError("pthread_cond_broadcast() failed"); + } + return retval; } -int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) +int +SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) { - int retval; - struct timeval delta; - struct timespec abstime; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - gettimeofday(&delta, NULL); - - abstime.tv_sec = delta.tv_sec + (ms/1000); - abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000; - if ( abstime.tv_nsec > 1000000000 ) { - abstime.tv_sec += 1; - abstime.tv_nsec -= 1000000000; - } + int retval; + struct timeval delta; + struct timespec abstime; + + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } + + gettimeofday(&delta, NULL); + + abstime.tv_sec = delta.tv_sec + (ms / 1000); + abstime.tv_nsec = (delta.tv_usec + (ms % 1000) * 1000) * 1000; + if (abstime.tv_nsec > 1000000000) { + abstime.tv_sec += 1; + abstime.tv_nsec -= 1000000000; + } tryagain: - retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime); - switch (retval) { - case EINTR: - goto tryagain; - break; - case ETIMEDOUT: - retval = SDL_MUTEX_TIMEDOUT; - break; - case 0: - break; - default: - SDL_SetError("pthread_cond_timedwait() failed"); - retval = -1; - break; - } - return retval; + retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime); + switch (retval) { + case EINTR: + goto tryagain; + break; + case ETIMEDOUT: + retval = SDL_MUTEX_TIMEDOUT; + break; + case 0: + break; + default: + retval = SDL_SetError("pthread_cond_timedwait() failed"); + } + return retval; } /* Wait on the condition variable, unlocking the provided mutex. The mutex must be locked before entering this function! */ -int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) +int +SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) { - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pthread_cond_wait(&cond->cond, &mutex->id) != 0 ) { - SDL_SetError("pthread_cond_wait() failed"); - retval = -1; - } - return retval; + if (!cond) { + return SDL_SetError("Passed a NULL condition variable"); + } else if (pthread_cond_wait(&cond->cond, &mutex->id) != 0) { + return SDL_SetError("pthread_cond_wait() failed"); + } + return 0; } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/pthread/SDL_sysmutex.c b/src/thread/pthread/SDL_sysmutex.c index c3b8ce2c37..bd238da367 100644 --- a/src/thread/pthread/SDL_sysmutex.c +++ b/src/thread/pthread/SDL_sysmutex.c @@ -1,153 +1,193 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#define _GNU_SOURCE #include +#include #include "SDL_thread.h" #if !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX && \ !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP -#define FAKE_RECURSIVE_MUTEX +#define FAKE_RECURSIVE_MUTEX 1 #endif -struct SDL_mutex { - pthread_mutex_t id; +struct SDL_mutex +{ + pthread_mutex_t id; #if FAKE_RECURSIVE_MUTEX - int recursive; - pthread_t owner; + int recursive; + pthread_t owner; #endif }; -SDL_mutex *SDL_CreateMutex (void) +SDL_mutex * +SDL_CreateMutex(void) { - SDL_mutex *mutex; - pthread_mutexattr_t attr; + SDL_mutex *mutex; + pthread_mutexattr_t attr; - /* Allocate the structure */ - mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex)); - if ( mutex ) { - pthread_mutexattr_init(&attr); + /* Allocate the structure */ + mutex = (SDL_mutex *) SDL_calloc(1, sizeof(*mutex)); + if (mutex) { + pthread_mutexattr_init(&attr); #if SDL_THREAD_PTHREAD_RECURSIVE_MUTEX - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); #elif SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP - pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); + pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); #else - /* No extra attributes necessary */ + /* No extra attributes necessary */ #endif - if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) { - SDL_SetError("pthread_mutex_init() failed"); - SDL_free(mutex); - mutex = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(mutex); + if (pthread_mutex_init(&mutex->id, &attr) != 0) { + SDL_SetError("pthread_mutex_init() failed"); + SDL_free(mutex); + mutex = NULL; + } + } else { + SDL_OutOfMemory(); + } + return (mutex); } -void SDL_DestroyMutex(SDL_mutex *mutex) +void +SDL_DestroyMutex(SDL_mutex * mutex) { - if ( mutex ) { - pthread_mutex_destroy(&mutex->id); - SDL_free(mutex); - } + if (mutex) { + pthread_mutex_destroy(&mutex->id); + SDL_free(mutex); + } } /* Lock the mutex */ -int SDL_mutexP(SDL_mutex *mutex) +int +SDL_LockMutex(SDL_mutex * mutex) { - int retval; #if FAKE_RECURSIVE_MUTEX - pthread_t this_thread; + pthread_t this_thread; #endif - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } - retval = 0; #if FAKE_RECURSIVE_MUTEX - this_thread = pthread_self(); - if ( mutex->owner == this_thread ) { - ++mutex->recursive; - } else { - /* The order of operations is important. - We set the locking thread id after we obtain the lock - so unlocks from other threads will fail. - */ - if ( pthread_mutex_lock(&mutex->id) == 0 ) { - mutex->owner = this_thread; - mutex->recursive = 0; - } else { - SDL_SetError("pthread_mutex_lock() failed"); - retval = -1; - } - } + this_thread = pthread_self(); + if (mutex->owner == this_thread) { + ++mutex->recursive; + } else { + /* The order of operations is important. + We set the locking thread id after we obtain the lock + so unlocks from other threads will fail. + */ + if (pthread_mutex_lock(&mutex->id) == 0) { + mutex->owner = this_thread; + mutex->recursive = 0; + } else { + return SDL_SetError("pthread_mutex_lock() failed"); + } + } #else - if ( pthread_mutex_lock(&mutex->id) < 0 ) { - SDL_SetError("pthread_mutex_lock() failed"); - retval = -1; - } + if (pthread_mutex_lock(&mutex->id) < 0) { + return SDL_SetError("pthread_mutex_lock() failed"); + } #endif - return retval; + return 0; } -int SDL_mutexV(SDL_mutex *mutex) +int +SDL_TryLockMutex(SDL_mutex * mutex) { - int retval; + int retval; +#if FAKE_RECURSIVE_MUTEX + pthread_t this_thread; +#endif - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } - retval = 0; + retval = 0; #if FAKE_RECURSIVE_MUTEX - /* We can only unlock the mutex if we own it */ - if ( pthread_self() == mutex->owner ) { - if ( mutex->recursive ) { - --mutex->recursive; - } else { - /* The order of operations is important. - First reset the owner so another thread doesn't lock - the mutex and set the ownership before we reset it, - then release the lock semaphore. - */ - mutex->owner = 0; - pthread_mutex_unlock(&mutex->id); - } - } else { - SDL_SetError("mutex not owned by this thread"); - retval = -1; - } + this_thread = pthread_self(); + if (mutex->owner == this_thread) { + ++mutex->recursive; + } else { + /* The order of operations is important. + We set the locking thread id after we obtain the lock + so unlocks from other threads will fail. + */ + if (pthread_mutex_lock(&mutex->id) == 0) { + mutex->owner = this_thread; + mutex->recursive = 0; + } else if (errno == EBUSY) { + retval = SDL_MUTEX_TIMEDOUT; + } else { + retval = SDL_SetError("pthread_mutex_trylock() failed"); + } + } +#else + if (pthread_mutex_trylock(&mutex->id) != 0) { + if (errno == EBUSY) { + retval = SDL_MUTEX_TIMEDOUT; + } else { + retval = SDL_SetError("pthread_mutex_trylock() failed"); + } + } +#endif + return retval; +} + +int +SDL_UnlockMutex(SDL_mutex * mutex) +{ + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + +#if FAKE_RECURSIVE_MUTEX + /* We can only unlock the mutex if we own it */ + if (pthread_self() == mutex->owner) { + if (mutex->recursive) { + --mutex->recursive; + } else { + /* The order of operations is important. + First reset the owner so another thread doesn't lock + the mutex and set the ownership before we reset it, + then release the lock semaphore. + */ + mutex->owner = 0; + pthread_mutex_unlock(&mutex->id); + } + } else { + return SDL_SetError("mutex not owned by this thread"); + } #else - if ( pthread_mutex_unlock(&mutex->id) < 0 ) { - SDL_SetError("pthread_mutex_unlock() failed"); - retval = -1; - } + if (pthread_mutex_unlock(&mutex->id) < 0) { + return SDL_SetError("pthread_mutex_unlock() failed"); + } #endif /* FAKE_RECURSIVE_MUTEX */ - return retval; + return 0; } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/pthread/SDL_sysmutex_c.h b/src/thread/pthread/SDL_sysmutex_c.h index 5258890156..2e2eae47e2 100644 --- a/src/thread/pthread/SDL_sysmutex_c.h +++ b/src/thread/pthread/SDL_sysmutex_c.h @@ -1,31 +1,32 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #ifndef _SDL_mutex_c_h #define _SDL_mutex_c_h -struct SDL_mutex { - pthread_mutex_t id; +struct SDL_mutex +{ + pthread_mutex_t id; }; #endif /* _SDL_mutex_c_h */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c index a03870fa35..4acd6bfb52 100644 --- a/src/thread/pthread/SDL_syssem.c +++ b/src/thread/pthread/SDL_syssem.c @@ -1,29 +1,28 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" +#include #include #include -#include #include #include "SDL_thread.h" @@ -31,160 +30,170 @@ /* Wrapper around POSIX 1003.1b semaphores */ -#ifdef __MACOSX__ +#if defined(__MACOSX__) || defined(__IPHONEOS__) /* Mac OS X doesn't support sem_getvalue() as of version 10.4 */ #include "../generic/SDL_syssem.c" #else -struct SDL_semaphore { - sem_t sem; +struct SDL_semaphore +{ + sem_t sem; }; /* Create a semaphore, initialized with value */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem * +SDL_CreateSemaphore(Uint32 initial_value) { - SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); - if ( sem ) { - if ( sem_init(&sem->sem, 0, initial_value) < 0 ) { - SDL_SetError("sem_init() failed"); - SDL_free(sem); - sem = NULL; - } - } else { - SDL_OutOfMemory(); - } - return sem; + SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); + if (sem) { + if (sem_init(&sem->sem, 0, initial_value) < 0) { + SDL_SetError("sem_init() failed"); + SDL_free(sem); + sem = NULL; + } + } else { + SDL_OutOfMemory(); + } + return sem; } -void SDL_DestroySemaphore(SDL_sem *sem) +void +SDL_DestroySemaphore(SDL_sem * sem) { - if ( sem ) { - sem_destroy(&sem->sem); - SDL_free(sem); - } + if (sem) { + sem_destroy(&sem->sem); + SDL_free(sem); + } } -int SDL_SemTryWait(SDL_sem *sem) +int +SDL_SemTryWait(SDL_sem * sem) { - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - retval = SDL_MUTEX_TIMEDOUT; - if ( sem_trywait(&sem->sem) == 0 ) { - retval = 0; - } - return retval; + int retval; + + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } + retval = SDL_MUTEX_TIMEDOUT; + if (sem_trywait(&sem->sem) == 0) { + retval = 0; + } + return retval; } -int SDL_SemWait(SDL_sem *sem) +int +SDL_SemWait(SDL_sem * sem) { - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - while ( ((retval = sem_wait(&sem->sem)) == -1) && (errno == EINTR) ) {} - if ( retval < 0 ) { - SDL_SetError("sem_wait() failed"); - } - return retval; + int retval; + + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } + + retval = sem_wait(&sem->sem); + if (retval < 0) { + retval = SDL_SetError("sem_wait() failed"); + } + return retval; } -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) +int +SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { - int retval; + int retval; #ifdef HAVE_SEM_TIMEDWAIT - struct timeval now; - struct timespec ts_timeout; + struct timeval now; + struct timespec ts_timeout; #else - Uint32 end; + Uint32 end; #endif - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } - /* Try the easy cases first */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } - if ( timeout == SDL_MUTEX_MAXWAIT ) { - return SDL_SemWait(sem); - } + /* Try the easy cases first */ + if (timeout == 0) { + return SDL_SemTryWait(sem); + } + if (timeout == SDL_MUTEX_MAXWAIT) { + return SDL_SemWait(sem); + } #ifdef HAVE_SEM_TIMEDWAIT - /* Setup the timeout. sem_timedwait doesn't wait for - * a lapse of time, but until we reach a certain time. - * This time is now plus the timeout. - */ - gettimeofday(&now, NULL); - - /* Add our timeout to current time */ - now.tv_usec += (timeout % 1000) * 1000; - now.tv_sec += timeout / 1000; - - /* Wrap the second if needed */ - if ( now.tv_usec >= 1000000 ) { - now.tv_usec -= 1000000; - now.tv_sec ++; - } - - /* Convert to timespec */ - ts_timeout.tv_sec = now.tv_sec; - ts_timeout.tv_nsec = now.tv_usec * 1000; - - /* Wait. */ - do - retval = sem_timedwait(&sem->sem, &ts_timeout); - while (retval == -1 && errno == EINTR); - - if (retval == -1) - SDL_SetError(strerror(errno)); + /* Setup the timeout. sem_timedwait doesn't wait for + * a lapse of time, but until we reach a certain time. + * This time is now plus the timeout. + */ + gettimeofday(&now, NULL); + + /* Add our timeout to current time */ + now.tv_usec += (timeout % 1000) * 1000; + now.tv_sec += timeout / 1000; + + /* Wrap the second if needed */ + if ( now.tv_usec >= 1000000 ) { + now.tv_usec -= 1000000; + now.tv_sec ++; + } + + /* Convert to timespec */ + ts_timeout.tv_sec = now.tv_sec; + ts_timeout.tv_nsec = now.tv_usec * 1000; + + /* Wait. */ + do { + retval = sem_timedwait(&sem->sem, &ts_timeout); + } while (retval < 0 && errno == EINTR); + + if (retval < 0) { + if (errno == ETIMEDOUT) { + retval = SDL_MUTEX_TIMEDOUT; + } else { + SDL_SetError(strerror(errno)); + } + } #else - end = SDL_GetTicks() + timeout; - while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) { - if ((SDL_GetTicks() - end) >= 0) { - break; - } - SDL_Delay(0); - } + end = SDL_GetTicks() + timeout; + while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) { + if ((SDL_GetTicks() - end) >= 0) { + break; + } + SDL_Delay(0); + } #endif /* HAVE_SEM_TIMEDWAIT */ - return retval; + return retval; } -Uint32 SDL_SemValue(SDL_sem *sem) +Uint32 +SDL_SemValue(SDL_sem * sem) { - int ret = 0; - if ( sem ) { - sem_getvalue(&sem->sem, &ret); - if ( ret < 0 ) { - ret = 0; - } - } - return (Uint32)ret; + int ret = 0; + if (sem) { + sem_getvalue(&sem->sem, &ret); + if (ret < 0) { + ret = 0; + } + } + return (Uint32) ret; } -int SDL_SemPost(SDL_sem *sem) +int +SDL_SemPost(SDL_sem * sem) { - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = sem_post(&sem->sem); - if ( retval < 0 ) { - SDL_SetError("sem_post() failed"); - } - return retval; + int retval; + + if (!sem) { + return SDL_SetError("Passed a NULL semaphore"); + } + + retval = sem_post(&sem->sem); + if (retval < 0) { + SDL_SetError("sem_post() failed"); + } + return retval; } #endif /* __MACOSX__ */ +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 40cc3b717d..c967ca7f30 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -1,120 +1,207 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ + #include "SDL_config.h" #include + +#if HAVE_PTHREAD_NP_H +#include +#endif + #include +#ifdef __LINUX__ +#include +#include +#include +#include +#endif /* __LINUX__ */ + +#if defined(__LINUX__) || defined(__MACOSX__) || defined(__IPHONEOS__) +#include +#ifndef RTLD_DEFAULT +#define RTLD_DEFAULT NULL +#endif +#endif + +#include "SDL_platform.h" #include "SDL_thread.h" #include "../SDL_thread_c.h" #include "../SDL_systhread.h" +#ifdef __ANDROID__ +#include "../../core/android/SDL_android.h" +#endif + +#include "SDL_assert.h" /* List of signals to mask in the subthreads */ -static int sig_list[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, - SIGVTALRM, SIGPROF, 0 +static const int sig_list[] = { + SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, + SIGVTALRM, SIGPROF, 0 }; -#ifdef __RISCOS__ -/* RISC OS needs to know the main thread for - * it's timer and event processing. */ -int riscos_using_threads = 0; -Uint32 riscos_main_thread = 0; /* Thread running events */ -#endif - -static void *RunThread(void *data) +static void * +RunThread(void *data) { - SDL_RunThread(data); - pthread_exit((void*)0); - return((void *)0); /* Prevent compiler warning */ +#ifdef __ANDROID__ + Android_JNI_SetupThread(); +#endif + SDL_RunThread(data); + return NULL; } -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - pthread_attr_t type; - - /* Set the thread attributes */ - if ( pthread_attr_init(&type) != 0 ) { - SDL_SetError("Couldn't initialize pthread attributes"); - return(-1); - } - pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE); - - /* Create the thread and go! */ - if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - -#ifdef __RISCOS__ - if (riscos_using_threads == 0) { - riscos_using_threads = 1; - riscos_main_thread = SDL_ThreadID(); - } +#if defined(__MACOSX__) || defined(__IPHONEOS__) +static SDL_bool checked_setname = SDL_FALSE; +static int (*ppthread_setname_np)(const char*) = NULL; +#elif defined(__LINUX__) +static SDL_bool checked_setname = SDL_FALSE; +static int (*ppthread_setname_np)(pthread_t, const char*) = NULL; #endif - - return(0); +int +SDL_SYS_CreateThread(SDL_Thread * thread, void *args) +{ + pthread_attr_t type; + + /* do this here before any threads exist, so there's no race condition. */ + #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__) + if (!checked_setname) { + void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np"); + #if defined(__MACOSX__) || defined(__IPHONEOS__) + ppthread_setname_np = (int(*)(const char*)) fn; + #elif defined(__LINUX__) + ppthread_setname_np = (int(*)(pthread_t, const char*)) fn; + #endif + checked_setname = SDL_TRUE; + } + #endif + + /* Set the thread attributes */ + if (pthread_attr_init(&type) != 0) { + return SDL_SetError("Couldn't initialize pthread attributes"); + } + pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE); + + /* Create the thread and go! */ + if (pthread_create(&thread->handle, &type, RunThread, args) != 0) { + return SDL_SetError("Not enough resources to create thread"); + } + + return 0; } -void SDL_SYS_SetupThread(void) +void +SDL_SYS_SetupThread(const char *name) { - int i; - sigset_t mask; - - /* Mask asynchronous signals for this thread */ - sigemptyset(&mask); - for ( i=0; sig_list[i]; ++i ) { - sigaddset(&mask, sig_list[i]); - } - pthread_sigmask(SIG_BLOCK, &mask, 0); + int i; + sigset_t mask; + + if (name != NULL) { + #if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__) + SDL_assert(checked_setname); + if (ppthread_setname_np != NULL) { + #if defined(__MACOSX__) || defined(__IPHONEOS__) + ppthread_setname_np(name); + #elif defined(__LINUX__) + ppthread_setname_np(pthread_self(), name); + #endif + } + #elif HAVE_PTHREAD_SETNAME_NP + pthread_setname_np(pthread_self(), name); + #elif HAVE_PTHREAD_SET_NAME_NP + pthread_set_name_np(pthread_self(), name); + #endif + } + + /* Mask asynchronous signals for this thread */ + sigemptyset(&mask); + for (i = 0; sig_list[i]; ++i) { + sigaddset(&mask, sig_list[i]); + } + pthread_sigmask(SIG_BLOCK, &mask, 0); #ifdef PTHREAD_CANCEL_ASYNCHRONOUS - /* Allow ourselves to be asynchronously cancelled */ - { int oldstate; - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate); - } + /* Allow ourselves to be asynchronously cancelled */ + { + int oldstate; + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate); + } #endif } -/* WARNING: This may not work for systems with 64-bit pid_t */ -Uint32 SDL_ThreadID(void) +SDL_threadID +SDL_ThreadID(void) { - return((Uint32)((size_t)pthread_self())); + return ((SDL_threadID) pthread_self()); } -void SDL_SYS_WaitThread(SDL_Thread *thread) +int +SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { - pthread_join(thread->handle, 0); +#ifdef __LINUX__ + int value; + + if (priority == SDL_THREAD_PRIORITY_LOW) { + value = 19; + } else if (priority == SDL_THREAD_PRIORITY_HIGH) { + value = -20; + } else { + value = 0; + } + if (setpriority(PRIO_PROCESS, syscall(SYS_gettid), value) < 0) { + /* Note that this fails if you're trying to set high priority + and you don't have root permission. BUT DON'T RUN AS ROOT! + */ + return SDL_SetError("setpriority() failed"); + } + return 0; +#else + struct sched_param sched; + int policy; + pthread_t thread = pthread_self(); + + if (pthread_getschedparam(thread, &policy, &sched) < 0) { + return SDL_SetError("pthread_getschedparam() failed"); + } + if (priority == SDL_THREAD_PRIORITY_LOW) { + sched.sched_priority = sched_get_priority_min(policy); + } else if (priority == SDL_THREAD_PRIORITY_HIGH) { + sched.sched_priority = sched_get_priority_max(policy); + } else { + int min_priority = sched_get_priority_min(policy); + int max_priority = sched_get_priority_max(policy); + sched.sched_priority = (min_priority + (max_priority - min_priority) / 2); + } + if (pthread_setschedparam(thread, policy, &sched) < 0) { + return SDL_SetError("pthread_setschedparam() failed"); + } + return 0; +#endif /* linux */ } -void SDL_SYS_KillThread(SDL_Thread *thread) +void +SDL_SYS_WaitThread(SDL_Thread * thread) { -#ifdef PTHREAD_CANCEL_ASYNCHRONOUS - pthread_cancel(thread->handle); -#else -#ifdef __FREEBSD__ -#warning For some reason, this doesnt actually kill a thread - FreeBSD 3.2 -#endif - pthread_kill(thread->handle, SIGKILL); -#endif + pthread_join(thread->handle, 0); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/pthread/SDL_systhread_c.h b/src/thread/pthread/SDL_systhread_c.h index 33ed750ff2..f134b0b33e 100644 --- a/src/thread/pthread/SDL_systhread_c.h +++ b/src/thread/pthread/SDL_systhread_c.h @@ -1,26 +1,27 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #include typedef pthread_t SYS_ThreadHandle; + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/pthread/SDL_systls.c b/src/thread/pthread/SDL_systls.c new file mode 100644 index 0000000000..9ef6e51ac8 --- /dev/null +++ b/src/thread/pthread/SDL_systls.c @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" +#include "SDL_thread.h" +#include "../SDL_thread_c.h" + +#include + + +#define INVALID_PTHREAD_KEY ((pthread_key_t)-1) + +static pthread_key_t thread_local_storage = INVALID_PTHREAD_KEY; +static SDL_bool generic_local_storage = SDL_FALSE; + +SDL_TLSData * +SDL_SYS_GetTLSData() +{ + if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) { + static SDL_SpinLock lock; + SDL_AtomicLock(&lock); + if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) { + pthread_key_t storage; + if (pthread_key_create(&storage, NULL) == 0) { + SDL_MemoryBarrierRelease(); + thread_local_storage = storage; + } else { + generic_local_storage = SDL_TRUE; + } + } + SDL_AtomicUnlock(&lock); + } + if (generic_local_storage) { + return SDL_Generic_GetTLSData(); + } + SDL_MemoryBarrierAcquire(); + return (SDL_TLSData *)pthread_getspecific(thread_local_storage); +} + +int +SDL_SYS_SetTLSData(SDL_TLSData *data) +{ + if (generic_local_storage) { + return SDL_Generic_SetTLSData(data); + } + if (pthread_setspecific(thread_local_storage, data) != 0) { + return SDL_SetError("pthread_setspecific() failed"); + } + return 0; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/riscos/SDL_syscond.c b/src/thread/riscos/SDL_syscond.c deleted file mode 100644 index ee5566647f..0000000000 --- a/src/thread/riscos/SDL_syscond.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* RISC OS implementations uses pthreads based on linux code */ - -#if SDL_THREADS_DISABLED -#include "../generic/SDL_syscond.c" -#else -#include -#include -#include - -#include "SDL_thread.h" -#include "SDL_sysmutex_c.h" - -struct SDL_cond -{ - pthread_cond_t cond; -}; - -/* Create a condition variable */ -SDL_cond * SDL_CreateCond(void) -{ - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if ( cond ) { - if ( pthread_cond_init(&cond->cond, NULL) < 0 ) { - SDL_SetError("pthread_cond_init() failed"); - SDL_free(cond); - cond = NULL; - } - } - return(cond); -} - -/* Destroy a condition variable */ -void SDL_DestroyCond(SDL_cond *cond) -{ - if ( cond ) { - pthread_cond_destroy(&cond->cond); - SDL_free(cond); - } -} - -/* Restart one of the threads that are waiting on the condition variable */ -int SDL_CondSignal(SDL_cond *cond) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pthread_cond_signal(&cond->cond) != 0 ) { - SDL_SetError("pthread_cond_signal() failed"); - retval = -1; - } - return retval; -} - -/* Restart all threads that are waiting on the condition variable */ -int SDL_CondBroadcast(SDL_cond *cond) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pthread_cond_broadcast(&cond->cond) != 0 ) { - SDL_SetError("pthread_cond_broadcast() failed"); - retval = -1; - } - return retval; -} - -int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) -{ - int retval; - struct timeval delta; - struct timespec abstime; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - gettimeofday(&delta, NULL); - - abstime.tv_sec = delta.tv_sec + (ms/1000); - abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000; - if ( abstime.tv_nsec > 1000000000 ) { - abstime.tv_sec += 1; - abstime.tv_nsec -= 1000000000; - } - - tryagain: - retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime); - switch (retval) { - case EINTR: - goto tryagain; - break; - case ETIMEDOUT: - retval = SDL_MUTEX_TIMEDOUT; - break; - case 0: - break; - default: - SDL_SetError("pthread_cond_timedwait() failed"); - retval = -1; - break; - } - return retval; -} - -/* Wait on the condition variable, unlocking the provided mutex. - The mutex must be locked before entering this function! - */ -int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) -{ - int retval; - - if ( ! cond ) { - SDL_SetError("Passed a NULL condition variable"); - return -1; - } - - retval = 0; - if ( pthread_cond_wait(&cond->cond, &mutex->id) != 0 ) { - SDL_SetError("pthread_cond_wait() failed"); - retval = -1; - } - return retval; -} -#endif diff --git a/src/thread/riscos/SDL_sysmutex.c b/src/thread/riscos/SDL_sysmutex.c deleted file mode 100644 index e9ac139b36..0000000000 --- a/src/thread/riscos/SDL_sysmutex.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* RISC OS implementations uses pthreads based on linux code */ - -#include "SDL_thread.h" - -#if SDL_THREADS_DISABLED -#include "../generic/SDL_sysmutex.c" -#else - -#include - -struct SDL_mutex { - pthread_mutex_t id; -#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX - int recursive; - pthread_t owner; -#endif -}; - -SDL_mutex *SDL_CreateMutex (void) -{ - SDL_mutex *mutex; - pthread_mutexattr_t attr; - - /* Allocate the structure */ - mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex)); - if ( mutex ) { - pthread_mutexattr_init(&attr); -#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX - /* No extra attributes necessary */ -#else - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); -#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */ - if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) { - SDL_SetError("pthread_mutex_init() failed"); - SDL_free(mutex); - mutex = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(mutex); -} - -void SDL_DestroyMutex(SDL_mutex *mutex) -{ - if ( mutex ) { - pthread_mutex_destroy(&mutex->id); - SDL_free(mutex); - } -} - -/* Lock the mutex */ -int SDL_mutexP(SDL_mutex *mutex) -{ - int retval; -#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX - pthread_t this_thread; -#endif - - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - retval = 0; -#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX - this_thread = pthread_self(); - if ( mutex->owner == this_thread ) { - ++mutex->recursive; - } else { - /* The order of operations is important. - We set the locking thread id after we obtain the lock - so unlocks from other threads will fail. - */ - if ( pthread_mutex_lock(&mutex->id) == 0 ) { - mutex->owner = this_thread; - mutex->recursive = 0; - } else { - SDL_SetError("pthread_mutex_lock() failed"); - retval = -1; - } - } -#else - if ( pthread_mutex_lock(&mutex->id) < 0 ) { - SDL_SetError("pthread_mutex_lock() failed"); - retval = -1; - } -#endif - return retval; -} - -int SDL_mutexV(SDL_mutex *mutex) -{ - int retval; - - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - - retval = 0; -#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX - /* We can only unlock the mutex if we own it */ - if ( pthread_self() == mutex->owner ) { - if ( mutex->recursive ) { - --mutex->recursive; - } else { - /* The order of operations is important. - First reset the owner so another thread doesn't lock - the mutex and set the ownership before we reset it, - then release the lock semaphore. - */ - mutex->owner = 0; - pthread_mutex_unlock(&mutex->id); - } - } else { - SDL_SetError("mutex not owned by this thread"); - retval = -1; - } - -#else - if ( pthread_mutex_unlock(&mutex->id) < 0 ) { - SDL_SetError("pthread_mutex_unlock() failed"); - retval = -1; - } -#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */ - - return retval; -} -#endif diff --git a/src/thread/riscos/SDL_sysmutex_c.h b/src/thread/riscos/SDL_sysmutex_c.h deleted file mode 100644 index 2391c3c108..0000000000 --- a/src/thread/riscos/SDL_sysmutex_c.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_mutex_c_h -#define _SDL_mutex_c_h - -#if !SDL_THREADS_DISABLED -struct SDL_mutex { - pthread_mutex_t id; -}; -#endif - - -#endif /* _SDL_mutex_c_h */ diff --git a/src/thread/riscos/SDL_syssem.c b/src/thread/riscos/SDL_syssem.c deleted file mode 100644 index 127211bf76..0000000000 --- a/src/thread/riscos/SDL_syssem.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -#include - -#include "SDL_config.h" - -/* RISC OS semiphores based on linux code */ - - -#include "SDL_timer.h" -#include "SDL_thread.h" -#include "SDL_systhread_c.h" - -#if !SDL_THREADS_DISABLED - -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - SDL_SetError("SDL not configured with thread support"); - return (SDL_sem *)0; -} - -void SDL_DestroySemaphore(SDL_sem *sem) -{ - return; -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -int SDL_SemWait(SDL_sem *sem) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -Uint32 SDL_SemValue(SDL_sem *sem) -{ - return 0; -} - -int SDL_SemPost(SDL_sem *sem) -{ - SDL_SetError("SDL not configured with thread support"); - return -1; -} - -#else - - -#include /* For getpid() */ -#include -#include - -struct SDL_semaphore { - sem_t *sem; - sem_t sem_data; -}; - -/* Create a semaphore, initialized with value */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); - if ( sem ) { - if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) { - SDL_SetError("sem_init() failed"); - SDL_free(sem); - sem = NULL; - } else { - sem->sem = &sem->sem_data; - } - } else { - SDL_OutOfMemory(); - } - return sem; -} - -void SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( sem ) { - sem_destroy(sem->sem); - SDL_free(sem); - } -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - retval = SDL_MUTEX_TIMEDOUT; - if ( sem_trywait(sem->sem) == 0 ) { - retval = 0; - } - return retval; -} - -int SDL_SemWait(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - while ( ((retval = sem_wait(sem->sem)) == -1) && (errno == EINTR) ) {} - if ( retval < 0 ) { - SDL_SetError("sem_wait() failed"); - } - return retval; -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - /* Try the easy cases first */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } - if ( timeout == SDL_MUTEX_MAXWAIT ) { - return SDL_SemWait(sem); - } - - /* Ack! We have to busy wait... */ - timeout += SDL_GetTicks(); - do { - retval = SDL_SemTryWait(sem); - if ( retval == 0 ) { - break; - } - SDL_Delay(1); - } while ( SDL_GetTicks() < timeout ); - - return retval; -} - -Uint32 SDL_SemValue(SDL_sem *sem) -{ - int ret = 0; - if ( sem ) { - sem_getvalue(sem->sem, &ret); - if ( ret < 0 ) { - ret = 0; - } - } - return (Uint32)ret; -} - -int SDL_SemPost(SDL_sem *sem) -{ - int retval; - - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } - - retval = sem_post(sem->sem); - if ( retval < 0 ) { - SDL_SetError("sem_post() failed"); - } - return retval; -} - -#endif /* !SDL_THREADS_DISABLED */ diff --git a/src/thread/riscos/SDL_systhread.c b/src/thread/riscos/SDL_systhread.c deleted file mode 100644 index 38fc333ae8..0000000000 --- a/src/thread/riscos/SDL_systhread.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* RISC OS version based on pthreads linux source */ - -#include "SDL_thread.h" -#include "../SDL_systhread.h" - -#if SDL_THREADS_DISABLED - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - SDL_SetError("Threads have not been compiled into this version of the library"); - return(-1); -} - -void SDL_SYS_SetupThread(void) -{ - return; -} - -Uint32 SDL_ThreadID(void) -{ - return(0); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - return; -} - -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - return; -} - -#else - -#include - -/* List of signals to mask in the subthreads */ -static int sig_list[] = { - SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, - SIGVTALRM, SIGPROF, 0 -}; - -#include - -int riscos_using_threads = 0; -Uint32 riscos_main_thread = 0; /* Thread running events */ - -static void *RunThread(void *data) -{ - SDL_RunThread(data); - pthread_exit((void*)0); - return((void *)0); /* Prevent compiler warning */ -} - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - pthread_attr_t type; - - /* Set the thread attributes */ - if ( pthread_attr_init(&type) != 0 ) { - SDL_SetError("Couldn't initialize pthread attributes"); - return(-1); - } - pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE); - - /* Create the thread and go! */ - if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - - if (riscos_using_threads == 0) - { - riscos_using_threads = 1; - riscos_main_thread = SDL_ThreadID(); - } - - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - int i; - sigset_t mask; - - /* Mask asynchronous signals for this thread */ - sigemptyset(&mask); - for ( i=0; sig_list[i]; ++i ) { - sigaddset(&mask, sig_list[i]); - } - pthread_sigmask(SIG_BLOCK, &mask, 0); - -#ifdef PTHREAD_CANCEL_ASYNCHRONOUS - /* Allow ourselves to be asynchronously cancelled */ - { int oldstate; - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate); - } -#endif -} - -Uint32 SDL_ThreadID(void) -{ - return((Uint32)pthread_self()); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - pthread_join(thread->handle, 0); -} - -void SDL_SYS_KillThread(SDL_Thread *thread) -{ -#ifdef PTHREAD_CANCEL_ASYNCHRONOUS - pthread_cancel(thread->handle); -#else - pthread_kill(thread->handle, SIGKILL); -#endif -} - -#endif diff --git a/src/thread/riscos/SDL_systhread_c.h b/src/thread/riscos/SDL_systhread_c.h deleted file mode 100644 index 9e1d2c8c5c..0000000000 --- a/src/thread/riscos/SDL_systhread_c.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#if SDL_THREADS_DISABLED - -typedef int SYS_ThreadHandle; - -#else - -#include - -typedef pthread_t SYS_ThreadHandle; - -#endif diff --git a/src/thread/symbian/SDL_sysmutex.cpp b/src/thread/symbian/SDL_sysmutex.cpp deleted file mode 100644 index f4b1aeaad2..0000000000 --- a/src/thread/symbian/SDL_sysmutex.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* - SDL_sysmutex.cpp - - Epoc version by Markus Mertama (w@iki.fi) -*/ - - -#ifdef SAVE_RCSID -static char rcsid = - "@(#) $Id: SDL_sysmutex.c,v 1.1.2.3 2000/06/22 15:25:23 hercules Exp $"; -#endif - -/* Mutex functions using the Win32 API */ - -//#include -//#include - -#include - -#include "epoc_sdl.h" - -#include "SDL_error.h" -#include "SDL_mutex.h" - - -#ifdef EKA2 //??? -struct SDL_mutex - { - TInt handle; - }; -#else -struct _SDL_mutex - { - TInt handle; - }; -#endif - -extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*); - -TInt NewMutex(const TDesC& aName, TAny* aPtr1, TAny*) - { - return ((RMutex*)aPtr1)->CreateGlobal(aName); - } - -void DeleteMutex(TAny* aMutex) - { - SDL_DestroyMutex ((SDL_mutex*) aMutex); - } - -/* Create a mutex */ -SDL_mutex *SDL_CreateMutex(void) -{ - RMutex rmutex; - - TInt status = CreateUnique(NewMutex, &rmutex, NULL); - if(status != KErrNone) - { - SDL_SetError("Couldn't create mutex"); - } - SDL_mutex* mutex = new /*(ELeave)*/ SDL_mutex; - mutex->handle = rmutex.Handle(); - EpocSdlEnv::AppendCleanupItem(TSdlCleanupItem(DeleteMutex, mutex)); - return(mutex); -} - -/* Free the mutex */ -void SDL_DestroyMutex(SDL_mutex *mutex) -{ - if ( mutex ) - { - RMutex rmutex; - rmutex.SetHandle(mutex->handle); - if(rmutex.IsHeld()) - { - rmutex.Signal(); - } - rmutex.Close(); - EpocSdlEnv::RemoveCleanupItem(mutex); - delete(mutex); - mutex = NULL; - } -} - -/* Lock the mutex */ -int SDL_mutexP(SDL_mutex *mutex) -{ - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - RMutex rmutex; - rmutex.SetHandle(mutex->handle); - rmutex.Wait(); - return(0); -} - -/* Unlock the mutex */ -int SDL_mutexV(SDL_mutex *mutex) -{ - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - RMutex rmutex; - rmutex.SetHandle(mutex->handle); - rmutex.Signal(); - return(0); -} diff --git a/src/thread/symbian/SDL_syssem.cpp b/src/thread/symbian/SDL_syssem.cpp deleted file mode 100644 index 00f9901ee5..0000000000 --- a/src/thread/symbian/SDL_syssem.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* - SDL_syssem.cpp - - Epoc version by Markus Mertama (w@iki.fi) -*/ - -#ifdef SAVE_RCSID -static char rcsid = - "@(#) $Id: SDL_syssem.c,v 1.1.2.4 2000/06/22 15:24:48 hercules Exp $"; -#endif - -/* Semaphore functions using the Win32 API */ - -//#include -//#include -#include - -#include "SDL_error.h" -#include "SDL_thread.h" - - -#define SDL_MUTEX_TIMEOUT -2 - -struct SDL_semaphore - { - TInt handle; - TInt count; - }; - - -extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*); -#ifndef EKA2 -extern TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2); -#endif - -TInt NewSema(const TDesC& aName, TAny* aPtr1, TAny* aPtr2) - { - TInt value = *((TInt*) aPtr2); - return ((RSemaphore*)aPtr1)->CreateGlobal(aName, value); - } - -/* Create a semaphore */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - RSemaphore s; - TInt status = CreateUnique(NewSema, &s, &initial_value); - if(status != KErrNone) - { - SDL_SetError("Couldn't create semaphore"); - } - SDL_semaphore* sem = new /*(ELeave)*/ SDL_semaphore; - sem->handle = s.Handle(); - sem->count = initial_value; - return(sem); -} - -/* Free the semaphore */ -void SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( sem ) - { - RSemaphore sema; - sema.SetHandle(sem->handle); - while(--sem->count) - sema.Signal(); - sema.Close(); - delete sem; - sem = NULL; - } -} - -#ifndef EKA2 - - struct TInfo - { - TInfo(TInt aTime, TInt aHandle) : - iTime(aTime), iHandle(aHandle), iVal(0) {} - TInt iTime; - TInt iHandle; - TInt iVal; - }; - - - -TBool ThreadRun(TAny* aInfo) - { - TInfo* info = STATIC_CAST(TInfo*, aInfo); - User::After(info->iTime); - RSemaphore sema; - sema.SetHandle(info->iHandle); - sema.Signal(); - info->iVal = SDL_MUTEX_TIMEOUT; - return 0; - } - -#endif - - -void _WaitAll(SDL_sem *sem) - { - //since SemTryWait may changed the counter. - //this may not be atomic, but hopes it works. - RSemaphore sema; - sema.SetHandle(sem->handle); - sema.Wait(); - while(sem->count < 0) - { - sema.Wait(); - } - } - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return -1; - } - - if ( timeout == SDL_MUTEX_MAXWAIT ) - { - _WaitAll(sem); - return SDL_MUTEX_MAXWAIT; - } - -#ifdef EKA2 - - RSemaphore sema; - sema.SetHandle(sem->handle); - if(KErrNone == sema.Wait(timeout)) - return 0; - return -1; -#else - RThread thread; - - TInfo* info = new (ELeave)TInfo(timeout, sem->handle); - - TInt status = CreateUnique(NewThread, &thread, info); - - if(status != KErrNone) - return status; - - thread.Resume(); - - _WaitAll(sem); - - if(thread.ExitType() == EExitPending) - { - thread.Kill(SDL_MUTEX_TIMEOUT); - } - - thread.Close(); - - return info->iVal; -#endif -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - if(sem->count > 0) - { - sem->count--; - } - return SDL_MUTEX_TIMEOUT; -} - -int SDL_SemWait(SDL_sem *sem) -{ - return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); -} - -/* Returns the current count of the semaphore */ -Uint32 SDL_SemValue(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return 0; - } - return sem->count; -} - -int SDL_SemPost(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return -1; - } - sem->count++; - RSemaphore sema; - sema.SetHandle(sem->handle); - sema.Signal(); - return 0; -} diff --git a/src/thread/symbian/SDL_systhread.cpp b/src/thread/symbian/SDL_systhread.cpp deleted file mode 100644 index 5e7adc5540..0000000000 --- a/src/thread/symbian/SDL_systhread.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* - SDL_systhread.cpp - Epoc thread management routines for SDL - - Epoc version by Markus Mertama (w@iki.fi) -*/ - -#include "epoc_sdl.h" - -//#include -//#include - - - -extern "C" { -#undef NULL -#include "SDL_error.h" -#include "SDL_thread.h" -#include "SDL_systhread.h" -#include "SDL_thread_c.h" - } - -#include -#include "epoc_sdl.h" - - -static int object_count; - -int RunThread(TAny* data) -{ - CTrapCleanup* cleanup = CTrapCleanup::New(); - TRAPD(err, SDL_RunThread(data)); - EpocSdlEnv::CleanupItems(); - delete cleanup; - return(err); -} - - -TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2) - { - return ((RThread*)(aPtr1))->Create(aName, - RunThread, - KDefaultStackSize, - NULL, - aPtr2); - } - -int CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny* aPtr1, TAny* aPtr2) - { - TBuf<16> name; - TInt status = KErrNone; - do - { - object_count++; - name.Format(_L("SDL_%x"), object_count); - status = aFunc(name, aPtr1, aPtr2); - } - while(status == KErrAlreadyExists); - return status; - } - - -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ - RThread rthread; - - const TInt status = CreateUnique(NewThread, &rthread, args); - if (status != KErrNone) - { - delete(((RThread*)(thread->handle))); - thread->handle = NULL; - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - rthread.Resume(); - thread->handle = rthread.Handle(); - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - return; -} - -Uint32 SDL_ThreadID(void) -{ - RThread current; - const TThreadId id = current.Id(); - return id; -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - SDL_TRACE1("Close thread", thread); - RThread t; - const TInt err = t.Open(thread->threadid); - if(err == KErrNone && t.ExitType() == EExitPending) - { - TRequestStatus status; - t.Logon(status); - User::WaitForRequest(status); - } - t.Close(); - - /* RUndertaker taker; - taker.Create(); - TRequestStatus status; - taker.Logon(status, thread->handle); - User::WaitForRequest(status); - taker.Close();*/ - SDL_TRACE1("Closed thread", thread); -} - -/* WARNING: This function is really a last resort. - * Threads should be signaled and then exit by themselves. - * TerminateThread() doesn't perform stack and DLL cleanup. - */ -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - RThread rthread; - rthread.SetHandle(thread->handle); - rthread.Kill(0); - rthread.Close(); -} diff --git a/src/thread/symbian/SDL_systhread_c.h b/src/thread/symbian/SDL_systhread_c.h deleted file mode 100644 index f5f1729cda..0000000000 --- a/src/thread/symbian/SDL_systhread_c.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* - SDL_systhread_c.h - - Epoc version by Markus Mertama (w@iki.fi) -*/ - -typedef int SYS_ThreadHandle; - diff --git a/src/thread/win32/SDL_sysmutex.c b/src/thread/win32/SDL_sysmutex.c deleted file mode 100644 index 1d7805c062..0000000000 --- a/src/thread/win32/SDL_sysmutex.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Mutex functions using the Win32 API */ - -#define WIN32_LEAN_AND_MEAN -#include - -#include "SDL_mutex.h" - - -struct SDL_mutex { - HANDLE id; -}; - -/* Create a mutex */ -SDL_mutex *SDL_CreateMutex(void) -{ - SDL_mutex *mutex; - - /* Allocate mutex memory */ - mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); - if ( mutex ) { - /* Create the mutex, with initial value signaled */ - mutex->id = CreateMutex(NULL, FALSE, NULL); - if ( ! mutex->id ) { - SDL_SetError("Couldn't create mutex"); - SDL_free(mutex); - mutex = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(mutex); -} - -/* Free the mutex */ -void SDL_DestroyMutex(SDL_mutex *mutex) -{ - if ( mutex ) { - if ( mutex->id ) { - CloseHandle(mutex->id); - mutex->id = 0; - } - SDL_free(mutex); - } -} - -/* Lock the mutex */ -int SDL_mutexP(SDL_mutex *mutex) -{ - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - if ( WaitForSingleObject(mutex->id, INFINITE) == WAIT_FAILED ) { - SDL_SetError("Couldn't wait on mutex"); - return -1; - } - return(0); -} - -/* Unlock the mutex */ -int SDL_mutexV(SDL_mutex *mutex) -{ - if ( mutex == NULL ) { - SDL_SetError("Passed a NULL mutex"); - return -1; - } - if ( ReleaseMutex(mutex->id) == FALSE ) { - SDL_SetError("Couldn't release mutex"); - return -1; - } - return(0); -} diff --git a/src/thread/win32/SDL_syssem.c b/src/thread/win32/SDL_syssem.c deleted file mode 100644 index 261d24cbfe..0000000000 --- a/src/thread/win32/SDL_syssem.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Semaphore functions using the Win32 API */ - -#define WIN32_LEAN_AND_MEAN -#include - -#include "SDL_thread.h" -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) -#include "win_ce_semaphore.h" -#endif - - -struct SDL_semaphore { -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - SYNCHHANDLE id; -#else - HANDLE id; -#endif - volatile LONG count; -}; - - -/* Create a semaphore */ -SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) -{ - SDL_sem *sem; - - /* Allocate sem memory */ - sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); - if ( sem ) { - /* Create the semaphore, with max value 32K */ -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - sem->id = CreateSemaphoreCE(NULL, initial_value, 32*1024, NULL); -#else - sem->id = CreateSemaphore(NULL, initial_value, 32*1024, NULL); -#endif - sem->count = (LONG) initial_value; - if ( ! sem->id ) { - SDL_SetError("Couldn't create semaphore"); - SDL_free(sem); - sem = NULL; - } - } else { - SDL_OutOfMemory(); - } - return(sem); -} - -/* Free the semaphore */ -void SDL_DestroySemaphore(SDL_sem *sem) -{ - if ( sem ) { - if ( sem->id ) { -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - CloseSynchHandle(sem->id); -#else - CloseHandle(sem->id); -#endif - sem->id = 0; - } - SDL_free(sem); - } -} - -int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) -{ - int retval; - DWORD dwMilliseconds; - - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return -1; - } - - if ( timeout == SDL_MUTEX_MAXWAIT ) { - dwMilliseconds = INFINITE; - } else { - dwMilliseconds = (DWORD)timeout; - } -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - switch (WaitForSemaphoreCE(sem->id, dwMilliseconds)) { -#else - switch (WaitForSingleObject(sem->id, dwMilliseconds)) { -#endif - case WAIT_OBJECT_0: - InterlockedDecrement(&sem->count); - retval = 0; - break; - case WAIT_TIMEOUT: - retval = SDL_MUTEX_TIMEDOUT; - break; - default: - SDL_SetError("WaitForSingleObject() failed"); - retval = -1; - break; - } - return retval; -} - -int SDL_SemTryWait(SDL_sem *sem) -{ - return SDL_SemWaitTimeout(sem, 0); -} - -int SDL_SemWait(SDL_sem *sem) -{ - return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); -} - -/* Returns the current count of the semaphore */ -Uint32 SDL_SemValue(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return 0; - } - return (Uint32) sem->count; -} - -int SDL_SemPost(SDL_sem *sem) -{ - if ( ! sem ) { - SDL_SetError("Passed a NULL sem"); - return -1; - } - /* Increase the counter in the first place, because - * after a successful release the semaphore may - * immediately get destroyed by another thread which - * is waiting for this semaphore. - */ - InterlockedIncrement(&sem->count); -#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) - if ( ReleaseSemaphoreCE(sem->id, 1, NULL) == FALSE ) { -#else - if ( ReleaseSemaphore(sem->id, 1, NULL) == FALSE ) { -#endif - InterlockedDecrement(&sem->count); /* restore */ - SDL_SetError("ReleaseSemaphore() failed"); - return -1; - } - return 0; -} diff --git a/src/thread/win32/SDL_systhread.c b/src/thread/win32/SDL_systhread.c deleted file mode 100644 index 55cb88a58c..0000000000 --- a/src/thread/win32/SDL_systhread.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Win32 thread management routines for SDL */ - -#define WIN32_LEAN_AND_MEAN -#include - -#include "SDL_thread.h" -#include "../SDL_thread_c.h" -#include "../SDL_systhread.h" - -#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD -#ifndef _WIN32_WCE -/* We'll use the C library from this DLL */ -#include -#endif - -#if defined(__WATCOMC__) -/* This is for Watcom targets except OS2 */ -#if __WATCOMC__ < 1240 -#define __watcall -#endif -typedef unsigned long (__watcall *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__watcall *pfnSDL_CurrentEndThread)(unsigned code); -#elif (defined(__MINGW32__) && (__GNUC__ < 4)) -typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); -#else -typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); -#endif -#endif /* !SDL_PASSED_BEGINTHREAD_ENDTHREAD */ - - -typedef struct ThreadStartParms -{ - void *args; - pfnSDL_CurrentEndThread pfnCurrentEndThread; -} tThreadStartParms, *pThreadStartParms; - -static DWORD RunThread(void *data) -{ - pThreadStartParms pThreadParms = (pThreadStartParms)data; - pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL; - - // Call the thread function! - SDL_RunThread(pThreadParms->args); - - // Get the current endthread we have to use! - if (pThreadParms) - { - pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread; - SDL_free(pThreadParms); - } - // Call endthread! - if (pfnCurrentEndThread) - (*pfnCurrentEndThread)(0); - return(0); -} - -static DWORD WINAPI RunThreadViaCreateThread(LPVOID data) -{ - return RunThread(data); -} - -static unsigned __stdcall RunThreadViaBeginThreadEx(void *data) -{ - return (unsigned) RunThread(data); -} - -#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) -{ -#else -int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) -{ -#ifdef _WIN32_WCE - pfnSDL_CurrentBeginThread pfnBeginThread = NULL; - pfnSDL_CurrentEndThread pfnEndThread = NULL; -#else - pfnSDL_CurrentBeginThread pfnBeginThread = _beginthreadex; - pfnSDL_CurrentEndThread pfnEndThread = _endthreadex; -#endif -#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ - pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms)); - if (!pThreadParms) { - SDL_OutOfMemory(); - return(-1); - } - - // Save the function which we will have to call to clear the RTL of calling app! - pThreadParms->pfnCurrentEndThread = pfnEndThread; - // Also save the real parameters we have to pass to thread function - pThreadParms->args = args; - - if (pfnBeginThread) { - unsigned threadid = 0; - thread->handle = (SYS_ThreadHandle) - ((size_t) pfnBeginThread(NULL, 0, RunThreadViaBeginThreadEx, - pThreadParms, 0, &threadid)); - } else { - DWORD threadid = 0; - thread->handle = CreateThread(NULL, 0, RunThreadViaCreateThread, pThreadParms, 0, &threadid); - } - if (thread->handle == NULL) { - SDL_SetError("Not enough resources to create thread"); - return(-1); - } - return(0); -} - -void SDL_SYS_SetupThread(void) -{ - return; -} - -Uint32 SDL_ThreadID(void) -{ - return((Uint32)GetCurrentThreadId()); -} - -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - WaitForSingleObject(thread->handle, INFINITE); - CloseHandle(thread->handle); -} - -/* WARNING: This function is really a last resort. - * Threads should be signaled and then exit by themselves. - * TerminateThread() doesn't perform stack and DLL cleanup. - */ -void SDL_SYS_KillThread(SDL_Thread *thread) -{ - TerminateThread(thread->handle, FALSE); -} diff --git a/src/thread/win32/SDL_systhread_c.h b/src/thread/win32/SDL_systhread_c.h deleted file mode 100644 index 10b0a7d6b5..0000000000 --- a/src/thread/win32/SDL_systhread_c.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#define WIN32_LEAN_AND_MEAN -#include - -typedef HANDLE SYS_ThreadHandle; - diff --git a/src/thread/win32/win_ce_semaphore.c b/src/thread/win32/win_ce_semaphore.c deleted file mode 100644 index 9db45c4391..0000000000 --- a/src/thread/win32/win_ce_semaphore.c +++ /dev/null @@ -1,216 +0,0 @@ -/* win_ce_semaphore.c - - Copyright (c) 1998, Johnson M. Hart - (with corrections 2001 by Rainer Loritz) - Permission is granted for any and all use providing that this - copyright is properly acknowledged. - There are no assurances of suitability for any use whatsoever. - - WINDOWS CE: There is a collection of Windows CE functions to simulate - semaphores using only a mutex and an event. As Windows CE events cannot - be named, these simulated semaphores cannot be named either. - - Implementation notes: - 1. All required internal data structures are allocated on the process's heap. - 2. Where appropriate, a new error code is returned (see the header - file), or, if the error is a Win32 error, that code is unchanged. - 3. Notice the new handle type "SYNCHHANDLE" that has handles, counters, - and other information. This structure will grow as new objects are added - to this set; some members are specific to only one or two of the objects. - 4. Mutexes are used for critical sections. These could be replaced with - CRITICAL_SECTION objects but then this would give up the time out - capability. - 5. The implementation shows several interesting aspects of synchronization, some - of which are specific to Win32 and some of which are general. These are pointed - out in the comments as appropriate. - 6. The wait function emulates WaitForSingleObject only. An emulation of - WaitForMultipleObjects is much harder to implement outside the kernel, - and it is not clear how to handle a mixture of WCE semaphores and normal - events and mutexes. */ - -#define WIN32_LEAN_AND_MEAN -#include - -#include "win_ce_semaphore.h" - -static SYNCHHANDLE CleanUp (SYNCHHANDLE hSynch, DWORD Flags); - -SYNCHHANDLE CreateSemaphoreCE ( - - LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, /* pointer to security attributes */ - LONG lInitialCount, /* initial count */ - LONG lMaximumCount, /* maximum count */ - LPCTSTR lpName ) - -/* Semaphore for use with Windows CE that does not support them directly. - Requires a counter, a mutex to protect the counter, and an - autoreset event. - - Here are the rules that must always hold between the autoreset event - and the mutex (any violation of these rules by the CE semaphore functions - will, in all likelihood, result in a defect): - 1. No thread can set, pulse, or reset the event, - nor can it access any part of the SYNCHHANDLE structure, - without first gaining ownership of the mutex. - BUT, a thread can wait on the event without owning the mutex - (this is clearly necessary or else the event could never be set). - 2. The event is in a signaled state if and only if the current semaphore - count ("CurCount") is greater than zero. - 3. The semaphore count is always >= 0 and <= the maximum count */ - -{ - SYNCHHANDLE hSynch = NULL, result = NULL; - - __try - { - if (lInitialCount > lMaximumCount || lMaximumCount < 0 || lInitialCount < 0) - { - /* Bad parameters */ - SetLastError (SYNCH_ERROR); - __leave; - } - - hSynch = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, SYNCH_HANDLE_SIZE); - if (hSynch == NULL) __leave; - - hSynch->MaxCount = lMaximumCount; - hSynch->CurCount = lInitialCount; - hSynch->lpName = lpName; - - hSynch->hMutex = CreateMutex (lpSemaphoreAttributes, FALSE, NULL); - - WaitForSingleObject (hSynch->hMutex, INFINITE); - /* Create the event. It is initially signaled if and only if the - initial count is > 0 */ - hSynch->hEvent = CreateEvent (lpSemaphoreAttributes, FALSE, - lInitialCount > 0, NULL); - ReleaseMutex (hSynch->hMutex); - hSynch->hSemph = NULL; - } - __finally - { - /* Return with the handle, or, if there was any error, return - a null after closing any open handles and freeing any allocated memory. */ - result=CleanUp(hSynch, 6 /* An event and a mutex, but no semaphore. */); - } - - return result; -} - -BOOL ReleaseSemaphoreCE (SYNCHHANDLE hSemCE, LONG cReleaseCount, LPLONG lpPreviousCount) -/* Windows CE equivalent to ReleaseSemaphore. */ -{ - BOOL Result = TRUE; - - /* Gain access to the object to assure that the release count - would not cause the total count to exceed the maximum. */ - - __try - { - WaitForSingleObject (hSemCE->hMutex, INFINITE); - /* reply only if asked to */ - if (lpPreviousCount!=NULL) - *lpPreviousCount = hSemCE->CurCount; - if (hSemCE->CurCount + cReleaseCount > hSemCE->MaxCount || cReleaseCount <= 0) - { - SetLastError (SYNCH_ERROR); - Result = FALSE; - __leave; - } - hSemCE->CurCount += cReleaseCount; - - /* Set the autoreset event, releasing exactly one waiting thread, now or - in the future. */ - - SetEvent (hSemCE->hEvent); - } - __finally - { - ReleaseMutex (hSemCE->hMutex); - } - - return Result; -} - -DWORD WaitForSemaphoreCE (SYNCHHANDLE hSemCE, DWORD dwMilliseconds) - /* Windows CE semaphore equivalent of WaitForSingleObject. */ -{ - DWORD WaitResult; - - WaitResult = WaitForSingleObject (hSemCE->hMutex, dwMilliseconds); - if (WaitResult != WAIT_OBJECT_0 && WaitResult != WAIT_ABANDONED_0) return WaitResult; - while (hSemCE->CurCount <= 0) - { - - /* The count is 0, and the thread must wait on the event (which, by - the rules, is currently reset) for semaphore resources to become - available. First, of course, the mutex must be released so that another - thread will be capable of setting the event. */ - - ReleaseMutex (hSemCE->hMutex); - - /* Wait for the event to be signaled, indicating a semaphore state change. - The event is autoreset and signaled with a SetEvent (not PulseEvent) - so exactly one waiting thread (whether or not there is currently - a waiting thread) is released as a result of the SetEvent. */ - - WaitResult = WaitForSingleObject (hSemCE->hEvent, dwMilliseconds); - if (WaitResult != WAIT_OBJECT_0) return WaitResult; - - /* This is where the properties of setting of an autoreset event is critical - to assure that, even if the semaphore state changes between the - preceding Wait and the next, and even if NO threads are waiting - on the event at the time of the SetEvent, at least one thread - will be released. - Pulsing a manual reset event would appear to work, but it would have - a defect which could appear if the semaphore state changed between - the two waits. */ - - WaitResult = WaitForSingleObject (hSemCE->hMutex, dwMilliseconds); - if (WaitResult != WAIT_OBJECT_0 && WaitResult != WAIT_ABANDONED_0) return WaitResult; - - } - /* The count is not zero and this thread owns the mutex. */ - - hSemCE->CurCount--; - /* The event is now unsignaled, BUT, the semaphore count may not be - zero, in which case the event should be signaled again - before releasing the mutex. */ - - if (hSemCE->CurCount > 0) SetEvent (hSemCE->hEvent); - ReleaseMutex (hSemCE->hMutex); - return WaitResult; -} - -BOOL CloseSynchHandle (SYNCHHANDLE hSynch) -/* Close a synchronization handle. - Improvement: Test for a valid handle before dereferencing the handle. */ -{ - BOOL Result = TRUE; - if (hSynch->hEvent != NULL) Result = Result && CloseHandle (hSynch->hEvent); - if (hSynch->hMutex != NULL) Result = Result && CloseHandle (hSynch->hMutex); - if (hSynch->hSemph != NULL) Result = Result && CloseHandle (hSynch->hSemph); - HeapFree (GetProcessHeap (), 0, hSynch); - return (Result); -} - -static SYNCHHANDLE CleanUp (SYNCHHANDLE hSynch, DWORD Flags) -{ /* Prepare to return from a create of a synchronization handle. - If there was any failure, free any allocated resources. - "Flags" indicates which Win32 objects are required in the - synchronization handle. */ - - BOOL ok = TRUE; - - if (hSynch == NULL) return NULL; - if ((Flags & 4) == 1 && (hSynch->hEvent == NULL)) ok = FALSE; - if ((Flags & 2) == 1 && (hSynch->hMutex == NULL)) ok = FALSE; - if ((Flags & 1) == 1 && (hSynch->hEvent == NULL)) ok = FALSE; - if (!ok) - { - CloseSynchHandle (hSynch); - return NULL; - } - /* Everything worked */ - return hSynch; -} diff --git a/src/thread/win32/win_ce_semaphore.h b/src/thread/win32/win_ce_semaphore.h deleted file mode 100644 index af2d7b613d..0000000000 --- a/src/thread/win32/win_ce_semaphore.h +++ /dev/null @@ -1,22 +0,0 @@ -/* win_ce_semaphore.h - header file to go with win_ce_semaphore.c */ - -typedef struct _SYNCH_HANDLE_STRUCTURE { - HANDLE hEvent; - HANDLE hMutex; - HANDLE hSemph; - LONG MaxCount; - volatile LONG CurCount; - LPCTSTR lpName; -} SYNCH_HANDLE_STRUCTURE, *SYNCHHANDLE; - -#define SYNCH_HANDLE_SIZE sizeof (SYNCH_HANDLE_STRUCTURE) - - /* Error codes - all must have bit 29 set */ -#define SYNCH_ERROR 0X20000000 /* EXERCISE - REFINE THE ERROR NUMBERS */ - -extern SYNCHHANDLE CreateSemaphoreCE (LPSECURITY_ATTRIBUTES, LONG, LONG, LPCTSTR); - -extern BOOL ReleaseSemaphoreCE (SYNCHHANDLE, LONG, LPLONG); -extern DWORD WaitForSemaphoreCE (SYNCHHANDLE, DWORD); - -extern BOOL CloseSynchHandle (SYNCHHANDLE); diff --git a/src/thread/windows/SDL_sysmutex.c b/src/thread/windows/SDL_sysmutex.c new file mode 100644 index 0000000000..60e9c6c87a --- /dev/null +++ b/src/thread/windows/SDL_sysmutex.c @@ -0,0 +1,106 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_THREAD_WINDOWS + +/* Mutex functions using the Win32 API */ + +#include "../../core/windows/SDL_windows.h" + +#include "SDL_mutex.h" + + +struct SDL_mutex +{ + CRITICAL_SECTION cs; +}; + +/* Create a mutex */ +SDL_mutex * +SDL_CreateMutex(void) +{ + SDL_mutex *mutex; + + /* Allocate mutex memory */ + mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); + if (mutex) { + /* Initialize */ + /* On SMP systems, a non-zero spin count generally helps performance */ + InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000); + } else { + SDL_OutOfMemory(); + } + return (mutex); +} + +/* Free the mutex */ +void +SDL_DestroyMutex(SDL_mutex * mutex) +{ + if (mutex) { + DeleteCriticalSection(&mutex->cs); + SDL_free(mutex); + } +} + +/* Lock the mutex */ +int +SDL_LockMutex(SDL_mutex * mutex) +{ + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + EnterCriticalSection(&mutex->cs); + return (0); +} + +/* TryLock the mutex */ +int +SDL_TryLockMutex(SDL_mutex * mutex) +{ + int retval = 0; + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + if (TryEnterCriticalSection(&mutex->cs) == 0) { + retval = SDL_MUTEX_TIMEDOUT; + } + return retval; +} + +/* Unlock the mutex */ +int +SDL_UnlockMutex(SDL_mutex * mutex) +{ + if (mutex == NULL) { + return SDL_SetError("Passed a NULL mutex"); + } + + LeaveCriticalSection(&mutex->cs); + return (0); +} + +#endif /* SDL_THREAD_WINDOWS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/windows/SDL_syssem.c b/src/thread/windows/SDL_syssem.c new file mode 100644 index 0000000000..8dc72bcb94 --- /dev/null +++ b/src/thread/windows/SDL_syssem.c @@ -0,0 +1,148 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_THREAD_WINDOWS + +/* Semaphore functions using the Win32 API */ + +#include "../../core/windows/SDL_windows.h" + +#include "SDL_thread.h" + +struct SDL_semaphore +{ + HANDLE id; + LONG count; +}; + + +/* Create a semaphore */ +SDL_sem * +SDL_CreateSemaphore(Uint32 initial_value) +{ + SDL_sem *sem; + + /* Allocate sem memory */ + sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); + if (sem) { + /* Create the semaphore, with max value 32K */ + sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL); + sem->count = initial_value; + if (!sem->id) { + SDL_SetError("Couldn't create semaphore"); + SDL_free(sem); + sem = NULL; + } + } else { + SDL_OutOfMemory(); + } + return (sem); +} + +/* Free the semaphore */ +void +SDL_DestroySemaphore(SDL_sem * sem) +{ + if (sem) { + if (sem->id) { + CloseHandle(sem->id); + sem->id = 0; + } + SDL_free(sem); + } +} + +int +SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) +{ + int retval; + DWORD dwMilliseconds; + + if (!sem) { + return SDL_SetError("Passed a NULL sem"); + } + + if (timeout == SDL_MUTEX_MAXWAIT) { + dwMilliseconds = INFINITE; + } else { + dwMilliseconds = (DWORD) timeout; + } + switch (WaitForSingleObject(sem->id, dwMilliseconds)) { + case WAIT_OBJECT_0: + InterlockedDecrement(&sem->count); + retval = 0; + break; + case WAIT_TIMEOUT: + retval = SDL_MUTEX_TIMEDOUT; + break; + default: + retval = SDL_SetError("WaitForSingleObject() failed"); + break; + } + return retval; +} + +int +SDL_SemTryWait(SDL_sem * sem) +{ + return SDL_SemWaitTimeout(sem, 0); +} + +int +SDL_SemWait(SDL_sem * sem) +{ + return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); +} + +/* Returns the current count of the semaphore */ +Uint32 +SDL_SemValue(SDL_sem * sem) +{ + if (!sem) { + SDL_SetError("Passed a NULL sem"); + return 0; + } + return (Uint32)sem->count; +} + +int +SDL_SemPost(SDL_sem * sem) +{ + if (!sem) { + return SDL_SetError("Passed a NULL sem"); + } + /* Increase the counter in the first place, because + * after a successful release the semaphore may + * immediately get destroyed by another thread which + * is waiting for this semaphore. + */ + InterlockedIncrement(&sem->count); + if (ReleaseSemaphore(sem->id, 1, NULL) == FALSE) { + InterlockedDecrement(&sem->count); /* restore */ + return SDL_SetError("ReleaseSemaphore() failed"); + } + return 0; +} + +#endif /* SDL_THREAD_WINDOWS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c new file mode 100644 index 0000000000..6cf826ec79 --- /dev/null +++ b/src/thread/windows/SDL_systhread.c @@ -0,0 +1,219 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_THREAD_WINDOWS + +/* Win32 thread management routines for SDL */ + +#include "SDL_thread.h" +#include "../SDL_thread_c.h" +#include "../SDL_systhread.h" +#include "SDL_systhread_c.h" + +#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD +/* We'll use the C library from this DLL */ +#include + +/* Cygwin gcc-3 ... MingW64 (even with a i386 host) does this like MSVC. */ +#if (defined(__MINGW32__) && (__GNUC__ < 4)) +typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); + +#elif defined(__WATCOMC__) +/* This is for Watcom targets except OS2 */ +#if __WATCOMC__ < 1240 +#define __watcall +#endif +typedef unsigned long (__watcall * pfnSDL_CurrentBeginThread) (void *, + unsigned, + unsigned + (__stdcall * + func) (void + *), + void *arg, + unsigned, + unsigned + *threadID); +typedef void (__watcall * pfnSDL_CurrentEndThread) (unsigned code); + +#else +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall * + func) (void + *), + void *arg, unsigned, + unsigned *threadID); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); +#endif +#endif /* !SDL_PASSED_BEGINTHREAD_ENDTHREAD */ + + +typedef struct ThreadStartParms +{ + void *args; + pfnSDL_CurrentEndThread pfnCurrentEndThread; +} tThreadStartParms, *pThreadStartParms; + +static DWORD +RunThread(void *data) +{ + pThreadStartParms pThreadParms = (pThreadStartParms) data; + pfnSDL_CurrentEndThread pfnEndThread = pThreadParms->pfnCurrentEndThread; + void *args = pThreadParms->args; + SDL_free(pThreadParms); + SDL_RunThread(args); + if (pfnEndThread != NULL) + pfnEndThread(0); + return (0); +} + +static DWORD WINAPI +RunThreadViaCreateThread(LPVOID data) +{ + return RunThread(data); +} + +static unsigned __stdcall +RunThreadViaBeginThreadEx(void *data) +{ + return (unsigned) RunThread(data); +} + +#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD +int +SDL_SYS_CreateThread(SDL_Thread * thread, void *args, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread) +{ +#elif defined(__CYGWIN__) +int +SDL_SYS_CreateThread(SDL_Thread * thread, void *args) +{ + pfnSDL_CurrentBeginThread pfnBeginThread = NULL; + pfnSDL_CurrentEndThread pfnEndThread = NULL; +#else +int +SDL_SYS_CreateThread(SDL_Thread * thread, void *args) +{ + pfnSDL_CurrentBeginThread pfnBeginThread = _beginthreadex; + pfnSDL_CurrentEndThread pfnEndThread = _endthreadex; +#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ + pThreadStartParms pThreadParms = + (pThreadStartParms) SDL_malloc(sizeof(tThreadStartParms)); + if (!pThreadParms) { + return SDL_OutOfMemory(); + } + /* Save the function which we will have to call to clear the RTL of calling app! */ + pThreadParms->pfnCurrentEndThread = pfnEndThread; + /* Also save the real parameters we have to pass to thread function */ + pThreadParms->args = args; + + if (pfnBeginThread) { + unsigned threadid = 0; + thread->handle = (SYS_ThreadHandle) + ((size_t) pfnBeginThread(NULL, 0, RunThreadViaBeginThreadEx, + pThreadParms, 0, &threadid)); + } else { + DWORD threadid = 0; + thread->handle = CreateThread(NULL, 0, RunThreadViaCreateThread, + pThreadParms, 0, &threadid); + } + if (thread->handle == NULL) { + return SDL_SetError("Not enough resources to create thread"); + } + return 0; +} + +#ifdef _MSC_VER +#pragma pack(push,8) +typedef struct tagTHREADNAME_INFO +{ + DWORD dwType; /* must be 0x1000 */ + LPCSTR szName; /* pointer to name (in user addr space) */ + DWORD dwThreadID; /* thread ID (-1=caller thread) */ + DWORD dwFlags; /* reserved for future use, must be zero */ +} THREADNAME_INFO; +#pragma pack(pop) +#endif + +void +SDL_SYS_SetupThread(const char *name) +{ + if (name != NULL) { + #if 0 /* !!! FIXME: __except needs C runtime, which we don't link against. */ + #ifdef _MSC_VER /* !!! FIXME: can we do SEH on other compilers yet? */ + /* This magic tells the debugger to name a thread if it's listening. */ + THREADNAME_INFO inf; + inf.dwType = 0x1000; + inf.szName = name; + inf.dwThreadID = (DWORD) -1; + inf.dwFlags = 0; + + __try + { + RaiseException(0x406D1388, 0, sizeof(inf)/sizeof(DWORD), (DWORD*)&inf); + } + __except(EXCEPTION_CONTINUE_EXECUTION) + { + /* The program itself should ignore this bogus exception. */ + } + #endif + #endif + } +} + +SDL_threadID +SDL_ThreadID(void) +{ + return ((SDL_threadID) GetCurrentThreadId()); +} + +int +SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) +{ + int value; + + if (priority == SDL_THREAD_PRIORITY_LOW) { + value = THREAD_PRIORITY_LOWEST; + } else if (priority == SDL_THREAD_PRIORITY_HIGH) { + value = THREAD_PRIORITY_HIGHEST; + } else { + value = THREAD_PRIORITY_NORMAL; + } + if (!SetThreadPriority(GetCurrentThread(), value)) { + return WIN_SetError("SetThreadPriority()"); + } + return 0; +} + +void +SDL_SYS_WaitThread(SDL_Thread * thread) +{ + WaitForSingleObject(thread->handle, INFINITE); + CloseHandle(thread->handle); +} + +#endif /* SDL_THREAD_WINDOWS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/windows/SDL_systhread_c.h b/src/thread/windows/SDL_systhread_c.h new file mode 100644 index 0000000000..f9f013bb7f --- /dev/null +++ b/src/thread/windows/SDL_systhread_c.h @@ -0,0 +1,32 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_systhread_c_h +#define _SDL_systhread_c_h + +#include "../../core/windows/SDL_windows.h" + +typedef HANDLE SYS_ThreadHandle; + +#endif /* _SDL_systhread_c_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/windows/SDL_systls.c b/src/thread/windows/SDL_systls.c new file mode 100644 index 0000000000..0ece77dd00 --- /dev/null +++ b/src/thread/windows/SDL_systls.c @@ -0,0 +1,72 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_config.h" +#include "SDL_thread.h" +#include "../SDL_thread_c.h" + +#if SDL_THREAD_WINDOWS + +#include "../../core/windows/SDL_windows.h" + + +static DWORD thread_local_storage = TLS_OUT_OF_INDEXES; +static SDL_bool generic_local_storage = SDL_FALSE; + +SDL_TLSData * +SDL_SYS_GetTLSData() +{ + if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) { + static SDL_SpinLock lock; + SDL_AtomicLock(&lock); + if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) { + DWORD storage = TlsAlloc(); + if (storage != TLS_OUT_OF_INDEXES) { + SDL_MemoryBarrierRelease(); + thread_local_storage = storage; + } else { + generic_local_storage = SDL_TRUE; + } + } + SDL_AtomicUnlock(&lock); + } + if (generic_local_storage) { + return SDL_Generic_GetTLSData(); + } + SDL_MemoryBarrierAcquire(); + return (SDL_TLSData *)TlsGetValue(thread_local_storage); +} + +int +SDL_SYS_SetTLSData(SDL_TLSData *data) +{ + if (generic_local_storage) { + return SDL_Generic_SetTLSData(data); + } + if (!TlsSetValue(thread_local_storage, data)) { + return SDL_SetError("TlsSetValue() failed"); + } + return 0; +} + +#endif /* SDL_THREAD_WINDOWS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/SDL_systimer.h b/src/timer/SDL_systimer.h deleted file mode 100644 index d19b67987f..0000000000 --- a/src/timer/SDL_systimer.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* The system dependent timer handling functions */ - -#include "SDL_timer.h" -#include "SDL_timer_c.h" - - -/* Initialize the system dependent timer subsystem */ -extern int SDL_SYS_TimerInit(void); - -/* Quit the system dependent timer subsystem */ -extern void SDL_SYS_TimerQuit(void); - -/* Start a timer set up by SDL_SetTimer() */ -extern int SDL_SYS_StartTimer(void); - -/* Stop a previously started timer */ -extern void SDL_SYS_StopTimer(void); diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c index 8d137e1a70..5b6550c1ca 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -1,285 +1,398 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #include "SDL_timer.h" #include "SDL_timer_c.h" -#include "SDL_mutex.h" -#include "SDL_systimer.h" +#include "SDL_atomic.h" +#include "SDL_cpuinfo.h" +#include "SDL_thread.h" + +extern void SDL_StartTicks(void); /* #define DEBUG_TIMERS */ -int SDL_timer_started = 0; -int SDL_timer_running = 0; +typedef struct _SDL_Timer +{ + int timerID; + SDL_TimerCallback callback; + void *param; + Uint32 interval; + Uint32 scheduled; + volatile SDL_bool canceled; + struct _SDL_Timer *next; +} SDL_Timer; -/* Data to handle a single periodic alarm */ -Uint32 SDL_alarm_interval = 0; -SDL_TimerCallback SDL_alarm_callback; +typedef struct _SDL_TimerMap +{ + int timerID; + SDL_Timer *timer; + struct _SDL_TimerMap *next; +} SDL_TimerMap; -/* Data used for a thread-based timer */ -static int SDL_timer_threaded = 0; +/* The timers are kept in a sorted list */ +typedef struct { + /* Data used by the main thread */ + SDL_Thread *thread; + SDL_atomic_t nextID; + SDL_TimerMap *timermap; + SDL_mutex *timermap_lock; -struct _SDL_TimerID { - Uint32 interval; - SDL_NewTimerCallback cb; - void *param; - Uint32 last_alarm; - struct _SDL_TimerID *next; -}; + /* Padding to separate cache lines between threads */ + char cache_pad[SDL_CACHELINE_SIZE]; -static SDL_TimerID SDL_timers = NULL; -static SDL_mutex *SDL_timer_mutex; -static volatile SDL_bool list_changed = SDL_FALSE; + /* Data used to communicate with the timer thread */ + SDL_SpinLock lock; + SDL_sem *sem; + SDL_Timer * volatile pending; + SDL_Timer * volatile freelist; + volatile SDL_bool active; -/* Set whether or not the timer should use a thread. - This should not be called while the timer subsystem is running. -*/ -int SDL_SetTimerThreaded(int value) -{ - int retval; - - if ( SDL_timer_started ) { - SDL_SetError("Timer already initialized"); - retval = -1; - } else { - retval = 0; - SDL_timer_threaded = value; - } - return retval; -} + /* List of timers - this is only touched by the timer thread */ + SDL_Timer *timers; +} SDL_TimerData; -int SDL_TimerInit(void) +static SDL_TimerData SDL_timer_data; + +static Uint32 ticks_started = 0; + +void +SDL_InitTicks(void) { - int retval; - - retval = 0; - if ( SDL_timer_started ) { - SDL_TimerQuit(); - } - if ( ! SDL_timer_threaded ) { - retval = SDL_SYS_TimerInit(); - } - if ( SDL_timer_threaded ) { - SDL_timer_mutex = SDL_CreateMutex(); - } - if ( retval == 0 ) { - SDL_timer_started = 1; - } - return(retval); + if (!ticks_started) { + SDL_StartTicks(); + ticks_started = 1; + } } -void SDL_TimerQuit(void) +/* The idea here is that any thread might add a timer, but a single + * thread manages the active timer queue, sorted by scheduling time. + * + * Timers are removed by simply setting a canceled flag + */ + +static void +SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer) { - SDL_SetTimer(0, NULL); - if ( SDL_timer_threaded < 2 ) { - SDL_SYS_TimerQuit(); - } - if ( SDL_timer_threaded ) { - SDL_DestroyMutex(SDL_timer_mutex); - SDL_timer_mutex = NULL; - } - SDL_timer_started = 0; - SDL_timer_threaded = 0; + SDL_Timer *prev, *curr; + + prev = NULL; + for (curr = data->timers; curr; prev = curr, curr = curr->next) { + if ((Sint32)(timer->scheduled-curr->scheduled) < 0) { + break; + } + } + + /* Insert the timer here! */ + if (prev) { + prev->next = timer; + } else { + data->timers = timer; + } + timer->next = curr; } -void SDL_ThreadedTimerCheck(void) +static int +SDL_TimerThread(void *_data) { - Uint32 now, ms; - SDL_TimerID t, prev, next; - SDL_bool removed; - - SDL_mutexP(SDL_timer_mutex); - list_changed = SDL_FALSE; - now = SDL_GetTicks(); - for ( prev = NULL, t = SDL_timers; t; t = next ) { - removed = SDL_FALSE; - ms = t->interval - SDL_TIMESLICE; - next = t->next; - if ( (int)(now - t->last_alarm) > (int)ms ) { - struct _SDL_TimerID timer; - - if ( (now - t->last_alarm) < t->interval ) { - t->last_alarm += t->interval; - } else { - t->last_alarm = now; - } -#ifdef DEBUG_TIMERS - printf("Executing timer %p (thread = %d)\n", - t, SDL_ThreadID()); -#endif - timer = *t; - SDL_mutexV(SDL_timer_mutex); - ms = timer.cb(timer.interval, timer.param); - SDL_mutexP(SDL_timer_mutex); - if ( list_changed ) { - /* Abort, list of timers modified */ - /* FIXME: what if ms was changed? */ - break; - } - if ( ms != t->interval ) { - if ( ms ) { - t->interval = ROUND_RESOLUTION(ms); - } else { - /* Remove timer from the list */ -#ifdef DEBUG_TIMERS - printf("SDL: Removing timer %p\n", t); -#endif - if ( prev ) { - prev->next = next; - } else { - SDL_timers = next; - } - SDL_free(t); - --SDL_timer_running; - removed = SDL_TRUE; - } - } - } - /* Don't update prev if the timer has disappeared */ - if ( ! removed ) { - prev = t; - } - } - SDL_mutexV(SDL_timer_mutex); + SDL_TimerData *data = (SDL_TimerData *)_data; + SDL_Timer *pending; + SDL_Timer *current; + SDL_Timer *freelist_head = NULL; + SDL_Timer *freelist_tail = NULL; + Uint32 tick, now, interval, delay; + + /* Threaded timer loop: + * 1. Queue timers added by other threads + * 2. Handle any timers that should dispatch this cycle + * 3. Wait until next dispatch time or new timer arrives + */ + for ( ; ; ) { + /* Pending and freelist maintenance */ + SDL_AtomicLock(&data->lock); + { + /* Get any timers ready to be queued */ + pending = data->pending; + data->pending = NULL; + + /* Make any unused timer structures available */ + if (freelist_head) { + freelist_tail->next = data->freelist; + data->freelist = freelist_head; + } + } + SDL_AtomicUnlock(&data->lock); + + /* Sort the pending timers into our list */ + while (pending) { + current = pending; + pending = pending->next; + SDL_AddTimerInternal(data, current); + } + freelist_head = NULL; + freelist_tail = NULL; + + /* Check to see if we're still running, after maintenance */ + if (!data->active) { + break; + } + + /* Initial delay if there are no timers */ + delay = SDL_MUTEX_MAXWAIT; + + tick = SDL_GetTicks(); + + /* Process all the pending timers for this tick */ + while (data->timers) { + current = data->timers; + + if ((Sint32)(tick-current->scheduled) < 0) { + /* Scheduled for the future, wait a bit */ + delay = (current->scheduled - tick); + break; + } + + /* We're going to do something with this timer */ + data->timers = current->next; + + if (current->canceled) { + interval = 0; + } else { + interval = current->callback(current->interval, current->param); + } + + if (interval > 0) { + /* Reschedule this timer */ + current->scheduled = tick + interval; + SDL_AddTimerInternal(data, current); + } else { + if (!freelist_head) { + freelist_head = current; + } + if (freelist_tail) { + freelist_tail->next = current; + } + freelist_tail = current; + + current->canceled = SDL_TRUE; + } + } + + /* Adjust the delay based on processing time */ + now = SDL_GetTicks(); + interval = (now - tick); + if (interval > delay) { + delay = 0; + } else { + delay -= interval; + } + + /* Note that each time a timer is added, this will return + immediately, but we process the timers added all at once. + That's okay, it just means we run through the loop a few + extra times. + */ + SDL_SemWaitTimeout(data->sem, delay); + } + return 0; } -static SDL_TimerID SDL_AddTimerInternal(Uint32 interval, SDL_NewTimerCallback callback, void *param) +int +SDL_TimerInit(void) { - SDL_TimerID t; - t = (SDL_TimerID) SDL_malloc(sizeof(struct _SDL_TimerID)); - if ( t ) { - t->interval = ROUND_RESOLUTION(interval); - t->cb = callback; - t->param = param; - t->last_alarm = SDL_GetTicks(); - t->next = SDL_timers; - SDL_timers = t; - ++SDL_timer_running; - list_changed = SDL_TRUE; - } -#ifdef DEBUG_TIMERS - printf("SDL_AddTimer(%d) = %08x num_timers = %d\n", interval, (Uint32)t, SDL_timer_running); + SDL_TimerData *data = &SDL_timer_data; + + if (!data->active) { + const char *name = "SDLTimer"; + data->timermap_lock = SDL_CreateMutex(); + if (!data->timermap_lock) { + return -1; + } + + data->sem = SDL_CreateSemaphore(0); + if (!data->sem) { + SDL_DestroyMutex(data->timermap_lock); + return -1; + } + + data->active = SDL_TRUE; + /* !!! FIXME: this is nasty. */ +#if defined(__WIN32__) && !defined(HAVE_LIBC) +#undef SDL_CreateThread + data->thread = SDL_CreateThread(SDL_TimerThread, name, data, NULL, NULL); +#else + data->thread = SDL_CreateThread(SDL_TimerThread, name, data); #endif - return t; -} + if (!data->thread) { + SDL_TimerQuit(); + return -1; + } -SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param) -{ - SDL_TimerID t; - if ( ! SDL_timer_mutex ) { - if ( SDL_timer_started ) { - SDL_SetError("This platform doesn't support multiple timers"); - } else { - SDL_SetError("You must call SDL_Init(SDL_INIT_TIMER) first"); - } - return NULL; - } - if ( ! SDL_timer_threaded ) { - SDL_SetError("Multiple timers require threaded events!"); - return NULL; - } - SDL_mutexP(SDL_timer_mutex); - t = SDL_AddTimerInternal(interval, callback, param); - SDL_mutexV(SDL_timer_mutex); - return t; + SDL_AtomicSet(&data->nextID, 1); + } + return 0; } -SDL_bool SDL_RemoveTimer(SDL_TimerID id) +void +SDL_TimerQuit(void) { - SDL_TimerID t, prev = NULL; - SDL_bool removed; - - removed = SDL_FALSE; - SDL_mutexP(SDL_timer_mutex); - /* Look for id in the linked list of timers */ - for (t = SDL_timers; t; prev=t, t = t->next ) { - if ( t == id ) { - if(prev) { - prev->next = t->next; - } else { - SDL_timers = t->next; - } - SDL_free(t); - --SDL_timer_running; - removed = SDL_TRUE; - list_changed = SDL_TRUE; - break; - } - } -#ifdef DEBUG_TIMERS - printf("SDL_RemoveTimer(%08x) = %d num_timers = %d thread = %d\n", (Uint32)id, removed, SDL_timer_running, SDL_ThreadID()); -#endif - SDL_mutexV(SDL_timer_mutex); - return removed; + SDL_TimerData *data = &SDL_timer_data; + SDL_Timer *timer; + SDL_TimerMap *entry; + + if (data->active) { + data->active = SDL_FALSE; + + /* Shutdown the timer thread */ + if (data->thread) { + SDL_SemPost(data->sem); + SDL_WaitThread(data->thread, NULL); + data->thread = NULL; + } + + SDL_DestroySemaphore(data->sem); + data->sem = NULL; + + /* Clean up the timer entries */ + while (data->timers) { + timer = data->timers; + data->timers = timer->next; + SDL_free(timer); + } + while (data->freelist) { + timer = data->freelist; + data->freelist = timer->next; + SDL_free(timer); + } + while (data->timermap) { + entry = data->timermap; + data->timermap = entry->next; + SDL_free(entry); + } + + SDL_DestroyMutex(data->timermap_lock); + data->timermap_lock = NULL; + } } -/* Old style callback functions are wrapped through this */ -static Uint32 SDLCALL callback_wrapper(Uint32 ms, void *param) +SDL_TimerID +SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) { - SDL_TimerCallback func = (SDL_TimerCallback) param; - return (*func)(ms); + SDL_TimerData *data = &SDL_timer_data; + SDL_Timer *timer; + SDL_TimerMap *entry; + + if (!data->active) { + int status = 0; + + SDL_AtomicLock(&data->lock); + if (!data->active) { + status = SDL_TimerInit(); + } + SDL_AtomicUnlock(&data->lock); + + if (status < 0) { + return 0; + } + } + + SDL_AtomicLock(&data->lock); + timer = data->freelist; + if (timer) { + data->freelist = timer->next; + } + SDL_AtomicUnlock(&data->lock); + + if (timer) { + SDL_RemoveTimer(timer->timerID); + } else { + timer = (SDL_Timer *)SDL_malloc(sizeof(*timer)); + if (!timer) { + SDL_OutOfMemory(); + return 0; + } + } + timer->timerID = SDL_AtomicIncRef(&data->nextID); + timer->callback = callback; + timer->param = param; + timer->interval = interval; + timer->scheduled = SDL_GetTicks() + interval; + timer->canceled = SDL_FALSE; + + entry = (SDL_TimerMap *)SDL_malloc(sizeof(*entry)); + if (!entry) { + SDL_free(timer); + SDL_OutOfMemory(); + return 0; + } + entry->timer = timer; + entry->timerID = timer->timerID; + + SDL_LockMutex(data->timermap_lock); + entry->next = data->timermap; + data->timermap = entry; + SDL_UnlockMutex(data->timermap_lock); + + /* Add the timer to the pending list for the timer thread */ + SDL_AtomicLock(&data->lock); + timer->next = data->pending; + data->pending = timer; + SDL_AtomicUnlock(&data->lock); + + /* Wake up the timer thread if necessary */ + SDL_SemPost(data->sem); + + return entry->timerID; } -int SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback) +SDL_bool +SDL_RemoveTimer(SDL_TimerID id) { - int retval; + SDL_TimerData *data = &SDL_timer_data; + SDL_TimerMap *prev, *entry; + SDL_bool canceled = SDL_FALSE; -#ifdef DEBUG_TIMERS - printf("SDL_SetTimer(%d)\n", ms); -#endif - retval = 0; - - if ( SDL_timer_threaded ) { - SDL_mutexP(SDL_timer_mutex); - } - if ( SDL_timer_running ) { /* Stop any currently running timer */ - if ( SDL_timer_threaded ) { - while ( SDL_timers ) { - SDL_TimerID freeme = SDL_timers; - SDL_timers = SDL_timers->next; - SDL_free(freeme); - } - SDL_timer_running = 0; - list_changed = SDL_TRUE; - } else { - SDL_SYS_StopTimer(); - SDL_timer_running = 0; - } - } - if ( ms ) { - if ( SDL_timer_threaded ) { - if ( SDL_AddTimerInternal(ms, callback_wrapper, (void *)callback) == NULL ) { - retval = -1; - } - } else { - SDL_timer_running = 1; - SDL_alarm_interval = ms; - SDL_alarm_callback = callback; - retval = SDL_SYS_StartTimer(); - } - } - if ( SDL_timer_threaded ) { - SDL_mutexV(SDL_timer_mutex); - } - - return retval; + /* Find the timer */ + SDL_LockMutex(data->timermap_lock); + prev = NULL; + for (entry = data->timermap; entry; prev = entry, entry = entry->next) { + if (entry->timerID == id) { + if (prev) { + prev->next = entry->next; + } else { + data->timermap = entry->next; + } + break; + } + } + SDL_UnlockMutex(data->timermap_lock); + + if (entry) { + if (!entry->timer->canceled) { + entry->timer->canceled = SDL_TRUE; + canceled = SDL_TRUE; + } + SDL_free(entry); + } + return canceled; } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/SDL_timer_c.h b/src/timer/SDL_timer_c.h index 96181081bb..1574853108 100644 --- a/src/timer/SDL_timer_c.h +++ b/src/timer/SDL_timer_c.h @@ -1,46 +1,33 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Useful functions and variables from SDL_timer.c */ #include "SDL_timer.h" -#define ROUND_RESOLUTION(X) \ - (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION) - -extern int SDL_timer_started; -extern int SDL_timer_running; - -/* Data to handle a single periodic alarm */ -extern Uint32 SDL_alarm_interval; -extern SDL_TimerCallback SDL_alarm_callback; - -/* Set whether or not the timer should use a thread. - This should be called while the timer subsystem is running. -*/ -extern int SDL_SetTimerThreaded(int value); +#define ROUND_RESOLUTION(X) \ + (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION) +extern void SDL_InitTicks(void); extern int SDL_TimerInit(void); extern void SDL_TimerQuit(void); -/* This function is called from the SDL event thread if it is available */ -extern void SDL_ThreadedTimerCheck(void); +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/beos/SDL_systimer.c b/src/timer/beos/SDL_systimer.c index f4cf6c765e..edaf27501a 100644 --- a/src/timer/beos/SDL_systimer.c +++ b/src/timer/beos/SDL_systimer.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -25,71 +24,41 @@ #include -#include "SDL_thread.h" #include "SDL_timer.h" -#include "../SDL_timer_c.h" static bigtime_t start; -void SDL_StartTicks(void) +void +SDL_StartTicks(void) { - /* Set first ticks value */ - start = system_time(); + /* Set first ticks value */ + start = system_time(); } -Uint32 SDL_GetTicks(void) +Uint32 +SDL_GetTicks(void) { - return((system_time()-start)/1000); + return ((system_time() - start) / 1000); } -void SDL_Delay(Uint32 ms) -{ - snooze(ms*1000); -} - -/* Data to handle a single periodic alarm */ -static int timer_alive = 0; -static SDL_Thread *timer = NULL; - -static int RunTimer(void *unused) +Uint64 +SDL_GetPerformanceCounter(void) { - while ( timer_alive ) { - if ( SDL_timer_running ) { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(10); - } - return(0); + return system_time(); } -/* This is only called if the event thread is not running */ -int SDL_SYS_TimerInit(void) +Uint64 +SDL_GetPerformanceFrequency(void) { - timer_alive = 1; - timer = SDL_CreateThread(RunTimer, NULL); - if ( timer == NULL ) - return(-1); - return(SDL_SetTimerThreaded(1)); + return 1000000; } -void SDL_SYS_TimerQuit(void) +void +SDL_Delay(Uint32 ms) { - timer_alive = 0; - if ( timer ) { - SDL_WaitThread(timer, NULL); - timer = NULL; - } -} - -int SDL_SYS_StartTimer(void) -{ - SDL_SetError("Internal logic error: BeOS uses threaded timer"); - return(-1); -} - -void SDL_SYS_StopTimer(void) -{ - return; + snooze(ms * 1000); } #endif /* SDL_TIMER_BEOS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/dc/SDL_systimer.c b/src/timer/dc/SDL_systimer.c deleted file mode 100644 index 386e158607..0000000000 --- a/src/timer/dc/SDL_systimer.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_TIMER_DC - -#include - -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "../SDL_timer_c.h" - -static unsigned start; - -/* - jif = ms * HZ /1000 - ms = jif * 1000/HZ -*/ - -void SDL_StartTicks(void) -{ - /* Set first ticks value */ - start = jiffies; -} - -Uint32 SDL_GetTicks(void) -{ - return((jiffies-start)*1000/HZ); -} - -void SDL_Delay(Uint32 ms) -{ - thd_sleep(ms); -} - -/* Data to handle a single periodic alarm */ -static int timer_alive = 0; -static SDL_Thread *timer = NULL; - -static int RunTimer(void *unused) -{ - while ( timer_alive ) { - if ( SDL_timer_running ) { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(10); - } - return(0); -} - -/* This is only called if the event thread is not running */ -int SDL_SYS_TimerInit(void) -{ - timer_alive = 1; - timer = SDL_CreateThread(RunTimer, NULL); - if ( timer == NULL ) - return(-1); - return(SDL_SetTimerThreaded(1)); -} - -void SDL_SYS_TimerQuit(void) -{ - timer_alive = 0; - if ( timer ) { - SDL_WaitThread(timer, NULL); - timer = NULL; - } -} - -int SDL_SYS_StartTimer(void) -{ - SDL_SetError("Internal logic error: DC uses threaded timer"); - return(-1); -} - -void SDL_SYS_StopTimer(void) -{ - return; -} - -#endif /* SDL_TIMER_DC */ diff --git a/src/timer/dummy/SDL_systimer.c b/src/timer/dummy/SDL_systimer.c index cc266bc9a5..2b5a9f8e38 100644 --- a/src/timer/dummy/SDL_systimer.c +++ b/src/timer/dummy/SDL_systimer.c @@ -1,91 +1,59 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED) #include "SDL_timer.h" -#include "../SDL_timer_c.h" - -void SDL_StartTicks(void) -{ -} - -Uint32 SDL_GetTicks (void) -{ - SDL_Unsupported(); - return 0; -} - -void SDL_Delay (Uint32 ms) -{ - SDL_Unsupported(); -} - -#include "SDL_thread.h" -/* Data to handle a single periodic alarm */ -static int timer_alive = 0; -static SDL_Thread *timer = NULL; - -static int RunTimer(void *unused) +void +SDL_StartTicks(void) { - while ( timer_alive ) { - if ( SDL_timer_running ) { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(1); - } - return(0); } -/* This is only called if the event thread is not running */ -int SDL_SYS_TimerInit(void) +Uint32 +SDL_GetTicks(void) { - timer_alive = 1; - timer = SDL_CreateThread(RunTimer, NULL); - if ( timer == NULL ) - return(-1); - return(SDL_SetTimerThreaded(1)); + SDL_Unsupported(); + return 0; } -void SDL_SYS_TimerQuit(void) +Uint64 +SDL_GetPerformanceCounter(void) { - timer_alive = 0; - if ( timer ) { - SDL_WaitThread(timer, NULL); - timer = NULL; - } + return SDL_GetTicks(); } -int SDL_SYS_StartTimer(void) +Uint64 +SDL_GetPerformanceFrequency(void) { - SDL_SetError("Internal logic error: threaded timer in use"); - return(-1); + return 1000; } -void SDL_SYS_StopTimer(void) +void +SDL_Delay(Uint32 ms) { - return; + SDL_Unsupported(); } #endif /* SDL_TIMER_DUMMY || SDL_TIMERS_DISABLED */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/macos/FastTimes.c b/src/timer/macos/FastTimes.c deleted file mode 100644 index 2da74b7d18..0000000000 --- a/src/timer/macos/FastTimes.c +++ /dev/null @@ -1,352 +0,0 @@ -/* File "FastTimes.c" - Original code by Matt Slot */ -/* Created 4/24/99 - This file is hereby placed in the public domain */ -/* Updated 5/21/99 - Calibrate to VIA, add TBR support, renamed functions */ -/* Updated 10/4/99 - Use AbsoluteToNanoseconds() in case Absolute = double */ -/* Updated 2/15/00 - Check for native Time Manager, no need to calibrate */ -/* Updated 2/19/00 - Fixed default value for gScale under native Time Mgr */ -/* Updated 3/21/00 - Fixed ns conversion, create 2 different scale factors */ -/* Updated 5/03/00 - Added copyright and placed into PD. No code changes */ -/* Updated 8/01/00 - Made "Carbon-compatible" by replacing LMGetTicks() */ - -/* This file is Copyright (C) Matt Slot, 1999-2012. It is hereby placed into - the public domain. The author makes no warranty as to fitness or stability */ - -#include -#include -#include -#include -#include - -#include "FastTimes.h" - -#ifdef TARGET_CPU_PPC -#undef GENERATINGPOWERPC /* stop whining */ -#define GENERATINGPOWERPC TARGET_CPU_PPC -#endif - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* - On 680x0 machines, we just use Microseconds(). - - On PowerPC machines, we try several methods: - * DriverServicesLib is available on all PCI PowerMacs, and perhaps - some NuBus PowerMacs. If it is, we use UpTime() : Overhead = 2.1 µsec. - * The PowerPC 601 has a built-in "real time clock" RTC, and we fall - back to that, accessing it directly from asm. Overhead = 1.3 µsec. - * Later PowerPCs have an accurate "time base register" TBR, and we - fall back to that, access it from PowerPC asm. Overhead = 1.3 µsec. - * We can also try Microseconds() which is emulated : Overhead = 36 µsec. - - On PowerPC machines, we avoid the following: - * OpenTransport is available on all PCI and some NuBus PowerMacs, but it - uses UpTime() if available and falls back to Microseconds() otherwise. - * InputSprocket is available on many PowerMacs, but again it uses - UpTime() if available and falls back to Microseconds() otherwise. - - Another PowerPC note: certain configurations, especially 3rd party upgrade - cards, may return inaccurate timings for the CPU or memory bus -- causing - skew in various system routines (up to 20% drift!). The VIA chip is very - accurate, and it's the basis for the Time Manager and Microseconds(). - Unfortunately, it's also very slow because the MacOS has to (a) switch to - 68K and (b) poll for a VIA event. - - We compensate for the drift by calibrating a floating point scale factor - between our fast method and the accurate timer at startup, then convert - each sample quickly on the fly. I'd rather not have the initialization - overhead -- but it's simply necessary for accurate timing. You can drop - it down to 30 ticks if you prefer, but that's as low as I'd recommend. - - Under MacOS 9, "new world" Macs (iMacs, B+W G3s and G+W G4s) have a native - Time Manager implementation: UpTime(), Microseconds(), and TickCount() are - all based on the same underlying counter. This makes it silly to calibrate - UpTime() against TickCount(). We now check for this feature using Gestalt(), - and skip the whole calibration step if possible. - -*/ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -#define RTCToNano(w) ((double) (w).hi * 1000000000.0 + (double) (w).lo) -#define WideTo64bit(w) (*(UInt64 *) &(w)) - -/* LMGetTicks() is not in Carbon and TickCount() has a fair bit of overhead, - so for speed we always read lowmem directly. This is a Mac OS X no-no, but - it always work on those systems that don't have a native Time Manager (ie, - anything before MacOS 9) -- regardless whether we are in Carbon or not! */ -#define MyLMGetTicks() (*(volatile UInt32 *) 0x16A) - -#if GENERATINGPOWERPC - -static asm UnsignedWide PollRTC(void); -static asm UnsignedWide PollTBR(void); -static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName); - -static Boolean gInited = false; -static Boolean gNative = false; -static Boolean gUseRTC = false; -static Boolean gUseTBR = false; -static double gScaleUSec = 1.0 / 1000.0; /* 1 / ( nsec / usec) */ -static double gScaleMSec = 1.0 / 1000000.0; /* 1 / ( nsec / msec) */ - -/* Functions loaded from DriverServicesLib */ -typedef AbsoluteTime (*UpTimeProcPtr)(void); -typedef Nanoseconds (*A2NSProcPtr)(AbsoluteTime); -static UpTimeProcPtr gUpTime = NULL; -static A2NSProcPtr gA2NS = NULL; - -#endif /* GENERATINGPOWERPC */ - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -void FastInitialize() { - SInt32 result; - - if (!gInited) { - -#if GENERATINGPOWERPC - - /* Initialize the feature flags */ - gNative = gUseRTC = gUseTBR = false; - - /* We use CFM to find and load needed symbols from shared libraries, so - the application doesn't have to weak-link them, for convenience. */ - gUpTime = (UpTimeProcPtr) FindFunctionInSharedLib( - "\pDriverServicesLib", "\pUpTime"); - if (gUpTime) gA2NS = (A2NSProcPtr) FindFunctionInSharedLib( - "\pDriverServicesLib", "\pAbsoluteToNanoseconds"); - if (!gA2NS) gUpTime = nil; /* Pedantic but necessary */ - - if (gUpTime) { - /* If we loaded UpTime(), then we need to know if the system has - a native implementation of the Time Manager. If so, then it's - pointless to calculate a scale factor against the missing VIA */ - - /* gestaltNativeTimeMgr = 4 in some future version of the headers */ - if (!Gestalt(gestaltTimeMgrVersion, &result) && - (result > gestaltExtendedTimeMgr)) - gNative = true; - } - else { - /* If no DriverServicesLib, use Gestalt() to get the processor type. - Only NuBus PowerMacs with old System Software won't have DSL, so - we know it should either be a 601 or 603. */ - - /* Use the processor gestalt to determine which register to use */ - if (!Gestalt(gestaltNativeCPUtype, &result)) { - if (result == gestaltCPU601) gUseRTC = true; - else if (result > gestaltCPU601) gUseTBR = true; - } - } - - /* Now calculate a scale factor to keep us accurate. */ - if ((gUpTime && !gNative) || gUseRTC || gUseTBR) { - UInt64 tick, usec1, usec2; - UnsignedWide wide; - - /* Wait for the beginning of the very next tick */ - for(tick = MyLMGetTicks() + 1; tick > MyLMGetTicks(); ); - - /* Poll the selected timer and prepare it (since we have time) */ - wide = (gUpTime) ? (*gA2NS)((*gUpTime)()) : - ((gUseRTC) ? PollRTC() : PollTBR()); - usec1 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide); - - /* Wait for the exact 60th tick to roll over */ - while(tick + 60 > MyLMGetTicks()); - - /* Poll the selected timer again and prepare it */ - wide = (gUpTime) ? (*gA2NS)((*gUpTime)()) : - ((gUseRTC) ? PollRTC() : PollTBR()); - usec2 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide); - - /* Calculate a scale value that will give microseconds per second. - Remember, there are actually 60.15 ticks in a second, not 60. */ - gScaleUSec = (60.0 * 1000000.0) / ((usec2 - usec1) * 60.15); - gScaleMSec = gScaleUSec / 1000.0; - } - -#endif /* GENERATINGPOWERPC */ - - /* We've initialized our globals */ - gInited = true; - } - } - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -UInt64 FastMicroseconds() { - UnsignedWide wide; - UInt64 usec; - -#if GENERATINGPOWERPC - /* Initialize globals the first time we are called */ - if (!gInited) FastInitialize(); - - if (gNative) { - /* Use DriverServices if it's available -- it's fast and compatible */ - wide = (*gA2NS)((*gUpTime)()); - usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5; - } - else if (gUpTime) { - /* Use DriverServices if it's available -- it's fast and compatible */ - wide = (*gA2NS)((*gUpTime)()); - usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5; - } - else if (gUseTBR) { - /* On a recent PowerPC, we poll the TBR directly */ - wide = PollTBR(); - usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5; - } - else if (gUseRTC) { - /* On a 601, we can poll the RTC instead */ - wide = PollRTC(); - usec = (double) RTCToNano(wide) * gScaleUSec + 0.5; - } - else -#endif /* GENERATINGPOWERPC */ - { - /* If all else fails, suffer the mixed mode overhead */ - Microseconds(&wide); - usec = WideTo64bit(wide); - } - - return(usec); - } - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -UInt64 FastMilliseconds() { - UnsignedWide wide; - UInt64 msec; - -#if GENERATINGPOWERPC - /* Initialize globals the first time we are called */ - if (!gInited) FastInitialize(); - - if (gNative) { - /* Use DriverServices if it's available -- it's fast and compatible */ - wide = (*gA2NS)((*gUpTime)()); - msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5; - } - else if (gUpTime) { - /* Use DriverServices if it's available -- it's fast and compatible */ - wide = (*gA2NS)((*gUpTime)()); - msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5; - } - else if (gUseTBR) { - /* On a recent PowerPC, we poll the TBR directly */ - wide = PollTBR(); - msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5; - } - else if (gUseRTC) { - /* On a 601, we can poll the RTC instead */ - wide = PollRTC(); - msec = (double) RTCToNano(wide) * gScaleMSec + 0.5; - } - else -#endif /* GENERATINGPOWERPC */ - { - /* If all else fails, suffer the mixed mode overhead */ - Microseconds(&wide); - msec = ((double) WideTo64bit(wide) + 500.0) / 1000.0; - } - - return(msec); - } - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -StringPtr FastMethod() { - StringPtr method = "\p"; - -#if GENERATINGPOWERPC - /* Initialize globals the first time we are called */ - if (!gInited) FastInitialize(); - - if (gNative) { - /* The Time Manager and UpTime() are entirely native on this machine */ - method = "\pNative UpTime()"; - } - else if (gUpTime) { - /* Use DriverServices if it's available -- it's fast and compatible */ - method = "\pUpTime()"; - } - else if (gUseTBR) { - /* On a recent PowerPC, we poll the TBR directly */ - method = "\pPowerPC TBR"; - } - else if (gUseRTC) { - /* On a 601, we can poll the RTC instead */ - method = "\pPowerPC RTC"; - } - else -#endif /* GENERATINGPOWERPC */ - { - /* If all else fails, suffer the mixed mode overhead */ - method = "\pMicroseconds()"; - } - - return(method); - } - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -#pragma mark - - -#if GENERATINGPOWERPC -asm static UnsignedWide PollRTC_() { -entry PollRTC /* Avoid CodeWarrior glue */ - machine 601 -@AGAIN: - mfrtcu r4 /* RTCU = SPR 4 */ - mfrtcl r5 /* RTCL = SPR 5 */ - mfrtcu r6 - cmpw r4,r6 - bne @AGAIN - stw r4,0(r3) - stw r5,4(r3) - blr - } - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -asm static UnsignedWide PollTBR_() { -entry PollTBR /* Avoid CodeWarrior glue */ - machine 604 -@AGAIN: - mftbu r4 /* TBRU = SPR 268 */ - mftb r5 /* TBRL = SPR 269 */ - mftbu r6 - cmpw r4,r6 - bne @AGAIN - stw r4,0(r3) - stw r5,4(r3) - blr - } - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName) { - OSErr error = noErr; - Str255 errorStr; - Ptr func = NULL; - Ptr entry = NULL; - CFragSymbolClass symClass; - CFragConnectionID connID; - - /* Find CFM containers for the current archecture -- CFM-PPC or CFM-68K */ - if (/* error = */ GetSharedLibrary(libName, kCompiledCFragArch, - kLoadCFrag, &connID, &entry, errorStr)) return(NULL); - if (/* error = */ FindSymbol(connID, funcName, &func, &symClass)) - return(NULL); - - return(func); - } -#endif /* GENERATINGPOWERPC */ diff --git a/src/timer/macos/FastTimes.h b/src/timer/macos/FastTimes.h deleted file mode 100644 index d25744c330..0000000000 --- a/src/timer/macos/FastTimes.h +++ /dev/null @@ -1,27 +0,0 @@ -/* File "FastTimes.h" - Original code by Matt Slot */ -#include "SDL_config.h" -/* Created 4/24/99 - This file is hereby placed in the public domain */ -/* Updated 5/21/99 - Calibrate to VIA, add TBR support, renamed functions */ -/* Updated 10/4/99 - Use AbsoluteToNanoseconds() in case Absolute = double */ -/* Updated 2/15/00 - Check for native Time Manager, no need to calibrate */ -/* Updated 3/21/00 - Fixed ns conversion, create 2 different scale factors */ -/* Updated 5/03/00 - Added copyright and placed into PD. No code changes */ - -/* This file is Copyright (C) Matt Slot, 1999-2012. It is hereby placed into - the public domain. The author makes no warranty as to fitness or stability */ - -#ifndef __FAST_TIMES_HEADER__ -#define __FAST_TIMES_HEADER__ - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -extern void FastInitialize(void); -extern UInt64 FastMicroseconds(void); -extern UInt64 FastMilliseconds(void); -extern StringPtr FastMethod(void); - -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ -/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */ - -#endif /* __FAST_TIMES_HEADER__ */ diff --git a/src/timer/macos/SDL_MPWtimer.c b/src/timer/macos/SDL_MPWtimer.c deleted file mode 100644 index 114b6c7c0a..0000000000 --- a/src/timer/macos/SDL_MPWtimer.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_TIMER_MACOS - -#include -#include -#include -#include -#include - -#include - -#include "SDL_timer.h" -#include "../SDL_timer_c.h" - -#define MS_PER_TICK (1000/60) /* MacOS tick = 1/60 second */ - -/* Note: This is only a step above the original 1/60s implementation. - * For a good implementation, see FastTimes.[ch], by Matt Slot. - */ -#define USE_MICROSECONDS -#define WideTo64bit(w) (*(UInt64 *) &(w)) - -UInt64 start; - -void SDL_StartTicks(void) -{ -#ifdef USE_MICROSECONDS - UnsignedWide now; - - Microseconds(&now); - start = WideTo64bit(now); -#else - /* FIXME: Should we implement a wrapping algorithm, like Win32? */ -#endif -} - -Uint32 SDL_GetTicks(void) -{ -#ifdef USE_MICROSECONDS - UnsignedWide now; - - Microseconds(&now); - return (Uint32)((WideTo64bit(now)-start)/1000); -#else - return(LMGetTicks()*MS_PER_TICK); -#endif -} - -void SDL_Delay(Uint32 ms) -{ -#ifdef USE_MICROSECONDS - Uint32 end_ms; - - end_ms = SDL_GetTicks() + ms; - do { - /* FIXME: Yield CPU? */ ; - } while ( SDL_GetTicks() < end_ms ); -#else - UInt32 unused; /* MJS */ - Delay(ms/MS_PER_TICK, &unused); -#endif -} - - -/* Data to handle a single periodic alarm */ -typedef struct _ExtendedTimerRec -{ - TMTask tmTask; - ProcessSerialNumber taskPSN; -} ExtendedTimerRec, *ExtendedTimerPtr; - -static ExtendedTimerRec gExtendedTimerRec; - - -int SDL_SYS_TimerInit(void) -{ - /* We don't need a setup? */ - return(0); -} - -void SDL_SYS_TimerQuit(void) -{ - /* We don't need a cleanup? */ - return; -} - -/* Our Stub routine to set up and then call the real routine. */ -pascal void TimerCallbackProc(TMTaskPtr tmTaskPtr) -{ - Uint32 ms; - - WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN); - - ms = SDL_alarm_callback(SDL_alarm_interval); - if ( ms ) { - SDL_alarm_interval = ROUND_RESOLUTION(ms); - PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, - SDL_alarm_interval); - } else { - SDL_alarm_interval = 0; - } -} - -int SDL_SYS_StartTimer(void) -{ - /* - * Configure the global structure that stores the timing information. - */ - gExtendedTimerRec.tmTask.qLink = NULL; - gExtendedTimerRec.tmTask.qType = 0; - gExtendedTimerRec.tmTask.tmAddr = NewTimerUPP(TimerCallbackProc); - gExtendedTimerRec.tmTask.tmCount = 0; - gExtendedTimerRec.tmTask.tmWakeUp = 0; - gExtendedTimerRec.tmTask.tmReserved = 0; - GetCurrentProcess(&gExtendedTimerRec.taskPSN); - - /* Install the task record */ - InsXTime((QElemPtr)&gExtendedTimerRec.tmTask); - - /* Go! */ - PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, SDL_alarm_interval); - return(0); -} - -void SDL_SYS_StopTimer(void) -{ - RmvTime((QElemPtr)&gExtendedTimerRec.tmTask); -} - -#endif /* SDL_TIMER_MACOS */ diff --git a/src/timer/macos/SDL_systimer.c b/src/timer/macos/SDL_systimer.c deleted file mode 100644 index 7a8063e57d..0000000000 --- a/src/timer/macos/SDL_systimer.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_TIMER_MACOS - -#include -#include -#include -#include -#include - -#include - -#include "SDL_timer.h" -#include "../SDL_timer_c.h" - -#include "FastTimes.h" - -#if TARGET_API_MAC_CARBON -#define NewTimerProc NewTimerUPP -#endif - -#define MS_PER_TICK (1000.0/60.0) /* MacOS tick = 1/60 second */ - - -#define kTwoPower32 (4294967296.0) /* 2^32 */ - -static double start_tick; -static int is_fast_inited = 0; - -void SDL_StartTicks(void) -{ - if ( ! is_fast_inited ) // important to check or FastTime may hang machine! - SDL_SYS_TimerInit(); - - start_tick = FastMicroseconds(); -} - -Uint32 SDL_GetTicks(void) -{ - - if ( ! is_fast_inited ) - SDL_SYS_TimerInit(); - - return FastMilliseconds(); -} - -void SDL_Delay(Uint32 ms) -{ - Uint32 stop, now; - - stop = SDL_GetTicks() + ms; - do { - #if TARGET_API_MAC_CARBON - MPYield(); - #else - SystemTask(); - #endif - - now = SDL_GetTicks(); - - } while ( stop > now ); -} - -/* -void SDL_StartTicks(void) -{ - // FIXME: Should we implement a wrapping algorithm, like Win32? -} - -Uint32 SDL_GetTicks(void) -{ - UnsignedWide ms; - - Microseconds (&ms); - - return ( ms.lo / 1000 ); -} - -void SDL_Delay(Uint32 ms) -{ - - UnsignedWide microsecs; - UInt32 stop; - - Microseconds (µsecs); - - stop = microsecs.lo + (ms * 1000); - - while ( stop > microsecs.lo ) { - - SystemTask (); - - Microseconds (µsecs); - } - -}*/ - -/* Data to handle a single periodic alarm */ -typedef struct _ExtendedTimerRec -{ - TMTask tmTask; - ProcessSerialNumber taskPSN; -} ExtendedTimerRec, *ExtendedTimerPtr; - -static ExtendedTimerRec gExtendedTimerRec; - - -int SDL_SYS_TimerInit(void) -{ - FastInitialize (); - is_fast_inited = 1; - - return(0); -} - -void SDL_SYS_TimerQuit(void) -{ - /* We don't need a cleanup? */ - return; -} - -/* Our Stub routine to set up and then call the real routine. */ -pascal void TimerCallbackProc(TMTaskPtr tmTaskPtr) -{ - Uint32 ms; - - WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN); - - ms = SDL_alarm_callback(SDL_alarm_interval); - if ( ms ) { - SDL_alarm_interval = ROUND_RESOLUTION(ms); - PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, - SDL_alarm_interval); - } else { - SDL_alarm_interval = 0; - } -} - -int SDL_SYS_StartTimer(void) -{ - /* - * Configure the global structure that stores the timing information. - */ - gExtendedTimerRec.tmTask.qLink = NULL; - gExtendedTimerRec.tmTask.qType = 0; - gExtendedTimerRec.tmTask.tmAddr = NewTimerProc(TimerCallbackProc); - gExtendedTimerRec.tmTask.tmCount = 0; - gExtendedTimerRec.tmTask.tmWakeUp = 0; - gExtendedTimerRec.tmTask.tmReserved = 0; - GetCurrentProcess(&gExtendedTimerRec.taskPSN); - - /* Install the task record */ - InsXTime((QElemPtr)&gExtendedTimerRec.tmTask); - - /* Go! */ - PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, SDL_alarm_interval); - return(0); -} - -void SDL_SYS_StopTimer(void) -{ - RmvTime((QElemPtr)&gExtendedTimerRec.tmTask); -} - -#endif /* SDL_TIMER_MACOS */ diff --git a/src/timer/mint/SDL_systimer.c b/src/timer/mint/SDL_systimer.c deleted file mode 100644 index 01e7a410c1..0000000000 --- a/src/timer/mint/SDL_systimer.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_TIMER_MINT - -/* - * TOS/MiNT timer driver - * based on vbl vector - * - * Patrice Mandin - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "../SDL_timer_c.h" -#include "SDL_thread.h" - -#include "../../video/ataricommon/SDL_atarisuper.h" - -#include "SDL_vbltimer_s.h" - -/* from audio/mint */ -void SDL_MintAudio_CheckFpu(void); - -/* The first ticks value of the application */ -static Uint32 start; -static SDL_bool read_hz200_from_vbl = SDL_FALSE; -static int mint_present; /* can we use Syield() ? */ - -void SDL_StartTicks(void) -{ - void *old_stack; - long dummy; - - /* Set first ticks value */ - old_stack = (void *)Super(0); - start = *((volatile long *)_hz_200); - SuperToUser(old_stack); - - start *= 5; /* One _hz_200 tic is 5ms */ - - mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND); -} - -Uint32 SDL_GetTicks (void) -{ - Uint32 now = start; - - if (read_hz200_from_vbl) { - now = SDL_Atari_hz200; - } else { - void *old_stack = (void *)Super(0); - now = *((volatile long *)_hz_200); - SuperToUser(old_stack); - } - - return((now*5)-start); -} - -void SDL_Delay (Uint32 ms) -{ - Uint32 now; - - now = SDL_GetTicks(); - while ((SDL_GetTicks()-now) - -#define timers2ms(tlow,thigh)(tlow | (thigh<<16)) >> 5 - - -void SDL_StartTicks(void) -{ - TIMER0_DATA=0; - TIMER1_DATA=0; - TIMER0_CR=TIMER_ENABLE|TIMER_DIV_1024; - TIMER1_CR=TIMER_ENABLE|TIMER_CASCADE; -} - -Uint32 SDL_GetTicks(void) -{ - return timers2ms(TIMER0_DATA, TIMER1_DATA); -} - -void SDL_Delay(Uint32 ms) -{ - Uint32 now; - now=timers2ms(TIMER0_DATA, TIMER1_DATA); - while((Uint32)timers2ms(TIMER0_DATA, TIMER1_DATA) - -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "../SDL_timer_c.h" - - -#define TIME_WRAP_VALUE (~(DWORD)0) - -/* The first high-resolution ticks value of the application */ -static long long hires_start_ticks; -/* The number of ticks per second of the high-resolution performance counter */ -static ULONG hires_ticks_per_second; - -void SDL_StartTicks(void) -{ - DosTmrQueryFreq(&hires_ticks_per_second); - DosTmrQueryTime((PQWORD)&hires_start_ticks); -} - -DECLSPEC Uint32 SDLCALL SDL_GetTicks(void) -{ - long long hires_now; - ULONG ticks = ticks; - - DosTmrQueryTime((PQWORD)&hires_now); -/* - hires_now -= hires_start_ticks; - hires_now *= 1000; - hires_now /= hires_ticks_per_second; -*/ - /* inline asm to avoid runtime inclusion */ - _asm { - push edx - push eax - mov eax, dword ptr hires_now - mov edx, dword ptr hires_now+4 - sub eax, dword ptr hires_start_ticks - sbb edx, dword ptr hires_start_ticks+4 - mov ebx,1000 - mov ecx,edx - mul ebx - push eax - push edx - mov eax,ecx - mul ebx - pop eax - add edx,eax - pop eax - mov ebx, dword ptr hires_ticks_per_second - div ebx - mov dword ptr ticks, eax - pop edx - pop eax - } - - return ticks; - -} - -/* High resolution sleep, originally made by Ilya Zakharevich */ -DECLSPEC void SDLCALL SDL_Delay(Uint32 ms) -{ - /* This is similar to DosSleep(), but has 8ms granularity in time-critical - threads even on Warp3. */ - HEV hevEvent1 = 0; /* Event semaphore handle */ - HTIMER htimerEvent1 = 0; /* Timer handle */ - APIRET rc = NO_ERROR; /* Return code */ - int ret = 1; - ULONG priority = 0, nesting; /* Shut down the warnings */ - PPIB pib; - PTIB tib; - char *e = NULL; - APIRET badrc; - int switch_priority = 50; - - DosCreateEventSem(NULL, /* Unnamed */ - &hevEvent1, /* Handle of semaphore returned */ - DC_SEM_SHARED, /* Shared needed for DosAsyncTimer */ - FALSE); /* Semaphore is in RESET state */ - - if (ms >= switch_priority) - switch_priority = 0; - if (switch_priority) - { - if (DosGetInfoBlocks(&tib, &pib)!=NO_ERROR) - switch_priority = 0; - else - { - /* In Warp3, to switch scheduling to 8ms step, one needs to do - DosAsyncTimer() in time-critical thread. On laters versions, - more and more cases of wait-for-something are covered. - - It turns out that on Warp3fp42 it is the priority at the time - of DosAsyncTimer() which matters. Let's hope that this works - with later versions too... XXXX - */ - priority = (tib->tib_ptib2->tib2_ulpri); - if ((priority & 0xFF00) == 0x0300) /* already time-critical */ - switch_priority = 0; - /* Make us time-critical. Just modifying TIB is not enough... */ - /* tib->tib_ptib2->tib2_ulpri = 0x0300;*/ - /* We do not want to run at high priority if a signal causes us - to longjmp() out of this section... */ - if (DosEnterMustComplete(&nesting)) - switch_priority = 0; - else - DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); - } - } - - if ((badrc = DosAsyncTimer(ms, - (HSEM) hevEvent1, /* Semaphore to post */ - &htimerEvent1))) /* Timer handler (returned) */ - e = "DosAsyncTimer"; - - if (switch_priority && tib->tib_ptib2->tib2_ulpri == 0x0300) - { - /* Nobody switched priority while we slept... Ignore errors... */ - /* tib->tib_ptib2->tib2_ulpri = priority; */ /* Get back... */ - if (!(rc = DosSetPriority(PRTYS_THREAD, (priority>>8) & 0xFF, 0, 0))) - rc = DosSetPriority(PRTYS_THREAD, 0, priority & 0xFF, 0); - } - if (switch_priority) - rc = DosExitMustComplete(&nesting); /* Ignore errors */ - - /* The actual blocking call is made with "normal" priority. This way we - should not bother with DosSleep(0) etc. to compensate for us interrupting - higher-priority threads. The goal is to prohibit the system spending too - much time halt()ing, not to run us "no matter what". */ - if (!e) /* Wait for AsyncTimer event */ - badrc = DosWaitEventSem(hevEvent1, SEM_INDEFINITE_WAIT); - - if (e) ; /* Do nothing */ - else if (badrc == ERROR_INTERRUPT) - ret = 0; - else if (badrc) - e = "DosWaitEventSem"; - if ((rc = DosCloseEventSem(hevEvent1)) && !e) { /* Get rid of semaphore */ - e = "DosCloseEventSem"; - badrc = rc; - } - if (e) - { - SDL_SetError("[SDL_Delay] : Had error in %s(), rc is 0x%x\n", e, badrc); - } -} - -/* Data to handle a single periodic alarm */ -static int timer_alive = 0; -static SDL_Thread *timer = NULL; - -static int SDLCALL RunTimer(void *unused) -{ - DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); - while ( timer_alive ) { - if ( SDL_timer_running ) { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(10); - } - return(0); -} - -/* This is only called if the event thread is not running */ -int SDL_SYS_TimerInit(void) -{ - timer_alive = 1; - timer = SDL_CreateThread(RunTimer, NULL); - if ( timer == NULL ) - return(-1); - return(SDL_SetTimerThreaded(1)); -} - -void SDL_SYS_TimerQuit(void) -{ - timer_alive = 0; - if ( timer ) { - SDL_WaitThread(timer, NULL); - timer = NULL; - } -} - -int SDL_SYS_StartTimer(void) -{ - SDL_SetError("Internal logic error: OS/2 uses threaded timer"); - return(-1); -} - -void SDL_SYS_StopTimer(void) -{ - return; -} - -#endif /* SDL_TIMER_OS2 */ diff --git a/src/timer/psp/SDL_systimer.c b/src/timer/psp/SDL_systimer.c new file mode 100644 index 0000000000..59bb4df1c3 --- /dev/null +++ b/src/timer/psp/SDL_systimer.c @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_error.h" +#include "../SDL_timer_c.h" +#include +#include +#include +#include + +static struct timeval start; + +void SDL_StartTicks(void) +{ + gettimeofday(&start, NULL); +} + +Uint32 SDL_GetTicks(void) +{ + struct timeval now; + Uint32 ticks; + + gettimeofday(&now, NULL); + ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000; + return(ticks); +} + +Uint64 +SDL_GetPerformanceCounter(void) +{ + return SDL_GetTicks(); +} + +Uint64 +SDL_GetPerformanceFrequency(void) +{ + return 1000; +} + +void SDL_Delay(Uint32 ms) +{ + const Uint32 max_delay = 0xffffffffUL / 1000; + if(ms > max_delay) + ms = max_delay; + sceKernelDelayThreadCB(ms * 1000); +} + +/* vim: ts=4 sw=4 + */ diff --git a/src/timer/riscos/SDL_systimer.c b/src/timer/riscos/SDL_systimer.c deleted file mode 100644 index 25ba65f784..0000000000 --- a/src/timer/riscos/SDL_systimer.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_TIMER_RISCOS - -#include -#include -#include -#include -#include -#include - -#include "SDL_timer.h" -#include "../SDL_timer_c.h" - -#if SDL_THREADS_DISABLED -/* Timer SDL_arraysize(Timer ),start/reset time */ -static Uint32 timerStart; -/* Timer running function */ -void RISCOS_CheckTimer(); -#else -#include -extern Uint32 riscos_main_thread; -extern int riscos_using_threads; -extern Uint32 SDL_ThreadID(); -extern Uint32 SDL_EventThreadID(void); -#endif - - -extern void RISCOS_BackgroundTasks(void); - -/* The first ticks value of the application */ -clock_t start; - -void SDL_StartTicks(void) -{ - /* Set first ticks value */ - start = clock(); -} - -Uint32 SDL_GetTicks (void) -{ - clock_t ticks; - - ticks=clock()-start; - - -#if CLOCKS_PER_SEC == 1000 - - return(ticks); - -#elif CLOCKS_PER_SEC == 100 - - return (ticks * 10); - -#else - - return ticks*(1000/CLOCKS_PER_SEC); - -#endif - -} - -void SDL_Delay (Uint32 ms) -{ - Uint32 now,then,elapsed; -#if !SDL_THREADS_DISABLED - int is_event_thread; - if (riscos_using_threads) - { - is_event_thread = 0; - if (SDL_EventThreadID()) - { - if (SDL_EventThreadID() == SDL_ThreadID()) is_event_thread = 1; - } else if (SDL_ThreadID() == riscos_main_thread) is_event_thread = 1; - } else is_event_thread = 1; -#endif - - /*TODO: Next version of Unixlib may allow us to use usleep here */ - /* for non event threads */ - - /* Set the timeout interval - Linux only needs to do this once */ - then = SDL_GetTicks(); - - do { - /* Do background tasks required while sleeping as we are not multithreaded */ -#if SDL_THREADS_DISABLED - RISCOS_BackgroundTasks(); -#else - /* For threaded build only run background tasks in event thread */ - if (is_event_thread) RISCOS_BackgroundTasks(); -#endif - - /* Calculate the time interval left (in case of interrupt) */ - now = SDL_GetTicks(); - elapsed = (now-then); - then = now; - if ( elapsed >= ms ) { - break; - } - ms -= elapsed; -#if !SDL_THREADS_DISABLED - /* Need to yield to let other threads have a go */ - if (riscos_using_threads) pthread_yield(); -#endif - - } while ( 1 ); -} - -#if SDL_THREADS_DISABLED - -/* Non-threaded version of timer */ - -int SDL_SYS_TimerInit(void) -{ - return(0); -} - -void SDL_SYS_TimerQuit(void) -{ - SDL_SetTimer(0, NULL); -} - -int SDL_SYS_StartTimer(void) -{ - timerStart = SDL_GetTicks(); - - return(0); -} - -void SDL_SYS_StopTimer(void) -{ - /* Don't need to do anything as we use SDL_timer_running - to detect if we need to check the timer */ -} - - -void RISCOS_CheckTimer() -{ - if (SDL_timer_running && SDL_GetTicks() - timerStart >= SDL_alarm_interval) - { - Uint32 ms; - - ms = SDL_alarm_callback(SDL_alarm_interval); - if ( ms != SDL_alarm_interval ) - { - if ( ms ) - { - SDL_alarm_interval = ROUND_RESOLUTION(ms); - } else - { - SDL_alarm_interval = 0; - SDL_timer_running = 0; - } - } - if (SDL_alarm_interval) timerStart = SDL_GetTicks(); - } -} - -#else - -/* Threaded version of timer - based on code for linux */ - -#include "SDL_thread.h" - -/* Data to handle a single periodic alarm */ -static int timer_alive = 0; -static SDL_Thread *timer = NULL; - -static int RunTimer(void *unused) -{ - while ( timer_alive ) { - if ( SDL_timer_running ) { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(1); - } - return(0); -} - -/* This is only called if the event thread is not running */ -int SDL_SYS_TimerInit(void) -{ - timer_alive = 1; - timer = SDL_CreateThread(RunTimer, NULL); - if ( timer == NULL ) - return(-1); - return(SDL_SetTimerThreaded(1)); -} - -void SDL_SYS_TimerQuit(void) -{ - timer_alive = 0; - if ( timer ) { - SDL_WaitThread(timer, NULL); - timer = NULL; - } -} - -int SDL_SYS_StartTimer(void) -{ - SDL_SetError("Internal logic error: RISC OS uses threaded timer"); - return(-1); -} - -void SDL_SYS_StopTimer(void) -{ - return; -} - -#endif /* SDL_THREADS_DISABLED */ - -#endif /* SDL_TIMER_RISCOS */ diff --git a/src/timer/symbian/SDL_systimer.cpp b/src/timer/symbian/SDL_systimer.cpp deleted file mode 100644 index a5bb749cac..0000000000 --- a/src/timer/symbian/SDL_systimer.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - Sam Lantinga - slouken@devolution.com -*/ - -/* - SDL_systimer.cpp - - Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi) - Markus Mertama -*/ - -#include -#include - -extern "C" { -#include "SDL_error.h" -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "SDL_timer_c.h" - -static TUint start = 0; -static TInt tickPeriodMilliSeconds; - - -void SDL_StartTicks(void) - { - /* Set first ticks value */ - start = User::TickCount(); - - TTimeIntervalMicroSeconds32 period; - TInt tmp = UserHal::TickPeriod(period); - tickPeriodMilliSeconds = period.Int() / 1000; - } - -Uint32 SDL_GetTicks(void) - { - TUint deltaTics = User::TickCount() - start; - return(deltaTics * tickPeriodMilliSeconds); - } - -void SDL_Delay(Uint32 ms) - { - User::After(TTimeIntervalMicroSeconds32(ms*1000)); - } - -/* Data to handle a single periodic alarm */ -static int timer_alive = 0; -static SDL_Thread *timer = NULL; - -static int RunTimer(void *unused) - { - while ( timer_alive ) - { - if (SDL_timer_running) - { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(10); - } - return(0); - } - -/* This is only called if the event thread is not running */ -int SDL_SYS_TimerInit(void) - { - if(timer != NULL) - return (-1); - timer_alive = 1; - timer = SDL_CreateThread(RunTimer, NULL); - if ( timer == NULL ) - return(-1); - return(SDL_SetTimerThreaded(1)); - } - -void SDL_SYS_TimerQuit(void) - { - timer_alive = 0; - if ( timer ) - { - SDL_WaitThread(timer, NULL); - timer = NULL; - } - } - -int SDL_SYS_StartTimer(void) - { - SDL_SetError("Internal logic error: Epoc uses threaded timer"); - return(-1); - } - -void SDL_SYS_StopTimer(void) - { - return; - } - -} // extern "C" diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 80b22283b6..596d749abc 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -25,216 +24,170 @@ #include #include -#include #include -#include #include #include "SDL_timer.h" -#include "../SDL_timer_c.h" /* The clock_gettime provides monotonous time, so we should use it if it's available. The clock_gettime function is behind ifdef for __USE_POSIX199309 Tommi Kyntola (tommi.kyntola@ray.fi) 27/09/2005 */ +/* Reworked monotonic clock to not assume the current system has one + as not all linux kernels provide a monotonic clock (yeah recent ones + probably do) + Also added OS X Monotonic clock support + Based on work in https://github.com/ThomasHabets/monotonic_clock + */ #if HAVE_NANOSLEEP || HAVE_CLOCK_GETTIME #include #endif - -#if SDL_THREAD_PTH -#include +#ifdef __APPLE__ +#include #endif -#if SDL_THREADS_DISABLED -#define USE_ITIMER +/* The first ticks value of the application */ +#if HAVE_CLOCK_GETTIME +static struct timespec start_ts; +#elif defined(__APPLE__) +static uint64_t start_mach; +mach_timebase_info_data_t mach_base_info; #endif +static SDL_bool has_monotonic_time = SDL_FALSE; +static struct timeval start_tv; -/* The first ticks value of the application */ -#ifdef HAVE_CLOCK_GETTIME -static struct timespec start; -#else -static struct timeval start; -#endif /* HAVE_CLOCK_GETTIME */ +void +SDL_StartTicks(void) +{ + /* Set first ticks value */ +#if HAVE_CLOCK_GETTIME + if (clock_gettime(CLOCK_MONOTONIC, &start_ts) == 0) { + has_monotonic_time = SDL_TRUE; + } else +#elif defined(__APPLE__) + kern_return_t ret = mach_timebase_info(&mach_base_info); + if (ret == 0) { + has_monotonic_time = SDL_TRUE; + start_mach = mach_absolute_time(); + } else +#endif + { + gettimeofday(&start_tv, NULL); + } +} +Uint32 +SDL_GetTicks(void) +{ + Uint32 ticks; + if (has_monotonic_time) { +#if HAVE_CLOCK_GETTIME + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + ticks = (now.tv_sec - start_ts.tv_sec) * 1000 + (now.tv_nsec - + start_ts.tv_nsec) / 1000000; +#elif defined(__APPLE__) + uint64_t now = mach_absolute_time(); + ticks = (((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000; +#endif + } else { + struct timeval now; + + gettimeofday(&now, NULL); + ticks = + (now.tv_sec - start_tv.tv_sec) * 1000 + (now.tv_usec - + start_tv.tv_usec) / 1000; + } + return (ticks); +} -void SDL_StartTicks(void) +Uint64 +SDL_GetPerformanceCounter(void) { - /* Set first ticks value */ + Uint64 ticks; + if (has_monotonic_time) { #if HAVE_CLOCK_GETTIME - clock_gettime(CLOCK_MONOTONIC,&start); -#else - gettimeofday(&start, NULL); + struct timespec now; + + clock_gettime(CLOCK_MONOTONIC, &now); + ticks = now.tv_sec; + ticks *= 1000000000; + ticks += now.tv_nsec; +#elif defined(__APPLE__) + ticks = mach_absolute_time(); #endif + } else { + struct timeval now; + + gettimeofday(&now, NULL); + ticks = now.tv_sec; + ticks *= 1000000; + ticks += now.tv_usec; + } + return (ticks); } -Uint32 SDL_GetTicks (void) +Uint64 +SDL_GetPerformanceFrequency(void) { + if (has_monotonic_time) { #if HAVE_CLOCK_GETTIME - Uint32 ticks; - struct timespec now; - clock_gettime(CLOCK_MONOTONIC,&now); - ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_nsec-start.tv_nsec)/1000000; - return(ticks); -#else - Uint32 ticks; - struct timeval now; - gettimeofday(&now, NULL); - ticks=(now.tv_sec-start.tv_sec)*1000+(now.tv_usec-start.tv_usec)/1000; - return(ticks); + return 1000000000; +#elif defined(__APPLE__) + Uint64 freq = mach_base_info.denom; + freq *= 1000000000; + freq /= mach_base_info.numer; + return freq; #endif + } else { + return 1000000; + } } -void SDL_Delay (Uint32 ms) +void +SDL_Delay(Uint32 ms) { -#if SDL_THREAD_PTH - pth_time_t tv; - tv.tv_sec = ms/1000; - tv.tv_usec = (ms%1000)*1000; - pth_nap(tv); -#else - int was_error; + int was_error; #if HAVE_NANOSLEEP - struct timespec elapsed, tv; + struct timespec elapsed, tv; #else - struct timeval tv; - Uint32 then, now, elapsed; + struct timeval tv; + Uint32 then, now, elapsed; #endif - /* Set the timeout interval */ + /* Set the timeout interval */ #if HAVE_NANOSLEEP - elapsed.tv_sec = ms/1000; - elapsed.tv_nsec = (ms%1000)*1000000; + elapsed.tv_sec = ms / 1000; + elapsed.tv_nsec = (ms % 1000) * 1000000; #else - then = SDL_GetTicks(); + then = SDL_GetTicks(); #endif - do { - errno = 0; + do { + errno = 0; #if HAVE_NANOSLEEP - tv.tv_sec = elapsed.tv_sec; - tv.tv_nsec = elapsed.tv_nsec; - was_error = nanosleep(&tv, &elapsed); + tv.tv_sec = elapsed.tv_sec; + tv.tv_nsec = elapsed.tv_nsec; + was_error = nanosleep(&tv, &elapsed); #else - /* Calculate the time interval left (in case of interrupt) */ - now = SDL_GetTicks(); - elapsed = (now-then); - then = now; - if ( elapsed >= ms ) { - break; - } - ms -= elapsed; - tv.tv_sec = ms/1000; - tv.tv_usec = (ms%1000)*1000; - - was_error = select(0, NULL, NULL, NULL, &tv); + /* Calculate the time interval left (in case of interrupt) */ + now = SDL_GetTicks(); + elapsed = (now - then); + then = now; + if (elapsed >= ms) { + break; + } + ms -= elapsed; + tv.tv_sec = ms / 1000; + tv.tv_usec = (ms % 1000) * 1000; + + was_error = select(0, NULL, NULL, NULL, &tv); #endif /* HAVE_NANOSLEEP */ - } while ( was_error && (errno == EINTR) ); -#endif /* SDL_THREAD_PTH */ -} - -#ifdef USE_ITIMER - -static void HandleAlarm(int sig) -{ - Uint32 ms; - - if ( SDL_alarm_callback ) { - ms = (*SDL_alarm_callback)(SDL_alarm_interval); - if ( ms != SDL_alarm_interval ) { - SDL_SetTimer(ms, SDL_alarm_callback); - } - } + } while (was_error && (errno == EINTR)); } -int SDL_SYS_TimerInit(void) -{ - struct sigaction action; - - /* Set the alarm handler (Linux specific) */ - SDL_memset(&action, 0, sizeof(action)); - action.sa_handler = HandleAlarm; - action.sa_flags = SA_RESTART; - sigemptyset(&action.sa_mask); - sigaction(SIGALRM, &action, NULL); - return(0); -} - -void SDL_SYS_TimerQuit(void) -{ - SDL_SetTimer(0, NULL); -} - -int SDL_SYS_StartTimer(void) -{ - struct itimerval timer; - - timer.it_value.tv_sec = (SDL_alarm_interval/1000); - timer.it_value.tv_usec = (SDL_alarm_interval%1000)*1000; - timer.it_interval.tv_sec = (SDL_alarm_interval/1000); - timer.it_interval.tv_usec = (SDL_alarm_interval%1000)*1000; - setitimer(ITIMER_REAL, &timer, NULL); - return(0); -} - -void SDL_SYS_StopTimer(void) -{ - struct itimerval timer; - - SDL_memset(&timer, 0, (sizeof timer)); - setitimer(ITIMER_REAL, &timer, NULL); -} - -#else /* USE_ITIMER */ - -#include "SDL_thread.h" - -/* Data to handle a single periodic alarm */ -static int timer_alive = 0; -static SDL_Thread *timer = NULL; - -static int RunTimer(void *unused) -{ - while ( timer_alive ) { - if ( SDL_timer_running ) { - SDL_ThreadedTimerCheck(); - } - SDL_Delay(1); - } - return(0); -} - -/* This is only called if the event thread is not running */ -int SDL_SYS_TimerInit(void) -{ - timer_alive = 1; - timer = SDL_CreateThread(RunTimer, NULL); - if ( timer == NULL ) - return(-1); - return(SDL_SetTimerThreaded(1)); -} - -void SDL_SYS_TimerQuit(void) -{ - timer_alive = 0; - if ( timer ) { - SDL_WaitThread(timer, NULL); - timer = NULL; - } -} - -int SDL_SYS_StartTimer(void) -{ - SDL_SetError("Internal logic error: Linux uses threaded timer"); - return(-1); -} - -void SDL_SYS_StopTimer(void) -{ - return; -} - -#endif /* USE_ITIMER */ - #endif /* SDL_TIMER_UNIX */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/win32/SDL_systimer.c b/src/timer/win32/SDL_systimer.c deleted file mode 100644 index b025e2e7c5..0000000000 --- a/src/timer/win32/SDL_systimer.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_TIMER_WIN32 - -#define WIN32_LEAN_AND_MEAN -#include -#include - -#include "SDL_timer.h" -#include "../SDL_timer_c.h" - -#ifdef _WIN32_WCE - #error This is WinCE. Please use src/timer/wince/SDL_systimer.c instead. -#endif - -#define TIME_WRAP_VALUE (~(DWORD)0) - -/* The first (low-resolution) ticks value of the application */ -static DWORD start; - -#ifndef USE_GETTICKCOUNT -/* Store if a high-resolution performance counter exists on the system */ -static BOOL hires_timer_available; -/* The first high-resolution ticks value of the application */ -static LARGE_INTEGER hires_start_ticks; -/* The number of ticks per second of the high-resolution performance counter */ -static LARGE_INTEGER hires_ticks_per_second; -#endif - -void SDL_StartTicks(void) -{ - /* Set first ticks value */ -#ifdef USE_GETTICKCOUNT - start = GetTickCount(); -#else -#if 0 /* Apparently there are problems with QPC on Win2K */ - if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE) - { - hires_timer_available = TRUE; - QueryPerformanceCounter(&hires_start_ticks); - } - else -#endif - { - hires_timer_available = FALSE; - timeBeginPeriod(1); /* use 1 ms timer precision */ - start = timeGetTime(); - } -#endif -} - -Uint32 SDL_GetTicks(void) -{ - DWORD now, ticks; -#ifndef USE_GETTICKCOUNT - LARGE_INTEGER hires_now; -#endif - -#ifdef USE_GETTICKCOUNT - now = GetTickCount(); -#else - if (hires_timer_available) - { - QueryPerformanceCounter(&hires_now); - - hires_now.QuadPart -= hires_start_ticks.QuadPart; - hires_now.QuadPart *= 1000; - hires_now.QuadPart /= hires_ticks_per_second.QuadPart; - - return (DWORD)hires_now.QuadPart; - } - else - { - now = timeGetTime(); - } -#endif - - if ( now < start ) { - ticks = (TIME_WRAP_VALUE-start) + now; - } else { - ticks = (now - start); - } - return(ticks); -} - -void SDL_Delay(Uint32 ms) -{ - Sleep(ms); -} - -/* Data to handle a single periodic alarm */ -static UINT timerID = 0; - -static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD_PTR dwUser, - DWORD_PTR dw1, DWORD_PTR dw2) -{ - SDL_ThreadedTimerCheck(); -} - - -int SDL_SYS_TimerInit(void) -{ - MMRESULT result; - - /* Set timer resolution */ - result = timeBeginPeriod(TIMER_RESOLUTION); - if ( result != TIMERR_NOERROR ) { - SDL_SetError("Warning: Can't set %d ms timer resolution", - TIMER_RESOLUTION); - } - /* Allow 10 ms of drift so we don't chew on CPU */ - timerID = timeSetEvent(TIMER_RESOLUTION,1,HandleAlarm,0,TIME_PERIODIC); - if ( ! timerID ) { - SDL_SetError("timeSetEvent() failed"); - return(-1); - } - return(SDL_SetTimerThreaded(1)); -} - -void SDL_SYS_TimerQuit(void) -{ - if ( timerID ) { - timeKillEvent(timerID); - } - timeEndPeriod(TIMER_RESOLUTION); -} - -int SDL_SYS_StartTimer(void) -{ - SDL_SetError("Internal logic error: Win32 uses threaded timer"); - return(-1); -} - -void SDL_SYS_StopTimer(void) -{ - return; -} - -#endif /* SDL_TIMER_WIN32 */ diff --git a/src/timer/wince/SDL_systimer.c b/src/timer/wince/SDL_systimer.c deleted file mode 100644 index 2b018b0ed5..0000000000 --- a/src/timer/wince/SDL_systimer.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifdef SDL_TIMER_WINCE - -#define WIN32_LEAN_AND_MEAN -#include -#include - -#include "SDL_thread.h" -#include "SDL_timer.h" -#include "../SDL_timer_c.h" - -static Uint64 start_date; -static Uint64 start_ticks; - -static Uint64 wce_ticks(void) -{ - return((Uint64)GetTickCount()); -} - -static Uint64 wce_date(void) -{ - union - { - FILETIME ftime; - Uint64 itime; - } ftime; - SYSTEMTIME stime; - - GetSystemTime(&stime); - SystemTimeToFileTime(&stime,&ftime.ftime); - ftime.itime/=10000; // Convert 100ns intervals to 1ms intervals - // Remove ms portion, which can't be relied on - ftime.itime -= (ftime.itime % 1000); - return(ftime.itime); -} - -static Sint32 wce_rel_ticks(void) -{ - return((Sint32)(wce_ticks()-start_ticks)); -} - -static Sint32 wce_rel_date(void) -{ - return((Sint32)(wce_date()-start_date)); -} - -/* Return time in ms relative to when SDL was started */ -Uint32 SDL_GetTicks() -{ - Sint32 offset=wce_rel_date()-wce_rel_ticks(); - if((offset < -1000) || (offset > 1000)) - { -// fprintf(stderr,"Time desync(%+d), resyncing\n",offset/1000); - start_ticks-=offset; - } - - return((Uint32)wce_rel_ticks()); -} - -/* Give up approx. givem milliseconds to the OS. */ -void SDL_Delay(Uint32 ms) -{ - Sleep(ms); -} - -/* Recard start-time of application for reference */ -void SDL_StartTicks(void) -{ - start_date=wce_date(); - start_ticks=wce_ticks(); -} - -static UINT WIN_timer; - -#if ( _WIN32_WCE <= 420 ) - -static HANDLE timersThread = 0; -static HANDLE timersQuitEvent = 0; - -DWORD TimersThreadProc(void *data) -{ - while(WaitForSingleObject(timersQuitEvent, 10) == WAIT_TIMEOUT) - { - SDL_ThreadedTimerCheck(); - } - return 0; -} - -int SDL_SYS_TimerInit(void) -{ - // create a thread to process a threaded timers - // SetTimer does not suit the needs because - // TimerCallbackProc will be called only when WM_TIMER occured - - timersQuitEvent = CreateEvent(0, TRUE, FALSE, 0); - if( !timersQuitEvent ) - { - SDL_SetError("Cannot create event for timers thread"); - return -1; - } - timersThread = CreateThread(NULL, 0, TimersThreadProc, 0, 0, 0); - if( !timersThread ) - { - SDL_SetError("Cannot create timers thread, check amount of RAM available"); - return -1; - } - SetThreadPriority(timersThread, THREAD_PRIORITY_HIGHEST); - - return(SDL_SetTimerThreaded(1)); -} - -void SDL_SYS_TimerQuit(void) -{ - SetEvent(timersQuitEvent); - if( WaitForSingleObject(timersThread, 2000) == WAIT_TIMEOUT ) - TerminateThread(timersThread, 0); - CloseHandle(timersThread); - CloseHandle(timersQuitEvent); - return; -} - -#else - -#pragma comment(lib, "mmtimer.lib") - -/* Data to handle a single periodic alarm */ -static UINT timerID = 0; - -static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD dwUser, - DWORD dw1, DWORD dw2) -{ - SDL_ThreadedTimerCheck(); -} - - -int SDL_SYS_TimerInit(void) -{ - MMRESULT result; - - /* Set timer resolution */ - result = timeBeginPeriod(TIMER_RESOLUTION); - if ( result != TIMERR_NOERROR ) { - SDL_SetError("Warning: Can't set %d ms timer resolution", - TIMER_RESOLUTION); - } - /* Allow 10 ms of drift so we don't chew on CPU */ - timerID = timeSetEvent(TIMER_RESOLUTION,1,HandleAlarm,0,TIME_PERIODIC); - if ( ! timerID ) { - SDL_SetError("timeSetEvent() failed"); - return(-1); - } - return(SDL_SetTimerThreaded(1)); -} - -void SDL_SYS_TimerQuit(void) -{ - if ( timerID ) { - timeKillEvent(timerID); - } - timeEndPeriod(TIMER_RESOLUTION); -} - -#endif - -int SDL_SYS_StartTimer(void) -{ - SDL_SetError("Internal logic error: WinCE uses threaded timer"); - return(-1); -} - -void SDL_SYS_StopTimer(void) -{ - return; -} - -#endif /* SDL_TIMER_WINCE */ diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c new file mode 100644 index 0000000000..ce6bd7a700 --- /dev/null +++ b/src/timer/windows/SDL_systimer.c @@ -0,0 +1,159 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifdef SDL_TIMER_WINDOWS + +#include "../../core/windows/SDL_windows.h" +#include + +#include "SDL_timer.h" +#include "SDL_hints.h" + + +/* The first (low-resolution) ticks value of the application */ +static DWORD start; + +#ifndef USE_GETTICKCOUNT +/* Store if a high-resolution performance counter exists on the system */ +static BOOL hires_timer_available; +/* The first high-resolution ticks value of the application */ +static LARGE_INTEGER hires_start_ticks; +/* The number of ticks per second of the high-resolution performance counter */ +static LARGE_INTEGER hires_ticks_per_second; +#endif + +static void +timeSetPeriod(UINT uPeriod) +{ + static UINT timer_period = 0; + + if (uPeriod != timer_period) { + if (timer_period) { + timeEndPeriod(timer_period); + } + + timer_period = uPeriod; + + if (timer_period) { + timeBeginPeriod(timer_period); + } + } +} + +static void +SDL_TimerResolutionChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +{ + UINT uPeriod; + + /* Unless the hint says otherwise, let's have good sleep precision */ + if (hint && *hint) { + uPeriod = SDL_atoi(hint); + } else { + uPeriod = 1; + } + if (uPeriod || oldValue != hint) { + timeSetPeriod(uPeriod); + } +} + +void +SDL_StartTicks(void) +{ + /* Set first ticks value */ +#ifdef USE_GETTICKCOUNT + start = GetTickCount(); +#else + /* QueryPerformanceCounter has had problems in the past, but lots of games + use it, so we'll rely on it here. + */ + if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE) { + hires_timer_available = TRUE; + QueryPerformanceCounter(&hires_start_ticks); + } else { + hires_timer_available = FALSE; + timeSetPeriod(1); /* use 1 ms timer precision */ + start = timeGetTime(); + } +#endif + + SDL_AddHintCallback(SDL_HINT_TIMER_RESOLUTION, + SDL_TimerResolutionChanged, NULL); +} + +Uint32 +SDL_GetTicks(void) +{ + DWORD now; +#ifndef USE_GETTICKCOUNT + LARGE_INTEGER hires_now; +#endif + +#ifdef USE_GETTICKCOUNT + now = GetTickCount(); +#else + if (hires_timer_available) { + QueryPerformanceCounter(&hires_now); + + hires_now.QuadPart -= hires_start_ticks.QuadPart; + hires_now.QuadPart *= 1000; + hires_now.QuadPart /= hires_ticks_per_second.QuadPart; + + return (DWORD) hires_now.QuadPart; + } else { + now = timeGetTime(); + } +#endif + + return (now - start); +} + +Uint64 +SDL_GetPerformanceCounter(void) +{ + LARGE_INTEGER counter; + + if (!QueryPerformanceCounter(&counter)) { + return SDL_GetTicks(); + } + return counter.QuadPart; +} + +Uint64 +SDL_GetPerformanceFrequency(void) +{ + LARGE_INTEGER frequency; + + if (!QueryPerformanceFrequency(&frequency)) { + return 1000; + } + return frequency.QuadPart; +} + +void +SDL_Delay(Uint32 ms) +{ + Sleep(ms); +} + +#endif /* SDL_TIMER_WINDOWS */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index d4b191c272..25ecd45560 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -72,7 +71,7 @@ * For 32-bit targets, each pixel has the target RGB format but with * the alpha value occupying the highest 8 bits. The and * counts are 16 bit. - * + * * For 16-bit targets, each pixel has the target RGB format, but with * the middle component (usually green) shifted 16 steps to the left, * and the hole filled with the 5 most significant bits of the alpha value. @@ -91,16 +90,6 @@ #include "SDL_blit.h" #include "SDL_RLEaccel_c.h" -/* Force MMX to 0; this blows up on almost every major compiler now. --ryan. */ -#if 0 && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES -#define MMX_ASMBLIT -#endif - -#ifdef MMX_ASMBLIT -#include "mmx.h" -#include "SDL_cpuinfo.h" -#endif - #ifndef MAX #define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif @@ -108,278 +97,16 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif -#define PIXEL_COPY(to, from, len, bpp) \ -do { \ - if(bpp == 4) { \ - SDL_memcpy4(to, from, (size_t)(len)); \ - } else { \ - SDL_memcpy(to, from, (size_t)(len) * (bpp)); \ - } \ -} while(0) +#define PIXEL_COPY(to, from, len, bpp) \ + SDL_memcpy(to, from, (size_t)(len) * (bpp)) /* * Various colorkey blit methods, for opaque and per-surface alpha */ -#define OPAQUE_BLIT(to, from, length, bpp, alpha) \ +#define OPAQUE_BLIT(to, from, length, bpp, alpha) \ PIXEL_COPY(to, from, length, bpp) -#ifdef MMX_ASMBLIT - -#define ALPHA_BLIT32_888MMX(to, from, length, bpp, alpha) \ - do { \ - Uint32 *srcp = (Uint32 *)(from); \ - Uint32 *dstp = (Uint32 *)(to); \ - int i = 0x00FF00FF; \ - movd_m2r(*(&i), mm3); \ - punpckldq_r2r(mm3, mm3); \ - i = 0xFF000000; \ - movd_m2r(*(&i), mm7); \ - punpckldq_r2r(mm7, mm7); \ - i = alpha | alpha << 16; \ - movd_m2r(*(&i), mm4); \ - punpckldq_r2r(mm4, mm4); \ - pcmpeqd_r2r(mm5,mm5); /* set mm5 to "1" */ \ - pxor_r2r(mm7, mm5); /* make clear alpha mask */ \ - i = length; \ - if(i & 1) { \ - movd_m2r((*srcp), mm1); /* src -> mm1 */ \ - punpcklbw_r2r(mm1, mm1); \ - pand_r2r(mm3, mm1); \ - movd_m2r((*dstp), mm2); /* dst -> mm2 */ \ - punpcklbw_r2r(mm2, mm2); \ - pand_r2r(mm3, mm2); \ - psubw_r2r(mm2, mm1); \ - pmullw_r2r(mm4, mm1); \ - psrlw_i2r(8, mm1); \ - paddw_r2r(mm1, mm2); \ - pand_r2r(mm3, mm2); \ - packuswb_r2r(mm2, mm2); \ - pand_r2r(mm5, mm2); /* 00000RGB -> mm2 */ \ - movd_r2m(mm2, *dstp); \ - ++srcp; \ - ++dstp; \ - i--; \ - } \ - for(; i > 0; --i) { \ - movq_m2r((*srcp), mm0); \ - movq_r2r(mm0, mm1); \ - punpcklbw_r2r(mm0, mm0); \ - movq_m2r((*dstp), mm2); \ - punpckhbw_r2r(mm1, mm1); \ - movq_r2r(mm2, mm6); \ - pand_r2r(mm3, mm0); \ - punpcklbw_r2r(mm2, mm2); \ - pand_r2r(mm3, mm1); \ - punpckhbw_r2r(mm6, mm6); \ - pand_r2r(mm3, mm2); \ - psubw_r2r(mm2, mm0); \ - pmullw_r2r(mm4, mm0); \ - pand_r2r(mm3, mm6); \ - psubw_r2r(mm6, mm1); \ - pmullw_r2r(mm4, mm1); \ - psrlw_i2r(8, mm0); \ - paddw_r2r(mm0, mm2); \ - psrlw_i2r(8, mm1); \ - paddw_r2r(mm1, mm6); \ - pand_r2r(mm3, mm2); \ - pand_r2r(mm3, mm6); \ - packuswb_r2r(mm2, mm2); \ - packuswb_r2r(mm6, mm6); \ - psrlq_i2r(32, mm2); \ - psllq_i2r(32, mm6); \ - por_r2r(mm6, mm2); \ - pand_r2r(mm5, mm2); /* 00000RGB -> mm2 */ \ - movq_r2m(mm2, *dstp); \ - srcp += 2; \ - dstp += 2; \ - i--; \ - } \ - emms(); \ - } while(0) - -#define ALPHA_BLIT16_565MMX(to, from, length, bpp, alpha) \ - do { \ - int i, n = 0; \ - Uint16 *srcp = (Uint16 *)(from); \ - Uint16 *dstp = (Uint16 *)(to); \ - Uint32 ALPHA = 0xF800; \ - movd_m2r(*(&ALPHA), mm1); \ - punpcklwd_r2r(mm1, mm1); \ - punpcklwd_r2r(mm1, mm1); \ - ALPHA = 0x07E0; \ - movd_m2r(*(&ALPHA), mm4); \ - punpcklwd_r2r(mm4, mm4); \ - punpcklwd_r2r(mm4, mm4); \ - ALPHA = 0x001F; \ - movd_m2r(*(&ALPHA), mm7); \ - punpcklwd_r2r(mm7, mm7); \ - punpcklwd_r2r(mm7, mm7); \ - alpha &= ~(1+2+4); \ - i = (Uint32)alpha | (Uint32)alpha << 16; \ - movd_m2r(*(&i), mm0); \ - punpckldq_r2r(mm0, mm0); \ - ALPHA = alpha >> 3; \ - i = ((int)(length) & 3); \ - for(; i > 0; --i) { \ - Uint32 s = *srcp++; \ - Uint32 d = *dstp; \ - s = (s | s << 16) & 0x07e0f81f; \ - d = (d | d << 16) & 0x07e0f81f; \ - d += (s - d) * ALPHA >> 5; \ - d &= 0x07e0f81f; \ - *dstp++ = d | d >> 16; \ - n++; \ - } \ - i = (int)(length) - n; \ - for(; i > 0; --i) { \ - movq_m2r((*dstp), mm3); \ - movq_m2r((*srcp), mm2); \ - movq_r2r(mm2, mm5); \ - pand_r2r(mm1 , mm5); \ - psrlq_i2r(11, mm5); \ - movq_r2r(mm3, mm6); \ - pand_r2r(mm1 , mm6); \ - psrlq_i2r(11, mm6); \ - psubw_r2r(mm6, mm5); \ - pmullw_r2r(mm0, mm5); \ - psrlw_i2r(8, mm5); \ - paddw_r2r(mm5, mm6); \ - psllq_i2r(11, mm6); \ - pand_r2r(mm1, mm6); \ - movq_r2r(mm4, mm5); \ - por_r2r(mm7, mm5); \ - pand_r2r(mm5, mm3); \ - por_r2r(mm6, mm3); \ - movq_r2r(mm2, mm5); \ - pand_r2r(mm4 , mm5); \ - psrlq_i2r(5, mm5); \ - movq_r2r(mm3, mm6); \ - pand_r2r(mm4 , mm6); \ - psrlq_i2r(5, mm6); \ - psubw_r2r(mm6, mm5); \ - pmullw_r2r(mm0, mm5); \ - psrlw_i2r(8, mm5); \ - paddw_r2r(mm5, mm6); \ - psllq_i2r(5, mm6); \ - pand_r2r(mm4, mm6); \ - movq_r2r(mm1, mm5); \ - por_r2r(mm7, mm5); \ - pand_r2r(mm5, mm3); \ - por_r2r(mm6, mm3); \ - movq_r2r(mm2, mm5); \ - pand_r2r(mm7 , mm5); \ - movq_r2r(mm3, mm6); \ - pand_r2r(mm7 , mm6); \ - psubw_r2r(mm6, mm5); \ - pmullw_r2r(mm0, mm5); \ - psrlw_i2r(8, mm5); \ - paddw_r2r(mm5, mm6); \ - pand_r2r(mm7, mm6); \ - movq_r2r(mm1, mm5); \ - por_r2r(mm4, mm5); \ - pand_r2r(mm5, mm3); \ - por_r2r(mm6, mm3); \ - movq_r2m(mm3, *dstp); \ - srcp += 4; \ - dstp += 4; \ - i -= 3; \ - } \ - emms(); \ - } while(0) - -#define ALPHA_BLIT16_555MMX(to, from, length, bpp, alpha) \ - do { \ - int i, n = 0; \ - Uint16 *srcp = (Uint16 *)(from); \ - Uint16 *dstp = (Uint16 *)(to); \ - Uint32 ALPHA = 0x7C00; \ - movd_m2r(*(&ALPHA), mm1); \ - punpcklwd_r2r(mm1, mm1); \ - punpcklwd_r2r(mm1, mm1); \ - ALPHA = 0x03E0; \ - movd_m2r(*(&ALPHA), mm4); \ - punpcklwd_r2r(mm4, mm4); \ - punpcklwd_r2r(mm4, mm4); \ - ALPHA = 0x001F; \ - movd_m2r(*(&ALPHA), mm7); \ - punpcklwd_r2r(mm7, mm7); \ - punpcklwd_r2r(mm7, mm7); \ - alpha &= ~(1+2+4); \ - i = (Uint32)alpha | (Uint32)alpha << 16; \ - movd_m2r(*(&i), mm0); \ - punpckldq_r2r(mm0, mm0); \ - i = ((int)(length) & 3); \ - ALPHA = alpha >> 3; \ - for(; i > 0; --i) { \ - Uint32 s = *srcp++; \ - Uint32 d = *dstp; \ - s = (s | s << 16) & 0x03e07c1f; \ - d = (d | d << 16) & 0x03e07c1f; \ - d += (s - d) * ALPHA >> 5; \ - d &= 0x03e07c1f; \ - *dstp++ = d | d >> 16; \ - n++; \ - } \ - i = (int)(length) - n; \ - for(; i > 0; --i) { \ - movq_m2r((*dstp), mm3); \ - movq_m2r((*srcp), mm2); \ - movq_r2r(mm2, mm5); \ - pand_r2r(mm1 , mm5); \ - psrlq_i2r(10, mm5); \ - movq_r2r(mm3, mm6); \ - pand_r2r(mm1 , mm6); \ - psrlq_i2r(10, mm6); \ - psubw_r2r(mm6, mm5); \ - pmullw_r2r(mm0, mm5); \ - psrlw_i2r(8, mm5); \ - paddw_r2r(mm5, mm6); \ - psllq_i2r(10, mm6); \ - pand_r2r(mm1, mm6); \ - movq_r2r(mm4, mm5); \ - por_r2r(mm7, mm5); \ - pand_r2r(mm5, mm3); \ - por_r2r(mm6, mm3); \ - movq_r2r(mm2, mm5); \ - pand_r2r(mm4 , mm5); \ - psrlq_i2r(5, mm5); \ - movq_r2r(mm3, mm6); \ - pand_r2r(mm4 , mm6); \ - psrlq_i2r(5, mm6); \ - psubw_r2r(mm6, mm5); \ - pmullw_r2r(mm0, mm5); \ - psrlw_i2r(8, mm5); \ - paddw_r2r(mm5, mm6); \ - psllq_i2r(5, mm6); \ - pand_r2r(mm4, mm6); \ - movq_r2r(mm1, mm5); \ - por_r2r(mm7, mm5); \ - pand_r2r(mm5, mm3); \ - por_r2r(mm6, mm3); \ - movq_r2r(mm2, mm5); \ - pand_r2r(mm7 , mm5); \ - movq_r2r(mm3, mm6); \ - pand_r2r(mm7 , mm6); \ - psubw_r2r(mm6, mm5); \ - pmullw_r2r(mm0, mm5); \ - psrlw_i2r(8, mm5); \ - paddw_r2r(mm5, mm6); \ - pand_r2r(mm7, mm6); \ - movq_r2r(mm1, mm5); \ - por_r2r(mm4, mm5); \ - pand_r2r(mm5, mm3); \ - por_r2r(mm6, mm3); \ - movq_r2m(mm3, *dstp); \ - srcp += 4; \ - dstp += 4; \ - i -= 3; \ - } \ - emms(); \ - } while(0) - -#endif - /* * For 32bpp pixels on the form 0x00rrggbb: * If we treat the middle component separately, we can process the two @@ -387,22 +114,22 @@ do { \ * of each component, so the bits from the multiplication don't collide. * This can be used for any RGB permutation of course. */ -#define ALPHA_BLIT32_888(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint32 *src = (Uint32 *)(from); \ - Uint32 *dst = (Uint32 *)(to); \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - Uint32 s1 = s & 0xff00ff; \ - Uint32 d1 = d & 0xff00ff; \ - d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ - s &= 0xff00; \ - d &= 0xff00; \ - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ - *dst++ = d1 | d; \ - } \ +#define ALPHA_BLIT32_888(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint32 *src = (Uint32 *)(from); \ + Uint32 *dst = (Uint32 *)(to); \ + for(i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + Uint32 s1 = s & 0xff00ff; \ + Uint32 d1 = d & 0xff00ff; \ + d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ + s &= 0xff00; \ + d &= 0xff00; \ + d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ + *dst++ = d1 | d; \ + } \ } while(0) /* @@ -411,142 +138,100 @@ do { \ * components at the same time. Since the smallest gap is here just * 5 bits, we have to scale alpha down to 5 bits as well. */ -#define ALPHA_BLIT16_565(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint16 *src = (Uint16 *)(from); \ - Uint16 *dst = (Uint16 *)(to); \ - Uint32 ALPHA = alpha >> 3; \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - s = (s | s << 16) & 0x07e0f81f; \ - d = (d | d << 16) & 0x07e0f81f; \ - d += (s - d) * ALPHA >> 5; \ - d &= 0x07e0f81f; \ - *dst++ = (Uint16)(d | d >> 16); \ - } \ +#define ALPHA_BLIT16_565(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint16 *src = (Uint16 *)(from); \ + Uint16 *dst = (Uint16 *)(to); \ + Uint32 ALPHA = alpha >> 3; \ + for(i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + s = (s | s << 16) & 0x07e0f81f; \ + d = (d | d << 16) & 0x07e0f81f; \ + d += (s - d) * ALPHA >> 5; \ + d &= 0x07e0f81f; \ + *dst++ = (Uint16)(d | d >> 16); \ + } \ } while(0) -#define ALPHA_BLIT16_555(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint16 *src = (Uint16 *)(from); \ - Uint16 *dst = (Uint16 *)(to); \ - Uint32 ALPHA = alpha >> 3; \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - s = (s | s << 16) & 0x03e07c1f; \ - d = (d | d << 16) & 0x03e07c1f; \ - d += (s - d) * ALPHA >> 5; \ - d &= 0x03e07c1f; \ - *dst++ = (Uint16)(d | d >> 16); \ - } \ +#define ALPHA_BLIT16_555(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint16 *src = (Uint16 *)(from); \ + Uint16 *dst = (Uint16 *)(to); \ + Uint32 ALPHA = alpha >> 3; \ + for(i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + s = (s | s << 16) & 0x03e07c1f; \ + d = (d | d << 16) & 0x03e07c1f; \ + d += (s - d) * ALPHA >> 5; \ + d &= 0x03e07c1f; \ + *dst++ = (Uint16)(d | d >> 16); \ + } \ } while(0) /* * The general slow catch-all function, for remaining depths and formats */ -#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint8 *src = from; \ - Uint8 *dst = to; \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s, d; \ - unsigned rs, gs, bs, rd, gd, bd; \ - switch(bpp) { \ - case 2: \ - s = *(Uint16 *)src; \ - d = *(Uint16 *)dst; \ - break; \ - case 3: \ - if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ - s = (src[0] << 16) | (src[1] << 8) | src[2]; \ - d = (dst[0] << 16) | (dst[1] << 8) | dst[2]; \ - } else { \ - s = (src[2] << 16) | (src[1] << 8) | src[0]; \ - d = (dst[2] << 16) | (dst[1] << 8) | dst[0]; \ - } \ - break; \ - case 4: \ - s = *(Uint32 *)src; \ - d = *(Uint32 *)dst; \ - break; \ - } \ - RGB_FROM_PIXEL(s, fmt, rs, gs, bs); \ - RGB_FROM_PIXEL(d, fmt, rd, gd, bd); \ - rd += (rs - rd) * alpha >> 8; \ - gd += (gs - gd) * alpha >> 8; \ - bd += (bs - bd) * alpha >> 8; \ - PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \ - switch(bpp) { \ - case 2: \ - *(Uint16 *)dst = (Uint16)d; \ - break; \ - case 3: \ - if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ - dst[0] = (Uint8)(d >> 16); \ - dst[1] = (Uint8)(d >> 8); \ - dst[2] = (Uint8)(d); \ - } else { \ - dst[0] = (Uint8)d; \ - dst[1] = (Uint8)(d >> 8); \ - dst[2] = (Uint8)(d >> 16); \ - } \ - break; \ - case 4: \ - *(Uint32 *)dst = d; \ - break; \ - } \ - src += bpp; \ - dst += bpp; \ - } \ - } while(0) - -#ifdef MMX_ASMBLIT - -#define ALPHA_BLIT32_888_50MMX(to, from, length, bpp, alpha) \ - do { \ - Uint32 *srcp = (Uint32 *)(from); \ - Uint32 *dstp = (Uint32 *)(to); \ - int i = 0x00fefefe; \ - movd_m2r(*(&i), mm4); \ - punpckldq_r2r(mm4, mm4); \ - i = 0x00010101; \ - movd_m2r(*(&i), mm3); \ - punpckldq_r2r(mm3, mm3); \ - i = (int)(length); \ - if( i & 1 ) { \ - Uint32 s = *srcp++; \ - Uint32 d = *dstp; \ - *dstp++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) \ - + (s & d & 0x00010101); \ - i--; \ - } \ - for(; i > 0; --i) { \ - movq_m2r((*dstp), mm2); /* dst -> mm2 */ \ - movq_r2r(mm2, mm6); /* dst -> mm6 */ \ - movq_m2r((*srcp), mm1); /* src -> mm1 */ \ - movq_r2r(mm1, mm5); /* src -> mm5 */ \ - pand_r2r(mm4, mm6); /* dst & 0x00fefefe -> mm6 */ \ - pand_r2r(mm4, mm5); /* src & 0x00fefefe -> mm5 */ \ - paddd_r2r(mm6, mm5); /* (dst & 0x00fefefe) + (dst & 0x00fefefe) -> mm5 */ \ - psrld_i2r(1, mm5); \ - pand_r2r(mm1, mm2); /* s & d -> mm2 */ \ - pand_r2r(mm3, mm2); /* s & d & 0x00010101 -> mm2 */ \ - paddd_r2r(mm5, mm2); \ - movq_r2m(mm2, (*dstp)); \ - dstp += 2; \ - srcp += 2; \ - i--; \ - } \ - emms(); \ +#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint8 *src = from; \ + Uint8 *dst = to; \ + for(i = 0; i < (int)(length); i++) { \ + Uint32 s, d; \ + unsigned rs, gs, bs, rd, gd, bd; \ + switch(bpp) { \ + case 2: \ + s = *(Uint16 *)src; \ + d = *(Uint16 *)dst; \ + break; \ + case 3: \ + if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ + s = (src[0] << 16) | (src[1] << 8) | src[2]; \ + d = (dst[0] << 16) | (dst[1] << 8) | dst[2]; \ + } else { \ + s = (src[2] << 16) | (src[1] << 8) | src[0]; \ + d = (dst[2] << 16) | (dst[1] << 8) | dst[0]; \ + } \ + break; \ + case 4: \ + s = *(Uint32 *)src; \ + d = *(Uint32 *)dst; \ + break; \ + } \ + RGB_FROM_PIXEL(s, fmt, rs, gs, bs); \ + RGB_FROM_PIXEL(d, fmt, rd, gd, bd); \ + rd += (rs - rd) * alpha >> 8; \ + gd += (gs - gd) * alpha >> 8; \ + bd += (bs - bd) * alpha >> 8; \ + PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \ + switch(bpp) { \ + case 2: \ + *(Uint16 *)dst = (Uint16)d; \ + break; \ + case 3: \ + if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ + dst[0] = (Uint8)(d >> 16); \ + dst[1] = (Uint8)(d >> 8); \ + dst[2] = (Uint8)(d); \ + } else { \ + dst[0] = (Uint8)d; \ + dst[1] = (Uint8)(d >> 8); \ + dst[2] = (Uint8)(d >> 16); \ + } \ + break; \ + case 4: \ + *(Uint32 *)dst = d; \ + break; \ + } \ + src += bpp; \ + dst += bpp; \ + } \ } while(0) -#endif - /* * Special case: 50% alpha (alpha=128) * This is treated specially because it can be optimized very well, and @@ -555,17 +240,17 @@ do { \ * First zero the lowest bit of each component, which gives us room to * add them. Then shift right and add the sum of the lowest bits. */ -#define ALPHA_BLIT32_888_50(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint32 *src = (Uint32 *)(from); \ - Uint32 *dst = (Uint32 *)(to); \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - *dst++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) \ - + (s & d & 0x00010101); \ - } \ +#define ALPHA_BLIT32_888_50(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint32 *src = (Uint32 *)(from); \ + Uint32 *dst = (Uint32 *)(to); \ + for(i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + *dst++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) \ + + (s & d & 0x00010101); \ + } \ } while(0) /* @@ -574,259 +259,170 @@ do { \ */ /* helper: blend a single 16 bit pixel at 50% */ -#define BLEND16_50(dst, src, mask) \ - do { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - *dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) + \ - (s & d & (~mask & 0xffff))); \ +#define BLEND16_50(dst, src, mask) \ + do { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + *dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) + \ + (s & d & (~mask & 0xffff))); \ } while(0) /* basic 16bpp blender. mask is the pixels to keep when adding. */ -#define ALPHA_BLIT16_50(to, from, length, bpp, alpha, mask) \ - do { \ - unsigned n = (length); \ - Uint16 *src = (Uint16 *)(from); \ - Uint16 *dst = (Uint16 *)(to); \ - if(((uintptr_t)src ^ (uintptr_t)dst) & 3) { \ - /* source and destination not in phase, blit one by one */ \ - while(n--) \ - BLEND16_50(dst, src, mask); \ - } else { \ - if((uintptr_t)src & 3) { \ - /* first odd pixel */ \ - BLEND16_50(dst, src, mask); \ - n--; \ - } \ - for(; n > 1; n -= 2) { \ - Uint32 s = *(Uint32 *)src; \ - Uint32 d = *(Uint32 *)dst; \ - *(Uint32 *)dst = ((s & (mask | mask << 16)) >> 1) \ - + ((d & (mask | mask << 16)) >> 1) \ - + (s & d & (~(mask | mask << 16))); \ - src += 2; \ - dst += 2; \ - } \ - if(n) \ - BLEND16_50(dst, src, mask); /* last odd pixel */ \ - } \ +#define ALPHA_BLIT16_50(to, from, length, bpp, alpha, mask) \ + do { \ + unsigned n = (length); \ + Uint16 *src = (Uint16 *)(from); \ + Uint16 *dst = (Uint16 *)(to); \ + if(((uintptr_t)src ^ (uintptr_t)dst) & 3) { \ + /* source and destination not in phase, blit one by one */ \ + while(n--) \ + BLEND16_50(dst, src, mask); \ + } else { \ + if((uintptr_t)src & 3) { \ + /* first odd pixel */ \ + BLEND16_50(dst, src, mask); \ + n--; \ + } \ + for(; n > 1; n -= 2) { \ + Uint32 s = *(Uint32 *)src; \ + Uint32 d = *(Uint32 *)dst; \ + *(Uint32 *)dst = ((s & (mask | mask << 16)) >> 1) \ + + ((d & (mask | mask << 16)) >> 1) \ + + (s & d & (~(mask | mask << 16))); \ + src += 2; \ + dst += 2; \ + } \ + if(n) \ + BLEND16_50(dst, src, mask); /* last odd pixel */ \ + } \ } while(0) -#define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha) \ +#define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha) \ ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7de) -#define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha) \ +#define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha) \ ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde) -#ifdef MMX_ASMBLIT - -#define CHOOSE_BLIT(blitter, alpha, fmt) \ - do { \ - if(alpha == 255) { \ - switch(fmt->BytesPerPixel) { \ - case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \ - case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \ - case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \ - case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \ - } \ - } else { \ - switch(fmt->BytesPerPixel) { \ - case 1: \ - /* No 8bpp alpha blitting */ \ - break; \ - \ - case 2: \ - switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \ - case 0xffff: \ - if(fmt->Gmask == 0x07e0 \ - || fmt->Rmask == 0x07e0 \ - || fmt->Bmask == 0x07e0) { \ - if(alpha == 128) \ - blitter(2, Uint8, ALPHA_BLIT16_565_50); \ - else { \ - if(SDL_HasMMX()) \ - blitter(2, Uint8, ALPHA_BLIT16_565MMX); \ - else \ - blitter(2, Uint8, ALPHA_BLIT16_565); \ - } \ - } else \ - goto general16; \ - break; \ - \ - case 0x7fff: \ - if(fmt->Gmask == 0x03e0 \ - || fmt->Rmask == 0x03e0 \ - || fmt->Bmask == 0x03e0) { \ - if(alpha == 128) \ - blitter(2, Uint8, ALPHA_BLIT16_555_50); \ - else { \ - if(SDL_HasMMX()) \ - blitter(2, Uint8, ALPHA_BLIT16_555MMX); \ - else \ - blitter(2, Uint8, ALPHA_BLIT16_555); \ - } \ - break; \ - } \ - /* fallthrough */ \ - \ - default: \ - general16: \ - blitter(2, Uint8, ALPHA_BLIT_ANY); \ - } \ - break; \ - \ - case 3: \ - blitter(3, Uint8, ALPHA_BLIT_ANY); \ - break; \ - \ - case 4: \ - if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \ - && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \ - || fmt->Bmask == 0xff00)) { \ - if(alpha == 128) \ - { \ - if(SDL_HasMMX()) \ - blitter(4, Uint16, ALPHA_BLIT32_888_50MMX);\ - else \ - blitter(4, Uint16, ALPHA_BLIT32_888_50);\ - } \ - else \ - { \ - if(SDL_HasMMX()) \ - blitter(4, Uint16, ALPHA_BLIT32_888MMX);\ - else \ - blitter(4, Uint16, ALPHA_BLIT32_888); \ - } \ - } else \ - blitter(4, Uint16, ALPHA_BLIT_ANY); \ - break; \ - } \ - } \ - } while(0) - -#else - -#define CHOOSE_BLIT(blitter, alpha, fmt) \ - do { \ - if(alpha == 255) { \ - switch(fmt->BytesPerPixel) { \ - case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \ - case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \ - case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \ - case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \ - } \ - } else { \ - switch(fmt->BytesPerPixel) { \ - case 1: \ - /* No 8bpp alpha blitting */ \ - break; \ - \ - case 2: \ - switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \ - case 0xffff: \ - if(fmt->Gmask == 0x07e0 \ - || fmt->Rmask == 0x07e0 \ - || fmt->Bmask == 0x07e0) { \ - if(alpha == 128) \ - blitter(2, Uint8, ALPHA_BLIT16_565_50); \ - else { \ - blitter(2, Uint8, ALPHA_BLIT16_565); \ - } \ - } else \ - goto general16; \ - break; \ - \ - case 0x7fff: \ - if(fmt->Gmask == 0x03e0 \ - || fmt->Rmask == 0x03e0 \ - || fmt->Bmask == 0x03e0) { \ - if(alpha == 128) \ - blitter(2, Uint8, ALPHA_BLIT16_555_50); \ - else { \ - blitter(2, Uint8, ALPHA_BLIT16_555); \ - } \ - break; \ - } \ - /* fallthrough */ \ - \ - default: \ - general16: \ - blitter(2, Uint8, ALPHA_BLIT_ANY); \ - } \ - break; \ - \ - case 3: \ - blitter(3, Uint8, ALPHA_BLIT_ANY); \ - break; \ - \ - case 4: \ - if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \ - && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \ - || fmt->Bmask == 0xff00)) { \ - if(alpha == 128) \ - blitter(4, Uint16, ALPHA_BLIT32_888_50); \ - else \ - blitter(4, Uint16, ALPHA_BLIT32_888); \ - } else \ - blitter(4, Uint16, ALPHA_BLIT_ANY); \ - break; \ - } \ - } \ +#define CHOOSE_BLIT(blitter, alpha, fmt) \ + do { \ + if(alpha == 255) { \ + switch(fmt->BytesPerPixel) { \ + case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \ + case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \ + case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \ + case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \ + } \ + } else { \ + switch(fmt->BytesPerPixel) { \ + case 1: \ + /* No 8bpp alpha blitting */ \ + break; \ + \ + case 2: \ + switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \ + case 0xffff: \ + if(fmt->Gmask == 0x07e0 \ + || fmt->Rmask == 0x07e0 \ + || fmt->Bmask == 0x07e0) { \ + if(alpha == 128) \ + blitter(2, Uint8, ALPHA_BLIT16_565_50); \ + else { \ + blitter(2, Uint8, ALPHA_BLIT16_565); \ + } \ + } else \ + goto general16; \ + break; \ + \ + case 0x7fff: \ + if(fmt->Gmask == 0x03e0 \ + || fmt->Rmask == 0x03e0 \ + || fmt->Bmask == 0x03e0) { \ + if(alpha == 128) \ + blitter(2, Uint8, ALPHA_BLIT16_555_50); \ + else { \ + blitter(2, Uint8, ALPHA_BLIT16_555); \ + } \ + break; \ + } \ + /* fallthrough */ \ + \ + default: \ + general16: \ + blitter(2, Uint8, ALPHA_BLIT_ANY); \ + } \ + break; \ + \ + case 3: \ + blitter(3, Uint8, ALPHA_BLIT_ANY); \ + break; \ + \ + case 4: \ + if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \ + && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \ + || fmt->Bmask == 0xff00)) { \ + if(alpha == 128) \ + blitter(4, Uint16, ALPHA_BLIT32_888_50); \ + else \ + blitter(4, Uint16, ALPHA_BLIT32_888); \ + } else \ + blitter(4, Uint16, ALPHA_BLIT_ANY); \ + break; \ + } \ + } \ } while(0) -#endif - /* * This takes care of the case when the surface is clipped on the left and/or * right. Top clipping has already been taken care of. */ -static void RLEClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst, - Uint8 *dstbuf, SDL_Rect *srcrect, unsigned alpha) +static void +RLEClipBlit(int w, Uint8 * srcbuf, SDL_Surface * dst, + Uint8 * dstbuf, SDL_Rect * srcrect, unsigned alpha) { SDL_PixelFormat *fmt = dst->format; -#define RLECLIPBLIT(bpp, Type, do_blit) \ - do { \ - int linecount = srcrect->h; \ - int ofs = 0; \ - int left = srcrect->x; \ - int right = left + srcrect->w; \ - dstbuf -= left * bpp; \ - for(;;) { \ - int run; \ - ofs += *(Type *)srcbuf; \ - run = ((Type *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Type); \ - if(run) { \ - /* clip to left and right borders */ \ - if(ofs < right) { \ - int start = 0; \ - int len = run; \ - int startcol; \ - if(left - ofs > 0) { \ - start = left - ofs; \ - len -= start; \ - if(len <= 0) \ - goto nocopy ## bpp ## do_blit; \ - } \ - startcol = ofs + start; \ - if(len > right - startcol) \ - len = right - startcol; \ - do_blit(dstbuf + startcol * bpp, srcbuf + start * bpp, \ - len, bpp, alpha); \ - } \ - nocopy ## bpp ## do_blit: \ - srcbuf += run * bpp; \ - ofs += run; \ - } else if(!ofs) \ - break; \ - if(ofs == w) { \ - ofs = 0; \ - dstbuf += dst->pitch; \ - if(!--linecount) \ - break; \ - } \ - } \ +#define RLECLIPBLIT(bpp, Type, do_blit) \ + do { \ + int linecount = srcrect->h; \ + int ofs = 0; \ + int left = srcrect->x; \ + int right = left + srcrect->w; \ + dstbuf -= left * bpp; \ + for(;;) { \ + int run; \ + ofs += *(Type *)srcbuf; \ + run = ((Type *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Type); \ + if(run) { \ + /* clip to left and right borders */ \ + if(ofs < right) { \ + int start = 0; \ + int len = run; \ + int startcol; \ + if(left - ofs > 0) { \ + start = left - ofs; \ + len -= start; \ + if(len <= 0) \ + goto nocopy ## bpp ## do_blit; \ + } \ + startcol = ofs + start; \ + if(len > right - startcol) \ + len = right - startcol; \ + do_blit(dstbuf + startcol * bpp, srcbuf + start * bpp, \ + len, bpp, alpha); \ + } \ + nocopy ## bpp ## do_blit: \ + srcbuf += run * bpp; \ + ofs += run; \ + } else if(!ofs) \ + break; \ + if(ofs == w) { \ + ofs = 0; \ + dstbuf += dst->pitch; \ + if(!--linecount) \ + break; \ + } \ + } \ } while(0) CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt); @@ -837,108 +433,116 @@ static void RLEClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst, /* blit a colorkeyed RLE surface */ -int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect) +int +SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect) { - Uint8 *dstbuf; - Uint8 *srcbuf; - int x, y; - int w = src->w; - unsigned alpha; - - /* Lock the destination if necessary */ - if ( SDL_MUSTLOCK(dst) ) { - if ( SDL_LockSurface(dst) < 0 ) { - return(-1); - } - } - - /* Set up the source and destination pointers */ - x = dstrect->x; - y = dstrect->y; - dstbuf = (Uint8 *)dst->pixels - + y * dst->pitch + x * src->format->BytesPerPixel; - srcbuf = (Uint8 *)src->map->sw_data->aux_data; - - { - /* skip lines at the top if neccessary */ - int vskip = srcrect->y; - int ofs = 0; - if(vskip) { - -#define RLESKIP(bpp, Type) \ - for(;;) { \ - int run; \ - ofs += *(Type *)srcbuf; \ - run = ((Type *)srcbuf)[1]; \ - srcbuf += sizeof(Type) * 2; \ - if(run) { \ - srcbuf += run * bpp; \ - ofs += run; \ - } else if(!ofs) \ - goto done; \ - if(ofs == w) { \ - ofs = 0; \ - if(!--vskip) \ - break; \ - } \ - } - - switch(src->format->BytesPerPixel) { - case 1: RLESKIP(1, Uint8); break; - case 2: RLESKIP(2, Uint8); break; - case 3: RLESKIP(3, Uint8); break; - case 4: RLESKIP(4, Uint16); break; - } + Uint8 *dstbuf; + Uint8 *srcbuf; + int x, y; + int w = src->w; + unsigned alpha; + + /* Lock the destination if necessary */ + if (SDL_MUSTLOCK(dst)) { + if (SDL_LockSurface(dst) < 0) { + return (-1); + } + } + + /* Set up the source and destination pointers */ + x = dstrect->x; + y = dstrect->y; + dstbuf = (Uint8 *) dst->pixels + + y * dst->pitch + x * src->format->BytesPerPixel; + srcbuf = (Uint8 *) src->map->data; + + { + /* skip lines at the top if necessary */ + int vskip = srcrect->y; + int ofs = 0; + if (vskip) { + +#define RLESKIP(bpp, Type) \ + for(;;) { \ + int run; \ + ofs += *(Type *)srcbuf; \ + run = ((Type *)srcbuf)[1]; \ + srcbuf += sizeof(Type) * 2; \ + if(run) { \ + srcbuf += run * bpp; \ + ofs += run; \ + } else if(!ofs) \ + goto done; \ + if(ofs == w) { \ + ofs = 0; \ + if(!--vskip) \ + break; \ + } \ + } + + switch (src->format->BytesPerPixel) { + case 1: + RLESKIP(1, Uint8); + break; + case 2: + RLESKIP(2, Uint8); + break; + case 3: + RLESKIP(3, Uint8); + break; + case 4: + RLESKIP(4, Uint16); + break; + } #undef RLESKIP - } - } - - alpha = (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA - ? src->format->alpha : 255; - /* if left or right edge clipping needed, call clip blit */ - if ( srcrect->x || srcrect->w != src->w ) { - RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha); - } else { - SDL_PixelFormat *fmt = src->format; - -#define RLEBLIT(bpp, Type, do_blit) \ - do { \ - int linecount = srcrect->h; \ - int ofs = 0; \ - for(;;) { \ - unsigned run; \ - ofs += *(Type *)srcbuf; \ - run = ((Type *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Type); \ - if(run) { \ - do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \ - srcbuf += run * bpp; \ - ofs += run; \ - } else if(!ofs) \ - break; \ - if(ofs == w) { \ - ofs = 0; \ - dstbuf += dst->pitch; \ - if(!--linecount) \ - break; \ - } \ - } \ - } while(0) - - CHOOSE_BLIT(RLEBLIT, alpha, fmt); + } + } + + alpha = src->map->info.a; + /* if left or right edge clipping needed, call clip blit */ + if (srcrect->x || srcrect->w != src->w) { + RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha); + } else { + SDL_PixelFormat *fmt = src->format; + +#define RLEBLIT(bpp, Type, do_blit) \ + do { \ + int linecount = srcrect->h; \ + int ofs = 0; \ + for(;;) { \ + unsigned run; \ + ofs += *(Type *)srcbuf; \ + run = ((Type *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Type); \ + if(run) { \ + do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \ + srcbuf += run * bpp; \ + ofs += run; \ + } else if(!ofs) \ + break; \ + if(ofs == w) { \ + ofs = 0; \ + dstbuf += dst->pitch; \ + if(!--linecount) \ + break; \ + } \ + } \ + } while(0) + + CHOOSE_BLIT(RLEBLIT, alpha, fmt); #undef RLEBLIT - } - -done: - /* Unlock the destination if necessary */ - if ( SDL_MUSTLOCK(dst) ) { - SDL_UnlockSurface(dst); - } - return(0); + } + + done: + /* Unlock the destination if necessary */ + if (SDL_MUSTLOCK(dst)) { + SDL_UnlockSurface(dst); + } + return (0); } #undef OPAQUE_BLIT @@ -952,68 +556,72 @@ int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect, * For 32bpp pixels, we have made sure the alpha is stored in the top * 8 bits, so proceed as usual */ -#define BLIT_TRANSL_888(src, dst) \ - do { \ - Uint32 s = src; \ - Uint32 d = dst; \ - unsigned alpha = s >> 24; \ - Uint32 s1 = s & 0xff00ff; \ - Uint32 d1 = d & 0xff00ff; \ - d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ - s &= 0xff00; \ - d &= 0xff00; \ - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ - dst = d1 | d; \ +#define BLIT_TRANSL_888(src, dst) \ + do { \ + Uint32 s = src; \ + Uint32 d = dst; \ + unsigned alpha = s >> 24; \ + Uint32 s1 = s & 0xff00ff; \ + Uint32 d1 = d & 0xff00ff; \ + d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ + s &= 0xff00; \ + d &= 0xff00; \ + d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ + dst = d1 | d | 0xff000000; \ } while(0) /* * For 16bpp pixels, we have stored the 5 most significant alpha bits in * bits 5-10. As before, we can process all 3 RGB components at the same time. */ -#define BLIT_TRANSL_565(src, dst) \ - do { \ - Uint32 s = src; \ - Uint32 d = dst; \ - unsigned alpha = (s & 0x3e0) >> 5; \ - s &= 0x07e0f81f; \ - d = (d | d << 16) & 0x07e0f81f; \ - d += (s - d) * alpha >> 5; \ - d &= 0x07e0f81f; \ - dst = (Uint16)(d | d >> 16); \ +#define BLIT_TRANSL_565(src, dst) \ + do { \ + Uint32 s = src; \ + Uint32 d = dst; \ + unsigned alpha = (s & 0x3e0) >> 5; \ + s &= 0x07e0f81f; \ + d = (d | d << 16) & 0x07e0f81f; \ + d += (s - d) * alpha >> 5; \ + d &= 0x07e0f81f; \ + dst = (Uint16)(d | d >> 16); \ } while(0) -#define BLIT_TRANSL_555(src, dst) \ - do { \ - Uint32 s = src; \ - Uint32 d = dst; \ - unsigned alpha = (s & 0x3e0) >> 5; \ - s &= 0x03e07c1f; \ - d = (d | d << 16) & 0x03e07c1f; \ - d += (s - d) * alpha >> 5; \ - d &= 0x03e07c1f; \ - dst = (Uint16)(d | d >> 16); \ +#define BLIT_TRANSL_555(src, dst) \ + do { \ + Uint32 s = src; \ + Uint32 d = dst; \ + unsigned alpha = (s & 0x3e0) >> 5; \ + s &= 0x03e07c1f; \ + d = (d | d << 16) & 0x03e07c1f; \ + d += (s - d) * alpha >> 5; \ + d &= 0x03e07c1f; \ + dst = (Uint16)(d | d >> 16); \ } while(0) /* used to save the destination format in the encoding. Designed to be macro-compatible with SDL_PixelFormat but without the unneeded fields */ -typedef struct { - Uint8 BytesPerPixel; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; +typedef struct +{ + Uint8 BytesPerPixel; + Uint8 padding[3]; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; } RLEDestFormat; /* blit a pixel-alpha RLE surface clipped at the right and/or left edges */ -static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst, - Uint8 *dstbuf, SDL_Rect *srcrect) +static void +RLEAlphaClipBlit(int w, Uint8 * srcbuf, SDL_Surface * dst, + Uint8 * dstbuf, SDL_Rect * srcrect) { SDL_PixelFormat *df = dst->format; /* @@ -1021,91 +629,91 @@ static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst, * Ctype the translucent count type, and do_blend the macro * to blend one pixel. */ -#define RLEALPHACLIPBLIT(Ptype, Ctype, do_blend) \ - do { \ - int linecount = srcrect->h; \ - int left = srcrect->x; \ - int right = left + srcrect->w; \ - dstbuf -= left * sizeof(Ptype); \ - do { \ - int ofs = 0; \ - /* blit opaque pixels on one line */ \ - do { \ - unsigned run; \ - ofs += ((Ctype *)srcbuf)[0]; \ - run = ((Ctype *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Ctype); \ - if(run) { \ - /* clip to left and right borders */ \ - int cofs = ofs; \ - int crun = run; \ - if(left - cofs > 0) { \ - crun -= left - cofs; \ - cofs = left; \ - } \ - if(crun > right - cofs) \ - crun = right - cofs; \ - if(crun > 0) \ - PIXEL_COPY(dstbuf + cofs * sizeof(Ptype), \ - srcbuf + (cofs - ofs) * sizeof(Ptype), \ - (unsigned)crun, sizeof(Ptype)); \ - srcbuf += run * sizeof(Ptype); \ - ofs += run; \ - } else if(!ofs) \ - return; \ - } while(ofs < w); \ - /* skip padding if necessary */ \ - if(sizeof(Ptype) == 2) \ - srcbuf += (uintptr_t)srcbuf & 2; \ - /* blit translucent pixels on the same line */ \ - ofs = 0; \ - do { \ - unsigned run; \ - ofs += ((Uint16 *)srcbuf)[0]; \ - run = ((Uint16 *)srcbuf)[1]; \ - srcbuf += 4; \ - if(run) { \ - /* clip to left and right borders */ \ - int cofs = ofs; \ - int crun = run; \ - if(left - cofs > 0) { \ - crun -= left - cofs; \ - cofs = left; \ - } \ - if(crun > right - cofs) \ - crun = right - cofs; \ - if(crun > 0) { \ - Ptype *dst = (Ptype *)dstbuf + cofs; \ - Uint32 *src = (Uint32 *)srcbuf + (cofs - ofs); \ - int i; \ - for(i = 0; i < crun; i++) \ - do_blend(src[i], dst[i]); \ - } \ - srcbuf += run * 4; \ - ofs += run; \ - } \ - } while(ofs < w); \ - dstbuf += dst->pitch; \ - } while(--linecount); \ +#define RLEALPHACLIPBLIT(Ptype, Ctype, do_blend) \ + do { \ + int linecount = srcrect->h; \ + int left = srcrect->x; \ + int right = left + srcrect->w; \ + dstbuf -= left * sizeof(Ptype); \ + do { \ + int ofs = 0; \ + /* blit opaque pixels on one line */ \ + do { \ + unsigned run; \ + ofs += ((Ctype *)srcbuf)[0]; \ + run = ((Ctype *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Ctype); \ + if(run) { \ + /* clip to left and right borders */ \ + int cofs = ofs; \ + int crun = run; \ + if(left - cofs > 0) { \ + crun -= left - cofs; \ + cofs = left; \ + } \ + if(crun > right - cofs) \ + crun = right - cofs; \ + if(crun > 0) \ + PIXEL_COPY(dstbuf + cofs * sizeof(Ptype), \ + srcbuf + (cofs - ofs) * sizeof(Ptype), \ + (unsigned)crun, sizeof(Ptype)); \ + srcbuf += run * sizeof(Ptype); \ + ofs += run; \ + } else if(!ofs) \ + return; \ + } while(ofs < w); \ + /* skip padding if necessary */ \ + if(sizeof(Ptype) == 2) \ + srcbuf += (uintptr_t)srcbuf & 2; \ + /* blit translucent pixels on the same line */ \ + ofs = 0; \ + do { \ + unsigned run; \ + ofs += ((Uint16 *)srcbuf)[0]; \ + run = ((Uint16 *)srcbuf)[1]; \ + srcbuf += 4; \ + if(run) { \ + /* clip to left and right borders */ \ + int cofs = ofs; \ + int crun = run; \ + if(left - cofs > 0) { \ + crun -= left - cofs; \ + cofs = left; \ + } \ + if(crun > right - cofs) \ + crun = right - cofs; \ + if(crun > 0) { \ + Ptype *dst = (Ptype *)dstbuf + cofs; \ + Uint32 *src = (Uint32 *)srcbuf + (cofs - ofs); \ + int i; \ + for(i = 0; i < crun; i++) \ + do_blend(src[i], dst[i]); \ + } \ + srcbuf += run * 4; \ + ofs += run; \ + } \ + } while(ofs < w); \ + dstbuf += dst->pitch; \ + } while(--linecount); \ } while(0) - switch(df->BytesPerPixel) { + switch (df->BytesPerPixel) { case 2: - if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0 - || df->Bmask == 0x07e0) - RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_565); - else - RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_555); - break; + if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) + RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_565); + else + RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_555); + break; case 4: - RLEALPHACLIPBLIT(Uint32, Uint16, BLIT_TRANSL_888); - break; + RLEALPHACLIPBLIT(Uint32, Uint16, BLIT_TRANSL_888); + break; } } /* blit a pixel-alpha RLE surface */ -int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect) +int +SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect) { int x, y; int w = src->w; @@ -1113,147 +721,146 @@ int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_PixelFormat *df = dst->format; /* Lock the destination if necessary */ - if ( SDL_MUSTLOCK(dst) ) { - if ( SDL_LockSurface(dst) < 0 ) { - return -1; - } + if (SDL_MUSTLOCK(dst)) { + if (SDL_LockSurface(dst) < 0) { + return -1; + } } x = dstrect->x; y = dstrect->y; - dstbuf = (Uint8 *)dst->pixels - + y * dst->pitch + x * df->BytesPerPixel; - srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat); + dstbuf = (Uint8 *) dst->pixels + y * dst->pitch + x * df->BytesPerPixel; + srcbuf = (Uint8 *) src->map->data + sizeof(RLEDestFormat); { - /* skip lines at the top if necessary */ - int vskip = srcrect->y; - if(vskip) { - int ofs; - if(df->BytesPerPixel == 2) { - /* the 16/32 interleaved format */ - do { - /* skip opaque line */ - ofs = 0; - do { - int run; - ofs += srcbuf[0]; - run = srcbuf[1]; - srcbuf += 2; - if(run) { - srcbuf += 2 * run; - ofs += run; - } else if(!ofs) - goto done; - } while(ofs < w); - - /* skip padding */ - srcbuf += (uintptr_t)srcbuf & 2; - - /* skip translucent line */ - ofs = 0; - do { - int run; - ofs += ((Uint16 *)srcbuf)[0]; - run = ((Uint16 *)srcbuf)[1]; - srcbuf += 4 * (run + 1); - ofs += run; - } while(ofs < w); - } while(--vskip); - } else { - /* the 32/32 interleaved format */ - vskip <<= 1; /* opaque and translucent have same format */ - do { - ofs = 0; - do { - int run; - ofs += ((Uint16 *)srcbuf)[0]; - run = ((Uint16 *)srcbuf)[1]; - srcbuf += 4; - if(run) { - srcbuf += 4 * run; - ofs += run; - } else if(!ofs) - goto done; - } while(ofs < w); - } while(--vskip); - } - } + /* skip lines at the top if necessary */ + int vskip = srcrect->y; + if (vskip) { + int ofs; + if (df->BytesPerPixel == 2) { + /* the 16/32 interleaved format */ + do { + /* skip opaque line */ + ofs = 0; + do { + int run; + ofs += srcbuf[0]; + run = srcbuf[1]; + srcbuf += 2; + if (run) { + srcbuf += 2 * run; + ofs += run; + } else if (!ofs) + goto done; + } while (ofs < w); + + /* skip padding */ + srcbuf += (uintptr_t) srcbuf & 2; + + /* skip translucent line */ + ofs = 0; + do { + int run; + ofs += ((Uint16 *) srcbuf)[0]; + run = ((Uint16 *) srcbuf)[1]; + srcbuf += 4 * (run + 1); + ofs += run; + } while (ofs < w); + } while (--vskip); + } else { + /* the 32/32 interleaved format */ + vskip <<= 1; /* opaque and translucent have same format */ + do { + ofs = 0; + do { + int run; + ofs += ((Uint16 *) srcbuf)[0]; + run = ((Uint16 *) srcbuf)[1]; + srcbuf += 4; + if (run) { + srcbuf += 4 * run; + ofs += run; + } else if (!ofs) + goto done; + } while (ofs < w); + } while (--vskip); + } + } } /* if left or right edge clipping needed, call clip blit */ - if(srcrect->x || srcrect->w != src->w) { - RLEAlphaClipBlit(w, srcbuf, dst, dstbuf, srcrect); + if (srcrect->x || srcrect->w != src->w) { + RLEAlphaClipBlit(w, srcbuf, dst, dstbuf, srcrect); } else { - /* - * non-clipped blitter. Ptype is the destination pixel type, - * Ctype the translucent count type, and do_blend the - * macro to blend one pixel. - */ -#define RLEALPHABLIT(Ptype, Ctype, do_blend) \ - do { \ - int linecount = srcrect->h; \ - do { \ - int ofs = 0; \ - /* blit opaque pixels on one line */ \ - do { \ - unsigned run; \ - ofs += ((Ctype *)srcbuf)[0]; \ - run = ((Ctype *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Ctype); \ - if(run) { \ - PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \ - run, sizeof(Ptype)); \ - srcbuf += run * sizeof(Ptype); \ - ofs += run; \ - } else if(!ofs) \ - goto done; \ - } while(ofs < w); \ - /* skip padding if necessary */ \ - if(sizeof(Ptype) == 2) \ - srcbuf += (uintptr_t)srcbuf & 2; \ - /* blit translucent pixels on the same line */ \ - ofs = 0; \ - do { \ - unsigned run; \ - ofs += ((Uint16 *)srcbuf)[0]; \ - run = ((Uint16 *)srcbuf)[1]; \ - srcbuf += 4; \ - if(run) { \ - Ptype *dst = (Ptype *)dstbuf + ofs; \ - unsigned i; \ - for(i = 0; i < run; i++) { \ - Uint32 src = *(Uint32 *)srcbuf; \ - do_blend(src, *dst); \ - srcbuf += 4; \ - dst++; \ - } \ - ofs += run; \ - } \ - } while(ofs < w); \ - dstbuf += dst->pitch; \ - } while(--linecount); \ - } while(0) - - switch(df->BytesPerPixel) { - case 2: - if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0 - || df->Bmask == 0x07e0) - RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_565); - else - RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_555); - break; - case 4: - RLEALPHABLIT(Uint32, Uint16, BLIT_TRANSL_888); - break; - } + /* + * non-clipped blitter. Ptype is the destination pixel type, + * Ctype the translucent count type, and do_blend the + * macro to blend one pixel. + */ +#define RLEALPHABLIT(Ptype, Ctype, do_blend) \ + do { \ + int linecount = srcrect->h; \ + do { \ + int ofs = 0; \ + /* blit opaque pixels on one line */ \ + do { \ + unsigned run; \ + ofs += ((Ctype *)srcbuf)[0]; \ + run = ((Ctype *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Ctype); \ + if(run) { \ + PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \ + run, sizeof(Ptype)); \ + srcbuf += run * sizeof(Ptype); \ + ofs += run; \ + } else if(!ofs) \ + goto done; \ + } while(ofs < w); \ + /* skip padding if necessary */ \ + if(sizeof(Ptype) == 2) \ + srcbuf += (uintptr_t)srcbuf & 2; \ + /* blit translucent pixels on the same line */ \ + ofs = 0; \ + do { \ + unsigned run; \ + ofs += ((Uint16 *)srcbuf)[0]; \ + run = ((Uint16 *)srcbuf)[1]; \ + srcbuf += 4; \ + if(run) { \ + Ptype *dst = (Ptype *)dstbuf + ofs; \ + unsigned i; \ + for(i = 0; i < run; i++) { \ + Uint32 src = *(Uint32 *)srcbuf; \ + do_blend(src, *dst); \ + srcbuf += 4; \ + dst++; \ + } \ + ofs += run; \ + } \ + } while(ofs < w); \ + dstbuf += dst->pitch; \ + } while(--linecount); \ + } while(0) + + switch (df->BytesPerPixel) { + case 2: + if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 + || df->Bmask == 0x07e0) + RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_565); + else + RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_555); + break; + case 4: + RLEALPHABLIT(Uint32, Uint16, BLIT_TRANSL_888); + break; + } } - done: + done: /* Unlock the destination if necessary */ - if ( SDL_MUSTLOCK(dst) ) { - SDL_UnlockSurface(dst); + if (SDL_MUSTLOCK(dst)) { + SDL_UnlockSurface(dst); } return 0; } @@ -1269,34 +876,36 @@ int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, */ /* encode 32bpp rgb + a into 16bpp rgb, losing alpha */ -static int copy_opaque_16(void *dst, Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) +static int +copy_opaque_16(void *dst, Uint32 * src, int n, + SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) { int i; Uint16 *d = dst; - for(i = 0; i < n; i++) { - unsigned r, g, b; - RGB_FROM_PIXEL(*src, sfmt, r, g, b); - PIXEL_FROM_RGB(*d, dfmt, r, g, b); - src++; - d++; + for (i = 0; i < n; i++) { + unsigned r, g, b; + RGB_FROM_PIXEL(*src, sfmt, r, g, b); + PIXEL_FROM_RGB(*d, dfmt, r, g, b); + src++; + d++; } return n * 2; } /* decode opaque pixels from 16bpp to 32bpp rgb + a */ -static int uncopy_opaque_16(Uint32 *dst, void *src, int n, - RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) +static int +uncopy_opaque_16(Uint32 * dst, void *src, int n, + RLEDestFormat * sfmt, SDL_PixelFormat * dfmt) { int i; Uint16 *s = src; unsigned alpha = dfmt->Amask ? 255 : 0; - for(i = 0; i < n; i++) { - unsigned r, g, b; - RGB_FROM_PIXEL(*s, sfmt, r, g, b); - PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, alpha); - s++; - dst++; + for (i = 0; i < n; i++) { + unsigned r, g, b; + RGB_FROM_PIXEL(*s, sfmt, r, g, b); + PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, alpha); + s++; + dst++; } return n * 2; } @@ -1304,100 +913,105 @@ static int uncopy_opaque_16(Uint32 *dst, void *src, int n, /* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 565 */ -static int copy_transl_565(void *dst, Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) +static int +copy_transl_565(void *dst, Uint32 * src, int n, + SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) { int i; Uint32 *d = dst; - for(i = 0; i < n; i++) { - unsigned r, g, b, a; - Uint16 pix; - RGBA_FROM_8888(*src, sfmt, r, g, b, a); - PIXEL_FROM_RGB(pix, dfmt, r, g, b); - *d = ((pix & 0x7e0) << 16) | (pix & 0xf81f) | ((a << 2) & 0x7e0); - src++; - d++; + for (i = 0; i < n; i++) { + unsigned r, g, b, a; + Uint16 pix; + RGBA_FROM_8888(*src, sfmt, r, g, b, a); + PIXEL_FROM_RGB(pix, dfmt, r, g, b); + *d = ((pix & 0x7e0) << 16) | (pix & 0xf81f) | ((a << 2) & 0x7e0); + src++; + d++; } return n * 4; } /* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 555 */ -static int copy_transl_555(void *dst, Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) +static int +copy_transl_555(void *dst, Uint32 * src, int n, + SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) { int i; Uint32 *d = dst; - for(i = 0; i < n; i++) { - unsigned r, g, b, a; - Uint16 pix; - RGBA_FROM_8888(*src, sfmt, r, g, b, a); - PIXEL_FROM_RGB(pix, dfmt, r, g, b); - *d = ((pix & 0x3e0) << 16) | (pix & 0xfc1f) | ((a << 2) & 0x3e0); - src++; - d++; + for (i = 0; i < n; i++) { + unsigned r, g, b, a; + Uint16 pix; + RGBA_FROM_8888(*src, sfmt, r, g, b, a); + PIXEL_FROM_RGB(pix, dfmt, r, g, b); + *d = ((pix & 0x3e0) << 16) | (pix & 0xfc1f) | ((a << 2) & 0x3e0); + src++; + d++; } return n * 4; } /* decode translucent pixels from 32bpp GORAB to 32bpp rgb + a */ -static int uncopy_transl_16(Uint32 *dst, void *src, int n, - RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) +static int +uncopy_transl_16(Uint32 * dst, void *src, int n, + RLEDestFormat * sfmt, SDL_PixelFormat * dfmt) { int i; Uint32 *s = src; - for(i = 0; i < n; i++) { - unsigned r, g, b, a; - Uint32 pix = *s++; - a = (pix & 0x3e0) >> 2; - pix = (pix & ~0x3e0) | pix >> 16; - RGB_FROM_PIXEL(pix, sfmt, r, g, b); - PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a); - dst++; + for (i = 0; i < n; i++) { + unsigned r, g, b, a; + Uint32 pix = *s++; + a = (pix & 0x3e0) >> 2; + pix = (pix & ~0x3e0) | pix >> 16; + RGB_FROM_PIXEL(pix, sfmt, r, g, b); + PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a); + dst++; } return n * 4; } /* encode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ -static int copy_32(void *dst, Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) +static int +copy_32(void *dst, Uint32 * src, int n, + SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) { int i; Uint32 *d = dst; - for(i = 0; i < n; i++) { - unsigned r, g, b, a; - Uint32 pixel; - RGBA_FROM_8888(*src, sfmt, r, g, b, a); - PIXEL_FROM_RGB(pixel, dfmt, r, g, b); - *d++ = pixel | a << 24; - src++; + for (i = 0; i < n; i++) { + unsigned r, g, b, a; + RGBA_FROM_8888(*src, sfmt, r, g, b, a); + PIXEL_FROM_RGBA(*d, dfmt, r, g, b, a); + d++; + src++; } return n * 4; } /* decode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ -static int uncopy_32(Uint32 *dst, void *src, int n, - RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) +static int +uncopy_32(Uint32 * dst, void *src, int n, + RLEDestFormat * sfmt, SDL_PixelFormat * dfmt) { int i; Uint32 *s = src; - for(i = 0; i < n; i++) { - unsigned r, g, b, a; - Uint32 pixel = *s++; - RGB_FROM_PIXEL(pixel, sfmt, r, g, b); - a = pixel >> 24; - PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a); - dst++; + for (i = 0; i < n; i++) { + unsigned r, g, b, a; + Uint32 pixel = *s++; + RGB_FROM_PIXEL(pixel, sfmt, r, g, b); + a = pixel >> 24; + PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a); + dst++; } return n * 4; } #define ISOPAQUE(pixel, fmt) ((((pixel) & fmt->Amask) >> fmt->Ashift) == 255) -#define ISTRANSL(pixel, fmt) \ +#define ISTRANSL(pixel, fmt) \ ((unsigned)((((pixel) & fmt->Amask) >> fmt->Ashift) - 1U) < 254U) /* convert surface to be quickly alpha-blittable onto dest, if possible */ -static int RLEAlphaSurface(SDL_Surface *surface) +static int +RLEAlphaSurface(SDL_Surface * surface) { SDL_Surface *dest; SDL_PixelFormat *df; @@ -1406,221 +1020,223 @@ static int RLEAlphaSurface(SDL_Surface *surface) int max_transl_run = 65535; unsigned masksum; Uint8 *rlebuf, *dst; - int (*copy_opaque)(void *, Uint32 *, int, - SDL_PixelFormat *, SDL_PixelFormat *); - int (*copy_transl)(void *, Uint32 *, int, - SDL_PixelFormat *, SDL_PixelFormat *); + int (*copy_opaque) (void *, Uint32 *, int, + SDL_PixelFormat *, SDL_PixelFormat *); + int (*copy_transl) (void *, Uint32 *, int, + SDL_PixelFormat *, SDL_PixelFormat *); dest = surface->map->dst; - if(!dest) - return -1; + if (!dest) + return -1; df = dest->format; - if(surface->format->BitsPerPixel != 32) - return -1; /* only 32bpp source supported */ + if (surface->format->BitsPerPixel != 32) + return -1; /* only 32bpp source supported */ /* find out whether the destination is one we support, and determine the max size of the encoded result */ masksum = df->Rmask | df->Gmask | df->Bmask; - switch(df->BytesPerPixel) { + switch (df->BytesPerPixel) { case 2: - /* 16bpp: only support 565 and 555 formats */ - switch(masksum) { - case 0xffff: - if(df->Gmask == 0x07e0 - || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) { - copy_opaque = copy_opaque_16; - copy_transl = copy_transl_565; - } else - return -1; - break; - case 0x7fff: - if(df->Gmask == 0x03e0 - || df->Rmask == 0x03e0 || df->Bmask == 0x03e0) { - copy_opaque = copy_opaque_16; - copy_transl = copy_transl_555; - } else - return -1; - break; - default: - return -1; - } - max_opaque_run = 255; /* runs stored as bytes */ - - /* worst case is alternating opaque and translucent pixels, - with room for alignment padding between lines */ - maxsize = surface->h * (2 + (4 + 2) * (surface->w + 1)) + 2; - break; + /* 16bpp: only support 565 and 555 formats */ + switch (masksum) { + case 0xffff: + if (df->Gmask == 0x07e0 + || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) { + copy_opaque = copy_opaque_16; + copy_transl = copy_transl_565; + } else + return -1; + break; + case 0x7fff: + if (df->Gmask == 0x03e0 + || df->Rmask == 0x03e0 || df->Bmask == 0x03e0) { + copy_opaque = copy_opaque_16; + copy_transl = copy_transl_555; + } else + return -1; + break; + default: + return -1; + } + max_opaque_run = 255; /* runs stored as bytes */ + + /* worst case is alternating opaque and translucent pixels, + with room for alignment padding between lines */ + maxsize = surface->h * (2 + (4 + 2) * (surface->w + 1)) + 2; + break; case 4: - if(masksum != 0x00ffffff) - return -1; /* requires unused high byte */ - copy_opaque = copy_32; - copy_transl = copy_32; - max_opaque_run = 255; /* runs stored as short ints */ - - /* worst case is alternating opaque and translucent pixels */ - maxsize = surface->h * 2 * 4 * (surface->w + 1) + 4; - break; + if (masksum != 0x00ffffff) + return -1; /* requires unused high byte */ + copy_opaque = copy_32; + copy_transl = copy_32; + max_opaque_run = 255; /* runs stored as short ints */ + + /* worst case is alternating opaque and translucent pixels */ + maxsize = surface->h * 2 * 4 * (surface->w + 1) + 4; + break; default: - return -1; /* anything else unsupported right now */ + return -1; /* anything else unsupported right now */ } maxsize += sizeof(RLEDestFormat); - rlebuf = (Uint8 *)SDL_malloc(maxsize); - if(!rlebuf) { - SDL_OutOfMemory(); - return -1; + rlebuf = (Uint8 *) SDL_malloc(maxsize); + if (!rlebuf) { + return SDL_OutOfMemory(); } { - /* save the destination format so we can undo the encoding later */ - RLEDestFormat *r = (RLEDestFormat *)rlebuf; - r->BytesPerPixel = df->BytesPerPixel; - r->Rloss = df->Rloss; - r->Gloss = df->Gloss; - r->Bloss = df->Bloss; - r->Rshift = df->Rshift; - r->Gshift = df->Gshift; - r->Bshift = df->Bshift; - r->Ashift = df->Ashift; - r->Rmask = df->Rmask; - r->Gmask = df->Gmask; - r->Bmask = df->Bmask; - r->Amask = df->Amask; + /* save the destination format so we can undo the encoding later */ + RLEDestFormat *r = (RLEDestFormat *) rlebuf; + r->BytesPerPixel = df->BytesPerPixel; + r->Rmask = df->Rmask; + r->Gmask = df->Gmask; + r->Bmask = df->Bmask; + r->Amask = df->Amask; + r->Rloss = df->Rloss; + r->Gloss = df->Gloss; + r->Bloss = df->Bloss; + r->Aloss = df->Aloss; + r->Rshift = df->Rshift; + r->Gshift = df->Gshift; + r->Bshift = df->Bshift; + r->Ashift = df->Ashift; } dst = rlebuf + sizeof(RLEDestFormat); /* Do the actual encoding */ { - int x, y; - int h = surface->h, w = surface->w; - SDL_PixelFormat *sf = surface->format; - Uint32 *src = (Uint32 *)surface->pixels; - Uint8 *lastline = dst; /* end of last non-blank line */ - - /* opaque counts are 8 or 16 bits, depending on target depth */ -#define ADD_OPAQUE_COUNTS(n, m) \ - if(df->BytesPerPixel == 4) { \ - ((Uint16 *)dst)[0] = n; \ - ((Uint16 *)dst)[1] = m; \ - dst += 4; \ - } else { \ - dst[0] = n; \ - dst[1] = m; \ - dst += 2; \ - } - - /* translucent counts are always 16 bit */ -#define ADD_TRANSL_COUNTS(n, m) \ - (((Uint16 *)dst)[0] = n, ((Uint16 *)dst)[1] = m, dst += 4) - - for(y = 0; y < h; y++) { - int runstart, skipstart; - int blankline = 0; - /* First encode all opaque pixels of a scan line */ - x = 0; - do { - int run, skip, len; - skipstart = x; - while(x < w && !ISOPAQUE(src[x], sf)) - x++; - runstart = x; - while(x < w && ISOPAQUE(src[x], sf)) - x++; - skip = runstart - skipstart; - if(skip == w) - blankline = 1; - run = x - runstart; - while(skip > max_opaque_run) { - ADD_OPAQUE_COUNTS(max_opaque_run, 0); - skip -= max_opaque_run; - } - len = MIN(run, max_opaque_run); - ADD_OPAQUE_COUNTS(skip, len); - dst += copy_opaque(dst, src + runstart, len, sf, df); - runstart += len; - run -= len; - while(run) { - len = MIN(run, max_opaque_run); - ADD_OPAQUE_COUNTS(0, len); - dst += copy_opaque(dst, src + runstart, len, sf, df); - runstart += len; - run -= len; - } - } while(x < w); - - /* Make sure the next output address is 32-bit aligned */ - dst += (uintptr_t)dst & 2; - - /* Next, encode all translucent pixels of the same scan line */ - x = 0; - do { - int run, skip, len; - skipstart = x; - while(x < w && !ISTRANSL(src[x], sf)) - x++; - runstart = x; - while(x < w && ISTRANSL(src[x], sf)) - x++; - skip = runstart - skipstart; - blankline &= (skip == w); - run = x - runstart; - while(skip > max_transl_run) { - ADD_TRANSL_COUNTS(max_transl_run, 0); - skip -= max_transl_run; - } - len = MIN(run, max_transl_run); - ADD_TRANSL_COUNTS(skip, len); - dst += copy_transl(dst, src + runstart, len, sf, df); - runstart += len; - run -= len; - while(run) { - len = MIN(run, max_transl_run); - ADD_TRANSL_COUNTS(0, len); - dst += copy_transl(dst, src + runstart, len, sf, df); - runstart += len; - run -= len; - } - if(!blankline) - lastline = dst; - } while(x < w); - - src += surface->pitch >> 2; - } - dst = lastline; /* back up past trailing blank lines */ - ADD_OPAQUE_COUNTS(0, 0); + int x, y; + int h = surface->h, w = surface->w; + SDL_PixelFormat *sf = surface->format; + Uint32 *src = (Uint32 *) surface->pixels; + Uint8 *lastline = dst; /* end of last non-blank line */ + + /* opaque counts are 8 or 16 bits, depending on target depth */ +#define ADD_OPAQUE_COUNTS(n, m) \ + if(df->BytesPerPixel == 4) { \ + ((Uint16 *)dst)[0] = n; \ + ((Uint16 *)dst)[1] = m; \ + dst += 4; \ + } else { \ + dst[0] = n; \ + dst[1] = m; \ + dst += 2; \ + } + + /* translucent counts are always 16 bit */ +#define ADD_TRANSL_COUNTS(n, m) \ + (((Uint16 *)dst)[0] = n, ((Uint16 *)dst)[1] = m, dst += 4) + + for (y = 0; y < h; y++) { + int runstart, skipstart; + int blankline = 0; + /* First encode all opaque pixels of a scan line */ + x = 0; + do { + int run, skip, len; + skipstart = x; + while (x < w && !ISOPAQUE(src[x], sf)) + x++; + runstart = x; + while (x < w && ISOPAQUE(src[x], sf)) + x++; + skip = runstart - skipstart; + if (skip == w) + blankline = 1; + run = x - runstart; + while (skip > max_opaque_run) { + ADD_OPAQUE_COUNTS(max_opaque_run, 0); + skip -= max_opaque_run; + } + len = MIN(run, max_opaque_run); + ADD_OPAQUE_COUNTS(skip, len); + dst += copy_opaque(dst, src + runstart, len, sf, df); + runstart += len; + run -= len; + while (run) { + len = MIN(run, max_opaque_run); + ADD_OPAQUE_COUNTS(0, len); + dst += copy_opaque(dst, src + runstart, len, sf, df); + runstart += len; + run -= len; + } + } while (x < w); + + /* Make sure the next output address is 32-bit aligned */ + dst += (uintptr_t) dst & 2; + + /* Next, encode all translucent pixels of the same scan line */ + x = 0; + do { + int run, skip, len; + skipstart = x; + while (x < w && !ISTRANSL(src[x], sf)) + x++; + runstart = x; + while (x < w && ISTRANSL(src[x], sf)) + x++; + skip = runstart - skipstart; + blankline &= (skip == w); + run = x - runstart; + while (skip > max_transl_run) { + ADD_TRANSL_COUNTS(max_transl_run, 0); + skip -= max_transl_run; + } + len = MIN(run, max_transl_run); + ADD_TRANSL_COUNTS(skip, len); + dst += copy_transl(dst, src + runstart, len, sf, df); + runstart += len; + run -= len; + while (run) { + len = MIN(run, max_transl_run); + ADD_TRANSL_COUNTS(0, len); + dst += copy_transl(dst, src + runstart, len, sf, df); + runstart += len; + run -= len; + } + if (!blankline) + lastline = dst; + } while (x < w); + + src += surface->pitch >> 2; + } + dst = lastline; /* back up past trailing blank lines */ + ADD_OPAQUE_COUNTS(0, 0); } #undef ADD_OPAQUE_COUNTS #undef ADD_TRANSL_COUNTS /* Now that we have it encoded, release the original pixels */ - if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC - && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { - SDL_free( surface->pixels ); - surface->pixels = NULL; + if (!(surface->flags & SDL_PREALLOC)) { + SDL_free(surface->pixels); + surface->pixels = NULL; } /* realloc the buffer to release unused memory */ { - Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); - if(!p) - p = rlebuf; - surface->map->sw_data->aux_data = p; + Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); + if (!p) + p = rlebuf; + surface->map->data = p; } return 0; } -static Uint32 getpix_8(Uint8 *srcbuf) +static Uint32 +getpix_8(Uint8 * srcbuf) { return *srcbuf; } -static Uint32 getpix_16(Uint8 *srcbuf) +static Uint32 +getpix_16(Uint8 * srcbuf) { - return *(Uint16 *)srcbuf; + return *(Uint16 *) srcbuf; } -static Uint32 getpix_24(Uint8 *srcbuf) +static Uint32 +getpix_24(Uint8 * srcbuf) { #if SDL_BYTEORDER == SDL_LIL_ENDIAN return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16); @@ -1629,313 +1245,324 @@ static Uint32 getpix_24(Uint8 *srcbuf) #endif } -static Uint32 getpix_32(Uint8 *srcbuf) +static Uint32 +getpix_32(Uint8 * srcbuf) { - return *(Uint32 *)srcbuf; + return *(Uint32 *) srcbuf; } -typedef Uint32 (*getpix_func)(Uint8 *); +typedef Uint32(*getpix_func) (Uint8 *); -static getpix_func getpixes[4] = { +static const getpix_func getpixes[4] = { getpix_8, getpix_16, getpix_24, getpix_32 }; -static int RLEColorkeySurface(SDL_Surface *surface) +static int +RLEColorkeySurface(SDL_Surface * surface) { - Uint8 *rlebuf, *dst; - int maxn; - int y; - Uint8 *srcbuf, *lastline; - int maxsize = 0; - int bpp = surface->format->BytesPerPixel; - getpix_func getpix; - Uint32 ckey, rgbmask; - int w, h; - - /* calculate the worst case size for the compressed surface */ - switch(bpp) { - case 1: - /* worst case is alternating opaque and transparent pixels, - starting with an opaque pixel */ - maxsize = surface->h * 3 * (surface->w / 2 + 1) + 2; - break; - case 2: - case 3: - /* worst case is solid runs, at most 255 pixels wide */ - maxsize = surface->h * (2 * (surface->w / 255 + 1) - + surface->w * bpp) + 2; - break; - case 4: - /* worst case is solid runs, at most 65535 pixels wide */ - maxsize = surface->h * (4 * (surface->w / 65535 + 1) - + surface->w * 4) + 4; - break; - } - - rlebuf = (Uint8 *)SDL_malloc(maxsize); - if ( rlebuf == NULL ) { - SDL_OutOfMemory(); - return(-1); - } - - /* Set up the conversion */ - srcbuf = (Uint8 *)surface->pixels; - maxn = bpp == 4 ? 65535 : 255; - dst = rlebuf; - rgbmask = ~surface->format->Amask; - ckey = surface->format->colorkey & rgbmask; - lastline = dst; - getpix = getpixes[bpp - 1]; - w = surface->w; - h = surface->h; - -#define ADD_COUNTS(n, m) \ - if(bpp == 4) { \ - ((Uint16 *)dst)[0] = n; \ - ((Uint16 *)dst)[1] = m; \ - dst += 4; \ - } else { \ - dst[0] = n; \ - dst[1] = m; \ - dst += 2; \ - } - - for(y = 0; y < h; y++) { - int x = 0; - int blankline = 0; - do { - int run, skip, len; - int runstart; - int skipstart = x; - - /* find run of transparent, then opaque pixels */ - while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey) - x++; - runstart = x; - while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey) - x++; - skip = runstart - skipstart; - if(skip == w) - blankline = 1; - run = x - runstart; - - /* encode segment */ - while(skip > maxn) { - ADD_COUNTS(maxn, 0); - skip -= maxn; - } - len = MIN(run, maxn); - ADD_COUNTS(skip, len); - SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); - dst += len * bpp; - run -= len; - runstart += len; - while(run) { - len = MIN(run, maxn); - ADD_COUNTS(0, len); - SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); - dst += len * bpp; - runstart += len; - run -= len; - } - if(!blankline) - lastline = dst; - } while(x < w); - - srcbuf += surface->pitch; - } - dst = lastline; /* back up bast trailing blank lines */ - ADD_COUNTS(0, 0); + Uint8 *rlebuf, *dst; + int maxn; + int y; + Uint8 *srcbuf, *lastline; + int maxsize = 0; + int bpp = surface->format->BytesPerPixel; + getpix_func getpix; + Uint32 ckey, rgbmask; + int w, h; + + /* calculate the worst case size for the compressed surface */ + switch (bpp) { + case 1: + /* worst case is alternating opaque and transparent pixels, + starting with an opaque pixel */ + maxsize = surface->h * 3 * (surface->w / 2 + 1) + 2; + break; + case 2: + case 3: + /* worst case is solid runs, at most 255 pixels wide */ + maxsize = surface->h * (2 * (surface->w / 255 + 1) + + surface->w * bpp) + 2; + break; + case 4: + /* worst case is solid runs, at most 65535 pixels wide */ + maxsize = surface->h * (4 * (surface->w / 65535 + 1) + + surface->w * 4) + 4; + break; + } + + rlebuf = (Uint8 *) SDL_malloc(maxsize); + if (rlebuf == NULL) { + return SDL_OutOfMemory(); + } + + /* Set up the conversion */ + srcbuf = (Uint8 *) surface->pixels; + maxn = bpp == 4 ? 65535 : 255; + dst = rlebuf; + rgbmask = ~surface->format->Amask; + ckey = surface->map->info.colorkey & rgbmask; + lastline = dst; + getpix = getpixes[bpp - 1]; + w = surface->w; + h = surface->h; + +#define ADD_COUNTS(n, m) \ + if(bpp == 4) { \ + ((Uint16 *)dst)[0] = n; \ + ((Uint16 *)dst)[1] = m; \ + dst += 4; \ + } else { \ + dst[0] = n; \ + dst[1] = m; \ + dst += 2; \ + } + + for (y = 0; y < h; y++) { + int x = 0; + int blankline = 0; + do { + int run, skip, len; + int runstart; + int skipstart = x; + + /* find run of transparent, then opaque pixels */ + while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey) + x++; + runstart = x; + while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey) + x++; + skip = runstart - skipstart; + if (skip == w) + blankline = 1; + run = x - runstart; + + /* encode segment */ + while (skip > maxn) { + ADD_COUNTS(maxn, 0); + skip -= maxn; + } + len = MIN(run, maxn); + ADD_COUNTS(skip, len); + SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); + dst += len * bpp; + run -= len; + runstart += len; + while (run) { + len = MIN(run, maxn); + ADD_COUNTS(0, len); + SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); + dst += len * bpp; + runstart += len; + run -= len; + } + if (!blankline) + lastline = dst; + } while (x < w); + + srcbuf += surface->pitch; + } + dst = lastline; /* back up bast trailing blank lines */ + ADD_COUNTS(0, 0); #undef ADD_COUNTS - /* Now that we have it encoded, release the original pixels */ - if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC - && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { - SDL_free( surface->pixels ); - surface->pixels = NULL; - } - - /* realloc the buffer to release unused memory */ - { - /* If realloc returns NULL, the original block is left intact */ - Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); - if(!p) - p = rlebuf; - surface->map->sw_data->aux_data = p; - } - - return(0); + /* Now that we have it encoded, release the original pixels */ + if (!(surface->flags & SDL_PREALLOC)) { + SDL_free(surface->pixels); + surface->pixels = NULL; + } + + /* realloc the buffer to release unused memory */ + { + /* If realloc returns NULL, the original block is left intact */ + Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); + if (!p) + p = rlebuf; + surface->map->data = p; + } + + return (0); } -int SDL_RLESurface(SDL_Surface *surface) +int +SDL_RLESurface(SDL_Surface * surface) { - int retcode; - - /* Clear any previous RLE conversion */ - if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - SDL_UnRLESurface(surface, 1); - } - - /* We don't support RLE encoding of bitmaps */ - if ( surface->format->BitsPerPixel < 8 ) { - return(-1); - } - - /* Lock the surface if it's in hardware */ - if ( SDL_MUSTLOCK(surface) ) { - if ( SDL_LockSurface(surface) < 0 ) { - return(-1); - } - } - - /* Encode */ - if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { - retcode = RLEColorkeySurface(surface); - } else { - if((surface->flags & SDL_SRCALPHA) == SDL_SRCALPHA - && surface->format->Amask != 0) - retcode = RLEAlphaSurface(surface); - else - retcode = -1; /* no RLE for per-surface alpha sans ckey */ - } - - /* Unlock the surface if it's in hardware */ - if ( SDL_MUSTLOCK(surface) ) { - SDL_UnlockSurface(surface); - } - - if(retcode < 0) - return -1; - - /* The surface is now accelerated */ - surface->flags |= SDL_RLEACCEL; - - return(0); + int flags; + + /* Clear any previous RLE conversion */ + if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { + SDL_UnRLESurface(surface, 1); + } + + /* We don't support RLE encoding of bitmaps */ + if (surface->format->BitsPerPixel < 8) { + return -1; + } + + /* Make sure the pixels are available */ + if (!surface->pixels) { + return -1; + } + + /* If we don't have colorkey or blending, nothing to do... */ + flags = surface->map->info.flags; + if (!(flags & (SDL_COPY_COLORKEY | SDL_COPY_BLEND))) { + return -1; + } + + /* Pass on combinations not supported */ + if ((flags & SDL_COPY_MODULATE_COLOR) || + ((flags & SDL_COPY_MODULATE_ALPHA) && surface->format->Amask) || + (flags & (SDL_COPY_ADD | SDL_COPY_MOD)) || + (flags & SDL_COPY_NEAREST)) { + return -1; + } + + /* Encode and set up the blit */ + if (!surface->format->Amask || !(flags & SDL_COPY_BLEND)) { + if (!surface->map->identity) { + return -1; + } + if (RLEColorkeySurface(surface) < 0) { + return -1; + } + surface->map->blit = SDL_RLEBlit; + surface->map->info.flags |= SDL_COPY_RLE_COLORKEY; + } else { + if (RLEAlphaSurface(surface) < 0) { + return -1; + } + surface->map->blit = SDL_RLEAlphaBlit; + surface->map->info.flags |= SDL_COPY_RLE_ALPHAKEY; + } + + /* The surface is now accelerated */ + surface->flags |= SDL_RLEACCEL; + + return (0); } /* * Un-RLE a surface with pixel alpha * This may not give back exactly the image before RLE-encoding; all - * completely transparent pixels will be lost, and colour and alpha depth + * completely transparent pixels will be lost, and color and alpha depth * may have been reduced (when encoding for 16bpp targets). */ -static SDL_bool UnRLEAlpha(SDL_Surface *surface) +static SDL_bool +UnRLEAlpha(SDL_Surface * surface) { Uint8 *srcbuf; Uint32 *dst; SDL_PixelFormat *sf = surface->format; - RLEDestFormat *df = surface->map->sw_data->aux_data; - int (*uncopy_opaque)(Uint32 *, void *, int, - RLEDestFormat *, SDL_PixelFormat *); - int (*uncopy_transl)(Uint32 *, void *, int, - RLEDestFormat *, SDL_PixelFormat *); + RLEDestFormat *df = surface->map->data; + int (*uncopy_opaque) (Uint32 *, void *, int, + RLEDestFormat *, SDL_PixelFormat *); + int (*uncopy_transl) (Uint32 *, void *, int, + RLEDestFormat *, SDL_PixelFormat *); int w = surface->w; int bpp = df->BytesPerPixel; - if(bpp == 2) { - uncopy_opaque = uncopy_opaque_16; - uncopy_transl = uncopy_transl_16; + if (bpp == 2) { + uncopy_opaque = uncopy_opaque_16; + uncopy_transl = uncopy_transl_16; } else { - uncopy_opaque = uncopy_transl = uncopy_32; + uncopy_opaque = uncopy_transl = uncopy_32; } surface->pixels = SDL_malloc(surface->h * surface->pitch); - if ( !surface->pixels ) { - return(SDL_FALSE); + if (!surface->pixels) { + return (SDL_FALSE); } /* fill background with transparent pixels */ SDL_memset(surface->pixels, 0, surface->h * surface->pitch); dst = surface->pixels; - srcbuf = (Uint8 *)(df + 1); - for(;;) { - /* copy opaque pixels */ - int ofs = 0; - do { - unsigned run; - if(bpp == 2) { - ofs += srcbuf[0]; - run = srcbuf[1]; - srcbuf += 2; - } else { - ofs += ((Uint16 *)srcbuf)[0]; - run = ((Uint16 *)srcbuf)[1]; - srcbuf += 4; - } - if(run) { - srcbuf += uncopy_opaque(dst + ofs, srcbuf, run, df, sf); - ofs += run; - } else if(!ofs) - return(SDL_TRUE); - } while(ofs < w); - - /* skip padding if needed */ - if(bpp == 2) - srcbuf += (uintptr_t)srcbuf & 2; - - /* copy translucent pixels */ - ofs = 0; - do { - unsigned run; - ofs += ((Uint16 *)srcbuf)[0]; - run = ((Uint16 *)srcbuf)[1]; - srcbuf += 4; - if(run) { - srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf); - ofs += run; - } - } while(ofs < w); - dst += surface->pitch >> 2; + srcbuf = (Uint8 *) (df + 1); + for (;;) { + /* copy opaque pixels */ + int ofs = 0; + do { + unsigned run; + if (bpp == 2) { + ofs += srcbuf[0]; + run = srcbuf[1]; + srcbuf += 2; + } else { + ofs += ((Uint16 *) srcbuf)[0]; + run = ((Uint16 *) srcbuf)[1]; + srcbuf += 4; + } + if (run) { + srcbuf += uncopy_opaque(dst + ofs, srcbuf, run, df, sf); + ofs += run; + } else if (!ofs) + return (SDL_TRUE); + } while (ofs < w); + + /* skip padding if needed */ + if (bpp == 2) + srcbuf += (uintptr_t) srcbuf & 2; + + /* copy translucent pixels */ + ofs = 0; + do { + unsigned run; + ofs += ((Uint16 *) srcbuf)[0]; + run = ((Uint16 *) srcbuf)[1]; + srcbuf += 4; + if (run) { + srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf); + ofs += run; + } + } while (ofs < w); + dst += surface->pitch >> 2; } /* Make the compiler happy */ - return(SDL_TRUE); + return (SDL_TRUE); } -void SDL_UnRLESurface(SDL_Surface *surface, int recode) +void +SDL_UnRLESurface(SDL_Surface * surface, int recode) { - if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - surface->flags &= ~SDL_RLEACCEL; - - if(recode && (surface->flags & SDL_PREALLOC) != SDL_PREALLOC - && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) { - if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { - SDL_Rect full; - unsigned alpha_flag; - - /* re-create the original surface */ - surface->pixels = SDL_malloc(surface->h * surface->pitch); - if ( !surface->pixels ) { - /* Oh crap... */ - surface->flags |= SDL_RLEACCEL; - return; - } - - /* fill it with the background colour */ - SDL_FillRect(surface, NULL, surface->format->colorkey); - - /* now render the encoded surface */ - full.x = full.y = 0; - full.w = surface->w; - full.h = surface->h; - alpha_flag = surface->flags & SDL_SRCALPHA; - surface->flags &= ~SDL_SRCALPHA; /* opaque blit */ - SDL_RLEBlit(surface, &full, surface, &full); - surface->flags |= alpha_flag; - } else { - if ( !UnRLEAlpha(surface) ) { - /* Oh crap... */ - surface->flags |= SDL_RLEACCEL; - return; - } - } - } - - if ( surface->map && surface->map->sw_data->aux_data ) { - SDL_free(surface->map->sw_data->aux_data); - surface->map->sw_data->aux_data = NULL; - } + if (surface->flags & SDL_RLEACCEL) { + surface->flags &= ~SDL_RLEACCEL; + + if (recode && !(surface->flags & SDL_PREALLOC)) { + if (surface->map->info.flags & SDL_COPY_RLE_COLORKEY) { + SDL_Rect full; + + /* re-create the original surface */ + surface->pixels = SDL_malloc(surface->h * surface->pitch); + if (!surface->pixels) { + /* Oh crap... */ + surface->flags |= SDL_RLEACCEL; + return; + } + + /* fill it with the background color */ + SDL_FillRect(surface, NULL, surface->map->info.colorkey); + + /* now render the encoded surface */ + full.x = full.y = 0; + full.w = surface->w; + full.h = surface->h; + SDL_RLEBlit(surface, &full, surface, &full); + } else { + if (!UnRLEAlpha(surface)) { + /* Oh crap... */ + surface->flags |= SDL_RLEACCEL; + return; + } + } + } + surface->map->info.flags &= + ~(SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY); + + if (surface->map->data) { + SDL_free(surface->map->data); + surface->map->data = NULL; + } } } - +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_RLEaccel_c.h b/src/video/SDL_RLEaccel_c.h index daf0c53f2d..986d114886 100644 --- a/src/video/SDL_RLEaccel_c.h +++ b/src/video/SDL_RLEaccel_c.h @@ -1,31 +1,31 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* Useful functions and variables from SDL_RLEaccel.c */ -extern int SDL_RLESurface(SDL_Surface *surface); -extern int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); -extern int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); -extern void SDL_UnRLESurface(SDL_Surface *surface, int recode); +extern int SDL_RLESurface(SDL_Surface * surface); +extern int SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); +extern int SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); +extern void SDL_UnRLESurface(SDL_Surface * surface, int recode); +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index e3f194aee4..7b4f9edc9b 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -1,360 +1,286 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #include "SDL_video.h" #include "SDL_sysvideo.h" #include "SDL_blit.h" +#include "SDL_blit_auto.h" +#include "SDL_blit_copy.h" +#include "SDL_blit_slow.h" #include "SDL_RLEaccel_c.h" #include "SDL_pixels_c.h" -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES -#define MMX_ASMBLIT -#if (__GNUC__ > 2) /* SSE instructions aren't in GCC 2. */ -#define SSE_ASMBLIT -#endif -#endif - -#if defined(MMX_ASMBLIT) -#include "SDL_cpuinfo.h" -#include "mmx.h" -#endif - /* The general purpose software blit routine */ -static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect) +static int +SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect) { - int okay; - int src_locked; - int dst_locked; - - /* Everything is okay at the beginning... */ - okay = 1; - - /* Lock the destination if it's in hardware */ - dst_locked = 0; - if ( SDL_MUSTLOCK(dst) ) { - if ( SDL_LockSurface(dst) < 0 ) { - okay = 0; - } else { - dst_locked = 1; - } - } - /* Lock the source if it's in hardware */ - src_locked = 0; - if ( SDL_MUSTLOCK(src) ) { - if ( SDL_LockSurface(src) < 0 ) { - okay = 0; - } else { - src_locked = 1; - } - } - - /* Set up source and destination buffer pointers, and BLIT! */ - if ( okay && srcrect->w && srcrect->h ) { - SDL_BlitInfo info; - SDL_loblit RunBlit; - - /* Set up the blit information */ - info.s_pixels = (Uint8 *)src->pixels + - (Uint16)srcrect->y*src->pitch + - (Uint16)srcrect->x*src->format->BytesPerPixel; - info.s_width = srcrect->w; - info.s_height = srcrect->h; - info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel; - info.d_pixels = (Uint8 *)dst->pixels + - (Uint16)dstrect->y*dst->pitch + - (Uint16)dstrect->x*dst->format->BytesPerPixel; - info.d_width = dstrect->w; - info.d_height = dstrect->h; - info.d_skip=dst->pitch-info.d_width*dst->format->BytesPerPixel; - info.aux_data = src->map->sw_data->aux_data; - info.src = src->format; - info.table = src->map->table; - info.dst = dst->format; - RunBlit = src->map->sw_data->blit; - - /* Run the actual software blit */ - RunBlit(&info); - } - - /* We need to unlock the surfaces if they're locked */ - if ( dst_locked ) { - SDL_UnlockSurface(dst); - } - if ( src_locked ) { - SDL_UnlockSurface(src); - } - /* Blit is done! */ - return(okay ? 0 : -1); + int okay; + int src_locked; + int dst_locked; + + /* Everything is okay at the beginning... */ + okay = 1; + + /* Lock the destination if it's in hardware */ + dst_locked = 0; + if (SDL_MUSTLOCK(dst)) { + if (SDL_LockSurface(dst) < 0) { + okay = 0; + } else { + dst_locked = 1; + } + } + /* Lock the source if it's in hardware */ + src_locked = 0; + if (SDL_MUSTLOCK(src)) { + if (SDL_LockSurface(src) < 0) { + okay = 0; + } else { + src_locked = 1; + } + } + + /* Set up source and destination buffer pointers, and BLIT! */ + if (okay && !SDL_RectEmpty(srcrect)) { + SDL_BlitFunc RunBlit; + SDL_BlitInfo *info = &src->map->info; + + /* Set up the blit information */ + info->src = (Uint8 *) src->pixels + + (Uint16) srcrect->y * src->pitch + + (Uint16) srcrect->x * info->src_fmt->BytesPerPixel; + info->src_w = srcrect->w; + info->src_h = srcrect->h; + info->src_pitch = src->pitch; + info->src_skip = + info->src_pitch - info->src_w * info->src_fmt->BytesPerPixel; + info->dst = + (Uint8 *) dst->pixels + (Uint16) dstrect->y * dst->pitch + + (Uint16) dstrect->x * info->dst_fmt->BytesPerPixel; + info->dst_w = dstrect->w; + info->dst_h = dstrect->h; + info->dst_pitch = dst->pitch; + info->dst_skip = + info->dst_pitch - info->dst_w * info->dst_fmt->BytesPerPixel; + RunBlit = (SDL_BlitFunc) src->map->data; + + /* Run the actual software blit */ + RunBlit(info); + } + + /* We need to unlock the surfaces if they're locked */ + if (dst_locked) { + SDL_UnlockSurface(dst); + } + if (src_locked) { + SDL_UnlockSurface(src); + } + /* Blit is done! */ + return (okay ? 0 : -1); } -#ifdef MMX_ASMBLIT -static __inline__ void SDL_memcpyMMX(Uint8 *to, const Uint8 *from, int len) -{ - int i; - - for(i=0; i -#ifdef SSE_ASMBLIT -static __inline__ void SDL_memcpySSE(Uint8 *to, const Uint8 *from, int len) +static SDL_bool +SDL_UseAltivecPrefetch() { - int i; - - __asm__ __volatile__ ( - " prefetchnta (%0)\n" - " prefetchnta 64(%0)\n" - " prefetchnta 128(%0)\n" - " prefetchnta 192(%0)\n" - : : "r" (from) ); - - for(i=0; i 0) { + return SDL_TRUE; + } else { + return SDL_FALSE; + } } -#endif -#endif - -static void SDL_BlitCopy(SDL_BlitInfo *info) +#else +static SDL_bool +SDL_UseAltivecPrefetch() { - Uint8 *src, *dst; - int w, h; - int srcskip, dstskip; - - w = info->d_width*info->dst->BytesPerPixel; - h = info->d_height; - src = info->s_pixels; - dst = info->d_pixels; - srcskip = w+info->s_skip; - dstskip = w+info->d_skip; - -#ifdef SSE_ASMBLIT - if(SDL_HasSSE()) - { - while ( h-- ) { - SDL_memcpySSE(dst, src, w); - src += srcskip; - dst += dstskip; - } - __asm__ __volatile__ ( - " emms\n" - ::); - } - else -#endif -#ifdef MMX_ASMBLIT - if(SDL_HasMMX()) - { - while ( h-- ) { - SDL_memcpyMMX(dst, src, w); - src += srcskip; - dst += dstskip; - } - __asm__ __volatile__ ( - " emms\n" - ::); - } - else -#endif - while ( h-- ) { - SDL_memcpy(dst, src, w); - src += srcskip; - dst += dstskip; - } + /* Just guess G4 */ + return SDL_TRUE; } +#endif /* __MACOSX__ */ -static void SDL_BlitCopyOverlap(SDL_BlitInfo *info) +static SDL_BlitFunc +SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, + SDL_BlitFuncEntry * entries) { - Uint8 *src, *dst; - int w, h; - int srcskip, dstskip; - - w = info->d_width*info->dst->BytesPerPixel; - h = info->d_height; - src = info->s_pixels; - dst = info->d_pixels; - srcskip = w+info->s_skip; - dstskip = w+info->d_skip; - if ( dst < src ) { - while ( h-- ) { - SDL_memmove(dst, src, w); - src += srcskip; - dst += dstskip; - } - } else { - src += ((h-1) * srcskip); - dst += ((h-1) * dstskip); - while ( h-- ) { - SDL_revcpy(dst, src, w); - src -= srcskip; - dst -= dstskip; - } - } + int i, flagcheck; + static Uint32 features = 0xffffffff; + + /* Get the available CPU features */ + if (features == 0xffffffff) { + const char *override = SDL_getenv("SDL_BLIT_CPU_FEATURES"); + + features = SDL_CPU_ANY; + + /* Allow an override for testing .. */ + if (override) { + SDL_sscanf(override, "%u", &features); + } else { + if (SDL_HasMMX()) { + features |= SDL_CPU_MMX; + } + if (SDL_Has3DNow()) { + features |= SDL_CPU_3DNOW; + } + if (SDL_HasSSE()) { + features |= SDL_CPU_SSE; + } + if (SDL_HasSSE2()) { + features |= SDL_CPU_SSE2; + } + if (SDL_HasAltiVec()) { + if (SDL_UseAltivecPrefetch()) { + features |= SDL_CPU_ALTIVEC_PREFETCH; + } else { + features |= SDL_CPU_ALTIVEC_NOPREFETCH; + } + } + } + } + + for (i = 0; entries[i].func; ++i) { + /* Check for matching pixel formats */ + if (src_format != entries[i].src_format) { + continue; + } + if (dst_format != entries[i].dst_format) { + continue; + } + + /* Check modulation flags */ + flagcheck = + (flags & (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA)); + if ((flagcheck & entries[i].flags) != flagcheck) { + continue; + } + + /* Check blend flags */ + flagcheck = + (flags & + (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)); + if ((flagcheck & entries[i].flags) != flagcheck) { + continue; + } + + /* Check colorkey flag */ + flagcheck = (flags & SDL_COPY_COLORKEY); + if ((flagcheck & entries[i].flags) != flagcheck) { + continue; + } + + /* Check scaling flags */ + flagcheck = (flags & SDL_COPY_NEAREST); + if ((flagcheck & entries[i].flags) != flagcheck) { + continue; + } + + /* Check CPU features */ + flagcheck = entries[i].cpu; + if ((flagcheck & features) != flagcheck) { + continue; + } + + /* We found the best one! */ + return entries[i].func; + } + return NULL; } /* Figure out which of many blit routines to set up on a surface */ -int SDL_CalculateBlit(SDL_Surface *surface) +int +SDL_CalculateBlit(SDL_Surface * surface) { - int blit_index; - - /* Clean everything out to start */ - if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - SDL_UnRLESurface(surface, 1); - } - surface->map->sw_blit = NULL; - - /* Figure out if an accelerated hardware blit is possible */ - surface->flags &= ~SDL_HWACCEL; - if ( surface->map->identity ) { - int hw_blit_ok; - - if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - /* We only support accelerated blitting to hardware */ - if ( surface->map->dst->flags & SDL_HWSURFACE ) { - hw_blit_ok = current_video->info.blit_hw; - } else { - hw_blit_ok = 0; - } - if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) { - hw_blit_ok = current_video->info.blit_hw_CC; - } - if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) { - hw_blit_ok = current_video->info.blit_hw_A; - } - } else { - /* We only support accelerated blitting to hardware */ - if ( surface->map->dst->flags & SDL_HWSURFACE ) { - hw_blit_ok = current_video->info.blit_sw; - } else { - hw_blit_ok = 0; - } - if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) { - hw_blit_ok = current_video->info.blit_sw_CC; - } - if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) { - hw_blit_ok = current_video->info.blit_sw_A; - } - } - if ( hw_blit_ok ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - video->CheckHWBlit(this, surface, surface->map->dst); - } - } - - /* if an alpha pixel format is specified, we can accelerate alpha blits */ - if (((surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE )&&(current_video->displayformatalphapixel)) - { - if ( (surface->flags & SDL_SRCALPHA) ) - if ( current_video->info.blit_hw_A ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - video->CheckHWBlit(this, surface, surface->map->dst); - } - } - - /* Get the blit function index, based on surface mode */ - /* { 0 = nothing, 1 = colorkey, 2 = alpha, 3 = colorkey+alpha } */ - blit_index = 0; - blit_index |= (!!(surface->flags & SDL_SRCCOLORKEY)) << 0; - if ( surface->flags & SDL_SRCALPHA - && (surface->format->alpha != SDL_ALPHA_OPAQUE - || surface->format->Amask) ) { - blit_index |= 2; - } - - /* Check for special "identity" case -- copy blit */ - if ( surface->map->identity && blit_index == 0 ) { - surface->map->sw_data->blit = SDL_BlitCopy; - - /* Handle overlapping blits on the same surface */ - if ( surface == surface->map->dst ) { - surface->map->sw_data->blit = SDL_BlitCopyOverlap; - } - } else { - if ( surface->format->BitsPerPixel < 8 ) { - surface->map->sw_data->blit = - SDL_CalculateBlit0(surface, blit_index); - } else { - switch ( surface->format->BytesPerPixel ) { - case 1: - surface->map->sw_data->blit = - SDL_CalculateBlit1(surface, blit_index); - break; - case 2: - case 3: - case 4: - surface->map->sw_data->blit = - SDL_CalculateBlitN(surface, blit_index); - break; - default: - surface->map->sw_data->blit = NULL; - break; - } - } - } - /* Make sure we have a blit function */ - if ( surface->map->sw_data->blit == NULL ) { - SDL_InvalidateMap(surface->map); - SDL_SetError("Blit combination not supported"); - return(-1); - } - - /* Choose software blitting function */ - if(surface->flags & SDL_RLEACCELOK - && (surface->flags & SDL_HWACCEL) != SDL_HWACCEL) { - - if(surface->map->identity - && (blit_index == 1 - || (blit_index == 3 && !surface->format->Amask))) { - if ( SDL_RLESurface(surface) == 0 ) - surface->map->sw_blit = SDL_RLEBlit; - } else if(blit_index == 2 && surface->format->Amask) { - if ( SDL_RLESurface(surface) == 0 ) - surface->map->sw_blit = SDL_RLEAlphaBlit; - } - } - - if ( surface->map->sw_blit == NULL ) { - surface->map->sw_blit = SDL_SoftBlit; - } - return(0); + SDL_BlitFunc blit = NULL; + SDL_BlitMap *map = surface->map; + SDL_Surface *dst = map->dst; + + /* Clean everything out to start */ + if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { + SDL_UnRLESurface(surface, 1); + } + map->blit = SDL_SoftBlit; + map->info.src_fmt = surface->format; + map->info.src_pitch = surface->pitch; + map->info.dst_fmt = dst->format; + map->info.dst_pitch = dst->pitch; + + /* See if we can do RLE acceleration */ + if (map->info.flags & SDL_COPY_RLE_DESIRED) { + if (SDL_RLESurface(surface) == 0) { + return 0; + } + } + + /* Choose a standard blit function */ + if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) { + blit = SDL_BlitCopy; + } else if (surface->format->BitsPerPixel < 8 && + SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { + blit = SDL_CalculateBlit0(surface); + } else if (surface->format->BytesPerPixel == 1 && + SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { + blit = SDL_CalculateBlit1(surface); + } else if (map->info.flags & SDL_COPY_BLEND) { + blit = SDL_CalculateBlitA(surface); + } else { + blit = SDL_CalculateBlitN(surface); + } + if (blit == NULL) { + Uint32 src_format = surface->format->format; + Uint32 dst_format = dst->format->format; + + blit = + SDL_ChooseBlitFunc(src_format, dst_format, map->info.flags, + SDL_GeneratedBlitFuncTable); + } +#ifndef TEST_SLOW_BLIT + if (blit == NULL) +#endif + { + Uint32 src_format = surface->format->format; + Uint32 dst_format = dst->format->format; + + if (!SDL_ISPIXELFORMAT_INDEXED(src_format) && + !SDL_ISPIXELFORMAT_FOURCC(src_format) && + !SDL_ISPIXELFORMAT_INDEXED(dst_format) && + !SDL_ISPIXELFORMAT_FOURCC(dst_format)) { + blit = SDL_Blit_Slow; + } + } + map->data = blit; + + /* Make sure we have a blit function */ + if (blit == NULL) { + SDL_InvalidateMap(map); + return SDL_SetError("Blit combination not supported"); + } + + return 0; } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index d64c1e5cce..07d3af7031 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -1,392 +1,461 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #ifndef _SDL_blit_h #define _SDL_blit_h +#include "SDL_cpuinfo.h" #include "SDL_endian.h" - -/* The structure passed to the low level blit functions */ -typedef struct { - Uint8 *s_pixels; - int s_width; - int s_height; - int s_skip; - Uint8 *d_pixels; - int d_width; - int d_height; - int d_skip; - void *aux_data; - SDL_PixelFormat *src; - Uint8 *table; - SDL_PixelFormat *dst; +#include "SDL_surface.h" + +/* Table to do pixel byte expansion */ +extern Uint8* SDL_expand_byte[9]; + +/* SDL blit copy flags */ +#define SDL_COPY_MODULATE_COLOR 0x00000001 +#define SDL_COPY_MODULATE_ALPHA 0x00000002 +#define SDL_COPY_BLEND 0x00000010 +#define SDL_COPY_ADD 0x00000020 +#define SDL_COPY_MOD 0x00000040 +#define SDL_COPY_COLORKEY 0x00000100 +#define SDL_COPY_NEAREST 0x00000200 +#define SDL_COPY_RLE_DESIRED 0x00001000 +#define SDL_COPY_RLE_COLORKEY 0x00002000 +#define SDL_COPY_RLE_ALPHAKEY 0x00004000 +#define SDL_COPY_RLE_MASK (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY) + +/* SDL blit CPU flags */ +#define SDL_CPU_ANY 0x00000000 +#define SDL_CPU_MMX 0x00000001 +#define SDL_CPU_3DNOW 0x00000002 +#define SDL_CPU_SSE 0x00000004 +#define SDL_CPU_SSE2 0x00000008 +#define SDL_CPU_ALTIVEC_PREFETCH 0x00000010 +#define SDL_CPU_ALTIVEC_NOPREFETCH 0x00000020 + +typedef struct +{ + Uint8 *src; + int src_w, src_h; + int src_pitch; + int src_skip; + Uint8 *dst; + int dst_w, dst_h; + int dst_pitch; + int dst_skip; + SDL_PixelFormat *src_fmt; + SDL_PixelFormat *dst_fmt; + Uint8 *table; + int flags; + Uint32 colorkey; + Uint8 r, g, b, a; } SDL_BlitInfo; -/* The type definition for the low level blit functions */ -typedef void (*SDL_loblit)(SDL_BlitInfo *info); +typedef void (SDLCALL * SDL_BlitFunc) (SDL_BlitInfo * info); -/* This is the private info structure for software accelerated blits */ -struct private_swaccel { - SDL_loblit blit; - void *aux_data; -}; +typedef struct +{ + Uint32 src_format; + Uint32 dst_format; + int flags; + int cpu; + SDL_BlitFunc func; +} SDL_BlitFuncEntry; /* Blit mapping definition */ -typedef struct SDL_BlitMap { - SDL_Surface *dst; - int identity; - Uint8 *table; - SDL_blit hw_blit; - SDL_blit sw_blit; - struct private_hwaccel *hw_data; - struct private_swaccel *sw_data; - - /* the version count matches the destination; mismatch indicates - an invalid mapping */ - unsigned int format_version; +typedef struct SDL_BlitMap +{ + SDL_Surface *dst; + int identity; + SDL_blit blit; + void *data; + SDL_BlitInfo info; + + /* the version count matches the destination; mismatch indicates + an invalid mapping */ + Uint32 dst_palette_version; + Uint32 src_palette_version; } SDL_BlitMap; - /* Functions found in SDL_blit.c */ -extern int SDL_CalculateBlit(SDL_Surface *surface); +extern int SDL_CalculateBlit(SDL_Surface * surface); -/* Functions found in SDL_blit_{0,1,N,A}.c */ -extern SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int complex); -extern SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int complex); -extern SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int complex); -extern SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int complex); +/* Functions found in SDL_blit_*.c */ +extern SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface * surface); +extern SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface * surface); +extern SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface * surface); +extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface * surface); /* * Useful macros for blitting routines */ -#define FORMAT_EQUAL(A, B) \ - ((A)->BitsPerPixel == (B)->BitsPerPixel \ - && ((A)->Rmask == (B)->Rmask) && ((A)->Amask == (B)->Amask)) +#if defined(__GNUC__) +#define DECLARE_ALIGNED(t,v,a) t __attribute__((aligned(a))) v +#elif defined(_MSC_VER) +#define DECLARE_ALIGNED(t,v,a) __declspec(align(a)) t v +#else +#define DECLARE_ALIGNED(t,v,a) t v +#endif /* Load pixel of the specified format from a buffer and get its R-G-B values */ -/* FIXME: rescale values to 0..255 here? */ -#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \ -{ \ - r = (((Pixel&fmt->Rmask)>>fmt->Rshift)<Rloss); \ - g = (((Pixel&fmt->Gmask)>>fmt->Gshift)<Gloss); \ - b = (((Pixel&fmt->Bmask)>>fmt->Bshift)<Bloss); \ +#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \ +{ \ + r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \ } -#define RGB_FROM_RGB565(Pixel, r, g, b) \ -{ \ - r = (((Pixel&0xF800)>>11)<<3); \ - g = (((Pixel&0x07E0)>>5)<<2); \ - b = ((Pixel&0x001F)<<3); \ +#define RGB_FROM_RGB565(Pixel, r, g, b) \ + { \ + r = SDL_expand_byte[3][((Pixel&0xF800)>>11)]; \ + g = SDL_expand_byte[2][((Pixel&0x07E0)>>5)]; \ + b = SDL_expand_byte[3][(Pixel&0x001F)]; \ } -#define RGB_FROM_RGB555(Pixel, r, g, b) \ -{ \ - r = (((Pixel&0x7C00)>>10)<<3); \ - g = (((Pixel&0x03E0)>>5)<<3); \ - b = ((Pixel&0x001F)<<3); \ +#define RGB_FROM_RGB555(Pixel, r, g, b) \ +{ \ + r = SDL_expand_byte[3][((Pixel&0x7C00)>>10)]; \ + g = SDL_expand_byte[3][((Pixel&0x03E0)>>5)]; \ + b = SDL_expand_byte[3][(Pixel&0x001F)]; \ } -#define RGB_FROM_RGB888(Pixel, r, g, b) \ -{ \ - r = ((Pixel&0xFF0000)>>16); \ - g = ((Pixel&0xFF00)>>8); \ - b = (Pixel&0xFF); \ +#define RGB_FROM_RGB888(Pixel, r, g, b) \ +{ \ + r = ((Pixel&0xFF0000)>>16); \ + g = ((Pixel&0xFF00)>>8); \ + b = (Pixel&0xFF); \ } -#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel) \ -do { \ - switch (bpp) { \ - case 2: \ - Pixel = *((Uint16 *)(buf)); \ - break; \ - \ - case 3: { \ - Uint8 *B = (Uint8 *)(buf); \ - if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \ - } else { \ - Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \ - } \ - } \ - break; \ - \ - case 4: \ - Pixel = *((Uint32 *)(buf)); \ - break; \ - \ - default: \ - Pixel = 0; /* appease gcc */ \ - break; \ - } \ -} while(0) - -#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b) \ -do { \ - switch (bpp) { \ - case 2: \ - Pixel = *((Uint16 *)(buf)); \ - break; \ - \ - case 3: { \ - Uint8 *B = (Uint8 *)buf; \ - if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \ - } else { \ - Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \ - } \ - } \ - break; \ - \ - case 4: \ - Pixel = *((Uint32 *)(buf)); \ - break; \ - \ - default: \ - Pixel = 0; /* prevent gcc from complaining */ \ - break; \ - } \ - RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ -} while(0) +#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel) \ +do { \ + switch (bpp) { \ + case 1: \ + Pixel = *((Uint8 *)(buf)); \ + break; \ + \ + case 2: \ + Pixel = *((Uint16 *)(buf)); \ + break; \ + \ + case 3: { \ + Uint8 *B = (Uint8 *)(buf); \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \ + } else { \ + Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \ + } \ + } \ + break; \ + \ + case 4: \ + Pixel = *((Uint32 *)(buf)); \ + break; \ + \ + default: \ + Pixel = 0; /* stop gcc complaints */ \ + break; \ + } \ +} while (0) + +#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b) \ +do { \ + switch (bpp) { \ + case 1: \ + Pixel = *((Uint8 *)(buf)); \ + RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ + break; \ + \ + case 2: \ + Pixel = *((Uint16 *)(buf)); \ + RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ + break; \ + \ + case 3: { \ + Pixel = 0; \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + r = *((buf)+fmt->Rshift/8); \ + g = *((buf)+fmt->Gshift/8); \ + b = *((buf)+fmt->Bshift/8); \ + } else { \ + r = *((buf)+2-fmt->Rshift/8); \ + g = *((buf)+2-fmt->Gshift/8); \ + b = *((buf)+2-fmt->Bshift/8); \ + } \ + } \ + break; \ + \ + case 4: \ + Pixel = *((Uint32 *)(buf)); \ + RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ + break; \ + \ + default: \ + /* stop gcc complaints */ \ + Pixel = 0; \ + r = g = b = 0; \ + break; \ + } \ +} while (0) /* Assemble R-G-B values into a specified pixel format and store them */ -#ifdef __NDS__ /* FIXME */ -#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift) | (1<<15); \ +#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ +{ \ + Pixel = ((r>>fmt->Rloss)<Rshift)| \ + ((g>>fmt->Gloss)<Gshift)| \ + ((b>>fmt->Bloss)<Bshift)| \ + fmt->Amask; \ } -#else -#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift); \ +#define RGB565_FROM_RGB(Pixel, r, g, b) \ +{ \ + Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \ +} +#define RGB555_FROM_RGB(Pixel, r, g, b) \ +{ \ + Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \ +} +#define RGB888_FROM_RGB(Pixel, r, g, b) \ +{ \ + Pixel = (r<<16)|(g<<8)|b; \ } -#endif /* __NDS__ FIXME */ -#define RGB565_FROM_RGB(Pixel, r, g, b) \ -{ \ - Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \ +#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (a<<24)|(r<<16)|(g<<8)|b; \ } -#define RGB555_FROM_RGB(Pixel, r, g, b) \ -{ \ - Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \ +#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (r<<24)|(g<<16)|(b<<8)|a; \ } -#define RGB888_FROM_RGB(Pixel, r, g, b) \ -{ \ - Pixel = (r<<16)|(g<<8)|b; \ +#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (a<<24)|(b<<16)|(g<<8)|r; \ } -#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) \ -{ \ - switch (bpp) { \ - case 2: { \ - Uint16 Pixel; \ - \ - PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \ - *((Uint16 *)(buf)) = Pixel; \ - } \ - break; \ - \ - case 3: { \ - if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - *((buf)+fmt->Rshift/8) = r; \ - *((buf)+fmt->Gshift/8) = g; \ - *((buf)+fmt->Bshift/8) = b; \ - } else { \ - *((buf)+2-fmt->Rshift/8) = r; \ - *((buf)+2-fmt->Gshift/8) = g; \ - *((buf)+2-fmt->Bshift/8) = b; \ - } \ - } \ - break; \ - \ - case 4: { \ - Uint32 Pixel; \ - \ - PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \ - *((Uint32 *)(buf)) = Pixel; \ - } \ - break; \ - } \ +#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + Pixel = (b<<24)|(g<<16)|(r<<8)|a; \ } -#define ASSEMBLE_RGB_AMASK(buf, bpp, fmt, r, g, b, Amask) \ -{ \ - switch (bpp) { \ - case 2: { \ - Uint16 *bufp; \ - Uint16 Pixel; \ - \ - bufp = (Uint16 *)buf; \ - PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \ - *bufp = Pixel | (*bufp & Amask); \ - } \ - break; \ - \ - case 3: { \ - if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - *((buf)+fmt->Rshift/8) = r; \ - *((buf)+fmt->Gshift/8) = g; \ - *((buf)+fmt->Bshift/8) = b; \ - } else { \ - *((buf)+2-fmt->Rshift/8) = r; \ - *((buf)+2-fmt->Gshift/8) = g; \ - *((buf)+2-fmt->Bshift/8) = b; \ - } \ - } \ - break; \ - \ - case 4: { \ - Uint32 *bufp; \ - Uint32 Pixel; \ - \ - bufp = (Uint32 *)buf; \ - PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \ - *bufp = Pixel | (*bufp & Amask); \ - } \ - break; \ - } \ +#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a) \ +{ \ + r = r ? ((r << 2) | 0x3) : 0; \ + g = g ? ((g << 2) | 0x3) : 0; \ + b = b ? ((b << 2) | 0x3) : 0; \ + a = (a * 3) / 255; \ + Pixel = (a<<30)|(r<<20)|(g<<10)|b; \ +} +#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) \ +{ \ + switch (bpp) { \ + case 1: { \ + Uint8 Pixel; \ + \ + PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \ + *((Uint8 *)(buf)) = Pixel; \ + } \ + break; \ + \ + case 2: { \ + Uint16 Pixel; \ + \ + PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \ + *((Uint16 *)(buf)) = Pixel; \ + } \ + break; \ + \ + case 3: { \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + *((buf)+fmt->Rshift/8) = r; \ + *((buf)+fmt->Gshift/8) = g; \ + *((buf)+fmt->Bshift/8) = b; \ + } else { \ + *((buf)+2-fmt->Rshift/8) = r; \ + *((buf)+2-fmt->Gshift/8) = g; \ + *((buf)+2-fmt->Bshift/8) = b; \ + } \ + } \ + break; \ + \ + case 4: { \ + Uint32 Pixel; \ + \ + PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \ + *((Uint32 *)(buf)) = Pixel; \ + } \ + break; \ + } \ } /* FIXME: Should we rescale alpha into 0..255 here? */ -#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ -{ \ - r = ((Pixel&fmt->Rmask)>>fmt->Rshift)<Rloss; \ - g = ((Pixel&fmt->Gmask)>>fmt->Gshift)<Gloss; \ - b = ((Pixel&fmt->Bmask)>>fmt->Bshift)<Bloss; \ - a = ((Pixel&fmt->Amask)>>fmt->Ashift)<Aloss; \ +#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ +{ \ + r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \ + a = SDL_expand_byte[fmt->Aloss][((Pixel&fmt->Amask)>>fmt->Ashift)]; \ } -#define RGBA_FROM_8888(Pixel, fmt, r, g, b, a) \ -{ \ - r = (Pixel&fmt->Rmask)>>fmt->Rshift; \ - g = (Pixel&fmt->Gmask)>>fmt->Gshift; \ - b = (Pixel&fmt->Bmask)>>fmt->Bshift; \ - a = (Pixel&fmt->Amask)>>fmt->Ashift; \ +#define RGBA_FROM_8888(Pixel, fmt, r, g, b, a) \ +{ \ + r = (Pixel&fmt->Rmask)>>fmt->Rshift; \ + g = (Pixel&fmt->Gmask)>>fmt->Gshift; \ + b = (Pixel&fmt->Bmask)>>fmt->Bshift; \ + a = (Pixel&fmt->Amask)>>fmt->Ashift; \ } -#define RGBA_FROM_RGBA8888(Pixel, r, g, b, a) \ -{ \ - r = (Pixel>>24); \ - g = ((Pixel>>16)&0xFF); \ - b = ((Pixel>>8)&0xFF); \ - a = (Pixel&0xFF); \ +#define RGBA_FROM_RGBA8888(Pixel, r, g, b, a) \ +{ \ + r = (Pixel>>24); \ + g = ((Pixel>>16)&0xFF); \ + b = ((Pixel>>8)&0xFF); \ + a = (Pixel&0xFF); \ } -#define RGBA_FROM_ARGB8888(Pixel, r, g, b, a) \ -{ \ - r = ((Pixel>>16)&0xFF); \ - g = ((Pixel>>8)&0xFF); \ - b = (Pixel&0xFF); \ - a = (Pixel>>24); \ +#define RGBA_FROM_ARGB8888(Pixel, r, g, b, a) \ +{ \ + r = ((Pixel>>16)&0xFF); \ + g = ((Pixel>>8)&0xFF); \ + b = (Pixel&0xFF); \ + a = (Pixel>>24); \ } -#define RGBA_FROM_ABGR8888(Pixel, r, g, b, a) \ -{ \ - r = (Pixel&0xFF); \ - g = ((Pixel>>8)&0xFF); \ - b = ((Pixel>>16)&0xFF); \ - a = (Pixel>>24); \ +#define RGBA_FROM_ABGR8888(Pixel, r, g, b, a) \ +{ \ + r = (Pixel&0xFF); \ + g = ((Pixel>>8)&0xFF); \ + b = ((Pixel>>16)&0xFF); \ + a = (Pixel>>24); \ } -#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \ -do { \ - switch (bpp) { \ - case 2: \ - Pixel = *((Uint16 *)(buf)); \ - break; \ - \ - case 3: {/* FIXME: broken code (no alpha) */ \ - Uint8 *b = (Uint8 *)buf; \ - if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - Pixel = b[0] + (b[1] << 8) + (b[2] << 16); \ - } else { \ - Pixel = (b[0] << 16) + (b[1] << 8) + b[2]; \ - } \ - } \ - break; \ - \ - case 4: \ - Pixel = *((Uint32 *)(buf)); \ - break; \ - \ - default: \ - Pixel = 0; /* stop gcc complaints */ \ - break; \ - } \ - RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ - Pixel &= ~fmt->Amask; \ -} while(0) +#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a) \ +{ \ + r = ((Pixel>>8)&0xFF); \ + g = ((Pixel>>16)&0xFF); \ + b = (Pixel>>24); \ + a = (Pixel&0xFF); \ +} +#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a) \ +{ \ + r = ((Pixel>>22)&0xFF); \ + g = ((Pixel>>12)&0xFF); \ + b = ((Pixel>>2)&0xFF); \ + a = SDL_expand_byte[6][(Pixel>>30)]; \ +} +#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \ +do { \ + switch (bpp) { \ + case 1: \ + Pixel = *((Uint8 *)(buf)); \ + RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ + break; \ + \ + case 2: \ + Pixel = *((Uint16 *)(buf)); \ + RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ + break; \ + \ + case 3: { \ + Pixel = 0; \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + r = *((buf)+fmt->Rshift/8); \ + g = *((buf)+fmt->Gshift/8); \ + b = *((buf)+fmt->Bshift/8); \ + } else { \ + r = *((buf)+2-fmt->Rshift/8); \ + g = *((buf)+2-fmt->Gshift/8); \ + b = *((buf)+2-fmt->Bshift/8); \ + } \ + a = 0xFF; \ + } \ + break; \ + \ + case 4: \ + Pixel = *((Uint32 *)(buf)); \ + RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ + break; \ + \ + default: \ + /* stop gcc complaints */ \ + Pixel = 0; \ + r = g = b = a = 0; \ + break; \ + } \ +} while (0) /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */ -#ifdef __NDS__ /* FIXME */ -#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift)| \ - ((a>>fmt->Aloss)<Ashift) | (1<<15); \ +#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ +{ \ + Pixel = ((r>>fmt->Rloss)<Rshift)| \ + ((g>>fmt->Gloss)<Gshift)| \ + ((b>>fmt->Bloss)<Bshift)| \ + ((a>>fmt->Aloss)<Ashift); \ } -#else -#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift)| \ - ((a>>fmt->Aloss)<Ashift); \ -} -#endif /* __NDS__ FIXME */ -#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ -{ \ - switch (bpp) { \ - case 2: { \ - Uint16 Pixel; \ - \ - PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \ - *((Uint16 *)(buf)) = Pixel; \ - } \ - break; \ - \ - case 3: { /* FIXME: broken code (no alpha) */ \ - if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - *((buf)+fmt->Rshift/8) = r; \ - *((buf)+fmt->Gshift/8) = g; \ - *((buf)+fmt->Bshift/8) = b; \ - } else { \ - *((buf)+2-fmt->Rshift/8) = r; \ - *((buf)+2-fmt->Gshift/8) = g; \ - *((buf)+2-fmt->Bshift/8) = b; \ - } \ - } \ - break; \ - \ - case 4: { \ - Uint32 Pixel; \ - \ - PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \ - *((Uint32 *)(buf)) = Pixel; \ - } \ - break; \ - } \ +#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ +{ \ + switch (bpp) { \ + case 1: { \ + Uint8 Pixel; \ + \ + PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \ + *((Uint8 *)(buf)) = Pixel; \ + } \ + break; \ + \ + case 2: { \ + Uint16 Pixel; \ + \ + PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \ + *((Uint16 *)(buf)) = Pixel; \ + } \ + break; \ + \ + case 3: { \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + *((buf)+fmt->Rshift/8) = r; \ + *((buf)+fmt->Gshift/8) = g; \ + *((buf)+fmt->Bshift/8) = b; \ + } else { \ + *((buf)+2-fmt->Rshift/8) = r; \ + *((buf)+2-fmt->Gshift/8) = g; \ + *((buf)+2-fmt->Bshift/8) = b; \ + } \ + } \ + break; \ + \ + case 4: { \ + Uint32 Pixel; \ + \ + PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \ + *((Uint32 *)(buf)) = Pixel; \ + } \ + break; \ + } \ } -/* Blend the RGB values of two Pixels based on a source alpha value */ -#define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) \ -do { \ - dR = (((sR-dR)*(A)+255)>>8)+dR; \ - dG = (((sG-dG)*(A)+255)>>8)+dG; \ - dB = (((sB-dB)*(A)+255)>>8)+dB; \ +/* Blend the RGB values of two pixels with an alpha value */ +#define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB) \ +do { \ + dR = ((((unsigned)(sR-dR)*(unsigned)A)/255)+dR); \ + dG = ((((unsigned)(sG-dG)*(unsigned)A)/255)+dG); \ + dB = ((((unsigned)(sB-dB)*(unsigned)A)/255)+dB); \ +} while(0) + + +/* Blend the RGBA values of two pixels */ +#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ +do { \ + dR = ((((unsigned)(sR-dR)*(unsigned)sA)/255)+dR); \ + dG = ((((unsigned)(sG-dG)*(unsigned)sA)/255)+dG); \ + dB = ((((unsigned)(sB-dB)*(unsigned)sA)/255)+dB); \ + dA = ((unsigned)sA+(unsigned)dA-((unsigned)sA*dA)/255); \ } while(0) @@ -399,124 +468,77 @@ do { \ #ifdef USE_DUFFS_LOOP /* 8-times unrolled loop */ -#define DUFFS_LOOP8(pixel_copy_increment, width) \ -{ int n = (width+7)/8; \ - switch (width & 7) { \ - case 0: do { pixel_copy_increment; \ - case 7: pixel_copy_increment; \ - case 6: pixel_copy_increment; \ - case 5: pixel_copy_increment; \ - case 4: pixel_copy_increment; \ - case 3: pixel_copy_increment; \ - case 2: pixel_copy_increment; \ - case 1: pixel_copy_increment; \ - } while ( --n > 0 ); \ - } \ +#define DUFFS_LOOP8(pixel_copy_increment, width) \ +{ int n = (width+7)/8; \ + switch (width & 7) { \ + case 0: do { pixel_copy_increment; \ + case 7: pixel_copy_increment; \ + case 6: pixel_copy_increment; \ + case 5: pixel_copy_increment; \ + case 4: pixel_copy_increment; \ + case 3: pixel_copy_increment; \ + case 2: pixel_copy_increment; \ + case 1: pixel_copy_increment; \ + } while ( --n > 0 ); \ + } \ } /* 4-times unrolled loop */ -#define DUFFS_LOOP4(pixel_copy_increment, width) \ -{ int n = (width+3)/4; \ - switch (width & 3) { \ - case 0: do { pixel_copy_increment; \ - case 3: pixel_copy_increment; \ - case 2: pixel_copy_increment; \ - case 1: pixel_copy_increment; \ - } while ( --n > 0 ); \ - } \ -} - -/* 2 - times unrolled loop */ -#define DUFFS_LOOP_DOUBLE2(pixel_copy_increment, \ - double_pixel_copy_increment, width) \ -{ int n, w = width; \ - if( w & 1 ) { \ - pixel_copy_increment; \ - w--; \ - } \ - if ( w > 0 ) { \ - n = ( w + 2) / 4; \ - switch( w & 2 ) { \ - case 0: do { double_pixel_copy_increment; \ - case 2: double_pixel_copy_increment; \ - } while ( --n > 0 ); \ - } \ - } \ -} - -/* 2 - times unrolled loop 4 pixels */ -#define DUFFS_LOOP_QUATRO2(pixel_copy_increment, \ - double_pixel_copy_increment, \ - quatro_pixel_copy_increment, width) \ -{ int n, w = width; \ - if(w & 1) { \ - pixel_copy_increment; \ - w--; \ - } \ - if(w & 2) { \ - double_pixel_copy_increment; \ - w -= 2; \ - } \ - if ( w > 0 ) { \ - n = ( w + 7 ) / 8; \ - switch( w & 4 ) { \ - case 0: do { quatro_pixel_copy_increment; \ - case 4: quatro_pixel_copy_increment; \ - } while ( --n > 0 ); \ - } \ - } \ +#define DUFFS_LOOP4(pixel_copy_increment, width) \ +{ int n = (width+3)/4; \ + switch (width & 3) { \ + case 0: do { pixel_copy_increment; \ + case 3: pixel_copy_increment; \ + case 2: pixel_copy_increment; \ + case 1: pixel_copy_increment; \ + } while (--n > 0); \ + } \ } /* Use the 8-times version of the loop by default */ -#define DUFFS_LOOP(pixel_copy_increment, width) \ - DUFFS_LOOP8(pixel_copy_increment, width) - -#else - -/* Don't use Duff's device to unroll loops */ -#define DUFFS_LOOP_DOUBLE2(pixel_copy_increment, \ - double_pixel_copy_increment, width) \ -{ int n = width; \ - if( n & 1 ) { \ - pixel_copy_increment; \ - n--; \ - } \ - n=n>>1; \ - for(; n > 0; --n) { \ - double_pixel_copy_increment; \ - } \ +#define DUFFS_LOOP(pixel_copy_increment, width) \ + DUFFS_LOOP8(pixel_copy_increment, width) + +/* Special version of Duff's device for even more optimization */ +#define DUFFS_LOOP_124(pixel_copy_increment1, \ + pixel_copy_increment2, \ + pixel_copy_increment4, width) \ +{ int n = width; \ + if (n & 1) { \ + pixel_copy_increment1; n -= 1; \ + } \ + if (n & 2) { \ + pixel_copy_increment2; n -= 2; \ + } \ + if (n & 4) { \ + pixel_copy_increment4; n -= 4; \ + } \ + if (n) { \ + n /= 8; \ + do { \ + pixel_copy_increment4; \ + pixel_copy_increment4; \ + } while (--n > 0); \ + } \ } -/* Don't use Duff's device to unroll loops */ -#define DUFFS_LOOP_QUATRO2(pixel_copy_increment, \ - double_pixel_copy_increment, \ - quatro_pixel_copy_increment, width) \ -{ int n = width; \ - if(n & 1) { \ - pixel_copy_increment; \ - n--; \ - } \ - if(n & 2) { \ - double_pixel_copy_increment; \ - n -= 2; \ - } \ - n=n>>2; \ - for(; n > 0; --n) { \ - quatro_pixel_copy_increment; \ - } \ -} +#else /* Don't use Duff's device to unroll loops */ -#define DUFFS_LOOP(pixel_copy_increment, width) \ -{ int n; \ - for ( n=width; n > 0; --n ) { \ - pixel_copy_increment; \ - } \ +#define DUFFS_LOOP(pixel_copy_increment, width) \ +{ int n; \ + for ( n=width; n > 0; --n ) { \ + pixel_copy_increment; \ + } \ } -#define DUFFS_LOOP8(pixel_copy_increment, width) \ - DUFFS_LOOP(pixel_copy_increment, width) -#define DUFFS_LOOP4(pixel_copy_increment, width) \ - DUFFS_LOOP(pixel_copy_increment, width) +#define DUFFS_LOOP8(pixel_copy_increment, width) \ + DUFFS_LOOP(pixel_copy_increment, width) +#define DUFFS_LOOP4(pixel_copy_increment, width) \ + DUFFS_LOOP(pixel_copy_increment, width) +#define DUFFS_LOOP_124(pixel_copy_increment1, \ + pixel_copy_increment2, \ + pixel_copy_increment4, width) \ + DUFFS_LOOP(pixel_copy_increment1, width) #endif /* USE_DUFFS_LOOP */ @@ -526,3 +548,5 @@ do { \ #endif #endif /* _SDL_blit_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_0.c b/src/video/SDL_blit_0.c index c1bc0eb61b..ba709745e0 100644 --- a/src/video/SDL_blit_0.c +++ b/src/video/SDL_blit_0.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,446 +25,459 @@ /* Functions to blit from bitmaps to other surfaces */ -static void BlitBto1(SDL_BlitInfo *info) +static void +BlitBto1(SDL_BlitInfo * info) { - int c; - int width, height; - Uint8 *src, *map, *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = info->d_pixels; - dstskip = info->d_skip; - map = info->table; - srcskip += width-(width+7)/8; - - if ( map ) { - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( 1 ) { - *dst = map[bit]; - } - dst++; - byte <<= 1; - } - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( 1 ) { - *dst = bit; - } - dst++; - byte <<= 1; - } - src += srcskip; - dst += dstskip; - } - } + int c; + int width, height; + Uint8 *src, *map, *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = info->dst; + dstskip = info->dst_skip; + map = info->table; + srcskip += width - (width + 7) / 8; + + if (map) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (1) { + *dst = map[bit]; + } + dst++; + byte <<= 1; + } + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (1) { + *dst = bit; + } + dst++; + byte <<= 1; + } + src += srcskip; + dst += dstskip; + } + } } -static void BlitBto2(SDL_BlitInfo *info) + +static void +BlitBto2(SDL_BlitInfo * info) { - int c; - int width, height; - Uint8 *src; - Uint16 *map, *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = (Uint16 *)info->d_pixels; - dstskip = info->d_skip/2; - map = (Uint16 *)info->table; - srcskip += width-(width+7)/8; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( 1 ) { - *dst = map[bit]; - } - byte <<= 1; - dst++; - } - src += srcskip; - dst += dstskip; - } + int c; + int width, height; + Uint8 *src; + Uint16 *map, *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = (Uint16 *) info->dst; + dstskip = info->dst_skip / 2; + map = (Uint16 *) info->table; + srcskip += width - (width + 7) / 8; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (1) { + *dst = map[bit]; + } + byte <<= 1; + dst++; + } + src += srcskip; + dst += dstskip; + } } -static void BlitBto3(SDL_BlitInfo *info) + +static void +BlitBto3(SDL_BlitInfo * info) { - int c, o; - int width, height; - Uint8 *src, *map, *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = info->d_pixels; - dstskip = info->d_skip; - map = info->table; - srcskip += width-(width+7)/8; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( 1 ) { - o = bit * 4; - dst[0] = map[o++]; - dst[1] = map[o++]; - dst[2] = map[o++]; - } - byte <<= 1; - dst += 3; - } - src += srcskip; - dst += dstskip; - } + int c, o; + int width, height; + Uint8 *src, *map, *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = info->dst; + dstskip = info->dst_skip; + map = info->table; + srcskip += width - (width + 7) / 8; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (1) { + o = bit * 4; + dst[0] = map[o++]; + dst[1] = map[o++]; + dst[2] = map[o++]; + } + byte <<= 1; + dst += 3; + } + src += srcskip; + dst += dstskip; + } } -static void BlitBto4(SDL_BlitInfo *info) + +static void +BlitBto4(SDL_BlitInfo * info) { - int width, height; - Uint8 *src; - Uint32 *map, *dst; - int srcskip, dstskip; - int c; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = (Uint32 *)info->d_pixels; - dstskip = info->d_skip/4; - map = (Uint32 *)info->table; - srcskip += width-(width+7)/8; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( 1 ) { - *dst = map[bit]; - } - byte <<= 1; - dst++; - } - src += srcskip; - dst += dstskip; - } + int width, height; + Uint8 *src; + Uint32 *map, *dst; + int srcskip, dstskip; + int c; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = (Uint32 *) info->dst; + dstskip = info->dst_skip / 4; + map = (Uint32 *) info->table; + srcskip += width - (width + 7) / 8; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (1) { + *dst = map[bit]; + } + byte <<= 1; + dst++; + } + src += srcskip; + dst += dstskip; + } } -static void BlitBto1Key(SDL_BlitInfo *info) +static void +BlitBto1Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - Uint8 *dst = info->d_pixels; - int srcskip = info->s_skip; - int dstskip = info->d_skip; - Uint32 ckey = info->src->colorkey; - Uint8 *palmap = info->table; - int c; - - /* Set up some basic variables */ - srcskip += width-(width+7)/8; - - if ( palmap ) { - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( bit != ckey ) { - *dst = palmap[bit]; - } - dst++; - byte <<= 1; - } - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( bit != ckey ) { - *dst = bit; - } - dst++; - byte <<= 1; - } - src += srcskip; - dst += dstskip; - } - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + Uint8 *dst = info->dst; + int srcskip = info->src_skip; + int dstskip = info->dst_skip; + Uint32 ckey = info->colorkey; + Uint8 *palmap = info->table; + int c; + + /* Set up some basic variables */ + srcskip += width - (width + 7) / 8; + + if (palmap) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (bit != ckey) { + *dst = palmap[bit]; + } + dst++; + byte <<= 1; + } + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (bit != ckey) { + *dst = bit; + } + dst++; + byte <<= 1; + } + src += srcskip; + dst += dstskip; + } + } } -static void BlitBto2Key(SDL_BlitInfo *info) +static void +BlitBto2Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int srcskip = info->s_skip; - int dstskip = info->d_skip; - Uint32 ckey = info->src->colorkey; - Uint8 *palmap = info->table; - int c; - - /* Set up some basic variables */ - srcskip += width-(width+7)/8; - dstskip /= 2; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( bit != ckey ) { - *dstp=((Uint16 *)palmap)[bit]; - } - byte <<= 1; - dstp++; - } - src += srcskip; - dstp += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + Uint16 *dstp = (Uint16 *) info->dst; + int srcskip = info->src_skip; + int dstskip = info->dst_skip; + Uint32 ckey = info->colorkey; + Uint8 *palmap = info->table; + int c; + + /* Set up some basic variables */ + srcskip += width - (width + 7) / 8; + dstskip /= 2; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (bit != ckey) { + *dstp = ((Uint16 *) palmap)[bit]; + } + byte <<= 1; + dstp++; + } + src += srcskip; + dstp += dstskip; + } } -static void BlitBto3Key(SDL_BlitInfo *info) +static void +BlitBto3Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - Uint8 *dst = info->d_pixels; - int srcskip = info->s_skip; - int dstskip = info->d_skip; - Uint32 ckey = info->src->colorkey; - Uint8 *palmap = info->table; - int c; - - /* Set up some basic variables */ - srcskip += width-(width+7)/8; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( bit != ckey ) { - SDL_memcpy(dst, &palmap[bit*4], 3); - } - byte <<= 1; - dst += 3; - } - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + Uint8 *dst = info->dst; + int srcskip = info->src_skip; + int dstskip = info->dst_skip; + Uint32 ckey = info->colorkey; + Uint8 *palmap = info->table; + int c; + + /* Set up some basic variables */ + srcskip += width - (width + 7) / 8; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (bit != ckey) { + SDL_memcpy(dst, &palmap[bit * 4], 3); + } + byte <<= 1; + dst += 3; + } + src += srcskip; + dst += dstskip; + } } -static void BlitBto4Key(SDL_BlitInfo *info) +static void +BlitBto4Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int srcskip = info->s_skip; - int dstskip = info->d_skip; - Uint32 ckey = info->src->colorkey; - Uint8 *palmap = info->table; - int c; - - /* Set up some basic variables */ - srcskip += width-(width+7)/8; - dstskip /= 4; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( bit != ckey ) { - *dstp=((Uint32 *)palmap)[bit]; - } - byte <<= 1; - dstp++; - } - src += srcskip; - dstp += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + Uint32 *dstp = (Uint32 *) info->dst; + int srcskip = info->src_skip; + int dstskip = info->dst_skip; + Uint32 ckey = info->colorkey; + Uint8 *palmap = info->table; + int c; + + /* Set up some basic variables */ + srcskip += width - (width + 7) / 8; + dstskip /= 4; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (bit != ckey) { + *dstp = ((Uint32 *) palmap)[bit]; + } + byte <<= 1; + dstp++; + } + src += srcskip; + dstp += dstskip; + } } -static void BlitBtoNAlpha(SDL_BlitInfo *info) +static void +BlitBtoNAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - Uint8 *dst = info->d_pixels; - int srcskip = info->s_skip; - int dstskip = info->d_skip; - const SDL_Color *srcpal = info->src->palette->colors; - SDL_PixelFormat *dstfmt = info->dst; - int dstbpp; - int c; - const int A = info->src->alpha; - - /* Set up some basic variables */ - dstbpp = dstfmt->BytesPerPixel; - srcskip += width-(width+7)/8; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( 1 ) { - Uint32 pixel; - unsigned sR, sG, sB; - unsigned dR, dG, dB; - sR = srcpal[bit].r; - sG = srcpal[bit].g; - sB = srcpal[bit].b; - DISEMBLE_RGB(dst, dstbpp, dstfmt, - pixel, dR, dG, dB); - ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); - ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); - } - byte <<= 1; - dst += dstbpp; - } - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + Uint8 *dst = info->dst; + int srcskip = info->src_skip; + int dstskip = info->dst_skip; + const SDL_Color *srcpal = info->src_fmt->palette->colors; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int dstbpp; + int c; + Uint32 pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB, dA; + const unsigned A = info->a; + + /* Set up some basic variables */ + dstbpp = dstfmt->BytesPerPixel; + srcskip += width - (width + 7) / 8; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (1) { + sR = srcpal[bit].r; + sG = srcpal[bit].g; + sB = srcpal[bit].b; + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + byte <<= 1; + dst += dstbpp; + } + src += srcskip; + dst += dstskip; + } } -static void BlitBtoNAlphaKey(SDL_BlitInfo *info) +static void +BlitBtoNAlphaKey(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - Uint8 *dst = info->d_pixels; - int srcskip = info->s_skip; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - const SDL_Color *srcpal = srcfmt->palette->colors; - int dstbpp; - int c; - const int A = srcfmt->alpha; - Uint32 ckey = srcfmt->colorkey; - - /* Set up some basic variables */ - dstbpp = dstfmt->BytesPerPixel; - srcskip += width-(width+7)/8; - - while ( height-- ) { - Uint8 byte = 0, bit; - for ( c=0; c>7; - if ( bit != ckey ) { - int sR, sG, sB; - int dR, dG, dB; - Uint32 pixel; - sR = srcpal[bit].r; - sG = srcpal[bit].g; - sB = srcpal[bit].b; - DISEMBLE_RGB(dst, dstbpp, dstfmt, - pixel, dR, dG, dB); - ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); - ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); - } - byte <<= 1; - dst += dstbpp; - } - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + Uint8 *dst = info->dst; + int srcskip = info->src_skip; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_Color *srcpal = srcfmt->palette->colors; + int dstbpp; + int c; + Uint32 pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB, dA; + const unsigned A = info->a; + Uint32 ckey = info->colorkey; + + /* Set up some basic variables */ + dstbpp = dstfmt->BytesPerPixel; + srcskip += width - (width + 7) / 8; + + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if ((c & 7) == 0) { + byte = *src++; + } + bit = (byte & 0x80) >> 7; + if (bit != ckey) { + sR = srcpal[bit].r; + sG = srcpal[bit].g; + sB = srcpal[bit].b; + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + byte <<= 1; + dst += dstbpp; + } + src += srcskip; + dst += dstskip; + } } -static SDL_loblit bitmap_blit[] = { - NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4 +static const SDL_BlitFunc bitmap_blit[] = { + (SDL_BlitFunc) NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4 }; -static SDL_loblit colorkey_blit[] = { - NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key +static const SDL_BlitFunc colorkey_blit[] = { + (SDL_BlitFunc) NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key }; -SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int blit_index) +SDL_BlitFunc +SDL_CalculateBlit0(SDL_Surface * surface) { - int which; - - if ( surface->format->BitsPerPixel != 1 ) { - /* We don't support sub 8-bit packed pixel modes */ - return NULL; - } - if ( surface->map->dst->format->BitsPerPixel < 8 ) { - which = 0; - } else { - which = surface->map->dst->format->BytesPerPixel; - } - switch(blit_index) { - case 0: /* copy */ - return bitmap_blit[which]; - - case 1: /* colorkey */ - return colorkey_blit[which]; - - case 2: /* alpha */ - return which >= 2 ? BlitBtoNAlpha : NULL; - - case 4: /* alpha + colorkey */ - return which >= 2 ? BlitBtoNAlphaKey : NULL; - } - return NULL; + int which; + + if (surface->format->BitsPerPixel != 1) { + /* We don't support sub 8-bit packed pixel modes */ + return (SDL_BlitFunc) NULL; + } + if (surface->map->dst->format->BitsPerPixel < 8) { + which = 0; + } else { + which = surface->map->dst->format->BytesPerPixel; + } + switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + case 0: + return bitmap_blit[which]; + + case SDL_COPY_COLORKEY: + return colorkey_blit[which]; + + case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL; + + case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL; + } + return (SDL_BlitFunc) NULL; } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_1.c b/src/video/SDL_blit_1.c index 7f95f5bf35..67503e8791 100644 --- a/src/video/SDL_blit_1.c +++ b/src/video/SDL_blit_1.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -28,26 +27,28 @@ /* Functions to blit from 8-bit surfaces to other surfaces */ -static void Blit1to1(SDL_BlitInfo *info) +static void +Blit1to1(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int width, height; - Uint8 *src, *map, *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = info->d_pixels; - dstskip = info->d_skip; - map = info->table; - - while ( height-- ) { + int width, height; + Uint8 *src, *map, *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = info->dst; + dstskip = info->dst_skip; + map = info->table; + + while (height--) { #ifdef USE_DUFFS_LOOP + /* *INDENT-OFF* */ DUFFS_LOOP( { *dst = map[*src]; @@ -55,17 +56,19 @@ static void Blit1to1(SDL_BlitInfo *info) dst++; src++; , width); + /* *INDENT-ON* */ #else - for ( c=width; c; --c ) { - *dst = map[*src]; - dst++; - src++; - } + for (c = width; c; --c) { + *dst = map[*src]; + dst++; + src++; + } #endif - src += srcskip; - dst += dstskip; - } + src += srcskip; + dst += dstskip; + } } + /* This is now endian dependent */ #if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) #define HI 1 @@ -74,136 +77,136 @@ static void Blit1to1(SDL_BlitInfo *info) #define HI 0 #define LO 1 #endif -static void Blit1to2(SDL_BlitInfo *info) +static void +Blit1to2(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int width, height; - Uint8 *src, *dst; - Uint16 *map; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = info->d_pixels; - dstskip = info->d_skip; - map = (Uint16 *)info->table; + int width, height; + Uint8 *src, *dst; + Uint16 *map; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = info->dst; + dstskip = info->dst_skip; + map = (Uint16 *) info->table; #ifdef USE_DUFFS_LOOP - while ( height-- ) { + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { *(Uint16 *)dst = map[*src++]; dst += 2; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } #else - /* Memory align at 4-byte boundary, if necessary */ - if ( (long)dst & 0x03 ) { - /* Don't do anything if width is 0 */ - if ( width == 0 ) { - return; - } - --width; - - while ( height-- ) { - /* Perform copy alignment */ - *(Uint16 *)dst = map[*src++]; - dst += 2; - - /* Copy in 4 pixel chunks */ - for ( c=width/4; c; --c ) { - *(Uint32 *)dst = - (map[src[HI]]<<16)|(map[src[LO]]); - src += 2; - dst += 4; - *(Uint32 *)dst = - (map[src[HI]]<<16)|(map[src[LO]]); - src += 2; - dst += 4; - } - /* Get any leftovers */ - switch (width & 3) { - case 3: - *(Uint16 *)dst = map[*src++]; - dst += 2; - case 2: - *(Uint32 *)dst = - (map[src[HI]]<<16)|(map[src[LO]]); - src += 2; - dst += 4; - break; - case 1: - *(Uint16 *)dst = map[*src++]; - dst += 2; - break; - } - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { - /* Copy in 4 pixel chunks */ - for ( c=width/4; c; --c ) { - *(Uint32 *)dst = - (map[src[HI]]<<16)|(map[src[LO]]); - src += 2; - dst += 4; - *(Uint32 *)dst = - (map[src[HI]]<<16)|(map[src[LO]]); - src += 2; - dst += 4; - } - /* Get any leftovers */ - switch (width & 3) { - case 3: - *(Uint16 *)dst = map[*src++]; - dst += 2; - case 2: - *(Uint32 *)dst = - (map[src[HI]]<<16)|(map[src[LO]]); - src += 2; - dst += 4; - break; - case 1: - *(Uint16 *)dst = map[*src++]; - dst += 2; - break; - } - src += srcskip; - dst += dstskip; - } - } + /* Memory align at 4-byte boundary, if necessary */ + if ((long) dst & 0x03) { + /* Don't do anything if width is 0 */ + if (width == 0) { + return; + } + --width; + + while (height--) { + /* Perform copy alignment */ + *(Uint16 *) dst = map[*src++]; + dst += 2; + + /* Copy in 4 pixel chunks */ + for (c = width / 4; c; --c) { + *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + src += 2; + dst += 4; + *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + src += 2; + dst += 4; + } + /* Get any leftovers */ + switch (width & 3) { + case 3: + *(Uint16 *) dst = map[*src++]; + dst += 2; + case 2: + *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + src += 2; + dst += 4; + break; + case 1: + *(Uint16 *) dst = map[*src++]; + dst += 2; + break; + } + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + /* Copy in 4 pixel chunks */ + for (c = width / 4; c; --c) { + *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + src += 2; + dst += 4; + *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + src += 2; + dst += 4; + } + /* Get any leftovers */ + switch (width & 3) { + case 3: + *(Uint16 *) dst = map[*src++]; + dst += 2; + case 2: + *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + src += 2; + dst += 4; + break; + case 1: + *(Uint16 *) dst = map[*src++]; + dst += 2; + break; + } + src += srcskip; + dst += dstskip; + } + } #endif /* USE_DUFFS_LOOP */ } -static void Blit1to3(SDL_BlitInfo *info) + +static void +Blit1to3(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int o; - int width, height; - Uint8 *src, *map, *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = info->d_pixels; - dstskip = info->d_skip; - map = info->table; - - while ( height-- ) { + int o; + int width, height; + Uint8 *src, *map, *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = info->dst; + dstskip = info->dst_skip; + map = info->table; + + while (height--) { #ifdef USE_DUFFS_LOOP + /* *INDENT-OFF* */ DUFFS_LOOP( { o = *src * 4; @@ -214,78 +217,85 @@ static void Blit1to3(SDL_BlitInfo *info) src++; dst += 3; , width); + /* *INDENT-ON* */ #else - for ( c=width; c; --c ) { - o = *src * 4; - dst[0] = map[o++]; - dst[1] = map[o++]; - dst[2] = map[o++]; - src++; - dst += 3; - } + for (c = width; c; --c) { + o = *src * 4; + dst[0] = map[o++]; + dst[1] = map[o++]; + dst[2] = map[o++]; + src++; + dst += 3; + } #endif /* USE_DUFFS_LOOP */ - src += srcskip; - dst += dstskip; - } + src += srcskip; + dst += dstskip; + } } -static void Blit1to4(SDL_BlitInfo *info) + +static void +Blit1to4(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int width, height; - Uint8 *src; - Uint32 *map, *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = (Uint32 *)info->d_pixels; - dstskip = info->d_skip/4; - map = (Uint32 *)info->table; - - while ( height-- ) { + int width, height; + Uint8 *src; + Uint32 *map, *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = (Uint32 *) info->dst; + dstskip = info->dst_skip / 4; + map = (Uint32 *) info->table; + + while (height--) { #ifdef USE_DUFFS_LOOP + /* *INDENT-OFF* */ DUFFS_LOOP( *dst++ = map[*src++]; , width); + /* *INDENT-ON* */ #else - for ( c=width/4; c; --c ) { - *dst++ = map[*src++]; - *dst++ = map[*src++]; - *dst++ = map[*src++]; - *dst++ = map[*src++]; - } - switch ( width & 3 ) { - case 3: - *dst++ = map[*src++]; - case 2: - *dst++ = map[*src++]; - case 1: - *dst++ = map[*src++]; - } + for (c = width / 4; c; --c) { + *dst++ = map[*src++]; + *dst++ = map[*src++]; + *dst++ = map[*src++]; + *dst++ = map[*src++]; + } + switch (width & 3) { + case 3: + *dst++ = map[*src++]; + case 2: + *dst++ = map[*src++]; + case 1: + *dst++ = map[*src++]; + } #endif /* USE_DUFFS_LOOP */ - src += srcskip; - dst += dstskip; - } + src += srcskip; + dst += dstskip; + } } -static void Blit1to1Key(SDL_BlitInfo *info) +static void +Blit1to1Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - Uint8 *palmap = info->table; - Uint32 ckey = info->src->colorkey; - - if ( palmap ) { - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint8 *palmap = info->table; + Uint32 ckey = info->colorkey; + + if (palmap) { + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { if ( *src != ckey ) { @@ -295,11 +305,13 @@ static void Blit1to1Key(SDL_BlitInfo *info) src++; }, width); - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { if ( *src != ckey ) { @@ -309,27 +321,30 @@ static void Blit1to1Key(SDL_BlitInfo *info) src++; }, width); - src += srcskip; - dst += dstskip; - } - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } + } } -static void Blit1to2Key(SDL_BlitInfo *info) +static void +Blit1to2Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip; - Uint16 *palmap = (Uint16 *)info->table; - Uint32 ckey = info->src->colorkey; - - /* Set up some basic variables */ - dstskip /= 2; - - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip; + Uint16 *palmap = (Uint16 *) info->table; + Uint32 ckey = info->colorkey; + + /* Set up some basic variables */ + dstskip /= 2; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { if ( *src != ckey ) { @@ -339,24 +354,27 @@ static void Blit1to2Key(SDL_BlitInfo *info) dstp++; }, width); - src += srcskip; - dstp += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dstp += dstskip; + } } -static void Blit1to3Key(SDL_BlitInfo *info) +static void +Blit1to3Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - Uint8 *palmap = info->table; - Uint32 ckey = info->src->colorkey; - int o; - - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint8 *palmap = info->table; + Uint32 ckey = info->colorkey; + int o; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { if ( *src != ckey ) { @@ -369,26 +387,29 @@ static void Blit1to3Key(SDL_BlitInfo *info) dst += 3; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -static void Blit1to4Key(SDL_BlitInfo *info) +static void +Blit1to4Key(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip; - Uint32 *palmap = (Uint32 *)info->table; - Uint32 ckey = info->src->colorkey; - - /* Set up some basic variables */ - dstskip /= 4; - - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip; + Uint32 *palmap = (Uint32 *) info->table; + Uint32 ckey = info->colorkey; + + /* Set up some basic variables */ + dstskip /= 4; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { if ( *src != ckey ) { @@ -398,126 +419,132 @@ static void Blit1to4Key(SDL_BlitInfo *info) dstp++; }, width); - src += srcskip; - dstp += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dstp += dstskip; + } } -static void Blit1toNAlpha(SDL_BlitInfo *info) +static void +Blit1toNAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *dstfmt = info->dst; - const SDL_Color *srcpal = info->src->palette->colors; - int dstbpp; - const int A = info->src->alpha; - - /* Set up some basic variables */ - dstbpp = dstfmt->BytesPerPixel; - - while ( height-- ) { - int sR, sG, sB; - int dR, dG, dB; - DUFFS_LOOP4( - { - Uint32 pixel; - sR = srcpal[*src].r; - sG = srcpal[*src].g; - sB = srcpal[*src].b; - DISEMBLE_RGB(dst, dstbpp, dstfmt, - pixel, dR, dG, dB); - ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); - ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); - src++; - dst += dstbpp; - }, - width); - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_Color *srcpal = info->src_fmt->palette->colors; + int dstbpp; + Uint32 pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB, dA; + const unsigned A = info->a; + + /* Set up some basic variables */ + dstbpp = dstfmt->BytesPerPixel; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP4( + { + sR = srcpal[*src].r; + sG = srcpal[*src].g; + sB = srcpal[*src].b; + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + src++; + dst += dstbpp; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -static void Blit1toNAlphaKey(SDL_BlitInfo *info) +static void +Blit1toNAlphaKey(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - const SDL_Color *srcpal = info->src->palette->colors; - Uint32 ckey = srcfmt->colorkey; - int dstbpp; - const int A = srcfmt->alpha; - - /* Set up some basic variables */ - dstbpp = dstfmt->BytesPerPixel; - - while ( height-- ) { - int sR, sG, sB; - int dR, dG, dB; + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_Color *srcpal = info->src_fmt->palette->colors; + Uint32 ckey = info->colorkey; + int dstbpp; + Uint32 pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB, dA; + const unsigned A = info->a; + + /* Set up some basic variables */ + dstbpp = dstfmt->BytesPerPixel; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { if ( *src != ckey ) { - Uint32 pixel; sR = srcpal[*src].r; sG = srcpal[*src].g; sB = srcpal[*src].b; - DISEMBLE_RGB(dst, dstbpp, dstfmt, - pixel, dR, dG, dB); - ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); - ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB); + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); } src++; dst += dstbpp; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -static SDL_loblit one_blit[] = { - NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4 +static const SDL_BlitFunc one_blit[] = { + (SDL_BlitFunc) NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4 }; -static SDL_loblit one_blitkey[] = { - NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key +static const SDL_BlitFunc one_blitkey[] = { + (SDL_BlitFunc) NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key }; -SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int blit_index) +SDL_BlitFunc +SDL_CalculateBlit1(SDL_Surface * surface) { - int which; - SDL_PixelFormat *dstfmt; - - dstfmt = surface->map->dst->format; - if ( dstfmt->BitsPerPixel < 8 ) { - which = 0; - } else { - which = dstfmt->BytesPerPixel; - } - switch(blit_index) { - case 0: /* copy */ - return one_blit[which]; - - case 1: /* colorkey */ - return one_blitkey[which]; - - case 2: /* alpha */ - /* Supporting 8bpp->8bpp alpha is doable but requires lots of - tables which consume space and takes time to precompute, - so is better left to the user */ - return which >= 2 ? Blit1toNAlpha : NULL; - - case 3: /* alpha + colorkey */ - return which >= 2 ? Blit1toNAlphaKey : NULL; - - } - return NULL; + int which; + SDL_PixelFormat *dstfmt; + + dstfmt = surface->map->dst->format; + if (dstfmt->BitsPerPixel < 8) { + which = 0; + } else { + which = dstfmt->BytesPerPixel; + } + switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + case 0: + return one_blit[which]; + + case SDL_COPY_COLORKEY: + return one_blitkey[which]; + + case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + /* Supporting 8bpp->8bpp alpha is doable but requires lots of + tables which consume space and takes time to precompute, + so is better left to the user */ + return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL; + + case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL; + } + return (SDL_BlitFunc) NULL; } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 219cdccf5b..3fb89c0612 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1,619 +1,354 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #include "SDL_video.h" #include "SDL_blit.h" -/* - In Visual C, VC6 has mmintrin.h in the "Processor Pack" add-on. - Checking if _mm_free is #defined in malloc.h is is the only way to - determine if the Processor Pack is installed, as far as I can tell. -*/ - -#if SDL_ASSEMBLY_ROUTINES -# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - /* forced MMX to 0...it breaks on most compilers now. --ryan. */ -# define MMX_ASMBLIT 0 -# define GCC_ASMBLIT 0 -# elif defined(_MSC_VER) && defined(_M_IX86) -# if (_MSC_VER <= 1200) -# include -# if defined(_mm_free) -# define HAVE_MMINTRIN_H 1 -# endif -# else /* Visual Studio > VC6 always has mmintrin.h */ -# define HAVE_MMINTRIN_H 1 -# endif -# if HAVE_MMINTRIN_H -# define MMX_ASMBLIT 1 -# define MSVC_ASMBLIT 1 -# endif -# endif -#endif /* SDL_ASSEMBLY_ROUTINES */ - -/* Function to check the CPU flags */ -#include "SDL_cpuinfo.h" -#if GCC_ASMBLIT -#include "mmx.h" -#elif MSVC_ASMBLIT -#include -#include -#endif - /* Functions to perform alpha blended blitting */ /* N->1 blending with per-surface alpha */ -static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info) +static void +BlitNto1SurfaceAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - Uint8 *palmap = info->table; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - int srcbpp = srcfmt->BytesPerPixel; - - const unsigned A = srcfmt->alpha; - - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint8 *palmap = info->table; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int srcbpp = srcfmt->BytesPerPixel; + Uint32 Pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB; + const unsigned A = info->a; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4( { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - unsigned dR; - unsigned dG; - unsigned dB; DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); dR = dstfmt->palette->colors[*dst].r; dG = dstfmt->palette->colors[*dst].g; dB = dstfmt->palette->colors[*dst].b; - ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); + ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB); dR &= 0xff; dG &= 0xff; dB &= 0xff; /* Pack RGB into 8bit pixel */ if ( palmap == NULL ) { - *dst =((dR>>5)<<(3+2))| - ((dG>>5)<<(2))| - ((dB>>6)<<(0)); + *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0)); } else { - *dst = palmap[((dR>>5)<<(3+2))| - ((dG>>5)<<(2)) | - ((dB>>6)<<(0))]; + *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))]; } dst++; src += srcbpp; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } /* N->1 blending with pixel alpha */ -static void BlitNto1PixelAlpha(SDL_BlitInfo *info) +static void +BlitNto1PixelAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - Uint8 *palmap = info->table; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - int srcbpp = srcfmt->BytesPerPixel; - - /* FIXME: fix alpha bit field expansion here too? */ - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint8 *palmap = info->table; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int srcbpp = srcfmt->BytesPerPixel; + Uint32 Pixel; + unsigned sR, sG, sB, sA; + unsigned dR, dG, dB; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4( { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - unsigned sA; - unsigned dR; - unsigned dG; - unsigned dB; DISEMBLE_RGBA(src,srcbpp,srcfmt,Pixel,sR,sG,sB,sA); dR = dstfmt->palette->colors[*dst].r; dG = dstfmt->palette->colors[*dst].g; dB = dstfmt->palette->colors[*dst].b; - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); + ALPHA_BLEND_RGB(sR, sG, sB, sA, dR, dG, dB); dR &= 0xff; dG &= 0xff; dB &= 0xff; /* Pack RGB into 8bit pixel */ if ( palmap == NULL ) { - *dst =((dR>>5)<<(3+2))| - ((dG>>5)<<(2))| - ((dB>>6)<<(0)); + *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0)); } else { - *dst = palmap[((dR>>5)<<(3+2))| - ((dG>>5)<<(2)) | - ((dB>>6)<<(0)) ]; + *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))]; } dst++; src += srcbpp; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } /* colorkeyed N->1 blending with per-surface alpha */ -static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) +static void +BlitNto1SurfaceAlphaKey(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - Uint8 *palmap = info->table; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - int srcbpp = srcfmt->BytesPerPixel; - Uint32 ckey = srcfmt->colorkey; - - const int A = srcfmt->alpha; - - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint8 *palmap = info->table; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int srcbpp = srcfmt->BytesPerPixel; + Uint32 ckey = info->colorkey; + Uint32 Pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB; + const unsigned A = info->a; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP( { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - unsigned dR; - unsigned dG; - unsigned dB; DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); if ( Pixel != ckey ) { dR = dstfmt->palette->colors[*dst].r; dG = dstfmt->palette->colors[*dst].g; dB = dstfmt->palette->colors[*dst].b; - ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB); + ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB); dR &= 0xff; dG &= 0xff; dB &= 0xff; /* Pack RGB into 8bit pixel */ if ( palmap == NULL ) { - *dst =((dR>>5)<<(3+2))| - ((dG>>5)<<(2)) | - ((dB>>6)<<(0)); + *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0)); } else { - *dst = palmap[((dR>>5)<<(3+2))| - ((dG>>5)<<(2)) | - ((dB>>6)<<(0)) ]; + *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))]; } } dst++; src += srcbpp; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -#if GCC_ASMBLIT -/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ -static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info) -{ - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - Uint32 dalpha = info->dst->Amask; - Uint64 load; - - load = 0x00fefefe00fefefeULL;/* alpha128 mask */ - movq_m2r(load, mm4); /* alpha128 mask -> mm4 */ - load = 0x0001010100010101ULL;/* !alpha128 mask */ - movq_m2r(load, mm3); /* !alpha128 mask -> mm3 */ - movd_m2r(dalpha, mm7); /* dst alpha mask */ - punpckldq_r2r(mm7, mm7); /* dst alpha mask | dst alpha mask -> mm7 */ - while(height--) { - DUFFS_LOOP_DOUBLE2( - { - Uint32 s = *srcp++; - Uint32 d = *dstp; - *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) - + (s & d & 0x00010101)) | dalpha; - },{ - movq_m2r((*dstp), mm2);/* 2 x dst -> mm2(ARGBARGB) */ - movq_r2r(mm2, mm6); /* 2 x dst -> mm6(ARGBARGB) */ - - movq_m2r((*srcp), mm1);/* 2 x src -> mm1(ARGBARGB) */ - movq_r2r(mm1, mm5); /* 2 x src -> mm5(ARGBARGB) */ - - pand_r2r(mm4, mm6); /* dst & mask -> mm6 */ - pand_r2r(mm4, mm5); /* src & mask -> mm5 */ - paddd_r2r(mm6, mm5); /* mm6 + mm5 -> mm5 */ - pand_r2r(mm1, mm2); /* src & dst -> mm2 */ - psrld_i2r(1, mm5); /* mm5 >> 1 -> mm5 */ - pand_r2r(mm3, mm2); /* mm2 & !mask -> mm2 */ - paddd_r2r(mm5, mm2); /* mm5 + mm2 -> mm2 */ - - por_r2r(mm7, mm2); /* mm7(full alpha) | mm2 -> mm2 */ - movq_r2m(mm2, (*dstp));/* mm2 -> 2 x dst pixels */ - dstp += 2; - srcp += 2; - }, width); - srcp += srcskip; - dstp += dstskip; - } - emms(); -} +#ifdef __MMX__ -/* fast RGB888->(A)RGB888 blending with surface alpha */ -static void BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info) +/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ +static void +BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo * info) { - SDL_PixelFormat* df = info->dst; - unsigned alpha = info->src->alpha; - - if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) { - /* only call a128 version when R,G,B occupy lower bits */ - BlitRGBtoRGBSurfaceAlpha128MMX(info); - } else { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - - pxor_r2r(mm5, mm5); /* 0 -> mm5 */ - /* form the alpha mult */ - movd_m2r(alpha, mm4); /* 0000000A -> mm4 */ - punpcklwd_r2r(mm4, mm4); /* 00000A0A -> mm4 */ - punpckldq_r2r(mm4, mm4); /* 0A0A0A0A -> mm4 */ - alpha = (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift); - movd_m2r(alpha, mm0); /* 00000FFF -> mm0 */ - punpcklbw_r2r(mm0, mm0); /* 00FFFFFF -> mm0 */ - pand_r2r(mm0, mm4); /* 0A0A0A0A -> mm4, minus 1 chan */ - /* at this point mm4 can be 000A0A0A or 0A0A0A00 or another combo */ - movd_m2r(df->Amask, mm7); /* dst alpha mask */ - punpckldq_r2r(mm7, mm7); /* dst alpha mask | dst alpha mask -> mm7 */ - - while(height--) { - DUFFS_LOOP_DOUBLE2({ - /* One Pixel Blend */ - movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/ - movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/ - punpcklbw_r2r(mm5, mm1); /* 0A0R0G0B -> mm1(src) */ - punpcklbw_r2r(mm5, mm2); /* 0A0R0G0B -> mm2(dst) */ - - psubw_r2r(mm2, mm1);/* src - dst -> mm1 */ - pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */ - psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1 */ - paddb_r2r(mm1, mm2); /* mm1 + mm2(dst) -> mm2 */ - - packuswb_r2r(mm5, mm2); /* ARGBARGB -> mm2 */ - por_r2r(mm7, mm2); /* mm7(full alpha) | mm2 -> mm2 */ - movd_r2m(mm2, *dstp);/* mm2 -> pixel */ - ++srcp; - ++dstp; - },{ - /* Two Pixels Blend */ - movq_m2r((*srcp), mm0);/* 2 x src -> mm0(ARGBARGB)*/ - movq_m2r((*dstp), mm2);/* 2 x dst -> mm2(ARGBARGB) */ - movq_r2r(mm0, mm1); /* 2 x src -> mm1(ARGBARGB) */ - movq_r2r(mm2, mm6); /* 2 x dst -> mm6(ARGBARGB) */ - - punpcklbw_r2r(mm5, mm0); /* low - 0A0R0G0B -> mm0(src1) */ - punpckhbw_r2r(mm5, mm1); /* high - 0A0R0G0B -> mm1(src2) */ - punpcklbw_r2r(mm5, mm2); /* low - 0A0R0G0B -> mm2(dst1) */ - punpckhbw_r2r(mm5, mm6); /* high - 0A0R0G0B -> mm6(dst2) */ - - psubw_r2r(mm2, mm0);/* src1 - dst1 -> mm0 */ - pmullw_r2r(mm4, mm0); /* mm0 * alpha -> mm0 */ - psrlw_i2r(8, mm0); /* mm0 >> 8 -> mm1 */ - paddb_r2r(mm0, mm2); /* mm0 + mm2(dst1) -> mm2 */ - - psubw_r2r(mm6, mm1);/* src2 - dst2 -> mm1 */ - pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */ - psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1 */ - paddb_r2r(mm1, mm6); /* mm1 + mm6(dst2) -> mm6 */ - - packuswb_r2r(mm6, mm2); /* ARGBARGB -> mm2 */ - por_r2r(mm7, mm2); /* mm7(dst alpha) | mm2 -> mm2 */ - - movq_r2m(mm2, *dstp);/* mm2 -> 2 x pixel */ + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + Uint32 dalpha = info->dst_fmt->Amask; + + __m64 src1, src2, dst1, dst2, lmask, hmask, dsta; + + hmask = _mm_set_pi32(0x00fefefe, 0x00fefefe); /* alpha128 mask -> hmask */ + lmask = _mm_set_pi32(0x00010101, 0x00010101); /* !alpha128 mask -> lmask */ + dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ + + while (height--) { + int n = width; + if (n & 1) { + Uint32 s = *srcp++; + Uint32 d = *dstp; + *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) + + (s & d & 0x00010101)) | dalpha; + n--; + } - srcp += 2; - dstp += 2; - }, width); - srcp += srcskip; - dstp += dstskip; - } - emms(); - } -} + for (n >>= 1; n > 0; --n) { + dst1 = *(__m64 *) dstp; /* 2 x dst -> dst1(ARGBARGB) */ + dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ -/* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) -{ - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - SDL_PixelFormat* sf = info->src; - Uint32 amask = sf->Amask; - - pxor_r2r(mm6, mm6); /* 0 -> mm6 */ - /* form multiplication mask */ - movd_m2r(sf->Amask, mm7); /* 0000F000 -> mm7 */ - punpcklbw_r2r(mm7, mm7); /* FF000000 -> mm7 */ - pcmpeqb_r2r(mm0, mm0); /* FFFFFFFF -> mm0 */ - movq_r2r(mm0, mm3); /* FFFFFFFF -> mm3 (for later) */ - pxor_r2r(mm0, mm7); /* 00FFFFFF -> mm7 (mult mask) */ - /* form channel masks */ - movq_r2r(mm7, mm0); /* 00FFFFFF -> mm0 */ - packsswb_r2r(mm6, mm0); /* 00000FFF -> mm0 (channel mask) */ - packsswb_r2r(mm6, mm3); /* 0000FFFF -> mm3 */ - pxor_r2r(mm0, mm3); /* 0000F000 -> mm3 (~channel mask) */ - /* get alpha channel shift */ - __asm__ __volatile__ ( - "movd %0, %%mm5" - : : "rm" ((Uint32) sf->Ashift) ); /* Ashift -> mm5 */ - - while(height--) { - DUFFS_LOOP4({ - Uint32 alpha = *srcp & amask; - /* FIXME: Here we special-case opaque alpha since the - compositioning used (>>8 instead of /255) doesn't handle - it correctly. Also special-case alpha=0 for speed? - Benchmark this! */ - if(alpha == 0) { - /* do nothing */ - } else if(alpha == amask) { - /* opaque alpha -- copy RGB, keep dst alpha */ - /* using MMX here to free up regular registers for other things */ - movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/ - movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/ - pand_r2r(mm0, mm1); /* src & chanmask -> mm1 */ - pand_r2r(mm3, mm2); /* dst & ~chanmask -> mm2 */ - por_r2r(mm1, mm2); /* src | dst -> mm2 */ - movd_r2m(mm2, (*dstp)); /* mm2 -> dst */ - } else { - movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/ - punpcklbw_r2r(mm6, mm1); /* 0A0R0G0B -> mm1 */ + src1 = *(__m64 *) srcp; /* 2 x src -> src1(ARGBARGB) */ + src2 = src1; /* 2 x src -> src2(ARGBARGB) */ - movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/ - punpcklbw_r2r(mm6, mm2); /* 0A0R0G0B -> mm2 */ + dst2 = _mm_and_si64(dst2, hmask); /* dst & mask -> dst2 */ + src2 = _mm_and_si64(src2, hmask); /* src & mask -> src2 */ + src2 = _mm_add_pi32(src2, dst2); /* dst2 + src2 -> src2 */ + src2 = _mm_srli_pi32(src2, 1); /* src2 >> 1 -> src2 */ - __asm__ __volatile__ ( - "movd %0, %%mm4" - : : "r" (alpha) ); /* 0000A000 -> mm4 */ - psrld_r2r(mm5, mm4); /* mm4 >> mm5 -> mm4 (0000000A) */ - punpcklwd_r2r(mm4, mm4); /* 00000A0A -> mm4 */ - punpcklwd_r2r(mm4, mm4); /* 0A0A0A0A -> mm4 */ - pand_r2r(mm7, mm4); /* 000A0A0A -> mm4, preserve dst alpha on add */ + dst1 = _mm_and_si64(dst1, src1); /* src & dst -> dst1 */ + dst1 = _mm_and_si64(dst1, lmask); /* dst1 & !mask -> dst1 */ + dst1 = _mm_add_pi32(dst1, src2); /* src2 + dst1 -> dst1 */ + dst1 = _mm_or_si64(dst1, dsta); /* dsta(full alpha) | dst1 -> dst1 */ - /* blend */ - psubw_r2r(mm2, mm1);/* src - dst -> mm1 */ - pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */ - psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1(000R0G0B) */ - paddb_r2r(mm1, mm2); /* mm1 + mm2(dst) -> mm2 */ - - packuswb_r2r(mm6, mm2); /* 0000ARGB -> mm2 */ - movd_r2m(mm2, *dstp);/* mm2 -> dst */ - } - ++srcp; - ++dstp; - }, width); - srcp += srcskip; - dstp += dstskip; - } - emms(); -} -/* End GCC_ASMBLIT */ + *(__m64 *) dstp = dst1; /* dst1 -> 2 x dst pixels */ + dstp += 2; + srcp += 2; + } -#elif MSVC_ASMBLIT -/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ -static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info) -{ - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - Uint32 dalpha = info->dst->Amask; - - __m64 src1, src2, dst1, dst2, lmask, hmask, dsta; - - hmask = _mm_set_pi32(0x00fefefe, 0x00fefefe); /* alpha128 mask -> hmask */ - lmask = _mm_set_pi32(0x00010101, 0x00010101); /* !alpha128 mask -> lmask */ - dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ - - while (height--) { - int n = width; - if ( n & 1 ) { - Uint32 s = *srcp++; - Uint32 d = *dstp; - *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) - + (s & d & 0x00010101)) | dalpha; - n--; - } - - for (n >>= 1; n > 0; --n) { - dst1 = *(__m64*)dstp; /* 2 x dst -> dst1(ARGBARGB) */ - dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ - - src1 = *(__m64*)srcp; /* 2 x src -> src1(ARGBARGB) */ - src2 = src1; /* 2 x src -> src2(ARGBARGB) */ - - dst2 = _mm_and_si64(dst2, hmask); /* dst & mask -> dst2 */ - src2 = _mm_and_si64(src2, hmask); /* src & mask -> src2 */ - src2 = _mm_add_pi32(src2, dst2); /* dst2 + src2 -> src2 */ - src2 = _mm_srli_pi32(src2, 1); /* src2 >> 1 -> src2 */ - - dst1 = _mm_and_si64(dst1, src1); /* src & dst -> dst1 */ - dst1 = _mm_and_si64(dst1, lmask); /* dst1 & !mask -> dst1 */ - dst1 = _mm_add_pi32(dst1, src2); /* src2 + dst1 -> dst1 */ - dst1 = _mm_or_si64(dst1, dsta); /* dsta(full alpha) | dst1 -> dst1 */ - - *(__m64*)dstp = dst1; /* dst1 -> 2 x dst pixels */ - dstp += 2; - srcp += 2; - } - - srcp += srcskip; - dstp += dstskip; - } - _mm_empty(); + srcp += srcskip; + dstp += dstskip; + } + _mm_empty(); } /* fast RGB888->(A)RGB888 blending with surface alpha */ -static void BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info) +static void +BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo * info) { - SDL_PixelFormat* df = info->dst; - Uint32 chanmask = df->Rmask | df->Gmask | df->Bmask; - unsigned alpha = info->src->alpha; - - if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) { - /* only call a128 version when R,G,B occupy lower bits */ - BlitRGBtoRGBSurfaceAlpha128MMX(info); - } else { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - Uint32 dalpha = df->Amask; - Uint32 amult; - - __m64 src1, src2, dst1, dst2, mm_alpha, mm_zero, dsta; - - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ - /* form the alpha mult */ - amult = alpha | (alpha << 8); - amult = amult | (amult << 16); - chanmask = (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift); - mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */ - mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */ - /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */ - dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ - - while (height--) { - int n = width; - if (n & 1) { - /* One Pixel Blend */ - src2 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src2 (0000ARGB)*/ - src2 = _mm_unpacklo_pi8(src2, mm_zero); /* 0A0R0G0B -> src2 */ - - dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB)*/ - dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */ - - src2 = _mm_sub_pi16(src2, dst1); /* src2 - dst2 -> src2 */ - src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ - src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ - dst1 = _mm_add_pi8(src2, dst1); /* src2 + dst1 -> dst1 */ - - dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */ - dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ - *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */ + SDL_PixelFormat *df = info->dst_fmt; + Uint32 chanmask; + unsigned alpha = info->a; - ++srcp; - ++dstp; - - n--; - } - - for (n >>= 1; n > 0; --n) { - /* Two Pixels Blend */ - src1 = *(__m64*)srcp; /* 2 x src -> src1(ARGBARGB)*/ - src2 = src1; /* 2 x src -> src2(ARGBARGB) */ - src1 = _mm_unpacklo_pi8(src1, mm_zero); /* low - 0A0R0G0B -> src1 */ - src2 = _mm_unpackhi_pi8(src2, mm_zero); /* high - 0A0R0G0B -> src2 */ - - dst1 = *(__m64*)dstp;/* 2 x dst -> dst1(ARGBARGB) */ - dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ - dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* low - 0A0R0G0B -> dst1 */ - dst2 = _mm_unpackhi_pi8(dst2, mm_zero); /* high - 0A0R0G0B -> dst2 */ - - src1 = _mm_sub_pi16(src1, dst1);/* src1 - dst1 -> src1 */ - src1 = _mm_mullo_pi16(src1, mm_alpha); /* src1 * alpha -> src1 */ - src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1 */ - dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst1) -> dst1 */ - - src2 = _mm_sub_pi16(src2, dst2);/* src2 - dst2 -> src2 */ - src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ - src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ - dst2 = _mm_add_pi8(src2, dst2); /* src2 + dst2(dst2) -> dst2 */ - - dst1 = _mm_packs_pu16(dst1, dst2); /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */ - dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ + if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) { + /* only call a128 version when R,G,B occupy lower bits */ + BlitRGBtoRGBSurfaceAlpha128MMX(info); + } else { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + Uint32 dalpha = df->Amask; + Uint32 amult; + + __m64 src1, src2, dst1, dst2, mm_alpha, mm_zero, dsta; + + mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ + /* form the alpha mult */ + amult = alpha | (alpha << 8); + amult = amult | (amult << 16); + chanmask = + (0xff << df->Rshift) | (0xff << df-> + Gshift) | (0xff << df->Bshift); + mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */ + mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */ + /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */ + dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ + + while (height--) { + int n = width; + if (n & 1) { + /* One Pixel Blend */ + src2 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src2 (0000ARGB) */ + src2 = _mm_unpacklo_pi8(src2, mm_zero); /* 0A0R0G0B -> src2 */ + + dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */ + dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */ + + src2 = _mm_sub_pi16(src2, dst1); /* src2 - dst2 -> src2 */ + src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ + src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ + dst1 = _mm_add_pi8(src2, dst1); /* src2 + dst1 -> dst1 */ + + dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */ + dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ + *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */ + + ++srcp; + ++dstp; + + n--; + } - *(__m64*)dstp = dst1; /* dst1 -> 2 x pixel */ + for (n >>= 1; n > 0; --n) { + /* Two Pixels Blend */ + src1 = *(__m64 *) srcp; /* 2 x src -> src1(ARGBARGB) */ + src2 = src1; /* 2 x src -> src2(ARGBARGB) */ + src1 = _mm_unpacklo_pi8(src1, mm_zero); /* low - 0A0R0G0B -> src1 */ + src2 = _mm_unpackhi_pi8(src2, mm_zero); /* high - 0A0R0G0B -> src2 */ - srcp += 2; - dstp += 2; - } - srcp += srcskip; - dstp += dstskip; - } - _mm_empty(); - } + dst1 = *(__m64 *) dstp; /* 2 x dst -> dst1(ARGBARGB) */ + dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ + dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* low - 0A0R0G0B -> dst1 */ + dst2 = _mm_unpackhi_pi8(dst2, mm_zero); /* high - 0A0R0G0B -> dst2 */ + + src1 = _mm_sub_pi16(src1, dst1); /* src1 - dst1 -> src1 */ + src1 = _mm_mullo_pi16(src1, mm_alpha); /* src1 * alpha -> src1 */ + src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1 */ + dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst1) -> dst1 */ + + src2 = _mm_sub_pi16(src2, dst2); /* src2 - dst2 -> src2 */ + src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ + src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ + dst2 = _mm_add_pi8(src2, dst2); /* src2 + dst2(dst2) -> dst2 */ + + dst1 = _mm_packs_pu16(dst1, dst2); /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */ + dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ + + *(__m64 *) dstp = dst1; /* dst1 -> 2 x pixel */ + + srcp += 2; + dstp += 2; + } + srcp += srcskip; + dstp += dstskip; + } + _mm_empty(); + } } /* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) +static void +BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - SDL_PixelFormat* sf = info->src; - Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask; - Uint32 amask = sf->Amask; - Uint32 ashift = sf->Ashift; - Uint64 multmask; - - __m64 src1, dst1, mm_alpha, mm_zero, dmask; - - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ - multmask = ~(0xFFFFi64 << (ashift * 2)); - dmask = *(__m64*) &multmask; /* dst alpha mask -> dmask */ - - while(height--) { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + SDL_PixelFormat *sf = info->src_fmt; + Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask; + Uint32 amask = sf->Amask; + Uint32 ashift = sf->Ashift; + Uint64 multmask; + + __m64 src1, dst1, mm_alpha, mm_zero, dmask; + + mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ + multmask = 0xFFFF; + multmask <<= (ashift * 2); + multmask = ~multmask; + dmask = *(__m64 *) & multmask; /* dst alpha mask -> dmask */ + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ Uint32 alpha = *srcp & amask; if (alpha == 0) { @@ -646,836 +381,62 @@ static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) ++srcp; ++dstp; }, width); - srcp += srcskip; - dstp += dstskip; - } - _mm_empty(); -} -/* End MSVC_ASMBLIT */ - -#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */ - -#if SDL_ALTIVEC_BLITTERS -#if __MWERKS__ -#pragma altivec_model on -#endif -#if HAVE_ALTIVEC_H -#include -#endif -#include - -#if (defined(__MACOSX__) && (__GNUC__ < 4)) - #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ - (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p ) - #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ - (vector unsigned short) ( a,b,c,d,e,f,g,h ) -#else - #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ - (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p } - #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ - (vector unsigned short) { a,b,c,d,e,f,g,h } -#endif - -#define UNALIGNED_PTR(x) (((size_t) x) & 0x0000000F) -#define VECPRINT(msg, v) do { \ - vector unsigned int tmpvec = (vector unsigned int)(v); \ - unsigned int *vp = (unsigned int *)&tmpvec; \ - printf("%s = %08X %08X %08X %08X\n", msg, vp[0], vp[1], vp[2], vp[3]); \ -} while (0) - -/* the permuation vector that takes the high bytes out of all the appropriate shorts - (vector unsigned char)( - 0x00, 0x10, 0x02, 0x12, - 0x04, 0x14, 0x06, 0x16, - 0x08, 0x18, 0x0A, 0x1A, - 0x0C, 0x1C, 0x0E, 0x1E ); -*/ -#define VEC_MERGE_PERMUTE() (vec_add(vec_lvsl(0, (int*)NULL), (vector unsigned char)vec_splat_u16(0x0F))) -#define VEC_U32_24() (vec_add(vec_splat_u32(12), vec_splat_u32(12))) -#define VEC_ALPHA_MASK() ((vector unsigned char)vec_sl((vector unsigned int)vec_splat_s8(-1), VEC_U32_24())) -#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \ - ? vec_lvsl(0, src) \ - : vec_add(vec_lvsl(8, src), vec_splat_u8(8))) - - -#define VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1_16, v8_16) do { \ - /* vtemp1 contains source AAGGAAGGAAGGAAGG */ \ - vector unsigned short vtemp1 = vec_mule(vs, valpha); \ - /* vtemp2 contains source RRBBRRBBRRBBRRBB */ \ - vector unsigned short vtemp2 = vec_mulo(vs, valpha); \ - /* valpha2 is 255-alpha */ \ - vector unsigned char valpha2 = vec_nor(valpha, valpha); \ - /* vtemp3 contains dest AAGGAAGGAAGGAAGG */ \ - vector unsigned short vtemp3 = vec_mule(vd, valpha2); \ - /* vtemp4 contains dest RRBBRRBBRRBBRRBB */ \ - vector unsigned short vtemp4 = vec_mulo(vd, valpha2); \ - /* add source and dest */ \ - vtemp1 = vec_add(vtemp1, vtemp3); \ - vtemp2 = vec_add(vtemp2, vtemp4); \ - /* vtemp1 = (vtemp1 + 1) + ((vtemp1 + 1) >> 8) */ \ - vtemp1 = vec_add(vtemp1, v1_16); \ - vtemp3 = vec_sr(vtemp1, v8_16); \ - vtemp1 = vec_add(vtemp1, vtemp3); \ - /* vtemp2 = (vtemp2 + 1) + ((vtemp2 + 1) >> 8) */ \ - vtemp2 = vec_add(vtemp2, v1_16); \ - vtemp4 = vec_sr(vtemp2, v8_16); \ - vtemp2 = vec_add(vtemp2, vtemp4); \ - /* (>>8) and get ARGBARGBARGBARGB */ \ - vd = (vector unsigned char)vec_perm(vtemp1, vtemp2, mergePermute); \ -} while (0) - -/* Calculate the permute vector used for 32->32 swizzling */ -static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt, - const SDL_PixelFormat *dstfmt) -{ - /* - * We have to assume that the bits that aren't used by other - * colors is alpha, and it's one complete byte, since some formats - * leave alpha with a zero mask, but we should still swizzle the bits. - */ - /* ARGB */ - const static struct SDL_PixelFormat default_pixel_format = { - NULL, 0, 0, - 0, 0, 0, 0, - 16, 8, 0, 24, - 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, - 0, 0}; - if (!srcfmt) { - srcfmt = &default_pixel_format; - } - if (!dstfmt) { - dstfmt = &default_pixel_format; - } - const vector unsigned char plus = VECUINT8_LITERAL - ( 0x00, 0x00, 0x00, 0x00, - 0x04, 0x04, 0x04, 0x04, - 0x08, 0x08, 0x08, 0x08, - 0x0C, 0x0C, 0x0C, 0x0C ); - vector unsigned char vswiz; - vector unsigned int srcvec; -#define RESHIFT(X) (3 - ((X) >> 3)) - Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift); - Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift); - Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift); - Uint32 amask; - /* Use zero for alpha if either surface doesn't have alpha */ - if (dstfmt->Amask) { - amask = ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift); - } else { - amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF); - } -#undef RESHIFT - ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask); - vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0)); - return(vswiz); -} - -static void Blit32to565PixelAlphaAltivec(SDL_BlitInfo *info) -{ - int height = info->d_height; - Uint8 *src = (Uint8 *)info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = (Uint8 *)info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - - vector unsigned char v0 = vec_splat_u8(0); - vector unsigned short v8_16 = vec_splat_u16(8); - vector unsigned short v1_16 = vec_splat_u16(1); - vector unsigned short v2_16 = vec_splat_u16(2); - vector unsigned short v3_16 = vec_splat_u16(3); - vector unsigned int v8_32 = vec_splat_u32(8); - vector unsigned int v16_32 = vec_add(v8_32, v8_32); - vector unsigned short v3f = VECUINT16_LITERAL( - 0x003f, 0x003f, 0x003f, 0x003f, - 0x003f, 0x003f, 0x003f, 0x003f); - vector unsigned short vfc = VECUINT16_LITERAL( - 0x00fc, 0x00fc, 0x00fc, 0x00fc, - 0x00fc, 0x00fc, 0x00fc, 0x00fc); - - /* - 0x10 - 0x1f is the alpha - 0x00 - 0x0e evens are the red - 0x01 - 0x0f odds are zero - */ - vector unsigned char vredalpha1 = VECUINT8_LITERAL( - 0x10, 0x00, 0x01, 0x01, - 0x10, 0x02, 0x01, 0x01, - 0x10, 0x04, 0x01, 0x01, - 0x10, 0x06, 0x01, 0x01 - ); - vector unsigned char vredalpha2 = (vector unsigned char)( - vec_add((vector unsigned int)vredalpha1, vec_sl(v8_32, v16_32)) - ); - /* - 0x00 - 0x0f is ARxx ARxx ARxx ARxx - 0x11 - 0x0f odds are blue - */ - vector unsigned char vblue1 = VECUINT8_LITERAL( - 0x00, 0x01, 0x02, 0x11, - 0x04, 0x05, 0x06, 0x13, - 0x08, 0x09, 0x0a, 0x15, - 0x0c, 0x0d, 0x0e, 0x17 - ); - vector unsigned char vblue2 = (vector unsigned char)( - vec_add((vector unsigned int)vblue1, v8_32) - ); - /* - 0x00 - 0x0f is ARxB ARxB ARxB ARxB - 0x10 - 0x0e evens are green - */ - vector unsigned char vgreen1 = VECUINT8_LITERAL( - 0x00, 0x01, 0x10, 0x03, - 0x04, 0x05, 0x12, 0x07, - 0x08, 0x09, 0x14, 0x0b, - 0x0c, 0x0d, 0x16, 0x0f - ); - vector unsigned char vgreen2 = (vector unsigned char)( - vec_add((vector unsigned int)vgreen1, vec_sl(v8_32, v8_32)) - ); - vector unsigned char vgmerge = VECUINT8_LITERAL( - 0x00, 0x02, 0x00, 0x06, - 0x00, 0x0a, 0x00, 0x0e, - 0x00, 0x12, 0x00, 0x16, - 0x00, 0x1a, 0x00, 0x1e); - vector unsigned char mergePermute = VEC_MERGE_PERMUTE(); - vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL); - vector unsigned char valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC)); - - vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7); - vf800 = vec_sl(vf800, vec_splat_u16(8)); - - while(height--) { - int extrawidth; - vector unsigned char valigner; - vector unsigned char vsrc; - vector unsigned char voverflow; - int width = info->d_width; - -#define ONE_PIXEL_BLEND(condition, widthvar) \ - while (condition) { \ - Uint32 Pixel; \ - unsigned sR, sG, sB, dR, dG, dB, sA; \ - DISEMBLE_RGBA(src, 4, srcfmt, Pixel, sR, sG, sB, sA); \ - if(sA) { \ - unsigned short dstpixel = *((unsigned short *)dst); \ - dR = (dstpixel >> 8) & 0xf8; \ - dG = (dstpixel >> 3) & 0xfc; \ - dB = (dstpixel << 3) & 0xf8; \ - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \ - *((unsigned short *)dst) = ( \ - ((dR & 0xf8) << 8) | ((dG & 0xfc) << 3) | (dB >> 3) \ - ); \ - } \ - src += 4; \ - dst += 2; \ - widthvar--; \ - } - ONE_PIXEL_BLEND((UNALIGNED_PTR(dst)) && (width), width); - extrawidth = (width % 8); - valigner = VEC_ALIGNER(src); - vsrc = (vector unsigned char)vec_ld(0, src); - width -= extrawidth; - while (width) { - vector unsigned char valpha; - vector unsigned char vsrc1, vsrc2; - vector unsigned char vdst1, vdst2; - vector unsigned short vR, vG, vB; - vector unsigned short vpixel, vrpixel, vgpixel, vbpixel; - - /* Load 8 pixels from src as ARGB */ - voverflow = (vector unsigned char)vec_ld(15, src); - vsrc = vec_perm(vsrc, voverflow, valigner); - vsrc1 = vec_perm(vsrc, vsrc, vpermute); - src += 16; - vsrc = (vector unsigned char)vec_ld(15, src); - voverflow = vec_perm(voverflow, vsrc, valigner); - vsrc2 = vec_perm(voverflow, voverflow, vpermute); - src += 16; - - /* Load 8 pixels from dst as XRGB */ - voverflow = vec_ld(0, dst); - vR = vec_and((vector unsigned short)voverflow, vf800); - vB = vec_sl((vector unsigned short)voverflow, v3_16); - vG = vec_sl(vB, v2_16); - vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, (vector unsigned char)vR, vredalpha1); - vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1); - vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1); - vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, (vector unsigned char)vR, vredalpha2); - vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2); - vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2); - - /* Alpha blend 8 pixels as ARGB */ - valpha = vec_perm(vsrc1, v0, valphaPermute); - VEC_MULTIPLY_ALPHA(vsrc1, vdst1, valpha, mergePermute, v1_16, v8_16); - valpha = vec_perm(vsrc2, v0, valphaPermute); - VEC_MULTIPLY_ALPHA(vsrc2, vdst2, valpha, mergePermute, v1_16, v8_16); - - /* Convert 8 pixels to 565 */ - vpixel = (vector unsigned short)vec_packpx((vector unsigned int)vdst1, (vector unsigned int)vdst2); - vgpixel = (vector unsigned short)vec_perm(vdst1, vdst2, vgmerge); - vgpixel = vec_and(vgpixel, vfc); - vgpixel = vec_sl(vgpixel, v3_16); - vrpixel = vec_sl(vpixel, v1_16); - vrpixel = vec_and(vrpixel, vf800); - vbpixel = vec_and(vpixel, v3f); - vdst1 = vec_or((vector unsigned char)vrpixel, (vector unsigned char)vgpixel); - vdst1 = vec_or(vdst1, (vector unsigned char)vbpixel); - - /* Store 8 pixels */ - vec_st(vdst1, 0, dst); - - width -= 8; - dst += 16; - } - ONE_PIXEL_BLEND((extrawidth), extrawidth); -#undef ONE_PIXEL_BLEND - src += srcskip; - dst += dstskip; - } -} - -static void Blit32to32SurfaceAlphaKeyAltivec(SDL_BlitInfo *info) -{ - unsigned alpha = info->src->alpha; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - unsigned sA = srcfmt->alpha; - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; - Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask; - Uint32 ckey = info->src->colorkey; - vector unsigned char mergePermute; - vector unsigned char vsrcPermute; - vector unsigned char vdstPermute; - vector unsigned char vsdstPermute; - vector unsigned char valpha; - vector unsigned char valphamask; - vector unsigned char vbits; - vector unsigned char v0; - vector unsigned short v1; - vector unsigned short v8; - vector unsigned int vckey; - vector unsigned int vrgbmask; - - mergePermute = VEC_MERGE_PERMUTE(); - v0 = vec_splat_u8(0); - v1 = vec_splat_u16(1); - v8 = vec_splat_u16(8); - - /* set the alpha to 255 on the destination surf */ - valphamask = VEC_ALPHA_MASK(); - - vsrcPermute = calc_swizzle32(srcfmt, NULL); - vdstPermute = calc_swizzle32(NULL, dstfmt); - vsdstPermute = calc_swizzle32(dstfmt, NULL); - - /* set a vector full of alpha and 255-alpha */ - ((unsigned char *)&valpha)[0] = alpha; - valpha = vec_splat(valpha, 0); - vbits = (vector unsigned char)vec_splat_s8(-1); - - ckey &= rgbmask; - ((unsigned int *)(char*)&vckey)[0] = ckey; - vckey = vec_splat(vckey, 0); - ((unsigned int *)(char*)&vrgbmask)[0] = rgbmask; - vrgbmask = vec_splat(vrgbmask, 0); - - while(height--) { - int width = info->d_width; -#define ONE_PIXEL_BLEND(condition, widthvar) \ - while (condition) { \ - Uint32 Pixel; \ - unsigned sR, sG, sB, dR, dG, dB; \ - RETRIEVE_RGB_PIXEL(((Uint8 *)srcp), 4, Pixel); \ - if(sA && Pixel != ckey) { \ - RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \ - DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \ - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \ - ASSEMBLE_RGBA(((Uint8 *)dstp), 4, dstfmt, dR, dG, dB, dA); \ - } \ - dstp++; \ - srcp++; \ - widthvar--; \ - } - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width); - if (width > 0) { - int extrawidth = (width % 4); - vector unsigned char valigner = VEC_ALIGNER(srcp); - vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp); - width -= extrawidth; - while (width) { - vector unsigned char vsel; - vector unsigned char voverflow; - vector unsigned char vd; - vector unsigned char vd_orig; - - /* s = *srcp */ - voverflow = (vector unsigned char)vec_ld(15, srcp); - vs = vec_perm(vs, voverflow, valigner); - - /* vsel is set for items that match the key */ - vsel = (vector unsigned char)vec_and((vector unsigned int)vs, vrgbmask); - vsel = (vector unsigned char)vec_cmpeq((vector unsigned int)vsel, vckey); - - /* permute to source format */ - vs = vec_perm(vs, valpha, vsrcPermute); - - /* d = *dstp */ - vd = (vector unsigned char)vec_ld(0, dstp); - vd_orig = vd = vec_perm(vd, v0, vsdstPermute); - - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8); - - /* set the alpha channel to full on */ - vd = vec_or(vd, valphamask); - - /* mask out color key */ - vd = vec_sel(vd, vd_orig, vsel); - - /* permute to dest format */ - vd = vec_perm(vd, vbits, vdstPermute); - - /* *dstp = res */ - vec_st((vector unsigned int)vd, 0, dstp); - - srcp += 4; - dstp += 4; - width -= 4; - vs = voverflow; - } - ONE_PIXEL_BLEND((extrawidth), extrawidth); - } -#undef ONE_PIXEL_BLEND - + /* *INDENT-ON* */ srcp += srcskip; dstp += dstskip; } + _mm_empty(); } - -static void Blit32to32PixelAlphaAltivec(SDL_BlitInfo *info) -{ - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - vector unsigned char mergePermute; - vector unsigned char valphaPermute; - vector unsigned char vsrcPermute; - vector unsigned char vdstPermute; - vector unsigned char vsdstPermute; - vector unsigned char valphamask; - vector unsigned char vpixelmask; - vector unsigned char v0; - vector unsigned short v1; - vector unsigned short v8; - - v0 = vec_splat_u8(0); - v1 = vec_splat_u16(1); - v8 = vec_splat_u16(8); - mergePermute = VEC_MERGE_PERMUTE(); - valphamask = VEC_ALPHA_MASK(); - valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC)); - vpixelmask = vec_nor(valphamask, v0); - vsrcPermute = calc_swizzle32(srcfmt, NULL); - vdstPermute = calc_swizzle32(NULL, dstfmt); - vsdstPermute = calc_swizzle32(dstfmt, NULL); - - while ( height-- ) { - width = info->d_width; -#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \ - Uint32 Pixel; \ - unsigned sR, sG, sB, dR, dG, dB, sA, dA; \ - DISEMBLE_RGBA((Uint8 *)srcp, 4, srcfmt, Pixel, sR, sG, sB, sA); \ - if(sA) { \ - DISEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, Pixel, dR, dG, dB, dA); \ - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \ - ASSEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, dR, dG, dB, dA); \ - } \ - ++srcp; \ - ++dstp; \ - widthvar--; \ - } - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width); - if (width > 0) { - /* vsrcPermute */ - /* vdstPermute */ - int extrawidth = (width % 4); - vector unsigned char valigner = VEC_ALIGNER(srcp); - vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp); - width -= extrawidth; - while (width) { - vector unsigned char voverflow; - vector unsigned char vd; - vector unsigned char valpha; - vector unsigned char vdstalpha; - /* s = *srcp */ - voverflow = (vector unsigned char)vec_ld(15, srcp); - vs = vec_perm(vs, voverflow, valigner); - vs = vec_perm(vs, v0, vsrcPermute); - - valpha = vec_perm(vs, v0, valphaPermute); - - /* d = *dstp */ - vd = (vector unsigned char)vec_ld(0, dstp); - vd = vec_perm(vd, v0, vsdstPermute); - vdstalpha = vec_and(vd, valphamask); - - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8); - - /* set the alpha to the dest alpha */ - vd = vec_and(vd, vpixelmask); - vd = vec_or(vd, vdstalpha); - vd = vec_perm(vd, v0, vdstPermute); - - /* *dstp = res */ - vec_st((vector unsigned int)vd, 0, dstp); - - srcp += 4; - dstp += 4; - width -= 4; - vs = voverflow; - - } - ONE_PIXEL_BLEND((extrawidth), extrawidth); - } - srcp += srcskip; - dstp += dstskip; -#undef ONE_PIXEL_BLEND - } -} - -/* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void BlitRGBtoRGBPixelAlphaAltivec(SDL_BlitInfo *info) -{ - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - vector unsigned char mergePermute; - vector unsigned char valphaPermute; - vector unsigned char valphamask; - vector unsigned char vpixelmask; - vector unsigned char v0; - vector unsigned short v1; - vector unsigned short v8; - v0 = vec_splat_u8(0); - v1 = vec_splat_u16(1); - v8 = vec_splat_u16(8); - mergePermute = VEC_MERGE_PERMUTE(); - valphamask = VEC_ALPHA_MASK(); - valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC)); - - - vpixelmask = vec_nor(valphamask, v0); - while(height--) { - width = info->d_width; -#define ONE_PIXEL_BLEND(condition, widthvar) \ - while ((condition)) { \ - Uint32 dalpha; \ - Uint32 d; \ - Uint32 s1; \ - Uint32 d1; \ - Uint32 s = *srcp; \ - Uint32 alpha = s >> 24; \ - if(alpha) { \ - if(alpha == SDL_ALPHA_OPAQUE) { \ - *dstp = (s & 0x00ffffff) | (*dstp & 0xff000000); \ - } else { \ - d = *dstp; \ - dalpha = d & 0xff000000; \ - s1 = s & 0xff00ff; \ - d1 = d & 0xff00ff; \ - d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ - s &= 0xff00; \ - d &= 0xff00; \ - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ - *dstp = d1 | d | dalpha; \ - } \ - } \ - ++srcp; \ - ++dstp; \ - widthvar--; \ - } - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width); - if (width > 0) { - int extrawidth = (width % 4); - vector unsigned char valigner = VEC_ALIGNER(srcp); - vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp); - width -= extrawidth; - while (width) { - vector unsigned char voverflow; - vector unsigned char vd; - vector unsigned char valpha; - vector unsigned char vdstalpha; - /* s = *srcp */ - voverflow = (vector unsigned char)vec_ld(15, srcp); - vs = vec_perm(vs, voverflow, valigner); - - valpha = vec_perm(vs, v0, valphaPermute); - - /* d = *dstp */ - vd = (vector unsigned char)vec_ld(0, dstp); - vdstalpha = vec_and(vd, valphamask); - - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8); - - /* set the alpha to the dest alpha */ - vd = vec_and(vd, vpixelmask); - vd = vec_or(vd, vdstalpha); - - /* *dstp = res */ - vec_st((vector unsigned int)vd, 0, dstp); - - srcp += 4; - dstp += 4; - width -= 4; - vs = voverflow; - } - ONE_PIXEL_BLEND((extrawidth), extrawidth); - } - srcp += srcskip; - dstp += dstskip; - } -#undef ONE_PIXEL_BLEND -} - -static void Blit32to32SurfaceAlphaAltivec(SDL_BlitInfo *info) -{ - /* XXX : 6 */ - unsigned alpha = info->src->alpha; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - unsigned sA = srcfmt->alpha; - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; - vector unsigned char mergePermute; - vector unsigned char vsrcPermute; - vector unsigned char vdstPermute; - vector unsigned char vsdstPermute; - vector unsigned char valpha; - vector unsigned char valphamask; - vector unsigned char vbits; - vector unsigned short v1; - vector unsigned short v8; - - mergePermute = VEC_MERGE_PERMUTE(); - v1 = vec_splat_u16(1); - v8 = vec_splat_u16(8); - - /* set the alpha to 255 on the destination surf */ - valphamask = VEC_ALPHA_MASK(); - - vsrcPermute = calc_swizzle32(srcfmt, NULL); - vdstPermute = calc_swizzle32(NULL, dstfmt); - vsdstPermute = calc_swizzle32(dstfmt, NULL); - - /* set a vector full of alpha and 255-alpha */ - ((unsigned char *)&valpha)[0] = alpha; - valpha = vec_splat(valpha, 0); - vbits = (vector unsigned char)vec_splat_s8(-1); - - while(height--) { - int width = info->d_width; -#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \ - Uint32 Pixel; \ - unsigned sR, sG, sB, dR, dG, dB; \ - DISEMBLE_RGB(((Uint8 *)srcp), 4, srcfmt, Pixel, sR, sG, sB); \ - DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \ - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \ - ASSEMBLE_RGBA(((Uint8 *)dstp), 4, dstfmt, dR, dG, dB, dA); \ - ++srcp; \ - ++dstp; \ - widthvar--; \ - } - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width); - if (width > 0) { - int extrawidth = (width % 4); - vector unsigned char valigner = VEC_ALIGNER(srcp); - vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp); - width -= extrawidth; - while (width) { - vector unsigned char voverflow; - vector unsigned char vd; - - /* s = *srcp */ - voverflow = (vector unsigned char)vec_ld(15, srcp); - vs = vec_perm(vs, voverflow, valigner); - vs = vec_perm(vs, valpha, vsrcPermute); - - /* d = *dstp */ - vd = (vector unsigned char)vec_ld(0, dstp); - vd = vec_perm(vd, vd, vsdstPermute); - - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8); - - /* set the alpha channel to full on */ - vd = vec_or(vd, valphamask); - vd = vec_perm(vd, vbits, vdstPermute); - - /* *dstp = res */ - vec_st((vector unsigned int)vd, 0, dstp); - - srcp += 4; - dstp += 4; - width -= 4; - vs = voverflow; - } - ONE_PIXEL_BLEND((extrawidth), extrawidth); - } -#undef ONE_PIXEL_BLEND - - srcp += srcskip; - dstp += dstskip; - } - -} - - -/* fast RGB888->(A)RGB888 blending */ -static void BlitRGBtoRGBSurfaceAlphaAltivec(SDL_BlitInfo *info) -{ - unsigned alpha = info->src->alpha; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - vector unsigned char mergePermute; - vector unsigned char valpha; - vector unsigned char valphamask; - vector unsigned short v1; - vector unsigned short v8; - - mergePermute = VEC_MERGE_PERMUTE(); - v1 = vec_splat_u16(1); - v8 = vec_splat_u16(8); - - /* set the alpha to 255 on the destination surf */ - valphamask = VEC_ALPHA_MASK(); - - /* set a vector full of alpha and 255-alpha */ - ((unsigned char *)&valpha)[0] = alpha; - valpha = vec_splat(valpha, 0); - - while(height--) { - int width = info->d_width; -#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \ - Uint32 s = *srcp; \ - Uint32 d = *dstp; \ - Uint32 s1 = s & 0xff00ff; \ - Uint32 d1 = d & 0xff00ff; \ - d1 = (d1 + ((s1 - d1) * alpha >> 8)) \ - & 0xff00ff; \ - s &= 0xff00; \ - d &= 0xff00; \ - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ - *dstp = d1 | d | 0xff000000; \ - ++srcp; \ - ++dstp; \ - widthvar--; \ - } - ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width); - if (width > 0) { - int extrawidth = (width % 4); - vector unsigned char valigner = VEC_ALIGNER(srcp); - vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp); - width -= extrawidth; - while (width) { - vector unsigned char voverflow; - vector unsigned char vd; - - /* s = *srcp */ - voverflow = (vector unsigned char)vec_ld(15, srcp); - vs = vec_perm(vs, voverflow, valigner); - - /* d = *dstp */ - vd = (vector unsigned char)vec_ld(0, dstp); - - VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8); - - /* set the alpha channel to full on */ - vd = vec_or(vd, valphamask); - - /* *dstp = res */ - vec_st((vector unsigned int)vd, 0, dstp); - - srcp += 4; - dstp += 4; - width -= 4; - vs = voverflow; - } - ONE_PIXEL_BLEND((extrawidth), extrawidth); - } -#undef ONE_PIXEL_BLEND - - srcp += srcskip; - dstp += dstskip; - } -} -#if __MWERKS__ -#pragma altivec_model off -#endif -#endif /* SDL_ALTIVEC_BLITTERS */ +#endif /* __MMX__ */ /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ -static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info) +static void +BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - - while(height--) { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ Uint32 s = *srcp++; Uint32 d = *dstp; *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) + (s & d & 0x00010101)) | 0xff000000; }, width); - srcp += srcskip; - dstp += dstskip; - } + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } } /* fast RGB888->(A)RGB888 blending with surface alpha */ -static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info) +static void +BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo * info) { - unsigned alpha = info->src->alpha; - if(alpha == 128) { - BlitRGBtoRGBSurfaceAlpha128(info); - } else { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - Uint32 s; - Uint32 d; - Uint32 s1; - Uint32 d1; - - while(height--) { - DUFFS_LOOP_DOUBLE2({ - /* One Pixel Blend */ + unsigned alpha = info->a; + if (alpha == 128) { + BlitRGBtoRGBSurfaceAlpha128(info); + } else { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + Uint32 s; + Uint32 d; + Uint32 s1; + Uint32 d1; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP4({ s = *srcp; d = *dstp; s1 = s & 0xff00ff; @@ -1488,53 +449,27 @@ static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info) *dstp = d1 | d | 0xff000000; ++srcp; ++dstp; - },{ - /* Two Pixels Blend */ - s = *srcp; - d = *dstp; - s1 = s & 0xff00ff; - d1 = d & 0xff00ff; - d1 += (s1 - d1) * alpha >> 8; - d1 &= 0xff00ff; - - s = ((s & 0xff00) >> 8) | - ((srcp[1] & 0xff00) << 8); - d = ((d & 0xff00) >> 8) | - ((dstp[1] & 0xff00) << 8); - d += (s - d) * alpha >> 8; - d &= 0x00ff00ff; - - *dstp++ = d1 | ((d << 8) & 0xff00) | 0xff000000; - ++srcp; - - s1 = *srcp; - d1 = *dstp; - s1 &= 0xff00ff; - d1 &= 0xff00ff; - d1 += (s1 - d1) * alpha >> 8; - d1 &= 0xff00ff; - - *dstp = d1 | ((d >> 8) & 0xff00) | 0xff000000; - ++srcp; - ++dstp; }, width); - srcp += srcskip; - dstp += dstskip; - } - } + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } + } } /* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info) +static void +BlitRGBtoRGBPixelAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - - while(height--) { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ Uint32 dalpha; Uint32 d; @@ -1568,152 +503,39 @@ static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info) ++srcp; ++dstp; }, width); - srcp += srcskip; - dstp += dstskip; - } -} - -#if GCC_ASMBLIT -/* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */ -static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info) -{ - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - SDL_PixelFormat* sf = info->src; - Uint32 amask = sf->Amask; - - __asm__ ( - /* make mm6 all zeros. */ - "pxor %%mm6, %%mm6\n" - - /* Make a mask to preserve the alpha. */ - "movd %0, %%mm7\n\t" /* 0000F000 -> mm7 */ - "punpcklbw %%mm7, %%mm7\n\t" /* FF000000 -> mm7 */ - "pcmpeqb %%mm4, %%mm4\n\t" /* FFFFFFFF -> mm4 */ - "movq %%mm4, %%mm3\n\t" /* FFFFFFFF -> mm3 (for later) */ - "pxor %%mm4, %%mm7\n\t" /* 00FFFFFF -> mm7 (mult mask) */ - - /* form channel masks */ - "movq %%mm7, %%mm4\n\t" /* 00FFFFFF -> mm4 */ - "packsswb %%mm6, %%mm4\n\t" /* 00000FFF -> mm4 (channel mask) */ - "packsswb %%mm6, %%mm3\n\t" /* 0000FFFF -> mm3 */ - "pxor %%mm4, %%mm3\n\t" /* 0000F000 -> mm3 (~channel mask) */ - - /* get alpha channel shift */ - "movd %1, %%mm5\n\t" /* Ashift -> mm5 */ - - : /* nothing */ : "rm" (amask), "rm" ((Uint32) sf->Ashift) ); - - while(height--) { - - DUFFS_LOOP4({ - Uint32 alpha; - - __asm__ ( - "prefetch 64(%0)\n" - "prefetch 64(%1)\n" - : : "r" (srcp), "r" (dstp) ); - - alpha = *srcp & amask; - /* FIXME: Here we special-case opaque alpha since the - compositioning used (>>8 instead of /255) doesn't handle - it correctly. Also special-case alpha=0 for speed? - Benchmark this! */ - if(alpha == 0) { - /* do nothing */ - } - else if(alpha == amask) { - /* opaque alpha -- copy RGB, keep dst alpha */ - /* using MMX here to free up regular registers for other things */ - __asm__ ( - "movd (%0), %%mm0\n\t" /* src(ARGB) -> mm0 (0000ARGB)*/ - "movd (%1), %%mm1\n\t" /* dst(ARGB) -> mm1 (0000ARGB)*/ - "pand %%mm4, %%mm0\n\t" /* src & chanmask -> mm0 */ - "pand %%mm3, %%mm1\n\t" /* dst & ~chanmask -> mm2 */ - "por %%mm0, %%mm1\n\t" /* src | dst -> mm1 */ - "movd %%mm1, (%1) \n\t" /* mm1 -> dst */ - - : : "r" (srcp), "r" (dstp) ); - } - - else { - __asm__ ( - /* load in the source, and dst. */ - "movd (%0), %%mm0\n" /* mm0(s) = 0 0 0 0 | As Rs Gs Bs */ - "movd (%1), %%mm1\n" /* mm1(d) = 0 0 0 0 | Ad Rd Gd Bd */ - - /* Move the src alpha into mm2 */ - - /* if supporting pshufw */ - /*"pshufw $0x55, %%mm0, %%mm2\n" */ /* mm2 = 0 As 0 As | 0 As 0 As */ - /*"psrlw $8, %%mm2\n" */ - - /* else: */ - "movd %2, %%mm2\n" - "psrld %%mm5, %%mm2\n" /* mm2 = 0 0 0 0 | 0 0 0 As */ - "punpcklwd %%mm2, %%mm2\n" /* mm2 = 0 0 0 0 | 0 As 0 As */ - "punpckldq %%mm2, %%mm2\n" /* mm2 = 0 As 0 As | 0 As 0 As */ - "pand %%mm7, %%mm2\n" /* to preserve dest alpha */ - - /* move the colors into words. */ - "punpcklbw %%mm6, %%mm0\n" /* mm0 = 0 As 0 Rs | 0 Gs 0 Bs */ - "punpcklbw %%mm6, %%mm1\n" /* mm0 = 0 Ad 0 Rd | 0 Gd 0 Bd */ - - /* src - dst */ - "psubw %%mm1, %%mm0\n" /* mm0 = As-Ad Rs-Rd | Gs-Gd Bs-Bd */ - - /* A * (src-dst) */ - "pmullw %%mm2, %%mm0\n" /* mm0 = 0*As-d As*Rs-d | As*Gs-d As*Bs-d */ - "psrlw $8, %%mm0\n" /* mm0 = 0>>8 Rc>>8 | Gc>>8 Bc>>8 */ - "paddb %%mm1, %%mm0\n" /* mm0 = 0+Ad Rc+Rd | Gc+Gd Bc+Bd */ - - "packuswb %%mm0, %%mm0\n" /* mm0 = | Ac Rc Gc Bc */ - - "movd %%mm0, (%1)\n" /* result in mm0 */ - - : : "r" (srcp), "r" (dstp), "r" (alpha) ); - - } - ++srcp; - ++dstp; - }, width); - srcp += srcskip; - dstp += dstskip; - } - - __asm__ ( - "emms\n" - : ); + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } } -/* End GCC_ASMBLIT*/ -#elif MSVC_ASMBLIT +#ifdef __3dNOW__ /* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */ -static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info) +static void +BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint32 *dstp = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip >> 2; - SDL_PixelFormat* sf = info->src; - Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask; - Uint32 amask = sf->Amask; - Uint32 ashift = sf->Ashift; - Uint64 multmask; - - __m64 src1, dst1, mm_alpha, mm_zero, dmask; - - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ - multmask = ~(0xFFFFi64 << (ashift * 2)); - dmask = *(__m64*) &multmask; /* dst alpha mask -> dmask */ - - while(height--) { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + SDL_PixelFormat *sf = info->src_fmt; + Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask; + Uint32 amask = sf->Amask; + Uint32 ashift = sf->Ashift; + Uint64 multmask; + + __m64 src1, dst1, mm_alpha, mm_zero, dmask; + + mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ + multmask = 0xFFFF; + multmask <<= (ashift * 2); + multmask = ~multmask; + dmask = *(__m64 *) & multmask; /* dst alpha mask -> dmask */ + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ Uint32 alpha; @@ -1751,14 +573,14 @@ static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info) ++srcp; ++dstp; }, width); - srcp += srcskip; - dstp += dstskip; - } - _mm_empty(); + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } + _mm_empty(); } -/* End MSVC_ASMBLIT */ -#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */ +#endif /* __MMX__ */ /* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */ @@ -1771,423 +593,142 @@ static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info) (((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \ + (s & d & (~(mask | mask << 16)))) -static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask) +static void +Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask) { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip >> 1; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - - while(height--) { - if(((uintptr_t)srcp ^ (uintptr_t)dstp) & 2) { - /* - * Source and destination not aligned, pipeline it. - * This is mostly a win for big blits but no loss for - * small ones - */ - Uint32 prev_sw; - int w = width; - - /* handle odd destination */ - if((uintptr_t)dstp & 2) { - Uint16 d = *dstp, s = *srcp; - *dstp = BLEND16_50(d, s, mask); - dstp++; - srcp++; - w--; - } - srcp++; /* srcp is now 32-bit aligned */ - - /* bootstrap pipeline with first halfword */ - prev_sw = ((Uint32 *)srcp)[-1]; - - while(w > 1) { - Uint32 sw, dw, s; - sw = *(Uint32 *)srcp; - dw = *(Uint32 *)dstp; + int width = info->dst_w; + int height = info->dst_h; + Uint16 *srcp = (Uint16 *) info->src; + int srcskip = info->src_skip >> 1; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip >> 1; + + while (height--) { + if (((uintptr_t) srcp ^ (uintptr_t) dstp) & 2) { + /* + * Source and destination not aligned, pipeline it. + * This is mostly a win for big blits but no loss for + * small ones + */ + Uint32 prev_sw; + int w = width; + + /* handle odd destination */ + if ((uintptr_t) dstp & 2) { + Uint16 d = *dstp, s = *srcp; + *dstp = BLEND16_50(d, s, mask); + dstp++; + srcp++; + w--; + } + srcp++; /* srcp is now 32-bit aligned */ + + /* bootstrap pipeline with first halfword */ + prev_sw = ((Uint32 *) srcp)[-1]; + + while (w > 1) { + Uint32 sw, dw, s; + sw = *(Uint32 *) srcp; + dw = *(Uint32 *) dstp; #if SDL_BYTEORDER == SDL_BIG_ENDIAN - s = (prev_sw << 16) + (sw >> 16); + s = (prev_sw << 16) + (sw >> 16); #else - s = (prev_sw >> 16) + (sw << 16); + s = (prev_sw >> 16) + (sw << 16); #endif - prev_sw = sw; - *(Uint32 *)dstp = BLEND2x16_50(dw, s, mask); - dstp += 2; - srcp += 2; - w -= 2; - } - - /* final pixel if any */ - if(w) { - Uint16 d = *dstp, s; + prev_sw = sw; + *(Uint32 *) dstp = BLEND2x16_50(dw, s, mask); + dstp += 2; + srcp += 2; + w -= 2; + } + + /* final pixel if any */ + if (w) { + Uint16 d = *dstp, s; #if SDL_BYTEORDER == SDL_BIG_ENDIAN - s = (Uint16)prev_sw; + s = (Uint16) prev_sw; #else - s = (Uint16)(prev_sw >> 16); + s = (Uint16) (prev_sw >> 16); #endif - *dstp = BLEND16_50(d, s, mask); - srcp++; - dstp++; - } - srcp += srcskip - 1; - dstp += dstskip; - } else { - /* source and destination are aligned */ - int w = width; - - /* first odd pixel? */ - if((uintptr_t)srcp & 2) { - Uint16 d = *dstp, s = *srcp; - *dstp = BLEND16_50(d, s, mask); - srcp++; - dstp++; - w--; - } - /* srcp and dstp are now 32-bit aligned */ - - while(w > 1) { - Uint32 sw = *(Uint32 *)srcp; - Uint32 dw = *(Uint32 *)dstp; - *(Uint32 *)dstp = BLEND2x16_50(dw, sw, mask); - srcp += 2; - dstp += 2; - w -= 2; - } - - /* last odd pixel? */ - if(w) { - Uint16 d = *dstp, s = *srcp; - *dstp = BLEND16_50(d, s, mask); - srcp++; - dstp++; - } - srcp += srcskip; - dstp += dstskip; - } - } -} - -#if GCC_ASMBLIT -/* fast RGB565->RGB565 blending with surface alpha */ -static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info) -{ - unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */ - if(alpha == 128) { - Blit16to16SurfaceAlpha128(info, 0xf7de); - } else { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip >> 1; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - Uint32 s, d; - Uint64 load; - - alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */ - load = alpha; - alpha >>= 3; /* downscale alpha to 5 bits */ - - movq_m2r(load, mm0); /* alpha(0000000A) -> mm0 */ - punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */ - punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */ - /* position alpha to allow for mullo and mulhi on diff channels - to reduce the number of operations */ - psllq_i2r(3, mm0); - - /* Setup the 565 color channel masks */ - load = 0x07E007E007E007E0ULL; - movq_m2r(load, mm4); /* MASKGREEN -> mm4 */ - load = 0x001F001F001F001FULL; - movq_m2r(load, mm7); /* MASKBLUE -> mm7 */ - while(height--) { - DUFFS_LOOP_QUATRO2( - { - s = *srcp++; - d = *dstp; - /* - * shift out the middle component (green) to - * the high 16 bits, and process all three RGB - * components at the same time. - */ - s = (s | s << 16) & 0x07e0f81f; - d = (d | d << 16) & 0x07e0f81f; - d += (s - d) * alpha >> 5; - d &= 0x07e0f81f; - *dstp++ = d | d >> 16; - },{ - s = *srcp++; - d = *dstp; - /* - * shift out the middle component (green) to - * the high 16 bits, and process all three RGB - * components at the same time. - */ - s = (s | s << 16) & 0x07e0f81f; - d = (d | d << 16) & 0x07e0f81f; - d += (s - d) * alpha >> 5; - d &= 0x07e0f81f; - *dstp++ = d | d >> 16; - s = *srcp++; - d = *dstp; - /* - * shift out the middle component (green) to - * the high 16 bits, and process all three RGB - * components at the same time. - */ - s = (s | s << 16) & 0x07e0f81f; - d = (d | d << 16) & 0x07e0f81f; - d += (s - d) * alpha >> 5; - d &= 0x07e0f81f; - *dstp++ = d | d >> 16; - },{ - movq_m2r((*srcp), mm2);/* 4 src pixels -> mm2 */ - movq_m2r((*dstp), mm3);/* 4 dst pixels -> mm3 */ - - /* red -- does not need a mask since the right shift clears - the uninteresting bits */ - movq_r2r(mm2, mm5); /* src -> mm5 */ - movq_r2r(mm3, mm6); /* dst -> mm6 */ - psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 [000r 000r 000r 000r] */ - psrlw_i2r(11, mm6); /* mm6 >> 11 -> mm6 [000r 000r 000r 000r] */ - - /* blend */ - psubw_r2r(mm6, mm5);/* src - dst -> mm5 */ - pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */ - /* alpha used is actually 11 bits - 11 + 5 = 16 bits, so the sign bits are lost */ - psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */ - paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */ - psllw_i2r(11, mm6); /* mm6 << 11 -> mm6 */ - - movq_r2r(mm6, mm1); /* save new reds in dsts */ - - /* green -- process the bits in place */ - movq_r2r(mm2, mm5); /* src -> mm5 */ - movq_r2r(mm3, mm6); /* dst -> mm6 */ - pand_r2r(mm4, mm5); /* src & MASKGREEN -> mm5 */ - pand_r2r(mm4, mm6); /* dst & MASKGREEN -> mm6 */ - - /* blend */ - psubw_r2r(mm6, mm5);/* src - dst -> mm5 */ - pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */ - /* 11 + 11 - 16 = 6 bits, so all the lower uninteresting - bits are gone and the sign bits present */ - psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */ - paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */ - - por_r2r(mm6, mm1); /* save new greens in dsts */ - - /* blue */ - movq_r2r(mm2, mm5); /* src -> mm5 */ - movq_r2r(mm3, mm6); /* dst -> mm6 */ - pand_r2r(mm7, mm5); /* src & MASKBLUE -> mm5[000b 000b 000b 000b] */ - pand_r2r(mm7, mm6); /* dst & MASKBLUE -> mm6[000b 000b 000b 000b] */ - - /* blend */ - psubw_r2r(mm6, mm5);/* src - dst -> mm5 */ - pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */ - /* 11 + 5 = 16 bits, so the sign bits are lost and - the interesting bits will need to be MASKed */ - psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */ - paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */ - pand_r2r(mm7, mm6); /* mm6 & MASKBLUE -> mm6[000b 000b 000b 000b] */ - - por_r2r(mm6, mm1); /* save new blues in dsts */ - - movq_r2m(mm1, *dstp); /* mm1 -> 4 dst pixels */ + *dstp = BLEND16_50(d, s, mask); + srcp++; + dstp++; + } + srcp += srcskip - 1; + dstp += dstskip; + } else { + /* source and destination are aligned */ + int w = width; + + /* first odd pixel? */ + if ((uintptr_t) srcp & 2) { + Uint16 d = *dstp, s = *srcp; + *dstp = BLEND16_50(d, s, mask); + srcp++; + dstp++; + w--; + } + /* srcp and dstp are now 32-bit aligned */ + + while (w > 1) { + Uint32 sw = *(Uint32 *) srcp; + Uint32 dw = *(Uint32 *) dstp; + *(Uint32 *) dstp = BLEND2x16_50(dw, sw, mask); + srcp += 2; + dstp += 2; + w -= 2; + } - srcp += 4; - dstp += 4; - }, width); - srcp += srcskip; - dstp += dstskip; - } - emms(); - } + /* last odd pixel? */ + if (w) { + Uint16 d = *dstp, s = *srcp; + *dstp = BLEND16_50(d, s, mask); + srcp++; + dstp++; + } + srcp += srcskip; + dstp += dstskip; + } + } } -/* fast RGB555->RGB555 blending with surface alpha */ -static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info) -{ - unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */ - if(alpha == 128) { - Blit16to16SurfaceAlpha128(info, 0xfbde); - } else { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip >> 1; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - Uint32 s, d; - Uint64 load; - - alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */ - load = alpha; - alpha >>= 3; /* downscale alpha to 5 bits */ - - movq_m2r(load, mm0); /* alpha(0000000A) -> mm0 */ - punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */ - punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */ - /* position alpha to allow for mullo and mulhi on diff channels - to reduce the number of operations */ - psllq_i2r(3, mm0); - - /* Setup the 555 color channel masks */ - load = 0x03E003E003E003E0ULL; - movq_m2r(load, mm4); /* MASKGREEN -> mm4 */ - load = 0x001F001F001F001FULL; - movq_m2r(load, mm7); /* MASKBLUE -> mm7 */ - while(height--) { - DUFFS_LOOP_QUATRO2( - { - s = *srcp++; - d = *dstp; - /* - * shift out the middle component (green) to - * the high 16 bits, and process all three RGB - * components at the same time. - */ - s = (s | s << 16) & 0x03e07c1f; - d = (d | d << 16) & 0x03e07c1f; - d += (s - d) * alpha >> 5; - d &= 0x03e07c1f; - *dstp++ = d | d >> 16; - },{ - s = *srcp++; - d = *dstp; - /* - * shift out the middle component (green) to - * the high 16 bits, and process all three RGB - * components at the same time. - */ - s = (s | s << 16) & 0x03e07c1f; - d = (d | d << 16) & 0x03e07c1f; - d += (s - d) * alpha >> 5; - d &= 0x03e07c1f; - *dstp++ = d | d >> 16; - s = *srcp++; - d = *dstp; - /* - * shift out the middle component (green) to - * the high 16 bits, and process all three RGB - * components at the same time. - */ - s = (s | s << 16) & 0x03e07c1f; - d = (d | d << 16) & 0x03e07c1f; - d += (s - d) * alpha >> 5; - d &= 0x03e07c1f; - *dstp++ = d | d >> 16; - },{ - movq_m2r((*srcp), mm2);/* 4 src pixels -> mm2 */ - movq_m2r((*dstp), mm3);/* 4 dst pixels -> mm3 */ - - /* red -- process the bits in place */ - psllq_i2r(5, mm4); /* turn MASKGREEN into MASKRED */ - /* by reusing the GREEN mask we free up another mmx - register to accumulate the result */ - - movq_r2r(mm2, mm5); /* src -> mm5 */ - movq_r2r(mm3, mm6); /* dst -> mm6 */ - pand_r2r(mm4, mm5); /* src & MASKRED -> mm5 */ - pand_r2r(mm4, mm6); /* dst & MASKRED -> mm6 */ - - /* blend */ - psubw_r2r(mm6, mm5);/* src - dst -> mm5 */ - pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */ - /* 11 + 15 - 16 = 10 bits, uninteresting bits will be - cleared by a MASK below */ - psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */ - paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */ - pand_r2r(mm4, mm6); /* mm6 & MASKRED -> mm6 */ - - psrlq_i2r(5, mm4); /* turn MASKRED back into MASKGREEN */ - - movq_r2r(mm6, mm1); /* save new reds in dsts */ +#ifdef __MMX__ - /* green -- process the bits in place */ - movq_r2r(mm2, mm5); /* src -> mm5 */ - movq_r2r(mm3, mm6); /* dst -> mm6 */ - pand_r2r(mm4, mm5); /* src & MASKGREEN -> mm5 */ - pand_r2r(mm4, mm6); /* dst & MASKGREEN -> mm6 */ - - /* blend */ - psubw_r2r(mm6, mm5);/* src - dst -> mm5 */ - pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */ - /* 11 + 10 - 16 = 5 bits, so all the lower uninteresting - bits are gone and the sign bits present */ - psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */ - paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */ - - por_r2r(mm6, mm1); /* save new greens in dsts */ - - /* blue */ - movq_r2r(mm2, mm5); /* src -> mm5 */ - movq_r2r(mm3, mm6); /* dst -> mm6 */ - pand_r2r(mm7, mm5); /* src & MASKBLUE -> mm5[000b 000b 000b 000b] */ - pand_r2r(mm7, mm6); /* dst & MASKBLUE -> mm6[000b 000b 000b 000b] */ - - /* blend */ - psubw_r2r(mm6, mm5);/* src - dst -> mm5 */ - pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */ - /* 11 + 5 = 16 bits, so the sign bits are lost and - the interesting bits will need to be MASKed */ - psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */ - paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */ - pand_r2r(mm7, mm6); /* mm6 & MASKBLUE -> mm6[000b 000b 000b 000b] */ - - por_r2r(mm6, mm1); /* save new blues in dsts */ - - movq_r2m(mm1, *dstp);/* mm1 -> 4 dst pixels */ - - srcp += 4; - dstp += 4; - }, width); - srcp += srcskip; - dstp += dstskip; - } - emms(); - } -} -/* End GCC_ASMBLIT */ - -#elif MSVC_ASMBLIT /* fast RGB565->RGB565 blending with surface alpha */ -static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info) +static void +Blit565to565SurfaceAlphaMMX(SDL_BlitInfo * info) { - unsigned alpha = info->src->alpha; - if(alpha == 128) { - Blit16to16SurfaceAlpha128(info, 0xf7de); - } else { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip >> 1; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - Uint32 s, d; - - __m64 src1, dst1, src2, dst2, gmask, bmask, mm_res, mm_alpha; - - alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */ - mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ - alpha >>= 3; /* downscale alpha to 5 bits */ - - mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ - mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ - /* position alpha to allow for mullo and mulhi on diff channels - to reduce the number of operations */ - mm_alpha = _mm_slli_si64(mm_alpha, 3); - - /* Setup the 565 color channel masks */ - gmask = _mm_set_pi32(0x07E007E0, 0x07E007E0); /* MASKGREEN -> gmask */ - bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ - - while(height--) { - DUFFS_LOOP_QUATRO2( + unsigned alpha = info->a; + if (alpha == 128) { + Blit16to16SurfaceAlpha128(info, 0xf7de); + } else { + int width = info->dst_w; + int height = info->dst_h; + Uint16 *srcp = (Uint16 *) info->src; + int srcskip = info->src_skip >> 1; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip >> 1; + Uint32 s, d; + + __m64 src1, dst1, src2, dst2, gmask, bmask, mm_res, mm_alpha; + + alpha &= ~(1 + 2 + 4); /* cut alpha to get the exact same behaviour */ + mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ + alpha >>= 3; /* downscale alpha to 5 bits */ + + mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ + mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ + /* position alpha to allow for mullo and mulhi on diff channels + to reduce the number of operations */ + mm_alpha = _mm_slli_si64(mm_alpha, 3); + + /* Setup the 565 color channel masks */ + gmask = _mm_set_pi32(0x07E007E0, 0x07E007E0); /* MASKGREEN -> gmask */ + bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP_124( { s = *srcp++; d = *dstp; @@ -2281,48 +822,51 @@ static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info) srcp += 4; dstp += 4; - }, width); - srcp += srcskip; - dstp += dstskip; - } - _mm_empty(); - } + }, width); + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } + _mm_empty(); + } } /* fast RGB555->RGB555 blending with surface alpha */ -static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info) +static void +Blit555to555SurfaceAlphaMMX(SDL_BlitInfo * info) { - unsigned alpha = info->src->alpha; - if(alpha == 128) { - Blit16to16SurfaceAlpha128(info, 0xfbde); - } else { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip >> 1; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - Uint32 s, d; - - __m64 src1, dst1, src2, dst2, rmask, gmask, bmask, mm_res, mm_alpha; - - alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */ - mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ - alpha >>= 3; /* downscale alpha to 5 bits */ - - mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ - mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ - /* position alpha to allow for mullo and mulhi on diff channels - to reduce the number of operations */ - mm_alpha = _mm_slli_si64(mm_alpha, 3); - - /* Setup the 555 color channel masks */ - rmask = _mm_set_pi32(0x7C007C00, 0x7C007C00); /* MASKRED -> rmask */ - gmask = _mm_set_pi32(0x03E003E0, 0x03E003E0); /* MASKGREEN -> gmask */ - bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ - - while(height--) { - DUFFS_LOOP_QUATRO2( + unsigned alpha = info->a; + if (alpha == 128) { + Blit16to16SurfaceAlpha128(info, 0xfbde); + } else { + int width = info->dst_w; + int height = info->dst_h; + Uint16 *srcp = (Uint16 *) info->src; + int srcskip = info->src_skip >> 1; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip >> 1; + Uint32 s, d; + + __m64 src1, dst1, src2, dst2, rmask, gmask, bmask, mm_res, mm_alpha; + + alpha &= ~(1 + 2 + 4); /* cut alpha to get the exact same behaviour */ + mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ + alpha >>= 3; /* downscale alpha to 5 bits */ + + mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ + mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ + /* position alpha to allow for mullo and mulhi on diff channels + to reduce the number of operations */ + mm_alpha = _mm_slli_si64(mm_alpha, 3); + + /* Setup the 555 color channel masks */ + rmask = _mm_set_pi32(0x7C007C00, 0x7C007C00); /* MASKRED -> rmask */ + gmask = _mm_set_pi32(0x03E003E0, 0x03E003E0); /* MASKGREEN -> gmask */ + bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP_124( { s = *srcp++; d = *dstp; @@ -2416,31 +960,35 @@ static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info) srcp += 4; dstp += 4; - }, width); - srcp += srcskip; - dstp += dstskip; - } - _mm_empty(); - } + }, width); + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } + _mm_empty(); + } } -#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */ + +#endif /* __MMX__ */ /* fast RGB565->RGB565 blending with surface alpha */ -static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info) +static void +Blit565to565SurfaceAlpha(SDL_BlitInfo * info) { - unsigned alpha = info->src->alpha; - if(alpha == 128) { - Blit16to16SurfaceAlpha128(info, 0xf7de); - } else { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip >> 1; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - alpha >>= 3; /* downscale alpha to 5 bits */ - - while(height--) { + unsigned alpha = info->a; + if (alpha == 128) { + Blit16to16SurfaceAlpha128(info, 0xf7de); + } else { + int width = info->dst_w; + int height = info->dst_h; + Uint16 *srcp = (Uint16 *) info->src; + int srcskip = info->src_skip >> 1; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip >> 1; + alpha >>= 3; /* downscale alpha to 5 bits */ + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ Uint32 s = *srcp++; Uint32 d = *dstp; @@ -2455,28 +1003,31 @@ static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info) d &= 0x07e0f81f; *dstp++ = (Uint16)(d | d >> 16); }, width); - srcp += srcskip; - dstp += dstskip; - } - } + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } + } } /* fast RGB555->RGB555 blending with surface alpha */ -static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info) +static void +Blit555to555SurfaceAlpha(SDL_BlitInfo * info) { - unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */ - if(alpha == 128) { - Blit16to16SurfaceAlpha128(info, 0xfbde); - } else { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip >> 1; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - alpha >>= 3; /* downscale alpha to 5 bits */ - - while(height--) { + unsigned alpha = info->a; /* downscale alpha to 5 bits */ + if (alpha == 128) { + Blit16to16SurfaceAlpha128(info, 0xfbde); + } else { + int width = info->dst_w; + int height = info->dst_h; + Uint16 *srcp = (Uint16 *) info->src; + int srcskip = info->src_skip >> 1; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip >> 1; + alpha >>= 3; /* downscale alpha to 5 bits */ + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ Uint32 s = *srcp++; Uint32 d = *dstp; @@ -2491,23 +1042,26 @@ static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info) d &= 0x03e07c1f; *dstp++ = (Uint16)(d | d >> 16); }, width); - srcp += srcskip; - dstp += dstskip; - } - } + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } + } } /* fast ARGB8888->RGB565 blending with pixel alpha */ -static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) +static void +BlitARGBto565PixelAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - - while(height--) { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip >> 1; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ Uint32 s = *srcp; unsigned alpha = s >> 27; /* downscale alpha to 5 bits */ @@ -2535,22 +1089,25 @@ static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) srcp++; dstp++; }, width); - srcp += srcskip; - dstp += dstskip; - } + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } } /* fast ARGB8888->RGB555 blending with pixel alpha */ -static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) +static void +BlitARGBto555PixelAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint32 *srcp = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip >> 2; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip >> 1; - - while(height--) { + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip >> 1; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4({ unsigned alpha; Uint32 s = *srcp; @@ -2579,295 +1136,253 @@ static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) srcp++; dstp++; }, width); - srcp += srcskip; - dstp += dstskip; - } + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } } /* General (slow) N->N blending with per-surface alpha */ -static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info) +static void +BlitNtoNSurfaceAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - int srcbpp = srcfmt->BytesPerPixel; - int dstbpp = dstfmt->BytesPerPixel; - unsigned sA = srcfmt->alpha; - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; - - if(sA) { - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int srcbpp = srcfmt->BytesPerPixel; + int dstbpp = dstfmt->BytesPerPixel; + Uint32 Pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB, dA; + const unsigned sA = info->a; + + if (sA) { + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4( { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - unsigned dR; - unsigned dG; - unsigned dB; DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); - DISEMBLE_RGB(dst, dstbpp, dstfmt, Pixel, dR, dG, dB); - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); + DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); src += srcbpp; dst += dstbpp; }, width); - src += srcskip; - dst += dstskip; - } - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } + } } /* General (slow) colorkeyed N->N blending with per-surface alpha */ -static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info) +static void +BlitNtoNSurfaceAlphaKey(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - Uint32 ckey = srcfmt->colorkey; - int srcbpp = srcfmt->BytesPerPixel; - int dstbpp = dstfmt->BytesPerPixel; - unsigned sA = srcfmt->alpha; - unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0; - - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + Uint32 ckey = info->colorkey; + int srcbpp = srcfmt->BytesPerPixel; + int dstbpp = dstfmt->BytesPerPixel; + Uint32 Pixel; + unsigned sR, sG, sB; + unsigned dR, dG, dB, dA; + const unsigned sA = info->a; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4( { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - unsigned dR; - unsigned dG; - unsigned dB; RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel); if(sA && Pixel != ckey) { RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); - DISEMBLE_RGB(dst, dstbpp, dstfmt, Pixel, dR, dG, dB); - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); + DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); } src += srcbpp; dst += dstbpp; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } /* General (slow) N->N blending with pixel alpha */ -static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) +static void +BlitNtoNPixelAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - - int srcbpp; - int dstbpp; - - /* Set up some basic variables */ - srcbpp = srcfmt->BytesPerPixel; - dstbpp = dstfmt->BytesPerPixel; - - /* FIXME: for 8bpp source alpha, this doesn't get opaque values - quite right. for <8bpp source alpha, it gets them very wrong - (check all macros!) - It is unclear whether there is a good general solution that doesn't - need a branch (or a divide). */ - while ( height-- ) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int srcbpp; + int dstbpp; + Uint32 Pixel; + unsigned sR, sG, sB, sA; + unsigned dR, dG, dB, dA; + + /* Set up some basic variables */ + srcbpp = srcfmt->BytesPerPixel; + dstbpp = dstfmt->BytesPerPixel; + + while (height--) { + /* *INDENT-OFF* */ DUFFS_LOOP4( { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - unsigned dR; - unsigned dG; - unsigned dB; - unsigned sA; - unsigned dA; DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); if(sA) { - DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); - ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); } src += srcbpp; dst += dstbpp; }, width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index) +SDL_BlitFunc +SDL_CalculateBlitA(SDL_Surface * surface) { SDL_PixelFormat *sf = surface->format; SDL_PixelFormat *df = surface->map->dst->format; - if(sf->Amask == 0) { - if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) { - if(df->BytesPerPixel == 1) - return BlitNto1SurfaceAlphaKey; - else -#if SDL_ALTIVEC_BLITTERS - if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 && - !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) - return Blit32to32SurfaceAlphaKeyAltivec; - else -#endif - return BlitNtoNSurfaceAlphaKey; - } else { - /* Per-surface alpha blits */ - switch(df->BytesPerPixel) { - case 1: - return BlitNto1SurfaceAlpha; - - case 2: - if(surface->map->identity) { - if(df->Gmask == 0x7e0) - { -#if MMX_ASMBLIT - if(SDL_HasMMX()) - return Blit565to565SurfaceAlphaMMX; - else -#endif - return Blit565to565SurfaceAlpha; - } - else if(df->Gmask == 0x3e0) - { -#if MMX_ASMBLIT - if(SDL_HasMMX()) - return Blit555to555SurfaceAlphaMMX; - else -#endif - return Blit555to555SurfaceAlpha; - } - } - return BlitNtoNSurfaceAlpha; - - case 4: - if(sf->Rmask == df->Rmask - && sf->Gmask == df->Gmask - && sf->Bmask == df->Bmask - && sf->BytesPerPixel == 4) - { -#if MMX_ASMBLIT - if(sf->Rshift % 8 == 0 - && sf->Gshift % 8 == 0 - && sf->Bshift % 8 == 0 - && SDL_HasMMX()) - return BlitRGBtoRGBSurfaceAlphaMMX; -#endif - if((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) - { -#if SDL_ALTIVEC_BLITTERS - if(!(surface->map->dst->flags & SDL_HWSURFACE) - && SDL_HasAltiVec()) - return BlitRGBtoRGBSurfaceAlphaAltivec; + switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + case SDL_COPY_BLEND: + /* Per-pixel alpha blits */ + switch (df->BytesPerPixel) { + case 1: + return BlitNto1PixelAlpha; + + case 2: + if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 + && sf->Gmask == 0xff00 + && ((sf->Rmask == 0xff && df->Rmask == 0x1f) + || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { + if (df->Gmask == 0x7e0) + return BlitARGBto565PixelAlpha; + else if (df->Gmask == 0x3e0) + return BlitARGBto555PixelAlpha; + } + return BlitNtoNPixelAlpha; + + case 4: + if (sf->Rmask == df->Rmask + && sf->Gmask == df->Gmask + && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { +#if defined(__MMX__) || defined(__3dNOW__) + if (sf->Rshift % 8 == 0 + && sf->Gshift % 8 == 0 + && sf->Bshift % 8 == 0 + && sf->Ashift % 8 == 0 && sf->Aloss == 0) { +#ifdef __3dNOW__ + if (SDL_Has3DNow()) + return BlitRGBtoRGBPixelAlphaMMX3DNOW; #endif - return BlitRGBtoRGBSurfaceAlpha; - } - } -#if SDL_ALTIVEC_BLITTERS - if((sf->BytesPerPixel == 4) && - !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) - return Blit32to32SurfaceAlphaAltivec; - else +#ifdef __MMX__ + if (SDL_HasMMX()) + return BlitRGBtoRGBPixelAlphaMMX; #endif - return BlitNtoNSurfaceAlpha; + } +#endif /* __MMX__ || __3dNOW__ */ + if (sf->Amask == 0xff000000) { + return BlitRGBtoRGBPixelAlpha; + } + } + return BlitNtoNPixelAlpha; - case 3: - default: - return BlitNtoNSurfaceAlpha; - } - } - } else { - /* Per-pixel alpha blits */ - switch(df->BytesPerPixel) { - case 1: - return BlitNto1PixelAlpha; - - case 2: -#if SDL_ALTIVEC_BLITTERS - if(sf->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) && - df->Gmask == 0x7e0 && - df->Bmask == 0x1f && SDL_HasAltiVec()) - return Blit32to565PixelAlphaAltivec; - else -#endif - if(sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 - && sf->Gmask == 0xff00 - && ((sf->Rmask == 0xff && df->Rmask == 0x1f) - || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { - if(df->Gmask == 0x7e0) - return BlitARGBto565PixelAlpha; - else if(df->Gmask == 0x3e0) - return BlitARGBto555PixelAlpha; - } - return BlitNtoNPixelAlpha; - - case 4: - if(sf->Rmask == df->Rmask - && sf->Gmask == df->Gmask - && sf->Bmask == df->Bmask - && sf->BytesPerPixel == 4) - { -#if MMX_ASMBLIT - if(sf->Rshift % 8 == 0 - && sf->Gshift % 8 == 0 - && sf->Bshift % 8 == 0 - && sf->Ashift % 8 == 0 - && sf->Aloss == 0) - { - if(SDL_Has3DNow()) - return BlitRGBtoRGBPixelAlphaMMX3DNOW; - if(SDL_HasMMX()) - return BlitRGBtoRGBPixelAlphaMMX; - } + case 3: + default: + return BlitNtoNPixelAlpha; + } + break; + + case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + if (sf->Amask == 0) { + /* Per-surface alpha blits */ + switch (df->BytesPerPixel) { + case 1: + return BlitNto1SurfaceAlpha; + + case 2: + if (surface->map->identity) { + if (df->Gmask == 0x7e0) { +#ifdef __MMX__ + if (SDL_HasMMX()) + return Blit565to565SurfaceAlphaMMX; + else #endif - if(sf->Amask == 0xff000000) - { -#if SDL_ALTIVEC_BLITTERS - if(!(surface->map->dst->flags & SDL_HWSURFACE) - && SDL_HasAltiVec()) - return BlitRGBtoRGBPixelAlphaAltivec; + return Blit565to565SurfaceAlpha; + } else if (df->Gmask == 0x3e0) { +#ifdef __MMX__ + if (SDL_HasMMX()) + return Blit555to555SurfaceAlphaMMX; + else #endif - return BlitRGBtoRGBPixelAlpha; - } - } -#if SDL_ALTIVEC_BLITTERS - if (sf->Amask && sf->BytesPerPixel == 4 && - !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec()) - return Blit32to32PixelAlphaAltivec; - else + return Blit555to555SurfaceAlpha; + } + } + return BlitNtoNSurfaceAlpha; + + case 4: + if (sf->Rmask == df->Rmask + && sf->Gmask == df->Gmask + && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { +#ifdef __MMX__ + if (sf->Rshift % 8 == 0 + && sf->Gshift % 8 == 0 + && sf->Bshift % 8 == 0 && SDL_HasMMX()) + return BlitRGBtoRGBSurfaceAlphaMMX; #endif - return BlitNtoNPixelAlpha; - - case 3: - default: - return BlitNtoNPixelAlpha; - } + if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) { + return BlitRGBtoRGBSurfaceAlpha; + } + } + return BlitNtoNSurfaceAlpha; + + case 3: + default: + return BlitNtoNSurfaceAlpha; + } + } + break; + + case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + if (sf->Amask == 0) { + if (df->BytesPerPixel == 1) { + return BlitNto1SurfaceAlphaKey; + } else { + return BlitNtoNSurfaceAlphaKey; + } + } + break; } + + return NULL; } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 858cee5ee3..84c96e2dcb 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,32 +25,33 @@ #include "SDL_cpuinfo.h" #include "SDL_blit.h" +#include "SDL_assert.h" + /* Functions to blit from N-bit surfaces to other surfaces */ #if SDL_ALTIVEC_BLITTERS -#if __MWERKS__ -#pragma altivec_model on -#endif #ifdef HAVE_ALTIVEC_H #include #endif -#define assert(X) #ifdef __MACOSX__ #include -static size_t GetL3CacheSize( void ) +static size_t +GetL3CacheSize(void) { const char key[] = "hw.l3cachesize"; u_int64_t result = 0; - size_t typeSize = sizeof( result ); + size_t typeSize = sizeof(result); - int err = sysctlbyname( key, &result, &typeSize, NULL, 0 ); - if( 0 != err ) return 0; + int err = sysctlbyname(key, &result, &typeSize, NULL, 0); + if (0 != err) + return 0; return result; } #else -static size_t GetL3CacheSize( void ) +static size_t +GetL3CacheSize(void) { /* XXX: Just guess G4 */ return 2097152; @@ -59,14 +59,14 @@ static size_t GetL3CacheSize( void ) #endif /* __MACOSX__ */ #if (defined(__MACOSX__) && (__GNUC__ < 4)) - #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ +#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p ) - #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ +#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ (vector unsigned short) ( a,b,c,d,e,f,g,h ) #else - #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ +#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p } - #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ +#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ (vector unsigned short) { a,b,c,d,e,f,g,h } #endif @@ -101,32 +101,34 @@ static size_t GetL3CacheSize( void ) : vec_add(vec_lvsl(8, src), vec_splat_u8(8))) /* Calculate the permute vector used for 32->32 swizzling */ -static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt, - const SDL_PixelFormat *dstfmt) +static vector unsigned char +calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt) { /* - * We have to assume that the bits that aren't used by other + * We have to assume that the bits that aren't used by other * colors is alpha, and it's one complete byte, since some formats * leave alpha with a zero mask, but we should still swizzle the bits. */ /* ARGB */ - const static struct SDL_PixelFormat default_pixel_format = { - NULL, 0, 0, + const static const struct SDL_PixelFormat default_pixel_format = { + 0, NULL, 0, 0, + {0, 0}, + 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, 0, 0, 0, 0, 16, 8, 0, 24, - 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, - 0, 0}; + 0, NULL + }; if (!srcfmt) { srcfmt = &default_pixel_format; } if (!dstfmt) { dstfmt = &default_pixel_format; } - const vector unsigned char plus = VECUINT8_LITERAL( - 0x00, 0x00, 0x00, 0x00, - 0x04, 0x04, 0x04, 0x04, - 0x08, 0x08, 0x08, 0x08, - 0x0C, 0x0C, 0x0C, 0x0C ); + const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, + 0x04, 0x04, 0x04, 0x04, + 0x08, 0x08, 0x08, 0x08, + 0x0C, 0x0C, 0x0C, + 0x0C); vector unsigned char vswiz; vector unsigned int srcvec; #define RESHIFT(X) (3 - ((X) >> 3)) @@ -136,40 +138,45 @@ static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt, Uint32 amask; /* Use zero for alpha if either surface doesn't have alpha */ if (dstfmt->Amask) { - amask = ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift); - } else { - amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF); - } -#undef RESHIFT - ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask); - vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0)); - return(vswiz); + amask = + ((srcfmt->Amask) ? RESHIFT(srcfmt-> + Ashift) : 0x10) << (dstfmt->Ashift); + } else { + amask = + 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ + 0xFFFFFFFF); + } +#undef RESHIFT + ((unsigned int *) (char *) &srcvec)[0] = (rmask | gmask | bmask | amask); + vswiz = vec_add(plus, (vector unsigned char) vec_splat(srcvec, 0)); + return (vswiz); } -static void Blit_RGB888_RGB565(SDL_BlitInfo *info); -static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) { - int height = info->d_height; - Uint8 *src = (Uint8 *) info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = (Uint8 *) info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; +static void Blit_RGB888_RGB565(SDL_BlitInfo * info); +static void +Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info) +{ + int height = info->dst_h; + Uint8 *src = (Uint8 *) info->src; + int srcskip = info->src_skip; + Uint8 *dst = (Uint8 *) info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; vector unsigned char valpha = vec_splat_u8(0); vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL); - vector unsigned char vgmerge = VECUINT8_LITERAL( - 0x00, 0x02, 0x00, 0x06, - 0x00, 0x0a, 0x00, 0x0e, - 0x00, 0x12, 0x00, 0x16, - 0x00, 0x1a, 0x00, 0x1e); + vector unsigned char vgmerge = VECUINT8_LITERAL(0x00, 0x02, 0x00, 0x06, + 0x00, 0x0a, 0x00, 0x0e, + 0x00, 0x12, 0x00, 0x16, + 0x00, 0x1a, 0x00, 0x1e); vector unsigned short v1 = vec_splat_u16(1); vector unsigned short v3 = vec_splat_u16(3); - vector unsigned short v3f = VECUINT16_LITERAL( - 0x003f, 0x003f, 0x003f, 0x003f, - 0x003f, 0x003f, 0x003f, 0x003f); - vector unsigned short vfc = VECUINT16_LITERAL( - 0x00fc, 0x00fc, 0x00fc, 0x00fc, - 0x00fc, 0x00fc, 0x00fc, 0x00fc); - vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7); + vector unsigned short v3f = + VECUINT16_LITERAL(0x003f, 0x003f, 0x003f, 0x003f, + 0x003f, 0x003f, 0x003f, 0x003f); + vector unsigned short vfc = + VECUINT16_LITERAL(0x00fc, 0x00fc, 0x00fc, 0x00fc, + 0x00fc, 0x00fc, 0x00fc, 0x00fc); + vector unsigned short vf800 = (vector unsigned short) vec_splat_u8(-7); vf800 = vec_sl(vf800, vec_splat_u16(8)); while (height--) { @@ -177,7 +184,7 @@ static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) { vector unsigned char voverflow; vector unsigned char vsrc; - int width = info->d_width; + int width = info->dst_w; int extrawidth; /* do scalar until we can align... */ @@ -198,7 +205,7 @@ static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) { ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width); /* After all that work, here's the vector part! */ - extrawidth = (width % 8); /* trailing unaligned stores */ + extrawidth = (width % 8); /* trailing unaligned stores */ width -= extrawidth; vsrc = vec_ld(0, src); valigner = VEC_ALIGNER(src); @@ -210,23 +217,25 @@ static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) { voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vsrc1 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute); + vsrc1 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute); src += 16; vsrc = voverflow; voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vsrc2 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute); + vsrc2 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute); /* 1555 */ - vpixel = (vector unsigned short)vec_packpx(vsrc1, vsrc2); - vgpixel = (vector unsigned short)vec_perm(vsrc1, vsrc2, vgmerge); + vpixel = (vector unsigned short) vec_packpx(vsrc1, vsrc2); + vgpixel = (vector unsigned short) vec_perm(vsrc1, vsrc2, vgmerge); vgpixel = vec_and(vgpixel, vfc); vgpixel = vec_sl(vgpixel, v3); vrpixel = vec_sl(vpixel, v1); vrpixel = vec_and(vrpixel, vf800); vbpixel = vec_and(vpixel, v3f); - vdst = vec_or((vector unsigned char)vrpixel, (vector unsigned char)vgpixel); + vdst = + vec_or((vector unsigned char) vrpixel, + (vector unsigned char) vgpixel); /* 565 */ - vdst = vec_or(vdst, (vector unsigned char)vbpixel); + vdst = vec_or(vdst, (vector unsigned char) vbpixel); vec_st(vdst, 0, dst); width -= 8; @@ -235,27 +244,29 @@ static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) { vsrc = voverflow; } - assert(width == 0); + SDL_assert(width == 0); /* do scalar until we can align... */ ONE_PIXEL_BLEND((extrawidth), extrawidth); #undef ONE_PIXEL_BLEND - src += srcskip; /* move to next row, accounting for pitch. */ + src += srcskip; /* move to next row, accounting for pitch. */ dst += dstskip; } } -static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) { - int height = info->d_height; - Uint8 *src = (Uint8 *) info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = (Uint8 *) info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; +static void +Blit_RGB565_32Altivec(SDL_BlitInfo * info) +{ + int height = info->dst_h; + Uint8 *src = (Uint8 *) info->src; + int srcskip = info->src_skip; + Uint8 *dst = (Uint8 *) info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; unsigned alpha; vector unsigned char valpha; vector unsigned char vpermute; @@ -264,56 +275,52 @@ static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) { vector unsigned int v16 = vec_add(v8, v8); vector unsigned short v2 = vec_splat_u16(2); vector unsigned short v3 = vec_splat_u16(3); - /* - 0x10 - 0x1f is the alpha - 0x00 - 0x0e evens are the red - 0x01 - 0x0f odds are zero - */ - vector unsigned char vredalpha1 = VECUINT8_LITERAL( - 0x10, 0x00, 0x01, 0x01, - 0x10, 0x02, 0x01, 0x01, - 0x10, 0x04, 0x01, 0x01, - 0x10, 0x06, 0x01, 0x01 - ); - vector unsigned char vredalpha2 = (vector unsigned char) ( - vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16)) - ); /* - 0x00 - 0x0f is ARxx ARxx ARxx ARxx - 0x11 - 0x0f odds are blue - */ - vector unsigned char vblue1 = VECUINT8_LITERAL( - 0x00, 0x01, 0x02, 0x11, - 0x04, 0x05, 0x06, 0x13, - 0x08, 0x09, 0x0a, 0x15, - 0x0c, 0x0d, 0x0e, 0x17 - ); - vector unsigned char vblue2 = (vector unsigned char)( - vec_add((vector unsigned int)vblue1, v8) - ); + 0x10 - 0x1f is the alpha + 0x00 - 0x0e evens are the red + 0x01 - 0x0f odds are zero + */ + vector unsigned char vredalpha1 = VECUINT8_LITERAL(0x10, 0x00, 0x01, 0x01, + 0x10, 0x02, 0x01, 0x01, + 0x10, 0x04, 0x01, 0x01, + 0x10, 0x06, 0x01, + 0x01); + vector unsigned char vredalpha2 = + (vector unsigned + char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16)) + ); + /* + 0x00 - 0x0f is ARxx ARxx ARxx ARxx + 0x11 - 0x0f odds are blue + */ + vector unsigned char vblue1 = VECUINT8_LITERAL(0x00, 0x01, 0x02, 0x11, + 0x04, 0x05, 0x06, 0x13, + 0x08, 0x09, 0x0a, 0x15, + 0x0c, 0x0d, 0x0e, 0x17); + vector unsigned char vblue2 = + (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8) + ); /* - 0x00 - 0x0f is ARxB ARxB ARxB ARxB - 0x10 - 0x0e evens are green - */ - vector unsigned char vgreen1 = VECUINT8_LITERAL( - 0x00, 0x01, 0x10, 0x03, - 0x04, 0x05, 0x12, 0x07, - 0x08, 0x09, 0x14, 0x0b, - 0x0c, 0x0d, 0x16, 0x0f - ); - vector unsigned char vgreen2 = (vector unsigned char)( - vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8)) - ); - - - assert(srcfmt->BytesPerPixel == 2); - assert(dstfmt->BytesPerPixel == 4); - - vf800 = (vector unsigned short)vec_splat_u8(-7); + 0x00 - 0x0f is ARxB ARxB ARxB ARxB + 0x10 - 0x0e evens are green + */ + vector unsigned char vgreen1 = VECUINT8_LITERAL(0x00, 0x01, 0x10, 0x03, + 0x04, 0x05, 0x12, 0x07, + 0x08, 0x09, 0x14, 0x0b, + 0x0c, 0x0d, 0x16, 0x0f); + vector unsigned char vgreen2 = + (vector unsigned + char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8)) + ); + + SDL_assert(srcfmt->BytesPerPixel == 2); + SDL_assert(dstfmt->BytesPerPixel == 4); + + vf800 = (vector unsigned short) vec_splat_u8(-7); vf800 = vec_sl(vf800, vec_splat_u16(8)); - if (dstfmt->Amask && srcfmt->alpha) { - ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha; + if (dstfmt->Amask && info->a) { + ((unsigned char *) &valpha)[0] = alpha = info->a; valpha = vec_splat(valpha, 0); } else { alpha = 0; @@ -326,7 +333,7 @@ static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) { vector unsigned char voverflow; vector unsigned char vsrc; - int width = info->d_width; + int width = info->dst_w; int extrawidth; /* do scalar until we can align... */ @@ -345,7 +352,7 @@ static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) { ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width); /* After all that work, here's the vector part! */ - extrawidth = (width % 8); /* trailing unaligned stores */ + extrawidth = (width % 8); /* trailing unaligned stores */ width -= extrawidth; vsrc = vec_ld(0, src); valigner = VEC_ALIGNER(src); @@ -357,50 +364,56 @@ static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) { voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vR = vec_and((vector unsigned short)vsrc, vf800); - vB = vec_sl((vector unsigned short)vsrc, v3); + vR = vec_and((vector unsigned short) vsrc, vf800); + vB = vec_sl((vector unsigned short) vsrc, v3); vG = vec_sl(vB, v2); - vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1); - vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1); - vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1); + vdst1 = + (vector unsigned char) vec_perm((vector unsigned char) vR, + valpha, vredalpha1); + vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1); + vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1); vdst1 = vec_perm(vdst1, valpha, vpermute); vec_st(vdst1, 0, dst); - vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2); - vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2); - vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2); + vdst2 = + (vector unsigned char) vec_perm((vector unsigned char) vR, + valpha, vredalpha2); + vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2); + vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2); vdst2 = vec_perm(vdst2, valpha, vpermute); vec_st(vdst2, 16, dst); - + width -= 8; dst += 32; src += 16; vsrc = voverflow; } - assert(width == 0); + SDL_assert(width == 0); /* do scalar until we can align... */ ONE_PIXEL_BLEND((extrawidth), extrawidth); #undef ONE_PIXEL_BLEND - src += srcskip; /* move to next row, accounting for pitch. */ + src += srcskip; /* move to next row, accounting for pitch. */ dst += dstskip; } } -static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) { - int height = info->d_height; - Uint8 *src = (Uint8 *) info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = (Uint8 *) info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; +static void +Blit_RGB555_32Altivec(SDL_BlitInfo * info) +{ + int height = info->dst_h; + Uint8 *src = (Uint8 *) info->src; + int srcskip = info->src_skip; + Uint8 *dst = (Uint8 *) info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; unsigned alpha; vector unsigned char valpha; vector unsigned char vpermute; @@ -409,56 +422,52 @@ static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) { vector unsigned int v16 = vec_add(v8, v8); vector unsigned short v1 = vec_splat_u16(1); vector unsigned short v3 = vec_splat_u16(3); - /* - 0x10 - 0x1f is the alpha - 0x00 - 0x0e evens are the red - 0x01 - 0x0f odds are zero - */ - vector unsigned char vredalpha1 = VECUINT8_LITERAL( - 0x10, 0x00, 0x01, 0x01, - 0x10, 0x02, 0x01, 0x01, - 0x10, 0x04, 0x01, 0x01, - 0x10, 0x06, 0x01, 0x01 - ); - vector unsigned char vredalpha2 = (vector unsigned char)( - vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16)) - ); /* - 0x00 - 0x0f is ARxx ARxx ARxx ARxx - 0x11 - 0x0f odds are blue - */ - vector unsigned char vblue1 = VECUINT8_LITERAL( - 0x00, 0x01, 0x02, 0x11, - 0x04, 0x05, 0x06, 0x13, - 0x08, 0x09, 0x0a, 0x15, - 0x0c, 0x0d, 0x0e, 0x17 - ); - vector unsigned char vblue2 = (vector unsigned char)( - vec_add((vector unsigned int)vblue1, v8) - ); + 0x10 - 0x1f is the alpha + 0x00 - 0x0e evens are the red + 0x01 - 0x0f odds are zero + */ + vector unsigned char vredalpha1 = VECUINT8_LITERAL(0x10, 0x00, 0x01, 0x01, + 0x10, 0x02, 0x01, 0x01, + 0x10, 0x04, 0x01, 0x01, + 0x10, 0x06, 0x01, + 0x01); + vector unsigned char vredalpha2 = + (vector unsigned + char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16)) + ); /* - 0x00 - 0x0f is ARxB ARxB ARxB ARxB - 0x10 - 0x0e evens are green - */ - vector unsigned char vgreen1 = VECUINT8_LITERAL( - 0x00, 0x01, 0x10, 0x03, - 0x04, 0x05, 0x12, 0x07, - 0x08, 0x09, 0x14, 0x0b, - 0x0c, 0x0d, 0x16, 0x0f - ); - vector unsigned char vgreen2 = (vector unsigned char)( - vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8)) - ); - - - assert(srcfmt->BytesPerPixel == 2); - assert(dstfmt->BytesPerPixel == 4); - - vf800 = (vector unsigned short)vec_splat_u8(-7); + 0x00 - 0x0f is ARxx ARxx ARxx ARxx + 0x11 - 0x0f odds are blue + */ + vector unsigned char vblue1 = VECUINT8_LITERAL(0x00, 0x01, 0x02, 0x11, + 0x04, 0x05, 0x06, 0x13, + 0x08, 0x09, 0x0a, 0x15, + 0x0c, 0x0d, 0x0e, 0x17); + vector unsigned char vblue2 = + (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8) + ); + /* + 0x00 - 0x0f is ARxB ARxB ARxB ARxB + 0x10 - 0x0e evens are green + */ + vector unsigned char vgreen1 = VECUINT8_LITERAL(0x00, 0x01, 0x10, 0x03, + 0x04, 0x05, 0x12, 0x07, + 0x08, 0x09, 0x14, 0x0b, + 0x0c, 0x0d, 0x16, 0x0f); + vector unsigned char vgreen2 = + (vector unsigned + char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8)) + ); + + SDL_assert(srcfmt->BytesPerPixel == 2); + SDL_assert(dstfmt->BytesPerPixel == 4); + + vf800 = (vector unsigned short) vec_splat_u8(-7); vf800 = vec_sl(vf800, vec_splat_u16(8)); - if (dstfmt->Amask && srcfmt->alpha) { - ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha; + if (dstfmt->Amask && info->a) { + ((unsigned char *) &valpha)[0] = alpha = info->a; valpha = vec_splat(valpha, 0); } else { alpha = 0; @@ -471,7 +480,7 @@ static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) { vector unsigned char voverflow; vector unsigned char vsrc; - int width = info->d_width; + int width = info->dst_w; int extrawidth; /* do scalar until we can align... */ @@ -490,7 +499,7 @@ static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) { ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width); /* After all that work, here's the vector part! */ - extrawidth = (width % 8); /* trailing unaligned stores */ + extrawidth = (width % 8); /* trailing unaligned stores */ width -= extrawidth; vsrc = vec_ld(0, src); valigner = VEC_ALIGNER(src); @@ -502,66 +511,71 @@ static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) { voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vR = vec_and(vec_sl((vector unsigned short)vsrc,v1), vf800); - vB = vec_sl((vector unsigned short)vsrc, v3); + vR = vec_and(vec_sl((vector unsigned short) vsrc, v1), vf800); + vB = vec_sl((vector unsigned short) vsrc, v3); vG = vec_sl(vB, v3); - vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1); - vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1); - vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1); + vdst1 = + (vector unsigned char) vec_perm((vector unsigned char) vR, + valpha, vredalpha1); + vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1); + vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1); vdst1 = vec_perm(vdst1, valpha, vpermute); vec_st(vdst1, 0, dst); - vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2); - vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2); - vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2); + vdst2 = + (vector unsigned char) vec_perm((vector unsigned char) vR, + valpha, vredalpha2); + vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2); + vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2); vdst2 = vec_perm(vdst2, valpha, vpermute); vec_st(vdst2, 16, dst); - + width -= 8; dst += 32; src += 16; vsrc = voverflow; } - assert(width == 0); + SDL_assert(width == 0); /* do scalar until we can align... */ ONE_PIXEL_BLEND((extrawidth), extrawidth); #undef ONE_PIXEL_BLEND - src += srcskip; /* move to next row, accounting for pitch. */ + src += srcskip; /* move to next row, accounting for pitch. */ dst += dstskip; } } -static void BlitNtoNKey(SDL_BlitInfo *info); -static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info); -static void Blit32to32KeyAltivec(SDL_BlitInfo *info) +static void BlitNtoNKey(SDL_BlitInfo * info); +static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info); +static void +Blit32to32KeyAltivec(SDL_BlitInfo * info) { - int height = info->d_height; - Uint32 *srcp = (Uint32 *) info->s_pixels; - int srcskip = info->s_skip; - Uint32 *dstp = (Uint32 *) info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip / 4; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip / 4; + SDL_PixelFormat *srcfmt = info->src_fmt; int srcbpp = srcfmt->BytesPerPixel; - SDL_PixelFormat *dstfmt = info->dst; + SDL_PixelFormat *dstfmt = info->dst_fmt; int dstbpp = dstfmt->BytesPerPixel; int copy_alpha = (srcfmt->Amask && dstfmt->Amask); - unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0; + unsigned alpha = dstfmt->Amask ? info->a : 0; Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask; - Uint32 ckey = info->src->colorkey; + Uint32 ckey = info->colorkey; vector unsigned int valpha; vector unsigned char vpermute; vector unsigned char vzero; vector unsigned int vckey; vector unsigned int vrgbmask; vpermute = calc_swizzle32(srcfmt, dstfmt); - if (info->d_width < 16) { - if(copy_alpha) { + if (info->dst_w < 16) { + if (copy_alpha) { BlitNtoNKeyCopyAlpha(info); } else { BlitNtoNKey(info); @@ -570,15 +584,16 @@ static void Blit32to32KeyAltivec(SDL_BlitInfo *info) } vzero = vec_splat_u8(0); if (alpha) { - ((unsigned char *)&valpha)[0] = (unsigned char)alpha; - valpha = (vector unsigned int)vec_splat((vector unsigned char)valpha, 0); + ((unsigned char *) &valpha)[0] = (unsigned char) alpha; + valpha = + (vector unsigned int) vec_splat((vector unsigned char) valpha, 0); } else { - valpha = (vector unsigned int)vzero; + valpha = (vector unsigned int) vzero; } ckey &= rgbmask; - ((unsigned int *)(char*)&vckey)[0] = ckey; + ((unsigned int *) (char *) &vckey)[0] = ckey; vckey = vec_splat(vckey, 0); - ((unsigned int *)(char*)&vrgbmask)[0] = rgbmask; + ((unsigned int *) (char *) &vrgbmask)[0] = rgbmask; vrgbmask = vec_splat(vrgbmask, 0); while (height--) { @@ -612,15 +627,15 @@ static void Blit32to32KeyAltivec(SDL_BlitInfo *info) widthvar--; \ } \ } - int width = info->d_width; + int width = info->dst_w; ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width); - assert(width > 0); + SDL_assert(width > 0); if (width > 0) { int extrawidth = (width % 4); vector unsigned char valigner = VEC_ALIGNER(srcp); vector unsigned int vs = vec_ld(0, srcp); width -= extrawidth; - assert(width >= 4); + SDL_assert(width >= 4); while (width) { vector unsigned char vsel; vector unsigned int vd; @@ -628,15 +643,17 @@ static void Blit32to32KeyAltivec(SDL_BlitInfo *info) /* load the source vec */ vs = vec_perm(vs, voverflow, valigner); /* vsel is set for items that match the key */ - vsel = (vector unsigned char)vec_and(vs, vrgbmask); - vsel = (vector unsigned char)vec_cmpeq(vs, vckey); + vsel = (vector unsigned char) vec_and(vs, vrgbmask); + vsel = (vector unsigned char) vec_cmpeq(vs, vckey); /* permute the src vec to the dest format */ vs = vec_perm(vs, valpha, vpermute); /* load the destination vec */ vd = vec_ld(0, dstp); /* select the source and dest into vs */ - vd = (vector unsigned int)vec_sel((vector unsigned char)vs, (vector unsigned char)vd, vsel); - + vd = (vector unsigned int) vec_sel((vector unsigned char) vs, + (vector unsigned char) vd, + vsel); + vec_st(vd, 0, dstp); srcp += 4; width -= 4; @@ -645,35 +662,36 @@ static void Blit32to32KeyAltivec(SDL_BlitInfo *info) } ONE_PIXEL_BLEND((extrawidth), extrawidth); #undef ONE_PIXEL_BLEND - srcp += srcskip >> 2; - dstp += dstskip >> 2; + srcp += srcskip; + dstp += dstskip; } } } /* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */ /* Use this on a G5 */ -static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info) +static void +ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info) { - int height = info->d_height; - Uint32 *src = (Uint32 *) info->s_pixels; - int srcskip = info->s_skip; - Uint32 *dst = (Uint32 *) info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; + int height = info->dst_h; + Uint32 *src = (Uint32 *) info->src; + int srcskip = info->src_skip / 4; + Uint32 *dst = (Uint32 *) info->dst; + int dstskip = info->dst_skip / 4; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; vector unsigned int vzero = vec_splat_u32(0); vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt); if (dstfmt->Amask && !srcfmt->Amask) { - if (srcfmt->alpha) { + if (info->a) { vector unsigned char valpha; - ((unsigned char *)&valpha)[0] = srcfmt->alpha; - vzero = (vector unsigned int)vec_splat(valpha, 0); + ((unsigned char *) &valpha)[0] = info->a; + vzero = (vector unsigned int) vec_splat(valpha, 0); } } - assert(srcfmt->BytesPerPixel == 4); - assert(dstfmt->BytesPerPixel == 4); + SDL_assert(srcfmt->BytesPerPixel == 4); + SDL_assert(dstfmt->BytesPerPixel == 4); while (height--) { vector unsigned char valigner; @@ -682,13 +700,15 @@ static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info) Uint32 bits; Uint8 r, g, b, a; - int width = info->d_width; + int width = info->dst_w; int extrawidth; /* do scalar until we can align... */ while ((UNALIGNED_PTR(dst)) && (width)) { bits = *(src++); RGBA_FROM_8888(bits, srcfmt, r, g, b, a); + if(!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); width--; } @@ -699,59 +719,62 @@ static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info) valigner = VEC_ALIGNER(src); vbits = vec_ld(0, src); - while (width) { + while (width) { voverflow = vec_ld(15, src); src += 4; width -= 4; - vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ - vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ - vec_st(vbits, 0, dst); /* store it back out. */ + vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ + vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ + vec_st(vbits, 0, dst); /* store it back out. */ dst += 4; vbits = voverflow; } - assert(width == 0); + SDL_assert(width == 0); /* cover pixels at the end of the row that didn't fit in 16 bytes. */ while (extrawidth) { - bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ + bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ RGBA_FROM_8888(bits, srcfmt, r, g, b, a); + if(!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); extrawidth--; } - src += srcskip >> 2; /* move to next row, accounting for pitch. */ - dst += dstskip >> 2; + src += srcskip; + dst += dstskip; } } /* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */ /* Use this on a G4 */ -static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info) +static void +ConvertAltivec32to32_prefetch(SDL_BlitInfo * info) { - const int scalar_dst_lead = sizeof (Uint32) * 4; - const int vector_dst_lead = sizeof (Uint32) * 16; - - int height = info->d_height; - Uint32 *src = (Uint32 *) info->s_pixels; - int srcskip = info->s_skip; - Uint32 *dst = (Uint32 *) info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; + const int scalar_dst_lead = sizeof(Uint32) * 4; + const int vector_dst_lead = sizeof(Uint32) * 16; + + int height = info->dst_h; + Uint32 *src = (Uint32 *) info->src; + int srcskip = info->src_skip / 4; + Uint32 *dst = (Uint32 *) info->dst; + int dstskip = info->dst_skip / 4; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; vector unsigned int vzero = vec_splat_u32(0); vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt); if (dstfmt->Amask && !srcfmt->Amask) { - if (srcfmt->alpha) { + if (info->a) { vector unsigned char valpha; - ((unsigned char *)&valpha)[0] = srcfmt->alpha; - vzero = (vector unsigned int)vec_splat(valpha, 0); + ((unsigned char *) &valpha)[0] = info->a; + vzero = (vector unsigned int) vec_splat(valpha, 0); } } - assert(srcfmt->BytesPerPixel == 4); - assert(dstfmt->BytesPerPixel == 4); + SDL_assert(srcfmt->BytesPerPixel == 4); + SDL_assert(dstfmt->BytesPerPixel == 4); while (height--) { vector unsigned char valigner; @@ -760,15 +783,19 @@ static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info) Uint32 bits; Uint8 r, g, b, a; - int width = info->d_width; + int width = info->dst_w; int extrawidth; /* do scalar until we can align... */ while ((UNALIGNED_PTR(dst)) && (width)) { - vec_dstt(src+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC); - vec_dstst(dst+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST); + vec_dstt(src + scalar_dst_lead, DST_CTRL(2, 32, 1024), + DST_CHAN_SRC); + vec_dstst(dst + scalar_dst_lead, DST_CTRL(2, 32, 1024), + DST_CHAN_DEST); bits = *(src++); RGBA_FROM_8888(bits, srcfmt, r, g, b, a); + if(!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); width--; } @@ -780,37 +807,42 @@ static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info) vbits = vec_ld(0, src); while (width) { - vec_dstt(src+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC); - vec_dstst(dst+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST); + vec_dstt(src + vector_dst_lead, DST_CTRL(2, 32, 1024), + DST_CHAN_SRC); + vec_dstst(dst + vector_dst_lead, DST_CTRL(2, 32, 1024), + DST_CHAN_DEST); voverflow = vec_ld(15, src); src += 4; width -= 4; - vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ - vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ - vec_st(vbits, 0, dst); /* store it back out. */ + vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ + vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ + vec_st(vbits, 0, dst); /* store it back out. */ dst += 4; vbits = voverflow; } - - assert(width == 0); + + SDL_assert(width == 0); /* cover pixels at the end of the row that didn't fit in 16 bytes. */ while (extrawidth) { - bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ + bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ RGBA_FROM_8888(bits, srcfmt, r, g, b, a); + if(!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); extrawidth--; } - src += srcskip >> 2; /* move to next row, accounting for pitch. */ - dst += dstskip >> 2; + src += srcskip; + dst += dstskip; } vec_dss(DST_CHAN_SRC); vec_dss(DST_CHAN_DEST); } -static Uint32 GetBlitFeatures( void ) +static Uint32 +GetBlitFeatures(void) { static Uint32 features = 0xffffffff; if (features == 0xffffffff) { @@ -820,19 +852,20 @@ static Uint32 GetBlitFeatures( void ) features = 0; SDL_sscanf(override, "%u", &features); } else { - features = ( 0 - /* Feature 1 is has-MMX */ - | ((SDL_HasMMX()) ? 1 : 0) - /* Feature 2 is has-AltiVec */ - | ((SDL_HasAltiVec()) ? 2 : 0) - /* Feature 4 is dont-use-prefetch */ - /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */ - | ((GetL3CacheSize() == 0) ? 4 : 0) - ); + features = (0 + /* Feature 1 is has-MMX */ + | ((SDL_HasMMX())? 1 : 0) + /* Feature 2 is has-AltiVec */ + | ((SDL_HasAltiVec())? 2 : 0) + /* Feature 4 is dont-use-prefetch */ + /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */ + | ((GetL3CacheSize() == 0) ? 4 : 0) + ); } } return features; } + #if __MWERKS__ #pragma altivec_model off #endif @@ -843,1650 +876,1726 @@ static Uint32 GetBlitFeatures( void ) /* This is now endian dependent */ #if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define HI 1 -#define LO 0 +#define HI 1 +#define LO 0 #else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */ -#define HI 0 -#define LO 1 +#define HI 0 +#define LO 1 #endif -#if SDL_HERMES_BLITTERS - -/* Heheheh, we coerce Hermes into using SDL blit information */ -#define X86_ASSEMBLER -#define HermesConverterInterface SDL_BlitInfo -#define HermesClearInterface void -#define STACKCALL - -#include "../hermes/HeadMMX.h" -#include "../hermes/HeadX86.h" +/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */ +#define RGB888_RGB332(dst, src) { \ + dst = (Uint8)((((src)&0x00E00000)>>16)| \ + (((src)&0x0000E000)>>11)| \ + (((src)&0x000000C0)>>6)); \ +} +static void +Blit_RGB888_index8(SDL_BlitInfo * info) +{ +#ifndef USE_DUFFS_LOOP + int c; +#endif + int width, height; + Uint32 *src; + const Uint8 *map; + Uint8 *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = (Uint32 *) info->src; + srcskip = info->src_skip / 4; + dst = info->dst; + dstskip = info->dst_skip; + map = info->table; + + if (map == NULL) { + while (height--) { +#ifdef USE_DUFFS_LOOP + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB888_RGB332(*dst++, *src); + , width); + /* *INDENT-ON* */ +#else + for (c = width / 4; c; --c) { + /* Pack RGB into 8bit pixel */ + ++src; + RGB888_RGB332(*dst++, *src); + ++src; + RGB888_RGB332(*dst++, *src); + ++src; + RGB888_RGB332(*dst++, *src); + ++src; + } + switch (width & 3) { + case 3: + RGB888_RGB332(*dst++, *src); + ++src; + case 2: + RGB888_RGB332(*dst++, *src); + ++src; + case 1: + RGB888_RGB332(*dst++, *src); + ++src; + } +#endif /* USE_DUFFS_LOOP */ + src += srcskip; + dst += dstskip; + } + } else { + int Pixel; + while (height--) { +#ifdef USE_DUFFS_LOOP + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + , width); + /* *INDENT-ON* */ #else + for (c = width / 4; c; --c) { + /* Pack RGB into 8bit pixel */ + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + } + switch (width & 3) { + case 3: + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + case 2: + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + case 1: + RGB888_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + } +#endif /* USE_DUFFS_LOOP */ + src += srcskip; + dst += dstskip; + } + } +} -/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */ -#define RGB888_RGB332(dst, src) { \ - dst = (Uint8)((((src)&0x00E00000)>>16)| \ - (((src)&0x0000E000)>>11)| \ - (((src)&0x000000C0)>>6)); \ +/* Special optimized blit for RGB 10-10-10 --> RGB 3-3-2 */ +#define RGB101010_RGB332(dst, src) { \ + dst = (Uint8)((((src)&0x38000000)>>22)| \ + (((src)&0x000E0000)>>15)| \ + (((src)&0x00000300)>>8)); \ } -static void Blit_RGB888_index8(SDL_BlitInfo *info) +static void +Blit_RGB101010_index8(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int width, height; - Uint32 *src; - const Uint8 *map; - Uint8 *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = (Uint32 *)info->s_pixels; - srcskip = info->s_skip/4; - dst = info->d_pixels; - dstskip = info->d_skip; - map = info->table; - - if ( map == NULL ) { - while ( height-- ) { + int width, height; + Uint32 *src; + const Uint8 *map; + Uint8 *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = (Uint32 *) info->src; + srcskip = info->src_skip / 4; + dst = info->dst; + dstskip = info->dst_skip; + map = info->table; + + if (map == NULL) { + while (height--) { #ifdef USE_DUFFS_LOOP - DUFFS_LOOP( - RGB888_RGB332(*dst++, *src); - , width); + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB101010_RGB332(*dst++, *src); + , width); + /* *INDENT-ON* */ #else - for ( c=width/4; c; --c ) { - /* Pack RGB into 8bit pixel */ - ++src; - RGB888_RGB332(*dst++, *src); - ++src; - RGB888_RGB332(*dst++, *src); - ++src; - RGB888_RGB332(*dst++, *src); - ++src; - } - switch ( width & 3 ) { - case 3: - RGB888_RGB332(*dst++, *src); - ++src; - case 2: - RGB888_RGB332(*dst++, *src); - ++src; - case 1: - RGB888_RGB332(*dst++, *src); - ++src; - } + for (c = width / 4; c; --c) { + /* Pack RGB into 8bit pixel */ + ++src; + RGB101010_RGB332(*dst++, *src); + ++src; + RGB101010_RGB332(*dst++, *src); + ++src; + RGB101010_RGB332(*dst++, *src); + ++src; + } + switch (width & 3) { + case 3: + RGB101010_RGB332(*dst++, *src); + ++src; + case 2: + RGB101010_RGB332(*dst++, *src); + ++src; + case 1: + RGB101010_RGB332(*dst++, *src); + ++src; + } #endif /* USE_DUFFS_LOOP */ - src += srcskip; - dst += dstskip; - } - } else { - int Pixel; + src += srcskip; + dst += dstskip; + } + } else { + int Pixel; - while ( height-- ) { + while (height--) { #ifdef USE_DUFFS_LOOP - DUFFS_LOOP( - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - , width); + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + , width); + /* *INDENT-ON* */ #else - for ( c=width/4; c; --c ) { - /* Pack RGB into 8bit pixel */ - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - } - switch ( width & 3 ) { - case 3: - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - case 2: - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - case 1: - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - } + for (c = width / 4; c; --c) { + /* Pack RGB into 8bit pixel */ + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + } + switch (width & 3) { + case 3: + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + case 2: + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + case 1: + RGB101010_RGB332(Pixel, *src); + *dst++ = map[Pixel]; + ++src; + } #endif /* USE_DUFFS_LOOP */ - src += srcskip; - dst += dstskip; - } - } + src += srcskip; + dst += dstskip; + } + } } + /* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */ #define RGB888_RGB555(dst, src) { \ - *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \ - (((*src)&0x0000F800)>>6)| \ - (((*src)&0x000000F8)>>3)); \ + *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \ + (((*src)&0x0000F800)>>6)| \ + (((*src)&0x000000F8)>>3)); \ } #define RGB888_RGB555_TWO(dst, src) { \ - *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \ - (((src[HI])&0x0000F800)>>6)| \ - (((src[HI])&0x000000F8)>>3))<<16)| \ - (((src[LO])&0x00F80000)>>9)| \ - (((src[LO])&0x0000F800)>>6)| \ - (((src[LO])&0x000000F8)>>3); \ + *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \ + (((src[HI])&0x0000F800)>>6)| \ + (((src[HI])&0x000000F8)>>3))<<16)| \ + (((src[LO])&0x00F80000)>>9)| \ + (((src[LO])&0x0000F800)>>6)| \ + (((src[LO])&0x000000F8)>>3); \ } -static void Blit_RGB888_RGB555(SDL_BlitInfo *info) +static void +Blit_RGB888_RGB555(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int width, height; - Uint32 *src; - Uint16 *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = (Uint32 *)info->s_pixels; - srcskip = info->s_skip/4; - dst = (Uint16 *)info->d_pixels; - dstskip = info->d_skip/2; + int width, height; + Uint32 *src; + Uint16 *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = (Uint32 *) info->src; + srcskip = info->src_skip / 4; + dst = (Uint16 *) info->dst; + dstskip = info->dst_skip / 2; #ifdef USE_DUFFS_LOOP - while ( height-- ) { - DUFFS_LOOP( - RGB888_RGB555(dst, src); - ++src; - ++dst; - , width); - src += srcskip; - dst += dstskip; - } + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB888_RGB555(dst, src); + ++src; + ++dst; + , width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } #else - /* Memory align at 4-byte boundary, if necessary */ - if ( (long)dst & 0x03 ) { - /* Don't do anything if width is 0 */ - if ( width == 0 ) { - return; - } - --width; - - while ( height-- ) { - /* Perform copy alignment */ - RGB888_RGB555(dst, src); - ++src; - ++dst; - - /* Copy in 4 pixel chunks */ - for ( c=width/4; c; --c ) { - RGB888_RGB555_TWO(dst, src); - src += 2; - dst += 2; - RGB888_RGB555_TWO(dst, src); - src += 2; - dst += 2; - } - /* Get any leftovers */ - switch (width & 3) { - case 3: - RGB888_RGB555(dst, src); - ++src; - ++dst; - case 2: - RGB888_RGB555_TWO(dst, src); - src += 2; - dst += 2; - break; - case 1: - RGB888_RGB555(dst, src); - ++src; - ++dst; - break; - } - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { - /* Copy in 4 pixel chunks */ - for ( c=width/4; c; --c ) { - RGB888_RGB555_TWO(dst, src); - src += 2; - dst += 2; - RGB888_RGB555_TWO(dst, src); - src += 2; - dst += 2; - } - /* Get any leftovers */ - switch (width & 3) { - case 3: - RGB888_RGB555(dst, src); - ++src; - ++dst; - case 2: - RGB888_RGB555_TWO(dst, src); - src += 2; - dst += 2; - break; - case 1: - RGB888_RGB555(dst, src); - ++src; - ++dst; - break; - } - src += srcskip; - dst += dstskip; - } - } + /* Memory align at 4-byte boundary, if necessary */ + if ((long) dst & 0x03) { + /* Don't do anything if width is 0 */ + if (width == 0) { + return; + } + --width; + + while (height--) { + /* Perform copy alignment */ + RGB888_RGB555(dst, src); + ++src; + ++dst; + + /* Copy in 4 pixel chunks */ + for (c = width / 4; c; --c) { + RGB888_RGB555_TWO(dst, src); + src += 2; + dst += 2; + RGB888_RGB555_TWO(dst, src); + src += 2; + dst += 2; + } + /* Get any leftovers */ + switch (width & 3) { + case 3: + RGB888_RGB555(dst, src); + ++src; + ++dst; + case 2: + RGB888_RGB555_TWO(dst, src); + src += 2; + dst += 2; + break; + case 1: + RGB888_RGB555(dst, src); + ++src; + ++dst; + break; + } + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + /* Copy in 4 pixel chunks */ + for (c = width / 4; c; --c) { + RGB888_RGB555_TWO(dst, src); + src += 2; + dst += 2; + RGB888_RGB555_TWO(dst, src); + src += 2; + dst += 2; + } + /* Get any leftovers */ + switch (width & 3) { + case 3: + RGB888_RGB555(dst, src); + ++src; + ++dst; + case 2: + RGB888_RGB555_TWO(dst, src); + src += 2; + dst += 2; + break; + case 1: + RGB888_RGB555(dst, src); + ++src; + ++dst; + break; + } + src += srcskip; + dst += dstskip; + } + } #endif /* USE_DUFFS_LOOP */ } + /* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */ #define RGB888_RGB565(dst, src) { \ - *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \ - (((*src)&0x0000FC00)>>5)| \ - (((*src)&0x000000F8)>>3)); \ + *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \ + (((*src)&0x0000FC00)>>5)| \ + (((*src)&0x000000F8)>>3)); \ } #define RGB888_RGB565_TWO(dst, src) { \ - *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \ - (((src[HI])&0x0000FC00)>>5)| \ - (((src[HI])&0x000000F8)>>3))<<16)| \ - (((src[LO])&0x00F80000)>>8)| \ - (((src[LO])&0x0000FC00)>>5)| \ - (((src[LO])&0x000000F8)>>3); \ + *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \ + (((src[HI])&0x0000FC00)>>5)| \ + (((src[HI])&0x000000F8)>>3))<<16)| \ + (((src[LO])&0x00F80000)>>8)| \ + (((src[LO])&0x0000FC00)>>5)| \ + (((src[LO])&0x000000F8)>>3); \ } -static void Blit_RGB888_RGB565(SDL_BlitInfo *info) +static void +Blit_RGB888_RGB565(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int width, height; - Uint32 *src; - Uint16 *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = (Uint32 *)info->s_pixels; - srcskip = info->s_skip/4; - dst = (Uint16 *)info->d_pixels; - dstskip = info->d_skip/2; + int width, height; + Uint32 *src; + Uint16 *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = (Uint32 *) info->src; + srcskip = info->src_skip / 4; + dst = (Uint16 *) info->dst; + dstskip = info->dst_skip / 2; #ifdef USE_DUFFS_LOOP - while ( height-- ) { - DUFFS_LOOP( - RGB888_RGB565(dst, src); - ++src; - ++dst; - , width); - src += srcskip; - dst += dstskip; - } + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + RGB888_RGB565(dst, src); + ++src; + ++dst; + , width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } #else - /* Memory align at 4-byte boundary, if necessary */ - if ( (long)dst & 0x03 ) { - /* Don't do anything if width is 0 */ - if ( width == 0 ) { - return; - } - --width; - - while ( height-- ) { - /* Perform copy alignment */ - RGB888_RGB565(dst, src); - ++src; - ++dst; - - /* Copy in 4 pixel chunks */ - for ( c=width/4; c; --c ) { - RGB888_RGB565_TWO(dst, src); - src += 2; - dst += 2; - RGB888_RGB565_TWO(dst, src); - src += 2; - dst += 2; - } - /* Get any leftovers */ - switch (width & 3) { - case 3: - RGB888_RGB565(dst, src); - ++src; - ++dst; - case 2: - RGB888_RGB565_TWO(dst, src); - src += 2; - dst += 2; - break; - case 1: - RGB888_RGB565(dst, src); - ++src; - ++dst; - break; - } - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { - /* Copy in 4 pixel chunks */ - for ( c=width/4; c; --c ) { - RGB888_RGB565_TWO(dst, src); - src += 2; - dst += 2; - RGB888_RGB565_TWO(dst, src); - src += 2; - dst += 2; - } - /* Get any leftovers */ - switch (width & 3) { - case 3: - RGB888_RGB565(dst, src); - ++src; - ++dst; - case 2: - RGB888_RGB565_TWO(dst, src); - src += 2; - dst += 2; - break; - case 1: - RGB888_RGB565(dst, src); - ++src; - ++dst; - break; - } - src += srcskip; - dst += dstskip; - } - } + /* Memory align at 4-byte boundary, if necessary */ + if ((long) dst & 0x03) { + /* Don't do anything if width is 0 */ + if (width == 0) { + return; + } + --width; + + while (height--) { + /* Perform copy alignment */ + RGB888_RGB565(dst, src); + ++src; + ++dst; + + /* Copy in 4 pixel chunks */ + for (c = width / 4; c; --c) { + RGB888_RGB565_TWO(dst, src); + src += 2; + dst += 2; + RGB888_RGB565_TWO(dst, src); + src += 2; + dst += 2; + } + /* Get any leftovers */ + switch (width & 3) { + case 3: + RGB888_RGB565(dst, src); + ++src; + ++dst; + case 2: + RGB888_RGB565_TWO(dst, src); + src += 2; + dst += 2; + break; + case 1: + RGB888_RGB565(dst, src); + ++src; + ++dst; + break; + } + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + /* Copy in 4 pixel chunks */ + for (c = width / 4; c; --c) { + RGB888_RGB565_TWO(dst, src); + src += 2; + dst += 2; + RGB888_RGB565_TWO(dst, src); + src += 2; + dst += 2; + } + /* Get any leftovers */ + switch (width & 3) { + case 3: + RGB888_RGB565(dst, src); + ++src; + ++dst; + case 2: + RGB888_RGB565_TWO(dst, src); + src += 2; + dst += 2; + break; + case 1: + RGB888_RGB565(dst, src); + ++src; + ++dst; + break; + } + src += srcskip; + dst += dstskip; + } + } #endif /* USE_DUFFS_LOOP */ } -#endif /* SDL_HERMES_BLITTERS */ - /* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */ #define RGB565_32(dst, src, map) (map[src[LO]*2] + map[src[HI]*2+1]) -static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map) +static void +Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int width, height; - Uint8 *src; - Uint32 *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = (Uint8 *)info->s_pixels; - srcskip = info->s_skip; - dst = (Uint32 *)info->d_pixels; - dstskip = info->d_skip/4; + int width, height; + Uint8 *src; + Uint32 *dst; + int srcskip, dstskip; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = (Uint8 *) info->src; + srcskip = info->src_skip; + dst = (Uint32 *) info->dst; + dstskip = info->dst_skip / 4; #ifdef USE_DUFFS_LOOP - while ( height-- ) { - DUFFS_LOOP( - { - *dst++ = RGB565_32(dst, src, map); - src += 2; - }, - width); - src += srcskip; - dst += dstskip; - } + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + *dst++ = RGB565_32(dst, src, map); + src += 2; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } #else - while ( height-- ) { - /* Copy in 4 pixel chunks */ - for ( c=width/4; c; --c ) { - *dst++ = RGB565_32(dst, src, map); - src += 2; - *dst++ = RGB565_32(dst, src, map); - src += 2; - *dst++ = RGB565_32(dst, src, map); - src += 2; - *dst++ = RGB565_32(dst, src, map); - src += 2; - } - /* Get any leftovers */ - switch (width & 3) { - case 3: - *dst++ = RGB565_32(dst, src, map); - src += 2; - case 2: - *dst++ = RGB565_32(dst, src, map); - src += 2; - case 1: - *dst++ = RGB565_32(dst, src, map); - src += 2; - break; - } - src += srcskip; - dst += dstskip; - } + while (height--) { + /* Copy in 4 pixel chunks */ + for (c = width / 4; c; --c) { + *dst++ = RGB565_32(dst, src, map); + src += 2; + *dst++ = RGB565_32(dst, src, map); + src += 2; + *dst++ = RGB565_32(dst, src, map); + src += 2; + *dst++ = RGB565_32(dst, src, map); + src += 2; + } + /* Get any leftovers */ + switch (width & 3) { + case 3: + *dst++ = RGB565_32(dst, src, map); + src += 2; + case 2: + *dst++ = RGB565_32(dst, src, map); + src += 2; + case 1: + *dst++ = RGB565_32(dst, src, map); + src += 2; + break; + } + src += srcskip; + dst += dstskip; + } #endif /* USE_DUFFS_LOOP */ } /* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */ static const Uint32 RGB565_ARGB8888_LUT[512] = { - 0x00000000, 0xff000000, 0x00000008, 0xff002000, - 0x00000010, 0xff004000, 0x00000018, 0xff006100, - 0x00000020, 0xff008100, 0x00000029, 0xff00a100, - 0x00000031, 0xff00c200, 0x00000039, 0xff00e200, - 0x00000041, 0xff080000, 0x0000004a, 0xff082000, - 0x00000052, 0xff084000, 0x0000005a, 0xff086100, - 0x00000062, 0xff088100, 0x0000006a, 0xff08a100, - 0x00000073, 0xff08c200, 0x0000007b, 0xff08e200, - 0x00000083, 0xff100000, 0x0000008b, 0xff102000, - 0x00000094, 0xff104000, 0x0000009c, 0xff106100, - 0x000000a4, 0xff108100, 0x000000ac, 0xff10a100, - 0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200, - 0x000000c5, 0xff180000, 0x000000cd, 0xff182000, - 0x000000d5, 0xff184000, 0x000000de, 0xff186100, - 0x000000e6, 0xff188100, 0x000000ee, 0xff18a100, - 0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200, - 0x00000400, 0xff200000, 0x00000408, 0xff202000, - 0x00000410, 0xff204000, 0x00000418, 0xff206100, - 0x00000420, 0xff208100, 0x00000429, 0xff20a100, - 0x00000431, 0xff20c200, 0x00000439, 0xff20e200, - 0x00000441, 0xff290000, 0x0000044a, 0xff292000, - 0x00000452, 0xff294000, 0x0000045a, 0xff296100, - 0x00000462, 0xff298100, 0x0000046a, 0xff29a100, - 0x00000473, 0xff29c200, 0x0000047b, 0xff29e200, - 0x00000483, 0xff310000, 0x0000048b, 0xff312000, - 0x00000494, 0xff314000, 0x0000049c, 0xff316100, - 0x000004a4, 0xff318100, 0x000004ac, 0xff31a100, - 0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200, - 0x000004c5, 0xff390000, 0x000004cd, 0xff392000, - 0x000004d5, 0xff394000, 0x000004de, 0xff396100, - 0x000004e6, 0xff398100, 0x000004ee, 0xff39a100, - 0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200, - 0x00000800, 0xff410000, 0x00000808, 0xff412000, - 0x00000810, 0xff414000, 0x00000818, 0xff416100, - 0x00000820, 0xff418100, 0x00000829, 0xff41a100, - 0x00000831, 0xff41c200, 0x00000839, 0xff41e200, - 0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000, - 0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100, - 0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100, - 0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200, - 0x00000883, 0xff520000, 0x0000088b, 0xff522000, - 0x00000894, 0xff524000, 0x0000089c, 0xff526100, - 0x000008a4, 0xff528100, 0x000008ac, 0xff52a100, - 0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200, - 0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000, - 0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100, - 0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100, - 0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200, - 0x00000c00, 0xff620000, 0x00000c08, 0xff622000, - 0x00000c10, 0xff624000, 0x00000c18, 0xff626100, - 0x00000c20, 0xff628100, 0x00000c29, 0xff62a100, - 0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200, - 0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000, - 0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100, - 0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100, - 0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200, - 0x00000c83, 0xff730000, 0x00000c8b, 0xff732000, - 0x00000c94, 0xff734000, 0x00000c9c, 0xff736100, - 0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100, - 0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200, - 0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000, - 0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100, - 0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100, - 0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200, - 0x00001000, 0xff830000, 0x00001008, 0xff832000, - 0x00001010, 0xff834000, 0x00001018, 0xff836100, - 0x00001020, 0xff838100, 0x00001029, 0xff83a100, - 0x00001031, 0xff83c200, 0x00001039, 0xff83e200, - 0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000, - 0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100, - 0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100, - 0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200, - 0x00001083, 0xff940000, 0x0000108b, 0xff942000, - 0x00001094, 0xff944000, 0x0000109c, 0xff946100, - 0x000010a4, 0xff948100, 0x000010ac, 0xff94a100, - 0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200, - 0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000, - 0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100, - 0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100, - 0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200, - 0x00001400, 0xffa40000, 0x00001408, 0xffa42000, - 0x00001410, 0xffa44000, 0x00001418, 0xffa46100, - 0x00001420, 0xffa48100, 0x00001429, 0xffa4a100, - 0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200, - 0x00001441, 0xffac0000, 0x0000144a, 0xffac2000, - 0x00001452, 0xffac4000, 0x0000145a, 0xffac6100, - 0x00001462, 0xffac8100, 0x0000146a, 0xffaca100, - 0x00001473, 0xffacc200, 0x0000147b, 0xfface200, - 0x00001483, 0xffb40000, 0x0000148b, 0xffb42000, - 0x00001494, 0xffb44000, 0x0000149c, 0xffb46100, - 0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100, - 0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200, - 0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000, - 0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100, - 0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100, - 0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200, - 0x00001800, 0xffc50000, 0x00001808, 0xffc52000, - 0x00001810, 0xffc54000, 0x00001818, 0xffc56100, - 0x00001820, 0xffc58100, 0x00001829, 0xffc5a100, - 0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200, - 0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000, - 0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100, - 0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100, - 0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200, - 0x00001883, 0xffd50000, 0x0000188b, 0xffd52000, - 0x00001894, 0xffd54000, 0x0000189c, 0xffd56100, - 0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100, - 0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200, - 0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000, - 0x000018d5, 0xffde4000, 0x000018de, 0xffde6100, - 0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100, - 0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200, - 0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000, - 0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100, - 0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100, - 0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200, - 0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000, - 0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100, - 0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100, - 0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200, - 0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000, - 0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100, - 0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100, - 0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200, - 0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000, - 0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100, - 0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100, - 0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200 + 0x00000000, 0xff000000, 0x00000008, 0xff002000, + 0x00000010, 0xff004000, 0x00000018, 0xff006100, + 0x00000020, 0xff008100, 0x00000029, 0xff00a100, + 0x00000031, 0xff00c200, 0x00000039, 0xff00e200, + 0x00000041, 0xff080000, 0x0000004a, 0xff082000, + 0x00000052, 0xff084000, 0x0000005a, 0xff086100, + 0x00000062, 0xff088100, 0x0000006a, 0xff08a100, + 0x00000073, 0xff08c200, 0x0000007b, 0xff08e200, + 0x00000083, 0xff100000, 0x0000008b, 0xff102000, + 0x00000094, 0xff104000, 0x0000009c, 0xff106100, + 0x000000a4, 0xff108100, 0x000000ac, 0xff10a100, + 0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200, + 0x000000c5, 0xff180000, 0x000000cd, 0xff182000, + 0x000000d5, 0xff184000, 0x000000de, 0xff186100, + 0x000000e6, 0xff188100, 0x000000ee, 0xff18a100, + 0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200, + 0x00000400, 0xff200000, 0x00000408, 0xff202000, + 0x00000410, 0xff204000, 0x00000418, 0xff206100, + 0x00000420, 0xff208100, 0x00000429, 0xff20a100, + 0x00000431, 0xff20c200, 0x00000439, 0xff20e200, + 0x00000441, 0xff290000, 0x0000044a, 0xff292000, + 0x00000452, 0xff294000, 0x0000045a, 0xff296100, + 0x00000462, 0xff298100, 0x0000046a, 0xff29a100, + 0x00000473, 0xff29c200, 0x0000047b, 0xff29e200, + 0x00000483, 0xff310000, 0x0000048b, 0xff312000, + 0x00000494, 0xff314000, 0x0000049c, 0xff316100, + 0x000004a4, 0xff318100, 0x000004ac, 0xff31a100, + 0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200, + 0x000004c5, 0xff390000, 0x000004cd, 0xff392000, + 0x000004d5, 0xff394000, 0x000004de, 0xff396100, + 0x000004e6, 0xff398100, 0x000004ee, 0xff39a100, + 0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200, + 0x00000800, 0xff410000, 0x00000808, 0xff412000, + 0x00000810, 0xff414000, 0x00000818, 0xff416100, + 0x00000820, 0xff418100, 0x00000829, 0xff41a100, + 0x00000831, 0xff41c200, 0x00000839, 0xff41e200, + 0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000, + 0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100, + 0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100, + 0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200, + 0x00000883, 0xff520000, 0x0000088b, 0xff522000, + 0x00000894, 0xff524000, 0x0000089c, 0xff526100, + 0x000008a4, 0xff528100, 0x000008ac, 0xff52a100, + 0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200, + 0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000, + 0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100, + 0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100, + 0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200, + 0x00000c00, 0xff620000, 0x00000c08, 0xff622000, + 0x00000c10, 0xff624000, 0x00000c18, 0xff626100, + 0x00000c20, 0xff628100, 0x00000c29, 0xff62a100, + 0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200, + 0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000, + 0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100, + 0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100, + 0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200, + 0x00000c83, 0xff730000, 0x00000c8b, 0xff732000, + 0x00000c94, 0xff734000, 0x00000c9c, 0xff736100, + 0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100, + 0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200, + 0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000, + 0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100, + 0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100, + 0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200, + 0x00001000, 0xff830000, 0x00001008, 0xff832000, + 0x00001010, 0xff834000, 0x00001018, 0xff836100, + 0x00001020, 0xff838100, 0x00001029, 0xff83a100, + 0x00001031, 0xff83c200, 0x00001039, 0xff83e200, + 0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000, + 0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100, + 0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100, + 0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200, + 0x00001083, 0xff940000, 0x0000108b, 0xff942000, + 0x00001094, 0xff944000, 0x0000109c, 0xff946100, + 0x000010a4, 0xff948100, 0x000010ac, 0xff94a100, + 0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200, + 0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000, + 0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100, + 0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100, + 0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200, + 0x00001400, 0xffa40000, 0x00001408, 0xffa42000, + 0x00001410, 0xffa44000, 0x00001418, 0xffa46100, + 0x00001420, 0xffa48100, 0x00001429, 0xffa4a100, + 0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200, + 0x00001441, 0xffac0000, 0x0000144a, 0xffac2000, + 0x00001452, 0xffac4000, 0x0000145a, 0xffac6100, + 0x00001462, 0xffac8100, 0x0000146a, 0xffaca100, + 0x00001473, 0xffacc200, 0x0000147b, 0xfface200, + 0x00001483, 0xffb40000, 0x0000148b, 0xffb42000, + 0x00001494, 0xffb44000, 0x0000149c, 0xffb46100, + 0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100, + 0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200, + 0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000, + 0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100, + 0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100, + 0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200, + 0x00001800, 0xffc50000, 0x00001808, 0xffc52000, + 0x00001810, 0xffc54000, 0x00001818, 0xffc56100, + 0x00001820, 0xffc58100, 0x00001829, 0xffc5a100, + 0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200, + 0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000, + 0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100, + 0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100, + 0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200, + 0x00001883, 0xffd50000, 0x0000188b, 0xffd52000, + 0x00001894, 0xffd54000, 0x0000189c, 0xffd56100, + 0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100, + 0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200, + 0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000, + 0x000018d5, 0xffde4000, 0x000018de, 0xffde6100, + 0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100, + 0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200, + 0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000, + 0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100, + 0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100, + 0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200, + 0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000, + 0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100, + 0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100, + 0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200, + 0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000, + 0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100, + 0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100, + 0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200, + 0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000, + 0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100, + 0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100, + 0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200 }; -static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info) + +static void +Blit_RGB565_ARGB8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_ARGB8888_LUT); } /* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */ static const Uint32 RGB565_ABGR8888_LUT[512] = { - 0xff000000, 0x00000000, 0xff080000, 0x00002000, - 0xff100000, 0x00004000, 0xff180000, 0x00006100, - 0xff200000, 0x00008100, 0xff290000, 0x0000a100, - 0xff310000, 0x0000c200, 0xff390000, 0x0000e200, - 0xff410000, 0x00000008, 0xff4a0000, 0x00002008, - 0xff520000, 0x00004008, 0xff5a0000, 0x00006108, - 0xff620000, 0x00008108, 0xff6a0000, 0x0000a108, - 0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208, - 0xff830000, 0x00000010, 0xff8b0000, 0x00002010, - 0xff940000, 0x00004010, 0xff9c0000, 0x00006110, - 0xffa40000, 0x00008110, 0xffac0000, 0x0000a110, - 0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210, - 0xffc50000, 0x00000018, 0xffcd0000, 0x00002018, - 0xffd50000, 0x00004018, 0xffde0000, 0x00006118, - 0xffe60000, 0x00008118, 0xffee0000, 0x0000a118, - 0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218, - 0xff000400, 0x00000020, 0xff080400, 0x00002020, - 0xff100400, 0x00004020, 0xff180400, 0x00006120, - 0xff200400, 0x00008120, 0xff290400, 0x0000a120, - 0xff310400, 0x0000c220, 0xff390400, 0x0000e220, - 0xff410400, 0x00000029, 0xff4a0400, 0x00002029, - 0xff520400, 0x00004029, 0xff5a0400, 0x00006129, - 0xff620400, 0x00008129, 0xff6a0400, 0x0000a129, - 0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229, - 0xff830400, 0x00000031, 0xff8b0400, 0x00002031, - 0xff940400, 0x00004031, 0xff9c0400, 0x00006131, - 0xffa40400, 0x00008131, 0xffac0400, 0x0000a131, - 0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231, - 0xffc50400, 0x00000039, 0xffcd0400, 0x00002039, - 0xffd50400, 0x00004039, 0xffde0400, 0x00006139, - 0xffe60400, 0x00008139, 0xffee0400, 0x0000a139, - 0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239, - 0xff000800, 0x00000041, 0xff080800, 0x00002041, - 0xff100800, 0x00004041, 0xff180800, 0x00006141, - 0xff200800, 0x00008141, 0xff290800, 0x0000a141, - 0xff310800, 0x0000c241, 0xff390800, 0x0000e241, - 0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a, - 0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a, - 0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a, - 0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a, - 0xff830800, 0x00000052, 0xff8b0800, 0x00002052, - 0xff940800, 0x00004052, 0xff9c0800, 0x00006152, - 0xffa40800, 0x00008152, 0xffac0800, 0x0000a152, - 0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252, - 0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a, - 0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a, - 0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a, - 0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a, - 0xff000c00, 0x00000062, 0xff080c00, 0x00002062, - 0xff100c00, 0x00004062, 0xff180c00, 0x00006162, - 0xff200c00, 0x00008162, 0xff290c00, 0x0000a162, - 0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262, - 0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a, - 0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a, - 0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a, - 0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a, - 0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073, - 0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173, - 0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173, - 0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273, - 0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b, - 0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b, - 0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b, - 0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b, - 0xff001000, 0x00000083, 0xff081000, 0x00002083, - 0xff101000, 0x00004083, 0xff181000, 0x00006183, - 0xff201000, 0x00008183, 0xff291000, 0x0000a183, - 0xff311000, 0x0000c283, 0xff391000, 0x0000e283, - 0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b, - 0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b, - 0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b, - 0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b, - 0xff831000, 0x00000094, 0xff8b1000, 0x00002094, - 0xff941000, 0x00004094, 0xff9c1000, 0x00006194, - 0xffa41000, 0x00008194, 0xffac1000, 0x0000a194, - 0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294, - 0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c, - 0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c, - 0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c, - 0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c, - 0xff001400, 0x000000a4, 0xff081400, 0x000020a4, - 0xff101400, 0x000040a4, 0xff181400, 0x000061a4, - 0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4, - 0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4, - 0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac, - 0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac, - 0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac, - 0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac, - 0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4, - 0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4, - 0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4, - 0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4, - 0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd, - 0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd, - 0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd, - 0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd, - 0xff001800, 0x000000c5, 0xff081800, 0x000020c5, - 0xff101800, 0x000040c5, 0xff181800, 0x000061c5, - 0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5, - 0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5, - 0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd, - 0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd, - 0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd, - 0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd, - 0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5, - 0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5, - 0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5, - 0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5, - 0xffc51800, 0x000000de, 0xffcd1800, 0x000020de, - 0xffd51800, 0x000040de, 0xffde1800, 0x000061de, - 0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de, - 0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de, - 0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6, - 0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6, - 0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6, - 0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6, - 0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee, - 0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee, - 0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee, - 0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee, - 0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6, - 0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6, - 0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6, - 0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6, - 0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff, - 0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff, - 0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff, - 0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff + 0xff000000, 0x00000000, 0xff080000, 0x00002000, + 0xff100000, 0x00004000, 0xff180000, 0x00006100, + 0xff200000, 0x00008100, 0xff290000, 0x0000a100, + 0xff310000, 0x0000c200, 0xff390000, 0x0000e200, + 0xff410000, 0x00000008, 0xff4a0000, 0x00002008, + 0xff520000, 0x00004008, 0xff5a0000, 0x00006108, + 0xff620000, 0x00008108, 0xff6a0000, 0x0000a108, + 0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208, + 0xff830000, 0x00000010, 0xff8b0000, 0x00002010, + 0xff940000, 0x00004010, 0xff9c0000, 0x00006110, + 0xffa40000, 0x00008110, 0xffac0000, 0x0000a110, + 0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210, + 0xffc50000, 0x00000018, 0xffcd0000, 0x00002018, + 0xffd50000, 0x00004018, 0xffde0000, 0x00006118, + 0xffe60000, 0x00008118, 0xffee0000, 0x0000a118, + 0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218, + 0xff000400, 0x00000020, 0xff080400, 0x00002020, + 0xff100400, 0x00004020, 0xff180400, 0x00006120, + 0xff200400, 0x00008120, 0xff290400, 0x0000a120, + 0xff310400, 0x0000c220, 0xff390400, 0x0000e220, + 0xff410400, 0x00000029, 0xff4a0400, 0x00002029, + 0xff520400, 0x00004029, 0xff5a0400, 0x00006129, + 0xff620400, 0x00008129, 0xff6a0400, 0x0000a129, + 0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229, + 0xff830400, 0x00000031, 0xff8b0400, 0x00002031, + 0xff940400, 0x00004031, 0xff9c0400, 0x00006131, + 0xffa40400, 0x00008131, 0xffac0400, 0x0000a131, + 0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231, + 0xffc50400, 0x00000039, 0xffcd0400, 0x00002039, + 0xffd50400, 0x00004039, 0xffde0400, 0x00006139, + 0xffe60400, 0x00008139, 0xffee0400, 0x0000a139, + 0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239, + 0xff000800, 0x00000041, 0xff080800, 0x00002041, + 0xff100800, 0x00004041, 0xff180800, 0x00006141, + 0xff200800, 0x00008141, 0xff290800, 0x0000a141, + 0xff310800, 0x0000c241, 0xff390800, 0x0000e241, + 0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a, + 0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a, + 0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a, + 0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a, + 0xff830800, 0x00000052, 0xff8b0800, 0x00002052, + 0xff940800, 0x00004052, 0xff9c0800, 0x00006152, + 0xffa40800, 0x00008152, 0xffac0800, 0x0000a152, + 0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252, + 0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a, + 0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a, + 0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a, + 0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a, + 0xff000c00, 0x00000062, 0xff080c00, 0x00002062, + 0xff100c00, 0x00004062, 0xff180c00, 0x00006162, + 0xff200c00, 0x00008162, 0xff290c00, 0x0000a162, + 0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262, + 0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a, + 0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a, + 0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a, + 0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a, + 0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073, + 0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173, + 0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173, + 0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273, + 0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b, + 0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b, + 0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b, + 0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b, + 0xff001000, 0x00000083, 0xff081000, 0x00002083, + 0xff101000, 0x00004083, 0xff181000, 0x00006183, + 0xff201000, 0x00008183, 0xff291000, 0x0000a183, + 0xff311000, 0x0000c283, 0xff391000, 0x0000e283, + 0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b, + 0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b, + 0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b, + 0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b, + 0xff831000, 0x00000094, 0xff8b1000, 0x00002094, + 0xff941000, 0x00004094, 0xff9c1000, 0x00006194, + 0xffa41000, 0x00008194, 0xffac1000, 0x0000a194, + 0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294, + 0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c, + 0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c, + 0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c, + 0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c, + 0xff001400, 0x000000a4, 0xff081400, 0x000020a4, + 0xff101400, 0x000040a4, 0xff181400, 0x000061a4, + 0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4, + 0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4, + 0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac, + 0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac, + 0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac, + 0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac, + 0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4, + 0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4, + 0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4, + 0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4, + 0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd, + 0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd, + 0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd, + 0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd, + 0xff001800, 0x000000c5, 0xff081800, 0x000020c5, + 0xff101800, 0x000040c5, 0xff181800, 0x000061c5, + 0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5, + 0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5, + 0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd, + 0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd, + 0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd, + 0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd, + 0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5, + 0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5, + 0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5, + 0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5, + 0xffc51800, 0x000000de, 0xffcd1800, 0x000020de, + 0xffd51800, 0x000040de, 0xffde1800, 0x000061de, + 0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de, + 0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de, + 0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6, + 0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6, + 0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6, + 0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6, + 0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee, + 0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee, + 0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee, + 0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee, + 0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6, + 0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6, + 0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6, + 0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6, + 0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff, + 0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff, + 0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff, + 0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff }; -static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info) + +static void +Blit_RGB565_ABGR8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_ABGR8888_LUT); } /* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */ static const Uint32 RGB565_RGBA8888_LUT[512] = { - 0x000000ff, 0x00000000, 0x000008ff, 0x00200000, - 0x000010ff, 0x00400000, 0x000018ff, 0x00610000, - 0x000020ff, 0x00810000, 0x000029ff, 0x00a10000, - 0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000, - 0x000041ff, 0x08000000, 0x00004aff, 0x08200000, - 0x000052ff, 0x08400000, 0x00005aff, 0x08610000, - 0x000062ff, 0x08810000, 0x00006aff, 0x08a10000, - 0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000, - 0x000083ff, 0x10000000, 0x00008bff, 0x10200000, - 0x000094ff, 0x10400000, 0x00009cff, 0x10610000, - 0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000, - 0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000, - 0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000, - 0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000, - 0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000, - 0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000, - 0x000400ff, 0x20000000, 0x000408ff, 0x20200000, - 0x000410ff, 0x20400000, 0x000418ff, 0x20610000, - 0x000420ff, 0x20810000, 0x000429ff, 0x20a10000, - 0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000, - 0x000441ff, 0x29000000, 0x00044aff, 0x29200000, - 0x000452ff, 0x29400000, 0x00045aff, 0x29610000, - 0x000462ff, 0x29810000, 0x00046aff, 0x29a10000, - 0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000, - 0x000483ff, 0x31000000, 0x00048bff, 0x31200000, - 0x000494ff, 0x31400000, 0x00049cff, 0x31610000, - 0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000, - 0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000, - 0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000, - 0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000, - 0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000, - 0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000, - 0x000800ff, 0x41000000, 0x000808ff, 0x41200000, - 0x000810ff, 0x41400000, 0x000818ff, 0x41610000, - 0x000820ff, 0x41810000, 0x000829ff, 0x41a10000, - 0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000, - 0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000, - 0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000, - 0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000, - 0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000, - 0x000883ff, 0x52000000, 0x00088bff, 0x52200000, - 0x000894ff, 0x52400000, 0x00089cff, 0x52610000, - 0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000, - 0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000, - 0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000, - 0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000, - 0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000, - 0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000, - 0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000, - 0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000, - 0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000, - 0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000, - 0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000, - 0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000, - 0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000, - 0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000, - 0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000, - 0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000, - 0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000, - 0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000, - 0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000, - 0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000, - 0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000, - 0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000, - 0x001000ff, 0x83000000, 0x001008ff, 0x83200000, - 0x001010ff, 0x83400000, 0x001018ff, 0x83610000, - 0x001020ff, 0x83810000, 0x001029ff, 0x83a10000, - 0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000, - 0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000, - 0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000, - 0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000, - 0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000, - 0x001083ff, 0x94000000, 0x00108bff, 0x94200000, - 0x001094ff, 0x94400000, 0x00109cff, 0x94610000, - 0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000, - 0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000, - 0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000, - 0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000, - 0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000, - 0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000, - 0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000, - 0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000, - 0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000, - 0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000, - 0x001441ff, 0xac000000, 0x00144aff, 0xac200000, - 0x001452ff, 0xac400000, 0x00145aff, 0xac610000, - 0x001462ff, 0xac810000, 0x00146aff, 0xaca10000, - 0x001473ff, 0xacc20000, 0x00147bff, 0xace20000, - 0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000, - 0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000, - 0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000, - 0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000, - 0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000, - 0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000, - 0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000, - 0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000, - 0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000, - 0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000, - 0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000, - 0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000, - 0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000, - 0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000, - 0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000, - 0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000, - 0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000, - 0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000, - 0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000, - 0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000, - 0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000, - 0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000, - 0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000, - 0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000, - 0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000, - 0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000, - 0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000, - 0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000, - 0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000, - 0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000, - 0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000, - 0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000, - 0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000, - 0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000, - 0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000, - 0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000, - 0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000, - 0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000, - 0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000, - 0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000, + 0x000000ff, 0x00000000, 0x000008ff, 0x00200000, + 0x000010ff, 0x00400000, 0x000018ff, 0x00610000, + 0x000020ff, 0x00810000, 0x000029ff, 0x00a10000, + 0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000, + 0x000041ff, 0x08000000, 0x00004aff, 0x08200000, + 0x000052ff, 0x08400000, 0x00005aff, 0x08610000, + 0x000062ff, 0x08810000, 0x00006aff, 0x08a10000, + 0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000, + 0x000083ff, 0x10000000, 0x00008bff, 0x10200000, + 0x000094ff, 0x10400000, 0x00009cff, 0x10610000, + 0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000, + 0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000, + 0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000, + 0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000, + 0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000, + 0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000, + 0x000400ff, 0x20000000, 0x000408ff, 0x20200000, + 0x000410ff, 0x20400000, 0x000418ff, 0x20610000, + 0x000420ff, 0x20810000, 0x000429ff, 0x20a10000, + 0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000, + 0x000441ff, 0x29000000, 0x00044aff, 0x29200000, + 0x000452ff, 0x29400000, 0x00045aff, 0x29610000, + 0x000462ff, 0x29810000, 0x00046aff, 0x29a10000, + 0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000, + 0x000483ff, 0x31000000, 0x00048bff, 0x31200000, + 0x000494ff, 0x31400000, 0x00049cff, 0x31610000, + 0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000, + 0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000, + 0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000, + 0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000, + 0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000, + 0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000, + 0x000800ff, 0x41000000, 0x000808ff, 0x41200000, + 0x000810ff, 0x41400000, 0x000818ff, 0x41610000, + 0x000820ff, 0x41810000, 0x000829ff, 0x41a10000, + 0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000, + 0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000, + 0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000, + 0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000, + 0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000, + 0x000883ff, 0x52000000, 0x00088bff, 0x52200000, + 0x000894ff, 0x52400000, 0x00089cff, 0x52610000, + 0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000, + 0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000, + 0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000, + 0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000, + 0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000, + 0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000, + 0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000, + 0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000, + 0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000, + 0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000, + 0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000, + 0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000, + 0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000, + 0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000, + 0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000, + 0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000, + 0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000, + 0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000, + 0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000, + 0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000, + 0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000, + 0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000, + 0x001000ff, 0x83000000, 0x001008ff, 0x83200000, + 0x001010ff, 0x83400000, 0x001018ff, 0x83610000, + 0x001020ff, 0x83810000, 0x001029ff, 0x83a10000, + 0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000, + 0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000, + 0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000, + 0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000, + 0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000, + 0x001083ff, 0x94000000, 0x00108bff, 0x94200000, + 0x001094ff, 0x94400000, 0x00109cff, 0x94610000, + 0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000, + 0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000, + 0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000, + 0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000, + 0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000, + 0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000, + 0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000, + 0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000, + 0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000, + 0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000, + 0x001441ff, 0xac000000, 0x00144aff, 0xac200000, + 0x001452ff, 0xac400000, 0x00145aff, 0xac610000, + 0x001462ff, 0xac810000, 0x00146aff, 0xaca10000, + 0x001473ff, 0xacc20000, 0x00147bff, 0xace20000, + 0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000, + 0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000, + 0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000, + 0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000, + 0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000, + 0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000, + 0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000, + 0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000, + 0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000, + 0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000, + 0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000, + 0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000, + 0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000, + 0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000, + 0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000, + 0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000, + 0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000, + 0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000, + 0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000, + 0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000, + 0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000, + 0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000, + 0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000, + 0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000, + 0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000, + 0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000, + 0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000, + 0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000, + 0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000, + 0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000, + 0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000, + 0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000, + 0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000, + 0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000, + 0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000, + 0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000, + 0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000, + 0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000, + 0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000, + 0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000, }; -static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info) + +static void +Blit_RGB565_RGBA8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_RGBA8888_LUT); } /* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */ static const Uint32 RGB565_BGRA8888_LUT[512] = { - 0x00000000, 0x000000ff, 0x08000000, 0x002000ff, - 0x10000000, 0x004000ff, 0x18000000, 0x006100ff, - 0x20000000, 0x008100ff, 0x29000000, 0x00a100ff, - 0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff, - 0x41000000, 0x000008ff, 0x4a000000, 0x002008ff, - 0x52000000, 0x004008ff, 0x5a000000, 0x006108ff, - 0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff, - 0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff, - 0x83000000, 0x000010ff, 0x8b000000, 0x002010ff, - 0x94000000, 0x004010ff, 0x9c000000, 0x006110ff, - 0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff, - 0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff, - 0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff, - 0xd5000000, 0x004018ff, 0xde000000, 0x006118ff, - 0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff, - 0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff, - 0x00040000, 0x000020ff, 0x08040000, 0x002020ff, - 0x10040000, 0x004020ff, 0x18040000, 0x006120ff, - 0x20040000, 0x008120ff, 0x29040000, 0x00a120ff, - 0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff, - 0x41040000, 0x000029ff, 0x4a040000, 0x002029ff, - 0x52040000, 0x004029ff, 0x5a040000, 0x006129ff, - 0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff, - 0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff, - 0x83040000, 0x000031ff, 0x8b040000, 0x002031ff, - 0x94040000, 0x004031ff, 0x9c040000, 0x006131ff, - 0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff, - 0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff, - 0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff, - 0xd5040000, 0x004039ff, 0xde040000, 0x006139ff, - 0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff, - 0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff, - 0x00080000, 0x000041ff, 0x08080000, 0x002041ff, - 0x10080000, 0x004041ff, 0x18080000, 0x006141ff, - 0x20080000, 0x008141ff, 0x29080000, 0x00a141ff, - 0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff, - 0x41080000, 0x00004aff, 0x4a080000, 0x00204aff, - 0x52080000, 0x00404aff, 0x5a080000, 0x00614aff, - 0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff, - 0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff, - 0x83080000, 0x000052ff, 0x8b080000, 0x002052ff, - 0x94080000, 0x004052ff, 0x9c080000, 0x006152ff, - 0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff, - 0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff, - 0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff, - 0xd5080000, 0x00405aff, 0xde080000, 0x00615aff, - 0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff, - 0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff, - 0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff, - 0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff, - 0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff, - 0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff, - 0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff, - 0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff, - 0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff, - 0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff, - 0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff, - 0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff, - 0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff, - 0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff, - 0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff, - 0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff, - 0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff, - 0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff, - 0x00100000, 0x000083ff, 0x08100000, 0x002083ff, - 0x10100000, 0x004083ff, 0x18100000, 0x006183ff, - 0x20100000, 0x008183ff, 0x29100000, 0x00a183ff, - 0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff, - 0x41100000, 0x00008bff, 0x4a100000, 0x00208bff, - 0x52100000, 0x00408bff, 0x5a100000, 0x00618bff, - 0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff, - 0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff, - 0x83100000, 0x000094ff, 0x8b100000, 0x002094ff, - 0x94100000, 0x004094ff, 0x9c100000, 0x006194ff, - 0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff, - 0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff, - 0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff, - 0xd5100000, 0x00409cff, 0xde100000, 0x00619cff, - 0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff, - 0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff, - 0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff, - 0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff, - 0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff, - 0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff, - 0x41140000, 0x0000acff, 0x4a140000, 0x0020acff, - 0x52140000, 0x0040acff, 0x5a140000, 0x0061acff, - 0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff, - 0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff, - 0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff, - 0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff, - 0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff, - 0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff, - 0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff, - 0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff, - 0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff, - 0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff, - 0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff, - 0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff, - 0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff, - 0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff, - 0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff, - 0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff, - 0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff, - 0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff, - 0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff, - 0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff, - 0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff, - 0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff, - 0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff, - 0xd5180000, 0x0040deff, 0xde180000, 0x0061deff, - 0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff, - 0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff, - 0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff, - 0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff, - 0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff, - 0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff, - 0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff, - 0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff, - 0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff, - 0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff, - 0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff, - 0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff, - 0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff, - 0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff, - 0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff, - 0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff, - 0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff, - 0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff + 0x00000000, 0x000000ff, 0x08000000, 0x002000ff, + 0x10000000, 0x004000ff, 0x18000000, 0x006100ff, + 0x20000000, 0x008100ff, 0x29000000, 0x00a100ff, + 0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff, + 0x41000000, 0x000008ff, 0x4a000000, 0x002008ff, + 0x52000000, 0x004008ff, 0x5a000000, 0x006108ff, + 0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff, + 0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff, + 0x83000000, 0x000010ff, 0x8b000000, 0x002010ff, + 0x94000000, 0x004010ff, 0x9c000000, 0x006110ff, + 0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff, + 0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff, + 0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff, + 0xd5000000, 0x004018ff, 0xde000000, 0x006118ff, + 0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff, + 0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff, + 0x00040000, 0x000020ff, 0x08040000, 0x002020ff, + 0x10040000, 0x004020ff, 0x18040000, 0x006120ff, + 0x20040000, 0x008120ff, 0x29040000, 0x00a120ff, + 0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff, + 0x41040000, 0x000029ff, 0x4a040000, 0x002029ff, + 0x52040000, 0x004029ff, 0x5a040000, 0x006129ff, + 0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff, + 0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff, + 0x83040000, 0x000031ff, 0x8b040000, 0x002031ff, + 0x94040000, 0x004031ff, 0x9c040000, 0x006131ff, + 0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff, + 0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff, + 0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff, + 0xd5040000, 0x004039ff, 0xde040000, 0x006139ff, + 0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff, + 0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff, + 0x00080000, 0x000041ff, 0x08080000, 0x002041ff, + 0x10080000, 0x004041ff, 0x18080000, 0x006141ff, + 0x20080000, 0x008141ff, 0x29080000, 0x00a141ff, + 0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff, + 0x41080000, 0x00004aff, 0x4a080000, 0x00204aff, + 0x52080000, 0x00404aff, 0x5a080000, 0x00614aff, + 0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff, + 0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff, + 0x83080000, 0x000052ff, 0x8b080000, 0x002052ff, + 0x94080000, 0x004052ff, 0x9c080000, 0x006152ff, + 0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff, + 0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff, + 0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff, + 0xd5080000, 0x00405aff, 0xde080000, 0x00615aff, + 0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff, + 0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff, + 0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff, + 0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff, + 0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff, + 0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff, + 0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff, + 0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff, + 0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff, + 0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff, + 0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff, + 0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff, + 0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff, + 0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff, + 0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff, + 0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff, + 0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff, + 0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff, + 0x00100000, 0x000083ff, 0x08100000, 0x002083ff, + 0x10100000, 0x004083ff, 0x18100000, 0x006183ff, + 0x20100000, 0x008183ff, 0x29100000, 0x00a183ff, + 0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff, + 0x41100000, 0x00008bff, 0x4a100000, 0x00208bff, + 0x52100000, 0x00408bff, 0x5a100000, 0x00618bff, + 0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff, + 0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff, + 0x83100000, 0x000094ff, 0x8b100000, 0x002094ff, + 0x94100000, 0x004094ff, 0x9c100000, 0x006194ff, + 0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff, + 0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff, + 0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff, + 0xd5100000, 0x00409cff, 0xde100000, 0x00619cff, + 0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff, + 0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff, + 0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff, + 0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff, + 0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff, + 0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff, + 0x41140000, 0x0000acff, 0x4a140000, 0x0020acff, + 0x52140000, 0x0040acff, 0x5a140000, 0x0061acff, + 0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff, + 0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff, + 0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff, + 0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff, + 0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff, + 0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff, + 0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff, + 0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff, + 0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff, + 0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff, + 0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff, + 0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff, + 0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff, + 0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff, + 0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff, + 0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff, + 0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff, + 0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff, + 0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff, + 0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff, + 0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff, + 0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff, + 0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff, + 0xd5180000, 0x0040deff, 0xde180000, 0x0061deff, + 0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff, + 0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff, + 0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff, + 0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff, + 0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff, + 0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff, + 0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff, + 0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff, + 0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff, + 0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff, + 0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff, + 0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff, + 0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff, + 0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff, + 0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff, + 0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff, + 0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff, + 0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff }; -static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info) + +static void +Blit_RGB565_BGRA8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_BGRA8888_LUT); } -/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */ -#ifndef RGB888_RGB332 -#define RGB888_RGB332(dst, src) { \ - dst = (((src)&0x00E00000)>>16)| \ - (((src)&0x0000E000)>>11)| \ - (((src)&0x000000C0)>>6); \ -} -#endif -static void Blit_RGB888_index8_map(SDL_BlitInfo *info) +static void +BlitNto1(SDL_BlitInfo * info) { #ifndef USE_DUFFS_LOOP - int c; + int c; #endif - int Pixel; - int width, height; - Uint32 *src; - const Uint8 *map; - Uint8 *dst; - int srcskip, dstskip; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = (Uint32 *)info->s_pixels; - srcskip = info->s_skip/4; - dst = info->d_pixels; - dstskip = info->d_skip; - map = info->table; - + int width, height; + Uint8 *src; + const Uint8 *map; + Uint8 *dst; + int srcskip, dstskip; + int srcbpp; + Uint32 Pixel; + int sR, sG, sB; + SDL_PixelFormat *srcfmt; + + /* Set up some basic variables */ + width = info->dst_w; + height = info->dst_h; + src = info->src; + srcskip = info->src_skip; + dst = info->dst; + dstskip = info->dst_skip; + map = info->table; + srcfmt = info->src_fmt; + srcbpp = srcfmt->BytesPerPixel; + + if (map == NULL) { + while (height--) { #ifdef USE_DUFFS_LOOP - while ( height-- ) { - DUFFS_LOOP( - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - , width); - src += srcskip; - dst += dstskip; - } + /* *INDENT-OFF* */ + DUFFS_LOOP( + DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, + sR, sG, sB); + if ( 1 ) { + /* Pack RGB into 8bit pixel */ + *dst = ((sR>>5)<<(3+2))| + ((sG>>5)<<(2)) | + ((sB>>6)<<(0)) ; + } + dst++; + src += srcbpp; + , width); + /* *INDENT-ON* */ #else - while ( height-- ) { - for ( c=width/4; c; --c ) { - /* Pack RGB into 8bit pixel */ - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - } - switch ( width & 3 ) { - case 3: - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - case 2: - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - case 1: - RGB888_RGB332(Pixel, *src); - *dst++ = map[Pixel]; - ++src; - } - src += srcskip; - dst += dstskip; - } -#endif /* USE_DUFFS_LOOP */ -} -static void BlitNto1(SDL_BlitInfo *info) -{ -#ifndef USE_DUFFS_LOOP - int c; -#endif - int width, height; - Uint8 *src; - const Uint8 *map; - Uint8 *dst; - int srcskip, dstskip; - int srcbpp; - Uint32 Pixel; - int sR, sG, sB; - SDL_PixelFormat *srcfmt; - - /* Set up some basic variables */ - width = info->d_width; - height = info->d_height; - src = info->s_pixels; - srcskip = info->s_skip; - dst = info->d_pixels; - dstskip = info->d_skip; - map = info->table; - srcfmt = info->src; - srcbpp = srcfmt->BytesPerPixel; - - if ( map == NULL ) { - while ( height-- ) { -#ifdef USE_DUFFS_LOOP - DUFFS_LOOP( - DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, - sR, sG, sB); - if ( 1 ) { - /* Pack RGB into 8bit pixel */ - *dst = ((sR>>5)<<(3+2))| - ((sG>>5)<<(2)) | - ((sB>>6)<<(0)) ; - } - dst++; - src += srcbpp; - , width); -#else - for ( c=width; c; --c ) { - DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, - sR, sG, sB); - if ( 1 ) { - /* Pack RGB into 8bit pixel */ - *dst = ((sR>>5)<<(3+2))| - ((sG>>5)<<(2)) | - ((sB>>6)<<(0)) ; - } - dst++; - src += srcbpp; - } + for (c = width; c; --c) { + DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); + if (1) { + /* Pack RGB into 8bit pixel */ + *dst = ((sR >> 5) << (3 + 2)) | + ((sG >> 5) << (2)) | ((sB >> 6) << (0)); + } + dst++; + src += srcbpp; + } #endif - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { #ifdef USE_DUFFS_LOOP - DUFFS_LOOP( - DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, - sR, sG, sB); - if ( 1 ) { - /* Pack RGB into 8bit pixel */ - *dst = map[((sR>>5)<<(3+2))| - ((sG>>5)<<(2)) | - ((sB>>6)<<(0)) ]; - } - dst++; - src += srcbpp; - , width); + /* *INDENT-OFF* */ + DUFFS_LOOP( + DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, + sR, sG, sB); + if ( 1 ) { + /* Pack RGB into 8bit pixel */ + *dst = map[((sR>>5)<<(3+2))| + ((sG>>5)<<(2)) | + ((sB>>6)<<(0)) ]; + } + dst++; + src += srcbpp; + , width); + /* *INDENT-ON* */ #else - for ( c=width; c; --c ) { - DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, - sR, sG, sB); - if ( 1 ) { - /* Pack RGB into 8bit pixel */ - *dst = map[((sR>>5)<<(3+2))| - ((sG>>5)<<(2)) | - ((sB>>6)<<(0)) ]; - } - dst++; - src += srcbpp; - } + for (c = width; c; --c) { + DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); + if (1) { + /* Pack RGB into 8bit pixel */ + *dst = map[((sR >> 5) << (3 + 2)) | + ((sG >> 5) << (2)) | ((sB >> 6) << (0))]; + } + dst++; + src += srcbpp; + } #endif /* USE_DUFFS_LOOP */ - src += srcskip; - dst += dstskip; - } - } + src += srcskip; + dst += dstskip; + } + } } /* blits 32 bit RGB<->RGBA with both surfaces having the same R,G,B fields */ -static void Blit4to4MaskAlpha(SDL_BlitInfo *info) +static void +Blit4to4MaskAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint32 *src = (Uint32 *)info->s_pixels; - int srcskip = info->s_skip; - Uint32 *dst = (Uint32 *)info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - - if (dstfmt->Amask) { - /* RGB->RGBA, SET_ALPHA */ - Uint32 mask = (srcfmt->alpha >> dstfmt->Aloss) << dstfmt->Ashift; - - while ( height-- ) { - DUFFS_LOOP( - { - *dst = *src | mask; - ++dst; - ++src; - }, - width); - src = (Uint32*)((Uint8*)src + srcskip); - dst = (Uint32*)((Uint8*)dst + dstskip); - } - } else { - /* RGBA->RGB, NO_ALPHA */ - Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask; - - while ( height-- ) { - DUFFS_LOOP( - { - *dst = *src & mask; - ++dst; - ++src; - }, - width); - src = (Uint32*)((Uint8*)src + srcskip); - dst = (Uint32*)((Uint8*)dst + dstskip); - } - } + int width = info->dst_w; + int height = info->dst_h; + Uint32 *src = (Uint32 *) info->src; + int srcskip = info->src_skip; + Uint32 *dst = (Uint32 *) info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + + if (dstfmt->Amask) { + /* RGB->RGBA, SET_ALPHA */ + Uint32 mask = (info->a >> dstfmt->Aloss) << dstfmt->Ashift; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + *dst = *src | mask; + ++dst; + ++src; + }, + width); + /* *INDENT-ON* */ + src = (Uint32 *) ((Uint8 *) src + srcskip); + dst = (Uint32 *) ((Uint8 *) dst + dstskip); + } + } else { + /* RGBA->RGB, NO_ALPHA */ + Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + *dst = *src & mask; + ++dst; + ++src; + }, + width); + /* *INDENT-ON* */ + src = (Uint32 *) ((Uint8 *) src + srcskip); + dst = (Uint32 *) ((Uint8 *) dst + dstskip); + } + } } -static void BlitNtoN(SDL_BlitInfo *info) +static void +BlitNtoN(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - int srcbpp = srcfmt->BytesPerPixel; - SDL_PixelFormat *dstfmt = info->dst; - int dstbpp = dstfmt->BytesPerPixel; - unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0; - - while ( height-- ) { - DUFFS_LOOP( - { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha); - dst += dstbpp; - src += srcbpp; - }, - width); - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + int srcbpp = srcfmt->BytesPerPixel; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int dstbpp = dstfmt->BytesPerPixel; + unsigned alpha = dstfmt->Amask ? info->a : 0; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + Uint32 Pixel; + unsigned sR; + unsigned sG; + unsigned sB; + DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha); + dst += dstbpp; + src += srcbpp; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -static void BlitNtoNCopyAlpha(SDL_BlitInfo *info) +static void +BlitNtoNCopyAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - int srcbpp = srcfmt->BytesPerPixel; - SDL_PixelFormat *dstfmt = info->dst; - int dstbpp = dstfmt->BytesPerPixel; - int c; - - /* FIXME: should map alpha to [0..255] correctly! */ - while ( height-- ) { - for ( c=width; c; --c ) { - Uint32 Pixel; - unsigned sR, sG, sB, sA; - DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, - sR, sG, sB, sA); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, - sR, sG, sB, sA); - dst += dstbpp; - src += srcbpp; - } - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + int srcbpp = srcfmt->BytesPerPixel; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int dstbpp = dstfmt->BytesPerPixel; + int c; + + while (height--) { + for (c = width; c; --c) { + Uint32 Pixel; + unsigned sR, sG, sB, sA; + DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA); + dst += dstbpp; + src += srcbpp; + } + src += srcskip; + dst += dstskip; + } +} + +static void +BlitNto1Key(SDL_BlitInfo * info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + const Uint8 *palmap = info->table; + Uint32 ckey = info->colorkey; + Uint32 rgbmask = ~srcfmt->Amask; + int srcbpp; + Uint32 Pixel; + unsigned sR, sG, sB; + + /* Set up some basic variables */ + srcbpp = srcfmt->BytesPerPixel; + ckey &= rgbmask; + + if (palmap == NULL) { + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, + sR, sG, sB); + if ( (Pixel & rgbmask) != ckey ) { + /* Pack RGB into 8bit pixel */ + *dst = (Uint8)(((sR>>5)<<(3+2))| + ((sG>>5)<<(2)) | + ((sB>>6)<<(0))); + } + dst++; + src += srcbpp; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, + sR, sG, sB); + if ( (Pixel & rgbmask) != ckey ) { + /* Pack RGB into 8bit pixel */ + *dst = (Uint8)palmap[((sR>>5)<<(3+2))| + ((sG>>5)<<(2)) | + ((sB>>6)<<(0)) ]; + } + dst++; + src += srcbpp; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } + } +} + +static void +Blit2to2Key(SDL_BlitInfo * info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint16 *srcp = (Uint16 *) info->src; + int srcskip = info->src_skip; + Uint16 *dstp = (Uint16 *) info->dst; + int dstskip = info->dst_skip; + Uint32 ckey = info->colorkey; + Uint32 rgbmask = ~info->src_fmt->Amask; + + /* Set up some basic variables */ + srcskip /= 2; + dstskip /= 2; + ckey &= rgbmask; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + if ( (*srcp & rgbmask) != ckey ) { + *dstp = *srcp; + } + dstp++; + srcp++; + }, + width); + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } } -static void BlitNto1Key(SDL_BlitInfo *info) +static void +BlitNtoNKey(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - SDL_PixelFormat *srcfmt = info->src; - const Uint8 *palmap = info->table; - Uint32 ckey = srcfmt->colorkey; - Uint32 rgbmask = ~srcfmt->Amask; - int srcbpp; - Uint32 Pixel; - unsigned sR, sG, sB; - - /* Set up some basic variables */ - srcbpp = srcfmt->BytesPerPixel; - ckey &= rgbmask; - - if ( palmap == NULL ) { - while ( height-- ) { - DUFFS_LOOP( - { - DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, - sR, sG, sB); - if ( (Pixel & rgbmask) != ckey ) { - /* Pack RGB into 8bit pixel */ - *dst = (Uint8)(((sR>>5)<<(3+2))| - ((sG>>5)<<(2)) | - ((sB>>6)<<(0))); - } - dst++; - src += srcbpp; - }, - width); - src += srcskip; - dst += dstskip; - } - } else { - while ( height-- ) { - DUFFS_LOOP( - { - DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, - sR, sG, sB); - if ( (Pixel & rgbmask) != ckey ) { - /* Pack RGB into 8bit pixel */ - *dst = (Uint8)palmap[((sR>>5)<<(3+2))| - ((sG>>5)<<(2)) | - ((sB>>6)<<(0)) ]; - } - dst++; - src += srcbpp; - }, - width); - src += srcskip; - dst += dstskip; - } - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint32 ckey = info->colorkey; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int srcbpp = srcfmt->BytesPerPixel; + int dstbpp = dstfmt->BytesPerPixel; + unsigned alpha = dstfmt->Amask ? info->a : 0; + Uint32 rgbmask = ~srcfmt->Amask; + + /* Set up some basic variables */ + ckey &= rgbmask; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + Uint32 Pixel; + unsigned sR; + unsigned sG; + unsigned sB; + RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel); + if ( (Pixel & rgbmask) != ckey ) { + RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha); + } + dst += dstbpp; + src += srcbpp; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -static void Blit2to2Key(SDL_BlitInfo *info) +static void +BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint16 *srcp = (Uint16 *)info->s_pixels; - int srcskip = info->s_skip; - Uint16 *dstp = (Uint16 *)info->d_pixels; - int dstskip = info->d_skip; - Uint32 ckey = info->src->colorkey; - Uint32 rgbmask = ~info->src->Amask; - - /* Set up some basic variables */ - srcskip /= 2; - dstskip /= 2; - ckey &= rgbmask; - - while ( height-- ) { - DUFFS_LOOP( - { - if ( (*srcp & rgbmask) != ckey ) { - *dstp = *srcp; - } - dstp++; - srcp++; - }, - width); - srcp += srcskip; - dstp += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint32 ckey = info->colorkey; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + Uint32 rgbmask = ~srcfmt->Amask; + + Uint8 srcbpp; + Uint8 dstbpp; + Uint32 Pixel; + unsigned sR, sG, sB, sA; + + /* Set up some basic variables */ + srcbpp = srcfmt->BytesPerPixel; + dstbpp = dstfmt->BytesPerPixel; + ckey &= rgbmask; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); + if ( (Pixel & rgbmask) != ckey ) { + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA); + } + dst += dstbpp; + src += srcbpp; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -static void BlitNtoNKey(SDL_BlitInfo *info) +/* Special optimized blit for ARGB 2-10-10-10 --> RGBA */ +static void +Blit2101010toN(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - Uint32 ckey = info->src->colorkey; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - int srcbpp = srcfmt->BytesPerPixel; - int dstbpp = dstfmt->BytesPerPixel; - unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0; - Uint32 rgbmask = ~srcfmt->Amask; - - /* Set up some basic variables */ - ckey &= rgbmask; - - while ( height-- ) { - DUFFS_LOOP( - { - Uint32 Pixel; - unsigned sR; - unsigned sG; - unsigned sB; - RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel); - if ( (Pixel & rgbmask) != ckey ) { - RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, - sR, sG, sB, alpha); - } - dst += dstbpp; - src += srcbpp; - }, - width); - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *dstfmt = info->dst_fmt; + int dstbpp = dstfmt->BytesPerPixel; + Uint32 Pixel; + unsigned sR, sG, sB, sA; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + Pixel = *(Uint32 *)src; + RGBA_FROM_ARGB2101010(Pixel, sR, sG, sB, sA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA); + dst += dstbpp; + src += 4; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } -static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info) +/* Special optimized blit for RGBA --> ARGB 2-10-10-10 */ +static void +BlitNto2101010(SDL_BlitInfo * info) { - int width = info->d_width; - int height = info->d_height; - Uint8 *src = info->s_pixels; - int srcskip = info->s_skip; - Uint8 *dst = info->d_pixels; - int dstskip = info->d_skip; - Uint32 ckey = info->src->colorkey; - SDL_PixelFormat *srcfmt = info->src; - SDL_PixelFormat *dstfmt = info->dst; - Uint32 rgbmask = ~srcfmt->Amask; - - Uint8 srcbpp; - Uint8 dstbpp; - Uint32 Pixel; - unsigned sR, sG, sB, sA; - - /* Set up some basic variables */ - srcbpp = srcfmt->BytesPerPixel; - dstbpp = dstfmt->BytesPerPixel; - ckey &= rgbmask; - - /* FIXME: should map alpha to [0..255] correctly! */ - while ( height-- ) { - DUFFS_LOOP( - { - DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, - sR, sG, sB, sA); - if ( (Pixel & rgbmask) != ckey ) { - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, - sR, sG, sB, sA); - } - dst += dstbpp; - src += srcbpp; - }, - width); - src += srcskip; - dst += dstskip; - } + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + int srcbpp = srcfmt->BytesPerPixel; + Uint32 Pixel; + unsigned sR, sG, sB, sA; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP( + { + DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); + ARGB2101010_FROM_RGBA(Pixel, sR, sG, sB, sA); + *(Uint32 *)dst = Pixel; + dst += 4; + src += srcbpp; + }, + width); + /* *INDENT-ON* */ + src += srcskip; + dst += dstskip; + } } /* Normal N to N optimized blitters */ -struct blit_table { - Uint32 srcR, srcG, srcB; - int dstbpp; - Uint32 dstR, dstG, dstB; - Uint32 blit_features; - void *aux_data; - SDL_loblit blitfunc; - enum { NO_ALPHA=1, SET_ALPHA=2, COPY_ALPHA=4 } alpha; +struct blit_table +{ + Uint32 srcR, srcG, srcB; + int dstbpp; + Uint32 dstR, dstG, dstB; + Uint32 blit_features; + SDL_BlitFunc blitfunc; + enum + { NO_ALPHA = 1, SET_ALPHA = 2, COPY_ALPHA = 4 } alpha; }; static const struct blit_table normal_blit_1[] = { - /* Default for 8-bit RGB source, an invalid combination */ - { 0,0,0, 0, 0,0,0, 0, NULL, NULL }, + /* Default for 8-bit RGB source, never optimized */ + {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} }; + static const struct blit_table normal_blit_2[] = { -#if SDL_HERMES_BLITTERS - { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800, - 0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA }, - { 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F, - 0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA }, - { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00, - 0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA }, -#elif SDL_ALTIVEC_BLITTERS +#if SDL_ALTIVEC_BLITTERS /* has-altivec */ - { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000, - 2, NULL, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, - { 0x00007C00,0x000003E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000, - 2, NULL, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, + 2, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + {0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, + 2, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, #endif - { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF, - 0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA }, - { 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000, - 0, NULL, Blit_RGB565_ABGR8888, SET_ALPHA }, - { 0x0000F800,0x000007E0,0x0000001F, 4, 0xFF000000,0x00FF0000,0x0000FF00, - 0, NULL, Blit_RGB565_RGBA8888, SET_ALPHA }, - { 0x0000F800,0x000007E0,0x0000001F, 4, 0x0000FF00,0x00FF0000,0xFF000000, - 0, NULL, Blit_RGB565_BGRA8888, SET_ALPHA }, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_RGB565_ARGB8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_RGB565_ABGR8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, 0x0000FF00, + 0, Blit_RGB565_RGBA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000, 0xFF000000, + 0, Blit_RGB565_BGRA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, /* Default for 16-bit RGB source, used if no other blitter matches */ - { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 } + {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} }; + static const struct blit_table normal_blit_3[] = { - /* Default for 24-bit RGB source, never optimized */ - { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 } + /* Default for 24-bit RGB source, never optimized */ + {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} }; + static const struct blit_table normal_blit_4[] = { -#if SDL_HERMES_BLITTERS - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, - 1, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, - 0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800, - 1, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800, - 0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F, - 1, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F, - 0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00, - 1, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00, - 0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF, - 1, ConvertMMXpII32_24RGB888, ConvertMMX, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF, - 0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000, - 0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000, - 0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00, - 0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000, - 0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA }, -#else #if SDL_ALTIVEC_BLITTERS /* has-altivec | dont-use-prefetch */ - { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000, - 6, NULL, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, + {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000, + 6, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, /* has-altivec */ - { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000, - 2, NULL, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, + {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000, + 2, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, /* has-altivec */ - { 0x00000000,0x00000000,0x00000000, 2, 0x0000F800,0x000007E0,0x0000001F, - 2, NULL, Blit_RGB888_RGB565Altivec, NO_ALPHA }, -#endif - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F, - 0, NULL, Blit_RGB888_RGB565, NO_ALPHA }, - { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F, - 0, NULL, Blit_RGB888_RGB555, NO_ALPHA }, + {0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0, 0x0000001F, + 2, Blit_RGB888_RGB565Altivec, NO_ALPHA}, #endif - /* Default for 32-bit RGB source, used if no other blitter matches */ - { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 } + {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, 0x0000001F, + 0, Blit_RGB888_RGB565, NO_ALPHA}, + {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0, 0x0000001F, + 0, Blit_RGB888_RGB555, NO_ALPHA}, + /* Default for 32-bit RGB source, used if no other blitter matches */ + {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} }; -static const struct blit_table *normal_blit[] = { - normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4 + +static const struct blit_table *const normal_blit[] = { + normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4 }; /* Mask matches table, or table entry is zero */ #define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000)) -SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index) +SDL_BlitFunc +SDL_CalculateBlitN(SDL_Surface * surface) { - struct private_swaccel *sdata; - SDL_PixelFormat *srcfmt; - SDL_PixelFormat *dstfmt; - const struct blit_table *table; - int which; - SDL_loblit blitfun; - - /* Set up data for choosing the blit */ - sdata = surface->map->sw_data; - srcfmt = surface->format; - dstfmt = surface->map->dst->format; - - if ( blit_index & 2 ) { - /* alpha or alpha+colorkey */ - return SDL_CalculateAlphaBlit(surface, blit_index); - } - - /* We don't support destinations less than 8-bits */ - if ( dstfmt->BitsPerPixel < 8 ) { - return(NULL); - } - - if(blit_index == 1) { - /* colorkey blit: Here we don't have too many options, mostly - because RLE is the preferred fast way to deal with this. - If a particular case turns out to be useful we'll add it. */ - - if(srcfmt->BytesPerPixel == 2 - && surface->map->identity) - return Blit2to2Key; - else if(dstfmt->BytesPerPixel == 1) - return BlitNto1Key; - else { -#if SDL_ALTIVEC_BLITTERS - if((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) { - return Blit32to32KeyAltivec; - } else -#endif + SDL_PixelFormat *srcfmt; + SDL_PixelFormat *dstfmt; + const struct blit_table *table; + int which; + SDL_BlitFunc blitfun; + + /* Set up data for choosing the blit */ + srcfmt = surface->format; + dstfmt = surface->map->dst->format; + + /* We don't support destinations less than 8-bits */ + if (dstfmt->BitsPerPixel < 8) { + return (NULL); + } - if(srcfmt->Amask && dstfmt->Amask) - return BlitNtoNKeyCopyAlpha; - else - return BlitNtoNKey; - } - } - - blitfun = NULL; - if ( dstfmt->BitsPerPixel == 8 ) { - /* We assume 8-bit destinations are palettized */ - if ( (srcfmt->BytesPerPixel == 4) && - (srcfmt->Rmask == 0x00FF0000) && - (srcfmt->Gmask == 0x0000FF00) && - (srcfmt->Bmask == 0x000000FF) ) { - if ( surface->map->table ) { - blitfun = Blit_RGB888_index8_map; - } else { -#if SDL_HERMES_BLITTERS - sdata->aux_data = ConvertX86p32_8RGB332; - blitfun = ConvertX86; -#else - blitfun = Blit_RGB888_index8; -#endif - } - } else { - blitfun = BlitNto1; - } - } else { - /* Now the meat, choose the blitter we want */ - int a_need = NO_ALPHA; - if(dstfmt->Amask) - a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA; - table = normal_blit[srcfmt->BytesPerPixel-1]; - for ( which=0; table[which].dstbpp; ++which ) { - if ( MASKOK(srcfmt->Rmask, table[which].srcR) && - MASKOK(srcfmt->Gmask, table[which].srcG) && - MASKOK(srcfmt->Bmask, table[which].srcB) && - MASKOK(dstfmt->Rmask, table[which].dstR) && - MASKOK(dstfmt->Gmask, table[which].dstG) && - MASKOK(dstfmt->Bmask, table[which].dstB) && - dstfmt->BytesPerPixel == table[which].dstbpp && - (a_need & table[which].alpha) == a_need && - ((table[which].blit_features & GetBlitFeatures()) == table[which].blit_features) ) - break; - } - sdata->aux_data = table[which].aux_data; - blitfun = table[which].blitfunc; - - if(blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */ - /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */ - if ( srcfmt->BytesPerPixel == 4 && dstfmt->BytesPerPixel == 4 && - srcfmt->Rmask == dstfmt->Rmask && - srcfmt->Gmask == dstfmt->Gmask && - srcfmt->Bmask == dstfmt->Bmask ) { - blitfun = Blit4to4MaskAlpha; - } else if ( a_need == COPY_ALPHA ) { - blitfun = BlitNtoNCopyAlpha; - } - } - } - -#ifdef DEBUG_ASM -#if SDL_HERMES_BLITTERS - if ( blitfun == ConvertMMX ) - fprintf(stderr, "Using mmx blit\n"); - else - if ( blitfun == ConvertX86 ) - fprintf(stderr, "Using asm blit\n"); - else + switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + case 0: + blitfun = NULL; + if (dstfmt->BitsPerPixel == 8) { + if ((srcfmt->BytesPerPixel == 4) && + (srcfmt->Rmask == 0x00FF0000) && + (srcfmt->Gmask == 0x0000FF00) && + (srcfmt->Bmask == 0x000000FF)) { + blitfun = Blit_RGB888_index8; + } else if ((srcfmt->BytesPerPixel == 4) && + (srcfmt->Rmask == 0x3FF00000) && + (srcfmt->Gmask == 0x000FFC00) && + (srcfmt->Bmask == 0x000003FF)) { + blitfun = Blit_RGB101010_index8; + } else { + blitfun = BlitNto1; + } + } else { + /* Now the meat, choose the blitter we want */ + int a_need = NO_ALPHA; + if (dstfmt->Amask) + a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA; + table = normal_blit[srcfmt->BytesPerPixel - 1]; + for (which = 0; table[which].dstbpp; ++which) { + if (MASKOK(srcfmt->Rmask, table[which].srcR) && + MASKOK(srcfmt->Gmask, table[which].srcG) && + MASKOK(srcfmt->Bmask, table[which].srcB) && + MASKOK(dstfmt->Rmask, table[which].dstR) && + MASKOK(dstfmt->Gmask, table[which].dstG) && + MASKOK(dstfmt->Bmask, table[which].dstB) && + dstfmt->BytesPerPixel == table[which].dstbpp && + (a_need & table[which].alpha) == a_need && + ((table[which].blit_features & GetBlitFeatures()) == + table[which].blit_features)) + break; + } + blitfun = table[which].blitfunc; + + if (blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */ + if (srcfmt->format == SDL_PIXELFORMAT_ARGB2101010) { + blitfun = Blit2101010toN; + } else if (dstfmt->format == SDL_PIXELFORMAT_ARGB2101010) { + blitfun = BlitNto2101010; + } else if (srcfmt->BytesPerPixel == 4 && + dstfmt->BytesPerPixel == 4 && + srcfmt->Rmask == dstfmt->Rmask && + srcfmt->Gmask == dstfmt->Gmask && + srcfmt->Bmask == dstfmt->Bmask) { + /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */ + blitfun = Blit4to4MaskAlpha; + } else if (a_need == COPY_ALPHA) { + blitfun = BlitNtoNCopyAlpha; + } + } + } + return (blitfun); + + case SDL_COPY_COLORKEY: + /* colorkey blit: Here we don't have too many options, mostly + because RLE is the preferred fast way to deal with this. + If a particular case turns out to be useful we'll add it. */ + + if (srcfmt->BytesPerPixel == 2 && surface->map->identity) + return Blit2to2Key; + else if (dstfmt->BytesPerPixel == 1) + return BlitNto1Key; + else { +#if SDL_ALTIVEC_BLITTERS + if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) + && SDL_HasAltiVec()) { + return Blit32to32KeyAltivec; + } else #endif - if ( (blitfun == BlitNtoN) || (blitfun == BlitNto1) ) - fprintf(stderr, "Using C blit\n"); - else - fprintf(stderr, "Using optimized C blit\n"); -#endif /* DEBUG_ASM */ + if (srcfmt->Amask && dstfmt->Amask) { + return BlitNtoNKeyCopyAlpha; + } else { + return BlitNtoNKey; + } + } + } - return(blitfun); + return NULL; } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_auto.c b/src/video/SDL_blit_auto.c new file mode 100644 index 0000000000..251c5fe808 --- /dev/null +++ b/src/video/SDL_blit_auto.c @@ -0,0 +1,7563 @@ +/* DO NOT EDIT! This file is generated by sdlgenblit.pl */ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* *INDENT-OFF* */ + +#include "SDL_video.h" +#include "SDL_blit.h" +#include "SDL_blit_auto.h" + +static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info) +{ + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + *dst = *src; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_RGB888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_BGR888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_RGB888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_RGB888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_RGB888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_RGB888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_RGB888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_RGB888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_BGR888_Scale(SDL_BlitInfo *info) +{ + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + *dst = *src; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_BGR888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_BGR888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_BGR888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_BGR888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_BGR888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_RGB888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_RGB888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_RGB888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_RGB888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_BGR888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_BGR888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_BGR888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_BGR888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + *dst = *src; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_RGB888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_RGB888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_RGB888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_RGB888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_BGR888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_BGR888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_BGR888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_BGR888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_RGB888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_RGB888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_RGB888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_RGB888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_BGR888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_BGR888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_BGR888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_BGR888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_RGB888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_RGB888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_RGB888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_RGB888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_BGR888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_BGR888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_BGR888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_BGR888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + pixel = *src; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + R = (R * modulateR) / 255; + G = (G * modulateG) / 255; + B = (B * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + A = (A * modulateA) / 255; + } + pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + } + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + dstpixel = *dst; + dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + dstA = srcA + ((255 - srcA) * dstA) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = { + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Scale }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Scale }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale }, + { 0, 0, 0, 0, NULL } +}; + +/* *INDENT-ON* */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_auto.h b/src/video/SDL_blit_auto.h new file mode 100644 index 0000000000..ed0115e72f --- /dev/null +++ b/src/video/SDL_blit_auto.h @@ -0,0 +1,30 @@ +/* DO NOT EDIT! This file is generated by sdlgenblit.pl */ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +/* *INDENT-OFF* */ + +extern SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]; + +/* *INDENT-ON* */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_copy.c b/src/video/SDL_blit_copy.c new file mode 100644 index 0000000000..6d286c31f1 --- /dev/null +++ b/src/video/SDL_blit_copy.c @@ -0,0 +1,152 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_video.h" +#include "SDL_blit.h" +#include "SDL_blit_copy.h" + + +#ifdef __SSE__ +/* This assumes 16-byte aligned src and dst */ +static __inline__ void +SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len) +{ + int i; + + __m128 values[4]; + for (i = len / 64; i--;) { + _mm_prefetch(src, _MM_HINT_NTA); + values[0] = *(__m128 *) (src + 0); + values[1] = *(__m128 *) (src + 16); + values[2] = *(__m128 *) (src + 32); + values[3] = *(__m128 *) (src + 48); + _mm_stream_ps((float *) (dst + 0), values[0]); + _mm_stream_ps((float *) (dst + 16), values[1]); + _mm_stream_ps((float *) (dst + 32), values[2]); + _mm_stream_ps((float *) (dst + 48), values[3]); + src += 64; + dst += 64; + } + + if (len & 63) + SDL_memcpy(dst, src, len & 63); +} +#endif /* __SSE__ */ + +#ifdef __MMX__ +#ifdef _MSC_VER +#pragma warning(disable:4799) +#endif +static __inline__ void +SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len) +{ + const int remain = (len & 63); + int i; + + __m64* d64 = (__m64*)dst; + __m64* s64 = (__m64*)src; + + for(i= len / 64; i--;) { + d64[0] = s64[0]; + d64[1] = s64[1]; + d64[2] = s64[2]; + d64[3] = s64[3]; + d64[4] = s64[4]; + d64[5] = s64[5]; + d64[6] = s64[6]; + d64[7] = s64[7]; + + d64 += 8; + s64 += 8; + } + + if (remain) + { + const int skip = len - remain; + SDL_memcpy(dst + skip, src + skip, remain); + } +} +#endif /* __MMX__ */ + +void +SDL_BlitCopy(SDL_BlitInfo * info) +{ + SDL_bool overlap; + Uint8 *src, *dst; + int w, h; + int srcskip, dstskip; + + w = info->dst_w * info->dst_fmt->BytesPerPixel; + h = info->dst_h; + src = info->src; + dst = info->dst; + srcskip = info->src_pitch; + dstskip = info->dst_pitch; + + /* Properly handle overlapping blits */ + if (src < dst) { + overlap = (dst < (src + h*srcskip)); + } else { + overlap = (src < (dst + h*dstskip)); + } + if (overlap) { + while (h--) { + SDL_memmove(dst, src, w); + src += srcskip; + dst += dstskip; + } + return; + } + +#ifdef __SSE__ + if (SDL_HasSSE() && + !((uintptr_t) src & 15) && !(srcskip & 15) && + !((uintptr_t) dst & 15) && !(dstskip & 15)) { + while (h--) { + SDL_memcpySSE(dst, src, w); + src += srcskip; + dst += dstskip; + } + return; + } +#endif + +#ifdef __MMX__ + if (SDL_HasMMX() && !(srcskip & 7) && !(dstskip & 7)) { + while (h--) { + SDL_memcpyMMX(dst, src, w); + src += srcskip; + dst += dstskip; + } + _mm_empty(); + return; + } +#endif + + while (h--) { + SDL_memcpy(dst, src, w); + src += srcskip; + dst += dstskip; + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_copy.h b/src/video/SDL_blit_copy.h new file mode 100644 index 0000000000..8d02a83bba --- /dev/null +++ b/src/video/SDL_blit_copy.h @@ -0,0 +1,24 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +void SDL_BlitCopy(SDL_BlitInfo * info); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_slow.c b/src/video/SDL_blit_slow.c new file mode 100644 index 0000000000..1f4bce2eef --- /dev/null +++ b/src/video/SDL_blit_slow.c @@ -0,0 +1,161 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_video.h" +#include "SDL_blit.h" +#include "SDL_blit_slow.h" + +/* The ONE TRUE BLITTER + * This puppy has to handle all the unoptimized cases - yes, it's slow. + */ +void +SDL_Blit_Slow(SDL_BlitInfo * info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + int srcy, srcx; + int posy, posx; + int incy, incx; + SDL_PixelFormat *src_fmt = info->src_fmt; + SDL_PixelFormat *dst_fmt = info->dst_fmt; + int srcbpp = src_fmt->BytesPerPixel; + int dstbpp = dst_fmt->BytesPerPixel; + + srcy = 0; + posy = 0; + incy = (info->src_h << 16) / info->dst_h; + incx = (info->src_w << 16) / info->dst_w; + + while (info->dst_h--) { + Uint8 *src = 0; + Uint8 *dst = (Uint8 *) info->dst; + int n = info->dst_w; + srcx = -1; + posx = 0x10000L; + while (posy >= 0x10000L) { + ++srcy; + posy -= 0x10000L; + } + while (n--) { + if (posx >= 0x10000L) { + while (posx >= 0x10000L) { + ++srcx; + posx -= 0x10000L; + } + src = + (info->src + (srcy * info->src_pitch) + (srcx * srcbpp)); + } + if (src_fmt->Amask) { + DISEMBLE_RGBA(src, srcbpp, src_fmt, srcpixel, srcR, srcG, + srcB, srcA); + } else { + DISEMBLE_RGB(src, srcbpp, src_fmt, srcpixel, srcR, srcG, + srcB); + srcA = 0xFF; + } + if (flags & SDL_COPY_COLORKEY) { + /* srcpixel isn't set for 24 bpp */ + if (srcbpp == 3) { + srcpixel = (srcR << src_fmt->Rshift) | + (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift); + } + if (srcpixel == info->colorkey) { + posx += incx; + dst += dstbpp; + continue; + } + } + if (dst_fmt->Amask) { + DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, + dstB, dstA); + } else { + DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, + dstB); + dstA = 0xFF; + } + + if (flags & SDL_COPY_MODULATE_COLOR) { + srcR = (srcR * modulateR) / 255; + srcG = (srcG * modulateG) / 255; + srcB = (srcB * modulateB) / 255; + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + srcA = (srcA * modulateA) / 255; + } + if (flags & (SDL_COPY_BLEND | SDL_COPY_ADD)) { + /* This goes away if we ever use premultiplied alpha */ + if (srcA < 255) { + srcR = (srcR * srcA) / 255; + srcG = (srcG * srcA) / 255; + srcB = (srcB * srcA) / 255; + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) { + case 0: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = srcA; + break; + case SDL_COPY_BLEND: + dstR = srcR + ((255 - srcA) * dstR) / 255; + dstG = srcG + ((255 - srcA) * dstG) / 255; + dstB = srcB + ((255 - srcA) * dstB) / 255; + break; + case SDL_COPY_ADD: + dstR = srcR + dstR; + if (dstR > 255) + dstR = 255; + dstG = srcG + dstG; + if (dstG > 255) + dstG = 255; + dstB = srcB + dstB; + if (dstB > 255) + dstB = 255; + break; + case SDL_COPY_MOD: + dstR = (srcR * dstR) / 255; + dstG = (srcG * dstG) / 255; + dstB = (srcB * dstB) / 255; + break; + } + if (dst_fmt->Amask) { + ASSEMBLE_RGBA(dst, dstbpp, dst_fmt, dstR, dstG, dstB, dstA); + } else { + ASSEMBLE_RGB(dst, dstbpp, dst_fmt, dstR, dstG, dstB); + } + posx += incx; + dst += dstbpp; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_blit_slow.h b/src/video/SDL_blit_slow.h new file mode 100644 index 0000000000..15b5c79ab2 --- /dev/null +++ b/src/video/SDL_blit_slow.h @@ -0,0 +1,25 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +extern void SDL_Blit_Slow(SDL_BlitInfo * info); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index d56cfd83a3..df43ed0ce1 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -1,549 +1,608 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" -/* +/* Code to load and save surfaces in Windows BMP format. Why support BMP format? Well, it's a native format for Windows, and most image processing programs can read and write it. It would be nice to be able to have at least one image format that we can natively load and save, and since PNG is so complex that it would bloat the library, - BMP is a good alternative. + BMP is a good alternative. This code currently supports Win32 DIBs in uncompressed 8 and 24 bpp. */ #include "SDL_video.h" #include "SDL_endian.h" +#include "SDL_pixels_c.h" + +#define SAVE_32BIT_BMP /* Compression encodings for BMP files */ #ifndef BI_RGB -#define BI_RGB 0 -#define BI_RLE8 1 -#define BI_RLE4 2 -#define BI_BITFIELDS 3 +#define BI_RGB 0 +#define BI_RLE8 1 +#define BI_RLE4 2 +#define BI_BITFIELDS 3 #endif -SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc) +static void CorrectAlphaChannel(SDL_Surface *surface) +{ + /* Check to see if there is any alpha channel data */ + SDL_bool hasAlpha = SDL_FALSE; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + int alphaChannelOffset = 0; +#else + int alphaChannelOffset = 3; +#endif + Uint8 *alpha = ((Uint8*)surface->pixels) + alphaChannelOffset; + Uint8 *end = alpha + surface->h * surface->pitch; + + while (alpha < end) { + if (*alpha != 0) { + hasAlpha = SDL_TRUE; + break; + } + alpha += 4; + } + + if (!hasAlpha) { + alpha = ((Uint8*)surface->pixels) + alphaChannelOffset; + while (alpha < end) { + *alpha = SDL_ALPHA_OPAQUE; + alpha += 4; + } + } +} + +SDL_Surface * +SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) { - SDL_bool was_error; - long fp_offset = 0; - int bmpPitch; - int i, pad; - SDL_Surface *surface; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - SDL_Palette *palette; - Uint8 *bits; - Uint8 *top, *end; - SDL_bool topDown; - int ExpandBMP; - - /* The Win32 BMP file header (14 bytes) */ - char magic[2]; - Uint32 bfSize; - Uint16 bfReserved1; - Uint16 bfReserved2; - Uint32 bfOffBits; - - /* The Win32 BITMAPINFOHEADER struct (40 bytes) */ - Uint32 biSize; - Sint32 biWidth; - Sint32 biHeight; - Uint16 biPlanes; - Uint16 biBitCount; - Uint32 biCompression; - Uint32 biSizeImage; - Sint32 biXPelsPerMeter; - Sint32 biYPelsPerMeter; - Uint32 biClrUsed; - Uint32 biClrImportant; - - /* Make sure we are passed a valid data source */ - surface = NULL; - was_error = SDL_FALSE; - if ( src == NULL ) { - was_error = SDL_TRUE; - goto done; - } - - /* Read in the BMP file header */ - fp_offset = SDL_RWtell(src); - SDL_ClearError(); - if ( SDL_RWread(src, magic, 1, 2) != 2 ) { - SDL_Error(SDL_EFREAD); - was_error = SDL_TRUE; - goto done; - } - if ( SDL_strncmp(magic, "BM", 2) != 0 ) { - SDL_SetError("File is not a Windows BMP file"); - was_error = SDL_TRUE; - goto done; - } - bfSize = SDL_ReadLE32(src); - bfReserved1 = SDL_ReadLE16(src); - bfReserved2 = SDL_ReadLE16(src); - bfOffBits = SDL_ReadLE32(src); - - /* Read the Win32 BITMAPINFOHEADER */ - biSize = SDL_ReadLE32(src); - if ( biSize == 12 ) { - biWidth = (Uint32)SDL_ReadLE16(src); - biHeight = (Uint32)SDL_ReadLE16(src); - biPlanes = SDL_ReadLE16(src); - biBitCount = SDL_ReadLE16(src); - biCompression = BI_RGB; - biSizeImage = 0; - biXPelsPerMeter = 0; - biYPelsPerMeter = 0; - biClrUsed = 0; - biClrImportant = 0; - } else { - biWidth = SDL_ReadLE32(src); - biHeight = SDL_ReadLE32(src); - biPlanes = SDL_ReadLE16(src); - biBitCount = SDL_ReadLE16(src); - biCompression = SDL_ReadLE32(src); - biSizeImage = SDL_ReadLE32(src); - biXPelsPerMeter = SDL_ReadLE32(src); - biYPelsPerMeter = SDL_ReadLE32(src); - biClrUsed = SDL_ReadLE32(src); - biClrImportant = SDL_ReadLE32(src); - } - - /* stop some compiler warnings. */ - (void) bfSize; - (void) bfReserved1; - (void) bfReserved2; - (void) biPlanes; - (void) biSizeImage; - (void) biXPelsPerMeter; - (void) biYPelsPerMeter; - (void) biClrImportant; - - if (biHeight < 0) { - topDown = SDL_TRUE; - biHeight = -biHeight; - } else { - topDown = SDL_FALSE; - } - - /* Check for read error */ - if ( SDL_strcmp(SDL_GetError(), "") != 0 ) { - was_error = SDL_TRUE; - goto done; - } - - /* Expand 1 and 4 bit bitmaps to 8 bits per pixel */ - switch (biBitCount) { - case 1: - case 4: - ExpandBMP = biBitCount; - biBitCount = 8; - break; - default: - ExpandBMP = 0; - break; - } - - /* We don't support any BMP compression right now */ - Rmask = Gmask = Bmask = 0; - switch (biCompression) { - case BI_RGB: - /* If there are no masks, use the defaults */ - if ( bfOffBits == (14+biSize) ) { - /* Default values for the BMP format */ - switch (biBitCount) { - case 15: - case 16: - Rmask = 0x7C00; - Gmask = 0x03E0; - Bmask = 0x001F; - break; - case 24: + SDL_bool was_error; + Sint64 fp_offset = 0; + int bmpPitch; + int i, pad; + SDL_Surface *surface; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + SDL_Palette *palette; + Uint8 *bits; + Uint8 *top, *end; + SDL_bool topDown; + int ExpandBMP; + SDL_bool correctAlpha = SDL_FALSE; + + /* The Win32 BMP file header (14 bytes) */ + char magic[2]; + /*Uint32 bfSize = 0;*/ + /*Uint16 bfReserved1 = 0;*/ + /*Uint16 bfReserved2 = 0;*/ + Uint32 bfOffBits = 0; + + /* The Win32 BITMAPINFOHEADER struct (40 bytes) */ + Uint32 biSize = 0; + Sint32 biWidth = 0; + Sint32 biHeight = 0; + /*Uint16 biPlanes = 0;*/ + Uint16 biBitCount = 0; + Uint32 biCompression = 0; + /*Uint32 biSizeImage = 0;*/ + /*Sint32 biXPelsPerMeter = 0;*/ + /*Sint32 biYPelsPerMeter = 0;*/ + Uint32 biClrUsed = 0; + /*Uint32 biClrImportant = 0;*/ + + /* Make sure we are passed a valid data source */ + surface = NULL; + was_error = SDL_FALSE; + if (src == NULL) { + was_error = SDL_TRUE; + goto done; + } + + /* Read in the BMP file header */ + fp_offset = SDL_RWtell(src); + SDL_ClearError(); + if (SDL_RWread(src, magic, 1, 2) != 2) { + SDL_Error(SDL_EFREAD); + was_error = SDL_TRUE; + goto done; + } + if (SDL_strncmp(magic, "BM", 2) != 0) { + SDL_SetError("File is not a Windows BMP file"); + was_error = SDL_TRUE; + goto done; + } + /*bfSize =*/ SDL_ReadLE32(src); + /*bfReserved1 =*/ SDL_ReadLE16(src); + /*bfReserved2 =*/ SDL_ReadLE16(src); + bfOffBits = SDL_ReadLE32(src); + + /* Read the Win32 BITMAPINFOHEADER */ + biSize = SDL_ReadLE32(src); + if (biSize == 12) { + biWidth = (Uint32) SDL_ReadLE16(src); + biHeight = (Uint32) SDL_ReadLE16(src); + /*biPlanes =*/ SDL_ReadLE16(src); + biBitCount = SDL_ReadLE16(src); + biCompression = BI_RGB; + } else { + biWidth = SDL_ReadLE32(src); + biHeight = SDL_ReadLE32(src); + /*biPlanes =*/ SDL_ReadLE16(src); + biBitCount = SDL_ReadLE16(src); + biCompression = SDL_ReadLE32(src); + /*biSizeImage =*/ SDL_ReadLE32(src); + /*biXPelsPerMeter =*/ SDL_ReadLE32(src); + /*biYPelsPerMeter =*/ SDL_ReadLE32(src); + biClrUsed = SDL_ReadLE32(src); + /*biClrImportant =*/ SDL_ReadLE32(src); + } + if (biHeight < 0) { + topDown = SDL_TRUE; + biHeight = -biHeight; + } else { + topDown = SDL_FALSE; + } + + /* Check for read error */ + if (SDL_strcmp(SDL_GetError(), "") != 0) { + was_error = SDL_TRUE; + goto done; + } + + /* Expand 1 and 4 bit bitmaps to 8 bits per pixel */ + switch (biBitCount) { + case 1: + case 4: + ExpandBMP = biBitCount; + biBitCount = 8; + break; + default: + ExpandBMP = 0; + break; + } + + /* We don't support any BMP compression right now */ + Rmask = Gmask = Bmask = Amask = 0; + switch (biCompression) { + case BI_RGB: + /* If there are no masks, use the defaults */ + if (bfOffBits == (14 + biSize)) { + /* Default values for the BMP format */ + switch (biBitCount) { + case 15: + case 16: + Rmask = 0x7C00; + Gmask = 0x03E0; + Bmask = 0x001F; + break; + case 24: #if SDL_BYTEORDER == SDL_BIG_ENDIAN - Rmask = 0x000000FF; - Gmask = 0x0000FF00; - Bmask = 0x00FF0000; - break; + Rmask = 0x000000FF; + Gmask = 0x0000FF00; + Bmask = 0x00FF0000; +#else + Rmask = 0x00FF0000; + Gmask = 0x0000FF00; + Bmask = 0x000000FF; #endif - case 32: - Rmask = 0x00FF0000; - Gmask = 0x0000FF00; - Bmask = 0x000000FF; - break; - default: - break; - } - break; - } - /* Fall through -- read the RGB masks */ - - case BI_BITFIELDS: - switch (biBitCount) { - case 15: - case 16: - case 32: - Rmask = SDL_ReadLE32(src); - Gmask = SDL_ReadLE32(src); - Bmask = SDL_ReadLE32(src); - break; - default: - break; - } - break; - default: - SDL_SetError("Compressed BMP files not supported"); - was_error = SDL_TRUE; - goto done; - } - - /* Create a compatible surface, note that the colors are RGB ordered */ - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, - biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, 0); - if ( surface == NULL ) { - was_error = SDL_TRUE; - goto done; - } - - /* Load the palette, if any */ - palette = (surface->format)->palette; - if ( palette ) { - if ( biClrUsed == 0 ) { - biClrUsed = 1 << biBitCount; - } - if ( biSize == 12 ) { - for ( i = 0; i < (int)biClrUsed; ++i ) { - SDL_RWread(src, &palette->colors[i].b, 1, 1); - SDL_RWread(src, &palette->colors[i].g, 1, 1); - SDL_RWread(src, &palette->colors[i].r, 1, 1); - palette->colors[i].unused = 0; - } - } else { - for ( i = 0; i < (int)biClrUsed; ++i ) { - SDL_RWread(src, &palette->colors[i].b, 1, 1); - SDL_RWread(src, &palette->colors[i].g, 1, 1); - SDL_RWread(src, &palette->colors[i].r, 1, 1); - SDL_RWread(src, &palette->colors[i].unused, 1, 1); - } - } - palette->ncolors = biClrUsed; - } - - /* Read the surface pixels. Note that the bmp image is upside down */ - if ( SDL_RWseek(src, fp_offset+bfOffBits, RW_SEEK_SET) < 0 ) { - SDL_Error(SDL_EFSEEK); - was_error = SDL_TRUE; - goto done; - } - top = (Uint8 *)surface->pixels; - end = (Uint8 *)surface->pixels+(surface->h*surface->pitch); - switch (ExpandBMP) { - case 1: - bmpPitch = (biWidth + 7) >> 3; - pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0); - break; - case 4: - bmpPitch = (biWidth + 1) >> 1; - pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0); - break; - default: - pad = ((surface->pitch%4) ? - (4-(surface->pitch%4)) : 0); - break; - } - if ( topDown ) { - bits = top; - } else { - bits = end - surface->pitch; - } - while ( bits >= top && bits < end ) { - switch (ExpandBMP) { - case 1: - case 4: { - Uint8 pixel = 0; - int shift = (8-ExpandBMP); - for ( i=0; iw; ++i ) { - if ( i%(8/ExpandBMP) == 0 ) { - if ( !SDL_RWread(src, &pixel, 1, 1) ) { - SDL_SetError( - "Error reading from BMP"); - was_error = SDL_TRUE; - goto done; - } - } - *(bits+i) = (pixel>>shift); - pixel <<= ExpandBMP; - } } - break; - - default: - if ( SDL_RWread(src, bits, 1, surface->pitch) - != surface->pitch ) { - SDL_Error(SDL_EFREAD); - was_error = SDL_TRUE; - goto done; - } + break; + case 32: + /* We don't know if this has alpha channel or not */ + correctAlpha = SDL_TRUE; + Amask = 0xFF000000; + Rmask = 0x00FF0000; + Gmask = 0x0000FF00; + Bmask = 0x000000FF; + break; + default: + break; + } + break; + } + /* Fall through -- read the RGB masks */ + + case BI_BITFIELDS: + switch (biBitCount) { + case 15: + case 16: + Rmask = SDL_ReadLE32(src); + Gmask = SDL_ReadLE32(src); + Bmask = SDL_ReadLE32(src); + break; + case 32: + Rmask = SDL_ReadLE32(src); + Gmask = SDL_ReadLE32(src); + Bmask = SDL_ReadLE32(src); + Amask = SDL_ReadLE32(src); + break; + default: + break; + } + break; + default: + SDL_SetError("Compressed BMP files not supported"); + was_error = SDL_TRUE; + goto done; + } + + /* Create a compatible surface, note that the colors are RGB ordered */ + surface = + SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask, + Bmask, Amask); + if (surface == NULL) { + was_error = SDL_TRUE; + goto done; + } + + /* Load the palette, if any */ + palette = (surface->format)->palette; + if (palette) { + if (biClrUsed == 0) { + biClrUsed = 1 << biBitCount; + } + if ((int) biClrUsed > palette->ncolors) { + palette->ncolors = biClrUsed; + palette->colors = + (SDL_Color *) SDL_realloc(palette->colors, + palette->ncolors * + sizeof(*palette->colors)); + if (!palette->colors) { + SDL_OutOfMemory(); + was_error = SDL_TRUE; + goto done; + } + } else if ((int) biClrUsed < palette->ncolors) { + palette->ncolors = biClrUsed; + } + if (biSize == 12) { + for (i = 0; i < (int) biClrUsed; ++i) { + SDL_RWread(src, &palette->colors[i].b, 1, 1); + SDL_RWread(src, &palette->colors[i].g, 1, 1); + SDL_RWread(src, &palette->colors[i].r, 1, 1); + palette->colors[i].a = SDL_ALPHA_OPAQUE; + } + } else { + for (i = 0; i < (int) biClrUsed; ++i) { + SDL_RWread(src, &palette->colors[i].b, 1, 1); + SDL_RWread(src, &palette->colors[i].g, 1, 1); + SDL_RWread(src, &palette->colors[i].r, 1, 1); + SDL_RWread(src, &palette->colors[i].a, 1, 1); + + /* According to Microsoft documentation, the fourth element + is reserved and must be zero, so we shouldn't treat it as + alpha. + */ + palette->colors[i].a = SDL_ALPHA_OPAQUE; + } + } + } + + /* Read the surface pixels. Note that the bmp image is upside down */ + if (SDL_RWseek(src, fp_offset + bfOffBits, RW_SEEK_SET) < 0) { + SDL_Error(SDL_EFSEEK); + was_error = SDL_TRUE; + goto done; + } + top = (Uint8 *)surface->pixels; + end = (Uint8 *)surface->pixels+(surface->h*surface->pitch); + switch (ExpandBMP) { + case 1: + bmpPitch = (biWidth + 7) >> 3; + pad = (((bmpPitch) % 4) ? (4 - ((bmpPitch) % 4)) : 0); + break; + case 4: + bmpPitch = (biWidth + 1) >> 1; + pad = (((bmpPitch) % 4) ? (4 - ((bmpPitch) % 4)) : 0); + break; + default: + pad = ((surface->pitch % 4) ? (4 - (surface->pitch % 4)) : 0); + break; + } + if (topDown) { + bits = top; + } else { + bits = end - surface->pitch; + } + while (bits >= top && bits < end) { + switch (ExpandBMP) { + case 1: + case 4:{ + Uint8 pixel = 0; + int shift = (8 - ExpandBMP); + for (i = 0; i < surface->w; ++i) { + if (i % (8 / ExpandBMP) == 0) { + if (!SDL_RWread(src, &pixel, 1, 1)) { + SDL_SetError("Error reading from BMP"); + was_error = SDL_TRUE; + goto done; + } + } + *(bits + i) = (pixel >> shift); + pixel <<= ExpandBMP; + } + } + break; + + default: + if (SDL_RWread(src, bits, 1, surface->pitch) + != surface->pitch) { + SDL_Error(SDL_EFREAD); + was_error = SDL_TRUE; + goto done; + } #if SDL_BYTEORDER == SDL_BIG_ENDIAN - /* Byte-swap the pixels if needed. Note that the 24bpp - case has already been taken care of above. */ - switch(biBitCount) { - case 15: - case 16: { - Uint16 *pix = (Uint16 *)bits; - for(i = 0; i < surface->w; i++) - pix[i] = SDL_Swap16(pix[i]); - break; - } - - case 32: { - Uint32 *pix = (Uint32 *)bits; - for(i = 0; i < surface->w; i++) - pix[i] = SDL_Swap32(pix[i]); - break; - } - } + /* Byte-swap the pixels if needed. Note that the 24bpp + case has already been taken care of above. */ + switch (biBitCount) { + case 15: + case 16:{ + Uint16 *pix = (Uint16 *) bits; + for (i = 0; i < surface->w; i++) + pix[i] = SDL_Swap16(pix[i]); + break; + } + + case 32:{ + Uint32 *pix = (Uint32 *) bits; + for (i = 0; i < surface->w; i++) + pix[i] = SDL_Swap32(pix[i]); + break; + } + } #endif - break; - } - /* Skip padding bytes, ugh */ - if ( pad ) { - Uint8 padbyte; - for ( i=0; ipitch; - } else { - bits -= surface->pitch; - } - } -done: - if ( was_error ) { - if ( src ) { - SDL_RWseek(src, fp_offset, RW_SEEK_SET); - } - if ( surface ) { - SDL_FreeSurface(surface); - } - surface = NULL; - } - if ( freesrc && src ) { - SDL_RWclose(src); - } - return(surface); + break; + } + /* Skip padding bytes, ugh */ + if (pad) { + Uint8 padbyte; + for (i = 0; i < pad; ++i) { + SDL_RWread(src, &padbyte, 1, 1); + } + } + if (topDown) { + bits += surface->pitch; + } else { + bits -= surface->pitch; + } + } + if (correctAlpha) { + CorrectAlphaChannel(surface); + } + done: + if (was_error) { + if (src) { + SDL_RWseek(src, fp_offset, RW_SEEK_SET); + } + if (surface) { + SDL_FreeSurface(surface); + } + surface = NULL; + } + if (freesrc && src) { + SDL_RWclose(src); + } + return (surface); } -int SDL_SaveBMP_RW (SDL_Surface *saveme, SDL_RWops *dst, int freedst) +int +SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) { - long fp_offset; - int i, pad; - SDL_Surface *surface; - Uint8 *bits; - - /* The Win32 BMP file header (14 bytes) */ - char magic[2] = { 'B', 'M' }; - Uint32 bfSize; - Uint16 bfReserved1; - Uint16 bfReserved2; - Uint32 bfOffBits; - - /* The Win32 BITMAPINFOHEADER struct (40 bytes) */ - Uint32 biSize; - Sint32 biWidth; - Sint32 biHeight; - Uint16 biPlanes; - Uint16 biBitCount; - Uint32 biCompression; - Uint32 biSizeImage; - Sint32 biXPelsPerMeter; - Sint32 biYPelsPerMeter; - Uint32 biClrUsed; - Uint32 biClrImportant; - - /* Make sure we have somewhere to save */ - surface = NULL; - if ( dst ) { - if ( saveme->format->palette ) { - if ( saveme->format->BitsPerPixel == 8 ) { - surface = saveme; - } else { - SDL_SetError("%d bpp BMP files not supported", - saveme->format->BitsPerPixel); - } - } - else if ( (saveme->format->BitsPerPixel == 24) && + Sint64 fp_offset; + int i, pad; + SDL_Surface *surface; + Uint8 *bits; + + /* The Win32 BMP file header (14 bytes) */ + char magic[2] = { 'B', 'M' }; + Uint32 bfSize; + Uint16 bfReserved1; + Uint16 bfReserved2; + Uint32 bfOffBits; + + /* The Win32 BITMAPINFOHEADER struct (40 bytes) */ + Uint32 biSize; + Sint32 biWidth; + Sint32 biHeight; + Uint16 biPlanes; + Uint16 biBitCount; + Uint32 biCompression; + Uint32 biSizeImage; + Sint32 biXPelsPerMeter; + Sint32 biYPelsPerMeter; + Uint32 biClrUsed; + Uint32 biClrImportant; + + /* Make sure we have somewhere to save */ + surface = NULL; + if (dst) { + SDL_bool save32bit = SDL_FALSE; +#ifdef SAVE_32BIT_BMP + /* We can save alpha information in a 32-bit BMP */ + if (saveme->map->info.flags & SDL_COPY_COLORKEY || + saveme->format->Amask) { + save32bit = SDL_TRUE; + } +#endif /* SAVE_32BIT_BMP */ + + if (saveme->format->palette && !save32bit) { + if (saveme->format->BitsPerPixel == 8) { + surface = saveme; + } else { + SDL_SetError("%d bpp BMP files not supported", + saveme->format->BitsPerPixel); + } + } else if ((saveme->format->BitsPerPixel == 24) && #if SDL_BYTEORDER == SDL_LIL_ENDIAN - (saveme->format->Rmask == 0x00FF0000) && - (saveme->format->Gmask == 0x0000FF00) && - (saveme->format->Bmask == 0x000000FF) + (saveme->format->Rmask == 0x00FF0000) && + (saveme->format->Gmask == 0x0000FF00) && + (saveme->format->Bmask == 0x000000FF) #else - (saveme->format->Rmask == 0x000000FF) && - (saveme->format->Gmask == 0x0000FF00) && - (saveme->format->Bmask == 0x00FF0000) + (saveme->format->Rmask == 0x000000FF) && + (saveme->format->Gmask == 0x0000FF00) && + (saveme->format->Bmask == 0x00FF0000) #endif - ) { - surface = saveme; - } else { - SDL_Rect bounds; - - /* Convert to 24 bits per pixel */ - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, - saveme->w, saveme->h, 24, + ) { + surface = saveme; + } else { + SDL_PixelFormat format; + + /* If the surface has a colorkey or alpha channel we'll save a + 32-bit BMP with alpha channel, otherwise save a 24-bit BMP. */ + if (save32bit) { + SDL_InitFormat(&format, #if SDL_BYTEORDER == SDL_LIL_ENDIAN - 0x00FF0000, 0x0000FF00, 0x000000FF, + SDL_PIXELFORMAT_ARGB8888 #else - 0x000000FF, 0x0000FF00, 0x00FF0000, + SDL_PIXELFORMAT_BGRA8888 #endif - 0); - if ( surface != NULL ) { - bounds.x = 0; - bounds.y = 0; - bounds.w = saveme->w; - bounds.h = saveme->h; - if ( SDL_LowerBlit(saveme, &bounds, surface, - &bounds) < 0 ) { - SDL_FreeSurface(surface); - SDL_SetError( - "Couldn't convert image to 24 bpp"); - surface = NULL; - } - } - } - } - - if ( surface && (SDL_LockSurface(surface) == 0) ) { - const int bw = surface->w*surface->format->BytesPerPixel; - - /* Set the BMP file header values */ - bfSize = 0; /* We'll write this when we're done */ - bfReserved1 = 0; - bfReserved2 = 0; - bfOffBits = 0; /* We'll write this when we're done */ - - /* Write the BMP file header values */ - fp_offset = SDL_RWtell(dst); - SDL_ClearError(); - SDL_RWwrite(dst, magic, 2, 1); - SDL_WriteLE32(dst, bfSize); - SDL_WriteLE16(dst, bfReserved1); - SDL_WriteLE16(dst, bfReserved2); - SDL_WriteLE32(dst, bfOffBits); - - /* Set the BMP info values */ - biSize = 40; - biWidth = surface->w; - biHeight = surface->h; - biPlanes = 1; - biBitCount = surface->format->BitsPerPixel; - biCompression = BI_RGB; - biSizeImage = surface->h*surface->pitch; - biXPelsPerMeter = 0; - biYPelsPerMeter = 0; - if ( surface->format->palette ) { - biClrUsed = surface->format->palette->ncolors; - } else { - biClrUsed = 0; - } - biClrImportant = 0; - - /* Write the BMP info values */ - SDL_WriteLE32(dst, biSize); - SDL_WriteLE32(dst, biWidth); - SDL_WriteLE32(dst, biHeight); - SDL_WriteLE16(dst, biPlanes); - SDL_WriteLE16(dst, biBitCount); - SDL_WriteLE32(dst, biCompression); - SDL_WriteLE32(dst, biSizeImage); - SDL_WriteLE32(dst, biXPelsPerMeter); - SDL_WriteLE32(dst, biYPelsPerMeter); - SDL_WriteLE32(dst, biClrUsed); - SDL_WriteLE32(dst, biClrImportant); - - /* Write the palette (in BGR color order) */ - if ( surface->format->palette ) { - SDL_Color *colors; - int ncolors; - - colors = surface->format->palette->colors; - ncolors = surface->format->palette->ncolors; - for ( i=0; ipixels+(surface->h*surface->pitch); - pad = ((bw%4) ? (4-(bw%4)) : 0); - while ( bits > (Uint8 *)surface->pixels ) { - bits -= surface->pitch; - if ( SDL_RWwrite(dst, bits, 1, bw) != bw) { - SDL_Error(SDL_EFWRITE); - break; - } - if ( pad ) { - const Uint8 padbyte = 0; - for ( i=0; iw * surface->format->BytesPerPixel; + + /* Set the BMP file header values */ + bfSize = 0; /* We'll write this when we're done */ + bfReserved1 = 0; + bfReserved2 = 0; + bfOffBits = 0; /* We'll write this when we're done */ + + /* Write the BMP file header values */ + fp_offset = SDL_RWtell(dst); + SDL_ClearError(); + SDL_RWwrite(dst, magic, 2, 1); + SDL_WriteLE32(dst, bfSize); + SDL_WriteLE16(dst, bfReserved1); + SDL_WriteLE16(dst, bfReserved2); + SDL_WriteLE32(dst, bfOffBits); + + /* Set the BMP info values */ + biSize = 40; + biWidth = surface->w; + biHeight = surface->h; + biPlanes = 1; + biBitCount = surface->format->BitsPerPixel; + biCompression = BI_RGB; + biSizeImage = surface->h * surface->pitch; + biXPelsPerMeter = 0; + biYPelsPerMeter = 0; + if (surface->format->palette) { + biClrUsed = surface->format->palette->ncolors; + } else { + biClrUsed = 0; + } + biClrImportant = 0; + + /* Write the BMP info values */ + SDL_WriteLE32(dst, biSize); + SDL_WriteLE32(dst, biWidth); + SDL_WriteLE32(dst, biHeight); + SDL_WriteLE16(dst, biPlanes); + SDL_WriteLE16(dst, biBitCount); + SDL_WriteLE32(dst, biCompression); + SDL_WriteLE32(dst, biSizeImage); + SDL_WriteLE32(dst, biXPelsPerMeter); + SDL_WriteLE32(dst, biYPelsPerMeter); + SDL_WriteLE32(dst, biClrUsed); + SDL_WriteLE32(dst, biClrImportant); + + /* Write the palette (in BGR color order) */ + if (surface->format->palette) { + SDL_Color *colors; + int ncolors; + + colors = surface->format->palette->colors; + ncolors = surface->format->palette->ncolors; + for (i = 0; i < ncolors; ++i) { + SDL_RWwrite(dst, &colors[i].b, 1, 1); + SDL_RWwrite(dst, &colors[i].g, 1, 1); + SDL_RWwrite(dst, &colors[i].r, 1, 1); + SDL_RWwrite(dst, &colors[i].a, 1, 1); + } + } + + /* Write the bitmap offset */ + bfOffBits = (Uint32)(SDL_RWtell(dst) - fp_offset); + if (SDL_RWseek(dst, fp_offset + 10, RW_SEEK_SET) < 0) { + SDL_Error(SDL_EFSEEK); + } + SDL_WriteLE32(dst, bfOffBits); + if (SDL_RWseek(dst, fp_offset + bfOffBits, RW_SEEK_SET) < 0) { + SDL_Error(SDL_EFSEEK); + } + + /* Write the bitmap image upside down */ + bits = (Uint8 *) surface->pixels + (surface->h * surface->pitch); + pad = ((bw % 4) ? (4 - (bw % 4)) : 0); + while (bits > (Uint8 *) surface->pixels) { + bits -= surface->pitch; + if (SDL_RWwrite(dst, bits, 1, bw) != bw) { + SDL_Error(SDL_EFWRITE); + break; + } + if (pad) { + const Uint8 padbyte = 0; + for (i = 0; i < pad; ++i) { + SDL_RWwrite(dst, &padbyte, 1, 1); + } + } + } + + /* Write the BMP file size */ + bfSize = (Uint32)(SDL_RWtell(dst) - fp_offset); + if (SDL_RWseek(dst, fp_offset + 2, RW_SEEK_SET) < 0) { + SDL_Error(SDL_EFSEEK); + } + SDL_WriteLE32(dst, bfSize); + if (SDL_RWseek(dst, fp_offset + bfSize, RW_SEEK_SET) < 0) { + SDL_Error(SDL_EFSEEK); + } + + /* Close it up.. */ + SDL_UnlockSurface(surface); + if (surface != saveme) { + SDL_FreeSurface(surface); + } + } + + if (freedst && dst) { + SDL_RWclose(dst); + } + return ((SDL_strcmp(SDL_GetError(), "") == 0) ? 0 : -1); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c new file mode 100644 index 0000000000..83c2e346ea --- /dev/null +++ b/src/video/SDL_clipboard.c @@ -0,0 +1,78 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_clipboard.h" +#include "SDL_sysvideo.h" + + +int +SDL_SetClipboardText(const char *text) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + + if (!text) { + text = ""; + } + if (_this->SetClipboardText) { + return _this->SetClipboardText(_this, text); + } else { + if (_this->clipboard_text) { + SDL_free(_this->clipboard_text); + } + _this->clipboard_text = SDL_strdup(text); + return 0; + } +} + +char * +SDL_GetClipboardText(void) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + + if (_this->GetClipboardText) { + return _this->GetClipboardText(_this); + } else { + const char *text = _this->clipboard_text; + if (!text) { + text = ""; + } + return SDL_strdup(text); + } +} + +SDL_bool +SDL_HasClipboardText(void) +{ + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + + if (_this->HasClipboardText) { + return _this->HasClipboardText(_this); + } else { + if ((_this->clipboard_text) && (SDL_strlen(_this->clipboard_text)>0)) { + return SDL_TRUE; + } else { + return SDL_FALSE; + } + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_cursor.c b/src/video/SDL_cursor.c deleted file mode 100644 index 5d747d3c52..0000000000 --- a/src/video/SDL_cursor.c +++ /dev/null @@ -1,758 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* General cursor handling code for SDL */ - -#include "SDL_mutex.h" -#include "SDL_video.h" -#include "SDL_mouse.h" -#include "SDL_blit.h" -#include "SDL_sysvideo.h" -#include "SDL_cursor_c.h" -#include "SDL_pixels_c.h" -#include "default_cursor.h" -#include "../events/SDL_sysevents.h" -#include "../events/SDL_events_c.h" - -/* These are static for our cursor handling code */ -volatile int SDL_cursorstate = CURSOR_VISIBLE; -SDL_Cursor *SDL_cursor = NULL; -static SDL_Cursor *SDL_defcursor = NULL; -SDL_mutex *SDL_cursorlock = NULL; - -/* Public functions */ -void SDL_CursorQuit(void) -{ - if ( SDL_cursor != NULL ) { - SDL_Cursor *cursor; - - SDL_cursorstate &= ~CURSOR_VISIBLE; - if ( SDL_cursor != SDL_defcursor ) { - SDL_FreeCursor(SDL_cursor); - } - SDL_cursor = NULL; - if ( SDL_defcursor != NULL ) { - cursor = SDL_defcursor; - SDL_defcursor = NULL; - SDL_FreeCursor(cursor); - } - } - if ( SDL_cursorlock != NULL ) { - SDL_DestroyMutex(SDL_cursorlock); - SDL_cursorlock = NULL; - } -} -int SDL_CursorInit(Uint32 multithreaded) -{ - /* We don't have mouse focus, and the cursor isn't drawn yet */ -#ifndef IPOD - SDL_cursorstate = CURSOR_VISIBLE; -#endif - - /* Create the default cursor */ - if ( SDL_defcursor == NULL ) { - SDL_defcursor = SDL_CreateCursor(default_cdata, default_cmask, - DEFAULT_CWIDTH, DEFAULT_CHEIGHT, - DEFAULT_CHOTX, DEFAULT_CHOTY); - SDL_SetCursor(SDL_defcursor); - } - - /* Create a lock if necessary */ - if ( multithreaded ) { - SDL_cursorlock = SDL_CreateMutex(); - } - - /* That's it! */ - return(0); -} - -/* Multi-thread support for cursors */ -#ifndef SDL_LockCursor -void SDL_LockCursor(void) -{ - if ( SDL_cursorlock ) { - SDL_mutexP(SDL_cursorlock); - } -} -#endif -#ifndef SDL_UnlockCursor -void SDL_UnlockCursor(void) -{ - if ( SDL_cursorlock ) { - SDL_mutexV(SDL_cursorlock); - } -} -#endif - -/* Software cursor drawing support */ -SDL_Cursor * SDL_CreateCursor (Uint8 *data, Uint8 *mask, - int w, int h, int hot_x, int hot_y) -{ - SDL_VideoDevice *video = current_video; - int savelen; - int i; - SDL_Cursor *cursor; - - /* Make sure the width is a multiple of 8 */ - w = ((w+7)&~7); - - /* Sanity check the hot spot */ - if ( (hot_x < 0) || (hot_y < 0) || (hot_x >= w) || (hot_y >= h) ) { - SDL_SetError("Cursor hot spot doesn't lie within cursor"); - return(NULL); - } - - /* Allocate memory for the cursor */ - cursor = (SDL_Cursor *)SDL_malloc(sizeof *cursor); - if ( cursor == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - savelen = (w*4)*h; - cursor->area.x = 0; - cursor->area.y = 0; - cursor->area.w = w; - cursor->area.h = h; - cursor->hot_x = hot_x; - cursor->hot_y = hot_y; - cursor->data = (Uint8 *)SDL_malloc((w/8)*h*2); - cursor->mask = cursor->data+((w/8)*h); - cursor->save[0] = (Uint8 *)SDL_malloc(savelen*2); - cursor->save[1] = cursor->save[0] + savelen; - cursor->wm_cursor = NULL; - if ( ! cursor->data || ! cursor->save[0] ) { - SDL_FreeCursor(cursor); - SDL_OutOfMemory(); - return(NULL); - } - for ( i=((w/8)*h)-1; i>=0; --i ) { - cursor->data[i] = data[i]; - cursor->mask[i] = mask[i] | data[i]; - } - SDL_memset(cursor->save[0], 0, savelen*2); - - /* If the window manager gives us a good cursor, we're done! */ - if ( video->CreateWMCursor ) { - cursor->wm_cursor = video->CreateWMCursor(video, data, mask, - w, h, hot_x, hot_y); - } else { - cursor->wm_cursor = NULL; - } - return(cursor); -} - -/* SDL_SetCursor(NULL) can be used to force the cursor redraw, - if this is desired for any reason. This is used when setting - the video mode and when the SDL window gains the mouse focus. - */ -void SDL_SetCursor (SDL_Cursor *cursor) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - /* Make sure that the video subsystem has been initialized */ - if ( ! video ) { - return; - } - - /* Prevent the event thread from moving the mouse */ - SDL_LockCursor(); - - /* Set the new cursor */ - if ( cursor && (cursor != SDL_cursor) ) { - /* Erase the current mouse position */ - if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { - SDL_EraseCursor(SDL_VideoSurface); - } else if ( video->MoveWMCursor ) { - /* If the video driver is moving the cursor directly, - it needs to hide the old cursor before (possibly) - showing the new one. (But don't erase NULL cursor) - */ - if ( SDL_cursor && video->ShowWMCursor ) { - video->ShowWMCursor(this, NULL); - } - } - SDL_cursor = cursor; - } - - /* Draw the new mouse cursor */ - if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) { - /* Use window manager cursor if possible */ - int show_wm_cursor = 0; - if ( SDL_cursor->wm_cursor && video->ShowWMCursor ) { - show_wm_cursor = video->ShowWMCursor(this, SDL_cursor->wm_cursor); - } - if ( show_wm_cursor ) { - SDL_cursorstate &= ~CURSOR_USINGSW; - } else { - SDL_cursorstate |= CURSOR_USINGSW; - if ( video->ShowWMCursor ) { - video->ShowWMCursor(this, NULL); - } - { int x, y; - SDL_GetMouseState(&x, &y); - SDL_cursor->area.x = (x - SDL_cursor->hot_x); - SDL_cursor->area.y = (y - SDL_cursor->hot_y); - } - SDL_DrawCursor(SDL_VideoSurface); - } - } else { - /* Erase window manager mouse (cursor not visible) */ - if ( SDL_cursor && (SDL_cursorstate & CURSOR_USINGSW) ) { - SDL_EraseCursor(SDL_VideoSurface); - } else { - if ( video ) { - if ( video->ShowWMCursor ) { - video->ShowWMCursor(this, NULL); - } - } - } - } - SDL_UnlockCursor(); -} - -SDL_Cursor * SDL_GetCursor (void) -{ - return(SDL_cursor); -} - -void SDL_FreeCursor (SDL_Cursor *cursor) -{ - if ( cursor ) { - if ( cursor == SDL_cursor ) { - SDL_SetCursor(SDL_defcursor); - } - if ( cursor != SDL_defcursor ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - if ( cursor->data ) { - SDL_free(cursor->data); - } - if ( cursor->save[0] ) { - SDL_free(cursor->save[0]); - } - if ( video && cursor->wm_cursor ) { - if ( video->FreeWMCursor ) { - video->FreeWMCursor(this, cursor->wm_cursor); - } - } - SDL_free(cursor); - } - } -} - -int SDL_ShowCursor (int toggle) -{ - int showing; - - showing = (SDL_cursorstate & CURSOR_VISIBLE); - if ( toggle >= 0 ) { - SDL_LockCursor(); - if ( toggle ) { - SDL_cursorstate |= CURSOR_VISIBLE; - } else { - SDL_cursorstate &= ~CURSOR_VISIBLE; - } - SDL_UnlockCursor(); - if ( (SDL_cursorstate & CURSOR_VISIBLE) != showing ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - SDL_SetCursor(NULL); - if ( video && video->CheckMouseMode ) { - video->CheckMouseMode(this); - } - } - } else { - /* Query current state */ ; - } - return(showing ? 1 : 0); -} - -void SDL_WarpMouse (Uint16 x, Uint16 y) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - if ( !video || !SDL_PublicSurface ) { - SDL_SetError("A video mode must be set before warping mouse"); - return; - } - - /* If we have an offset video mode, offset the mouse coordinates */ - if (this->screen->pitch == 0) { - x += this->screen->offset / this->screen->format->BytesPerPixel; - y += this->screen->offset; - } else { - x += (this->screen->offset % this->screen->pitch) / - this->screen->format->BytesPerPixel; - y += (this->screen->offset / this->screen->pitch); - } - - /* This generates a mouse motion event */ - if ( video->WarpWMCursor ) { - video->WarpWMCursor(this, x, y); - } else { - SDL_PrivateMouseMotion(0, 0, x, y); - } -} - -void SDL_MoveCursor(int x, int y) -{ - SDL_VideoDevice *video = current_video; - - /* Erase and update the current mouse position */ - if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { - /* Erase and redraw mouse cursor in new position */ - SDL_LockCursor(); - SDL_EraseCursor(SDL_VideoSurface); - SDL_cursor->area.x = (x - SDL_cursor->hot_x); - SDL_cursor->area.y = (y - SDL_cursor->hot_y); - SDL_DrawCursor(SDL_VideoSurface); - SDL_UnlockCursor(); - } else if ( video->MoveWMCursor ) { - video->MoveWMCursor(video, x, y); - } -} - -/* Keep track of the current cursor colors */ -static int palette_changed = 1; -static Uint8 pixels8[2]; - -void SDL_CursorPaletteChanged(void) -{ - palette_changed = 1; -} - -void SDL_MouseRect(SDL_Rect *area) -{ - int clip_diff; - - *area = SDL_cursor->area; - if ( area->x < 0 ) { - area->w += area->x; - area->x = 0; - } - if ( area->y < 0 ) { - area->h += area->y; - area->y = 0; - } - clip_diff = (area->x+area->w)-SDL_VideoSurface->w; - if ( clip_diff > 0 ) { - area->w = area->w < clip_diff ? 0 : area->w-clip_diff; - } - clip_diff = (area->y+area->h)-SDL_VideoSurface->h; - if ( clip_diff > 0 ) { - area->h = area->h < clip_diff ? 0 : area->h-clip_diff; - } -} - -static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area) -{ - const Uint32 pixels[2] = { 0xFFFFFFFF, 0x00000000 }; - int i, w, h; - Uint8 *data, datab; - Uint8 *mask, maskb; - - data = SDL_cursor->data + area->y * SDL_cursor->area.w/8; - mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8; - switch (screen->format->BytesPerPixel) { - - case 1: { - Uint8 *dst; - int dstskip; - - if ( palette_changed ) { - pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255); - pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0); - palette_changed = 0; - } - dst = (Uint8 *)screen->pixels + - (SDL_cursor->area.y+area->y)*screen->pitch + - SDL_cursor->area.x; - dstskip = screen->pitch-area->w; - - for ( h=area->h; h; h-- ) { - for ( w=area->w/8; w; w-- ) { - maskb = *mask++; - datab = *data++; - for ( i=0; i<8; ++i ) { - if ( maskb & 0x80 ) { - *dst = pixels8[datab>>7]; - } - maskb <<= 1; - datab <<= 1; - dst++; - } - } - dst += dstskip; - } - } - break; - - case 2: { - Uint16 *dst; - int dstskip; - - dst = (Uint16 *)screen->pixels + - (SDL_cursor->area.y+area->y)*screen->pitch/2 + - SDL_cursor->area.x; - dstskip = (screen->pitch/2)-area->w; - - for ( h=area->h; h; h-- ) { - for ( w=area->w/8; w; w-- ) { - maskb = *mask++; - datab = *data++; - for ( i=0; i<8; ++i ) { - if ( maskb & 0x80 ) { - *dst = (Uint16)pixels[datab>>7]; - } - maskb <<= 1; - datab <<= 1; - dst++; - } - } - dst += dstskip; - } - } - break; - - case 3: { - Uint8 *dst; - int dstskip; - - dst = (Uint8 *)screen->pixels + - (SDL_cursor->area.y+area->y)*screen->pitch + - SDL_cursor->area.x*3; - dstskip = screen->pitch-area->w*3; - - for ( h=area->h; h; h-- ) { - for ( w=area->w/8; w; w-- ) { - maskb = *mask++; - datab = *data++; - for ( i=0; i<8; ++i ) { - if ( maskb & 0x80 ) { - SDL_memset(dst,pixels[datab>>7],3); - } - maskb <<= 1; - datab <<= 1; - dst += 3; - } - } - dst += dstskip; - } - } - break; - - case 4: { - Uint32 *dst; - int dstskip; - - dst = (Uint32 *)screen->pixels + - (SDL_cursor->area.y+area->y)*screen->pitch/4 + - SDL_cursor->area.x; - dstskip = (screen->pitch/4)-area->w; - - for ( h=area->h; h; h-- ) { - for ( w=area->w/8; w; w-- ) { - maskb = *mask++; - datab = *data++; - for ( i=0; i<8; ++i ) { - if ( maskb & 0x80 ) { - *dst = pixels[datab>>7]; - } - maskb <<= 1; - datab <<= 1; - dst++; - } - } - dst += dstskip; - } - } - break; - } -} - -static void SDL_DrawCursorSlow(SDL_Surface *screen, SDL_Rect *area) -{ - const Uint32 pixels[2] = { 0xFFFFFF, 0x000000 }; - int h; - int x, minx, maxx; - Uint8 *data, datab = 0; - Uint8 *mask, maskb = 0; - Uint8 *dst; - int dstbpp, dstskip; - - data = SDL_cursor->data + area->y * SDL_cursor->area.w/8; - mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8; - dstbpp = screen->format->BytesPerPixel; - dst = (Uint8 *)screen->pixels + - (SDL_cursor->area.y+area->y)*screen->pitch + - SDL_cursor->area.x*dstbpp; - dstskip = screen->pitch-SDL_cursor->area.w*dstbpp; - - minx = area->x; - maxx = area->x+area->w; - if ( screen->format->BytesPerPixel == 1 ) { - if ( palette_changed ) { - pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255); - pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0); - palette_changed = 0; - } - for ( h=area->h; h; h-- ) { - for ( x=0; xarea.w; ++x ) { - if ( (x%8) == 0 ) { - maskb = *mask++; - datab = *data++; - } - if ( (x >= minx) && (x < maxx) ) { - if ( maskb & 0x80 ) { - SDL_memset(dst, pixels8[datab>>7], dstbpp); - } - } - maskb <<= 1; - datab <<= 1; - dst += dstbpp; - } - dst += dstskip; - } - } else { - for ( h=area->h; h; h-- ) { - for ( x=0; xarea.w; ++x ) { - if ( (x%8) == 0 ) { - maskb = *mask++; - datab = *data++; - } - if ( (x >= minx) && (x < maxx) ) { - if ( maskb & 0x80 ) { - SDL_memset(dst, pixels[datab>>7], dstbpp); - } - } - maskb <<= 1; - datab <<= 1; - dst += dstbpp; - } - dst += dstskip; - } - } -} - -/* This handles the ugly work of converting the saved cursor background from - the pixel format of the shadow surface to that of the video surface. - This is only necessary when blitting from a shadow surface of a different - pixel format than the video surface, and using a software rendered cursor. -*/ -static void SDL_ConvertCursorSave(SDL_Surface *screen, int w, int h) -{ - SDL_BlitInfo info; - SDL_loblit RunBlit; - - /* Make sure we can steal the blit mapping */ - if ( screen->map->dst != SDL_VideoSurface ) { - return; - } - - /* Set up the blit information */ - info.s_pixels = SDL_cursor->save[1]; - info.s_width = w; - info.s_height = h; - info.s_skip = 0; - info.d_pixels = SDL_cursor->save[0]; - info.d_width = w; - info.d_height = h; - info.d_skip = 0; - info.aux_data = screen->map->sw_data->aux_data; - info.src = screen->format; - info.table = screen->map->table; - info.dst = SDL_VideoSurface->format; - RunBlit = screen->map->sw_data->blit; - - /* Run the actual software blit */ - RunBlit(&info); -} - -void SDL_DrawCursorNoLock(SDL_Surface *screen) -{ - SDL_Rect area; - - /* Get the mouse rectangle, clipped to the screen */ - SDL_MouseRect(&area); - if ( (area.w == 0) || (area.h == 0) ) { - return; - } - - /* Copy mouse background */ - { int w, h, screenbpp; - Uint8 *src, *dst; - - /* Set up the copy pointers */ - screenbpp = screen->format->BytesPerPixel; - if ( (screen == SDL_VideoSurface) || - FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) { - dst = SDL_cursor->save[0]; - } else { - dst = SDL_cursor->save[1]; - } - src = (Uint8 *)screen->pixels + area.y * screen->pitch + - area.x * screenbpp; - - /* Perform the copy */ - w = area.w*screenbpp; - h = area.h; - while ( h-- ) { - SDL_memcpy(dst, src, w); - dst += w; - src += screen->pitch; - } - } - - /* Draw the mouse cursor */ - area.x -= SDL_cursor->area.x; - area.y -= SDL_cursor->area.y; - if ( (area.x == 0) && (area.w == SDL_cursor->area.w) ) { - SDL_DrawCursorFast(screen, &area); - } else { - SDL_DrawCursorSlow(screen, &area); - } -} - -void SDL_DrawCursor(SDL_Surface *screen) -{ - /* Lock the screen if necessary */ - if ( screen == NULL ) { - return; - } - if ( SDL_MUSTLOCK(screen) ) { - if ( SDL_LockSurface(screen) < 0 ) { - return; - } - } - - SDL_DrawCursorNoLock(screen); - - /* Unlock the screen and update if necessary */ - if ( SDL_MUSTLOCK(screen) ) { - SDL_UnlockSurface(screen); - } - if ( (screen == SDL_VideoSurface) && - ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - SDL_Rect area; - - SDL_MouseRect(&area); - - /* This can be called before a video mode is set */ - if ( video->UpdateRects ) { - video->UpdateRects(this, 1, &area); - } - } -} - -void SDL_EraseCursorNoLock(SDL_Surface *screen) -{ - SDL_Rect area; - - /* Get the mouse rectangle, clipped to the screen */ - SDL_MouseRect(&area); - if ( (area.w == 0) || (area.h == 0) ) { - return; - } - - /* Copy mouse background */ - { int w, h, screenbpp; - Uint8 *src, *dst; - - /* Set up the copy pointers */ - screenbpp = screen->format->BytesPerPixel; - if ( (screen == SDL_VideoSurface) || - FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) { - src = SDL_cursor->save[0]; - } else { - src = SDL_cursor->save[1]; - } - dst = (Uint8 *)screen->pixels + area.y * screen->pitch + - area.x * screenbpp; - - /* Perform the copy */ - w = area.w*screenbpp; - h = area.h; - while ( h-- ) { - SDL_memcpy(dst, src, w); - src += w; - dst += screen->pitch; - } - - /* Perform pixel conversion on cursor background */ - if ( src > SDL_cursor->save[1] ) { - SDL_ConvertCursorSave(screen, area.w, area.h); - } - } -} - -void SDL_EraseCursor(SDL_Surface *screen) -{ - /* Lock the screen if necessary */ - if ( screen == NULL ) { - return; - } - if ( SDL_MUSTLOCK(screen) ) { - if ( SDL_LockSurface(screen) < 0 ) { - return; - } - } - - SDL_EraseCursorNoLock(screen); - - /* Unlock the screen and update if necessary */ - if ( SDL_MUSTLOCK(screen) ) { - SDL_UnlockSurface(screen); - } - if ( (screen == SDL_VideoSurface) && - ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - SDL_Rect area; - - SDL_MouseRect(&area); - if ( video->UpdateRects ) { - video->UpdateRects(this, 1, &area); - } - } -} - -/* Reset the cursor on video mode change - FIXME: Keep track of all cursors, and reset them all. - */ -void SDL_ResetCursor(void) -{ - int savelen; - - if ( SDL_cursor ) { - savelen = SDL_cursor->area.w*4*SDL_cursor->area.h; - SDL_cursor->area.x = 0; - SDL_cursor->area.y = 0; - SDL_memset(SDL_cursor->save[0], 0, savelen); - } -} diff --git a/src/video/SDL_cursor_c.h b/src/video/SDL_cursor_c.h deleted file mode 100644 index 8be8df912c..0000000000 --- a/src/video/SDL_cursor_c.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Useful variables and functions from SDL_cursor.c */ -#include "SDL_mouse.h" - -extern int SDL_CursorInit(Uint32 flags); -extern void SDL_CursorPaletteChanged(void); -extern void SDL_DrawCursor(SDL_Surface *screen); -extern void SDL_DrawCursorNoLock(SDL_Surface *screen); -extern void SDL_EraseCursor(SDL_Surface *screen); -extern void SDL_EraseCursorNoLock(SDL_Surface *screen); -extern void SDL_UpdateCursor(SDL_Surface *screen); -extern void SDL_ResetCursor(void); -extern void SDL_MoveCursor(int x, int y); -extern void SDL_CursorQuit(void); - -#define INLINE_MOUSELOCK -#ifdef INLINE_MOUSELOCK -/* Inline (macro) versions of the mouse lock functions */ -#include "SDL_mutex.h" - -extern SDL_mutex *SDL_cursorlock; - -#define SDL_LockCursor() \ - do { \ - if ( SDL_cursorlock ) { \ - SDL_mutexP(SDL_cursorlock); \ - } \ - } while ( 0 ) -#define SDL_UnlockCursor() \ - do { \ - if ( SDL_cursorlock ) { \ - SDL_mutexV(SDL_cursorlock); \ - } \ - } while ( 0 ) -#else -extern void SDL_LockCursor(void); -extern void SDL_UnlockCursor(void); -#endif /* INLINE_MOUSELOCK */ - -/* Only for low-level mouse cursor drawing */ -extern SDL_Cursor *SDL_cursor; -extern void SDL_MouseRect(SDL_Rect *area); - -/* State definitions for the SDL cursor */ -#define CURSOR_VISIBLE 0x01 -#define CURSOR_USINGSW 0x10 -#define SHOULD_DRAWCURSOR(X) \ - (((X)&(CURSOR_VISIBLE|CURSOR_USINGSW)) == \ - (CURSOR_VISIBLE|CURSOR_USINGSW)) - -extern volatile int SDL_cursorstate; diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c new file mode 100644 index 0000000000..a99371e056 --- /dev/null +++ b/src/video/SDL_fillrect.c @@ -0,0 +1,432 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_video.h" +#include "SDL_blit.h" + + +#ifdef __SSE__ +/* *INDENT-OFF* */ + +#ifdef _MSC_VER +#define SSE_BEGIN \ + __m128 c128; \ + c128.m128_u32[0] = color; \ + c128.m128_u32[1] = color; \ + c128.m128_u32[2] = color; \ + c128.m128_u32[3] = color; +#else +#define SSE_BEGIN \ + DECLARE_ALIGNED(Uint32, cccc[4], 16); \ + cccc[0] = color; \ + cccc[1] = color; \ + cccc[2] = color; \ + cccc[3] = color; \ + __m128 c128 = *(__m128 *)cccc; +#endif + +#define SSE_WORK \ + for (i = n / 64; i--;) { \ + _mm_stream_ps((float *)(p+0), c128); \ + _mm_stream_ps((float *)(p+16), c128); \ + _mm_stream_ps((float *)(p+32), c128); \ + _mm_stream_ps((float *)(p+48), c128); \ + p += 64; \ + } + +#define SSE_END + +#define DEFINE_SSE_FILLRECT(bpp, type) \ +static void \ +SDL_FillRect##bpp##SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \ +{ \ + SSE_BEGIN; \ + \ + while (h--) { \ + int i, n = w * bpp; \ + Uint8 *p = pixels; \ + \ + if (n > 63) { \ + int adjust = 16 - ((uintptr_t)p & 15); \ + if (adjust < 16) { \ + n -= adjust; \ + adjust /= bpp; \ + while (adjust--) { \ + *((type *)p) = (type)color; \ + p += bpp; \ + } \ + } \ + SSE_WORK; \ + } \ + if (n & 63) { \ + int remainder = (n & 63); \ + remainder /= bpp; \ + while (remainder--) { \ + *((type *)p) = (type)color; \ + p += bpp; \ + } \ + } \ + pixels += pitch; \ + } \ + \ + SSE_END; \ +} + +static void +SDL_FillRect1SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + SSE_BEGIN; + + while (h--) { + int i, n = w; + Uint8 *p = pixels; + + if (n > 63) { + int adjust = 16 - ((uintptr_t)p & 15); + if (adjust) { + n -= adjust; + SDL_memset(p, color, adjust); + p += adjust; + } + SSE_WORK; + } + if (n & 63) { + int remainder = (n & 63); + SDL_memset(p, color, remainder); + p += remainder; + } + pixels += pitch; + } + + SSE_END; +} +/*DEFINE_SSE_FILLRECT(1, Uint8)*/ +DEFINE_SSE_FILLRECT(2, Uint16) +DEFINE_SSE_FILLRECT(4, Uint32) + +/* *INDENT-ON* */ +#endif /* __SSE__ */ + +#ifdef __MMX__ +/* *INDENT-OFF* */ + +#define MMX_BEGIN \ + __m64 c64 = _mm_set_pi32(color, color) + +#define MMX_WORK \ + for (i = n / 64; i--;) { \ + _mm_stream_pi((__m64 *)(p+0), c64); \ + _mm_stream_pi((__m64 *)(p+8), c64); \ + _mm_stream_pi((__m64 *)(p+16), c64); \ + _mm_stream_pi((__m64 *)(p+24), c64); \ + _mm_stream_pi((__m64 *)(p+32), c64); \ + _mm_stream_pi((__m64 *)(p+40), c64); \ + _mm_stream_pi((__m64 *)(p+48), c64); \ + _mm_stream_pi((__m64 *)(p+56), c64); \ + p += 64; \ + } + +#define MMX_END \ + _mm_empty() + +#define DEFINE_MMX_FILLRECT(bpp, type) \ +static void \ +SDL_FillRect##bpp##MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \ +{ \ + MMX_BEGIN; \ + \ + while (h--) { \ + int i, n = w * bpp; \ + Uint8 *p = pixels; \ + \ + if (n > 63) { \ + int adjust = 8 - ((uintptr_t)p & 7); \ + if (adjust < 8) { \ + n -= adjust; \ + adjust /= bpp; \ + while (adjust--) { \ + *((type *)p) = (type)color; \ + p += bpp; \ + } \ + } \ + MMX_WORK; \ + } \ + if (n & 63) { \ + int remainder = (n & 63); \ + remainder /= bpp; \ + while (remainder--) { \ + *((type *)p) = (type)color; \ + p += bpp; \ + } \ + } \ + pixels += pitch; \ + } \ + \ + MMX_END; \ +} + +static void +SDL_FillRect1MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + MMX_BEGIN; + + while (h--) { + int i, n = w; + Uint8 *p = pixels; + + if (n > 63) { + int adjust = 8 - ((uintptr_t)p & 7); + if (adjust) { + n -= adjust; + SDL_memset(p, color, adjust); + p += adjust; + } + MMX_WORK; + } + if (n & 63) { + int remainder = (n & 63); + SDL_memset(p, color, remainder); + p += remainder; + } + pixels += pitch; + } + + MMX_END; +} +/*DEFINE_MMX_FILLRECT(1, Uint8)*/ +DEFINE_MMX_FILLRECT(2, Uint16) +DEFINE_MMX_FILLRECT(4, Uint32) + +/* *INDENT-ON* */ +#endif /* __MMX__ */ + +static void +SDL_FillRect1(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +{ + while (h--) { + int n = w; + Uint8 *p = pixels; + + if (n > 3) { + switch ((uintptr_t) p & 3) { + case 1: + *p++ = (Uint8) color; + --n; + case 2: + *p++ = (Uint8) color; + --n; + case 3: + *p++ = (Uint8) color; + --n; + } + SDL_memset4(p, color, (n >> 2)); + } + if (n & 3) { + p += (n & ~3); + switch (n & 3) { + case 3: + *p++ = (Uint8) color; + case 2: + *p++ = (Uint8) color; + case 1: + *p++ = (Uint8) color; + } + } + pixels += pitch; + } +} + +static void +SDL_FillRect2(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +{ + while (h--) { + int n = w; + Uint16 *p = (Uint16 *) pixels; + + if (n > 1) { + if ((uintptr_t) p & 2) { + *p++ = (Uint16) color; + --n; + } + SDL_memset4(p, color, (n >> 1)); + } + if (n & 1) { + p[n - 1] = (Uint16) color; + } + pixels += pitch; + } +} + +static void +SDL_FillRect3(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +{ + Uint8 r = (Uint8) ((color >> 16) & 0xFF); + Uint8 g = (Uint8) ((color >> 8) & 0xFF); + Uint8 b = (Uint8) (color & 0xFF); + + while (h--) { + int n = w; + Uint8 *p = pixels; + + while (n--) { + *p++ = r; + *p++ = g; + *p++ = b; + } + pixels += pitch; + } +} + +static void +SDL_FillRect4(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +{ + while (h--) { + SDL_memset4(pixels, color, w); + pixels += pitch; + } +} + +/* + * This function performs a fast fill of the given rectangle with 'color' + */ +int +SDL_FillRect(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color) +{ + SDL_Rect clipped; + Uint8 *pixels; + + if (!dst) { + return SDL_SetError("Passed NULL destination surface"); + } + + /* This function doesn't work on surfaces < 8 bpp */ + if (dst->format->BitsPerPixel < 8) { + return SDL_SetError("SDL_FillRect(): Unsupported surface format"); + } + + /* If 'rect' == NULL, then fill the whole surface */ + if (rect) { + /* Perform clipping */ + if (!SDL_IntersectRect(rect, &dst->clip_rect, &clipped)) { + return 0; + } + rect = &clipped; + } else { + rect = &dst->clip_rect; + } + + /* Perform software fill */ + if (!dst->pixels) { + return SDL_SetError("SDL_FillRect(): You must lock the surface"); + } + + pixels = (Uint8 *) dst->pixels + rect->y * dst->pitch + + rect->x * dst->format->BytesPerPixel; + + switch (dst->format->BytesPerPixel) { + case 1: + { + color |= (color << 8); + color |= (color << 16); +#ifdef __SSE__ + if (SDL_HasSSE()) { + SDL_FillRect1SSE(pixels, dst->pitch, color, rect->w, rect->h); + break; + } +#endif +#ifdef __MMX__ + if (SDL_HasMMX()) { + SDL_FillRect1MMX(pixels, dst->pitch, color, rect->w, rect->h); + break; + } +#endif + SDL_FillRect1(pixels, dst->pitch, color, rect->w, rect->h); + break; + } + + case 2: + { + color |= (color << 16); +#ifdef __SSE__ + if (SDL_HasSSE()) { + SDL_FillRect2SSE(pixels, dst->pitch, color, rect->w, rect->h); + break; + } +#endif +#ifdef __MMX__ + if (SDL_HasMMX()) { + SDL_FillRect2MMX(pixels, dst->pitch, color, rect->w, rect->h); + break; + } +#endif + SDL_FillRect2(pixels, dst->pitch, color, rect->w, rect->h); + break; + } + + case 3: + /* 24-bit RGB is a slow path, at least for now. */ + { + SDL_FillRect3(pixels, dst->pitch, color, rect->w, rect->h); + break; + } + + case 4: + { +#ifdef __SSE__ + if (SDL_HasSSE()) { + SDL_FillRect4SSE(pixels, dst->pitch, color, rect->w, rect->h); + break; + } +#endif +#ifdef __MMX__ + if (SDL_HasMMX()) { + SDL_FillRect4MMX(pixels, dst->pitch, color, rect->w, rect->h); + break; + } +#endif + SDL_FillRect4(pixels, dst->pitch, color, rect->w, rect->h); + break; + } + } + + /* We're done! */ + return 0; +} + +int +SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, + Uint32 color) +{ + int i; + int status = 0; + + if (!rects) { + return SDL_SetError("SDL_FillRects() passed NULL rects"); + } + + for (i = 0; i < count; ++i) { + status += SDL_FillRect(dst, &rects[i], color); + } + return status; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_gamma.c b/src/video/SDL_gamma.c deleted file mode 100644 index 4fd037019f..0000000000 --- a/src/video/SDL_gamma.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Gamma correction support */ - -#ifdef HAVE_MATH_H -#include /* Used for calculating gamma ramps */ -#else -/* Math routines from uClibc: http://www.uclibc.org */ -#include "math_private.h" -#include "e_sqrt.h" -#include "e_pow.h" -#include "e_log.h" -#define pow(x, y) __ieee754_pow(x, y) -#define log(x) __ieee754_log(x) -#endif - -#include "SDL_sysvideo.h" - - -static void CalculateGammaRamp(float gamma, Uint16 *ramp) -{ - int i; - - /* 0.0 gamma is all black */ - if ( gamma <= 0.0f ) { - for ( i=0; i<256; ++i ) { - ramp[i] = 0; - } - return; - } else - /* 1.0 gamma is identity */ - if ( gamma == 1.0f ) { - for ( i=0; i<256; ++i ) { - ramp[i] = (i << 8) | i; - } - return; - } else - /* Calculate a real gamma ramp */ - { int value; - gamma = 1.0f / gamma; - for ( i=0; i<256; ++i ) { - value = (int)(pow((double)i/256.0, gamma)*65535.0+0.5); - if ( value > 65535 ) { - value = 65535; - } - ramp[i] = (Uint16)value; - } - } -} -static void CalculateGammaFromRamp(float *gamma, Uint16 *ramp) -{ - /* The following is adapted from a post by Garrett Bass on OpenGL - Gamedev list, March 4, 2000. - */ - float sum = 0.0f; - int i, count = 0; - - *gamma = 1.0; - for ( i = 1; i < 256; ++i ) { - if ( (ramp[i] != 0) && (ramp[i] != 65535) ) { - double B = (double)i / 256.0; - double A = ramp[i] / 65535.0; - sum += (float) ( log(A) / log(B) ); - count++; - } - } - if ( count && sum > 0.0f ) { - *gamma = 1.0f / (sum / count); - } -} - -int SDL_SetGamma(float red, float green, float blue) -{ - int succeeded; - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - succeeded = -1; - /* Prefer using SetGammaRamp(), as it's more flexible */ - { - Uint16 ramp[3][256]; - - CalculateGammaRamp(red, ramp[0]); - CalculateGammaRamp(green, ramp[1]); - CalculateGammaRamp(blue, ramp[2]); - succeeded = SDL_SetGammaRamp(ramp[0], ramp[1], ramp[2]); - } - if ( (succeeded < 0) && video->SetGamma ) { - SDL_ClearError(); - succeeded = video->SetGamma(this, red, green, blue); - } - return succeeded; -} - -/* Calculating the gamma by integrating the gamma ramps isn't exact, - so this function isn't officially supported. -*/ -int SDL_GetGamma(float *red, float *green, float *blue) -{ - int succeeded; - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - succeeded = -1; - /* Prefer using GetGammaRamp(), as it's more flexible */ - { - Uint16 ramp[3][256]; - - succeeded = SDL_GetGammaRamp(ramp[0], ramp[1], ramp[2]); - if ( succeeded >= 0 ) { - CalculateGammaFromRamp(red, ramp[0]); - CalculateGammaFromRamp(green, ramp[1]); - CalculateGammaFromRamp(blue, ramp[2]); - } - } - if ( (succeeded < 0) && video->GetGamma ) { - SDL_ClearError(); - succeeded = video->GetGamma(this, red, green, blue); - } - return succeeded; -} - -int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue) -{ - int succeeded; - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - SDL_Surface *screen = SDL_PublicSurface; - - /* Verify the screen parameter */ - if ( !screen ) { - SDL_SetError("No video mode has been set"); - return -1; - } - - /* Lazily allocate the gamma tables */ - if ( ! video->gamma ) { - SDL_GetGammaRamp(0, 0, 0); - } - - /* Fill the gamma table with the new values */ - if ( red ) { - SDL_memcpy(&video->gamma[0*256], red, 256*sizeof(*video->gamma)); - } - if ( green ) { - SDL_memcpy(&video->gamma[1*256], green, 256*sizeof(*video->gamma)); - } - if ( blue ) { - SDL_memcpy(&video->gamma[2*256], blue, 256*sizeof(*video->gamma)); - } - - /* Gamma correction always possible on split palettes */ - if ( (screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) { - SDL_Palette *pal = screen->format->palette; - - /* If physical palette has been set independently, use it */ - if(video->physpal) - pal = video->physpal; - - SDL_SetPalette(screen, SDL_PHYSPAL, - pal->colors, 0, pal->ncolors); - return 0; - } - - /* Try to set the gamma ramp in the driver */ - succeeded = -1; - if ( video->SetGammaRamp ) { - succeeded = video->SetGammaRamp(this, video->gamma); - } else { - SDL_SetError("Gamma ramp manipulation not supported"); - } - return succeeded; -} - -int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - /* Lazily allocate the gamma table */ - if ( ! video->gamma ) { - video->gamma = SDL_malloc(3*256*sizeof(*video->gamma)); - if ( ! video->gamma ) { - SDL_OutOfMemory(); - return -1; - } - if ( video->GetGammaRamp ) { - /* Get the real hardware gamma */ - video->GetGammaRamp(this, video->gamma); - } else { - /* Assume an identity gamma */ - int i; - for ( i=0; i<256; ++i ) { - video->gamma[0*256+i] = (i << 8) | i; - video->gamma[1*256+i] = (i << 8) | i; - video->gamma[2*256+i] = (i << 8) | i; - } - } - } - - /* Just copy from our internal table */ - if ( red ) { - SDL_memcpy(red, &video->gamma[0*256], 256*sizeof(*red)); - } - if ( green ) { - SDL_memcpy(green, &video->gamma[1*256], 256*sizeof(*green)); - } - if ( blue ) { - SDL_memcpy(blue, &video->gamma[2*256], 256*sizeof(*blue)); - } - return 0; -} diff --git a/src/video/SDL_glfuncs.h b/src/video/SDL_glfuncs.h deleted file mode 100644 index fb2d964879..0000000000 --- a/src/video/SDL_glfuncs.h +++ /dev/null @@ -1,341 +0,0 @@ -/* list of OpenGL functions sorted alphabetically - If you need to use a GL function from the SDL video subsystem, - change it's entry from SDL_PROC_UNUSED to SDL_PROC and rebuild. -*/ -#define SDL_PROC_UNUSED(ret,func,params) -SDL_PROC_UNUSED(void,glAccum,(GLenum,GLfloat)) -SDL_PROC_UNUSED(void,glAlphaFunc,(GLenum,GLclampf)) -SDL_PROC_UNUSED(GLboolean,glAreTexturesResident,(GLsizei,const GLuint*,GLboolean*)) -SDL_PROC_UNUSED(void,glArrayElement,(GLint)) -SDL_PROC(void,glBegin,(GLenum)) -SDL_PROC(void,glBindTexture,(GLenum,GLuint)) -SDL_PROC_UNUSED(void,glBitmap,(GLsizei,GLsizei,GLfloat,GLfloat,GLfloat,GLfloat,const GLubyte*)) -SDL_PROC(void,glBlendFunc,(GLenum,GLenum)) -SDL_PROC_UNUSED(void,glCallList,(GLuint)) -SDL_PROC_UNUSED(void,glCallLists,(GLsizei,GLenum,const GLvoid*)) -SDL_PROC_UNUSED(void,glClear,(GLbitfield)) -SDL_PROC_UNUSED(void,glClearAccum,(GLfloat,GLfloat,GLfloat,GLfloat)) -SDL_PROC_UNUSED(void,glClearColor,(GLclampf,GLclampf,GLclampf,GLclampf)) -SDL_PROC_UNUSED(void,glClearDepth,(GLclampd)) -SDL_PROC_UNUSED(void,glClearIndex,(GLfloat)) -SDL_PROC_UNUSED(void,glClearStencil,(GLint)) -SDL_PROC_UNUSED(void,glClipPlane,(GLenum,const GLdouble*)) -SDL_PROC_UNUSED(void,glColor3b,(GLbyte,GLbyte,GLbyte)) -SDL_PROC_UNUSED(void,glColor3bv,(const GLbyte*)) -SDL_PROC_UNUSED(void,glColor3d,(GLdouble,GLdouble,GLdouble)) -SDL_PROC_UNUSED(void,glColor3dv,(const GLdouble*)) -SDL_PROC_UNUSED(void,glColor3f,(GLfloat,GLfloat,GLfloat)) -SDL_PROC_UNUSED(void,glColor3fv,(const GLfloat*)) -SDL_PROC_UNUSED(void,glColor3i,(GLint,GLint,GLint)) -SDL_PROC_UNUSED(void,glColor3iv,(const GLint*)) -SDL_PROC_UNUSED(void,glColor3s,(GLshort,GLshort,GLshort)) -SDL_PROC_UNUSED(void,glColor3sv,(const GLshort*)) -SDL_PROC_UNUSED(void,glColor3ub,(GLubyte,GLubyte,GLubyte)) -SDL_PROC_UNUSED(void,glColor3ubv,(const GLubyte*)) -SDL_PROC_UNUSED(void,glColor3ui,(GLuint,GLuint,GLuint)) -SDL_PROC_UNUSED(void,glColor3uiv,(const GLuint*)) -SDL_PROC_UNUSED(void,glColor3us,(GLushort,GLushort,GLushort)) -SDL_PROC_UNUSED(void,glColor3usv,(const GLushort*)) -SDL_PROC_UNUSED(void,glColor4b,(GLbyte,GLbyte,GLbyte,GLbyte)) -SDL_PROC_UNUSED(void,glColor4bv,(const GLbyte*)) -SDL_PROC_UNUSED(void,glColor4d,(GLdouble,GLdouble,GLdouble,GLdouble)) -SDL_PROC_UNUSED(void,glColor4dv,(const GLdouble*)) -SDL_PROC(void,glColor4f,(GLfloat,GLfloat,GLfloat,GLfloat)) -SDL_PROC_UNUSED(void,glColor4fv,(const GLfloat*)) -SDL_PROC_UNUSED(void,glColor4i,(GLint,GLint,GLint,GLint)) -SDL_PROC_UNUSED(void,glColor4iv,(const GLint*)) -SDL_PROC_UNUSED(void,glColor4s,(GLshort,GLshort,GLshort,GLshort)) -SDL_PROC_UNUSED(void,glColor4sv,(const GLshort*)) -SDL_PROC_UNUSED(void,glColor4ub,(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)) -SDL_PROC_UNUSED(void,glColor4ubv,(const GLubyte *v)) -SDL_PROC_UNUSED(void,glColor4ui,(GLuint red, GLuint green, GLuint blue, GLuint alpha)) -SDL_PROC_UNUSED(void,glColor4uiv,(const GLuint *v)) -SDL_PROC_UNUSED(void,glColor4us,(GLushort red, GLushort green, GLushort blue, GLushort alpha)) -SDL_PROC_UNUSED(void,glColor4usv,(const GLushort *v)) -SDL_PROC_UNUSED(void,glColorMask,(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) -SDL_PROC_UNUSED(void,glColorMaterial,(GLenum face, GLenum mode)) -SDL_PROC_UNUSED(void,glColorPointer,(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) -SDL_PROC_UNUSED(void,glCopyPixels,(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)) -SDL_PROC_UNUSED(void,glCopyTexImage1D,(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border)) -SDL_PROC_UNUSED(void,glCopyTexImage2D,(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)) -SDL_PROC_UNUSED(void,glCopyTexSubImage1D,(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) -SDL_PROC_UNUSED(void,glCopyTexSubImage2D,(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) -SDL_PROC_UNUSED(void,glCullFace,(GLenum mode)) -SDL_PROC_UNUSED(void,glDeleteLists,(GLuint list, GLsizei range)) -SDL_PROC_UNUSED(void,glDeleteTextures,(GLsizei n, const GLuint *textures)) -SDL_PROC_UNUSED(void,glDepthFunc,(GLenum func)) -SDL_PROC_UNUSED(void,glDepthMask,(GLboolean flag)) -SDL_PROC_UNUSED(void,glDepthRange,(GLclampd zNear, GLclampd zFar)) -SDL_PROC(void,glDisable,(GLenum cap)) -SDL_PROC_UNUSED(void,glDisableClientState,(GLenum array)) -SDL_PROC_UNUSED(void,glDrawArrays,(GLenum mode, GLint first, GLsizei count)) -SDL_PROC_UNUSED(void,glDrawBuffer,(GLenum mode)) -SDL_PROC_UNUSED(void,glDrawElements,(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)) -SDL_PROC_UNUSED(void,glDrawPixels,(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) -SDL_PROC_UNUSED(void,glEdgeFlag,(GLboolean flag)) -SDL_PROC_UNUSED(void,glEdgeFlagPointer,(GLsizei stride, const GLvoid *pointer)) -SDL_PROC_UNUSED(void,glEdgeFlagv,(const GLboolean *flag)) -SDL_PROC(void,glEnable,(GLenum cap)) -SDL_PROC_UNUSED(void,glEnableClientState,(GLenum array)) -SDL_PROC(void,glEnd,(void)) -SDL_PROC_UNUSED(void,glEndList,(void)) -SDL_PROC_UNUSED(void,glEvalCoord1d,(GLdouble u)) -SDL_PROC_UNUSED(void,glEvalCoord1dv,(const GLdouble *u)) -SDL_PROC_UNUSED(void,glEvalCoord1f,(GLfloat u)) -SDL_PROC_UNUSED(void,glEvalCoord1fv,(const GLfloat *u)) -SDL_PROC_UNUSED(void,glEvalCoord2d,(GLdouble u, GLdouble v)) -SDL_PROC_UNUSED(void,glEvalCoord2dv,(const GLdouble *u)) -SDL_PROC_UNUSED(void,glEvalCoord2f,(GLfloat u, GLfloat v)) -SDL_PROC_UNUSED(void,glEvalCoord2fv,(const GLfloat *u)) -SDL_PROC_UNUSED(void,glEvalMesh1,(GLenum mode, GLint i1, GLint i2)) -SDL_PROC_UNUSED(void,glEvalMesh2,(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)) -SDL_PROC_UNUSED(void,glEvalPoint1,(GLint i)) -SDL_PROC_UNUSED(void,glEvalPoint2,(GLint i, GLint j)) -SDL_PROC_UNUSED(void,glFeedbackBuffer,(GLsizei size, GLenum type, GLfloat *buffer)) -SDL_PROC_UNUSED(void,glFinish,(void)) -SDL_PROC(void,glFlush,(void)) -SDL_PROC_UNUSED(void,glFogf,(GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glFogfv,(GLenum pname, const GLfloat *params)) -SDL_PROC_UNUSED(void,glFogi,(GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glFogiv,(GLenum pname, const GLint *params)) -SDL_PROC_UNUSED(void,glFrontFace,(GLenum mode)) -SDL_PROC_UNUSED(void,glFrustum,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) -SDL_PROC_UNUSED(GLuint,glGenLists,(GLsizei range)) -SDL_PROC(void,glGenTextures,(GLsizei n, GLuint *textures)) -SDL_PROC_UNUSED(void,glGetBooleanv,(GLenum pname, GLboolean *params)) -SDL_PROC_UNUSED(void,glGetClipPlane,(GLenum plane, GLdouble *equation)) -SDL_PROC_UNUSED(void,glGetDoublev,(GLenum pname, GLdouble *params)) -SDL_PROC_UNUSED(GLenum,glGetError,(void)) -SDL_PROC_UNUSED(void,glGetFloatv,(GLenum pname, GLfloat *params)) -SDL_PROC_UNUSED(void,glGetIntegerv,(GLenum pname, GLint *params)) -SDL_PROC_UNUSED(void,glGetLightfv,(GLenum light, GLenum pname, GLfloat *params)) -SDL_PROC_UNUSED(void,glGetLightiv,(GLenum light, GLenum pname, GLint *params)) -SDL_PROC_UNUSED(void,glGetMapdv,(GLenum target, GLenum query, GLdouble *v)) -SDL_PROC_UNUSED(void,glGetMapfv,(GLenum target, GLenum query, GLfloat *v)) -SDL_PROC_UNUSED(void,glGetMapiv,(GLenum target, GLenum query, GLint *v)) -SDL_PROC_UNUSED(void,glGetMaterialfv,(GLenum face, GLenum pname, GLfloat *params)) -SDL_PROC_UNUSED(void,glGetMaterialiv,(GLenum face, GLenum pname, GLint *params)) -SDL_PROC_UNUSED(void,glGetPixelMapfv,(GLenum map, GLfloat *values)) -SDL_PROC_UNUSED(void,glGetPixelMapuiv,(GLenum map, GLuint *values)) -SDL_PROC_UNUSED(void,glGetPixelMapusv,(GLenum map, GLushort *values)) -SDL_PROC_UNUSED(void,glGetPointerv,(GLenum pname, GLvoid* *params)) -SDL_PROC_UNUSED(void,glGetPolygonStipple,(GLubyte *mask)) -SDL_PROC(const GLubyte *,glGetString,(GLenum name)) -SDL_PROC_UNUSED(void,glGetTexEnvfv,(GLenum target, GLenum pname, GLfloat *params)) -SDL_PROC_UNUSED(void,glGetTexEnviv,(GLenum target, GLenum pname, GLint *params)) -SDL_PROC_UNUSED(void,glGetTexGendv,(GLenum coord, GLenum pname, GLdouble *params)) -SDL_PROC_UNUSED(void,glGetTexGenfv,(GLenum coord, GLenum pname, GLfloat *params)) -SDL_PROC_UNUSED(void,glGetTexGeniv,(GLenum coord, GLenum pname, GLint *params)) -SDL_PROC_UNUSED(void,glGetTexImage,(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)) -SDL_PROC_UNUSED(void,glGetTexLevelParameterfv,(GLenum target, GLint level, GLenum pname, GLfloat *params)) -SDL_PROC_UNUSED(void,glGetTexLevelParameteriv,(GLenum target, GLint level, GLenum pname, GLint *params)) -SDL_PROC_UNUSED(void,glGetTexParameterfv,(GLenum target, GLenum pname, GLfloat *params)) -SDL_PROC_UNUSED(void,glGetTexParameteriv,(GLenum target, GLenum pname, GLint *params)) -SDL_PROC_UNUSED(void,glHint,(GLenum target, GLenum mode)) -SDL_PROC_UNUSED(void,glIndexMask,(GLuint mask)) -SDL_PROC_UNUSED(void,glIndexPointer,(GLenum type, GLsizei stride, const GLvoid *pointer)) -SDL_PROC_UNUSED(void,glIndexd,(GLdouble c)) -SDL_PROC_UNUSED(void,glIndexdv,(const GLdouble *c)) -SDL_PROC_UNUSED(void,glIndexf,(GLfloat c)) -SDL_PROC_UNUSED(void,glIndexfv,(const GLfloat *c)) -SDL_PROC_UNUSED(void,glIndexi,(GLint c)) -SDL_PROC_UNUSED(void,glIndexiv,(const GLint *c)) -SDL_PROC_UNUSED(void,glIndexs,(GLshort c)) -SDL_PROC_UNUSED(void,glIndexsv,(const GLshort *c)) -SDL_PROC_UNUSED(void,glIndexub,(GLubyte c)) -SDL_PROC_UNUSED(void,glIndexubv,(const GLubyte *c)) -SDL_PROC_UNUSED(void,glInitNames,(void)) -SDL_PROC_UNUSED(void,glInterleavedArrays,(GLenum format, GLsizei stride, const GLvoid *pointer)) -SDL_PROC_UNUSED(GLboolean,glIsEnabled,(GLenum cap)) -SDL_PROC_UNUSED(GLboolean,glIsList,(GLuint list)) -SDL_PROC_UNUSED(GLboolean,glIsTexture,(GLuint texture)) -SDL_PROC_UNUSED(void,glLightModelf,(GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glLightModelfv,(GLenum pname, const GLfloat *params)) -SDL_PROC_UNUSED(void,glLightModeli,(GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glLightModeliv,(GLenum pname, const GLint *params)) -SDL_PROC_UNUSED(void,glLightf,(GLenum light, GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glLightfv,(GLenum light, GLenum pname, const GLfloat *params)) -SDL_PROC_UNUSED(void,glLighti,(GLenum light, GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glLightiv,(GLenum light, GLenum pname, const GLint *params)) -SDL_PROC_UNUSED(void,glLineStipple,(GLint factor, GLushort pattern)) -SDL_PROC_UNUSED(void,glLineWidth,(GLfloat width)) -SDL_PROC_UNUSED(void,glListBase,(GLuint base)) -SDL_PROC(void,glLoadIdentity,(void)) -SDL_PROC_UNUSED(void,glLoadMatrixd,(const GLdouble *m)) -SDL_PROC_UNUSED(void,glLoadMatrixf,(const GLfloat *m)) -SDL_PROC_UNUSED(void,glLoadName,(GLuint name)) -SDL_PROC_UNUSED(void,glLogicOp,(GLenum opcode)) -SDL_PROC_UNUSED(void,glMap1d,(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points)) -SDL_PROC_UNUSED(void,glMap1f,(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points)) -SDL_PROC_UNUSED(void,glMap2d,(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points)) -SDL_PROC_UNUSED(void,glMap2f,(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)) -SDL_PROC_UNUSED(void,glMapGrid1d,(GLint un, GLdouble u1, GLdouble u2)) -SDL_PROC_UNUSED(void,glMapGrid1f,(GLint un, GLfloat u1, GLfloat u2)) -SDL_PROC_UNUSED(void,glMapGrid2d,(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)) -SDL_PROC_UNUSED(void,glMapGrid2f,(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)) -SDL_PROC_UNUSED(void,glMaterialf,(GLenum face, GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glMaterialfv,(GLenum face, GLenum pname, const GLfloat *params)) -SDL_PROC_UNUSED(void,glMateriali,(GLenum face, GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glMaterialiv,(GLenum face, GLenum pname, const GLint *params)) -SDL_PROC(void,glMatrixMode,(GLenum mode)) -SDL_PROC_UNUSED(void,glMultMatrixd,(const GLdouble *m)) -SDL_PROC_UNUSED(void,glMultMatrixf,(const GLfloat *m)) -SDL_PROC_UNUSED(void,glNewList,(GLuint list, GLenum mode)) -SDL_PROC_UNUSED(void,glNormal3b,(GLbyte nx, GLbyte ny, GLbyte nz)) -SDL_PROC_UNUSED(void,glNormal3bv,(const GLbyte *v)) -SDL_PROC_UNUSED(void,glNormal3d,(GLdouble nx, GLdouble ny, GLdouble nz)) -SDL_PROC_UNUSED(void,glNormal3dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glNormal3f,(GLfloat nx, GLfloat ny, GLfloat nz)) -SDL_PROC_UNUSED(void,glNormal3fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glNormal3i,(GLint nx, GLint ny, GLint nz)) -SDL_PROC_UNUSED(void,glNormal3iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glNormal3s,(GLshort nx, GLshort ny, GLshort nz)) -SDL_PROC_UNUSED(void,glNormal3sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glNormalPointer,(GLenum type, GLsizei stride, const GLvoid *pointer)) -SDL_PROC(void,glOrtho,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) -SDL_PROC_UNUSED(void,glPassThrough,(GLfloat token)) -SDL_PROC_UNUSED(void,glPixelMapfv,(GLenum map, GLsizei mapsize, const GLfloat *values)) -SDL_PROC_UNUSED(void,glPixelMapuiv,(GLenum map, GLsizei mapsize, const GLuint *values)) -SDL_PROC_UNUSED(void,glPixelMapusv,(GLenum map, GLsizei mapsize, const GLushort *values)) -SDL_PROC_UNUSED(void,glPixelStoref,(GLenum pname, GLfloat param)) -SDL_PROC(void,glPixelStorei,(GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glPixelTransferf,(GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glPixelTransferi,(GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glPixelZoom,(GLfloat xfactor, GLfloat yfactor)) -SDL_PROC_UNUSED(void,glPointSize,(GLfloat size)) -SDL_PROC_UNUSED(void,glPolygonMode,(GLenum face, GLenum mode)) -SDL_PROC_UNUSED(void,glPolygonOffset,(GLfloat factor, GLfloat units)) -SDL_PROC_UNUSED(void,glPolygonStipple,(const GLubyte *mask)) -SDL_PROC(void,glPopAttrib,(void)) -SDL_PROC(void,glPopClientAttrib,(void)) -SDL_PROC(void,glPopMatrix,(void)) -SDL_PROC_UNUSED(void,glPopName,(void)) -SDL_PROC_UNUSED(void,glPrioritizeTextures,(GLsizei n, const GLuint *textures, const GLclampf *priorities)) -SDL_PROC(void,glPushAttrib,(GLbitfield mask)) -SDL_PROC(void,glPushClientAttrib,(GLbitfield mask)) -SDL_PROC(void,glPushMatrix,(void)) -SDL_PROC_UNUSED(void,glPushName,(GLuint name)) -SDL_PROC_UNUSED(void,glRasterPos2d,(GLdouble x, GLdouble y)) -SDL_PROC_UNUSED(void,glRasterPos2dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glRasterPos2f,(GLfloat x, GLfloat y)) -SDL_PROC_UNUSED(void,glRasterPos2fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glRasterPos2i,(GLint x, GLint y)) -SDL_PROC_UNUSED(void,glRasterPos2iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glRasterPos2s,(GLshort x, GLshort y)) -SDL_PROC_UNUSED(void,glRasterPos2sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glRasterPos3d,(GLdouble x, GLdouble y, GLdouble z)) -SDL_PROC_UNUSED(void,glRasterPos3dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glRasterPos3f,(GLfloat x, GLfloat y, GLfloat z)) -SDL_PROC_UNUSED(void,glRasterPos3fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glRasterPos3i,(GLint x, GLint y, GLint z)) -SDL_PROC_UNUSED(void,glRasterPos3iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glRasterPos3s,(GLshort x, GLshort y, GLshort z)) -SDL_PROC_UNUSED(void,glRasterPos3sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glRasterPos4d,(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) -SDL_PROC_UNUSED(void,glRasterPos4dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glRasterPos4f,(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) -SDL_PROC_UNUSED(void,glRasterPos4fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glRasterPos4i,(GLint x, GLint y, GLint z, GLint w)) -SDL_PROC_UNUSED(void,glRasterPos4iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glRasterPos4s,(GLshort x, GLshort y, GLshort z, GLshort w)) -SDL_PROC_UNUSED(void,glRasterPos4sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glReadBuffer,(GLenum mode)) -SDL_PROC_UNUSED(void,glReadPixels,(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)) -SDL_PROC_UNUSED(void,glRectd,(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)) -SDL_PROC_UNUSED(void,glRectdv,(const GLdouble *v1, const GLdouble *v2)) -SDL_PROC_UNUSED(void,glRectf,(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)) -SDL_PROC_UNUSED(void,glRectfv,(const GLfloat *v1, const GLfloat *v2)) -SDL_PROC_UNUSED(void,glRecti,(GLint x1, GLint y1, GLint x2, GLint y2)) -SDL_PROC_UNUSED(void,glRectiv,(const GLint *v1, const GLint *v2)) -SDL_PROC_UNUSED(void,glRects,(GLshort x1, GLshort y1, GLshort x2, GLshort y2)) -SDL_PROC_UNUSED(void,glRectsv,(const GLshort *v1, const GLshort *v2)) -SDL_PROC_UNUSED(GLint,glRenderMode,(GLenum mode)) -SDL_PROC_UNUSED(void,glRotated,(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)) -SDL_PROC_UNUSED(void,glRotatef,(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) -SDL_PROC_UNUSED(void,glScaled,(GLdouble x, GLdouble y, GLdouble z)) -SDL_PROC_UNUSED(void,glScalef,(GLfloat x, GLfloat y, GLfloat z)) -SDL_PROC_UNUSED(void,glScissor,(GLint x, GLint y, GLsizei width, GLsizei height)) -SDL_PROC_UNUSED(void,glSelectBuffer,(GLsizei size, GLuint *buffer)) -SDL_PROC_UNUSED(void,glShadeModel,(GLenum mode)) -SDL_PROC_UNUSED(void,glStencilFunc,(GLenum func, GLint ref, GLuint mask)) -SDL_PROC_UNUSED(void,glStencilMask,(GLuint mask)) -SDL_PROC_UNUSED(void,glStencilOp,(GLenum fail, GLenum zfail, GLenum zpass)) -SDL_PROC_UNUSED(void,glTexCoord1d,(GLdouble s)) -SDL_PROC_UNUSED(void,glTexCoord1dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glTexCoord1f,(GLfloat s)) -SDL_PROC_UNUSED(void,glTexCoord1fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glTexCoord1i,(GLint s)) -SDL_PROC_UNUSED(void,glTexCoord1iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glTexCoord1s,(GLshort s)) -SDL_PROC_UNUSED(void,glTexCoord1sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glTexCoord2d,(GLdouble s, GLdouble t)) -SDL_PROC_UNUSED(void,glTexCoord2dv,(const GLdouble *v)) -SDL_PROC(void,glTexCoord2f,(GLfloat s, GLfloat t)) -SDL_PROC_UNUSED(void,glTexCoord2fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glTexCoord2i,(GLint s, GLint t)) -SDL_PROC_UNUSED(void,glTexCoord2iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glTexCoord2s,(GLshort s, GLshort t)) -SDL_PROC_UNUSED(void,glTexCoord2sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glTexCoord3d,(GLdouble s, GLdouble t, GLdouble r)) -SDL_PROC_UNUSED(void,glTexCoord3dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glTexCoord3f,(GLfloat s, GLfloat t, GLfloat r)) -SDL_PROC_UNUSED(void,glTexCoord3fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glTexCoord3i,(GLint s, GLint t, GLint r)) -SDL_PROC_UNUSED(void,glTexCoord3iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glTexCoord3s,(GLshort s, GLshort t, GLshort r)) -SDL_PROC_UNUSED(void,glTexCoord3sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glTexCoord4d,(GLdouble s, GLdouble t, GLdouble r, GLdouble q)) -SDL_PROC_UNUSED(void,glTexCoord4dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glTexCoord4f,(GLfloat s, GLfloat t, GLfloat r, GLfloat q)) -SDL_PROC_UNUSED(void,glTexCoord4fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glTexCoord4i,(GLint s, GLint t, GLint r, GLint q)) -SDL_PROC_UNUSED(void,glTexCoord4iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glTexCoord4s,(GLshort s, GLshort t, GLshort r, GLshort q)) -SDL_PROC_UNUSED(void,glTexCoord4sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glTexCoordPointer,(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) -SDL_PROC(void,glTexEnvf,(GLenum target, GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glTexEnvfv,(GLenum target, GLenum pname, const GLfloat *params)) -SDL_PROC_UNUSED(void,glTexEnvi,(GLenum target, GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glTexEnviv,(GLenum target, GLenum pname, const GLint *params)) -SDL_PROC_UNUSED(void,glTexGend,(GLenum coord, GLenum pname, GLdouble param)) -SDL_PROC_UNUSED(void,glTexGendv,(GLenum coord, GLenum pname, const GLdouble *params)) -SDL_PROC_UNUSED(void,glTexGenf,(GLenum coord, GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glTexGenfv,(GLenum coord, GLenum pname, const GLfloat *params)) -SDL_PROC_UNUSED(void,glTexGeni,(GLenum coord, GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glTexGeniv,(GLenum coord, GLenum pname, const GLint *params)) -SDL_PROC_UNUSED(void,glTexImage1D,(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) -SDL_PROC(void,glTexImage2D,(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)) -SDL_PROC_UNUSED(void,glTexParameterf,(GLenum target, GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void,glTexParameterfv,(GLenum target, GLenum pname, const GLfloat *params)) -SDL_PROC(void,glTexParameteri,(GLenum target, GLenum pname, GLint param)) -SDL_PROC_UNUSED(void,glTexParameteriv,(GLenum target, GLenum pname, const GLint *params)) -SDL_PROC_UNUSED(void,glTexSubImage1D,(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)) -SDL_PROC(void,glTexSubImage2D,(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)) -SDL_PROC_UNUSED(void,glTranslated,(GLdouble x, GLdouble y, GLdouble z)) -SDL_PROC_UNUSED(void,glTranslatef,(GLfloat x, GLfloat y, GLfloat z)) -SDL_PROC_UNUSED(void,glVertex2d,(GLdouble x, GLdouble y)) -SDL_PROC_UNUSED(void,glVertex2dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glVertex2f,(GLfloat x, GLfloat y)) -SDL_PROC_UNUSED(void,glVertex2fv,(const GLfloat *v)) -SDL_PROC(void,glVertex2i,(GLint x, GLint y)) -SDL_PROC_UNUSED(void,glVertex2iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glVertex2s,(GLshort x, GLshort y)) -SDL_PROC_UNUSED(void,glVertex2sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glVertex3d,(GLdouble x, GLdouble y, GLdouble z)) -SDL_PROC_UNUSED(void,glVertex3dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glVertex3f,(GLfloat x, GLfloat y, GLfloat z)) -SDL_PROC_UNUSED(void,glVertex3fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glVertex3i,(GLint x, GLint y, GLint z)) -SDL_PROC_UNUSED(void,glVertex3iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glVertex3s,(GLshort x, GLshort y, GLshort z)) -SDL_PROC_UNUSED(void,glVertex3sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glVertex4d,(GLdouble x, GLdouble y, GLdouble z, GLdouble w)) -SDL_PROC_UNUSED(void,glVertex4dv,(const GLdouble *v)) -SDL_PROC_UNUSED(void,glVertex4f,(GLfloat x, GLfloat y, GLfloat z, GLfloat w)) -SDL_PROC_UNUSED(void,glVertex4fv,(const GLfloat *v)) -SDL_PROC_UNUSED(void,glVertex4i,(GLint x, GLint y, GLint z, GLint w)) -SDL_PROC_UNUSED(void,glVertex4iv,(const GLint *v)) -SDL_PROC_UNUSED(void,glVertex4s,(GLshort x, GLshort y, GLshort z, GLshort w)) -SDL_PROC_UNUSED(void,glVertex4sv,(const GLshort *v)) -SDL_PROC_UNUSED(void,glVertexPointer,(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)) -SDL_PROC(void,glViewport,(GLint x, GLint y, GLsizei width, GLsizei height)) diff --git a/src/video/SDL_leaks.h b/src/video/SDL_leaks.h deleted file mode 100644 index 74495c63fe..0000000000 --- a/src/video/SDL_leaks.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Define this if you want surface leak detection code enabled */ -/*#define CHECK_LEAKS*/ - -/* Global variables used to check leaks in code using SDL */ - -#ifdef CHECK_LEAKS -extern int surfaces_allocated; -#endif diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 1a7fd518f1..c472c38b5e 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -30,597 +29,1103 @@ #include "SDL_pixels_c.h" #include "SDL_RLEaccel_c.h" + +/* Lookup tables to expand partial bytes to the full 0..255 range */ + +static Uint8 lookup_0[] = { +0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 +}; + +static Uint8 lookup_1[] = { +0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 +}; + +static Uint8 lookup_2[] = { +0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 +}; + +static Uint8 lookup_3[] = { +0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 +}; + +static Uint8 lookup_4[] = { +0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 +}; + +static Uint8 lookup_5[] = { +0, 36, 72, 109, 145, 182, 218, 255 +}; + +static Uint8 lookup_6[] = { +0, 85, 170, 255 +}; + +static Uint8 lookup_7[] = { +0, 255 +}; + +static Uint8 lookup_8[] = { +255 +}; + +Uint8* SDL_expand_byte[9] = { + lookup_0, + lookup_1, + lookup_2, + lookup_3, + lookup_4, + lookup_5, + lookup_6, + lookup_7, + lookup_8 +}; + /* Helper functions */ -/* - * Allocate a pixel format structure and fill it according to the given info. - */ -SDL_PixelFormat *SDL_AllocFormat(int bpp, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) + +const char* +SDL_GetPixelFormatName(Uint32 format) { - SDL_PixelFormat *format; - Uint32 mask; - - /* Allocate an empty pixel format structure */ - format = SDL_malloc(sizeof(*format)); - if ( format == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - SDL_memset(format, 0, sizeof(*format)); - format->alpha = SDL_ALPHA_OPAQUE; - - /* Set up the format */ - format->BitsPerPixel = bpp; - format->BytesPerPixel = (bpp+7)/8; - if ( Rmask || Bmask || Gmask ) { /* Packed pixels with custom mask */ - format->palette = NULL; - format->Rshift = 0; - format->Rloss = 8; - if ( Rmask ) { - for ( mask = Rmask; !(mask&0x01); mask >>= 1 ) - ++format->Rshift; - for ( ; (mask&0x01); mask >>= 1 ) - --format->Rloss; - } - format->Gshift = 0; - format->Gloss = 8; - if ( Gmask ) { - for ( mask = Gmask; !(mask&0x01); mask >>= 1 ) - ++format->Gshift; - for ( ; (mask&0x01); mask >>= 1 ) - --format->Gloss; - } - format->Bshift = 0; - format->Bloss = 8; - if ( Bmask ) { - for ( mask = Bmask; !(mask&0x01); mask >>= 1 ) - ++format->Bshift; - for ( ; (mask&0x01); mask >>= 1 ) - --format->Bloss; - } - format->Ashift = 0; - format->Aloss = 8; - if ( Amask ) { - for ( mask = Amask; !(mask&0x01); mask >>= 1 ) - ++format->Ashift; - for ( ; (mask&0x01); mask >>= 1 ) - --format->Aloss; - } - format->Rmask = Rmask; - format->Gmask = Gmask; - format->Bmask = Bmask; - format->Amask = Amask; - } else if ( bpp > 8 ) { /* Packed pixels with standard mask */ - /* R-G-B */ - if ( bpp > 24 ) - bpp = 24; - format->Rloss = 8-(bpp/3); - format->Gloss = 8-(bpp/3)-(bpp%3); - format->Bloss = 8-(bpp/3); - format->Rshift = ((bpp/3)+(bpp%3))+(bpp/3); - format->Gshift = (bpp/3); - format->Bshift = 0; - format->Rmask = ((0xFF>>format->Rloss)<Rshift); - format->Gmask = ((0xFF>>format->Gloss)<Gshift); - format->Bmask = ((0xFF>>format->Bloss)<Bshift); - } else { - /* Palettized formats have no mask info */ - format->Rloss = 8; - format->Gloss = 8; - format->Bloss = 8; - format->Aloss = 8; - format->Rshift = 0; - format->Gshift = 0; - format->Bshift = 0; - format->Ashift = 0; - format->Rmask = 0; - format->Gmask = 0; - format->Bmask = 0; - format->Amask = 0; - } - if ( bpp <= 8 ) { /* Palettized mode */ - int ncolors = 1<palette = (SDL_Palette *)SDL_malloc(sizeof(SDL_Palette)); - if ( format->palette == NULL ) { - SDL_FreeFormat(format); - SDL_OutOfMemory(); - return(NULL); - } - (format->palette)->ncolors = ncolors; - (format->palette)->colors = (SDL_Color *)SDL_malloc( - (format->palette)->ncolors*sizeof(SDL_Color)); - if ( (format->palette)->colors == NULL ) { - SDL_FreeFormat(format); - SDL_OutOfMemory(); - return(NULL); - } - if ( Rmask || Bmask || Gmask ) { - /* create palette according to masks */ - int i; - int Rm=0,Gm=0,Bm=0; - int Rw=0,Gw=0,Bw=0; -#ifdef ENABLE_PALETTE_ALPHA - int Am=0,Aw=0; -#endif - if(Rmask) - { - Rw=8-format->Rloss; - for(i=format->Rloss;i>0;i-=Rw) - Rm|=1<Gloss; - for(i=format->Gloss;i>0;i-=Gw) - Gm|=1<Bloss; - for(i=format->Bloss;i>0;i-=Bw) - Bm|=1<Aloss; - for(i=format->Aloss;i>0;i-=Aw) - Am|=1<>format->Rshift; - r=(r<Rloss)|((r*Rm)>>Rw); - format->palette->colors[i].r=r; - - g=(i&Gmask)>>format->Gshift; - g=(g<Gloss)|((g*Gm)>>Gw); - format->palette->colors[i].g=g; - - b=(i&Bmask)>>format->Bshift; - b=(b<Bloss)|((b*Bm)>>Bw); - format->palette->colors[i].b=b; - -#ifdef ENABLE_PALETTE_ALPHA - a=(i&Amask)>>format->Ashift; - a=(a<Aloss)|((a*Am)>>Aw); - format->palette->colors[i].unused=a; + case 0x000000FF: +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + return SDL_PIXELFORMAT_BGR24; #else - format->palette->colors[i].unused=0; + return SDL_PIXELFORMAT_RGB24; #endif - } - } else if ( ncolors == 2 ) { - /* Create a black and white bitmap palette */ - format->palette->colors[0].r = 0xFF; - format->palette->colors[0].g = 0xFF; - format->palette->colors[0].b = 0xFF; - format->palette->colors[1].r = 0x00; - format->palette->colors[1].g = 0x00; - format->palette->colors[1].b = 0x00; - } else { - /* Create an empty palette */ - SDL_memset((format->palette)->colors, 0, - (format->palette)->ncolors*sizeof(SDL_Color)); - } - } - return(format); + } + case 32: + if (Rmask == 0) { + return SDL_PIXELFORMAT_RGB888; + } + if (Rmask == 0x00FF0000 && + Gmask == 0x0000FF00 && + Bmask == 0x000000FF && + Amask == 0x00000000) { + return SDL_PIXELFORMAT_RGB888; + } + if (Rmask == 0xFF000000 && + Gmask == 0x00FF0000 && + Bmask == 0x0000FF00 && + Amask == 0x00000000) { + return SDL_PIXELFORMAT_RGBX8888; + } + if (Rmask == 0x000000FF && + Gmask == 0x0000FF00 && + Bmask == 0x00FF0000 && + Amask == 0x00000000) { + return SDL_PIXELFORMAT_BGR888; + } + if (Rmask == 0x0000FF00 && + Gmask == 0x00FF0000 && + Bmask == 0xFF000000 && + Amask == 0x00000000) { + return SDL_PIXELFORMAT_BGRX8888; + } + if (Rmask == 0x00FF0000 && + Gmask == 0x0000FF00 && + Bmask == 0x000000FF && + Amask == 0xFF000000) { + return SDL_PIXELFORMAT_ARGB8888; + } + if (Rmask == 0xFF000000 && + Gmask == 0x00FF0000 && + Bmask == 0x0000FF00 && + Amask == 0x000000FF) { + return SDL_PIXELFORMAT_RGBA8888; + } + if (Rmask == 0x000000FF && + Gmask == 0x0000FF00 && + Bmask == 0x00FF0000 && + Amask == 0xFF000000) { + return SDL_PIXELFORMAT_ABGR8888; + } + if (Rmask == 0x0000FF00 && + Gmask == 0x00FF0000 && + Bmask == 0xFF000000 && + Amask == 0x000000FF) { + return SDL_PIXELFORMAT_BGRA8888; + } + if (Rmask == 0x3FF00000 && + Gmask == 0x000FFC00 && + Bmask == 0x000003FF && + Amask == 0xC0000000) { + return SDL_PIXELFORMAT_ARGB2101010; + } + } + return SDL_PIXELFORMAT_UNKNOWN; } -SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) + +static SDL_PixelFormat *formats; + +SDL_PixelFormat * +SDL_AllocFormat(Uint32 pixel_format) { - if ( surface->format ) { - SDL_FreeFormat(surface->format); - SDL_FormatChanged(surface); - } - surface->format = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask); - return surface->format; + SDL_PixelFormat *format; + + /* Look it up in our list of previously allocated formats */ + for (format = formats; format; format = format->next) { + if (pixel_format == format->format) { + ++format->refcount; + return format; + } + } + + /* Allocate an empty pixel format structure, and initialize it */ + format = SDL_malloc(sizeof(*format)); + if (format == NULL) { + SDL_OutOfMemory(); + return NULL; + } + if (SDL_InitFormat(format, pixel_format) < 0) { + SDL_free(format); + SDL_InvalidParamError("format"); + return NULL; + } + + if (!SDL_ISPIXELFORMAT_INDEXED(pixel_format)) { + /* Cache the RGB formats */ + format->next = formats; + formats = format; + } + return format; } -/* - * Change any previous mappings from/to the new surface format - */ -void SDL_FormatChanged(SDL_Surface *surface) +int +SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format) { - static int format_version = 0; - ++format_version; - if ( format_version < 0 ) { /* It wrapped... */ - format_version = 1; - } - surface->format_version = format_version; - SDL_InvalidateMap(surface->map); + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + Uint32 mask; + + if (!SDL_PixelFormatEnumToMasks(pixel_format, &bpp, + &Rmask, &Gmask, &Bmask, &Amask)) { + return -1; + } + + /* Set up the format */ + SDL_zerop(format); + format->format = pixel_format; + format->BitsPerPixel = bpp; + format->BytesPerPixel = (bpp + 7) / 8; + + format->Rmask = Rmask; + format->Rshift = 0; + format->Rloss = 8; + if (Rmask) { + for (mask = Rmask; !(mask & 0x01); mask >>= 1) + ++format->Rshift; + for (; (mask & 0x01); mask >>= 1) + --format->Rloss; + } + + format->Gmask = Gmask; + format->Gshift = 0; + format->Gloss = 8; + if (Gmask) { + for (mask = Gmask; !(mask & 0x01); mask >>= 1) + ++format->Gshift; + for (; (mask & 0x01); mask >>= 1) + --format->Gloss; + } + + format->Bmask = Bmask; + format->Bshift = 0; + format->Bloss = 8; + if (Bmask) { + for (mask = Bmask; !(mask & 0x01); mask >>= 1) + ++format->Bshift; + for (; (mask & 0x01); mask >>= 1) + --format->Bloss; + } + + format->Amask = Amask; + format->Ashift = 0; + format->Aloss = 8; + if (Amask) { + for (mask = Amask; !(mask & 0x01); mask >>= 1) + ++format->Ashift; + for (; (mask & 0x01); mask >>= 1) + --format->Aloss; + } + + format->palette = NULL; + format->refcount = 1; + format->next = NULL; + + return 0; } -/* - * Free a previously allocated format structure - */ -void SDL_FreeFormat(SDL_PixelFormat *format) + +void +SDL_FreeFormat(SDL_PixelFormat *format) +{ + SDL_PixelFormat *prev; + + if (!format) { + SDL_InvalidParamError("format"); + return; + } + if (--format->refcount > 0) { + return; + } + + /* Remove this format from our list */ + if (format == formats) { + formats = format->next; + } else if (formats) { + for (prev = formats; prev->next; prev = prev->next) { + if (prev->next == format) { + prev->next = format->next; + break; + } + } + } + + if (format->palette) { + SDL_FreePalette(format->palette); + } + SDL_free(format); +} + +SDL_Palette * +SDL_AllocPalette(int ncolors) { - if ( format ) { - if ( format->palette ) { - if ( format->palette->colors ) { - SDL_free(format->palette->colors); - } - SDL_free(format->palette); - } - SDL_free(format); - } + SDL_Palette *palette; + + /* Input validation */ + if (ncolors < 1) { + SDL_InvalidParamError("ncolors"); + return NULL; + } + + palette = (SDL_Palette *) SDL_malloc(sizeof(*palette)); + if (!palette) { + SDL_OutOfMemory(); + return NULL; + } + palette->colors = + (SDL_Color *) SDL_malloc(ncolors * sizeof(*palette->colors)); + if (!palette->colors) { + SDL_free(palette); + return NULL; + } + palette->ncolors = ncolors; + palette->version = 1; + palette->refcount = 1; + + SDL_memset(palette->colors, 0xFF, ncolors * sizeof(*palette->colors)); + + return palette; +} + +int +SDL_SetPixelFormatPalette(SDL_PixelFormat * format, SDL_Palette *palette) +{ + if (!format) { + return SDL_SetError("SDL_SetPixelFormatPalette() passed NULL format"); + } + + if (palette && palette->ncolors != (1 << format->BitsPerPixel)) { + return SDL_SetError("SDL_SetPixelFormatPalette() passed a palette that doesn't match the format"); + } + + if (format->palette == palette) { + return 0; + } + + if (format->palette) { + SDL_FreePalette(format->palette); + } + + format->palette = palette; + + if (format->palette) { + ++format->palette->refcount; + } + + return 0; +} + +int +SDL_SetPaletteColors(SDL_Palette * palette, const SDL_Color * colors, + int firstcolor, int ncolors) +{ + int status = 0; + + /* Verify the parameters */ + if (!palette) { + return -1; + } + if (ncolors > (palette->ncolors - firstcolor)) { + ncolors = (palette->ncolors - firstcolor); + status = -1; + } + + if (colors != (palette->colors + firstcolor)) { + SDL_memcpy(palette->colors + firstcolor, colors, + ncolors * sizeof(*colors)); + } + ++palette->version; + if (!palette->version) { + palette->version = 1; + } + + return status; } + +void +SDL_FreePalette(SDL_Palette * palette) +{ + if (!palette) { + SDL_InvalidParamError("palette"); + return; + } + if (--palette->refcount > 0) { + return; + } + if (palette->colors) { + SDL_free(palette->colors); + } + SDL_free(palette); +} + /* * Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors */ -void SDL_DitherColors(SDL_Color *colors, int bpp) +void +SDL_DitherColors(SDL_Color * colors, int bpp) { - int i; - if(bpp != 8) - return; /* only 8bpp supported right now */ - - for(i = 0; i < 256; i++) { - int r, g, b; - /* map each bit field to the full [0, 255] interval, - so 0 is mapped to (0, 0, 0) and 255 to (255, 255, 255) */ - r = i & 0xe0; - r |= r >> 3 | r >> 6; - colors[i].r = r; - g = (i << 3) & 0xe0; - g |= g >> 3 | g >> 6; - colors[i].g = g; - b = i & 0x3; - b |= b << 2; - b |= b << 4; - colors[i].b = b; - } + int i; + if (bpp != 8) + return; /* only 8bpp supported right now */ + + for (i = 0; i < 256; i++) { + int r, g, b; + /* map each bit field to the full [0, 255] interval, + so 0 is mapped to (0, 0, 0) and 255 to (255, 255, 255) */ + r = i & 0xe0; + r |= r >> 3 | r >> 6; + colors[i].r = r; + g = (i << 3) & 0xe0; + g |= g >> 3 | g >> 6; + colors[i].g = g; + b = i & 0x3; + b |= b << 2; + b |= b << 4; + colors[i].b = b; + colors[i].a = SDL_ALPHA_OPAQUE; + } } -/* + +/* * Calculate the pad-aligned scanline width of a surface */ -Uint16 SDL_CalculatePitch(SDL_Surface *surface) +int +SDL_CalculatePitch(SDL_Surface * surface) { - Uint16 pitch; - - /* Surface should be 4-byte aligned for speed */ - pitch = surface->w*surface->format->BytesPerPixel; - switch (surface->format->BitsPerPixel) { - case 1: - pitch = (pitch+7)/8; - break; - case 4: - pitch = (pitch+1)/2; - break; - default: - break; - } - pitch = (pitch + 3) & ~3; /* 4-byte aligning */ - return(pitch); + int pitch; + + /* Surface should be 4-byte aligned for speed */ + pitch = surface->w * surface->format->BytesPerPixel; + switch (surface->format->BitsPerPixel) { + case 1: + pitch = (pitch + 7) / 8; + break; + case 4: + pitch = (pitch + 1) / 2; + break; + default: + break; + } + pitch = (pitch + 3) & ~3; /* 4-byte aligning */ + return (pitch); } + /* * Match an RGB value to a particular palette index */ -Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b) +Uint8 +SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - /* Do colorspace distance matching */ - unsigned int smallest; - unsigned int distance; - int rd, gd, bd; - int i; - Uint8 pixel=0; - - smallest = ~0; - for ( i=0; incolors; ++i ) { - rd = pal->colors[i].r - r; - gd = pal->colors[i].g - g; - bd = pal->colors[i].b - b; - distance = (rd*rd)+(gd*gd)+(bd*bd); - if ( distance < smallest ) { - pixel = i; - if ( distance == 0 ) { /* Perfect match! */ - break; - } - smallest = distance; - } - } - return(pixel); + /* Do colorspace distance matching */ + unsigned int smallest; + unsigned int distance; + int rd, gd, bd, ad; + int i; + Uint8 pixel = 0; + + smallest = ~0; + for (i = 0; i < pal->ncolors; ++i) { + rd = pal->colors[i].r - r; + gd = pal->colors[i].g - g; + bd = pal->colors[i].b - b; + ad = pal->colors[i].a - a; + distance = (rd * rd) + (gd * gd) + (bd * bd) + (ad * ad); + if (distance < smallest) { + pixel = i; + if (distance == 0) { /* Perfect match! */ + break; + } + smallest = distance; + } + } + return (pixel); } /* Find the opaque pixel value corresponding to an RGB triple */ -Uint32 SDL_MapRGB -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b) +Uint32 +SDL_MapRGB(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b) { - if ( format->palette == NULL ) { - return (r >> format->Rloss) << format->Rshift - | (g >> format->Gloss) << format->Gshift - | (b >> format->Bloss) << format->Bshift - | format->Amask; - } else { - return SDL_FindColor(format->palette, r, g, b); - } + if (format->palette == NULL) { + return (r >> format->Rloss) << format->Rshift + | (g >> format->Gloss) << format->Gshift + | (b >> format->Bloss) << format->Bshift | format->Amask; + } else { + return SDL_FindColor(format->palette, r, g, b, SDL_ALPHA_OPAQUE); + } } /* Find the pixel value corresponding to an RGBA quadruple */ -Uint32 SDL_MapRGBA -(const SDL_PixelFormat * const format, - const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) +Uint32 +SDL_MapRGBA(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b, + Uint8 a) { - if ( format->palette == NULL ) { - return (r >> format->Rloss) << format->Rshift - | (g >> format->Gloss) << format->Gshift - | (b >> format->Bloss) << format->Bshift - | ((a >> format->Aloss) << format->Ashift & format->Amask); - } else { - return SDL_FindColor(format->palette, r, g, b); - } + if (format->palette == NULL) { + return (r >> format->Rloss) << format->Rshift + | (g >> format->Gloss) << format->Gshift + | (b >> format->Bloss) << format->Bshift + | ((a >> format->Aloss) << format->Ashift & format->Amask); + } else { + return SDL_FindColor(format->palette, r, g, b, a); + } } -void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * const fmt, - Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) +void +SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format, Uint8 * r, Uint8 * g, + Uint8 * b) { - if ( fmt->palette == NULL ) { - /* - * This makes sure that the result is mapped to the - * interval [0..255], and the maximum value for each - * component is 255. This is important to make sure - * that white is indeed reported as (255, 255, 255), - * and that opaque alpha is 255. - * This only works for RGB bit fields at least 4 bit - * wide, which is almost always the case. - */ - unsigned v; - v = (pixel & fmt->Rmask) >> fmt->Rshift; - *r = (v << fmt->Rloss) + (v >> (8 - (fmt->Rloss << 1))); - v = (pixel & fmt->Gmask) >> fmt->Gshift; - *g = (v << fmt->Gloss) + (v >> (8 - (fmt->Gloss << 1))); - v = (pixel & fmt->Bmask) >> fmt->Bshift; - *b = (v << fmt->Bloss) + (v >> (8 - (fmt->Bloss << 1))); - if(fmt->Amask) { - v = (pixel & fmt->Amask) >> fmt->Ashift; - *a = (v << fmt->Aloss) + (v >> (8 - (fmt->Aloss << 1))); - } else { - *a = SDL_ALPHA_OPAQUE; - } - } else { - *r = fmt->palette->colors[pixel].r; - *g = fmt->palette->colors[pixel].g; - *b = fmt->palette->colors[pixel].b; - *a = SDL_ALPHA_OPAQUE; - } + if (format->palette == NULL) { + unsigned v; + v = (pixel & format->Rmask) >> format->Rshift; + *r = SDL_expand_byte[format->Rloss][v]; + v = (pixel & format->Gmask) >> format->Gshift; + *g = SDL_expand_byte[format->Gloss][v]; + v = (pixel & format->Bmask) >> format->Bshift; + *b = SDL_expand_byte[format->Bloss][v]; + } else { + if (pixel < (unsigned)format->palette->ncolors) { + *r = format->palette->colors[pixel].r; + *g = format->palette->colors[pixel].g; + *b = format->palette->colors[pixel].b; + } else { + *r = *g = *b = 0; + } + } } -void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * const fmt, - Uint8 *r,Uint8 *g,Uint8 *b) +void +SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) { - if ( fmt->palette == NULL ) { - /* the note for SDL_GetRGBA above applies here too */ - unsigned v; - v = (pixel & fmt->Rmask) >> fmt->Rshift; - *r = (v << fmt->Rloss) + (v >> (8 - (fmt->Rloss << 1))); - v = (pixel & fmt->Gmask) >> fmt->Gshift; - *g = (v << fmt->Gloss) + (v >> (8 - (fmt->Gloss << 1))); - v = (pixel & fmt->Bmask) >> fmt->Bshift; - *b = (v << fmt->Bloss) + (v >> (8 - (fmt->Bloss << 1))); - } else { - *r = fmt->palette->colors[pixel].r; - *g = fmt->palette->colors[pixel].g; - *b = fmt->palette->colors[pixel].b; - } + if (format->palette == NULL) { + unsigned v; + v = (pixel & format->Rmask) >> format->Rshift; + *r = SDL_expand_byte[format->Rloss][v]; + v = (pixel & format->Gmask) >> format->Gshift; + *g = SDL_expand_byte[format->Gloss][v]; + v = (pixel & format->Bmask) >> format->Bshift; + *b = SDL_expand_byte[format->Bloss][v]; + v = (pixel & format->Amask) >> format->Ashift; + *a = SDL_expand_byte[format->Aloss][v]; + } else { + if (pixel < (unsigned)format->palette->ncolors) { + *r = format->palette->colors[pixel].r; + *g = format->palette->colors[pixel].g; + *b = format->palette->colors[pixel].b; + *a = format->palette->colors[pixel].a; + } else { + *r = *g = *b = *a = 0; + } + } } -/* Apply gamma to a set of colors - this is easy. :) */ -void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output, - int ncolors) +/* Map from Palette to Palette */ +static Uint8 * +Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical) { - int i; + Uint8 *map; + int i; - for ( i=0; i> 8; - output[i].g = gamma[1*256 + colors[i].g] >> 8; - output[i].b = gamma[2*256 + colors[i].b] >> 8; - } + if (identical) { + if (src->ncolors <= dst->ncolors) { + /* If an identical palette, no need to map */ + if (src == dst + || + (SDL_memcmp + (src->colors, dst->colors, + src->ncolors * sizeof(SDL_Color)) == 0)) { + *identical = 1; + return (NULL); + } + } + *identical = 0; + } + map = (Uint8 *) SDL_malloc(src->ncolors); + if (map == NULL) { + SDL_OutOfMemory(); + return (NULL); + } + for (i = 0; i < src->ncolors; ++i) { + map[i] = SDL_FindColor(dst, + src->colors[i].r, src->colors[i].g, + src->colors[i].b, src->colors[i].a); + } + return (map); } -/* Map from Palette to Palette */ -static Uint8 *Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical) -{ - Uint8 *map; - int i; - - if ( identical ) { - if ( src->ncolors <= dst->ncolors ) { - /* If an identical palette, no need to map */ - if ( SDL_memcmp(src->colors, dst->colors, src->ncolors* - sizeof(SDL_Color)) == 0 ) { - *identical = 1; - return(NULL); - } - } - *identical = 0; - } - map = (Uint8 *)SDL_malloc(src->ncolors); - if ( map == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - for ( i=0; incolors; ++i ) { - map[i] = SDL_FindColor(dst, - src->colors[i].r, src->colors[i].g, src->colors[i].b); - } - return(map); -} /* Map from Palette to BitField */ -static Uint8 *Map1toN(SDL_PixelFormat *src, SDL_PixelFormat *dst) +static Uint8 * +Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, + SDL_PixelFormat * dst) { - Uint8 *map; - int i; - int bpp; - unsigned alpha; - SDL_Palette *pal = src->palette; - - bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel); - map = (Uint8 *)SDL_malloc(pal->ncolors*bpp); - if ( map == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - - alpha = dst->Amask ? src->alpha : 0; - /* We memory copy to the pixel map so the endianness is preserved */ - for ( i=0; incolors; ++i ) { - ASSEMBLE_RGBA(&map[i*bpp], dst->BytesPerPixel, dst, - pal->colors[i].r, pal->colors[i].g, - pal->colors[i].b, alpha); - } - return(map); + Uint8 *map; + int i; + int bpp; + SDL_Palette *pal = src->palette; + + bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel); + map = (Uint8 *) SDL_malloc(pal->ncolors * bpp); + if (map == NULL) { + SDL_OutOfMemory(); + return (NULL); + } + + /* We memory copy to the pixel map so the endianness is preserved */ + for (i = 0; i < pal->ncolors; ++i) { + Uint8 R = (Uint8) ((pal->colors[i].r * Rmod) / 255); + Uint8 G = (Uint8) ((pal->colors[i].g * Gmod) / 255); + Uint8 B = (Uint8) ((pal->colors[i].b * Bmod) / 255); + Uint8 A = (Uint8) ((pal->colors[i].a * Amod) / 255); + ASSEMBLE_RGBA(&map[i * bpp], dst->BytesPerPixel, dst, R, G, B, A); + } + return (map); } + /* Map from BitField to Dithered-Palette to Palette */ -static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical) +static Uint8 * +MapNto1(SDL_PixelFormat * src, SDL_PixelFormat * dst, int *identical) { - /* Generate a 256 color dither palette */ - SDL_Palette dithered; - SDL_Color colors[256]; - SDL_Palette *pal = dst->palette; - - /* SDL_DitherColors does not initialize the 'unused' component of colors, - but Map1to1 compares it against pal, so we should initialize it. */ - SDL_memset(colors, 0, sizeof(colors)); - - dithered.ncolors = 256; - SDL_DitherColors(colors, 8); - dithered.colors = colors; - return(Map1to1(&dithered, pal, identical)); + /* Generate a 256 color dither palette */ + SDL_Palette dithered; + SDL_Color colors[256]; + SDL_Palette *pal = dst->palette; + + dithered.ncolors = 256; + SDL_DitherColors(colors, 8); + dithered.colors = colors; + return (Map1to1(&dithered, pal, identical)); } -SDL_BlitMap *SDL_AllocBlitMap(void) +SDL_BlitMap * +SDL_AllocBlitMap(void) { - SDL_BlitMap *map; - - /* Allocate the empty map */ - map = (SDL_BlitMap *)SDL_malloc(sizeof(*map)); - if ( map == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - SDL_memset(map, 0, sizeof(*map)); - - /* Allocate the software blit data */ - map->sw_data = (struct private_swaccel *)SDL_malloc(sizeof(*map->sw_data)); - if ( map->sw_data == NULL ) { - SDL_FreeBlitMap(map); - SDL_OutOfMemory(); - return(NULL); - } - SDL_memset(map->sw_data, 0, sizeof(*map->sw_data)); - - /* It's ready to go */ - return(map); + SDL_BlitMap *map; + + /* Allocate the empty map */ + map = (SDL_BlitMap *) SDL_calloc(1, sizeof(*map)); + if (map == NULL) { + SDL_OutOfMemory(); + return (NULL); + } + map->info.r = 0xFF; + map->info.g = 0xFF; + map->info.b = 0xFF; + map->info.a = 0xFF; + + /* It's ready to go */ + return (map); } -void SDL_InvalidateMap(SDL_BlitMap *map) + +void +SDL_InvalidateMap(SDL_BlitMap * map) { - if ( ! map ) { - return; - } - map->dst = NULL; - map->format_version = (unsigned int)-1; - if ( map->table ) { - SDL_free(map->table); - map->table = NULL; - } + if (!map) { + return; + } + if (map->dst) { + /* Release our reference to the surface - see the note below */ + if (--map->dst->refcount <= 0) { + SDL_FreeSurface(map->dst); + } + } + map->dst = NULL; + map->src_palette_version = 0; + map->dst_palette_version = 0; + if (map->info.table) { + SDL_free(map->info.table); + map->info.table = NULL; + } } -int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst) + +int +SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst) { - SDL_PixelFormat *srcfmt; - SDL_PixelFormat *dstfmt; - SDL_BlitMap *map; - - /* Clear out any previous mapping */ - map = src->map; - if ( (src->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - SDL_UnRLESurface(src, 1); - } - SDL_InvalidateMap(map); - - /* Figure out what kind of mapping we're doing */ - map->identity = 0; - srcfmt = src->format; - dstfmt = dst->format; - switch (srcfmt->BytesPerPixel) { - case 1: - switch (dstfmt->BytesPerPixel) { - case 1: - /* Palette --> Palette */ - /* If both SDL_HWSURFACE, assume have same palette */ - if ( ((src->flags & SDL_HWSURFACE) == SDL_HWSURFACE) && - ((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) ) { - map->identity = 1; - } else { - map->table = Map1to1(srcfmt->palette, - dstfmt->palette, &map->identity); - } - if ( ! map->identity ) { - if ( map->table == NULL ) { - return(-1); - } - } - if (srcfmt->BitsPerPixel!=dstfmt->BitsPerPixel) - map->identity = 0; - break; - - default: - /* Palette --> BitField */ - map->table = Map1toN(srcfmt, dstfmt); - if ( map->table == NULL ) { - return(-1); - } - break; - } - break; - default: - switch (dstfmt->BytesPerPixel) { - case 1: - /* BitField --> Palette */ - map->table = MapNto1(srcfmt, dstfmt, &map->identity); - if ( ! map->identity ) { - if ( map->table == NULL ) { - return(-1); - } - } - map->identity = 0; /* Don't optimize to copy */ - break; - default: - /* BitField --> BitField */ - if ( FORMAT_EQUAL(srcfmt, dstfmt) ) - map->identity = 1; - break; - } - break; - } - - map->dst = dst; - map->format_version = dst->format_version; - - /* Choose your blitters wisely */ - return(SDL_CalculateBlit(src)); + SDL_PixelFormat *srcfmt; + SDL_PixelFormat *dstfmt; + SDL_BlitMap *map; + + /* Clear out any previous mapping */ + map = src->map; + if ((src->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { + SDL_UnRLESurface(src, 1); + } + SDL_InvalidateMap(map); + + /* Figure out what kind of mapping we're doing */ + map->identity = 0; + srcfmt = src->format; + dstfmt = dst->format; + if (SDL_ISPIXELFORMAT_INDEXED(srcfmt->format)) { + if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) { + /* Palette --> Palette */ + map->info.table = + Map1to1(srcfmt->palette, dstfmt->palette, &map->identity); + if (!map->identity) { + if (map->info.table == NULL) { + return (-1); + } + } + if (srcfmt->BitsPerPixel != dstfmt->BitsPerPixel) + map->identity = 0; + } else { + /* Palette --> BitField */ + map->info.table = + Map1toN(srcfmt, src->map->info.r, src->map->info.g, + src->map->info.b, src->map->info.a, dstfmt); + if (map->info.table == NULL) { + return (-1); + } + } + } else { + if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) { + /* BitField --> Palette */ + map->info.table = MapNto1(srcfmt, dstfmt, &map->identity); + if (!map->identity) { + if (map->info.table == NULL) { + return (-1); + } + } + map->identity = 0; /* Don't optimize to copy */ + } else { + /* BitField --> BitField */ + if (srcfmt == dstfmt) { + map->identity = 1; + } + } + } + + map->dst = dst; + + if (map->dst) { + /* Keep a reference to this surface so it doesn't get deleted + while we're still pointing at it. + + A better method would be for the destination surface to keep + track of surfaces that are mapped to it and automatically + invalidate them when it is freed, but this will do for now. + */ + ++map->dst->refcount; + } + + if (dstfmt->palette) { + map->dst_palette_version = dstfmt->palette->version; + } else { + map->dst_palette_version = 0; + } + + if (srcfmt->palette) { + map->src_palette_version = srcfmt->palette->version; + } else { + map->src_palette_version = 0; + } + + /* Choose your blitters wisely */ + return (SDL_CalculateBlit(src)); } -void SDL_FreeBlitMap(SDL_BlitMap *map) + +void +SDL_FreeBlitMap(SDL_BlitMap * map) { - if ( map ) { - SDL_InvalidateMap(map); - if ( map->sw_data != NULL ) { - SDL_free(map->sw_data); - } - SDL_free(map); - } + if (map) { + SDL_InvalidateMap(map); + SDL_free(map); + } } + +void +SDL_CalculateGammaRamp(float gamma, Uint16 * ramp) +{ + int i; + + /* Input validation */ + if (gamma < 0.0f ) { + SDL_InvalidParamError("gamma"); + return; + } + if (ramp == NULL) { + SDL_InvalidParamError("ramp"); + return; + } + + /* 0.0 gamma is all black */ + if (gamma == 0.0f) { + for (i = 0; i < 256; ++i) { + ramp[i] = 0; + } + return; + } else if (gamma == 1.0f) { + /* 1.0 gamma is identity */ + for (i = 0; i < 256; ++i) { + ramp[i] = (i << 8) | i; + } + return; + } else { + /* Calculate a real gamma ramp */ + int value; + gamma = 1.0f / gamma; + for (i = 0; i < 256; ++i) { + value = + (int) (SDL_pow((double) i / 256.0, gamma) * 65535.0 + 0.5); + if (value > 65535) { + value = 65535; + } + ramp[i] = (Uint16) value; + } + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_pixels_c.h b/src/video/SDL_pixels_c.h index 76759e2f7f..0b5d9a0064 100644 --- a/src/video/SDL_pixels_c.h +++ b/src/video/SDL_pixels_c.h @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -26,21 +25,17 @@ #include "SDL_blit.h" /* Pixel format functions */ -extern SDL_PixelFormat *SDL_AllocFormat(int bpp, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -extern SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); -extern void SDL_FormatChanged(SDL_Surface *surface); -extern void SDL_FreeFormat(SDL_PixelFormat *format); +extern int SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format); /* Blit mapping functions */ extern SDL_BlitMap *SDL_AllocBlitMap(void); -extern void SDL_InvalidateMap(SDL_BlitMap *map); -extern int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst); -extern void SDL_FreeBlitMap(SDL_BlitMap *map); +extern void SDL_InvalidateMap(SDL_BlitMap * map); +extern int SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst); +extern void SDL_FreeBlitMap(SDL_BlitMap * map); /* Miscellaneous functions */ -extern Uint16 SDL_CalculatePitch(SDL_Surface *surface); -extern void SDL_DitherColors(SDL_Color *colors, int bpp); -extern Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b); -extern void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output, int ncolors); +extern int SDL_CalculatePitch(SDL_Surface * surface); +extern void SDL_DitherColors(SDL_Color * colors, int bpp); +extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c new file mode 100644 index 0000000000..8dcb5b6519 --- /dev/null +++ b/src/video/SDL_rect.c @@ -0,0 +1,524 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_rect.h" +#include "SDL_rect_c.h" + + +SDL_bool +SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B) +{ + int Amin, Amax, Bmin, Bmax; + + if (!A) { + SDL_InvalidParamError("A"); + return SDL_FALSE; + } + + if (!B) { + SDL_InvalidParamError("B"); + return SDL_FALSE; + } + + /* Special cases for empty rects */ + if (SDL_RectEmpty(A) || SDL_RectEmpty(B)) { + return SDL_FALSE; + } + + /* Horizontal intersection */ + Amin = A->x; + Amax = Amin + A->w; + Bmin = B->x; + Bmax = Bmin + B->w; + if (Bmin > Amin) + Amin = Bmin; + if (Bmax < Amax) + Amax = Bmax; + if (Amax <= Amin) + return SDL_FALSE; + + /* Vertical intersection */ + Amin = A->y; + Amax = Amin + A->h; + Bmin = B->y; + Bmax = Bmin + B->h; + if (Bmin > Amin) + Amin = Bmin; + if (Bmax < Amax) + Amax = Bmax; + if (Amax <= Amin) + return SDL_FALSE; + + return SDL_TRUE; +} + +SDL_bool +SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) +{ + int Amin, Amax, Bmin, Bmax; + + if (!A) { + SDL_InvalidParamError("A"); + return SDL_FALSE; + } + + if (!B) { + SDL_InvalidParamError("B"); + return SDL_FALSE; + } + + if (!result) { + SDL_InvalidParamError("result"); + return SDL_FALSE; + } + + /* Special cases for empty rects */ + if (SDL_RectEmpty(A) || SDL_RectEmpty(B)) { + result->w = 0; + result->h = 0; + return SDL_FALSE; + } + + /* Horizontal intersection */ + Amin = A->x; + Amax = Amin + A->w; + Bmin = B->x; + Bmax = Bmin + B->w; + if (Bmin > Amin) + Amin = Bmin; + result->x = Amin; + if (Bmax < Amax) + Amax = Bmax; + result->w = Amax - Amin; + + /* Vertical intersection */ + Amin = A->y; + Amax = Amin + A->h; + Bmin = B->y; + Bmax = Bmin + B->h; + if (Bmin > Amin) + Amin = Bmin; + result->y = Amin; + if (Bmax < Amax) + Amax = Bmax; + result->h = Amax - Amin; + + return !SDL_RectEmpty(result); +} + +void +SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result) +{ + int Amin, Amax, Bmin, Bmax; + + if (!A) { + SDL_InvalidParamError("A"); + return; + } + + if (!B) { + SDL_InvalidParamError("B"); + return; + } + + if (!result) { + SDL_InvalidParamError("result"); + return; + } + + /* Special cases for empty Rects */ + if (SDL_RectEmpty(A)) { + if (SDL_RectEmpty(B)) { + /* A and B empty */ + return; + } else { + /* A empty, B not empty */ + *result = *B; + return; + } + } else { + if (SDL_RectEmpty(B)) { + /* A not empty, B empty */ + *result = *A; + return; + } + } + + /* Horizontal union */ + Amin = A->x; + Amax = Amin + A->w; + Bmin = B->x; + Bmax = Bmin + B->w; + if (Bmin < Amin) + Amin = Bmin; + result->x = Amin; + if (Bmax > Amax) + Amax = Bmax; + result->w = Amax - Amin; + + /* Vertical union */ + Amin = A->y; + Amax = Amin + A->h; + Bmin = B->y; + Bmax = Bmin + B->h; + if (Bmin < Amin) + Amin = Bmin; + result->y = Amin; + if (Bmax > Amax) + Amax = Bmax; + result->h = Amax - Amin; +} + +SDL_bool +SDL_EnclosePoints(const SDL_Point * points, int count, const SDL_Rect * clip, + SDL_Rect * result) +{ + int minx = 0; + int miny = 0; + int maxx = 0; + int maxy = 0; + int x, y, i; + + if (!points) { + SDL_InvalidParamError("points"); + return SDL_FALSE; + } + + if (count < 1) { + SDL_InvalidParamError("count"); + return SDL_FALSE; + } + + if (clip) { + SDL_bool added = SDL_FALSE; + const int clip_minx = clip->x; + const int clip_miny = clip->y; + const int clip_maxx = clip->x+clip->w-1; + const int clip_maxy = clip->y+clip->h-1; + + /* Special case for empty rectangle */ + if (SDL_RectEmpty(clip)) { + return SDL_FALSE; + } + + for (i = 0; i < count; ++i) { + x = points[i].x; + y = points[i].y; + + if (x < clip_minx || x > clip_maxx || + y < clip_miny || y > clip_maxy) { + continue; + } + if (!added) { + /* Special case: if no result was requested, we are done */ + if (result == NULL) { + return SDL_TRUE; + } + + /* First point added */ + minx = maxx = x; + miny = maxy = y; + added = SDL_TRUE; + continue; + } + if (x < minx) { + minx = x; + } else if (x > maxx) { + maxx = x; + } + if (y < miny) { + miny = y; + } else if (y > maxy) { + maxy = y; + } + } + if (!added) { + return SDL_FALSE; + } + } else { + /* Special case: if no result was requested, we are done */ + if (result == NULL) { + return SDL_TRUE; + } + + /* No clipping, always add the first point */ + minx = maxx = points[0].x; + miny = maxy = points[0].y; + + for (i = 1; i < count; ++i) { + x = points[i].x; + y = points[i].y; + + if (x < minx) { + minx = x; + } else if (x > maxx) { + maxx = x; + } + if (y < miny) { + miny = y; + } else if (y > maxy) { + maxy = y; + } + } + } + + if (result) { + result->x = minx; + result->y = miny; + result->w = (maxx-minx)+1; + result->h = (maxy-miny)+1; + } + return SDL_TRUE; +} + +/* Use the Cohen-Sutherland algorithm for line clipping */ +#define CODE_BOTTOM 1 +#define CODE_TOP 2 +#define CODE_LEFT 4 +#define CODE_RIGHT 8 + +static int ComputeOutCode(const SDL_Rect * rect, int x, int y) +{ + int code = 0; + if (y < 0) { + code |= CODE_TOP; + } else if (y >= rect->y + rect->h) { + code |= CODE_BOTTOM; + } + if (x < 0) { + code |= CODE_LEFT; + } else if (x >= rect->x + rect->w) { + code |= CODE_RIGHT; + } + return code; +} + +SDL_bool +SDL_IntersectRectAndLine(const SDL_Rect * rect, int *X1, int *Y1, int *X2, + int *Y2) +{ + int x = 0; + int y = 0; + int x1, y1; + int x2, y2; + int rectx1; + int recty1; + int rectx2; + int recty2; + int outcode1, outcode2; + + if (!rect) { + SDL_InvalidParamError("rect"); + return SDL_FALSE; + } + + if (!X1) { + SDL_InvalidParamError("X1"); + return SDL_FALSE; + } + + if (!Y1) { + SDL_InvalidParamError("Y1"); + return SDL_FALSE; + } + + if (!X2) { + SDL_InvalidParamError("X2"); + return SDL_FALSE; + } + + if (!Y2) { + SDL_InvalidParamError("Y2"); + return SDL_FALSE; + } + + /* Special case for empty rect */ + if (SDL_RectEmpty(rect)) { + return SDL_FALSE; + } + + x1 = *X1; + y1 = *Y1; + x2 = *X2; + y2 = *Y2; + rectx1 = rect->x; + recty1 = rect->y; + rectx2 = rect->x + rect->w - 1; + recty2 = rect->y + rect->h - 1; + + /* Check to see if entire line is inside rect */ + if (x1 >= rectx1 && x1 <= rectx2 && x2 >= rectx1 && x2 <= rectx2 && + y1 >= recty1 && y1 <= recty2 && y2 >= recty1 && y2 <= recty2) { + return SDL_TRUE; + } + + /* Check to see if entire line is to one side of rect */ + if ((x1 < rectx1 && x2 < rectx1) || (x1 > rectx2 && x2 > rectx2) || + (y1 < recty1 && y2 < recty1) || (y1 > recty2 && y2 > recty2)) { + return SDL_FALSE; + } + + if (y1 == y2) { + /* Horizontal line, easy to clip */ + if (x1 < rectx1) { + *X1 = rectx1; + } else if (x1 > rectx2) { + *X1 = rectx2; + } + if (x2 < rectx1) { + *X2 = rectx1; + } else if (x2 > rectx2) { + *X2 = rectx2; + } + return SDL_TRUE; + } + + if (x1 == x2) { + /* Vertical line, easy to clip */ + if (y1 < recty1) { + *Y1 = recty1; + } else if (y1 > recty2) { + *Y1 = recty2; + } + if (y2 < recty1) { + *Y2 = recty1; + } else if (y2 > recty2) { + *Y2 = recty2; + } + return SDL_TRUE; + } + + /* More complicated Cohen-Sutherland algorithm */ + outcode1 = ComputeOutCode(rect, x1, y1); + outcode2 = ComputeOutCode(rect, x2, y2); + while (outcode1 || outcode2) { + if (outcode1 & outcode2) { + return SDL_FALSE; + } + + if (outcode1) { + if (outcode1 & CODE_TOP) { + y = recty1; + x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + } else if (outcode1 & CODE_BOTTOM) { + y = recty2; + x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + } else if (outcode1 & CODE_LEFT) { + x = rectx1; + y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + } else if (outcode1 & CODE_RIGHT) { + x = rectx2; + y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + } + x1 = x; + y1 = y; + outcode1 = ComputeOutCode(rect, x, y); + } else { + if (outcode2 & CODE_TOP) { + y = recty1; + x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + } else if (outcode2 & CODE_BOTTOM) { + y = recty2; + x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + } else if (outcode2 & CODE_LEFT) { + x = rectx1; + y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + } else if (outcode2 & CODE_RIGHT) { + x = rectx2; + y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + } + x2 = x; + y2 = y; + outcode2 = ComputeOutCode(rect, x, y); + } + } + *X1 = x1; + *Y1 = y1; + *X2 = x2; + *Y2 = y2; + return SDL_TRUE; +} + +SDL_bool +SDL_GetSpanEnclosingRect(int width, int height, + int numrects, const SDL_Rect * rects, SDL_Rect *span) +{ + int i; + int span_y1, span_y2; + int rect_y1, rect_y2; + + if (width < 1) { + SDL_InvalidParamError("width"); + return SDL_FALSE; + } + + if (height < 1) { + SDL_InvalidParamError("height"); + return SDL_FALSE; + } + + if (!rects) { + SDL_InvalidParamError("rects"); + return SDL_FALSE; + } + + if (!span) { + SDL_InvalidParamError("span"); + return SDL_FALSE; + } + + if (numrects < 1) { + SDL_InvalidParamError("numrects"); + return SDL_FALSE; + } + + /* Initialize to empty rect */ + span_y1 = height; + span_y2 = 0; + + for (i = 0; i < numrects; ++i) { + rect_y1 = rects[i].y; + rect_y2 = rect_y1 + rects[i].h; + + /* Clip out of bounds rectangles, and expand span rect */ + if (rect_y1 < 0) { + span_y1 = 0; + } else if (rect_y1 < span_y1) { + span_y1 = rect_y1; + } + if (rect_y2 > height) { + span_y2 = height; + } else if (rect_y2 > span_y2) { + span_y2 = rect_y2; + } + } + if (span_y2 > span_y1) { + span->x = 0; + span->y = span_y1; + span->w = width; + span->h = (span_y2 - span_y1); + return SDL_TRUE; + } + return SDL_FALSE; +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_rect_c.h b/src/video/SDL_rect_c.h new file mode 100644 index 0000000000..a7fd49cf8e --- /dev/null +++ b/src/video/SDL_rect_c.h @@ -0,0 +1,25 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_shape.c b/src/video/SDL_shape.c new file mode 100644 index 0000000000..e9876e4104 --- /dev/null +++ b/src/video/SDL_shape.c @@ -0,0 +1,286 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL.h" +#include "SDL_assert.h" +#include "SDL_video.h" +#include "SDL_sysvideo.h" +#include "SDL_pixels.h" +#include "SDL_surface.h" +#include "SDL_shape.h" +#include "SDL_shape_internals.h" + +SDL_Window* +SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags) +{ + SDL_Window *result = NULL; + result = SDL_CreateWindow(title,-1000,-1000,w,h,(flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /*& (~SDL_WINDOW_SHOWN)*/); + if(result != NULL) { + result->shaper = SDL_GetVideoDevice()->shape_driver.CreateShaper(result); + if(result->shaper != NULL) { + result->shaper->userx = x; + result->shaper->usery = y; + result->shaper->mode.mode = ShapeModeDefault; + result->shaper->mode.parameters.binarizationCutoff = 1; + result->shaper->hasshape = SDL_FALSE; + return result; + } + else { + SDL_DestroyWindow(result); + return NULL; + } + } + else + return NULL; +} + +SDL_bool +SDL_IsShapedWindow(const SDL_Window *window) +{ + if(window == NULL) + return SDL_FALSE; + else + return (SDL_bool)(window->shaper != NULL); +} + +/* REQUIRES that bitmap point to a w-by-h bitmap with ppb pixels-per-byte. */ +void +SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb) +{ + int x = 0; + int y = 0; + Uint8 r = 0,g = 0,b = 0,alpha = 0; + Uint8* pixel = NULL; + Uint32 bitmap_pixel,pixel_value = 0,mask_value = 0; + SDL_Color key; + if(SDL_MUSTLOCK(shape)) + SDL_LockSurface(shape); + for(y = 0;yh;y++) { + for(x=0;xw;x++) { + alpha = 0; + pixel_value = 0; + pixel = (Uint8 *)(shape->pixels) + (y*shape->pitch) + (x*shape->format->BytesPerPixel); + switch(shape->format->BytesPerPixel) { + case(1): + pixel_value = *(Uint8*)pixel; + break; + case(2): + pixel_value = *(Uint16*)pixel; + break; + case(3): + pixel_value = *(Uint32*)pixel & (~shape->format->Amask); + break; + case(4): + pixel_value = *(Uint32*)pixel; + break; + } + SDL_GetRGBA(pixel_value,shape->format,&r,&g,&b,&alpha); + bitmap_pixel = y*shape->w + x; + switch(mode.mode) { + case(ShapeModeDefault): + mask_value = (alpha >= 1 ? 1 : 0); + break; + case(ShapeModeBinarizeAlpha): + mask_value = (alpha >= mode.parameters.binarizationCutoff ? 1 : 0); + break; + case(ShapeModeReverseBinarizeAlpha): + mask_value = (alpha <= mode.parameters.binarizationCutoff ? 1 : 0); + break; + case(ShapeModeColorKey): + key = mode.parameters.colorKey; + mask_value = ((key.r != r || key.g != g || key.b != b) ? 1 : 0); + break; + } + bitmap[bitmap_pixel / ppb] |= mask_value << (7 - ((ppb - 1) - (bitmap_pixel % ppb))); + } + } + if(SDL_MUSTLOCK(shape)) + SDL_UnlockSurface(shape); +} + +static SDL_ShapeTree* +RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* mask,SDL_Rect dimensions) { + int x = 0,y = 0; + Uint8* pixel = NULL; + Uint32 pixel_value = 0; + Uint8 r = 0,g = 0,b = 0,a = 0; + SDL_bool pixel_opaque = SDL_FALSE; + int last_opaque = -1; + SDL_Color key; + SDL_ShapeTree* result = (SDL_ShapeTree*)SDL_malloc(sizeof(SDL_ShapeTree)); + SDL_Rect next = {0,0,0,0}; + for(y=dimensions.y;ypixels) + (y*mask->pitch) + (x*mask->format->BytesPerPixel); + switch(mask->format->BytesPerPixel) { + case(1): + pixel_value = *(Uint8*)pixel; + break; + case(2): + pixel_value = *(Uint16*)pixel; + break; + case(3): + pixel_value = *(Uint32*)pixel & (~mask->format->Amask); + break; + case(4): + pixel_value = *(Uint32*)pixel; + break; + } + SDL_GetRGBA(pixel_value,mask->format,&r,&g,&b,&a); + switch(mode.mode) { + case(ShapeModeDefault): + pixel_opaque = (a >= 1 ? SDL_TRUE : SDL_FALSE); + break; + case(ShapeModeBinarizeAlpha): + pixel_opaque = (a >= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE); + break; + case(ShapeModeReverseBinarizeAlpha): + pixel_opaque = (a <= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE); + break; + case(ShapeModeColorKey): + key = mode.parameters.colorKey; + pixel_opaque = ((key.r != r || key.g != g || key.b != b) ? SDL_TRUE : SDL_FALSE); + break; + } + if(last_opaque == -1) + last_opaque = pixel_opaque; + if(last_opaque != pixel_opaque) { + result->kind = QuadShape; + /* These will stay the same. */ + next.w = dimensions.w / 2; + next.h = dimensions.h / 2; + /* These will change from recursion to recursion. */ + next.x = dimensions.x; + next.y = dimensions.y; + result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + next.x += next.w; + /* Unneeded: next.y = dimensions.y; */ + result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + next.x = dimensions.x; + next.y += next.h; + result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + next.x += next.w; + /* Unneeded: next.y = dimensions.y + dimensions.h /2; */ + result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + return result; + } + } + } + /* If we never recursed, all the pixels in this quadrant have the same "value". */ + result->kind = (last_opaque == SDL_TRUE ? OpaqueShape : TransparentShape); + result->data.shape = dimensions; + return result; +} + +SDL_ShapeTree* +SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape) +{ + SDL_Rect dimensions = {0,0,shape->w,shape->h}; + SDL_ShapeTree* result = NULL; + if(SDL_MUSTLOCK(shape)) + SDL_LockSurface(shape); + result = RecursivelyCalculateShapeTree(mode,shape,dimensions); + if(SDL_MUSTLOCK(shape)) + SDL_UnlockSurface(shape); + return result; +} + +void +SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure) +{ + SDL_assert(tree != NULL); + if(tree->kind == QuadShape) { + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upleft,function,closure); + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upright,function,closure); + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downleft,function,closure); + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downright,function,closure); + } + else + function(tree,closure); +} + +void +SDL_FreeShapeTree(SDL_ShapeTree** shape_tree) +{ + if((*shape_tree)->kind == QuadShape) { + SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.upleft); + SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.upright); + SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.downleft); + SDL_FreeShapeTree((SDL_ShapeTree **)&(*shape_tree)->data.children.downright); + } + SDL_free(*shape_tree); + *shape_tree = NULL; +} + +int +SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) +{ + int result; + if(window == NULL || !SDL_IsShapedWindow(window)) + /* The window given was not a shapeable window. */ + return SDL_NONSHAPEABLE_WINDOW; + if(shape == NULL) + /* Invalid shape argument. */ + return SDL_INVALID_SHAPE_ARGUMENT; + + if(shape_mode != NULL) + window->shaper->mode = *shape_mode; + result = SDL_GetVideoDevice()->shape_driver.SetWindowShape(window->shaper,shape,shape_mode); + window->shaper->hasshape = SDL_TRUE; + if(window->shaper->userx != 0 && window->shaper->usery != 0) { + SDL_SetWindowPosition(window,window->shaper->userx,window->shaper->usery); + window->shaper->userx = 0; + window->shaper->usery = 0; + } + return result; +} + +static SDL_bool +SDL_WindowHasAShape(SDL_Window *window) +{ + if (window == NULL || !SDL_IsShapedWindow(window)) + return SDL_FALSE; + return window->shaper->hasshape; +} + +int +SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode) +{ + if(window != NULL && SDL_IsShapedWindow(window)) { + if(shape_mode == NULL) { + if(SDL_WindowHasAShape(window)) + /* The window given has a shape. */ + return 0; + else + /* The window given is shapeable but lacks a shape. */ + return SDL_WINDOW_LACKS_SHAPE; + } + else { + *shape_mode = window->shaper->mode; + return 0; + } + } + else + /* The window given is not a valid shapeable window. */ + return SDL_NONSHAPEABLE_WINDOW; +} diff --git a/src/video/SDL_shape_internals.h b/src/video/SDL_shape_internals.h new file mode 100644 index 0000000000..27b51241be --- /dev/null +++ b/src/video/SDL_shape_internals.h @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_shape_internals_h +#define _SDL_shape_internals_h + +#include "SDL_rect.h" +#include "SDL_shape.h" +#include "SDL_surface.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +typedef struct { + struct SDL_ShapeTree *upleft,*upright,*downleft,*downright; +} SDL_QuadTreeChildren; + +typedef union { + SDL_QuadTreeChildren children; + SDL_Rect shape; +} SDL_ShapeUnion; + +typedef enum { QuadShape,TransparentShape,OpaqueShape } SDL_ShapeKind; + +typedef struct { + SDL_ShapeKind kind; + SDL_ShapeUnion data; +} SDL_ShapeTree; + +typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*); + +extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb); +extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape); +extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure); +extern void SDL_FreeShapeTree(SDL_ShapeTree** shape_tree); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 7ce401ff7a..69980d0764 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -1,23 +1,22 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" @@ -34,7 +33,7 @@ into the general blitting mechanism. */ -#if ((defined(_MFC_VER) && defined(_M_IX86)/* && !defined(_WIN32_WCE) still needed? */) || \ +#if ((defined(_MFC_VER) && defined(_M_IX86)) || \ defined(__WATCOMC__) || \ (defined(__GNUC__) && defined(__i386__))) && SDL_ASSEMBLY_ROUTINES /* There's a bug with gcc 4.4.1 and -O2 where srcp doesn't get the correct @@ -55,304 +54,300 @@ #endif #if defined(_M_IX86) || defined(i386) -#define PREFIX16 0x66 -#define STORE_BYTE 0xAA -#define STORE_WORD 0xAB -#define LOAD_BYTE 0xAC -#define LOAD_WORD 0xAD -#define RETURN 0xC3 +#define PREFIX16 0x66 +#define STORE_BYTE 0xAA +#define STORE_WORD 0xAB +#define LOAD_BYTE 0xAC +#define LOAD_WORD 0xAD +#define RETURN 0xC3 #else #error Need assembly opcodes for this architecture #endif static unsigned char copy_row[4096] PAGE_ALIGNED; -static int generate_rowbytes(int src_w, int dst_w, int bpp) +static int +generate_rowbytes(int src_w, int dst_w, int bpp) { - static struct { - int bpp; - int src_w; - int dst_w; - int status; - } last; - - int i; - int pos, inc; - unsigned char *eip, *fence; - unsigned char load, store; - - /* See if we need to regenerate the copy buffer */ - if ( (src_w == last.src_w) && - (dst_w == last.dst_w) && (bpp == last.bpp) ) { - return(last.status); - } - last.bpp = bpp; - last.src_w = src_w; - last.dst_w = dst_w; - last.status = -1; - - switch (bpp) { - case 1: - load = LOAD_BYTE; - store = STORE_BYTE; - break; - case 2: - case 4: - load = LOAD_WORD; - store = STORE_WORD; - break; - default: - SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp); - return(-1); - } + static struct + { + int bpp; + int src_w; + int dst_w; + int status; + } last; + + int i; + int pos, inc; + unsigned char *eip, *fence; + unsigned char load, store; + + /* See if we need to regenerate the copy buffer */ + if ((src_w == last.src_w) && (dst_w == last.dst_w) && (bpp == last.bpp)) { + return (last.status); + } + last.bpp = bpp; + last.src_w = src_w; + last.dst_w = dst_w; + last.status = -1; + + switch (bpp) { + case 1: + load = LOAD_BYTE; + store = STORE_BYTE; + break; + case 2: + case 4: + load = LOAD_WORD; + store = STORE_WORD; + break; + default: + return SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp); + } #ifdef HAVE_MPROTECT - /* Make the code writeable */ - if ( mprotect(copy_row, sizeof(copy_row), PROT_READ|PROT_WRITE) < 0 ) { - SDL_SetError("Couldn't make copy buffer writeable"); - return(-1); - } + /* Make the code writeable */ + if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_WRITE) < 0) { + return SDL_SetError("Couldn't make copy buffer writeable"); + } #endif - pos = 0x10000; - inc = (src_w << 16) / dst_w; - eip = copy_row; - fence = copy_row+sizeof(copy_row)-2; - for ( i=0; i= 0x10000L ) { - if ( eip == fence ) { - return -1; - } - if ( bpp == 2 ) { - *eip++ = PREFIX16; - } - *eip++ = load; - pos -= 0x10000L; - } - if ( eip == fence ) { - return -1; - } - if ( bpp == 2 ) { - *eip++ = PREFIX16; - } - *eip++ = store; - pos += inc; - } - *eip++ = RETURN; + pos = 0x10000; + inc = (src_w << 16) / dst_w; + eip = copy_row; + fence = copy_row + sizeof(copy_row)-2; + for (i = 0; i < dst_w; ++i) { + while (pos >= 0x10000L) { + if (eip == fence) { + return -1; + } + if (bpp == 2) { + *eip++ = PREFIX16; + } + *eip++ = load; + pos -= 0x10000L; + } + if (eip == fence) { + return -1; + } + if (bpp == 2) { + *eip++ = PREFIX16; + } + *eip++ = store; + pos += inc; + } + *eip++ = RETURN; #ifdef HAVE_MPROTECT - /* Make the code executable but not writeable */ - if ( mprotect(copy_row, sizeof(copy_row), PROT_READ|PROT_EXEC) < 0 ) { - SDL_SetError("Couldn't make copy buffer executable"); - return(-1); - } + /* Make the code executable but not writeable */ + if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_EXEC) < 0) { + return SDL_SetError("Couldn't make copy buffer executable"); + } #endif - last.status = 0; - return(0); + last.status = 0; + return (0); } #endif /* USE_ASM_STRETCH */ -#define DEFINE_COPY_ROW(name, type) \ -void name(type *src, int src_w, type *dst, int dst_w) \ -{ \ - int i; \ - int pos, inc; \ - type pixel = 0; \ - \ - pos = 0x10000; \ - inc = (src_w << 16) / dst_w; \ - for ( i=dst_w; i>0; --i ) { \ - while ( pos >= 0x10000L ) { \ - pixel = *src++; \ - pos -= 0x10000L; \ - } \ - *dst++ = pixel; \ - pos += inc; \ - } \ +#define DEFINE_COPY_ROW(name, type) \ +static void name(type *src, int src_w, type *dst, int dst_w) \ +{ \ + int i; \ + int pos, inc; \ + type pixel = 0; \ + \ + pos = 0x10000; \ + inc = (src_w << 16) / dst_w; \ + for ( i=dst_w; i>0; --i ) { \ + while ( pos >= 0x10000L ) { \ + pixel = *src++; \ + pos -= 0x10000L; \ + } \ + *dst++ = pixel; \ + pos += inc; \ + } \ } +/* *INDENT-OFF* */ DEFINE_COPY_ROW(copy_row1, Uint8) DEFINE_COPY_ROW(copy_row2, Uint16) DEFINE_COPY_ROW(copy_row4, Uint32) +/* *INDENT-ON* */ /* The ASM code doesn't handle 24-bpp stretch blits */ -void copy_row3(Uint8 *src, int src_w, Uint8 *dst, int dst_w) +static void +copy_row3(Uint8 * src, int src_w, Uint8 * dst, int dst_w) { - int i; - int pos, inc; - Uint8 pixel[3] = { 0, 0, 0 }; - - pos = 0x10000; - inc = (src_w << 16) / dst_w; - for ( i=dst_w; i>0; --i ) { - while ( pos >= 0x10000L ) { - pixel[0] = *src++; - pixel[1] = *src++; - pixel[2] = *src++; - pos -= 0x10000L; - } - *dst++ = pixel[0]; - *dst++ = pixel[1]; - *dst++ = pixel[2]; - pos += inc; - } + int i; + int pos, inc; + Uint8 pixel[3] = { 0, 0, 0 }; + + pos = 0x10000; + inc = (src_w << 16) / dst_w; + for (i = dst_w; i > 0; --i) { + while (pos >= 0x10000L) { + pixel[0] = *src++; + pixel[1] = *src++; + pixel[2] = *src++; + pos -= 0x10000L; + } + *dst++ = pixel[0]; + *dst++ = pixel[1]; + *dst++ = pixel[2]; + pos += inc; + } } /* Perform a stretch blit between two surfaces of the same format. NOTE: This function is not safe to call from multiple threads! */ -int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect) +int +SDL_SoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, const SDL_Rect * dstrect) { - int src_locked; - int dst_locked; - int pos, inc; - int dst_maxrow; - int src_row, dst_row; - Uint8 *srcp = NULL; - Uint8 *dstp; - SDL_Rect full_src; - SDL_Rect full_dst; + int src_locked; + int dst_locked; + int pos, inc; + int dst_maxrow; + int src_row, dst_row; + Uint8 *srcp = NULL; + Uint8 *dstp; + SDL_Rect full_src; + SDL_Rect full_dst; #ifdef USE_ASM_STRETCH - SDL_bool use_asm = SDL_TRUE; + SDL_bool use_asm = SDL_TRUE; #ifdef __GNUC__ - int u1, u2; + int u1, u2; #endif #endif /* USE_ASM_STRETCH */ - const int bpp = dst->format->BytesPerPixel; - - if ( src->format->BitsPerPixel != dst->format->BitsPerPixel ) { - SDL_SetError("Only works with same format surfaces"); - return(-1); - } - - /* Verify the blit rectangles */ - if ( srcrect ) { - if ( (srcrect->x < 0) || (srcrect->y < 0) || - ((srcrect->x+srcrect->w) > src->w) || - ((srcrect->y+srcrect->h) > src->h) ) { - SDL_SetError("Invalid source blit rectangle"); - return(-1); - } - } else { - full_src.x = 0; - full_src.y = 0; - full_src.w = src->w; - full_src.h = src->h; - srcrect = &full_src; - } - if ( dstrect ) { - if ( (dstrect->x < 0) || (dstrect->y < 0) || - ((dstrect->x+dstrect->w) > dst->w) || - ((dstrect->y+dstrect->h) > dst->h) ) { - SDL_SetError("Invalid destination blit rectangle"); - return(-1); - } - } else { - full_dst.x = 0; - full_dst.y = 0; - full_dst.w = dst->w; - full_dst.h = dst->h; - dstrect = &full_dst; - } - - /* Lock the destination if it's in hardware */ - dst_locked = 0; - if ( SDL_MUSTLOCK(dst) ) { - if ( SDL_LockSurface(dst) < 0 ) { - SDL_SetError("Unable to lock destination surface"); - return(-1); - } - dst_locked = 1; - } - /* Lock the source if it's in hardware */ - src_locked = 0; - if ( SDL_MUSTLOCK(src) ) { - if ( SDL_LockSurface(src) < 0 ) { - if ( dst_locked ) { - SDL_UnlockSurface(dst); - } - SDL_SetError("Unable to lock source surface"); - return(-1); - } - src_locked = 1; - } - - /* Set up the data... */ - pos = 0x10000; - inc = (srcrect->h << 16) / dstrect->h; - src_row = srcrect->y; - dst_row = dstrect->y; + const int bpp = dst->format->BytesPerPixel; + + if (src->format->format != dst->format->format) { + return SDL_SetError("Only works with same format surfaces"); + } + + /* Verify the blit rectangles */ + if (srcrect) { + if ((srcrect->x < 0) || (srcrect->y < 0) || + ((srcrect->x + srcrect->w) > src->w) || + ((srcrect->y + srcrect->h) > src->h)) { + return SDL_SetError("Invalid source blit rectangle"); + } + } else { + full_src.x = 0; + full_src.y = 0; + full_src.w = src->w; + full_src.h = src->h; + srcrect = &full_src; + } + if (dstrect) { + if ((dstrect->x < 0) || (dstrect->y < 0) || + ((dstrect->x + dstrect->w) > dst->w) || + ((dstrect->y + dstrect->h) > dst->h)) { + return SDL_SetError("Invalid destination blit rectangle"); + } + } else { + full_dst.x = 0; + full_dst.y = 0; + full_dst.w = dst->w; + full_dst.h = dst->h; + dstrect = &full_dst; + } + + /* Lock the destination if it's in hardware */ + dst_locked = 0; + if (SDL_MUSTLOCK(dst)) { + if (SDL_LockSurface(dst) < 0) { + return SDL_SetError("Unable to lock destination surface"); + } + dst_locked = 1; + } + /* Lock the source if it's in hardware */ + src_locked = 0; + if (SDL_MUSTLOCK(src)) { + if (SDL_LockSurface(src) < 0) { + if (dst_locked) { + SDL_UnlockSurface(dst); + } + return SDL_SetError("Unable to lock source surface"); + } + src_locked = 1; + } + + /* Set up the data... */ + pos = 0x10000; + inc = (srcrect->h << 16) / dstrect->h; + src_row = srcrect->y; + dst_row = dstrect->y; #ifdef USE_ASM_STRETCH - /* Write the opcodes for this stretch */ - if ( (bpp == 3) || - (generate_rowbytes(srcrect->w, dstrect->w, bpp) < 0) ) { - use_asm = SDL_FALSE; - } + /* Write the opcodes for this stretch */ + if ((bpp == 3) || (generate_rowbytes(srcrect->w, dstrect->w, bpp) < 0)) { + use_asm = SDL_FALSE; + } #endif - /* Perform the stretch blit */ - for ( dst_maxrow = dst_row+dstrect->h; dst_rowpixels + (dst_row*dst->pitch) - + (dstrect->x*bpp); - while ( pos >= 0x10000L ) { - srcp = (Uint8 *)src->pixels + (src_row*src->pitch) - + (srcrect->x*bpp); - ++src_row; - pos -= 0x10000L; - } + /* Perform the stretch blit */ + for (dst_maxrow = dst_row + dstrect->h; dst_row < dst_maxrow; ++dst_row) { + dstp = (Uint8 *) dst->pixels + (dst_row * dst->pitch) + + (dstrect->x * bpp); + while (pos >= 0x10000L) { + srcp = (Uint8 *) src->pixels + (src_row * src->pitch) + + (srcrect->x * bpp); + ++src_row; + pos -= 0x10000L; + } #ifdef USE_ASM_STRETCH - if (use_asm) { + if (use_asm) { #ifdef __GNUC__ - __asm__ __volatile__ ( - "call *%4" - : "=&D" (u1), "=&S" (u2) - : "0" (dstp), "1" (srcp), "r" (copy_row) - : "memory" ); + __asm__ __volatile__("call *%4":"=&D"(u1), "=&S"(u2) + :"0"(dstp), "1"(srcp), "r"(copy_row) + :"memory"); #elif defined(_MSC_VER) || defined(__WATCOMC__) - { void *code = copy_row; - __asm { - push edi - push esi - - mov edi, dstp - mov esi, srcp - call dword ptr code - - pop esi - pop edi - } - } + /* *INDENT-OFF* */ + { + void *code = copy_row; + __asm { + push edi + push esi + mov edi, dstp + mov esi, srcp + call dword ptr code + pop esi + pop edi + } + } + /* *INDENT-ON* */ #else #error Need inline assembly for this compiler #endif - } else + } else #endif - switch (bpp) { - case 1: - copy_row1(srcp, srcrect->w, dstp, dstrect->w); - break; - case 2: - copy_row2((Uint16 *)srcp, srcrect->w, - (Uint16 *)dstp, dstrect->w); - break; - case 3: - copy_row3(srcp, srcrect->w, dstp, dstrect->w); - break; - case 4: - copy_row4((Uint32 *)srcp, srcrect->w, - (Uint32 *)dstp, dstrect->w); - break; - } - pos += inc; - } - - /* We need to unlock the surfaces if they're locked */ - if ( dst_locked ) { - SDL_UnlockSurface(dst); - } - if ( src_locked ) { - SDL_UnlockSurface(src); - } - return(0); + switch (bpp) { + case 1: + copy_row1(srcp, srcrect->w, dstp, dstrect->w); + break; + case 2: + copy_row2((Uint16 *) srcp, srcrect->w, + (Uint16 *) dstp, dstrect->w); + break; + case 3: + copy_row3(srcp, srcrect->w, dstp, dstrect->w); + break; + case 4: + copy_row4((Uint32 *) srcp, srcrect->w, + (Uint32 *) dstp, dstrect->w); + break; + } + pos += inc; + } + + /* We need to unlock the surfaces if they're locked */ + if (dst_locked) { + SDL_UnlockSurface(dst); + } + if (src_locked) { + SDL_UnlockSurface(src); + } + return (0); } +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_stretch_c.h b/src/video/SDL_stretch_c.h deleted file mode 100644 index 4cc6acb207..0000000000 --- a/src/video/SDL_stretch_c.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Perform a stretch blit between two surfaces of the same format. - NOTE: This function is not safe to call from multiple threads! -*/ -extern int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect); - diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 0f3ad12c4b..460d53bc38 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -1,941 +1,1085 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #include "SDL_video.h" #include "SDL_sysvideo.h" -#include "SDL_cursor_c.h" #include "SDL_blit.h" #include "SDL_RLEaccel_c.h" #include "SDL_pixels_c.h" -#include "SDL_leaks.h" /* Public routines */ /* * Create an empty RGB surface of the appropriate depth */ -SDL_Surface * SDL_CreateRGBSurface (Uint32 flags, - int width, int height, int depth, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +SDL_Surface * +SDL_CreateRGBSurface(Uint32 flags, + int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - SDL_Surface *screen; - SDL_Surface *surface; - - /* Make sure the size requested doesn't overflow our datatypes */ - /* Next time I write a library like SDL, I'll use int for size. :) */ - if ( width >= 16384 || height >= 65536 ) { - SDL_SetError("Width or height is too large"); - return(NULL); - } - - /* Check to see if we desire the surface in video memory */ - if ( video ) { - screen = SDL_PublicSurface; - } else { - screen = NULL; - } - if ( screen && ((screen->flags&SDL_HWSURFACE) == SDL_HWSURFACE) ) { - if ( (flags&(SDL_SRCCOLORKEY|SDL_SRCALPHA)) != 0 ) { - flags |= SDL_HWSURFACE; - } - if ( (flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) { - if ( ! current_video->info.blit_hw_CC ) { - flags &= ~SDL_HWSURFACE; - } - } - if ( (flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { - if ( ! current_video->info.blit_hw_A ) { - flags &= ~SDL_HWSURFACE; - } - } - } else { - flags &= ~SDL_HWSURFACE; - } - - /* Allocate the surface */ - surface = (SDL_Surface *)SDL_malloc(sizeof(*surface)); - if ( surface == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - surface->flags = SDL_SWSURFACE; - if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { - if ((Amask) && (video->displayformatalphapixel)) - { - depth = video->displayformatalphapixel->BitsPerPixel; - Rmask = video->displayformatalphapixel->Rmask; - Gmask = video->displayformatalphapixel->Gmask; - Bmask = video->displayformatalphapixel->Bmask; - Amask = video->displayformatalphapixel->Amask; - } - else - { - depth = screen->format->BitsPerPixel; - Rmask = screen->format->Rmask; - Gmask = screen->format->Gmask; - Bmask = screen->format->Bmask; - Amask = screen->format->Amask; - } - } - surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask); - if ( surface->format == NULL ) { - SDL_free(surface); - return(NULL); - } - if ( Amask ) { - surface->flags |= SDL_SRCALPHA; - } - surface->w = width; - surface->h = height; - surface->pitch = SDL_CalculatePitch(surface); - surface->pixels = NULL; - surface->offset = 0; - surface->hwdata = NULL; - surface->locked = 0; - surface->map = NULL; - surface->unused1 = 0; - SDL_SetClipRect(surface, NULL); - SDL_FormatChanged(surface); - - /* Get the pixels */ - if ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) || - (video->AllocHWSurface(this, surface) < 0) ) { - if ( surface->w && surface->h ) { - surface->pixels = SDL_malloc(surface->h*surface->pitch); - if ( surface->pixels == NULL ) { - SDL_FreeSurface(surface); - SDL_OutOfMemory(); - return(NULL); - } - /* This is important for bitmaps */ - SDL_memset(surface->pixels, 0, surface->h*surface->pitch); - } - } - - /* Allocate an empty mapping */ - surface->map = SDL_AllocBlitMap(); - if ( surface->map == NULL ) { - SDL_FreeSurface(surface); - return(NULL); - } - - /* The surface is ready to go */ - surface->refcount = 1; -#ifdef CHECK_LEAKS - ++surfaces_allocated; -#endif - return(surface); + SDL_Surface *surface; + Uint32 format; + + /* The flags are no longer used, make the compiler happy */ + (void)flags; + + /* Get the pixel format */ + format = SDL_MasksToPixelFormatEnum(depth, Rmask, Gmask, Bmask, Amask); + if (format == SDL_PIXELFORMAT_UNKNOWN) { + SDL_SetError("Unknown pixel format"); + return NULL; + } + + /* Allocate the surface */ + surface = (SDL_Surface *) SDL_calloc(1, sizeof(*surface)); + if (surface == NULL) { + SDL_OutOfMemory(); + return NULL; + } + + surface->format = SDL_AllocFormat(format); + if (!surface->format) { + SDL_FreeSurface(surface); + return NULL; + } + surface->w = width; + surface->h = height; + surface->pitch = SDL_CalculatePitch(surface); + SDL_SetClipRect(surface, NULL); + + if (SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { + SDL_Palette *palette = + SDL_AllocPalette((1 << surface->format->BitsPerPixel)); + if (!palette) { + SDL_FreeSurface(surface); + return NULL; + } + if (palette->ncolors == 2) { + /* Create a black and white bitmap palette */ + palette->colors[0].r = 0xFF; + palette->colors[0].g = 0xFF; + palette->colors[0].b = 0xFF; + palette->colors[1].r = 0x00; + palette->colors[1].g = 0x00; + palette->colors[1].b = 0x00; + } + SDL_SetSurfacePalette(surface, palette); + SDL_FreePalette(palette); + } + + /* Get the pixels */ + if (surface->w && surface->h) { + surface->pixels = SDL_malloc(surface->h * surface->pitch); + if (!surface->pixels) { + SDL_FreeSurface(surface); + SDL_OutOfMemory(); + return NULL; + } + /* This is important for bitmaps */ + SDL_memset(surface->pixels, 0, surface->h * surface->pitch); + } + + /* Allocate an empty mapping */ + surface->map = SDL_AllocBlitMap(); + if (!surface->map) { + SDL_FreeSurface(surface); + return NULL; + } + + /* By default surface with an alpha mask are set up for blending */ + if (Amask) { + SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND); + } + + /* The surface is ready to go */ + surface->refcount = 1; + return surface; } + /* * Create an RGB surface from an existing memory buffer */ -SDL_Surface * SDL_CreateRGBSurfaceFrom (void *pixels, - int width, int height, int depth, int pitch, - Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +SDL_Surface * +SDL_CreateRGBSurfaceFrom(void *pixels, + int width, int height, int depth, int pitch, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, + Uint32 Amask) { - SDL_Surface *surface; - - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0, depth, - Rmask, Gmask, Bmask, Amask); - if ( surface != NULL ) { - surface->flags |= SDL_PREALLOC; - surface->pixels = pixels; - surface->w = width; - surface->h = height; - surface->pitch = pitch; - SDL_SetClipRect(surface, NULL); - } - return(surface); + SDL_Surface *surface; + + surface = + SDL_CreateRGBSurface(0, 0, 0, depth, Rmask, Gmask, Bmask, Amask); + if (surface != NULL) { + surface->flags |= SDL_PREALLOC; + surface->pixels = pixels; + surface->w = width; + surface->h = height; + surface->pitch = pitch; + SDL_SetClipRect(surface, NULL); + } + return surface; } -/* - * Set the color key in a blittable surface - */ -int SDL_SetColorKey (SDL_Surface *surface, Uint32 flag, Uint32 key) + +int +SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette) { - /* Sanity check the flag as it gets passed in */ - if ( flag & SDL_SRCCOLORKEY ) { - if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) { - flag = (SDL_SRCCOLORKEY | SDL_RLEACCELOK); - } else { - flag = SDL_SRCCOLORKEY; - } - } else { - flag = 0; - } - - /* Optimize away operations that don't change anything */ - if ( (flag == (surface->flags & (SDL_SRCCOLORKEY|SDL_RLEACCELOK))) && - (key == surface->format->colorkey) ) { - return(0); - } - - /* UnRLE surfaces before we change the colorkey */ - if ( surface->flags & SDL_RLEACCEL ) { - SDL_UnRLESurface(surface, 1); - } - - if ( flag ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - - surface->flags |= SDL_SRCCOLORKEY; - surface->format->colorkey = key; - if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) { - if ( (video->SetHWColorKey == NULL) || - (video->SetHWColorKey(this, surface, key) < 0) ) { - surface->flags &= ~SDL_HWACCEL; - } - } - if ( flag & SDL_RLEACCELOK ) { - surface->flags |= SDL_RLEACCELOK; - } else { - surface->flags &= ~SDL_RLEACCELOK; - } - } else { - surface->flags &= ~(SDL_SRCCOLORKEY|SDL_RLEACCELOK); - surface->format->colorkey = 0; - } - SDL_InvalidateMap(surface->map); - return(0); + if (!surface) { + return SDL_SetError("SDL_SetSurfacePalette() passed a NULL surface"); + } + return SDL_SetPixelFormatPalette(surface->format, palette); } -/* This function sets the alpha channel of a surface */ -int SDL_SetAlpha (SDL_Surface *surface, Uint32 flag, Uint8 value) + +int +SDL_SetSurfaceRLE(SDL_Surface * surface, int flag) { - Uint32 oldflags = surface->flags; - Uint32 oldalpha = surface->format->alpha; - - /* Sanity check the flag as it gets passed in */ - if ( flag & SDL_SRCALPHA ) { - if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) { - flag = (SDL_SRCALPHA | SDL_RLEACCELOK); - } else { - flag = SDL_SRCALPHA; - } - } else { - flag = 0; - } - - /* Optimize away operations that don't change anything */ - if ( (flag == (surface->flags & (SDL_SRCALPHA|SDL_RLEACCELOK))) && - (!flag || value == oldalpha) ) { - return(0); - } - - if(!(flag & SDL_RLEACCELOK) && (surface->flags & SDL_RLEACCEL)) - SDL_UnRLESurface(surface, 1); - - if ( flag ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - surface->flags |= SDL_SRCALPHA; - surface->format->alpha = value; - if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) { - if ( (video->SetHWAlpha == NULL) || - (video->SetHWAlpha(this, surface, value) < 0) ) { - surface->flags &= ~SDL_HWACCEL; - } - } - if ( flag & SDL_RLEACCELOK ) { - surface->flags |= SDL_RLEACCELOK; - } else { - surface->flags &= ~SDL_RLEACCELOK; - } - } else { - surface->flags &= ~SDL_SRCALPHA; - surface->format->alpha = SDL_ALPHA_OPAQUE; - } - /* - * The representation for software surfaces is independent of - * per-surface alpha, so no need to invalidate the blit mapping - * if just the alpha value was changed. (If either is 255, we still - * need to invalidate.) - */ - if((surface->flags & SDL_HWACCEL) == SDL_HWACCEL - || oldflags != surface->flags - || (((oldalpha + 1) ^ (value + 1)) & 0x100)) - SDL_InvalidateMap(surface->map); - return(0); + int flags; + + if (!surface) { + return -1; + } + + flags = surface->map->info.flags; + if (flag) { + surface->map->info.flags |= SDL_COPY_RLE_DESIRED; + } else { + surface->map->info.flags &= ~SDL_COPY_RLE_DESIRED; + } + if (surface->map->info.flags != flags) { + SDL_InvalidateMap(surface->map); + } + return 0; } -int SDL_SetAlphaChannel(SDL_Surface *surface, Uint8 value) + +int +SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) { - int row, col; - int offset; - Uint8 *buf; - - if ( (surface->format->Amask != 0xFF000000) && - (surface->format->Amask != 0x000000FF) ) { - SDL_SetError("Unsupported surface alpha mask format"); - return -1; - } - -#if SDL_BYTEORDER == SDL_LIL_ENDIAN - if ( surface->format->Amask == 0xFF000000 ) { - offset = 3; - } else { - offset = 0; - } -#else - if ( surface->format->Amask == 0xFF000000 ) { - offset = 0; - } else { - offset = 3; - } -#endif /* Byte ordering */ - - /* Quickly set the alpha channel of an RGBA or ARGB surface */ - if ( SDL_MUSTLOCK(surface) ) { - if ( SDL_LockSurface(surface) < 0 ) { - return -1; - } - } - row = surface->h; - while (row--) { - col = surface->w; - buf = (Uint8 *)surface->pixels + row * surface->pitch + offset; - while(col--) { - *buf = value; - buf += 4; - } - } - if ( SDL_MUSTLOCK(surface) ) { - SDL_UnlockSurface(surface); - } - return 0; + int flags; + + if (!surface) { + return SDL_InvalidParamError("surface"); + } + + if (surface->format->palette && key >= ((Uint32) surface->format->palette->ncolors)) { + return SDL_InvalidParamError("key"); + } + + if (flag & SDL_RLEACCEL) { + SDL_SetSurfaceRLE(surface, 1); + } + + flags = surface->map->info.flags; + if (flag) { + surface->map->info.flags |= SDL_COPY_COLORKEY; + surface->map->info.colorkey = key; + if (surface->format->palette) { + surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_TRANSPARENT; + ++surface->format->palette->version; + if (!surface->format->palette->version) { + surface->format->palette->version = 1; + } + } + } else { + if (surface->format->palette) { + surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_OPAQUE; + ++surface->format->palette->version; + if (!surface->format->palette->version) { + surface->format->palette->version = 1; + } + } + surface->map->info.flags &= ~SDL_COPY_COLORKEY; + } + if (surface->map->info.flags != flags) { + SDL_InvalidateMap(surface->map); + } + + return 0; } -/* - * A function to calculate the intersection of two rectangles: - * return true if the rectangles intersect, false otherwise - */ -static __inline__ -SDL_bool SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *intersection) +int +SDL_GetColorKey(SDL_Surface * surface, Uint32 * key) { - int Amin, Amax, Bmin, Bmax; - - /* Horizontal intersection */ - Amin = A->x; - Amax = Amin + A->w; - Bmin = B->x; - Bmax = Bmin + B->w; - if(Bmin > Amin) - Amin = Bmin; - intersection->x = Amin; - if(Bmax < Amax) - Amax = Bmax; - intersection->w = Amax - Amin > 0 ? Amax - Amin : 0; - - /* Vertical intersection */ - Amin = A->y; - Amax = Amin + A->h; - Bmin = B->y; - Bmax = Bmin + B->h; - if(Bmin > Amin) - Amin = Bmin; - intersection->y = Amin; - if(Bmax < Amax) - Amax = Bmax; - intersection->h = Amax - Amin > 0 ? Amax - Amin : 0; - - return (intersection->w && intersection->h); + if (!surface) { + return -1; + } + + if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) { + return -1; + } + + if (key) { + *key = surface->map->info.colorkey; + } + return 0; } -/* - * Set the clipping rectangle for a blittable surface - */ -SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect) + +/* This is a fairly slow function to switch from colorkey to alpha */ +static void +SDL_ConvertColorkeyToAlpha(SDL_Surface * surface) { - SDL_Rect full_rect; - - /* Don't do anything if there's no surface to act on */ - if ( ! surface ) { - return SDL_FALSE; - } - - /* Set up the full surface rectangle */ - full_rect.x = 0; - full_rect.y = 0; - full_rect.w = surface->w; - full_rect.h = surface->h; - - /* Set the clipping rectangle */ - if ( ! rect ) { - surface->clip_rect = full_rect; - return 1; - } - return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect); + int x, y; + + if (!surface) { + return; + } + + if (!(surface->map->info.flags & SDL_COPY_COLORKEY) || + !surface->format->Amask) { + return; + } + + SDL_LockSurface(surface); + + switch (surface->format->BytesPerPixel) { + case 2: + { + Uint16 *row, *spot; + Uint16 ckey = (Uint16) surface->map->info.colorkey; + Uint16 mask = (Uint16) (~surface->format->Amask); + + /* Ignore alpha in colorkey comparison */ + ckey &= mask; + row = (Uint16 *) surface->pixels; + for (y = surface->h; y--;) { + spot = row; + for (x = surface->w; x--;) { + if ((*spot & mask) == ckey) { + *spot &= mask; + } + ++spot; + } + row += surface->pitch / 2; + } + } + break; + case 3: + /* FIXME */ + break; + case 4: + { + Uint32 *row, *spot; + Uint32 ckey = surface->map->info.colorkey; + Uint32 mask = ~surface->format->Amask; + + /* Ignore alpha in colorkey comparison */ + ckey &= mask; + row = (Uint32 *) surface->pixels; + for (y = surface->h; y--;) { + spot = row; + for (x = surface->w; x--;) { + if ((*spot & mask) == ckey) { + *spot &= mask; + } + ++spot; + } + row += surface->pitch / 4; + } + } + break; + } + + SDL_UnlockSurface(surface); + + SDL_SetColorKey(surface, 0, 0); + SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND); } -void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) + +int +SDL_SetSurfaceColorMod(SDL_Surface * surface, Uint8 r, Uint8 g, Uint8 b) +{ + int flags; + + if (!surface) { + return -1; + } + + surface->map->info.r = r; + surface->map->info.g = g; + surface->map->info.b = b; + + flags = surface->map->info.flags; + if (r != 0xFF || g != 0xFF || b != 0xFF) { + surface->map->info.flags |= SDL_COPY_MODULATE_COLOR; + } else { + surface->map->info.flags &= ~SDL_COPY_MODULATE_COLOR; + } + if (surface->map->info.flags != flags) { + SDL_InvalidateMap(surface->map); + } + return 0; +} + + +int +SDL_GetSurfaceColorMod(SDL_Surface * surface, Uint8 * r, Uint8 * g, Uint8 * b) +{ + if (!surface) { + return -1; + } + + if (r) { + *r = surface->map->info.r; + } + if (g) { + *g = surface->map->info.g; + } + if (b) { + *b = surface->map->info.b; + } + return 0; +} + +int +SDL_SetSurfaceAlphaMod(SDL_Surface * surface, Uint8 alpha) { - if ( surface && rect ) { - *rect = surface->clip_rect; - } + int flags; + + if (!surface) { + return -1; + } + + surface->map->info.a = alpha; + + flags = surface->map->info.flags; + if (alpha != 0xFF) { + surface->map->info.flags |= SDL_COPY_MODULATE_ALPHA; + } else { + surface->map->info.flags &= ~SDL_COPY_MODULATE_ALPHA; + } + if (surface->map->info.flags != flags) { + SDL_InvalidateMap(surface->map); + } + return 0; } -/* + +int +SDL_GetSurfaceAlphaMod(SDL_Surface * surface, Uint8 * alpha) +{ + if (!surface) { + return -1; + } + + if (alpha) { + *alpha = surface->map->info.a; + } + return 0; +} + +int +SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode) +{ + int flags, status; + + if (!surface) { + return -1; + } + + status = 0; + flags = surface->map->info.flags; + surface->map->info.flags &= + ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD); + switch (blendMode) { + case SDL_BLENDMODE_NONE: + break; + case SDL_BLENDMODE_BLEND: + surface->map->info.flags |= SDL_COPY_BLEND; + break; + case SDL_BLENDMODE_ADD: + surface->map->info.flags |= SDL_COPY_ADD; + break; + case SDL_BLENDMODE_MOD: + surface->map->info.flags |= SDL_COPY_MOD; + break; + default: + status = SDL_Unsupported(); + break; + } + + if (surface->map->info.flags != flags) { + SDL_InvalidateMap(surface->map); + } + + return status; +} + +int +SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode) +{ + if (!surface) { + return -1; + } + + if (!blendMode) { + return 0; + } + + switch (surface->map-> + info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) { + case SDL_COPY_BLEND: + *blendMode = SDL_BLENDMODE_BLEND; + break; + case SDL_COPY_ADD: + *blendMode = SDL_BLENDMODE_ADD; + break; + case SDL_COPY_MOD: + *blendMode = SDL_BLENDMODE_MOD; + break; + default: + *blendMode = SDL_BLENDMODE_NONE; + break; + } + return 0; +} + +SDL_bool +SDL_SetClipRect(SDL_Surface * surface, const SDL_Rect * rect) +{ + SDL_Rect full_rect; + + /* Don't do anything if there's no surface to act on */ + if (!surface) { + return SDL_FALSE; + } + + /* Set up the full surface rectangle */ + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = surface->w; + full_rect.h = surface->h; + + /* Set the clipping rectangle */ + if (!rect) { + surface->clip_rect = full_rect; + return SDL_TRUE; + } + return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect); +} + +void +SDL_GetClipRect(SDL_Surface * surface, SDL_Rect * rect) +{ + if (surface && rect) { + *rect = surface->clip_rect; + } +} + +/* * Set up a blit between two surfaces -- split into three parts: - * The upper part, SDL_UpperBlit(), performs clipping and rectangle + * The upper part, SDL_UpperBlit(), performs clipping and rectangle * verification. The lower part is a pointer to a low level * accelerated blitting function. * - * These parts are separated out and each used internally by this + * These parts are separated out and each used internally by this * library in the optimimum places. They are exported so that if * you know exactly what you are doing, you can optimize your code * by calling the one(s) you need. */ -int SDL_LowerBlit (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect) +int +SDL_LowerBlit(SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect) { - SDL_blit do_blit; - SDL_Rect hw_srcrect; - SDL_Rect hw_dstrect; - - /* Check to make sure the blit mapping is valid */ - if ( (src->map->dst != dst) || - (src->map->dst->format_version != src->map->format_version) ) { - if ( SDL_MapSurface(src, dst) < 0 ) { - return(-1); - } - } - - /* Figure out which blitter to use */ - if ( (src->flags & SDL_HWACCEL) == SDL_HWACCEL ) { - if ( src == SDL_VideoSurface ) { - hw_srcrect = *srcrect; - hw_srcrect.x += current_video->offset_x; - hw_srcrect.y += current_video->offset_y; - srcrect = &hw_srcrect; - } - if ( dst == SDL_VideoSurface ) { - hw_dstrect = *dstrect; - hw_dstrect.x += current_video->offset_x; - hw_dstrect.y += current_video->offset_y; - dstrect = &hw_dstrect; - } - do_blit = src->map->hw_blit; - } else { - do_blit = src->map->sw_blit; - } - return(do_blit(src, srcrect, dst, dstrect)); + /* Check to make sure the blit mapping is valid */ + if ((src->map->dst != dst) || + (dst->format->palette && + src->map->dst_palette_version != dst->format->palette->version) || + (src->format->palette && + src->map->src_palette_version != src->format->palette->version)) { + if (SDL_MapSurface(src, dst) < 0) { + return (-1); + } + /* just here for debugging */ +/* printf */ +/* ("src = 0x%08X src->flags = %08X src->map->info.flags = %08x\ndst = 0x%08X dst->flags = %08X dst->map->info.flags = %08X\nsrc->map->blit = 0x%08x\n", */ +/* src, dst->flags, src->map->info.flags, dst, dst->flags, */ +/* dst->map->info.flags, src->map->blit); */ + } + return (src->map->blit(src, srcrect, dst, dstrect)); } -int SDL_UpperBlit (SDL_Surface *src, SDL_Rect *srcrect, - SDL_Surface *dst, SDL_Rect *dstrect) +int +SDL_UpperBlit(SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect) { - SDL_Rect fulldst; - int srcx, srcy, w, h; - - /* Make sure the surfaces aren't locked */ - if ( ! src || ! dst ) { - SDL_SetError("SDL_UpperBlit: passed a NULL surface"); - return(-1); - } - if ( src->locked || dst->locked ) { - SDL_SetError("Surfaces must not be locked during blit"); - return(-1); - } - - /* If the destination rectangle is NULL, use the entire dest surface */ - if ( dstrect == NULL ) { - fulldst.x = fulldst.y = 0; - dstrect = &fulldst; - } - - /* clip the source rectangle to the source surface */ - if(srcrect) { - int maxw, maxh; - - srcx = srcrect->x; - w = srcrect->w; - if(srcx < 0) { - w += srcx; - dstrect->x -= srcx; - srcx = 0; - } - maxw = src->w - srcx; - if(maxw < w) - w = maxw; - - srcy = srcrect->y; - h = srcrect->h; - if(srcy < 0) { - h += srcy; - dstrect->y -= srcy; - srcy = 0; - } - maxh = src->h - srcy; - if(maxh < h) - h = maxh; - - } else { - srcx = srcy = 0; - w = src->w; - h = src->h; - } - - /* clip the destination rectangle against the clip rectangle */ - { - SDL_Rect *clip = &dst->clip_rect; - int dx, dy; - - dx = clip->x - dstrect->x; - if(dx > 0) { - w -= dx; - dstrect->x += dx; - srcx += dx; - } - dx = dstrect->x + w - clip->x - clip->w; - if(dx > 0) - w -= dx; - - dy = clip->y - dstrect->y; - if(dy > 0) { - h -= dy; - dstrect->y += dy; - srcy += dy; - } - dy = dstrect->y + h - clip->y - clip->h; - if(dy > 0) - h -= dy; - } - - if(w > 0 && h > 0) { - SDL_Rect sr; - sr.x = srcx; - sr.y = srcy; - sr.w = dstrect->w = w; - sr.h = dstrect->h = h; - return SDL_LowerBlit(src, &sr, dst, dstrect); - } - dstrect->w = dstrect->h = 0; - return 0; + SDL_Rect fulldst; + int srcx, srcy, w, h; + + /* Make sure the surfaces aren't locked */ + if (!src || !dst) { + return SDL_SetError("SDL_UpperBlit: passed a NULL surface"); + } + if (src->locked || dst->locked) { + return SDL_SetError("Surfaces must not be locked during blit"); + } + + /* If the destination rectangle is NULL, use the entire dest surface */ + if (dstrect == NULL) { + fulldst.x = fulldst.y = 0; + fulldst.w = dst->w; + fulldst.h = dst->h; + dstrect = &fulldst; + } + + /* clip the source rectangle to the source surface */ + if (srcrect) { + int maxw, maxh; + + srcx = srcrect->x; + w = srcrect->w; + if (srcx < 0) { + w += srcx; + dstrect->x -= srcx; + srcx = 0; + } + maxw = src->w - srcx; + if (maxw < w) + w = maxw; + + srcy = srcrect->y; + h = srcrect->h; + if (srcy < 0) { + h += srcy; + dstrect->y -= srcy; + srcy = 0; + } + maxh = src->h - srcy; + if (maxh < h) + h = maxh; + + } else { + srcx = srcy = 0; + w = src->w; + h = src->h; + } + + /* clip the destination rectangle against the clip rectangle */ + { + SDL_Rect *clip = &dst->clip_rect; + int dx, dy; + + dx = clip->x - dstrect->x; + if (dx > 0) { + w -= dx; + dstrect->x += dx; + srcx += dx; + } + dx = dstrect->x + w - clip->x - clip->w; + if (dx > 0) + w -= dx; + + dy = clip->y - dstrect->y; + if (dy > 0) { + h -= dy; + dstrect->y += dy; + srcy += dy; + } + dy = dstrect->y + h - clip->y - clip->h; + if (dy > 0) + h -= dy; + } + + if (w > 0 && h > 0) { + SDL_Rect sr; + sr.x = srcx; + sr.y = srcy; + sr.w = dstrect->w = w; + sr.h = dstrect->h = h; + return SDL_LowerBlit(src, &sr, dst, dstrect); + } + dstrect->w = dstrect->h = 0; + return 0; } -static int SDL_FillRect1(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) +int +SDL_UpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect) { - /* FIXME: We have to worry about packing order.. *sigh* */ - SDL_SetError("1-bpp rect fill not yet implemented"); - return -1; + SDL_Rect final_src, final_dst, fulldst; + + /* Make sure the surfaces aren't locked */ + if (!src || !dst) { + return SDL_SetError("SDL_UpperBlitScaled: passed a NULL surface"); + } + if (src->locked || dst->locked) { + return SDL_SetError("Surfaces must not be locked during blit"); + } + + /* If the destination rectangle is NULL, use the entire dest surface */ + if (dstrect == NULL) { + fulldst.x = fulldst.y = 0; + fulldst.w = dst->w; + fulldst.h = dst->h; + dstrect = &fulldst; + } + + /* clip the source rectangle to the source surface */ + if (srcrect) { + int maxw, maxh; + + final_src.x = srcrect->x; + final_src.w = srcrect->w; + if (final_src.x < 0) { + final_src.w += final_src.x; + final_src.x = 0; + } + maxw = src->w - final_src.x; + if (maxw < final_src.w) + final_src.w = maxw; + + final_src.y = srcrect->y; + final_src.h = srcrect->h; + if (final_src.y < 0) { + final_src.h += final_src.y; + final_src.y = 0; + } + maxh = src->h - final_src.y; + if (maxh < final_src.h) + final_src.h = maxh; + + } else { + final_src.x = final_src.y = 0; + final_src.w = src->w; + final_src.h = src->h; + } + + /* clip the destination rectangle against the clip rectangle */ + if (dstrect) { + int maxw, maxh; + + final_dst.x = dstrect->x; + final_dst.w = dstrect->w; + if (final_dst.x < 0) { + final_dst.w += final_dst.x; + final_dst.x = 0; + } + maxw = dst->w - final_dst.x; + if (maxw < final_dst.w) + final_dst.w = maxw; + + final_dst.y = dstrect->y; + final_dst.h = dstrect->h; + if (final_dst.y < 0) { + final_dst.h += final_dst.y; + final_dst.y = 0; + } + maxh = dst->h - final_dst.y; + if (maxh < final_dst.h) + final_dst.h = maxh; + } else { + final_dst.x = final_dst.y = 0; + final_dst.w = dst->w; + final_dst.h = dst->h; + } + + if (final_dst.w > 0 && final_dst.h > 0) { + return SDL_LowerBlitScaled(src, &final_src, dst, &final_dst); + } + + return 0; } -static int SDL_FillRect4(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) -{ - /* FIXME: We have to worry about packing order.. *sigh* */ - SDL_SetError("4-bpp rect fill not yet implemented"); - return -1; -} - -/* - * This function performs a fast fill of the given rectangle with 'color' +/** + * This is a semi-private blit function and it performs low-level surface + * scaled blitting only. */ -int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) +int +SDL_LowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - int x, y; - Uint8 *row; - - /* This function doesn't work on surfaces < 8 bpp */ - if ( dst->format->BitsPerPixel < 8 ) { - switch(dst->format->BitsPerPixel) { - case 1: - return SDL_FillRect1(dst, dstrect, color); - break; - case 4: - return SDL_FillRect4(dst, dstrect, color); - break; - default: - SDL_SetError("Fill rect on unsupported surface format"); - return(-1); - break; - } - } - - /* If 'dstrect' == NULL, then fill the whole surface */ - if ( dstrect ) { - /* Perform clipping */ - if ( !SDL_IntersectRect(dstrect, &dst->clip_rect, dstrect) ) { - return(0); - } - } else { - dstrect = &dst->clip_rect; - } - - /* Check for hardware acceleration */ - if ( ((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) && - video->info.blit_fill ) { - SDL_Rect hw_rect; - if ( dst == SDL_VideoSurface ) { - hw_rect = *dstrect; - hw_rect.x += current_video->offset_x; - hw_rect.y += current_video->offset_y; - dstrect = &hw_rect; - } - return(video->FillHWRect(this, dst, dstrect, color)); - } - - /* Perform software fill */ - if ( SDL_LockSurface(dst) != 0 ) { - return(-1); - } - row = (Uint8 *)dst->pixels+dstrect->y*dst->pitch+ - dstrect->x*dst->format->BytesPerPixel; - if ( dst->format->palette || (color == 0) ) { - x = dstrect->w*dst->format->BytesPerPixel; - if ( !color && !((uintptr_t)row&3) && !(x&3) && !(dst->pitch&3) ) { - int n = x >> 2; - for ( y=dstrect->h; y; --y ) { - SDL_memset4(row, 0, n); - row += dst->pitch; - } - } else { -#ifdef __powerpc__ - /* - * SDL_memset() on PPC (both glibc and codewarrior) uses - * the dcbz (Data Cache Block Zero) instruction, which - * causes an alignment exception if the destination is - * uncachable, so only use it on software surfaces - */ - if((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) { - if(dstrect->w >= 8) { - /* - * 64-bit stores are probably most - * efficient to uncached video memory - */ - double fill; - SDL_memset(&fill, color, (sizeof fill)); - for(y = dstrect->h; y; y--) { - Uint8 *d = row; - unsigned n = x; - unsigned nn; - Uint8 c = color; - double f = fill; - while((unsigned long)d - & (sizeof(double) - 1)) { - *d++ = c; - n--; - } - nn = n / (sizeof(double) * 4); - while(nn) { - ((double *)d)[0] = f; - ((double *)d)[1] = f; - ((double *)d)[2] = f; - ((double *)d)[3] = f; - d += 4*sizeof(double); - nn--; - } - n &= ~(sizeof(double) * 4 - 1); - nn = n / sizeof(double); - while(nn) { - *(double *)d = f; - d += sizeof(double); - nn--; - } - n &= ~(sizeof(double) - 1); - while(n) { - *d++ = c; - n--; - } - row += dst->pitch; - } - } else { - /* narrow boxes */ - for(y = dstrect->h; y; y--) { - Uint8 *d = row; - Uint8 c = color; - int n = x; - while(n) { - *d++ = c; - n--; - } - row += dst->pitch; - } - } - } else -#endif /* __powerpc__ */ - { - for(y = dstrect->h; y; y--) { - SDL_memset(row, color, x); - row += dst->pitch; - } - } - } - } else { - switch (dst->format->BytesPerPixel) { - case 2: - for ( y=dstrect->h; y; --y ) { - Uint16 *pixels = (Uint16 *)row; - Uint16 c = (Uint16)color; - Uint32 cc = (Uint32)c << 16 | c; - int n = dstrect->w; - if((uintptr_t)pixels & 3) { - *pixels++ = c; - n--; - } - if(n >> 1) - SDL_memset4(pixels, cc, n >> 1); - if(n & 1) - pixels[n - 1] = c; - row += dst->pitch; - } - break; - - case 3: - #if SDL_BYTEORDER == SDL_BIG_ENDIAN - color <<= 8; - #endif - for ( y=dstrect->h; y; --y ) { - Uint8 *pixels = row; - for ( x=dstrect->w; x; --x ) { - SDL_memcpy(pixels, &color, 3); - pixels += 3; - } - row += dst->pitch; - } - break; - - case 4: - for(y = dstrect->h; y; --y) { - SDL_memset4(row, color, dstrect->w); - row += dst->pitch; - } - break; - } - } - SDL_UnlockSurface(dst); - - /* We're done! */ - return(0); + static const Uint32 complex_copy_flags = ( + SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | + SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | + SDL_COPY_COLORKEY + ); + + /* Save off the original dst width, height */ + int dstW = dstrect->w; + int dstH = dstrect->h; + SDL_Rect full_rect; + SDL_Rect final_dst = *dstrect; + SDL_Rect final_src = *srcrect; + + /* Clip the dst surface to the dstrect */ + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = dst->w; + full_rect.h = dst->h; + if (!SDL_IntersectRect(&final_dst, &full_rect, &final_dst)) { + return 0; + } + + /* Did the dst width change? */ + if ( dstW != final_dst.w ) { + /* scale the src width appropriately */ + final_src.w = final_src.w * dst->clip_rect.w / dstW; + } + + /* Did the dst height change? */ + if ( dstH != final_dst.h ) { + /* scale the src width appropriately */ + final_src.h = final_src.h * dst->clip_rect.h / dstH; + } + + /* Clip the src surface to the srcrect */ + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = src->w; + full_rect.h = src->h; + if (!SDL_IntersectRect(&final_src, &full_rect, &final_src)) { + return 0; + } + + src->map->info.flags |= SDL_COPY_NEAREST; + + if ( !(src->map->info.flags & complex_copy_flags) && + src->format->format == dst->format->format && + !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) { + return SDL_SoftStretch( src, &final_src, dst, &final_dst ); + } else { + return SDL_LowerBlit( src, &final_src, dst, &final_dst ); + } } /* * Lock a surface to directly access the pixels */ -int SDL_LockSurface (SDL_Surface *surface) +int +SDL_LockSurface(SDL_Surface * surface) { - if ( ! surface->locked ) { - /* Perform the lock */ - if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - if ( video->LockHWSurface(this, surface) < 0 ) { - return(-1); - } - } - if ( surface->flags & SDL_RLEACCEL ) { - SDL_UnRLESurface(surface, 1); - surface->flags |= SDL_RLEACCEL; /* save accel'd state */ - } - /* This needs to be done here in case pixels changes value */ - surface->pixels = (Uint8 *)surface->pixels + surface->offset; - } - - /* Increment the surface lock count, for recursive locks */ - ++surface->locked; - - /* Ready to go.. */ - return(0); + if (!surface->locked) { + /* Perform the lock */ + if (surface->flags & SDL_RLEACCEL) { + SDL_UnRLESurface(surface, 1); + surface->flags |= SDL_RLEACCEL; /* save accel'd state */ + } + } + + /* Increment the surface lock count, for recursive locks */ + ++surface->locked; + + /* Ready to go.. */ + return (0); } + /* * Unlock a previously locked surface */ -void SDL_UnlockSurface (SDL_Surface *surface) +void +SDL_UnlockSurface(SDL_Surface * surface) { - /* Only perform an unlock if we are locked */ - if ( ! surface->locked || (--surface->locked > 0) ) { - return; - } - - /* Perform the unlock */ - surface->pixels = (Uint8 *)surface->pixels - surface->offset; - - /* Unlock hardware or accelerated surfaces */ - if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - video->UnlockHWSurface(this, surface); - } else { - /* Update RLE encoded surface with new data */ - if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - surface->flags &= ~SDL_RLEACCEL; /* stop lying */ - SDL_RLESurface(surface); - } - } + /* Only perform an unlock if we are locked */ + if (!surface->locked || (--surface->locked > 0)) { + return; + } + + /* Update RLE encoded surface with new data */ + if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { + surface->flags &= ~SDL_RLEACCEL; /* stop lying */ + SDL_RLESurface(surface); + } } -/* +/* * Convert a surface into the specified pixel format. */ -SDL_Surface * SDL_ConvertSurface (SDL_Surface *surface, - SDL_PixelFormat *format, Uint32 flags) +SDL_Surface * +SDL_ConvertSurface(SDL_Surface * surface, SDL_PixelFormat * format, + Uint32 flags) { - SDL_Surface *convert; - Uint32 colorkey = 0; - Uint8 alpha = 0; - Uint32 surface_flags; - SDL_Rect bounds; - - /* Check for empty destination palette! (results in empty image) */ - if ( format->palette != NULL ) { - int i; - for ( i=0; ipalette->ncolors; ++i ) { - if ( (format->palette->colors[i].r != 0) || - (format->palette->colors[i].g != 0) || - (format->palette->colors[i].b != 0) ) - break; - } - if ( i == format->palette->ncolors ) { - SDL_SetError("Empty destination palette"); - return(NULL); - } - } - - /* Only create hw surfaces with alpha channel if hw alpha blits - are supported */ - if(format->Amask != 0 && (flags & SDL_HWSURFACE)) { - const SDL_VideoInfo *vi = SDL_GetVideoInfo(); - if(!vi || !vi->blit_hw_A) - flags &= ~SDL_HWSURFACE; - } - - /* Create a new surface with the desired format */ - convert = SDL_CreateRGBSurface(flags, - surface->w, surface->h, format->BitsPerPixel, - format->Rmask, format->Gmask, format->Bmask, format->Amask); - if ( convert == NULL ) { - return(NULL); - } - - /* Copy the palette if any */ - if ( format->palette && convert->format->palette ) { - SDL_memcpy(convert->format->palette->colors, - format->palette->colors, - format->palette->ncolors*sizeof(SDL_Color)); - convert->format->palette->ncolors = format->palette->ncolors; - } - - /* Save the original surface color key and alpha */ - surface_flags = surface->flags; - if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) { - /* Convert colourkeyed surfaces to RGBA if requested */ - if((flags & SDL_SRCCOLORKEY) != SDL_SRCCOLORKEY - && format->Amask) { - surface_flags &= ~SDL_SRCCOLORKEY; - } else { - colorkey = surface->format->colorkey; - SDL_SetColorKey(surface, 0, 0); - } - } - if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { - /* Copy over the alpha channel to RGBA if requested */ - if ( format->Amask ) { - surface->flags &= ~SDL_SRCALPHA; - } else { - alpha = surface->format->alpha; - SDL_SetAlpha(surface, 0, 0); - } - } - - /* Copy over the image data */ - bounds.x = 0; - bounds.y = 0; - bounds.w = surface->w; - bounds.h = surface->h; - SDL_LowerBlit(surface, &bounds, convert, &bounds); - - /* Clean up the original surface, and update converted surface */ - if ( convert != NULL ) { - SDL_SetClipRect(convert, &surface->clip_rect); - } - if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) { - Uint32 cflags = surface_flags&(SDL_SRCCOLORKEY|SDL_RLEACCELOK); - if ( convert != NULL ) { - Uint8 keyR, keyG, keyB; - - SDL_GetRGB(colorkey,surface->format,&keyR,&keyG,&keyB); - SDL_SetColorKey(convert, cflags|(flags&SDL_RLEACCELOK), - SDL_MapRGB(convert->format, keyR, keyG, keyB)); - } - SDL_SetColorKey(surface, cflags, colorkey); - } - if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { - Uint32 aflags = surface_flags&(SDL_SRCALPHA|SDL_RLEACCELOK); - if ( convert != NULL ) { - SDL_SetAlpha(convert, aflags|(flags&SDL_RLEACCELOK), - alpha); - } - if ( format->Amask ) { - surface->flags |= SDL_SRCALPHA; - } else { - SDL_SetAlpha(surface, aflags, alpha); - } - } - - /* We're ready to go! */ - return(convert); + SDL_Surface *convert; + Uint32 copy_flags; + SDL_Color copy_color; + SDL_Rect bounds; + + /* Check for empty destination palette! (results in empty image) */ + if (format->palette != NULL) { + int i; + for (i = 0; i < format->palette->ncolors; ++i) { + if ((format->palette->colors[i].r != 0xFF) || + (format->palette->colors[i].g != 0xFF) || + (format->palette->colors[i].b != 0xFF)) + break; + } + if (i == format->palette->ncolors) { + SDL_SetError("Empty destination palette"); + return (NULL); + } + } + + /* Create a new surface with the desired format */ + convert = SDL_CreateRGBSurface(flags, surface->w, surface->h, + format->BitsPerPixel, format->Rmask, + format->Gmask, format->Bmask, + format->Amask); + if (convert == NULL) { + return (NULL); + } + + /* Copy the palette if any */ + if (format->palette && convert->format->palette) { + SDL_memcpy(convert->format->palette->colors, + format->palette->colors, + format->palette->ncolors * sizeof(SDL_Color)); + convert->format->palette->ncolors = format->palette->ncolors; + } + + /* Save the original copy flags */ + copy_flags = surface->map->info.flags; + copy_color.r = surface->map->info.r; + copy_color.g = surface->map->info.g; + copy_color.b = surface->map->info.b; + copy_color.a = surface->map->info.a; + surface->map->info.r = 0xFF; + surface->map->info.g = 0xFF; + surface->map->info.b = 0xFF; + surface->map->info.a = 0xFF; + surface->map->info.flags = 0; + SDL_InvalidateMap(surface->map); + + /* Copy over the image data */ + bounds.x = 0; + bounds.y = 0; + bounds.w = surface->w; + bounds.h = surface->h; + SDL_LowerBlit(surface, &bounds, convert, &bounds); + + /* Clean up the original surface, and update converted surface */ + convert->map->info.r = copy_color.r; + convert->map->info.g = copy_color.g; + convert->map->info.b = copy_color.b; + convert->map->info.a = copy_color.a; + convert->map->info.flags = + (copy_flags & + ~(SDL_COPY_COLORKEY | SDL_COPY_BLEND + | SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY | + SDL_COPY_RLE_ALPHAKEY)); + surface->map->info.r = copy_color.r; + surface->map->info.g = copy_color.g; + surface->map->info.b = copy_color.b; + surface->map->info.a = copy_color.a; + surface->map->info.flags = copy_flags; + SDL_InvalidateMap(surface->map); + if (copy_flags & SDL_COPY_COLORKEY) { + SDL_bool set_colorkey_by_color = SDL_FALSE; + + if (surface->format->palette) { + if (format->palette && + surface->format->palette->ncolors <= format->palette->ncolors && + (SDL_memcmp(surface->format->palette->colors, format->palette->colors, + surface->format->palette->ncolors * sizeof(SDL_Color)) == 0)) { + /* The palette is identical, just set the same colorkey */ + SDL_SetColorKey(convert, 1, surface->map->info.colorkey); + } else if (format->Amask) { + /* The alpha was set in the destination from the palette */ + } else { + set_colorkey_by_color = SDL_TRUE; + } + } else { + set_colorkey_by_color = SDL_TRUE; + } + + if (set_colorkey_by_color) { + /* Set the colorkey by color, which needs to be unique */ + Uint8 keyR, keyG, keyB, keyA; + + SDL_GetRGBA(surface->map->info.colorkey, surface->format, &keyR, + &keyG, &keyB, &keyA); + SDL_SetColorKey(convert, 1, + SDL_MapRGBA(convert->format, keyR, keyG, keyB, keyA)); + /* This is needed when converting for 3D texture upload */ + SDL_ConvertColorkeyToAlpha(convert); + } + } + SDL_SetClipRect(convert, &surface->clip_rect); + + /* Enable alpha blending by default if the new surface has an + * alpha channel or alpha modulation */ + if ((surface->format->Amask && format->Amask) || + (copy_flags & (SDL_COPY_COLORKEY|SDL_COPY_MODULATE_ALPHA))) { + SDL_SetSurfaceBlendMode(convert, SDL_BLENDMODE_BLEND); + } + if ((copy_flags & SDL_COPY_RLE_DESIRED) || (flags & SDL_RLEACCEL)) { + SDL_SetSurfaceRLE(convert, SDL_RLEACCEL); + } + + /* We're ready to go! */ + return (convert); +} + +SDL_Surface * +SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format, + Uint32 flags) +{ + SDL_PixelFormat *fmt; + SDL_Surface *convert = NULL; + + fmt = SDL_AllocFormat(pixel_format); + if (fmt) { + convert = SDL_ConvertSurface(surface, fmt, flags); + SDL_FreeFormat(fmt); + } + return convert; +} + +/* + * Create a surface on the stack for quick blit operations + */ +static __inline__ SDL_bool +SDL_CreateSurfaceOnStack(int width, int height, Uint32 pixel_format, + void * pixels, int pitch, SDL_Surface * surface, + SDL_PixelFormat * format, SDL_BlitMap * blitmap) +{ + if (SDL_ISPIXELFORMAT_INDEXED(pixel_format)) { + SDL_SetError("Indexed pixel formats not supported"); + return SDL_FALSE; + } + if (SDL_InitFormat(format, pixel_format) < 0) { + return SDL_FALSE; + } + + SDL_zerop(surface); + surface->flags = SDL_PREALLOC; + surface->format = format; + surface->pixels = pixels; + surface->w = width; + surface->h = height; + surface->pitch = pitch; + /* We don't actually need to set up the clip rect for our purposes */ + /*SDL_SetClipRect(surface, NULL);*/ + + /* Allocate an empty mapping */ + SDL_zerop(blitmap); + blitmap->info.r = 0xFF; + blitmap->info.g = 0xFF; + blitmap->info.b = 0xFF; + blitmap->info.a = 0xFF; + surface->map = blitmap; + + /* The surface is ready to go */ + surface->refcount = 1; + return SDL_TRUE; +} + +/* + * Copy a block of pixels of one format to another format + */ +int SDL_ConvertPixels(int width, int height, + Uint32 src_format, const void * src, int src_pitch, + Uint32 dst_format, void * dst, int dst_pitch) +{ + SDL_Surface src_surface, dst_surface; + SDL_PixelFormat src_fmt, dst_fmt; + SDL_BlitMap src_blitmap, dst_blitmap; + SDL_Rect rect; + void *nonconst_src = (void *) src; + + /* Check to make sure we are bliting somewhere, so we don't crash */ + if (!dst) { + return SDL_InvalidParamError("dst"); + } + if (!dst_pitch) { + return SDL_InvalidParamError("dst_pitch"); + } + + /* Fast path for same format copy */ + if (src_format == dst_format) { + int bpp; + + if (SDL_ISPIXELFORMAT_FOURCC(src_format)) { + switch (src_format) { + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + case SDL_PIXELFORMAT_YUY2: + case SDL_PIXELFORMAT_UYVY: + case SDL_PIXELFORMAT_YVYU: + bpp = 2; + break; + default: + return SDL_SetError("Unknown FOURCC pixel format"); + } + } else { + bpp = SDL_BYTESPERPIXEL(src_format); + } + width *= bpp; + + while (height-- > 0) { + SDL_memcpy(dst, src, width); + src = (Uint8*)src + src_pitch; + dst = (Uint8*)dst + dst_pitch; + } + return 0; + } + + if (!SDL_CreateSurfaceOnStack(width, height, src_format, nonconst_src, + src_pitch, + &src_surface, &src_fmt, &src_blitmap)) { + return -1; + } + if (!SDL_CreateSurfaceOnStack(width, height, dst_format, dst, dst_pitch, + &dst_surface, &dst_fmt, &dst_blitmap)) { + return -1; + } + + /* Set up the rect and go! */ + rect.x = 0; + rect.y = 0; + rect.w = width; + rect.h = height; + return SDL_LowerBlit(&src_surface, &rect, &dst_surface, &rect); } /* * Free a surface created by the above function. */ -void SDL_FreeSurface (SDL_Surface *surface) +void +SDL_FreeSurface(SDL_Surface * surface) { - /* Free anything that's not NULL, and not the screen surface */ - if ((surface == NULL) || - (current_video && - ((surface == SDL_ShadowSurface)||(surface == SDL_VideoSurface)))) { - return; - } - if ( --surface->refcount > 0 ) { - return; - } - while ( surface->locked > 0 ) { - SDL_UnlockSurface(surface); - } - if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { - SDL_UnRLESurface(surface, 0); - } - if ( surface->format ) { - SDL_FreeFormat(surface->format); - surface->format = NULL; - } - if ( surface->map != NULL ) { - SDL_FreeBlitMap(surface->map); - surface->map = NULL; - } - if ( surface->hwdata ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - video->FreeHWSurface(this, surface); - } - if ( surface->pixels && - ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC) ) { - SDL_free(surface->pixels); - } - SDL_free(surface); -#ifdef CHECK_LEAKS - --surfaces_allocated; -#endif + if (surface == NULL) { + return; + } + if (surface->flags & SDL_DONTFREE) { + return; + } + if (--surface->refcount > 0) { + return; + } + while (surface->locked > 0) { + SDL_UnlockSurface(surface); + } + if (surface->flags & SDL_RLEACCEL) { + SDL_UnRLESurface(surface, 0); + } + if (surface->format) { + SDL_SetSurfacePalette(surface, NULL); + SDL_FreeFormat(surface->format); + surface->format = NULL; + } + if (surface->map != NULL) { + SDL_FreeBlitMap(surface->map); + surface->map = NULL; + } + if (surface->pixels && ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC)) { + SDL_free(surface->pixels); + } + SDL_free(surface); } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 436450e330..4973648c79 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -1,424 +1,389 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" #ifndef _SDL_sysvideo_h #define _SDL_sysvideo_h -#include "SDL_mouse.h" -#define SDL_PROTOTYPES_ONLY -#include "SDL_syswm.h" -#undef SDL_PROTOTYPES_ONLY - -/* This file prototypes the video driver implementation. - This is designed to be easily converted to C++ in the future. - */ - -#if SDL_VIDEO_OPENGL -#include "SDL_opengl.h" -#endif /* SDL_VIDEO_OPENGL */ +#include "SDL_messagebox.h" +#include "SDL_shape.h" +#include "SDL_thread.h" /* The SDL video driver */ + +typedef struct SDL_WindowShaper SDL_WindowShaper; +typedef struct SDL_ShapeDriver SDL_ShapeDriver; +typedef struct SDL_VideoDisplay SDL_VideoDisplay; typedef struct SDL_VideoDevice SDL_VideoDevice; -/* Define the SDL video driver structure */ -#define _THIS SDL_VideoDevice *_this -#ifndef _STATUS -#define _STATUS SDL_status *status -#endif -struct SDL_VideoDevice { - /* * * */ - /* The name of this video driver */ - const char *name; - - /* * * */ - /* Initialization/Query functions */ - - /* Initialize the native video subsystem, filling 'vformat' with the - "best" display pixel format, returning 0 or -1 if there's an error. - */ - int (*VideoInit)(_THIS, SDL_PixelFormat *vformat); - - /* List the available video modes for the given pixel format, sorted - from largest to smallest. - */ - SDL_Rect **(*ListModes)(_THIS, SDL_PixelFormat *format, Uint32 flags); - - /* Set the requested video mode, returning a surface which will be - set to the SDL_VideoSurface. The width and height will already - be verified by ListModes(), and the video subsystem is free to - set the mode to a supported bit depth different from the one - specified -- the desired bpp will be emulated with a shadow - surface if necessary. If a new mode is returned, this function - should take care of cleaning up the current mode. - */ - SDL_Surface *(*SetVideoMode)(_THIS, SDL_Surface *current, - int width, int height, int bpp, Uint32 flags); - - /* Toggle the fullscreen mode */ - int (*ToggleFullScreen)(_THIS, int on); - - /* This is called after the video mode has been set, to get the - initial mouse state. It should queue events as necessary to - properly represent the current mouse focus and position. - */ - void (*UpdateMouse)(_THIS); - - /* Create a YUV video surface (possibly overlay) of the given - format. The hardware should be able to perform at least 2x - scaling on display. - */ - SDL_Overlay *(*CreateYUVOverlay)(_THIS, int width, int height, - Uint32 format, SDL_Surface *display); - - /* Sets the color entries { firstcolor .. (firstcolor+ncolors-1) } - of the physical palette to those in 'colors'. If the device is - using a software palette (SDL_HWPALETTE not set), then the - changes are reflected in the logical palette of the screen - as well. - The return value is 1 if all entries could be set properly - or 0 otherwise. - */ - int (*SetColors)(_THIS, int firstcolor, int ncolors, - SDL_Color *colors); - - /* This pointer should exist in the native video subsystem and should - point to an appropriate update function for the current video mode - */ - void (*UpdateRects)(_THIS, int numrects, SDL_Rect *rects); - - /* Reverse the effects VideoInit() -- called if VideoInit() fails - or if the application is shutting down the video subsystem. - */ - void (*VideoQuit)(_THIS); - - /* * * */ - /* Hardware acceleration functions */ - - /* Information about the video hardware */ - SDL_VideoInfo info; - - /* The pixel format used when SDL_CreateRGBSurface creates SDL_HWSURFACEs with alpha */ - SDL_PixelFormat* displayformatalphapixel; - - /* Allocates a surface in video memory */ - int (*AllocHWSurface)(_THIS, SDL_Surface *surface); - - /* Sets the hardware accelerated blit function, if any, based - on the current flags of the surface (colorkey, alpha, etc.) - */ - int (*CheckHWBlit)(_THIS, SDL_Surface *src, SDL_Surface *dst); - - /* Fills a surface rectangle with the given color */ - int (*FillHWRect)(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color); - - /* Sets video mem colorkey and accelerated blit function */ - int (*SetHWColorKey)(_THIS, SDL_Surface *surface, Uint32 key); - - /* Sets per surface hardware alpha value */ - int (*SetHWAlpha)(_THIS, SDL_Surface *surface, Uint8 value); - - /* Returns a readable/writable surface */ - int (*LockHWSurface)(_THIS, SDL_Surface *surface); - void (*UnlockHWSurface)(_THIS, SDL_Surface *surface); - - /* Performs hardware flipping */ - int (*FlipHWSurface)(_THIS, SDL_Surface *surface); - - /* Frees a previously allocated video surface */ - void (*FreeHWSurface)(_THIS, SDL_Surface *surface); - - /* * * */ - /* Gamma support */ - - Uint16 *gamma; - - /* Set the gamma correction directly (emulated with gamma ramps) */ - int (*SetGamma)(_THIS, float red, float green, float blue); - - /* Get the gamma correction directly (emulated with gamma ramps) */ - int (*GetGamma)(_THIS, float *red, float *green, float *blue); - - /* Set the gamma ramp */ - int (*SetGammaRamp)(_THIS, Uint16 *ramp); - - /* Get the gamma ramp */ - int (*GetGammaRamp)(_THIS, Uint16 *ramp); - - /* * * */ - /* OpenGL support */ - - /* Sets the dll to use for OpenGL and loads it */ - int (*GL_LoadLibrary)(_THIS, const char *path); +/* Define the SDL window-shaper structure */ +struct SDL_WindowShaper +{ + /* The window associated with the shaper */ + SDL_Window *window; - /* Retrieves the address of a function in the gl library */ - void* (*GL_GetProcAddress)(_THIS, const char *proc); + /* The user's specified coordinates for the window, for once we give it a shape. */ + Uint32 userx,usery; - /* Get attribute information from the windowing system. */ - int (*GL_GetAttribute)(_THIS, SDL_GLattr attrib, int* value); + /* The parameters for shape calculation. */ + SDL_WindowShapeMode mode; - /* Make the context associated with this driver current */ - int (*GL_MakeCurrent)(_THIS); + /* Has this window been assigned a shape? */ + SDL_bool hasshape; - /* Swap the current buffers in double buffer mode. */ - void (*GL_SwapBuffers)(_THIS); + void *driverdata; +}; - /* OpenGL functions for SDL_OPENGLBLIT */ -#if SDL_VIDEO_OPENGL -#if !defined(__WIN32__) -#define WINAPI -#endif -#define SDL_PROC(ret,func,params) ret (WINAPI *func) params; -#include "SDL_glfuncs.h" -#undef SDL_PROC +/* Define the SDL shape driver structure */ +struct SDL_ShapeDriver +{ + SDL_WindowShaper *(*CreateShaper)(SDL_Window * window); + int (*SetWindowShape)(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); + int (*ResizeWindowShape)(SDL_Window *window); +}; - /* Texture id */ - GLuint texture; -#endif - int is_32bit; - - /* * * */ - /* Window manager functions */ - - /* Set the title and icon text */ - void (*SetCaption)(_THIS, const char *title, const char *icon); - - /* Set the window icon image */ - void (*SetIcon)(_THIS, SDL_Surface *icon, Uint8 *mask); - - /* Iconify the window. - This function returns 1 if there is a window manager and the - window was actually iconified, it returns 0 otherwise. - */ - int (*IconifyWindow)(_THIS); - - /* Grab or ungrab keyboard and mouse input */ - SDL_GrabMode (*GrabInput)(_THIS, SDL_GrabMode mode); - - /* Get some platform dependent window information */ - int (*GetWMInfo)(_THIS, SDL_SysWMinfo *info); - - /* * * */ - /* Cursor manager functions */ - - /* Free a window manager cursor - This function can be NULL if CreateWMCursor is also NULL. - */ - void (*FreeWMCursor)(_THIS, WMcursor *cursor); - - /* If not NULL, create a black/white window manager cursor */ - WMcursor *(*CreateWMCursor)(_THIS, - Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); - - /* Show the specified cursor, or hide if cursor is NULL */ - int (*ShowWMCursor)(_THIS, WMcursor *cursor); - - /* Warp the window manager cursor to (x,y) - If NULL, a mouse motion event is posted internally. - */ - void (*WarpWMCursor)(_THIS, Uint16 x, Uint16 y); - - /* If not NULL, this is called when a mouse motion event occurs */ - void (*MoveWMCursor)(_THIS, int x, int y); - - /* Determine whether the mouse should be in relative mode or not. - This function is called when the input grab state or cursor - visibility state changes. - If the cursor is not visible, and the input is grabbed, the - driver can place the mouse in relative mode, which may result - in higher accuracy sampling of the pointer motion. - */ - void (*CheckMouseMode)(_THIS); - - /* * * */ - /* Event manager functions */ - - /* Initialize keyboard mapping for this driver */ - void (*InitOSKeymap)(_THIS); - - /* Handle any queued OS events */ - void (*PumpEvents)(_THIS); - - /* * * */ - /* Data common to all drivers */ - SDL_Surface *screen; - SDL_Surface *shadow; - SDL_Surface *visible; - SDL_Palette *physpal; /* physical palette, if != logical palette */ - SDL_Color *gammacols; /* gamma-corrected colours, or NULL */ - char *wm_title; - char *wm_icon; - int offset_x; - int offset_y; - SDL_GrabMode input_grab; - - /* Driver information flags */ - int handles_any_size; /* Driver handles any size video mode */ - - /* * * */ - /* Data used by the GL drivers */ - struct { - int red_size; - int green_size; - int blue_size; - int alpha_size; - int depth_size; - int buffer_size; - int stencil_size; - int double_buffer; - int accum_red_size; - int accum_green_size; - int accum_blue_size; - int accum_alpha_size; - int stereo; - int multisamplebuffers; - int multisamplesamples; - int accelerated; - int swap_control; - int driver_loaded; - char driver_path[256]; - void* dll_handle; - } gl_config; - - /* * * */ - /* Data private to this driver */ - struct SDL_PrivateVideoData *hidden; - struct SDL_PrivateGLData *gl_data; - - /* * * */ - /* The function used to dispose of this structure */ - void (*free)(_THIS); +typedef struct SDL_WindowUserData +{ + char *name; + void *data; + struct SDL_WindowUserData *next; +} SDL_WindowUserData; + +/* Define the SDL window structure, corresponding to toplevel windows */ +struct SDL_Window +{ + const void *magic; + Uint32 id; + char *title; + SDL_Surface *icon; + int x, y; + int w, h; + int min_w, min_h; + int max_w, max_h; + Uint32 flags; + + /* Stored position and size for windowed mode */ + SDL_Rect windowed; + + SDL_DisplayMode fullscreen_mode; + + float brightness; + Uint16 *gamma; + Uint16 *saved_gamma; /* (just offset into gamma) */ + + SDL_Surface *surface; + SDL_bool surface_valid; + + SDL_WindowShaper *shaper; + + SDL_WindowUserData *data; + + void *driverdata; + + SDL_Window *prev; + SDL_Window *next; +}; +#define FULLSCREEN_VISIBLE(W) \ + (((W)->flags & SDL_WINDOW_FULLSCREEN) && \ + ((W)->flags & SDL_WINDOW_SHOWN) && \ + !((W)->flags & SDL_WINDOW_MINIMIZED)) + +/* + * Define the SDL display structure This corresponds to physical monitors + * attached to the system. + */ +struct SDL_VideoDisplay +{ + char *name; + int max_display_modes; + int num_display_modes; + SDL_DisplayMode *display_modes; + SDL_DisplayMode desktop_mode; + SDL_DisplayMode current_mode; + + SDL_Window *fullscreen_window; + + SDL_VideoDevice *device; + + void *driverdata; }; -#undef _THIS -typedef struct VideoBootStrap { - const char *name; - const char *desc; - int (*available)(void); - SDL_VideoDevice *(*create)(int devindex); +/* Forward declaration */ +struct SDL_SysWMinfo; + +/* Define the SDL video driver structure */ +#define _THIS SDL_VideoDevice *_this + +struct SDL_VideoDevice +{ + /* * * */ + /* The name of this video driver */ + const char *name; + + /* * * */ + /* Initialization/Query functions */ + + /* + * Initialize the native video subsystem, filling in the list of + * displays for this driver, returning 0 or -1 if there's an error. + */ + int (*VideoInit) (_THIS); + + /* + * Reverse the effects VideoInit() -- called if VideoInit() fails or + * if the application is shutting down the video subsystem. + */ + void (*VideoQuit) (_THIS); + + /* * * */ + /* + * Display functions + */ + + /* + * Get the bounds of a display + */ + int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); + + /* + * Get a list of the available display modes for a display. + */ + void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display); + + /* + * Setting the display mode is independent of creating windows, so + * when the display mode is changed, all existing windows should have + * their data updated accordingly, including the display surfaces + * associated with them. + */ + int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); + + /* * * */ + /* + * Window functions + */ + int (*CreateWindow) (_THIS, SDL_Window * window); + int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data); + void (*SetWindowTitle) (_THIS, SDL_Window * window); + void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon); + void (*SetWindowPosition) (_THIS, SDL_Window * window); + void (*SetWindowSize) (_THIS, SDL_Window * window); + void (*SetWindowMinimumSize) (_THIS, SDL_Window * window); + void (*SetWindowMaximumSize) (_THIS, SDL_Window * window); + void (*ShowWindow) (_THIS, SDL_Window * window); + void (*HideWindow) (_THIS, SDL_Window * window); + void (*RaiseWindow) (_THIS, SDL_Window * window); + void (*MaximizeWindow) (_THIS, SDL_Window * window); + void (*MinimizeWindow) (_THIS, SDL_Window * window); + void (*RestoreWindow) (_THIS, SDL_Window * window); + void (*SetWindowBordered) (_THIS, SDL_Window * window, SDL_bool bordered); + void (*SetWindowFullscreen) (_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen); + int (*SetWindowGammaRamp) (_THIS, SDL_Window * window, const Uint16 * ramp); + int (*GetWindowGammaRamp) (_THIS, SDL_Window * window, Uint16 * ramp); + void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed); + void (*DestroyWindow) (_THIS, SDL_Window * window); + int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); + int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); + void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window); + void (*OnWindowEnter) (_THIS, SDL_Window * window); + + /* * * */ + /* + * Shaped-window functions + */ + SDL_ShapeDriver shape_driver; + + /* Get some platform dependent window information */ + SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window, + struct SDL_SysWMinfo * info); + + /* * * */ + /* + * OpenGL support + */ + int (*GL_LoadLibrary) (_THIS, const char *path); + void *(*GL_GetProcAddress) (_THIS, const char *proc); + void (*GL_UnloadLibrary) (_THIS); + SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window); + int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context); + int (*GL_SetSwapInterval) (_THIS, int interval); + int (*GL_GetSwapInterval) (_THIS); + void (*GL_SwapWindow) (_THIS, SDL_Window * window); + void (*GL_DeleteContext) (_THIS, SDL_GLContext context); + + /* * * */ + /* + * Event manager functions + */ + void (*PumpEvents) (_THIS); + + /* Suspend the screensaver */ + void (*SuspendScreenSaver) (_THIS); + + /* Text input */ + void (*StartTextInput) (_THIS); + void (*StopTextInput) (_THIS); + void (*SetTextInputRect) (_THIS, SDL_Rect *rect); + + /* Screen keyboard */ + SDL_bool (*HasScreenKeyboardSupport) (_THIS); + void (*ShowScreenKeyboard) (_THIS, SDL_Window *window); + void (*HideScreenKeyboard) (_THIS, SDL_Window *window); + SDL_bool (*IsScreenKeyboardShown) (_THIS, SDL_Window *window); + + /* Clipboard */ + int (*SetClipboardText) (_THIS, const char *text); + char * (*GetClipboardText) (_THIS); + SDL_bool (*HasClipboardText) (_THIS); + + /* MessageBox */ + int (*ShowMessageBox) (_THIS, const SDL_MessageBoxData *messageboxdata, int *buttonid); + + /* * * */ + /* Data common to all drivers */ + SDL_bool suspend_screensaver; + int num_displays; + SDL_VideoDisplay *displays; + SDL_Window *windows; + Uint8 window_magic; + Uint32 next_object_id; + char * clipboard_text; + + /* * * */ + /* Data used by the GL drivers */ + struct + { + int red_size; + int green_size; + int blue_size; + int alpha_size; + int depth_size; + int buffer_size; + int stencil_size; + int double_buffer; + int accum_red_size; + int accum_green_size; + int accum_blue_size; + int accum_alpha_size; + int stereo; + int multisamplebuffers; + int multisamplesamples; + int accelerated; + int major_version; + int minor_version; + int flags; + int profile_mask; + int use_egl; + int share_with_current_context; + int retained_backing; + int driver_loaded; + char driver_path[256]; + void *dll_handle; + } gl_config; + + /* * * */ + /* Cache current GL context; don't call the OS when it hasn't changed. */ + /* We have the global pointers here so Cocoa continues to work the way + it always has, and the thread-local storage for the general case. + */ + SDL_Window *current_glwin; + SDL_GLContext current_glctx; + SDL_TLSID current_glwin_tls; + SDL_TLSID current_glctx_tls; + + /* * * */ + /* Data private to this driver */ + void *driverdata; + struct SDL_GLDriverData *gl_data; + +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 + struct SDL_PrivateGLESData *gles_data; +#endif + + /* * * */ + /* The function used to dispose of this structure */ + void (*free) (_THIS); +}; + +typedef struct VideoBootStrap +{ + const char *name; + const char *desc; + int (*available) (void); + SDL_VideoDevice *(*create) (int devindex); } VideoBootStrap; -#if SDL_VIDEO_DRIVER_QUARTZ -extern VideoBootStrap QZ_bootstrap; +#if SDL_VIDEO_DRIVER_COCOA +extern VideoBootStrap COCOA_bootstrap; #endif #if SDL_VIDEO_DRIVER_X11 extern VideoBootStrap X11_bootstrap; #endif -#if SDL_VIDEO_DRIVER_DGA -extern VideoBootStrap DGA_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_NANOX -extern VideoBootStrap NX_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_IPOD -extern VideoBootStrap iPod_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_QTOPIA -extern VideoBootStrap Qtopia_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_WSCONS -extern VideoBootStrap WSCONS_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_FBCON -extern VideoBootStrap FBCON_bootstrap; -#endif #if SDL_VIDEO_DRIVER_DIRECTFB extern VideoBootStrap DirectFB_bootstrap; #endif -#if SDL_VIDEO_DRIVER_PS2GS -extern VideoBootStrap PS2GS_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_PS3 -extern VideoBootStrap PS3_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_GGI -extern VideoBootStrap GGI_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_VGL -extern VideoBootStrap VGL_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_SVGALIB -extern VideoBootStrap SVGALIB_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_GAPI -extern VideoBootStrap GAPI_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_WINDIB -extern VideoBootStrap WINDIB_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_DDRAW -extern VideoBootStrap DIRECTX_bootstrap; +#if SDL_VIDEO_DRIVER_WINDOWS +extern VideoBootStrap WINDOWS_bootstrap; #endif #if SDL_VIDEO_DRIVER_BWINDOW extern VideoBootStrap BWINDOW_bootstrap; #endif -#if SDL_VIDEO_DRIVER_TOOLBOX -extern VideoBootStrap TOOLBOX_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_DRAWSPROCKET -extern VideoBootStrap DSp_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_PHOTON -extern VideoBootStrap ph_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_EPOC -extern VideoBootStrap EPOC_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_XBIOS -extern VideoBootStrap XBIOS_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_GEM -extern VideoBootStrap GEM_bootstrap; +#if SDL_VIDEO_DRIVER_PANDORA +extern VideoBootStrap PND_bootstrap; #endif -#if SDL_VIDEO_DRIVER_PICOGUI -extern VideoBootStrap PG_bootstrap; +#if SDL_VIDEO_DRIVER_UIKIT +extern VideoBootStrap UIKIT_bootstrap; #endif -#if SDL_VIDEO_DRIVER_DC -extern VideoBootStrap DC_bootstrap; +#if SDL_VIDEO_DRIVER_ANDROID +extern VideoBootStrap Android_bootstrap; #endif -#if SDL_VIDEO_DRIVER_NDS -extern VideoBootStrap NDS_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_RISCOS -extern VideoBootStrap RISCOS_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_OS2FS -extern VideoBootStrap OS2FSLib_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_AALIB -extern VideoBootStrap AALIB_bootstrap; -#endif -#if SDL_VIDEO_DRIVER_CACA -extern VideoBootStrap CACA_bootstrap; +#if SDL_VIDEO_DRIVER_PSP +extern VideoBootStrap PSP_bootstrap; #endif #if SDL_VIDEO_DRIVER_DUMMY extern VideoBootStrap DUMMY_bootstrap; #endif -/* This is the current video device */ -extern SDL_VideoDevice *current_video; +extern SDL_VideoDevice *SDL_GetVideoDevice(void); +extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); +extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display); +extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode); +extern SDL_VideoDisplay *SDL_GetDisplayForWindow(SDL_Window *window); -#define SDL_VideoSurface (current_video->screen) -#define SDL_ShadowSurface (current_video->shadow) -#define SDL_PublicSurface (current_video->visible) +extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); + +extern void SDL_OnWindowShown(SDL_Window * window); +extern void SDL_OnWindowHidden(SDL_Window * window); +extern void SDL_OnWindowResized(SDL_Window * window); +extern void SDL_OnWindowMinimized(SDL_Window * window); +extern void SDL_OnWindowRestored(SDL_Window * window); +extern void SDL_OnWindowEnter(SDL_Window * window); +extern void SDL_OnWindowLeave(SDL_Window * window); +extern void SDL_OnWindowFocusGained(SDL_Window * window); +extern void SDL_OnWindowFocusLost(SDL_Window * window); +extern void SDL_UpdateWindowGrab(SDL_Window * window); +extern SDL_Window * SDL_GetFocusWindow(void); + +extern SDL_bool SDL_ShouldAllowTopmost(void); #endif /* _SDL_sysvideo_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 46285c990e..bab6c6cb94 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1,1978 +1,3198 @@ /* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_config.h" /* The high-level video driver subsystem */ #include "SDL.h" +#include "SDL_video.h" #include "SDL_sysvideo.h" #include "SDL_blit.h" #include "SDL_pixels_c.h" -#include "SDL_cursor_c.h" -#include "../events/SDL_sysevents.h" +#include "SDL_rect_c.h" #include "../events/SDL_events_c.h" +#include "../timer/SDL_timer_c.h" + +#if SDL_VIDEO_OPENGL +#include "SDL_opengl.h" +#endif /* SDL_VIDEO_OPENGL */ + +#if SDL_VIDEO_OPENGL_ES +#include "SDL_opengles.h" +#endif /* SDL_VIDEO_OPENGL_ES */ + +#if SDL_VIDEO_OPENGL_ES2 +#include "SDL_opengles2.h" +#endif /* SDL_VIDEO_OPENGL_ES2 */ + +#include "SDL_syswm.h" + +/* On Windows, windows.h defines CreateWindow */ +#ifdef CreateWindow +#undef CreateWindow +#endif /* Available video drivers */ static VideoBootStrap *bootstrap[] = { -#if SDL_VIDEO_DRIVER_QUARTZ - &QZ_bootstrap, +#if SDL_VIDEO_DRIVER_COCOA + &COCOA_bootstrap, #endif #if SDL_VIDEO_DRIVER_X11 - &X11_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_DGA - &DGA_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_NANOX - &NX_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_IPOD - &iPod_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_QTOPIA - &Qtopia_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_WSCONS - &WSCONS_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_FBCON - &FBCON_bootstrap, + &X11_bootstrap, #endif #if SDL_VIDEO_DRIVER_DIRECTFB - &DirectFB_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_PS2GS - &PS2GS_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_PS3 - &PS3_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_GGI - &GGI_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_VGL - &VGL_bootstrap, + &DirectFB_bootstrap, #endif -#if SDL_VIDEO_DRIVER_SVGALIB - &SVGALIB_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_GAPI - &GAPI_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_WINDIB - &WINDIB_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_DDRAW - &DIRECTX_bootstrap, +#if SDL_VIDEO_DRIVER_WINDOWS + &WINDOWS_bootstrap, #endif #if SDL_VIDEO_DRIVER_BWINDOW - &BWINDOW_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_TOOLBOX - &TOOLBOX_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_DRAWSPROCKET - &DSp_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_PHOTON - &ph_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_EPOC - &EPOC_bootstrap, + &BWINDOW_bootstrap, #endif -#if SDL_VIDEO_DRIVER_XBIOS - &XBIOS_bootstrap, +#if SDL_VIDEO_DRIVER_PANDORA + &PND_bootstrap, #endif -#if SDL_VIDEO_DRIVER_GEM - &GEM_bootstrap, +#if SDL_VIDEO_DRIVER_UIKIT + &UIKIT_bootstrap, #endif -#if SDL_VIDEO_DRIVER_PICOGUI - &PG_bootstrap, +#if SDL_VIDEO_DRIVER_ANDROID + &Android_bootstrap, #endif -#if SDL_VIDEO_DRIVER_DC - &DC_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_NDS - &NDS_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_RISCOS - &RISCOS_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_OS2FS - &OS2FSLib_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_AALIB - &AALIB_bootstrap, -#endif -#if SDL_VIDEO_DRIVER_CACA - &CACA_bootstrap, +#if SDL_VIDEO_DRIVER_PSP + &PSP_bootstrap, #endif #if SDL_VIDEO_DRIVER_DUMMY - &DUMMY_bootstrap, + &DUMMY_bootstrap, #endif - NULL + NULL }; -SDL_VideoDevice *current_video = NULL; - -/* Various local functions */ -int SDL_VideoInit(const char *driver_name, Uint32 flags); -void SDL_VideoQuit(void); -void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects); - -static SDL_GrabMode SDL_WM_GrabInputOff(void); +static SDL_VideoDevice *_this = NULL; + +#define CHECK_WINDOW_MAGIC(window, retval) \ + if (!_this) { \ + SDL_UninitializedVideo(); \ + return retval; \ + } \ + if (!window || window->magic != &_this->window_magic) { \ + SDL_SetError("Invalid window"); \ + return retval; \ + } + +#define CHECK_DISPLAY_INDEX(displayIndex, retval) \ + if (!_this) { \ + SDL_UninitializedVideo(); \ + return retval; \ + } \ + if (displayIndex < 0 || displayIndex >= _this->num_displays) { \ + SDL_SetError("displayIndex must be in the range 0 - %d", \ + _this->num_displays - 1); \ + return retval; \ + } + +/* Support for framebuffer emulation using an accelerated renderer */ + +#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData" + +typedef struct { + SDL_Renderer *renderer; + SDL_Texture *texture; + void *pixels; + int pitch; + int bytes_per_pixel; +} SDL_WindowTextureData; + +static SDL_bool +ShouldUseTextureFramebuffer() +{ + const char *hint; + + /* If there's no native framebuffer support then there's no option */ + if (!_this->CreateWindowFramebuffer) { + return SDL_TRUE; + } + + /* If the user has specified a software renderer we can't use a + texture framebuffer, or renderer creation will go recursive. + */ + hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER); + if (hint && SDL_strcasecmp(hint, "software") == 0) { + return SDL_FALSE; + } + + /* See if the user or application wants a specific behavior */ + hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); + if (hint) { + if (*hint == '0') { + return SDL_FALSE; + } else { + return SDL_TRUE; + } + } + + /* Each platform has different performance characteristics */ +#if defined(__WIN32__) + /* GDI BitBlt() is way faster than Direct3D dynamic textures right now. + */ + return SDL_FALSE; + +#elif defined(__MACOSX__) + /* Mac OS X uses OpenGL as the native fast path */ + return SDL_TRUE; + +#elif defined(__LINUX__) + /* Properly configured OpenGL drivers are faster than MIT-SHM */ #if SDL_VIDEO_OPENGL -static int lock_count = 0; + /* Ugh, find a way to cache this value! */ + { + SDL_Window *window; + SDL_GLContext context; + SDL_bool hasAcceleratedOpenGL = SDL_FALSE; + + window = SDL_CreateWindow("OpenGL test", -32, -32, 32, 32, SDL_WINDOW_OPENGL|SDL_WINDOW_HIDDEN); + if (window) { + context = SDL_GL_CreateContext(window); + if (context) { + const GLubyte *(APIENTRY * glGetStringFunc) (GLenum); + const char *vendor = NULL; + + glGetStringFunc = SDL_GL_GetProcAddress("glGetString"); + if (glGetStringFunc) { + vendor = (const char *) glGetStringFunc(GL_VENDOR); + } + /* Add more vendors here at will... */ + if (vendor && + (SDL_strstr(vendor, "ATI Technologies") || + SDL_strstr(vendor, "NVIDIA"))) { + hasAcceleratedOpenGL = SDL_TRUE; + } + SDL_GL_DeleteContext(context); + } + SDL_DestroyWindow(window); + } + return hasAcceleratedOpenGL; + } +#elif SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 + /* Let's be optimistic about this! */ + return SDL_TRUE; +#else + return SDL_FALSE; #endif +#else + /* Play it safe, assume that if there is a framebuffer driver that it's + optimized for the current platform. + */ + return SDL_FALSE; +#endif +} + +static int +SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +{ + SDL_WindowTextureData *data; + SDL_RendererInfo info; + Uint32 i; + + data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); + if (!data) { + SDL_Renderer *renderer = NULL; + SDL_RendererInfo info; + int i; + const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); + + /* Check to see if there's a specific driver requested */ + if (hint && *hint != '0' && *hint != '1' && + SDL_strcasecmp(hint, "software") != 0) { + for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) { + SDL_GetRenderDriverInfo(i, &info); + if (SDL_strcasecmp(info.name, hint) == 0) { + renderer = SDL_CreateRenderer(window, i, 0); + break; + } + } + } + + if (!renderer) { + for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) { + SDL_GetRenderDriverInfo(i, &info); + if (SDL_strcmp(info.name, "software") != 0) { + renderer = SDL_CreateRenderer(window, i, 0); + if (renderer) { + break; + } + } + } + } + if (!renderer) { + return SDL_SetError("No hardware accelerated renderers available"); + } + + /* Create the data after we successfully create the renderer (bug #1116) */ + data = (SDL_WindowTextureData *)SDL_calloc(1, sizeof(*data)); + if (!data) { + SDL_DestroyRenderer(renderer); + return SDL_OutOfMemory(); + } + SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, data); + + data->renderer = renderer; + } + + /* Free any old texture and pixel data */ + if (data->texture) { + SDL_DestroyTexture(data->texture); + data->texture = NULL; + } + if (data->pixels) { + SDL_free(data->pixels); + data->pixels = NULL; + } + + if (SDL_GetRendererInfo(data->renderer, &info) < 0) { + return -1; + } + + /* Find the first format without an alpha channel */ + *format = info.texture_formats[0]; + for (i = 0; i < info.num_texture_formats; ++i) { + if (!SDL_ISPIXELFORMAT_FOURCC(info.texture_formats[i]) && + !SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) { + *format = info.texture_formats[i]; + break; + } + } + + data->texture = SDL_CreateTexture(data->renderer, *format, + SDL_TEXTUREACCESS_STREAMING, + window->w, window->h); + if (!data->texture) { + return -1; + } + + /* Create framebuffer data */ + data->bytes_per_pixel = SDL_BYTESPERPIXEL(*format); + data->pitch = (((window->w * data->bytes_per_pixel) + 3) & ~3); + data->pixels = SDL_malloc(window->h * data->pitch); + if (!data->pixels) { + return SDL_OutOfMemory(); + } + + *pixels = data->pixels; + *pitch = data->pitch; + + /* Make sure we're not double-scaling the viewport */ + SDL_RenderSetViewport(data->renderer, NULL); + + return 0; +} + +static int +SDL_UpdateWindowTexture(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +{ + SDL_WindowTextureData *data; + SDL_Rect rect; + void *src; + + data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); + if (!data || !data->texture) { + return SDL_SetError("No window texture data"); + } + + /* Update a single rect that contains subrects for best DMA performance */ + if (SDL_GetSpanEnclosingRect(window->w, window->h, numrects, rects, &rect)) { + src = (void *)((Uint8 *)data->pixels + + rect.y * data->pitch + + rect.x * data->bytes_per_pixel); + if (SDL_UpdateTexture(data->texture, &rect, src, data->pitch) < 0) { + return -1; + } + + if (SDL_RenderCopy(data->renderer, data->texture, NULL, NULL) < 0) { + return -1; + } + + SDL_RenderPresent(data->renderer); + } + return 0; +} + +static void +SDL_DestroyWindowTexture(_THIS, SDL_Window * window) +{ + SDL_WindowTextureData *data; + + data = SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, NULL); + if (!data) { + return; + } + if (data->texture) { + SDL_DestroyTexture(data->texture); + } + if (data->renderer) { + SDL_DestroyRenderer(data->renderer); + } + if (data->pixels) { + SDL_free(data->pixels); + } + SDL_free(data); +} + + +static int +cmpmodes(const void *A, const void *B) +{ + const SDL_DisplayMode *a = (const SDL_DisplayMode *) A; + const SDL_DisplayMode *b = (const SDL_DisplayMode *) B; + if (a == b) { + return 0; + } else if (a->w != b->w) { + return b->w - a->w; + } else if (a->h != b->h) { + return b->h - a->h; + } else if (SDL_BITSPERPIXEL(a->format) != SDL_BITSPERPIXEL(b->format)) { + return SDL_BITSPERPIXEL(b->format) - SDL_BITSPERPIXEL(a->format); + } else if (SDL_PIXELLAYOUT(a->format) != SDL_PIXELLAYOUT(b->format)) { + return SDL_PIXELLAYOUT(b->format) - SDL_PIXELLAYOUT(a->format); + } else if (a->refresh_rate != b->refresh_rate) { + return b->refresh_rate - a->refresh_rate; + } + return 0; +} + +static int +SDL_UninitializedVideo() +{ + return SDL_SetError("Video subsystem has not been initialized"); +} + +int +SDL_GetNumVideoDrivers(void) +{ + return SDL_arraysize(bootstrap) - 1; +} + +const char * +SDL_GetVideoDriver(int index) +{ + if (index >= 0 && index < SDL_GetNumVideoDrivers()) { + return bootstrap[index]->name; + } + return NULL; +} /* * Initialize the video and event subsystems -- determine native pixel format */ -int SDL_VideoInit (const char *driver_name, Uint32 flags) -{ - SDL_VideoDevice *video; - int index; - int i; - SDL_PixelFormat vformat; - Uint32 video_flags; - - /* Toggle the event thread flags, based on OS requirements */ -#if defined(MUST_THREAD_EVENTS) - flags |= SDL_INIT_EVENTTHREAD; -#elif defined(CANT_THREAD_EVENTS) - if ( (flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) { - SDL_SetError("OS doesn't support threaded events"); - return(-1); - } -#endif +int +SDL_VideoInit(const char *driver_name) +{ + SDL_VideoDevice *video; + int index; + int i; - /* Check to make sure we don't overwrite 'current_video' */ - if ( current_video != NULL ) { - SDL_VideoQuit(); - } - - /* Select the proper video driver */ - index = 0; - video = NULL; - if ( driver_name != NULL ) { -#if 0 /* This will be replaced with a better driver selection API */ - if ( SDL_strrchr(driver_name, ':') != NULL ) { - index = atoi(SDL_strrchr(driver_name, ':')+1); - } + /* Check to make sure we don't overwrite '_this' */ + if (_this != NULL) { + SDL_VideoQuit(); + } + +#if !SDL_TIMERS_DISABLED + SDL_InitTicks(); #endif - for ( i=0; bootstrap[i]; ++i ) { - if ( SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) { - if ( bootstrap[i]->available() ) { - video = bootstrap[i]->create(index); - break; - } - } - } - } else { - for ( i=0; bootstrap[i]; ++i ) { - if ( bootstrap[i]->available() ) { - video = bootstrap[i]->create(index); - if ( video != NULL ) { - break; - } - } - } - } - if ( video == NULL ) { - SDL_SetError("No available video device"); - return(-1); - } - current_video = video; - current_video->name = bootstrap[i]->name; - - /* Do some basic variable initialization */ - video->screen = NULL; - video->shadow = NULL; - video->visible = NULL; - video->physpal = NULL; - video->gammacols = NULL; - video->gamma = NULL; - video->wm_title = NULL; - video->wm_icon = NULL; - video->offset_x = 0; - video->offset_y = 0; - SDL_memset(&video->info, 0, (sizeof video->info)); - - video->displayformatalphapixel = NULL; - - /* Set some very sane GL defaults */ - video->gl_config.driver_loaded = 0; - video->gl_config.dll_handle = NULL; - video->gl_config.red_size = 3; - video->gl_config.green_size = 3; - video->gl_config.blue_size = 2; - video->gl_config.alpha_size = 0; - video->gl_config.buffer_size = 0; - video->gl_config.depth_size = 16; - video->gl_config.stencil_size = 0; - video->gl_config.double_buffer = 1; - video->gl_config.accum_red_size = 0; - video->gl_config.accum_green_size = 0; - video->gl_config.accum_blue_size = 0; - video->gl_config.accum_alpha_size = 0; - video->gl_config.stereo = 0; - video->gl_config.multisamplebuffers = 0; - video->gl_config.multisamplesamples = 0; - video->gl_config.accelerated = -1; /* not known, don't set */ - video->gl_config.swap_control = -1; /* not known, don't set */ - - /* Initialize the video subsystem */ - SDL_memset(&vformat, 0, sizeof(vformat)); - if ( video->VideoInit(video, &vformat) < 0 ) { - SDL_VideoQuit(); - return(-1); - } - - /* Create a zero sized video surface of the appropriate format */ - video_flags = SDL_SWSURFACE; - SDL_VideoSurface = SDL_CreateRGBSurface(video_flags, 0, 0, - vformat.BitsPerPixel, - vformat.Rmask, vformat.Gmask, vformat.Bmask, 0); - if ( SDL_VideoSurface == NULL ) { - SDL_VideoQuit(); - return(-1); - } - SDL_PublicSurface = NULL; /* Until SDL_SetVideoMode() */ - -#if 0 /* Don't change the current palette - may be used by other programs. - * The application can't do anything with the display surface until - * a video mode has been set anyway. :) - */ - /* If we have a palettized surface, create a default palette */ - if ( SDL_VideoSurface->format->palette ) { - SDL_PixelFormat *vf = SDL_VideoSurface->format; - SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel); - video->SetColors(video, - 0, vf->palette->ncolors, vf->palette->colors); - } + + /* Start the event loop */ + if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0 || + SDL_KeyboardInit() < 0 || + SDL_MouseInit() < 0 || + SDL_TouchInit() < 0) { + return -1; + } + + /* Select the proper video driver */ + index = 0; + video = NULL; + if (driver_name == NULL) { + driver_name = SDL_getenv("SDL_VIDEODRIVER"); + } + if (driver_name != NULL) { + for (i = 0; bootstrap[i]; ++i) { + if (SDL_strncasecmp(bootstrap[i]->name, driver_name, SDL_strlen(driver_name)) == 0) { + video = bootstrap[i]->create(index); + break; + } + } + } else { + for (i = 0; bootstrap[i]; ++i) { + if (bootstrap[i]->available()) { + video = bootstrap[i]->create(index); + if (video != NULL) { + break; + } + } + } + } + if (video == NULL) { + if (driver_name) { + return SDL_SetError("%s not available", driver_name); + } + return SDL_SetError("No available video device"); + } + _this = video; + _this->name = bootstrap[i]->name; + _this->next_object_id = 1; + + + /* Set some very sane GL defaults */ + _this->gl_config.driver_loaded = 0; + _this->gl_config.dll_handle = NULL; + _this->gl_config.red_size = 3; + _this->gl_config.green_size = 3; + _this->gl_config.blue_size = 2; + _this->gl_config.alpha_size = 0; + _this->gl_config.buffer_size = 0; + _this->gl_config.depth_size = 16; + _this->gl_config.stencil_size = 0; + _this->gl_config.double_buffer = 1; + _this->gl_config.accum_red_size = 0; + _this->gl_config.accum_green_size = 0; + _this->gl_config.accum_blue_size = 0; + _this->gl_config.accum_alpha_size = 0; + _this->gl_config.stereo = 0; + _this->gl_config.multisamplebuffers = 0; + _this->gl_config.multisamplesamples = 0; + _this->gl_config.retained_backing = 1; + _this->gl_config.accelerated = -1; /* accelerated or not, both are fine */ +#if SDL_VIDEO_OPENGL + _this->gl_config.major_version = 2; + _this->gl_config.minor_version = 1; + _this->gl_config.use_egl = 0; +#elif SDL_VIDEO_OPENGL_ES + _this->gl_config.major_version = 1; + _this->gl_config.minor_version = 1; + _this->gl_config.use_egl = 1; +#elif SDL_VIDEO_OPENGL_ES2 + _this->gl_config.major_version = 2; + _this->gl_config.minor_version = 0; + _this->gl_config.use_egl = 1; #endif - video->info.vfmt = SDL_VideoSurface->format; + _this->gl_config.flags = 0; + _this->gl_config.profile_mask = 0; + _this->gl_config.share_with_current_context = 0; + + _this->current_glwin_tls = SDL_TLSCreate(); + _this->current_glctx_tls = SDL_TLSCreate(); + + /* Initialize the video subsystem */ + if (_this->VideoInit(_this) < 0) { + SDL_VideoQuit(); + return -1; + } + + /* Make sure some displays were added */ + if (_this->num_displays == 0) { + SDL_VideoQuit(); + return SDL_SetError("The video driver did not add any displays"); + } + + /* Add the renderer framebuffer emulation if desired */ + if (ShouldUseTextureFramebuffer()) { + _this->CreateWindowFramebuffer = SDL_CreateWindowTexture; + _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture; + _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture; + } + + /* If we don't use a screen keyboard, turn on text input by default, + otherwise programs that expect to get text events without enabling + UNICODE input won't get any events. + + Actually, come to think of it, you needed to call SDL_EnableUNICODE(1) + in SDL 1.2 before you got text input events. Hmm... + */ + if (!SDL_HasScreenKeyboardSupport()) { + SDL_StartTextInput(); + } + + /* We're ready to go! */ + return 0; +} - /* Start the event loop */ - if ( SDL_StartEventLoop(flags) < 0 ) { - SDL_VideoQuit(); - return(-1); - } - SDL_CursorInit(flags & SDL_INIT_EVENTTHREAD); +const char * +SDL_GetCurrentVideoDriver() +{ + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + return _this->name; +} - /* We're ready to go! */ - return(0); +SDL_VideoDevice * +SDL_GetVideoDevice(void) +{ + return _this; } -char *SDL_VideoDriverName(char *namebuf, int maxlen) +int +SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode) { - if ( current_video != NULL ) { - SDL_strlcpy(namebuf, current_video->name, maxlen); - return(namebuf); - } - return(NULL); + SDL_VideoDisplay display; + + SDL_zero(display); + if (desktop_mode) { + display.desktop_mode = *desktop_mode; + } + display.current_mode = display.desktop_mode; + + return SDL_AddVideoDisplay(&display); } -/* - * Get the current display surface - */ -SDL_Surface *SDL_GetVideoSurface(void) +int +SDL_AddVideoDisplay(const SDL_VideoDisplay * display) { - SDL_Surface *visible; + SDL_VideoDisplay *displays; + int index = -1; + + displays = + SDL_realloc(_this->displays, + (_this->num_displays + 1) * sizeof(*displays)); + if (displays) { + index = _this->num_displays++; + displays[index] = *display; + displays[index].device = _this; + _this->displays = displays; + + if (display->name) { + displays[index].name = SDL_strdup(display->name); + } else { + char name[32]; + + SDL_itoa(index, name, 10); + displays[index].name = SDL_strdup(name); + } + } else { + SDL_OutOfMemory(); + } + return index; +} - visible = NULL; - if ( current_video ) { - visible = current_video->visible; - } - return(visible); +int +SDL_GetNumVideoDisplays(void) +{ + if (!_this) { + SDL_UninitializedVideo(); + return 0; + } + return _this->num_displays; } -/* - * Get the current information about the video hardware - */ -const SDL_VideoInfo *SDL_GetVideoInfo(void) +static int +SDL_GetIndexOfDisplay(SDL_VideoDisplay *display) { - const SDL_VideoInfo *info; + int displayIndex; + + for (displayIndex = 0; displayIndex < _this->num_displays; ++displayIndex) { + if (display == &_this->displays[displayIndex]) { + return displayIndex; + } + } - info = NULL; - if ( current_video ) { - info = ¤t_video->info; - } - return(info); + /* Couldn't find the display, just use index 0 */ + return 0; } -/* - * Return a pointer to an array of available screen dimensions for the - * given format, sorted largest to smallest. Returns NULL if there are - * no dimensions available for a particular format, or (SDL_Rect **)-1 - * if any dimension is okay for the given format. If 'format' is NULL, - * the mode list will be for the format given by SDL_GetVideoInfo()->vfmt - */ -SDL_Rect ** SDL_ListModes (SDL_PixelFormat *format, Uint32 flags) +const char * +SDL_GetDisplayName(int displayIndex) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - SDL_Rect **modes; + CHECK_DISPLAY_INDEX(displayIndex, NULL); - modes = NULL; - if ( SDL_VideoSurface ) { - if ( format == NULL ) { - format = SDL_VideoSurface->format; - } - modes = video->ListModes(this, format, flags); - } - return(modes); + return _this->displays[displayIndex].name; } -/* - * Check to see if a particular video mode is supported. - * It returns 0 if the requested mode is not supported under any bit depth, - * or returns the bits-per-pixel of the closest available mode with the - * given width and height. If this bits-per-pixel is different from the - * one used when setting the video mode, SDL_SetVideoMode() will succeed, - * but will emulate the requested bits-per-pixel with a shadow surface. - */ -static Uint8 SDL_closest_depths[4][8] = { - /* 8 bit closest depth ordering */ - { 0, 8, 16, 15, 32, 24, 0, 0 }, - /* 15,16 bit closest depth ordering */ - { 0, 16, 15, 32, 24, 8, 0, 0 }, - /* 24 bit closest depth ordering */ - { 0, 24, 32, 16, 15, 8, 0, 0 }, - /* 32 bit closest depth ordering */ - { 0, 32, 16, 15, 24, 8, 0, 0 } -}; +int +SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect) +{ + CHECK_DISPLAY_INDEX(displayIndex, -1); + + if (rect) { + SDL_VideoDisplay *display = &_this->displays[displayIndex]; + + if (_this->GetDisplayBounds) { + if (_this->GetDisplayBounds(_this, display, rect) == 0) { + return 0; + } + } + + /* Assume that the displays are left to right */ + if (displayIndex == 0) { + rect->x = 0; + rect->y = 0; + } else { + SDL_GetDisplayBounds(displayIndex-1, rect); + rect->x += rect->w; + } + rect->w = display->current_mode.w; + rect->h = display->current_mode.h; + } + return 0; +} +SDL_bool +SDL_AddDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) +{ + SDL_DisplayMode *modes; + int i, nmodes; + + /* Make sure we don't already have the mode in the list */ + modes = display->display_modes; + nmodes = display->num_display_modes; + for (i = 0; i < nmodes; ++i) { + if (cmpmodes(mode, &modes[i]) == 0) { + return SDL_FALSE; + } + } + + /* Go ahead and add the new mode */ + if (nmodes == display->max_display_modes) { + modes = + SDL_realloc(modes, + (display->max_display_modes + 32) * sizeof(*modes)); + if (!modes) { + return SDL_FALSE; + } + display->display_modes = modes; + display->max_display_modes += 32; + } + modes[nmodes] = *mode; + display->num_display_modes++; + + /* Re-sort video modes */ + SDL_qsort(display->display_modes, display->num_display_modes, + sizeof(SDL_DisplayMode), cmpmodes); + + return SDL_TRUE; +} -#ifdef __MACOS__ /* MPW optimization bug? */ -#define NEGATIVE_ONE 0xFFFFFFFF -#else -#define NEGATIVE_ONE -1 -#endif +static int +SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display) +{ + if (!display->num_display_modes && _this->GetDisplayModes) { + _this->GetDisplayModes(_this, display); + SDL_qsort(display->display_modes, display->num_display_modes, + sizeof(SDL_DisplayMode), cmpmodes); + } + return display->num_display_modes; +} + +int +SDL_GetNumDisplayModes(int displayIndex) +{ + CHECK_DISPLAY_INDEX(displayIndex, -1); -int SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags) -{ - int table, b, i; - int supported; - SDL_PixelFormat format; - SDL_Rect **sizes; - - /* Currently 1 and 4 bpp are not supported */ - if ( bpp < 8 || bpp > 32 ) { - return(0); - } - if ( (width <= 0) || (height <= 0) ) { - return(0); - } - - /* Search through the list valid of modes */ - SDL_memset(&format, 0, sizeof(format)); - supported = 0; - table = ((bpp+7)/8)-1; - SDL_closest_depths[table][0] = bpp; - SDL_closest_depths[table][7] = 0; - for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) { - format.BitsPerPixel = SDL_closest_depths[table][b]; - sizes = SDL_ListModes(&format, flags); - if ( sizes == (SDL_Rect **)0 ) { - /* No sizes supported at this bit-depth */ - continue; - } else - if (sizes == (SDL_Rect **)NEGATIVE_ONE) { - /* Any size supported at this bit-depth */ - supported = 1; - continue; - } else if (current_video->handles_any_size) { - /* Driver can center a smaller surface to simulate fullscreen */ - for ( i=0; sizes[i]; ++i ) { - if ((sizes[i]->w >= width) && (sizes[i]->h >= height)) { - supported = 1; /* this mode can fit the centered window. */ - break; - } - } - } else - for ( i=0; sizes[i]; ++i ) { - if ((sizes[i]->w == width) && (sizes[i]->h == height)) { - supported = 1; - break; - } - } - } - if ( supported ) { - --b; - return(SDL_closest_depths[table][b]); - } else { - return(0); - } + return SDL_GetNumDisplayModesForDisplay(&_this->displays[displayIndex]); } -/* - * Get the closest non-emulated video mode to the one requested - */ -static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags) -{ - int table, b, i; - int supported; - int native_bpp; - SDL_PixelFormat format; - SDL_Rect **sizes; - - /* Check parameters */ - if ( *BitsPerPixel < 8 || *BitsPerPixel > 32 ) { - SDL_SetError("Invalid bits per pixel (range is {8...32})"); - return(0); - } - if ((*w <= 0) || (*h <= 0)) { - SDL_SetError("Invalid width or height"); - return(0); - } - - /* Try the original video mode, get the closest depth */ - native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags); - if ( native_bpp == *BitsPerPixel ) { - return(1); - } - if ( native_bpp > 0 ) { - *BitsPerPixel = native_bpp; - return(1); - } - - /* No exact size match at any depth, look for closest match */ - SDL_memset(&format, 0, sizeof(format)); - supported = 0; - table = ((*BitsPerPixel+7)/8)-1; - SDL_closest_depths[table][0] = *BitsPerPixel; - SDL_closest_depths[table][7] = SDL_VideoSurface->format->BitsPerPixel; - for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) { - int best; - - format.BitsPerPixel = SDL_closest_depths[table][b]; - sizes = SDL_ListModes(&format, flags); - if ( sizes == (SDL_Rect **)0 ) { - /* No sizes supported at this bit-depth */ - continue; - } - best=0; - for ( i=0; sizes[i]; ++i ) { - /* Mode with both dimensions bigger or equal than asked ? */ - if ((sizes[i]->w >= *w) && (sizes[i]->h >= *h)) { - /* Mode with any dimension smaller or equal than current best ? */ - if ((sizes[i]->w <= sizes[best]->w) || (sizes[i]->h <= sizes[best]->h)) { - /* Now choose the mode that has less pixels */ - if ((sizes[i]->w * sizes[i]->h) <= (sizes[best]->w * sizes[best]->h)) { - best=i; - supported = 1; - } - } - } - } - if (supported) { - *w=sizes[best]->w; - *h=sizes[best]->h; - *BitsPerPixel = SDL_closest_depths[table][b]; - } - } - if ( ! supported ) { - SDL_SetError("No video mode large enough for %dx%d", *w, *h); - } - return(supported); -} - -/* This should probably go somewhere else -- like SDL_surface.c */ -static void SDL_ClearSurface(SDL_Surface *surface) -{ - Uint32 black; - - black = SDL_MapRGB(surface->format, 0, 0, 0); - SDL_FillRect(surface, NULL, black); - if ((surface->flags&SDL_HWSURFACE) && (surface->flags&SDL_DOUBLEBUF)) { - SDL_Flip(surface); - SDL_FillRect(surface, NULL, black); - } - if (surface->flags&SDL_FULLSCREEN) { - SDL_Flip(surface); - } +int +SDL_GetDisplayMode(int displayIndex, int index, SDL_DisplayMode * mode) +{ + SDL_VideoDisplay *display; + + CHECK_DISPLAY_INDEX(displayIndex, -1); + + display = &_this->displays[displayIndex]; + if (index < 0 || index >= SDL_GetNumDisplayModesForDisplay(display)) { + return SDL_SetError("index must be in the range of 0 - %d", + SDL_GetNumDisplayModesForDisplay(display) - 1); + } + if (mode) { + *mode = display->display_modes[index]; + } + return 0; } -/* - * Create a shadow surface suitable for fooling the app. :-) - */ -static void SDL_CreateShadowSurface(int depth) -{ - Uint32 Rmask, Gmask, Bmask; - - /* Allocate the shadow surface */ - if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) { - Rmask = (SDL_VideoSurface->format)->Rmask; - Gmask = (SDL_VideoSurface->format)->Gmask; - Bmask = (SDL_VideoSurface->format)->Bmask; - } else { - Rmask = Gmask = Bmask = 0; - } - SDL_ShadowSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, - SDL_VideoSurface->w, SDL_VideoSurface->h, - depth, Rmask, Gmask, Bmask, 0); - if ( SDL_ShadowSurface == NULL ) { - return; - } - - /* 8-bit shadow surfaces report that they have exclusive palette */ - if ( SDL_ShadowSurface->format->palette ) { - SDL_ShadowSurface->flags |= SDL_HWPALETTE; - if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) { - SDL_memcpy(SDL_ShadowSurface->format->palette->colors, - SDL_VideoSurface->format->palette->colors, - SDL_VideoSurface->format->palette->ncolors* - sizeof(SDL_Color)); - } else { - SDL_DitherColors( - SDL_ShadowSurface->format->palette->colors, depth); - } - } - - /* If the video surface is resizable, the shadow should say so */ - if ( (SDL_VideoSurface->flags & SDL_RESIZABLE) == SDL_RESIZABLE ) { - SDL_ShadowSurface->flags |= SDL_RESIZABLE; - } - /* If the video surface has no frame, the shadow should say so */ - if ( (SDL_VideoSurface->flags & SDL_NOFRAME) == SDL_NOFRAME ) { - SDL_ShadowSurface->flags |= SDL_NOFRAME; - } - /* If the video surface is fullscreen, the shadow should say so */ - if ( (SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) { - SDL_ShadowSurface->flags |= SDL_FULLSCREEN; - } - /* If the video surface is flippable, the shadow should say so */ - if ( (SDL_VideoSurface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { - SDL_ShadowSurface->flags |= SDL_DOUBLEBUF; - } - return; -} - -#ifdef __QNXNTO__ - #include -#endif /* __QNXNTO__ */ - -#ifdef WIN32 - extern int sysevents_mouse_pressed; -#endif +int +SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode) +{ + SDL_VideoDisplay *display; -/* - * Set the requested video mode, allocating a shadow buffer if necessary. - */ -SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) -{ - SDL_VideoDevice *video, *this; - SDL_Surface *prev_mode, *mode; - int video_w; - int video_h; - int video_bpp; - int is_opengl; - SDL_GrabMode saved_grab; - - #ifdef WIN32 - sysevents_mouse_pressed = 0; - #endif - - /* Start up the video driver, if necessary.. - WARNING: This is the only function protected this way! - */ - if ( ! current_video ) { - if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) < 0 ) { - return(NULL); - } - } - this = video = current_video; - - /* Default to the current width and height */ - if ( width == 0 ) { - width = video->info.current_w; - } - if ( height == 0 ) { - height = video->info.current_h; - } - /* Default to the current video bpp */ - if ( bpp == 0 ) { - flags |= SDL_ANYFORMAT; - bpp = SDL_VideoSurface->format->BitsPerPixel; - } - - /* Get a good video mode, the closest one possible */ - video_w = width; - video_h = height; - video_bpp = bpp; - if ( ! SDL_GetVideoMode(&video_w, &video_h, &video_bpp, flags) ) { - return(NULL); - } - - /* Check the requested flags */ - /* There's no palette in > 8 bits-per-pixel mode */ - if ( video_bpp > 8 ) { - flags &= ~SDL_HWPALETTE; - } -#if 0 - if ( (flags&SDL_FULLSCREEN) != SDL_FULLSCREEN ) { - /* There's no windowed double-buffering */ - flags &= ~SDL_DOUBLEBUF; - } -#endif - if ( (flags&SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { - /* Use hardware surfaces when double-buffering */ - flags |= SDL_HWSURFACE; - } - - is_opengl = ( ( flags & SDL_OPENGL ) == SDL_OPENGL ); - if ( is_opengl ) { - /* These flags are for 2D video modes only */ - flags &= ~(SDL_HWSURFACE|SDL_DOUBLEBUF); - } - - /* Reset the keyboard here so event callbacks can run */ - SDL_ResetKeyboard(); - SDL_ResetMouse(); - SDL_SetMouseRange(width, height); - SDL_cursorstate &= ~CURSOR_USINGSW; - - /* Clean up any previous video mode */ - if ( SDL_PublicSurface != NULL ) { - SDL_PublicSurface = NULL; - } - if ( SDL_ShadowSurface != NULL ) { - SDL_Surface *ready_to_go; - ready_to_go = SDL_ShadowSurface; - SDL_ShadowSurface = NULL; - SDL_FreeSurface(ready_to_go); - } - if ( video->physpal ) { - SDL_free(video->physpal->colors); - SDL_free(video->physpal); - video->physpal = NULL; - } - if( video->gammacols) { - SDL_free(video->gammacols); - video->gammacols = NULL; - } - - /* Save the previous grab state and turn off grab for mode switch */ - saved_grab = SDL_WM_GrabInputOff(); - - /* Try to set the video mode, along with offset and clipping */ - prev_mode = SDL_VideoSurface; - SDL_LockCursor(); - SDL_VideoSurface = NULL; /* In case it's freed by driver */ - mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags); - if ( mode ) { /* Prevent resize events from mode change */ - /* But not on OS/2 */ -#ifndef __OS2__ - SDL_PrivateResize(mode->w, mode->h); -#endif + CHECK_DISPLAY_INDEX(displayIndex, -1); + + display = &_this->displays[displayIndex]; + if (mode) { + *mode = display->desktop_mode; + } + return 0; +} + +int +SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode) +{ + SDL_VideoDisplay *display; + + CHECK_DISPLAY_INDEX(displayIndex, -1); + + display = &_this->displays[displayIndex]; + if (mode) { + *mode = display->current_mode; + } + return 0; +} - /* Sam - If we asked for OpenGL mode, and didn't get it, fail */ - if ( is_opengl && !(mode->flags & SDL_OPENGL) ) { - mode = NULL; - SDL_SetError("OpenGL not available"); - } - } - /* - * rcg11292000 - * If you try to set an SDL_OPENGL surface, and fail to find a - * matching visual, then the next call to SDL_SetVideoMode() - * will segfault, since we no longer point to a dummy surface, - * but rather NULL. - * Sam 11/29/00 - * WARNING, we need to make sure that the previous mode hasn't - * already been freed by the video driver. What do we do in - * that case? Should we call SDL_VideoInit() again? - */ - SDL_VideoSurface = (mode != NULL) ? mode : prev_mode; - - if ( (mode != NULL) && (!is_opengl) ) { - /* Sanity check */ - if ( (mode->w < width) || (mode->h < height) ) { - SDL_SetError("Video mode smaller than requested"); - return(NULL); - } - - /* If we have a palettized surface, create a default palette */ - if ( mode->format->palette ) { - SDL_PixelFormat *vf = mode->format; - SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel); - video->SetColors(this, 0, vf->palette->ncolors, - vf->palette->colors); - } - - /* Clear the surface to black */ - video->offset_x = 0; - video->offset_y = 0; - mode->offset = 0; - SDL_SetClipRect(mode, NULL); - SDL_ClearSurface(mode); - - /* Now adjust the offsets to match the desired mode */ - video->offset_x = (mode->w-width)/2; - video->offset_y = (mode->h-height)/2; - mode->offset = video->offset_y*mode->pitch + - video->offset_x*mode->format->BytesPerPixel; -#ifdef DEBUG_VIDEO - fprintf(stderr, - "Requested mode: %dx%dx%d, obtained mode %dx%dx%d (offset %d)\n", - width, height, bpp, - mode->w, mode->h, mode->format->BitsPerPixel, mode->offset); +static SDL_DisplayMode * +SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, + const SDL_DisplayMode * mode, + SDL_DisplayMode * closest) +{ + Uint32 target_format; + int target_refresh_rate; + int i; + SDL_DisplayMode *current, *match; + + if (!mode || !closest) { + SDL_SetError("Missing desired mode or closest mode parameter"); + return NULL; + } + + /* Default to the desktop format */ + if (mode->format) { + target_format = mode->format; + } else { + target_format = display->desktop_mode.format; + } + + /* Default to the desktop refresh rate */ + if (mode->refresh_rate) { + target_refresh_rate = mode->refresh_rate; + } else { + target_refresh_rate = display->desktop_mode.refresh_rate; + } + + match = NULL; + for (i = 0; i < SDL_GetNumDisplayModesForDisplay(display); ++i) { + current = &display->display_modes[i]; + + if (current->w && (current->w < mode->w)) { + /* Out of sorted modes large enough here */ + break; + } + if (current->h && (current->h < mode->h)) { + if (current->w && (current->w == mode->w)) { + /* Out of sorted modes large enough here */ + break; + } + /* Wider, but not tall enough, due to a different + aspect ratio. This mode must be skipped, but closer + modes may still follow. */ + continue; + } + if (!match || current->w < match->w || current->h < match->h) { + match = current; + continue; + } + if (current->format != match->format) { + /* Sorted highest depth to lowest */ + if (current->format == target_format || + (SDL_BITSPERPIXEL(current->format) >= + SDL_BITSPERPIXEL(target_format) + && SDL_PIXELTYPE(current->format) == + SDL_PIXELTYPE(target_format))) { + match = current; + } + continue; + } + if (current->refresh_rate != match->refresh_rate) { + /* Sorted highest refresh to lowest */ + if (current->refresh_rate >= target_refresh_rate) { + match = current; + } + } + } + if (match) { + if (match->format) { + closest->format = match->format; + } else { + closest->format = mode->format; + } + if (match->w && match->h) { + closest->w = match->w; + closest->h = match->h; + } else { + closest->w = mode->w; + closest->h = mode->h; + } + if (match->refresh_rate) { + closest->refresh_rate = match->refresh_rate; + } else { + closest->refresh_rate = mode->refresh_rate; + } + closest->driverdata = match->driverdata; + + /* + * Pick some reasonable defaults if the app and driver don't + * care + */ + if (!closest->format) { + closest->format = SDL_PIXELFORMAT_RGB888; + } + if (!closest->w) { + closest->w = 640; + } + if (!closest->h) { + closest->h = 480; + } + return closest; + } + return NULL; +} + +SDL_DisplayMode * +SDL_GetClosestDisplayMode(int displayIndex, + const SDL_DisplayMode * mode, + SDL_DisplayMode * closest) +{ + SDL_VideoDisplay *display; + + CHECK_DISPLAY_INDEX(displayIndex, NULL); + + display = &_this->displays[displayIndex]; + return SDL_GetClosestDisplayModeForDisplay(display, mode, closest); +} + +static int +SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) +{ + SDL_DisplayMode display_mode; + SDL_DisplayMode current_mode; + + if (mode) { + display_mode = *mode; + + /* Default to the current mode */ + if (!display_mode.format) { + display_mode.format = display->current_mode.format; + } + if (!display_mode.w) { + display_mode.w = display->current_mode.w; + } + if (!display_mode.h) { + display_mode.h = display->current_mode.h; + } + if (!display_mode.refresh_rate) { + display_mode.refresh_rate = display->current_mode.refresh_rate; + } + + /* Get a good video mode, the closest one possible */ + if (!SDL_GetClosestDisplayModeForDisplay(display, &display_mode, &display_mode)) { + return SDL_SetError("No video mode large enough for %dx%d", + display_mode.w, display_mode.h); + } + } else { + display_mode = display->desktop_mode; + } + + /* See if there's anything left to do */ + current_mode = display->current_mode; + if (SDL_memcmp(&display_mode, ¤t_mode, sizeof(display_mode)) == 0) { + return 0; + } + + /* Actually change the display mode */ + if (!_this->SetDisplayMode) { + return SDL_SetError("Video driver doesn't support changing display mode"); + } + if (_this->SetDisplayMode(_this, display, &display_mode) < 0) { + return -1; + } + display->current_mode = display_mode; + return 0; +} + +int +SDL_GetWindowDisplayIndex(SDL_Window * window) +{ + int displayIndex; + int i, dist; + int closest = -1; + int closest_dist = 0x7FFFFFFF; + SDL_Point center; + SDL_Point delta; + SDL_Rect rect; + + CHECK_WINDOW_MAGIC(window, -1); + + if (SDL_WINDOWPOS_ISUNDEFINED(window->x) || + SDL_WINDOWPOS_ISCENTERED(window->x)) { + displayIndex = (window->x & 0xFFFF); + if (displayIndex >= _this->num_displays) { + displayIndex = 0; + } + return displayIndex; + } + if (SDL_WINDOWPOS_ISUNDEFINED(window->y) || + SDL_WINDOWPOS_ISCENTERED(window->y)) { + displayIndex = (window->y & 0xFFFF); + if (displayIndex >= _this->num_displays) { + displayIndex = 0; + } + return displayIndex; + } + + /* Find the display containing the window */ + for (i = 0; i < _this->num_displays; ++i) { + SDL_VideoDisplay *display = &_this->displays[i]; + + if (display->fullscreen_window == window) { + return i; + } + } + center.x = window->x + window->w / 2; + center.y = window->y + window->h / 2; + for (i = 0; i < _this->num_displays; ++i) { + SDL_GetDisplayBounds(i, &rect); + if (SDL_EnclosePoints(¢er, 1, &rect, NULL)) { + return i; + } + + delta.x = center.x - (rect.x + rect.w / 2); + delta.y = center.y - (rect.y + rect.h / 2); + dist = (delta.x*delta.x + delta.y*delta.y); + if (dist < closest_dist) { + closest = i; + closest_dist = dist; + } + } + if (closest < 0) { + SDL_SetError("Couldn't find any displays"); + } + return closest; +} + +SDL_VideoDisplay * +SDL_GetDisplayForWindow(SDL_Window *window) +{ + int displayIndex = SDL_GetWindowDisplayIndex(window); + if (displayIndex >= 0) { + return &_this->displays[displayIndex]; + } else { + return NULL; + } +} + +int +SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (mode) { + window->fullscreen_mode = *mode; + } else { + SDL_zero(window->fullscreen_mode); + } + return 0; +} + +int +SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) +{ + SDL_DisplayMode fullscreen_mode; + SDL_VideoDisplay *display; + + if (!mode) { + return SDL_InvalidParamError("mode"); + } + + CHECK_WINDOW_MAGIC(window, -1); + + fullscreen_mode = window->fullscreen_mode; + if (!fullscreen_mode.w) { + fullscreen_mode.w = window->w; + } + if (!fullscreen_mode.h) { + fullscreen_mode.h = window->h; + } + + display = SDL_GetDisplayForWindow(window); + + /* if in desktop size mode, just return the size of the desktop */ + if ( ( window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) == SDL_WINDOW_FULLSCREEN_DESKTOP ) + { + fullscreen_mode = display->desktop_mode; + } + else if (!SDL_GetClosestDisplayModeForDisplay(SDL_GetDisplayForWindow(window), + &fullscreen_mode, + &fullscreen_mode)) { + return SDL_SetError("Couldn't find display mode match"); + } + + if (mode) { + *mode = fullscreen_mode; + } + return 0; +} + +Uint32 +SDL_GetWindowPixelFormat(SDL_Window * window) +{ + SDL_VideoDisplay *display; + + CHECK_WINDOW_MAGIC(window, SDL_PIXELFORMAT_UNKNOWN); + + display = SDL_GetDisplayForWindow(window); + return display->current_mode.format; +} + +static void +SDL_RestoreMousePosition(SDL_Window *window) +{ + int x, y; + + if (window == SDL_GetMouseFocus()) { + SDL_GetMouseState(&x, &y); + SDL_WarpMouseInWindow(window, x, y); + } +} + +static void +SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) +{ + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); + SDL_Window *other; + + if (fullscreen) { + /* Hide any other fullscreen windows */ + if (display->fullscreen_window && + display->fullscreen_window != window) { + SDL_MinimizeWindow(display->fullscreen_window); + } + } + + /* See if anything needs to be done now */ + if ((display->fullscreen_window == window) == fullscreen) { + return; + } + + /* See if there are any fullscreen windows */ + for (other = _this->windows; other; other = other->next) { + SDL_bool setDisplayMode = SDL_FALSE; + + if (other == window) { + setDisplayMode = fullscreen; + } else if (FULLSCREEN_VISIBLE(other) && + SDL_GetDisplayForWindow(other) == display) { + setDisplayMode = SDL_TRUE; + } + + if (setDisplayMode) { + SDL_DisplayMode fullscreen_mode; + + if (SDL_GetWindowDisplayMode(other, &fullscreen_mode) == 0) { + SDL_bool resized = SDL_TRUE; + + if (other->w == fullscreen_mode.w && other->h == fullscreen_mode.h) { + resized = SDL_FALSE; + } + + /* only do the mode change if we want exclusive fullscreen */ + if ( ( window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) != SDL_WINDOW_FULLSCREEN_DESKTOP ) + SDL_SetDisplayModeForDisplay(display, &fullscreen_mode); + else + SDL_SetDisplayModeForDisplay(display, NULL); + + + if (_this->SetWindowFullscreen) { + _this->SetWindowFullscreen(_this, other, display, SDL_TRUE); + } + display->fullscreen_window = other; + + /* Generate a mode change event here */ + if (resized) { + SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED, + fullscreen_mode.w, fullscreen_mode.h); + } else { + SDL_OnWindowResized(other); + } + + SDL_RestoreMousePosition(other); + return; + } + } + } + + /* Nope, restore the desktop mode */ + SDL_SetDisplayModeForDisplay(display, NULL); + + if (_this->SetWindowFullscreen) { + _this->SetWindowFullscreen(_this, window, display, SDL_FALSE); + } + display->fullscreen_window = NULL; + + /* Generate a mode change event here */ + SDL_OnWindowResized(window); + + /* Restore the cursor position */ + SDL_RestoreMousePosition(window); +} + +#define CREATE_FLAGS \ + (SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE) + +static void +SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags) +{ + window->windowed.x = window->x; + window->windowed.y = window->y; + window->windowed.w = window->w; + window->windowed.h = window->h; + + if (flags & SDL_WINDOW_MAXIMIZED) { + SDL_MaximizeWindow(window); + } + if (flags & SDL_WINDOW_MINIMIZED) { + SDL_MinimizeWindow(window); + } + if (flags & SDL_WINDOW_FULLSCREEN) { + SDL_SetWindowFullscreen(window, flags); + } + if (flags & SDL_WINDOW_INPUT_GRABBED) { + SDL_SetWindowGrab(window, SDL_TRUE); + } + if (!(flags & SDL_WINDOW_HIDDEN)) { + SDL_ShowWindow(window); + } +} + +SDL_Window * +SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) +{ + SDL_Window *window; + + if (!_this) { + /* Initialize the video system if needed */ + if (SDL_VideoInit(NULL) < 0) { + return NULL; + } + } + + /* Some platforms can't create zero-sized windows */ + if (w < 1) { + w = 1; + } + if (h < 1) { + h = 1; + } + + /* Some platforms have OpenGL enabled by default */ +#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__ + flags |= SDL_WINDOW_OPENGL; #endif - mode->w = width; - mode->h = height; - SDL_SetClipRect(mode, NULL); - } - SDL_ResetCursor(); - SDL_UnlockCursor(); - - /* If we failed setting a video mode, return NULL... (Uh Oh!) */ - if ( mode == NULL ) { - return(NULL); - } - - /* If there is no window manager, set the SDL_NOFRAME flag */ - if ( ! video->info.wm_available ) { - mode->flags |= SDL_NOFRAME; - } - - /* Reset the mouse cursor and grab for new video mode */ - SDL_SetCursor(NULL); - if ( video->UpdateMouse ) { - video->UpdateMouse(this); - } - SDL_WM_GrabInput(saved_grab); - SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */ + if (flags & SDL_WINDOW_OPENGL) { + if (!_this->GL_CreateContext) { + SDL_SetError("No OpenGL support in video driver"); + return NULL; + } + if (SDL_GL_LoadLibrary(NULL) < 0) { + return NULL; + } + } + window = (SDL_Window *)SDL_calloc(1, sizeof(*window)); + if (!window) { + SDL_OutOfMemory(); + return NULL; + } + window->magic = &_this->window_magic; + window->id = _this->next_object_id++; + window->x = x; + window->y = y; + window->w = w; + window->h = h; + if (SDL_WINDOWPOS_ISUNDEFINED(x) || SDL_WINDOWPOS_ISUNDEFINED(y) || + SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) { + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); + int displayIndex; + SDL_Rect bounds; + + displayIndex = SDL_GetIndexOfDisplay(display); + SDL_GetDisplayBounds(displayIndex, &bounds); + if (SDL_WINDOWPOS_ISUNDEFINED(x) || SDL_WINDOWPOS_ISCENTERED(x)) { + window->x = bounds.x + (bounds.w - w) / 2; + } + if (SDL_WINDOWPOS_ISUNDEFINED(y) || SDL_WINDOWPOS_ISCENTERED(y)) { + window->y = bounds.y + (bounds.h - h) / 2; + } + } + window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN); + window->brightness = 1.0f; + window->next = _this->windows; + if (_this->windows) { + _this->windows->prev = window; + } + _this->windows = window; + + if (_this->CreateWindow && _this->CreateWindow(_this, window) < 0) { + SDL_DestroyWindow(window); + return NULL; + } + + if (title) { + SDL_SetWindowTitle(window, title); + } + SDL_FinishWindowCreation(window, flags); + + /* If the window was created fullscreen, make sure the mode code matches */ + SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)); + + return window; +} -#if SDL_VIDEO_OPENGL - /* Load GL symbols (before MakeCurrent, where we need glGetString). */ - if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) { +SDL_Window * +SDL_CreateWindowFrom(const void *data) +{ + SDL_Window *window; + + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + window = (SDL_Window *)SDL_calloc(1, sizeof(*window)); + if (!window) { + SDL_OutOfMemory(); + return NULL; + } + window->magic = &_this->window_magic; + window->id = _this->next_object_id++; + window->flags = SDL_WINDOW_FOREIGN; + window->brightness = 1.0f; + window->next = _this->windows; + if (_this->windows) { + _this->windows->prev = window; + } + _this->windows = window; + + if (!_this->CreateWindowFrom || + _this->CreateWindowFrom(_this, window, data) < 0) { + SDL_DestroyWindow(window); + return NULL; + } + return window; +} + +int +SDL_RecreateWindow(SDL_Window * window, Uint32 flags) +{ + char *title = window->title; + SDL_Surface *icon = window->icon; + + if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) { + return SDL_SetError("No OpenGL support in video driver"); + } + + if (window->flags & SDL_WINDOW_FOREIGN) { + /* Can't destroy and re-create foreign windows, hrm */ + flags |= SDL_WINDOW_FOREIGN; + } else { + flags &= ~SDL_WINDOW_FOREIGN; + } + + /* Restore video mode, etc. */ + SDL_HideWindow(window); + + /* Tear down the old native window */ + if (window->surface) { + window->surface->flags &= ~SDL_DONTFREE; + SDL_FreeSurface(window->surface); + } + if (_this->DestroyWindowFramebuffer) { + _this->DestroyWindowFramebuffer(_this, window); + } + if (_this->DestroyWindow && !(flags & SDL_WINDOW_FOREIGN)) { + _this->DestroyWindow(_this, window); + } + + if ((window->flags & SDL_WINDOW_OPENGL) != (flags & SDL_WINDOW_OPENGL)) { + if (flags & SDL_WINDOW_OPENGL) { + if (SDL_GL_LoadLibrary(NULL) < 0) { + return -1; + } + } else { + SDL_GL_UnloadLibrary(); + } + } + + window->title = NULL; + window->icon = NULL; + window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN); + + if (_this->CreateWindow && !(flags & SDL_WINDOW_FOREIGN)) { + if (_this->CreateWindow(_this, window) < 0) { + if (flags & SDL_WINDOW_OPENGL) { + SDL_GL_UnloadLibrary(); + } + return -1; + } + } + + if (title) { + SDL_SetWindowTitle(window, title); + SDL_free(title); + } + if (icon) { + SDL_SetWindowIcon(window, icon); + SDL_FreeSurface(icon); + } + SDL_FinishWindowCreation(window, flags); + + return 0; +} + +Uint32 +SDL_GetWindowID(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, 0); + + return window->id; +} + +SDL_Window * +SDL_GetWindowFromID(Uint32 id) +{ + SDL_Window *window; + + if (!_this) { + return NULL; + } + for (window = _this->windows; window; window = window->next) { + if (window->id == id) { + return window; + } + } + return NULL; +} + +Uint32 +SDL_GetWindowFlags(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, 0); + + return window->flags; +} + +void +SDL_SetWindowTitle(SDL_Window * window, const char *title) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (title == window->title) { + return; + } + if (window->title) { + SDL_free(window->title); + } + if (title && *title) { + window->title = SDL_strdup(title); + } else { + window->title = NULL; + } + + if (_this->SetWindowTitle) { + _this->SetWindowTitle(_this, window); + } +} + +const char * +SDL_GetWindowTitle(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, ""); + + return window->title ? window->title : ""; +} + +void +SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (!icon) { + return; + } + + if (window->icon) { + SDL_FreeSurface(window->icon); + } + + /* Convert the icon into ARGB8888 */ + window->icon = SDL_ConvertSurfaceFormat(icon, SDL_PIXELFORMAT_ARGB8888, 0); + if (!window->icon) { + return; + } + + if (_this->SetWindowIcon) { + _this->SetWindowIcon(_this, window, window->icon); + } +} + +void* +SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata) +{ + SDL_WindowUserData *prev, *data; + + CHECK_WINDOW_MAGIC(window, NULL); + + /* Input validation */ + if (name == NULL || SDL_strlen(name) == 0) { + SDL_InvalidParamError("name"); + return NULL; + } + + /* See if the named data already exists */ + prev = NULL; + for (data = window->data; data; prev = data, data = data->next) { + if (data->name && SDL_strcmp(data->name, name) == 0) { + void *last_value = data->data; + + if (userdata) { + /* Set the new value */ + data->data = userdata; + } else { + /* Delete this value */ + if (prev) { + prev->next = data->next; + } else { + window->data = data->next; + } + SDL_free(data->name); + SDL_free(data); + } + return last_value; + } + } + + /* Add new data to the window */ + if (userdata) { + data = (SDL_WindowUserData *)SDL_malloc(sizeof(*data)); + data->name = SDL_strdup(name); + data->data = userdata; + data->next = window->data; + window->data = data; + } + return NULL; +} + +void * +SDL_GetWindowData(SDL_Window * window, const char *name) +{ + SDL_WindowUserData *data; + + CHECK_WINDOW_MAGIC(window, NULL); + + /* Input validation */ + if (name == NULL || SDL_strlen(name) == 0) { + SDL_InvalidParamError("name"); + return NULL; + } + + for (data = window->data; data; data = data->next) { + if (data->name && SDL_strcmp(data->name, name) == 0) { + return data->data; + } + } + return NULL; +} + +void +SDL_SetWindowPosition(SDL_Window * window, int x, int y) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) { + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); + int displayIndex; + SDL_Rect bounds; + + displayIndex = SDL_GetIndexOfDisplay(display); + SDL_GetDisplayBounds(displayIndex, &bounds); + if (SDL_WINDOWPOS_ISCENTERED(x)) { + x = bounds.x + (bounds.w - window->w) / 2; + } + if (SDL_WINDOWPOS_ISCENTERED(y)) { + y = bounds.y + (bounds.h - window->h) / 2; + } + } + + if (!SDL_WINDOWPOS_ISUNDEFINED(x)) { + window->x = x; + } + if (!SDL_WINDOWPOS_ISUNDEFINED(y)) { + window->y = y; + } + + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + if (_this->SetWindowPosition) { + _this->SetWindowPosition(_this, window); + } + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y); + } +} + +void +SDL_GetWindowPosition(SDL_Window * window, int *x, int *y) +{ + CHECK_WINDOW_MAGIC(window, ); + + /* Fullscreen windows are always at their display's origin */ + if (window->flags & SDL_WINDOW_FULLSCREEN) { + if (x) { + *x = 0; + } + if (y) { + *y = 0; + } + } else { + if (x) { + *x = window->x; + } + if (y) { + *y = window->y; + } + } +} + +void +SDL_SetWindowBordered(SDL_Window * window, SDL_bool bordered) +{ + CHECK_WINDOW_MAGIC(window, ); + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + const int want = (bordered != SDL_FALSE); /* normalize the flag. */ + const int have = ((window->flags & SDL_WINDOW_BORDERLESS) == 0); + if ((want != have) && (_this->SetWindowBordered)) { + if (want) { + window->flags &= ~SDL_WINDOW_BORDERLESS; + } else { + window->flags |= SDL_WINDOW_BORDERLESS; + } + _this->SetWindowBordered(_this, window, (SDL_bool) want); + } + } +} + +void +SDL_SetWindowSize(SDL_Window * window, int w, int h) +{ + CHECK_WINDOW_MAGIC(window, ); + if (w <= 0) { + SDL_InvalidParamError("w"); + return; + } + if (h <= 0) { + SDL_InvalidParamError("h"); + return; + } + + /* FIXME: Should this change fullscreen modes? */ + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + window->w = w; + window->h = h; + if (_this->SetWindowSize) { + _this->SetWindowSize(_this, window); + } + if (window->w == w && window->h == h) { + /* We didn't get a SDL_WINDOWEVENT_RESIZED event (by design) */ + SDL_OnWindowResized(window); + } + } +} + +void +SDL_GetWindowSize(SDL_Window * window, int *w, int *h) +{ + CHECK_WINDOW_MAGIC(window, ); + if (w) { + *w = window->w; + } + if (h) { + *h = window->h; + } +} + +void +SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h) +{ + CHECK_WINDOW_MAGIC(window, ); + if (min_w <= 0) { + SDL_InvalidParamError("min_w"); + return; + } + if (min_h <= 0) { + SDL_InvalidParamError("min_h"); + return; + } + + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + window->min_w = min_w; + window->min_h = min_h; + if (_this->SetWindowMinimumSize) { + _this->SetWindowMinimumSize(_this, window); + } + /* Ensure that window is not smaller than minimal size */ + SDL_SetWindowSize(window, SDL_max(window->w, window->min_w), SDL_max(window->h, window->min_h)); + } +} + +void +SDL_GetWindowMinimumSize(SDL_Window * window, int *min_w, int *min_h) +{ + CHECK_WINDOW_MAGIC(window, ); + if (min_w) { + *min_w = window->min_w; + } + if (min_h) { + *min_h = window->min_h; + } +} + +void +SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h) +{ + CHECK_WINDOW_MAGIC(window, ); + if (max_w <= 0) { + SDL_InvalidParamError("max_w"); + return; + } + if (max_h <= 0) { + SDL_InvalidParamError("max_h"); + return; + } + + if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { + window->max_w = max_w; + window->max_h = max_h; + if (_this->SetWindowMaximumSize) { + _this->SetWindowMaximumSize(_this, window); + } + /* Ensure that window is not larger than maximal size */ + SDL_SetWindowSize(window, SDL_min(window->w, window->max_w), SDL_min(window->h, window->max_h)); + } +} + +void +SDL_GetWindowMaximumSize(SDL_Window * window, int *max_w, int *max_h) +{ + CHECK_WINDOW_MAGIC(window, ); + if (max_w) { + *max_w = window->max_w; + } + if (max_h) { + *max_h = window->max_h; + } +} + +void +SDL_ShowWindow(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (window->flags & SDL_WINDOW_SHOWN) { + return; + } + + if (_this->ShowWindow) { + _this->ShowWindow(_this, window); + } + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SHOWN, 0, 0); +} + +void +SDL_HideWindow(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (!(window->flags & SDL_WINDOW_SHOWN)) { + return; + } + + SDL_UpdateFullscreenMode(window, SDL_FALSE); -#if defined(__QNXNTO__) && (_NTO_VERSION < 630) -#define __SDL_NOGETPROCADDR__ -#elif defined(__MINT__) -#define __SDL_NOGETPROCADDR__ + if (_this->HideWindow) { + _this->HideWindow(_this, window); + } + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_HIDDEN, 0, 0); +} + +void +SDL_RaiseWindow(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (!(window->flags & SDL_WINDOW_SHOWN)) { + return; + } + if (_this->RaiseWindow) { + _this->RaiseWindow(_this, window); + } +} + +void +SDL_MaximizeWindow(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (window->flags & SDL_WINDOW_MAXIMIZED) { + return; + } + + // !!! FIXME: should this check if the window is resizable? + + if (_this->MaximizeWindow) { + _this->MaximizeWindow(_this, window); + } +} + +void +SDL_MinimizeWindow(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (window->flags & SDL_WINDOW_MINIMIZED) { + return; + } + + SDL_UpdateFullscreenMode(window, SDL_FALSE); + + if (_this->MinimizeWindow) { + _this->MinimizeWindow(_this, window); + } +} + +void +SDL_RestoreWindow(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (!(window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) { + return; + } + + if (_this->RestoreWindow) { + _this->RestoreWindow(_this, window); + } +} + +#define FULLSCREEN_MASK ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN ) +int +SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags) +{ + CHECK_WINDOW_MAGIC(window, -1); + + flags &= FULLSCREEN_MASK; + + if ( flags == (window->flags & FULLSCREEN_MASK) ) { + return 0; + } + + /* clear the previous flags and OR in the new ones */ + window->flags &= ~FULLSCREEN_MASK; + window->flags |= flags; + + SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)); + + return 0; +} + +static SDL_Surface * +SDL_CreateWindowFramebuffer(SDL_Window * window) +{ + Uint32 format; + void *pixels; + int pitch; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + + if (!_this->CreateWindowFramebuffer || !_this->UpdateWindowFramebuffer) { + return NULL; + } + + if (_this->CreateWindowFramebuffer(_this, window, &format, &pixels, &pitch) < 0) { + return NULL; + } + + if (!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + return NULL; + } + + return SDL_CreateRGBSurfaceFrom(pixels, window->w, window->h, bpp, pitch, Rmask, Gmask, Bmask, Amask); +} + +SDL_Surface * +SDL_GetWindowSurface(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, NULL); + + if (!window->surface_valid) { + if (window->surface) { + window->surface->flags &= ~SDL_DONTFREE; + SDL_FreeSurface(window->surface); + } + window->surface = SDL_CreateWindowFramebuffer(window); + if (window->surface) { + window->surface_valid = SDL_TRUE; + window->surface->flags |= SDL_DONTFREE; + } + } + return window->surface; +} + +int +SDL_UpdateWindowSurface(SDL_Window * window) +{ + SDL_Rect full_rect; + + CHECK_WINDOW_MAGIC(window, -1); + + full_rect.x = 0; + full_rect.y = 0; + full_rect.w = window->w; + full_rect.h = window->h; + return SDL_UpdateWindowSurfaceRects(window, &full_rect, 1); +} + +int +SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects, + int numrects) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (!window->surface_valid) { + return SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface"); + } + + return _this->UpdateWindowFramebuffer(_this, window, rects, numrects); +} + +int +SDL_SetWindowBrightness(SDL_Window * window, float brightness) +{ + Uint16 ramp[256]; + int status; + + CHECK_WINDOW_MAGIC(window, -1); + + SDL_CalculateGammaRamp(brightness, ramp); + status = SDL_SetWindowGammaRamp(window, ramp, ramp, ramp); + if (status == 0) { + window->brightness = brightness; + } + return status; +} + +float +SDL_GetWindowBrightness(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, 1.0f); + + return window->brightness; +} + +int +SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red, + const Uint16 * green, + const Uint16 * blue) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (!_this->SetWindowGammaRamp) { + return SDL_Unsupported(); + } + + if (!window->gamma) { + if (SDL_GetWindowGammaRamp(window, NULL, NULL, NULL) < 0) { + return -1; + } + } + + if (red) { + SDL_memcpy(&window->gamma[0*256], red, 256*sizeof(Uint16)); + } + if (green) { + SDL_memcpy(&window->gamma[1*256], green, 256*sizeof(Uint16)); + } + if (blue) { + SDL_memcpy(&window->gamma[2*256], blue, 256*sizeof(Uint16)); + } + if (window->flags & SDL_WINDOW_INPUT_FOCUS) { + return _this->SetWindowGammaRamp(_this, window, window->gamma); + } else { + return 0; + } +} + +int +SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red, + Uint16 * green, + Uint16 * blue) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (!window->gamma) { + int i; + + window->gamma = (Uint16 *)SDL_malloc(256*6*sizeof(Uint16)); + if (!window->gamma) { + return SDL_OutOfMemory(); + } + window->saved_gamma = window->gamma + 3*256; + + if (_this->GetWindowGammaRamp) { + if (_this->GetWindowGammaRamp(_this, window, window->gamma) < 0) { + return -1; + } + } else { + /* Create an identity gamma ramp */ + for (i = 0; i < 256; ++i) { + Uint16 value = (Uint16)((i << 8) | i); + + window->gamma[0*256+i] = value; + window->gamma[1*256+i] = value; + window->gamma[2*256+i] = value; + } + } + SDL_memcpy(window->saved_gamma, window->gamma, 3*256*sizeof(Uint16)); + } + + if (red) { + SDL_memcpy(red, &window->gamma[0*256], 256*sizeof(Uint16)); + } + if (green) { + SDL_memcpy(green, &window->gamma[1*256], 256*sizeof(Uint16)); + } + if (blue) { + SDL_memcpy(blue, &window->gamma[2*256], 256*sizeof(Uint16)); + } + return 0; +} + +void +SDL_UpdateWindowGrab(SDL_Window * window) +{ + if (_this->SetWindowGrab) { + SDL_bool grabbed; + if ((window->flags & SDL_WINDOW_INPUT_GRABBED) && + (window->flags & SDL_WINDOW_INPUT_FOCUS)) { + grabbed = SDL_TRUE; + } else { + grabbed = SDL_FALSE; + } + _this->SetWindowGrab(_this, window, grabbed); + } +} + +void +SDL_SetWindowGrab(SDL_Window * window, SDL_bool grabbed) +{ + CHECK_WINDOW_MAGIC(window, ); + + if (!!grabbed == !!(window->flags & SDL_WINDOW_INPUT_GRABBED)) { + return; + } + if (grabbed) { + window->flags |= SDL_WINDOW_INPUT_GRABBED; + } else { + window->flags &= ~SDL_WINDOW_INPUT_GRABBED; + } + SDL_UpdateWindowGrab(window); +} + +SDL_bool +SDL_GetWindowGrab(SDL_Window * window) +{ + CHECK_WINDOW_MAGIC(window, SDL_FALSE); + + return ((window->flags & SDL_WINDOW_INPUT_GRABBED) != 0); +} + +void +SDL_OnWindowShown(SDL_Window * window) +{ + SDL_OnWindowRestored(window); +} + +void +SDL_OnWindowHidden(SDL_Window * window) +{ + SDL_UpdateFullscreenMode(window, SDL_FALSE); +} + +void +SDL_OnWindowResized(SDL_Window * window) +{ + window->surface_valid = SDL_FALSE; + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SIZE_CHANGED, window->w, window->h); +} + +void +SDL_OnWindowMinimized(SDL_Window * window) +{ + SDL_UpdateFullscreenMode(window, SDL_FALSE); +} + +void +SDL_OnWindowRestored(SDL_Window * window) +{ + SDL_RaiseWindow(window); + + if (FULLSCREEN_VISIBLE(window)) { + SDL_UpdateFullscreenMode(window, SDL_TRUE); + } +} + +void +SDL_OnWindowEnter(SDL_Window * window) +{ + if (_this->OnWindowEnter) { + _this->OnWindowEnter(_this, window); + } +} + +void +SDL_OnWindowLeave(SDL_Window * window) +{ +} + +void +SDL_OnWindowFocusGained(SDL_Window * window) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (window->gamma && _this->SetWindowGammaRamp) { + _this->SetWindowGammaRamp(_this, window, window->gamma); + } + + if (mouse && mouse->relative_mode) { + SDL_SetMouseFocus(window); + SDL_WarpMouseInWindow(window, window->w/2, window->h/2); + } + + SDL_UpdateWindowGrab(window); +} + +static SDL_bool ShouldMinimizeOnFocusLoss() +{ + const char *hint = SDL_GetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS); + if (hint) { + if (*hint == '0') { + return SDL_FALSE; + } else { + return SDL_TRUE; + } + } + return SDL_TRUE; +} + +void +SDL_OnWindowFocusLost(SDL_Window * window) +{ + if (window->gamma && _this->SetWindowGammaRamp) { + _this->SetWindowGammaRamp(_this, window, window->saved_gamma); + } + + SDL_UpdateWindowGrab(window); + + /* If we're fullscreen and lose focus, minimize unless the hint tells us otherwise */ + if ((window->flags & SDL_WINDOW_FULLSCREEN) && ShouldMinimizeOnFocusLoss()) { + SDL_MinimizeWindow(window); + } +} + +SDL_Window * +SDL_GetFocusWindow(void) +{ + SDL_Window *window; + + if (!_this) { + return NULL; + } + for (window = _this->windows; window; window = window->next) { + if (window->flags & SDL_WINDOW_INPUT_FOCUS) { + return window; + } + } + return NULL; +} + +void +SDL_DestroyWindow(SDL_Window * window) +{ + SDL_VideoDisplay *display; + + CHECK_WINDOW_MAGIC(window, ); + + /* Restore video mode, etc. */ + SDL_HideWindow(window); + + /* Make sure this window no longer has focus */ + if (SDL_GetKeyboardFocus() == window) { + SDL_SetKeyboardFocus(NULL); + } + if (SDL_GetMouseFocus() == window) { + SDL_SetMouseFocus(NULL); + } + + /* make no context current if this is the current context window. */ + if (window->flags & SDL_WINDOW_OPENGL) { + if (_this->current_glwin == window) { + SDL_GL_MakeCurrent(window, NULL); + } + } + + if (window->surface) { + window->surface->flags &= ~SDL_DONTFREE; + SDL_FreeSurface(window->surface); + } + if (_this->DestroyWindowFramebuffer) { + _this->DestroyWindowFramebuffer(_this, window); + } + if (_this->DestroyWindow) { + _this->DestroyWindow(_this, window); + } + if (window->flags & SDL_WINDOW_OPENGL) { + SDL_GL_UnloadLibrary(); + } + + display = SDL_GetDisplayForWindow(window); + if (display->fullscreen_window == window) { + display->fullscreen_window = NULL; + } + + /* Now invalidate magic */ + window->magic = NULL; + + /* Free memory associated with the window */ + if (window->title) { + SDL_free(window->title); + } + if (window->icon) { + SDL_FreeSurface(window->icon); + } + if (window->gamma) { + SDL_free(window->gamma); + } + while (window->data) { + SDL_WindowUserData *data = window->data; + + window->data = data->next; + SDL_free(data->name); + SDL_free(data); + } + + /* Unlink the window from the list */ + if (window->next) { + window->next->prev = window->prev; + } + if (window->prev) { + window->prev->next = window->next; + } else { + _this->windows = window->next; + } + + SDL_free(window); +} + +SDL_bool +SDL_IsScreenSaverEnabled() +{ + if (!_this) { + return SDL_TRUE; + } + return _this->suspend_screensaver ? SDL_FALSE : SDL_TRUE; +} + +void +SDL_EnableScreenSaver() +{ + if (!_this) { + return; + } + if (!_this->suspend_screensaver) { + return; + } + _this->suspend_screensaver = SDL_FALSE; + if (_this->SuspendScreenSaver) { + _this->SuspendScreenSaver(_this); + } +} + +void +SDL_DisableScreenSaver() +{ + if (!_this) { + return; + } + if (_this->suspend_screensaver) { + return; + } + _this->suspend_screensaver = SDL_TRUE; + if (_this->SuspendScreenSaver) { + _this->SuspendScreenSaver(_this); + } +} + +void +SDL_VideoQuit(void) +{ + int i, j; + + if (!_this) { + return; + } + + /* Halt event processing before doing anything else */ + SDL_TouchQuit(); + SDL_MouseQuit(); + SDL_KeyboardQuit(); + SDL_QuitSubSystem(SDL_INIT_EVENTS); + + SDL_EnableScreenSaver(); + + /* Clean up the system video */ + while (_this->windows) { + SDL_DestroyWindow(_this->windows); + } + _this->VideoQuit(_this); + + for (i = 0; i < _this->num_displays; ++i) { + SDL_VideoDisplay *display = &_this->displays[i]; + for (j = display->num_display_modes; j--;) { + if (display->display_modes[j].driverdata) { + SDL_free(display->display_modes[j].driverdata); + display->display_modes[j].driverdata = NULL; + } + } + if (display->display_modes) { + SDL_free(display->display_modes); + display->display_modes = NULL; + } + if (display->desktop_mode.driverdata) { + SDL_free(display->desktop_mode.driverdata); + display->desktop_mode.driverdata = NULL; + } + if (display->driverdata) { + SDL_free(display->driverdata); + display->driverdata = NULL; + } + } + if (_this->displays) { + for (i = 0; i < _this->num_displays; ++i) { + SDL_free(_this->displays[i].name); + } + SDL_free(_this->displays); + _this->displays = NULL; + _this->num_displays = 0; + } + if (_this->clipboard_text) { + SDL_free(_this->clipboard_text); + _this->clipboard_text = NULL; + } + _this->free(_this); + _this = NULL; +} + +int +SDL_GL_LoadLibrary(const char *path) +{ + int retval; + + if (!_this) { + return SDL_UninitializedVideo(); + } + if (_this->gl_config.driver_loaded) { + if (path && SDL_strcmp(path, _this->gl_config.driver_path) != 0) { + return SDL_SetError("OpenGL library already loaded"); + } + retval = 0; + } else { + if (!_this->GL_LoadLibrary) { + return SDL_SetError("No dynamic GL support in video driver"); + } + retval = _this->GL_LoadLibrary(_this, path); + } + if (retval == 0) { + ++_this->gl_config.driver_loaded; + } + return (retval); +} + +void * +SDL_GL_GetProcAddress(const char *proc) +{ + void *func; + + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + func = NULL; + if (_this->GL_GetProcAddress) { + if (_this->gl_config.driver_loaded) { + func = _this->GL_GetProcAddress(_this, proc); + } else { + SDL_SetError("No GL driver has been loaded"); + } + } else { + SDL_SetError("No dynamic GL support in video driver"); + } + return func; +} + +void +SDL_GL_UnloadLibrary(void) +{ + if (!_this) { + SDL_UninitializedVideo(); + return; + } + if (_this->gl_config.driver_loaded > 0) { + if (--_this->gl_config.driver_loaded > 0) { + return; + } + if (_this->GL_UnloadLibrary) { + _this->GL_UnloadLibrary(_this); + } + } +} + +static __inline__ SDL_bool +isAtLeastGL3(const char *verstr) +{ + return ( verstr && (SDL_atoi(verstr) >= 3) ); +} + +SDL_bool +SDL_GL_ExtensionSupported(const char *extension) +{ +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 + const GLubyte *(APIENTRY * glGetStringFunc) (GLenum); + const char *extensions; + const char *start; + const char *where, *terminator; + + /* Extension names should not have spaces. */ + where = SDL_strchr(extension, ' '); + if (where || *extension == '\0') { + return SDL_FALSE; + } + /* See if there's an environment variable override */ + start = SDL_getenv(extension); + if (start && *start == '0') { + return SDL_FALSE; + } + + /* Lookup the available extensions */ + + glGetStringFunc = SDL_GL_GetProcAddress("glGetString"); + if (!glGetStringFunc) { + return SDL_FALSE; + } + + if (isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) { + const GLubyte *(APIENTRY * glGetStringiFunc) (GLenum, GLuint); + void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); + GLint num_exts = 0; + GLint i; + + glGetStringiFunc = SDL_GL_GetProcAddress("glGetStringi"); + glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); + if ((!glGetStringiFunc) || (!glGetIntegervFunc)) { + return SDL_FALSE; + } + + #ifndef GL_NUM_EXTENSIONS + #define GL_NUM_EXTENSIONS 0x821D + #endif + glGetIntegervFunc(GL_NUM_EXTENSIONS, &num_exts); + for (i = 0; i < num_exts; i++) { + const char *thisext = (const char *) glGetStringiFunc(GL_EXTENSIONS, i); + if (SDL_strcmp(thisext, extension) == 0) { + return SDL_TRUE; + } + } + + return SDL_FALSE; + } + + /* Try the old way with glGetString(GL_EXTENSIONS) ... */ + + extensions = (const char *) glGetStringFunc(GL_EXTENSIONS); + if (!extensions) { + return SDL_FALSE; + } + /* + * It takes a bit of care to be fool-proof about parsing the OpenGL + * extensions string. Don't be fooled by sub-strings, etc. + */ + + start = extensions; + + for (;;) { + where = SDL_strstr(start, extension); + if (!where) + break; + + terminator = where + SDL_strlen(extension); + if (where == start || *(where - 1) == ' ') + if (*terminator == ' ' || *terminator == '\0') + return SDL_TRUE; + + start = terminator; + } + return SDL_FALSE; +#else + return SDL_FALSE; #endif -#ifdef __SDL_NOGETPROCADDR__ - #define SDL_PROC(ret,func,params) video->func=func; +} + +int +SDL_GL_SetAttribute(SDL_GLattr attr, int value) +{ +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 + int retval; + + if (!_this) { + return SDL_UninitializedVideo(); + } + retval = 0; + switch (attr) { + case SDL_GL_RED_SIZE: + _this->gl_config.red_size = value; + break; + case SDL_GL_GREEN_SIZE: + _this->gl_config.green_size = value; + break; + case SDL_GL_BLUE_SIZE: + _this->gl_config.blue_size = value; + break; + case SDL_GL_ALPHA_SIZE: + _this->gl_config.alpha_size = value; + break; + case SDL_GL_DOUBLEBUFFER: + _this->gl_config.double_buffer = value; + break; + case SDL_GL_BUFFER_SIZE: + _this->gl_config.buffer_size = value; + break; + case SDL_GL_DEPTH_SIZE: + _this->gl_config.depth_size = value; + break; + case SDL_GL_STENCIL_SIZE: + _this->gl_config.stencil_size = value; + break; + case SDL_GL_ACCUM_RED_SIZE: + _this->gl_config.accum_red_size = value; + break; + case SDL_GL_ACCUM_GREEN_SIZE: + _this->gl_config.accum_green_size = value; + break; + case SDL_GL_ACCUM_BLUE_SIZE: + _this->gl_config.accum_blue_size = value; + break; + case SDL_GL_ACCUM_ALPHA_SIZE: + _this->gl_config.accum_alpha_size = value; + break; + case SDL_GL_STEREO: + _this->gl_config.stereo = value; + break; + case SDL_GL_MULTISAMPLEBUFFERS: + _this->gl_config.multisamplebuffers = value; + break; + case SDL_GL_MULTISAMPLESAMPLES: + _this->gl_config.multisamplesamples = value; + break; + case SDL_GL_ACCELERATED_VISUAL: + _this->gl_config.accelerated = value; + break; + case SDL_GL_RETAINED_BACKING: + _this->gl_config.retained_backing = value; + break; + case SDL_GL_CONTEXT_MAJOR_VERSION: + _this->gl_config.major_version = value; + break; + case SDL_GL_CONTEXT_MINOR_VERSION: + _this->gl_config.minor_version = value; + break; + case SDL_GL_CONTEXT_EGL: + _this->gl_config.use_egl = value; + break; + case SDL_GL_CONTEXT_FLAGS: + if( value & ~(SDL_GL_CONTEXT_DEBUG_FLAG | + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG | + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG | + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG) ) { + retval = SDL_SetError("Unknown OpenGL context flag %d", value); + break; + } + _this->gl_config.flags = value; + break; + case SDL_GL_CONTEXT_PROFILE_MASK: + if( value != 0 && + value != SDL_GL_CONTEXT_PROFILE_CORE && + value != SDL_GL_CONTEXT_PROFILE_COMPATIBILITY && + value != SDL_GL_CONTEXT_PROFILE_ES ) { + retval = SDL_SetError("Unknown OpenGL context profile %d", value); + break; + } + _this->gl_config.profile_mask = value; + break; + case SDL_GL_SHARE_WITH_CURRENT_CONTEXT: + _this->gl_config.share_with_current_context = value; + break; + default: + retval = SDL_SetError("Unknown OpenGL attribute"); + break; + } + return retval; #else - #define SDL_PROC(ret,func,params) \ - do { \ - video->func = SDL_GL_GetProcAddress(#func); \ - if ( ! video->func ) { \ - SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \ - return(NULL); \ - } \ - } while ( 0 ); - -#endif /* __SDL_NOGETPROCADDR__ */ - -#include "SDL_glfuncs.h" -#undef SDL_PROC - } + return SDL_Unsupported(); #endif /* SDL_VIDEO_OPENGL */ +} - /* If we're running OpenGL, make the context current */ - if ( (video->screen->flags & SDL_OPENGL) && - video->GL_MakeCurrent ) { - if ( video->GL_MakeCurrent(this) < 0 ) { - return(NULL); - } - } - - /* Set up a fake SDL surface for OpenGL "blitting" */ - if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) { - /* Load GL functions for performing the texture updates */ +int +SDL_GL_GetAttribute(SDL_GLattr attr, int *value) +{ +#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 + void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); + GLenum(APIENTRY * glGetErrorFunc) (void); + GLenum attrib = 0; + GLenum error = 0; + + glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); + if (!glGetIntegervFunc) { + return -1; + } + + glGetErrorFunc = SDL_GL_GetProcAddress("glGetError"); + if (!glGetErrorFunc) { + return -1; + } + + /* Clear value in any case */ + *value = 0; + + switch (attr) { + case SDL_GL_RED_SIZE: + attrib = GL_RED_BITS; + break; + case SDL_GL_BLUE_SIZE: + attrib = GL_BLUE_BITS; + break; + case SDL_GL_GREEN_SIZE: + attrib = GL_GREEN_BITS; + break; + case SDL_GL_ALPHA_SIZE: + attrib = GL_ALPHA_BITS; + break; + case SDL_GL_DOUBLEBUFFER: #if SDL_VIDEO_OPENGL - - /* Create a software surface for blitting */ -#ifdef GL_VERSION_1_2 - /* If the implementation either supports the packed pixels - extension, or implements the core OpenGL 1.2 API, it will - support the GL_UNSIGNED_SHORT_5_6_5 texture format. - */ - if ( (bpp == 16) && - (SDL_strstr((const char *)video->glGetString(GL_EXTENSIONS), "GL_EXT_packed_pixels") || - (SDL_atof((const char *)video->glGetString(GL_VERSION)) >= 1.2f)) - ) { - video->is_32bit = 0; - SDL_VideoSurface = SDL_CreateRGBSurface( - flags, - width, - height, - 16, - 31 << 11, - 63 << 5, - 31, - 0 - ); - } - else -#endif /* OpenGL 1.2 */ - { - video->is_32bit = 1; - SDL_VideoSurface = SDL_CreateRGBSurface( - flags, - width, - height, - 32, -#if SDL_BYTEORDER == SDL_LIL_ENDIAN - 0x000000FF, - 0x0000FF00, - 0x00FF0000, - 0xFF000000 + attrib = GL_DOUBLEBUFFER; + break; #else - 0xFF000000, - 0x00FF0000, - 0x0000FF00, - 0x000000FF + /* OpenGL ES 1.0 and above specifications have EGL_SINGLE_BUFFER */ + /* parameter which switches double buffer to single buffer. OpenGL ES */ + /* SDL driver must set proper value after initialization */ + *value = _this->gl_config.double_buffer; + return 0; #endif - ); - } - if ( ! SDL_VideoSurface ) { - return(NULL); - } - SDL_VideoSurface->flags = mode->flags | SDL_OPENGLBLIT; - - /* Free the original video mode surface (is this safe?) */ - SDL_FreeSurface(mode); - - /* Set the surface completely opaque & white by default */ - SDL_memset( SDL_VideoSurface->pixels, 255, SDL_VideoSurface->h * SDL_VideoSurface->pitch ); - video->glGenTextures( 1, &video->texture ); - video->glBindTexture( GL_TEXTURE_2D, video->texture ); - video->glTexImage2D( - GL_TEXTURE_2D, - 0, - video->is_32bit ? GL_RGBA : GL_RGB, - 256, - 256, - 0, - video->is_32bit ? GL_RGBA : GL_RGB, -#ifdef GL_VERSION_1_2 - video->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5, + case SDL_GL_DEPTH_SIZE: + attrib = GL_DEPTH_BITS; + break; + case SDL_GL_STENCIL_SIZE: + attrib = GL_STENCIL_BITS; + break; +#if SDL_VIDEO_OPENGL + case SDL_GL_ACCUM_RED_SIZE: + attrib = GL_ACCUM_RED_BITS; + break; + case SDL_GL_ACCUM_GREEN_SIZE: + attrib = GL_ACCUM_GREEN_BITS; + break; + case SDL_GL_ACCUM_BLUE_SIZE: + attrib = GL_ACCUM_BLUE_BITS; + break; + case SDL_GL_ACCUM_ALPHA_SIZE: + attrib = GL_ACCUM_ALPHA_BITS; + break; + case SDL_GL_STEREO: + attrib = GL_STEREO; + break; #else - GL_UNSIGNED_BYTE, + case SDL_GL_ACCUM_RED_SIZE: + case SDL_GL_ACCUM_GREEN_SIZE: + case SDL_GL_ACCUM_BLUE_SIZE: + case SDL_GL_ACCUM_ALPHA_SIZE: + case SDL_GL_STEREO: + /* none of these are supported in OpenGL ES */ + *value = 0; + return 0; #endif - NULL); - - video->UpdateRects = SDL_GL_UpdateRectsLock; + case SDL_GL_MULTISAMPLEBUFFERS: +#if SDL_VIDEO_OPENGL + attrib = GL_SAMPLE_BUFFERS_ARB; #else - SDL_SetError("Somebody forgot to #define SDL_VIDEO_OPENGL"); - return(NULL); + attrib = GL_SAMPLE_BUFFERS; #endif - } - - /* Create a shadow surface if necessary */ - /* There are three conditions under which we create a shadow surface: - 1. We need a particular bits-per-pixel that we didn't get. - 2. We need a hardware palette and didn't get one. - 3. We need a software surface and got a hardware surface. - */ - if ( !(SDL_VideoSurface->flags & SDL_OPENGL) && - ( - ( !(flags&SDL_ANYFORMAT) && - (SDL_VideoSurface->format->BitsPerPixel != bpp)) || - ( (flags&SDL_HWPALETTE) && - !(SDL_VideoSurface->flags&SDL_HWPALETTE)) || - /* If the surface is in hardware, video writes are visible - as soon as they are performed, so we need to buffer them - */ - ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) && - (SDL_VideoSurface->flags&SDL_HWSURFACE)) || - ( (flags&SDL_DOUBLEBUF) && - (SDL_VideoSurface->flags&SDL_HWSURFACE) && - !(SDL_VideoSurface->flags&SDL_DOUBLEBUF)) - ) ) { - SDL_CreateShadowSurface(bpp); - if ( SDL_ShadowSurface == NULL ) { - SDL_SetError("Couldn't create shadow surface"); - return(NULL); - } - SDL_PublicSurface = SDL_ShadowSurface; - } else { - SDL_PublicSurface = SDL_VideoSurface; - } - video->info.vfmt = SDL_VideoSurface->format; - video->info.current_w = SDL_VideoSurface->w; - video->info.current_h = SDL_VideoSurface->h; - - /* We're done! */ - return(SDL_PublicSurface); -} - -/* - * Convert a surface into the video pixel format. - */ -SDL_Surface * SDL_DisplayFormat (SDL_Surface *surface) -{ - Uint32 flags; - - if ( ! SDL_PublicSurface ) { - SDL_SetError("No video mode has been set"); - return(NULL); - } - /* Set the flags appropriate for copying to display surface */ - if (((SDL_PublicSurface->flags&SDL_HWSURFACE) == SDL_HWSURFACE) && current_video->info.blit_hw) - flags = SDL_HWSURFACE; - else - flags = SDL_SWSURFACE; -#ifdef AUTORLE_DISPLAYFORMAT - flags |= (surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA)); - flags |= SDL_RLEACCELOK; + break; + case SDL_GL_MULTISAMPLESAMPLES: +#if SDL_VIDEO_OPENGL + attrib = GL_SAMPLES_ARB; #else - flags |= surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA|SDL_RLEACCELOK); + attrib = GL_SAMPLES; #endif - return(SDL_ConvertSurface(surface, SDL_PublicSurface->format, flags)); + break; + case SDL_GL_BUFFER_SIZE: + { + GLint bits = 0; + GLint component; + + /* + * there doesn't seem to be a single flag in OpenGL + * for this! + */ + glGetIntegervFunc(GL_RED_BITS, &component); + bits += component; + glGetIntegervFunc(GL_GREEN_BITS, &component); + bits += component; + glGetIntegervFunc(GL_BLUE_BITS, &component); + bits += component; + glGetIntegervFunc(GL_ALPHA_BITS, &component); + bits += component; + + *value = bits; + return 0; + } + case SDL_GL_ACCELERATED_VISUAL: + { + /* FIXME: How do we get this information? */ + *value = (_this->gl_config.accelerated != 0); + return 0; + } + case SDL_GL_RETAINED_BACKING: + { + *value = _this->gl_config.retained_backing; + return 0; + } + case SDL_GL_CONTEXT_MAJOR_VERSION: + { + *value = _this->gl_config.major_version; + return 0; + } + case SDL_GL_CONTEXT_MINOR_VERSION: + { + *value = _this->gl_config.minor_version; + return 0; + } + case SDL_GL_CONTEXT_EGL: + { + *value = _this->gl_config.use_egl; + return 0; + } + case SDL_GL_CONTEXT_FLAGS: + { + *value = _this->gl_config.flags; + return 0; + } + case SDL_GL_CONTEXT_PROFILE_MASK: + { + *value = _this->gl_config.profile_mask; + return 0; + } + case SDL_GL_SHARE_WITH_CURRENT_CONTEXT: + { + *value = _this->gl_config.share_with_current_context; + return 0; + } + default: + return SDL_SetError("Unknown OpenGL attribute"); + } + + glGetIntegervFunc(attrib, (GLint *) value); + error = glGetErrorFunc(); + if (error != GL_NO_ERROR) { + if (error == GL_INVALID_ENUM) { + return SDL_SetError("OpenGL error: GL_INVALID_ENUM"); + } else if (error == GL_INVALID_VALUE) { + return SDL_SetError("OpenGL error: GL_INVALID_VALUE"); + } + return SDL_SetError("OpenGL error: %08X", error); + } + return 0; +#else + return SDL_Unsupported(); +#endif /* SDL_VIDEO_OPENGL */ } -/* - * Convert a surface into a format that's suitable for blitting to - * the screen, but including an alpha channel. - */ -SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface) -{ - SDL_PixelFormat *vf; - SDL_PixelFormat *format; - SDL_Surface *converted; - Uint32 flags; - /* default to ARGB8888 */ - Uint32 amask = 0xff000000; - Uint32 rmask = 0x00ff0000; - Uint32 gmask = 0x0000ff00; - Uint32 bmask = 0x000000ff; - - if ( ! SDL_PublicSurface ) { - SDL_SetError("No video mode has been set"); - return(NULL); - } - vf = SDL_PublicSurface->format; - - switch(vf->BytesPerPixel) { - case 2: - /* For XGY5[56]5, use, AXGY8888, where {X, Y} = {R, B}. - For anything else (like ARGB4444) it doesn't matter - since we have no special code for it anyway */ - if ( (vf->Rmask == 0x1f) && - (vf->Bmask == 0xf800 || vf->Bmask == 0x7c00)) { - rmask = 0xff; - bmask = 0xff0000; - } - break; - - case 3: - case 4: - /* Keep the video format, as long as the high 8 bits are - unused or alpha */ - if ( (vf->Rmask == 0xff) && (vf->Bmask == 0xff0000) ) { - rmask = 0xff; - bmask = 0xff0000; - } else if ( vf->Rmask == 0xFF00 && (vf->Bmask == 0xFF000000) ) { - amask = 0x000000FF; - rmask = 0x0000FF00; - gmask = 0x00FF0000; - bmask = 0xFF000000; - } - break; - - default: - /* We have no other optimised formats right now. When/if a new - optimised alpha format is written, add the converter here */ - break; - } - format = SDL_AllocFormat(32, rmask, gmask, bmask, amask); - flags = SDL_PublicSurface->flags & SDL_HWSURFACE; - flags |= surface->flags & (SDL_SRCALPHA | SDL_RLEACCELOK); - converted = SDL_ConvertSurface(surface, format, flags); - SDL_FreeFormat(format); - return(converted); +SDL_GLContext +SDL_GL_CreateContext(SDL_Window * window) +{ + SDL_GLContext ctx = NULL; + CHECK_WINDOW_MAGIC(window, NULL); + + if (!(window->flags & SDL_WINDOW_OPENGL)) { + SDL_SetError("The specified window isn't an OpenGL window"); + return NULL; + } + + ctx = _this->GL_CreateContext(_this, window); + + /* Creating a context is assumed to make it current in the SDL driver. */ + if (ctx) { + _this->current_glwin = window; + _this->current_glctx = ctx; + SDL_TLSSet(_this->current_glwin_tls, window, NULL); + SDL_TLSSet(_this->current_glctx_tls, ctx, NULL); + } + return ctx; } -/* - * Update a specific portion of the physical screen - */ -void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h) -{ - if ( screen ) { - SDL_Rect rect; - - /* Perform some checking */ - if ( w == 0 ) - w = screen->w; - if ( h == 0 ) - h = screen->h; - if ( (int)(x+w) > screen->w ) - return; - if ( (int)(y+h) > screen->h ) - return; - - /* Fill the rectangle */ - rect.x = (Sint16)x; - rect.y = (Sint16)y; - rect.w = (Uint16)w; - rect.h = (Uint16)h; - SDL_UpdateRects(screen, 1, &rect); - } -} -void SDL_UpdateRects (SDL_Surface *screen, int numrects, SDL_Rect *rects) -{ - int i; - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - if ( (screen->flags & (SDL_OPENGL | SDL_OPENGLBLIT)) == SDL_OPENGL ) { - SDL_SetError("OpenGL active, use SDL_GL_SwapBuffers()"); - return; - } - if ( screen == SDL_ShadowSurface ) { - /* Blit the shadow surface using saved mapping */ - SDL_Palette *pal = screen->format->palette; - SDL_Color *saved_colors = NULL; - if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) { - /* simulated 8bpp, use correct physical palette */ - saved_colors = pal->colors; - if ( video->gammacols ) { - /* gamma-corrected palette */ - pal->colors = video->gammacols; - } else if ( video->physpal ) { - /* physical palette different from logical */ - pal->colors = video->physpal->colors; - } - } - if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { - SDL_LockCursor(); - SDL_DrawCursor(SDL_ShadowSurface); - for ( i=0; icolors = saved_colors; - } - - /* Fall through to video surface update */ - screen = SDL_VideoSurface; - } - if ( screen == SDL_VideoSurface ) { - /* Update the video surface */ - if ( screen->offset ) { - for ( i=0; ioffset_x; - rects[i].y += video->offset_y; - } - video->UpdateRects(this, numrects, rects); - for ( i=0; ioffset_x; - rects[i].y -= video->offset_y; - } - } else { - video->UpdateRects(this, numrects, rects); - } - } +int +SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx) +{ + int retval; + + if (window == SDL_GL_GetCurrentWindow() && + ctx == SDL_GL_GetCurrentContext()) { + /* We're already current. */ + return 0; + } + + if (!ctx) { + window = NULL; + } else { + CHECK_WINDOW_MAGIC(window, -1); + + if (!(window->flags & SDL_WINDOW_OPENGL)) { + return SDL_SetError("The specified window isn't an OpenGL window"); + } + } + + retval = _this->GL_MakeCurrent(_this, window, ctx); + if (retval == 0) { + _this->current_glwin = window; + _this->current_glctx = ctx; + SDL_TLSSet(_this->current_glwin_tls, window, NULL); + SDL_TLSSet(_this->current_glctx_tls, ctx, NULL); + } + return retval; } -/* - * Performs hardware double buffering, if possible, or a full update if not. - */ -int SDL_Flip(SDL_Surface *screen) -{ - SDL_VideoDevice *video = current_video; - /* Copy the shadow surface to the video surface */ - if ( screen == SDL_ShadowSurface ) { - SDL_Rect rect; - SDL_Palette *pal = screen->format->palette; - SDL_Color *saved_colors = NULL; - if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) { - /* simulated 8bpp, use correct physical palette */ - saved_colors = pal->colors; - if ( video->gammacols ) { - /* gamma-corrected palette */ - pal->colors = video->gammacols; - } else if ( video->physpal ) { - /* physical palette different from logical */ - pal->colors = video->physpal->colors; - } - } - - rect.x = 0; - rect.y = 0; - rect.w = screen->w; - rect.h = screen->h; - if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) { - SDL_LockCursor(); - SDL_DrawCursor(SDL_ShadowSurface); - SDL_LowerBlit(SDL_ShadowSurface, &rect, - SDL_VideoSurface, &rect); - SDL_EraseCursor(SDL_ShadowSurface); - SDL_UnlockCursor(); - } else { - SDL_LowerBlit(SDL_ShadowSurface, &rect, - SDL_VideoSurface, &rect); - } - if ( saved_colors ) { - pal->colors = saved_colors; - } - - /* Fall through to video surface update */ - screen = SDL_VideoSurface; - } - if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) { - SDL_VideoDevice *this = current_video; - return(video->FlipHWSurface(this, SDL_VideoSurface)); - } else { - SDL_UpdateRect(screen, 0, 0, 0, 0); - } - return(0); -} - -static void SetPalette_logical(SDL_Surface *screen, SDL_Color *colors, - int firstcolor, int ncolors) -{ - SDL_Palette *pal = screen->format->palette; - SDL_Palette *vidpal; - - if ( colors != (pal->colors + firstcolor) ) { - SDL_memcpy(pal->colors + firstcolor, colors, - ncolors * sizeof(*colors)); - } - - if ( current_video && SDL_VideoSurface ) { - vidpal = SDL_VideoSurface->format->palette; - if ( (screen == SDL_ShadowSurface) && vidpal ) { - /* - * This is a shadow surface, and the physical - * framebuffer is also indexed. Propagate the - * changes to its logical palette so that - * updates are always identity blits - */ - SDL_memcpy(vidpal->colors + firstcolor, colors, - ncolors * sizeof(*colors)); - } - } - SDL_FormatChanged(screen); -} - -static int SetPalette_physical(SDL_Surface *screen, - SDL_Color *colors, int firstcolor, int ncolors) -{ - SDL_VideoDevice *video = current_video; - int gotall = 1; - - if ( video->physpal ) { - /* We need to copy the new colors, since we haven't - * already done the copy in the logical set above. - */ - SDL_memcpy(video->physpal->colors + firstcolor, - colors, ncolors * sizeof(*colors)); - } - if ( screen == SDL_ShadowSurface ) { - if ( SDL_VideoSurface->flags & SDL_HWPALETTE ) { - /* - * The real screen is also indexed - set its physical - * palette. The physical palette does not include the - * gamma modification, we apply it directly instead, - * but this only happens if we have hardware palette. - */ - screen = SDL_VideoSurface; - } else { - /* - * The video surface is not indexed - invalidate any - * active shadow-to-video blit mappings. - */ - if ( screen->map->dst == SDL_VideoSurface ) { - SDL_InvalidateMap(screen->map); - } - if ( video->gamma ) { - if( ! video->gammacols ) { - SDL_Palette *pp = video->physpal; - if(!pp) - pp = screen->format->palette; - video->gammacols = SDL_malloc(pp->ncolors - * sizeof(SDL_Color)); - SDL_ApplyGamma(video->gamma, - pp->colors, - video->gammacols, - pp->ncolors); - } else { - SDL_ApplyGamma(video->gamma, colors, - video->gammacols - + firstcolor, - ncolors); - } - } - SDL_UpdateRect(screen, 0, 0, 0, 0); - } - } - - if ( screen == SDL_VideoSurface ) { - SDL_Color gcolors[256]; - - if ( video->gamma ) { - SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors); - colors = gcolors; - } - gotall = video->SetColors(video, firstcolor, ncolors, colors); - if ( ! gotall ) { - /* The video flags shouldn't have SDL_HWPALETTE, and - the video driver is responsible for copying back the - correct colors into the video surface palette. - */ - ; - } - SDL_CursorPaletteChanged(); - } - return gotall; +SDL_Window * +SDL_GL_GetCurrentWindow(void) +{ + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + return (SDL_Window *)SDL_TLSGet(_this->current_glwin_tls); } -/* - * Set the physical and/or logical colormap of a surface: - * Only the screen has a physical colormap. It determines what is actually - * sent to the display. - * The logical colormap is used to map blits to/from the surface. - * 'which' is one or both of SDL_LOGPAL, SDL_PHYSPAL - * - * Return nonzero if all colours were set as requested, or 0 otherwise. - */ -int SDL_SetPalette(SDL_Surface *screen, int which, - SDL_Color *colors, int firstcolor, int ncolors) -{ - SDL_Palette *pal; - int gotall; - int palsize; - - if ( !screen ) { - return 0; - } - if ( !current_video || screen != SDL_PublicSurface ) { - /* only screens have physical palettes */ - which &= ~SDL_PHYSPAL; - } else if ( (screen->flags & SDL_HWPALETTE) != SDL_HWPALETTE ) { - /* hardware palettes required for split colormaps */ - which |= SDL_PHYSPAL | SDL_LOGPAL; - } - - /* Verify the parameters */ - pal = screen->format->palette; - if( !pal ) { - return 0; /* not a palettized surface */ - } - gotall = 1; - palsize = 1 << screen->format->BitsPerPixel; - if ( ncolors > (palsize - firstcolor) ) { - ncolors = (palsize - firstcolor); - gotall = 0; - } - - if ( which & SDL_LOGPAL ) { - /* - * Logical palette change: The actual screen isn't affected, - * but the internal colormap is altered so that the - * interpretation of the pixel values (for blits etc) is - * changed. - */ - SetPalette_logical(screen, colors, firstcolor, ncolors); - } - if ( which & SDL_PHYSPAL ) { - SDL_VideoDevice *video = current_video; - /* - * Physical palette change: This doesn't affect the - * program's idea of what the screen looks like, but changes - * its actual appearance. - */ - if ( !video->physpal && !(which & SDL_LOGPAL) ) { - /* Lazy physical palette allocation */ - int size; - SDL_Palette *pp = SDL_malloc(sizeof(*pp)); - if ( !pp ) { - return 0; - } - video->physpal = pp; - pp->ncolors = pal->ncolors; - size = pp->ncolors * sizeof(SDL_Color); - pp->colors = SDL_malloc(size); - if ( !pp->colors ) { - return 0; - } - SDL_memcpy(pp->colors, pal->colors, size); - } - if ( ! SetPalette_physical(screen, - colors, firstcolor, ncolors) ) { - gotall = 0; - } - } - return gotall; -} - -int SDL_SetColors(SDL_Surface *screen, SDL_Color *colors, int firstcolor, - int ncolors) -{ - return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL, - colors, firstcolor, ncolors); +SDL_GLContext +SDL_GL_GetCurrentContext(void) +{ + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + return (SDL_GLContext)SDL_TLSGet(_this->current_glctx_tls); } -/* - * Clean up the video subsystem - */ -void SDL_VideoQuit (void) -{ - SDL_Surface *ready_to_go; - - if ( current_video ) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - /* Halt event processing before doing anything else */ - SDL_StopEventLoop(); - - /* Clean up allocated window manager items */ - if ( SDL_PublicSurface ) { - SDL_PublicSurface = NULL; - } - SDL_CursorQuit(); - - /* Just in case... */ - SDL_WM_GrabInputOff(); - - /* Clean up the system video */ - video->VideoQuit(this); - - /* Free any lingering surfaces */ - ready_to_go = SDL_ShadowSurface; - SDL_ShadowSurface = NULL; - SDL_FreeSurface(ready_to_go); - if ( SDL_VideoSurface != NULL ) { - ready_to_go = SDL_VideoSurface; - SDL_VideoSurface = NULL; - SDL_FreeSurface(ready_to_go); - } - SDL_PublicSurface = NULL; - - /* Clean up miscellaneous memory */ - if ( video->physpal ) { - SDL_free(video->physpal->colors); - SDL_free(video->physpal); - video->physpal = NULL; - } - if ( video->gammacols ) { - SDL_free(video->gammacols); - video->gammacols = NULL; - } - if ( video->gamma ) { - SDL_free(video->gamma); - video->gamma = NULL; - } - if ( video->wm_title != NULL ) { - SDL_free(video->wm_title); - video->wm_title = NULL; - } - if ( video->wm_icon != NULL ) { - SDL_free(video->wm_icon); - video->wm_icon = NULL; - } - - /* Finish cleaning up video subsystem */ - video->free(this); - current_video = NULL; - } - return; -} - -/* Load the GL driver library */ -int SDL_GL_LoadLibrary(const char *path) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - int retval; - - retval = -1; - if ( video == NULL ) { - SDL_SetError("Video subsystem has not been initialized"); - } else { - if ( video->GL_LoadLibrary ) { - retval = video->GL_LoadLibrary(this, path); - } else { - SDL_SetError("No dynamic GL support in video driver"); - } - } - return(retval); -} - -void *SDL_GL_GetProcAddress(const char* proc) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - void *func; - - func = NULL; - if ( video->GL_GetProcAddress ) { - if ( video->gl_config.driver_loaded ) { - func = video->GL_GetProcAddress(this, proc); - } else { - SDL_SetError("No GL driver has been loaded"); - } - } else { - SDL_SetError("No dynamic GL support in video driver"); - } - return func; -} - -/* Set the specified GL attribute for setting up a GL video mode */ -int SDL_GL_SetAttribute( SDL_GLattr attr, int value ) -{ - int retval; - SDL_VideoDevice *video = current_video; - - retval = 0; - switch (attr) { - case SDL_GL_RED_SIZE: - video->gl_config.red_size = value; - break; - case SDL_GL_GREEN_SIZE: - video->gl_config.green_size = value; - break; - case SDL_GL_BLUE_SIZE: - video->gl_config.blue_size = value; - break; - case SDL_GL_ALPHA_SIZE: - video->gl_config.alpha_size = value; - break; - case SDL_GL_DOUBLEBUFFER: - video->gl_config.double_buffer = value; - break; - case SDL_GL_BUFFER_SIZE: - video->gl_config.buffer_size = value; - break; - case SDL_GL_DEPTH_SIZE: - video->gl_config.depth_size = value; - break; - case SDL_GL_STENCIL_SIZE: - video->gl_config.stencil_size = value; - break; - case SDL_GL_ACCUM_RED_SIZE: - video->gl_config.accum_red_size = value; - break; - case SDL_GL_ACCUM_GREEN_SIZE: - video->gl_config.accum_green_size = value; - break; - case SDL_GL_ACCUM_BLUE_SIZE: - video->gl_config.accum_blue_size = value; - break; - case SDL_GL_ACCUM_ALPHA_SIZE: - video->gl_config.accum_alpha_size = value; - break; - case SDL_GL_STEREO: - video->gl_config.stereo = value; - break; - case SDL_GL_MULTISAMPLEBUFFERS: - video->gl_config.multisamplebuffers = value; - break; - case SDL_GL_MULTISAMPLESAMPLES: - video->gl_config.multisamplesamples = value; - break; - case SDL_GL_ACCELERATED_VISUAL: - video->gl_config.accelerated = value; - break; - case SDL_GL_SWAP_CONTROL: - video->gl_config.swap_control = value; - break; - default: - SDL_SetError("Unknown OpenGL attribute"); - retval = -1; - break; - } - return(retval); -} - -/* Retrieve an attribute value from the windowing system. */ -int SDL_GL_GetAttribute(SDL_GLattr attr, int* value) -{ - int retval = -1; - SDL_VideoDevice* video = current_video; - SDL_VideoDevice* this = current_video; - - if ( video->GL_GetAttribute ) { - retval = this->GL_GetAttribute(this, attr, value); - } else { - *value = 0; - SDL_SetError("GL_GetAttribute not supported"); - } - return retval; -} - -/* Perform a GL buffer swap on the current GL context */ -void SDL_GL_SwapBuffers(void) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - if ( video->screen->flags & SDL_OPENGL ) { - video->GL_SwapBuffers(this); - } else { - SDL_SetError("OpenGL video mode has not been set"); - } -} - -/* Update rects with locking */ -void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect *rects) -{ - SDL_GL_Lock(); - SDL_GL_UpdateRects(numrects, rects); - SDL_GL_Unlock(); -} - -/* Update rects without state setting and changing (the caller is responsible for it) */ -void SDL_GL_UpdateRects(int numrects, SDL_Rect *rects) +int +SDL_GL_SetSwapInterval(int interval) { -#if SDL_VIDEO_OPENGL - SDL_VideoDevice *this = current_video; - SDL_Rect update, tmp; - int x, y, i; - - for ( i = 0; i < numrects; i++ ) - { - tmp.y = rects[i].y; - tmp.h = rects[i].h; - for ( y = 0; y <= rects[i].h / 256; y++ ) - { - tmp.x = rects[i].x; - tmp.w = rects[i].w; - for ( x = 0; x <= rects[i].w / 256; x++ ) - { - update.x = tmp.x; - update.y = tmp.y; - update.w = tmp.w; - update.h = tmp.h; - - if ( update.w > 256 ) - update.w = 256; - - if ( update.h > 256 ) - update.h = 256; - - this->glFlush(); - this->glTexSubImage2D( - GL_TEXTURE_2D, - 0, - 0, - 0, - update.w, - update.h, - this->is_32bit? GL_RGBA : GL_RGB, -#ifdef GL_VERSION_1_2 - this->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5, -#else - GL_UNSIGNED_BYTE, -#endif - (Uint8 *)this->screen->pixels + - this->screen->format->BytesPerPixel * update.x + - update.y * this->screen->pitch ); - - this->glFlush(); - /* - * Note the parens around the function name: - * This is because some OpenGL implementations define glTexCoord etc - * as macros, and we don't want them expanded here. - */ - this->glBegin(GL_TRIANGLE_STRIP); - (this->glTexCoord2f)( 0.0, 0.0 ); - (this->glVertex2i)( update.x, update.y ); - (this->glTexCoord2f)( (float)(update.w / 256.0), 0.0 ); - (this->glVertex2i)( update.x + update.w, update.y ); - (this->glTexCoord2f)( 0.0, (float)(update.h / 256.0) ); - (this->glVertex2i)( update.x, update.y + update.h ); - (this->glTexCoord2f)( (float)(update.w / 256.0), (float)(update.h / 256.0) ); - (this->glVertex2i)( update.x + update.w , update.y + update.h ); - this->glEnd(); - - tmp.x += 256; - tmp.w -= 256; - } - tmp.y += 256; - tmp.h -= 256; - } - } -#endif + if (!_this) { + return SDL_UninitializedVideo(); + } else if (SDL_GL_GetCurrentContext() == NULL) { + return SDL_SetError("No OpenGL context has been made current"); + } else if (_this->GL_SetSwapInterval) { + return _this->GL_SetSwapInterval(_this, interval); + } else { + return SDL_SetError("Setting the swap interval is not supported"); + } } -/* Lock == save current state */ -void SDL_GL_Lock() +int +SDL_GL_GetSwapInterval(void) { -#if SDL_VIDEO_OPENGL - lock_count--; - if (lock_count==-1) - { - SDL_VideoDevice *this = current_video; - - this->glPushAttrib( GL_ALL_ATTRIB_BITS ); /* TODO: narrow range of what is saved */ -#ifdef GL_CLIENT_PIXEL_STORE_BIT - this->glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT ); -#endif - - this->glEnable(GL_TEXTURE_2D); - this->glEnable(GL_BLEND); - this->glDisable(GL_FOG); - this->glDisable(GL_ALPHA_TEST); - this->glDisable(GL_DEPTH_TEST); - this->glDisable(GL_SCISSOR_TEST); - this->glDisable(GL_STENCIL_TEST); - this->glDisable(GL_CULL_FACE); - - this->glBindTexture( GL_TEXTURE_2D, this->texture ); - this->glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); - this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - - this->glPixelStorei( GL_UNPACK_ROW_LENGTH, this->screen->pitch / this->screen->format->BytesPerPixel ); - this->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - (this->glColor4f)(1.0, 1.0, 1.0, 1.0); /* Solaris workaround */ - - this->glViewport(0, 0, this->screen->w, this->screen->h); - this->glMatrixMode(GL_PROJECTION); - this->glPushMatrix(); - this->glLoadIdentity(); - - this->glOrtho(0.0, (GLdouble) this->screen->w, (GLdouble) this->screen->h, 0.0, 0.0, 1.0); - - this->glMatrixMode(GL_MODELVIEW); - this->glPushMatrix(); - this->glLoadIdentity(); - } -#endif + if (!_this) { + return 0; + } else if (SDL_GL_GetCurrentContext() == NULL) { + return 0; + } else if (_this->GL_GetSwapInterval) { + return _this->GL_GetSwapInterval(_this); + } else { + return 0; + } } -/* Unlock == restore saved state */ -void SDL_GL_Unlock() +void +SDL_GL_SwapWindow(SDL_Window * window) { -#if SDL_VIDEO_OPENGL - lock_count++; - if (lock_count==0) - { - SDL_VideoDevice *this = current_video; - - this->glPopMatrix(); - this->glMatrixMode(GL_PROJECTION); - this->glPopMatrix(); - - this->glPopClientAttrib(); - this->glPopAttrib(); - } -#endif + CHECK_WINDOW_MAGIC(window, ); + + if (!(window->flags & SDL_WINDOW_OPENGL)) { + SDL_SetError("The specified window isn't an OpenGL window"); + return; + } + + if (SDL_GL_GetCurrentWindow() != window) { + SDL_SetError("The specified window has not been made current"); + return; + } + + _this->GL_SwapWindow(_this, window); } +void +SDL_GL_DeleteContext(SDL_GLContext context) +{ + if (!_this || !context) { + return; + } + + if (SDL_GL_GetCurrentContext() == context) { + SDL_GL_MakeCurrent(NULL, NULL); + } -void SDL_Audio_SetCaption(const char *caption); + _this->GL_DeleteContext(_this, context); +} +#if 0 /* FIXME */ /* - * Sets/Gets the title and icon text of the display window, if any. + * Utility function used by SDL_WM_SetIcon(); flags & 1 for color key, flags + * & 2 for alpha channel. */ -void SDL_WM_SetCaption (const char *title, const char *icon) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - if ( video ) { - if ( title ) { - if ( video->wm_title ) { - SDL_free(video->wm_title); - } - video->wm_title = SDL_strdup(title); - } - if ( icon ) { - if ( video->wm_icon ) { - SDL_free(video->wm_icon); - } - video->wm_icon = SDL_strdup(icon); - } - if ( (title || icon) && (video->SetCaption != NULL) ) { - video->SetCaption(this, video->wm_title,video->wm_icon); - } - } - - /* PulseAudio can make use of this information. */ - SDL_Audio_SetCaption(title); -} - -void SDL_WM_GetCaption (char **title, char **icon) -{ - SDL_VideoDevice *video = current_video; - - if ( video ) { - if ( title ) { - *title = video->wm_title; - } - if ( icon ) { - *icon = video->wm_icon; - } - } -} - -/* Utility function used by SDL_WM_SetIcon(); - * flags & 1 for color key, flags & 2 for alpha channel. */ -static void CreateMaskFromColorKeyOrAlpha(SDL_Surface *icon, Uint8 *mask, int flags) -{ - int x, y; - Uint32 colorkey; +static void +CreateMaskFromColorKeyOrAlpha(SDL_Surface * icon, Uint8 * mask, int flags) +{ + int x, y; + Uint32 colorkey; #define SET_MASKBIT(icon, x, y, mask) \ - mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8))) - - colorkey = icon->format->colorkey; - switch (icon->format->BytesPerPixel) { - case 1: { Uint8 *pixels; - for ( y=0; yh; ++y ) { - pixels = (Uint8 *)icon->pixels + y*icon->pitch; - for ( x=0; xw; ++x ) { - if ( *pixels++ == colorkey ) { - SET_MASKBIT(icon, x, y, mask); - } - } - } - } - break; - - case 2: { Uint16 *pixels; - for ( y=0; yh; ++y ) { - pixels = (Uint16 *)icon->pixels + - y*icon->pitch/2; - for ( x=0; xw; ++x ) { - if ( (flags & 1) && *pixels == colorkey ) { - SET_MASKBIT(icon, x, y, mask); - } else if((flags & 2) && (*pixels & icon->format->Amask) == 0) { - SET_MASKBIT(icon, x, y, mask); - } - pixels++; - } - } - } - break; - - case 4: { Uint32 *pixels; - for ( y=0; yh; ++y ) { - pixels = (Uint32 *)icon->pixels + - y*icon->pitch/4; - for ( x=0; xw; ++x ) { - if ( (flags & 1) && *pixels == colorkey ) { - SET_MASKBIT(icon, x, y, mask); - } else if((flags & 2) && (*pixels & icon->format->Amask) == 0) { - SET_MASKBIT(icon, x, y, mask); - } - pixels++; - } - } - } - break; - } + mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8))) + + colorkey = icon->format->colorkey; + switch (icon->format->BytesPerPixel) { + case 1: + { + Uint8 *pixels; + for (y = 0; y < icon->h; ++y) { + pixels = (Uint8 *) icon->pixels + y * icon->pitch; + for (x = 0; x < icon->w; ++x) { + if (*pixels++ == colorkey) { + SET_MASKBIT(icon, x, y, mask); + } + } + } + } + break; + + case 2: + { + Uint16 *pixels; + for (y = 0; y < icon->h; ++y) { + pixels = (Uint16 *) icon->pixels + y * icon->pitch / 2; + for (x = 0; x < icon->w; ++x) { + if ((flags & 1) && *pixels == colorkey) { + SET_MASKBIT(icon, x, y, mask); + } else if ((flags & 2) + && (*pixels & icon->format->Amask) == 0) { + SET_MASKBIT(icon, x, y, mask); + } + pixels++; + } + } + } + break; + + case 4: + { + Uint32 *pixels; + for (y = 0; y < icon->h; ++y) { + pixels = (Uint32 *) icon->pixels + y * icon->pitch / 4; + for (x = 0; x < icon->w; ++x) { + if ((flags & 1) && *pixels == colorkey) { + SET_MASKBIT(icon, x, y, mask); + } else if ((flags & 2) + && (*pixels & icon->format->Amask) == 0) { + SET_MASKBIT(icon, x, y, mask); + } + pixels++; + } + } + } + break; + } } /* * Sets the window manager icon for the display window. */ -void SDL_WM_SetIcon (SDL_Surface *icon, Uint8 *mask) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - if ( icon && video->SetIcon ) { - /* Generate a mask if necessary, and create the icon! */ - if ( mask == NULL ) { - int mask_len = icon->h*(icon->w+7)/8; - int flags = 0; - mask = (Uint8 *)SDL_malloc(mask_len); - if ( mask == NULL ) { - return; - } - SDL_memset(mask, ~0, mask_len); - if ( icon->flags & SDL_SRCCOLORKEY ) flags |= 1; - if ( icon->flags & SDL_SRCALPHA ) flags |= 2; - if( flags ) { - CreateMaskFromColorKeyOrAlpha(icon, mask, flags); - } - video->SetIcon(video, icon, mask); - SDL_free(mask); - } else { - video->SetIcon(this, icon, mask); - } - } +void +SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask) +{ + if (icon && _this->SetIcon) { + /* Generate a mask if necessary, and create the icon! */ + if (mask == NULL) { + int mask_len = icon->h * (icon->w + 7) / 8; + int flags = 0; + mask = (Uint8 *) SDL_malloc(mask_len); + if (mask == NULL) { + return; + } + SDL_memset(mask, ~0, mask_len); + if (icon->flags & SDL_SRCCOLORKEY) + flags |= 1; + if (icon->flags & SDL_SRCALPHA) + flags |= 2; + if (flags) { + CreateMaskFromColorKeyOrAlpha(icon, mask, flags); + } + _this->SetIcon(_this, icon, mask); + SDL_free(mask); + } else { + _this->SetIcon(_this, icon, mask); + } + } } +#endif -/* - * Grab or ungrab the keyboard and mouse input. - * This function returns the final grab mode after calling the - * driver dependent function. - */ -static SDL_GrabMode SDL_WM_GrabInputRaw(SDL_GrabMode mode) +SDL_bool +SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - - /* Only do something if we have support for grabs */ - if ( video->GrabInput == NULL ) { - return(video->input_grab); - } + CHECK_WINDOW_MAGIC(window, SDL_FALSE); - /* If the final grab mode if off, only then do we actually grab */ -#ifdef DEBUG_GRAB - printf("SDL_WM_GrabInputRaw(%d) ... ", mode); -#endif - if ( mode == SDL_GRAB_OFF ) { - if ( video->input_grab != SDL_GRAB_OFF ) { - mode = video->GrabInput(this, mode); - } - } else { - if ( video->input_grab == SDL_GRAB_OFF ) { - mode = video->GrabInput(this, mode); - } - } - if ( mode != video->input_grab ) { - video->input_grab = mode; - if ( video->CheckMouseMode ) { - video->CheckMouseMode(this); - } - } -#ifdef DEBUG_GRAB - printf("Final mode %d\n", video->input_grab); -#endif + if (!info) { + return SDL_FALSE; + } + info->subsystem = SDL_SYSWM_UNKNOWN; - /* Return the final grab state */ - if ( mode >= SDL_GRAB_FULLSCREEN ) { - mode -= SDL_GRAB_FULLSCREEN; - } - return(mode); + if (!_this->GetWindowWMInfo) { + return SDL_FALSE; + } + return (_this->GetWindowWMInfo(_this, window, info)); } -SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode) + +void +SDL_StartTextInput(void) { - SDL_VideoDevice *video = current_video; + SDL_Window *window; + + /* First, enable text events */ + SDL_EventState(SDL_TEXTINPUT, SDL_ENABLE); + SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE); + + /* Then show the on-screen keyboard, if any */ + window = SDL_GetFocusWindow(); + if (window && _this && _this->ShowScreenKeyboard) { + _this->ShowScreenKeyboard(_this, window); + } + + /* Finally start the text input system */ + if (_this && _this->StartTextInput) { + _this->StartTextInput(_this); + } +} - /* If the video isn't initialized yet, we can't do anything */ - if ( ! video ) { - return SDL_GRAB_OFF; - } +SDL_bool +SDL_IsTextInputActive(void) +{ + return (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE); +} - /* Return the current mode on query */ - if ( mode == SDL_GRAB_QUERY ) { - mode = video->input_grab; - if ( mode >= SDL_GRAB_FULLSCREEN ) { - mode -= SDL_GRAB_FULLSCREEN; - } - return(mode); - } +void +SDL_StopTextInput(void) +{ + SDL_Window *window; + + /* Stop the text input system */ + if (_this && _this->StopTextInput) { + _this->StopTextInput(_this); + } + + /* Hide the on-screen keyboard, if any */ + window = SDL_GetFocusWindow(); + if (window && _this && _this->HideScreenKeyboard) { + _this->HideScreenKeyboard(_this, window); + } + + /* Finally disable text events */ + SDL_EventState(SDL_TEXTINPUT, SDL_DISABLE); + SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); +} -#ifdef DEBUG_GRAB - printf("SDL_WM_GrabInput(%d) ... ", mode); -#endif - /* If the video surface is fullscreen, we always grab */ - if ( mode >= SDL_GRAB_FULLSCREEN ) { - mode -= SDL_GRAB_FULLSCREEN; - } - if ( SDL_VideoSurface && (SDL_VideoSurface->flags & SDL_FULLSCREEN) ) { - mode += SDL_GRAB_FULLSCREEN; - } - return(SDL_WM_GrabInputRaw(mode)); +void +SDL_SetTextInputRect(SDL_Rect *rect) +{ + if (_this && _this->SetTextInputRect) { + _this->SetTextInputRect(_this, rect); + } } -static SDL_GrabMode SDL_WM_GrabInputOff(void) + +SDL_bool +SDL_HasScreenKeyboardSupport(void) { - SDL_GrabMode mode; + if (_this && _this->HasScreenKeyboardSupport) { + return _this->HasScreenKeyboardSupport(_this); + } + return SDL_FALSE; +} - /* First query the current grab state */ - mode = SDL_WM_GrabInput(SDL_GRAB_QUERY); +SDL_bool +SDL_IsScreenKeyboardShown(SDL_Window *window) +{ + if (window && _this && _this->IsScreenKeyboardShown) { + return _this->IsScreenKeyboardShown(_this, window); + } + return SDL_FALSE; +} - /* Now explicitly turn off input grab */ - SDL_WM_GrabInputRaw(SDL_GRAB_OFF); +#if SDL_VIDEO_DRIVER_WINDOWS +#include "windows/SDL_windowsmessagebox.h" +#endif +#if SDL_VIDEO_DRIVER_COCOA +#include "cocoa/SDL_cocoamessagebox.h" +#endif +#if SDL_VIDEO_DRIVER_UIKIT +#include "uikit/SDL_uikitmessagebox.h" +#endif +#if SDL_VIDEO_DRIVER_X11 +#include "x11/SDL_x11messagebox.h" +#endif - /* Return the old state */ - return(mode); +static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype) +{ + SDL_SysWMinfo info; + SDL_Window *window = messageboxdata->window; + + if (!window) { + return SDL_TRUE; + } + + SDL_VERSION(&info.version); + if (!SDL_GetWindowWMInfo(window, &info)) { + return SDL_TRUE; + } else { + return (info.subsystem == drivertype); + } } -/* - * Iconify the window in window managed environments. - * A successful iconification will result in an SDL_APPACTIVE loss event. - */ -int SDL_WM_IconifyWindow(void) +int +SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - int retval; + int dummybutton; + int retval = -1; + SDL_bool relative_mode; + int show_cursor_prev; + + if (!messageboxdata) { + return SDL_InvalidParamError("messageboxdata"); + } + + relative_mode = SDL_GetRelativeMouseMode(); + SDL_SetRelativeMouseMode(SDL_FALSE); + show_cursor_prev = SDL_ShowCursor(1); + + if (!buttonid) { + buttonid = &dummybutton; + } + + if (_this && _this->ShowMessageBox) { + retval = _this->ShowMessageBox(_this, messageboxdata, buttonid); + } + + /* It's completely fine to call this function before video is initialized */ +#if SDL_VIDEO_DRIVER_WINDOWS + if (retval == -1 && + SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_WINDOWS) && + WIN_ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + } +#endif +#if SDL_VIDEO_DRIVER_COCOA + if (retval == -1 && + SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_COCOA) && + Cocoa_ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + } +#endif +#if SDL_VIDEO_DRIVER_UIKIT + if (retval == -1 && + SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_UIKIT) && + UIKit_ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + } +#endif +#if SDL_VIDEO_DRIVER_X11 + if (retval == -1 && + SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_X11) && + X11_ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + } +#endif + if (retval == -1) { + SDL_SetError("No message system available"); + } - retval = 0; - if ( video->IconifyWindow ) { - retval = video->IconifyWindow(this); - } - return(retval); -} + SDL_ShowCursor(show_cursor_prev); + SDL_SetRelativeMouseMode(relative_mode); -/* - * Toggle fullscreen mode - */ -int SDL_WM_ToggleFullScreen(SDL_Surface *surface) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - int toggled; - - toggled = 0; - if ( SDL_PublicSurface && (surface == SDL_PublicSurface) && - video->ToggleFullScreen ) { - if ( surface->flags & SDL_FULLSCREEN ) { - toggled = video->ToggleFullScreen(this, 0); - if ( toggled ) { - SDL_VideoSurface->flags &= ~SDL_FULLSCREEN; - SDL_PublicSurface->flags &= ~SDL_FULLSCREEN; - } - } else { - toggled = video->ToggleFullScreen(this, 1); - if ( toggled ) { - SDL_VideoSurface->flags |= SDL_FULLSCREEN; - SDL_PublicSurface->flags |= SDL_FULLSCREEN; - } - } - /* Double-check the grab state inside SDL_WM_GrabInput() */ - if ( toggled ) { - SDL_WM_GrabInput(video->input_grab); - } - } - return(toggled); + return retval; } -/* - * Get some platform dependent window manager information - */ -int SDL_GetWMInfo (SDL_SysWMinfo *info) +int +SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window) { - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; + SDL_MessageBoxData data; + SDL_MessageBoxButtonData button; + + SDL_zero(data); + data.flags = flags; + data.title = title; + data.message = message; + data.numbuttons = 1; + data.buttons = &button; + data.window = window; + + SDL_zero(button); + button.flags |= SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT; + button.flags |= SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT; + button.text = "OK"; + + return SDL_ShowMessageBox(&data, NULL); +} - if ( video && video->GetWMInfo ) { - return(video->GetWMInfo(this, info)); - } else { - return(0); - } +SDL_bool +SDL_ShouldAllowTopmost(void) +{ + const char *hint = SDL_GetHint(SDL_HINT_ALLOW_TOPMOST); + if (hint) { + if (*hint == '0') { + return SDL_FALSE; + } else { + return SDL_TRUE; + } + } + return SDL_TRUE; } + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c deleted file mode 100644 index eea3347b20..0000000000 --- a/src/video/SDL_yuv.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the implementation of the YUV video surface support */ - -#include "SDL_video.h" -#include "SDL_sysvideo.h" -#include "SDL_yuvfuncs.h" -#include "SDL_yuv_sw_c.h" - - -SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format, - SDL_Surface *display) -{ - SDL_VideoDevice *video = current_video; - SDL_VideoDevice *this = current_video; - const char *yuv_hwaccel; - SDL_Overlay *overlay; - - if ( (display->flags & SDL_OPENGL) == SDL_OPENGL ) { - SDL_SetError("YUV overlays are not supported in OpenGL mode"); - return NULL; - } - - /* Display directly on video surface, if possible */ - if ( SDL_getenv("SDL_VIDEO_YUV_DIRECT") ) { - if ( (display == SDL_PublicSurface) && - ((SDL_VideoSurface->format->BytesPerPixel == 2) || - (SDL_VideoSurface->format->BytesPerPixel == 4)) ) { - display = SDL_VideoSurface; - } - } - overlay = NULL; - yuv_hwaccel = SDL_getenv("SDL_VIDEO_YUV_HWACCEL"); - if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) && - (!yuv_hwaccel || (SDL_atoi(yuv_hwaccel) > 0)) ) { - overlay = video->CreateYUVOverlay(this, w, h, format, display); - } - /* If hardware YUV overlay failed ... */ - if ( overlay == NULL ) { - overlay = SDL_CreateYUV_SW(this, w, h, format, display); - } - return overlay; -} - -int SDL_LockYUVOverlay(SDL_Overlay *overlay) -{ - if ( overlay == NULL ) { - SDL_SetError("Passed NULL overlay"); - return -1; - } - return overlay->hwfuncs->Lock(current_video, overlay); -} - -void SDL_UnlockYUVOverlay(SDL_Overlay *overlay) -{ - if ( overlay == NULL ) { - return; - } - overlay->hwfuncs->Unlock(current_video, overlay); -} - -int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect) -{ - SDL_Rect src, dst; - int srcx, srcy, srcw, srch; - int dstx, dsty, dstw, dsth; - - if ( overlay == NULL || dstrect == NULL ) { - SDL_SetError("Passed NULL overlay or dstrect"); - return -1; - } - - /* Clip the rectangle to the screen area */ - srcx = 0; - srcy = 0; - srcw = overlay->w; - srch = overlay->h; - dstx = dstrect->x; - dsty = dstrect->y; - dstw = dstrect->w; - dsth = dstrect->h; - if ( dstx < 0 ) { - srcw += (dstx * overlay->w) / dstrect->w; - dstw += dstx; - srcx -= (dstx * overlay->w) / dstrect->w; - dstx = 0; - } - if ( (dstx+dstw) > current_video->screen->w ) { - int extra = (dstx+dstw - current_video->screen->w); - srcw -= (extra * overlay->w) / dstrect->w; - dstw -= extra; - } - if ( dsty < 0 ) { - srch += (dsty * overlay->h) / dstrect->h; - dsth += dsty; - srcy -= (dsty * overlay->h) / dstrect->h; - dsty = 0; - } - if ( (dsty+dsth) > current_video->screen->h ) { - int extra = (dsty+dsth - current_video->screen->h); - srch -= (extra * overlay->h) / dstrect->h; - dsth -= extra; - } - if ( srcw <= 0 || srch <= 0 || - srch <= 0 || dsth <= 0 ) { - return 0; - } - /* Ugh, I can't wait for SDL_Rect to be int values */ - src.x = srcx; - src.y = srcy; - src.w = srcw; - src.h = srch; - dst.x = dstx; - dst.y = dsty; - dst.w = dstw; - dst.h = dsth; - return overlay->hwfuncs->Display(current_video, overlay, &src, &dst); -} - -void SDL_FreeYUVOverlay(SDL_Overlay *overlay) -{ - if ( overlay == NULL ) { - return; - } - if ( overlay->hwfuncs ) { - overlay->hwfuncs->FreeHW(current_video, overlay); - } - SDL_free(overlay); -} diff --git a/src/video/SDL_yuv_mmx.c b/src/video/SDL_yuv_mmx.c deleted file mode 100644 index f11c432a4f..0000000000 --- a/src/video/SDL_yuv_mmx.c +++ /dev/null @@ -1,428 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES - -#include "SDL_stdinc.h" - -#include "mmx.h" - -/* *INDENT-OFF* */ - -static mmx_t MMX_0080w = { .ud = {0x00800080, 0x00800080} }; -static mmx_t MMX_00FFw = { .ud = {0x00ff00ff, 0x00ff00ff} }; -static mmx_t MMX_FF00w = { .ud = {0xff00ff00, 0xff00ff00} }; - -static mmx_t MMX_Ycoeff = { .uw = {0x004a, 0x004a, 0x004a, 0x004a} }; - -static mmx_t MMX_UbluRGB = { .uw = {0x0072, 0x0072, 0x0072, 0x0072} }; -static mmx_t MMX_VredRGB = { .uw = {0x0059, 0x0059, 0x0059, 0x0059} }; -static mmx_t MMX_UgrnRGB = { .uw = {0xffea, 0xffea, 0xffea, 0xffea} }; -static mmx_t MMX_VgrnRGB = { .uw = {0xffd2, 0xffd2, 0xffd2, 0xffd2} }; - -static mmx_t MMX_Ublu5x5 = { .uw = {0x0081, 0x0081, 0x0081, 0x0081} }; -static mmx_t MMX_Vred5x5 = { .uw = {0x0066, 0x0066, 0x0066, 0x0066} }; -static mmx_t MMX_Ugrn565 = { .uw = {0xffe8, 0xffe8, 0xffe8, 0xffe8} }; -static mmx_t MMX_Vgrn565 = { .uw = {0xffcd, 0xffcd, 0xffcd, 0xffcd} }; - -static mmx_t MMX_red565 = { .uw = {0xf800, 0xf800, 0xf800, 0xf800} }; -static mmx_t MMX_grn565 = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} }; - -/** - This MMX assembler is my first assembler/MMX program ever. - Thus it maybe buggy. - Send patches to: - mvogt@rhrk.uni-kl.de - - After it worked fine I have "obfuscated" the code a bit to have - more parallism in the MMX units. This means I moved - initilisation around and delayed other instruction. - Performance measurement did not show that this brought any advantage - but in theory it _should_ be faster this way. - - The overall performanve gain to the C based dither was 30%-40%. - The MMX routine calculates 256bit=8RGB values in each cycle - (4 for row1 & 4 for row2) - - The red/green/blue.. coefficents are taken from the mpeg_play - player. They look nice, but I dont know if you can have - better values, to avoid integer rounding errors. - - - IMPORTANT: - ========== - - It is a requirement that the cr/cb/lum are 8 byte aligned and - the out are 16byte aligned or you will/may get segfaults - -*/ - -void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - Uint32 *row1; - Uint32 *row2; - - unsigned char* y = lum +cols*rows; // Pointer to the end - int x = 0; - row1 = (Uint32 *)out; // 32 bit target - row2 = (Uint32 *)out+cols+mod; // start of second row - mod = (mod+cols+mod)*4; // increment for row1 in byte - - __asm__ __volatile__ ( - // tap dance to workaround the inability to use %%ebx at will... - // move one thing to the stack... - "pushl $0\n" // save a slot on the stack. - "pushl %%ebx\n" // save %%ebx. - "movl %0, %%ebx\n" // put the thing in ebx. - "movl %%ebx,4(%%esp)\n" // put the thing in the stack slot. - "popl %%ebx\n" // get back %%ebx (the PIC register). - - ".align 8\n" - "1:\n" - - // create Cr (result in mm1) - "pushl %%ebx\n" - "movl 4(%%esp),%%ebx\n" - "movd (%%ebx),%%mm1\n" // 0 0 0 0 v3 v2 v1 v0 - "popl %%ebx\n" - "pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00 - "movd (%2), %%mm2\n" // 0 0 0 0 l3 l2 l1 l0 - "punpcklbw %%mm7,%%mm1\n" // 0 v3 0 v2 00 v1 00 v0 - "punpckldq %%mm1,%%mm1\n" // 00 v1 00 v0 00 v1 00 v0 - "psubw %9,%%mm1\n" // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 - - // create Cr_g (result in mm0) - "movq %%mm1,%%mm0\n" // r1 r1 r0 r0 r1 r1 r0 r0 - "pmullw %10,%%mm0\n" // red*-46dec=0.7136*64 - "pmullw %11,%%mm1\n" // red*89dec=1.4013*64 - "psraw $6, %%mm0\n" // red=red/64 - "psraw $6, %%mm1\n" // red=red/64 - - // create L1 L2 (result in mm2,mm4) - // L2=lum+cols - "movq (%2,%4),%%mm3\n" // 0 0 0 0 L3 L2 L1 L0 - "punpckldq %%mm3,%%mm2\n" // L3 L2 L1 L0 l3 l2 l1 l0 - "movq %%mm2,%%mm4\n" // L3 L2 L1 L0 l3 l2 l1 l0 - "pand %12,%%mm2\n" // L3 0 L1 0 l3 0 l1 0 - "pand %13,%%mm4\n" // 0 L2 0 L0 0 l2 0 l0 - "psrlw $8,%%mm2\n" // 0 L3 0 L1 0 l3 0 l1 - - // create R (result in mm6) - "movq %%mm2,%%mm5\n" // 0 L3 0 L1 0 l3 0 l1 - "movq %%mm4,%%mm6\n" // 0 L2 0 L0 0 l2 0 l0 - "paddsw %%mm1, %%mm5\n" // lum1+red:x R3 x R1 x r3 x r1 - "paddsw %%mm1, %%mm6\n" // lum1+red:x R2 x R0 x r2 x r0 - "packuswb %%mm5,%%mm5\n" // R3 R1 r3 r1 R3 R1 r3 r1 - "packuswb %%mm6,%%mm6\n" // R2 R0 r2 r0 R2 R0 r2 r0 - "pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00 - "punpcklbw %%mm5,%%mm6\n" // R3 R2 R1 R0 r3 r2 r1 r0 - - // create Cb (result in mm1) - "movd (%1), %%mm1\n" // 0 0 0 0 u3 u2 u1 u0 - "punpcklbw %%mm7,%%mm1\n" // 0 u3 0 u2 00 u1 00 u0 - "punpckldq %%mm1,%%mm1\n" // 00 u1 00 u0 00 u1 00 u0 - "psubw %9,%%mm1\n" // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 - // create Cb_g (result in mm5) - "movq %%mm1,%%mm5\n" // u1 u1 u0 u0 u1 u1 u0 u0 - "pmullw %14,%%mm5\n" // blue*-109dec=1.7129*64 - "pmullw %15,%%mm1\n" // blue*114dec=1.78125*64 - "psraw $6, %%mm5\n" // blue=red/64 - "psraw $6, %%mm1\n" // blue=blue/64 - - // create G (result in mm7) - "movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1 - "movq %%mm4,%%mm7\n" // 0 L2 0 L0 0 l2 0 l1 - "paddsw %%mm5, %%mm3\n" // lum1+Cb_g:x G3t x G1t x g3t x g1t - "paddsw %%mm5, %%mm7\n" // lum1+Cb_g:x G2t x G0t x g2t x g0t - "paddsw %%mm0, %%mm3\n" // lum1+Cr_g:x G3 x G1 x g3 x g1 - "paddsw %%mm0, %%mm7\n" // lum1+blue:x G2 x G0 x g2 x g0 - "packuswb %%mm3,%%mm3\n" // G3 G1 g3 g1 G3 G1 g3 g1 - "packuswb %%mm7,%%mm7\n" // G2 G0 g2 g0 G2 G0 g2 g0 - "punpcklbw %%mm3,%%mm7\n" // G3 G2 G1 G0 g3 g2 g1 g0 - - // create B (result in mm5) - "movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1 - "movq %%mm4,%%mm5\n" // 0 L2 0 L0 0 l2 0 l1 - "paddsw %%mm1, %%mm3\n" // lum1+blue:x B3 x B1 x b3 x b1 - "paddsw %%mm1, %%mm5\n" // lum1+blue:x B2 x B0 x b2 x b0 - "packuswb %%mm3,%%mm3\n" // B3 B1 b3 b1 B3 B1 b3 b1 - "packuswb %%mm5,%%mm5\n" // B2 B0 b2 b0 B2 B0 b2 b0 - "punpcklbw %%mm3,%%mm5\n" // B3 B2 B1 B0 b3 b2 b1 b0 - - // fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) - - "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 - "pxor %%mm4,%%mm4\n" // 0 0 0 0 0 0 0 0 - "movq %%mm6,%%mm1\n" // R3 R2 R1 R0 r3 r2 r1 r0 - "movq %%mm5,%%mm3\n" // B3 B2 B1 B0 b3 b2 b1 b0 - // process lower lum - "punpcklbw %%mm4,%%mm1\n" // 0 r3 0 r2 0 r1 0 r0 - "punpcklbw %%mm4,%%mm3\n" // 0 b3 0 b2 0 b1 0 b0 - "movq %%mm1,%%mm2\n" // 0 r3 0 r2 0 r1 0 r0 - "movq %%mm3,%%mm0\n" // 0 b3 0 b2 0 b1 0 b0 - "punpcklwd %%mm1,%%mm3\n" // 0 r1 0 b1 0 r0 0 b0 - "punpckhwd %%mm2,%%mm0\n" // 0 r3 0 b3 0 r2 0 b2 - - "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 - "movq %%mm7,%%mm1\n" // G3 G2 G1 G0 g3 g2 g1 g0 - "punpcklbw %%mm1,%%mm2\n" // g3 0 g2 0 g1 0 g0 0 - "punpcklwd %%mm4,%%mm2\n" // 0 0 g1 0 0 0 g0 0 - "por %%mm3, %%mm2\n" // 0 r1 g1 b1 0 r0 g0 b0 - "movq %%mm2,(%3)\n" // wrote out ! row1 - - "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 - "punpcklbw %%mm1,%%mm4\n" // g3 0 g2 0 g1 0 g0 0 - "punpckhwd %%mm2,%%mm4\n" // 0 0 g3 0 0 0 g2 0 - "por %%mm0, %%mm4\n" // 0 r3 g3 b3 0 r2 g2 b2 - "movq %%mm4,8(%3)\n" // wrote out ! row1 - - // fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) - // this can be done "destructive" - "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0 - "punpckhbw %%mm2,%%mm6\n" // 0 R3 0 R2 0 R1 0 R0 - "punpckhbw %%mm1,%%mm5\n" // G3 B3 G2 B2 G1 B1 G0 B0 - "movq %%mm5,%%mm1\n" // G3 B3 G2 B2 G1 B1 G0 B0 - "punpcklwd %%mm6,%%mm1\n" // 0 R1 G1 B1 0 R0 G0 B0 - "movq %%mm1,(%5)\n" // wrote out ! row2 - "punpckhwd %%mm6,%%mm5\n" // 0 R3 G3 B3 0 R2 G2 B2 - "movq %%mm5,8(%5)\n" // wrote out ! row2 - - "addl $4,%2\n" // lum+4 - "leal 16(%3),%3\n" // row1+16 - "leal 16(%5),%5\n" // row2+16 - "addl $2,(%%esp)\n" // cr+2 - "addl $2,%1\n" // cb+2 - - "addl $4,%6\n" // x+4 - "cmpl %4,%6\n" - - "jl 1b\n" - "addl %4,%2\n" // lum += cols - "addl %8,%3\n" // row1+= mod - "addl %8,%5\n" // row2+= mod - "movl $0,%6\n" // x=0 - "cmpl %7,%2\n" - "jl 1b\n" - - "addl $4,%%esp\n" // get rid of the stack slot we reserved. - "emms\n" // reset MMX registers. - : - : "m" (cr), "r"(cb),"r"(lum), - "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod), - "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB), - "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB), - "m"(MMX_UbluRGB) - ); -} - -void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - Uint16 *row1; - Uint16 *row2; - - unsigned char* y = lum +cols*rows; /* Pointer to the end */ - int x = 0; - row1 = (Uint16 *)out; /* 16 bit target */ - row2 = (Uint16 *)out+cols+mod; /* start of second row */ - mod = (mod+cols+mod)*2; /* increment for row1 in byte */ - - __asm__ __volatile__( - // tap dance to workaround the inability to use %%ebx at will... - // move one thing to the stack... - "pushl $0\n" // save a slot on the stack. - "pushl %%ebx\n" // save %%ebx. - "movl %0, %%ebx\n" // put the thing in ebx. - "movl %%ebx, 4(%%esp)\n" // put the thing in the stack slot. - "popl %%ebx\n" // get back %%ebx (the PIC register). - - ".align 8\n" - "1:\n" - "movd (%1), %%mm0\n" // 4 Cb 0 0 0 0 u3 u2 u1 u0 - "pxor %%mm7, %%mm7\n" - "pushl %%ebx\n" - "movl 4(%%esp), %%ebx\n" - "movd (%%ebx), %%mm1\n" // 4 Cr 0 0 0 0 v3 v2 v1 v0 - "popl %%ebx\n" - - "punpcklbw %%mm7, %%mm0\n" // 4 W cb 0 u3 0 u2 0 u1 0 u0 - "punpcklbw %%mm7, %%mm1\n" // 4 W cr 0 v3 0 v2 0 v1 0 v0 - "psubw %9, %%mm0\n" - "psubw %9, %%mm1\n" - "movq %%mm0, %%mm2\n" // Cb 0 u3 0 u2 0 u1 0 u0 - "movq %%mm1, %%mm3\n" // Cr - "pmullw %10, %%mm2\n" // Cb2green 0 R3 0 R2 0 R1 0 R0 - "movq (%2), %%mm6\n" // L1 l7 L6 L5 L4 L3 L2 L1 L0 - "pmullw %11, %%mm0\n" // Cb2blue - "pand %12, %%mm6\n" // L1 00 L6 00 L4 00 L2 00 L0 - "pmullw %13, %%mm3\n" // Cr2green - "movq (%2), %%mm7\n" // L2 - "pmullw %14, %%mm1\n" // Cr2red - "psrlw $8, %%mm7\n" // L2 00 L7 00 L5 00 L3 00 L1 - "pmullw %15, %%mm6\n" // lum1 - "paddw %%mm3, %%mm2\n" // Cb2green + Cr2green == green - "pmullw %15, %%mm7\n" // lum2 - - "movq %%mm6, %%mm4\n" // lum1 - "paddw %%mm0, %%mm6\n" // lum1 +blue 00 B6 00 B4 00 B2 00 B0 - "movq %%mm4, %%mm5\n" // lum1 - "paddw %%mm1, %%mm4\n" // lum1 +red 00 R6 00 R4 00 R2 00 R0 - "paddw %%mm2, %%mm5\n" // lum1 +green 00 G6 00 G4 00 G2 00 G0 - "psraw $6, %%mm4\n" // R1 0 .. 64 - "movq %%mm7, %%mm3\n" // lum2 00 L7 00 L5 00 L3 00 L1 - "psraw $6, %%mm5\n" // G1 - .. + - "paddw %%mm0, %%mm7\n" // Lum2 +blue 00 B7 00 B5 00 B3 00 B1 - "psraw $6, %%mm6\n" // B1 0 .. 64 - "packuswb %%mm4, %%mm4\n" // R1 R1 - "packuswb %%mm5, %%mm5\n" // G1 G1 - "packuswb %%mm6, %%mm6\n" // B1 B1 - "punpcklbw %%mm4, %%mm4\n" - "punpcklbw %%mm5, %%mm5\n" - - "pand %16, %%mm4\n" - "psllw $3, %%mm5\n" // GREEN 1 - "punpcklbw %%mm6, %%mm6\n" - "pand %17, %%mm5\n" - "pand %16, %%mm6\n" - "por %%mm5, %%mm4\n" // - "psrlw $11, %%mm6\n" // BLUE 1 - "movq %%mm3, %%mm5\n" // lum2 - "paddw %%mm1, %%mm3\n" // lum2 +red 00 R7 00 R5 00 R3 00 R1 - "paddw %%mm2, %%mm5\n" // lum2 +green 00 G7 00 G5 00 G3 00 G1 - "psraw $6, %%mm3\n" // R2 - "por %%mm6, %%mm4\n" // MM4 - "psraw $6, %%mm5\n" // G2 - "movq (%2, %4), %%mm6\n" // L3 load lum2 - "psraw $6, %%mm7\n" - "packuswb %%mm3, %%mm3\n" - "packuswb %%mm5, %%mm5\n" - "packuswb %%mm7, %%mm7\n" - "pand %12, %%mm6\n" // L3 - "punpcklbw %%mm3, %%mm3\n" - "punpcklbw %%mm5, %%mm5\n" - "pmullw %15, %%mm6\n" // lum3 - "punpcklbw %%mm7, %%mm7\n" - "psllw $3, %%mm5\n" // GREEN 2 - "pand %16, %%mm7\n" - "pand %16, %%mm3\n" - "psrlw $11, %%mm7\n" // BLUE 2 - "pand %17, %%mm5\n" - "por %%mm7, %%mm3\n" - "movq (%2,%4), %%mm7\n" // L4 load lum2 - "por %%mm5, %%mm3\n" // - "psrlw $8, %%mm7\n" // L4 - "movq %%mm4, %%mm5\n" - "punpcklwd %%mm3, %%mm4\n" - "pmullw %15, %%mm7\n" // lum4 - "punpckhwd %%mm3, %%mm5\n" - - "movq %%mm4, (%3)\n" // write row1 - "movq %%mm5, 8(%3)\n" // write row1 - - "movq %%mm6, %%mm4\n" // Lum3 - "paddw %%mm0, %%mm6\n" // Lum3 +blue - - "movq %%mm4, %%mm5\n" // Lum3 - "paddw %%mm1, %%mm4\n" // Lum3 +red - "paddw %%mm2, %%mm5\n" // Lum3 +green - "psraw $6, %%mm4\n" - "movq %%mm7, %%mm3\n" // Lum4 - "psraw $6, %%mm5\n" - "paddw %%mm0, %%mm7\n" // Lum4 +blue - "psraw $6, %%mm6\n" // Lum3 +blue - "movq %%mm3, %%mm0\n" // Lum4 - "packuswb %%mm4, %%mm4\n" - "paddw %%mm1, %%mm3\n" // Lum4 +red - "packuswb %%mm5, %%mm5\n" - "paddw %%mm2, %%mm0\n" // Lum4 +green - "packuswb %%mm6, %%mm6\n" - "punpcklbw %%mm4, %%mm4\n" - "punpcklbw %%mm5, %%mm5\n" - "punpcklbw %%mm6, %%mm6\n" - "psllw $3, %%mm5\n" // GREEN 3 - "pand %16, %%mm4\n" - "psraw $6, %%mm3\n" // psr 6 - "psraw $6, %%mm0\n" - "pand %16, %%mm6\n" // BLUE - "pand %17, %%mm5\n" - "psrlw $11, %%mm6\n" // BLUE 3 - "por %%mm5, %%mm4\n" - "psraw $6, %%mm7\n" - "por %%mm6, %%mm4\n" - "packuswb %%mm3, %%mm3\n" - "packuswb %%mm0, %%mm0\n" - "packuswb %%mm7, %%mm7\n" - "punpcklbw %%mm3, %%mm3\n" - "punpcklbw %%mm0, %%mm0\n" - "punpcklbw %%mm7, %%mm7\n" - "pand %16, %%mm3\n" - "pand %16, %%mm7\n" // BLUE - "psllw $3, %%mm0\n" // GREEN 4 - "psrlw $11, %%mm7\n" - "pand %17, %%mm0\n" - "por %%mm7, %%mm3\n" - "por %%mm0, %%mm3\n" - - "movq %%mm4, %%mm5\n" - - "punpcklwd %%mm3, %%mm4\n" - "punpckhwd %%mm3, %%mm5\n" - - "movq %%mm4, (%5)\n" - "movq %%mm5, 8(%5)\n" - - "addl $8, %6\n" - "addl $8, %2\n" - "addl $4, (%%esp)\n" - "addl $4, %1\n" - "cmpl %4, %6\n" - "leal 16(%3), %3\n" - "leal 16(%5),%5\n" // row2+16 - - "jl 1b\n" - "addl %4, %2\n" // lum += cols - "addl %8, %3\n" // row1+= mod - "addl %8, %5\n" // row2+= mod - "movl $0, %6\n" // x=0 - "cmpl %7, %2\n" - "jl 1b\n" - "addl $4, %%esp\n" // get rid of the stack slot we reserved. - "emms\n" - : - : "m" (cr), "r"(cb),"r"(lum), - "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod), - "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5), - "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5), - "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565) - ); -} - -/* *INDENT-ON* */ - -#endif /* GCC3 i386 inline assembly */ - diff --git a/src/video/SDL_yuv_sw.c b/src/video/SDL_yuv_sw.c deleted file mode 100644 index c555ce06c2..0000000000 --- a/src/video/SDL_yuv_sw.c +++ /dev/null @@ -1,1299 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the software implementation of the YUV video overlay support */ - -/* This code was derived from code carrying the following copyright notices: - - * Copyright (c) 1995 The Regents of the University of California. - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose, without fee, and without written agreement is - * hereby granted, provided that the above copyright notice and the following - * two paragraphs appear in all copies of this software. - * - * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT - * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF - * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - - * Copyright (c) 1995 Erik Corry - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose, without fee, and without written agreement is - * hereby granted, provided that the above copyright notice and the following - * two paragraphs appear in all copies of this software. - * - * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, - * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF - * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" - * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, - * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - - * Portions of this software Copyright (c) 1995 Brown University. - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose, without fee, and without written agreement - * is hereby granted, provided that the above copyright notice and the - * following two paragraphs appear in all copies of this software. - * - * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT - * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN - * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" - * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, - * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - */ - -#include "SDL_video.h" -#include "SDL_cpuinfo.h" -#include "SDL_stretch_c.h" -#include "SDL_yuvfuncs.h" -#include "SDL_yuv_sw_c.h" - -/* The functions used to manipulate software video overlays */ -static struct private_yuvhwfuncs sw_yuvfuncs = { - SDL_LockYUV_SW, - SDL_UnlockYUV_SW, - SDL_DisplayYUV_SW, - SDL_FreeYUV_SW -}; - -/* RGB conversion lookup tables */ -struct private_yuvhwdata { - SDL_Surface *stretch; - SDL_Surface *display; - Uint8 *pixels; - int *colortab; - Uint32 *rgb_2_pix; - void (*Display1X)(int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ); - void (*Display2X)(int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ); - - /* These are just so we don't have to allocate them separately */ - Uint16 pitches[3]; - Uint8 *planes[3]; -}; - - -/* The colorspace conversion functions */ - -#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES -extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ); -extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ); -#endif - -static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned short* row1; - unsigned short* row2; - unsigned char* lum2; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - row1 = (unsigned short*) out; - row2 = row1 + cols + mod; - lum2 = lum + cols; - - mod += cols + mod; - - y = rows / 2; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - ++cr; ++cb; - - L = *lum++; - *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - L = *lum++; - *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - - /* Now, do second row. */ - - L = *lum2++; - *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - L = *lum2++; - *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - } - - /* - * These values are at the start of the next line, (due - * to the ++'s above),but they need to be at the start - * of the line after that. - */ - lum += cols; - lum2 += cols; - row1 += mod; - row2 += mod; - } -} - -static void Color24DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int value; - unsigned char* row1; - unsigned char* row2; - unsigned char* lum2; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - row1 = out; - row2 = row1 + cols*3 + mod*3; - lum2 = lum + cols; - - mod += cols + mod; - mod *= 3; - - y = rows / 2; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - ++cr; ++cb; - - L = *lum++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - *row1++ = (value ) & 0xFF; - *row1++ = (value >> 8) & 0xFF; - *row1++ = (value >> 16) & 0xFF; - - L = *lum++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - *row1++ = (value ) & 0xFF; - *row1++ = (value >> 8) & 0xFF; - *row1++ = (value >> 16) & 0xFF; - - - /* Now, do second row. */ - - L = *lum2++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - *row2++ = (value ) & 0xFF; - *row2++ = (value >> 8) & 0xFF; - *row2++ = (value >> 16) & 0xFF; - - L = *lum2++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - *row2++ = (value ) & 0xFF; - *row2++ = (value >> 8) & 0xFF; - *row2++ = (value >> 16) & 0xFF; - } - - /* - * These values are at the start of the next line, (due - * to the ++'s above),but they need to be at the start - * of the line after that. - */ - lum += cols; - lum2 += cols; - row1 += mod; - row2 += mod; - } -} - -static void Color32DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int* row1; - unsigned int* row2; - unsigned char* lum2; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - row1 = (unsigned int*) out; - row2 = row1 + cols + mod; - lum2 = lum + cols; - - mod += cols + mod; - - y = rows / 2; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - ++cr; ++cb; - - L = *lum++; - *row1++ = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - L = *lum++; - *row1++ = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - - /* Now, do second row. */ - - L = *lum2++; - *row2++ = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - L = *lum2++; - *row2++ = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - } - - /* - * These values are at the start of the next line, (due - * to the ++'s above),but they need to be at the start - * of the line after that. - */ - lum += cols; - lum2 += cols; - row1 += mod; - row2 += mod; - } -} - -/* - * In this function I make use of a nasty trick. The tables have the lower - * 16 bits replicated in the upper 16. This means I can write ints and get - * the horisontal doubling for free (almost). - */ -static void Color16DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int* row1 = (unsigned int*) out; - const int next_row = cols+(mod/2); - unsigned int* row2 = row1 + 2*next_row; - unsigned char* lum2; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - lum2 = lum + cols; - - mod = (next_row * 3) + (mod/2); - - y = rows / 2; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - ++cr; ++cb; - - L = *lum++; - row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row1++; - - L = *lum++; - row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row1++; - - - /* Now, do second row. */ - - L = *lum2++; - row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row2++; - - L = *lum2++; - row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row2++; - } - - /* - * These values are at the start of the next line, (due - * to the ++'s above),but they need to be at the start - * of the line after that. - */ - lum += cols; - lum2 += cols; - row1 += mod; - row2 += mod; - } -} - -static void Color24DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int value; - unsigned char* row1 = out; - const int next_row = (cols*2 + mod) * 3; - unsigned char* row2 = row1 + 2*next_row; - unsigned char* lum2; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - lum2 = lum + cols; - - mod = next_row*3 + mod*3; - - y = rows / 2; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - ++cr; ++cb; - - L = *lum++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] = - (value ) & 0xFF; - row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] = - (value >> 8) & 0xFF; - row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] = - (value >> 16) & 0xFF; - row1 += 2*3; - - L = *lum++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] = - (value ) & 0xFF; - row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] = - (value >> 8) & 0xFF; - row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] = - (value >> 16) & 0xFF; - row1 += 2*3; - - - /* Now, do second row. */ - - L = *lum2++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] = - (value ) & 0xFF; - row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] = - (value >> 8) & 0xFF; - row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] = - (value >> 16) & 0xFF; - row2 += 2*3; - - L = *lum2++; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] = - (value ) & 0xFF; - row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] = - (value >> 8) & 0xFF; - row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] = - (value >> 16) & 0xFF; - row2 += 2*3; - } - - /* - * These values are at the start of the next line, (due - * to the ++'s above),but they need to be at the start - * of the line after that. - */ - lum += cols; - lum2 += cols; - row1 += mod; - row2 += mod; - } -} - -static void Color32DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int* row1 = (unsigned int*) out; - const int next_row = cols*2+mod; - unsigned int* row2 = row1 + 2*next_row; - unsigned char* lum2; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - lum2 = lum + cols; - - mod = (next_row * 3) + mod; - - y = rows / 2; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - ++cr; ++cb; - - L = *lum++; - row1[0] = row1[1] = row1[next_row] = row1[next_row+1] = - (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row1 += 2; - - L = *lum++; - row1[0] = row1[1] = row1[next_row] = row1[next_row+1] = - (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row1 += 2; - - - /* Now, do second row. */ - - L = *lum2++; - row2[0] = row2[1] = row2[next_row] = row2[next_row+1] = - (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row2 += 2; - - L = *lum2++; - row2[0] = row2[1] = row2[next_row] = row2[next_row+1] = - (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row2 += 2; - } - - /* - * These values are at the start of the next line, (due - * to the ++'s above),but they need to be at the start - * of the line after that. - */ - lum += cols; - lum2 += cols; - row1 += mod; - row2 += mod; - } -} - -static void Color16DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned short* row; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - row = (unsigned short*) out; - - y = rows; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - cr += 4; cb += 4; - - L = *lum; lum += 2; - *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - L = *lum; lum += 2; - *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - } - - row += mod; - } -} - -static void Color24DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int value; - unsigned char* row; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - row = (unsigned char*) out; - mod *= 3; - y = rows; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - cr += 4; cb += 4; - - L = *lum; lum += 2; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - *row++ = (value ) & 0xFF; - *row++ = (value >> 8) & 0xFF; - *row++ = (value >> 16) & 0xFF; - - L = *lum; lum += 2; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - *row++ = (value ) & 0xFF; - *row++ = (value >> 8) & 0xFF; - *row++ = (value >> 16) & 0xFF; - - } - row += mod; - } -} - -static void Color32DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int* row; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - row = (unsigned int*) out; - y = rows; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - cr += 4; cb += 4; - - L = *lum; lum += 2; - *row++ = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - L = *lum; lum += 2; - *row++ = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - - - } - row += mod; - } -} - -/* - * In this function I make use of a nasty trick. The tables have the lower - * 16 bits replicated in the upper 16. This means I can write ints and get - * the horisontal doubling for free (almost). - */ -static void Color16DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int* row = (unsigned int*) out; - const int next_row = cols+(mod/2); - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - - y = rows; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - cr += 4; cb += 4; - - L = *lum; lum += 2; - row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row++; - - L = *lum; lum += 2; - row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row++; - - } - row += next_row; - } -} - -static void Color24DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int value; - unsigned char* row = out; - const int next_row = (cols*2 + mod) * 3; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - y = rows; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - cr += 4; cb += 4; - - L = *lum; lum += 2; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] = - (value ) & 0xFF; - row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] = - (value >> 8) & 0xFF; - row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] = - (value >> 16) & 0xFF; - row += 2*3; - - L = *lum; lum += 2; - value = (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] = - (value ) & 0xFF; - row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] = - (value >> 8) & 0xFF; - row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] = - (value >> 16) & 0xFF; - row += 2*3; - - } - row += next_row; - } -} - -static void Color32DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix, - unsigned char *lum, unsigned char *cr, - unsigned char *cb, unsigned char *out, - int rows, int cols, int mod ) -{ - unsigned int* row = (unsigned int*) out; - const int next_row = cols*2+mod; - int x, y; - int cr_r; - int crb_g; - int cb_b; - int cols_2 = cols / 2; - mod+=mod; - y = rows; - while( y-- ) - { - x = cols_2; - while( x-- ) - { - register int L; - - cr_r = 0*768+256 + colortab[ *cr + 0*256 ]; - crb_g = 1*768+256 + colortab[ *cr + 1*256 ] - + colortab[ *cb + 2*256 ]; - cb_b = 2*768+256 + colortab[ *cb + 3*256 ]; - cr += 4; cb += 4; - - L = *lum; lum += 2; - row[0] = row[1] = row[next_row] = row[next_row+1] = - (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row += 2; - - L = *lum; lum += 2; - row[0] = row[1] = row[next_row] = row[next_row+1] = - (rgb_2_pix[ L + cr_r ] | - rgb_2_pix[ L + crb_g ] | - rgb_2_pix[ L + cb_b ]); - row += 2; - - - } - - row += next_row; - } -} - -/* - * How many 1 bits are there in the Uint32. - * Low performance, do not call often. - */ -static int number_of_bits_set( Uint32 a ) -{ - if(!a) return 0; - if(a & 1) return 1 + number_of_bits_set(a >> 1); - return(number_of_bits_set(a >> 1)); -} - -/* - * How many 0 bits are there at least significant end of Uint32. - * Low performance, do not call often. - */ -static int free_bits_at_bottom( Uint32 a ) -{ - /* assume char is 8 bits */ - if(!a) return sizeof(Uint32) * 8; - if(((Sint32)a) & 1l) return 0; - return 1 + free_bits_at_bottom ( a >> 1); -} - - -SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display) -{ - SDL_Overlay *overlay; - struct private_yuvhwdata *swdata; - int *Cr_r_tab; - int *Cr_g_tab; - int *Cb_g_tab; - int *Cb_b_tab; - Uint32 *r_2_pix_alloc; - Uint32 *g_2_pix_alloc; - Uint32 *b_2_pix_alloc; - int i; - int CR, CB; - Uint32 Rmask, Gmask, Bmask; - - /* Only RGB packed pixel conversion supported */ - if ( (display->format->BytesPerPixel != 2) && - (display->format->BytesPerPixel != 3) && - (display->format->BytesPerPixel != 4) ) { - SDL_SetError("Can't use YUV data on non 16/24/32 bit surfaces"); - return(NULL); - } - - /* Verify that we support the format */ - switch (format) { - case SDL_YV12_OVERLAY: - case SDL_IYUV_OVERLAY: - case SDL_YUY2_OVERLAY: - case SDL_UYVY_OVERLAY: - case SDL_YVYU_OVERLAY: - break; - default: - SDL_SetError("Unsupported YUV format"); - return(NULL); - } - - /* Create the overlay structure */ - overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay); - if ( overlay == NULL ) { - SDL_OutOfMemory(); - return(NULL); - } - SDL_memset(overlay, 0, (sizeof *overlay)); - - /* Fill in the basic members */ - overlay->format = format; - overlay->w = width; - overlay->h = height; - - /* Set up the YUV surface function structure */ - overlay->hwfuncs = &sw_yuvfuncs; - - /* Create the pixel data and lookup tables */ - swdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *swdata); - overlay->hwdata = swdata; - if ( swdata == NULL ) { - SDL_OutOfMemory(); - SDL_FreeYUVOverlay(overlay); - return(NULL); - } - swdata->stretch = NULL; - swdata->display = display; - swdata->pixels = (Uint8 *) SDL_malloc(width*height*2); - swdata->colortab = (int *)SDL_malloc(4*256*sizeof(int)); - Cr_r_tab = &swdata->colortab[0*256]; - Cr_g_tab = &swdata->colortab[1*256]; - Cb_g_tab = &swdata->colortab[2*256]; - Cb_b_tab = &swdata->colortab[3*256]; - swdata->rgb_2_pix = (Uint32 *)SDL_malloc(3*768*sizeof(Uint32)); - r_2_pix_alloc = &swdata->rgb_2_pix[0*768]; - g_2_pix_alloc = &swdata->rgb_2_pix[1*768]; - b_2_pix_alloc = &swdata->rgb_2_pix[2*768]; - if ( ! swdata->pixels || ! swdata->colortab || ! swdata->rgb_2_pix ) { - SDL_OutOfMemory(); - SDL_FreeYUVOverlay(overlay); - return(NULL); - } - - /* Generate the tables for the display surface */ - for (i=0; i<256; i++) { - /* Gamma correction (luminescence table) and chroma correction - would be done here. See the Berkeley mpeg_play sources. - */ - CB = CR = (i-128); - Cr_r_tab[i] = (int) ( (0.419/0.299) * CR); - Cr_g_tab[i] = (int) (-(0.299/0.419) * CR); - Cb_g_tab[i] = (int) (-(0.114/0.331) * CB); - Cb_b_tab[i] = (int) ( (0.587/0.331) * CB); - } - - /* - * Set up entries 0-255 in rgb-to-pixel value tables. - */ - Rmask = display->format->Rmask; - Gmask = display->format->Gmask; - Bmask = display->format->Bmask; - for ( i=0; i<256; ++i ) { - r_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Rmask)); - r_2_pix_alloc[i+256] <<= free_bits_at_bottom(Rmask); - g_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Gmask)); - g_2_pix_alloc[i+256] <<= free_bits_at_bottom(Gmask); - b_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Bmask)); - b_2_pix_alloc[i+256] <<= free_bits_at_bottom(Bmask); - } - - /* - * If we have 16-bit output depth, then we double the value - * in the top word. This means that we can write out both - * pixels in the pixel doubling mode with one op. It is - * harmless in the normal case as storing a 32-bit value - * through a short pointer will lose the top bits anyway. - */ - if( display->format->BytesPerPixel == 2 ) { - for ( i=0; i<256; ++i ) { - r_2_pix_alloc[i+256] |= (r_2_pix_alloc[i+256]) << 16; - g_2_pix_alloc[i+256] |= (g_2_pix_alloc[i+256]) << 16; - b_2_pix_alloc[i+256] |= (b_2_pix_alloc[i+256]) << 16; - } - } - - /* - * Spread out the values we have to the rest of the array so that - * we do not need to check for overflow. - */ - for ( i=0; i<256; ++i ) { - r_2_pix_alloc[i] = r_2_pix_alloc[256]; - r_2_pix_alloc[i+512] = r_2_pix_alloc[511]; - g_2_pix_alloc[i] = g_2_pix_alloc[256]; - g_2_pix_alloc[i+512] = g_2_pix_alloc[511]; - b_2_pix_alloc[i] = b_2_pix_alloc[256]; - b_2_pix_alloc[i+512] = b_2_pix_alloc[511]; - } - - /* You have chosen wisely... */ - switch (format) { - case SDL_YV12_OVERLAY: - case SDL_IYUV_OVERLAY: - if ( display->format->BytesPerPixel == 2 ) { -#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES - /* inline assembly functions */ - if ( SDL_HasMMX() && (Rmask == 0xF800) && - (Gmask == 0x07E0) && - (Bmask == 0x001F) && - (width & 15) == 0) { -/*printf("Using MMX 16-bit 565 dither\n");*/ - swdata->Display1X = Color565DitherYV12MMX1X; - } else { -/*printf("Using C 16-bit dither\n");*/ - swdata->Display1X = Color16DitherYV12Mod1X; - } -#else - swdata->Display1X = Color16DitherYV12Mod1X; -#endif - swdata->Display2X = Color16DitherYV12Mod2X; - } - if ( display->format->BytesPerPixel == 3 ) { - swdata->Display1X = Color24DitherYV12Mod1X; - swdata->Display2X = Color24DitherYV12Mod2X; - } - if ( display->format->BytesPerPixel == 4 ) { -#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES - /* inline assembly functions */ - if ( SDL_HasMMX() && (Rmask == 0x00FF0000) && - (Gmask == 0x0000FF00) && - (Bmask == 0x000000FF) && - (width & 15) == 0) { -/*printf("Using MMX 32-bit dither\n");*/ - swdata->Display1X = ColorRGBDitherYV12MMX1X; - } else { -/*printf("Using C 32-bit dither\n");*/ - swdata->Display1X = Color32DitherYV12Mod1X; - } -#else - swdata->Display1X = Color32DitherYV12Mod1X; -#endif - swdata->Display2X = Color32DitherYV12Mod2X; - } - break; - case SDL_YUY2_OVERLAY: - case SDL_UYVY_OVERLAY: - case SDL_YVYU_OVERLAY: - if ( display->format->BytesPerPixel == 2 ) { - swdata->Display1X = Color16DitherYUY2Mod1X; - swdata->Display2X = Color16DitherYUY2Mod2X; - } - if ( display->format->BytesPerPixel == 3 ) { - swdata->Display1X = Color24DitherYUY2Mod1X; - swdata->Display2X = Color24DitherYUY2Mod2X; - } - if ( display->format->BytesPerPixel == 4 ) { - swdata->Display1X = Color32DitherYUY2Mod1X; - swdata->Display2X = Color32DitherYUY2Mod2X; - } - break; - default: - /* We should never get here (caught above) */ - break; - } - - /* Find the pitch and offset values for the overlay */ - overlay->pitches = swdata->pitches; - overlay->pixels = swdata->planes; - switch (format) { - case SDL_YV12_OVERLAY: - case SDL_IYUV_OVERLAY: - overlay->pitches[0] = overlay->w; - overlay->pitches[1] = overlay->pitches[0] / 2; - overlay->pitches[2] = overlay->pitches[0] / 2; - overlay->pixels[0] = swdata->pixels; - overlay->pixels[1] = overlay->pixels[0] + - overlay->pitches[0] * overlay->h; - overlay->pixels[2] = overlay->pixels[1] + - overlay->pitches[1] * overlay->h / 2; - overlay->planes = 3; - break; - case SDL_YUY2_OVERLAY: - case SDL_UYVY_OVERLAY: - case SDL_YVYU_OVERLAY: - overlay->pitches[0] = overlay->w*2; - overlay->pixels[0] = swdata->pixels; - overlay->planes = 1; - break; - default: - /* We should never get here (caught above) */ - break; - } - - /* We're all done.. */ - return(overlay); -} - -int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay) -{ - return(0); -} - -void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay) -{ - return; -} - -int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst) -{ - struct private_yuvhwdata *swdata; - int stretch; - int scale_2x; - SDL_Surface *display; - Uint8 *lum, *Cr, *Cb; - Uint8 *dstp; - int mod; - - swdata = overlay->hwdata; - stretch = 0; - scale_2x = 0; - if ( src->x || src->y || src->w < overlay->w || src->h < overlay->h ) { - /* The source rectangle has been clipped. - Using a scratch surface is easier than adding clipped - source support to all the blitters, plus that would - slow them down in the general unclipped case. - */ - stretch = 1; - } else if ( (src->w != dst->w) || (src->h != dst->h) ) { - if ( (dst->w == 2*src->w) && - (dst->h == 2*src->h) ) { - scale_2x = 1; - } else { - stretch = 1; - } - } - if ( stretch ) { - if ( ! swdata->stretch ) { - display = swdata->display; - swdata->stretch = SDL_CreateRGBSurface( - SDL_SWSURFACE, - overlay->w, overlay->h, - display->format->BitsPerPixel, - display->format->Rmask, - display->format->Gmask, - display->format->Bmask, 0); - if ( ! swdata->stretch ) { - return(-1); - } - } - display = swdata->stretch; - } else { - display = swdata->display; - } - switch (overlay->format) { - case SDL_YV12_OVERLAY: - lum = overlay->pixels[0]; - Cr = overlay->pixels[1]; - Cb = overlay->pixels[2]; - break; - case SDL_IYUV_OVERLAY: - lum = overlay->pixels[0]; - Cr = overlay->pixels[2]; - Cb = overlay->pixels[1]; - break; - case SDL_YUY2_OVERLAY: - lum = overlay->pixels[0]; - Cr = lum + 3; - Cb = lum + 1; - break; - case SDL_UYVY_OVERLAY: - lum = overlay->pixels[0]+1; - Cr = lum + 1; - Cb = lum - 1; - break; - case SDL_YVYU_OVERLAY: - lum = overlay->pixels[0]; - Cr = lum + 1; - Cb = lum + 3; - break; - default: - SDL_SetError("Unsupported YUV format in blit"); - return(-1); - } - if ( SDL_MUSTLOCK(display) ) { - if ( SDL_LockSurface(display) < 0 ) { - return(-1); - } - } - if ( stretch ) { - dstp = (Uint8 *)swdata->stretch->pixels; - } else { - dstp = (Uint8 *)display->pixels - + dst->x * display->format->BytesPerPixel - + dst->y * display->pitch; - } - mod = (display->pitch / display->format->BytesPerPixel); - - if ( scale_2x ) { - mod -= (overlay->w * 2); - swdata->Display2X(swdata->colortab, swdata->rgb_2_pix, - lum, Cr, Cb, dstp, overlay->h, overlay->w, mod); - } else { - mod -= overlay->w; - swdata->Display1X(swdata->colortab, swdata->rgb_2_pix, - lum, Cr, Cb, dstp, overlay->h, overlay->w, mod); - } - if ( SDL_MUSTLOCK(display) ) { - SDL_UnlockSurface(display); - } - if ( stretch ) { - display = swdata->display; - SDL_SoftStretch(swdata->stretch, src, display, dst); - } - SDL_UpdateRects(display, 1, dst); - - return(0); -} - -void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay) -{ - struct private_yuvhwdata *swdata; - - swdata = overlay->hwdata; - if ( swdata ) { - if ( swdata->stretch ) { - SDL_FreeSurface(swdata->stretch); - } - if ( swdata->pixels ) { - SDL_free(swdata->pixels); - } - if ( swdata->colortab ) { - SDL_free(swdata->colortab); - } - if ( swdata->rgb_2_pix ) { - SDL_free(swdata->rgb_2_pix); - } - SDL_free(swdata); - overlay->hwdata = NULL; - } -} diff --git a/src/video/SDL_yuv_sw_c.h b/src/video/SDL_yuv_sw_c.h deleted file mode 100644 index 5aea3a5add..0000000000 --- a/src/video/SDL_yuv_sw_c.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include "SDL_video.h" -#include "SDL_sysvideo.h" - -/* This is the software implementation of the YUV video overlay support */ - -extern SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display); - -extern int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay); - -extern void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay); - -extern int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst); - -extern void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay); diff --git a/src/video/SDL_yuvfuncs.h b/src/video/SDL_yuvfuncs.h deleted file mode 100644 index cb496b6adf..0000000000 --- a/src/video/SDL_yuvfuncs.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* This is the definition of the YUV video surface function structure */ - -#include "SDL_video.h" -#include "SDL_sysvideo.h" - -#ifndef _THIS -#define _THIS SDL_VideoDevice *_this -#endif -struct private_yuvhwfuncs { - int (*Lock)(_THIS, SDL_Overlay *overlay); - void (*Unlock)(_THIS, SDL_Overlay *overlay); - int (*Display)(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst); - void (*FreeHW)(_THIS, SDL_Overlay *overlay); -}; diff --git a/src/video/Xext/README b/src/video/Xext/README deleted file mode 100644 index a16ea68444..0000000000 --- a/src/video/Xext/README +++ /dev/null @@ -1,10 +0,0 @@ - -The reason these libraries are built outside of the standard XFree86 -tree is so that they can be linked as shared object code directly into -SDL without causing any symbol collisions with code in the application. - -You can't link static library code into shared libraries on non-x86 -Linux platforms. Since these libraries haven't become standard yet, -we'll just include them directly. - -These sources are synchronized with XFree86 4.2.1 diff --git a/src/video/Xext/XME/xme.c b/src/video/Xext/XME/xme.c deleted file mode 100644 index 2cead35ada..0000000000 --- a/src/video/Xext/XME/xme.c +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright 1993-2001 by Xi Graphics, Inc. - * All Rights Reserved. - * - * Please see the LICENSE file accompanying this distribution for licensing - * information. - * - * Please send any bug fixes and modifications to src@xig.com. - * - * $XiGId: xme.c,v 1.2 2001/11/30 21:56:59 jon Exp $ - * - */ - -#define NEED_EVENTS -#define NEED_REPLIES - -/* Apparently some X11 systems can't include this multiple times... */ -#ifndef SDL_INCLUDED_XLIBINT_H -#define SDL_INCLUDED_XLIBINT_H 1 -#include -#endif - -#include -#include -#include -#include "../extensions/Xext.h" -#include "../extensions/extutil.h" - -/*****************************************************************************/ - - -#define XIGMISC_PROTOCOL_NAME "XiG-SUNDRY-NONSTANDARD" -#define XIGMISC_MAJOR_VERSION 2 -#define XIGMISC_MINOR_VERSION 0 - -#define XiGMiscNumberEvents 0 - -#define X_XiGMiscQueryVersion 0 -#define X_XiGMiscQueryViews 1 -#define X_XiGMiscQueryResolutions 2 -#define X_XiGMiscChangeResolution 3 -#define X_XiGMiscFullScreen 4 - -#define sz_xXiGMiscQueryVersionReq 8 -#define sz_xXiGMiscQueryViewsReq 8 -#define sz_xXiGMiscQueryResolutionsReq 8 -#define sz_xXiGMiscChangeResolutionReq 16 -#define sz_xXiGMiscFullScreenReq 16 - -#define sz_xXiGMiscQueryVersionReply 32 -#define sz_xXiGMiscQueryViewsReply 32 -#define sz_xXiGMiscQueryResolutionsReply 32 -#define sz_xXiGMiscQueryFullScreenReply 32 - -/*******************************************************************/ - -typedef struct { - CARD8 reqType; /* always codes->major_opcode */ - CARD8 xigmiscReqType; /* always X_XiGMiscQueryVersion */ - CARD16 length; - CARD16 major; - CARD16 minor; -} xXiGMiscQueryVersionReq; - -typedef struct { - CARD8 reqType; /* always codes->major_opcode */ - CARD8 xigmiscReqType; /* always X_XiGMiscQueryViews */ - CARD16 length; - CARD8 screen; - CARD8 pad0; - CARD16 pad1; -} xXiGMiscQueryViewsReq; - -typedef struct { - CARD8 reqType; /* always codes->major_opcode */ - CARD8 xigmiscReqType; /* always X_XiGMiscQueryResolutions */ - CARD16 length; - CARD8 screen; - CARD8 view; - CARD16 pad0; -} xXiGMiscQueryResolutionsReq; - -typedef struct { - CARD8 reqType; /* always codes->major_opcode */ - CARD8 xigmiscReqType; /* always X_XiGMiscChangeResolution */ - CARD16 length; - CARD8 screen; - CARD8 view; - CARD16 pad0; - CARD16 width; - CARD16 height; - INT32 refresh; -} xXiGMiscChangeResolutionReq; - -typedef struct { - CARD8 reqType; /* always codes->major_opcode */ - CARD8 xigmiscReqType; /* always X_XiGMiscFullScreen */ - CARD16 length; - CARD8 screen; - CARD8 pad0; - CARD16 pad1; - CARD32 window; - CARD32 cmap; -} xXiGMiscFullScreenReq; - -/*******************************************************************/ - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 pad0; - CARD16 sequenceNumber; - CARD32 length; - CARD16 major; - CARD16 minor; - CARD32 pad1; - CARD32 pad2; - CARD32 pad3; - CARD32 pad4; - CARD32 pad5; -} xXiGMiscQueryVersionReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 pad0; - CARD16 sequenceNumber; - CARD32 length; - CARD32 nviews; - CARD32 pad1; - CARD32 pad2; - CARD32 pad3; - CARD32 pad4; - CARD32 pad5; -} xXiGMiscQueryViewsReply; - -typedef struct { - BYTE type; /* X_Reply */ - CARD8 pad0; - CARD16 sequenceNumber; - CARD32 length; - CARD16 active; - CARD16 nresolutions; - CARD32 pad1; - CARD32 pad2; - CARD32 pad3; - CARD32 pad4; - CARD32 pad5; -} xXiGMiscQueryResolutionsReply; - -typedef struct { - BYTE type; /* X_Reply */ - BOOL success; - CARD16 sequenceNumber; - CARD32 length; - CARD32 pad1; - CARD32 pad2; - CARD32 pad3; - CARD32 pad4; - CARD32 pad5; - CARD32 pad6; -} xXiGMiscFullScreenReply; - -/*******************************************************************/ - -typedef struct { - INT16 x; - INT16 y; - CARD16 w; - CARD16 h; -} XiGMiscViewInfo; - -typedef struct { - CARD16 width; - CARD16 height; - INT32 refresh; -} XiGMiscResolutionInfo; - -/*****************************************************************************/ - -static XExtensionInfo *xigmisc_info = NULL; -static char *xigmisc_extension_name = XIGMISC_PROTOCOL_NAME; - -#define XiGMiscCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, xigmisc_extension_name, val) -#define XiGMiscSimpleCheckExtension(dpy,i) \ - XextSimpleCheckExtension (dpy, i, xigmisc_extension_name) - -#if defined(__STDC__) && !defined(UNIXCPP) -#define XiGMiscGetReq(name,req,info) GetReq (name, req); \ - req->reqType = info->codes->major_opcode; \ - req->xigmiscReqType = X_##name; - -#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \ - req->reqType = info->codes->major_opcode; \ - req->xigmicReqType = X_##name; -#else -#define XiGMiscGetReq(name,req,info) GetReq (name, req); \ - req->reqType = info->codes->major_opcode; \ - req->xigmiscReqType = X_/**/name; -#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \ - req->reqType = info->codes->major_opcode; \ - req->xigmiscReqType = X_/**/name; -#endif - - - -/* - * find_display - locate the display info block - */ -static int XiGMiscCloseDisplay(); - -static XExtensionHooks xigmisc_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - XiGMiscCloseDisplay, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - - -static XEXT_GENERATE_CLOSE_DISPLAY (XiGMiscCloseDisplay, xigmisc_info) - -static XEXT_GENERATE_FIND_DISPLAY (XiGMiscFindDisplay, xigmisc_info, - xigmisc_extension_name, - &xigmisc_extension_hooks, XiGMiscNumberEvents, NULL) - - -/*****************************************************************************/ - -Bool XiGMiscQueryVersion(Display *dpy, int *major, int *minor) -{ - int opcode, event, error; - xXiGMiscQueryVersionReq *req; - xXiGMiscQueryVersionReply rep; - XExtDisplayInfo *info = XiGMiscFindDisplay(dpy); - - if (!XQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error)) - return xFalse; - - XiGMiscCheckExtension(dpy, info, xFalse); - - LockDisplay (dpy); - XiGMiscGetReq (XiGMiscQueryVersion, req, info); - - req->major = XIGMISC_MAJOR_VERSION; - req->minor = XIGMISC_MINOR_VERSION; - - if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) { - UnlockDisplay(dpy); - SyncHandle(); - return xFalse; - } - - *major = rep.major; - *minor = rep.minor; - UnlockDisplay(dpy); - SyncHandle(); - - return xTrue; -} - -int XiGMiscQueryViews(Display *dpy, int screen, XiGMiscViewInfo **pviews) -{ - int n, size; - XiGMiscViewInfo *views; - xXiGMiscQueryViewsReq *req; - xXiGMiscQueryViewsReply rep; - XExtDisplayInfo *info = XiGMiscFindDisplay(dpy); - XiGMiscCheckExtension(dpy, info, 0); - - LockDisplay (dpy); - XiGMiscGetReq (XiGMiscQueryViews, req, info); - req->screen = screen; - - if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return 0; - } - - n = rep.nviews; - - if (n > 0) { - size = sizeof(XiGMiscViewInfo) * n; - views = (XiGMiscViewInfo*)Xmalloc(size); - if (!views) { - _XEatData(dpy, (unsigned long)size); - UnlockDisplay(dpy); - SyncHandle(); - return 0; - } - - _XReadPad(dpy, (void*)views, size); - - *pviews = views; - } - - UnlockDisplay(dpy); - SyncHandle(); - - return n; -} - -int XiGMiscQueryResolutions(Display *dpy, int screen, int view, int *pactive, XiGMiscResolutionInfo **presolutions) -{ - int n, size; - XiGMiscResolutionInfo *resolutions; - xXiGMiscQueryResolutionsReq *req; - xXiGMiscQueryResolutionsReply rep; - XExtDisplayInfo *info = XiGMiscFindDisplay(dpy); - XiGMiscCheckExtension(dpy, info, 0); - - LockDisplay (dpy); - XiGMiscGetReq (XiGMiscQueryResolutions, req, info); - req->screen = screen; - req->view = view; - - if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return 0; - } - - n = rep.nresolutions; - - if (n > 0) { - size = sizeof(XiGMiscResolutionInfo) * n; - resolutions = (XiGMiscResolutionInfo*)Xmalloc(size); - if (!resolutions) { - _XEatData(dpy, (unsigned long)size); - UnlockDisplay(dpy); - SyncHandle(); - return 0; - } - - _XReadPad(dpy, (void*)resolutions, size); - - *presolutions = resolutions; - *pactive = rep.active; - } - - UnlockDisplay(dpy); - SyncHandle(); - - return n; -} - -void XiGMiscChangeResolution(Display *dpy, int screen, int view, int width, int height, int refresh) -{ - xXiGMiscChangeResolutionReq *req; - XExtDisplayInfo *info = XiGMiscFindDisplay(dpy); - - XiGMiscSimpleCheckExtension(dpy, info); - - LockDisplay (dpy); - XiGMiscGetReq (XiGMiscChangeResolution, req, info); - req->screen = screen; - req->view = view; - req->width = width; - req->height = height; - req->refresh = refresh; - - UnlockDisplay(dpy); - SyncHandle(); -} - - -Bool XiGMiscFullScreen(Display *dpy, int screen, XID window, XID cmap) -{ - xXiGMiscFullScreenReq *req; - xXiGMiscFullScreenReply rep; - XExtDisplayInfo *info = XiGMiscFindDisplay(dpy); - - XiGMiscCheckExtension(dpy, info, xFalse); - - LockDisplay (dpy); - XiGMiscGetReq (XiGMiscFullScreen, req, info); - req->screen = screen; - req->pad0 = 0; - req->pad1 = 0; - req->window = window; - req->cmap = cmap; - - if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) { - UnlockDisplay(dpy); - SyncHandle(); - return xFalse; - } - - UnlockDisplay(dpy); - SyncHandle(); - - return (rep.success ? xTrue : xFalse); -} - - -/* SDL addition from Ryan: free memory used by xme. */ -void XiGMiscDestroy(void) -{ - if (xigmisc_info) { - XextDestroyExtension(xigmisc_info); - xigmisc_info = NULL; - } -} - diff --git a/src/video/Xext/Xinerama/Xinerama.c b/src/video/Xext/Xinerama/Xinerama.c deleted file mode 100644 index 4ff42ebfe9..0000000000 --- a/src/video/Xext/Xinerama/Xinerama.c +++ /dev/null @@ -1,324 +0,0 @@ -/* $Xorg: XPanoramiX.c,v 1.4 2000/08/17 19:45:51 cpqbld Exp $ */ -/***************************************************************** -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. -******************************************************************/ -/* $XFree86: xc/lib/Xinerama/Xinerama.c,v 1.2 2001/07/23 17:20:28 dawes Exp $ */ - -#define NEED_EVENTS -#define NEED_REPLIES - -/* Apparently some X11 systems can't include this multiple times... */ -#ifndef SDL_INCLUDED_XLIBINT_H -#define SDL_INCLUDED_XLIBINT_H 1 -#include -#endif - -#include -#include "../extensions/Xext.h" -#include "../extensions/extutil.h" /* in ../include */ -#include "../extensions/panoramiXext.h" -#include "../extensions/panoramiXproto.h" /* in ../include */ -#include "../extensions/Xinerama.h" - -static XExtensionInfo _panoramiX_ext_info_data; -static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data; -static /* const */ char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME; - -#define PanoramiXCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, panoramiX_extension_name, val) -#define PanoramiXSimpleCheckExtension(dpy,i) \ - XextSimpleCheckExtension (dpy, i, panoramiX_extension_name) - -static int close_display(); -static /* const */ XExtensionHooks panoramiX_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, panoramiX_ext_info, - panoramiX_extension_name, - &panoramiX_extension_hooks, - 0, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, panoramiX_ext_info) - - - -/**************************************************************************** - * * - * PanoramiX public interfaces * - * * - ****************************************************************************/ - -Bool SDL_NAME(XPanoramiXQueryExtension) ( - Display *dpy, - int *event_basep, - int *error_basep -) -{ - XExtDisplayInfo *info = find_display (dpy); - - if (XextHasExtension(info)) { - *event_basep = info->codes->first_event; - *error_basep = info->codes->first_error; - return True; - } else { - return False; - } -} - - -Status SDL_NAME(XPanoramiXQueryVersion)( - Display *dpy, - int *major_versionp, - int *minor_versionp -) -{ - XExtDisplayInfo *info = find_display (dpy); - xPanoramiXQueryVersionReply rep; - register xPanoramiXQueryVersionReq *req; - - PanoramiXCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - GetReq (PanoramiXQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->panoramiXReqType = X_PanoramiXQueryVersion; - req->clientMajor = PANORAMIX_MAJOR_VERSION; - req->clientMinor = PANORAMIX_MINOR_VERSION; - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - *major_versionp = rep.majorVersion; - *minor_versionp = rep.minorVersion; - UnlockDisplay (dpy); - SyncHandle (); - return 1; -} - -SDL_NAME(XPanoramiXInfo) *SDL_NAME(XPanoramiXAllocInfo)(void) -{ - return (SDL_NAME(XPanoramiXInfo) *) Xmalloc (sizeof (SDL_NAME(XPanoramiXInfo))); -} - -Status SDL_NAME(XPanoramiXGetState) ( - Display *dpy, - Drawable drawable, - SDL_NAME(XPanoramiXInfo) *panoramiX_info -) -{ - XExtDisplayInfo *info = find_display (dpy); - xPanoramiXGetStateReply rep; - register xPanoramiXGetStateReq *req; - - PanoramiXCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - GetReq (PanoramiXGetState, req); - req->reqType = info->codes->major_opcode; - req->panoramiXReqType = X_PanoramiXGetState; - req->window = drawable; - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - UnlockDisplay (dpy); - SyncHandle (); - panoramiX_info->window = rep.window; - panoramiX_info->State = rep.state; - return 1; -} - -Status SDL_NAME(XPanoramiXGetScreenCount) ( - Display *dpy, - Drawable drawable, - SDL_NAME(XPanoramiXInfo) *panoramiX_info -) -{ - XExtDisplayInfo *info = find_display (dpy); - xPanoramiXGetScreenCountReply rep; - register xPanoramiXGetScreenCountReq *req; - - PanoramiXCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - GetReq (PanoramiXGetScreenCount, req); - req->reqType = info->codes->major_opcode; - req->panoramiXReqType = X_PanoramiXGetScreenCount; - req->window = drawable; - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - UnlockDisplay (dpy); - SyncHandle (); - panoramiX_info->window = rep.window; - panoramiX_info->ScreenCount = rep.ScreenCount; - return 1; -} - -Status SDL_NAME(XPanoramiXGetScreenSize) ( - Display *dpy, - Drawable drawable, - int screen_num, - SDL_NAME(XPanoramiXInfo) *panoramiX_info -) -{ - XExtDisplayInfo *info = find_display (dpy); - xPanoramiXGetScreenSizeReply rep; - register xPanoramiXGetScreenSizeReq *req; - - PanoramiXCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - GetReq (PanoramiXGetScreenSize, req); - req->reqType = info->codes->major_opcode; - req->panoramiXReqType = X_PanoramiXGetScreenSize; - req->window = drawable; - req->screen = screen_num; /* need to define */ - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return 0; - } - UnlockDisplay (dpy); - SyncHandle (); - panoramiX_info->window = rep.window; - panoramiX_info->screen = rep.screen; - panoramiX_info->width = rep.width; - panoramiX_info->height = rep.height; - return 1; -} - -/*******************************************************************\ - Alternate interface to make up for shortcomings in the original, - namely, the omission of the screen origin. The new interface is - in the "Xinerama" namespace instead of "PanoramiX". -\*******************************************************************/ - -Bool SDL_NAME(XineramaQueryExtension) ( - Display *dpy, - int *event_base, - int *error_base -) -{ - return SDL_NAME(XPanoramiXQueryExtension)(dpy, event_base, error_base); -} - -Status SDL_NAME(XineramaQueryVersion)( - Display *dpy, - int *major, - int *minor -) -{ - return SDL_NAME(XPanoramiXQueryVersion)(dpy, major, minor); -} - -Bool SDL_NAME(XineramaIsActive)(Display *dpy) -{ - xXineramaIsActiveReply rep; - xXineramaIsActiveReq *req; - XExtDisplayInfo *info = find_display (dpy); - - if(!XextHasExtension(info)) - return False; /* server doesn't even have the extension */ - - LockDisplay (dpy); - GetReq (XineramaIsActive, req); - req->reqType = info->codes->major_opcode; - req->panoramiXReqType = X_XineramaIsActive; - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return False; - } - UnlockDisplay (dpy); - SyncHandle (); - return rep.state; -} - -#include - -SDL_NAME(XineramaScreenInfo) * -SDL_NAME(XineramaQueryScreens)( - Display *dpy, - int *number -) -{ - XExtDisplayInfo *info = find_display (dpy); - xXineramaQueryScreensReply rep; - xXineramaQueryScreensReq *req; - SDL_NAME(XineramaScreenInfo) *scrnInfo = NULL; - - PanoramiXCheckExtension (dpy, info, 0); - - LockDisplay (dpy); - GetReq (XineramaQueryScreens, req); - req->reqType = info->codes->major_opcode; - req->panoramiXReqType = X_XineramaQueryScreens; - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - - if(rep.number) { - if((scrnInfo = Xmalloc(sizeof(SDL_NAME(XineramaScreenInfo)) * rep.number))) { - xXineramaScreenInfo scratch; - int i; - - for(i = 0; i < rep.number; i++) { - _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo); - scrnInfo[i].screen_number = i; - scrnInfo[i].x_org = scratch.x_org; - scrnInfo[i].y_org = scratch.y_org; - scrnInfo[i].width = scratch.width; - scrnInfo[i].height = scratch.height; - } - - *number = rep.number; - } else - _XEatData(dpy, rep.length << 2); - } - - UnlockDisplay (dpy); - SyncHandle (); - return scrnInfo; -} - - - diff --git a/src/video/Xext/Xv/Xv.c b/src/video/Xext/Xv/Xv.c deleted file mode 100644 index 7147b9e8cb..0000000000 --- a/src/video/Xext/Xv/Xv.c +++ /dev/null @@ -1,1151 +0,0 @@ -/*********************************************************** -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/lib/Xv/Xv.c,v 1.15 2001/05/11 08:23:22 alanh Exp $ */ -/* -** File: -** -** Xv.c --- Xv library extension module. -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 26.06.91 Carver -** - changed XvFreeAdaptors to XvFreeAdaptorInfo -** - changed XvFreeEncodings to XvFreeEncodingInfo -** -** 11.06.91 Carver -** - changed SetPortControl to SetPortAttribute -** - changed GetPortControl to GetPortAttribute -** - changed QueryBestSize -** -** 15.05.91 Carver -** - version 2.0 upgrade -** -** 240.01.91 Carver -** - version 1.4 upgrade -** -*/ - -#include -#include "Xvlibint.h" -#include "../extensions/Xext.h" -#include -#include "../extensions/extutil.h" - -static XExtensionInfo _xv_info_data; -static XExtensionInfo *xv_info = &_xv_info_data; -static char *xv_extension_name = XvName; - -#define XvCheckExtension(dpy, i, val) \ - XextCheckExtension(dpy, i, xv_extension_name, val) - -static char *xv_error_string(); -static int xv_close_display(); -static Bool xv_wire_to_event(); - -static XExtensionHooks xv_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - xv_close_display, /* close_display */ - xv_wire_to_event, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - xv_error_string /* error_string */ -}; - - -static char *xv_error_list[] = -{ - "BadPort", /* XvBadPort */ - "BadEncoding", /* XvBadEncoding */ - "BadControl" /* XvBadControl */ -}; - -static XEXT_GENERATE_CLOSE_DISPLAY (xv_close_display, xv_info) - - -static XEXT_GENERATE_FIND_DISPLAY (xv_find_display, xv_info, - xv_extension_name, - &xv_extension_hooks, - XvNumEvents, NULL) - - -static XEXT_GENERATE_ERROR_STRING (xv_error_string, xv_extension_name, - XvNumErrors, xv_error_list) - - -int -SDL_NAME(XvQueryExtension)( - Display *dpy, - unsigned int *p_version, - unsigned int *p_revision, - unsigned int *p_requestBase, - unsigned int *p_eventBase, - unsigned int *p_errorBase -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvQueryExtensionReq *req; - xvQueryExtensionReply rep; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(QueryExtension, req); - - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return XvBadExtension; - } - - *p_version = rep.version; - *p_revision = rep.revision; - *p_requestBase = info->codes->major_opcode; - *p_eventBase = info->codes->first_event; - *p_errorBase = info->codes->first_error; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvQueryAdaptors)( - Display *dpy, - Window window, - unsigned int *p_nAdaptors, - SDL_NAME(XvAdaptorInfo) **p_pAdaptors -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvQueryAdaptorsReq *req; - xvQueryAdaptorsReply rep; - int size,ii,jj; - char *name; - SDL_NAME(XvAdaptorInfo) *pas, *pa; - SDL_NAME(XvFormat) *pfs, *pf; - char *buffer; - union - { - char *buffer; - char *string; - xvAdaptorInfo *pa; - xvFormat *pf; - } u; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(QueryAdaptors, req); - req->window = window; - - /* READ THE REPLY */ - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) { - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadReply); - } - - size = rep.length << 2; - if ( (buffer = (char *)Xmalloc ((unsigned) size)) == NULL) { - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); - } - _XRead (dpy, buffer, size); - - u.buffer = buffer; - - /* GET INPUT ADAPTORS */ - - if (rep.num_adaptors == 0) { - pas = NULL; - } else { - size = rep.num_adaptors*sizeof(SDL_NAME(XvAdaptorInfo)); - if ((pas=(SDL_NAME(XvAdaptorInfo) *)Xmalloc(size))==NULL) { - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); - } - } - - /* INIT ADAPTOR FIELDS */ - - pa = pas; - for (ii=0; iinum_adaptors = 0; - pa->name = (char *)NULL; - pa->formats = (SDL_NAME(XvFormat) *)NULL; - pa++; - } - - pa = pas; - for (ii=0; iitype = u.pa->type; - pa->base_id = u.pa->base_id; - pa->num_ports = u.pa->num_ports; - pa->num_formats = u.pa->num_formats; - pa->num_adaptors = rep.num_adaptors - ii; - - /* GET ADAPTOR NAME */ - - size = u.pa->name_size; - u.buffer += (sz_xvAdaptorInfo + 3) & ~3; - - if ( (name = (char *)Xmalloc(size+1)) == NULL) - { - SDL_NAME(XvFreeAdaptorInfo)(pas); - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); - } - SDL_strlcpy(name, u.string, size); - pa->name = name; - - u.buffer += (size + 3) & ~3; - - /* GET FORMATS */ - - size = pa->num_formats*sizeof(SDL_NAME(XvFormat)); - if ((pfs=(SDL_NAME(XvFormat) *)Xmalloc(size))==NULL) { - SDL_NAME(XvFreeAdaptorInfo)(pas); - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); - } - - pf = pfs; - for (jj=0; jjnum_formats; jj++) { - pf->depth = u.pf->depth; - pf->visual_id = u.pf->visual; - pf++; - - u.buffer += (sz_xvFormat + 3) & ~3; - } - - pa->formats = pfs; - - pa++; - - } - - *p_nAdaptors = rep.num_adaptors; - *p_pAdaptors = pas; - - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - - return (Success); -} - - -void -SDL_NAME(XvFreeAdaptorInfo)(SDL_NAME(XvAdaptorInfo) *pAdaptors) -{ - - SDL_NAME(XvAdaptorInfo) *pa; - int ii; - - if (!pAdaptors) return; - - pa = pAdaptors; - - for (ii=0; iinum_adaptors; ii++, pa++) - { - if (pa->name) - { - Xfree(pa->name); - } - if (pa->formats) - { - Xfree(pa->formats); - } - } - - Xfree(pAdaptors); -} - -int -SDL_NAME(XvQueryEncodings)( - Display *dpy, - XvPortID port, - unsigned int *p_nEncodings, - SDL_NAME(XvEncodingInfo) **p_pEncodings -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvQueryEncodingsReq *req; - xvQueryEncodingsReply rep; - int size, jj; - char *name; - SDL_NAME(XvEncodingInfo) *pes, *pe; - char *buffer; - union - { - char *buffer; - char *string; - xvEncodingInfo *pe; - } u; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(QueryEncodings, req); - req->port = port; - - /* READ THE REPLY */ - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) { - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadReply); - } - - size = rep.length << 2; - if ( (buffer = (char *)Xmalloc ((unsigned) size)) == NULL) { - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); - } - _XRead (dpy, buffer, size); - - u.buffer = buffer; - - /* GET ENCODINGS */ - - size = rep.num_encodings*sizeof(SDL_NAME(XvEncodingInfo)); - if ( (pes = (SDL_NAME(XvEncodingInfo) *)Xmalloc(size)) == NULL) { - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); - } - - /* INITIALIZE THE ENCODING POINTER */ - - pe = pes; - for (jj=0; jjname = (char *)NULL; - pe->num_encodings = 0; - pe++; - } - - pe = pes; - for (jj=0; jjencoding_id = u.pe->encoding; - pe->width = u.pe->width; - pe->height = u.pe->height; - pe->rate.numerator = u.pe->rate.numerator; - pe->rate.denominator = u.pe->rate.denominator; - pe->num_encodings = rep.num_encodings - jj; - - size = u.pe->name_size; - u.buffer += (sz_xvEncodingInfo + 3) & ~3; - - if ( (name = (char *)Xmalloc(size+1)) == NULL) { - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); - } - SDL_strlcpy(name, u.string, size); - pe->name = name; - pe++; - - u.buffer += (size + 3) & ~3; - } - - *p_nEncodings = rep.num_encodings; - *p_pEncodings = pes; - - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - - return (Success); -} - -void -SDL_NAME(XvFreeEncodingInfo)(SDL_NAME(XvEncodingInfo) *pEncodings) -{ - - SDL_NAME(XvEncodingInfo) *pe; - int ii; - - if (!pEncodings) return; - - pe = pEncodings; - - for (ii=0; iinum_encodings; ii++, pe++) { - if (pe->name) Xfree(pe->name); - } - - Xfree(pEncodings); -} - -int -SDL_NAME(XvPutVideo)( - Display *dpy, - XvPortID port, - Drawable d, - GC gc, - int vx, int vy, - unsigned int vw, unsigned int vh, - int dx, int dy, - unsigned int dw, unsigned int dh -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvPutVideoReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - FlushGC(dpy, gc); - - XvGetReq(PutVideo, req); - - req->port = port; - req->drawable = d; - req->gc = gc->gid; - req->vid_x = vx; - req->vid_y = vy; - req->vid_w = vw; - req->vid_h = vh; - req->drw_x = dx; - req->drw_y = dy; - req->drw_w = dw; - req->drw_h = dh; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvPutStill)( - Display *dpy, - XvPortID port, - Drawable d, - GC gc, - int vx, int vy, - unsigned int vw, unsigned int vh, - int dx, int dy, - unsigned int dw, unsigned int dh -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvPutStillReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - FlushGC(dpy, gc); - - XvGetReq(PutStill, req); - req->port = port; - req->drawable = d; - req->gc = gc->gid; - req->vid_x = vx; - req->vid_y = vy; - req->vid_w = vw; - req->vid_h = vh; - req->drw_x = dx; - req->drw_y = dy; - req->drw_w = dw; - req->drw_h = dh; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvGetVideo)( - Display *dpy, - XvPortID port, - Drawable d, - GC gc, - int vx, int vy, - unsigned int vw, unsigned int vh, - int dx, int dy, - unsigned int dw, unsigned int dh -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvGetVideoReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - FlushGC(dpy, gc); - - XvGetReq(GetVideo, req); - req->port = port; - req->drawable = d; - req->gc = gc->gid; - req->vid_x = vx; - req->vid_y = vy; - req->vid_w = vw; - req->vid_h = vh; - req->drw_x = dx; - req->drw_y = dy; - req->drw_w = dw; - req->drw_h = dh; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvGetStill)( - Display *dpy, - XvPortID port, - Drawable d, - GC gc, - int vx, int vy, - unsigned int vw, unsigned int vh, - int dx, int dy, - unsigned int dw, unsigned int dh -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvGetStillReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - FlushGC(dpy, gc); - - XvGetReq(GetStill, req); - req->port = port; - req->drawable = d; - req->gc = gc->gid; - req->vid_x = vx; - req->vid_y = vy; - req->vid_w = vw; - req->vid_h = vh; - req->drw_x = dx; - req->drw_y = dy; - req->drw_w = dw; - req->drw_h = dh; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvStopVideo)( - Display *dpy, - XvPortID port, - Drawable draw -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvStopVideoReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(StopVideo, req); - req->port = port; - req->drawable = draw; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvGrabPort)( - Display *dpy, - XvPortID port, - Time time -){ - XExtDisplayInfo *info = xv_find_display(dpy); - int result; - xvGrabPortReply rep; - xvGrabPortReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(GrabPort, req); - req->port = port; - req->time = time; - - if (_XReply (dpy, (xReply *) &rep, 0, xTrue) == 0) - rep.result = GrabSuccess; - - result = rep.result; - - UnlockDisplay(dpy); - SyncHandle(); - - return result; -} - -int -SDL_NAME(XvUngrabPort)( - Display *dpy, - XvPortID port, - Time time -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvUngrabPortReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(UngrabPort, req); - req->port = port; - req->time = time; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvSelectVideoNotify)( - Display *dpy, - Drawable drawable, - Bool onoff -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvSelectVideoNotifyReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(SelectVideoNotify, req); - req->drawable = drawable; - req->onoff = onoff; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvSelectPortNotify)( - Display *dpy, - XvPortID port, - Bool onoff -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvSelectPortNotifyReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(SelectPortNotify, req); - req->port = port; - req->onoff = onoff; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int -SDL_NAME(XvSetPortAttribute) ( - Display *dpy, - XvPortID port, - Atom attribute, - int value -) -{ - XExtDisplayInfo *info = xv_find_display(dpy); - xvSetPortAttributeReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(SetPortAttribute, req); - req->port = port; - req->attribute = attribute; - req->value = value; - - UnlockDisplay(dpy); - SyncHandle(); - - return (Success); -} - -int -SDL_NAME(XvGetPortAttribute) ( - Display *dpy, - XvPortID port, - Atom attribute, - int *p_value -) -{ - XExtDisplayInfo *info = xv_find_display(dpy); - xvGetPortAttributeReq *req; - xvGetPortAttributeReply rep; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(GetPortAttribute, req); - req->port = port; - req->attribute = attribute; - - /* READ THE REPLY */ - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) { - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadReply); - } - - *p_value = rep.value; - - UnlockDisplay(dpy); - SyncHandle(); - - return (Success); -} - -int -SDL_NAME(XvQueryBestSize)( - Display *dpy, - XvPortID port, - Bool motion, - unsigned int vid_w, - unsigned int vid_h, - unsigned int drw_w, - unsigned int drw_h, - unsigned int *p_actual_width, - unsigned int *p_actual_height -) -{ - XExtDisplayInfo *info = xv_find_display(dpy); - xvQueryBestSizeReq *req; - xvQueryBestSizeReply rep; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - XvGetReq(QueryBestSize, req); - req->port = port; - req->motion = motion; - req->vid_w = vid_w; - req->vid_h = vid_h; - req->drw_w = drw_w; - req->drw_h = drw_h; - - /* READ THE REPLY */ - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) { - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadReply); - } - - *p_actual_width = rep.actual_width; - *p_actual_height = rep.actual_height; - - UnlockDisplay(dpy); - SyncHandle(); - - return (Success); -} - - -SDL_NAME(XvAttribute)* -SDL_NAME(XvQueryPortAttributes)(Display *dpy, XvPortID port, int *num) -{ - XExtDisplayInfo *info = xv_find_display(dpy); - xvQueryPortAttributesReq *req; - xvQueryPortAttributesReply rep; - SDL_NAME(XvAttribute) *ret = NULL; - - *num = 0; - - XvCheckExtension(dpy, info, NULL); - - LockDisplay(dpy); - - XvGetReq(QueryPortAttributes, req); - req->port = port; - - /* READ THE REPLY */ - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) { - UnlockDisplay(dpy); - SyncHandle(); - return ret; - } - - if(rep.num_attributes) { - int size = (rep.num_attributes * sizeof(SDL_NAME(XvAttribute))) + rep.text_size; - - if((ret = Xmalloc(size))) { - char* marker = (char*)(&ret[rep.num_attributes]); - xvAttributeInfo Info; - int i; - - for(i = 0; i < rep.num_attributes; i++) { - _XRead(dpy, (char*)(&Info), sz_xvAttributeInfo); - ret[i].flags = (int)Info.flags; - ret[i].min_value = Info.min; - ret[i].max_value = Info.max; - ret[i].name = marker; - _XRead(dpy, marker, Info.size); - marker += Info.size; - (*num)++; - } - } else - _XEatData(dpy, rep.length << 2); - } - - UnlockDisplay(dpy); - SyncHandle(); - - return ret; -} - -SDL_NAME(XvImageFormatValues) * SDL_NAME(XvListImageFormats) ( - Display *dpy, - XvPortID port, - int *num -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvListImageFormatsReq *req; - xvListImageFormatsReply rep; - SDL_NAME(XvImageFormatValues) *ret = NULL; - - *num = 0; - - XvCheckExtension(dpy, info, NULL); - - LockDisplay(dpy); - - XvGetReq(ListImageFormats, req); - req->port = port; - - /* READ THE REPLY */ - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) { - UnlockDisplay(dpy); - SyncHandle(); - return NULL; - } - - if(rep.num_formats) { - int size = (rep.num_formats * sizeof(SDL_NAME(XvImageFormatValues))); - - if((ret = Xmalloc(size))) { - xvImageFormatInfo Info; - int i; - - for(i = 0; i < rep.num_formats; i++) { - _XRead(dpy, (char*)(&Info), sz_xvImageFormatInfo); - ret[i].id = Info.id; - ret[i].type = Info.type; - ret[i].byte_order = Info.byte_order; - memcpy(&(ret[i].guid[0]), &(Info.guid[0]), 16); - ret[i].bits_per_pixel = Info.bpp; - ret[i].format = Info.format; - ret[i].num_planes = Info.num_planes; - ret[i].depth = Info.depth; - ret[i].red_mask = Info.red_mask; - ret[i].green_mask = Info.green_mask; - ret[i].blue_mask = Info.blue_mask; - ret[i].y_sample_bits = Info.y_sample_bits; - ret[i].u_sample_bits = Info.u_sample_bits; - ret[i].v_sample_bits = Info.v_sample_bits; - ret[i].horz_y_period = Info.horz_y_period; - ret[i].horz_u_period = Info.horz_u_period; - ret[i].horz_v_period = Info.horz_v_period; - ret[i].vert_y_period = Info.vert_y_period; - ret[i].vert_u_period = Info.vert_u_period; - ret[i].vert_v_period = Info.vert_v_period; - memcpy(&(ret[i].component_order[0]), &(Info.comp_order[0]), 32); - ret[i].scanline_order = Info.scanline_order; - (*num)++; - } - } else - _XEatData(dpy, rep.length << 2); - } - - UnlockDisplay(dpy); - SyncHandle(); - - return ret; -} - -SDL_NAME(XvImage) * SDL_NAME(XvCreateImage) ( - Display *dpy, - XvPortID port, - int id, - char *data, - int width, - int height -) { - XExtDisplayInfo *info = xv_find_display(dpy); - xvQueryImageAttributesReq *req; - xvQueryImageAttributesReply rep; - SDL_NAME(XvImage) *ret = NULL; - - XvCheckExtension(dpy, info, NULL); - - LockDisplay(dpy); - - XvGetReq(QueryImageAttributes, req); - req->id = id; - req->port = port; - req->width = width; - req->height = height; - - /* READ THE REPLY */ - - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return NULL; - } - - if((ret = (SDL_NAME(XvImage)*)Xmalloc(sizeof(SDL_NAME(XvImage)) + (rep.num_planes << 3)))) { - ret->id = id; - ret->width = rep.width; - ret->height = rep.height; - ret->data_size = rep.data_size; - ret->num_planes = rep.num_planes; - ret->pitches = (int*)(&ret[1]); - ret->offsets = ret->pitches + rep.num_planes; - ret->data = data; - ret->obdata = NULL; - _XRead(dpy, (char*)(ret->pitches), rep.num_planes << 2); - _XRead(dpy, (char*)(ret->offsets), rep.num_planes << 2); - } else - _XEatData(dpy, rep.length << 2); - - UnlockDisplay(dpy); - SyncHandle(); - return ret; -} - -SDL_NAME(XvImage) * SDL_NAME(XvShmCreateImage) ( - Display *dpy, - XvPortID port, - int id, - char *data, - int width, - int height, - XShmSegmentInfo *shminfo -){ - SDL_NAME(XvImage) *ret; - - ret = SDL_NAME(XvCreateImage)(dpy, port, id, data, width, height); - - if(ret) ret->obdata = (XPointer)shminfo; - - return ret; -} - -int SDL_NAME(XvPutImage) ( - Display *dpy, - XvPortID port, - Drawable d, - GC gc, - SDL_NAME(XvImage) *image, - int src_x, - int src_y, - unsigned int src_w, - unsigned int src_h, - int dest_x, - int dest_y, - unsigned int dest_w, - unsigned int dest_h -){ - XExtDisplayInfo *info = xv_find_display(dpy); - xvPutImageReq *req; - int len; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - FlushGC(dpy, gc); - - XvGetReq(PutImage, req); - - req->port = port; - req->drawable = d; - req->gc = gc->gid; - req->id = image->id; - req->src_x = src_x; - req->src_y = src_y; - req->src_w = src_w; - req->src_h = src_h; - req->drw_x = dest_x; - req->drw_y = dest_y; - req->drw_w = dest_w; - req->drw_h = dest_h; - req->width = image->width; - req->height = image->height; - - len = (image->data_size + 3) >> 2; - SetReqLen(req, len, len); - - /* Yes it's kindof lame that we are sending the whole thing, - but for video all of it may be needed even if displaying - only a subsection, and I don't want to go through the - trouble of creating subregions to send */ - Data(dpy, (char *)image->data, image->data_size); - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - -int SDL_NAME(XvShmPutImage) ( - Display *dpy, - XvPortID port, - Drawable d, - GC gc, - SDL_NAME(XvImage) *image, - int src_x, - int src_y, - unsigned int src_w, - unsigned int src_h, - int dest_x, - int dest_y, - unsigned int dest_w, - unsigned int dest_h, - Bool send_event -){ - XExtDisplayInfo *info = xv_find_display(dpy); - XShmSegmentInfo *shminfo = (XShmSegmentInfo *)image->obdata; - xvShmPutImageReq *req; - - XvCheckExtension(dpy, info, XvBadExtension); - - LockDisplay(dpy); - - FlushGC(dpy, gc); - - XvGetReq(ShmPutImage, req); - - req->port = port; - req->drawable = d; - req->gc = gc->gid; - req->shmseg = shminfo->shmseg; - req->id = image->id; - req->src_x = src_x; - req->src_y = src_y; - req->src_w = src_w; - req->src_h = src_h; - req->drw_x = dest_x; - req->drw_y = dest_y; - req->drw_w = dest_w; - req->drw_h = dest_h; - req->offset = image->data - shminfo->shmaddr; - req->width = image->width; - req->height = image->height; - req->send_event = send_event; - - UnlockDisplay(dpy); - SyncHandle(); - - return Success; -} - - -static Bool -xv_wire_to_event(Display *dpy, XEvent *host, xEvent *wire) -{ - XExtDisplayInfo *info = xv_find_display(dpy); - SDL_NAME(XvEvent) *re = (SDL_NAME(XvEvent) *)host; - xvEvent *event = (xvEvent *)wire; - - XvCheckExtension(dpy, info, False); - - switch((event->u.u.type & 0x7F) - info->codes->first_event) - { - case XvVideoNotify: - re->xvvideo.type = event->u.u.type & 0x7f; - re->xvvideo.serial = - _XSetLastRequestRead(dpy, (xGenericReply *)event); - re->xvvideo.send_event = ((event->u.u.type & 0x80) != 0); - re->xvvideo.display = dpy; - re->xvvideo.time = event->u.videoNotify.time; - re->xvvideo.reason = event->u.videoNotify.reason; - re->xvvideo.drawable = event->u.videoNotify.drawable; - re->xvvideo.port_id = event->u.videoNotify.port; - break; - case XvPortNotify: - re->xvport.type = event->u.u.type & 0x7f; - re->xvport.serial = - _XSetLastRequestRead(dpy, (xGenericReply *)event); - re->xvport.send_event = ((event->u.u.type & 0x80) != 0); - re->xvport.display = dpy; - re->xvport.time = event->u.portNotify.time; - re->xvport.port_id = event->u.portNotify.port; - re->xvport.attribute = event->u.portNotify.attribute; - re->xvport.value = event->u.portNotify.value; - break; - default: - return False; - } - - return (True); -} - - diff --git a/src/video/Xext/Xv/Xvlibint.h b/src/video/Xext/Xv/Xvlibint.h deleted file mode 100644 index 20df706dc7..0000000000 --- a/src/video/Xext/Xv/Xvlibint.h +++ /dev/null @@ -1,81 +0,0 @@ -/*********************************************************** -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/lib/Xv/Xvlibint.h,v 1.5 2001/07/25 15:04:53 dawes Exp $ */ - -#ifndef XVLIBINT_H -#define XVLIBINT_H -/* -** File: -** -** Xvlibint.h --- Xv library internal header file -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 01.24.91 Carver -** - version 1.4 upgrade -** -*/ - -#define NEED_REPLIES - -/* Apparently some X11 systems can't include this multiple times... */ -#ifndef SDL_INCLUDED_XLIBINT_H -#define SDL_INCLUDED_XLIBINT_H 1 -#include -#endif - -#include "../extensions/Xvproto.h" -#include "../extensions/Xvlib.h" - -#if !defined(UNIXCPP) -#define XvGetReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xv##name##Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xv##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = info->codes->major_opcode;\ - req->xvReqType = xv_##name; \ - req->length = (SIZEOF(xv##name##Req))>>2;\ - dpy->bufptr += SIZEOF(xv##name##Req);\ - dpy->request++ - -#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ -#define XvGetReq(name, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(xv/**/name/**/Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (xv/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = info->codes->major_opcode;\ - req->xvReqType = xv_/**/name;\ - req->length = (SIZEOF(xv/**/name/**/Req))>>2;\ - dpy->bufptr += SIZEOF(xv/**/name/**/Req);\ - dpy->request++ -#endif - - -#endif /* XVLIBINT_H */ diff --git a/src/video/Xext/Xxf86dga/XF86DGA.c b/src/video/Xext/Xxf86dga/XF86DGA.c deleted file mode 100644 index fc729f1257..0000000000 --- a/src/video/Xext/Xxf86dga/XF86DGA.c +++ /dev/null @@ -1,721 +0,0 @@ -/* $XFree86: xc/lib/Xxf86dga/XF86DGA.c,v 3.19 2001/08/18 02:41:30 dawes Exp $ */ -/* - -Copyright (c) 1995 Jon Tombs -Copyright (c) 1995,1996 The XFree86 Project, Inc - -*/ - -/* THIS IS NOT AN X CONSORTIUM STANDARD */ - -#ifdef __EMX__ /* needed here to override certain constants in X headers */ -#define INCL_DOS -#define INCL_DOSIOCTL -#include -#endif - -#if defined(linux) -#define HAS_MMAP_ANON -#include -#include -/*#include */ /* PAGE_SIZE */ -#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */ -#define HAS_GETPAGESIZE -#endif /* linux */ - -#if defined(CSRG_BASED) -#define HAS_MMAP_ANON -#define HAS_GETPAGESIZE -#include -#include -#endif /* CSRG_BASED */ - -#if defined(DGUX) -#define HAS_GETPAGESIZE -#define MMAP_DEV_ZERO -#include -#include -#include -#endif /* DGUX */ - -#if defined(SVR4) && !defined(DGUX) -#define MMAP_DEV_ZERO -#include -#include -#include -#endif /* SVR4 && !DGUX */ - -#if defined(sun) && !defined(SVR4) /* SunOS */ -#define MMAP_DEV_ZERO /* doesn't SunOS have MAP_ANON ?? */ -#define HAS_GETPAGESIZE -#include -#include -#endif /* sun && !SVR4 */ - -#ifdef XNO_SYSCONF -#undef _SC_PAGESIZE -#endif - -#define NEED_EVENTS -#define NEED_REPLIES - -/* Apparently some X11 systems can't include this multiple times... */ -#ifndef SDL_INCLUDED_XLIBINT_H -#define SDL_INCLUDED_XLIBINT_H 1 -#include -#endif - -#include "../extensions/xf86dga.h" -#include "../extensions/xf86dgastr.h" -#include "../extensions/Xext.h" -#include "../extensions/extutil.h" - -extern XExtDisplayInfo* SDL_NAME(xdga_find_display)(Display*); -extern char *SDL_NAME(xdga_extension_name); - -#define XF86DGACheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, SDL_NAME(xdga_extension_name), val) - -/***************************************************************************** - * * - * public XFree86-DGA Extension routines * - * * - *****************************************************************************/ - -Bool SDL_NAME(XF86DGAQueryExtension) ( - Display *dpy, - int *event_basep, - int *error_basep -){ - return SDL_NAME(XDGAQueryExtension)(dpy, event_basep, error_basep); -} - -Bool SDL_NAME(XF86DGAQueryVersion)( - Display* dpy, - int* majorVersion, - int* minorVersion -){ - return SDL_NAME(XDGAQueryVersion)(dpy, majorVersion, minorVersion); -} - -Bool SDL_NAME(XF86DGAGetVideoLL)( - Display* dpy, - int screen, - int *offset, - int *width, - int *bank_size, - int *ram_size -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGAGetVideoLLReply rep; - xXF86DGAGetVideoLLReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGAGetVideoLL, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGAGetVideoLL; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - - *offset = /*(char *)*/rep.offset; - *width = rep.width; - *bank_size = rep.bank_size; - *ram_size = rep.ram_size; - - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - - -Bool SDL_NAME(XF86DGADirectVideoLL)( - Display* dpy, - int screen, - int enable -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGADirectVideoReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGADirectVideo, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGADirectVideo; - req->screen = screen; - req->enable = enable; - UnlockDisplay(dpy); - SyncHandle(); - XSync(dpy,False); - return True; -} - -Bool SDL_NAME(XF86DGAGetViewPortSize)( - Display* dpy, - int screen, - int *width, - int *height -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGAGetViewPortSizeReply rep; - xXF86DGAGetViewPortSizeReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGAGetViewPortSize, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGAGetViewPortSize; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - - *width = rep.width; - *height = rep.height; - - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - - -Bool SDL_NAME(XF86DGASetViewPort)( - Display* dpy, - int screen, - int x, - int y -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGASetViewPortReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGASetViewPort, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGASetViewPort; - req->screen = screen; - req->x = x; - req->y = y; - UnlockDisplay(dpy); - SyncHandle(); - XSync(dpy,False); - return True; -} - - -Bool SDL_NAME(XF86DGAGetVidPage)( - Display* dpy, - int screen, - int *vpage -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGAGetVidPageReply rep; - xXF86DGAGetVidPageReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGAGetVidPage, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGAGetVidPage; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - - *vpage = rep.vpage; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - - -Bool SDL_NAME(XF86DGASetVidPage)( - Display* dpy, - int screen, - int vpage -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGASetVidPageReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGASetVidPage, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGASetVidPage; - req->screen = screen; - req->vpage = vpage; - UnlockDisplay(dpy); - SyncHandle(); - XSync(dpy,False); - return True; -} - -Bool SDL_NAME(XF86DGAInstallColormap)( - Display* dpy, - int screen, - Colormap cmap -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGAInstallColormapReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGAInstallColormap, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGAInstallColormap; - req->screen = screen; - req->id = cmap; - UnlockDisplay(dpy); - SyncHandle(); - XSync(dpy,False); - return True; -} - -Bool SDL_NAME(XF86DGAQueryDirectVideo)( - Display *dpy, - int screen, - int *flags -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGAQueryDirectVideoReply rep; - xXF86DGAQueryDirectVideoReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGAQueryDirectVideo, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGAQueryDirectVideo; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *flags = rep.flags; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool SDL_NAME(XF86DGAViewPortChanged)( - Display *dpy, - int screen, - int n -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXF86DGAViewPortChangedReply rep; - xXF86DGAViewPortChangedReq *req; - - XF86DGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DGAViewPortChanged, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XF86DGAViewPortChanged; - req->screen = screen; - req->n = n; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - UnlockDisplay(dpy); - SyncHandle(); - return rep.result; -} - - - -/* Helper functions */ - -#include -#include "../extensions/xf86dga.h" -#include -#include -#include -#if defined(ISC) -# define HAS_SVR3_MMAP -# include -# include - -# include -# include - -# include -# include -# include - -# include -#else -# if !defined(Lynx) -# if !defined(__EMX__) -# include -# endif -# else -# include -# include -# include -# endif -#endif -#include -#include -#include - -#if defined(SVR4) && !defined(sun) && !defined(SCO325) -#define DEV_MEM "/dev/pmem" -#elif defined(SVR4) && defined(sun) -#define DEV_MEM "/dev/xsvc" -#else -#define DEV_MEM "/dev/mem" -#endif - -typedef struct { - unsigned long physaddr; /* actual requested physical address */ - unsigned long size; /* actual requested map size */ - unsigned long delta; /* delta to account for page alignment */ - void * vaddr; /* mapped address, without the delta */ - int refcount; /* reference count */ -} MapRec, *MapPtr; - -typedef struct { - Display * display; - int screen; - MapPtr map; -} ScrRec, *ScrPtr; - -static int mapFd = -1; -static int numMaps = 0; -static int numScrs = 0; -static MapPtr *mapList = NULL; -static ScrPtr *scrList = NULL; - -static MapPtr -AddMap(void) -{ - MapPtr *old; - - old = mapList; - mapList = realloc(mapList, sizeof(MapPtr) * (numMaps + 1)); - if (!mapList) { - mapList = old; - return NULL; - } - mapList[numMaps] = malloc(sizeof(MapRec)); - if (!mapList[numMaps]) - return NULL; - return mapList[numMaps++]; -} - -static ScrPtr -AddScr(void) -{ - ScrPtr *old; - - old = scrList; - scrList = realloc(scrList, sizeof(ScrPtr) * (numScrs + 1)); - if (!scrList) { - scrList = old; - return NULL; - } - scrList[numScrs] = malloc(sizeof(ScrRec)); - if (!scrList[numScrs]) - return NULL; - return scrList[numScrs++]; -} - -static MapPtr -FindMap(unsigned long address, unsigned long size) -{ - int i; - - for (i = 0; i < numMaps; i++) { - if (mapList[i]->physaddr == address && - mapList[i]->size == size) - return mapList[i]; - } - return NULL; -} - -static ScrPtr -FindScr(Display *display, int screen) -{ - int i; - - for (i = 0; i < numScrs; i++) { - if (scrList[i]->display == display && - scrList[i]->screen == screen) - return scrList[i]; - } - return NULL; -} - -static void * -MapPhysAddress(unsigned long address, unsigned long size) -{ - unsigned long offset, delta; - int pagesize = -1; - void *vaddr; - MapPtr mp; -#if defined(ISC) && defined(HAS_SVR3_MMAP) - struct kd_memloc mloc; -#elif defined(__EMX__) - APIRET rc; - ULONG action; - HFILE hfd; -#endif - - if ((mp = FindMap(address, size))) { - mp->refcount++; - return (void *)((unsigned long)mp->vaddr + mp->delta); - } - -#if defined(_SC_PAGESIZE) && defined(HAS_SC_PAGESIZE) - pagesize = sysconf(_SC_PAGESIZE); -#endif -#ifdef _SC_PAGE_SIZE - if (pagesize == -1) - pagesize = sysconf(_SC_PAGE_SIZE); -#endif -#ifdef HAS_GETPAGESIZE - if (pagesize == -1) - pagesize = getpagesize(); -#endif -#ifdef PAGE_SIZE - if (pagesize == -1) - pagesize = PAGE_SIZE; -#endif - if (pagesize == -1) - pagesize = 4096; - - delta = address % pagesize; - offset = address - delta; - -#if defined(ISC) && defined(HAS_SVR3_MMAP) - if (mapFd < 0) { - if ((mapFd = open("/dev/mmap", O_RDWR)) < 0) - return NULL; - } - mloc.vaddr = (char *)0; - mloc.physaddr = (char *)offset; - mloc.length = size + delta; - mloc.ioflg=1; - - if ((vaddr = (void *)ioctl(mapFd, MAP, &mloc)) == (void *)-1) - return NULL; -#elif defined (__EMX__) - /* - * Dragon warning here! /dev/pmap$ is never closed, except on progam exit. - * Consecutive calling of this routine will make PMAP$ driver run out - * of memory handles. Some umap/close mechanism should be provided - */ - - rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN, - OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL); - if (rc != 0) - return NULL; - { - struct map_ioctl { - union { - ULONG phys; - void* user; - } a; - ULONG size; - } pmap,dmap; - ULONG plen,dlen; -#define XFREE86_PMAP 0x76 -#define PMAP_MAP 0x44 - - pmap.a.phys = offset; - pmap.size = size + delta; - rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP, - (PULONG)&pmap, sizeof(pmap), &plen, - (PULONG)&dmap, sizeof(dmap), &dlen); - if (rc == 0) { - vaddr = dmap.a.user; - } - } - if (rc != 0) - return NULL; -#elif defined (Lynx) - vaddr = (void *)smem_create("XF86DGA", (char *)offset, - size + delta, SM_READ|SM_WRITE); -#else -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif - if (mapFd < 0) { - if ((mapFd = open(DEV_MEM, O_RDWR)) < 0) - return NULL; - } - vaddr = (void *)mmap(NULL, size + delta, PROT_READ | PROT_WRITE, - MAP_FILE | MAP_SHARED, mapFd, (off_t)offset); - if (vaddr == (void *)-1) - return NULL; -#endif - - if (!vaddr) { - if (!(mp = AddMap())) - return NULL; - mp->physaddr = address; - mp->size = size; - mp->delta = delta; - mp->vaddr = vaddr; - mp->refcount = 1; - } - return (void *)((unsigned long)vaddr + delta); -} - -/* - * Still need to find a clean way of detecting the death of a DGA app - * and returning things to normal - Jon - * This is here to help debugging without rebooting... Also C-A-BS - * should restore text mode. - */ - -int -SDL_NAME(XF86DGAForkApp)(int screen) -{ - pid_t pid; - int status; - int i; - - /* fork the app, parent hangs around to clean up */ - if ((pid = fork()) > 0) { - ScrPtr sp; - - waitpid(pid, &status, 0); - for (i = 0; i < numScrs; i++) { - sp = scrList[i]; - SDL_NAME(XF86DGADirectVideoLL)(sp->display, sp->screen, 0); - XSync(sp->display, False); - } - if (WIFEXITED(status)) - _exit(0); - else - _exit(-1); - } - return pid; -} - - -Bool -SDL_NAME(XF86DGADirectVideo)( - Display *dis, - int screen, - int enable -){ - ScrPtr sp; - MapPtr mp = NULL; - - if ((sp = FindScr(dis, screen))) - mp = sp->map; - - if (enable & XF86DGADirectGraphics) { -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \ - && !defined(__EMX__) - if (mp && mp->vaddr) - mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ | PROT_WRITE); -#endif - } else { -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \ - && !defined(__EMX__) - if (mp && mp->vaddr) - mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ); -#elif defined(Lynx) - /* XXX this doesn't allow enable after disable */ - smem_create(NULL, mp->vaddr, mp->size + mp->delta, SM_DETACH); - smem_remove("XF86DGA"); -#endif - } - - SDL_NAME(XF86DGADirectVideoLL)(dis, screen, enable); - return 1; -} - - -static void -XF86cleanup(int sig) -{ - ScrPtr sp; - int i; - static char beenhere = 0; - - if (beenhere) - _exit(3); - beenhere = 1; - - for (i = 0; i < numScrs; i++) { - sp = scrList[i]; - SDL_NAME(XF86DGADirectVideo)(sp->display, sp->screen, 0); - XSync(sp->display, False); - } - _exit(3); -} - -Bool -SDL_NAME(XF86DGAGetVideo)( - Display *dis, - int screen, - char **addr, - int *width, - int *bank, - int *ram -){ - /*unsigned long*/ int offset; - static int beenHere = 0; - ScrPtr sp; - MapPtr mp; - - if (!(sp = FindScr(dis, screen))) { - if (!(sp = AddScr())) { - fprintf(stderr, "XF86DGAGetVideo: malloc failure\n"); - exit(-2); - } - sp->display = dis; - sp->screen = screen; - sp->map = NULL; - } - - SDL_NAME(XF86DGAGetVideoLL)(dis, screen , &offset, width, bank, ram); - - *addr = MapPhysAddress(offset, *bank); - if (*addr == NULL) { - fprintf(stderr, "XF86DGAGetVideo: failed to map video memory (%s)\n", - strerror(errno)); - exit(-2); - } - - if ((mp = FindMap(offset, *bank))) - sp->map = mp; - - if (!beenHere) { - beenHere = 1; - atexit((void(*)(void))XF86cleanup); - /* one shot XF86cleanup attempts */ - signal(SIGSEGV, XF86cleanup); -#ifdef SIGBUS - signal(SIGBUS, XF86cleanup); -#endif - signal(SIGHUP, XF86cleanup); - signal(SIGFPE, XF86cleanup); - } - - return 1; -} - diff --git a/src/video/Xext/Xxf86dga/XF86DGA2.c b/src/video/Xext/Xxf86dga/XF86DGA2.c deleted file mode 100644 index 11d4fddc6a..0000000000 --- a/src/video/Xext/Xxf86dga/XF86DGA2.c +++ /dev/null @@ -1,993 +0,0 @@ -/* $XFree86: xc/lib/Xxf86dga/XF86DGA2.c,v 1.18 2001/08/17 13:27:51 dawes Exp $ */ -/* - -Copyright (c) 1995 Jon Tombs -Copyright (c) 1995,1996 The XFree86 Project, Inc - -*/ - -/* THIS IS NOT AN X CONSORTIUM STANDARD */ - -#ifdef __EMX__ /* needed here to override certain constants in X headers */ -#define INCL_DOS -#define INCL_DOSIOCTL -#include -#endif - -#define NEED_EVENTS -#define NEED_REPLIES - -/* Apparently some X11 systems can't include this multiple times... */ -#ifndef SDL_INCLUDED_XLIBINT_H -#define SDL_INCLUDED_XLIBINT_H 1 -#include -#endif - -#include "../extensions/xf86dga.h" -#include "../extensions/xf86dgastr.h" -#include "../extensions/Xext.h" -#include "../extensions/extutil.h" -#include - -#if defined(ENABLE_FBCON) /* Needed for framebuffer console support */ -#include -#include -#endif - -/* If you change this, change the Bases[] array below as well */ -#define MAX_HEADS 16 - -char *SDL_NAME(xdga_extension_name) = XF86DGANAME; - -static XExtensionInfo _xdga_info_data; -static XExtensionInfo *xdga_info = &_xdga_info_data; - - -Bool SDL_NAME(XDGAMapFramebuffer)(int, char *, unsigned char*, CARD32, CARD32, CARD32); -void SDL_NAME(XDGAUnmapFramebuffer)(int); -unsigned char* SDL_NAME(XDGAGetMappedMemory)(int); - -#define XDGACheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, SDL_NAME(xdga_extension_name), val) - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -static int xdga_close_display(Display *dpy, XExtCodes *codes); -static Bool xdga_wire_to_event(Display *dpy, XEvent *event, xEvent *wire_ev); -static Status xdga_event_to_wire(Display *dpy, XEvent *event, xEvent *wire_ev); - -static XExtensionHooks xdga_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - xdga_close_display, /* close_display */ - xdga_wire_to_event, /* wire_to_event */ - xdga_event_to_wire, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - -static XEXT_GENERATE_CLOSE_DISPLAY (xdga_close_display, xdga_info) - - -XEXT_GENERATE_FIND_DISPLAY (SDL_NAME(xdga_find_display), xdga_info, - "XFree86-DGA", - &xdga_extension_hooks, - 0, NULL) - - -static Status -xdga_event_to_wire( - Display *dpy, - XEvent *event, - xEvent *wire_ev -){ - return True; -} - -static Bool -xdga_wire_to_event( - Display *dpy, - XEvent *event, - xEvent *wire_ev -){ - dgaEvent *wire = (dgaEvent *) wire_ev; - SDL_NAME(XDGAButtonEvent) *bevent; - SDL_NAME(XDGAKeyEvent) *kevent; - SDL_NAME(XDGAMotionEvent) *mevent; - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - - XDGACheckExtension (dpy, info, False); - - switch((wire->u.u.type & 0x7f) - info->codes->first_event) { - case MotionNotify: - mevent = (SDL_NAME(XDGAMotionEvent)*)event; - mevent->type = wire->u.u.type & 0x7F; - mevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire); - mevent->display = dpy; - mevent->screen = wire->u.event.screen; - mevent->time = wire->u.event.time; - mevent->state = wire->u.event.state; - mevent->dx = wire->u.event.dx; - mevent->dy = wire->u.event.dy; - return True; - case ButtonPress: - case ButtonRelease: - bevent = (SDL_NAME(XDGAButtonEvent)*)event; - bevent->type = wire->u.u.type & 0x7F; - bevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire); - bevent->display = dpy; - bevent->screen = wire->u.event.screen; - bevent->time = wire->u.event.time; - bevent->state = wire->u.event.state; - bevent->button = wire->u.u.detail; - return True; - case KeyPress: - case KeyRelease: - kevent = (SDL_NAME(XDGAKeyEvent)*)event; - kevent->type = wire->u.u.type & 0x7F; - kevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire); - kevent->display = dpy; - kevent->screen = wire->u.event.screen; - kevent->time = wire->u.event.time; - kevent->state = wire->u.event.state; - kevent->keycode = wire->u.u.detail; - return True; - } - - return False; -} - - -Bool SDL_NAME(XDGAQueryExtension) ( - Display *dpy, - int *event_basep, - int *error_basep -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - - if (XextHasExtension(info)) { - *event_basep = info->codes->first_event; - *error_basep = info->codes->first_error; - return True; - } else { - return False; - } -} - - -Bool SDL_NAME(XDGAQueryVersion)( - Display *dpy, - int *majorVersion, - int *minorVersion -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGAQueryVersionReply rep; - xXDGAQueryVersionReq *req; - - XDGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XDGAQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGAQueryVersion; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *majorVersion = rep.majorVersion; - *minorVersion = rep.minorVersion; - UnlockDisplay(dpy); - SyncHandle(); - if (*majorVersion >= 2) - { - int i, j; - - for (i = 0, j = info->codes->first_event; - i < XF86DGANumberEvents; - i++, j++) - { - XESetWireToEvent(dpy, j, xdga_wire_to_event); - XESetEventToWire(dpy, j, xdga_event_to_wire); - } - SDL_NAME(XDGASetClientVersion)(dpy); - } - return True; -} - -Bool SDL_NAME(XDGASetClientVersion)( - Display *dpy -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGASetClientVersionReq *req; - - XDGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XDGASetClientVersion, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGASetClientVersion; - req->major = XDGA_MAJOR_VERSION; - req->minor = XDGA_MINOR_VERSION; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool SDL_NAME(XDGAOpenFramebuffer)( - Display *dpy, - int screen -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGAOpenFramebufferReply rep; - xXDGAOpenFramebufferReq *req; - char *deviceName = NULL; - Bool ret; - - XDGACheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XDGAOpenFramebuffer, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGAOpenFramebuffer; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - - if(rep.length) { - deviceName = Xmalloc(rep.length << 2); - _XRead(dpy, deviceName, rep.length << 2); - } - - ret = SDL_NAME(XDGAMapFramebuffer)(screen, deviceName, - (unsigned char*)(long)rep.mem1, - rep.size, rep.offset, rep.extra); - - if(deviceName) - Xfree(deviceName); - - UnlockDisplay(dpy); - SyncHandle(); - return ret; -} - -void SDL_NAME(XDGACloseFramebuffer)( - Display *dpy, - int screen -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGACloseFramebufferReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - SDL_NAME(XDGAUnmapFramebuffer)(screen); - - LockDisplay(dpy); - GetReq(XDGACloseFramebuffer, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGACloseFramebuffer; - req->screen = screen; - UnlockDisplay(dpy); - SyncHandle(); -} - - - -SDL_NAME(XDGAMode)* SDL_NAME(XDGAQueryModes)( - Display *dpy, - int screen, - int *num -){ - XExtDisplayInfo *dinfo = SDL_NAME(xdga_find_display) (dpy); - xXDGAQueryModesReply rep; - xXDGAQueryModesReq *req; - SDL_NAME(XDGAMode) *modes = NULL; - - *num = 0; - - XDGACheckExtension (dpy, dinfo, NULL); - - LockDisplay(dpy); - GetReq(XDGAQueryModes, req); - req->reqType = dinfo->codes->major_opcode; - req->dgaReqType = X_XDGAQueryModes; - req->screen = screen; - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - if(rep.length) { - xXDGAModeInfo info; - int i, size; - char *offset; - - size = rep.length << 2; - size -= rep.number * sz_xXDGAModeInfo; /* find text size */ - modes = (SDL_NAME(XDGAMode)*)Xmalloc((rep.number * sizeof(SDL_NAME(XDGAMode))) + size); - offset = (char*)(&modes[rep.number]); /* start of text */ - - - if(modes) { - for(i = 0; i < rep.number; i++) { - _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo); - - modes[i].num = info.num; - modes[i].verticalRefresh = - (float)info.vsync_num / (float)info.vsync_den; - modes[i].flags = info.flags; - modes[i].imageWidth = info.image_width; - modes[i].imageHeight = info.image_height; - modes[i].pixmapWidth = info.pixmap_width; - modes[i].pixmapHeight = info.pixmap_height; - modes[i].bytesPerScanline = info.bytes_per_scanline; - modes[i].byteOrder = info.byte_order; - modes[i].depth = info.depth; - modes[i].bitsPerPixel = info.bpp; - modes[i].redMask = info.red_mask; - modes[i].greenMask = info.green_mask; - modes[i].blueMask = info.blue_mask; - modes[i].visualClass = info.visual_class; - modes[i].viewportWidth = info.viewport_width; - modes[i].viewportHeight = info.viewport_height; - modes[i].xViewportStep = info.viewport_xstep; - modes[i].yViewportStep = info.viewport_ystep; - modes[i].maxViewportX = info.viewport_xmax; - modes[i].maxViewportY = info.viewport_ymax; - modes[i].viewportFlags = info.viewport_flags; - modes[i].reserved1 = info.reserved1; - modes[i].reserved2 = info.reserved2; - - _XRead(dpy, offset, info.name_size); - modes[i].name = offset; - offset += info.name_size; - } - *num = rep.number; - } else - _XEatData(dpy, rep.length << 2); - } - } - - UnlockDisplay(dpy); - SyncHandle(); - - return modes; -} - - -SDL_NAME(XDGADevice) * -SDL_NAME(XDGASetMode)( - Display *dpy, - int screen, - int mode -){ - XExtDisplayInfo *dinfo = SDL_NAME(xdga_find_display) (dpy); - xXDGASetModeReply rep; - xXDGASetModeReq *req; - SDL_NAME(XDGADevice) *dev = NULL; - Pixmap pid; - - XDGACheckExtension (dpy, dinfo, NULL); - - LockDisplay(dpy); - GetReq(XDGASetMode, req); - req->reqType = dinfo->codes->major_opcode; - req->dgaReqType = X_XDGASetMode; - req->screen = screen; - req->mode = mode; - req->pid = pid = XAllocID(dpy); - - if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - if(rep.length) { - xXDGAModeInfo info; - int size; - - size = rep.length << 2; - size -= sz_xXDGAModeInfo; /* get text size */ - - dev = (SDL_NAME(XDGADevice)*)Xmalloc(sizeof(SDL_NAME(XDGADevice)) + size); - - if(dev) { - _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo); - - dev->mode.num = info.num; - dev->mode.verticalRefresh = - (float)info.vsync_num / (float)info.vsync_den; - dev->mode.flags = info.flags; - dev->mode.imageWidth = info.image_width; - dev->mode.imageHeight = info.image_height; - dev->mode.pixmapWidth = info.pixmap_width; - dev->mode.pixmapHeight = info.pixmap_height; - dev->mode.bytesPerScanline = info.bytes_per_scanline; - dev->mode.byteOrder = info.byte_order; - dev->mode.depth = info.depth; - dev->mode.bitsPerPixel = info.bpp; - dev->mode.redMask = info.red_mask; - dev->mode.greenMask = info.green_mask; - dev->mode.blueMask = info.blue_mask; - dev->mode.visualClass = info.visual_class; - dev->mode.viewportWidth = info.viewport_width; - dev->mode.viewportHeight = info.viewport_height; - dev->mode.xViewportStep = info.viewport_xstep; - dev->mode.yViewportStep = info.viewport_ystep; - dev->mode.maxViewportX = info.viewport_xmax; - dev->mode.maxViewportY = info.viewport_ymax; - dev->mode.viewportFlags = info.viewport_flags; - dev->mode.reserved1 = info.reserved1; - dev->mode.reserved2 = info.reserved2; - - dev->mode.name = (char*)(&dev[1]); - _XRead(dpy, dev->mode.name, info.name_size); - - dev->pixmap = (rep.flags & XDGAPixmap) ? pid : 0; - dev->data = SDL_NAME(XDGAGetMappedMemory)(screen); - - if(dev->data) - dev->data += rep.offset; - } - /* not sure what to do if the allocation fails */ - } - } - - UnlockDisplay(dpy); - SyncHandle(); - - return dev; -} - - -void SDL_NAME(XDGASetViewport)( - Display *dpy, - int screen, - int x, - int y, - int flags -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGASetViewportReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGASetViewport, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGASetViewport; - req->screen = screen; - req->x = x; - req->y = y; - req->flags = flags; - UnlockDisplay(dpy); - SyncHandle(); -} - - -void SDL_NAME(XDGAInstallColormap)( - Display *dpy, - int screen, - Colormap cmap -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGAInstallColormapReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGAInstallColormap, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGAInstallColormap; - req->screen = screen; - req->cmap = cmap; - UnlockDisplay(dpy); - SyncHandle(); -} - -void SDL_NAME(XDGASelectInput)( - Display *dpy, - int screen, - long mask -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGASelectInputReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGASelectInput, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGASelectInput; - req->screen = screen; - req->mask = mask; - UnlockDisplay(dpy); - SyncHandle(); -} - -void SDL_NAME(XDGAFillRectangle)( - Display *dpy, - int screen, - int x, - int y, - unsigned int width, - unsigned int height, - unsigned long color -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGAFillRectangleReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGAFillRectangle, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGAFillRectangle; - req->screen = screen; - req->x = x; - req->y = y; - req->width = width; - req->height = height; - req->color = color; - UnlockDisplay(dpy); - SyncHandle(); -} - -void SDL_NAME(XDGACopyArea)( - Display *dpy, - int screen, - int srcx, - int srcy, - unsigned int width, - unsigned int height, - int dstx, - int dsty -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGACopyAreaReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGACopyArea, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGACopyArea; - req->screen = screen; - req->srcx = srcx; - req->srcy = srcy; - req->width = width; - req->height = height; - req->dstx = dstx; - req->dsty = dsty; - UnlockDisplay(dpy); - SyncHandle(); -} - -void SDL_NAME(XDGACopyTransparentArea)( - Display *dpy, - int screen, - int srcx, - int srcy, - unsigned int width, - unsigned int height, - int dstx, - int dsty, - unsigned long key -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGACopyTransparentAreaReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGACopyTransparentArea, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGACopyTransparentArea; - req->screen = screen; - req->srcx = srcx; - req->srcy = srcy; - req->width = width; - req->height = height; - req->dstx = dstx; - req->dsty = dsty; - req->key = key; - UnlockDisplay(dpy); - SyncHandle(); -} - - -int SDL_NAME(XDGAGetViewportStatus)( - Display *dpy, - int screen -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGAGetViewportStatusReply rep; - xXDGAGetViewportStatusReq *req; - int status = 0; - - XDGACheckExtension (dpy, info, 0); - - LockDisplay(dpy); - GetReq(XDGAGetViewportStatus, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGAGetViewportStatus; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) - status = rep.status; - UnlockDisplay(dpy); - SyncHandle(); - return status; -} - -void SDL_NAME(XDGASync)( - Display *dpy, - int screen -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGASyncReply rep; - xXDGASyncReq *req; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGASync, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGASync; - req->screen = screen; - _XReply(dpy, (xReply *)&rep, 0, xFalse); - UnlockDisplay(dpy); - SyncHandle(); -} - - -void SDL_NAME(XDGAChangePixmapMode)( - Display *dpy, - int screen, - int *x, - int *y, - int mode -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGAChangePixmapModeReq *req; - xXDGAChangePixmapModeReply rep; - - XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name)); - - LockDisplay(dpy); - GetReq(XDGAChangePixmapMode, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGAChangePixmapMode; - req->screen = screen; - req->x = *x; - req->y = *y; - req->flags = mode; - _XReply(dpy, (xReply *)&rep, 0, xFalse); - *x = rep.x; - *y = rep.y; - UnlockDisplay(dpy); - SyncHandle(); -} - -Colormap SDL_NAME(XDGACreateColormap)( - Display *dpy, - int screen, - SDL_NAME(XDGADevice) *dev, - int alloc -){ - XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy); - xXDGACreateColormapReq *req; - Colormap cid; - - XDGACheckExtension (dpy, info, -1); - - LockDisplay(dpy); - GetReq(XDGACreateColormap, req); - req->reqType = info->codes->major_opcode; - req->dgaReqType = X_XDGACreateColormap; - req->screen = screen; - req->mode = dev->mode.num; - req->alloc = alloc; - cid = req->id = XAllocID(dpy); - UnlockDisplay(dpy); - SyncHandle(); - - return cid; -} - - -void SDL_NAME(XDGAKeyEventToXKeyEvent)( - SDL_NAME(XDGAKeyEvent)* dk, - XKeyEvent* xk -){ - xk->type = dk->type; - xk->serial = dk->serial; - xk->send_event = False; - xk->display = dk->display; - xk->window = RootWindow(dk->display, dk->screen); - xk->root = xk->window; - xk->subwindow = None; - xk->time = dk->time; - xk->x = xk->y = xk->x_root = xk->y_root = 0; - xk->state = dk->state; - xk->keycode = dk->keycode; - xk->same_screen = True; -} - -#include -#include -#include -#include -#if defined(ISC) -# define HAS_SVR3_MMAP -# include -# include - -# include -# include - -# include -# include -# include - -# include -#else -# if !defined(Lynx) -# if !defined(__EMX__) -# include -# endif -# else -# include -# include -# include -# endif -#endif -#include -#include -#include - -#if defined(SVR4) && !defined(sun) && !defined(SCO325) -#define DEV_MEM "/dev/pmem" -#elif defined(SVR4) && defined(sun) -#define DEV_MEM "/dev/xsvc" -#else -#define DEV_MEM "/dev/mem" -#endif - - - -typedef struct _DGAMapRec{ - unsigned char *physical; - unsigned char *virtual; - CARD32 size; - int fd; - int screen; - struct _DGAMapRec *next; -} DGAMapRec, *DGAMapPtr; - -static Bool -DGAMapPhysical(int, char*, unsigned char*, CARD32, CARD32, CARD32, DGAMapPtr); -static void DGAUnmapPhysical(DGAMapPtr); - -static DGAMapPtr _Maps = NULL; - - -unsigned char* -SDL_NAME(XDGAGetMappedMemory)(int screen) -{ - DGAMapPtr pMap = _Maps; - unsigned char *pntr = NULL; - - while(pMap != NULL) { - if(pMap->screen == screen) { - pntr = pMap->virtual; - break; - } - pMap = pMap->next; - } - - return pntr; -} - -Bool -SDL_NAME(XDGAMapFramebuffer)( - int screen, - char *name, /* optional device name */ - unsigned char* base, /* physical memory */ - CARD32 size, /* size */ - CARD32 offset, /* optional offset */ - CARD32 extra /* optional extra data */ -){ - DGAMapPtr pMap = _Maps; - Bool result; - - /* is it already mapped ? */ - while(pMap != NULL) { - if(pMap->screen == screen) - return True; - pMap = pMap->next; - } - - if(extra & XDGANeedRoot) { - /* we should probably check if we have root permissions and - return False here */ - - } - - pMap = (DGAMapPtr)Xmalloc(sizeof(DGAMapRec)); - - result = DGAMapPhysical(screen, name, base, size, offset, extra, pMap); - - if(result) { - pMap->next = _Maps; - _Maps = pMap; - } else - Xfree(pMap); - - return result; -} - -void -SDL_NAME(XDGAUnmapFramebuffer)(int screen) -{ - DGAMapPtr pMap = _Maps; - DGAMapPtr pPrev = NULL; - - /* is it already mapped */ - while(pMap != NULL) { - if(pMap->screen == screen) - break; - pPrev = pMap; - pMap = pMap->next; - } - - if(!pMap) - return; - - DGAUnmapPhysical(pMap); - - if(!pPrev) - _Maps = pMap->next; - else - pPrev->next = pMap->next; - - Xfree(pMap); -} - - -static Bool -DGAMapPhysical( - int screen, - char *name, /* optional device name */ - unsigned char* base, /* physical memory */ - CARD32 size, /* size */ - CARD32 offset, /* optional offset */ - CARD32 extra, /* optional extra data */ - DGAMapPtr pMap -) { -#if defined(ISC) && defined(HAS_SVR3_MMAP) - struct kd_memloc mloc; -#elif defined(__EMX__) - APIRET rc; - ULONG action; - HFILE hfd; -#endif - - base += offset; - - pMap->screen = screen; - pMap->physical = base; - pMap->size = size; - -#if defined(ISC) && defined(HAS_SVR3_MMAP) - if ((pMap->fd = open("/dev/mmap", O_RDWR)) < 0) - return False; - mloc.vaddr = (char *)0; - mloc.physaddr = (char *)base; - mloc.length = size; - mloc.ioflg=1; - - if ((pMap->virtual = (void *)ioctl(pMap->fd, MAP, &mloc)) == (void *)-1) - return False; -#elif defined (__EMX__) - /* - * Dragon warning here! /dev/pmap$ is never closed, except on progam exit. - * Consecutive calling of this routine will make PMAP$ driver run out - * of memory handles. Some umap/close mechanism should be provided - */ - - rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN, - OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL); - if (rc != 0) - return False; - { - struct map_ioctl { - union { - ULONG phys; - void* user; - } a; - ULONG size; - } pmap,dmap; - ULONG plen,dlen; -#define XFREE86_PMAP 0x76 -#define PMAP_MAP 0x44 - - pmap.a.phys = base; - pmap.size = size; - rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP, - (PULONG)&pmap, sizeof(pmap), &plen, - (PULONG)&dmap, sizeof(dmap), &dlen); - if (rc == 0) { - pMap->virtual = dmap.a.user; - } - } - if (rc != 0) - return False; -#elif defined (Lynx) - pMap->virtual = smem_create("XF86DGA", (char*)base, size, SM_READ|SM_WRITE); -#else -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif - if (!name) - name = DEV_MEM; - if ((pMap->fd = open(name, O_RDWR)) < 0) -#if defined(ENABLE_FBCON) - { /* /dev/fb0 fallback added by Sam Lantinga */ - /* Try to fall back to /dev/fb on Linux - FIXME: verify the device */ - struct fb_fix_screeninfo finfo; - - if ((pMap->fd = open("/dev/fb0", O_RDWR)) < 0) { - return False; - } - /* The useable framebuffer console memory may not be the whole - framebuffer that X has access to. :-( - */ - if ( ioctl(pMap->fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) { - close(pMap->fd); - return False; - } - /* Warning: On PPC, the size and virtual need to be offset by: - (((long)finfo.smem_start) - - (((long)finfo.smem_start)&~(PAGE_SIZE-1))) - */ - base = 0; - size = pMap->size = finfo.smem_len; - } -#else - return False; -#endif - pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE, - MAP_FILE | MAP_SHARED, pMap->fd, (off_t)((size_t)base)); - if (pMap->virtual == (void *)-1) - return False; -#endif - -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \ - && !defined(__EMX__) - mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE); -#endif - - return True; -} - - - -static void -DGAUnmapPhysical(DGAMapPtr pMap) -{ -#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \ - && !defined(__EMX__) - mprotect(pMap->virtual,pMap->size, PROT_READ); -#elif defined(Lynx) - /* XXX this doesn't allow enable after disable */ - smem_create(NULL, pMap->virtual, pMap->size, SM_DETACH); - smem_remove("XF86DGA"); -#endif - - - /* We need to unmap and close too !!!!!!!!!!*/ -} diff --git a/src/video/Xext/Xxf86vm/XF86VMode.c b/src/video/Xext/Xxf86vm/XF86VMode.c deleted file mode 100644 index 5cb21905af..0000000000 --- a/src/video/Xext/Xxf86vm/XF86VMode.c +++ /dev/null @@ -1,1226 +0,0 @@ -/* $XConsortium: XF86VMode.c /main/2 1995/11/14 18:17:58 kaleb $ */ -/* $XFree86: xc/lib/Xxf86vm/XF86VMode.c,v 3.32 2001/07/25 15:04:54 dawes Exp $ */ -/* - -Copyright (c) 1995 Kaleb S. KEITHLEY - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Kaleb S. KEITHLEY -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -from Kaleb S. KEITHLEY. - -*/ -/* $XConsortium: XF86VMode.c /main/4 1996/01/16 07:52:25 kaleb CHECKEDOUT $ */ - -/* THIS IS NOT AN X CONSORTIUM STANDARD */ - -#define NEED_EVENTS -#define NEED_REPLIES - -#ifndef XBUILD_IN_CLIENT -/* Apparently some X11 systems can't include this multiple times... */ -#ifndef SDL_INCLUDED_XLIBINT_H -#define SDL_INCLUDED_XLIBINT_H 1 -#include -#endif -#include "../extensions/xf86vmstr.h" -#include "../extensions/Xext.h" -#include "../extensions/extutil.h" -#else -#include "include/extensions/xf86vmstr.h" -#include "include/extensions/Xext.h" -#include "include/extensions/extutil.h" -#endif - -#ifdef DEBUG -#include -#endif - -#ifndef MODE_BAD -#define MODE_BAD 255 -#endif - -static XExtensionInfo _xf86vidmode_info_data; -static XExtensionInfo *xf86vidmode_info = &_xf86vidmode_info_data; -static char *xf86vidmode_extension_name = XF86VIDMODENAME; - -#define XF86VidModeCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, xf86vidmode_extension_name, val) - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -static XEXT_CLOSE_DISPLAY_PROTO(close_display); -static /* const */ XExtensionHooks xf86vidmode_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - -static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86vidmode_info, - xf86vidmode_extension_name, - &xf86vidmode_extension_hooks, - 0, NULL) - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86vidmode_info) - - -/***************************************************************************** - * * - * public XFree86-VidMode Extension routines * - * * - *****************************************************************************/ - -Bool -SDL_NAME(XF86VidModeQueryExtension) (dpy, event_basep, error_basep) - Display *dpy; - int *event_basep, *error_basep; -{ - XExtDisplayInfo *info = find_display (dpy); - - if (XextHasExtension(info)) { - *event_basep = info->codes->first_event; - *error_basep = info->codes->first_error; - return True; - } else { - return False; - } -} - -Bool -SDL_NAME(XF86VidModeQueryVersion)(dpy, majorVersion, minorVersion) - Display* dpy; - int* majorVersion; - int* minorVersion; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeQueryVersionReply rep; - xXF86VidModeQueryVersionReq *req; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeQueryVersion; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *majorVersion = rep.majorVersion; - *minorVersion = rep.minorVersion; - UnlockDisplay(dpy); - SyncHandle(); - if (*majorVersion >= 2) - SDL_NAME(XF86VidModeSetClientVersion)(dpy); - return True; -} - -Bool -SDL_NAME(XF86VidModeSetClientVersion)(Display *dpy) -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86VidModeSetClientVersionReq *req; - - XF86VidModeCheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeSetClientVersion, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeSetClientVersion; - req->major = XF86VIDMODE_MAJOR_VERSION; - req->minor = XF86VIDMODE_MINOR_VERSION; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeSetGamma)(Display *dpy, int screen, SDL_NAME(XF86VidModeGamma) *Gamma) -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86VidModeSetGammaReq *req; - - XF86VidModeCheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeSetGamma, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeSetGamma; - req->screen = screen; - req->red = (CARD32)(Gamma->red * 10000.); - req->green = (CARD32)(Gamma->green * 10000.); - req->blue = (CARD32)(Gamma->blue * 10000.); - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeGetGamma)(Display *dpy, int screen, SDL_NAME(XF86VidModeGamma) *Gamma) -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetGammaReply rep; - xXF86VidModeGetGammaReq *req; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeGetGamma, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetGamma; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - Gamma->red = ((float)rep.red) / 10000.; - Gamma->green = ((float)rep.green) / 10000.; - Gamma->blue = ((float)rep.blue) / 10000.; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeGetModeLine)(dpy, screen, dotclock, modeline) - Display* dpy; - int screen; - int* dotclock; - SDL_NAME(XF86VidModeModeLine)* modeline; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetModeLineReply rep; - xXF86OldVidModeGetModeLineReply oldrep; - xXF86VidModeGetModeLineReq *req; - int majorVersion, minorVersion; - - XF86VidModeCheckExtension (dpy, info, False); - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - - LockDisplay(dpy); - GetReq(XF86VidModeGetModeLine, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetModeLine; - req->screen = screen; - - if (majorVersion < 2) { - if (!_XReply(dpy, (xReply *)&oldrep, - (SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *dotclock = oldrep.dotclock; - modeline->hdisplay = oldrep.hdisplay; - modeline->hsyncstart = oldrep.hsyncstart; - modeline->hsyncend = oldrep.hsyncend; - modeline->htotal = oldrep.htotal; - modeline->hskew = 0; - modeline->vdisplay = oldrep.vdisplay; - modeline->vsyncstart = oldrep.vsyncstart; - modeline->vsyncend = oldrep.vsyncend; - modeline->vtotal = oldrep.vtotal; - modeline->flags = oldrep.flags; - modeline->privsize = oldrep.privsize; - } else { - if (!_XReply(dpy, (xReply *)&rep, - (SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *dotclock = rep.dotclock; - modeline->hdisplay = rep.hdisplay; - modeline->hsyncstart = rep.hsyncstart; - modeline->hsyncend = rep.hsyncend; - modeline->htotal = rep.htotal; - modeline->hskew = rep.hskew; - modeline->vdisplay = rep.vdisplay; - modeline->vsyncstart = rep.vsyncstart; - modeline->vsyncend = rep.vsyncend; - modeline->vtotal = rep.vtotal; - modeline->flags = rep.flags; - modeline->privsize = rep.privsize; - } - - if (modeline->privsize > 0) { - if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) { - _XEatData(dpy, (modeline->privsize) * sizeof(INT32)); - Xfree(modeline->private); - return False; - } - _XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32)); - } else { - modeline->private = NULL; - } - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeGetAllModeLines)(dpy, screen, modecount, modelinesPtr) - Display* dpy; - int screen; - int* modecount; - SDL_NAME(XF86VidModeModeInfo) ***modelinesPtr; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetAllModeLinesReply rep; - xXF86VidModeGetAllModeLinesReq *req; - SDL_NAME(XF86VidModeModeInfo) *mdinfptr, **modelines; - xXF86VidModeModeInfo xmdline; - xXF86OldVidModeModeInfo oldxmdline; - int i; - int majorVersion, minorVersion; - Bool protocolBug = False; - - XF86VidModeCheckExtension (dpy, info, False); - - /* - * Note: There was a bug in the protocol implementation in versions - * 0.x with x < 8 (the .private field wasn't being passed over the wire). - * Check the server's version, and accept the old format if appropriate. - */ - - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - if (majorVersion == 0 && minorVersion < 8) { - protocolBug = True; -#ifdef DEBUG - fprintf(stderr, "XF86VidModeGetAllModeLines: Warning: Xserver is" - "running an old version (%d.%d)\n", majorVersion, - minorVersion); -#endif - } - - LockDisplay(dpy); - GetReq(XF86VidModeGetAllModeLines, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetAllModeLines; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, - (SIZEOF(xXF86VidModeGetAllModeLinesReply) - SIZEOF(xReply)) >> 2, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - - *modecount = rep.modecount; - - if (!(modelines = (SDL_NAME(XF86VidModeModeInfo) **) Xcalloc(rep.modecount, - sizeof(SDL_NAME(XF86VidModeModeInfo) *) - +sizeof(SDL_NAME(XF86VidModeModeInfo))))) { - if (majorVersion < 2) - _XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo)); - else - _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo)); - Xfree(modelines); - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - mdinfptr = (SDL_NAME(XF86VidModeModeInfo) *) ( - (char *) modelines - + rep.modecount*sizeof(SDL_NAME(XF86VidModeModeInfo) *) - ); - - for (i = 0; i < rep.modecount; i++) { - modelines[i] = mdinfptr++; - if (majorVersion < 2) { - _XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo)); - modelines[i]->dotclock = oldxmdline.dotclock; - modelines[i]->hdisplay = oldxmdline.hdisplay; - modelines[i]->hsyncstart = oldxmdline.hsyncstart; - modelines[i]->hsyncend = oldxmdline.hsyncend; - modelines[i]->htotal = oldxmdline.htotal; - modelines[i]->hskew = 0; - modelines[i]->vdisplay = oldxmdline.vdisplay; - modelines[i]->vsyncstart = oldxmdline.vsyncstart; - modelines[i]->vsyncend = oldxmdline.vsyncend; - modelines[i]->vtotal = oldxmdline.vtotal; - modelines[i]->flags = oldxmdline.flags; - if (protocolBug) { - modelines[i]->privsize = 0; - modelines[i]->private = NULL; - } else { - modelines[i]->privsize = oldxmdline.privsize; - if (oldxmdline.privsize > 0) { - if (!(modelines[i]->private = - Xcalloc(oldxmdline.privsize, sizeof(INT32)))) { - _XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32)); - Xfree(modelines[i]->private); - } else { - _XRead(dpy, (char*)modelines[i]->private, - oldxmdline.privsize * sizeof(INT32)); - } - } else { - modelines[i]->private = NULL; - } - } - } else { - _XRead(dpy, (char*)&xmdline, sizeof(xXF86VidModeModeInfo)); - modelines[i]->dotclock = xmdline.dotclock; - modelines[i]->hdisplay = xmdline.hdisplay; - modelines[i]->hsyncstart = xmdline.hsyncstart; - modelines[i]->hsyncend = xmdline.hsyncend; - modelines[i]->htotal = xmdline.htotal; - modelines[i]->hskew = xmdline.hskew; - modelines[i]->vdisplay = xmdline.vdisplay; - modelines[i]->vsyncstart = xmdline.vsyncstart; - modelines[i]->vsyncend = xmdline.vsyncend; - modelines[i]->vtotal = xmdline.vtotal; - modelines[i]->flags = xmdline.flags; - if (protocolBug) { - modelines[i]->privsize = 0; - modelines[i]->private = NULL; - } else { - modelines[i]->privsize = xmdline.privsize; - if (xmdline.privsize > 0) { - if (!(modelines[i]->private = - Xcalloc(xmdline.privsize, sizeof(INT32)))) { - _XEatData(dpy, (xmdline.privsize) * sizeof(INT32)); - Xfree(modelines[i]->private); - } else { - _XRead(dpy, (char*)modelines[i]->private, - xmdline.privsize * sizeof(INT32)); - } - } else { - modelines[i]->private = NULL; - } - } - } - } - *modelinesPtr = modelines; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -/* - * GetReq replacement for use with VidMode protocols earlier than 2.0 - */ -#if !defined(UNIXCPP) || defined(ANSICPP) -#define GetOldReq(name, oldname, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##oldname##Req))>>2;\ - dpy->bufptr += SIZEOF(x##oldname##Req);\ - dpy->request++ - -#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ -#define GetOldReq(name, oldname, req) \ - WORD64ALIGN\ - if ((dpy->bufptr + SIZEOF(x/**/oldname/**/Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/oldname/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/oldname/**/Req))>>2;\ - dpy->bufptr += SIZEOF(x/**/oldname/**/Req);\ - dpy->request++ -#endif - -Bool -SDL_NAME(XF86VidModeAddModeLine) (dpy, screen, newmodeline, aftermodeline) - Display *dpy; - int screen; - SDL_NAME(XF86VidModeModeInfo)* newmodeline; - SDL_NAME(XF86VidModeModeInfo)* aftermodeline; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeAddModeLineReq *req; - xXF86OldVidModeAddModeLineReq *oldreq; - int majorVersion, minorVersion; - - XF86VidModeCheckExtension (dpy, info, False); - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - - LockDisplay(dpy); - if (majorVersion < 2) { - GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq); - oldreq->reqType = info->codes->major_opcode; - oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine; - oldreq->screen = screen; - oldreq->dotclock = newmodeline->dotclock; - oldreq->hdisplay = newmodeline->hdisplay; - oldreq->hsyncstart = newmodeline->hsyncstart; - oldreq->hsyncend = newmodeline->hsyncend; - oldreq->htotal = newmodeline->htotal; - oldreq->vdisplay = newmodeline->vdisplay; - oldreq->vsyncstart = newmodeline->vsyncstart; - oldreq->vsyncend = newmodeline->vsyncend; - oldreq->vtotal = newmodeline->vtotal; - oldreq->flags = newmodeline->flags; - oldreq->privsize = newmodeline->privsize; - if (aftermodeline != NULL) { - oldreq->after_dotclock = aftermodeline->dotclock; - oldreq->after_hdisplay = aftermodeline->hdisplay; - oldreq->after_hsyncstart = aftermodeline->hsyncstart; - oldreq->after_hsyncend = aftermodeline->hsyncend; - oldreq->after_htotal = aftermodeline->htotal; - oldreq->after_vdisplay = aftermodeline->vdisplay; - oldreq->after_vsyncstart = aftermodeline->vsyncstart; - oldreq->after_vsyncend = aftermodeline->vsyncend; - oldreq->after_vtotal = aftermodeline->vtotal; - oldreq->after_flags = aftermodeline->flags; - } else { - oldreq->after_dotclock = 0; - oldreq->after_hdisplay = 0; - oldreq->after_hsyncstart = 0; - oldreq->after_hsyncend = 0; - oldreq->after_htotal = 0; - oldreq->after_vdisplay = 0; - oldreq->after_vsyncstart = 0; - oldreq->after_vsyncend = 0; - oldreq->after_vtotal = 0; - oldreq->after_flags = 0; - } - if (newmodeline->privsize) { - oldreq->length += newmodeline->privsize; - Data32(dpy, (long *) newmodeline->private, - newmodeline->privsize * sizeof(INT32)); - } - } else { - GetReq(XF86VidModeAddModeLine, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeAddModeLine; - req->screen = screen; - req->dotclock = newmodeline->dotclock; - req->hdisplay = newmodeline->hdisplay; - req->hsyncstart = newmodeline->hsyncstart; - req->hsyncend = newmodeline->hsyncend; - req->htotal = newmodeline->htotal; - req->hskew = newmodeline->hskew; - req->vdisplay = newmodeline->vdisplay; - req->vsyncstart = newmodeline->vsyncstart; - req->vsyncend = newmodeline->vsyncend; - req->vtotal = newmodeline->vtotal; - req->flags = newmodeline->flags; - req->privsize = newmodeline->privsize; - if (aftermodeline != NULL) { - req->after_dotclock = aftermodeline->dotclock; - req->after_hdisplay = aftermodeline->hdisplay; - req->after_hsyncstart = aftermodeline->hsyncstart; - req->after_hsyncend = aftermodeline->hsyncend; - req->after_htotal = aftermodeline->htotal; - req->after_hskew = aftermodeline->hskew; - req->after_vdisplay = aftermodeline->vdisplay; - req->after_vsyncstart = aftermodeline->vsyncstart; - req->after_vsyncend = aftermodeline->vsyncend; - req->after_vtotal = aftermodeline->vtotal; - req->after_flags = aftermodeline->flags; - } else { - req->after_dotclock = 0; - req->after_hdisplay = 0; - req->after_hsyncstart = 0; - req->after_hsyncend = 0; - req->after_htotal = 0; - req->after_hskew = 0; - req->after_vdisplay = 0; - req->after_vsyncstart = 0; - req->after_vsyncend = 0; - req->after_vtotal = 0; - req->after_flags = 0; - } - if (newmodeline->privsize) { - req->length += newmodeline->privsize; - Data32(dpy, (long *) newmodeline->private, - newmodeline->privsize * sizeof(INT32)); - } - } - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeDeleteModeLine) (dpy, screen, modeline) - Display *dpy; - int screen; - SDL_NAME(XF86VidModeModeInfo)* modeline; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeDeleteModeLineReq *req; - xXF86OldVidModeDeleteModeLineReq *oldreq; - int majorVersion, minorVersion; - - XF86VidModeCheckExtension (dpy, info, 0); - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - - LockDisplay(dpy); - if (majorVersion < 2) { - GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine, oldreq); - oldreq->reqType = info->codes->major_opcode; - oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine; - oldreq->screen = screen; - oldreq->dotclock = modeline->dotclock; - oldreq->hdisplay = modeline->hdisplay; - oldreq->hsyncstart = modeline->hsyncstart; - oldreq->hsyncend = modeline->hsyncend; - oldreq->htotal = modeline->htotal; - oldreq->vdisplay = modeline->vdisplay; - oldreq->vsyncstart = modeline->vsyncstart; - oldreq->vsyncend = modeline->vsyncend; - oldreq->vtotal = modeline->vtotal; - oldreq->flags = modeline->flags; - oldreq->privsize = modeline->privsize; - if (modeline->privsize) { - oldreq->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } else { - GetReq(XF86VidModeDeleteModeLine, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine; - req->screen = screen; - req->dotclock = modeline->dotclock; - req->hdisplay = modeline->hdisplay; - req->hsyncstart = modeline->hsyncstart; - req->hsyncend = modeline->hsyncend; - req->htotal = modeline->htotal; - req->hskew = modeline->hskew; - req->vdisplay = modeline->vdisplay; - req->vsyncstart = modeline->vsyncstart; - req->vsyncend = modeline->vsyncend; - req->vtotal = modeline->vtotal; - req->flags = modeline->flags; - req->privsize = modeline->privsize; - if (modeline->privsize) { - req->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeModModeLine) (dpy, screen, modeline) - Display *dpy; - int screen; - SDL_NAME(XF86VidModeModeLine)* modeline; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeModModeLineReq *req; - xXF86OldVidModeModModeLineReq *oldreq; - int majorVersion, minorVersion; - - XF86VidModeCheckExtension (dpy, info, 0); - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - - LockDisplay(dpy); - if (majorVersion < 2) { - GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq); - oldreq->reqType = info->codes->major_opcode; - oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine; - oldreq->screen = screen; - oldreq->hdisplay = modeline->hdisplay; - oldreq->hsyncstart = modeline->hsyncstart; - oldreq->hsyncend = modeline->hsyncend; - oldreq->htotal = modeline->htotal; - oldreq->vdisplay = modeline->vdisplay; - oldreq->vsyncstart = modeline->vsyncstart; - oldreq->vsyncend = modeline->vsyncend; - oldreq->vtotal = modeline->vtotal; - oldreq->flags = modeline->flags; - oldreq->privsize = modeline->privsize; - if (modeline->privsize) { - oldreq->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } else { - GetReq(XF86VidModeModModeLine, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeModModeLine; - req->screen = screen; - req->hdisplay = modeline->hdisplay; - req->hsyncstart = modeline->hsyncstart; - req->hsyncend = modeline->hsyncend; - req->htotal = modeline->htotal; - req->hskew = modeline->hskew; - req->vdisplay = modeline->vdisplay; - req->vsyncstart = modeline->vsyncstart; - req->vsyncend = modeline->vsyncend; - req->vtotal = modeline->vtotal; - req->flags = modeline->flags; - req->privsize = modeline->privsize; - if (modeline->privsize) { - req->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Status -SDL_NAME(XF86VidModeValidateModeLine) (dpy, screen, modeline) - Display *dpy; - int screen; - SDL_NAME(XF86VidModeModeInfo)* modeline; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeValidateModeLineReq *req; - xXF86OldVidModeValidateModeLineReq *oldreq; - xXF86VidModeValidateModeLineReply rep; - int majorVersion, minorVersion; - - XF86VidModeCheckExtension (dpy, info, 0); - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - - LockDisplay(dpy); - - if (majorVersion < 2) { - GetOldReq(XF86VidModeValidateModeLine, XF86OldVidModeValidateModeLine, oldreq); - oldreq->reqType = info->codes->major_opcode; - oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine; - oldreq->screen = screen; - oldreq->dotclock = modeline->dotclock; - oldreq->hdisplay = modeline->hdisplay; - oldreq->hsyncstart = modeline->hsyncstart; - oldreq->hsyncend = modeline->hsyncend; - oldreq->htotal = modeline->htotal; - oldreq->vdisplay = modeline->vdisplay; - oldreq->vsyncstart = modeline->vsyncstart; - oldreq->vsyncend = modeline->vsyncend; - oldreq->vtotal = modeline->vtotal; - oldreq->flags = modeline->flags; - oldreq->privsize = modeline->privsize; - if (modeline->privsize) { - oldreq->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } else { - GetReq(XF86VidModeValidateModeLine, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeValidateModeLine; - req->screen = screen; - req->dotclock = modeline->dotclock; - req->hdisplay = modeline->hdisplay; - req->hsyncstart = modeline->hsyncstart; - req->hsyncend = modeline->hsyncend; - req->htotal = modeline->htotal; - req->hskew = modeline->hskew; - req->vdisplay = modeline->vdisplay; - req->vsyncstart = modeline->vsyncstart; - req->vsyncend = modeline->vsyncend; - req->vtotal = modeline->vtotal; - req->flags = modeline->flags; - req->privsize = modeline->privsize; - if (modeline->privsize) { - req->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return MODE_BAD; - } - UnlockDisplay(dpy); - SyncHandle(); - return rep.status; -} - -Bool -SDL_NAME(XF86VidModeSwitchMode)(dpy, screen, zoom) - Display* dpy; - int screen; - int zoom; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeSwitchModeReq *req; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeSwitchMode, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeSwitchMode; - req->screen = screen; - req->zoom = zoom; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeSwitchToMode)(dpy, screen, modeline) - Display* dpy; - int screen; - SDL_NAME(XF86VidModeModeInfo)* modeline; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeSwitchToModeReq *req; - xXF86OldVidModeSwitchToModeReq *oldreq; - int majorVersion, minorVersion; - Bool protocolBug = False; - - XF86VidModeCheckExtension (dpy, info, False); - - /* - * Note: There was a bug in the protocol implementation in versions - * 0.x with x < 8 (the .private field wasn't expected to be sent over - * the wire). Check the server's version, and accept the old format - * if appropriate. - */ - - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - if (majorVersion == 0 && minorVersion < 8) { - protocolBug = True; -#ifdef DEBUG - fprintf(stderr, "XF86VidModeSwitchToMode: Warning: Xserver is" - "running an old version (%d.%d)\n", majorVersion, - minorVersion); -#endif - } - - LockDisplay(dpy); - if (majorVersion < 2) { - GetOldReq(XF86VidModeSwitchToMode, XF86OldVidModeSwitchToMode, oldreq); - oldreq->reqType = info->codes->major_opcode; - oldreq->xf86vidmodeReqType = X_XF86VidModeSwitchToMode; - oldreq->screen = screen; - oldreq->dotclock = modeline->dotclock; - oldreq->hdisplay = modeline->hdisplay; - oldreq->hsyncstart = modeline->hsyncstart; - oldreq->hsyncend = modeline->hsyncend; - oldreq->htotal = modeline->htotal; - oldreq->vdisplay = modeline->vdisplay; - oldreq->vsyncstart = modeline->vsyncstart; - oldreq->vsyncend = modeline->vsyncend; - oldreq->vtotal = modeline->vtotal; - oldreq->flags = modeline->flags; - if (protocolBug) { - oldreq->privsize = 0; - } else { - oldreq->privsize = modeline->privsize; - if (modeline->privsize) { - oldreq->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } - } else { - GetReq(XF86VidModeSwitchToMode, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeSwitchToMode; - req->screen = screen; - req->dotclock = modeline->dotclock; - req->hdisplay = modeline->hdisplay; - req->hsyncstart = modeline->hsyncstart; - req->hsyncend = modeline->hsyncend; - req->htotal = modeline->htotal; - req->hskew = modeline->hskew; - req->vdisplay = modeline->vdisplay; - req->vsyncstart = modeline->vsyncstart; - req->vsyncend = modeline->vsyncend; - req->vtotal = modeline->vtotal; - req->flags = modeline->flags; - if (protocolBug) { - req->privsize = 0; - } else { - req->privsize = modeline->privsize; - if (modeline->privsize) { - req->length += modeline->privsize; - Data32(dpy, (long *) modeline->private, - modeline->privsize * sizeof(INT32)); - } - } - } - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeLockModeSwitch)(dpy, screen, lock) - Display* dpy; - int screen; - int lock; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeLockModeSwitchReq *req; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeLockModeSwitch, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeLockModeSwitch; - req->screen = screen; - req->lock = lock; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeGetMonitor)(dpy, screen, monitor) - Display* dpy; - int screen; - SDL_NAME(XF86VidModeMonitor)* monitor; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetMonitorReply rep; - xXF86VidModeGetMonitorReq *req; - CARD32 syncrange; - int i; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeGetMonitor, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetMonitor; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - monitor->nhsync = rep.nhsync; - monitor->nvsync = rep.nvsync; -#if 0 - monitor->bandwidth = (float)rep.bandwidth / 1e6; -#endif - if (rep.vendorLength) { - if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) { - _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 + - ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3)); - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - } else { - monitor->vendor = NULL; - } - if (rep.modelLength) { - if (!(monitor->model = Xcalloc(rep.modelLength + 1, 1))) { - _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 + - ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3)); - if (monitor->vendor) - Xfree(monitor->vendor); - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - } else { - monitor->model = NULL; - } - if (!(monitor->hsync = Xcalloc(rep.nhsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) { - _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 + - ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3)); - - if (monitor->vendor) - Xfree(monitor->vendor); - if (monitor->model) - Xfree(monitor->model); - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) { - _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 + - ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3)); - if (monitor->vendor) - Xfree(monitor->vendor); - if (monitor->model) - Xfree(monitor->model); - Xfree(monitor->hsync); - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - for (i = 0; i < rep.nhsync; i++) { - _XRead(dpy, (char *)&syncrange, 4); - monitor->hsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0; - monitor->hsync[i].hi = (float)(syncrange >> 16) / 100.0; - } - for (i = 0; i < rep.nvsync; i++) { - _XRead(dpy, (char *)&syncrange, 4); - monitor->vsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0; - monitor->vsync[i].hi = (float)(syncrange >> 16) / 100.0; - } - if (rep.vendorLength) - _XReadPad(dpy, monitor->vendor, rep.vendorLength); - else - monitor->vendor = ""; - if (rep.modelLength) - _XReadPad(dpy, monitor->model, rep.modelLength); - else - monitor->model = ""; - - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeGetViewPort)(dpy, screen, x, y) - Display* dpy; - int screen; - int *x, *y; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetViewPortReply rep; - xXF86VidModeGetViewPortReq *req; - int majorVersion, minorVersion; - Bool protocolBug = False; - - XF86VidModeCheckExtension (dpy, info, False); - - /* - * Note: There was a bug in the protocol implementation in versions - * 0.x with x < 8 (no reply was sent, so the client would hang) - * Check the server's version, and don't wait for a reply with older - * versions. - */ - - SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion); - if (majorVersion == 0 && minorVersion < 8) { - protocolBug = True; -#ifdef DEBUG - fprintf(stderr, "XF86VidModeGetViewPort: Warning: Xserver is" - "running an old version (%d.%d)\n", majorVersion, - minorVersion); -#endif - } - LockDisplay(dpy); - GetReq(XF86VidModeGetViewPort, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetViewPort; - req->screen = screen; - if (protocolBug) { - *x = 0; - *y = 0; - } else { - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *x = rep.x; - *y = rep.y; - } - - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeSetViewPort)(dpy, screen, x, y) - Display* dpy; - int screen; - int x, y; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeSetViewPortReq *req; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeSetViewPort, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeSetViewPort; - req->screen = screen; - req->x = x; - req->y = y; - - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeGetDotClocks)(dpy, screen, - flagsPtr, numclocksPtr, maxclocksPtr, clocksPtr) - Display* dpy; - int screen; - int *flagsPtr, *numclocksPtr, *maxclocksPtr, *clocksPtr[]; -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetDotClocksReply rep; - xXF86VidModeGetDotClocksReq *req; - int i, *dotclocks; - CARD32 dotclk; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeGetDotClocks, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetDotClocks; - req->screen = screen; - if (!_XReply(dpy, (xReply *)&rep, - (SIZEOF(xXF86VidModeGetDotClocksReply) - SIZEOF(xReply)) >> 2, xFalse)) - { - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - *numclocksPtr = rep.clocks; - *maxclocksPtr = rep.maxclocks; - *flagsPtr = rep.flags; - - if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) { - _XEatData(dpy, (rep.clocks) * 4); - Xfree(dotclocks); - UnlockDisplay(dpy); - SyncHandle(); - return False; - } - - for (i = 0; i < rep.clocks; i++) { - _XRead(dpy, (char*)&dotclk, 4); - dotclocks[i] = dotclk; - } - *clocksPtr = dotclocks; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool -SDL_NAME(XF86VidModeSetGammaRamp) ( - Display *dpy, - int screen, - int size, - unsigned short *red, - unsigned short *green, - unsigned short *blue -) -{ - int length = (size + 1) & ~1; - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeSetGammaRampReq *req; - - XF86VidModeCheckExtension (dpy, info, False); - LockDisplay(dpy); - GetReq(XF86VidModeSetGammaRamp, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeSetGammaRamp; - req->screen = screen; - req->length += (length >> 1) * 3; - req->size = size; - _XSend(dpy, (char*)red, size * 2); - _XSend(dpy, (char*)green, size * 2); - _XSend(dpy, (char*)blue, size * 2); - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - - -Bool -SDL_NAME(XF86VidModeGetGammaRamp) ( - Display *dpy, - int screen, - int size, - unsigned short *red, - unsigned short *green, - unsigned short *blue -) -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetGammaRampReq *req; - xXF86VidModeGetGammaRampReply rep; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeGetGammaRamp, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp; - req->screen = screen; - req->size = size; - if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { - UnlockDisplay (dpy); - SyncHandle (); - return False; - } - if(rep.size) { - _XRead(dpy, (char*)red, rep.size << 1); - _XRead(dpy, (char*)green, rep.size << 1); - _XRead(dpy, (char*)blue, rep.size << 1); - } - - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - -Bool SDL_NAME(XF86VidModeGetGammaRampSize)( - Display *dpy, - int screen, - int *size -) -{ - XExtDisplayInfo *info = find_display (dpy); - xXF86VidModeGetGammaRampSizeReq *req; - xXF86VidModeGetGammaRampSizeReply rep; - - *size = 0; - - XF86VidModeCheckExtension (dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86VidModeGetGammaRampSize, req); - req->reqType = info->codes->major_opcode; - req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize; - req->screen = screen; - if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { - UnlockDisplay (dpy); - SyncHandle (); - return False; - } - *size = rep.size; - UnlockDisplay(dpy); - SyncHandle(); - return True; -} - diff --git a/src/video/Xext/extensions/Xext.h b/src/video/Xext/extensions/Xext.h deleted file mode 100644 index 9edf3194b4..0000000000 --- a/src/video/Xext/extensions/Xext.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - */ -/* $XFree86: xc/include/extensions/Xext.h,v 1.7 2005/01/27 03:03:09 dawes Exp $ */ - -#ifndef _XEXT_H_ -#define _XEXT_H_ - -#include - -_XFUNCPROTOBEGIN - -typedef int (*XExtensionErrorHandler)(Display *, _Xconst char *, - _Xconst char *); - -extern XExtensionErrorHandler XSetExtensionErrorHandler( - XExtensionErrorHandler handler -); - -extern int XMissingExtension( - Display* /* dpy */, - _Xconst char* /* ext_name */ -); - -_XFUNCPROTOEND - -#define X_EXTENSION_UNKNOWN "unknown" -#define X_EXTENSION_MISSING "missing" - -#endif /* _XEXT_H_ */ diff --git a/src/video/Xext/extensions/Xinerama.h b/src/video/Xext/extensions/Xinerama.h deleted file mode 100644 index 54f2fe17d2..0000000000 --- a/src/video/Xext/extensions/Xinerama.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $XFree86: xc/include/extensions/Xinerama.h,v 3.2 2000/03/01 01:04:20 dawes Exp $ */ - -#ifndef _Xinerama_h -#define _Xinerama_h - -#include "SDL_name.h" - -typedef struct { - int screen_number; - short x_org; - short y_org; - short width; - short height; -} SDL_NAME(XineramaScreenInfo); - -Bool SDL_NAME(XineramaQueryExtension) ( - Display *dpy, - int *event_base, - int *error_base -); - -Status SDL_NAME(XineramaQueryVersion)( - Display *dpy, - int *major, - int *minor -); - -Bool SDL_NAME(XineramaIsActive)(Display *dpy); - - -/* - Returns the number of heads and a pointer to an array of - structures describing the position and size of the individual - heads. Returns NULL and number = 0 if Xinerama is not active. - - Returned array should be freed with XFree(). -*/ - -SDL_NAME(XineramaScreenInfo) * -SDL_NAME(XineramaQueryScreens)( - Display *dpy, - int *number -); - -#endif /* _Xinerama_h */ - diff --git a/src/video/Xext/extensions/Xv.h b/src/video/Xext/extensions/Xv.h deleted file mode 100644 index a6a027195f..0000000000 --- a/src/video/Xext/extensions/Xv.h +++ /dev/null @@ -1,129 +0,0 @@ -/*********************************************************** -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/include/extensions/Xv.h,v 1.5 1999/12/11 19:28:48 mvojkovi Exp $ */ - -#ifndef XV_H -#define XV_H -/* -** File: -** -** Xv.h --- Xv shared library and server header file -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 05.15.91 Carver -** - version 2.0 upgrade -** -** 01.24.91 Carver -** - version 1.4 upgrade -** -*/ - -#include - -#define XvName "XVideo" -#define XvVersion 2 -#define XvRevision 2 - -/* Symbols */ - -typedef XID XvPortID; -typedef XID XvEncodingID; - -#define XvNone 0 - -#define XvInput 0 -#define XvOutput 1 - -#define XvInputMask (1L< -#include "Xv.h" -#include "SDL_name.h" - -typedef struct { - int numerator; - int denominator; -} SDL_NAME(XvRational); - -typedef struct { - int flags; /* XvGettable, XvSettable */ - int min_value; - int max_value; - char *name; -} SDL_NAME(XvAttribute); - -typedef struct { - XvEncodingID encoding_id; - char *name; - unsigned long width; - unsigned long height; - SDL_NAME(XvRational) rate; - unsigned long num_encodings; -} SDL_NAME(XvEncodingInfo); - -typedef struct { - char depth; - unsigned long visual_id; -} SDL_NAME(XvFormat); - -typedef struct { - XvPortID base_id; - unsigned long num_ports; - char type; - char *name; - unsigned long num_formats; - SDL_NAME(XvFormat) *formats; - unsigned long num_adaptors; -} SDL_NAME(XvAdaptorInfo); - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Drawable drawable; /* drawable */ - unsigned long reason; /* what generated this event */ - XvPortID port_id; /* what port */ - Time time; /* milliseconds */ -} SDL_NAME(XvVideoNotifyEvent); - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - XvPortID port_id; /* what port */ - Time time; /* milliseconds */ - Atom attribute; /* atom that identifies attribute */ - long value; /* value of attribute */ -} SDL_NAME(XvPortNotifyEvent); - -typedef union { - int type; - SDL_NAME(XvVideoNotifyEvent) xvvideo; - SDL_NAME(XvPortNotifyEvent) xvport; - long pad[24]; -} SDL_NAME(XvEvent); - -typedef struct { - int id; /* Unique descriptor for the format */ - int type; /* XvRGB, XvYUV */ - int byte_order; /* LSBFirst, MSBFirst */ - char guid[16]; /* Globally Unique IDentifier */ - int bits_per_pixel; - int format; /* XvPacked, XvPlanar */ - int num_planes; - - /* for RGB formats only */ - int depth; - unsigned int red_mask; - unsigned int green_mask; - unsigned int blue_mask; - - /* for YUV formats only */ - unsigned int y_sample_bits; - unsigned int u_sample_bits; - unsigned int v_sample_bits; - unsigned int horz_y_period; - unsigned int horz_u_period; - unsigned int horz_v_period; - unsigned int vert_y_period; - unsigned int vert_u_period; - unsigned int vert_v_period; - char component_order[32]; /* eg. UYVY */ - int scanline_order; /* XvTopToBottom, XvBottomToTop */ -} SDL_NAME(XvImageFormatValues); - -typedef struct { - int id; - int width, height; - int data_size; /* bytes */ - int num_planes; - int *pitches; /* bytes */ - int *offsets; /* bytes */ - char *data; - XPointer obdata; -} SDL_NAME(XvImage); - -_XFUNCPROTOBEGIN - -extern int SDL_NAME(XvQueryExtension)( -#if NeedFunctionPrototypes - Display* /* display */, - unsigned int* /* p_version */, - unsigned int* /* p_revision */, - unsigned int* /* p_requestBase */, - unsigned int* /* p_eventBase */, - unsigned int* /* p_errorBase */ -#endif -); - -extern int SDL_NAME(XvQueryAdaptors)( -#if NeedFunctionPrototypes - Display* /* display */, - Window /* window */, - unsigned int* /* p_nAdaptors */, - SDL_NAME(XvAdaptorInfo)** /* p_pAdaptors */ -#endif -); - -extern int SDL_NAME(XvQueryEncodings)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - unsigned int* /* p_nEncoding */, - SDL_NAME(XvEncodingInfo)** /* p_pEncoding */ -#endif -); - -extern int SDL_NAME(XvPutVideo)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Drawable /* d */, - GC /* gc */, - int /* vx */, - int /* vy */, - unsigned int /* vw */, - unsigned int /* vh */, - int /* dx */, - int /* dy */, - unsigned int /* dw */, - unsigned int /* dh */ -#endif -); - -extern int SDL_NAME(XvPutStill)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Drawable /* d */, - GC /* gc */, - int /* vx */, - int /* vy */, - unsigned int /* vw */, - unsigned int /* vh */, - int /* dx */, - int /* dy */, - unsigned int /* dw */, - unsigned int /* dh */ -#endif -); - -extern int SDL_NAME(XvGetVideo)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Drawable /* d */, - GC /* gc */, - int /* vx */, - int /* vy */, - unsigned int /* vw */, - unsigned int /* vh */, - int /* dx */, - int /* dy */, - unsigned int /* dw */, - unsigned int /* dh */ -#endif -); - -extern int SDL_NAME(XvGetStill)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Drawable /* d */, - GC /* gc */, - int /* vx */, - int /* vy */, - unsigned int /* vw */, - unsigned int /* vh */, - int /* dx */, - int /* dy */, - unsigned int /* dw */, - unsigned int /* dh */ -#endif -); - -extern int SDL_NAME(XvStopVideo)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Drawable /* drawable */ -#endif -); - -extern int SDL_NAME(XvGrabPort)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Time /* time */ -#endif -); - -extern int SDL_NAME(XvUngrabPort)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Time /* time */ -#endif -); - -extern int SDL_NAME(XvSelectVideoNotify)( -#if NeedFunctionPrototypes - Display* /* display */, - Drawable /* drawable */, - Bool /* onoff */ -#endif -); - -extern int SDL_NAME(XvSelectPortNotify)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Bool /* onoff */ -#endif -); - -extern int SDL_NAME(XvSetPortAttribute)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Atom /* attribute */, - int /* value */ -#endif -); - -extern int SDL_NAME(XvGetPortAttribute)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Atom /* attribute */, - int* /* p_value */ -#endif -); - -extern int SDL_NAME(XvQueryBestSize)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - Bool /* motion */, - unsigned int /* vid_w */, - unsigned int /* vid_h */, - unsigned int /* drw_w */, - unsigned int /* drw_h */, - unsigned int* /* p_actual_width */, - unsigned int* /* p_actual_width */ -#endif -); - -extern SDL_NAME(XvAttribute)* SDL_NAME(XvQueryPortAttributes)( -#if NeedFunctionPrototypes - Display* /* display */, - XvPortID /* port */, - int* /* number */ -#endif -); - - -extern void SDL_NAME(XvFreeAdaptorInfo)( -#if NeedFunctionPrototypes - SDL_NAME(XvAdaptorInfo)* /* adaptors */ -#endif -); - -extern void SDL_NAME(XvFreeEncodingInfo)( -#if NeedFunctionPrototypes - SDL_NAME(XvEncodingInfo)* /* encodings */ -#endif -); - - -extern SDL_NAME(XvImageFormatValues) * SDL_NAME(XvListImageFormats) ( -#if NeedFunctionPrototypes - Display *display, - XvPortID port_id, - int *count_return -#endif -); - -extern SDL_NAME(XvImage) * SDL_NAME(XvCreateImage) ( -#if NeedFunctionPrototypes - Display *display, - XvPortID port, - int id, - char *data, - int width, - int height -#endif -); - -extern int SDL_NAME(XvPutImage) ( -#if NeedFunctionPrototypes - Display *display, - XvPortID id, - Drawable d, - GC gc, - SDL_NAME(XvImage) *image, - int src_x, - int src_y, - unsigned int src_w, - unsigned int src_h, - int dest_x, - int dest_y, - unsigned int dest_w, - unsigned int dest_h -#endif -); - -extern int SDL_NAME(XvShmPutImage) ( -#if NeedFunctionPrototypes - Display *display, - XvPortID id, - Drawable d, - GC gc, - SDL_NAME(XvImage) *image, - int src_x, - int src_y, - unsigned int src_w, - unsigned int src_h, - int dest_x, - int dest_y, - unsigned int dest_w, - unsigned int dest_h, - Bool send_event -#endif -); - -#ifdef _XSHM_H_ - -extern SDL_NAME(XvImage) * SDL_NAME(XvShmCreateImage) ( -#if NeedFunctionPrototypes - Display *display, - XvPortID port, - int id, - char* data, - int width, - int height, - XShmSegmentInfo *shminfo -#endif -); - -#endif - - -_XFUNCPROTOEND - -#endif /* XVLIB_H */ diff --git a/src/video/Xext/extensions/Xvproto.h b/src/video/Xext/extensions/Xvproto.h deleted file mode 100644 index b4d8f22cdc..0000000000 --- a/src/video/Xext/extensions/Xvproto.h +++ /dev/null @@ -1,604 +0,0 @@ -/*********************************************************** -Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, -and the Massachusetts Institute of Technology, Cambridge, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Digital or MIT not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ -/* $XFree86: xc/include/extensions/Xvproto.h,v 1.6 2001/05/07 21:37:12 tsi Exp $ */ - -#ifndef XVPROTO_H -#define XVPROTO_H -/* -** File: -** -** Xvproto.h --- Xv protocol header file -** -** Author: -** -** David Carver (Digital Workstation Engineering/Project Athena) -** -** Revisions: -** -** 11.06.91 Carver -** - changed SetPortControl to SetPortAttribute -** - changed GetPortControl to GetPortAttribute -** - changed QueryBestSize -** -** 15.05.91 Carver -** - version 2.0 upgrade -** -** 24.01.91 Carver -** - version 1.4 upgrade -** -*/ - -#include - -/* Symbols: These are undefined at the end of this file to restore the - values they have in Xv.h */ - -#define XvPortID CARD32 -#define XvEncodingID CARD32 -#define ShmSeg CARD32 -#define VisualID CARD32 -#define Drawable CARD32 -#define GContext CARD32 -#define Time CARD32 -#define Atom CARD32 - -/* Structures */ - -typedef struct { - INT32 numerator B32; - INT32 denominator B32; -} xvRational; -#define sz_xvRational 8 - -typedef struct { - XvPortID base_id B32; - CARD16 name_size B16; - CARD16 num_ports B16; - CARD16 num_formats B16; - CARD8 type; - CARD8 pad; -} xvAdaptorInfo; -#define sz_xvAdaptorInfo 12 - -typedef struct { - XvEncodingID encoding B32; - CARD16 name_size B16; - CARD16 width B16, height B16; - xvRational rate; - CARD16 pad B16; -} xvEncodingInfo; -#define sz_xvEncodingInfo (12 + sz_xvRational) - -typedef struct { - VisualID visual B32; - CARD8 depth; - CARD8 pad1; - CARD16 pad2 B16; -} xvFormat; -#define sz_xvFormat 8 - -typedef struct { - CARD32 flags B32; - INT32 min B32; - INT32 max B32; - CARD32 size B32; -} xvAttributeInfo; -#define sz_xvAttributeInfo 16 - -typedef struct { - CARD32 id B32; - CARD8 type; - CARD8 byte_order; - CARD16 pad1 B16; - CARD8 guid[16]; - CARD8 bpp; - CARD8 num_planes; - CARD16 pad2 B16; - CARD8 depth; - CARD8 pad3; - CARD16 pad4 B16; - CARD32 red_mask B32; - CARD32 green_mask B32; - CARD32 blue_mask B32; - CARD8 format; - CARD8 pad5; - CARD16 pad6 B16; - CARD32 y_sample_bits B32; - CARD32 u_sample_bits B32; - CARD32 v_sample_bits B32; - CARD32 horz_y_period B32; - CARD32 horz_u_period B32; - CARD32 horz_v_period B32; - CARD32 vert_y_period B32; - CARD32 vert_u_period B32; - CARD32 vert_v_period B32; - CARD8 comp_order[32]; - CARD8 scanline_order; - CARD8 pad7; - CARD16 pad8 B16; - CARD32 pad9 B32; - CARD32 pad10 B32; -} xvImageFormatInfo; -#define sz_xvImageFormatInfo 128 - - -/* Requests */ - -#define xv_QueryExtension 0 -#define xv_QueryAdaptors 1 -#define xv_QueryEncodings 2 -#define xv_GrabPort 3 -#define xv_UngrabPort 4 -#define xv_PutVideo 5 -#define xv_PutStill 6 -#define xv_GetVideo 7 -#define xv_GetStill 8 -#define xv_StopVideo 9 -#define xv_SelectVideoNotify 10 -#define xv_SelectPortNotify 11 -#define xv_QueryBestSize 12 -#define xv_SetPortAttribute 13 -#define xv_GetPortAttribute 14 -#define xv_QueryPortAttributes 15 -#define xv_ListImageFormats 16 -#define xv_QueryImageAttributes 17 -#define xv_PutImage 18 -#define xv_ShmPutImage 19 -#define xv_LastRequest xv_ShmPutImage - -#define xvNumRequests (xv_LastRequest + 1) - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; -} xvQueryExtensionReq; -#define sz_xvQueryExtensionReq 4 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - CARD32 window B32; -} xvQueryAdaptorsReq; -#define sz_xvQueryAdaptorsReq 8 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - CARD32 port B32; -} xvQueryEncodingsReq; -#define sz_xvQueryEncodingsReq 8 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Drawable drawable B32; - GContext gc B32; - INT16 vid_x B16; - INT16 vid_y B16; - CARD16 vid_w B16; - CARD16 vid_h B16; - INT16 drw_x B16; - INT16 drw_y B16; - CARD16 drw_w B16; - CARD16 drw_h B16; -} xvPutVideoReq; -#define sz_xvPutVideoReq 32 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Drawable drawable B32; - GContext gc B32; - INT16 vid_x B16; - INT16 vid_y B16; - CARD16 vid_w B16; - CARD16 vid_h B16; - INT16 drw_x B16; - INT16 drw_y B16; - CARD16 drw_w B16; - CARD16 drw_h B16; -} xvPutStillReq; -#define sz_xvPutStillReq 32 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Drawable drawable B32; - GContext gc B32; - INT16 vid_x B16; - INT16 vid_y B16; - CARD16 vid_w B16; - CARD16 vid_h B16; - INT16 drw_x B16; - INT16 drw_y B16; - CARD16 drw_w B16; - CARD16 drw_h B16; -} xvGetVideoReq; -#define sz_xvGetVideoReq 32 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Drawable drawable B32; - GContext gc B32; - INT16 vid_x B16; - INT16 vid_y B16; - CARD16 vid_w B16; - CARD16 vid_h B16; - INT16 drw_x B16; - INT16 drw_y B16; - CARD16 drw_w B16; - CARD16 drw_h B16; -} xvGetStillReq; -#define sz_xvGetStillReq 32 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Time time B32; -} xvGrabPortReq; -#define sz_xvGrabPortReq 12 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Time time B32; -} xvUngrabPortReq; -#define sz_xvUngrabPortReq 12 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - Drawable drawable B32; - BOOL onoff; - CARD8 pad1; - CARD16 pad2; -} xvSelectVideoNotifyReq; -#define sz_xvSelectVideoNotifyReq 12 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - BOOL onoff; - CARD8 pad1; - CARD16 pad2; -} xvSelectPortNotifyReq; -#define sz_xvSelectPortNotifyReq 12 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Drawable drawable B32; -} xvStopVideoReq; -#define sz_xvStopVideoReq 12 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Atom attribute B32; - INT32 value B32; -} xvSetPortAttributeReq; -#define sz_xvSetPortAttributeReq 16 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Atom attribute B32; -} xvGetPortAttributeReq; -#define sz_xvGetPortAttributeReq 12 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - CARD16 vid_w B16; - CARD16 vid_h B16; - CARD16 drw_w B16; - CARD16 drw_h B16; - CARD8 motion; - CARD8 pad1; - CARD16 pad2 B16; -} xvQueryBestSizeReq; -#define sz_xvQueryBestSizeReq 20 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; -} xvQueryPortAttributesReq; -#define sz_xvQueryPortAttributesReq 8 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Drawable drawable B32; - GContext gc B32; - CARD32 id B32; - INT16 src_x B16; - INT16 src_y B16; - CARD16 src_w B16; - CARD16 src_h B16; - INT16 drw_x B16; - INT16 drw_y B16; - CARD16 drw_w B16; - CARD16 drw_h B16; - CARD16 width B16; - CARD16 height B16; -} xvPutImageReq; -#define sz_xvPutImageReq 40 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; - Drawable drawable B32; - GContext gc B32; - ShmSeg shmseg B32; - CARD32 id B32; - CARD32 offset B32; - INT16 src_x B16; - INT16 src_y B16; - CARD16 src_w B16; - CARD16 src_h B16; - INT16 drw_x B16; - INT16 drw_y B16; - CARD16 drw_w B16; - CARD16 drw_h B16; - CARD16 width B16; - CARD16 height B16; - CARD8 send_event; - CARD8 pad1; - CARD16 pad2 B16; -} xvShmPutImageReq; -#define sz_xvShmPutImageReq 52 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - XvPortID port B32; -} xvListImageFormatsReq; -#define sz_xvListImageFormatsReq 8 - -typedef struct { - CARD8 reqType; - CARD8 xvReqType; - CARD16 length B16; - CARD32 port B32; - CARD32 id B32; - CARD16 width B16; - CARD16 height B16; -} xvQueryImageAttributesReq; -#define sz_xvQueryImageAttributesReq 16 - - -/* Replies */ - -typedef struct _QueryExtensionReply { - BYTE type; /* X_Reply */ - CARD8 padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 version B16; - CARD16 revision B16; - CARD32 padl4 B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvQueryExtensionReply; -#define sz_xvQueryExtensionReply 32 - -typedef struct _QueryAdaptorsReply { - BYTE type; /* X_Reply */ - CARD8 padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 num_adaptors B16; - CARD16 pads3 B16; - CARD32 padl4 B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvQueryAdaptorsReply; -#define sz_xvQueryAdaptorsReply 32 - -typedef struct _QueryEncodingsReply { - BYTE type; /* X_Reply */ - CARD8 padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 num_encodings B16; - CARD32 padl3 B32; - CARD32 padl4 B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvQueryEncodingsReply; -#define sz_xvQueryEncodingsReply 32 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE result; - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD32 padl3 B32; - CARD32 padl4 B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvGrabPortReply; -#define sz_xvGrabPortReply 32 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - INT32 value B32; - CARD32 padl4 B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvGetPortAttributeReply; -#define sz_xvGetPortAttributeReply 32 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD16 actual_width B16; - CARD16 actual_height B16; - CARD32 padl4 B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvQueryBestSizeReply; -#define sz_xvQueryBestSizeReply 32 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; /* 0 */ - CARD32 num_attributes B32; - CARD32 text_size B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvQueryPortAttributesReply; -#define sz_xvQueryPortAttributesReply 32 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 num_formats B32; - CARD32 padl4 B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvListImageFormatsReply; -#define sz_xvListImageFormatsReply 32 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE padb1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 num_planes B32; - CARD32 data_size B32; - CARD16 width B16; - CARD16 height B16; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; -} xvQueryImageAttributesReply; -#define sz_xvQueryImageAttributesReply 32 - -/* DEFINE EVENT STRUCTURE */ - -typedef struct { - union { - struct { - BYTE type; - BYTE detail; - CARD16 sequenceNumber B16; - } u; - struct { - BYTE type; - BYTE reason; - CARD16 sequenceNumber B16; - Time time B32; - Drawable drawable B32; - XvPortID port B32; - CARD32 padl5 B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; - } videoNotify; - struct { - BYTE type; - BYTE padb1; - CARD16 sequenceNumber B16; - Time time B32; - XvPortID port B32; - Atom attribute B32; - INT32 value B32; - CARD32 padl6 B32; - CARD32 padl7 B32; - CARD32 padl8 B32; - } portNotify; - } u; -} xvEvent; - -#undef XvPortID -#undef XvEncodingID -#undef ShmSeg -#undef VisualID -#undef Drawable -#undef GContext -#undef Time -#undef Atom - -#endif /* XVPROTO_H */ - diff --git a/src/video/Xext/extensions/extutil.h b/src/video/Xext/extensions/extutil.h deleted file mode 100644 index f3a741ea22..0000000000 --- a/src/video/Xext/extensions/extutil.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * $Xorg: extutil.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ - * -Copyright 1989, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - * - * Author: Jim Fulton, MIT The Open Group - * - * Xlib Extension-Writing Utilities - * - * This package contains utilities for writing the client API for various - * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND - * ARE SUBJECT TO CHANGE! - */ -/* $XFree86: xc/include/extensions/extutil.h,v 1.9 2001/12/14 19:53:28 dawes Exp $ */ - -#ifndef _EXTUTIL_H_ -#define _EXTUTIL_H_ - -#include "SDL_stdinc.h" /* For portable string functions */ - -#include "./Xext.h" - -/* - * We need to keep a list of open displays since the Xlib display list isn't - * public. We also have to per-display info in a separate block since it isn't - * stored directly in the Display structure. - */ -typedef struct _XExtDisplayInfo { - struct _XExtDisplayInfo *next; /* keep a linked list */ - Display *display; /* which display this is */ - XExtCodes *codes; /* the extension protocol codes */ - XPointer data; /* extra data for extension to use */ -} XExtDisplayInfo; - -typedef struct _XExtensionInfo { - XExtDisplayInfo *head; /* start of list */ - XExtDisplayInfo *cur; /* most recently used */ - int ndisplays; /* number of displays */ -} XExtensionInfo; - -typedef struct _XExtensionHooks { - int (*create_gc)( -#if NeedNestedPrototypes - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -#endif -); - int (*copy_gc)( -#if NeedNestedPrototypes - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -#endif -); - int (*flush_gc)( -#if NeedNestedPrototypes - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -#endif -); - int (*free_gc)( -#if NeedNestedPrototypes - Display* /* display */, - GC /* gc */, - XExtCodes* /* codes */ -#endif -); - int (*create_font)( -#if NeedNestedPrototypes - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ -#endif -); - int (*free_font)( -#if NeedNestedPrototypes - Display* /* display */, - XFontStruct* /* fs */, - XExtCodes* /* codes */ -#endif -); - int (*close_display)( -#if NeedNestedPrototypes - Display* /* display */, - XExtCodes* /* codes */ -#endif -); - Bool (*wire_to_event)( -#if NeedNestedPrototypes - Display* /* display */, - XEvent* /* re */, - xEvent* /* event */ -#endif -); - Status (*event_to_wire)( -#if NeedNestedPrototypes - Display* /* display */, - XEvent* /* re */, - xEvent* /* event */ -#endif -); - int (*error)( -#if NeedNestedPrototypes - Display* /* display */, - xError* /* err */, - XExtCodes* /* codes */, - int* /* ret_code */ -#endif -); - char *(*error_string)( -#if NeedNestedPrototypes - Display* /* display */, - int /* code */, - XExtCodes* /* codes */, - char* /* buffer */, - int /* nbytes */ -#endif -); -} XExtensionHooks; - -extern XExtensionInfo *XextCreateExtension( -#if NeedFunctionPrototypes - void -#endif -); -extern void XextDestroyExtension( -#if NeedFunctionPrototypes - XExtensionInfo* /* info */ -#endif -); -extern XExtDisplayInfo *XextAddDisplay( -#if NeedFunctionPrototypes - XExtensionInfo* /* extinfo */, - Display* /* dpy */, - char* /* ext_name */, - XExtensionHooks* /* hooks */, - int /* nevents */, - XPointer /* data */ -#endif -); -extern int XextRemoveDisplay( -#if NeedFunctionPrototypes - XExtensionInfo* /* extinfo */, - Display* /* dpy */ -#endif -); -extern XExtDisplayInfo *XextFindDisplay( -#if NeedFunctionPrototypes - XExtensionInfo* /* extinfo */, - Display* /* dpy */ -#endif -); - -#define XextHasExtension(i) ((i) && ((i)->codes)) -#define XextCheckExtension(dpy,i,name,val) \ - if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; } -#define XextSimpleCheckExtension(dpy,i,name) \ - if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; } - - -/* - * helper macros to generate code that is common to all extensions; caller - * should prefix it with static if extension source is in one file; this - * could be a utility function, but have to stack 6 unused arguments for - * something that is called many, many times would be bad. - */ -#define XEXT_GENERATE_FIND_DISPLAY(proc,extinfo,extname,hooks,nev,data) \ -XExtDisplayInfo *proc (Display *dpy) \ -{ \ - XExtDisplayInfo *dpyinfo; \ - if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \ - if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \ - dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \ - return dpyinfo; \ -} - -#define XEXT_FIND_DISPLAY_PROTO(proc) \ - XExtDisplayInfo *proc(Display *dpy) - -#define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \ -int proc (Display *dpy, XExtCodes *codes) \ -{ \ - return XextRemoveDisplay (extinfo, dpy); \ -} - -#define XEXT_CLOSE_DISPLAY_PROTO(proc) \ - int proc(Display *dpy, XExtCodes *codes) - -#define XEXT_GENERATE_ERROR_STRING(proc,extname,nerr,errl) \ -char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \ -{ \ - code -= codes->first_error; \ - if (code >= 0 && code < nerr) { \ - char tmp[256]; \ - SDL_snprintf (tmp, SDL_arraysize(tmp), "%s.%d", extname, code); \ - XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \ - return buf; \ - } \ - return (char *)0; \ -} - -#define XEXT_ERROR_STRING_PROTO(proc) \ - char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n) -#endif diff --git a/src/video/Xext/extensions/panoramiXext.h b/src/video/Xext/extensions/panoramiXext.h deleted file mode 100644 index e89d8917bb..0000000000 --- a/src/video/Xext/extensions/panoramiXext.h +++ /dev/null @@ -1,52 +0,0 @@ -/* $Xorg: panoramiXext.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */ -/***************************************************************** -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. -******************************************************************/ -/* - * PanoramiX definitions - */ -/* $XFree86: xc/include/extensions/panoramiXext.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */ - -#include "SDL_name.h" - -/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ - -#define PANORAMIX_MAJOR_VERSION 1 /* current version number */ -#define PANORAMIX_MINOR_VERSION 1 - -typedef struct { - Window window; /* PanoramiX window - may not exist */ - int screen; - int State; /* PanroamiXOff, PanoramiXOn */ - int width; /* width of this screen */ - int height; /* height of this screen */ - int ScreenCount; /* real physical number of screens */ - XID eventMask; /* selected events for this client */ -} SDL_NAME(XPanoramiXInfo); - -extern SDL_NAME(XPanoramiXInfo) *SDL_NAME(XPanoramiXAllocInfo) ( -#if NeedFunctionPrototypes - void -#endif -); diff --git a/src/video/Xext/extensions/panoramiXproto.h b/src/video/Xext/extensions/panoramiXproto.h deleted file mode 100644 index fe3826eb3b..0000000000 --- a/src/video/Xext/extensions/panoramiXproto.h +++ /dev/null @@ -1,192 +0,0 @@ -/* $Xorg: panoramiXproto.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */ -/***************************************************************** -Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, -BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Digital Equipment Corporation -shall not be used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from Digital -Equipment Corporation. -******************************************************************/ -/* $XFree86: xc/include/extensions/panoramiXproto.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */ - -/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */ - -#ifndef _PANORAMIXPROTO_H_ -#define _PANORAMIXPROTO_H_ - -#define PANORAMIX_PROTOCOL_NAME "XINERAMA" - -#define X_PanoramiXQueryVersion 0 -#define X_PanoramiXGetState 1 -#define X_PanoramiXGetScreenCount 2 -#define X_PanoramiXGetScreenSize 3 - -#define X_XineramaIsActive 4 -#define X_XineramaQueryScreens 5 - -typedef struct _PanoramiXQueryVersion { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXQueryVersion */ - CARD16 length B16; - CARD8 clientMajor; - CARD8 clientMinor; - CARD16 unused B16; -} xPanoramiXQueryVersionReq; - -#define sz_xPanoramiXQueryVersionReq 8 - -typedef struct { - CARD8 type; /* must be X_Reply */ - CARD8 pad1; /* unused */ - CARD16 sequenceNumber B16; /* last sequence number */ - CARD32 length B32; /* 0 */ - CARD16 majorVersion B16; - CARD16 minorVersion B16; - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ - CARD32 pad4 B32; /* unused */ - CARD32 pad5 B32; /* unused */ - CARD32 pad6 B32; /* unused */ -} xPanoramiXQueryVersionReply; - -#define sz_xPanoramiXQueryVersionReply 32 - - -typedef struct _PanoramiXGetState { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXGetState */ - CARD16 length B16; - CARD32 window B32; -} xPanoramiXGetStateReq; -#define sz_xPanoramiXGetStateReq 8 - -typedef struct { - BYTE type; - BYTE state; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 window B32; - CARD32 pad1 B32; /* unused */ - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ - CARD32 pad4 B32; /* unused */ - CARD32 pad5 B32; /* unused */ -} xPanoramiXGetStateReply; - -#define sz_panoramiXGetStateReply 32 - -typedef struct _PanoramiXGetScreenCount { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXGetScreenCount */ - CARD16 length B16; - CARD32 window B32; -} xPanoramiXGetScreenCountReq; -#define sz_xPanoramiXGetScreenCountReq 8 - -typedef struct { - BYTE type; - BYTE ScreenCount; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 window B32; - CARD32 pad1 B32; /* unused */ - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ - CARD32 pad4 B32; /* unused */ - CARD32 pad5 B32; /* unused */ -} xPanoramiXGetScreenCountReply; -#define sz_panoramiXGetScreenCountReply 32 - -typedef struct _PanoramiXGetScreenSize { - CARD8 reqType; /* always PanoramiXReqCode */ - CARD8 panoramiXReqType; /* always X_PanoramiXGetState */ - CARD16 length B16; - CARD32 window B32; - CARD32 screen B32; -} xPanoramiXGetScreenSizeReq; -#define sz_xPanoramiXGetScreenSizeReq 12 - -typedef struct { - BYTE type; - CARD8 pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 width B32; - CARD32 height B32; - CARD32 window B32; - CARD32 screen B32; - CARD32 pad2 B32; /* unused */ - CARD32 pad3 B32; /* unused */ -} xPanoramiXGetScreenSizeReply; -#define sz_panoramiXGetScreenSizeReply 32 - -/************ Alternate protocol ******************/ - -typedef struct { - CARD8 reqType; - CARD8 panoramiXReqType; - CARD16 length B16; -} xXineramaIsActiveReq; -#define sz_xXineramaIsActiveReq 4 - -typedef struct { - BYTE type; - CARD8 pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 state B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXineramaIsActiveReply; -#define sz_XineramaIsActiveReply 32 - - -typedef struct { - CARD8 reqType; - CARD8 panoramiXReqType; - CARD16 length B16; -} xXineramaQueryScreensReq; -#define sz_xXineramaQueryScreensReq 4 - -typedef struct { - BYTE type; - CARD8 pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 number B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXineramaQueryScreensReply; -#define sz_XineramaQueryScreensReply 32 - -typedef struct { - INT16 x_org B16; - INT16 y_org B16; - CARD16 width B16; - CARD16 height B16; -} xXineramaScreenInfo; -#define sz_XineramaScreenInfo 8 - -#endif diff --git a/src/video/Xext/extensions/xf86dga.h b/src/video/Xext/extensions/xf86dga.h deleted file mode 100644 index c71ef4b14a..0000000000 --- a/src/video/Xext/extensions/xf86dga.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - Copyright (c) 1999 XFree86 Inc -*/ -/* $XFree86: xc/include/extensions/xf86dga.h,v 3.21 2001/08/01 00:44:36 tsi Exp $ */ - -#ifndef _XF86DGA_H_ -#define _XF86DGA_H_ - -#include -#include "xf86dga1.h" -#include "SDL_name.h" - -#define X_XDGAQueryVersion 0 - -/* 1 through 9 are in xf86dga1.h */ - -/* 10 and 11 are reserved to avoid conflicts with rogue DGA extensions */ - -#define X_XDGAQueryModes 12 -#define X_XDGASetMode 13 -#define X_XDGASetViewport 14 -#define X_XDGAInstallColormap 15 -#define X_XDGASelectInput 16 -#define X_XDGAFillRectangle 17 -#define X_XDGACopyArea 18 -#define X_XDGACopyTransparentArea 19 -#define X_XDGAGetViewportStatus 20 -#define X_XDGASync 21 -#define X_XDGAOpenFramebuffer 22 -#define X_XDGACloseFramebuffer 23 -#define X_XDGASetClientVersion 24 -#define X_XDGAChangePixmapMode 25 -#define X_XDGACreateColormap 26 - - -#define XDGAConcurrentAccess 0x00000001 -#define XDGASolidFillRect 0x00000002 -#define XDGABlitRect 0x00000004 -#define XDGABlitTransRect 0x00000008 -#define XDGAPixmap 0x00000010 - -#define XDGAInterlaced 0x00010000 -#define XDGADoublescan 0x00020000 - -#define XDGAFlipImmediate 0x00000001 -#define XDGAFlipRetrace 0x00000002 - -#define XDGANeedRoot 0x00000001 - -#define XF86DGANumberEvents 7 - -#define XDGAPixmapModeLarge 0 -#define XDGAPixmapModeSmall 1 - -#define XF86DGAClientNotLocal 0 -#define XF86DGANoDirectVideoMode 1 -#define XF86DGAScreenNotActive 2 -#define XF86DGADirectNotActivated 3 -#define XF86DGAOperationNotSupported 4 -#define XF86DGANumberErrors (XF86DGAOperationNotSupported + 1) - - -typedef struct { - int num; /* A unique identifier for the mode (num > 0) */ - char *name; /* name of mode given in the XF86Config */ - float verticalRefresh; - int flags; /* DGA_CONCURRENT_ACCESS, etc... */ - int imageWidth; /* linear accessible portion (pixels) */ - int imageHeight; - int pixmapWidth; /* Xlib accessible portion (pixels) */ - int pixmapHeight; /* both fields ignored if no concurrent access */ - int bytesPerScanline; - int byteOrder; /* MSBFirst, LSBFirst */ - int depth; - int bitsPerPixel; - unsigned long redMask; - unsigned long greenMask; - unsigned long blueMask; - short visualClass; - int viewportWidth; - int viewportHeight; - int xViewportStep; /* viewport position granularity */ - int yViewportStep; - int maxViewportX; /* max viewport origin */ - int maxViewportY; - int viewportFlags; /* types of page flipping possible */ - int reserved1; - int reserved2; -} SDL_NAME(XDGAMode); - - -typedef struct { - SDL_NAME(XDGAMode) mode; - unsigned char *data; - Pixmap pixmap; -} SDL_NAME(XDGADevice); - - -#ifndef _XF86DGA_SERVER_ -_XFUNCPROTOBEGIN - -typedef struct { - int type; - unsigned long serial; - Display *display; - int screen; - Time time; - unsigned int state; - unsigned int button; -} SDL_NAME(XDGAButtonEvent); - -typedef struct { - int type; - unsigned long serial; - Display *display; - int screen; - Time time; - unsigned int state; - unsigned int keycode; -} SDL_NAME(XDGAKeyEvent); - -typedef struct { - int type; - unsigned long serial; - Display *display; - int screen; - Time time; - unsigned int state; - int dx; - int dy; -} SDL_NAME(XDGAMotionEvent); - -typedef union { - int type; - SDL_NAME(XDGAButtonEvent) xbutton; - SDL_NAME(XDGAKeyEvent) xkey; - SDL_NAME(XDGAMotionEvent) xmotion; - long pad[24]; -} SDL_NAME(XDGAEvent); - -Bool SDL_NAME(XDGAQueryExtension)( - Display *dpy, - int *eventBase, - int *erroBase -); - -Bool SDL_NAME(XDGAQueryVersion)( - Display *dpy, - int *majorVersion, - int *minorVersion -); - -SDL_NAME(XDGAMode)* SDL_NAME(XDGAQueryModes)( - Display *dpy, - int screen, - int *num -); - -SDL_NAME(XDGADevice)* SDL_NAME(XDGASetMode)( - Display *dpy, - int screen, - int mode -); - -Bool SDL_NAME(XDGAOpenFramebuffer)( - Display *dpy, - int screen -); - -void SDL_NAME(XDGACloseFramebuffer)( - Display *dpy, - int screen -); - -void SDL_NAME(XDGASetViewport)( - Display *dpy, - int screen, - int x, - int y, - int flags -); - -void SDL_NAME(XDGAInstallColormap)( - Display *dpy, - int screen, - Colormap cmap -); - -Colormap SDL_NAME(XDGACreateColormap)( - Display *dpy, - int screen, - SDL_NAME(XDGADevice) *device, - int alloc -); - -void SDL_NAME(XDGASelectInput)( - Display *dpy, - int screen, - long event_mask -); - -void SDL_NAME(XDGAFillRectangle)( - Display *dpy, - int screen, - int x, - int y, - unsigned int width, - unsigned int height, - unsigned long color -); - - -void SDL_NAME(XDGACopyArea)( - Display *dpy, - int screen, - int srcx, - int srcy, - unsigned int width, - unsigned int height, - int dstx, - int dsty -); - - -void SDL_NAME(XDGACopyTransparentArea)( - Display *dpy, - int screen, - int srcx, - int srcy, - unsigned int width, - unsigned int height, - int dstx, - int dsty, - unsigned long key -); - -int SDL_NAME(XDGAGetViewportStatus)( - Display *dpy, - int screen -); - -void SDL_NAME(XDGASync)( - Display *dpy, - int screen -); - -Bool SDL_NAME(XDGASetClientVersion)( - Display *dpy -); - -void SDL_NAME(XDGAChangePixmapMode)( - Display *dpy, - int screen, - int *x, - int *y, - int mode -); - - -void SDL_NAME(XDGAKeyEventToXKeyEvent)(SDL_NAME(XDGAKeyEvent)* dk, XKeyEvent* xk); - - -_XFUNCPROTOEND -#endif /* _XF86DGA_SERVER_ */ -#endif /* _XF86DGA_H_ */ diff --git a/src/video/Xext/extensions/xf86dga1.h b/src/video/Xext/extensions/xf86dga1.h deleted file mode 100644 index 4a49e9f385..0000000000 --- a/src/video/Xext/extensions/xf86dga1.h +++ /dev/null @@ -1,169 +0,0 @@ -/* $XFree86: xc/include/extensions/xf86dga1.h,v 1.2 1999/04/17 07:05:41 dawes Exp $ */ -/* - -Copyright (c) 1995 Jon Tombs -Copyright (c) 1995 XFree86 Inc - -*/ - -/************************************************************************ - - THIS IS THE OLD DGA API AND IS OBSOLETE. PLEASE DO NOT USE IT ANYMORE - -************************************************************************/ - -#ifndef _XF86DGA1_H_ -#define _XF86DGA1_H_ - -#include -#include "SDL_name.h" - -#define X_XF86DGAQueryVersion 0 -#define X_XF86DGAGetVideoLL 1 -#define X_XF86DGADirectVideo 2 -#define X_XF86DGAGetViewPortSize 3 -#define X_XF86DGASetViewPort 4 -#define X_XF86DGAGetVidPage 5 -#define X_XF86DGASetVidPage 6 -#define X_XF86DGAInstallColormap 7 -#define X_XF86DGAQueryDirectVideo 8 -#define X_XF86DGAViewPortChanged 9 - -#define XF86DGADirectPresent 0x0001 -#define XF86DGADirectGraphics 0x0002 -#define XF86DGADirectMouse 0x0004 -#define XF86DGADirectKeyb 0x0008 -#define XF86DGAHasColormap 0x0100 -#define XF86DGADirectColormap 0x0200 - - - - -#ifndef _XF86DGA_SERVER_ - -_XFUNCPROTOBEGIN - -Bool SDL_NAME(XF86DGAQueryVersion)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int* /* majorVersion */, - int* /* minorVersion */ -#endif -); - -Bool SDL_NAME(XF86DGAQueryExtension)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int* /* event_base */, - int* /* error_base */ -#endif -); - -Status SDL_NAME(XF86DGAGetVideoLL)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int * /* base addr */, - int * /* width */, - int * /* bank_size */, - int * /* ram_size */ -#endif -); - -Status SDL_NAME(XF86DGAGetVideo)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - char ** /* base addr */, - int * /* width */, - int * /* bank_size */, - int * /* ram_size */ -#endif -); - -Status SDL_NAME(XF86DGADirectVideo)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int /* enable */ -#endif -); - -Status SDL_NAME(XF86DGADirectVideoLL)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int /* enable */ -#endif -); - -Status SDL_NAME(XF86DGAGetViewPortSize)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int * /* width */, - int * /* height */ -#endif -); - -Status SDL_NAME(XF86DGASetViewPort)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int x /* X */, - int y /* Y */ -#endif -); - -Status SDL_NAME(XF86DGAGetVidPage)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int * /* vid page */ -#endif -); - -Status SDL_NAME(XF86DGASetVidPage)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int /* vid page */ -#endif -); - -Status SDL_NAME(XF86DGAInstallColormap)( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - Colormap /*Colormap */ -#endif -); - -int SDL_NAME(XF86DGAForkApp)( -#if NeedFunctionPrototypes - int screen -#endif -); - -Status SDL_NAME(XF86DGAQueryDirectVideo)( -#if NeedFunctionPrototypes - Display * /* dpy */, - int /* screen */, - int * /* flags */ -#endif -); - -Bool SDL_NAME(XF86DGAViewPortChanged)( -#if NeedFunctionPrototypes - Display * /* dpy */, - int /* screen */, - int /* n */ -#endif -); - - -_XFUNCPROTOEND - -#endif /* _XF86DGA_SERVER_ */ - -#endif /* _XF86DGA1_H_ */ diff --git a/src/video/Xext/extensions/xf86dga1str.h b/src/video/Xext/extensions/xf86dga1str.h deleted file mode 100644 index 5695fbd13b..0000000000 --- a/src/video/Xext/extensions/xf86dga1str.h +++ /dev/null @@ -1,194 +0,0 @@ -/* $XFree86: xc/include/extensions/xf86dga1str.h,v 1.2 1999/05/03 12:15:37 dawes Exp $ */ -/* - -Copyright (c) 1995 Jon Tombs -Copyright (c) 1995 XFree86 Inc. - -*/ - -#ifndef _XF86DGASTR1_H_ -#define _XF86DGASTR1_H_ - -typedef struct _XF86DGAQueryVersion { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_DGAQueryVersion */ - CARD16 length B16; -} xXF86DGAQueryVersionReq; -#define sz_xXF86DGAQueryVersionReq 4 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 majorVersion B16; /* major version of DGA protocol */ - CARD16 minorVersion B16; /* minor version of DGA protocol */ - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86DGAQueryVersionReply; -#define sz_xXF86DGAQueryVersionReply 32 - -typedef struct _XF86DGAGetVideoLL { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_XF86DGAGetVideoLL */ - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; -} xXF86DGAGetVideoLLReq; -#define sz_xXF86DGAGetVideoLLReq 8 - -typedef struct _XF86DGAInstallColormap{ - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD16 screen B16; - CARD16 pad2; - CARD32 id B32; /* colormap. */ -} xXF86DGAInstallColormapReq; -#define sz_xXF86DGAInstallColormapReq 12 - - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 offset B32; - CARD32 width B32; - CARD32 bank_size B32; - CARD32 ram_size B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86DGAGetVideoLLReply; -#define sz_xXF86DGAGetVideoLLReply 32 - -typedef struct _XF86DGADirectVideo { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_XF86DGADirectVideo */ - CARD16 length B16; - CARD16 screen B16; - CARD16 enable B16; -} xXF86DGADirectVideoReq; -#define sz_xXF86DGADirectVideoReq 8 - - -typedef struct _XF86DGAGetViewPortSize { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_XF86DGAGetViewPort */ - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; -} xXF86DGAGetViewPortSizeReq; -#define sz_xXF86DGAGetViewPortSizeReq 8 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 width B32; - CARD32 height B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86DGAGetViewPortSizeReply; -#define sz_xXF86DGAGetViewPortSizeReply 32 - -typedef struct _XF86DGASetViewPort { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_XF86DGASetViewPort */ - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; - CARD32 x B32; - CARD32 y B32; -} xXF86DGASetViewPortReq; -#define sz_xXF86DGASetViewPortReq 16 - -typedef struct _XF86DGAGetVidPage { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_XF86DGAGetVidPage */ - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; -} xXF86DGAGetVidPageReq; -#define sz_xXF86DGAGetVidPageReq 8 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 vpage B32; - CARD32 pad B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86DGAGetVidPageReply; -#define sz_xXF86DGAGetVidPageReply 32 - - -typedef struct _XF86DGASetVidPage { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_XF86DGASetVidPage */ - CARD16 length B16; - CARD16 screen B16; - CARD16 vpage B16; -} xXF86DGASetVidPageReq; -#define sz_xXF86DGASetVidPageReq 8 - - -typedef struct _XF86DGAQueryDirectVideo { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_DGAQueryVersion */ - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; -} xXF86DGAQueryDirectVideoReq; -#define sz_xXF86DGAQueryDirectVideoReq 8 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 flags B32; - CARD32 pad B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86DGAQueryDirectVideoReply; -#define sz_xXF86DGAQueryDirectVideoReply 32 - - -typedef struct _XF86DGAViewPortChanged { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_DGAQueryVersion */ - CARD16 length B16; - CARD16 screen B16; - CARD16 n B16; -} xXF86DGAViewPortChangedReq; -#define sz_xXF86DGAViewPortChangedReq 8 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 result B32; - CARD32 pad B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86DGAViewPortChangedReply; -#define sz_xXF86DGAViewPortChangedReply 32 - -#endif /* _XF86DGASTR1_H_ */ - diff --git a/src/video/Xext/extensions/xf86dgastr.h b/src/video/Xext/extensions/xf86dgastr.h deleted file mode 100644 index b249feb3c6..0000000000 --- a/src/video/Xext/extensions/xf86dgastr.h +++ /dev/null @@ -1,344 +0,0 @@ -/* $XFree86: xc/include/extensions/xf86dgastr.h,v 3.14 2001/08/01 00:44:36 tsi Exp $ */ -/* - -Copyright (c) 1995 Jon Tombs -Copyright (c) 1995 XFree86 Inc. - -*/ - -#ifndef _XF86DGASTR_H_ -#define _XF86DGASTR_H_ - -#include "xf86dga1str.h" - -#define XF86DGANAME "XFree86-DGA" - -#define XDGA_MAJOR_VERSION 2 /* current version numbers */ -#define XDGA_MINOR_VERSION 0 - - -typedef struct _XDGAQueryVersion { - CARD8 reqType; /* always DGAReqCode */ - CARD8 dgaReqType; /* always X_DGAQueryVersion */ - CARD16 length B16; -} xXDGAQueryVersionReq; -#define sz_xXDGAQueryVersionReq 4 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 majorVersion B16; /* major version of DGA protocol */ - CARD16 minorVersion B16; /* minor version of DGA protocol */ - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXDGAQueryVersionReply; -#define sz_xXDGAQueryVersionReply 32 - -typedef struct _XDGAQueryModes { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; -} xXDGAQueryModesReq; -#define sz_xXDGAQueryModesReq 8 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 number B32; /* number of modes available */ - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXDGAQueryModesReply; -#define sz_xXDGAQueryModesReply 32 - - -typedef struct _XDGASetMode { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD32 mode B32; /* mode number to init */ - CARD32 pid B32; /* Pixmap descriptor */ -} xXDGASetModeReq; -#define sz_xXDGASetModeReq 16 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 offset B32; /* offset into framebuffer map */ - CARD32 flags B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXDGASetModeReply; -#define sz_xXDGASetModeReply 32 - -typedef struct { - CARD8 byte_order; - CARD8 depth; - CARD16 num B16; - CARD16 bpp B16; - CARD16 name_size B16; - CARD32 vsync_num B32; - CARD32 vsync_den B32; - CARD32 flags B32; - CARD16 image_width B16; - CARD16 image_height B16; - CARD16 pixmap_width B16; - CARD16 pixmap_height B16; - CARD32 bytes_per_scanline B32; - CARD32 red_mask B32; - CARD32 green_mask B32; - CARD32 blue_mask B32; - CARD16 visual_class B16; - CARD16 pad1 B16; - CARD16 viewport_width B16; - CARD16 viewport_height B16; - CARD16 viewport_xstep B16; - CARD16 viewport_ystep B16; - CARD16 viewport_xmax B16; - CARD16 viewport_ymax B16; - CARD32 viewport_flags B32; - CARD32 reserved1 B32; - CARD32 reserved2 B32; -} xXDGAModeInfo; -#define sz_xXDGAModeInfo 72 - -typedef struct _XDGAOpenFramebuffer { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; -} xXDGAOpenFramebufferReq; -#define sz_xXDGAOpenFramebufferReq 8 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; /* device name size if there is one */ - CARD32 mem1 B32; /* physical memory */ - CARD32 mem2 B32; /* spillover for _alpha_ */ - CARD32 size B32; /* size of map in bytes */ - CARD32 offset B32; /* optional offset into device */ - CARD32 extra B32; /* extra info associated with the map */ - CARD32 pad2 B32; -} xXDGAOpenFramebufferReply; -#define sz_xXDGAOpenFramebufferReply 32 - - -typedef struct _XDGACloseFramebuffer { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; -} xXDGACloseFramebufferReq; -#define sz_xXDGACloseFramebufferReq 8 - - -typedef struct _XDGASetViewport { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD16 x B16; - CARD16 y B16; - CARD32 flags B32; -} xXDGASetViewportReq; -#define sz_xXDGASetViewportReq 16 - - -typedef struct _XDGAInstallColormap { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD32 cmap B32; -} xXDGAInstallColormapReq; -#define sz_xXDGAInstallColormapReq 12 - -typedef struct _XDGASelectInput { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD32 mask B32; -} xXDGASelectInputReq; -#define sz_xXDGASelectInputReq 12 - -typedef struct _XDGAFillRectangle { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD16 x B16; - CARD16 y B16; - CARD16 width B16; - CARD16 height B16; - CARD32 color B32; -} xXDGAFillRectangleReq; -#define sz_xXDGAFillRectangleReq 20 - - -typedef struct _XDGACopyArea { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD16 srcx B16; - CARD16 srcy B16; - CARD16 width B16; - CARD16 height B16; - CARD16 dstx B16; - CARD16 dsty B16; -} xXDGACopyAreaReq; -#define sz_xXDGACopyAreaReq 20 - -typedef struct _XDGACopyTransparentArea { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD16 srcx B16; - CARD16 srcy B16; - CARD16 width B16; - CARD16 height B16; - CARD16 dstx B16; - CARD16 dsty B16; - CARD32 key B32; -} xXDGACopyTransparentAreaReq; -#define sz_xXDGACopyTransparentAreaReq 24 - - -typedef struct _XDGAGetViewportStatus { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; -} xXDGAGetViewportStatusReq; -#define sz_xXDGAGetViewportStatusReq 8 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 status B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXDGAGetViewportStatusReply; -#define sz_xXDGAGetViewportStatusReply 32 - -typedef struct _XDGASync { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; -} xXDGASyncReq; -#define sz_xXDGASyncReq 8 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; - CARD32 pad7 B32; -} xXDGASyncReply; -#define sz_xXDGASyncReply 32 - -typedef struct _XDGASetClientVersion { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD16 major B16; - CARD16 minor B16; -} xXDGASetClientVersionReq; -#define sz_xXDGASetClientVersionReq 8 - - -typedef struct { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD16 x B16; - CARD16 y B16; - CARD32 flags B32; -} xXDGAChangePixmapModeReq; -#define sz_xXDGAChangePixmapModeReq 16 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 x B16; - CARD16 y B16; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; - CARD32 pad7 B32; -} xXDGAChangePixmapModeReply; -#define sz_xXDGAChangePixmapModeReply 32 - -typedef struct _XDGACreateColormap { - CARD8 reqType; - CARD8 dgaReqType; - CARD16 length B16; - CARD32 screen B32; - CARD32 id B32; - CARD32 mode B32; - CARD8 alloc; - CARD8 pad1; - CARD16 pad2; -} xXDGACreateColormapReq; -#define sz_xXDGACreateColormapReq 20 - - -typedef struct { - union { - struct { - BYTE type; - BYTE detail; - CARD16 sequenceNumber B16; - } u; - struct { - CARD32 pad0 B32; - CARD32 time B32; - INT16 dx B16; - INT16 dy B16; - INT16 screen B16; - CARD16 state B16; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - } event; - } u; -} dgaEvent; - - -#endif /* _XF86DGASTR_H_ */ - diff --git a/src/video/Xext/extensions/xf86vmode.h b/src/video/Xext/extensions/xf86vmode.h deleted file mode 100644 index eb56c0e8da..0000000000 --- a/src/video/Xext/extensions/xf86vmode.h +++ /dev/null @@ -1,314 +0,0 @@ -/* $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $ */ -/* - -Copyright 1995 Kaleb S. KEITHLEY - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Kaleb S. KEITHLEY -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -from Kaleb S. KEITHLEY - -*/ -/* $Xorg: xf86vmode.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ */ - -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ - -#ifndef _XF86VIDMODE_H_ -#define _XF86VIDMODE_H_ - -#include -#include -#include "SDL_name.h" - -#define X_XF86VidModeQueryVersion 0 -#define X_XF86VidModeGetModeLine 1 -#define X_XF86VidModeModModeLine 2 -#define X_XF86VidModeSwitchMode 3 -#define X_XF86VidModeGetMonitor 4 -#define X_XF86VidModeLockModeSwitch 5 -#define X_XF86VidModeGetAllModeLines 6 -#define X_XF86VidModeAddModeLine 7 -#define X_XF86VidModeDeleteModeLine 8 -#define X_XF86VidModeValidateModeLine 9 -#define X_XF86VidModeSwitchToMode 10 -#define X_XF86VidModeGetViewPort 11 -#define X_XF86VidModeSetViewPort 12 -/* new for version 2.x of this extension */ -#define X_XF86VidModeGetDotClocks 13 -#define X_XF86VidModeSetClientVersion 14 -#define X_XF86VidModeSetGamma 15 -#define X_XF86VidModeGetGamma 16 -#define X_XF86VidModeGetGammaRamp 17 -#define X_XF86VidModeSetGammaRamp 18 -#define X_XF86VidModeGetGammaRampSize 19 - -#define CLKFLAG_PROGRAMABLE 1 - -#ifdef XF86VIDMODE_EVENTS -#define XF86VidModeNotify 0 -#define XF86VidModeNumberEvents (XF86VidModeNotify + 1) - -#define XF86VidModeNotifyMask 0x00000001 - -#define XF86VidModeNonEvent 0 -#define XF86VidModeModeChange 1 -#else -#define XF86VidModeNumberEvents 0 -#endif - -#define XF86VidModeBadClock 0 -#define XF86VidModeBadHTimings 1 -#define XF86VidModeBadVTimings 2 -#define XF86VidModeModeUnsuitable 3 -#define XF86VidModeExtensionDisabled 4 -#define XF86VidModeClientNotLocal 5 -#define XF86VidModeZoomLocked 6 -#define XF86VidModeNumberErrors (XF86VidModeZoomLocked + 1) - -#ifndef _XF86VIDMODE_SERVER_ - -typedef struct { - unsigned short hdisplay; - unsigned short hsyncstart; - unsigned short hsyncend; - unsigned short htotal; - unsigned short hskew; - unsigned short vdisplay; - unsigned short vsyncstart; - unsigned short vsyncend; - unsigned short vtotal; - unsigned int flags; - int privsize; -#if defined(__cplusplus) || defined(c_plusplus) - /* private is a C++ reserved word */ - INT32 *c_private; -#else - INT32 *private; -#endif -} SDL_NAME(XF86VidModeModeLine); - -typedef struct { - unsigned int dotclock; - unsigned short hdisplay; - unsigned short hsyncstart; - unsigned short hsyncend; - unsigned short htotal; - unsigned short hskew; - unsigned short vdisplay; - unsigned short vsyncstart; - unsigned short vsyncend; - unsigned short vtotal; - unsigned int flags; - int privsize; -#if defined(__cplusplus) || defined(c_plusplus) - /* private is a C++ reserved word */ - INT32 *c_private; -#else - INT32 *private; -#endif -} SDL_NAME(XF86VidModeModeInfo); - -typedef struct { - float hi; - float lo; -} SDL_NAME(XF86VidModeSyncRange); - -typedef struct { - char* vendor; - char* model; - float EMPTY; - unsigned char nhsync; - SDL_NAME(XF86VidModeSyncRange)* hsync; - unsigned char nvsync; - SDL_NAME(XF86VidModeSyncRange)* vsync; -} SDL_NAME(XF86VidModeMonitor); - -typedef struct { - int type; /* of event */ - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent req */ - Display *display; /* Display the event was read from */ - Window root; /* root window of event screen */ - int state; /* What happened */ - int kind; /* What happened */ - Bool forced; /* extents of new region */ - Time time; /* event timestamp */ -} SDL_NAME(XF86VidModeNotifyEvent); - -typedef struct { - float red; /* Red Gamma value */ - float green; /* Green Gamma value */ - float blue; /* Blue Gamma value */ -} SDL_NAME(XF86VidModeGamma); - - -#define SDL_XF86VidModeSelectNextMode(disp, scr) \ - SDL_NAME(XF86VidModeSwitchMode)(disp, scr, 1) -#define SDL_XF86VidModeSelectPrevMode(disp, scr) \ - SDL_NAME(XF86VidModeSwitchMode)(disp, scr, -1) - -_XFUNCPROTOBEGIN - -Bool SDL_NAME(XF86VidModeQueryVersion)( - Display* /* dpy */, - int* /* majorVersion */, - int* /* minorVersion */ -); - -Bool SDL_NAME(XF86VidModeQueryExtension)( - Display* /* dpy */, - int* /* event_base */, - int* /* error_base */ -); - -Bool SDL_NAME(XF86VidModeSetClientVersion)( - Display* /* dpy */ -); - -Bool SDL_NAME(XF86VidModeGetModeLine)( - Display* /* dpy */, - int /* screen */, - int* /* dotclock */, - SDL_NAME(XF86VidModeModeLine)* /* modeline */ -); - -Bool SDL_NAME(XF86VidModeGetAllModeLines)( - Display* /* dpy */, - int /* screen */, - int* /* modecount */, - SDL_NAME(XF86VidModeModeInfo)*** /* modelinesPtr */ -); - -Bool SDL_NAME(XF86VidModeAddModeLine)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeModeInfo)* /* new modeline */, - SDL_NAME(XF86VidModeModeInfo)* /* after modeline */ -); - -Bool SDL_NAME(XF86VidModeDeleteModeLine)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeModeInfo)* /* modeline */ -); - -Bool SDL_NAME(XF86VidModeModModeLine)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeModeLine)* /* modeline */ -); - -Status SDL_NAME(XF86VidModeValidateModeLine)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeModeInfo)* /* modeline */ -); - -Bool SDL_NAME(XF86VidModeSwitchMode)( - Display* /* dpy */, - int /* screen */, - int /* zoom */ -); - -Bool SDL_NAME(XF86VidModeSwitchToMode)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeModeInfo)* /* modeline */ -); - -Bool SDL_NAME(XF86VidModeLockModeSwitch)( - Display* /* dpy */, - int /* screen */, - int /* lock */ -); - -Bool SDL_NAME(XF86VidModeGetMonitor)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeMonitor)* /* monitor */ -); - -Bool SDL_NAME(XF86VidModeGetViewPort)( - Display* /* dpy */, - int /* screen */, - int* /* x return */, - int* /* y return */ -); - -Bool SDL_NAME(XF86VidModeSetViewPort)( - Display* /* dpy */, - int /* screen */, - int /* x */, - int /* y */ -); - -Bool SDL_NAME(XF86VidModeGetDotClocks)( - Display* /* dpy */, - int /* screen */, - int* /* flags return */, - int* /* number of clocks return */, - int* /* max dot clock return */, - int** /* clocks return */ -); - -Bool SDL_NAME(XF86VidModeGetGamma)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeGamma)* /* Gamma */ -); - -Bool SDL_NAME(XF86VidModeSetGamma)( - Display* /* dpy */, - int /* screen */, - SDL_NAME(XF86VidModeGamma)* /* Gamma */ -); - -Bool SDL_NAME(XF86VidModeSetGammaRamp)( - Display* /* dpy */, - int /* screen */, - int /* size */, - unsigned short* /* red array */, - unsigned short* /* green array */, - unsigned short* /* blue array */ -); - -Bool SDL_NAME(XF86VidModeGetGammaRamp)( - Display* /* dpy */, - int /* screen */, - int /* size */, - unsigned short* /* red array */, - unsigned short* /* green array */, - unsigned short* /* blue array */ -); - -Bool SDL_NAME(XF86VidModeGetGammaRampSize)( - Display* /* dpy */, - int /* screen */, - int* /* size */ -); - - -_XFUNCPROTOEND - -#endif - -#endif diff --git a/src/video/Xext/extensions/xf86vmstr.h b/src/video/Xext/extensions/xf86vmstr.h deleted file mode 100644 index 0c3078d5aa..0000000000 --- a/src/video/Xext/extensions/xf86vmstr.h +++ /dev/null @@ -1,546 +0,0 @@ -/* $XFree86: xc/include/extensions/xf86vmstr.h,v 3.27 2001/08/01 00:44:36 tsi Exp $ */ -/* - -Copyright 1995 Kaleb S. KEITHLEY - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES -OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Kaleb S. KEITHLEY -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -from Kaleb S. KEITHLEY - -*/ -/* $Xorg: xf86vmstr.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ */ - -/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */ - -#ifndef _XF86VIDMODESTR_H_ -#define _XF86VIDMODESTR_H_ - -#include "xf86vmode.h" - -#define XF86VIDMODENAME "XFree86-VidModeExtension" - -#define XF86VIDMODE_MAJOR_VERSION 2 /* current version numbers */ -#define XF86VIDMODE_MINOR_VERSION 1 -/* - * major version 0 == uses parameter-to-wire functions in XFree86 libXxf86vm. - * major version 1 == uses parameter-to-wire functions hard-coded in xvidtune - * client. - * major version 2 == uses new protocol version in XFree86 4.0. - */ - -typedef struct _XF86VidModeQueryVersion { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86VidModeQueryVersion */ - CARD16 length B16; -} xXF86VidModeQueryVersionReq; -#define sz_xXF86VidModeQueryVersionReq 4 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 majorVersion B16; /* major version of XF86VidMode */ - CARD16 minorVersion B16; /* minor version of XF86VidMode */ - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86VidModeQueryVersionReply; -#define sz_xXF86VidModeQueryVersionReply 32 - -typedef struct _XF86VidModeGetModeLine { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; -} xXF86VidModeGetModeLineReq, - xXF86VidModeGetAllModeLinesReq, - xXF86VidModeGetMonitorReq, - xXF86VidModeGetViewPortReq, - xXF86VidModeGetDotClocksReq; -#define sz_xXF86VidModeGetModeLineReq 8 -#define sz_xXF86VidModeGetAllModeLinesReq 8 -#define sz_xXF86VidModeGetMonitorReq 8 -#define sz_xXF86VidModeGetViewPortReq 8 -#define sz_xXF86VidModeGetDotClocksReq 8 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 hskew B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD16 pad2 B16; - CARD32 flags B32; - CARD32 reserved1 B32; - CARD32 reserved2 B32; - CARD32 reserved3 B32; - CARD32 privsize B32; -} xXF86VidModeGetModeLineReply; -#define sz_xXF86VidModeGetModeLineReply 52 - -/* 0.x version */ -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD32 flags B32; - CARD32 privsize B32; -} xXF86OldVidModeGetModeLineReply; -#define sz_xXF86OldVidModeGetModeLineReply 36 - -typedef struct { - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD32 hskew B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD16 pad1 B16; - CARD32 flags B32; - CARD32 reserved1 B32; - CARD32 reserved2 B32; - CARD32 reserved3 B32; - CARD32 privsize B32; -} xXF86VidModeModeInfo; - -/* 0.x version */ -typedef struct { - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD32 flags B32; - CARD32 privsize B32; -} xXF86OldVidModeModeInfo; - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 modecount B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86VidModeGetAllModeLinesReply; -#define sz_xXF86VidModeGetAllModeLinesReply 32 - -typedef struct _XF86VidModeAddModeLine { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86VidModeAddMode */ - CARD16 length B16; - CARD32 screen B32; /* could be CARD16 but need the pad */ - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 hskew B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD16 pad1 B16; - CARD32 flags B32; - CARD32 reserved1 B32; - CARD32 reserved2 B32; - CARD32 reserved3 B32; - CARD32 privsize B32; - CARD32 after_dotclock B32; - CARD16 after_hdisplay B16; - CARD16 after_hsyncstart B16; - CARD16 after_hsyncend B16; - CARD16 after_htotal B16; - CARD16 after_hskew B16; - CARD16 after_vdisplay B16; - CARD16 after_vsyncstart B16; - CARD16 after_vsyncend B16; - CARD16 after_vtotal B16; - CARD16 pad2 B16; - CARD32 after_flags B32; - CARD32 reserved4 B32; - CARD32 reserved5 B32; - CARD32 reserved6 B32; -} xXF86VidModeAddModeLineReq; -#define sz_xXF86VidModeAddModeLineReq 92 - -/* 0.x version */ -typedef struct _XF86OldVidModeAddModeLine { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86VidModeAddMode */ - CARD16 length B16; - CARD32 screen B32; /* could be CARD16 but need the pad */ - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD32 flags B32; - CARD32 privsize B32; - CARD32 after_dotclock B32; - CARD16 after_hdisplay B16; - CARD16 after_hsyncstart B16; - CARD16 after_hsyncend B16; - CARD16 after_htotal B16; - CARD16 after_vdisplay B16; - CARD16 after_vsyncstart B16; - CARD16 after_vsyncend B16; - CARD16 after_vtotal B16; - CARD32 after_flags B32; -} xXF86OldVidModeAddModeLineReq; -#define sz_xXF86OldVidModeAddModeLineReq 60 - -typedef struct _XF86VidModeModModeLine { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86VidModeModModeLine */ - CARD16 length B16; - CARD32 screen B32; /* could be CARD16 but need the pad */ - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 hskew B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD16 pad1 B16; - CARD32 flags B32; - CARD32 reserved1 B32; - CARD32 reserved2 B32; - CARD32 reserved3 B32; - CARD32 privsize B32; -} xXF86VidModeModModeLineReq; -#define sz_xXF86VidModeModModeLineReq 48 - -/* 0.x version */ -typedef struct _XF86OldVidModeModModeLine { - CARD8 reqType; /* always XF86OldVidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86OldVidModeModModeLine */ - CARD16 length B16; - CARD32 screen B32; /* could be CARD16 but need the pad */ - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD32 flags B32; - CARD32 privsize B32; -} xXF86OldVidModeModModeLineReq; -#define sz_xXF86OldVidModeModModeLineReq 32 - -typedef struct _XF86VidModeValidateModeLine { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD32 screen B32; /* could be CARD16 but need the pad */ - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 hskew B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD16 pad1 B16; - CARD32 flags B32; - CARD32 reserved1 B32; - CARD32 reserved2 B32; - CARD32 reserved3 B32; - CARD32 privsize B32; -} xXF86VidModeDeleteModeLineReq, - xXF86VidModeValidateModeLineReq, - xXF86VidModeSwitchToModeReq; -#define sz_xXF86VidModeDeleteModeLineReq 52 -#define sz_xXF86VidModeValidateModeLineReq 52 -#define sz_xXF86VidModeSwitchToModeReq 52 - -/* 0.x version */ -typedef struct _XF86OldVidModeValidateModeLine { - CARD8 reqType; /* always XF86OldVidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD32 screen B32; /* could be CARD16 but need the pad */ - CARD32 dotclock B32; - CARD16 hdisplay B16; - CARD16 hsyncstart B16; - CARD16 hsyncend B16; - CARD16 htotal B16; - CARD16 vdisplay B16; - CARD16 vsyncstart B16; - CARD16 vsyncend B16; - CARD16 vtotal B16; - CARD32 flags B32; - CARD32 privsize B32; -} xXF86OldVidModeDeleteModeLineReq, - xXF86OldVidModeValidateModeLineReq, - xXF86OldVidModeSwitchToModeReq; -#define sz_xXF86OldVidModeDeleteModeLineReq 36 -#define sz_xXF86OldVidModeValidateModeLineReq 36 -#define sz_xXF86OldVidModeSwitchToModeReq 36 - -typedef struct _XF86VidModeSwitchMode { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86VidModeSwitchMode */ - CARD16 length B16; - CARD16 screen B16; - CARD16 zoom B16; -} xXF86VidModeSwitchModeReq; -#define sz_xXF86VidModeSwitchModeReq 8 - -typedef struct _XF86VidModeLockModeSwitch { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86VidModeLockModeSwitch */ - CARD16 length B16; - CARD16 screen B16; - CARD16 lock B16; -} xXF86VidModeLockModeSwitchReq; -#define sz_xXF86VidModeLockModeSwitchReq 8 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 status B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86VidModeValidateModeLineReply; -#define sz_xXF86VidModeValidateModeLineReply 32 - -typedef struct { - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD8 vendorLength; - CARD8 modelLength; - CARD8 nhsync; - CARD8 nvsync; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86VidModeGetMonitorReply; -#define sz_xXF86VidModeGetMonitorReply 32 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 x B32; - CARD32 y B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86VidModeGetViewPortReply; -#define sz_xXF86VidModeGetViewPortReply 32 - -typedef struct _XF86VidModeSetViewPort { - CARD8 reqType; /* always VidModeReqCode */ - CARD8 xf86vidmodeReqType; /* always X_XF86VidModeSetViewPort */ - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; - CARD32 x B32; - CARD32 y B32; -} xXF86VidModeSetViewPortReq; -#define sz_xXF86VidModeSetViewPortReq 16 - -typedef struct { - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 flags B32; - CARD32 clocks B32; - CARD32 maxclocks B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; -} xXF86VidModeGetDotClocksReply; -#define sz_xXF86VidModeGetDotClocksReply 32 - -typedef struct _XF86VidModeSetClientVersion { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD16 major B16; - CARD16 minor B16; -} xXF86VidModeSetClientVersionReq; -#define sz_xXF86VidModeSetClientVersionReq 8 - -typedef struct _XF86VidModeGetGamma { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86VidModeGetGammaReq; -#define sz_xXF86VidModeGetGammaReq 32 - -typedef struct { - BYTE type; - BOOL pad; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 red B32; - CARD32 green B32; - CARD32 blue B32; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; -} xXF86VidModeGetGammaReply; -#define sz_xXF86VidModeGetGammaReply 32 - -typedef struct _XF86VidModeSetGamma { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; - CARD32 red B32; - CARD32 green B32; - CARD32 blue B32; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; -} xXF86VidModeSetGammaReq; -#define sz_xXF86VidModeSetGammaReq 32 - - -typedef struct _XF86VidModeSetGammaRamp { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD16 screen B16; - CARD16 size B16; -} xXF86VidModeSetGammaRampReq; -#define sz_xXF86VidModeSetGammaRampReq 8 - -typedef struct _XF86VidModeGetGammaRamp { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD16 screen B16; - CARD16 size B16; -} xXF86VidModeGetGammaRampReq; -#define sz_xXF86VidModeGetGammaRampReq 8 - -typedef struct { - BYTE type; - BOOL pad; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 size B16; - CARD16 pad0 B16; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86VidModeGetGammaRampReply; -#define sz_xXF86VidModeGetGammaRampReply 32 - -typedef struct _XF86VidModeGetGammaRampSize { - CARD8 reqType; /* always XF86VidModeReqCode */ - CARD8 xf86vidmodeReqType; - CARD16 length B16; - CARD16 screen B16; - CARD16 pad B16; -} xXF86VidModeGetGammaRampSizeReq; -#define sz_xXF86VidModeGetGammaRampSizeReq 8 - -typedef struct { - BYTE type; - BOOL pad; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 size B16; - CARD16 pad0 B16; - CARD32 pad1 B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xXF86VidModeGetGammaRampSizeReply; -#define sz_xXF86VidModeGetGammaRampSizeReply 32 - - -#endif /* _XF86VIDMODESTR_H_ */ - diff --git a/src/video/Xext/extensions/xme.h b/src/video/Xext/extensions/xme.h deleted file mode 100644 index f550623c9f..0000000000 --- a/src/video/Xext/extensions/xme.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 1993-2001 by Xi Graphics, Inc. - * All Rights Reserved. - * - * Please see the LICENSE file accompanying this distribution for licensing - * information. - * - * Please send any bug fixes and modifications to src@xig.com. - * - * $XiGId: xme.h,v 1.1.1.1 2001/11/19 19:01:10 jon Exp $ - * - */ - - -#ifndef _XME_H_INCLUDED -#define _XME_H_INCLUDED - -typedef struct { - short x; - short y; - unsigned short w; - unsigned short h; -} XiGMiscViewInfo; - -typedef struct { - unsigned short width; - unsigned short height; - int refresh; -} XiGMiscResolutionInfo; - -extern Bool XiGMiscQueryVersion(Display *dpy, int *major, int *minor); -extern int XiGMiscQueryViews(Display *dpy, int screen, - XiGMiscViewInfo **pviews); -extern int XiGMiscQueryResolutions(Display *dpy, int screen, int view, - int *pactive, - XiGMiscResolutionInfo **presolutions); -extern void XiGMiscChangeResolution(Display *dpy, int screen, int view, - int width, int height, int refresh); - -/* SDL addition from Ryan: free memory used by xme. */ -extern void XiGMiscDestroy(void); - -#endif /* _XME_H_INCLUDED */ - - diff --git a/src/video/aalib/SDL_aaevents.c b/src/video/aalib/SDL_aaevents.c deleted file mode 100644 index a26ab2d0e1..0000000000 --- a/src/video/aalib/SDL_aaevents.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* Handle the event stream, converting AA events into SDL events */ - -#include - -#include - -#include "SDL.h" -#include "../../events/SDL_sysevents.h" -#include "../../events/SDL_events_c.h" -#include "SDL_aavideo.h" -#include "SDL_aaevents_c.h" - -/* The translation tables from a console scancode to a SDL keysym */ -static SDLKey keymap[401]; - -static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym); - - -void AA_PumpEvents(_THIS) -{ - int posted = 0; - int mouse_button, mouse_x, mouse_y; - int evt; - SDL_keysym keysym; - - static int prev_button = -1, prev_x = -1, prev_y = -1; - - if( ! this->screen ) /* Wait till we got the screen initialized */ - return; - - do { - posted = 0; - /* Gather events */ - - /* Get mouse status */ - SDL_mutexP(AA_mutex); - aa_getmouse (AA_context, &mouse_x, &mouse_y, &mouse_button); - SDL_mutexV(AA_mutex); - mouse_x = mouse_x * this->screen->w / aa_scrwidth (AA_context); - mouse_y = mouse_y * this->screen->h / aa_scrheight (AA_context); - - /* Compare against previous state and generate events */ - if( prev_button != mouse_button ) { - if( mouse_button & AA_BUTTON1 ) { - if ( ! (prev_button & AA_BUTTON1) ) { - posted += SDL_PrivateMouseButton(SDL_PRESSED, 1, 0, 0); - } - } else { - if ( prev_button & AA_BUTTON1 ) { - posted += SDL_PrivateMouseButton(SDL_RELEASED, 1, 0, 0); - } - } - if( mouse_button & AA_BUTTON2 ) { - if ( ! (prev_button & AA_BUTTON2) ) { - posted += SDL_PrivateMouseButton(SDL_PRESSED, 2, 0, 0); - } - } else { - if ( prev_button & AA_BUTTON2 ) { - posted += SDL_PrivateMouseButton(SDL_RELEASED, 2, 0, 0); - } - } - if( mouse_button & AA_BUTTON3 ) { - if ( ! (prev_button & AA_BUTTON3) ) { - posted += SDL_PrivateMouseButton(SDL_PRESSED, 3, 0, 0); - } - } else { - if ( prev_button & AA_BUTTON3 ) { - posted += SDL_PrivateMouseButton(SDL_RELEASED, 3, 0, 0); - } - } - } - if ( prev_x != mouse_x || prev_y != mouse_y ) { - posted += SDL_PrivateMouseMotion(0, 0, mouse_x, mouse_y); - } - - prev_button = mouse_button; - prev_x = mouse_x; prev_y = mouse_y; - - /* Get keyboard event */ - SDL_mutexP(AA_mutex); - evt = aa_getevent(AA_context, 0); - SDL_mutexV(AA_mutex); - if ( (evt > AA_NONE) && (evt < AA_RELEASE) && (evt != AA_MOUSE) && (evt != AA_RESIZE) ) { - /* Key pressed */ -/* printf("Key pressed: %d (%c)\n", evt, evt); */ - posted += SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(evt, &keysym)); - } else if ( evt >= AA_RELEASE ) { - /* Key released */ - evt &= ~AA_RELEASE; -/* printf("Key released: %d (%c)\n", evt, evt); */ - posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(evt, &keysym)); - } - } while ( posted ); -} - -void AA_InitOSKeymap(_THIS) -{ - int i; - static const char *std_keys = " 01234567890&#'()_-|$*+-=/\\:;.,!?<>{}[]@~%^\x9"; - const char *std; - - /* Initialize the AAlib key translation table */ - for ( i=0; i= SDL_arraysize(keymap) ) - scancode = AA_UNKNOWN; - - /* Set the keysym information */ - keysym->scancode = scancode; - keysym->sym = keymap[scancode]; - keysym->mod = KMOD_NONE; - - /* If UNICODE is on, get the UNICODE value for the key */ - keysym->unicode = 0; - if ( SDL_TranslateUNICODE ) { - /* Populate the unicode field with the ASCII value */ - keysym->unicode = scancode; - } - return(keysym); -} diff --git a/src/video/aalib/SDL_aaevents_c.h b/src/video/aalib/SDL_aaevents_c.h deleted file mode 100644 index 6dbc9f691f..0000000000 --- a/src/video/aalib/SDL_aaevents_c.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include "SDL_aavideo.h" - -/* Variables and functions exported by SDL_sysevents.c to other parts - of the native video subsystem (SDL_sysvideo.c) -*/ -extern void AA_initkeymaps(int fd); -extern void AA_mousecallback(int button, int dx, int dy, - int u1,int u2,int u3, int u4); -extern void AA_keyboardcallback(int scancode, int pressed); - -extern void AA_InitOSKeymap(_THIS); -extern void AA_PumpEvents(_THIS); diff --git a/src/video/aalib/SDL_aamouse.c b/src/video/aalib/SDL_aamouse.c deleted file mode 100644 index dc784a56f9..0000000000 --- a/src/video/aalib/SDL_aamouse.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include - -#include "SDL_mouse.h" -#include "../../events/SDL_events_c.h" - -#include "SDL_aamouse_c.h" - - -/* The implementation dependent data for the window manager cursor */ -struct WMcursor { - int unused; -}; diff --git a/src/video/aalib/SDL_aamouse_c.h b/src/video/aalib/SDL_aamouse_c.h deleted file mode 100644 index 6ce3d9863b..0000000000 --- a/src/video/aalib/SDL_aamouse_c.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#include "SDL_aavideo.h" - -/* Functions to be exported */ diff --git a/src/video/aalib/SDL_aavideo.c b/src/video/aalib/SDL_aavideo.c deleted file mode 100644 index e6d5d3e4ce..0000000000 --- a/src/video/aalib/SDL_aavideo.c +++ /dev/null @@ -1,388 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* AAlib based SDL video driver implementation. -*/ - -#include -#include - - -#include "SDL_video.h" -#include "SDL_mouse.h" -#include "../SDL_sysvideo.h" -#include "../SDL_pixels_c.h" -#include "../../events/SDL_events_c.h" - -#include "SDL_aavideo.h" -#include "SDL_aaevents_c.h" -#include "SDL_aamouse_c.h" - -#include - -/* Initialization/Query functions */ -static int AA_VideoInit(_THIS, SDL_PixelFormat *vformat); -static SDL_Rect **AA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); -static SDL_Surface *AA_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags); -static int AA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors); -static void AA_VideoQuit(_THIS); - -/* Hardware surface functions */ -static int AA_AllocHWSurface(_THIS, SDL_Surface *surface); -static int AA_LockHWSurface(_THIS, SDL_Surface *surface); -static int AA_FlipHWSurface(_THIS, SDL_Surface *surface); -static void AA_UnlockHWSurface(_THIS, SDL_Surface *surface); -static void AA_FreeHWSurface(_THIS, SDL_Surface *surface); - -/* Cache the VideoDevice struct */ -static struct SDL_VideoDevice *local_this; - -/* AAlib driver bootstrap functions */ - -static int AA_Available(void) -{ - return 1; /* Always available ! */ -} - -static void AA_DeleteDevice(SDL_VideoDevice *device) -{ - SDL_free(device->hidden); - SDL_free(device); -} - -static SDL_VideoDevice *AA_CreateDevice(int devindex) -{ - SDL_VideoDevice *device; - - /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice)); - if ( device ) { - SDL_memset(device, 0, (sizeof *device)); - device->hidden = (struct SDL_PrivateVideoData *) - SDL_malloc((sizeof *device->hidden)); - } - if ( (device == NULL) || (device->hidden == NULL) ) { - SDL_OutOfMemory(); - if ( device ) { - SDL_free(device); - } - return(0); - } - SDL_memset(device->hidden, 0, (sizeof *device->hidden)); - - /* Set the function pointers */ - device->VideoInit = AA_VideoInit; - device->ListModes = AA_ListModes; - device->SetVideoMode = AA_SetVideoMode; - device->CreateYUVOverlay = NULL; - device->SetColors = AA_SetColors; - device->UpdateRects = NULL; - device->VideoQuit = AA_VideoQuit; - device->AllocHWSurface = AA_AllocHWSurface; - device->CheckHWBlit = NULL; - device->FillHWRect = NULL; - device->SetHWColorKey = NULL; - device->SetHWAlpha = NULL; - device->LockHWSurface = AA_LockHWSurface; - device->UnlockHWSurface = AA_UnlockHWSurface; - device->FlipHWSurface = NULL; - device->FreeHWSurface = AA_FreeHWSurface; - device->SetCaption = NULL; - device->SetIcon = NULL; - device->IconifyWindow = NULL; - device->GrabInput = NULL; - device->GetWMInfo = NULL; - device->InitOSKeymap = AA_InitOSKeymap; - device->PumpEvents = AA_PumpEvents; - - device->free = AA_DeleteDevice; - - return device; -} - -VideoBootStrap AALIB_bootstrap = { - "aalib", "ASCII Art Library", - AA_Available, AA_CreateDevice -}; - -static void AA_ResizeHandler(aa_context *); - -int AA_VideoInit(_THIS, SDL_PixelFormat *vformat) -{ - int keyboard; - int i; - - /* Initialize all variables that we clean on shutdown */ - for ( i=0; ix = SDL_modelist[i]->y = 0; - } - /* Modes sorted largest to smallest */ - SDL_modelist[0]->w = 1024; SDL_modelist[0]->h = 768; - SDL_modelist[1]->w = 800; SDL_modelist[1]->h = 600; - SDL_modelist[2]->w = 640; SDL_modelist[2]->h = 480; - SDL_modelist[3]->w = 320; SDL_modelist[3]->h = 400; - SDL_modelist[4]->w = 320; SDL_modelist[4]->h = 240; - SDL_modelist[5]->w = 320; SDL_modelist[5]->h = 200; - SDL_modelist[6] = NULL; - - /* Initialize the library */ - - AA_mutex = SDL_CreateMutex(); - - aa_parseoptions (NULL, NULL, NULL, NULL); - - AA_context = aa_autoinit(&aa_defparams); - if ( ! AA_context ) { - SDL_SetError("Unable to initialize AAlib"); - return(-1); - } - - /* Enable mouse and keyboard support */ - - if ( ! aa_autoinitkbd (AA_context, AA_SENDRELEASE) ) { - SDL_SetError("Unable to initialize AAlib keyboard"); - return(-1); - } - if ( ! aa_autoinitmouse (AA_context, AA_SENDRELEASE) ) { - fprintf(stderr,"Warning: Unable to initialize AAlib mouse"); - } - AA_rparams = aa_getrenderparams(); - - local_this = this; - - aa_resizehandler(AA_context, AA_ResizeHandler); - - fprintf(stderr,"Using AAlib driver: %s (%s)\n", AA_context->driver->name, AA_context->driver->shortname); - - AA_in_x11 = (SDL_strcmp(AA_context->driver->shortname,"X11") == 0); - /* Determine the screen depth (use default 8-bit depth) */ - vformat->BitsPerPixel = 8; - vformat->BytesPerPixel = 1; - - /* We're done! */ - return(0); -} - -SDL_Rect **AA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) -{ - if(format->BitsPerPixel != 8) - return NULL; - - if ( flags & SDL_FULLSCREEN ) { - return SDL_modelist; - } else { - return (SDL_Rect **) -1; - } -} - -/* From aavga.c - AAlib does not give us the choice of the actual resolution, thus we have to simulate additional - resolution by scaling down manually each frame -*/ -static void fastscale (register char *b1, register char *b2, int x1, int x2, int y1, int y2) -{ - register int ex, spx = 0, ddx, ddx1; - int ddy1, ddy, spy = 0, ey; - int x; - char *bb1 = b1; - if (!x1 || !x2 || !y1 || !y2) - return; - ddx = x1 + x1; - ddx1 = x2 + x2; - if (ddx1 < ddx) - spx = ddx / ddx1, ddx %= ddx1; - ddy = y1 + y1; - ddy1 = y2 + y2; - if (ddy1 < ddy) - spy = (ddy / ddy1) * x1, ddy %= ddy1; - ey = -ddy1; - for (; y2; y2--) { - ex = -ddx1; - for (x = x2; x; x--) { - *b2 = *b1; - b2++; - b1 += spx; - ex += ddx; - if (ex > 0) { - b1++; - ex -= ddx1; - } - } - bb1 += spy; - ey += ddy; - if (ey > 0) { - bb1 += x1; - ey -= ddy1; - } - b1 = bb1; - } -} - -/* Various screen update functions available */ -static void AA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects); - -SDL_Surface *AA_SetVideoMode(_THIS, SDL_Surface *current, - int width, int height, int bpp, Uint32 flags) -{ - int mode; - - if ( AA_buffer ) { - SDL_free( AA_buffer ); - } - - AA_buffer = SDL_malloc(width * height); - if ( ! AA_buffer ) { - SDL_SetError("Couldn't allocate buffer for requested mode"); - return(NULL); - } - -/* printf("Setting mode %dx%d\n", width, height); */ - - SDL_memset(aa_image(AA_context), 0, aa_imgwidth(AA_context) * aa_imgheight(AA_context)); - SDL_memset(AA_buffer, 0, width * height); - - /* Allocate the new pixel format for the screen */ - if ( ! SDL_ReallocFormat(current, 8, 0, 0, 0, 0) ) { - return(NULL); - } - - /* Set up the new mode framebuffer */ - current->flags = SDL_FULLSCREEN; - AA_w = current->w = width; - AA_h = current->h = height; - current->pitch = current->w; - current->pixels = AA_buffer; - - AA_x_ratio = ((double)aa_imgwidth(AA_context)) / ((double)width); - AA_y_ratio = ((double)aa_imgheight(AA_context)) / ((double)height); - - /* Set the blit function */ - this->UpdateRects = AA_DirectUpdate; - - /* We're done */ - return(current); -} - -static void AA_ResizeHandler(aa_context *context) -{ - aa_resize(context); - local_this->hidden->x_ratio = ((double)aa_imgwidth(context)) / ((double)local_this->screen->w); - local_this->hidden->y_ratio = ((double)aa_imgheight(context)) / ((double)local_this->screen->h); - - fastscale (local_this->hidden->buffer, aa_image(context), local_this->hidden->w, aa_imgwidth (context), local_this->hidden->h, aa_imgheight (context)); - aa_renderpalette(context, local_this->hidden->palette, local_this->hidden->rparams, 0, 0, aa_scrwidth(context), aa_scrheight(context)); - aa_flush(context); -} - -/* We don't actually allow hardware surfaces other than the main one */ -static int AA_AllocHWSurface(_THIS, SDL_Surface *surface) -{ - return(-1); -} -static void AA_FreeHWSurface(_THIS, SDL_Surface *surface) -{ - return; -} - -/* We need to wait for vertical retrace on page flipped displays */ -static int AA_LockHWSurface(_THIS, SDL_Surface *surface) -{ - /* TODO ? */ - return(0); -} -static void AA_UnlockHWSurface(_THIS, SDL_Surface *surface) -{ - return; -} - -/* FIXME: How is this done with AAlib? */ -static int AA_FlipHWSurface(_THIS, SDL_Surface *surface) -{ - SDL_mutexP(AA_mutex); - aa_flush(AA_context); - SDL_mutexV(AA_mutex); - return(0); -} - -static void AA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects) -{ - int i; - SDL_Rect *rect; - - fastscale (AA_buffer, aa_image(AA_context), AA_w, aa_imgwidth (AA_context), AA_h, aa_imgheight (AA_context)); -#if 1 - aa_renderpalette(AA_context, AA_palette, AA_rparams, 0, 0, aa_scrwidth(AA_context), aa_scrheight(AA_context)); -#else - /* Render only the rectangles in the list */ - printf("Update rects : "); - for ( i=0; i < numrects; ++i ) { - rect = &rects[i]; - printf("(%d,%d-%d,%d)", rect->x, rect->y, rect->w, rect->h); - aa_renderpalette(AA_context, AA_palette, AA_rparams, rect->x * AA_x_ratio, rect->y * AA_y_ratio, rect->w * AA_x_ratio, rect->h * AA_y_ratio); - } - printf("\n"); -#endif - SDL_mutexP(AA_mutex); - aa_flush(AA_context); - SDL_mutexV(AA_mutex); - return; -} - -int AA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) -{ - int i; - - for ( i=0; i < ncolors; i++ ) { - aa_setpalette(AA_palette, firstcolor + i, - colors[i].r>>2, - colors[i].g>>2, - colors[i].b>>2); - } - return(1); -} - -/* Note: If we are terminated, this could be called in the middle of - another SDL video routine -- notably UpdateRects. -*/ -void AA_VideoQuit(_THIS) -{ - int i; - - aa_uninitkbd(AA_context); - aa_uninitmouse(AA_context); - - /* Free video mode lists */ - for ( i=0; iscreen->pixels = NULL; -} diff --git a/src/video/aalib/SDL_aavideo.h b/src/video/aalib/SDL_aavideo.h deleted file mode 100644 index 987edc9768..0000000000 --- a/src/video/aalib/SDL_aavideo.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _SDL_aavideo_h -#define _SDL_aavideo_h - -#include "SDL_mouse.h" -#include "SDL_mutex.h" -#include "../SDL_sysvideo.h" - -#include - -/* Hidden "this" pointer for the video functions */ -#define _THIS SDL_VideoDevice *this - -#define SDL_NUMMODES 6 - -/* Private display data */ -struct SDL_PrivateVideoData { - SDL_Rect *SDL_modelist[SDL_NUMMODES+1]; - aa_context *context; - aa_palette palette; - aa_renderparams *rparams; - double x_ratio, y_ratio; - int w, h; - SDL_mutex *mutex; - int in_x11; - void *buffer; -}; - -/* Old variable names */ -#define SDL_modelist (this->hidden->SDL_modelist) -#define AA_context (this->hidden->context) -#define AA_palette (this->hidden->palette) -#define AA_rparams (this->hidden->rparams) -#define AA_buffer (this->hidden->buffer) - -#define AA_x_ratio (this->hidden->x_ratio) -#define AA_y_ratio (this->hidden->y_ratio) - -#define AA_mutex (this->hidden->mutex) -#define AA_in_x11 (this->hidden->in_x11) -#define AA_w (this->hidden->w) -#define AA_h (this->hidden->h) - -#endif /* _SDL_aavideo_h */ diff --git a/src/video/android/SDL_androidclipboard.c b/src/video/android/SDL_androidclipboard.c new file mode 100644 index 0000000000..19a70a305d --- /dev/null +++ b/src/video/android/SDL_androidclipboard.c @@ -0,0 +1,48 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +#include "SDL_androidvideo.h" + +#include "../../core/android/SDL_android.h" + +int +Android_SetClipboardText(_THIS, const char *text) +{ + return Android_JNI_SetClipboardText(text); +} + +char * +Android_GetClipboardText(_THIS) +{ + return Android_JNI_GetClipboardText(); +} + +SDL_bool Android_HasClipboardText(_THIS) +{ + return Android_JNI_HasClipboardText(); +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidclipboard.h b/src/video/android/SDL_androidclipboard.h new file mode 100644 index 0000000000..d1cdaf1c47 --- /dev/null +++ b/src/video/android/SDL_androidclipboard.h @@ -0,0 +1,32 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_androidclipboard_h +#define _SDL_androidclipboard_h + +extern int Android_SetClipboardText(_THIS, const char *text); +extern char *Android_GetClipboardText(_THIS); +extern SDL_bool Android_HasClipboardText(_THIS); + +#endif /* _SDL_androidclipboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c new file mode 100644 index 0000000000..528fce5c66 --- /dev/null +++ b/src/video/android/SDL_androidevents.c @@ -0,0 +1,88 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +/* We're going to do this by default */ +#define SDL_ANDROID_BLOCK_ON_PAUSE 1 + +#include "SDL_androidevents.h" +#include "SDL_events.h" + +void +Android_PumpEvents(_THIS) +{ + static int isPaused = 0; +#if SDL_ANDROID_BLOCK_ON_PAUSE + static int isPausing = 0; +#endif + /* No polling necessary */ + + /* + * Android_ResumeSem and Android_PauseSem are signaled from Java_org_libsdl_app_SDLActivity_nativePause and Java_org_libsdl_app_SDLActivity_nativeResume + * When the pause semaphore is signaled, if SDL_ANDROID_BLOCK_ON_PAUSE is defined the event loop will block until the resume signal is emitted. + * When the resume semaphore is signaled, SDL_GL_CreateContext is called which in turn calls Java code + * SDLActivity::createGLContext -> SDLActivity:: initEGL -> SDLActivity::createEGLSurface -> SDLActivity::createEGLContext + */ + +#if SDL_ANDROID_BLOCK_ON_PAUSE + if (isPaused && !isPausing) { + if(SDL_SemWait(Android_ResumeSem) == 0) { +#else + if (isPaused) { + if(SDL_SemTryWait(Android_ResumeSem) == 0) { +#endif + isPaused = 0; + /* TODO: Should we double check if we are on the same thread as the one that made the original GL context? + * This call will go through the following chain of calls in Java: + * SDLActivity::createGLContext -> SDLActivity:: initEGL -> SDLActivity::createEGLSurface -> SDLActivity::createEGLContext + * SDLActivity::createEGLContext will attempt to restore the GL context first, and if that fails it will create a new one + * If a new GL context is created, the user needs to restore the textures manually (TODO: notify the user that this happened with a message) + */ + SDL_GL_CreateContext(Android_Window); + } + } + else { +#if SDL_ANDROID_BLOCK_ON_PAUSE + if( isPausing || SDL_SemTryWait(Android_PauseSem) == 0 ) { + /* We've been signaled to pause, but before we block ourselves, we need to make sure that + SDL_WINDOWEVENT_FOCUS_LOST and SDL_WINDOWEVENT_MINIMIZED have reached the app */ + if (SDL_HasEvent(SDL_WINDOWEVENT)) { + isPausing = 1; + } + else { + isPausing = 0; + isPaused = 1; + } + } +#else + if(SDL_SemTryWait(Android_PauseSem) == 0) { + /* If we fall in here, the system is/was paused */ + isPaused = 1; + } +#endif + } +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidevents.h b/src/video/android/SDL_androidevents.h new file mode 100644 index 0000000000..970131c712 --- /dev/null +++ b/src/video/android/SDL_androidevents.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_androidvideo.h" + +extern void Android_PumpEvents(_THIS); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidgl.c b/src/video/android/SDL_androidgl.c new file mode 100644 index 0000000000..6902bc1d03 --- /dev/null +++ b/src/video/android/SDL_androidgl.c @@ -0,0 +1,129 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +/* Android SDL video driver implementation */ + +#include "SDL_video.h" + +#include "SDL_androidvideo.h" +#include "../../core/android/SDL_android.h" + +#include + +#include + +static void* Android_GLHandle = NULL; + +/* GL functions */ +int +Android_GL_LoadLibrary(_THIS, const char *path) +{ + if (!Android_GLHandle) { + Android_GLHandle = dlopen("libGLESv1_CM.so",RTLD_GLOBAL); + if (!Android_GLHandle) { + return SDL_SetError("Could not initialize GL ES library\n"); + } + } + return 0; +} + +void * +Android_GL_GetProcAddress(_THIS, const char *proc) +{ + /* + !!! FIXME: this _should_ use eglGetProcAddress(), but it appears to be + !!! FIXME: busted on Android at the moment... + !!! FIXME: http://code.google.com/p/android/issues/detail?id=7681 + !!! FIXME: ...so revisit this later. --ryan. + */ + return dlsym(Android_GLHandle, proc); +} + +void +Android_GL_UnloadLibrary(_THIS) +{ + if(Android_GLHandle) { + dlclose(Android_GLHandle); + Android_GLHandle = NULL; + } +} + +SDL_GLContext +Android_GL_CreateContext(_THIS, SDL_Window * window) +{ + if (!Android_JNI_CreateContext(_this->gl_config.major_version, + _this->gl_config.minor_version, + _this->gl_config.red_size, + _this->gl_config.green_size, + _this->gl_config.blue_size, + _this->gl_config.alpha_size, + _this->gl_config.buffer_size, + _this->gl_config.depth_size, + _this->gl_config.stencil_size, + _this->gl_config.multisamplebuffers, + _this->gl_config.multisamplesamples)) { + SDL_SetError("Couldn't create OpenGL context - see Android log for details"); + return NULL; + } + return (SDL_GLContext)1; +} + +int +Android_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +{ + /* There's only one context, nothing to do... */ + return 0; +} + +int +Android_GL_SetSwapInterval(_THIS, int interval) +{ + __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SetSwapInterval\n"); + return 0; +} + +int +Android_GL_GetSwapInterval(_THIS) +{ + __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n"); + return 0; +} + +void +Android_GL_SwapWindow(_THIS, SDL_Window * window) +{ + Android_JNI_SwapWindow(); +} + +void +Android_GL_DeleteContext(_THIS, SDL_GLContext context) +{ + if (context) { + Android_JNI_DeleteContext(); + } +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c new file mode 100644 index 0000000000..5381de64d4 --- /dev/null +++ b/src/video/android/SDL_androidkeyboard.c @@ -0,0 +1,333 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +#include + +#include "../../events/SDL_events_c.h" + +#include "SDL_androidkeyboard.h" + +#include "../../core/android/SDL_android.h" + +void Android_InitKeyboard(void) +{ + SDL_Keycode keymap[SDL_NUM_SCANCODES]; + + /* Add default scancode to key mapping */ + SDL_GetDefaultKeymap(keymap); + SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); +} + +static SDL_Scancode Android_Keycodes[] = { + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_UNKNOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_LEFT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_RIGHT */ + SDL_SCANCODE_AC_HOME, /* AKEYCODE_HOME */ + SDL_SCANCODE_AC_BACK, /* AKEYCODE_BACK */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALL */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ENDCALL */ + SDL_SCANCODE_0, /* AKEYCODE_0 */ + SDL_SCANCODE_1, /* AKEYCODE_1 */ + SDL_SCANCODE_2, /* AKEYCODE_2 */ + SDL_SCANCODE_3, /* AKEYCODE_3 */ + SDL_SCANCODE_4, /* AKEYCODE_4 */ + SDL_SCANCODE_5, /* AKEYCODE_5 */ + SDL_SCANCODE_6, /* AKEYCODE_6 */ + SDL_SCANCODE_7, /* AKEYCODE_7 */ + SDL_SCANCODE_8, /* AKEYCODE_8 */ + SDL_SCANCODE_9, /* AKEYCODE_9 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STAR */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_POUND */ + SDL_SCANCODE_UP, /* AKEYCODE_DPAD_UP */ + SDL_SCANCODE_DOWN, /* AKEYCODE_DPAD_DOWN */ + SDL_SCANCODE_LEFT, /* AKEYCODE_DPAD_LEFT */ + SDL_SCANCODE_RIGHT, /* AKEYCODE_DPAD_RIGHT */ + SDL_SCANCODE_SELECT, /* AKEYCODE_DPAD_CENTER */ + SDL_SCANCODE_VOLUMEUP, /* AKEYCODE_VOLUME_UP */ + SDL_SCANCODE_VOLUMEDOWN, /* AKEYCODE_VOLUME_DOWN */ + SDL_SCANCODE_POWER, /* AKEYCODE_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAMERA */ + SDL_SCANCODE_CLEAR, /* AKEYCODE_CLEAR */ + SDL_SCANCODE_A, /* AKEYCODE_A */ + SDL_SCANCODE_B, /* AKEYCODE_B */ + SDL_SCANCODE_C, /* AKEYCODE_C */ + SDL_SCANCODE_D, /* AKEYCODE_D */ + SDL_SCANCODE_E, /* AKEYCODE_E */ + SDL_SCANCODE_F, /* AKEYCODE_F */ + SDL_SCANCODE_G, /* AKEYCODE_G */ + SDL_SCANCODE_H, /* AKEYCODE_H */ + SDL_SCANCODE_I, /* AKEYCODE_I */ + SDL_SCANCODE_J, /* AKEYCODE_J */ + SDL_SCANCODE_K, /* AKEYCODE_K */ + SDL_SCANCODE_L, /* AKEYCODE_L */ + SDL_SCANCODE_M, /* AKEYCODE_M */ + SDL_SCANCODE_N, /* AKEYCODE_N */ + SDL_SCANCODE_O, /* AKEYCODE_O */ + SDL_SCANCODE_P, /* AKEYCODE_P */ + SDL_SCANCODE_Q, /* AKEYCODE_Q */ + SDL_SCANCODE_R, /* AKEYCODE_R */ + SDL_SCANCODE_S, /* AKEYCODE_S */ + SDL_SCANCODE_T, /* AKEYCODE_T */ + SDL_SCANCODE_U, /* AKEYCODE_U */ + SDL_SCANCODE_V, /* AKEYCODE_V */ + SDL_SCANCODE_W, /* AKEYCODE_W */ + SDL_SCANCODE_X, /* AKEYCODE_X */ + SDL_SCANCODE_Y, /* AKEYCODE_Y */ + SDL_SCANCODE_Z, /* AKEYCODE_Z */ + SDL_SCANCODE_COMMA, /* AKEYCODE_COMMA */ + SDL_SCANCODE_PERIOD, /* AKEYCODE_PERIOD */ + SDL_SCANCODE_LALT, /* AKEYCODE_ALT_LEFT */ + SDL_SCANCODE_RALT, /* AKEYCODE_ALT_RIGHT */ + SDL_SCANCODE_LSHIFT, /* AKEYCODE_SHIFT_LEFT */ + SDL_SCANCODE_RSHIFT, /* AKEYCODE_SHIFT_RIGHT */ + SDL_SCANCODE_TAB, /* AKEYCODE_TAB */ + SDL_SCANCODE_SPACE, /* AKEYCODE_SPACE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SYM */ + SDL_SCANCODE_WWW, /* AKEYCODE_EXPLORER */ + SDL_SCANCODE_MAIL, /* AKEYCODE_ENVELOPE */ + SDL_SCANCODE_RETURN, /* AKEYCODE_ENTER */ + SDL_SCANCODE_BACKSPACE, /* AKEYCODE_DEL */ + SDL_SCANCODE_GRAVE, /* AKEYCODE_GRAVE */ + SDL_SCANCODE_MINUS, /* AKEYCODE_MINUS */ + SDL_SCANCODE_EQUALS, /* AKEYCODE_EQUALS */ + SDL_SCANCODE_LEFTBRACKET, /* AKEYCODE_LEFT_BRACKET */ + SDL_SCANCODE_RIGHTBRACKET, /* AKEYCODE_RIGHT_BRACKET */ + SDL_SCANCODE_BACKSLASH, /* AKEYCODE_BACKSLASH */ + SDL_SCANCODE_SEMICOLON, /* AKEYCODE_SEMICOLON */ + SDL_SCANCODE_APOSTROPHE, /* AKEYCODE_APOSTROPHE */ + SDL_SCANCODE_SLASH, /* AKEYCODE_SLASH */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HEADSETHOOK */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FOCUS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PLUS */ + SDL_SCANCODE_MENU, /* AKEYCODE_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NOTIFICATION */ + SDL_SCANCODE_AC_SEARCH, /* AKEYCODE_SEARCH */ + SDL_SCANCODE_AUDIOPLAY, /* AKEYCODE_MEDIA_PLAY_PAUSE */ + SDL_SCANCODE_AUDIOSTOP, /* AKEYCODE_MEDIA_STOP */ + SDL_SCANCODE_AUDIONEXT, /* AKEYCODE_MEDIA_NEXT */ + SDL_SCANCODE_AUDIOPREV, /* AKEYCODE_MEDIA_PREVIOUS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_REWIND */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_FAST_FORWARD */ + SDL_SCANCODE_MUTE, /* AKEYCODE_MUTE */ + SDL_SCANCODE_PAGEUP, /* AKEYCODE_PAGE_UP */ + SDL_SCANCODE_PAGEDOWN, /* AKEYCODE_PAGE_DOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PICTSYMBOLS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SWITCH_CHARSET */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_A */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_B */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_C */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_X */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Y */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Z */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBL */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBR */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_START */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_SELECT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_MODE */ + SDL_SCANCODE_ESCAPE, /* AKEYCODE_ESCAPE */ + SDL_SCANCODE_DELETE, /* AKEYCODE_FORWARD_DEL */ + SDL_SCANCODE_LCTRL, /* AKEYCODE_CTRL_LEFT */ + SDL_SCANCODE_RCTRL, /* AKEYCODE_CTRL_RIGHT */ + SDL_SCANCODE_CAPSLOCK, /* AKEYCODE_CAPS_LOCK */ + SDL_SCANCODE_SCROLLLOCK, /* AKEYCODE_SCROLL_LOCK */ + SDL_SCANCODE_LGUI, /* AKEYCODE_META_LEFT */ + SDL_SCANCODE_RGUI, /* AKEYCODE_META_RIGHT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FUNCTION */ + SDL_SCANCODE_PRINTSCREEN, /* AKEYCODE_SYSRQ */ + SDL_SCANCODE_PAUSE, /* AKEYCODE_BREAK */ + SDL_SCANCODE_HOME, /* AKEYCODE_MOVE_HOME */ + SDL_SCANCODE_END, /* AKEYCODE_MOVE_END */ + SDL_SCANCODE_INSERT, /* AKEYCODE_INSERT */ + SDL_SCANCODE_AC_FORWARD, /* AKEYCODE_FORWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PLAY */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PAUSE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_CLOSE */ + SDL_SCANCODE_EJECT, /* AKEYCODE_MEDIA_EJECT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_RECORD */ + SDL_SCANCODE_F1, /* AKEYCODE_F1 */ + SDL_SCANCODE_F2, /* AKEYCODE_F2 */ + SDL_SCANCODE_F3, /* AKEYCODE_F3 */ + SDL_SCANCODE_F4, /* AKEYCODE_F4 */ + SDL_SCANCODE_F5, /* AKEYCODE_F5 */ + SDL_SCANCODE_F6, /* AKEYCODE_F6 */ + SDL_SCANCODE_F7, /* AKEYCODE_F7 */ + SDL_SCANCODE_F8, /* AKEYCODE_F8 */ + SDL_SCANCODE_F9, /* AKEYCODE_F9 */ + SDL_SCANCODE_F10, /* AKEYCODE_F10 */ + SDL_SCANCODE_F11, /* AKEYCODE_F11 */ + SDL_SCANCODE_F12, /* AKEYCODE_F12 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM_LOCK */ + SDL_SCANCODE_KP_0, /* AKEYCODE_NUMPAD_0 */ + SDL_SCANCODE_KP_1, /* AKEYCODE_NUMPAD_1 */ + SDL_SCANCODE_KP_2, /* AKEYCODE_NUMPAD_2 */ + SDL_SCANCODE_KP_3, /* AKEYCODE_NUMPAD_3 */ + SDL_SCANCODE_KP_4, /* AKEYCODE_NUMPAD_4 */ + SDL_SCANCODE_KP_5, /* AKEYCODE_NUMPAD_5 */ + SDL_SCANCODE_KP_6, /* AKEYCODE_NUMPAD_6 */ + SDL_SCANCODE_KP_7, /* AKEYCODE_NUMPAD_7 */ + SDL_SCANCODE_KP_8, /* AKEYCODE_NUMPAD_8 */ + SDL_SCANCODE_KP_9, /* AKEYCODE_NUMPAD_9 */ + SDL_SCANCODE_KP_DIVIDE, /* AKEYCODE_NUMPAD_DIVIDE */ + SDL_SCANCODE_KP_MULTIPLY, /* AKEYCODE_NUMPAD_MULTIPLY */ + SDL_SCANCODE_KP_MINUS, /* AKEYCODE_NUMPAD_SUBTRACT */ + SDL_SCANCODE_KP_PLUS, /* AKEYCODE_NUMPAD_ADD */ + SDL_SCANCODE_KP_PERIOD, /* AKEYCODE_NUMPAD_DOT */ + SDL_SCANCODE_KP_COMMA, /* AKEYCODE_NUMPAD_COMMA */ + SDL_SCANCODE_KP_ENTER, /* AKEYCODE_NUMPAD_ENTER */ + SDL_SCANCODE_KP_EQUALS, /* AKEYCODE_NUMPAD_EQUALS */ + SDL_SCANCODE_KP_LEFTPAREN, /* AKEYCODE_NUMPAD_LEFT_PAREN */ + SDL_SCANCODE_KP_RIGHTPAREN, /* AKEYCODE_NUMPAD_RIGHT_PAREN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOLUME_MUTE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_INFO */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_UP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_DOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_IN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_OUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WINDOW */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_GUIDE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DVR */ + SDL_SCANCODE_AC_BOOKMARKS, /* AKEYCODE_BOOKMARK */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAPTIONS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SETTINGS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_INPUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_INPUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_RED */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_GREEN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_YELLOW */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_BLUE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_APP_SWITCH */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_3 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_4 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_5 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_6 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_7 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_8 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_9 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_10 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_11 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_12 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_13 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_14 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_15 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_16 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LANGUAGE_SWITCH */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MANNER_MODE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_3D_MODE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CONTACTS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALENDAR */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUSIC */ + SDL_SCANCODE_CALCULATOR, /* AKEYCODE_CALCULATOR */ + SDL_SCANCODE_LANG5, /* AKEYCODE_ZENKAKU_HANKAKU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EISU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUHENKAN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HENKAN */ + SDL_SCANCODE_LANG3, /* AKEYCODE_KATAKANA_HIRAGANA */ + SDL_SCANCODE_INTERNATIONAL3, /* AKEYCODE_YEN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_RO */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_KANA */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ASSIST */ + SDL_SCANCODE_BRIGHTNESSDOWN, /* AKEYCODE_BRIGHTNESS_DOWN */ + SDL_SCANCODE_BRIGHTNESSUP, /* AKEYCODE_BRIGHTNESS_UP */ +}; + +static SDL_Scancode +TranslateKeycode(int keycode) +{ + SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; + + if (keycode < SDL_arraysize(Android_Keycodes)) { + scancode = Android_Keycodes[keycode]; + } + if (scancode == SDL_SCANCODE_UNKNOWN) { + __android_log_print(ANDROID_LOG_INFO, "SDL", "Unknown keycode %d", keycode); + } + return scancode; +} + +int +Android_OnKeyDown(int keycode) +{ + return SDL_SendKeyboardKey(SDL_PRESSED, TranslateKeycode(keycode)); +} + +int +Android_OnKeyUp(int keycode) +{ + return SDL_SendKeyboardKey(SDL_RELEASED, TranslateKeycode(keycode)); +} + +SDL_bool +Android_HasScreenKeyboardSupport(_THIS) +{ + return SDL_TRUE; +} + +SDL_bool +Android_IsScreenKeyboardShown(_THIS, SDL_Window * window) +{ + return SDL_IsTextInputActive(); +} + +void +Android_StartTextInput(_THIS) +{ + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + Android_JNI_ShowTextInput(&videodata->textRect); +} + +void +Android_StopTextInput(_THIS) +{ + Android_JNI_HideTextInput(); +} + +void +Android_SetTextInputRect(_THIS, SDL_Rect *rect) +{ + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + + if (!rect) { + SDL_InvalidParamError("rect"); + return; + } + + videodata->textRect = *rect; +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidkeyboard.h b/src/video/android/SDL_androidkeyboard.h new file mode 100644 index 0000000000..da8da9b750 --- /dev/null +++ b/src/video/android/SDL_androidkeyboard.h @@ -0,0 +1,36 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_androidvideo.h" + +extern void Android_InitKeyboard(void); +extern int Android_OnKeyDown(int keycode); +extern int Android_OnKeyUp(int keycode); + +extern SDL_bool Android_HasScreenKeyboardSupport(_THIS); +extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window * window); + +extern void Android_StartTextInput(_THIS); +extern void Android_StopTextInput(_THIS); +extern void Android_SetTextInputRect(_THIS, SDL_Rect *rect); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidtouch.c b/src/video/android/SDL_androidtouch.c new file mode 100644 index 0000000000..3265b54eb0 --- /dev/null +++ b/src/video/android/SDL_androidtouch.c @@ -0,0 +1,113 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +#include + +#include "SDL_events.h" +#include "../../events/SDL_mouse_c.h" +#include "../../events/SDL_touch_c.h" +#include "SDL_log.h" + +#include "SDL_androidtouch.h" + + +#define ACTION_DOWN 0 +#define ACTION_UP 1 +#define ACTION_MOVE 2 +#define ACTION_CANCEL 3 +#define ACTION_OUTSIDE 4 +/* The following two are deprecated but it seems they are still emitted (instead the corresponding ACTION_UP/DOWN) as of Android 3.2 */ +#define ACTION_POINTER_1_DOWN 5 +#define ACTION_POINTER_1_UP 6 + +static SDL_FingerID leftFingerDown = 0; + +static void Android_GetWindowCoordinates(float x, float y, + int *window_x, int *window_y) +{ + int window_w, window_h; + + SDL_GetWindowSize(Android_Window, &window_w, &window_h); + *window_x = (int)(x * window_w); + *window_y = (int)(y * window_h); +} + +void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p) +{ + SDL_TouchID touchDeviceId = 0; + SDL_FingerID fingerId = 0; + int window_x, window_y; + + if (!Android_Window) { + return; + } + + touchDeviceId = (SDL_TouchID)touch_device_id_in; + if (SDL_AddTouch(touchDeviceId, "") < 0) { + SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__); + } + + fingerId = (SDL_FingerID)pointer_finger_id_in; + switch (action) { + case ACTION_DOWN: + case ACTION_POINTER_1_DOWN: + if (!leftFingerDown) { + Android_GetWindowCoordinates(x, y, &window_x, &window_y); + + /* send moved event */ + SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, window_x, window_y); + + /* send mouse down event */ + SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); + + leftFingerDown = fingerId; + } + SDL_SendTouch(touchDeviceId, fingerId, SDL_TRUE, x, y, p); + break; + case ACTION_MOVE: + if (!leftFingerDown) { + Android_GetWindowCoordinates(x, y, &window_x, &window_y); + + /* send moved event */ + SDL_SendMouseMotion(NULL, SDL_TOUCH_MOUSEID, 0, window_x, window_y); + } + SDL_SendTouchMotion(touchDeviceId, fingerId, x, y, p); + break; + case ACTION_UP: + case ACTION_POINTER_1_UP: + if (fingerId == leftFingerDown) { + /* send mouse up */ + SDL_SendMouseButton(NULL, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT); + leftFingerDown = 0; + } + SDL_SendTouch(touchDeviceId, fingerId, SDL_FALSE, x, y, p); + break; + default: + break; + } +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidtouch.h b/src/video/android/SDL_androidtouch.h new file mode 100644 index 0000000000..50a3ebdc8a --- /dev/null +++ b/src/video/android/SDL_androidtouch.h @@ -0,0 +1,27 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#include "SDL_androidvideo.h" + +extern void Android_OnTouch( int touch_device_id_in, int pointer_finger_id_in, int action, float x, float y, float p); + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidvideo.c b/src/video/android/SDL_androidvideo.c new file mode 100644 index 0000000000..6dcb81e70c --- /dev/null +++ b/src/video/android/SDL_androidvideo.c @@ -0,0 +1,192 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +/* Android SDL video driver implementation +*/ + +#include "SDL_video.h" +#include "SDL_mouse.h" +#include "../SDL_sysvideo.h" +#include "../SDL_pixels_c.h" +#include "../../events/SDL_events_c.h" +#include "../../events/SDL_windowevents_c.h" + +#include "SDL_androidvideo.h" +#include "SDL_androidclipboard.h" +#include "SDL_androidevents.h" +#include "SDL_androidkeyboard.h" +#include "SDL_androidwindow.h" + +#define ANDROID_VID_DRIVER_NAME "Android" + +/* Initialization/Query functions */ +static int Android_VideoInit(_THIS); +static void Android_VideoQuit(_THIS); + +/* GL functions (SDL_androidgl.c) */ +extern int Android_GL_LoadLibrary(_THIS, const char *path); +extern void *Android_GL_GetProcAddress(_THIS, const char *proc); +extern void Android_GL_UnloadLibrary(_THIS); +extern SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window); +extern int Android_GL_MakeCurrent(_THIS, SDL_Window * window, + SDL_GLContext context); +extern int Android_GL_SetSwapInterval(_THIS, int interval); +extern int Android_GL_GetSwapInterval(_THIS); +extern void Android_GL_SwapWindow(_THIS, SDL_Window * window); +extern void Android_GL_DeleteContext(_THIS, SDL_GLContext context); + +/* Android driver bootstrap functions */ + + +/* These are filled in with real values in Android_SetScreenResolution on init (before SDL_main()) */ +int Android_ScreenWidth = 0; +int Android_ScreenHeight = 0; +Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN; +SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL; + +/* Currently only one window */ +SDL_Window *Android_Window = NULL; + +static int +Android_Available(void) +{ + return 1; +} + +static void +Android_DeleteDevice(SDL_VideoDevice * device) +{ + SDL_free(device); +} + +static SDL_VideoDevice * +Android_CreateDevice(int devindex) +{ + SDL_VideoDevice *device; + SDL_VideoData *data; + + /* Initialize all variables that we clean on shutdown */ + device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + if (!device) { + SDL_OutOfMemory(); + return NULL; + } + + data = (SDL_VideoData*) SDL_calloc(1, sizeof(SDL_VideoData)); + if (!data) { + SDL_OutOfMemory(); + SDL_free(device); + return NULL; + } + + device->driverdata = data; + + /* Set the function pointers */ + device->VideoInit = Android_VideoInit; + device->VideoQuit = Android_VideoQuit; + device->PumpEvents = Android_PumpEvents; + + device->CreateWindow = Android_CreateWindow; + device->SetWindowTitle = Android_SetWindowTitle; + device->DestroyWindow = Android_DestroyWindow; + + device->free = Android_DeleteDevice; + + /* GL pointers */ + device->GL_LoadLibrary = Android_GL_LoadLibrary; + device->GL_GetProcAddress = Android_GL_GetProcAddress; + device->GL_UnloadLibrary = Android_GL_UnloadLibrary; + device->GL_CreateContext = Android_GL_CreateContext; + device->GL_MakeCurrent = Android_GL_MakeCurrent; + device->GL_SetSwapInterval = Android_GL_SetSwapInterval; + device->GL_GetSwapInterval = Android_GL_GetSwapInterval; + device->GL_SwapWindow = Android_GL_SwapWindow; + device->GL_DeleteContext = Android_GL_DeleteContext; + + /* Text input */ + device->StartTextInput = Android_StartTextInput; + device->StopTextInput = Android_StopTextInput; + device->SetTextInputRect = Android_SetTextInputRect; + + /* Screen keyboard */ + device->HasScreenKeyboardSupport = Android_HasScreenKeyboardSupport; + device->IsScreenKeyboardShown = Android_IsScreenKeyboardShown; + + /* Clipboard */ + device->SetClipboardText = Android_SetClipboardText; + device->GetClipboardText = Android_GetClipboardText; + device->HasClipboardText = Android_HasClipboardText; + + return device; +} + +VideoBootStrap Android_bootstrap = { + ANDROID_VID_DRIVER_NAME, "SDL Android video driver", + Android_Available, Android_CreateDevice +}; + + +int +Android_VideoInit(_THIS) +{ + SDL_DisplayMode mode; + + mode.format = Android_ScreenFormat; + mode.w = Android_ScreenWidth; + mode.h = Android_ScreenHeight; + mode.refresh_rate = 0; + mode.driverdata = NULL; + if (SDL_AddBasicVideoDisplay(&mode) < 0) { + return -1; + } + + SDL_AddDisplayMode(&_this->displays[0], &mode); + + Android_InitKeyboard(); + + /* We're done! */ + return 0; +} + +void +Android_VideoQuit(_THIS) +{ +} + +/* This function gets called before VideoInit() */ +void +Android_SetScreenResolution(int width, int height, Uint32 format) +{ + Android_ScreenWidth = width; + Android_ScreenHeight = height; + Android_ScreenFormat = format; + + if (Android_Window) { + SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height); + } +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidvideo.h b/src/video/android/SDL_androidvideo.h new file mode 100644 index 0000000000..3f509ab222 --- /dev/null +++ b/src/video/android/SDL_androidvideo.h @@ -0,0 +1,49 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_androidvideo_h +#define _SDL_androidvideo_h + +#include "SDL_mutex.h" +#include "SDL_rect.h" +#include "../SDL_sysvideo.h" + +/* Called by the JNI layer when the screen changes size or format */ +extern void Android_SetScreenResolution(int width, int height, Uint32 format); + +/* Private display data */ + +typedef struct SDL_VideoData +{ + SDL_Rect textRect; +} SDL_VideoData; + +extern int Android_ScreenWidth; +extern int Android_ScreenHeight; +extern Uint32 Android_ScreenFormat; +extern SDL_sem *Android_PauseSem, *Android_ResumeSem; +extern SDL_Window *Android_Window; + + +#endif /* _SDL_androidvideo_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c new file mode 100644 index 0000000000..70e244e1a7 --- /dev/null +++ b/src/video/android/SDL_androidwindow.c @@ -0,0 +1,83 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#if SDL_VIDEO_DRIVER_ANDROID + +#include "../SDL_sysvideo.h" +#include "../../events/SDL_keyboard_c.h" +#include "../../events/SDL_mouse_c.h" + +#include "SDL_androidvideo.h" +#include "SDL_androidwindow.h" + +#include "../../core/android/SDL_android.h" + +int +Android_CreateWindow(_THIS, SDL_Window * window) +{ + if (Android_Window) { + return SDL_SetError("Android only supports one window"); + } + Android_Window = window; + Android_PauseSem = SDL_CreateSemaphore(0); + Android_ResumeSem = SDL_CreateSemaphore(0); + + /* Adjust the window data to match the screen */ + window->x = 0; + window->y = 0; + window->w = Android_ScreenWidth; + window->h = Android_ScreenHeight; + + window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizeable */ + window->flags |= SDL_WINDOW_FULLSCREEN; /* window is always fullscreen */ + window->flags &= ~SDL_WINDOW_HIDDEN; + window->flags |= SDL_WINDOW_SHOWN; /* only one window on Android */ + window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ + + /* One window, it always has focus */ + SDL_SetMouseFocus(window); + SDL_SetKeyboardFocus(window); + + return 0; +} + +void +Android_SetWindowTitle(_THIS, SDL_Window * window) +{ + Android_JNI_SetActivityTitle(window->title); +} + +void +Android_DestroyWindow(_THIS, SDL_Window * window) +{ + if (window == Android_Window) { + Android_Window = NULL; + if (Android_PauseSem) SDL_DestroySemaphore(Android_PauseSem); + if (Android_ResumeSem) SDL_DestroySemaphore(Android_ResumeSem); + Android_PauseSem = NULL; + Android_ResumeSem = NULL; + } +} + +#endif /* SDL_VIDEO_DRIVER_ANDROID */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidwindow.h b/src/video/android/SDL_androidwindow.h new file mode 100644 index 0000000000..c0ef93bb0a --- /dev/null +++ b/src/video/android/SDL_androidwindow.h @@ -0,0 +1,32 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_config.h" + +#ifndef _SDL_androidwindow_h +#define _SDL_androidwindow_h + +extern int Android_CreateWindow(_THIS, SDL_Window * window); +extern void Android_SetWindowTitle(_THIS, SDL_Window * window); +extern void Android_DestroyWindow(_THIS, SDL_Window * window); + +#endif /* _SDL_androidwindow_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/ataricommon/SDL_ataric2p.S b/src/video/ataricommon/SDL_ataric2p.S deleted file mode 100644 index 3cd1961b85..0000000000 --- a/src/video/ataricommon/SDL_ataric2p.S +++ /dev/null @@ -1,452 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ - -/* - Chunky to planar conversion routine - 1 byte/pixel -> 4 or 8 bit planes - - Patrice Mandin - Xavier Joubert - Mikael Kalms -*/ - - .globl _SDL_Atari_C2pConvert - .globl _SDL_Atari_C2pConvert8 - .globl _SDL_Atari_C2pConvert4 - .globl _SDL_Atari_C2pConvert4_pal - -/* ------------ Conversion C2P, 8 bits ------------ */ - - .text -_SDL_Atari_C2pConvert8: -#if !defined(__mcoldfire__) - movel sp@(4),c2p_source - movel sp@(8),c2p_dest - movel sp@(12),c2p_width - movel sp@(16),c2p_height - movel sp@(20),c2p_dblligne - movel sp@(24),c2p_srcpitch - movel sp@(28),c2p_dstpitch - - moveml d2-d7/a2-a6,sp@- - - movel c2p_source,c2p_cursrc - movel c2p_dest,c2p_curdst - movel #0x0f0f0f0f,d4 - movel #0x00ff00ff,d5 - movel #0x55555555,d6 - movew c2p_height+2,c2p_row - movew c2p_width+2,d0 - andw #-8,d0 - movew d0,c2p_rowlen - -SDL_Atari_C2p8_rowloop: - - movel c2p_cursrc,a0 - movel c2p_curdst,a1 - - movel a0,a2 - addw c2p_rowlen,a2 - - movel a0@+,d0 - movel a0@+,d1 - movel a0@+,d2 - movel a0@+,d3 -/* - d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0 - d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0 - d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0 - d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0 -*/ - movel d1,d7 - lsrl #4,d7 - eorl d0,d7 - andl d4,d7 - eorl d7,d0 - lsll #4,d7 - eorl d7,d1 - - movel d3,d7 - lsrl #4,d7 - eorl d2,d7 - andl d4,d7 - eorl d7,d2 - lsll #4,d7 - eorl d7,d3 - - movel d2,d7 - lsrl #8,d7 - eorl d0,d7 - andl d5,d7 - eorl d7,d0 - lsll #8,d7 - eorl d7,d2 - - movel d3,d7 - lsrl #8,d7 - eorl d1,d7 - andl d5,d7 - eorl d7,d1 - lsll #8,d7 - eorl d7,d3 -/* - d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4 - d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0 - d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4 - d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0 -*/ - bras SDL_Atari_C2p8_start - -SDL_Atari_C2p8_pix16: - - movel a0@+,d0 - movel a0@+,d1 - movel a0@+,d2 - movel a0@+,d3 -/* - d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0 - d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0 - d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0 - d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0 -*/ - movel d1,d7 - lsrl #4,d7 - movel a3,a1@+ - eorl d0,d7 - andl d4,d7 - eorl d7,d0 - lsll #4,d7 - eorl d7,d1 - - movel d3,d7 - lsrl #4,d7 - eorl d2,d7 - andl d4,d7 - eorl d7,d2 - movel a4,a1@+ - lsll #4,d7 - eorl d7,d3 - - movel d2,d7 - lsrl #8,d7 - eorl d0,d7 - andl d5,d7 - eorl d7,d0 - movel a5,a1@+ - lsll #8,d7 - eorl d7,d2 - - movel d3,d7 - lsrl #8,d7 - eorl d1,d7 - andl d5,d7 - eorl d7,d1 - movel a6,a1@+ - lsll #8,d7 - eorl d7,d3 -/* - d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4 - d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0 - d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4 - d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0 -*/ - -SDL_Atari_C2p8_start: - - movel d2,d7 - lsrl #1,d7 - eorl d0,d7 - andl d6,d7 - eorl d7,d0 - addl d7,d7 - eorl d7,d2 - - movel d3,d7 - lsrl #1,d7 - eorl d1,d7 - andl d6,d7 - eorl d7,d1 - addl d7,d7 - eorl d7,d3 -/* - d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5 - d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 - d2 = a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4 - d3 = a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0 -*/ - movew d2,d7 - movew d0,d2 - swap d2 - movew d2,d0 - movew d7,d2 - - movew d3,d7 - movew d1,d3 - swap d3 - movew d3,d1 - movew d7,d3 -/* - d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4 - d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0 - d2 = c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4 - d3 = c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0 -*/ - movel d2,d7 - lsrl #2,d7 - eorl d0,d7 - andl #0x33333333,d7 - eorl d7,d0 - lsll #2,d7 - eorl d7,d2 - - movel d3,d7 - lsrl #2,d7 - eorl d1,d7 - andl #0x33333333,d7 - eorl d7,d1 - lsll #2,d7 - eorl d7,d3 -/* - d0 = a7b7c7d7e7f7g7h7 i7j7k7l7m7n7o7p7 a6b6c6d6e6f6g6h6 i6j6k6l6m6n6o6p6 - d1 = a3b3c3d3e3f3g3h3 i3j3k3l3m3n3o3p3 a2b2c2d2e2f2g2h2 i2j2k2l2m2n2o2p2 - d2 = a5b5c5d5e5f5g5h5 i5j5k5l5m5n5o5p5 a4b4c4d4e4f4g4h4 i4j4k4l4m4n4o4p4 - d3 = a1b1c1d1e1f1g1h1 i1j1k1l1m1n1o1p1 a0b0c0d0e0f0g0h0 i0j0k0l0m0n0o0p0 -*/ - swap d0 - swap d1 - swap d2 - swap d3 - - movel d0,a6 - movel d2,a5 - movel d1,a4 - movel d3,a3 - - cmpl a0,a2 - bgt SDL_Atari_C2p8_pix16 - - movel a3,a1@+ - movel a4,a1@+ - movel a5,a1@+ - movel a6,a1@+ - - /* Double the line ? */ - - movel c2p_srcpitch,d0 - movel c2p_dstpitch,d1 - - tstl c2p_dblligne - beqs SDL_Atari_C2p8_nodblline - - movel c2p_curdst,a0 - movel a0,a1 - addl d1,a1 - - movew c2p_width+2,d7 - lsrw #4,d7 - subql #1,d7 -SDL_Atari_C2p8_dblloop: - movel a0@+,a1@+ - movel a0@+,a1@+ - movel a0@+,a1@+ - movel a0@+,a1@+ - dbra d7,SDL_Atari_C2p8_dblloop - - addl d1,c2p_curdst - -SDL_Atari_C2p8_nodblline: - - /* Next line */ - - addl d0,c2p_cursrc - addl d1,c2p_curdst - - subqw #1,c2p_row - bne SDL_Atari_C2p8_rowloop - - moveml sp@+,d2-d7/a2-a6 -#endif - rts - -/* ------------ Conversion C2P, 4 bits ------------ */ - -_SDL_Atari_C2pConvert4: -#if !defined(__mcoldfire__) - movel sp@(4),c2p_source - movel sp@(8),c2p_dest - movel sp@(12),c2p_width - movel sp@(16),c2p_height - movel sp@(20),c2p_dblligne - movel sp@(24),c2p_srcpitch - movel sp@(28),c2p_dstpitch - - moveml d2-d7/a2-a6,sp@- - - movel c2p_source,a0 - movel c2p_dest,a1 - lea _SDL_Atari_table_c2p,a2 - movel #0x00070001,d3 -#if defined(__mc68020__) - moveq #0,d0 -#endif - - movel c2p_height,d7 - subql #1,d7 -c2p4_bcly: - movel a0,a4 | Save start address of source - movel a1,a5 | Save start address of dest - - | Conversion - - movel c2p_width,d6 - lsrw #4,d6 - subql #1,d6 -c2p4_bclx: - | Octets 0-7 - - moveq #0,d1 - moveq #7,d5 -c2p4_bcl07: -#if defined(__mc68020__) - moveb a0@+,d0 - lea a2@(0,d0:w:4),a3 -#else - moveq #0,d0 - moveb a0@+,d0 - lslw #2,d0 - lea a2@(0,d0:w),a3 -#endif - lsll #1,d1 - orl a3@,d1 - dbra d5,c2p4_bcl07 - - movepl d1,a1@(0) - addw d3,a1 - swap d3 - - | Octets 8-15 - - moveq #0,d1 - moveq #7,d5 -c2p4_bcl815: -#if defined(__mc68020__) - moveb a0@+,d0 - lea a2@(0,d0:w:4),a3 -#else - moveq #0,d0 - moveb a0@+,d0 - lslw #2,d0 - lea a2@(0,d0:w),a3 -#endif - lsll #1,d1 - orl a3@,d1 - dbra d5,c2p4_bcl815 - - movepl d1,a1@(0) - addw d3,a1 - swap d3 - - dbra d6,c2p4_bclx - - | Double line ? - - tstl c2p_dblligne - beqs c2p4_nodblligne - - movel a5,a6 | src line - movel a5,a1 | dest line - addl c2p_dstpitch,a1 - - movel c2p_width,d6 - lsrw #3,d6 - subql #1,d6 -c2p4_copydbl: - movel a6@+,a1@+ - dbra d6,c2p4_copydbl - - addl c2p_dstpitch,a5 -c2p4_nodblligne: - - | Next line - - movel a4,a0 - addl c2p_srcpitch,a0 - movel a5,a1 - addl c2p_dstpitch,a1 - - dbra d7,c2p4_bcly - - moveml sp@+,d2-d7/a2-a6 -#endif - rts - -/* ------------ Conversion of a light palette in 4 bits ------------ */ - -_SDL_Atari_C2pConvert4_pal: -#if !defined(__mcoldfire__) - /* a0 is a 256-word light palette */ - movel sp@(4),a0 - - moveml d2-d3,sp@- - - lea _SDL_Atari_table_c2p,a1 - movew #255,d3 -c2p_pal_initbcl: - movew a0@+,d0 - lsrw #4,d0 - andw #15,d0 - - moveq #3,d1 -c2p_pal_initbyte: - btst d1,d0 - sne d2 - negw d2 - moveb d2,a1@(0,d1:w) - - dbra d1,c2p_pal_initbyte - - addql #4,a1 - dbra d3,c2p_pal_initbcl - - moveml sp@+,d2-d3 -#endif - rts - -/* ------------ Buffers ------------ */ - - .bss - - .even - .comm _SDL_Atari_C2pConvert,4 - .comm _SDL_Atari_table_c2p,1024 - - .comm c2p_source,4 /* Source framebuffer */ - .comm c2p_dest,4 /* Destination framebuffer */ - .comm c2p_width,4 /* Width of zone to convert */ - .comm c2p_height,4 /* Height of zone to convert */ - .comm c2p_dblligne,4 /* Double the lines while converting ? */ - .comm c2p_srcpitch,4 /* Source pitch */ - .comm c2p_dstpitch,4 /* Destination pitch */ - .comm c2p_cursrc,4 /* Current source line */ - .comm c2p_curdst,4 /* Current destination line */ - .comm c2p_rowlen,2 /* Line length in bytes */ - .comm c2p_row,2 /* Current line number */ diff --git a/src/video/ataricommon/SDL_ataric2p_s.h b/src/video/ataricommon/SDL_ataric2p_s.h deleted file mode 100644 index 48bdae7242..0000000000 --- a/src/video/ataricommon/SDL_ataric2p_s.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -#ifndef _ATARI_C2P_h -#define _ATARI_C2P_h - -#include "SDL_stdinc.h" - -/*--- Functions pointers ---*/ - -/* Convert a chunky screen to bitplane screen */ - -extern void (*SDL_Atari_C2pConvert)( - Uint8 *src, /* Source screen (one byte=one pixel) */ - Uint8 *dest, /* Destination (4/8 bits planes) */ - Uint32 width, /* Dimensions of screen to convert */ - Uint32 height, - Uint32 dblligne, /* Double the lines when converting ? */ - Uint32 srcpitch, /* Length of one source line in bytes */ - Uint32 dstpitch /* Length of one destination line in bytes */ -); - -/*--- 8 bits functions ---*/ - -/* Convert a chunky screen to bitplane screen */ - -void SDL_Atari_C2pConvert8( - Uint8 *src, /* Source screen (one byte=one pixel) */ - Uint8 *dest, /* Destination (8 bits planes) */ - Uint32 width, /* Dimensions of screen to convert */ - Uint32 height, - Uint32 dblligne, /* Double the lines when converting ? */ - Uint32 srcpitch, /* Length of one source line in bytes */ - Uint32 dstpitch /* Length of one destination line in bytes */ -); - -/*--- 4 bits functions ---*/ - -/* Convert a chunky screen to bitplane screen */ - -void SDL_Atari_C2pConvert4( - Uint8 *src, /* Source screen (one byte=one pixel) */ - Uint8 *dest, /* Destination (4 bits planes) */ - Uint32 width, /* Dimensions of screen to convert */ - Uint32 height, - Uint32 dblligne, /* Double the lines when converting ? */ - Uint32 srcpitch, /* Length of one source line in bytes */ - Uint32 dstpitch /* Length of one destination line in bytes */ -); - -/* Conversion palette */ - -void SDL_Atari_C2pConvert4_pal(Uint16 *lightpalette); - -#endif /* _ATARI_C2P_h */ diff --git a/src/video/ataricommon/SDL_ataridevmouse.c b/src/video/ataricommon/SDL_ataridevmouse.c deleted file mode 100644 index 0527380bad..0000000000 --- a/src/video/ataricommon/SDL_ataridevmouse.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2012 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org -*/ -#include "SDL_config.h" - -/* - MiNT /dev/mouse driver - - Patrice Mandin -*/ - -#include -#include - -#include "../../events/SDL_events_c.h" -#include "SDL_ataridevmouse_c.h" - -/* Defines */ - -#define DEVICE_NAME "/dev/mouse" - -/* Local variables */ - -static int handle = -1; -static int mouseb, prev_mouseb; - -/* Functions */ - -int SDL_AtariDevMouse_Open(void) -{ - int r; - const char *mousedev; - - /* - TODO: Fix the MiNT device driver, that locks mouse for other - applications, so this is disabled till fixed - */ - return 0; - - /* First, try SDL_MOUSEDEV device */ - mousedev = SDL_getenv("SDL_MOUSEDEV"); - if (!mousedev) { - handle = open(mousedev, 0); - } - - /* Failed, try default device */ - if (handle<0) { - handle = open(DEVICE_NAME, 0); - } - - if (handle<0) { - handle = -1; - return 0; - } - - /* Set non blocking mode */ - r = fcntl(handle, F_GETFL, 0); - if (r<0) { - close(handle); - handle = -1; - return 0; - } - - r |= O_NDELAY; - - r = fcntl(handle, F_SETFL, r); - if (r<0) { - close(handle); - handle = -1; - return 0; - } - - prev_mouseb = 7; - return 1; -} - -void SDL_AtariDevMouse_Close(void) -{ - if (handle>0) { - close(handle); - handle = -1; - } -} - -static int atari_GetButton(int button) -{ - switch(button) - { - case 0: - return SDL_BUTTON_RIGHT; - case 1: - return SDL_BUTTON_MIDDLE; - default: - break; - } - - return SDL_BUTTON_LEFT; -} - -void SDL_AtariDevMouse_PostMouseEvents(_THIS, SDL_bool buttonEvents) -{ - unsigned char buffer[3]; - int mousex, mousey; - - if (handle<0) { - return; - } - - mousex = mousey = 0; - while (read(handle, buffer, sizeof(buffer))==sizeof(buffer)) { - mouseb = buffer[0] & 7; - mousex += (char) buffer[1]; - mousey += (char) buffer[2]; - - /* Mouse button events */ - if (buttonEvents && (mouseb != prev_mouseb)) { - int i; - - for (i=0;i<3;i++) { - int curbutton, prevbutton; - - curbutton = mouseb & (1<